@operato/input 7.1.30 → 7.1.32

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 (119) hide show
  1. package/CHANGELOG.md +10 -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/demo/index-3dish.html +0 -38
  9. package/demo/index-angle.html +0 -36
  10. package/demo/index-barcode.html +0 -68
  11. package/demo/index-button-radio.html +0 -42
  12. package/demo/index-checkbox.html +0 -69
  13. package/demo/index-code.html +0 -61
  14. package/demo/index-color-gradient.html +0 -35
  15. package/demo/index-color-stops.html +0 -62
  16. package/demo/index-color.html +0 -35
  17. package/demo/index-crontab.html +0 -37
  18. package/demo/index-file.html +0 -41
  19. package/demo/index-image.html +0 -40
  20. package/demo/index-multiple-colors.html +0 -52
  21. package/demo/index-options.html +0 -43
  22. package/demo/index-partition-keys.html +0 -79
  23. package/demo/index-range.html +0 -40
  24. package/demo/index-select.html +0 -136
  25. package/demo/index-stack.html +0 -33
  26. package/demo/index-table.html +0 -50
  27. package/demo/index-value-map.html +0 -80
  28. package/demo/index-value-ranges.html +0 -80
  29. package/demo/index-work-shift.html +0 -59
  30. package/demo/index.html +0 -54
  31. package/src/index.ts +0 -34
  32. package/src/locale/locale-codes.ts +0 -18
  33. package/src/locale/locale-picker.ts +0 -43
  34. package/src/locale/localization.ts +0 -15
  35. package/src/locales/en.ts +0 -30
  36. package/src/locales/ko.ts +0 -30
  37. package/src/locales/ms.ts +0 -30
  38. package/src/locales/zh.ts +0 -30
  39. package/src/ox-buttons-radio.ts +0 -140
  40. package/src/ox-checkbox.ts +0 -181
  41. package/src/ox-form-field.ts +0 -53
  42. package/src/ox-input-3axis.ts +0 -77
  43. package/src/ox-input-3dish.ts +0 -211
  44. package/src/ox-input-angle.ts +0 -73
  45. package/src/ox-input-barcode.ts +0 -318
  46. package/src/ox-input-code.ts +0 -139
  47. package/src/ox-input-color-gradient.ts +0 -349
  48. package/src/ox-input-color-stops.ts +0 -525
  49. package/src/ox-input-color.ts +0 -338
  50. package/src/ox-input-container.ts +0 -32
  51. package/src/ox-input-crontab.ts +0 -595
  52. package/src/ox-input-data.ts +0 -219
  53. package/src/ox-input-direction.ts +0 -65
  54. package/src/ox-input-duration.ts +0 -175
  55. package/src/ox-input-file.ts +0 -209
  56. package/src/ox-input-hashtags.ts +0 -185
  57. package/src/ox-input-i18n-label.ts +0 -140
  58. package/src/ox-input-image.ts +0 -168
  59. package/src/ox-input-key-values.ts +0 -301
  60. package/src/ox-input-layout/ox-input-card-layout.ts +0 -58
  61. package/src/ox-input-layout/ox-input-grid-layout.ts +0 -64
  62. package/src/ox-input-layout/ox-input-layout.ts +0 -77
  63. package/src/ox-input-mass-fraction.ts +0 -437
  64. package/src/ox-input-multiple-colors.ts +0 -135
  65. package/src/ox-input-options.ts +0 -216
  66. package/src/ox-input-partition-keys.ts +0 -303
  67. package/src/ox-input-privilege.ts +0 -163
  68. package/src/ox-input-quantifier.ts +0 -62
  69. package/src/ox-input-range.ts +0 -146
  70. package/src/ox-input-scene-component-id.ts +0 -73
  71. package/src/ox-input-search.ts +0 -126
  72. package/src/ox-input-select-buttons.ts +0 -75
  73. package/src/ox-input-signature.ts +0 -180
  74. package/src/ox-input-stack.ts +0 -136
  75. package/src/ox-input-table-column-config.ts +0 -211
  76. package/src/ox-input-table.ts +0 -404
  77. package/src/ox-input-textarea.ts +0 -86
  78. package/src/ox-input-unit-number.ts +0 -354
  79. package/src/ox-input-value-map.ts +0 -342
  80. package/src/ox-input-value-ranges.ts +0 -363
  81. package/src/ox-input-work-shift.ts +0 -290
  82. package/src/ox-select.ts +0 -219
  83. package/src/ox-zoomable-image.ts +0 -75
  84. package/stories/ox-buttons-radio.stories.ts +0 -89
  85. package/stories/ox-checkbox.stories.ts +0 -111
  86. package/stories/ox-input-3axis.stories.ts +0 -77
  87. package/stories/ox-input-3dish.stories.ts +0 -106
  88. package/stories/ox-input-angle.stories.ts +0 -84
  89. package/stories/ox-input-barcode.stories.ts +0 -117
  90. package/stories/ox-input-code.stories.ts +0 -99
  91. package/stories/ox-input-crontab.stories.ts +0 -82
  92. package/stories/ox-input-data.stories.ts +0 -82
  93. package/stories/ox-input-direction.stories.ts +0 -80
  94. package/stories/ox-input-duration.stories.ts +0 -84
  95. package/stories/ox-input-file.stories.ts +0 -111
  96. package/stories/ox-input-hashtags.stories.ts +0 -82
  97. package/stories/ox-input-i18n-label.stories.ts +0 -103
  98. package/stories/ox-input-key-values.stories.ts +0 -97
  99. package/stories/ox-input-mass-fraction.stories.ts +0 -102
  100. package/stories/ox-input-multiple-colors.stories.ts +0 -72
  101. package/stories/ox-input-options.stories.ts +0 -80
  102. package/stories/ox-input-partition-keys.stories.ts +0 -84
  103. package/stories/ox-input-privilege.stories.ts +0 -108
  104. package/stories/ox-input-quantifier.stories.ts +0 -80
  105. package/stories/ox-input-range.stories.ts +0 -89
  106. package/stories/ox-input-search.stories.ts +0 -91
  107. package/stories/ox-input-select-buttons.stories.ts +0 -118
  108. package/stories/ox-input-signature.stories.ts +0 -75
  109. package/stories/ox-input-table-column-config.stories.ts +0 -109
  110. package/stories/ox-input-unit.stories.ts +0 -151
  111. package/stories/ox-input-value-map.stories.ts +0 -92
  112. package/stories/ox-input-value-ranges.stories.ts +0 -92
  113. package/stories/ox-input-work-shift.stories.ts +0 -106
  114. package/stories/ox-select-set-options.stories.ts +0 -208
  115. package/stories/ox-select.stories.ts +0 -181
  116. package/tsconfig.json +0 -25
  117. package/web-dev-server.config.mjs +0 -27
  118. package/web-test-runner.config.mjs +0 -41
  119. package/yarn-error.log +0 -17084
