open-vault/ui/stories/masked-input.md
Matthew Irish 8152e0a74c
UI - masked input onchange (#6586)
* update masked-input to work with form-field component

* add test for masked input onChange functionality

* fix doc changes
2019-04-15 17:53:44 -05:00

32 lines
1.4 KiB
Markdown

<!--THIS FILE IS AUTO GENERATED. This file is generated from JSDoc comments in app/components/masked-input.js. To make changes, first edit that file and run "yarn gen-story-md masked-input" to re-generate the content.-->
## MaskedInput
`MaskedInput` components are textarea inputs where the input is hidden. They are used to enter sensitive information like passwords.
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [value] | <code>String</code> | | The value to display in the input. |
| [placeholder] | <code>String</code> | <code>value</code> | The placeholder to display before the user has entered any input. |
| [allowCopy] | <code>bool</code> | <code></code> | Whether or not the input should render with a copy button. |
| [displayOnly] | <code>bool</code> | <code>false</code> | Whether or not to display the value as a display only `pre` element or as an input. |
| [onChange] | <code>function</code> \| <code>action</code> | <code>Function.prototype</code> | A function to call when the value of the input changes. |
**Example**
```js
<MaskedInput
@value={{attr.options.defaultValue}}
@placeholder="secret"
@allowCopy={{true}}
@onChange={{action "someAction"}}
/>
```
**See**
- [Uses of MaskedInput](https://github.com/hashicorp/vault/search?l=Handlebars&q=MaskedInput)
- [MaskedInput Source Code](https://github.com/hashicorp/vault/blob/master/ui/app/components/masked-input.js)
---