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:
Alessandro
2022-06-28 23:59:52 +02:00
committed by GitHub
parent 0d19c46d18
commit b2cf3a5505
22 changed files with 468 additions and 16 deletions

View File

@@ -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;