mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
feat(form): add reset functionality (#799)
* feat(form): add reset functionality * feat(interal): add defaultValue decorator * feat: add defaultValue and defaultChecked * chore: implement unit tests * chore: remove leftover
This commit is contained in:
@@ -3,6 +3,7 @@ import { customElement, property, query, state } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
import { live } from 'lit/directives/live.js';
|
||||
import { defaultValue } from '../../internal/default-value';
|
||||
import '../../components/icon/icon';
|
||||
import { emit } from '../../internal/event';
|
||||
import { FormSubmitController } from '../../internal/form';
|
||||
@@ -77,6 +78,10 @@ export default class SlInput extends LitElement {
|
||||
/** The input's value attribute. */
|
||||
@property() value = '';
|
||||
|
||||
/** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
|
||||
@defaultValue()
|
||||
defaultValue = '';
|
||||
|
||||
/** Draws a filled input. */
|
||||
@property({ type: Boolean, reflect: true }) filled = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user