import { storiesOf, html, action } from '@open-wc/storybook'; import '../lion-form.js'; import '@lion/fieldset/lion-fieldset.js'; import '@lion/input-iban/lion-input-iban.js'; import '@lion/textarea/lion-textarea.js'; import { maxLengthValidator } from '@lion/validate'; storiesOf('Forms|', module) .add( 'Basic form result', () => html` action('serializeGroup')(document.querySelector('#form').serializeGroup())} > Log to Action Logger `, ) .add('Form Submit/Reset', () => { const submit = () => { const form = document.querySelector('#form'); if (form.errorState === false) { action('serializeGroup')(form.serializeGroup()); } }; return html` Submit document.querySelector('#form').resetGroup()}> Reset A reset button should never be offered to users. This button is only used here to demonstrate the functionality. `; });
A reset button should never be offered to users. This button is only used here to demonstrate the functionality.