Files
vault/ui/lib/core/addon/components/enable-input.hbs
claire bontempo 416d8bde5d UI: Create enable input component (#24427)
* enable input component

* add more stars

* update css comments

* Update ui/app/styles/helper-classes/flexbox-and-grid.scss

* make attrOptions optional

* add subtext to textfile

* add docLink arg to form field textfile

* update form field test

* add test

* add comment

* update jsdoc

* remove unused class

* Update ui/tests/integration/components/enable-input-test.js

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>

---------

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2023-12-07 15:25:55 -08:00

27 lines
625 B
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
{{#if this.enable}}
{{yield}}
{{else}}
<div class="flex" ...attributes>
<div class="is-flex-grow-1">
{{#if @attr}}
<ReadonlyFormField @attr={{@attr}} @value="**********" />
{{else}}
<Input disabled class="input" @type="text" @value="**********" />
{{/if}}
</div>
<div class="align-self-end">
<Hds::Button
@text="Enable input"
@icon="edit"
@isIconOnly={{true}}
@color="tertiary"
{{on "click" (fn (mut this.enable))}}
/>
</div>
</div>
{{/if}}