@operato/input 2.0.0-alpha.57 → 2.0.0-alpha.62

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 (166) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/src/ox-input-barcode.js +2 -2
  3. package/dist/src/ox-input-barcode.js.map +1 -1
  4. package/dist/src/ox-input-code.d.ts +2 -3
  5. package/dist/src/ox-input-code.js +8 -15
  6. package/dist/src/ox-input-code.js.map +1 -1
  7. package/dist/src/ox-input-container.d.ts +1 -1
  8. package/dist/src/ox-input-container.js +2 -2
  9. package/dist/src/ox-input-container.js.map +1 -1
  10. package/dist/src/ox-input-crontab.d.ts +0 -1
  11. package/dist/src/ox-input-crontab.js +4 -7
  12. package/dist/src/ox-input-crontab.js.map +1 -1
  13. package/dist/src/ox-input-data.js +2 -2
  14. package/dist/src/ox-input-data.js.map +1 -1
  15. package/dist/src/ox-input-duration.d.ts +0 -1
  16. package/dist/src/ox-input-duration.js +3 -5
  17. package/dist/src/ox-input-duration.js.map +1 -1
  18. package/dist/src/ox-input-file.d.ts +1 -1
  19. package/dist/src/ox-input-file.js +9 -9
  20. package/dist/src/ox-input-file.js.map +1 -1
  21. package/dist/src/ox-input-i18n-label.d.ts +1 -1
  22. package/dist/src/ox-input-i18n-label.js +1 -1
  23. package/dist/src/ox-input-i18n-label.js.map +1 -1
  24. package/dist/src/ox-input-image.d.ts +1 -1
  25. package/dist/src/ox-input-image.js +4 -4
  26. package/dist/src/ox-input-image.js.map +1 -1
  27. package/dist/src/ox-input-key-values.d.ts +1 -1
  28. package/dist/src/ox-input-key-values.js +8 -8
  29. package/dist/src/ox-input-key-values.js.map +1 -1
  30. package/dist/src/ox-input-mass-fraction.d.ts +1 -1
  31. package/dist/src/ox-input-mass-fraction.js +18 -10
  32. package/dist/src/ox-input-mass-fraction.js.map +1 -1
  33. package/dist/src/ox-input-multiple-colors.d.ts +1 -1
  34. package/dist/src/ox-input-multiple-colors.js +4 -7
  35. package/dist/src/ox-input-multiple-colors.js.map +1 -1
  36. package/dist/src/ox-input-options.d.ts +1 -1
  37. package/dist/src/ox-input-options.js +3 -7
  38. package/dist/src/ox-input-options.js.map +1 -1
  39. package/dist/src/ox-input-partition-keys.d.ts +1 -1
  40. package/dist/src/ox-input-partition-keys.js +8 -10
  41. package/dist/src/ox-input-partition-keys.js.map +1 -1
  42. package/dist/src/ox-input-privilege.d.ts +0 -1
  43. package/dist/src/ox-input-privilege.js +0 -1
  44. package/dist/src/ox-input-privilege.js.map +1 -1
  45. package/dist/src/ox-input-search.d.ts +1 -1
  46. package/dist/src/ox-input-search.js +4 -4
  47. package/dist/src/ox-input-search.js.map +1 -1
  48. package/dist/src/ox-input-table.d.ts +1 -1
  49. package/dist/src/ox-input-table.js +12 -12
  50. package/dist/src/ox-input-table.js.map +1 -1
  51. package/dist/src/ox-input-unit-number.d.ts +1 -1
  52. package/dist/src/ox-input-unit-number.js +3 -3
  53. package/dist/src/ox-input-unit-number.js.map +1 -1
  54. package/dist/src/ox-input-value-map.js +13 -15
  55. package/dist/src/ox-input-value-map.js.map +1 -1
  56. package/dist/src/ox-input-value-ranges.js +13 -15
  57. package/dist/src/ox-input-value-ranges.js.map +1 -1
  58. package/dist/src/ox-input-work-shift.js +2 -5
  59. package/dist/src/ox-input-work-shift.js.map +1 -1
  60. package/dist/src/ox-select.d.ts +1 -1
  61. package/dist/src/ox-select.js +4 -4
  62. package/dist/src/ox-select.js.map +1 -1
  63. package/dist/stories/ox-input-3axis.stories.js +14 -1
  64. package/dist/stories/ox-input-3axis.stories.js.map +1 -1
  65. package/dist/stories/ox-input-3dish.stories.js +14 -1
  66. package/dist/stories/ox-input-3dish.stories.js.map +1 -1
  67. package/dist/stories/ox-input-angle.stories.js +13 -1
  68. package/dist/stories/ox-input-angle.stories.js.map +1 -1
  69. package/dist/stories/ox-input-barcode.stories.js +13 -1
  70. package/dist/stories/ox-input-barcode.stories.js.map +1 -1
  71. package/dist/stories/ox-input-code.stories.d.ts +4 -0
  72. package/dist/stories/ox-input-code.stories.js +18 -3
  73. package/dist/stories/ox-input-code.stories.js.map +1 -1
  74. package/dist/stories/ox-input-crontab.stories.js +13 -1
  75. package/dist/stories/ox-input-crontab.stories.js.map +1 -1
  76. package/dist/stories/ox-input-data.stories.d.ts +0 -4
  77. package/dist/stories/ox-input-data.stories.js +14 -4
  78. package/dist/stories/ox-input-data.stories.js.map +1 -1
  79. package/dist/stories/ox-input-duration.stories.js +13 -1
  80. package/dist/stories/ox-input-duration.stories.js.map +1 -1
  81. package/dist/stories/ox-input-file.stories.js +13 -1
  82. package/dist/stories/ox-input-file.stories.js.map +1 -1
  83. package/dist/stories/ox-input-hashtags.stories.js +13 -1
  84. package/dist/stories/ox-input-hashtags.stories.js.map +1 -1
  85. package/dist/stories/ox-input-i18n-label.stories.js +13 -1
  86. package/dist/stories/ox-input-i18n-label.stories.js.map +1 -1
  87. package/dist/stories/ox-input-key-values.stories.js +13 -1
  88. package/dist/stories/ox-input-key-values.stories.js.map +1 -1
  89. package/dist/stories/ox-input-mass-fraction.stories.js +13 -1
  90. package/dist/stories/ox-input-mass-fraction.stories.js.map +1 -1
  91. package/dist/stories/ox-input-multiple-colors.stories.js +21 -10
  92. package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -1
  93. package/dist/stories/ox-input-options.stories.js +13 -1
  94. package/dist/stories/ox-input-options.stories.js.map +1 -1
  95. package/dist/stories/ox-input-partition-keys.stories.js +13 -1
  96. package/dist/stories/ox-input-partition-keys.stories.js.map +1 -1
  97. package/dist/stories/ox-input-privilege.stories.js +13 -1
  98. package/dist/stories/ox-input-privilege.stories.js.map +1 -1
  99. package/dist/stories/ox-input-quantifier.stories.js +13 -1
  100. package/dist/stories/ox-input-quantifier.stories.js.map +1 -1
  101. package/dist/stories/ox-input-range.stories.js +13 -1
  102. package/dist/stories/ox-input-range.stories.js.map +1 -1
  103. package/dist/stories/ox-input-search.stories.js +13 -1
  104. package/dist/stories/ox-input-search.stories.js.map +1 -1
  105. package/dist/stories/ox-input-select-buttons.stories.js +13 -1
  106. package/dist/stories/ox-input-select-buttons.stories.js.map +1 -1
  107. package/dist/stories/ox-input-unit.stories.js +14 -1
  108. package/dist/stories/ox-input-unit.stories.js.map +1 -1
  109. package/dist/stories/ox-input-value-map.stories.js +13 -1
  110. package/dist/stories/ox-input-value-map.stories.js.map +1 -1
  111. package/dist/stories/ox-input-value-ranges.stories.js +13 -1
  112. package/dist/stories/ox-input-value-ranges.stories.js.map +1 -1
  113. package/dist/stories/ox-input-work-shift.stories.js +13 -1
  114. package/dist/stories/ox-input-work-shift.stories.js.map +1 -1
  115. package/dist/stories/ox-select.stories.js +13 -1
  116. package/dist/stories/ox-select.stories.js.map +1 -1
  117. package/dist/tsconfig.tsbuildinfo +1 -1
  118. package/package.json +6 -6
  119. package/src/ox-input-barcode.ts +2 -2
  120. package/src/ox-input-code.ts +6 -13
  121. package/src/ox-input-container.ts +2 -2
  122. package/src/ox-input-crontab.ts +4 -8
  123. package/src/ox-input-data.ts +2 -2
  124. package/src/ox-input-duration.ts +3 -6
  125. package/src/ox-input-file.ts +9 -9
  126. package/src/ox-input-i18n-label.ts +1 -1
  127. package/src/ox-input-image.ts +4 -4
  128. package/src/ox-input-key-values.ts +26 -20
  129. package/src/ox-input-mass-fraction.ts +18 -10
  130. package/src/ox-input-multiple-colors.ts +4 -7
  131. package/src/ox-input-options.ts +3 -7
  132. package/src/ox-input-partition-keys.ts +26 -22
  133. package/src/ox-input-privilege.ts +0 -2
  134. package/src/ox-input-search.ts +4 -4
  135. package/src/ox-input-table.ts +12 -12
  136. package/src/ox-input-unit-number.ts +3 -3
  137. package/src/ox-input-value-map.ts +15 -17
  138. package/src/ox-input-value-ranges.ts +15 -17
  139. package/src/ox-input-work-shift.ts +2 -5
  140. package/src/ox-select.ts +4 -4
  141. package/stories/ox-input-3axis.stories.ts +14 -1
  142. package/stories/ox-input-3dish.stories.ts +14 -1
  143. package/stories/ox-input-angle.stories.ts +13 -1
  144. package/stories/ox-input-barcode.stories.ts +13 -1
  145. package/stories/ox-input-code.stories.ts +25 -3
  146. package/stories/ox-input-crontab.stories.ts +13 -1
  147. package/stories/ox-input-data.stories.ts +14 -4
  148. package/stories/ox-input-duration.stories.ts +13 -1
  149. package/stories/ox-input-file.stories.ts +13 -1
  150. package/stories/ox-input-hashtags.stories.ts +13 -1
  151. package/stories/ox-input-i18n-label.stories.ts +13 -1
  152. package/stories/ox-input-key-values.stories.ts +13 -1
  153. package/stories/ox-input-mass-fraction.stories.ts +13 -1
  154. package/stories/ox-input-multiple-colors.stories.ts +21 -10
  155. package/stories/ox-input-options.stories.ts +13 -1
  156. package/stories/ox-input-partition-keys.stories.ts +13 -1
  157. package/stories/ox-input-privilege.stories.ts +13 -1
  158. package/stories/ox-input-quantifier.stories.ts +13 -1
  159. package/stories/ox-input-range.stories.ts +13 -1
  160. package/stories/ox-input-search.stories.ts +13 -1
  161. package/stories/ox-input-select-buttons.stories.ts +13 -1
  162. package/stories/ox-input-unit.stories.ts +14 -1
  163. package/stories/ox-input-value-map.stories.ts +13 -1
  164. package/stories/ox-input-value-ranges.stories.ts +13 -1
  165. package/stories/ox-input-work-shift.stories.ts +13 -1
  166. package/stories/ox-select.stories.ts +13 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/input",
