@operato/input 8.0.0-beta.0 → 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 (98) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +7 -7
  3. package/.editorconfig +0 -29
  4. package/.storybook/main.js +0 -3
  5. package/.storybook/preview.js +0 -52
  6. package/.storybook/server.mjs +0 -8
  7. package/src/index.ts +0 -35
  8. package/src/locale/locale-codes.ts +0 -18
  9. package/src/locale/locale-picker.ts +0 -43
  10. package/src/locale/localization.ts +0 -15
  11. package/src/locales/en.ts +0 -30
  12. package/src/locales/ko.ts +0 -30
  13. package/src/locales/ms.ts +0 -30
  14. package/src/locales/zh.ts +0 -30
  15. package/src/ox-buttons-radio.ts +0 -140
  16. package/src/ox-checkbox.ts +0 -181
  17. package/src/ox-form-field.ts +0 -53
  18. package/src/ox-input-3axis.ts +0 -77
  19. package/src/ox-input-3dish.ts +0 -211
  20. package/src/ox-input-angle.ts +0 -73
  21. package/src/ox-input-barcode.ts +0 -318
  22. package/src/ox-input-code.ts +0 -139
  23. package/src/ox-input-color-gradient.ts +0 -349
  24. package/src/ox-input-color-stops.ts +0 -525
  25. package/src/ox-input-color.ts +0 -338
  26. package/src/ox-input-container.ts +0 -32
  27. package/src/ox-input-crontab.ts +0 -595
  28. package/src/ox-input-data.ts +0 -219
  29. package/src/ox-input-direction.ts +0 -92
  30. package/src/ox-input-duration.ts +0 -175
  31. package/src/ox-input-file.ts +0 -209
  32. package/src/ox-input-hashtags.ts +0 -185
  33. package/src/ox-input-i18n-label.ts +0 -140
  34. package/src/ox-input-image.ts +0 -168
  35. package/src/ox-input-key-values.ts +0 -301
  36. package/src/ox-input-layout/ox-input-card-layout.ts +0 -58
  37. package/src/ox-input-layout/ox-input-grid-layout.ts +0 -64
  38. package/src/ox-input-layout/ox-input-layout.ts +0 -77
  39. package/src/ox-input-mass-fraction.ts +0 -437
  40. package/src/ox-input-multiple-colors.ts +0 -135
  41. package/src/ox-input-options.ts +0 -216
  42. package/src/ox-input-partition-keys.ts +0 -303
  43. package/src/ox-input-privilege.ts +0 -163
  44. package/src/ox-input-quantifier.ts +0 -62
  45. package/src/ox-input-range.ts +0 -146
  46. package/src/ox-input-scene-component-id.ts +0 -73
  47. package/src/ox-input-search.ts +0 -126
  48. package/src/ox-input-select-buttons.ts +0 -75
  49. package/src/ox-input-signature.ts +0 -208
  50. package/src/ox-input-stack.ts +0 -136
  51. package/src/ox-input-switch.ts +0 -117
  52. package/src/ox-input-table-column-config.ts +0 -211
  53. package/src/ox-input-table.ts +0 -404
  54. package/src/ox-input-textarea.ts +0 -86
  55. package/src/ox-input-unit-number.ts +0 -354
  56. package/src/ox-input-value-map.ts +0 -342
  57. package/src/ox-input-value-ranges.ts +0 -363
  58. package/src/ox-input-work-shift.ts +0 -290
  59. package/src/ox-select-floor.ts +0 -246
  60. package/src/ox-select.ts +0 -219
  61. package/stories/image-for-select-floor.ts +0 -2
  62. package/stories/ox-buttons-radio.stories.ts +0 -89
  63. package/stories/ox-checkbox.stories.ts +0 -111
  64. package/stories/ox-input-3axis.stories.ts +0 -77
  65. package/stories/ox-input-3dish.stories.ts +0 -106
  66. package/stories/ox-input-angle.stories.ts +0 -84
  67. package/stories/ox-input-barcode.stories.ts +0 -117
  68. package/stories/ox-input-code.stories.ts +0 -99
  69. package/stories/ox-input-crontab.stories.ts +0 -82
  70. package/stories/ox-input-data.stories.ts +0 -82
  71. package/stories/ox-input-direction.stories.ts +0 -91
  72. package/stories/ox-input-duration.stories.ts +0 -84
  73. package/stories/ox-input-file.stories.ts +0 -111
  74. package/stories/ox-input-hashtags.stories.ts +0 -82
  75. package/stories/ox-input-i18n-label.stories.ts +0 -103
  76. package/stories/ox-input-key-values.stories.ts +0 -97
  77. package/stories/ox-input-mass-fraction.stories.ts +0 -102
  78. package/stories/ox-input-multiple-colors.stories.ts +0 -72
  79. package/stories/ox-input-options.stories.ts +0 -80
  80. package/stories/ox-input-partition-keys.stories.ts +0 -84
  81. package/stories/ox-input-privilege.stories.ts +0 -108
  82. package/stories/ox-input-quantifier.stories.ts +0 -80
  83. package/stories/ox-input-range.stories.ts +0 -89
  84. package/stories/ox-input-search.stories.ts +0 -91
  85. package/stories/ox-input-select-buttons.stories.ts +0 -118
  86. package/stories/ox-input-signature.stories.ts +0 -75
  87. package/stories/ox-input-switch.stories.ts +0 -91
  88. package/stories/ox-input-table-column-config.stories.ts +0 -109
  89. package/stories/ox-input-unit.stories.ts +0 -151
  90. package/stories/ox-input-value-map.stories.ts +0 -92
  91. package/stories/ox-input-value-ranges.stories.ts +0 -92
  92. package/stories/ox-input-work-shift.stories.ts +0 -106
  93. package/stories/ox-select-floor.stories.ts +0 -197
  94. package/stories/ox-select-set-options.stories.ts +0 -208
  95. package/stories/ox-select.stories.ts +0 -181
  96. package/tsconfig.json +0 -25
  97. package/web-dev-server.config.mjs +0 -27
  98. package/web-test-runner.config.mjs +0 -41
