lion/packages/input-amount/stories/index.stories.js
Thomas Allmer ec8da8f12c feat: release inital public lion version
Co-authored-by: Mikhail Bashkirov <mikhail.bashkirov@ing.com>
Co-authored-by: Thijs Louisse <thijs.louisse@ing.com>
Co-authored-by: Joren Broekema <joren.broekema@ing.com>
Co-authored-by: Gerjan van Geest <gerjan.van.geest@ing.com>
Co-authored-by: Erik Kroes <erik.kroes@ing.com>
Co-authored-by: Lars den Bakker <lars.den.bakker@ing.com>
2019-04-26 10:37:57 +02:00

59 lines
1.3 KiB
JavaScript

import { storiesOf, html } from '@open-wc/storybook';
import '../lion-input-amount.js';
storiesOf('Forms|<lion-input-amount>', module)
.add(
'Default',
() => html`
<lion-input-amount .errorValidators="${['required']}" label="Amount" .modelValue=${123456.78}>
</lion-input-amount>
`,
)
.add(
'Set USD as currency',
() => html`
<lion-input-amount label="Price" currency="USD" .modelValue=${123456.78}> </lion-input-amount>
`,
)
.add(
'Set JOD as currency',
() => html`
<lion-input-amount label="Price" currency="JOD" .modelValue=${123456.78}> </lion-input-amount>
`,
)
.add(
'Force locale to nl-NL',
() => html`
<lion-input-amount
.formatOptions="${{ locale: 'nl-NL' }}"
label="Price"
.modelValue=${123456.78}
currency="JOD"
>
</lion-input-amount>
`,
)
.add(
'Force locale to en-US',
() => html`
<lion-input-amount
.formatOptions="${{ locale: 'en-US' }}"
label="Price"
.modelValue=${123456.78}
currency="YEN"
>
</lion-input-amount>
`,
)
.add(
'Faulty prefilled',
() => html`
<lion-input-amount
label="Amount"
help-text="Faulty prefilled input will be cleared"
.modelValue=${'foo'}
>
</lion-input-amount>
`,
);