3
3
  "description": "Webcomponents for input following open-wc recommendations",
4
4
  "author": "heartyoh@hatiolab.com",
5
- "version": "2.0.0-alpha.57",
5
+ "version": "2.0.0-alpha.62",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "license": "MIT",
@@ -194,11 +194,11 @@
194
194
  "@codemirror/theme-one-dark": "^6.1.2",
195
195
  "@codemirror/view": "^6.22.1",
196
196
  "@lit/localize": "^0.12.1",
197
- "@material/mwc-icon": "^0.27.0",
197
+ "@material/web": "^1.4.0",
198
198
  "@operato/color-picker": "^2.0.0-alpha.57",
199
- "@operato/i18n": "^2.0.0-alpha.57",
200
- "@operato/popup": "^2.0.0-alpha.57",
201
- "@operato/styles": "^2.0.0-alpha.57",
199
+ "@operato/i18n": "^2.0.0-alpha.59",
200
+ "@operato/popup": "^2.0.0-alpha.62",
201
+ "@operato/styles": "^2.0.0-alpha.62",
202
202
  "@operato/utils": "^2.0.0-alpha.57",
203
203
  "@polymer/paper-dropdown-menu": "^3.2.0",
204
204
  "@polymer/paper-item": "^3.0.1",
@@ -243,5 +243,5 @@
243
243
  "prettier --write"
