open-vault/ui/app/components/tool-random.js
Angel Garbarino cf511a895b
UI/tools partial (#11672)
* hash tools from partial to component

* initial setup of tools random, but issue remaining with bytes

* rewrap

* unwrap

* final two partials

* fix issues with actions on tool wrap

* fix hash

* changelog

* address pr comments

* fix onClear

* trigger run

* triggering test suite
2021-05-24 10:45:35 -06:00

30 lines
999 B
JavaScript

import Component from '@glimmer/component';
import { action } from '@ember/object';
/**
* @module ToolRandom
* ToolRandom components are components that sys/wrapping/random functionality. Most of the functionality is passed through as actions from the tool-actions-form and then called back with properties.
*
* @example
* ```js
* <ToolRandom
* @onClear={{action "onClear"}}
* @format={{format}}
* @bytes={{bytes}}
* @random_bytes={{random_bytes}}
* @errors={{errors}}/>
* ```
* @param onClear {Function} - parent action that is passed through. Must be passed as {{action "onClear"}}
* @param format {String} - property returned from parent.
* @param bytes {String} - property returned from parent.
* @param random_bytes {String} - property returned from parent.
* @param error=null {Object} - errors passed from parent as default then from child back to parent.
*/
export default class ToolRandom extends Component {
@action
onClear() {
this.args.onClear();
}
}