mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			37 lines
		
	
	
		
			768 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			768 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/**
 | 
						|
 * Copyright (c) HashiCorp, Inc.
 | 
						|
 * SPDX-License-Identifier: BUSL-1.1
 | 
						|
 */
 | 
						|
 | 
						|
import Component from '@ember/component';
 | 
						|
import keys from 'core/utils/key-codes';
 | 
						|
 | 
						|
export default Component.extend({
 | 
						|
  onExecuteCommand() {},
 | 
						|
  onFullscreen() {},
 | 
						|
  onValueUpdate() {},
 | 
						|
  onShiftCommand() {},
 | 
						|
  value: null,
 | 
						|
  isFullscreen: null,
 | 
						|
 | 
						|
  actions: {
 | 
						|
    handleKeyUp(event) {
 | 
						|
      const keyCode = event.keyCode;
 | 
						|
      switch (keyCode) {
 | 
						|
        case keys.ENTER:
 | 
						|
          this.onExecuteCommand(event.target.value);
 | 
						|
          break;
 | 
						|
        case keys.UP:
 | 
						|
        case keys.DOWN:
 | 
						|
          this.onShiftCommand(keyCode);
 | 
						|
          break;
 | 
						|
        default:
 | 
						|
          this.onValueUpdate(event.target.value);
 | 
						|
      }
 | 
						|
    },
 | 
						|
    fullscreen() {
 | 
						|
      this.onFullscreen();
 | 
						|
    },
 | 
						|
  },
 | 
						|
});
 |