@operato/input 1.0.0-beta.4 → 1.0.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.js +2 -2
- package/.storybook/server.mjs +4 -4
- package/CHANGELOG.md +568 -0
- package/demo/index-multiple-colors.html +4 -1
- package/demo/index-partition-keys.html +2 -5
- package/demo/index-select.html +1 -1
- package/demo/index.html +4 -0
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.js +3 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/locales/en.d.ts +8 -0
- package/dist/src/locales/en.js +8 -0
- package/dist/src/locales/en.js.map +1 -1
- package/dist/src/locales/ko.d.ts +8 -0
- package/dist/src/locales/ko.js +8 -0
- package/dist/src/locales/ko.js.map +1 -1
- package/dist/src/locales/ms.d.ts +8 -0
- package/dist/src/locales/ms.js +8 -0
- package/dist/src/locales/ms.js.map +1 -1
- package/dist/src/locales/zh.d.ts +8 -0
- package/dist/src/locales/zh.js +8 -0
- package/dist/src/locales/zh.js.map +1 -1
- package/dist/src/ox-input-3dish.js +24 -8
- package/dist/src/ox-input-3dish.js.map +1 -1
- package/dist/src/ox-input-barcode.d.ts +5 -2
- package/dist/src/ox-input-barcode.js +60 -30
- package/dist/src/ox-input-barcode.js.map +1 -1
- package/dist/src/ox-input-color.js +16 -11
- package/dist/src/ox-input-color.js.map +1 -1
- package/dist/src/ox-input-crontab.js +28 -10
- package/dist/src/ox-input-crontab.js.map +1 -1
- package/dist/src/ox-input-duration.d.ts +13 -0
- package/dist/src/ox-input-duration.js +163 -0
- package/dist/src/ox-input-duration.js.map +1 -0
- package/dist/src/ox-input-file.js +5 -3
- package/dist/src/ox-input-file.js.map +1 -1
- package/dist/src/ox-input-key-values.d.ts +41 -0
- package/dist/src/ox-input-key-values.js +233 -0
- package/dist/src/ox-input-key-values.js.map +1 -0
- package/dist/src/ox-input-multiple-colors.d.ts +1 -0
- package/dist/src/ox-input-multiple-colors.js +29 -21
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.d.ts +1 -0
- package/dist/src/ox-input-options.js +54 -14
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-partition-keys.d.ts +1 -0
- package/dist/src/ox-input-partition-keys.js +51 -23
- package/dist/src/ox-input-partition-keys.js.map +1 -1
- package/dist/src/ox-input-range.js +35 -38
- package/dist/src/ox-input-range.js.map +1 -1
- package/dist/src/ox-input-search.d.ts +1 -1
- package/dist/src/ox-input-search.js +24 -7
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/src/ox-input-unit.d.ts +17 -0
- package/dist/src/ox-input-unit.js +122 -0
- package/dist/src/ox-input-unit.js.map +1 -0
- package/dist/src/ox-input-value-map.d.ts +2 -2
- package/dist/src/ox-input-value-map.js +51 -15
- package/dist/src/ox-input-value-map.js.map +1 -1
- package/dist/src/ox-input-value-ranges.d.ts +2 -2
- package/dist/src/ox-input-value-ranges.js +50 -23
- package/dist/src/ox-input-value-ranges.js.map +1 -1
- package/dist/src/ox-input-work-shift.js +77 -43
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/src/ox-select.js +9 -1
- package/dist/src/ox-select.js.map +1 -1
- package/dist/stories/ox-checkbox.stories.d.ts +39 -0
- package/dist/stories/ox-checkbox.stories.js +44 -0
- package/dist/stories/ox-checkbox.stories.js.map +1 -0
- package/dist/stories/ox-input-3dish.stories.d.ts +26 -0
- package/dist/stories/ox-input-3dish.stories.js +59 -0
- package/dist/stories/ox-input-3dish.stories.js.map +1 -0
- package/dist/stories/ox-input-barcode.stories.d.ts +43 -0
- package/dist/stories/ox-input-barcode.stories.js +52 -0
- package/dist/stories/ox-input-barcode.stories.js.map +1 -0
- package/dist/stories/ox-input-crontab.stories.d.ts +25 -0
- package/dist/stories/ox-input-crontab.stories.js +35 -0
- package/dist/stories/ox-input-crontab.stories.js.map +1 -0
- package/dist/stories/ox-input-duration.stories.d.ts +26 -0
- package/dist/stories/ox-input-duration.stories.js +37 -0
- package/dist/stories/ox-input-duration.stories.js.map +1 -0
- package/dist/stories/ox-input-file.stories.d.ts +49 -0
- package/dist/stories/ox-input-file.stories.js +48 -0
- package/dist/stories/ox-input-file.stories.js.map +1 -0
- package/dist/stories/{index.stories.d.ts → ox-input-key-values.stories.d.ts} +7 -11
- package/dist/stories/ox-input-key-values.stories.js +49 -0
- package/dist/stories/ox-input-key-values.stories.js.map +1 -0
- package/dist/stories/ox-input-multiple-colors.stories.d.ts +20 -0
- package/dist/stories/ox-input-multiple-colors.stories.js +167 -0
- package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -0
- package/dist/stories/ox-input-options.stories.d.ts +25 -0
- package/dist/stories/ox-input-options.stories.js +33 -0
- package/dist/stories/ox-input-options.stories.js.map +1 -0
- package/dist/stories/ox-input-partition-keys.stories.d.ts +25 -0
- package/dist/stories/ox-input-partition-keys.stories.js +37 -0
- package/dist/stories/ox-input-partition-keys.stories.js.map +1 -0
- package/dist/stories/ox-input-range.stories.d.ts +37 -0
- package/dist/stories/ox-input-range.stories.js +28 -0
- package/dist/stories/ox-input-range.stories.js.map +1 -0
- package/dist/stories/ox-input-search.stories.d.ts +33 -0
- package/dist/stories/ox-input-search.stories.js +35 -0
- package/dist/stories/ox-input-search.stories.js.map +1 -0
- package/dist/stories/ox-input-unit.stories.d.ts +40 -0
- package/dist/stories/ox-input-unit.stories.js +42 -0
- package/dist/stories/ox-input-unit.stories.js.map +1 -0
- package/dist/stories/ox-input-value-map.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-map.stories.js +37 -0
- package/dist/stories/ox-input-value-map.stories.js.map +1 -0
- package/dist/stories/ox-input-value-ranges.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-ranges.stories.js +37 -0
- package/dist/stories/ox-input-value-ranges.stories.js.map +1 -0
- package/dist/stories/ox-input-work-shift.stories.d.ts +26 -0
- package/dist/stories/ox-input-work-shift.stories.js +59 -0
- package/dist/stories/ox-input-work-shift.stories.js.map +1 -0
- package/dist/stories/ox-select.stories.d.ts +30 -0
- package/dist/stories/ox-select.stories.js +83 -0
- package/dist/stories/ox-select.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -11
- package/src/index.ts +3 -2
- package/src/locales/en.ts +8 -0
- package/src/locales/ko.ts +8 -0
- package/src/locales/ms.ts +8 -0
- package/src/locales/zh.ts +8 -0
- package/src/ox-input-3dish.ts +24 -8
- package/src/ox-input-barcode.ts +66 -33
- package/src/ox-input-color.ts +17 -11
- package/src/ox-input-crontab.ts +30 -10
- package/src/ox-input-duration.ts +168 -0
- package/src/ox-input-file.ts +7 -6
- package/src/ox-input-key-values.ts +270 -0
- package/src/ox-input-multiple-colors.ts +29 -21
- package/src/ox-input-options.ts +53 -13
- package/src/ox-input-partition-keys.ts +51 -22
- package/src/ox-input-range.ts +35 -38
- package/src/ox-input-search.ts +26 -8
- package/src/ox-input-unit.ts +123 -0
- package/src/ox-input-value-map.ts +52 -16
- package/src/ox-input-value-ranges.ts +52 -25
- package/src/ox-input-work-shift.ts +78 -43
- package/src/ox-select.ts +12 -3
- package/stories/ox-checkbox.stories.ts +69 -0
- package/stories/ox-input-3dish.stories.ts +73 -0
- package/stories/ox-input-barcode.stories.ts +78 -0
- package/stories/ox-input-code.stories.ts_ +51 -0
- package/stories/ox-input-crontab.stories.ts +49 -0
- package/stories/ox-input-duration.stories.ts +51 -0
- package/stories/ox-input-file.stories.ts +77 -0
- package/stories/ox-input-key-values.stories.ts +64 -0
- package/stories/ox-input-multiple-colors.stories.ts +178 -0
- package/stories/ox-input-options.stories.ts +47 -0
- package/stories/ox-input-partition-keys.stories.ts +51 -0
- package/stories/ox-input-range.stories.ts +45 -0
- package/stories/ox-input-search.stories.ts +56 -0
- package/stories/ox-input-unit.stories.ts +66 -0
- package/stories/ox-input-value-map.stories.ts +58 -0
- package/stories/ox-input-value-ranges.stories.ts +58 -0
- package/stories/ox-input-work-shift.stories.ts +73 -0
- package/stories/ox-select.stories.ts +101 -0
- package/themes/app-theme.css +142 -0
- package/themes/input-theme.css +19 -0
- package/translations/en.json +45 -1
- package/translations/ko.json +43 -1
- package/translations/ms.json +43 -1
- package/translations/zh.json +43 -1
- package/xliff/en.xlf +24 -0
- package/xliff/ko.xlf +32 -0
- package/xliff/ms.xlf +24 -0
- package/xliff/zh.xlf +24 -0
- package/dist/stories/index.stories.js +0 -33
- package/dist/stories/index.stories.js.map +0 -1
- package/stories/index.stories.ts +0 -52
@@ -0,0 +1,40 @@
|
|
1
|
+
import '../src/ox-input-unit.js';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
declare const _default: {
|
4
|
+
title: string;
|
5
|
+
component: string;
|
6
|
+
argTypes: {
|
7
|
+
placeholder: {
|
8
|
+
control: string;
|
9
|
+
};
|
10
|
+
name: {
|
11
|
+
control: string;
|
12
|
+
};
|
13
|
+
value: {
|
14
|
+
control: string;
|
15
|
+
};
|
16
|
+
stdUnit: {
|
17
|
+
control: string;
|
18
|
+
options: string[];
|
19
|
+
};
|
20
|
+
userUnit: {
|
21
|
+
control: string;
|
22
|
+
options: string[];
|
23
|
+
};
|
24
|
+
};
|
25
|
+
};
|
26
|
+
export default _default;
|
27
|
+
interface Story<T> {
|
28
|
+
(args: T): TemplateResult;
|
29
|
+
args?: Partial<T>;
|
30
|
+
argTypes?: Record<string, unknown>;
|
31
|
+
}
|
32
|
+
interface ArgTypes {
|
33
|
+
placeholder?: string;
|
34
|
+
name?: string;
|
35
|
+
value?: number;
|
36
|
+
stdUnit: string;
|
37
|
+
userUnit?: string;
|
38
|
+
}
|
39
|
+
export declare const Weight: Story<ArgTypes>;
|
40
|
+
export declare const Angle: Story<ArgTypes>;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import '../src/ox-input-unit.js';
|
2
|
+
import { html } from 'lit';
|
3
|
+
export default {
|
4
|
+
title: 'ox-input-unit',
|
5
|
+
component: 'ox-input-unit',
|
6
|
+
argTypes: {
|
7
|
+
placeholder: { control: 'text' },
|
8
|
+
name: { control: 'text' },
|
9
|
+
value: { control: 'number' },
|
10
|
+
stdUnit: { control: 'select', options: ['kg', 'rad'] },
|
11
|
+
userUnit: { control: 'select', options: ['mg', 'g', 'ton', 'degree'] }
|
12
|
+
}
|
13
|
+
};
|
14
|
+
const Template = ({ placeholder = 'unit', name = 'hello', value = 0, stdUnit = 'kg', userUnit }) => html `
|
15
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
16
|
+
<ox-input-unit
|
17
|
+
name=${name}
|
18
|
+
placeholder=${placeholder}
|
19
|
+
.value=${value}
|
20
|
+
std-unit=${stdUnit}
|
21
|
+
user-unit=${userUnit}
|
22
|
+
@change=${(e) => console.log(e.detail)}
|
23
|
+
>
|
24
|
+
</ox-input-unit>
|
25
|
+
`;
|
26
|
+
export const Weight = Template.bind({});
|
27
|
+
Weight.args = {
|
28
|
+
placeholder: 'weight',
|
29
|
+
name: 'weight',
|
30
|
+
value: 0,
|
31
|
+
stdUnit: 'kg',
|
32
|
+
userUnit: 'g'
|
33
|
+
};
|
34
|
+
export const Angle = Template.bind({});
|
35
|
+
Angle.args = {
|
36
|
+
placeholder: 'angle',
|
37
|
+
name: 'angle',
|
38
|
+
value: 0,
|
39
|
+
stdUnit: 'rad',
|
40
|
+
userUnit: 'degree'
|
41
|
+
};
|
42
|
+
//# sourceMappingURL=ox-input-unit.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ox-input-unit.stories.js","sourceRoot":"","sources":["../../stories/ox-input-unit.stories.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;QACtD,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE;KACvE;CACF,CAAA;AAgBD,MAAM,QAAQ,GAAoB,CAAC,EACjC,WAAW,GAAG,MAAM,EACpB,IAAI,GAAG,OAAO,EACd,KAAK,GAAG,CAAC,EACT,OAAO,GAAG,IAAI,EACd,QAAQ,EACC,EAAE,EAAE,CAAC,IAAI,CAAA;;;WAGT,IAAI;kBACG,WAAW;aAChB,KAAK;eACH,OAAO;gBACN,QAAQ;cACV,CAAC,CAAc,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;;;CAGtD,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACvC,MAAM,CAAC,IAAI,GAAG;IACZ,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,GAAG;CACd,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACtC,KAAK,CAAC,IAAI,GAAG;IACX,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,QAAQ;CACnB,CAAA","sourcesContent":["import '../src/ox-input-unit.js'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'ox-input-unit',\n component: 'ox-input-unit',\n argTypes: {\n placeholder: { control: 'text' },\n name: { control: 'text' },\n value: { control: 'number' },\n stdUnit: { control: 'select', options: ['kg', 'rad'] },\n userUnit: { control: 'select', options: ['mg', 'g', 'ton', 'degree'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n placeholder?: string\n name?: string\n value?: number\n stdUnit: string\n userUnit?: string\n}\n\nconst Template: Story<ArgTypes> = ({\n placeholder = 'unit',\n name = 'hello',\n value = 0,\n stdUnit = 'kg',\n userUnit\n}: ArgTypes) => html`\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <ox-input-unit\n name=${name}\n placeholder=${placeholder}\n .value=${value}\n std-unit=${stdUnit}\n user-unit=${userUnit}\n @change=${(e: CustomEvent) => console.log(e.detail)}\n >\n </ox-input-unit>\n`\n\nexport const Weight = Template.bind({})\nWeight.args = {\n placeholder: 'weight',\n name: 'weight',\n value: 0,\n stdUnit: 'kg',\n userUnit: 'g'\n}\n\nexport const Angle = Template.bind({})\nAngle.args = {\n placeholder: 'angle',\n name: 'angle',\n value: 0,\n stdUnit: 'rad',\n userUnit: 'degree'\n}\n"]}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import '../src/ox-input-value-map.js';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
declare const _default: {
|
4
|
+
title: string;
|
5
|
+
component: string;
|
6
|
+
argTypes: {
|
7
|
+
name: {
|
8
|
+
control: string;
|
9
|
+
};
|
10
|
+
value: {
|
11
|
+
control: string;
|
12
|
+
};
|
13
|
+
keytype: {
|
14
|
+
control: string;
|
15
|
+
options: string[];
|
16
|
+
};
|
17
|
+
valuetype: {
|
18
|
+
control: string;
|
19
|
+
options: string[];
|
20
|
+
};
|
21
|
+
};
|
22
|
+
};
|
23
|
+
export default _default;
|
24
|
+
interface Story<T> {
|
25
|
+
(args: T): TemplateResult;
|
26
|
+
args?: Partial<T>;
|
27
|
+
argTypes?: Record<string, unknown>;
|
28
|
+
}
|
29
|
+
interface ArgTypes {
|
30
|
+
name?: string;
|
31
|
+
value?: object;
|
32
|
+
valuetype?: string;
|
33
|
+
keytype?: string;
|
34
|
+
}
|
35
|
+
export declare const Regular: Story<ArgTypes>;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import '../src/ox-input-value-map.js';
|
2
|
+
import { html } from 'lit';
|
3
|
+
export default {
|
4
|
+
title: 'ox-input-value-map',
|
5
|
+
component: 'ox-input-value-map',
|
6
|
+
argTypes: {
|
7
|
+
name: { control: 'text' },
|
8
|
+
value: { control: 'object' },
|
9
|
+
keytype: { control: 'select', options: ['string', 'number'] },
|
10
|
+
valuetype: { control: 'select', options: ['string', 'boolean', 'number', 'color', 'date'] }
|
11
|
+
}
|
12
|
+
};
|
13
|
+
const Template = ({ name = 'values', value = {}, keytype = 'string', valuetype = 'string' }) => html `
|
14
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
15
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
16
|
+
<style>
|
17
|
+
body {
|
18
|
+
}
|
19
|
+
</style>
|
20
|
+
|
21
|
+
<ox-input-value-map
|
22
|
+
@change=${(e) => {
|
23
|
+
console.log(e.target.value);
|
24
|
+
}}
|
25
|
+
name=${name}
|
26
|
+
.value=${value}
|
27
|
+
keytype=${keytype}
|
28
|
+
valuetype=${valuetype}
|
29
|
+
>
|
30
|
+
</ox-input-value-map>
|
31
|
+
`;
|
32
|
+
export const Regular = Template.bind({});
|
33
|
+
Regular.args = {
|
34
|
+
name: 'values',
|
35
|
+
value: {}
|
36
|
+
};
|
37
|
+
//# sourceMappingURL=ox-input-value-map.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ox-input-value-map.stories.js","sourceRoot":"","sources":["../../stories/ox-input-value-map.stories.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AAErC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;QAC7D,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;KAC5F;CACF,CAAA;AAeD,MAAM,QAAQ,GAAoB,CAAC,EACjC,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,EAAE,EACV,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,QAAQ,EACX,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;cASN,CAAC,CAAQ,EAAE,EAAE;IACrB,OAAO,CAAC,GAAG,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC;WACM,IAAI;aACF,KAAK;cACJ,OAAO;gBACL,SAAS;;;CAGxB,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,EAAE;CACV,CAAA","sourcesContent":["import '../src/ox-input-value-map.js'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'ox-input-value-map',\n component: 'ox-input-value-map',\n argTypes: {\n name: { control: 'text' },\n value: { control: 'object' },\n keytype: { control: 'select', options: ['string', 'number'] },\n valuetype: { control: 'select', options: ['string', 'boolean', 'number', 'color', 'date'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n name?: string\n value?: object\n valuetype?: string\n keytype?: string\n}\n\nconst Template: Story<ArgTypes> = ({\n name = 'values',\n value = {},\n keytype = 'string',\n valuetype = 'string'\n}: ArgTypes) => html`\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n <style>\n body {\n }\n </style>\n\n <ox-input-value-map\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n name=${name}\n .value=${value}\n keytype=${keytype}\n valuetype=${valuetype}\n >\n </ox-input-value-map>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n name: 'values',\n value: {}\n}\n"]}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import '../src/ox-input-value-ranges.js';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
declare const _default: {
|
4
|
+
title: string;
|
5
|
+
component: string;
|
6
|
+
argTypes: {
|
7
|
+
name: {
|
8
|
+
control: string;
|
9
|
+
};
|
10
|
+
value: {
|
11
|
+
control: string;
|
12
|
+
};
|
13
|
+
keytype: {
|
14
|
+
control: string;
|
15
|
+
options: string[];
|
16
|
+
};
|
17
|
+
valuetype: {
|
18
|
+
control: string;
|
19
|
+
options: string[];
|
20
|
+
};
|
21
|
+
};
|
22
|
+
};
|
23
|
+
export default _default;
|
24
|
+
interface Story<T> {
|
25
|
+
(args: T): TemplateResult;
|
26
|
+
args?: Partial<T>;
|
27
|
+
argTypes?: Record<string, unknown>;
|
28
|
+
}
|
29
|
+
interface ArgTypes {
|
30
|
+
name?: string;
|
31
|
+
value?: object;
|
32
|
+
valuetype?: string;
|
33
|
+
keytype?: string;
|
34
|
+
}
|
35
|
+
export declare const Regular: Story<ArgTypes>;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import '../src/ox-input-value-ranges.js';
|
2
|
+
import { html } from 'lit';
|
3
|
+
export default {
|
4
|
+
title: 'ox-input-value-ranges',
|
5
|
+
component: 'ox-input-value-ranges',
|
6
|
+
argTypes: {
|
7
|
+
name: { control: 'text' },
|
8
|
+
value: { control: 'object' },
|
9
|
+
keytype: { control: 'select', options: ['string', 'number'] },
|
10
|
+
valuetype: { control: 'select', options: ['string', 'boolean', 'number', 'color', 'date'] }
|
11
|
+
}
|
12
|
+
};
|
13
|
+
const Template = ({ name = 'values', value = {}, keytype = 'string', valuetype = 'string' }) => html `
|
14
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
15
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
16
|
+
<style>
|
17
|
+
body {
|
18
|
+
}
|
19
|
+
</style>
|
20
|
+
|
21
|
+
<ox-input-value-ranges
|
22
|
+
@change=${(e) => {
|
23
|
+
console.log(e.target.value);
|
24
|
+
}}
|
25
|
+
name=${name}
|
26
|
+
.value=${value}
|
27
|
+
keytype=${keytype}
|
28
|
+
valuetype=${valuetype}
|
29
|
+
>
|
30
|
+
</ox-input-value-ranges>
|
31
|
+
`;
|
32
|
+
export const Regular = Template.bind({});
|
33
|
+
Regular.args = {
|
34
|
+
name: 'values',
|
35
|
+
value: {}
|
36
|
+
};
|
37
|
+
//# sourceMappingURL=ox-input-value-ranges.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ox-input-value-ranges.stories.js","sourceRoot":"","sources":["../../stories/ox-input-value-ranges.stories.ts"],"names":[],"mappings":"AAAA,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,uBAAuB;IAClC,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;QAC7D,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;KAC5F;CACF,CAAA;AAeD,MAAM,QAAQ,GAAoB,CAAC,EACjC,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,EAAE,EACV,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,QAAQ,EACX,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;cASN,CAAC,CAAQ,EAAE,EAAE;IACrB,OAAO,CAAC,GAAG,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC;WACM,IAAI;aACF,KAAK;cACJ,OAAO;gBACL,SAAS;;;CAGxB,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,EAAE;CACV,CAAA","sourcesContent":["import '../src/ox-input-value-ranges.js'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'ox-input-value-ranges',\n component: 'ox-input-value-ranges',\n argTypes: {\n name: { control: 'text' },\n value: { control: 'object' },\n keytype: { control: 'select', options: ['string', 'number'] },\n valuetype: { control: 'select', options: ['string', 'boolean', 'number', 'color', 'date'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n name?: string\n value?: object\n valuetype?: string\n keytype?: string\n}\n\nconst Template: Story<ArgTypes> = ({\n name = 'values',\n value = {},\n keytype = 'string',\n valuetype = 'string'\n}: ArgTypes) => html`\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n <style>\n body {\n }\n </style>\n\n <ox-input-value-ranges\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n name=${name}\n .value=${value}\n keytype=${keytype}\n valuetype=${valuetype}\n >\n </ox-input-value-ranges>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n name: 'values',\n value: {}\n}\n"]}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import '../src/ox-input-work-shift.js';
|
2
|
+
import '../src/locale/locale-picker.js';
|
3
|
+
import { TemplateResult } from 'lit';
|
4
|
+
declare const _default: {
|
5
|
+
title: string;
|
6
|
+
component: string;
|
7
|
+
argTypes: {
|
8
|
+
value: {
|
9
|
+
control: string;
|
10
|
+
};
|
11
|
+
name: {
|
12
|
+
control: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
};
|
16
|
+
export default _default;
|
17
|
+
interface Story<T> {
|
18
|
+
(args: T): TemplateResult;
|
19
|
+
args?: Partial<T>;
|
20
|
+
argTypes?: Record<string, unknown>;
|
21
|
+
}
|
22
|
+
interface ArgTypes {
|
23
|
+
name?: string;
|
24
|
+
value?: object;
|
25
|
+
}
|
26
|
+
export declare const Regular: Story<ArgTypes>;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import '../src/ox-input-work-shift.js';
|
2
|
+
import '../src/locale/locale-picker.js';
|
3
|
+
import { html } from 'lit';
|
4
|
+
export default {
|
5
|
+
title: 'ox-input-work-shift',
|
6
|
+
component: 'ox-input-work-shift',
|
7
|
+
argTypes: {
|
8
|
+
value: { control: 'object' },
|
9
|
+
name: { control: 'text' }
|
10
|
+
}
|
11
|
+
};
|
12
|
+
const Template = ({ name = 'work-shift', value = [] }) => html `
|
13
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
14
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
15
|
+
<style>
|
16
|
+
body {
|
17
|
+
}
|
18
|
+
</style>
|
19
|
+
|
20
|
+
<locale-picker></locale-picker>
|
21
|
+
<br /><br />
|
22
|
+
|
23
|
+
<ox-input-work-shift
|
24
|
+
@change=${(e) => {
|
25
|
+
console.log(e.target.value);
|
26
|
+
}}
|
27
|
+
name=${name}
|
28
|
+
.value=${value}
|
29
|
+
>
|
30
|
+
</ox-input-work-shift>
|
31
|
+
`;
|
32
|
+
export const Regular = Template.bind({});
|
33
|
+
Regular.args = {
|
34
|
+
name: 'work-shift',
|
35
|
+
value: [
|
36
|
+
{
|
37
|
+
name: 'DAY',
|
38
|
+
fromDate: -1,
|
39
|
+
fromTime: '22:00',
|
40
|
+
toDate: 0,
|
41
|
+
toTime: '06:00'
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: 'SWING',
|
45
|
+
fromDate: 0,
|
46
|
+
fromTime: '06:00',
|
47
|
+
toDate: 0,
|
48
|
+
toTime: '14:00'
|
49
|
+
},
|
50
|
+
{
|
51
|
+
name: 'NIGHT',
|
52
|
+
fromDate: 0,
|
53
|
+
fromTime: '14:00',
|
54
|
+
toDate: 0,
|
55
|
+
toTime: '22:00'
|
56
|
+
}
|
57
|
+
]
|
58
|
+
};
|
59
|
+
//# sourceMappingURL=ox-input-work-shift.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ox-input-work-shift.stories.js","sourceRoot":"","sources":["../../stories/ox-input-work-shift.stories.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,qBAAqB;IAChC,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1B;CACF,CAAA;AAaD,MAAM,QAAQ,GAAoB,CAAC,EAAE,IAAI,GAAG,YAAY,EAAE,KAAK,GAAG,EAAE,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;cAY3E,CAAC,CAAQ,EAAE,EAAE;IACrB,OAAO,CAAC,GAAG,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC;WACM,IAAI;aACF,KAAK;;;CAGjB,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE;QACL;YACE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,CAAC,CAAC;YACZ,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,OAAO;SAChB;QACD;YACE,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,OAAO;SAChB;QACD;YACE,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,OAAO;SAChB;KACF;CACF,CAAA","sourcesContent":["import '../src/ox-input-work-shift.js'\nimport '../src/locale/locale-picker.js'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'ox-input-work-shift',\n component: 'ox-input-work-shift',\n argTypes: {\n value: { control: 'object' },\n name: { control: 'text' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n name?: string\n value?: object\n}\n\nconst Template: Story<ArgTypes> = ({ name = 'work-shift', value = [] }: ArgTypes) => html`\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n <style>\n body {\n }\n </style>\n\n <locale-picker></locale-picker>\n <br /><br />\n\n <ox-input-work-shift\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n name=${name}\n .value=${value}\n >\n </ox-input-work-shift>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n name: 'work-shift',\n value: [\n {\n name: 'DAY',\n fromDate: -1,\n fromTime: '22:00',\n toDate: 0,\n toTime: '06:00'\n },\n {\n name: 'SWING',\n fromDate: 0,\n fromTime: '06:00',\n toDate: 0,\n toTime: '14:00'\n },\n {\n name: 'NIGHT',\n fromDate: 0,\n fromTime: '14:00',\n toDate: 0,\n toTime: '22:00'\n }\n ]\n}\n"]}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import '../src/ox-select.js';
|
2
|
+
import '../src/ox-checkbox.js';
|
3
|
+
import { TemplateResult } from 'lit';
|
4
|
+
declare const _default: {
|
5
|
+
title: string;
|
6
|
+
component: string;
|
7
|
+
argTypes: {
|
8
|
+
placeholder: {
|
9
|
+
control: string;
|
10
|
+
};
|
11
|
+
name: {
|
12
|
+
control: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
};
|
16
|
+
export default _default;
|
17
|
+
interface Story<T> {
|
18
|
+
(args: T): TemplateResult;
|
19
|
+
args?: Partial<T>;
|
20
|
+
argTypes?: Record<string, unknown>;
|
21
|
+
}
|
22
|
+
interface ArgTypes {
|
23
|
+
placeholder?: string;
|
24
|
+
name?: string;
|
25
|
+
value?: object | string;
|
26
|
+
slot?: TemplateResult;
|
27
|
+
}
|
28
|
+
export declare const Regular: Story<ArgTypes>;
|
29
|
+
export declare const MultipleSelect: Story<ArgTypes>;
|
30
|
+
export declare const MultipleWithCheckbox: Story<ArgTypes>;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import '../src/ox-select.js';
|
2
|
+
import '../src/ox-checkbox.js';
|
3
|
+
import { html } from 'lit';
|
4
|
+
export default {
|
5
|
+
title: 'ox-select',
|
6
|
+
component: 'ox-select',
|
7
|
+
argTypes: {
|
8
|
+
placeholder: { control: 'text' },
|
9
|
+
name: { control: 'text' }
|
10
|
+
}
|
11
|
+
};
|
12
|
+
const Template = ({ placeholder = 'Checkbox', name = 'hello', value = '', slot }) => html `
|
13
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
14
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
15
|
+
|
16
|
+
<ox-select
|
17
|
+
name=${name}
|
18
|
+
@change=${(e) => {
|
19
|
+
console.log(e.target.value);
|
20
|
+
}}
|
21
|
+
placeholder=${placeholder}
|
22
|
+
.value=${value}
|
23
|
+
>
|
24
|
+
${slot}
|
25
|
+
</ox-select>
|
26
|
+
`;
|
27
|
+
export const Regular = Template.bind({});
|
28
|
+
Regular.args = {
|
29
|
+
placeholder: 'single select',
|
30
|
+
name: 'label',
|
31
|
+
value: '',
|
32
|
+
slot: html `
|
33
|
+
<ox-popup-list align-left nowrap>
|
34
|
+
<div option value="A">LABEL-A</div>
|
35
|
+
<div option value="B">LABEL-B</div>
|
36
|
+
<div option value="C">LABEL-C</div>
|
37
|
+
<div option value="TOO LONG VALUE">LABEL-TOO LONG VALUE</div>
|
38
|
+
</ox-popup-list>
|
39
|
+
`
|
40
|
+
};
|
41
|
+
export const MultipleSelect = Template.bind({});
|
42
|
+
MultipleSelect.args = {
|
43
|
+
placeholder: 'multiple select',
|
44
|
+
name: 'multiple',
|
45
|
+
value: ['B', 'TOO LONG VALUE'],
|
46
|
+
slot: html `
|
47
|
+
<ox-popup-list multiple with-search>
|
48
|
+
<div option value="A">A</div>
|
49
|
+
<div option value="B">B</div>
|
50
|
+
<div option value="C">C</div>
|
51
|
+
<div option value="TOO LONG VALUE" />TOO LONG VALUE</div>
|
52
|
+
</ox-popup-list>
|
53
|
+
`
|
54
|
+
};
|
55
|
+
export const MultipleWithCheckbox = Template.bind({});
|
56
|
+
MultipleWithCheckbox.args = {
|
57
|
+
placeholder: 'multiple with checkbox',
|
58
|
+
name: 'multiple',
|
59
|
+
value: ['B', 'C', 'F'],
|
60
|
+
slot: html `
|
61
|
+
<ox-popup-list attr-selected="checked" multiple with-search>
|
62
|
+
<ox-checkbox
|
63
|
+
option
|
64
|
+
@change=${(e) => {
|
65
|
+
const target = e.target;
|
66
|
+
const options = target.parentElement.querySelectorAll('[option]');
|
67
|
+
console.log(options);
|
68
|
+
options.forEach(option => (option.checked = target.checked));
|
69
|
+
}}
|
70
|
+
>set all</ox-checkbox
|
71
|
+
>
|
72
|
+
<ox-checkbox option value="A">LABEL-A</ox-checkbox>
|
73
|
+
<ox-checkbox option value="B">LABEL-B</ox-checkbox>
|
74
|
+
<ox-checkbox option value="C" checked>LABEL-C</ox-checkbox>
|
75
|
+
<ox-checkbox option value="D">LABEL-D</ox-checkbox>
|
76
|
+
<ox-checkbox option value="E">LABEL-E</ox-checkbox>
|
77
|
+
<ox-checkbox option value="F">LABEL-F</ox-checkbox>
|
78
|
+
<ox-checkbox option value="G">LABEL-G</ox-checkbox>
|
79
|
+
<ox-checkbox option value="TOO LONG VALUE">TOO LONG VALUE</ox-checkbox>
|
80
|
+
</ox-popup-list>
|
81
|
+
`
|
82
|
+
};
|
83
|
+
//# sourceMappingURL=ox-select.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ox-select.stories.js","sourceRoot":"","sources":["../../stories/ox-select.stories.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,uBAAuB,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1B;CACF,CAAA;AAeD,MAAM,QAAQ,GAAoB,CAAC,EAAE,WAAW,GAAG,UAAU,EAAE,IAAI,GAAG,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;WAKzG,IAAI;cACD,CAAC,CAAQ,EAAE,EAAE;IACrB,OAAO,CAAC,GAAG,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC;kBACa,WAAW;aAChB,KAAK;;MAEZ,IAAI;;CAET,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,WAAW,EAAE,eAAe;IAC5B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,IAAI,CAAA;;;;;;;GAOT;CACF,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/C,cAAc,CAAC,IAAI,GAAG;IACpB,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC9B,IAAI,EAAE,IAAI,CAAA;;;;;;;GAOT;CACF,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrD,oBAAoB,CAAC,IAAI,GAAG;IAC1B,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACtB,IAAI,EAAE,IAAI,CAAA;;;;kBAIM,CAAC,CAAQ,EAAE,EAAE;QACrB,MAAM,MAAM,GAAG,CAAC,CAAC,MAA0B,CAAA;QAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,aAAc,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAA;QAClE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACpB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAE,MAA2B,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IACpF,CAAC;;;;;;;;;;;;GAYN;CACF,CAAA","sourcesContent":["import '../src/ox-select.js'\nimport '../src/ox-checkbox.js'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'ox-select',\n component: 'ox-select',\n argTypes: {\n placeholder: { control: 'text' },\n name: { control: 'text' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n placeholder?: string\n name?: string\n value?: object | string\n slot?: TemplateResult\n}\n\nconst Template: Story<ArgTypes> = ({ placeholder = 'Checkbox', name = 'hello', value = '', slot }: ArgTypes) => html`\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n\n <ox-select\n name=${name}\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n placeholder=${placeholder}\n .value=${value}\n >\n ${slot}\n </ox-select>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n placeholder: 'single select',\n name: 'label',\n value: '',\n slot: html`\n <ox-popup-list align-left nowrap>\n <div option value=\"A\">LABEL-A</div>\n <div option value=\"B\">LABEL-B</div>\n <div option value=\"C\">LABEL-C</div>\n <div option value=\"TOO LONG VALUE\">LABEL-TOO LONG VALUE</div>\n </ox-popup-list>\n `\n}\n\nexport const MultipleSelect = Template.bind({})\nMultipleSelect.args = {\n placeholder: 'multiple select',\n name: 'multiple',\n value: ['B', 'TOO LONG VALUE'],\n slot: html`\n <ox-popup-list multiple with-search>\n <div option value=\"A\">A</div>\n <div option value=\"B\">B</div>\n <div option value=\"C\">C</div>\n <div option value=\"TOO LONG VALUE\" />TOO LONG VALUE</div>\n </ox-popup-list>\n `\n}\n\nexport const MultipleWithCheckbox = Template.bind({})\nMultipleWithCheckbox.args = {\n placeholder: 'multiple with checkbox',\n name: 'multiple',\n value: ['B', 'C', 'F'],\n slot: html`\n <ox-popup-list attr-selected=\"checked\" multiple with-search>\n <ox-checkbox\n option\n @change=${(e: Event) => {\n const target = e.target as HTMLInputElement\n const options = target.parentElement!.querySelectorAll('[option]')\n console.log(options)\n options.forEach(option => ((option as HTMLInputElement).checked = target.checked))\n }}\n >set all</ox-checkbox\n >\n <ox-checkbox option value=\"A\">LABEL-A</ox-checkbox>\n <ox-checkbox option value=\"B\">LABEL-B</ox-checkbox>\n <ox-checkbox option value=\"C\" checked>LABEL-C</ox-checkbox>\n <ox-checkbox option value=\"D\">LABEL-D</ox-checkbox>\n <ox-checkbox option value=\"E\">LABEL-E</ox-checkbox>\n <ox-checkbox option value=\"F\">LABEL-F</ox-checkbox>\n <ox-checkbox option value=\"G\">LABEL-G</ox-checkbox>\n <ox-checkbox option value=\"TOO LONG VALUE\">TOO LONG VALUE</ox-checkbox>\n </ox-popup-list>\n `\n}\n"]}
|