@operato/input 8.0.0 → 9.0.0-beta.10

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 (211) hide show
  1. package/CHANGELOG.md +199 -23
  2. package/dist/src/index.d.ts +1 -0
  3. package/dist/src/index.js +1 -0
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/ox-buttons-radio.d.ts +1 -1
  6. package/dist/src/ox-buttons-radio.js +11 -13
  7. package/dist/src/ox-buttons-radio.js.map +1 -1
  8. package/dist/src/ox-checkbox.d.ts +1 -1
  9. package/dist/src/ox-checkbox.js +8 -11
  10. package/dist/src/ox-checkbox.js.map +1 -1
  11. package/dist/src/ox-form-field.js +5 -5
  12. package/dist/src/ox-form-field.js.map +1 -1
  13. package/dist/src/ox-input-3axis.d.ts +1 -1
  14. package/dist/src/ox-input-3axis.js +3 -3
  15. package/dist/src/ox-input-3axis.js.map +1 -1
  16. package/dist/src/ox-input-3dish.d.ts +2 -2
  17. package/dist/src/ox-input-3dish.js +8 -4
  18. package/dist/src/ox-input-3dish.js.map +1 -1
  19. package/dist/src/ox-input-angle.d.ts +1 -1
  20. package/dist/src/ox-input-angle.js +5 -3
  21. package/dist/src/ox-input-angle.js.map +1 -1
  22. package/dist/src/ox-input-barcode.js +26 -7
  23. package/dist/src/ox-input-barcode.js.map +1 -1
  24. package/dist/src/ox-input-code.d.ts +1 -1
  25. package/dist/src/ox-input-code.js +14 -17
  26. package/dist/src/ox-input-code.js.map +1 -1
  27. package/dist/src/ox-input-color-gradient.d.ts +3 -3
  28. package/dist/src/ox-input-color-gradient.js +10 -13
  29. package/dist/src/ox-input-color-gradient.js.map +1 -1
  30. package/dist/src/ox-input-color-stops.d.ts +28 -25
  31. package/dist/src/ox-input-color-stops.js +54 -46
  32. package/dist/src/ox-input-color-stops.js.map +1 -1
  33. package/dist/src/ox-input-color.d.ts +1 -1
  34. package/dist/src/ox-input-color.js +5 -3
  35. package/dist/src/ox-input-color.js.map +1 -1
  36. package/dist/src/ox-input-container.js +1 -0
  37. package/dist/src/ox-input-container.js.map +1 -1
  38. package/dist/src/ox-input-crontab.d.ts +1 -1
  39. package/dist/src/ox-input-crontab.js +11 -7
  40. package/dist/src/ox-input-crontab.js.map +1 -1
  41. package/dist/src/ox-input-data.d.ts +1 -1
  42. package/dist/src/ox-input-data.js +3 -3
  43. package/dist/src/ox-input-data.js.map +1 -1
  44. package/dist/src/ox-input-direction.d.ts +2 -1
  45. package/dist/src/ox-input-direction.js +38 -7
  46. package/dist/src/ox-input-direction.js.map +1 -1
  47. package/dist/src/ox-input-duration.d.ts +1 -1
  48. package/dist/src/ox-input-duration.js +8 -3
  49. package/dist/src/ox-input-duration.js.map +1 -1
  50. package/dist/src/ox-input-file.js +10 -9
  51. package/dist/src/ox-input-file.js.map +1 -1
  52. package/dist/src/ox-input-hashtags.js +6 -7
  53. package/dist/src/ox-input-hashtags.js.map +1 -1
  54. package/dist/src/ox-input-i18n-label.d.ts +1 -1
  55. package/dist/src/ox-input-i18n-label.js +7 -9
  56. package/dist/src/ox-input-i18n-label.js.map +1 -1
  57. package/dist/src/ox-input-image.js +3 -2
  58. package/dist/src/ox-input-image.js.map +1 -1
  59. package/dist/src/ox-input-key-values.d.ts +1 -1
  60. package/dist/src/ox-input-key-values.js +7 -9
  61. package/dist/src/ox-input-key-values.js.map +1 -1
  62. package/dist/src/ox-input-layout/ox-input-card-layout.js +4 -6
  63. package/dist/src/ox-input-layout/ox-input-card-layout.js.map +1 -1
  64. package/dist/src/ox-input-layout/ox-input-grid-layout.js +4 -6
  65. package/dist/src/ox-input-layout/ox-input-grid-layout.js.map +1 -1
  66. package/dist/src/ox-input-layout/ox-input-layout.d.ts +2 -2
  67. package/dist/src/ox-input-layout/ox-input-layout.js +7 -10
  68. package/dist/src/ox-input-layout/ox-input-layout.js.map +1 -1
  69. package/dist/src/ox-input-mass-fraction.d.ts +1 -1
  70. package/dist/src/ox-input-mass-fraction.js +9 -11
  71. package/dist/src/ox-input-mass-fraction.js.map +1 -1
  72. package/dist/src/ox-input-multiple-colors.js +5 -6
  73. package/dist/src/ox-input-multiple-colors.js.map +1 -1
  74. package/dist/src/ox-input-options.d.ts +1 -1
  75. package/dist/src/ox-input-options.js +5 -8
  76. package/dist/src/ox-input-options.js.map +1 -1
  77. package/dist/src/ox-input-partition-keys.d.ts +1 -1
  78. package/dist/src/ox-input-partition-keys.js +6 -8
  79. package/dist/src/ox-input-partition-keys.js.map +1 -1
  80. package/dist/src/ox-input-privilege.d.ts +1 -1
  81. package/dist/src/ox-input-privilege.js +6 -7
  82. package/dist/src/ox-input-privilege.js.map +1 -1
  83. package/dist/src/ox-input-quantifier.js +4 -6
  84. package/dist/src/ox-input-quantifier.js.map +1 -1
  85. package/dist/src/ox-input-range.js +6 -9
  86. package/dist/src/ox-input-range.js.map +1 -1
  87. package/dist/src/ox-input-scene-component-id.d.ts +1 -1
  88. package/dist/src/ox-input-scene-component-id.js +5 -7
  89. package/dist/src/ox-input-scene-component-id.js.map +1 -1
  90. package/dist/src/ox-input-search.d.ts +1 -1
  91. package/dist/src/ox-input-search.js +7 -4
  92. package/dist/src/ox-input-search.js.map +1 -1
  93. package/dist/src/ox-input-select-buttons.d.ts +1 -1
  94. package/dist/src/ox-input-select-buttons.js +6 -9
  95. package/dist/src/ox-input-select-buttons.js.map +1 -1
  96. package/dist/src/ox-input-signature.d.ts +4 -2
  97. package/dist/src/ox-input-signature.js +42 -21
  98. package/dist/src/ox-input-signature.js.map +1 -1
  99. package/dist/src/ox-input-stack.d.ts +1 -1
  100. package/dist/src/ox-input-stack.js +7 -10
  101. package/dist/src/ox-input-stack.js.map +1 -1
  102. package/dist/src/ox-input-switch.d.ts +10 -0
  103. package/dist/src/ox-input-switch.js +122 -0
  104. package/dist/src/ox-input-switch.js.map +1 -0
  105. package/dist/src/ox-input-table-column-config.d.ts +1 -1
  106. package/dist/src/ox-input-table-column-config.js +4 -7
  107. package/dist/src/ox-input-table-column-config.js.map +1 -1
  108. package/dist/src/ox-input-table.d.ts +2 -2
  109. package/dist/src/ox-input-table.js +8 -9
  110. package/dist/src/ox-input-table.js.map +1 -1
  111. package/dist/src/ox-input-textarea.d.ts +1 -1
  112. package/dist/src/ox-input-textarea.js +5 -7
  113. package/dist/src/ox-input-textarea.js.map +1 -1
  114. package/dist/src/ox-input-unit-number.d.ts +1 -1
  115. package/dist/src/ox-input-unit-number.js +8 -3
  116. package/dist/src/ox-input-unit-number.js.map +1 -1
  117. package/dist/src/ox-input-value-map.d.ts +2 -2
  118. package/dist/src/ox-input-value-map.js +9 -11
  119. package/dist/src/ox-input-value-map.js.map +1 -1
  120. package/dist/src/ox-input-value-ranges.d.ts +1 -1
  121. package/dist/src/ox-input-value-ranges.js +8 -10
  122. package/dist/src/ox-input-value-ranges.js.map +1 -1
  123. package/dist/src/ox-input-work-shift.js +4 -7
  124. package/dist/src/ox-input-work-shift.js.map +1 -1
  125. package/dist/src/ox-select-floor.d.ts +35 -0
  126. package/dist/src/ox-select-floor.js +237 -0
  127. package/dist/src/ox-select-floor.js.map +1 -0
  128. package/dist/src/ox-select.js +7 -10
  129. package/dist/src/ox-select.js.map +1 -1
  130. package/dist/stories/image-for-select-floor.d.ts +1 -0
  131. package/dist/stories/image-for-select-floor.js +2 -0
  132. package/dist/stories/image-for-select-floor.js.map +1 -0
  133. package/dist/stories/ox-buttons-radio.stories.js +1 -1
  134. package/dist/stories/ox-buttons-radio.stories.js.map +1 -1
  135. package/dist/stories/ox-checkbox.stories.js +1 -1
  136. package/dist/stories/ox-checkbox.stories.js.map +1 -1
  137. package/dist/stories/ox-input-3axis.stories.js +1 -1
  138. package/dist/stories/ox-input-3axis.stories.js.map +1 -1
  139. package/dist/stories/ox-input-3dish.stories.js +1 -1
  140. package/dist/stories/ox-input-3dish.stories.js.map +1 -1
  141. package/dist/stories/ox-input-angle.stories.js +1 -1
  142. package/dist/stories/ox-input-angle.stories.js.map +1 -1
  143. package/dist/stories/ox-input-barcode.stories.js +1 -1
  144. package/dist/stories/ox-input-barcode.stories.js.map +1 -1
  145. package/dist/stories/ox-input-code.stories.js +1 -1
  146. package/dist/stories/ox-input-code.stories.js.map +1 -1
  147. package/dist/stories/ox-input-crontab.stories.js +1 -1
  148. package/dist/stories/ox-input-crontab.stories.js.map +1 -1
  149. package/dist/stories/ox-input-data.stories.js +1 -1
  150. package/dist/stories/ox-input-data.stories.js.map +1 -1
  151. package/dist/stories/ox-input-direction.stories.js +12 -1
  152. package/dist/stories/ox-input-direction.stories.js.map +1 -1
  153. package/dist/stories/ox-input-duration.stories.js +1 -1
  154. package/dist/stories/ox-input-duration.stories.js.map +1 -1
  155. package/dist/stories/ox-input-file.stories.js +1 -1
  156. package/dist/stories/ox-input-file.stories.js.map +1 -1
  157. package/dist/stories/ox-input-hashtags.stories.js +1 -1
  158. package/dist/stories/ox-input-hashtags.stories.js.map +1 -1
  159. package/dist/stories/ox-input-i18n-label.stories.js +1 -1
  160. package/dist/stories/ox-input-i18n-label.stories.js.map +1 -1
  161. package/dist/stories/ox-input-key-values.stories.js +1 -1
  162. package/dist/stories/ox-input-key-values.stories.js.map +1 -1
  163. package/dist/stories/ox-input-mass-fraction.stories.js +1 -1
  164. package/dist/stories/ox-input-mass-fraction.stories.js.map +1 -1
  165. package/dist/stories/ox-input-multiple-colors.stories.js +1 -1
  166. package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -1
  167. package/dist/stories/ox-input-options.stories.js +1 -1
  168. package/dist/stories/ox-input-options.stories.js.map +1 -1
  169. package/dist/stories/ox-input-partition-keys.stories.js +1 -1
  170. package/dist/stories/ox-input-partition-keys.stories.js.map +1 -1
  171. package/dist/stories/ox-input-privilege.stories.js +1 -1
  172. package/dist/stories/ox-input-privilege.stories.js.map +1 -1
  173. package/dist/stories/ox-input-quantifier.stories.js +1 -1
  174. package/dist/stories/ox-input-quantifier.stories.js.map +1 -1
  175. package/dist/stories/ox-input-range.stories.js +1 -1
  176. package/dist/stories/ox-input-range.stories.js.map +1 -1
  177. package/dist/stories/ox-input-search.stories.js +1 -1
  178. package/dist/stories/ox-input-search.stories.js.map +1 -1
  179. package/dist/stories/ox-input-select-buttons.stories.js +1 -1
  180. package/dist/stories/ox-input-select-buttons.stories.js.map +1 -1
  181. package/dist/stories/ox-input-signature.stories.js +1 -1
  182. package/dist/stories/ox-input-signature.stories.js.map +1 -1
  183. package/dist/stories/ox-input-switch.stories.d.ts +38 -0
  184. package/dist/stories/ox-input-switch.stories.js +68 -0
  185. package/dist/stories/ox-input-switch.stories.js.map +1 -0
  186. package/dist/stories/ox-input-table-column-config.stories.js +1 -1
  187. package/dist/stories/ox-input-table-column-config.stories.js.map +1 -1
  188. package/dist/stories/ox-input-unit.stories.js +1 -1
  189. package/dist/stories/ox-input-unit.stories.js.map +1 -1
  190. package/dist/stories/ox-input-value-map.stories.js +1 -1
  191. package/dist/stories/ox-input-value-map.stories.js.map +1 -1
  192. package/dist/stories/ox-input-value-ranges.stories.js +1 -1
  193. package/dist/stories/ox-input-value-ranges.stories.js.map +1 -1
  194. package/dist/stories/ox-input-work-shift.stories.js +1 -1
  195. package/dist/stories/ox-input-work-shift.stories.js.map +1 -1
  196. package/dist/stories/ox-select-floor.stories.d.ts +45 -0
  197. package/dist/stories/ox-select-floor.stories.js +166 -0
  198. package/dist/stories/ox-select-floor.stories.js.map +1 -0
  199. package/dist/stories/ox-select-set-options.stories.js +1 -1
  200. package/dist/stories/ox-select-set-options.stories.js.map +1 -1
  201. package/dist/stories/ox-select.stories.js +1 -1
  202. package/dist/stories/ox-select.stories.js.map +1 -1
  203. package/dist/tsconfig.tsbuildinfo +1 -1
  204. package/package.json +25 -16
  205. package/assets/images/icon-editor-gradient-direction.png +0 -0
  206. package/assets/images/icon-properties-label.png +0 -0
  207. package/assets/images/icon-properties-line-type.png +0 -0
  208. package/assets/images/icon-properties-table.png +0 -0
  209. package/dist/src/ox-zoomable-image.d.ts +0 -17
  210. package/dist/src/ox-zoomable-image.js +0 -80
  211. package/dist/src/ox-z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AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAErC;IAAR,KAAK,EAAE;+CAAuD;AA7JpD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA8f1B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { OxFormField } from './ox-form-field'\n\nimport '@material/web/fab/fab.js'\nimport '@material/web/icon/icon.js'\n\nfunction createCronRegex(type: 'sec' | 'min' | 'hour' | 'day' | 'month' | 'dayOfWeek') {\n // https://gist.github.com/dkandalov/a2aed17cfdeb65243022\n var regexByField = {} as any\n regexByField['sec'] = '[0-5]?\\\\d'\n regexByField['min'] = '[0-5]?\\\\d'\n regexByField['hour'] = '[01]?\\\\d|2[0-3]'\n regexByField['day'] = '0?[1-9]|[12]\\\\d|3[01]'\n regexByField['month'] = '[1-9]|1[012]'\n regexByField['dayOfWeek'] = '[0-7]'\n\n var crontabFields = [type]\n if (!type) crontabFields = ['sec', 'min', 'hour', 'day', 'month', 'dayOfWeek']\n\n crontabFields.forEach(field => {\n var number = regexByField[field]\n var range =\n '(?:' +\n number +\n ')' +\n '(?:' +\n '(?:-|/|,' +\n ('dayOfWeek' === field ? '|#' : '') +\n ')' +\n '(?:' +\n number +\n ')' +\n ')?'\n if (field === 'dayOfWeek') range += '(?:L)?'\n if (field === 'month') range += '(?:L|W)?'\n regexByField[field] = '\\\\?|\\\\*|' + range + '(?:,' + range + ')*'\n })\n\n var monthValues = 'JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC'\n var monthRange = '(?:' + monthValues + ')(?:(?:-)(?:' + monthValues + '))?'\n regexByField['month'] += '|\\\\?|\\\\*|' + monthRange + '(?:,' + monthRange + ')*'\n\n var dayOfWeekValues = 'MON|TUE|WED|THU|FRI|SAT|SUN'\n var dayOfWeekRange = '(?:' + dayOfWeekValues + ')(?:(?:-)(?:' + dayOfWeekValues + '))?'\n regexByField['dayOfWeek'] += '|\\\\?|\\\\*|' + dayOfWeekRange + '(?:,' + dayOfWeekRange + ')*'\n\n if (!type)\n return (\n '^\\\\s*($' +\n '|#' +\n '|\\\\w+\\\\s*=' +\n '|' +\n '(' +\n regexByField['sec'] +\n ')\\\\s+' +\n '(' +\n regexByField['min'] +\n ')\\\\s+' +\n '(' +\n regexByField['hour'] +\n ')\\\\s+' +\n '(' +\n regexByField['day'] +\n ')\\\\s+' +\n '(' +\n regexByField['month'] +\n ')\\\\s+' +\n '(' +\n regexByField['dayOfWeek'] +\n ')(|\\\\s)+' +\n ')$'\n )\n else return `^${regexByField[type]}$`\n}\n\n@customElement('ox-input-crontab')\nexport class OxInputCrontab extends OxFormField {\n static styles = css`\n :host {\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n }\n\n :host * {\n box-sizing: border-box;\n }\n :host *:focus {\n outline: none;\n }\n\n form {\n display: grid;\n width: 100%;\n height: 100%;\n padding: 1rem;\n grid-template: auto auto 1fr auto / repeat(6, 1fr);\n grid-gap: 0.5rem;\n justify-content: center;\n align-items: center;\n overflow: auto;\n }\n\n label[for='example'] {\n text-align: right;\n grid-column: 3;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n text-transform: capitalize;\n }\n\n #example {\n grid-column: 4 / span 3;\n width: 100%;\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n background-color: var(--md-sys-color-on-primary);\n text-transform: capitalize;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n input {\n width: 100%;\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n input:focus {\n outline: none;\n border-color: var(--md-sys-color-secondary-fixed-dim);\n }\n\n input:invalid {\n border-color: var(--md-sys-color-error);\n color: var(--md-sys-color-error);\n }\n\n label {\n width: 100%;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n label:not([for='example']) {\n text-align: center;\n }\n\n #input-wrapper {\n grid-column: span 6;\n display: flex;\n flex-wrap: wrap;\n margin: 0 -0.25rem;\n }\n\n #input-wrapper > div {\n flex: 1;\n display: grid;\n grid-template-rows: 1fr auto;\n grid-gap: var(--spacing-small);\n min-width: 60px;\n max-width: 33%;\n margin: 0.25rem;\n }\n\n #tooltip {\n grid-column: span 6;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 0;\n margin: auto;\n grid-auto-rows: min-content;\n align-self: center;\n align-items: center;\n }\n\n #tooltip > div {\n padding: 0.25rem 0.5rem;\n border-bottom: var(--md-sys-color-on-surface-variant) 1px dashed;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n #tooltip > .crontab-value {\n text-align: right;\n color: var(--md-sys-color-surface-tint);\n }\n\n #tooltip > .crontab-description {\n text-align: left;\n color: var (--md-sys-color-on-primary-container);\n }\n\n #button-wrapper {\n grid-column: 1 / span 6;\n display: flex;\n flex-wrap: wrap-reverse;\n flex-direction: row-reverse;\n margin: -0.25rem;\n }\n\n md-fab {\n margin: 0.25rem;\n position: absolute;\n bottom: 1rem;\n left: 1rem;\n color: var(--md-sys-color-on-primary);\n }\n\n md-icon {\n font-size: 24px;\n }\n `\n\n @property({ type: String }) value?: string\n @property({ type: String }) second?: string\n @property({ type: String }) minute?: string\n @property({ type: String }) hour?: string\n @property({ type: String }) dayOfMonth?: string\n @property({ type: String }) month?: string\n @property({ type: String }) dayOfWeek?: string\n\n @state() tooltip: { value: string; description: string }[] = []\n\n render() {\n return html`\n <form>\n <label for=\"example\">${i18next.t('label.examples')}</label>\n <select\n id=\"example\"\n @change=${(e: Event) => (this.value = (e.currentTarget as HTMLInputElement).value)}\n .value=${this.value || ''}\n >\n <optgroup label=\"String(${i18next.t('label.second by second')})\">\n <option value=\"* * * * * *\">${i18next.t('text.every second')}</option>\n <option value=\"0/2 * * * * *\">${i18next.t('text.every 2 seconds')}</option>\n <option value=\"0/15 * * * * *\">${i18next.t('text.every 15 seconds')}</option>\n <option value=\"0/30 * * * * *\">${i18next.t('text.every 30 seconds')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.minute by minute')})\">\n <option value=\"0 * * * * *\">${i18next.t('text.every minute')}</option>\n <option value=\"0 0/2 * * * *\">${i18next.t('text.every 2 minutes')}</option>\n <option value=\"0 0/15 * * * *\">${i18next.t('text.every 15 minutes')}</option>\n <option value=\"0 0/30 * * * *\">${i18next.t('text.every half hour')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.hourly')})\">\n <option value=\"0 0 * * * *\">${i18next.t('text.every hour')}</option>\n <option value=\"0 0 0/2 * * *\">${i18next.t('text.every 2 hours')}</option>\n <option value=\"0 0 0/12 * * *\">${i18next.t('text.every 12 hours')}</option>\n <option value=\"0 0 10-19 * * *\">${i18next.t('text.every hour during working time')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.daily')})\">\n <option value=\"0 0 0 * * *\">${i18next.t('text.every day')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.weekly')})\">\n <option value=\"0 0 0 * * SUN\">${i18next.t('text.every sunday')}</option>\n <option value=\"0 0 0 * * 0\">${i18next.t('text.every sunday')}(2)</option>\n <option value=\"0 0 0 * * 1-5\">${i18next.t('text.every weekday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.monthly')})\">\n <option value=\"0 0 0 1 * *\">${i18next.t('text.the first day of every month')}</option>\n <option value=\"0 0 10 21 * *\">${i18next.t('text.10 am on every payday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.yearly')})\">\n <option value=\"0 0 0 1 1 *\">${i18next.t('text.the first day of every year')}</option>\n <option value=\"0 0 0 25 12 *\">${i18next.t('text.every christmas')}</option>\n </optgroup>\n </select>\n <div id=\"input-wrapper\">\n <div>\n <input\n id=\"second-input\"\n class=\"second\"\n type=\"text\"\n .value=${this.second || ''}\n @input=${(e: Event) => (this.second = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('second')\n }}\n pattern=${createCronRegex('sec')}\n required\n />\n <label for=\"second-input\" class=\"second\">${i18next.t('label.second')}</label>\n </div>\n <div>\n <input\n id=\"minute-input\"\n class=\"minute\"\n type=\"text\"\n .value=${this.minute || ''}\n @input=${(e: Event) => (this.minute = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('minute')\n }}\n pattern=${createCronRegex('min')}\n required\n />\n <label for=\"minute-input\" class=\"minute\">${i18next.t('label.minute')}</label>\n </div>\n <div>\n <input\n id=\"hour-input\"\n class=\"hour\"\n type=\"text\"\n .value=${this.hour || ''}\n @input=${(e: Event) => (this.hour = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('hour')\n }}\n pattern=${createCronRegex('hour')}\n required\n />\n <label for=\"hour-input\" class=\"hour\">${i18next.t('label.hour')}</label>\n </div>\n <div>\n <input\n id=\"day-of-month-input\"\n class=\"day-of-month\"\n type=\"text\"\n .value=${this.dayOfMonth || ''}\n @input=${(e: Event) => (this.dayOfMonth = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfMonth')\n }}\n pattern=${createCronRegex('day')}\n required\n />\n <label for=\"day-of-month-input\" class=\"day-of-month\">${i18next.t('label.day-of-month')}</label>\n </div>\n <div>\n <input\n id=\"month-input\"\n class=\"month\"\n type=\"text\"\n .value=${this.month || ''}\n @input=${(e: Event) => (this.month = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('month')\n }}\n pattern=${createCronRegex('month')}\n required\n />\n <label for=\"month-input\" class=\"month\">${i18next.t('label.month')}</label>\n </div>\n <div>\n <input\n id=\"day-of-week-input\"\n class=\"day-of-week\"\n type=\"text\"\n .value=${this.dayOfWeek || ''}\n @input=${(e: Event) => (this.dayOfWeek = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfWeek')\n }}\n pattern=${createCronRegex('dayOfWeek')}\n required\n />\n <label for=\"day-of-week-input\" class=\"day-of-week\">${i18next.t('label.day-of-week')}</label>\n </div>\n </div>\n <div id=\"tooltip\">\n ${this.tooltip.map(\n tip => html`\n <div class=\"crontab-value\">${tip.value}</div>\n <div class=\"crontab-description\">${i18next.t(`text.${tip.description}`)}</div>\n `\n )}\n </div>\n <div id=\"button-wrapper\">\n <md-fab\n title=\"clear\"\n @click=${(e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n this.value = ''\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n <md-icon slot=\"icon\">delete</md-icon>\n </md-fab>\n </div>\n </form>\n `\n }\n\n get focusableElements(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll('select, input, button'))\n }\n\n firstUpdated() {\n ;(this.renderRoot.querySelector('input') as HTMLInputElement).focus()\n this.renderRoot.addEventListener('change', this.onChange.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value')) {\n var values = (this.value || '').split(' ')\n\n if (values.length == 1) values = ['*', '*', '*', '*', '*', '*']\n else if (values.length == 5) values = ['0'].concat(values)\n\n this.second = values[0]\n this.minute = values[1]\n this.hour = values[2]\n this.dayOfMonth = values[3]\n this.month = values[4]\n this.dayOfWeek = values[5]\n }\n }\n\n showTooltip(type: 'second' | 'minute' | 'hour' | 'dayOfMonth' | 'month' | 'dayOfWeek') {\n switch (type) {\n case 'second':\n case 'minute':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-59',\n description: 'allowed values'\n }\n ]\n break\n case 'hour':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-23',\n description: 'allowed values'\n }\n ]\n break\n\n case 'dayOfMonth':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-31',\n description: 'allowed values'\n }\n ]\n break\n\n case 'month':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-12',\n description: 'allowed values'\n },\n {\n value: 'JAN-DEC',\n description: 'alternative single values'\n }\n ]\n break\n\n case 'dayOfWeek':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-6',\n description: 'allowed values'\n },\n {\n value: 'SUN-SAT',\n description: 'alternative single values'\n }\n ]\n break\n\n default:\n this.tooltip = []\n break\n }\n }\n\n onChange() {\n var form = this.renderRoot.querySelector('form') as HTMLFormElement\n var valid = form.checkValidity()\n if (!valid) {\n form.reportValidity()\n return\n }\n\n this.value = `${this.second} ${this.minute} ${this.hour} ${this.dayOfMonth} ${this.month} ${this.dayOfWeek}`\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
1
+ {"version":3,"file":"ox-input-crontab.js","sourceRoot":"","sources":["../../src/ox-input-crontab.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,0BAA0B,CAAA;AACjC,OAAO,4BAA4B,CAAA;AAEnC,SAAS,eAAe,CAAC,IAA4D;IACnF,yDAAyD;IACzD,IAAI,YAAY,GAAG,EAAS,CAAA;IAC5B,YAAY,CAAC,KAAK,CAAC,GAAG,WAAW,CAAA;IACjC,YAAY,CAAC,KAAK,CAAC,GAAG,WAAW,CAAA;IACjC,YAAY,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAA;IACxC,YAAY,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAA;IAC7C,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAA;IACtC,YAAY,CAAC,WAAW,CAAC,GAAG,OAAO,CAAA;IAEnC,IAAI,aAAa,GAAG,CAAC,IAAI,CAAC,CAAA;IAC1B,IAAI,CAAC,IAAI;QAAE,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;IAE9E,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC5B,IAAI,MAAM,GAAG,Y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AAA;IACH,CAAC;;AAxW2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAErC;IAAR,KAAK,EAAE;+CAAuD;AA7JpD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA8f1B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { OxFormField } from './ox-form-field.js'\n\nimport '@material/web/fab/fab.js'\nimport '@material/web/icon/icon.js'\n\nfunction createCronRegex(type: 'sec' | 'min' | 'hour' | 'day' | 'month' | 'dayOfWeek') {\n // https://gist.github.com/dkandalov/a2aed17cfdeb65243022\n var regexByField = {} as any\n regexByField['sec'] = '[0-5]?\\\\d'\n regexByField['min'] = '[0-5]?\\\\d'\n regexByField['hour'] = '[01]?\\\\d|2[0-3]'\n regexByField['day'] = '0?[1-9]|[12]\\\\d|3[01]'\n regexByField['month'] = '[1-9]|1[012]'\n regexByField['dayOfWeek'] = '[0-7]'\n\n var crontabFields = [type]\n if (!type) crontabFields = ['sec', 'min', 'hour', 'day', 'month', 'dayOfWeek']\n\n crontabFields.forEach(field => {\n var number = regexByField[field]\n var range =\n '(?:' +\n number +\n ')' +\n '(?:' +\n '(?:-|/|,' +\n ('dayOfWeek' === field ? '|#' : '') +\n ')' +\n '(?:' +\n number +\n ')' +\n ')?'\n if (field === 'dayOfWeek') range += '(?:L)?'\n if (field === 'month') range += '(?:L|W)?'\n regexByField[field] = '\\\\?|\\\\*|' + range + '(?:,' + range + ')*'\n })\n\n var monthValues = 'JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC'\n var monthRange = '(?:' + monthValues + ')(?:(?:-)(?:' + monthValues + '))?'\n regexByField['month'] += '|\\\\?|\\\\*|' + monthRange + '(?:,' + monthRange + ')*'\n\n var dayOfWeekValues = 'MON|TUE|WED|THU|FRI|SAT|SUN'\n var dayOfWeekRange = '(?:' + dayOfWeekValues + ')(?:(?:-)(?:' + dayOfWeekValues + '))?'\n regexByField['dayOfWeek'] += '|\\\\?|\\\\*|' + dayOfWeekRange + '(?:,' + dayOfWeekRange + ')*'\n\n if (!type)\n return (\n '^\\\\s*($' +\n '|#' +\n '|\\\\w+\\\\s*=' +\n '|' +\n '(' +\n regexByField['sec'] +\n ')\\\\s+' +\n '(' +\n regexByField['min'] +\n ')\\\\s+' +\n '(' +\n regexByField['hour'] +\n ')\\\\s+' +\n '(' +\n regexByField['day'] +\n ')\\\\s+' +\n '(' +\n regexByField['month'] +\n ')\\\\s+' +\n '(' +\n regexByField['dayOfWeek'] +\n ')(|\\\\s)+' +\n ')$'\n )\n else return `^${regexByField[type]}$`\n}\n\n@customElement('ox-input-crontab')\nexport class OxInputCrontab extends OxFormField {\n static styles = css`\n :host {\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n }\n\n :host * {\n box-sizing: border-box;\n }\n :host *:focus {\n outline: none;\n }\n\n form {\n display: grid;\n width: 100%;\n height: 100%;\n padding: 1rem;\n grid-template: auto auto 1fr auto / repeat(6, 1fr);\n grid-gap: 0.5rem;\n justify-content: center;\n align-items: center;\n overflow: auto;\n }\n\n label[for='example'] {\n text-align: right;\n grid-column: 3;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n text-transform: capitalize;\n }\n\n #example {\n grid-column: 4 / span 3;\n width: 100%;\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n background-color: var(--md-sys-color-on-primary);\n text-transform: capitalize;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n input {\n width: 100%;\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n input:focus {\n outline: none;\n border-color: var(--md-sys-color-secondary-fixed-dim);\n }\n\n input:invalid {\n border-color: var(--md-sys-color-error);\n color: var(--md-sys-color-error);\n }\n\n label {\n width: 100%;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n label:not([for='example']) {\n text-align: center;\n }\n\n #input-wrapper {\n grid-column: span 6;\n display: flex;\n flex-wrap: wrap;\n margin: 0 -0.25rem;\n }\n\n #input-wrapper > div {\n flex: 1;\n display: grid;\n grid-template-rows: 1fr auto;\n grid-gap: var(--spacing-small);\n min-width: 60px;\n max-width: 33%;\n margin: 0.25rem;\n }\n\n #tooltip {\n grid-column: span 6;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 0;\n margin: auto;\n grid-auto-rows: min-content;\n align-self: center;\n align-items: center;\n }\n\n #tooltip > div {\n padding: 0.25rem 0.5rem;\n border-bottom: var(--md-sys-color-on-surface-variant) 1px dashed;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n #tooltip > .crontab-value {\n text-align: right;\n color: var(--md-sys-color-surface-tint);\n }\n\n #tooltip > .crontab-description {\n text-align: left;\n color: var (--md-sys-color-on-primary-container);\n }\n\n #button-wrapper {\n grid-column: 1 / span 6;\n display: flex;\n flex-wrap: wrap-reverse;\n flex-direction: row-reverse;\n margin: -0.25rem;\n }\n\n md-fab {\n margin: 0.25rem;\n position: absolute;\n bottom: 1rem;\n left: 1rem;\n color: var(--md-sys-color-on-primary);\n }\n\n md-icon {\n font-size: 24px;\n }\n `\n\n @property({ type: String }) value?: string = undefined\n @property({ type: String }) second?: string\n @property({ type: String }) minute?: string\n @property({ type: String }) hour?: string\n @property({ type: String }) dayOfMonth?: string\n @property({ type: String }) month?: string\n @property({ type: String }) dayOfWeek?: string\n\n @state() tooltip: { value: string; description: string }[] = []\n\n render() {\n return html`\n <form>\n <label for=\"example\">${i18next.t('label.examples')}</label>\n <select\n id=\"example\"\n @change=${(e: Event) => (this.value = (e.currentTarget as HTMLInputElement).value)}\n .value=${this.value || ''}\n >\n <optgroup label=\"String(${i18next.t('label.second by second')})\">\n <option value=\"* * * * * *\">${i18next.t('text.every second')}</option>\n <option value=\"0/2 * * * * *\">${i18next.t('text.every 2 seconds')}</option>\n <option value=\"0/15 * * * * *\">${i18next.t('text.every 15 seconds')}</option>\n <option value=\"0/30 * * * * *\">${i18next.t('text.every 30 seconds')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.minute by minute')})\">\n <option value=\"0 * * * * *\">${i18next.t('text.every minute')}</option>\n <option value=\"0 0/2 * * * *\">${i18next.t('text.every 2 minutes')}</option>\n <option value=\"0 0/15 * * * *\">${i18next.t('text.every 15 minutes')}</option>\n <option value=\"0 0/30 * * * *\">${i18next.t('text.every half hour')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.hourly')})\">\n <option value=\"0 0 * * * *\">${i18next.t('text.every hour')}</option>\n <option value=\"0 0 0/2 * * *\">${i18next.t('text.every 2 hours')}</option>\n <option value=\"0 0 0/12 * * *\">${i18next.t('text.every 12 hours')}</option>\n <option value=\"0 0 10-19 * * *\">${i18next.t('text.every hour during working time')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.daily')})\">\n <option value=\"0 0 0 * * *\">${i18next.t('text.every day')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.weekly')})\">\n <option value=\"0 0 0 * * SUN\">${i18next.t('text.every sunday')}</option>\n <option value=\"0 0 0 * * 0\">${i18next.t('text.every sunday')}(2)</option>\n <option value=\"0 0 0 * * 1-5\">${i18next.t('text.every weekday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.monthly')})\">\n <option value=\"0 0 0 1 * *\">${i18next.t('text.the first day of every month')}</option>\n <option value=\"0 0 10 21 * *\">${i18next.t('text.10 am on every payday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.yearly')})\">\n <option value=\"0 0 0 1 1 *\">${i18next.t('text.the first day of every year')}</option>\n <option value=\"0 0 0 25 12 *\">${i18next.t('text.every christmas')}</option>\n </optgroup>\n </select>\n <div id=\"input-wrapper\">\n <div>\n <input\n id=\"second-input\"\n class=\"second\"\n type=\"text\"\n .value=${this.second || ''}\n @input=${(e: Event) => (this.second = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('second')\n }}\n pattern=${createCronRegex('sec')}\n required\n />\n <label for=\"second-input\" class=\"second\">${i18next.t('label.second')}</label>\n </div>\n <div>\n <input\n id=\"minute-input\"\n class=\"minute\"\n type=\"text\"\n .value=${this.minute || ''}\n @input=${(e: Event) => (this.minute = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('minute')\n }}\n pattern=${createCronRegex('min')}\n required\n />\n <label for=\"minute-input\" class=\"minute\">${i18next.t('label.minute')}</label>\n </div>\n <div>\n <input\n id=\"hour-input\"\n class=\"hour\"\n type=\"text\"\n .value=${this.hour || ''}\n @input=${(e: Event) => (this.hour = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('hour')\n }}\n pattern=${createCronRegex('hour')}\n required\n />\n <label for=\"hour-input\" class=\"hour\">${i18next.t('label.hour')}</label>\n </div>\n <div>\n <input\n id=\"day-of-month-input\"\n class=\"day-of-month\"\n type=\"text\"\n .value=${this.dayOfMonth || ''}\n @input=${(e: Event) => (this.dayOfMonth = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfMonth')\n }}\n pattern=${createCronRegex('day')}\n required\n />\n <label for=\"day-of-month-input\" class=\"day-of-month\">${i18next.t('label.day-of-month')}</label>\n </div>\n <div>\n <input\n id=\"month-input\"\n class=\"month\"\n type=\"text\"\n .value=${this.month || ''}\n @input=${(e: Event) => (this.month = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('month')\n }}\n pattern=${createCronRegex('month')}\n required\n />\n <label for=\"month-input\" class=\"month\">${i18next.t('label.month')}</label>\n </div>\n <div>\n <input\n id=\"day-of-week-input\"\n class=\"day-of-week\"\n type=\"text\"\n .value=${this.dayOfWeek || ''}\n @input=${(e: Event) => (this.dayOfWeek = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfWeek')\n }}\n pattern=${createCronRegex('dayOfWeek')}\n required\n />\n <label for=\"day-of-week-input\" class=\"day-of-week\">${i18next.t('label.day-of-week')}</label>\n </div>\n </div>\n <div id=\"tooltip\">\n ${this.tooltip.map(\n tip => html`\n <div class=\"crontab-value\">${tip.value}</div>\n <div class=\"crontab-description\">${i18next.t(`text.${tip.description}`)}</div>\n `\n )}\n </div>\n <div id=\"button-wrapper\">\n <md-fab\n title=\"clear\"\n @click=${(e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n this.value = ''\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n <md-icon slot=\"icon\">delete</md-icon>\n </md-fab>\n </div>\n </form>\n `\n }\n\n get focusableElements(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll('select, input, button'))\n }\n\n firstUpdated() {\n ;(this.renderRoot.querySelector('input') as HTMLInputElement).focus()\n this.renderRoot.addEventListener('change', this.onChange.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value')) {\n var values = (this.value || '').split(' ')\n\n if (values.length == 1) values = ['*', '*', '*', '*', '*', '*']\n else if (values.length == 5) values = ['0'].concat(values)\n\n this.second = values[0]\n this.minute = values[1]\n this.hour = values[2]\n this.dayOfMonth = values[3]\n this.month = values[4]\n this.dayOfWeek = values[5]\n }\n }\n\n showTooltip(type: 'second' | 'minute' | 'hour' | 'dayOfMonth' | 'month' | 'dayOfWeek') {\n switch (type) {\n case 'second':\n case 'minute':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-59',\n description: 'allowed values'\n }\n ]\n break\n case 'hour':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-23',\n description: 'allowed values'\n }\n ]\n break\n\n case 'dayOfMonth':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-31',\n description: 'allowed values'\n }\n ]\n break\n\n case 'month':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-12',\n description: 'allowed values'\n },\n {\n value: 'JAN-DEC',\n description: 'alternative single values'\n }\n ]\n break\n\n case 'dayOfWeek':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-6',\n description: 'allowed values'\n },\n {\n value: 'SUN-SAT',\n description: 'alternative single values'\n }\n ]\n break\n\n default:\n this.tooltip = []\n break\n }\n }\n\n onChange() {\n var form = this.renderRoot.querySelector('form') as HTMLFormElement\n var valid = form.checkValidity()\n if (!valid) {\n form.reportValidity()\n return\n }\n\n this.value = `${this.second} ${this.minute} ${this.hour} ${this.dayOfMonth} ${this.month} ${this.dayOfWeek}`\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import './ox-input-code';
1
+ import './ox-input-code.js';
2
2
  import { OxFormField } from './ox-form-field.js';
3
3
  import 'ses';
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import './ox-input-code';
2
+ import './ox-input-code.js';
3
3
  import { css, html } from 'lit';
4
4
  import { customElement } from 'lit/decorators.js';
5
5
  import { live } from 'lit/directives/live.js';
@@ -15,7 +15,7 @@ Example:
15
15
  </ox-input-data>
16
16
  */
17
17
  let OxInputData = class OxInputData extends OxFormField {
18
- static { this.styles = [
18
+ static styles = [
19
19
  css `
20
20
  :host {
21
21
  display: flex;
@@ -50,7 +50,7 @@ let OxInputData = class OxInputData extends OxFormField {
50
50
  overflow: auto;
51
51
  }
52
52
  `
53
- ]; }
53
+ ];
54
54
  render() {
55
55
  const valueType = typeof this.value;
56
56
  return html `
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-data.js","sourceRoot":"","sources":["../../src/ox-input-data.ts"],"names":[],"mappings":";AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KA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K,QAAQ;gBACX,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;YACtC,KAAK,WAAW;gBACd,OAAO,EAAE,CAAA;YACX;gBACE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAC7B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;;AArMU,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAsMvB","sourcesContent":["import './ox-input-code'\n\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { OxFormField } from './ox-form-field.js'\nimport { OxInputCode } from './ox-input-code.js'\nimport { isEqual } from 'lodash-es'\nimport 'ses'\n\n/**\nWEB Component for code-mirror based data editor.\n\nExample:\n\n <ox-input-data value=${text}>\n </ox-input-data>\n*/\n@customElement('ox-input-data')\nexport class OxInputData extends OxFormField {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n }\n\n div.datatype {\n display: flex;\n align-items: center;\n margin-bottom: var(--spacing-small);\n padding: var(--spacing-small);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-fixed-dim);\n border-radius: var(--md-sys-shape-corner-small);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n div.datatype md-icon {\n margin-left: auto;\n color: var(--md-sys-color-primary);\n cursor: pointer;\n }\n div.datatype label {\n margin-right: var(--spacing-small);\n }\n\n ox-input-code {\n flex: 1;\n max-width: 260px;\n overflow: auto;\n }\n `\n ]\n\n render() {\n const valueType = typeof this.value\n\n return html`\n <div class=\"datatype\">\n <input\n id=\"string\"\n type=\"radio\"\n name=\"data-type\"\n data-value=\"string\"\n .checked=${live(valueType == 'string')}\n @click=${() => this._setDataType('string')}\n ?disabled=${this.disabled}\n />\n <label for=\"string\">string</label>\n\n <input\n id=\"number\"\n type=\"radio\"\n name=\"data-type\"\n data-value=\"number\"\n .checked=${live(valueType == 'number')}\n @click=${() => this._setDataType('number')}\n ?disabled=${this.disabled}\n />\n <label for=\"number\">number</label>\n\n <input\n id=\"object\"\n type=\"radio\"\n name=\"data-type\"\n data-value=\"object\"\n .checked=${live(valueType == 'object')}\n @click=${() => this._setDataType('object')}\n ?disabled=${this.disabled}\n />\n <label for=\"object\">object</label>\n\n <md-icon @click=${() => this._clearData()} title=\"delete\">delete_forever</md-icon>\n </div>\n\n <ox-input-code\n .value=${this._getStringData(this.value)}\n language=\"text\"\n editor\n ?disabled=${this.disabled}\n @change=${(e: CustomEvent) => {\n e.stopPropagation()\n this._setDataTypeAndValue(valueType, (e.target as any).value)\n }}\n >\n </ox-input-code>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', e => {\n e.stopPropagation()\n\n const target = e.target as OxInputCode\n if (target.hasAttribute('editor')) {\n if (this.value === undefined && target.value == '') {\n return\n }\n this.value = target.value\n }\n })\n }\n\n _setDataTypeAndValue(type: string | undefined | null, value: any) {\n /* value must be a string */\n try {\n switch (type) {\n case 'number':\n if (!isNaN(Number(value))) {\n value = Number(value)\n }\n break\n case 'object':\n const compartment = new Compartment()\n value = compartment.evaluate(`(${value})`)\n break\n }\n } catch (e) {\n console.error('Error parsing value:', e)\n }\n\n if (isEqual(this.value, value)) {\n return\n }\n\n this.value = value\n\n this.requestUpdate()\n this._onAfterValueChange()\n }\n\n _setDataType(type: string | undefined | null) {\n if (typeof this.value == type) {\n return\n }\n\n var value = this.value\n\n try {\n switch (type) {\n case 'string':\n value = this._getStringData(value)\n break\n case 'number':\n if (!isNaN(value)) {\n value = Number(value)\n }\n break\n case 'object':\n const compartment = new Compartment()\n value = compartment.evaluate(`(${value})`)\n break\n }\n } catch (e) {\n console.error('Error setting data type:', e)\n }\n\n if (isEqual(this.value, value)) {\n this.requestUpdate()\n return\n }\n\n this.value = value\n\n this.requestUpdate()\n this._onAfterValueChange()\n }\n\n _clearData() {\n this.value = undefined\n this._onAfterValueChange()\n }\n\n _getStringData(data: any) {\n const type = typeof data\n\n switch (type) {\n case 'object':\n return JSON.stringify(data, null, 1)\n case 'undefined':\n return ''\n default:\n return String(data) || ''\n }\n }\n\n async _onAfterValueChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true\n })\n )\n }\n}\n"]}
1
+ {"version":3,"file":"ox-input-data.js","sourceRoot":"","sources":["../../src/ox-input-data.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,CAAA;AAEZ;;;;;;;EAOE;AAEK,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAC1C,MAAM,CAAC,MAAM,GAAG;QACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;KACF,CAAA;IAED,MAAM;QACJ,MAAM,SAAS,GAAG,OAAO,IAAI,CAAC,KAAK,CAAA;QAEnC,OAAO,IAAI,CAAA;;;;;;;qBAOM,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC;mBAC7B,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;sBAC9B,IAAI,CAAC,QAAQ;;;;;;;;;qBASd,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC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OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC,CAAC,CAAA;QAC9C,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,aAAa,EAAE,CAAA;YACpB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAElB,IAAI,CAAC,aAAa,EAAE,CAAA;QACpB,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;QACtB,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED,cAAc,CAAC,IAAS;QACtB,MAAM,IAAI,GAAG,OAAO,IAAI,CAAA;QAExB,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;YACtC,KAAK,WAAW;gBACd,OAAO,EAAE,CAAA;YACX;gBACE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAC7B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;;AArMU,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAsMvB","sourcesContent":["import './ox-input-code.js'\n\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { OxFormField } from './ox-form-field.js'\nimport { OxInputCode } from './ox-input-code.js'\nimport { isEqual } from 'lodash-es'\nimport 'ses'\n\n/**\nWEB Component for code-mirror based data editor.\n\nExample:\n\n <ox-input-data value=${text}>\n </ox-input-data>\n*/\n@customElement('ox-input-data')\nexport class OxInputData extends OxFormField {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n }\n\n div.datatype {\n display: flex;\n align-items: center;\n margin-bottom: var(--spacing-small);\n padding: var(--spacing-small);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-fixed-dim);\n border-radius: var(--md-sys-shape-corner-small);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n\n div.datatype md-icon {\n margin-left: auto;\n color: var(--md-sys-color-primary);\n cursor: pointer;\n }\n div.datatype label {\n margin-right: var(--spacing-small);\n }\n\n ox-input-code {\n flex: 1;\n max-width: 260px;\n overflow: auto;\n }\n `\n ]\n\n render() {\n const valueType = typeof this.value\n\n return html`\n <div class=\"datatype\">\n <input\n id=\"string\"\n type=\"radio\"\n name=\"data-type\"\n data-value=\"string\"\n .checked=${live(valueType == 'string')}\n @click=${() => this._setDataType('string')}\n ?disabled=${this.disabled}\n />\n <label for=\"string\">string</label>\n\n <input\n id=\"number\"\n type=\"radio\"\n name=\"data-type\"\n data-value=\"number\"\n .checked=${live(valueType == 'number')}\n @click=${() => this._setDataType('number')}\n ?disabled=${this.disabled}\n />\n <label for=\"number\">number</label>\n\n <input\n id=\"object\"\n type=\"radio\"\n name=\"data-type\"\n data-value=\"object\"\n .checked=${live(valueType == 'object')}\n @click=${() => this._setDataType('object')}\n ?disabled=${this.disabled}\n />\n <label for=\"object\">object</label>\n\n <md-icon @click=${() => this._clearData()} title=\"delete\">delete_forever</md-icon>\n </div>\n\n <ox-input-code\n .value=${this._getStringData(this.value)}\n language=\"text\"\n editor\n ?disabled=${this.disabled}\n @change=${(e: CustomEvent) => {\n e.stopPropagation()\n this._setDataTypeAndValue(valueType, (e.target as any).value)\n }}\n >\n </ox-input-code>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', e => {\n e.stopPropagation()\n\n const target = e.target as OxInputCode\n if (target.hasAttribute('editor')) {\n if (this.value === undefined && target.value == '') {\n return\n }\n this.value = target.value\n }\n })\n }\n\n _setDataTypeAndValue(type: string | undefined | null, value: any) {\n /* value must be a string */\n try {\n switch (type) {\n case 'number':\n if (!isNaN(Number(value))) {\n value = Number(value)\n }\n break\n case 'object':\n const compartment = new Compartment()\n value = compartment.evaluate(`(${value})`)\n break\n }\n } catch (e) {\n console.error('Error parsing value:', e)\n }\n\n if (isEqual(this.value, value)) {\n return\n }\n\n this.value = value\n\n this.requestUpdate()\n this._onAfterValueChange()\n }\n\n _setDataType(type: string | undefined | null) {\n if (typeof this.value == type) {\n return\n }\n\n var value = this.value\n\n try {\n switch (type) {\n case 'string':\n value = this._getStringData(value)\n break\n case 'number':\n if (!isNaN(value)) {\n value = Number(value)\n }\n break\n case 'object':\n const compartment = new Compartment()\n value = compartment.evaluate(`(${value})`)\n break\n }\n } catch (e) {\n console.error('Error setting data type:', e)\n }\n\n if (isEqual(this.value, value)) {\n this.requestUpdate()\n return\n }\n\n this.value = value\n\n this.requestUpdate()\n this._onAfterValueChange()\n }\n\n _clearData() {\n this.value = undefined\n this._onAfterValueChange()\n }\n\n _getStringData(data: any) {\n const type = typeof data\n\n switch (type) {\n case 'object':\n return JSON.stringify(data, null, 1)\n case 'undefined':\n return ''\n default:\n return String(data) || ''\n }\n }\n\n async _onAfterValueChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true\n })\n )\n }\n}\n"]}
@@ -2,10 +2,11 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
  import '@material/web/icon/icon.js';
5
- import { OxFormField } from './ox-form-field';
5
+ import { OxFormField } from './ox-form-field.js';
6
6
  export declare class OxInputDirection extends OxFormField {
7
7
  static styles: import("lit").CSSResult;
8
8
  value?: string;
9
+ inbound?: boolean;
9
10
  render(): import("lit-html").TemplateResult<1>;
10
11
  onClick(e: MouseEvent): void;
11
12
  }
@@ -5,9 +5,9 @@ import { __decorate } from "tslib";
5
5
  import '@material/web/icon/icon.js';
6
6
  import { css, html } from 'lit';
7
7
  import { customElement, property } from 'lit/decorators.js';
8
- import { OxFormField } from './ox-form-field';
8
+ import { OxFormField } from './ox-form-field.js';
9
9
  let OxInputDirection = class OxInputDirection extends OxFormField {
10
- static { this.styles = css `
10
+ static styles = css `
11
11
  :host {
12
12
  --md-icon-size: 1.4em;
13
13
  }
@@ -27,15 +27,43 @@ let OxInputDirection = class OxInputDirection extends OxFormField {
27
27
  color: var(--md-sys-color-on-primary);
28
28
  background-color: var(--md-sys-color-primary);
29
29
  }
30
- `; }
30
+
31
+ /* 아이콘 회전 */
32
+ md-icon[data-value='W'] {
33
+ transform: rotate(-90deg);
34
+ }
35
+
36
+ md-icon[data-value='N'] {
37
+ transform: rotate(0deg);
38
+ }
39
+
40
+ md-icon[data-value='S'] {
41
+ transform: rotate(180deg);
42
+ }
43
+
44
+ md-icon[data-value='E'] {
45
+ transform: rotate(90deg);
46
+ }
47
+ `;
48
+ value = undefined;
49
+ inbound = false;
31
50
  render() {
32
51
  const value = this.value;
33
52
  return html `
34
53
  <div @click=${this.onClick.bind(this)}>
35
- <md-icon ?selected=${value == 'W'} data-value="W">arrow_back</md-icon>
36
- <md-icon ?selected=${value == 'N'} data-value="N">arrow_upward</md-icon>
37
- <md-icon ?selected=${value == 'S'} data-value="S">arrow_downward</md-icon>
38
- <md-icon ?selected=${value == 'E'} data-value="E">arrow_forward</md-icon>
54
+ ${this.inbound
55
+ ? html `
56
+ <md-icon ?selected=${value == 'W'} data-value="W">step_into</md-icon>
57
+ <md-icon ?selected=${value == 'N'} data-value="N">step_into</md-icon>
58
+ <md-icon ?selected=${value == 'S'} data-value="S">step_into</md-icon>
59
+ <md-icon ?selected=${value == 'E'} data-value="E">step_into</md-icon>
60
+ `
61
+ : html `
62
+ <md-icon ?selected=${value == 'W'} data-value="W">step_out</md-icon>
63
+ <md-icon ?selected=${value == 'N'} data-value="N">step_out</md-icon>
64
+ <md-icon ?selected=${value == 'S'} data-value="S">step_out</md-icon>
65
+ <md-icon ?selected=${value == 'E'} data-value="E">step_out</md-icon>
66
+ `}
39
67
  </div>
40
68
  `;
41
69
  }
@@ -53,6 +81,9 @@ let OxInputDirection = class OxInputDirection extends OxFormField {
53
81
  __decorate([
54
82
  property({ type: String })
55
83
  ], OxInputDirection.prototype, "value", void 0);
84
+ __decorate([
85
+ property({ type: Boolean })
86
+ ], OxInputDirection.prototype, "inbound", void 0);
56
87
  OxInputDirection = __decorate([
57
88
  customElement('ox-input-direction')
58
89
  ], OxInputDirection);
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-direction.js","sourceRoot":"","sources":["../../src/ox-input-direction.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGtC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,WAAW;aACxC,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;GAoBlB,AApBY,CAoBZ;IAID,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,OAAO,IAAI,CAAA;oBACK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;6BACd,KAAK,IAAI,GAAG;6BACZ,KAAK,IAAI,GAAG;6BACZ,KAAK,IAAI,GAAG;6BACZ,KAAK,IAAI,GAAG;;KAEpC,CAAA;IACH,CAAC;IAED,OAAO,CAAC,CAAa;QACnB,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAM;QACR,CAAC;QAED,MAAM,MAAM,GAAG,CAAC,CAAC,MAAiB,CAAA;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAW,CAAA;QAEzD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;QAErD,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACtG,CAAC;;AA5B2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAe;AAvB/B,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAoD5B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxFormField } from './ox-form-field'\n\n@customElement('ox-input-direction')\nexport class OxInputDirection extends OxFormField {\n static styles = css`\n :host {\n --md-icon-size: 1.4em;\n }\n\n div {\n display: flex;\n justify-content: space-between;\n max-width: 140px;\n }\n\n md-icon {\n color: var(--md-sys-color-on-background);\n background-color: var(--md-sys-color-background);\n }\n\n md-icon[selected] {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n `\n\n @property({ type: String }) value?: string\n\n render() {\n const value = this.value\n\n return html`\n <div @click=${this.onClick.bind(this)}>\n <md-icon ?selected=${value == 'W'} data-value=\"W\">arrow_back</md-icon>\n <md-icon ?selected=${value == 'N'} data-value=\"N\">arrow_upward</md-icon>\n <md-icon ?selected=${value == 'S'} data-value=\"S\">arrow_downward</md-icon>\n <md-icon ?selected=${value == 'E'} data-value=\"E\">arrow_forward</md-icon>\n </div>\n `\n }\n\n onClick(e: MouseEvent) {\n e.stopPropagation()\n\n if (this.disabled) {\n return\n }\n\n const target = e.target as Element\n const value = target.getAttribute('data-value') as string\n\n this.value = this.value === value ? undefined : value\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n }\n}\n"]}
1
+ {"version":3,"file":"ox-input-direction.js","sourceRoot":"","sources":["../../src/ox-input-direction.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqClB,CAAA;IAE2B,KAAK,GAAY,SAAS,CAAA;IACzB,OAAO,GAAa,KAAK,CAAA;IAEtD,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,OAAO,IAAI,CAAA;oBACK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;UACjC,IAAI,CAAC,OAAO;YACZ,CAAC,CAAC,IAAI,CAAA;mCACmB,KAAK,IAAI,GAAG;mCACZ,KAAK,IAAI,GAAG;mCACZ,KAAK,IAAI,GAAG;mCACZ,KAAK,IAAI,GAAG;aAClC;YACH,CAAC,CAAC,IAAI,CAAA;mCACmB,KAAK,IAAI,GAAG;mCACZ,KAAK,IAAI,GAAG;mCACZ,KAAK,IAAI,GAAG;mCACZ,KAAK,IAAI,GAAG;aAClC;;KAER,CAAA;IACH,CAAC;IAED,OAAO,CAAC,CAAa;QACnB,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAM;QACR,CAAC;QAED,MAAM,MAAM,GAAG,CAAC,CAAC,MAAiB,CAAA;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAW,CAAA;QAEzD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;QAErD,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACtG,CAAC;;AAtC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA2B;AACzB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAA0B;AAzC3C,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA+E5B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxFormField } from './ox-form-field.js'\n\n@customElement('ox-input-direction')\nexport class OxInputDirection extends OxFormField {\n static styles = css`\n :host {\n --md-icon-size: 1.4em;\n }\n\n div {\n display: flex;\n justify-content: space-between;\n max-width: 140px;\n }\n\n md-icon {\n color: var(--md-sys-color-on-background);\n background-color: var(--md-sys-color-background);\n }\n\n md-icon[selected] {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n /* 아이콘 회전 */\n md-icon[data-value='W'] {\n transform: rotate(-90deg);\n }\n\n md-icon[data-value='N'] {\n transform: rotate(0deg);\n }\n\n md-icon[data-value='S'] {\n transform: rotate(180deg);\n }\n\n md-icon[data-value='E'] {\n transform: rotate(90deg);\n }\n `\n\n @property({ type: String }) value?: string = undefined\n @property({ type: Boolean }) inbound?: boolean = false\n\n render() {\n const value = this.value\n\n return html`\n <div @click=${this.onClick.bind(this)}>\n ${this.inbound\n ? html`\n <md-icon ?selected=${value == 'W'} data-value=\"W\">step_into</md-icon>\n <md-icon ?selected=${value == 'N'} data-value=\"N\">step_into</md-icon>\n <md-icon ?selected=${value == 'S'} data-value=\"S\">step_into</md-icon>\n <md-icon ?selected=${value == 'E'} data-value=\"E\">step_into</md-icon>\n `\n : html`\n <md-icon ?selected=${value == 'W'} data-value=\"W\">step_out</md-icon>\n <md-icon ?selected=${value == 'N'} data-value=\"N\">step_out</md-icon>\n <md-icon ?selected=${value == 'S'} data-value=\"S\">step_out</md-icon>\n <md-icon ?selected=${value == 'E'} data-value=\"E\">step_out</md-icon>\n `}\n </div>\n `\n }\n\n onClick(e: MouseEvent) {\n e.stopPropagation()\n\n if (this.disabled) {\n return\n }\n\n const target = e.target as Element\n const value = target.getAttribute('data-value') as string\n\n this.value = this.value === value ? undefined : value\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
- import { OxFormField } from './ox-form-field';
4
+ import { OxFormField } from './ox-form-field.js';
5
5
  export declare class OxInputDuration extends OxFormField {
6
6
  static styles: import("lit").CSSResult;
7
7
  value?: number;
@@ -5,9 +5,9 @@ import { __decorate } from "tslib";
5
5
  import { css, html } from 'lit';
6
6
  import { customElement, property, query } from 'lit/decorators.js';
7
7
  import { i18next } from '@operato/i18n';
8
- import { OxFormField } from './ox-form-field';
8
+ import { OxFormField } from './ox-form-field.js';
9
9
  let OxInputDuration = class OxInputDuration extends OxFormField {
10
- static { this.styles = css `
10
+ static styles = css `
11
11
  :host {
12
12
  text-align: center;
13
13
  padding: 10px;
@@ -62,7 +62,8 @@ let OxInputDuration = class OxInputDuration extends OxFormField {
62
62
  font-size: var(--md-sys-typescale-label-large-size, 0.875rem);
63
63
  color: var(--md-sys-color-on-primary-container);
64
64
  }
65
- `; }
65
+ `;
66
+ value = undefined;
66
67
  render() {
67
68
  var d = Number(this.value || 0);
68
69
  const days = Math.floor(d / (3600 * 24));
@@ -128,6 +129,10 @@ let OxInputDuration = class OxInputDuration extends OxFormField {
128
129
  ;
129
130
  this.renderRoot.querySelector('input').focus();
130
131
  }
132
+ days;
133
+ hours;
134
+ minutes;
135
+ seconds;
131
136
  onChange(e) {
132
137
  e.stopPropagation();
133
138
  var form = this.renderRoot.querySelector('form');
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-duration.js","sourceRoot":"","sources":["../../src/ox-input-duration.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGtC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,WAAW;aACvC,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDlB,AAvDY,CAuDZ;IAID,MAAM;QACJ,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAA;QAE/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAA;QACxC,CAAC,IAAI,IAAI,GAAG,EAAE,GAAG,IAAI,CAAA;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;QAClC,CAAC,IAA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C;gDAA2B;AAC1B;IAAlB,KAAK,CAAC,UAAU,CAAC;gDAA2B;AAvIlC,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAkK3B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { OxFormField } from './ox-form-field'\n\n@customElement('ox-input-duration')\nexport class OxInputDuration extends OxFormField {\n static styles = css`\n :host {\n text-align: center;\n padding: 10px;\n --md-filled-icon-button-container-height: var(--form-element-height-medium);\n --md-filled-icon-button-container-shape: var(--md-sys-shape-corner-small);\n }\n\n :host * {\n box-sizing: border-box;\n }\n\n :host *:focus {\n outline: none;\n }\n\n form {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n }\n\n [padding] {\n min-width: 100px;\n }\n\n input {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n max-width: 70px;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n text-align: right;\n }\n\n input:focus {\n outline: none;\n border-color: var(--md-sys-color-secondary-fixed-dim);\n }\n\n input:invalid {\n border-bottom: 1px solid var(--md-sys-color-error);\n color: var(--md-sys-color-error);\n }\n\n label {\n width: 100%;\n margin-right: var(--spacing-medium);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n `\n\n @property({ type: Number }) value?: number\n\n render() {\n var d = Number(this.value || 0)\n\n const days = Math.floor(d / (3600 * 24))\n d -= days * 24 * 3600\n const hours = Math.floor(d / 3600)\n d -= hours * 3600\n const minutes = Math.floor(d / 60)\n const seconds = d - minutes * 60\n\n return html`\n <form @change=${this.onChange.bind(this)}>\n <div padding></div>\n <input id=\"days\" type=\"number\" .value=${String(days || 0)} pattern=\"\\\\d*\" ?disabled=${this.disabled} />\n <label for=\"days\">${i18next.t('label.days')}</label>\n\n <input\n id=\"hours\"\n type=\"number\"\n .value=${String(hours || 0)}\n pattern=\"[01]?\\\\d|2[0-3]\"\n ?disabled=${this.disabled}\n />\n <label for=\"hour\">${i18next.t('label.hours')}</label>\n\n <input\n id=\"minutes\"\n type=\"number\"\n .value=${String(minutes || 0)}\n pattern=\"[0-5]?\\\\d\"\n ?disabled=${this.disabled}\n />\n <label for=\"minute\">${i18next.t('label.minutes')}</label>\n\n <input\n id=\"seconds\"\n type=\"number\"\n .value=${String(seconds || 0)}\n pattern=\"[0-5]?\\\\d\"\n ?disabled=${this.disabled}\n />\n <label for=\"second\">${i18next.t('label.seconds')}</label>\n\n <md-filled-icon-button\n type=\"button\"\n @click=${(e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n\n this.value = 0\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n ?disabled=${this.disabled}\n >\n <md-icon>backspace</md-icon>\n </md-filled-icon-button>\n <div padding></div>\n </form>\n `\n }\n\n firstUpdated() {\n ;(this.renderRoot.querySelector('input') as HTMLInputElement).focus()\n }\n\n @query('#days') days!: HTMLInputElement\n @query('#hours') hours!: HTMLInputElement\n @query('#minutes') minutes!: HTMLInputElement\n @query('#seconds') seconds!: HTMLInputElement\n\n onChange(e: Event) {\n e.stopPropagation()\n\n var form = this.renderRoot.querySelector('form') as HTMLFormElement\n var valid = form.checkValidity()\n if (!valid) {\n form.reportValidity()\n return\n }\n\n const days = Number(this.days.value)\n const hours = Number(this.hours.value)\n const minutes = Number(this.minutes.value)\n const seconds = Number(this.seconds.value)\n\n this.value = (days || 0) * 24 * 60 * 60 + (hours || 0) * 60 * 60 + (minutes || 0) * 60 + (seconds || 0)\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
1
+ {"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,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACtC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAE1C,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;QAEvG,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB,CAAC,CACH,CAAA;IACH,CAAC;;AAvG2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA2B;AA0EtC;IAAf,KAAK,CAAC,OAAO,CAAC;6CAAwB;AACtB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8CAAyB;AACtB;IAAlB,KAAK,CAAC,UAAU,CAAC;gDAA2B;AAC1B;IAAlB,KAAK,CAAC,UAAU,CAAC;gDAA2B;AAvIlC,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAkK3B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { OxFormField } from './ox-form-field.js'\n\n@customElement('ox-input-duration')\nexport class OxInputDuration extends OxFormField {\n static styles = css`\n :host {\n text-align: center;\n padding: 10px;\n --md-filled-icon-button-container-height: var(--form-element-height-medium);\n --md-filled-icon-button-container-shape: var(--md-sys-shape-corner-small);\n }\n\n :host * {\n box-sizing: border-box;\n }\n\n :host *:focus {\n outline: none;\n }\n\n form {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n }\n\n [padding] {\n min-width: 100px;\n }\n\n input {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n max-width: 70px;\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n text-align: right;\n }\n\n input:focus {\n outline: none;\n border-color: var(--md-sys-color-secondary-fixed-dim);\n }\n\n input:invalid {\n border-bottom: 1px solid var(--md-sys-color-error);\n color: var(--md-sys-color-error);\n }\n\n label {\n width: 100%;\n margin-right: var(--spacing-medium);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n }\n `\n\n @property({ type: Number }) value?: number = undefined\n\n render() {\n var d = Number(this.value || 0)\n\n const days = Math.floor(d / (3600 * 24))\n d -= days * 24 * 3600\n const hours = Math.floor(d / 3600)\n d -= hours * 3600\n const minutes = Math.floor(d / 60)\n const seconds = d - minutes * 60\n\n return html`\n <form @change=${this.onChange.bind(this)}>\n <div padding></div>\n <input id=\"days\" type=\"number\" .value=${String(days || 0)} pattern=\"\\\\d*\" ?disabled=${this.disabled} />\n <label for=\"days\">${i18next.t('label.days')}</label>\n\n <input\n id=\"hours\"\n type=\"number\"\n .value=${String(hours || 0)}\n pattern=\"[01]?\\\\d|2[0-3]\"\n ?disabled=${this.disabled}\n />\n <label for=\"hour\">${i18next.t('label.hours')}</label>\n\n <input\n id=\"minutes\"\n type=\"number\"\n .value=${String(minutes || 0)}\n pattern=\"[0-5]?\\\\d\"\n ?disabled=${this.disabled}\n />\n <label for=\"minute\">${i18next.t('label.minutes')}</label>\n\n <input\n id=\"seconds\"\n type=\"number\"\n .value=${String(seconds || 0)}\n pattern=\"[0-5]?\\\\d\"\n ?disabled=${this.disabled}\n />\n <label for=\"second\">${i18next.t('label.seconds')}</label>\n\n <md-filled-icon-button\n type=\"button\"\n @click=${(e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n\n this.value = 0\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n ?disabled=${this.disabled}\n >\n <md-icon>backspace</md-icon>\n </md-filled-icon-button>\n <div padding></div>\n </form>\n `\n }\n\n firstUpdated() {\n ;(this.renderRoot.querySelector('input') as HTMLInputElement).focus()\n }\n\n @query('#days') days!: HTMLInputElement\n @query('#hours') hours!: HTMLInputElement\n @query('#minutes') minutes!: HTMLInputElement\n @query('#seconds') seconds!: HTMLInputElement\n\n onChange(e: Event) {\n e.stopPropagation()\n\n var form = this.renderRoot.querySelector('form') as HTMLFormElement\n var valid = form.checkValidity()\n if (!valid) {\n form.reportValidity()\n return\n }\n\n const days = Number(this.days.value)\n const hours = Number(this.hours.value)\n const minutes = Number(this.minutes.value)\n const seconds = Number(this.seconds.value)\n\n this.value = (days || 0) * 24 * 60 * 60 + (hours || 0) * 60 * 60 + (minutes || 0) * 60 + (seconds || 0)\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
@@ -9,14 +9,7 @@ import { ScrollbarStyles } from '@operato/styles';
9
9
  import { FileDropHelper } from '@operato/utils';
10
10
  import { OxFormField } from './ox-form-field.js';
11
11
  let OxInputFile = class OxInputFile extends OxFormField {
12
- constructor() {
13
- super(...arguments);
14
- this.icon = 'upload';
15
- this.description = 'drop files here!';
16
- this.hideFileList = false;
17
- this.attachFileList = false;
18
- }
19
- static { this.styles = [
12
+ static styles = [
20
13
  ScrollbarStyles,
21
14
  css `
22
15
  :host {
@@ -94,7 +87,15 @@ let OxInputFile = class OxInputFile extends OxFormField {
94
87
  color: var(--md-sys-color-error);
95
88
  }
96
89
  `
97
- ]; }
90
+ ];
91
+ multiple;
92
+ accept;
93
+ icon = 'upload';
94
+ label;
95
+ description = 'drop files here!';
96
+ hideFileList = false;
97
+ attachFileList = false;
98
+ fileInput;
98
99
  render() {
99
100
  var files = this.value || [];
100
101
  return html `
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-file.js","sourceRoot":"","sources":["../../src/ox-input-file.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGzC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QAmFuB,SAAI,GAAY,QAAQ,CAAA;QAExB,gBAAW,GAAY,kBAAkB,CAAA;QAErE,iBAAY,GAAY,KAAK,CAAA;QAE7B,mBAAc,GAAY,KAAK,CAAA;IAwGjC,CAAC;aAhMQ,WAAM,GAAG;QACd,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2EF;KACF,AA9EY,CA8EZ;IAcD,MAAM;QACJ,IAAI,KAAK,GAAW,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAEpC,OAAO,IAAI,CAAA;iBACE,IAAI,CAAC,IAAI,IAAI,QAAQ;;cAExB,IAAI,CAAC,WAAW,IAA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G4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAmB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA0C;AAErE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;iDAC1C;AAE7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;mDAC1C;AAET;IAArB,KAAK,CAAC,aAAa,CAAC;8CAA6B;AA3FvC,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAiMvB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { FileDropHelper } from '@operato/utils'\n\nimport { OxFormField } from './ox-form-field.js'\n\n@customElement('ox-input-file')\nexport class OxInputFile extends OxFormField {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n border-radius: var(--md-sys-shape-corner-small);\n align-items: center;\n justify-content: center;\n padding: var(--padding-default, 9px);\n min-height: 100px;\n text-transform: capitalize;\n\n border: 1px dashed var(--md-sys-color-outline-variant);\n background-color: var(--md-sys-color-surface);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n }\n :host > span {\n color: var(--md-sys-color-primary);\n font-weight: var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500));\n }\n\n :host > md-icon {\n color: var(--md-sys-color-primary);\n --md-icon-size: var(--file-uploader-icon-size, 36px);\n }\n\n :host(.candrop) {\n background-color: var(--md-sys-color-primary-fixed);\n border: 1px dashed var(--md-sys-color-primary-fixed-dim);\n }\n\n #input-file {\n display: none;\n }\n\n label {\n position: relative;\n width: auto;\n border: none;\n text-transform: capitalize;\n\n padding: var(--file-uploader-label-padding);\n border-radius: var(--file-uploader-label-border-radius);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n ul {\n max-width: 500px;\n width: 100%;\n list-style: none;\n margin: 5px 0 0 0;\n padding: 0;\n max-height: 46px;\n overflow: auto;\n background-color: var(--md-sys-color-on-primary);\n }\n li {\n text-align: left;\n\n padding: 3px 5px 2px 5px;\n border-bottom: var(--file-uploader-li-border-bottom);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n display: flex;\n align-items: center;\n }\n li md-icon {\n cursor: pointer;\n font-size: var(--icon-size-small);\n margin-left: auto;\n }\n li md-icon:hover,\n li md-icon:active {\n color: var(--md-sys-color-error);\n }\n `\n ]\n\n @property({ type: Boolean }) multiple?: boolean\n @property({ type: String }) accept?: string\n @property({ type: String }) icon?: string = 'upload'\n @property({ type: String }) label?: string\n @property({ type: String }) description?: string = 'drop files here!'\n @property({ type: Boolean, reflect: true, attribute: 'hide-filelist' })\n hideFileList: boolean = false\n @property({ type: Boolean, reflect: true, attribute: 'attach-filelist' })\n attachFileList: boolean = false\n\n @query('#input-file') fileInput!: HTMLInputElement\n\n render() {\n var files: File[] = this.value || []\n\n return html`\n <md-icon>${this.icon || 'upload'}</md-icon>\n\n <span>${this.description || 'drop files here!'}</span>\n\n <input\n id=\"input-file\"\n type=\"file\"\n accept=${this.accept}\n ?multiple=${this.multiple}\n hidden\n capture=\"environment\"\n @change=${(e: Event) => this._onChangeValue(e)}\n ?disabled=${this.disabled}\n />\n\n <label for=\"input-file\">${this.label || 'select files'}</label>\n\n ${!this.hideFileList && files?.length\n ? html` <ul>\n ${files.map(\n file => html`\n <li>\n - ${file.name}\n <md-icon\n @click=${(e: Event) => {\n if (this.disabled) {\n return\n }\n files.splice(files.indexOf(file), 1)\n this.value = [...files]\n this._notifyChange()\n }}\n >delete_outline</md-icon\n >\n </li>\n `\n )}\n </ul>`\n : html``}\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value') && !(this.value instanceof Array)) {\n this.value = !this.value ? [] : [this.value]\n }\n }\n\n firstUpdated() {\n FileDropHelper.set(this)\n\n this.addEventListener('file-drop', (e: Event) => {\n if (this.disabled) {\n return\n }\n\n const detail = (e as CustomEvent).detail\n this.value = this.multiple ? detail : detail[0] ? [detail[0]] : []\n\n this._notifyChange()\n })\n }\n\n get files() {\n return this.value\n }\n\n reset() {\n this.fileInput.value = ''\n this.value = []\n\n this._notifyChange()\n }\n\n _onChangeValue(e: Event) {\n const fileInput = e.currentTarget as HTMLInputElement\n const files = this.value || []\n\n this.value = this.attachFileList\n ? [...files, ...Array.from(fileInput.files as FileList)]\n : [...Array.from(fileInput.files as FileList)]\n\n fileInput.files = null\n\n this._notifyChange()\n }\n\n _notifyChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
1
+ {"version":3,"file":"ox-input-file.js","sourceRoot":"","sources":["../../src/ox-input-file.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,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AC1C;AAET;IAArB,KAAK,CAAC,aAAa,CAAC;8CAA6B;AA3FvC,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAiMvB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { FileDropHelper } from '@operato/utils'\n\nimport { OxFormField } from './ox-form-field.js'\n\n@customElement('ox-input-file')\nexport class OxInputFile extends OxFormField {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n border-radius: var(--md-sys-shape-corner-small);\n align-items: center;\n justify-content: center;\n padding: var(--padding-default, 9px);\n min-height: 100px;\n text-transform: capitalize;\n\n border: 1px dashed var(--md-sys-color-outline-variant);\n background-color: var(--md-sys-color-surface);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n }\n :host > span {\n color: var(--md-sys-color-primary);\n font-weight: var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500));\n }\n\n :host > md-icon {\n color: var(--md-sys-color-primary);\n --md-icon-size: var(--file-uploader-icon-size, 36px);\n }\n\n :host(.candrop) {\n background-color: var(--md-sys-color-primary-fixed);\n border: 1px dashed var(--md-sys-color-primary-fixed-dim);\n }\n\n #input-file {\n display: none;\n }\n\n label {\n position: relative;\n width: auto;\n border: none;\n text-transform: capitalize;\n\n padding: var(--file-uploader-label-padding);\n border-radius: var(--file-uploader-label-border-radius);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n ul {\n max-width: 500px;\n width: 100%;\n list-style: none;\n margin: 5px 0 0 0;\n padding: 0;\n max-height: 46px;\n overflow: auto;\n background-color: var(--md-sys-color-on-primary);\n }\n li {\n text-align: left;\n\n padding: 3px 5px 2px 5px;\n border-bottom: var(--file-uploader-li-border-bottom);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n color: var(--md-sys-color-on-primary-container);\n display: flex;\n align-items: center;\n }\n li md-icon {\n cursor: pointer;\n font-size: var(--icon-size-small);\n margin-left: auto;\n }\n li md-icon:hover,\n li md-icon:active {\n color: var(--md-sys-color-error);\n }\n `\n ]\n\n @property({ type: Boolean }) multiple?: boolean\n @property({ type: String }) accept?: string\n @property({ type: String }) icon?: string = 'upload'\n @property({ type: String }) label?: string\n @property({ type: String }) description?: string = 'drop files here!'\n @property({ type: Boolean, reflect: true, attribute: 'hide-filelist' })\n hideFileList: boolean = false\n @property({ type: Boolean, reflect: true, attribute: 'attach-filelist' })\n attachFileList: boolean = false\n\n @query('#input-file') fileInput!: HTMLInputElement\n\n render() {\n var files: File[] = this.value || []\n\n return html`\n <md-icon>${this.icon || 'upload'}</md-icon>\n\n <span>${this.description || 'drop files here!'}</span>\n\n <input\n id=\"input-file\"\n type=\"file\"\n accept=${this.accept}\n ?multiple=${this.multiple}\n hidden\n capture=\"environment\"\n @change=${(e: Event) => this._onChangeValue(e)}\n ?disabled=${this.disabled}\n />\n\n <label for=\"input-file\">${this.label || 'select files'}</label>\n\n ${!this.hideFileList && files?.length\n ? html` <ul>\n ${files.map(\n file => html`\n <li>\n - ${file.name}\n <md-icon\n @click=${(e: Event) => {\n if (this.disabled) {\n return\n }\n files.splice(files.indexOf(file), 1)\n this.value = [...files]\n this._notifyChange()\n }}\n >delete_outline</md-icon\n >\n </li>\n `\n )}\n </ul>`\n : html``}\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value') && !(this.value instanceof Array)) {\n this.value = !this.value ? [] : [this.value]\n }\n }\n\n firstUpdated() {\n FileDropHelper.set(this)\n\n this.addEventListener('file-drop', (e: Event) => {\n if (this.disabled) {\n return\n }\n\n const detail = (e as CustomEvent).detail\n this.value = this.multiple ? detail : detail[0] ? [detail[0]] : []\n\n this._notifyChange()\n })\n }\n\n get files() {\n return this.value\n }\n\n reset() {\n this.fileInput.value = ''\n this.value = []\n\n this._notifyChange()\n }\n\n _onChangeValue(e: Event) {\n const fileInput = e.currentTarget as HTMLInputElement\n const files = this.value || []\n\n this.value = this.attachFileList\n ? [...files, ...Array.from(fileInput.files as FileList)]\n : [...Array.from(fileInput.files as FileList)]\n\n fileInput.files = null\n\n this._notifyChange()\n }\n\n _notifyChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
@@ -9,12 +9,7 @@ import { repeat } from 'lit/directives/repeat.js';
9
9
  import { localized, msg } from '@lit/localize';
10
10
  import { OxFormField } from './ox-form-field.js';
11
11
  let OxInputHashtags = class OxInputHashtags extends OxFormField {
12
- constructor() {
13
- super(...arguments);
14
- this.value = [];
15
- this.placeholder = 'tag';
16
- }
17
- static { this.styles = css `
12
+ static styles = css `
18
13
  #editor {
19
14
  display: flex;
20
15
  gap: var(--spacing-medium);
@@ -80,7 +75,11 @@ let OxInputHashtags = class OxInputHashtags extends OxFormField {
80
75
  font: var(--input-font);
81
76
  text-align: left;
82
77
  }
83
- `; }
78
+ `;
79
+ value = [];
80
+ placeholder = 'tag';
81
+ input;
82
+ errors;
84
83
  render() {
85
84
  return html `
86
85
  <div id="editor" @click=${this.setHashtags}>
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-hashtags.js","sourceRoot":"","sources":["../../src/ox-input-hashtags.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAE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CAAC,CAAC,CAAA;QAEhF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QAClB,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAA;QACrB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAED,aAAa,CAAC,GAAW;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QACzB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;QAC5B,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AApG0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAAqB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAA4B;AACvC;IAAf,KAAK,CAAC,OAAO,CAAC;8CAAyB;AAE/B;IAAR,KAAK,EAAE;+CAAuB;AAzEpB,eAAe;IAF3B,SAAS,EAAE;IACX,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA0K3B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { localized, msg } from '@lit/localize'\n\nimport { OxFormField } from './ox-form-field.js'\n\n@localized()\n@customElement('ox-input-hashtags')\nexport class OxInputHashtags extends OxFormField {\n static styles = css`\n #editor {\n display: flex;\n gap: var(--spacing-medium);\n align-items: center;\n }\n\n .tags {\n display: flex;\n gap: var(--spacing-medium);\n align-items: center;\n }\n\n .tag {\n display: flex;\n gap: var(--spacing-small);\n\n font: var(--input-font);\n cursor: pointer;\n }\n\n .tag:hover {\n font-weight: bold;\n }\n\n .closer {\n opacity: 0.3;\n }\n .tag:hover .closer {\n opacity: 0.3;\n }\n\n .input {\n display: inline-block;\n }\n\n .input::before {\n display: inline;\n position: relative;\n opacity: 0.5;\n top: -1px;\n content: '#';\n vertical-align: middle;\n }\n\n input {\n vertical-align: middle;\n -webkit-appearance: none;\n -webkit-text-size-adjust: none;\n border: 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n outline: none;\n font-weight: bold;\n }\n\n input:focus {\n outline: none;\n border-bottom: 1px solid var(--md-sys-color-primary);\n }\n\n .error {\n margin: var(--spacing-small);\n color: var(--md-sys-color-error);\n font: var(--input-font);\n text-align: left;\n }\n `\n\n @property({ type: Array }) value: string[] = []\n @property({ type: String }) placeholder: string = 'tag'\n @query('input') input!: HTMLInputElement\n\n @state() errors?: string | null\n\n render() {\n return html`\n <div id=\"editor\" @click=${this.setHashtags}>\n <div class=\"tags\">\n ${repeat(\n this.value,\n tag => tag,\n (tag, index) => html`\n <span class=\"tag\"\n >#${tag} <span @click=${() => !this.disabled && this.removeHashtag(index)} class=\"closer\">x</span></span\n >\n `\n )}\n </div>\n\n <div class=\"input\">\n <input\n type=\"text\"\n @keyup=${this.onInputKeyup}\n @blur=${this.onBlur}\n placeholder=\"태그입력\"\n ?disabled=${this.disabled}\n />\n </div>\n </div>\n\n ${when(this.errors, () => html`<p class=\"error\">${this.errors}</p>`)}\n `\n }\n\n private onInputKeyup(e: KeyboardEvent) {\n e.stopPropagation()\n\n const tag = this.input.value.trim()\n\n switch (e.key) {\n case 'Enter':\n case 'Spacebar':\n this.addHashtag(tag)\n break\n default:\n this.errors = this.validate(tag)\n }\n }\n\n private onBlur() {\n const tag = this.input.value.trim()\n this.addHashtag(tag)\n }\n\n async setHashtags() {\n this.input.focus()\n }\n\n initErrors() {\n this.errors = null\n }\n\n validate(newtag: string) {\n if (this.value.some(tag => tag === newtag)) {\n return msg('tag duplicated')\n }\n\n const regex = /[~!@#$%^&*()+|<>?:{},.=\"':;/-]/\n if (regex.test(newtag)) {\n return msg('special characters not allowed')\n }\n }\n\n async addHashtag(tag: string) {\n if (!tag) {\n this.initErrors()\n this.input.focus()\n return\n }\n\n this.errors = this.validate(tag)\n if (this.errors) {\n this.input.focus()\n return\n }\n\n this.value = [...this.value, tag]\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.errors = null\n this.input.value = ''\n this.input.focus()\n }\n\n removeHashtag(idx: number) {\n this.value.splice(idx, 1)\n this.value = [...this.value]\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
1
+ {"version":3,"file":"ox-input-hashtags.js","sourceRoot":"","sources":["../../src/ox-input-hashtags.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIzC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,WAAW;IAC9C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkElB,CAAA;IAE0B,KAAK,GAAa,EAAE,CAAA;IACnB,WAAW,GAAW,KAAK,CAAA;IACvC,KAAK,CAAmB;IAE/B,MAAM,CAAgB;IAE/B,MAAM;QACJ,OAAO,IAAI,CAAA;gCACiB,IAAI,CAAC,WAAW;;YAEpC,MAAM,CACN,IAAI,CAAC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OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AApG0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAAqB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAA4B;AACvC;IAAf,KAAK,CAAC,OAAO,CAAC;8CAAyB;AAE/B;IAAR,KAAK,EAAE;+CAAuB;AAzEpB,eAAe;IAF3B,SAAS,EAAE;IACX,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA0K3B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { localized, msg } from '@lit/localize'\n\nimport { OxFormField } from './ox-form-field.js'\n\n@localized()\n@customElement('ox-input-hashtags')\nexport class OxInputHashtags extends OxFormField {\n static styles = css`\n #editor {\n display: flex;\n gap: var(--spacing-medium);\n align-items: center;\n }\n\n .tags {\n display: flex;\n gap: var(--spacing-medium);\n align-items: center;\n }\n\n .tag {\n display: flex;\n gap: var(--spacing-small);\n\n font: var(--input-font);\n cursor: pointer;\n }\n\n .tag:hover {\n font-weight: bold;\n }\n\n .closer {\n opacity: 0.3;\n }\n .tag:hover .closer {\n opacity: 0.3;\n }\n\n .input {\n display: inline-block;\n }\n\n .input::before {\n display: inline;\n position: relative;\n opacity: 0.5;\n top: -1px;\n content: '#';\n vertical-align: middle;\n }\n\n input {\n vertical-align: middle;\n -webkit-appearance: none;\n -webkit-text-size-adjust: none;\n border: 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n outline: none;\n font-weight: bold;\n }\n\n input:focus {\n outline: none;\n border-bottom: 1px solid var(--md-sys-color-primary);\n }\n\n .error {\n margin: var(--spacing-small);\n color: var(--md-sys-color-error);\n font: var(--input-font);\n text-align: left;\n }\n `\n\n @property({ type: Array }) value: string[] = []\n @property({ type: String }) placeholder: string = 'tag'\n @query('input') input!: HTMLInputElement\n\n @state() errors?: string | null\n\n render() {\n return html`\n <div id=\"editor\" @click=${this.setHashtags}>\n <div class=\"tags\">\n ${repeat(\n this.value,\n tag => tag,\n (tag, index) => html`\n <span class=\"tag\"\n >#${tag} <span @click=${() => !this.disabled && this.removeHashtag(index)} class=\"closer\">x</span></span\n >\n `\n )}\n </div>\n\n <div class=\"input\">\n <input\n type=\"text\"\n @keyup=${this.onInputKeyup}\n @blur=${this.onBlur}\n placeholder=\"태그입력\"\n ?disabled=${this.disabled}\n />\n </div>\n </div>\n\n ${when(this.errors, () => html`<p class=\"error\">${this.errors}</p>`)}\n `\n }\n\n private onInputKeyup(e: KeyboardEvent) {\n e.stopPropagation()\n\n const tag = this.input.value.trim()\n\n switch (e.key) {\n case 'Enter':\n case 'Spacebar':\n this.addHashtag(tag)\n break\n default:\n this.errors = this.validate(tag)\n }\n }\n\n private onBlur() {\n const tag = this.input.value.trim()\n this.addHashtag(tag)\n }\n\n async setHashtags() {\n this.input.focus()\n }\n\n initErrors() {\n this.errors = null\n }\n\n validate(newtag: string) {\n if (this.value.some(tag => tag === newtag)) {\n return msg('tag duplicated')\n }\n\n const regex = /[~!@#$%^&*()+|<>?:{},.=\"':;/-]/\n if (regex.test(newtag)) {\n return msg('special characters not allowed')\n }\n }\n\n async addHashtag(tag: string) {\n if (!tag) {\n this.initErrors()\n this.input.focus()\n return\n }\n\n this.errors = this.validate(tag)\n if (this.errors) {\n this.input.focus()\n return\n }\n\n this.value = [...this.value, tag]\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.errors = null\n this.input.value = ''\n this.input.focus()\n }\n\n removeHashtag(idx: number) {\n this.value.splice(idx, 1)\n this.value = [...this.value]\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
  import '@material/web/icon/icon.js';
5
- import { OxFormField } from './ox-form-field';
5
+ import { OxFormField } from './ox-form-field.js';
6
6
  type I18nLabel = {
7
7
  [code: string]: string;
8
8
  };