open-vault/ui/app/components/hover-copy-button.js
Angel Garbarino 999503c0b5
Glimmer continued (#15786)
* generated item list

* home link glimmerization

* hover copy button

* clean up

* clean up

* copy change
2022-06-03 18:34:42 -06:00

25 lines
659 B
JavaScript

import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
/**
* @module HoverCopyButton
* The `HoverCopyButton` is used on dark backgrounds to show a copy button.
*
* @example ```js
* <HoverCopyButton @copyValue={{stringify this.model.id}} @alwaysShow={{true}} />```
*
* @param {string} copyValue - The value to be copied.
* @param {boolean} [alwaysShow] - Boolean that affects the class.
*/
export default class HoverCopyButton extends Component {
get alwaysShow() {
return this.args.alwaysShow || false;
}
get copyValue() {
return this.args.copyValue || false;
}
@tracked tooltipText = 'Copy';
}