import { storiesOf, html } from '@open-wc/demoing-storybook';
import { css } from '@lion/core';
import '@lion/form/lion-form.js';
import '@lion/option/lion-option.js';
import '../lion-select-rich.js';
import '../lion-options.js';
const selectRichDemoStyle = css`
.demo-area {
margin: 50px;
}
`;
storiesOf('Forms|Select Rich', module)
.add(
'Default',
() => html`
Red
Hotpink
Teal
`,
)
.add(
'Options with HTML',
() => html`
I am red
and multi Line
I am hotpink
and multi Line
I am teal
and multi Line
`,
)
.add(
'Disabled',
() => html`
Red
Hotpink
Teal
Red
Blue
Hotpink
Green
Teal
`,
)
.add('Validation', () => {
const submit = () => {
const form = document.querySelector('#form');
if (form.errorState === false) {
console.log(form.serializeGroup());
}
};
return html`
`;
})
.add('Render Options', () => {
const objs = [
{ type: 'mastercard', label: 'Master Card', amount: 12000, active: true },
{ type: 'visacard', label: 'Visa Card', amount: 0, active: false },
];
function showOutput() {
// eslint-disable-next-line no-undef
output.innerHTML = JSON.stringify(this.checkedValue, null, 2);
}
return html`
`;
})
.add(
'Interaction mode',
() => html`
By default the select-rich uses the same interaction-mode as the operating system.
Red
Hotpink
Teal
Red
Hotpink
Teal
`,
);