@operato/input 1.0.0-beta.2 → 1.0.0-beta.22
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 +417 -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/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-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-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 +0 -1
- package/dist/src/ox-input-search.js +14 -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 +1 -1
- 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.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 +12 -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/{index.stories.d.ts → ox-input-barcode.stories.d.ts} +11 -11
- package/dist/stories/ox-input-barcode.stories.js +22 -0
- package/dist/stories/ox-input-barcode.stories.js.map +1 -0
- package/dist/stories/ox-input-conntab.stories.d.ts +26 -0
- package/dist/stories/ox-input-conntab.stories.js +37 -0
- package/dist/stories/ox-input-conntab.stories.js.map +1 -0
- package/dist/stories/ox-input-crontab.stories.d.ts +26 -0
- package/dist/stories/ox-input-crontab.stories.js +37 -0
- package/dist/stories/ox-input-crontab.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/ox-input-key-values.stories.d.ts +29 -0
- 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 +29 -0
- package/dist/stories/ox-input-search.stories.js +32 -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 copy.d.ts +35 -0
- package/dist/stories/ox-input-value-map.stories copy.js +37 -0
- package/dist/stories/ox-input-value-map.stories copy.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-range.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-range.stories.js +37 -0
- package/dist/stories/ox-input-value-range.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/themes/common-grist-styles.d.ts +1 -0
- package/dist/themes/common-grist-styles.js +110 -0
- package/dist/themes/common-grist-styles.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -11
- 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-color.ts +17 -11
- package/src/ox-input-crontab.ts +30 -10
- 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 +14 -8
- package/src/ox-input-unit.ts +123 -0
- package/src/ox-input-value-map.ts +2 -2
- package/src/ox-input-value-ranges.ts +2 -2
- package/src/ox-input-work-shift.ts +78 -43
- package/src/ox-select.ts +15 -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 +38 -0
- package/stories/ox-input-code.stories.ts_ +51 -0
- package/stories/ox-input-crontab.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 +47 -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/common-grist-styles.ts +110 -0
- package/themes/input-theme.css +19 -0
- 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,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"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const CommonGristStyles: import("lit").CSSResult;
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import { css } from 'lit';
|
2
|
+
export const CommonGristStyles = css `
|
3
|
+
:host {
|
4
|
+
display: flex;
|
5
|
+
|
6
|
+
width: 100%;
|
7
|
+
}
|
8
|
+
|
9
|
+
ox-grist {
|
10
|
+
flex: 1;
|
11
|
+
overflow-y: auto;
|
12
|
+
}
|
13
|
+
|
14
|
+
[slot='headroom'] {
|
15
|
+
display: flex;
|
16
|
+
flex-direction: row;
|
17
|
+
align-items: center;
|
18
|
+
padding: var(--padding-default) var(--padding-wide);
|
19
|
+
border-top: 2px solid rgba(0, 0, 0, 0.2);
|
20
|
+
background-color: var(--theme-white-color);
|
21
|
+
box-shadow: var(--box-shadow);
|
22
|
+
|
23
|
+
--mdc-icon-size: 24px;
|
24
|
+
}
|
25
|
+
#sorters mwc-icon,
|
26
|
+
#modes mwc-icon {
|
27
|
+
--mdc-icon-size: 18px;
|
28
|
+
}
|
29
|
+
#sorters {
|
30
|
+
margin-left: auto;
|
31
|
+
margin-right: var(--margin-default);
|
32
|
+
padding-left: var(--padding-narrow);
|
33
|
+
border-bottom: var(--border-dark-color);
|
34
|
+
position: relative;
|
35
|
+
color: var(--secondary-color);
|
36
|
+
font-size: var(--fontsize-default);
|
37
|
+
user-select: none;
|
38
|
+
}
|
39
|
+
|
40
|
+
#sorters > * {
|
41
|
+
padding: var(--padding-narrow);
|
42
|
+
vertical-align: middle;
|
43
|
+
}
|
44
|
+
|
45
|
+
#modes > * {
|
46
|
+
padding: var(--padding-narrow);
|
47
|
+
opacity: 0.5;
|
48
|
+
color: var(--primary-text-color);
|
49
|
+
cursor: pointer;
|
50
|
+
}
|
51
|
+
|
52
|
+
#modes > mwc-icon[active] {
|
53
|
+
border-radius: 9px;
|
54
|
+
background-color: rgba(var(--primary-color-rgb), 0.05);
|
55
|
+
opacity: 1;
|
56
|
+
color: var(--secondary-text-color);
|
57
|
+
cursor: default;
|
58
|
+
}
|
59
|
+
|
60
|
+
#modes > mwc-icon:hover {
|
61
|
+
opacity: 1;
|
62
|
+
color: var(--secondary-text-color);
|
63
|
+
}
|
64
|
+
|
65
|
+
#add {
|
66
|
+
width: 50px;
|
67
|
+
text-align: right;
|
68
|
+
}
|
69
|
+
|
70
|
+
#add button {
|
71
|
+
background-color: var(--status-success-color);
|
72
|
+
border: 0;
|
73
|
+
border-radius: 50%;
|
74
|
+
padding: 5px;
|
75
|
+
width: 36px;
|
76
|
+
height: 36px;
|
77
|
+
cursor: pointer;
|
78
|
+
}
|
79
|
+
|
80
|
+
#add button:hover {
|
81
|
+
background-color: var(--focus-background-color);
|
82
|
+
box-shadow: var(--box-shadow);
|
83
|
+
}
|
84
|
+
|
85
|
+
#add button mwc-icon {
|
86
|
+
font-size: 2em;
|
87
|
+
color: var(--theme-white-color);
|
88
|
+
}
|
89
|
+
|
90
|
+
#filters {
|
91
|
+
display: flex;
|
92
|
+
justify-content: center;
|
93
|
+
align-items: center;
|
94
|
+
}
|
95
|
+
|
96
|
+
#filters * {
|
97
|
+
margin-right: var(--margin-default);
|
98
|
+
}
|
99
|
+
|
100
|
+
@media only screen and (max-width: 460px) {
|
101
|
+
#filters {
|
102
|
+
flex-direction: column;
|
103
|
+
}
|
104
|
+
|
105
|
+
#modes {
|
106
|
+
display: none;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
`;
|
110
|
+
//# sourceMappingURL=common-grist-styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common-grist-styles.js","sourceRoot":"","sources":["../../themes/common-grist-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GnC,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const CommonGristStyles = css`\n :host {\n display: flex;\n\n width: 100%;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n }\n\n [slot='headroom'] {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n\n --mdc-icon-size: 24px;\n }\n #sorters mwc-icon,\n #modes mwc-icon {\n --mdc-icon-size: 18px;\n }\n #sorters {\n margin-left: auto;\n margin-right: var(--margin-default);\n padding-left: var(--padding-narrow);\n border-bottom: var(--border-dark-color);\n position: relative;\n color: var(--secondary-color);\n font-size: var(--fontsize-default);\n user-select: none;\n }\n\n #sorters > * {\n padding: var(--padding-narrow);\n vertical-align: middle;\n }\n\n #modes > * {\n padding: var(--padding-narrow);\n opacity: 0.5;\n color: var(--primary-text-color);\n cursor: pointer;\n }\n\n #modes > mwc-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--secondary-text-color);\n cursor: default;\n }\n\n #modes > mwc-icon:hover {\n opacity: 1;\n color: var(--secondary-text-color);\n }\n\n #add {\n width: 50px;\n text-align: right;\n }\n\n #add button {\n background-color: var(--status-success-color);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 36px;\n height: 36px;\n cursor: pointer;\n }\n\n #add button:hover {\n background-color: var(--focus-background-color);\n box-shadow: var(--box-shadow);\n }\n\n #add button mwc-icon {\n font-size: 2em;\n color: var(--theme-white-color);\n }\n\n #filters {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n #filters * {\n margin-right: var(--margin-default);\n }\n\n @media only screen and (max-width: 460px) {\n #filters {\n flex-direction: column;\n }\n\n #modes {\n display: none;\n }\n }\n`\n"]}
|