@operato/input 9.0.0-beta.55 → 9.0.0-beta.61
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/CHANGELOG.md +9 -0
- package/dist/src/ox-input-options.js +0 -1
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/stories/image-for-select-floor.d.ts +0 -1
- package/dist/stories/image-for-select-floor.js +0 -2
- package/dist/stories/image-for-select-floor.js.map +0 -1
- package/dist/stories/ox-buttons-radio.stories.d.ts +0 -26
- package/dist/stories/ox-buttons-radio.stories.js +0 -75
- package/dist/stories/ox-buttons-radio.stories.js.map +0 -1
- package/dist/stories/ox-checkbox.stories.d.ts +0 -44
- package/dist/stories/ox-checkbox.stories.js +0 -84
- package/dist/stories/ox-checkbox.stories.js.map +0 -1
- package/dist/stories/ox-input-3axis.stories.d.ts +0 -26
- package/dist/stories/ox-input-3axis.stories.js +0 -63
- package/dist/stories/ox-input-3axis.stories.js.map +0 -1
- package/dist/stories/ox-input-3dish.stories.d.ts +0 -30
- package/dist/stories/ox-input-3dish.stories.js +0 -91
- package/dist/stories/ox-input-3dish.stories.js.map +0 -1
- package/dist/stories/ox-input-angle.stories.d.ts +0 -30
- package/dist/stories/ox-input-angle.stories.js +0 -69
- package/dist/stories/ox-input-angle.stories.js.map +0 -1
- package/dist/stories/ox-input-barcode.stories.d.ts +0 -47
- package/dist/stories/ox-input-barcode.stories.js +0 -89
- package/dist/stories/ox-input-barcode.stories.js.map +0 -1
- package/dist/stories/ox-input-code.stories.d.ts +0 -38
- package/dist/stories/ox-input-code.stories.js +0 -76
- package/dist/stories/ox-input-code.stories.js.map +0 -1
- package/dist/stories/ox-input-crontab.stories.d.ts +0 -29
- package/dist/stories/ox-input-crontab.stories.js +0 -67
- package/dist/stories/ox-input-crontab.stories.js.map +0 -1
- package/dist/stories/ox-input-data.stories.d.ts +0 -29
- package/dist/stories/ox-input-data.stories.js +0 -67
- package/dist/stories/ox-input-data.stories.js.map +0 -1
- package/dist/stories/ox-input-direction.stories.d.ts +0 -29
- package/dist/stories/ox-input-direction.stories.js +0 -76
- package/dist/stories/ox-input-direction.stories.js.map +0 -1
- package/dist/stories/ox-input-duration.stories.d.ts +0 -30
- package/dist/stories/ox-input-duration.stories.js +0 -69
- package/dist/stories/ox-input-duration.stories.js.map +0 -1
- package/dist/stories/ox-input-file.stories.d.ts +0 -53
- package/dist/stories/ox-input-file.stories.js +0 -80
- package/dist/stories/ox-input-file.stories.js.map +0 -1
- package/dist/stories/ox-input-hashtags.stories.d.ts +0 -33
- package/dist/stories/ox-input-hashtags.stories.js +0 -66
- package/dist/stories/ox-input-hashtags.stories.js.map +0 -1
- package/dist/stories/ox-input-i18n-label.stories.d.ts +0 -29
- package/dist/stories/ox-input-i18n-label.stories.js +0 -88
- package/dist/stories/ox-input-i18n-label.stories.js.map +0 -1
- package/dist/stories/ox-input-key-values.stories.d.ts +0 -33
- package/dist/stories/ox-input-key-values.stories.js +0 -81
- package/dist/stories/ox-input-key-values.stories.js.map +0 -1
- package/dist/stories/ox-input-mass-fraction.stories.d.ts +0 -37
- package/dist/stories/ox-input-mass-fraction.stories.js +0 -79
- package/dist/stories/ox-input-mass-fraction.stories.js.map +0 -1
- package/dist/stories/ox-input-multiple-colors.stories.d.ts +0 -24
- package/dist/stories/ox-input-multiple-colors.stories.js +0 -59
- package/dist/stories/ox-input-multiple-colors.stories.js.map +0 -1
- package/dist/stories/ox-input-options.stories.d.ts +0 -29
- package/dist/stories/ox-input-options.stories.js +0 -65
- package/dist/stories/ox-input-options.stories.js.map +0 -1
- package/dist/stories/ox-input-partition-keys.stories.d.ts +0 -29
- package/dist/stories/ox-input-partition-keys.stories.js +0 -69
- package/dist/stories/ox-input-partition-keys.stories.js.map +0 -1
- package/dist/stories/ox-input-privilege.stories.d.ts +0 -40
- package/dist/stories/ox-input-privilege.stories.js +0 -87
- package/dist/stories/ox-input-privilege.stories.js.map +0 -1
- package/dist/stories/ox-input-quantifier.stories.d.ts +0 -29
- package/dist/stories/ox-input-quantifier.stories.js +0 -63
- package/dist/stories/ox-input-quantifier.stories.js.map +0 -1
- package/dist/stories/ox-input-range.stories.d.ts +0 -41
- package/dist/stories/ox-input-range.stories.js +0 -64
- package/dist/stories/ox-input-range.stories.js.map +0 -1
- package/dist/stories/ox-input-search.stories.d.ts +0 -36
- package/dist/stories/ox-input-search.stories.js +0 -68
- package/dist/stories/ox-input-search.stories.js.map +0 -1
- package/dist/stories/ox-input-select-buttons.stories.d.ts +0 -38
- package/dist/stories/ox-input-select-buttons.stories.js +0 -94
- package/dist/stories/ox-input-select-buttons.stories.js.map +0 -1
- package/dist/stories/ox-input-signature.stories.d.ts +0 -25
- package/dist/stories/ox-input-signature.stories.js +0 -60
- package/dist/stories/ox-input-signature.stories.js.map +0 -1
- package/dist/stories/ox-input-switch.stories.d.ts +0 -38
- package/dist/stories/ox-input-switch.stories.js +0 -68
- package/dist/stories/ox-input-switch.stories.js.map +0 -1
- package/dist/stories/ox-input-table-column-config.stories.d.ts +0 -29
- package/dist/stories/ox-input-table-column-config.stories.js +0 -94
- package/dist/stories/ox-input-table-column-config.stories.js.map +0 -1
- package/dist/stories/ox-input-table.stories.d.ts +0 -21
- package/dist/stories/ox-input-table.stories.js +0 -84
- package/dist/stories/ox-input-table.stories.js.map +0 -1
- package/dist/stories/ox-input-unit.stories.d.ts +0 -42
- package/dist/stories/ox-input-unit.stories.js +0 -123
- package/dist/stories/ox-input-unit.stories.js.map +0 -1
- package/dist/stories/ox-input-value-map.stories.d.ts +0 -39
- package/dist/stories/ox-input-value-map.stories.js +0 -69
- package/dist/stories/ox-input-value-map.stories.js.map +0 -1
- package/dist/stories/ox-input-value-ranges.stories.d.ts +0 -39
- package/dist/stories/ox-input-value-ranges.stories.js +0 -69
- package/dist/stories/ox-input-value-ranges.stories.js.map +0 -1
- package/dist/stories/ox-input-work-shift.stories.d.ts +0 -30
- package/dist/stories/ox-input-work-shift.stories.js +0 -91
- package/dist/stories/ox-input-work-shift.stories.js.map +0 -1
- package/dist/stories/ox-select-floor.stories.d.ts +0 -45
- package/dist/stories/ox-select-floor.stories.js +0 -166
- package/dist/stories/ox-select-floor.stories.js.map +0 -1
- package/dist/stories/ox-select-images.stories.d.ts +0 -32
- package/dist/stories/ox-select-images.stories.js +0 -120
- package/dist/stories/ox-select-images.stories.js.map +0 -1
- package/dist/stories/ox-select-set-options.stories.d.ts +0 -48
- package/dist/stories/ox-select-set-options.stories.js +0 -178
- package/dist/stories/ox-select-set-options.stories.js.map +0 -1
- package/dist/stories/ox-select.stories.d.ts +0 -34
- package/dist/stories/ox-select.stories.js +0 -151
- package/dist/stories/ox-select.stories.js.map +0 -1
@@ -1,34 +0,0 @@
|
|
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
|
-
disabled: {
|
15
|
-
control: string;
|
16
|
-
};
|
17
|
-
};
|
18
|
-
};
|
19
|
-
export default _default;
|
20
|
-
interface Story<T> {
|
21
|
-
(args: T): TemplateResult;
|
22
|
-
args?: Partial<T>;
|
23
|
-
argTypes?: Record<string, unknown>;
|
24
|
-
}
|
25
|
-
interface ArgTypes {
|
26
|
-
placeholder?: string;
|
27
|
-
name?: string;
|
28
|
-
value?: object | string;
|
29
|
-
slot?: TemplateResult;
|
30
|
-
disabled?: boolean;
|
31
|
-
}
|
32
|
-
export declare const Regular: Story<ArgTypes>;
|
33
|
-
export declare const MultipleSelect: Story<ArgTypes>;
|
34
|
-
export declare const MultipleWithCheckbox: Story<ArgTypes>;
|
@@ -1,151 +0,0 @@
|
|
1
|
-
import '../src/ox-select.js';
|
2
|
-
import '../src/ox-checkbox.js';
|
3
|
-
import { html } from 'lit';
|
4
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
5
|
-
export default {
|
6
|
-
title: 'ox-select',
|
7
|
-
component: 'ox-select',
|
8
|
-
argTypes: {
|
9
|
-
placeholder: { control: 'text' },
|
10
|
-
name: { control: 'text' },
|
11
|
-
disabled: { control: 'boolean' }
|
12
|
-
}
|
13
|
-
};
|
14
|
-
const Template = ({ placeholder = 'Checkbox', name = 'hello', value = '', slot, disabled }) => html `
|
15
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
16
|
-
|
17
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
18
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
19
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
20
|
-
|
21
|
-
<link
|
22
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
23
|
-
rel="stylesheet"
|
24
|
-
/>
|
25
|
-
<link
|
26
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
27
|
-
rel="stylesheet"
|
28
|
-
/>
|
29
|
-
<link
|
30
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
31
|
-
rel="stylesheet"
|
32
|
-
/>
|
33
|
-
|
34
|
-
<style>
|
35
|
-
${MDTypeScaleStyles.cssText}
|
36
|
-
</style>
|
37
|
-
|
38
|
-
<style>
|
39
|
-
.container {
|
40
|
-
height: 250px;
|
41
|
-
text-align: center;
|
42
|
-
padding: 20px;
|
43
|
-
|
44
|
-
background-color: var(--md-sys-color-primary-container);
|
45
|
-
color: var(--md-sys-color-on-primary-container);
|
46
|
-
}
|
47
|
-
|
48
|
-
ox-select {
|
49
|
-
width: 300px;
|
50
|
-
}
|
51
|
-
</style>
|
52
|
-
|
53
|
-
<div class="container md-typescale-body-large-prominent">
|
54
|
-
<ox-select
|
55
|
-
name=${name}
|
56
|
-
@change=${(e) => {
|
57
|
-
console.log(e.target.value);
|
58
|
-
}}
|
59
|
-
placeholder=${placeholder}
|
60
|
-
.value=${value}
|
61
|
-
?disabled=${disabled}
|
62
|
-
>
|
63
|
-
${slot}
|
64
|
-
</ox-select>
|
65
|
-
</div>
|
66
|
-
`;
|
67
|
-
export const Regular = Template.bind({});
|
68
|
-
Regular.args = {
|
69
|
-
placeholder: 'single select',
|
70
|
-
name: 'label',
|
71
|
-
value: '',
|
72
|
-
slot: html `
|
73
|
-
<ox-popup-list align-left nowrap>
|
74
|
-
<div option value="A">LABEL-A</div>
|
75
|
-
<div option value="B">LABEL-B</div>
|
76
|
-
<div option value="C">LABEL-C</div>
|
77
|
-
<div option value="TOO LONG VALUE">LABEL-TOO LONG VALUE</div>
|
78
|
-
</ox-popup-list>
|
79
|
-
`
|
80
|
-
};
|
81
|
-
export const MultipleSelect = Template.bind({});
|
82
|
-
MultipleSelect.args = {
|
83
|
-
placeholder: 'multiple select',
|
84
|
-
name: 'multiple',
|
85
|
-
value: ['B', 'TOO LONG VALUE'],
|
86
|
-
slot: html `
|
87
|
-
<ox-popup-list multiple with-search>
|
88
|
-
<div option value="A">A</div>
|
89
|
-
<div option value="B">B</div>
|
90
|
-
<div option value="C">C</div>
|
91
|
-
<div option value="D">D</div>
|
92
|
-
<div option value="E">E</div>
|
93
|
-
<div option value="F">F</div>
|
94
|
-
<div option value="G">G</div>
|
95
|
-
<div option value="H">H</div>
|
96
|
-
<div option value="I">I</div>
|
97
|
-
<div option value="J">J</div>
|
98
|
-
<div option value="K">K</div>
|
99
|
-
<div option value="L">L</div>
|
100
|
-
<div option value="M">M</div>
|
101
|
-
<div option value="O">O</div>
|
102
|
-
<div option value="P">P</div>
|
103
|
-
<div option value="Q">Q</div>
|
104
|
-
<div option value="R">R</div>
|
105
|
-
<div option value="S">S</div>
|
106
|
-
<div option value="T">T</div>
|
107
|
-
<div option value="U">U</div>
|
108
|
-
<div option value="V">V</div>
|
109
|
-
<div option value="W">W</div>
|
110
|
-
<div option value="X">X</div>
|
111
|
-
<div option value="Y">Y</div>
|
112
|
-
<div option value="Z">Z</div>
|
113
|
-
<div option value="TOO LONG VALUE" />TOO LONG VALUE</div>
|
114
|
-
</ox-popup-list>
|
115
|
-
`
|
116
|
-
};
|
117
|
-
export const MultipleWithCheckbox = Template.bind({});
|
118
|
-
MultipleWithCheckbox.args = {
|
119
|
-
placeholder: 'multiple with checkbox',
|
120
|
-
name: 'multiple',
|
121
|
-
value: ['B', 'C', 'F'],
|
122
|
-
slot: html `
|
123
|
-
<ox-popup-list attr-selected="checked" multiple with-search>
|
124
|
-
<ox-checkbox
|
125
|
-
@change=${(e) => {
|
126
|
-
const target = e.target;
|
127
|
-
const options = Array.from(target.parentElement.querySelectorAll('[option]')).filter(option => !option.hasAttribute('hidden'));
|
128
|
-
options.forEach(option => (option.checked = target.checked));
|
129
|
-
const value = options
|
130
|
-
.map(option => (option.checked ? option.value : undefined))
|
131
|
-
.filter(Boolean);
|
132
|
-
target.closest('ox-popup-list').dispatchEvent(new CustomEvent('select', {
|
133
|
-
bubbles: true,
|
134
|
-
composed: true,
|
135
|
-
detail: value
|
136
|
-
}));
|
137
|
-
}}
|
138
|
-
>set all</ox-checkbox
|
139
|
-
>
|
140
|
-
<ox-checkbox option value="A">LABEL-A</ox-checkbox>
|
141
|
-
<ox-checkbox option value="B">LABEL-B</ox-checkbox>
|
142
|
-
<ox-checkbox option value="C" checked>LABEL-C</ox-checkbox>
|
143
|
-
<ox-checkbox option value="D">LABEL-D</ox-checkbox>
|
144
|
-
<ox-checkbox option value="E">LABEL-E</ox-checkbox>
|
145
|
-
<ox-checkbox option value="F">LABEL-F</ox-checkbox>
|
146
|
-
<ox-checkbox option value="G">LABEL-G</ox-checkbox>
|
147
|
-
<ox-checkbox option value="TOO LONG VALUE">TOO LONG VALUE</ox-checkbox>
|
148
|
-
</ox-popup-list>
|
149
|
-
`
|
150
|
-
};
|
151
|
-
//# sourceMappingURL=ox-select.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-select.stories.js","sourceRoot":"","sources":["../../stories/ox-select.stories.ts"],"names":[],"mappings":"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","sourcesContent":["import '../src/ox-select.js'\nimport '../src/ox-checkbox.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nexport default {\n title: 'ox-select',\n component: 'ox-select',\n argTypes: {\n placeholder: { control: 'text' },\n name: { control: 'text' },\n disabled: { control: 'boolean' }\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 disabled?: boolean\n}\n\nconst Template: Story<ArgTypes> = ({\n placeholder = 'Checkbox',\n name = 'hello',\n value = '',\n slot,\n disabled\n}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n .container {\n height: 250px;\n text-align: center;\n padding: 20px;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n\n ox-select {\n width: 300px;\n }\n </style>\n\n <div class=\"container md-typescale-body-large-prominent\">\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 ?disabled=${disabled}\n >\n ${slot}\n </ox-select>\n </div>\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=\"D\">D</div>\n <div option value=\"E\">E</div>\n <div option value=\"F\">F</div>\n <div option value=\"G\">G</div>\n <div option value=\"H\">H</div>\n <div option value=\"I\">I</div>\n <div option value=\"J\">J</div>\n <div option value=\"K\">K</div>\n <div option value=\"L\">L</div>\n <div option value=\"M\">M</div>\n <div option value=\"O\">O</div>\n <div option value=\"P\">P</div>\n <div option value=\"Q\">Q</div>\n <div option value=\"R\">R</div>\n <div option value=\"S\">S</div>\n <div option value=\"T\">T</div>\n <div option value=\"U\">U</div>\n <div option value=\"V\">V</div>\n <div option value=\"W\">W</div>\n <div option value=\"X\">X</div>\n <div option value=\"Y\">Y</div>\n <div option value=\"Z\">Z</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 @change=${(e: Event) => {\n const target = e.target as HTMLInputElement\n const options = Array.from(target.parentElement!.querySelectorAll('[option]')).filter(\n option => !option.hasAttribute('hidden')\n )\n options.forEach(option => ((option as HTMLInputElement).checked = target.checked))\n const value = options\n .map(option => ((option as HTMLInputElement).checked ? (option as HTMLInputElement).value : undefined))\n .filter(Boolean)\n\n ;(target.closest('ox-popup-list') as any)!.dispatchEvent(\n new CustomEvent('select', {\n bubbles: true,\n composed: true,\n detail: value\n })\n )\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"]}
|