@operato/input 8.0.0-alpha.51 → 8.0.0-beta.1

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +7 -7
  4. package/.editorconfig +0 -29
  5. package/.storybook/main.js +0 -3
  6. package/.storybook/preview.js +0 -52
  7. package/.storybook/server.mjs +0 -8
  8. package/src/index.ts +0 -35
  9. package/src/locale/locale-codes.ts +0 -18
  10. package/src/locale/locale-picker.ts +0 -43
  11. package/src/locale/localization.ts +0 -15
  12. package/src/locales/en.ts +0 -30
  13. package/src/locales/ko.ts +0 -30
  14. package/src/locales/ms.ts +0 -30
  15. package/src/locales/zh.ts +0 -30
  16. package/src/ox-buttons-radio.ts +0 -140
  17. package/src/ox-checkbox.ts +0 -181
  18. package/src/ox-form-field.ts +0 -53
  19. package/src/ox-input-3axis.ts +0 -77
  20. package/src/ox-input-3dish.ts +0 -211
  21. package/src/ox-input-angle.ts +0 -73
  22. package/src/ox-input-barcode.ts +0 -318
  23. package/src/ox-input-code.ts +0 -139
  24. package/src/ox-input-color-gradient.ts +0 -349
  25. package/src/ox-input-color-stops.ts +0 -525
  26. package/src/ox-input-color.ts +0 -338
  27. package/src/ox-input-container.ts +0 -32
  28. package/src/ox-input-crontab.ts +0 -595
  29. package/src/ox-input-data.ts +0 -219
  30. package/src/ox-input-direction.ts +0 -92
  31. package/src/ox-input-duration.ts +0 -175
  32. package/src/ox-input-file.ts +0 -209
  33. package/src/ox-input-hashtags.ts +0 -185
  34. package/src/ox-input-i18n-label.ts +0 -140
  35. package/src/ox-input-image.ts +0 -168
  36. package/src/ox-input-key-values.ts +0 -301
  37. package/src/ox-input-layout/ox-input-card-layout.ts +0 -58
  38. package/src/ox-input-layout/ox-input-grid-layout.ts +0 -64
  39. package/src/ox-input-layout/ox-input-layout.ts +0 -77
  40. package/src/ox-input-mass-fraction.ts +0 -437
  41. package/src/ox-input-multiple-colors.ts +0 -135
  42. package/src/ox-input-options.ts +0 -216
  43. package/src/ox-input-partition-keys.ts +0 -303
  44. package/src/ox-input-privilege.ts +0 -163
  45. package/src/ox-input-quantifier.ts +0 -62
  46. package/src/ox-input-range.ts +0 -146
  47. package/src/ox-input-scene-component-id.ts +0 -73
  48. package/src/ox-input-search.ts +0 -126
  49. package/src/ox-input-select-buttons.ts +0 -75
  50. package/src/ox-input-signature.ts +0 -208
  51. package/src/ox-input-stack.ts +0 -136
  52. package/src/ox-input-switch.ts +0 -117
  53. package/src/ox-input-table-column-config.ts +0 -211
  54. package/src/ox-input-table.ts +0 -404
  55. package/src/ox-input-textarea.ts +0 -86
  56. package/src/ox-input-unit-number.ts +0 -354
  57. package/src/ox-input-value-map.ts +0 -342
  58. package/src/ox-input-value-ranges.ts +0 -363
  59. package/src/ox-input-work-shift.ts +0 -290
  60. package/src/ox-select-floor.ts +0 -246
  61. package/src/ox-select.ts +0 -219
  62. package/stories/image-for-select-floor.ts +0 -2
  63. package/stories/ox-buttons-radio.stories.ts +0 -89
  64. package/stories/ox-checkbox.stories.ts +0 -111
  65. package/stories/ox-input-3axis.stories.ts +0 -77
  66. package/stories/ox-input-3dish.stories.ts +0 -106
  67. package/stories/ox-input-angle.stories.ts +0 -84
  68. package/stories/ox-input-barcode.stories.ts +0 -117
  69. package/stories/ox-input-code.stories.ts +0 -99
  70. package/stories/ox-input-crontab.stories.ts +0 -82
  71. package/stories/ox-input-data.stories.ts +0 -82
  72. package/stories/ox-input-direction.stories.ts +0 -91
  73. package/stories/ox-input-duration.stories.ts +0 -84
  74. package/stories/ox-input-file.stories.ts +0 -111
  75. package/stories/ox-input-hashtags.stories.ts +0 -82
  76. package/stories/ox-input-i18n-label.stories.ts +0 -103
  77. package/stories/ox-input-key-values.stories.ts +0 -97
  78. package/stories/ox-input-mass-fraction.stories.ts +0 -102
  79. package/stories/ox-input-multiple-colors.stories.ts +0 -72
  80. package/stories/ox-input-options.stories.ts +0 -80
  81. package/stories/ox-input-partition-keys.stories.ts +0 -84
  82. package/stories/ox-input-privilege.stories.ts +0 -108
  83. package/stories/ox-input-quantifier.stories.ts +0 -80
  84. package/stories/ox-input-range.stories.ts +0 -89
  85. package/stories/ox-input-search.stories.ts +0 -91
  86. package/stories/ox-input-select-buttons.stories.ts +0 -118
  87. package/stories/ox-input-signature.stories.ts +0 -75
  88. package/stories/ox-input-switch.stories.ts +0 -91
  89. package/stories/ox-input-table-column-config.stories.ts +0 -109
  90. package/stories/ox-input-unit.stories.ts +0 -151
  91. package/stories/ox-input-value-map.stories.ts +0 -92
  92. package/stories/ox-input-value-ranges.stories.ts +0 -92
  93. package/stories/ox-input-work-shift.stories.ts +0 -106
  94. package/stories/ox-select-floor.stories.ts +0 -197
  95. package/stories/ox-select-set-options.stories.ts +0 -208
  96. package/stories/ox-select.stories.ts +0 -181
  97. package/tsconfig.json +0 -25
  98. package/web-dev-server.config.mjs +0 -27
  99. package/web-test-runner.config.mjs +0 -41