244
244
  ]
245
245
  },
246
- "gitHead": "2786e62dc37ead8c5a858869baa5c083dce24e93"
246
+ "gitHead": "0265a1407b7a20729845d67410297cc50975e2a8"
247
247
  }
@@ -225,12 +225,12 @@ export class OxInputBarcode extends OxFormField {
225
225
  this.popup = OxPopup.open({
226
226
  template: html`
227
227
  <video></video>
228
- <mwc-icon
228
+ <md-icon
229
229
  style="position: fixed; right: 0; top: 0; color: red; tabindex: 0"
230
230
  @click=${() => {
231
231
  this.stopScan()
232
232
  }}
233
- >close</mwc-icon
233
+ >close</md-icon
234
234
  >
235
235
  `,
236
236
  width: '100vw',
@@ -5,8 +5,9 @@
5
5
  import { css, PropertyValues } from 'lit'
6
6
  import { customElement, property } from 'lit/decorators.js'
7
7
 
8
+ import { minimalSetup } from 'codemirror'
8
9
  import { history, historyKeymap, indentWithTab } from '@codemirror/commands'
9
- import { EditorView, highlightActiveLine, keymap } from '@codemirror/view'
10
+ import { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view'
10
11
  import { autocompletion, closeBrackets } from '@codemirror/autocomplete'
11
12
  import { bracketMatching, LanguageSupport, syntaxHighlighting } from '@codemirror/language'
12
13
  import { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark'
@@ -25,7 +26,7 @@ WEB Component for code-mirror code editor.
25
26
 
26
27
  Example:
27
28
 
28
- <ox-input-code .value=${text} tab-size="4" tab-as-space="true" language="javascript">
29
+ <ox-input-code .value=${text} language="javascript" show-line-numbers>
29
30
  </ox-input-code>
30
31
  */
31
32
  @customElement('ox-input-code')
@@ -51,8 +52,7 @@ export class OxInputCode extends OxFormField {
51
52
  * `value`는 에디터에서 작성중인 contents이다.
52
53
  */
53
54
  @property({ type: String }) value: string = ''
54
- @property({ type: Number, attribute: 'tab-size' }) tabSize: number = 2
55
- @property({ type: Boolean, attribute: 'tab-as-space' }) tabAsSpace: boolean = true
55
+ @property({ type: Boolean, attribute: 'show-line-numbers' }) showLineNumbers: boolean = false
56
56
  @property({ type: String }) language?: string = 'javascript'
57
57
 
58
58
  private _self_changing: boolean = false
@@ -88,7 +88,9 @@ export class OxInputCode extends OxFormField {
88
88
  this._editor = new EditorView({
89
89
  doc: this.value,
90
90
  extensions: [
91
+ minimalSetup,
91
92
  ...language,
93
+ ...(this.showLineNumbers ? [lineNumbers()] : []),
92
94
  bracketMatching(),
93
95
  closeBrackets(),
94
96
  history(),
@@ -129,15 +131,6 @@ export class OxInputCode extends OxFormField {
129
131
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))
130
132
  })
131
133
 
132
- // this._editor.contentDOM.addEventListener('change', async e => {
133
- // this._self_changing = true
134
- // this._changed = true
135
-
136
- // await this.updateComplete
137
-
138
- // this._self_changing = false
139
- // })
140
-
141
134
  return this._editor
142
135
  }
143
136
  }
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
  import '@operato/popup/ox-popup-list.js'
7
7
 
8
8
  import { css, html, LitElement } from 'lit'
@@ -17,7 +17,7 @@ export class OxInputContainer extends LitElement {
17
17
  render() {
18
18
  return html`
19
19
  <slot> </slot>
20
- <mwc-icon @click=${this.openPopupList.bind(this)}>menu</mwc-icon>
20
+ <md-icon @click=${this.openPopupList.bind(this)}>menu</md-icon>
21
21
 
22
22
  <ox-popup-list></ox-popup-list>
23
23
  `
@@ -2,8 +2,6 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-button'
6
-
7
5
  import { css, html, PropertyValues } from 'lit'
8
6
  import { customElement, property, state } from 'lit/decorators.js'
9
7
 
@@ -211,14 +209,12 @@ export class OxInputCrontab extends OxFormField {
211
209
  margin: -0.25rem;
212
210
  }
213
211
 
214
- mwc-button {
215
- background-color: var(--secondary-color);
212
+ button {
216
213
  border-radius: var(--button-border-radius);
217
- --mdc-theme-primary: #fff;
218
214
  margin: 0.25rem;
219
215
  }
220
- mwc-button:hover,
221
- mwc-button:active {
216
+ button:hover,
217
+ button:active {
222
218
  background-color: var(--primary-color);
223
219
  }
224
220
  `
@@ -399,7 +395,7 @@ export class OxInputCrontab extends OxFormField {
399
395
  }
400
396
 
401
397
  get focusableElements(): HTMLElement[] {
402
- return Array.from(this.renderRoot.querySelectorAll('select, input, mwc-button'))
398
+ return Array.from(this.renderRoot.querySelectorAll('select, input, button'))
403
399
  }
404
400
 
405
401
  firstUpdated() {
@@ -38,7 +38,7 @@ export class OxInputData extends OxFormField {
38
38
  font-size: small;
39
39
  }
40
40
 
41
- div[datatype] mwc-icon {
41
+ div[datatype] md-icon {
42
42
  margin-left: auto;
43
43
  }
44
44
 
@@ -88,7 +88,7 @@ export class OxInputData extends OxFormField {
88
88
  />
89
89
  <label for="object">object</label>
90
90
 
91
- <mwc-icon @click=${() => this._clearData()} title="delete">delete_forever</mwc-icon>
91
+ <md-icon @click=${() => this._clearData()} title="delete">delete_forever</md-icon>
92
92
  </div>
93
93
 
94
94
  <ox-input-code
@@ -2,8 +2,6 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-button'
6
-
7
5
  import { css, html } from 'lit'
8
6
  import { customElement, property, query } from 'lit/decorators.js'
9
7
 
@@ -71,12 +69,11 @@ export class OxInputDuration extends OxFormField {
71
69
  color: var(--button-color);
72
70
  cursor: pointer;
73
71
  }
72
+
74
73
  button + button {
75
74
  margin-left: -5px;
76
75
  }
77
- button mwc-icon {
78
- font-size: var(--fontsize-default);
79
- }
76
+
80
77
  button:focus,
81
78
  button:hover,
82
79
  button:active {
@@ -148,7 +145,7 @@ export class OxInputDuration extends OxFormField {
148
145
  }}
149
146
  ?disabled=${this.disabled}
150
147
  >
151
- <mwc-icon>backspace</mwc-icon>
148
+ <md-icon>backspace</md-icon>
152
149
  </button>
153
150
  </form>
154
151
  `
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
 
7
7
  import { css, html, PropertyValues } from 'lit'
8
8
  import { customElement, property, query } from 'lit/decorators.js'
@@ -32,9 +32,9 @@ export class OxInputFile extends OxFormField {
32
32
  font: var(--file-uploader-font) !important;
33
33
  color: var(--file-uploader-color);
34
34
  }
35
- :host > mwc-icon {
35
+ :host > md-icon {
36
36
  color: var(--file-uploader-icon-color);
37
- --mdc-icon-size: var(--file-uploader-icon-size, 36px);
37
+ --md-icon-size: var(--file-uploader-icon-size, 36px);
38
38
  }
39
39
 
40
40
  :host(.candrop) {
@@ -75,14 +75,14 @@ export class OxInputFile extends OxFormField {
75
75
  border-bottom: var(--file-uploader-li-border-bottom);
76
76
  font: normal 14px var(--theme-font);
77
77
  }
78
- li mwc-icon {
78
+ li md-icon {
79
79
  float: right;
80
80
  cursor: pointer;
81
81
  margin: var(--file-uploader-li-icon-margin);
82
82
  font-size: 1em;
83
83
  }
84
- li mwc-icon:hover,
85
- li mwc-icon:active {
84
+ li md-icon:hover,
85
+ li md-icon:active {
86
86
  color: var(--file-uploader-li-icon-focus-color);
87
87
  }
88
88
  `
@@ -104,7 +104,7 @@ export class OxInputFile extends OxFormField {
104
104
  var files: File[] = this.value || []
105
105
 
106
106
  return html`
107
- <mwc-icon>${this.icon || 'upload'}</mwc-icon>
107
+ <md-icon>${this.icon || 'upload'}</md-icon>
108
108
 
109
109
  <span>${this.description || 'drop files here!'}</span>
110
110
 
@@ -127,7 +127,7 @@ export class OxInputFile extends OxFormField {
127
127
  file => html`
128
128
  <li>
129
129
  - ${file.name}
130
- <mwc-icon
130
+ <md-icon
131
131
  @click=${(e: Event) => {
132
132
  if (this.disabled) {
133
133
  return
@@ -136,7 +136,7 @@ export class OxInputFile extends OxFormField {
136
136
  this.value = [...files]
137
137
  this._notifyChange()
138
138
  }}
139
- >delete_outline</mwc-icon
139
+ >delete_outline</md-icon
140
140
  >
141
141
  </li>
142
142
  `
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
 
7
7
  import { css, html } from 'lit'
8
8
  import { customElement, property, queryAll } from 'lit/decorators.js'
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
 
7
7
  import { css, html } from 'lit'
8
8
  import { customElement, query } from 'lit/decorators.js'
@@ -76,11 +76,11 @@ export class OxInputImage extends OxFormField {
76
76
  place-content: center;
77
77
  }
78
78
 
79
- mwc-icon {
79
+ md-icon {
80
80
  align-self: center;
81
81
 
82
82
  color: var(--file-uploader-icon-color, black);
83
- --mdc-icon-size: var(--file-uploader-icon-size, 36px);
83
+ --md-icon-size: var(--file-uploader-icon-size, 36px);
84
84
  }
85
85
  `
86
86
  ]
@@ -118,7 +118,7 @@ export class OxInputImage extends OxFormField {
118
118
  @change=${(e: Event) => this._onChangeValue(e)}
119
119
  ?disabled=${this.disabled}
120
120
  />
121
- <mwc-icon>upload</mwc-icon>
121
+ <md-icon>upload</md-icon>
122
122
  </label>
123
123
  </div>
124
124
  `
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
 
7
7
  import { css, html, nothing } from 'lit'
8
8
  import { customElement, property, queryAll } from 'lit/decorators.js'
@@ -50,7 +50,7 @@ export class OxInputKeyValues extends OxFormField {
50
50
  button + button {
51
51
  margin-left: -5px;
52
52
  }
53
- button mwc-icon {
53
+ button md-icon {
54
54
  font-size: var(--fontsize-default);
55
55
  }
56
56
  button:focus,
@@ -112,7 +112,7 @@ export class OxInputKeyValues extends OxFormField {
112
112
  tabindex="-1"
113
113
  ?disabled=${this.disabled}
114
114
  >
115
- <mwc-icon>remove</mwc-icon>
115
+ <md-icon>remove</md-icon>
116
116
  </button>
117
117
  <button
118
118
  class="record-action"
@@ -120,7 +120,7 @@ export class OxInputKeyValues extends OxFormField {
120
120
  tabindex="-1"
121
121
  ?disabled=${this.disabled}
122
122
  >
123
- <mwc-icon>arrow_upward</mwc-icon>
123
+ <md-icon>arrow_upward</md-icon>
124
124
  </button>
125
125
  <button
126
126
  class="record-action"
@@ -128,7 +128,7 @@ export class OxInputKeyValues extends OxFormField {
128
128
  tabindex="-1"
129
129
  ?disabled=${this.disabled}
130
130
  >
131
- <mwc-icon>arrow_downward</mwc-icon>
131
+ <md-icon>arrow_downward</md-icon>
132
132
  </button>
133
133
  </div>
134
134
  `
@@ -140,10 +140,10 @@ export class OxInputKeyValues extends OxFormField {
140
140
  <input type="text" data-key placeholder="key" value="" />
141
141
  <input type="text" data-value placeholder="value" value="" list="value-template" />
142
142
  <button class="record-action" @click=${(e: MouseEvent) => this._add()} tabindex="-1">
143
- <mwc-icon>add</mwc-icon>
143
+ <md-icon>add</md-icon>
144
144
  </button>
145
- <button class="hidden"><mwc-icon>add</mwc-icon></button>
146
- <button class="hidden"><mwc-icon>add</mwc-icon></button>
145
+ <button class="hidden"><md-icon>add</md-icon></button>
146
+ <button class="hidden"><md-icon>add</md-icon></button>
147
147
  </div>
148
148
  `}
149
149
 
@@ -260,13 +260,16 @@ export class OxInputKeyValues extends OxFormField {
260
260
  const deleted = array.splice(index, 1)
261
261
  array.splice(index + 1, 0, ...deleted)
262
262
 
263
- this.value = array.reduce((sum, record) => {
264
- const key = (record.querySelector('[data-key]') as HTMLInputElement).value
265
- const value = (record.querySelector('[data-value]') as HTMLInputElement).value
263
+ this.value = array.reduce(
264
+ (sum, record) => {
265
+ const key = (record.querySelector('[data-key]') as HTMLInputElement).value
266
+ const value = (record.querySelector('[data-value]') as HTMLInputElement).value
266
267
 
267
- sum[key] = value
268
- return sum
269
- }, {} as { [key: string]: string })
268
+ sum[key] = value
269
+ return sum
270
+ },
271
+ {} as { [key: string]: string }
272
+ )
270
273
 
271
274
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))
272
275
  }
@@ -283,13 +286,16 @@ export class OxInputKeyValues extends OxFormField {
283
286
  array.splice(index, 1)
284
287
  array.splice(index + 1, 0, record)
285
288
 
286
- this.value = array.reduce((sum, record) => {
287
- const key = (record.querySelector('[data-key]') as HTMLInputElement).value
288
- const value = (record.querySelector('[data-value]') as HTMLInputElement).value
289
+ this.value = array.reduce(
290
+ (sum, record) => {
291
+ const key = (record.querySelector('[data-key]') as HTMLInputElement).value
292
+ const value = (record.querySelector('[data-value]') as HTMLInputElement).value
289
293
 
290
- sum[key] = value
291
- return sum
292
- }, {} as { [key: string]: string })
294
+ sum[key] = value
295
+ return sum
296
+ },
297
+ {} as { [key: string]: string }
298
+ )
293
299
 
294
300
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))
295
301
  }
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
  import '@operato/popup/ox-popup-list.js'
7
7
  import './ox-select.js'
8
8
 
@@ -75,9 +75,6 @@ export class OxInputMassFraction extends OxFormField {
75
75
  color: var(--button-color);
76
76
  cursor: pointer;
77
77
  }
78
- button mwc-icon {
79
- font-size: var(--fontsize-default);
80
- }
81
78
  button:focus,
82
79
  button:hover,
83
80
  button:active {
@@ -87,6 +84,7 @@ export class OxInputMassFraction extends OxFormField {
87
84
  }
88
85
 
89
86
  input,
87
+ label,
90
88
  ox-select {
91
89
  border: 0;
92
90
  border-bottom: var(--border-dark-color);
@@ -135,6 +133,10 @@ export class OxInputMassFraction extends OxFormField {
135
133
  [right-end] {
136
134
  margin-left: auto;
137
135
  }
136
+
137
+ [hidden] {
138
+ opacity: 0;
139
+ }
138
140
  `
139
141
  ]
140
142
 
@@ -157,6 +159,12 @@ export class OxInputMassFraction extends OxFormField {
157
159
 
158
160
  return html`
159
161
  <div records>
162
+ <div data-header>
163
+ <label data-key>성분</label>
164
+ <label data-value>체적비(몰분율)</label>
165
+ <button hidden><md-icon>remove</md-icon></button>
166
+ <button hidden><md-icon>remove</md-icon></button>
167
+ </div>
160
168
  ${arrayed.length
161
169
  ? arrayed.map(
162
170
  (item, idx) => html`
@@ -181,7 +189,7 @@ export class OxInputMassFraction extends OxFormField {
181
189
  tabindex="-1"
182
190
  ?disabled=${this.disabled}
183
191
  >
184
- <mwc-icon>remove</mwc-icon>
192
+ <md-icon>remove</md-icon>
185
193
  </button>
186
194
  `
187
195
  : nothing}
@@ -191,7 +199,7 @@ export class OxInputMassFraction extends OxFormField {
191
199
  tabindex="-1"
192
200
  ?disabled=${this.disabled || idx === 0}
193
201
  >
194
- <mwc-icon>arrow_upward</mwc-icon>
202
+ <md-icon>arrow_upward</md-icon>
195
203
  </button>
196
204
  <button
197
205
  class="record-action"
@@ -199,7 +207,7 @@ export class OxInputMassFraction extends OxFormField {
199
207
  tabindex="-1"
200
208
  ?disabled=${this.disabled || idx === arrayed.length - 1}
201
209
  >
202
- <mwc-icon>arrow_downward</mwc-icon>
210
+ <md-icon>arrow_downward</md-icon>
203
211
  </button>
204
212
  </div>
205
213
  `
@@ -235,7 +243,7 @@ export class OxInputMassFraction extends OxFormField {
235
243
  list="value-template"
236
244
  />
237
245
  <button class="record-action" @click=${(e: MouseEvent) => this._add()} tabindex="-1">
238
- <mwc-icon>add</mwc-icon>
246
+ <md-icon>add</md-icon>
239
247
  </button>
240
248
  `
241
249
  : nothing}
@@ -247,7 +255,7 @@ export class OxInputMassFraction extends OxFormField {
247
255
  }}
248
256
  right-end
249
257
  >
250
- <mwc-icon>settings_suggest</mwc-icon>
258
+ <md-icon>settings_suggest</md-icon>
251
259
  </button>
252
260
  <button
253
261
  title="normalize fraction"
@@ -255,7 +263,7 @@ export class OxInputMassFraction extends OxFormField {
255
263
  this._normalize()
256
264
  }}
257
265
  >
258
- <mwc-icon>repartition</mwc-icon>
266
+ <md-icon>repartition</md-icon>
259
267
  </button>
260
268
  </div>
261
269
  `}
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import './ox-input-color.js'
6
- import '@material/mwc-icon'
6
+ import '@material/web/icon/icon.js'
7
7
 
8
8
  import { css, html } from 'lit'
9
9
  import { customElement, property, query, queryAll } from 'lit/decorators.js'
@@ -47,14 +47,11 @@ export class OxInputMultipleColors extends OxFormField {
47
47
  border: var(--button-border);
48
48
  border-radius: var(--border-radius);
49
49
  background-color: var(--button-background-color);
50
- padding: var(--padding-narrow) var(--padding-default);
51
50
  line-height: 0.8;
52
51
  color: var(--button-color);
53
52
  cursor: pointer;
54
53
  }
55
- button mwc-icon {
56
- font-size: var(--fontsize-default);
57
- }
54
+
58
55
  button:focus,
59
56
  button:hover,
60
57
  button:active {
@@ -80,7 +77,7 @@ export class OxInputMultipleColors extends OxFormField {
80
77
  (item, index) => html`
81
78
  <div>
82
79
  <button @click=${() => this._appendEditorColor()} data-index=${index} ?disabled=${this.disabled}>
83
- <mwc-icon>add</mwc-icon>
80
+ <md-icon>add</md-icon>
84
81
  </button>
85
82
  <ox-input-color .value=${item} ?disabled=${this.disabled}> </ox-input-color>
86
83
 
@@ -91,7 +88,7 @@ export class OxInputMultipleColors extends OxFormField {
91
88
  data-index=${index}
92
89
  ?disabled=${this.disabled}
93
90
  >
94
- <mwc-icon>remove</mwc-icon>
91
+ <md-icon>remove</md-icon>
95
92
  </button>
96
93
  `
97
94
  : html``}
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@material/mwc-icon'
5
+ import '@material/web/icon/icon.js'
6
6
 
7
7
  import { css, html, nothing } from 'lit'
8
8
  import { customElement, property } from 'lit/decorators.js'
@@ -32,7 +32,6 @@ export class OxInputOptions extends OxFormField {
32
32
  border: var(--button-border);
33
33
  border-radius: var(--border-radius);
34
34
  background-color: var(--button-background-color);
35
- padding: var(--padding-narrow) var(--padding-default);
36
35
  line-height: 0.8;
37
36
  color: var(--button-color);
38
37
  cursor: pointer;
@@ -40,9 +39,6 @@ export class OxInputOptions extends OxFormField {
40
39
  button + button {
41
40
  margin-left: -5px;
42
41
  }
43
- button mwc-icon {
44
- font-size: var(--fontsize-default);
45
- }
46
42
  button:focus,
47
43
  button:hover,
48
44
  button:active {
@@ -91,7 +87,7 @@ export class OxInputOptions extends OxFormField {
91
87
  tabindex="-1"
92
88
  ?disabled=${this.disabled}
93
89
  >
94
- <mwc-icon>remove</mwc-icon>
90
+ <md-icon>remove</md-icon>
95
91
  </button>
96
92
  </div>
97
93
  `
@@ -103,7 +99,7 @@ export class OxInputOptions extends OxFormField {
103
99
  <input type="text" data-text="" placeholder="text" value="" />
104
100
  <input type="text" data-value="" placeholder="value" value="" @change=${(e: Event) => this._add()} />
105
101
  <button class="record-action" @click=${(e: MouseEvent) => this._add()} tabindex="-1">
106
- <mwc-icon>add</mwc-icon>
102
+ <md-icon>add</md-icon>
107
103
  </button>
108
104
  </div>
109
105
  `}