package/src/ox-select.ts DELETED
@@ -1,219 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import '@material/web/icon/icon.js'
6
- import '@operato/popup/ox-popup-list.js'
7
- import './ox-checkbox.js'
8
-
9
- import { css, html, render, PropertyValues } from 'lit'
10
- import { customElement, property, query, state } from 'lit/decorators.js'
11
-
12
- import { OxPopupList } from '@operato/popup'
13
-
14
- import { OxFormField } from './ox-form-field.js'
15
-
16
- @customElement('ox-select')
17
- export class OxSelect extends OxFormField {
18
- static styles = [
19
- css`
20
- :host {
21
- display: block;
22
- position: relative;
23
- border-bottom: 1px solid rgba(0, 0, 0, 0.15);
24
-
25
- --ox-select-padding: var(--spacing-tiny);
26
- --ox-select-font: var(--input-font);
27
- --ox-select-color: var(--input-color, var(--md-sys-color-on-surface-variant));
28
- --ox-select-icon-color: var(--theme-primary-text-color, var(--md-sys-color-on-surface-variant));
29
- --ox-select-icon-hover-color: var(--md-sys-color-on-primary-container, #3c3938);
30
- }
31
-
32
- div {
33
- width: 100%;
34
- box-sizing: border-box;
35
-
36
- display: flex;
37
- flex-direction: row;
38
- align-items: center;
39
- justify-content: center;
40
- cursor: pointer;
41
- padding: var(--ox-select-padding);
42
- font: var(--ox-select-font);
43
- color: var(--ox-select-color);
44
- }
45
-
46
- span {
47
- flex: 1;
48
- overflow: hidden;
49
- text-overflow: ellipsis;
50
- white-space: nowrap;
51
- gap: 4px;
52
- }
53
-
54
- md-icon {
55
- --md-icon-size: 16px;
56
- display: block;
57
- text-align: right;
58
- color: var(--ox-select-icon-color);
59
- opacity: 0.7;
60
- }
61
-
62
- div:hover md-icon {
63
- color: var(--md-sys-color-on-primary-container);
64
- }
65
- `
66
- ]
67
-
68
- @property({ type: String }) name: string = ''
69
- @property({ type: String }) placeholder: string = ''
70
-
71
- @state() label: string | string[] = ''
72
- @state() popupContainer: HTMLElement | null = null
73
- @state() observer: MutationObserver | null = null
74
-
75
- render() {
76
- const label =
77
- (this.label instanceof Array ? this.label.join(', ') : this.label?.trim()) ||
78
- (this.value instanceof Array ? this.value.join(', ') : this.value?.trim()) ||
79
- this.placeholder ||
80
- ''
81
-
82
- return html`
83
- <div @click=${this.expand}>
84
- <span data-reactive-tooltip>${label}</span>
85
- <md-icon>expand_more</md-icon>
86
- </div>
87
-
88
- <slot></slot>
89
- `
90
- }
91
-
92
- connectedCallback() {
93
- super.connectedCallback()
94
-
95
- this.setAttribute('tabindex', '0')
96
-
97
- this.addEventListener('keydown', (e: KeyboardEvent) => {
98
- e.preventDefault()
99
-
100
- if (e.key === ' ' || e.key === 'Spacebar' || e.key === 'ArrowDown') {
101
- this.expand()
102
- }
103
- })
104
-
105
- this.addEventListener('click', () => this.expand())
106
- }
107
-
108
- async updated(changes: PropertyValues<this>) {
109
- if (changes.has('value')) {
110
- const popupList = (this.popupContainer?.querySelector('ox-popup-list') ||
111
- this.querySelector('ox-popup-list')) as OxPopupList
112
-
113
- if (popupList) {
114
- popupList.value = this.value
115
- await this.requestUpdate()
116
-
117
- this.label = popupList.getSelectedLabels()
118
- }
119
- }
120
- }
121
-
122
- setOptions(
123
- options: string[] | { display: string; value: string }[],
124
- opt: { multiple?: boolean; withSearch?: boolean } = {}
125
- ) {
126
- const objOptions = options.map(option => {
127
- return typeof option == 'string' ? { display: option, value: option } : option
128
- })
129
-
130
- const { multiple, withSearch } = opt || {}
131
-
132
- const template = html`
133
- <ox-popup-list
134
- align-left
135
- nowrap
136
- ?multiple=${multiple}
137
- attr-selected=${multiple ? 'checked' : ''}
138
- ?with-search=${withSearch}
139
- >
140
- ${multiple
141
- ? html`<ox-checkbox
142
- @change=${(e: Event) => {
143
- const target = e.target as HTMLInputElement
144
- const options = Array.from(target.parentElement!.querySelectorAll('[option]')).filter(
145
- option => !option.hasAttribute('hidden')
146
- )
147
- options.forEach(option => ((option as HTMLInputElement).checked = target.checked))
148
-
149
- this.value = options
150
- .map(option =>
151
- (option as HTMLInputElement).checked ? (option as HTMLInputElement).value : undefined
152
- )
153
- .filter(Boolean)
154
- }}
155
- >set all</ox-checkbox
156
- >
157
- ${objOptions.map(
158
- option => html` <ox-checkbox option value=${option.value}>${option.display}</ox-checkbox> `
159
- )}`
160
- : html`${objOptions.map(option => html` <div option value=${option.value}>${option.display}</div> `)}`}
161
- </ox-popup-list>
162
- `
163
-
164
- render(template, this)
165
- }
166
-
167
- expand() {
168
- if (this.disabled) {
169
- return
170
- }
171
-
172
- const slotContent = this.renderRoot.querySelector('slot')?.assignedNodes() || []
173
-
174
- if (slotContent.length > 0) {
175
- const popupList = slotContent.find(content => content instanceof OxPopupList) as OxPopupList
176
-
177
- if (popupList) {
178
- const { left, bottom } = this.getBoundingClientRect()
179
-
180
- popupList.value = this.value
181
- popupList.style.width = `${this.offsetWidth}px`
182
- popupList.style.textWrap = 'nowrap'
183
-
184
- const selectHandler = async (e: Event) => {
185
- this.value = (e as CustomEvent).detail
186
-
187
- if (popupList) {
188
- await this.requestUpdate()
189
- this.label = popupList.getSelectedLabels()
190
- }
191
- }
192
- popupList.addEventListener('select', selectHandler)
193
-
194
- const closeHandler = (e: Event) => {
195
- /* popup이 close될 때 change 이벤트를 발생시킨다. */
196
- this.dispatchEvent(
197
- new CustomEvent('change', {
198
- bubbles: true,
199
- composed: true,
200
- detail: this.value
201
- })
202
- )
203
- popupList.removeEventListener('select', selectHandler)
204
- popupList.removeEventListener('close', closeHandler)
205
-
206
- this.appendChild(popupList)
207
- }
208
- popupList.addEventListener('close', closeHandler, { once: true })
209
-
210
- document.body.appendChild(popupList)
211
-
212
- popupList.open({
213
- left,
214
- top: bottom
215
- })
216
- }
217
- }
218
- }
219
- }
@@ -1,75 +0,0 @@
1
- import { LitElement, html, css } from 'lit'
2
- import { customElement, property, query } from 'lit/decorators.js'
3
-
4
- @customElement('ox-zoomable-image')
5
- export class OxZoomableImage extends LitElement {
6
- static styles = css`
7
- :host {
8
- display: block;
9
- overflow: hidden;
10
- position: relative;
11
- }
12
-
13
- img {
14
- transition: transform 0.25s ease;
15
- transform-origin: center;
16
- cursor: grab;
17
- }
18
- `
19
-
20
- @property({ type: String }) src = ''
21
-
22
- @query('img') image!: HTMLImageElement
23
-
24
- private scale: number = 1
25
- private startX: number = 0
26
- private startY: number = 0
27
- private x: number = 0
28
- private y: number = 0
29
- private dragging: boolean = false
30
-
31
- render() {
32
- return html`
33
- <img
34
- id="zoomableImage"
35
- src="${this.src}"
36
- @wheel="${this.handleWheel}"
37
- @mousedown="${this.handleMouseDown}"
38
- @mousemove="${this.handleMouseMove}"
39
- @mouseup="${this.handleMouseUp}"
40
- @mouseleave="${this.handleMouseUp}"
41
- style="transform: translate(${this.x}px, ${this.y}px) scale(${this.scale});"
42
- />
43
- `
44
- }
45
-
46
- private handleWheel(event: WheelEvent) {
47
- event.preventDefault()
48
- const delta = event.deltaY
49
- const zoomIntensity = 0.1
50
- this.scale += delta > 0 ? -zoomIntensity : zoomIntensity
51
- this.scale = Math.max(0.1, Math.min(this.scale, 4))
52
- this.requestUpdate()
53
- }
54
-
55
- private handleMouseDown(event: MouseEvent) {
56
- this.startX = event.clientX - this.x
57
- this.startY = event.clientY - this.y
58
- this.dragging = true
59
- const img = this.image as HTMLImageElement
60
- img.style.cursor = 'grabbing'
61
- }
62
-
63
- private handleMouseMove(event: MouseEvent) {
64
- if (!this.dragging) return
65
- this.x = event.clientX - this.startX
66
- this.y = event.clientY - this.startY
67
- this.requestUpdate()
68
- }
69
-
70
- private handleMouseUp() {
71
- this.dragging = false
72
- const img = this.image as HTMLImageElement
73
- img.style.cursor = 'grab'
74
- }
75
- }
@@ -1,89 +0,0 @@
1
- import '@material/web/all.js'
2
- import '../src/ox-buttons-radio.js'
3
-
4
- import { TemplateResult, html } from 'lit'
5
- import { ifDefined } from 'lit/directives/if-defined.js'
6
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
7
-
8
- export default {
9
- title: 'ox-buttons-radio',
10
- component: 'ox-buttons-radio',
11
- argTypes: {
12
- value: { control: 'boolean' },
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
- value?: string
25
- disabled?: boolean
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, disabled }: ArgTypes) => html`
29
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
30
-
31
- <link href="/themes/light.css" rel="stylesheet" />
32
- <link href="/themes/dark.css" rel="stylesheet" />
33
- <link href="/themes/spacing.css" rel="stylesheet" />
34
-
35
- <link
36
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
37
- rel="stylesheet"
38
- />
39
- <link
40
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
41
- rel="stylesheet"
42
- />
43
- <link
44
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
45
- rel="stylesheet"
46
- />
47
-
48
- <style>
49
- ${MDTypeScaleStyles.cssText}
50
- </style>
51
-
52
- <style>
53
- .container {
54
- height: 500px;
55
- text-align: center;
56
- padding: 20px;
57
- background-color: var(--md-sys-color-primary-container);
58
- color: var(--md-sys-color-on-primary-container);
59
-
60
- padding: 20px;
61
- }
62
-
63
- ox-buttons-radio {
64
- padding: 20px;
65
- }
66
- </style>
67
-
68
- <div class="container md-typescale-body-large-prominent">
69
- <ox-buttons-radio
70
- @change=${(e: CustomEvent) => {
71
- console.log('changed', e.detail)
72
- }}
73
- value=${ifDefined(value)}
74
- ?disabled=${disabled}
75
- >
76
- <md-filled-button data-value="1">Option 1</md-filled-button>
77
- <md-filled-button data-value="2">Option 2</md-filled-button>
78
- <md-outlined-button data-value="3">Option 3</md-outlined-button>
79
- <md-text-button trailing-icon>Open<md-icon slot="icon">upload</md-icon></md-text-button>
80
- <md-elevated-button>Elevated</md-elevated-button>
81
- </ox-buttons-radio>
82
- </div>
83
- `
84
-
85
- export const Regular = Template.bind({})
86
- Regular.args = {
87
- value: '',
88
- disabled: false
89
- }
@@ -1,111 +0,0 @@
1
- import '@material/web/all.js'
2
- import '../src/ox-checkbox.js'
3
-
4
- import { TemplateResult, html } from 'lit'
5
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
6
-
7
- export default {
8
- title: 'ox-checkbox',
9
- component: 'ox-checkbox',
10
- argTypes: {
11
- label: { control: 'text' },
12
- name: { control: 'text' },
13
- value: { control: 'boolean' },
14
- indeterminatable: { control: 'boolean' },
15
- indeterminate: { control: 'boolean' },
16
- disabled: { control: 'boolean' }
17
- }
18
- }
19
-
20
- interface Story<T> {
21
- (args: T): TemplateResult
22
- args?: Partial<T>
23
- argTypes?: Record<string, unknown>
24
- }
25
-
26
- interface ArgTypes {
27
- label?: string
28
- name?: string
29
- value?: boolean
30
- indeterminatable?: boolean
31
- indeterminate?: boolean
32
- disabled?: boolean
33
- }
34
-
35
- const Template: Story<ArgTypes> = ({
36
- label = 'Checkbox',
37
- name = 'hello',
38
- value,
39
- indeterminatable = false,
40
- indeterminate = false,
41
- disabled
42
- }: ArgTypes) => html`
43
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
44
-
45
- <link href="/themes/light.css" rel="stylesheet" />
46
- <link href="/themes/dark.css" rel="stylesheet" />
47
- <link href="/themes/spacing.css" rel="stylesheet" />
48
-
49
- <link
50
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
51
- rel="stylesheet"
52
- />
53
- <link
54
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
55
- rel="stylesheet"
56
- />
57
- <link
58
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
59
- rel="stylesheet"
60
- />
61
-
62
- <style>
63
- ${MDTypeScaleStyles.cssText}
64
- </style>
65
-
66
- <style>
67
- .container {
68
- height: 500px;
69
- text-align: center;
70
- padding: 20px;
71
- background-color: var(--md-sys-color-primary-container);
72
- color: var(--md-sys-color-on-primary-container);
73
- padding: 20px;
74
- }
75
- </style>
76
-
77
- <div class="container md-typescale-body-large-prominent">
78
- <ox-checkbox
79
- @click=${(e: MouseEvent) => console.log('clicked')}
80
- name=${name}
81
- .checked=${value}
82
- ?indeterminatable=${indeterminatable}
83
- ?indeterminate=${indeterminate}
84
- ?disabled=${disabled}
85
- >
86
- ${label}
87
- </ox-checkbox>
88
- </div>
89
- `
90
-
91
- export const Regular = Template.bind({})
92
- Regular.args = {
93
- label: 'label',
94
- name: 'label',
95
- value: false
96
- }
97
-
98
- export const CustomActivated = Template.bind({})
99
- CustomActivated.args = {
100
- label: 'Activated',
101
- name: 'activated',
102
- indeterminate: false,
103
- value: true
104
- }
105
-
106
- export const CustomIndeterminated = Template.bind({})
107
- CustomIndeterminated.args = {
108
- label: 'Indeterminated',
109
- indeterminatable: true,
110
- indeterminate: true
111
- }
@@ -1,77 +0,0 @@
1
- import '../src/ox-input-3axis.js'
2
- import '../src/locale/locale-picker.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-input-3axis',
9
- component: 'ox-input-3axis',
10
- argTypes: {
11
- value: { control: 'object' },
12
- disabled: { control: 'boolean' }
13
- }
14
- }
15
-
16
- interface Story<T> {
17
- (args: T): TemplateResult
18
- args?: Partial<T>
19
- argTypes?: Record<string, unknown>
20
- }
21
-
22
- interface ArgTypes {
23
- value?: object
24
- disabled?: boolean
25
- }
26
-
27
- const Template: Story<ArgTypes> = ({ value = {}, disabled }: ArgTypes) => html`
28
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
29
-
30
- <link href="/themes/light.css" rel="stylesheet" />
31
- <link href="/themes/dark.css" rel="stylesheet" />
32
- <link href="/themes/spacing.css" rel="stylesheet" />
33
-
34
- <link
35
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
36
- rel="stylesheet"
37
- />
38
- <link
39
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
40
- rel="stylesheet"
41
- />
42
- <link
43
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
44
- rel="stylesheet"
45
- />
46
-
47
- <style>
48
- ${MDTypeScaleStyles.cssText}
49
- </style>
50
-
51
- <style>
52
- .container {
53
- height: 500px;
54
- text-align: center;
55
- padding: 20px;
56
-
57
- background-color: var(--md-sys-color-primary-container);
58
- color: var(--md-sys-color-on-primary-container);
59
- }
60
- </style>
61
-
62
- <div class="container md-typescale-body-large-prominent">
63
- <ox-input-3axis
64
- @change=${(e: Event) => {
65
- console.log((e.target as HTMLInputElement).value)
66
- }}
67
- .value=${value}
68
- ?disabled=${disabled}
69
- >
70
- </ox-input-3axis>
71
- </div>
72
- `
73
-
74
- export const Regular = Template.bind({})
75
- Regular.args = {
76
- value: { x: 100, y: 120, z: 130 }
77
- }
@@ -1,106 +0,0 @@
1
- import '../src/ox-input-3dish.js'
2
- import '../src/locale/locale-picker.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-input-3dish',
9
- component: 'ox-input-3dish',
10
- argTypes: {
11
- value: { control: 'object' },
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
- name?: string
25
- value?: object
26
- disabled?: boolean
27
- }
28
-
29
- const Template: Story<ArgTypes> = ({ name = '3dish', value = [], disabled }: ArgTypes) => html`
30
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
31
-
32
- <link href="/themes/light.css" rel="stylesheet" />
33
- <link href="/themes/dark.css" rel="stylesheet" />
34
- <link href="/themes/spacing.css" rel="stylesheet" />
35
-
36
- <link
37
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
38
- rel="stylesheet"
39
- />
40
- <link
41
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
42
- rel="stylesheet"
43
- />
44
- <link
45
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
46
- rel="stylesheet"
47
- />
48
-
49
- <style>
50
- ${MDTypeScaleStyles.cssText}
51
- </style>
52
-
53
- <style>
54
- .container {
55
- height: 500px;
56
- text-align: center;
57
- padding: 20px;
58
-
59
- background-color: var(--md-sys-color-primary-container);
60
- color: var(--md-sys-color-on-primary-container);
61
- }
62
- </style>
63
-
64
- <div class="container md-typescale-body-large-prominent">
65
- <locale-picker></locale-picker>
66
- <br /><br />
67
-
68
- <ox-input-3dish
69
- @change=${(e: Event) => {
70
- console.log((e.target as HTMLInputElement).value)
71
- }}
72
- name=${name}
73
- .value=${value}
74
- ?disabled=${disabled}
75
- >
76
- </ox-input-3dish>
77
- </div>
78
- `
79
-
80
- export const Regular = Template.bind({})
81
- Regular.args = {
82
- name: '3dish',
83
- value: [
84
- {
85
- name: 'DAY',
86
- fromDate: -1,
87
- fromTime: '22:00',
88
- toDate: 0,
89
- toTime: '06:00'
90
- },
91
- {
92
- name: 'SWING',
93
- fromDate: 0,
94
- fromTime: '06:00',
95
- toDate: 0,
96
- toTime: '14:00'
97
- },
98
- {
99
- name: 'NIGHT',
100
- fromDate: 0,
101
- fromTime: '14:00',
102
- toDate: 0,
103
- toTime: '22:00'
104
- }
105
- ]
106
- }