@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
@@ -1,136 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { css, html } from 'lit'
6
- import { customElement, property } from 'lit/decorators.js'
7
-
8
- import { OxFormField } from './ox-form-field'
9
-
10
- @customElement('ox-input-stack')
11
- export class OxInputStack extends OxFormField {
12
- static styles = [
13
- css`
14
- :host {
15
- display: block;
16
- }
17
-
18
- #add-floor {
19
- width: 100%;
20
- height: 20px;
21
- background-color: blue;
22
- color: white;
23
- }
24
-
25
- div {
26
- background-color: blue;
27
- width: calc(100% - 40px);
28
- width: -webkit-calc(100% - 40px);
29
- min-height: 20px;
30
- }
31
-
32
- div[active] {
33
- background-color: red;
34
- }
35
-
36
- div button {
37
- position: absolute;
38
- right: 10px;
39
- width: 30px;
40
- min-height: 20px;
41
- }
42
- `
43
- ]
44
-
45
- /**
46
- * `stack`은 stack에 의해 만들어진 층의 배열을 유지한다.
47
- */
48
- @property({ type: Array }) stack: { name: string; active?: boolean }[] = []
49
-
50
- /**
51
- * `activeIndex`은 현재 active된 층의 인덱스를 유지한다.
52
- */
53
- // @property({ type: Number }) activeIndex: number = 0
54
-
55
- render() {
56
- const stack = [...this.stack].reverse()
57
- const length = stack.length
58
-
59
- return html`
60
- <button id="add-floor" @click=${(e: Event) => this._onClickAddFloor(e)} ?disabled=${this.disabled}>+</button>
61
-
62
- ${stack.map(
63
- (item, index) => html`
64
- <div
65
- floor
66
- ?active=${item.active}
67
- @click=${(e: Event) => !this.disabled && this._onClickToActive(e)}
68
- idx=${length - index - 1}
69
- >
70
- ${item.name}
71
- <button @click=${(e: Event) => this._onClickRemoveFloor(e)} ?disabled=${this.disabled}>-</button>
72
- </div>
73
- `
74
- )}
75
- `
76
- }
77
-
78
- _notifyChange() {
79
- this.value = this.stack
80
-
81
- this.dispatchEvent(
82
- new CustomEvent('change', {
83
- detail: this.value,
84
- bubbles: true,
85
- composed: true
86
- })
87
- )
88
- }
89
-
90
- _onClickAddFloor(e: Event) {
91
- this.stack.push({ name: String(this.stack.length + 1) })
92
- this.requestUpdate()
93
-
94
- this._notifyChange()
95
- }
96
-
97
- _onClickToActive(e: Event) {
98
- const floor = (e.target as HTMLElement).closest('[floor]')
99
-
100
- if (!floor) {
101
- return
102
- }
103
-
104
- e.stopPropagation()
105
-
106
- const activeIndex = Number(floor.getAttribute('idx'))
107
- this.stack = this.stack.map((floor, index) => {
108
- return activeIndex === index
109
- ? {
110
- name: floor.name,
111
- active: true
112
- }
113
- : { name: floor.name }
114
- })
115
-
116
- this._notifyChange()
117
- }
118
-
119
- _onClickRemoveFloor(e: Event) {
120
- const floor = (e.target as HTMLElement).closest('[floor]')
121
-
122
- if (!floor) {
123
- return
124
- }
125
-
126
- e.stopPropagation()
127
-
128
- const idx = Number(floor.getAttribute('idx'))
129
-
130
- this.stack.splice(idx, 1)
131
-
132
- this.requestUpdate()
133
-
134
- this._notifyChange()
135
- }
136
- }
@@ -1,211 +0,0 @@
1
- import { css, html } from 'lit'
2
- import { customElement, property } from 'lit/decorators.js'
3
- import { OxFormField } from './ox-form-field'
4
- import '@material/web/icon/icon.js'
5
-
6
- export interface ColumnConfig {
7
- name: string
8
- label: string
9
- visible: boolean
10
- width: number
11
- order: number
12
- }
13
-
14
- @customElement('ox-input-table-column-config')
15
- export class OxInputTableColumnConfig extends OxFormField {
16
- static styles = [
17
- css`
18
- :host {
19
- display: block;
20
- padding: 4px;
21
- border: 1px solid var(--ox-input-table-column-config-border-color, var(--md-sys-color-on-surface));
22
- background-color: var(--ox-input-table-column-config-background-color, var(--md-sys-color-surface));
23
- color: var(--ox-input-table-column-config-color, var(--md-sys-color-on-surface));
24
- }
25
-
26
- table {
27
- width: auto;
28
- border-collapse: collapse;
29
- font-size: 12px;
30
- border: 0;
31
- }
32
-
33
- tr {
34
- border-bottom: 1px solid var(--ox-input-table-column-config-border-color, var(--md-sys-color-on-surface));
35
- }
36
-
37
- th,
38
- td {
39
- padding: 0 var(--spacing-small, 2px);
40
- text-align: left;
41
- }
42
-
43
- th {
44
- text-transform: capitalize;
45
- text-align: center;
46
- background-color: var(
47
- --ox-input-table-column-config-header-background-color,
48
- var(--md-sys-color-secondary-container)
49
- );
50
- color: var(--ox-input-table-column-config-header-background-color, var(--md-sys-color-on-secondary-container));
51
- white-space: nowrap;
52
- }
53
-
54
- th *,
55
- td * {
56
- vertical-align: middle;
57
- }
58
-
59
- td[width] {
60
- width: 60px;
61
- text-align: right;
62
- }
63
-
64
- input {
65
- font-size: 12px;
66
- padding: 0;
67
- margin: 0;
68
- border: none;
69
- width: 100%;
70
- box-sizing: border-box;
71
- outline: none;
72
- background-color: var(--ox-input-table-column-config-input-background-color, var(--md-sys-color-surface));
73
- color: var(--ox-input-table-column-config-input-color, var(--md-sys-color-on-surface));
74
- }
75
-
76
- input[type='number'] {
77
- text-align: right;
78
- }
79
-
80
- md-icon {
81
- cursor: pointer;
82
- padding: 0;
83
- margin: 0;
84
- border: none;
85
- background: none;
86
-
87
- --md-icon-size: 16px;
88
- }
89
-
90
- md-icon[disabled] {
91
- cursor: not-allowed;
92
- color: var(--ox-input-table-column-config-disabled-color, var(--md-sys-color-surface-variant, #ccc));
93
- }
94
- `
95
- ]
96
-
97
- @property({ type: Array }) value: ColumnConfig[] = []
98
-
99
- render() {
100
- console.log('this.value', this.value)
101
- return html`
102
- <table>
103
- <thead>
104
- <tr>
105
- <th></th>
106
- <th>name</th>
107
- <th>label</th>
108
- <th>width</th>
109
- <th></th>
110
- </tr>
111
- </thead>
112
- <tbody>
113
- ${(this.value || []).map(
114
- (col, index) => html`
115
- <tr name=${col.name}>
116
- <td>
117
- <input
118
- type="checkbox"
119
- .checked=${col.visible}
120
- @change=${(e: Event) => this._updateVisibility(e, index)}
121
- />
122
- </td>
123
- <td name>${col.name}</td>
124
- <td>
125
- <input type="text" .value=${col.label} @input=${(e: Event) => this._updateLabel(e, index)} />
126
- </td>
127
- <td width>
128
- <input
129
- type="number"
130
- .value=${String(col.width)}
131
- @input=${(e: Event) => this._updateWidth(e, index)}
132
- />
133
- </td>
134
- <td buttons>
135
- <md-icon class="icon-button" @click=${() => this._moveUp(index)} ?disabled=${index === 0}>
136
- arrow_upward
137
- </md-icon>
138
- <md-icon
139
- class="icon-button"
140
- @click=${() => this._moveDown(index)}
141
- ?disabled=${index === this.value.length - 1}
142
- >
143
- arrow_downward
144
- </md-icon>
145
- </td>
146
- </tr>
147
- `
148
- )}
149
- </tbody>
150
- </table>
151
- `
152
- }
153
-
154
- private _updateVisibility(event: Event, index: number) {
155
- const target = event.target as HTMLInputElement
156
- this.value[index].visible = target.checked
157
- this.requestUpdate()
158
- this._notifyChange()
159
- }
160
-
161
- private _updateLabel(event: Event, index: number) {
162
- const target = event.target as HTMLInputElement
163
- this.value[index].label = target.value
164
- this.requestUpdate()
165
- this._notifyChange()
166
- }
167
-
168
- private _updateWidth(event: Event, index: number) {
169
- const target = event.target as HTMLInputElement
170
- this.value[index].width = target.valueAsNumber
171
- this.requestUpdate()
172
- this._notifyChange()
173
- }
174
-
175
- private _moveUp(index: number) {
176
- if (index === 0) return
177
- const temp = this.value[index]
178
- this.value[index] = this.value[index - 1]
179
- this.value[index - 1] = temp
180
- this._updateOrder()
181
- this.requestUpdate()
182
- this._notifyChange()
183
- }
184
-
185
- private _moveDown(index: number) {
186
- if (index === this.value.length - 1) return
187
- const temp = this.value[index]
188
- this.value[index] = this.value[index + 1]
189
- this.value[index + 1] = temp
190
- this._updateOrder()
191
- this.requestUpdate()
192
- this._notifyChange()
193
- }
194
-
195
- private _updateOrder() {
196
- this.value = this.value.map((col, index) => ({
197
- ...col,
198
- order: index + 1
199
- }))
200
- }
201
-
202
- private _notifyChange() {
203
- this.dispatchEvent(
204
- new CustomEvent('change', {
205
- detail: this.value,
206
- bubbles: true,
207
- composed: true
208
- })
209
- )
210
- }
211
- }