@@ -1,338 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import '@operato/color-picker/paper-color-picker.js'
6
-
7
- import { css, html } from 'lit'
8
- import { customElement, property } from 'lit/decorators.js'
9
-
10
- import { tinycolor } from '@thebespokepixel/es-tinycolor'
11
-
12
- import { OxFormField } from './ox-form-field'
13
-
14
- /**
15
- 색상을 입력하는데 사용되는 입력 컴포넌트이다.
16
- 화면상에는 두개의 입력 필드가 보이며, 하나는 색상값을 키보드로 직접 입력하는 입력 픽드이며,
17
- 다른 하나는 마우스로 클릭하여 컬러 파레트를 팝업 시키는 입력 필드이다.
18
- 컬러 파레트를 팝업시키는 입력필드는 현재 입력된 색상으로 표시된다.
19
-
20
- 색상값을 직접 입력하는 필드에서는 'white', 'red', 'yellow' 등 색상의미 단어를 사용할 수도 있고,
21
- #fff, #123456 와 같이 스타일에서 지정하는 방식의 3자리 및 6자리 숫자 표현도 가능하다.
22
- 컬러 파레트를 팝업시키는 입력 필드에서 색상을 지정하게되면, 모두 6자리 숫자 표현방식만을 사용한다.
23
-
24
- 의미 단어를 지원하는 색상은 다음과 같다.
25
-
26
- aliceblue : #f0f8ff<br>
27
- antiquewhite : #faebd7<br>
28
- aqua : #00ffff<br>
29
- aquamarine : #7fffd4<br>
30
- azure : #f0ffff<br>
31
- beige : #f5f5dc<br>
32
- bisque : #ffe4c4<br>
33
- black : #000000<br>
34
- blanchedalmond : #ffebcd<br>
35
- blue : #0000ff<br>
36
- blueviolet : #8a2be2<br>
37
- brown : #a52a2a<br>
38
- burlywood : #deb887<br>
39
- cadetblue : #5f9ea0<br>
40
- chartreuse : #7fff00<br>
41
- chocolate : #d2691e<br>
42
- coral : #ff7f50<br>
43
- cornflowerblue : #6495ed<br>
44
- cornsilk : #fff8dc<br>
45
- crimson : #dc143c<br>
46
- cyan : #00ffff<br>
47
- darkblue : #00008b<br>
48
- darkcyan : #008b8b<br>
49
- darkgoldenrod : #b8860b<br>
50
- darkgray : #a9a9a9<br>
51
- darkgreen : #006400<br>
52
- darkkhaki : #bdb76b<br>
53
- darkmagenta : #8b008b<br>
54
- darkolivegreen : #556b2f<br>
55
- darkorange : #ff8c00<br>
56
- darkorchid : #9932cc<br>
57
- darkred : #8b0000<br>
58
- darksalmon : #e9967a<br>
59
- darkseagreen : #8fbc8f<br>
60
- darkslateblue : #483d8b<br>
61
- darkslategray : #2f4f4f<br>
62
- darkturquoise : #00ced1<br>
63
- darkviolet : #9400d3<br>
64
- deeppink : #ff1493<br>
65
- deepskyblue : #00bfff<br>
66
- dimgray : #696969<br>
67
- dodgerblue : #1e90ff<br>
68
- firebrick : #b22222<br>
69
- floralwhite : #fffaf0<br>
70
- forestgreen : #228b22<br>
71
- fuchsia : #ff00ff<br>
72
- gainsboro : #dcdcdc<br>
73
- ghostwhite : #f8f8ff<br>
74
- gold : #ffd700<br>
75
- goldenrod : #daa520<br>
76
- gray : #808080<br>
77
- green : #008000<br>
78
- greenyellow : #adff2f<br>
79
- honeydew : #f0fff0<br>
80
- hotpink : #ff69b4<br>
81
- indianred : #cd5c5c<br>
82
- indigo : #4b0082<br>
83
- ivory : #fffff0<br>
84
- khaki : #f0e68c<br>
85
- lavender : #e6e6fa<br>
86
- lavenderblush : #fff0f5<br>
87
- lawngreen : #7cfc00<br>
88
- lemonchiffon : #fffacd<br>
89
- lightblue : #add8e6<br>
90
- lightcoral : #f08080<br>
91
- lightcyan : #e0ffff<br>
92
- lightgoldenrodyellow : #fafad2<br>
93
- lightgrey : #d3d3d3<br>
94
- lightgreen : #90ee90<br>
95
- lightpink : #ffb6c1<br>
96
- lightsalmon : #ffa07a<br>
97
- lightseagreen : #20b2aa<br>
98
- lightskyblue : #87cefa<br>
99
- lightslategray : #778899<br>
100
- lightsteelblue : #b0c4de<br>
101
- lightyellow : #ffffe0<br>
102
- lime : #00ff00<br>
103
- limegreen : #32cd32<br>
104
- linen : #faf0e6<br>
105
- magenta : #ff00ff<br>
106
- maroon : #800000<br>
107
- mediumaquamarine : #66cdaa<br>
108
- mediumblue : #0000cd<br>
109
- mediumorchid : #ba55d3<br>
110
- mediumpurple : #9370d8<br>
111
- mediumseagreen : #3cb371<br>
112
- mediumslateblue : #7b68ee<br>
113
- mediumspringgreen : #00fa9a<br>
114
- mediumturquoise : #48d1cc<br>
115
- mediumvioletred : #c71585<br>
116
- midnightblue : #191970<br>
117
- mintcream : #f5fffa<br>
118
- mistyrose : #ffe4e1<br>
119
- moccasin : #ffe4b5<br>
120
- navajowhite : #ffdead<br>
121
- navy : #000080<br>
122
- oldlace : #fdf5e6<br>
123
- olive : #808000<br>
124
- olivedrab : #6b8e23<br>
125
- orange : #ffa500<br>
126
- orangered : #ff4500<br>
127
- orchid : #da70d6<br>
128
- palegoldenrod : #eee8aa<br>
129
- palegreen : #98fb98<br>
130
- paleturquoise : #afeeee<br>
131
- palevioletred : #d87093<br>
132
- papayawhip : #ffefd5<br>
133
- peachpuff : #ffdab9<br>
134
- peru : #cd853f<br>
135
- pink : #ffc0cb<br>
136
- plum : #dda0dd<br>
137
- powderblue : #b0e0e6<br>
138
- purple : #800080<br>
139
- red : #ff0000<br>
140
- rosybrown : #bc8f8f<br>
141
- royalblue : #4169e1<br>
142
- saddlebrown : #8b4513<br>
143
- salmon : #fa8072<br>
144
- sandybrown : #f4a460<br>
145
- seagreen : #2e8b57<br>
146
- seashell : #fff5ee<br>
147
- sienna : #a0522d<br>
148
- silver : #c0c0c0<br>
149
- skyblue : #87ceeb<br>
150
- slateblue : #6a5acd<br>
151
- slategray : #708090<br>
152
- snow : #fffafa<br>
153
- springgreen : #00ff7f<br>
154
- steelblue : #4682b4<br>
155
- tan : #d2b48c<br>
156
- teal : #008080<br>
157
- thistle : #d8bfd8<br>
158
- tomato : #ff6347<br>
159
- turquoise : #40e0d0<br>
160
- violet : #ee82ee<br>
161
- wheat : #f5deb3<br>
162
- white : #ffffff<br>
163
- whitesmoke : #f5f5f5<br>
164
- yellow : #ffff00<br>
165
- yellowgreen : #9acd32<br>
166
-
167
- Example:
168
-
169
- <ox-input-color .value=${color}>
170
- </ox-input-color>
171
- */
172
-
173
- @customElement('ox-input-color')
174
- export class OxInputColor extends OxFormField {
175
- static styles = css`
176
- :host {
177
- position: relative;
178
- display: inline-flex;
179
- align-items: center;
180
- justify-content: flex-end;
181
- }
182
-
183
- input[type='text'] {
184
- width: 100%;
185
- border: 0;
186
- border-bottom: 1px solid rgba(0, 0, 0, 0.15);
187
- padding: var(--spacing-tiny);
188
- font: var(--input-font);
189
- color: var(--md-sys-color-on-primary-container);
190
- padding-right: 35px;
191
- }
192
- input:focus {
193
- outline: none;
194
- border-bottom: 1px solid var(--md-sys-color-on-primary-container);
195
- }
196
-
197
- a {
198
- -webkit-appearance: none;
199
- display: flex;
200
- position: absolute;
201
- width: 35px;
202
- height: 100%;
203
- box-sizing: border-box;
204
- align-items: center;
205
- justify-content: center;
206
- }
207
-
208
- span {
209
- width: 80%;
210
- height: 60%;
211
- border: 1px solid rgba(0, 0, 0, 0.15);
212
- border-radius: var(--border-radius);
213
- }
214
-
215
- span.transparent {
216
- background-color: #fefefe;
217
- background-image: linear-gradient(45deg, #cbcbcb 25%, transparent 25%, transparent 75%, #cbcbcb 75%, #cbcbcb),
218
- linear-gradient(45deg, #cbcbcb 25%, transparent 25%, transparent 75%, #cbcbcb 75%, #cbcbcb);
219
- background-position:
220
- 0 0,
221
- 9px 9px;
222
- background-size: 18px 18px;
223
- }
224
- `
225
-
226
- @property({ type: String }) value?: string
227
- @property({ type: Object }) properties: any
228
-
229
- render() {
230
- return html`
231
- <input
232
- id="text"
233
- type="text"
234
- .value=${this.value || ''}
235
- @change=${(e: Event) => this._onInputChanged(e)}
236
- .placeholder=${this.getAttribute('placeholder') || ''}
237
- ?disabled=${this.disabled}
238
- />
239
-
240
- <a @click=${(e: MouseEvent) => this.showPicker()}>
241
- <span id="color-thumbnail" .style="background-color:${this._thumbnail()}" class=${this._thumbnail()}> </span>
242
- </a>
243
- `
244
- }
245
-
246
- set colorString(colorString: string) {
247
- var color = tinycolor(colorString, {})
248
- var { withoutAlpha, valueType } = this.properties || {}
249
-
250
- if (color.isValid()) {
251
- if (valueType == 'hex' || withoutAlpha) {
252
- this.value = color.toHexString(false)
253
- } else this.value = color.toRgbString()
254
-
255
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
256
- }
257
- }
258
-
259
- _thumbnail() {
260
- return tinycolor(this.value || 'transparent', {}).toRgbString()
261
- }
262
-
263
- _onInputChanged(e: Event) {
264
- e.stopPropagation()
265
- this.value = (e.target as HTMLInputElement).value
266
-
267
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
268
- }
269
-
270
- /**
271
- * 외부에서 호출 가능한 메쏘드임.
272
- */
273
- showPicker() {
274
- if (this.disabled) {
275
- return
276
- }
277
-
278
- var { withoutAlpha } = this.properties || {}
279
-
280
- var color = tinycolor(this.value, {})
281
-
282
- var picker = document.createElement('paper-color-picker') as HTMLElement & {
283
- shape: string
284
- color: any
285
- colorAsString: string
286
- allowAlpha: boolean
287
- alwaysShowAlpha: boolean
288
- type: string
289
- _initialAlphaValueHack: number
290
- set: (name: string, value: number) => void
291
- open: () => void
292
- }
293
-
294
- picker.shape = 'huebox'
295
- picker.color = color
296
- picker.colorAsString = color.toRgbString()
297
- if (!withoutAlpha) {
298
- picker.allowAlpha = true
299
- picker.alwaysShowAlpha = true
300
- }
301
- picker.type = 'hsl'
302
- picker.style.setProperty('--paper-input-container-color', 'var(--md-sys-color-primary, gray)')
303
- picker.style.setProperty('--primary-text-color', 'var(--md-sys-color-primary, gray)')
304
-
305
- if (color.isValid()) {
306
- let rgb = color.toRgb() as { r: number; g: number; b: number }
307
- let alpha = color.getAlpha()
308
-
309
- picker._initialAlphaValueHack = alpha
310
-
311
- picker.set('immediateColor.red', rgb.r)
312
- picker.set('immediateColor.green', rgb.g)
313
- picker.set('immediateColor.blue', rgb.b)
314
-
315
- if (alpha != undefined) {
316
- picker.set('immediateColor.alpha', alpha)
317
- }
318
- }
319
-
320
- document.body.appendChild(picker)
321
-
322
- var _ = (e: Event) => {
323
- if (!(e as CustomEvent)?.detail?.confirmed) {
324
- return
325
- }
326
-
327
- if (picker.colorAsString) {
328
- this.colorString = picker.colorAsString
329
- }
330
-
331
- picker.removeEventListener('iron-overlay-closed', _)
332
- picker.parentNode?.removeChild(picker)
333
- }
334
- picker.addEventListener('iron-overlay-closed', _)
335
-
336
- setTimeout(() => picker.open())
337
- }
338
- }
@@ -1,32 +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
-
8
- import { css, html, LitElement } from 'lit'
9
- import { customElement, query } from 'lit/decorators.js'
10
-
11
- import { OxPopupList } from '@operato/popup'
12
-
13
- @customElement('ox-input-container')
14
- export class OxInputContainer extends LitElement {
15
- @query('ox-popup-list') popupList!: OxPopupList
16
-
17
- render() {
18
- return html`
19
- <slot> </slot>
20
- <md-icon @click=${this.openPopupList.bind(this)}>menu</md-icon>
21
-
22
- <ox-popup-list></ox-popup-list>
23
- `
24
- }
25
-
26
- openPopupList(e: MouseEvent) {
27
- this.popupList.open({
28
- left: 0,
29
- top: 0
30
- })
31
- }
32
- }