@@ -1,208 +0,0 @@
1
- import '../src/ox-select.js'
2
- import '../src/ox-checkbox.js'
3
-
4
- import { OxSelect } from '../src/ox-select.js'
5
- import { html, TemplateResult } from 'lit'
6
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
7
-
8
- export default {
9
- title: 'ox-select-set-options',
10
- component: 'ox-select',
11
- argTypes: {
12
- placeholder: { control: 'text' },
13
- name: { control: 'text' },
14
- options: { control: 'object' },
15
- multiple: { control: 'boolean' },
16
- withSearch: { control: 'boolean' },
17
- disabled: { control: 'boolean' }
18
- }
19
- }
20
-
21
- interface Story<T> {
22
- (args: T): TemplateResult
23
- args?: Partial<T>
24
- argTypes?: Record<string, unknown>
25
- }
26
-
27
- interface ArgTypes {
28
- placeholder?: string
29
- name?: string
30
- value?: object | string
31
- options?: string[] | { display: string; value: string }[]
32
- multiple?: boolean
33
- withSearch?: boolean
34
- disabled?: boolean
35
- }
36
-
37
- const Template: Story<ArgTypes> = ({
38
- placeholder = 'Checkbox',
39
- name = 'hello',
40
- value = '',
41
- options = [],
42
- multiple,
43
- withSearch,
44
- disabled
45
- }: ArgTypes) => html`
46
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
47
-
48
- <link href="/themes/light.css" rel="stylesheet" />
49
- <link href="/themes/dark.css" rel="stylesheet" />
50
- <link href="/themes/spacing.css" rel="stylesheet" />
51
-
52
- <link
53
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
54
- rel="stylesheet"
55
- />
56
- <link
57
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
58
- rel="stylesheet"
59
- />
60
- <link
61
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
62
- rel="stylesheet"
63
- />
64
-
65
- <style>
66
- ${MDTypeScaleStyles.cssText}
67
- </style>
68
-
69
- <style>
70
- .container {
71
- height: 500px;
72
- text-align: center;
73
- padding: 20px;
74
-
75
- background-color: var(--md-sys-color-primary-container);
76
- color: var(--md-sys-color-on-primary-container);
77
- }
78
- </style>
79
-
80
- <div class="container md-typescale-body-large-prominent">
81
- <ox-select
82
- name=${name}
83
- @change=${(e: Event) => {
84
- console.log((e.target as HTMLInputElement).value)
85
- }}
86
- placeholder=${placeholder}
87
- .value=${value}
88
- ?disabled=${disabled}
89
- >
90
- </ox-select>
91
-
92
- <input
93
- type="button"
94
- value="set options"
95
- @click=${() => {
96
- const select = document.querySelector('ox-select') as OxSelect
97
- select.setOptions(options, { multiple, withSearch })
98
- select.value = JSON.parse(JSON.stringify(value))
99
- }}
100
- />
101
- </div>
102
- `
103
-
104
- export const Regular = Template.bind({})
105
- Regular.args = {
106
- placeholder: 'single select',
107
- name: 'label',
108
- value: '',
109
- multiple: false,
110
- options: [
111
- {
112
- value: 'A',
113
- display: 'LABEL-A'
114
- },
115
- {
116
- value: 'B',
117
- display: 'LABEL-B'
118
- },
119
- {
120
- value: 'C',
121
- display: 'LABEL-C'
122
- },
123
- {
124
- value: 'TOO LONG VALUE',
125
- display: 'LABEL-TOO LONG VALUE'
126
- }
127
- ]
128
- }
129
-
130
- export const MultipleSelect = Template.bind({})
131
- MultipleSelect.args = {
132
- placeholder: 'multiple select',
133
- name: 'multiple',
134
- multiple: true,
135
- withSearch: true,
136
- value: ['B', 'TOO LONG VALUE'],
137
- options: [
138
- 'A',
139
- 'B',
140
- 'C',
141
- 'D',
142
- 'E',
143
- 'F',
144
- 'G',
145
- 'H',
146
- 'I',
147
- 'J',
148
- 'K',
149
- 'L',
150
- 'M',
151
- 'O',
152
- 'P',
153
- 'Q',
154
- 'R',
155
- 'S',
156
- 'T',
157
- 'U',
158
- 'V',
159
- 'W',
160
- 'X',
161
- 'Y',
162
- 'Z',
163
- 'TOO LONG VALUE'
164
- ]
165
- }
166
-
167
- export const MultipleWithCheckbox = Template.bind({})
168
- MultipleWithCheckbox.args = {
169
- placeholder: 'multiple with checkbox',
170
- name: 'multiple',
171
- multiple: true,
172
- withSearch: true,
173
- value: ['B', 'C', 'F'],
174
- options: [
175
- {
176
- value: 'A',
177
- display: 'A'
178
- },
179
- {
180
- value: 'B',
181
- display: 'B'
182
- },
183
- {
184
- value: 'C',
185
- display: 'C'
186
- },
187
- {
188
- value: 'D',
189
- display: 'D'
190
- },
191
- {
192
- value: 'E',
193
- display: 'E'
194
- },
195
- {
196
- value: 'F',
197
- display: 'F'
198
- },
199
- {
200
- value: 'G',
201
- display: 'G'
202
- },
203
- {
204
- value: 'TOO LONG VALUE',
205
- display: 'TOO LONG VALUE'
206
- }
207
- ]
208
- }
@@ -1,181 +0,0 @@
1
- import '../src/ox-select.js'
2
- import '../src/ox-checkbox.js'
3
-
4
- import { html, TemplateResult } from 'lit'
5
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
6
-
7
- export default {
8
- title: 'ox-select',
9
- component: 'ox-select',
10
- argTypes: {
11
- placeholder: { control: 'text' },
12
- name: { control: 'text' },
13
- disabled: { control: 'boolean' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- placeholder?: string
25
- name?: string
26
- value?: object | string
27
- slot?: TemplateResult
28
- disabled?: boolean
29
- }
30
-
31
- const Template: Story<ArgTypes> = ({
32
- placeholder = 'Checkbox',
33
- name = 'hello',
34
- value = '',
35
- slot,
36
- disabled
37
- }: ArgTypes) => html`
38
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
39
-
40
- <link href="/themes/light.css" rel="stylesheet" />
41
- <link href="/themes/dark.css" rel="stylesheet" />
42
- <link href="/themes/spacing.css" rel="stylesheet" />
43
-
44
- <link
45
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
46
- rel="stylesheet"
47
- />
48
- <link
49
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
50
- rel="stylesheet"
51
- />
52
- <link
53
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
54
- rel="stylesheet"
55
- />
56
-
57
- <style>
58
- ${MDTypeScaleStyles.cssText}
59
- </style>
60
-
61
- <style>
62
- .container {
63
- height: 250px;
64
- text-align: center;
65
- padding: 20px;
66
-
67
- background-color: var(--md-sys-color-primary-container);
68
- color: var(--md-sys-color-on-primary-container);
69
- }
70
-
71
- ox-select {
72
- width: 300px;
73
- }
74
- </style>
75
-
76
- <div class="container md-typescale-body-large-prominent">
77
- <ox-select
78
- name=${name}
79
- @change=${(e: Event) => {
80
- console.log((e.target as HTMLInputElement).value)
81
- }}
82
- placeholder=${placeholder}
83
- .value=${value}
84
- ?disabled=${disabled}
85
- >
86
- ${slot}
87
- </ox-select>
88
- </div>
89
- `
90
-
91
- export const Regular = Template.bind({})
92
- Regular.args = {
93
- placeholder: 'single select',
94
- name: 'label',
95
- value: '',
96
- slot: html`
97
- <ox-popup-list align-left nowrap>
98
- <div option value="A">LABEL-A</div>
99
- <div option value="B">LABEL-B</div>
100
- <div option value="C">LABEL-C</div>
101
- <div option value="TOO LONG VALUE">LABEL-TOO LONG VALUE</div>
102
- </ox-popup-list>
103
- `
104
- }
105
-
106
- export const MultipleSelect = Template.bind({})
107
- MultipleSelect.args = {
108
- placeholder: 'multiple select',
109
- name: 'multiple',
110
- value: ['B', 'TOO LONG VALUE'],
111
- slot: html`
112
- <ox-popup-list multiple with-search>
113
- <div option value="A">A</div>
114
- <div option value="B">B</div>
115
- <div option value="C">C</div>
116
- <div option value="D">D</div>
117
- <div option value="E">E</div>
118
- <div option value="F">F</div>
119
- <div option value="G">G</div>
120
- <div option value="H">H</div>
121
- <div option value="I">I</div>
122
- <div option value="J">J</div>
123
- <div option value="K">K</div>
124
- <div option value="L">L</div>
125
- <div option value="M">M</div>
126
- <div option value="O">O</div>
127
- <div option value="P">P</div>
128
- <div option value="Q">Q</div>
129
- <div option value="R">R</div>
130
- <div option value="S">S</div>
131
- <div option value="T">T</div>
132
- <div option value="U">U</div>
133
- <div option value="V">V</div>
134
- <div option value="W">W</div>
135
- <div option value="X">X</div>
136
- <div option value="Y">Y</div>
137
- <div option value="Z">Z</div>
138
- <div option value="TOO LONG VALUE" />TOO LONG VALUE</div>
139
- </ox-popup-list>
140
- `
141
- }
142
-
143
- export const MultipleWithCheckbox = Template.bind({})
144
- MultipleWithCheckbox.args = {
145
- placeholder: 'multiple with checkbox',
146
- name: 'multiple',
147
- value: ['B', 'C', 'F'],
148
- slot: html`
149
- <ox-popup-list attr-selected="checked" multiple with-search>
150
- <ox-checkbox
151
- @change=${(e: Event) => {
152
- const target = e.target as HTMLInputElement
153
- const options = Array.from(target.parentElement!.querySelectorAll('[option]')).filter(
154
- option => !option.hasAttribute('hidden')
155
- )
156
- options.forEach(option => ((option as HTMLInputElement).checked = target.checked))
157
- const value = options
158
- .map(option => ((option as HTMLInputElement).checked ? (option as HTMLInputElement).value : undefined))
159
- .filter(Boolean)
160
-
161
- ;(target.closest('ox-popup-list') as any)!.dispatchEvent(
162
- new CustomEvent('select', {
163
- bubbles: true,
164
- composed: true,
165
- detail: value
166
- })
167
- )
168
- }}
169
- >set all</ox-checkbox
170
- >
171
- <ox-checkbox option value="A">LABEL-A</ox-checkbox>
172
- <ox-checkbox option value="B">LABEL-B</ox-checkbox>
173
- <ox-checkbox option value="C" checked>LABEL-C</ox-checkbox>
174
- <ox-checkbox option value="D">LABEL-D</ox-checkbox>
175
- <ox-checkbox option value="E">LABEL-E</ox-checkbox>
176
- <ox-checkbox option value="F">LABEL-F</ox-checkbox>
177
- <ox-checkbox option value="G">LABEL-G</ox-checkbox>
178
- <ox-checkbox option value="TOO LONG VALUE">TOO LONG VALUE</ox-checkbox>
179
- </ox-popup-list>
180
- `
181
- }
package/tsconfig.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "resolveJsonModule": true,
7
- "noEmitOnError": true,
8
- "lib": ["es2017", "dom"],
9
- "strict": true,
10
- "esModuleInterop": false,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators": true,
13
- "useDefineForClassFields": false,
14
- "importHelpers": true,
15
- "outDir": "dist",
16
- "sourceMap": true,
17
- "inlineSources": true,
18
- "rootDir": "./",
19
- "declaration": true,
20
- "incremental": true,
21
- "skipLibCheck": true,
22
- "types": ["node", "mocha"]
23
- },
24
- "include": ["**/*.ts"]
25
- }
@@ -1,27 +0,0 @@
1
- // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2
-
3
- /** Use Hot Module replacement by adding --hmr to the start command */
4
- const hmr = process.argv.includes('--hmr');
5
-
6
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/demo/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
14
-
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
17
-
18
- /** Set appIndex to enable SPA routing */
19
- // appIndex: 'demo/index.html',
20
-
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
25
-
26
- // See documentation for all available options
27
- });
@@ -1,41 +0,0 @@
1
- // import { playwrightLauncher } from '@web/test-runner-playwright';
2
-
3
- const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
4
-
5
- export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6
- /** Test files to run */
7
- files: 'dist/test/**/*.test.js',
8
-
9
- /** Resolve bare module imports */
10
- nodeResolve: {
11
- exportConditions: ['browser', 'development'],
12
- },
13
-
14
- /** Filter out lit dev mode logs */
15
- filterBrowserLogs(log) {
16
- for (const arg of log.args) {
17
- if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
18
- return false;
19
- }
20
- }
21
- return true;
22
- },
23
-
24
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
25
- // esbuildTarget: 'auto',
26
-
27
- /** Amount of browsers to run concurrently */
28
- // concurrentBrowsers: 2,
29
-
30
- /** Amount of test files per browser to test concurrently */
31
- // concurrency: 1,
32
-
33
- /** Browsers to run tests on */
34
- // browsers: [
35
- // playwrightLauncher({ product: 'chromium' }),
36
- // playwrightLauncher({ product: 'firefox' }),
37
- // playwrightLauncher({ product: 'webkit' }),
38
- // ],
39
-
40
- // See documentation for all available options
41
- });