@globalpayments/vega 2.86.0-beta.0 → 2.86.0

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 (310) hide show
  1. package/dist/cjs/{app-globals-844163e7.js → app-globals-3080f55a.js} +5 -5
  2. package/dist/cjs/{aria-dialog-focusable-trap-slimmer-5debfcf9.js → aria-dialog-focusable-trap-slimmer-5507f917.js} +2 -2
  3. package/dist/cjs/{child-nodes-notify-observer-slimmer-34a606b3.js → child-nodes-notify-observer-slimmer-2631c381.js} +1 -1
  4. package/dist/cjs/{code-block-0ec03cd3.js → code-block-c6c70464.js} +2 -11
  5. package/dist/cjs/{component-value-history-controller-slimmer.abstract-b243e1e3.js → component-value-history-controller-slimmer.abstract-a523b747.js} +5 -5
  6. package/dist/cjs/{content-state-8898e96d.js → content-state-efd3b1a7.js} +3 -3
  7. package/dist/cjs/{dom-node-subject-observer-factory-ba6a95f3.js → dom-node-subject-observer-factory-9110cb94.js} +1 -1
  8. package/dist/cjs/{element-appender-slimmer-2355d6f6.js → element-appender-slimmer-2b4e0a62.js} +2 -2
  9. package/dist/cjs/{event-emit-slimmer-8ba00d00.js → event-emit-slimmer-80e1c8ca.js} +1 -1
  10. package/dist/cjs/{form-field-controller-slimmer-595f4138.js → form-field-controller-slimmer-a07e3de0.js} +3 -3
  11. package/dist/cjs/{image-annotation-action-37434c42.js → image-annotation-action-93bace08.js} +3 -3
  12. package/dist/cjs/index.cjs.js +8 -9
  13. package/dist/cjs/{inject-keyboard-manager-98ae7ce1.js → inject-keyboard-manager-ff8735b8.js} +1 -1
  14. package/dist/cjs/{keyboard-manager-d3cc662c.js → keyboard-manager-cc446230.js} +1 -1
  15. package/dist/cjs/{keyboard-manager-slimmer-3824781d.js → keyboard-manager-slimmer-a10b7d6f.js} +1 -1
  16. package/dist/cjs/loader.cjs.js +7 -7
  17. package/dist/cjs/{public-rules-60e4dfda.js → public-rules-3cd0f182.js} +5 -5
  18. package/dist/cjs/{range-a6c15539.js → range-c9bde0b4.js} +2 -2
  19. package/dist/cjs/{rich-text-editor-required-rule-f69c62ea.js → rich-text-editor-required-rule-d1f0509c.js} +1 -1
  20. package/dist/cjs/{split-cell-operation-7920e3a1.js → split-cell-operation-6a59c9b0.js} +3 -3
  21. package/dist/cjs/{string-input-formatter-slimmer-fd2fb154.js → string-input-formatter-slimmer-127cf2b8.js} +2 -2
  22. package/dist/cjs/{sub-state-notify-slimmer-7b2380c1.js → sub-state-notify-slimmer-b33171b0.js} +1 -1
  23. package/dist/cjs/{sub-state-observer-slimmer-ec5ac913.js → sub-state-observer-slimmer-b8f6f27b.js} +2 -2
  24. package/dist/cjs/{token-extension-364972cd.js → token-extension-d7d2ead6.js} +5 -5
  25. package/dist/cjs/{ui-3727d685.js → ui-ae4ee13d.js} +0 -13
  26. package/dist/cjs/vega-accordion.cjs.entry.js +3 -3
  27. package/dist/cjs/vega-app-header-button.cjs.entry.js +3 -3
  28. package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
  29. package/dist/cjs/vega-banner.cjs.entry.js +3 -3
  30. package/dist/cjs/vega-box.cjs.entry.js +1 -1
  31. package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
  32. package/dist/cjs/vega-button-circle.cjs.entry.js +3 -3
  33. package/dist/cjs/vega-button-group_2.cjs.entry.js +5 -5
  34. package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
  35. package/dist/cjs/vega-button.cjs.entry.js +3 -3
  36. package/dist/cjs/vega-calendar_4.cjs.entry.js +5 -5
  37. package/dist/cjs/vega-card.cjs.entry.js +1 -1
  38. package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
  39. package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
  40. package/dist/cjs/vega-chip.cjs.entry.js +3 -3
  41. package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
  42. package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
  43. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +5 -5
  44. package/dist/cjs/vega-color-swatch.cjs.entry.js +3 -3
  45. package/dist/cjs/vega-combo-box.cjs.entry.js +7 -7
  46. package/dist/cjs/vega-date-picker_2.cjs.entry.js +11 -11
  47. package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
  48. package/dist/cjs/vega-dropdown_5.cjs.entry.js +10 -10
  49. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  50. package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
  51. package/dist/cjs/vega-file-uploader.cjs.entry.js +5 -5
  52. package/dist/cjs/vega-flex.cjs.entry.js +1 -1
  53. package/dist/cjs/vega-font.cjs.entry.js +1 -1
  54. package/dist/cjs/vega-form.cjs.entry.js +7 -7
  55. package/dist/cjs/vega-grid.cjs.entry.js +1 -1
  56. package/dist/cjs/vega-icon.cjs.entry.js +1 -1
  57. package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -5
  58. package/dist/cjs/vega-input-credit-card.cjs.entry.js +5 -5
  59. package/dist/cjs/vega-input-numeric.cjs.entry.js +8 -8
  60. package/dist/cjs/vega-input-passcode.cjs.entry.js +7 -7
  61. package/dist/cjs/vega-input-phone-number.cjs.entry.js +5 -5
  62. package/dist/cjs/vega-input-range.cjs.entry.js +5 -5
  63. package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
  64. package/dist/cjs/vega-input.cjs.entry.js +7 -7
  65. package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
  66. package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
  67. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +1 -1
  68. package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -2
  69. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
  70. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
  71. package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
  72. package/dist/cjs/vega-popover_2.cjs.entry.js +7 -7
  73. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +5 -5
  74. package/dist/cjs/vega-radio_2.cjs.entry.js +8 -8
  75. package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
  76. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +23 -16
  77. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +7 -7
  78. package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
  79. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +6 -6
  80. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +7 -7
  81. package/dist/cjs/vega-sidenav_3.cjs.entry.js +5 -5
  82. package/dist/cjs/vega-signature-capture.cjs.entry.js +5 -5
  83. package/dist/cjs/vega-stepper.cjs.entry.js +5 -5
  84. package/dist/cjs/vega-tab-group_2.cjs.entry.js +63 -149
  85. package/dist/cjs/vega-table_11.cjs.entry.js +5 -5
  86. package/dist/cjs/vega-text.cjs.entry.js +1 -1
  87. package/dist/cjs/vega-textarea.cjs.entry.js +5 -5
  88. package/dist/cjs/vega-time-picker_2.cjs.entry.js +8 -8
  89. package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
  90. package/dist/cjs/vega-tooltip_2.cjs.entry.js +5 -5
  91. package/dist/cjs/vega.cjs.js +7 -7
  92. package/dist/cjs/{wait-for-component-did-render-ae9c4c2a.js → wait-for-component-did-render-16863a21.js} +1 -1
  93. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +0 -8
  94. package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -1
  95. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +10 -3
  96. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-panel-controller.js +1 -14
  97. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-close-button-renderer.js +1 -15
  98. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-direction-button-renderer.js +1 -1
  99. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.js +4 -16
  100. package/dist/collection/components/vega-tab-group/vega-tab-group.js +0 -5
  101. package/dist/collection/global/scripts/before-vega-load.js +1 -1
  102. package/dist/collection/helpers/feature-control/feature-flag-controller.js +1 -1
  103. package/dist/collection/helpers/slimmers/component-usage-runtime-metrics.js +1 -1
  104. package/dist/collection/helpers/slimmers/runtime-metrics/public-api-runtime-metrics-slimmer-base.js +1 -1
  105. package/dist/collection/utils/ui.js +0 -12
  106. package/dist/esm/{app-globals-c5b58e3c.js → app-globals-37536ac9.js} +5 -5
  107. package/dist/esm/{aria-dialog-focusable-trap-slimmer-4cc75c59.js → aria-dialog-focusable-trap-slimmer-6eb79723.js} +2 -2
  108. package/dist/esm/{child-nodes-notify-observer-slimmer-8822d0d0.js → child-nodes-notify-observer-slimmer-a8cb19cf.js} +1 -1
  109. package/dist/esm/{code-block-3af53bbb.js → code-block-10be3916.js} +3 -11
  110. package/dist/esm/{component-value-history-controller-slimmer.abstract-7f35b770.js → component-value-history-controller-slimmer.abstract-82d51b7a.js} +5 -5
  111. package/dist/esm/{content-state-b3d319b4.js → content-state-afeb700d.js} +3 -3
  112. package/dist/esm/{dom-node-subject-observer-factory-3897e95b.js → dom-node-subject-observer-factory-aca0116e.js} +1 -1
  113. package/dist/esm/{element-appender-slimmer-b20308aa.js → element-appender-slimmer-05f487d7.js} +2 -2
  114. package/dist/esm/{event-emit-slimmer-27acc176.js → event-emit-slimmer-1c57093d.js} +1 -1
  115. package/dist/esm/{form-field-controller-slimmer-4c1976c9.js → form-field-controller-slimmer-ae8478b5.js} +3 -3
  116. package/dist/esm/{image-annotation-action-0287d7f6.js → image-annotation-action-bad7c565.js} +3 -3
  117. package/dist/esm/index.js +8 -8
  118. package/dist/esm/{inject-keyboard-manager-2ec31cf2.js → inject-keyboard-manager-1ceb9ee0.js} +1 -1
  119. package/dist/esm/{keyboard-manager-394883fe.js → keyboard-manager-50a1d90e.js} +1 -1
  120. package/dist/esm/{keyboard-manager-slimmer-71d1c602.js → keyboard-manager-slimmer-3891ee20.js} +1 -1
  121. package/dist/esm/loader.js +7 -7
  122. package/dist/esm/polyfills/core-js.js +0 -0
  123. package/dist/esm/polyfills/dom.js +0 -0
  124. package/dist/esm/polyfills/es5-html-element.js +0 -0
  125. package/dist/esm/polyfills/index.js +0 -0
  126. package/dist/esm/polyfills/system.js +0 -0
  127. package/dist/esm/{public-rules-ae0099c8.js → public-rules-f54e6f39.js} +5 -5
  128. package/dist/esm/{range-dfb5388f.js → range-f32f9185.js} +2 -2
  129. package/dist/esm/{rich-text-editor-required-rule-cfc7aef8.js → rich-text-editor-required-rule-627fd7e4.js} +1 -1
  130. package/dist/esm/{split-cell-operation-8045ac1d.js → split-cell-operation-90c30861.js} +3 -3
  131. package/dist/esm/{string-input-formatter-slimmer-27ef1fc6.js → string-input-formatter-slimmer-4059080b.js} +2 -2
  132. package/dist/esm/{sub-state-notify-slimmer-da3d2cfa.js → sub-state-notify-slimmer-63ecb465.js} +1 -1
  133. package/dist/esm/{sub-state-observer-slimmer-f31b1733.js → sub-state-observer-slimmer-2adbbe00.js} +2 -2
  134. package/dist/esm/{token-extension-3c07558d.js → token-extension-728c0678.js} +5 -5
  135. package/dist/esm/{ui-64815a12.js → ui-b7600a48.js} +1 -13
  136. package/dist/esm/vega-accordion.entry.js +3 -3
  137. package/dist/esm/vega-app-header-button.entry.js +3 -3
  138. package/dist/esm/vega-backdrop.entry.js +1 -1
  139. package/dist/esm/vega-banner.entry.js +3 -3
  140. package/dist/esm/vega-box.entry.js +1 -1
  141. package/dist/esm/vega-breadcrumb.entry.js +3 -3
  142. package/dist/esm/vega-button-circle.entry.js +3 -3
  143. package/dist/esm/vega-button-group_2.entry.js +5 -5
  144. package/dist/esm/vega-button-link.entry.js +3 -3
  145. package/dist/esm/vega-button.entry.js +3 -3
  146. package/dist/esm/vega-calendar_4.entry.js +5 -5
  147. package/dist/esm/vega-card.entry.js +1 -1
  148. package/dist/esm/vega-carousel.entry.js +3 -3
  149. package/dist/esm/vega-checkbox_2.entry.js +6 -6
  150. package/dist/esm/vega-chip.entry.js +3 -3
  151. package/dist/esm/vega-code-block.entry.js +8 -8
  152. package/dist/esm/vega-color-picker.entry.js +5 -5
  153. package/dist/esm/vega-color-swatch-picker.entry.js +5 -5
  154. package/dist/esm/vega-color-swatch.entry.js +3 -3
  155. package/dist/esm/vega-combo-box.entry.js +7 -7
  156. package/dist/esm/vega-date-picker_2.entry.js +11 -11
  157. package/dist/esm/vega-dialog_2.entry.js +4 -4
  158. package/dist/esm/vega-dropdown_5.entry.js +10 -10
  159. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  160. package/dist/esm/vega-field-label.entry.js +3 -3
  161. package/dist/esm/vega-file-uploader.entry.js +5 -5
  162. package/dist/esm/vega-flex.entry.js +1 -1
  163. package/dist/esm/vega-font.entry.js +1 -1
  164. package/dist/esm/vega-form.entry.js +7 -7
  165. package/dist/esm/vega-grid.entry.js +1 -1
  166. package/dist/esm/vega-icon.entry.js +1 -1
  167. package/dist/esm/vega-image-uploader.entry.js +5 -5
  168. package/dist/esm/vega-input-credit-card.entry.js +5 -5
  169. package/dist/esm/vega-input-numeric.entry.js +8 -8
  170. package/dist/esm/vega-input-passcode.entry.js +7 -7
  171. package/dist/esm/vega-input-phone-number.entry.js +5 -5
  172. package/dist/esm/vega-input-range.entry.js +5 -5
  173. package/dist/esm/vega-input-select.entry.js +5 -5
  174. package/dist/esm/vega-input.entry.js +7 -7
  175. package/dist/esm/vega-item-toggle.entry.js +3 -3
  176. package/dist/esm/vega-left-nav_5.entry.js +7 -7
  177. package/dist/esm/vega-loader-wrapper_2.entry.js +1 -1
  178. package/dist/esm/vega-page-notification_2.entry.js +2 -2
  179. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +2 -2
  180. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
  181. package/dist/esm/vega-pagination.entry.js +3 -3
  182. package/dist/esm/vega-popover_2.entry.js +7 -7
  183. package/dist/esm/vega-progress-tracker_2.entry.js +5 -5
  184. package/dist/esm/vega-radio_2.entry.js +8 -8
  185. package/dist/esm/vega-rich-text-content.entry.js +7 -7
  186. package/dist/esm/vega-rich-text-editor_4.entry.js +23 -16
  187. package/dist/esm/vega-rich-text-table-properties_3.entry.js +7 -7
  188. package/dist/esm/vega-segment-control.entry.js +3 -3
  189. package/dist/esm/vega-selection-chip_2.entry.js +6 -6
  190. package/dist/esm/vega-selection-tile_2.entry.js +7 -7
  191. package/dist/esm/vega-sidenav_3.entry.js +5 -5
  192. package/dist/esm/vega-signature-capture.entry.js +5 -5
  193. package/dist/esm/vega-stepper.entry.js +5 -5
  194. package/dist/esm/vega-tab-group_2.entry.js +63 -149
  195. package/dist/esm/vega-table_11.entry.js +5 -5
  196. package/dist/esm/vega-text.entry.js +1 -1
  197. package/dist/esm/vega-textarea.entry.js +5 -5
  198. package/dist/esm/vega-time-picker_2.entry.js +8 -8
  199. package/dist/esm/vega-toggle-switch.entry.js +5 -5
  200. package/dist/esm/vega-tooltip_2.entry.js +5 -5
  201. package/dist/esm/vega.js +7 -7
  202. package/dist/esm/{wait-for-component-did-render-3d126515.js → wait-for-component-did-render-9a83d343.js} +1 -1
  203. package/dist/sri/vega-sri-manifest.json +304 -304
  204. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +1 -2
  205. package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -1
  206. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-close-button-renderer.d.ts +0 -1
  207. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.d.ts +0 -2
  208. package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +0 -2
  209. package/dist/types/utils/ui.d.ts +0 -9
  210. package/dist/vega/index.esm.js +1 -1
  211. package/dist/vega/{p-f90ec132.entry.js → p-096d186d.entry.js} +1 -1
  212. package/dist/vega/{p-2b518ca7.entry.js → p-0b5b0fd2.entry.js} +1 -1
  213. package/dist/vega/{p-dc965280.entry.js → p-13e7f906.entry.js} +1 -1
  214. package/dist/vega/{p-33a6a38d.entry.js → p-23b38467.entry.js} +1 -1
  215. package/dist/vega/{p-e4fdccb9.entry.js → p-25572ea7.entry.js} +1 -1
  216. package/dist/vega/{p-202207a2.entry.js → p-268e84e0.entry.js} +1 -1
  217. package/dist/vega/{p-1985f011.entry.js → p-2edc066c.entry.js} +1 -1
  218. package/dist/vega/{p-d564ff1e.entry.js → p-2fb26f4f.entry.js} +1 -1
  219. package/dist/vega/{p-13330f58.js → p-33234385.js} +1 -1
  220. package/dist/vega/{p-b208a7cb.entry.js → p-35d77c9c.entry.js} +1 -1
  221. package/dist/vega/{p-bfafd175.entry.js → p-3c456e91.entry.js} +1 -1
  222. package/dist/vega/{p-f89d14c9.entry.js → p-3d0ba2c6.entry.js} +1 -1
  223. package/dist/vega/{p-b042c46d.entry.js → p-3d92d2af.entry.js} +1 -1
  224. package/dist/vega/{p-f1eccec7.entry.js → p-3e64fa38.entry.js} +1 -1
  225. package/dist/vega/{p-e703a770.entry.js → p-411ea209.entry.js} +1 -1
  226. package/dist/vega/{p-f30d8248.entry.js → p-423762ae.entry.js} +1 -1
  227. package/dist/vega/p-4530f0e1.entry.js +1 -0
  228. package/dist/vega/{p-7931e6e6.entry.js → p-4afafeb3.entry.js} +1 -1
  229. package/dist/vega/{p-63b585de.entry.js → p-4c90d013.entry.js} +1 -1
  230. package/dist/vega/{p-70cd4efd.js → p-4cefd7fe.js} +1 -1
  231. package/dist/vega/{p-089ad8ac.entry.js → p-5087fa1e.entry.js} +1 -1
  232. package/dist/vega/{p-97f9ad6c.js → p-51b2b3de.js} +1 -1
  233. package/dist/vega/p-5657f768.js +1 -0
  234. package/dist/vega/{p-f9d33494.entry.js → p-571a6d15.entry.js} +1 -1
  235. package/dist/vega/{p-e695657d.entry.js → p-59c6dcf7.entry.js} +1 -1
  236. package/dist/vega/p-5e50dbb9.js +1 -0
  237. package/dist/vega/p-5f377954.js +1 -1
  238. package/dist/vega/{p-7b7a70b5.entry.js → p-606d7113.entry.js} +1 -1
  239. package/dist/vega/{p-9dd58ae8.js → p-6817b9bd.js} +1 -1
  240. package/dist/vega/{p-12bd4bab.entry.js → p-69c11b7b.entry.js} +1 -1
  241. package/dist/vega/{p-de7109d3.js → p-6b5cb920.js} +1 -1
  242. package/dist/vega/{p-ec2a1d4c.js → p-6e70d3cc.js} +1 -1
  243. package/dist/vega/{p-3749e29b.entry.js → p-6fadee27.entry.js} +1 -1
  244. package/dist/vega/{p-cfede0b1.entry.js → p-73c6669e.entry.js} +1 -1
  245. package/dist/vega/{p-77fb5d5c.js → p-76063dcb.js} +1 -1
  246. package/dist/vega/{p-99d05b8f.entry.js → p-7702a906.entry.js} +1 -1
  247. package/dist/vega/{p-329541e0.js → p-7730bace.js} +1 -1
  248. package/dist/vega/{p-3f854e0a.entry.js → p-78099a83.entry.js} +1 -1
  249. package/dist/vega/{p-0be4fe08.entry.js → p-79c12a64.entry.js} +1 -1
  250. package/dist/vega/{p-120376f6.entry.js → p-7f74cd41.entry.js} +1 -1
  251. package/dist/vega/{p-331c3e77.js → p-818da356.js} +1 -1
  252. package/dist/vega/{p-0adb76a2.entry.js → p-82039afd.entry.js} +1 -1
  253. package/dist/vega/p-84eb3b9c.js +1 -0
  254. package/dist/vega/{p-801ee68b.js → p-8d48940d.js} +1 -1
  255. package/dist/vega/{p-26c56c5c.entry.js → p-9297f4a9.entry.js} +1 -1
  256. package/dist/vega/{p-2c8a205d.js → p-93afdfc3.js} +1 -1
  257. package/dist/vega/{p-2d9ac3d7.entry.js → p-98a6cd8e.entry.js} +1 -1
  258. package/dist/vega/{p-dfc9f226.entry.js → p-9e2b7718.entry.js} +1 -1
  259. package/dist/vega/{p-0ef6ceee.entry.js → p-9eb00537.entry.js} +1 -1
  260. package/dist/vega/{p-a3e40e66.entry.js → p-9f064488.entry.js} +1 -1
  261. package/dist/vega/p-9f36abf9.entry.js +1 -0
  262. package/dist/vega/{p-91f82047.entry.js → p-9fc8bd1f.entry.js} +1 -1
  263. package/dist/vega/{p-db90512c.entry.js → p-a050c24d.entry.js} +1 -1
  264. package/dist/vega/{p-89b2a865.entry.js → p-a49c25c2.entry.js} +1 -1
  265. package/dist/vega/{p-dbdc9e35.js → p-a87cb7ac.js} +1 -1
  266. package/dist/vega/{p-57edff7d.entry.js → p-a9528dbd.entry.js} +1 -1
  267. package/dist/vega/{p-59a7b513.js → p-a9e10a64.js} +1 -1
  268. package/dist/vega/{p-b6d7faa2.entry.js → p-a9f34735.entry.js} +1 -1
  269. package/dist/vega/p-aaf44879.entry.js +1 -0
  270. package/dist/vega/{p-9aeff9b4.js → p-ae1aa4df.js} +1 -1
  271. package/dist/vega/{p-3cea9c0f.entry.js → p-af00e6e2.entry.js} +1 -1
  272. package/dist/vega/{p-158108ea.js → p-af5cb9bc.js} +1 -1
  273. package/dist/vega/{p-9f99a5d7.entry.js → p-afd1b519.entry.js} +1 -1
  274. package/dist/vega/{p-3b3f2e16.entry.js → p-bc74d7e7.entry.js} +1 -1
  275. package/dist/vega/{p-98e2c103.entry.js → p-c2388937.entry.js} +1 -1
  276. package/dist/vega/{p-0689727d.js → p-c31a32f4.js} +1 -1
  277. package/dist/vega/{p-b2df5cb1.js → p-c347e08a.js} +1 -1
  278. package/dist/vega/{p-a4cdcdcf.entry.js → p-c51ebb14.entry.js} +1 -1
  279. package/dist/vega/{p-ce5b32e8.entry.js → p-c601b331.entry.js} +1 -1
  280. package/dist/vega/{p-f0388529.entry.js → p-c8fe46fd.entry.js} +1 -1
  281. package/dist/vega/{p-2946f85e.entry.js → p-ce61d23f.entry.js} +1 -1
  282. package/dist/vega/{p-75636420.entry.js → p-cf2838c7.entry.js} +1 -1
  283. package/dist/vega/{p-8283bf6e.entry.js → p-d10ae46a.entry.js} +1 -1
  284. package/dist/vega/{p-247308c9.entry.js → p-d37636a5.entry.js} +1 -1
  285. package/dist/vega/{p-96301146.entry.js → p-d402eb7b.entry.js} +1 -1
  286. package/dist/vega/{p-95681890.js → p-d4e519a0.js} +1 -1
  287. package/dist/vega/{p-d7ef3516.entry.js → p-da8bb883.entry.js} +1 -1
  288. package/dist/vega/{p-4c210e31.entry.js → p-dffbbc3d.entry.js} +1 -1
  289. package/dist/vega/{p-1a6f0a51.js → p-e1709e59.js} +1 -1
  290. package/dist/vega/{p-87ddb52c.entry.js → p-e47b2c4c.entry.js} +1 -1
  291. package/dist/vega/{p-83e5600a.entry.js → p-e7a4b760.entry.js} +1 -1
  292. package/dist/vega/{p-a8a34c79.entry.js → p-e95cb28f.entry.js} +1 -1
  293. package/dist/vega/{p-21919f19.entry.js → p-ecbb63a5.entry.js} +1 -1
  294. package/dist/vega/p-ed26f4c8.entry.js +1 -0
  295. package/dist/vega/{p-ecbcbdab.entry.js → p-effb285f.entry.js} +1 -1
  296. package/dist/vega/{p-11e2dcf5.js → p-f28a6074.js} +1 -1
  297. package/dist/vega/{p-becddd0b.js → p-f5f5a0d9.js} +1 -1
  298. package/dist/vega/{p-5373c5e6.entry.js → p-f604f2c9.entry.js} +1 -1
  299. package/dist/vega/{p-5c54bb05.entry.js → p-fa91805b.entry.js} +1 -1
  300. package/dist/vega/vega.esm.js +1 -1
  301. package/package.json +5 -5
  302. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-voice-over-focus-controller.js +0 -45
  303. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-voice-over-focus-controller.d.ts +0 -23
  304. package/dist/vega/p-04cef724.js +0 -1
  305. package/dist/vega/p-3f566d54.js +0 -1
  306. package/dist/vega/p-60c7ed92.entry.js +0 -1
  307. package/dist/vega/p-758f9809.entry.js +0 -1
  308. package/dist/vega/p-ef44af22.entry.js +0 -1
  309. package/dist/vega/p-f235be72.js +0 -1
  310. package/dist/vega/p-fa17fe93.entry.js +0 -1
@@ -1 +1 @@
1
- import{h as e,F as i,r as t,c as r,H as n,g as a}from"./p-6b2342e0.js";import{s as o}from"./p-519a7d55.js";import{c as s,V as p,M as l,I as d}from"./p-6e1ab235.js";import{V as u,I as h}from"./p-4415ad28.js";import{c}from"./p-de7109d3.js";import{i as g}from"./p-9af0e2e7.js";import{F as v}from"./p-b2df5cb1.js";import{i as f}from"./p-d27ae9ff.js";import{C as b}from"./p-2d0d575f.js";import{F as m}from"./p-a528714c.js";import{g as x,D as w}from"./p-ec2a1d4c.js";import{D as y}from"./p-11e2dcf5.js";import{C as j}from"./p-e27626f6.js";import{I as R}from"./p-f396c69a.js";import{I}from"./p-abd7aeaa.js";import{c as C}from"./p-6ac8e655.js";import{T as V}from"./p-57f220b5.js";import"./p-6a334573.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-158108ea.js";import"./p-262ec334.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var N=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class k extends p{getInputRangeContainerRef(){return this.inputRangeContainerRef}render(){return e(i,null,e("vega-flex",{class:"vega-input-range-container",direction:"horizontal"!==this.stack?"col":"row",alignItems:"horizontal"!==this.stack?"start":"center",gap:"size-8",ref:e=>this.inputRangeContainerRef=e},e("vega-field-label",{onClick:this.inputRangeInputRenderer.focusFirstInput,isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.inputRangeInputRenderer.render()),this.renderHintDom())}renderHintDom(){if(this.hint)return e("label",{class:"vega-input-range-hint"},e("vega-font",{variant:"font-footnote1-short",color:"text-secondary"},this.hint))}}N([s()],k.prototype,"required",void 0),N([s()],k.prototype,"disabled",void 0),N([s()],k.prototype,"label",void 0),N([s()],k.prototype,"hint",void 0),N([s()],k.prototype,"stack",void 0),N([s()],k.prototype,"inputRangeInputRenderer",void 0);var z=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class A extends p{emitEventAndNotifyAfterValueChange(e,i){f(e,i)||(this.changeEventEmitter.emit(e),b.notify(m,{host:this.host,detail:e}))}updateValueByRangeIndex(e,i){let t=this.value;t=0===i?[e,Array.isArray(this.value)&&!isNaN(Number(this.value[1]))?this.value[1]:""]:[Array.isArray(this.value)&&!isNaN(Number(this.value[0]))?this.value[0]:"",e],f(t,this.value)||this.setValue(t)}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){return Array.isArray(e)&&2===e.length}}z([s({writable:!0})],A.prototype,"value",void 0),z([s()],A.prototype,"host",void 0),z([s()],A.prototype,"changeEventEmitter",void 0),z([l("watchValue")],A.prototype,"emitEventAndNotifyAfterValueChange",null);var O=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class E extends p{constructor(){super(...arguments),this.isMobileDevice=x()===w.MOBILE,this.focusFirstInput=()=>{this.minFieldInputRef.doFocus()},this.inputValueChange=e=>{this.valueController.updateValueByRangeIndex(e.detail,"0"===e.host.dataset.index?0:1)}}getInputRefByIndex(e){return[this.minFieldInputRef,this.maxFieldInputRef][e]}render(){return e("vega-box",{class:{"vega-input-range-input-container":!0,"input-range-disabled":this.disabled,"input-range-mobile":this.isMobileDevice,"input-range-with-clear-icon":this.showClearIcon&&!this.disabled},corners:"rounded-8",backgroundColor:this.disabled?"bg-secondary":"bg-primary"},e("vega-flex",{"align-items":"center",direction:this.isMobileDevice?"col":"row"},e("vega-input",Object.assign({prefixIcon:this.prefixIcon},this.getInputPropsByRangeIndex(0),{ref:e=>{y.addUniqueObserverToNode(e,g,this.inputValueChange),this.minFieldInputRef=e}})),e("span",{class:"vega-input-range-divider"}),e("vega-input",Object.assign({class:{"with-left-padding-in-mobile":!!this.prefixIcon&&this.isMobileDevice}},this.getInputPropsByRangeIndex(1),{ref:e=>{y.addUniqueObserverToNode(e,g,this.inputValueChange),this.maxFieldInputRef=e}}))),this.clearIconRenderer.render())}getInputPropsByRangeIndex(e){return{type:"number","data-index":e,placeholder:this.getPlaceholderByIndex(e),"data-aria-label":this.getDataAriaLabel(e),showClearIcon:!1,disabled:this.disabled,size:this.size,min:this.min,max:this.max,value:this.getDefaultValueByIndex(e)}}getPlaceholderByIndex(e){return this.translationSlimmer.t((this.placeholder||E.defaultPlaceholder)[e])}getDataAriaLabel(e){return`${this.label||"Input range"} ${0===e?"start":"end"}`}getDefaultValueByIndex(e){return(this.value||["",""])[e]}}E.defaultPlaceholder=["Minimum","Maximum"],O([s()],E.prototype,"value",void 0),O([s()],E.prototype,"prefixIcon",void 0),O([s()],E.prototype,"disabled",void 0),O([s()],E.prototype,"min",void 0),O([s()],E.prototype,"max",void 0),O([s()],E.prototype,"size",void 0),O([s()],E.prototype,"placeholder",void 0),O([s()],E.prototype,"label",void 0),O([s()],E.prototype,"showClearIcon",void 0),O([s()],E.prototype,"valueController",void 0),O([s()],E.prototype,"clearIconRenderer",void 0),O([s()],E.prototype,"translationSlimmer",void 0);class F extends I{constructor(e){super(),this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""}),this.minValue=0===e.minValue||e.minValue?Number(e.minValue):null,this.maxValue=0===e.maxValue||e.maxValue?Number(e.maxValue):null}canEvaluate(e,i){return i?this.isAcceptedInputType(e)&&!i.disabled&&i.visible:this.isAcceptedInputType(e)}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Unexpected type of input: ${typeof e}: ${e}`);const i=Number(e[0]),t=Number(e[1]);return null!==this.minValue&&(""!==e[0]&&i<this.minValue||""!==e[1]&&t<this.minValue)?this.invalidResult({key:"The minimum input value is {0}",args:[this.minValue]}):null!==this.maxValue&&(""!==e[0]&&i>this.maxValue||""!==e[1]&&t>this.maxValue)?this.invalidResult({key:"The maximum input value is {0}",args:[this.maxValue]}):""!==e[0]&&""!==e[1]&&i>t?this.invalidResult("The end value should be greater than the start value"):this.validResult()}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return Array.isArray(e)&&2===e.length&&e.every((e=>"number"==typeof Number(e)))}}var D=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class M extends p{constructor(){super(...arguments),this.clearInputRangeValue=()=>{this.valueController.setValue(["",""]),this.inputRangeInputRenderer.focusFirstInput()}}render(){return e("div",{class:{"vega-input-range-clear-icon":!0,invisible:!this.shouldShowClearIcon()},"aria-label":"clear input range",role:"button",tabindex:this.disabled?-1:0,onClick:this.clearInputRangeValue,onKeyDown:C()},e("vega-icon",{icon:"close"}))}shouldShowClearIcon(){return this.showClearIcon&&!this.disabled&&Array.isArray(this.value)&&this.value.some((e=>!!e))}}D([s()],M.prototype,"showClearIcon",void 0),D([s()],M.prototype,"value",void 0),D([s()],M.prototype,"disabled",void 0),D([s()],M.prototype,"inputRangeInputRenderer",void 0),D([s()],M.prototype,"valueController",void 0);var S=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};const B=class{constructor(e){t(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new V,this.formFieldController=new v({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new R:null},{propertyName:"min",ruleFactory:(e,i)=>new F({minValue:e,maxValue:i}),dependence:"max"},{propertyName:"max",ruleFactory:(e,i)=>new F({minValue:i,maxValue:e}),dependence:"min"}],validationRulesName:"validationRules",defaultValue:["",""],attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputRangeRenderer.getInputRangeContainerRef(),touchableAreaGetter:()=>[this.inputRangeInputRenderer.getInputRefByIndex(0),this.inputRangeInputRenderer.getInputRefByIndex(1)]}),this.inputRangeInputRenderer=new E,this.clearIconRenderer=new M,this.inputRangeRenderer=new k,this.valueController=new A,this.inputChangeEventPrevent=new j([g],(()=>this.inputRangeRenderer.getInputRangeContainerRef())),this.changeEventEmitter=c(B,g),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.label="",this.value=["",""],this.showClearIcon=!0,this.min=null,this.max=null,this.required=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.size="default",this.placeholder=["Minimum","Maximum"],this.disabled=!1,this.hint="",this.stack="vertical"}watchValue(e,i){}watchValidationRules(){}render(){return o(e(n,{class:{disabled:this.disabled}},this.inputRangeRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};S([h()],B.prototype,"globalSlimmers",void 0),S([d()],B.prototype,"translationSlimmer",void 0),S([d()],B.prototype,"formFieldController",void 0),S([d()],B.prototype,"inputRangeInputRenderer",void 0),S([d()],B.prototype,"clearIconRenderer",void 0),S([d()],B.prototype,"inputRangeRenderer",void 0),S([d()],B.prototype,"valueController",void 0),S([d()],B.prototype,"inputChangeEventPrevent",void 0),S([d()],B.prototype,"changeEventEmitter",void 0),S([d()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),B.style=':host{display:inline-block;width:100%}.vega-input-range-input-container{position:relative;width:100%;flex:1 1 0%;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));box-sizing:border-box;min-width:50%}.vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-input-range-input-container .vega-input-range-divider{display:inline-block;width:0px;height:24px;border-color:rgba(var(--v-border-color-input-field, 171, 198, 216, 1));border-style:solid;border-right-width:1px;border-left-width:0px;flex-shrink:0}.vega-input-range-input-container:focus-within .vega-input-range-divider{opacity:0}.vega-input-range-input-container .vega-input-range-clear-icon{position:absolute;width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));top:50%;right:16px;transform:translateY(-50%);z-index:2}.vega-input-range-input-container .vega-input-range-clear-icon.invisible{visibility:hidden}.vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border-radius:4px;padding:2px}.vega-input-range-input-container vega-input::part(input-container){border-width:0px}.vega-input-range-input-container vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));position:relative;box-shadow:0 0 0;margin:-1px;z-index:1}.vega-input-range-input-container.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled .vega-input-range-divider{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-mobile .vega-input-range-divider{width:100%;height:0px;border-right-width:0px;border-left-width:0px;border-top-width:0px;border-bottom-width:1px}.vega-input-range-input-container.input-range-mobile:focus-within .vega-input-range-divider{opacity:1}.vega-input-range-input-container.input-range-mobile .with-left-padding-in-mobile::part(input){padding-left:26px}.vega-input-range-input-container.input-range-mobile .vega-input-range-clear-icon{top:25%}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:first-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:2px}.vega-input-range-container.error .vega-input-range-input-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-input-range-container.error .vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-input-range-container.error .vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-input-range-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}.vega-input-range-hint{display:inline-block;padding-top:12px;padding-right:8px;padding-left:8px}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{B as vega_input_range}
1
+ import{h as e,F as i,r as t,c as r,H as n,g as a}from"./p-6b2342e0.js";import{s as o}from"./p-519a7d55.js";import{c as s,V as p,M as l,I as d}from"./p-6e1ab235.js";import{V as u,I as h}from"./p-4415ad28.js";import{c}from"./p-6b5cb920.js";import{i as g}from"./p-9af0e2e7.js";import{F as v}from"./p-c347e08a.js";import{i as f}from"./p-d27ae9ff.js";import{C as b}from"./p-2d0d575f.js";import{F as m}from"./p-a528714c.js";import{g as x,D as w}from"./p-6e70d3cc.js";import{D as y}from"./p-f28a6074.js";import{C as j}from"./p-e27626f6.js";import{I as R}from"./p-f396c69a.js";import{I}from"./p-abd7aeaa.js";import{c as C}from"./p-6ac8e655.js";import{T as V}from"./p-57f220b5.js";import"./p-6a334573.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-af5cb9bc.js";import"./p-262ec334.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var N=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class k extends p{getInputRangeContainerRef(){return this.inputRangeContainerRef}render(){return e(i,null,e("vega-flex",{class:"vega-input-range-container",direction:"horizontal"!==this.stack?"col":"row",alignItems:"horizontal"!==this.stack?"start":"center",gap:"size-8",ref:e=>this.inputRangeContainerRef=e},e("vega-field-label",{onClick:this.inputRangeInputRenderer.focusFirstInput,isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.inputRangeInputRenderer.render()),this.renderHintDom())}renderHintDom(){if(this.hint)return e("label",{class:"vega-input-range-hint"},e("vega-font",{variant:"font-footnote1-short",color:"text-secondary"},this.hint))}}N([s()],k.prototype,"required",void 0),N([s()],k.prototype,"disabled",void 0),N([s()],k.prototype,"label",void 0),N([s()],k.prototype,"hint",void 0),N([s()],k.prototype,"stack",void 0),N([s()],k.prototype,"inputRangeInputRenderer",void 0);var z=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class A extends p{emitEventAndNotifyAfterValueChange(e,i){f(e,i)||(this.changeEventEmitter.emit(e),b.notify(m,{host:this.host,detail:e}))}updateValueByRangeIndex(e,i){let t=this.value;t=0===i?[e,Array.isArray(this.value)&&!isNaN(Number(this.value[1]))?this.value[1]:""]:[Array.isArray(this.value)&&!isNaN(Number(this.value[0]))?this.value[0]:"",e],f(t,this.value)||this.setValue(t)}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){return Array.isArray(e)&&2===e.length}}z([s({writable:!0})],A.prototype,"value",void 0),z([s()],A.prototype,"host",void 0),z([s()],A.prototype,"changeEventEmitter",void 0),z([l("watchValue")],A.prototype,"emitEventAndNotifyAfterValueChange",null);var O=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class E extends p{constructor(){super(...arguments),this.isMobileDevice=x()===w.MOBILE,this.focusFirstInput=()=>{this.minFieldInputRef.doFocus()},this.inputValueChange=e=>{this.valueController.updateValueByRangeIndex(e.detail,"0"===e.host.dataset.index?0:1)}}getInputRefByIndex(e){return[this.minFieldInputRef,this.maxFieldInputRef][e]}render(){return e("vega-box",{class:{"vega-input-range-input-container":!0,"input-range-disabled":this.disabled,"input-range-mobile":this.isMobileDevice,"input-range-with-clear-icon":this.showClearIcon&&!this.disabled},corners:"rounded-8",backgroundColor:this.disabled?"bg-secondary":"bg-primary"},e("vega-flex",{"align-items":"center",direction:this.isMobileDevice?"col":"row"},e("vega-input",Object.assign({prefixIcon:this.prefixIcon},this.getInputPropsByRangeIndex(0),{ref:e=>{y.addUniqueObserverToNode(e,g,this.inputValueChange),this.minFieldInputRef=e}})),e("span",{class:"vega-input-range-divider"}),e("vega-input",Object.assign({class:{"with-left-padding-in-mobile":!!this.prefixIcon&&this.isMobileDevice}},this.getInputPropsByRangeIndex(1),{ref:e=>{y.addUniqueObserverToNode(e,g,this.inputValueChange),this.maxFieldInputRef=e}}))),this.clearIconRenderer.render())}getInputPropsByRangeIndex(e){return{type:"number","data-index":e,placeholder:this.getPlaceholderByIndex(e),"data-aria-label":this.getDataAriaLabel(e),showClearIcon:!1,disabled:this.disabled,size:this.size,min:this.min,max:this.max,value:this.getDefaultValueByIndex(e)}}getPlaceholderByIndex(e){return this.translationSlimmer.t((this.placeholder||E.defaultPlaceholder)[e])}getDataAriaLabel(e){return`${this.label||"Input range"} ${0===e?"start":"end"}`}getDefaultValueByIndex(e){return(this.value||["",""])[e]}}E.defaultPlaceholder=["Minimum","Maximum"],O([s()],E.prototype,"value",void 0),O([s()],E.prototype,"prefixIcon",void 0),O([s()],E.prototype,"disabled",void 0),O([s()],E.prototype,"min",void 0),O([s()],E.prototype,"max",void 0),O([s()],E.prototype,"size",void 0),O([s()],E.prototype,"placeholder",void 0),O([s()],E.prototype,"label",void 0),O([s()],E.prototype,"showClearIcon",void 0),O([s()],E.prototype,"valueController",void 0),O([s()],E.prototype,"clearIconRenderer",void 0),O([s()],E.prototype,"translationSlimmer",void 0);class F extends I{constructor(e){super(),this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""}),this.minValue=0===e.minValue||e.minValue?Number(e.minValue):null,this.maxValue=0===e.maxValue||e.maxValue?Number(e.maxValue):null}canEvaluate(e,i){return i?this.isAcceptedInputType(e)&&!i.disabled&&i.visible:this.isAcceptedInputType(e)}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Unexpected type of input: ${typeof e}: ${e}`);const i=Number(e[0]),t=Number(e[1]);return null!==this.minValue&&(""!==e[0]&&i<this.minValue||""!==e[1]&&t<this.minValue)?this.invalidResult({key:"The minimum input value is {0}",args:[this.minValue]}):null!==this.maxValue&&(""!==e[0]&&i>this.maxValue||""!==e[1]&&t>this.maxValue)?this.invalidResult({key:"The maximum input value is {0}",args:[this.maxValue]}):""!==e[0]&&""!==e[1]&&i>t?this.invalidResult("The end value should be greater than the start value"):this.validResult()}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return Array.isArray(e)&&2===e.length&&e.every((e=>"number"==typeof Number(e)))}}var D=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class M extends p{constructor(){super(...arguments),this.clearInputRangeValue=()=>{this.valueController.setValue(["",""]),this.inputRangeInputRenderer.focusFirstInput()}}render(){return e("div",{class:{"vega-input-range-clear-icon":!0,invisible:!this.shouldShowClearIcon()},"aria-label":"clear input range",role:"button",tabindex:this.disabled?-1:0,onClick:this.clearInputRangeValue,onKeyDown:C()},e("vega-icon",{icon:"close"}))}shouldShowClearIcon(){return this.showClearIcon&&!this.disabled&&Array.isArray(this.value)&&this.value.some((e=>!!e))}}D([s()],M.prototype,"showClearIcon",void 0),D([s()],M.prototype,"value",void 0),D([s()],M.prototype,"disabled",void 0),D([s()],M.prototype,"inputRangeInputRenderer",void 0),D([s()],M.prototype,"valueController",void 0);var S=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};const B=class{constructor(e){t(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new V,this.formFieldController=new v({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new R:null},{propertyName:"min",ruleFactory:(e,i)=>new F({minValue:e,maxValue:i}),dependence:"max"},{propertyName:"max",ruleFactory:(e,i)=>new F({minValue:i,maxValue:e}),dependence:"min"}],validationRulesName:"validationRules",defaultValue:["",""],attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputRangeRenderer.getInputRangeContainerRef(),touchableAreaGetter:()=>[this.inputRangeInputRenderer.getInputRefByIndex(0),this.inputRangeInputRenderer.getInputRefByIndex(1)]}),this.inputRangeInputRenderer=new E,this.clearIconRenderer=new M,this.inputRangeRenderer=new k,this.valueController=new A,this.inputChangeEventPrevent=new j([g],(()=>this.inputRangeRenderer.getInputRangeContainerRef())),this.changeEventEmitter=c(B,g),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.label="",this.value=["",""],this.showClearIcon=!0,this.min=null,this.max=null,this.required=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.size="default",this.placeholder=["Minimum","Maximum"],this.disabled=!1,this.hint="",this.stack="vertical"}watchValue(e,i){}watchValidationRules(){}render(){return o(e(n,{class:{disabled:this.disabled}},this.inputRangeRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};S([h()],B.prototype,"globalSlimmers",void 0),S([d()],B.prototype,"translationSlimmer",void 0),S([d()],B.prototype,"formFieldController",void 0),S([d()],B.prototype,"inputRangeInputRenderer",void 0),S([d()],B.prototype,"clearIconRenderer",void 0),S([d()],B.prototype,"inputRangeRenderer",void 0),S([d()],B.prototype,"valueController",void 0),S([d()],B.prototype,"inputChangeEventPrevent",void 0),S([d()],B.prototype,"changeEventEmitter",void 0),S([d()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),B.style=':host{display:inline-block;width:100%}.vega-input-range-input-container{position:relative;width:100%;flex:1 1 0%;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));box-sizing:border-box;min-width:50%}.vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-input-range-input-container .vega-input-range-divider{display:inline-block;width:0px;height:24px;border-color:rgba(var(--v-border-color-input-field, 171, 198, 216, 1));border-style:solid;border-right-width:1px;border-left-width:0px;flex-shrink:0}.vega-input-range-input-container:focus-within .vega-input-range-divider{opacity:0}.vega-input-range-input-container .vega-input-range-clear-icon{position:absolute;width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));top:50%;right:16px;transform:translateY(-50%);z-index:2}.vega-input-range-input-container .vega-input-range-clear-icon.invisible{visibility:hidden}.vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border-radius:4px;padding:2px}.vega-input-range-input-container vega-input::part(input-container){border-width:0px}.vega-input-range-input-container vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));position:relative;box-shadow:0 0 0;margin:-1px;z-index:1}.vega-input-range-input-container.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled .vega-input-range-divider{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-mobile .vega-input-range-divider{width:100%;height:0px;border-right-width:0px;border-left-width:0px;border-top-width:0px;border-bottom-width:1px}.vega-input-range-input-container.input-range-mobile:focus-within .vega-input-range-divider{opacity:1}.vega-input-range-input-container.input-range-mobile .with-left-padding-in-mobile::part(input){padding-left:26px}.vega-input-range-input-container.input-range-mobile .vega-input-range-clear-icon{top:25%}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:first-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:2px}.vega-input-range-container.error .vega-input-range-input-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-input-range-container.error .vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-input-range-container.error .vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-input-range-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}.vega-input-range-hint{display:inline-block;padding-top:12px;padding-right:8px;padding-left:8px}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{B as vega_input_range}
@@ -1 +1 @@
1
- import{h as t,H as e,r as i,c as s,g as r}from"./p-6b2342e0.js";import{c as n,M as a,V as o,I as h}from"./p-6e1ab235.js";import{V as p,I as l}from"./p-4415ad28.js";import{s as d}from"./p-519a7d55.js";import{G as u,H as c,i as m,J as f,K as v}from"./p-9af0e2e7.js";import{D as g}from"./p-11e2dcf5.js";import{F as b}from"./p-a528714c.js";import{C as x}from"./p-2d0d575f.js";import{c as w}from"./p-de7109d3.js";import{K as j}from"./p-dbdc9e35.js";import{C as y}from"./p-e27626f6.js";import{F as I}from"./p-b2df5cb1.js";import{R}from"./p-280cbcdb.js";import"./p-331a62d5.js";import"./p-ec2a1d4c.js";import"./p-6a334573.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-70cd4efd.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-6c43d54a.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-158108ea.js";var V=function(t,e,i,s){var r,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class C extends o{constructor(){super(...arguments),this.vegaInputRefs=[],this.focusInputPasscode=()=>{this.vegaInputRefs[0]&&this.vegaInputRefs[0].doFocus()},this.handleVegaFocus=t=>()=>{0!==t&&(this.vegaInputRefs[t].tabIndex=null);const e=this.vegaInputValues.get(t)?t:this.valueController.getFirstEmptyIndex(),i=-1===e?this.length-1:e;this.currentIndex=i,this.vegaInputRefs[i].doFocus()},this.handleVegaBlur=t=>()=>{0!==t&&(this.vegaInputRefs[t].tabIndex=-1)},this.handleVegaChange=t=>e=>{var i;const s=e.detail||"";if(2===s.length||1===s.length&&!this.vegaInputValues.get(t)){const e=this.generateNewInputValue(t,s);this.vegaInputValues.set(t,e),null===(i=this.vegaInputRefs[t+1])||void 0===i||i.doFocus()}},this.handleVegaPaste=()=>t=>{t.preventDefault();const e=t.detail.getData("text");this.valueController.setValuesArray(e),this.vegaInputRefs[this.value.length<this.length?this.value.length:this.length-1].doFocus()}}watchLengthAndInputType(){this.valueController.setValuesArray(this.value)}getVegaInputRefs(){return this.vegaInputRefs}getCurrentIndex(){return this.currentIndex}getInputPasscodeContainerRef(){return this.inputPasscodeContainerRef}render(){const i=Array.from({length:this.length}).map(((e,i)=>t("vega-input",{class:"small"===this.size?"small":"medium",key:i,"data-tabindex":0!==i?-1:0,showClearIcon:!1,disabled:this.disabled,"data-aria-hidden":String(!this.isInputAccessibleForScreenReader(i)),"data-aria-label":`Passcode input ${i+1} of ${this.length}`,value:this.vegaInputValues.get(i)||"",autocomplete:0===i?"one-time-code":"off",inputmode:"text"===this.inputType?"text":"numeric",ref:t=>{this.vegaInputRefs[i]=t,g.addUniqueObserverToNode(t,u,this.handleVegaFocus(i)),g.addUniqueObserverToNode(t,c,this.handleVegaBlur(i)),g.addUniqueObserverToNode(t,m,this.handleVegaChange(i)),g.addUniqueObserverToNode(t,f,this.handleVegaPaste())},maskConfig:{type:"custom-formatter",formatter:t=>this.valueController.valueValidationFilter(t)}})));return t(e,null,this.label&&this.renderLabel(),t("vega-flex",{class:"vega-input-passcode-container",direction:"row",gap:"size-8",role:"group","aria-label":this.label||"One-time password input",ref:t=>this.inputPasscodeContainerRef=t},i),this.hint&&t("vega-hint",null,this.hint))}renderLabel(){return t("vega-field-label",{onClick:this.focusInputPasscode,isFieldRequired:this.required,disabled:this.disabled,label:this.label})}getFirstEmptyIndexForRender(t){for(let e=0;e<t;e++)if(!this.vegaInputValues.get(e))return e;return-1}isInputAccessibleForScreenReader(t){const e=this.getFirstEmptyIndexForRender(this.length);return-1===e||t<=e}generateNewInputValue(t,e){if(2===e.length){for(let i=0;i<e.length;i++)if(e[i]!==this.vegaInputValues.get(t))return e[i];return this.vegaInputValues.get(t)}return e}}V([n()],C.prototype,"host",void 0),V([n()],C.prototype,"value",void 0),V([n()],C.prototype,"label",void 0),V([n()],C.prototype,"required",void 0),V([n()],C.prototype,"length",void 0),V([n()],C.prototype,"disabled",void 0),V([n()],C.prototype,"hint",void 0),V([n()],C.prototype,"size",void 0),V([n()],C.prototype,"inputType",void 0),V([n()],C.prototype,"vegaInputValues",void 0),V([n()],C.prototype,"valueController",void 0),V([a("watchLengthAndInputType")],C.prototype,"watchLengthAndInputType",null);var A=function(t,e,i,s){var r,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class k extends o{componentWillLoad(){this.setValuesArray(this.value),this.value=this.vegaInputValues.join("")}watchValue(){this.setValuesArray(this.value),this.changeEventEmitter.emit(this.value),x.notify(b,{host:this.host,detail:this.value}),this.value.length===this.length&&this.completeEventEmitter.emit(this.value)}watchVegaInputValues(){for(let t=0;t<this.length;t++)this.inputPasscodeRenderer.getVegaInputRefs()[t]&&(this.inputPasscodeRenderer.getVegaInputRefs()[t].value=this.vegaInputValues.get(t)||"");this.value=this.vegaInputValues.join("")}setValuesArray(t){const e=this.valueValidationFilter(t).slice(0,this.length).split("");this.vegaInputValues.setAll(e)}valueValidationFilter(t){return t.replace("text"===this.inputType?/\s/g:/\D/g,"")}getFirstEmptyIndex(){var t;const{length:e}=this;return null!==(t=Array.from({length:e},((t,e)=>this.vegaInputValues.get(e)||"")).findIndex((t=>!t||""===t)))&&void 0!==t?t:-1}}A([n()],k.prototype,"host",void 0),A([n({writable:!0})],k.prototype,"value",void 0),A([n({writable:!0})],k.prototype,"vegaInputValues",void 0),A([n()],k.prototype,"length",void 0),A([n()],k.prototype,"inputType",void 0),A([n()],k.prototype,"inputPasscodeRenderer",void 0),A([n()],k.prototype,"changeEventEmitter",void 0),A([n()],k.prototype,"completeEventEmitter",void 0),A([a("componentWillLoad")],k.prototype,"componentWillLoad",null),A([a("watchValue")],k.prototype,"watchValue",null),A([a("watchVegaInputValues")],k.prototype,"watchVegaInputValues",null);var E=function(t,e,i,s){var r,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class L extends j{constructor(){super((t=>[{keyCode:"Backspace",activeElementInScope:[this.inputPasscodeRenderer.getInputPasscodeContainerRef()],eventName:"keydown",callback:e=>{t.deletePasscode(e)}},{keyCode:["ArrowLeft","ArrowRight"],activeElementInScope:[this.inputPasscodeRenderer.getInputPasscodeContainerRef()],eventName:"keydown",callback:e=>{t.controlDirectionByKeyboard(e)}}])),this.deletePasscode=t=>{t.preventDefault();const e=this.inputPasscodeRenderer.getCurrentIndex();this.vegaInputValues.get(e)?this.vegaInputValues.withMutation((t=>{for(let i=e;i<this.length-1;i++)t[i]=t[i+1];t[this.length-1]=""})):!this.vegaInputValues.get(e)&&e>0&&(this.vegaInputValues.set(e-1,""),this.inputPasscodeRenderer.getVegaInputRefs()[e-1].doFocus())}}controlDirectionByKeyboard(t){t.preventDefault();const e=this.inputPasscodeRenderer.getCurrentIndex(),i=this.inputPasscodeRenderer.getVegaInputRefs();"ArrowLeft"===t.key&&e>0&&i[e-1].doFocus(),"ArrowRight"===t.key&&this.vegaInputValues.get(e)&&e<this.length-1&&i[e+1].doFocus()}}E([n()],L.prototype,"value",void 0),E([n()],L.prototype,"length",void 0),E([n()],L.prototype,"vegaInputValues",void 0),E([n()],L.prototype,"valueController",void 0),E([n()],L.prototype,"inputPasscodeRenderer",void 0);class F{constructor(t,e){this.length=0,this.array=[],t&&(this.array=t,this.length=t.length),e&&(this.onMutate=e)}onMutate(t){}push(...t){return this.withMutation((e=>{e.push(...t)}))}pop(){return this.withMutation((t=>{t.length>0&&t.pop()}))}set(t,e){return this.withMutation((i=>{t>=0&&(i[t]=e)}))}setAll(t){return this.withMutation((e=>{e.length=0;for(let i=0;i<t.length;i++)e[i]=t[i]}))}clear(){return this.withMutation((t=>{t.length=0}))}withMutation(t){const e=[...this.array];t(e);const i=new F(e,this.onMutate);return this.onMutate(i),i}get(t){return this.array[t]}join(t){return this.array.join(t)}toArray(){return this.array}}var O=function(t,e,i,s){var r,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};const T=class{constructor(t){i(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaComplete=s(this,"vegaComplete",7),this.complete=s(this,"complete",7),this.globalSlimmers={},this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new R:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputPasscodeRenderer.getInputPasscodeContainerRef(),touchableAreaGetter:()=>[...this.inputPasscodeRenderer.getVegaInputRefs()]}),this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.keyboardController=new L,this.valueController=new k,this.inputPasscodeRenderer=new C,this.changeEventEmitter=w(T,m),this.completeEventEmitter=w(T,v),this.eventPreventSlimmer=new y([m],(()=>this.host),{useCapture:!0}),this.vegaInputValues=new F(new Array,(t=>{this.vegaInputValues=t})),this.label="",this.disabled=!1,this.size="medium",this.hint="",this.length=4,this.inputType="numeric",this.value="",this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchVegaInputValues(){}watchLengthAndInputType(){}watchValue(){}watchValidationRules(){}render(){return d(this.inputPasscodeRenderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{vegaInputValues:["watchVegaInputValues"],length:["watchLengthAndInputType"],inputType:["watchLengthAndInputType"],value:["watchValue"],validationRules:["watchValidationRules"]}}};O([l()],T.prototype,"globalSlimmers",void 0),O([h()],T.prototype,"formFieldController",void 0),O([h()],T.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),O([h()],T.prototype,"keyboardController",void 0),O([h()],T.prototype,"valueController",void 0),O([h()],T.prototype,"inputPasscodeRenderer",void 0),O([h()],T.prototype,"changeEventEmitter",void 0),O([h()],T.prototype,"completeEventEmitter",void 0),O([h()],T.prototype,"eventPreventSlimmer",void 0),T.style=':host{display:inline-block}:host vega-field-label{margin-bottom:8px}:host vega-input::part(input-container){padding-left:0px;padding-right:0px}:host vega-input.small{width:38px;height:42px;box-sizing:border-box}:host vega-input.medium{width:42px;height:50px;box-sizing:border-box}:host vega-input::part(input){text-align:center}:host vega-input.small::part(input-container){padding-top:8px;padding-bottom:8px}:host vega-input.medium::part(input-container){padding-top:12px;padding-bottom:12px}:host .vega-input-passcode-container.error vega-input::part(input-container){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-input-passcode-container.error vega-input::part(input-container):hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-input-passcode-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));box-shadow:0 0 0}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{T as vega_input_passcode}
1
+ import{h as t,H as e,r as i,c as s,g as r}from"./p-6b2342e0.js";import{c as a,M as n,V as o,I as h}from"./p-6e1ab235.js";import{V as p,I as l}from"./p-4415ad28.js";import{s as d}from"./p-519a7d55.js";import{G as c,H as u,i as m,J as f,K as v}from"./p-9af0e2e7.js";import{D as g}from"./p-f28a6074.js";import{F as b}from"./p-a528714c.js";import{C as x}from"./p-2d0d575f.js";import{c as w}from"./p-6b5cb920.js";import{K as j}from"./p-a87cb7ac.js";import{C as y}from"./p-e27626f6.js";import{F as I}from"./p-c347e08a.js";import{R}from"./p-280cbcdb.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-6a334573.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-4cefd7fe.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-6c43d54a.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-af5cb9bc.js";var V=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};class C extends o{constructor(){super(...arguments),this.vegaInputRefs=[],this.focusInputPasscode=()=>{this.vegaInputRefs[0]&&this.vegaInputRefs[0].doFocus()},this.handleVegaFocus=t=>()=>{0!==t&&(this.vegaInputRefs[t].tabIndex=null);const e=this.vegaInputValues.get(t)?t:this.valueController.getFirstEmptyIndex(),i=-1===e?this.length-1:e;this.currentIndex=i,this.vegaInputRefs[i].doFocus()},this.handleVegaBlur=t=>()=>{0!==t&&(this.vegaInputRefs[t].tabIndex=-1)},this.handleVegaChange=t=>e=>{var i;const s=e.detail||"";if(2===s.length||1===s.length&&!this.vegaInputValues.get(t)){const e=this.generateNewInputValue(t,s);this.vegaInputValues.set(t,e),null===(i=this.vegaInputRefs[t+1])||void 0===i||i.doFocus()}},this.handleVegaPaste=()=>t=>{t.preventDefault();const e=t.detail.getData("text");this.valueController.setValuesArray(e),this.vegaInputRefs[this.value.length<this.length?this.value.length:this.length-1].doFocus()}}watchLengthAndInputType(){this.valueController.setValuesArray(this.value)}getVegaInputRefs(){return this.vegaInputRefs}getCurrentIndex(){return this.currentIndex}getInputPasscodeContainerRef(){return this.inputPasscodeContainerRef}render(){const i=Array.from({length:this.length}).map(((e,i)=>t("vega-input",{class:"small"===this.size?"small":"medium",key:i,"data-tabindex":0!==i?-1:0,showClearIcon:!1,disabled:this.disabled,"data-aria-hidden":String(!this.isInputAccessibleForScreenReader(i)),"data-aria-label":`Passcode input ${i+1} of ${this.length}`,value:this.vegaInputValues.get(i)||"",autocomplete:0===i?"one-time-code":"off",inputmode:"text"===this.inputType?"text":"numeric",ref:t=>{this.vegaInputRefs[i]=t,g.addUniqueObserverToNode(t,c,this.handleVegaFocus(i)),g.addUniqueObserverToNode(t,u,this.handleVegaBlur(i)),g.addUniqueObserverToNode(t,m,this.handleVegaChange(i)),g.addUniqueObserverToNode(t,f,this.handleVegaPaste())},maskConfig:{type:"custom-formatter",formatter:t=>this.valueController.valueValidationFilter(t)}})));return t(e,null,this.label&&this.renderLabel(),t("vega-flex",{class:"vega-input-passcode-container",direction:"row",gap:"size-8",role:"group","aria-label":this.label||"One-time password input",ref:t=>this.inputPasscodeContainerRef=t},i),this.hint&&t("vega-hint",null,this.hint))}renderLabel(){return t("vega-field-label",{onClick:this.focusInputPasscode,isFieldRequired:this.required,disabled:this.disabled,label:this.label})}getFirstEmptyIndexForRender(t){for(let e=0;e<t;e++)if(!this.vegaInputValues.get(e))return e;return-1}isInputAccessibleForScreenReader(t){const e=this.getFirstEmptyIndexForRender(this.length);return-1===e||t<=e}generateNewInputValue(t,e){if(2===e.length){for(let i=0;i<e.length;i++)if(e[i]!==this.vegaInputValues.get(t))return e[i];return this.vegaInputValues.get(t)}return e}}V([a()],C.prototype,"host",void 0),V([a()],C.prototype,"value",void 0),V([a()],C.prototype,"label",void 0),V([a()],C.prototype,"required",void 0),V([a()],C.prototype,"length",void 0),V([a()],C.prototype,"disabled",void 0),V([a()],C.prototype,"hint",void 0),V([a()],C.prototype,"size",void 0),V([a()],C.prototype,"inputType",void 0),V([a()],C.prototype,"vegaInputValues",void 0),V([a()],C.prototype,"valueController",void 0),V([n("watchLengthAndInputType")],C.prototype,"watchLengthAndInputType",null);var A=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};class k extends o{componentWillLoad(){this.setValuesArray(this.value),this.value=this.vegaInputValues.join("")}watchValue(){this.setValuesArray(this.value),this.changeEventEmitter.emit(this.value),x.notify(b,{host:this.host,detail:this.value}),this.value.length===this.length&&this.completeEventEmitter.emit(this.value)}watchVegaInputValues(){for(let t=0;t<this.length;t++)this.inputPasscodeRenderer.getVegaInputRefs()[t]&&(this.inputPasscodeRenderer.getVegaInputRefs()[t].value=this.vegaInputValues.get(t)||"");this.value=this.vegaInputValues.join("")}setValuesArray(t){const e=this.valueValidationFilter(t).slice(0,this.length).split("");this.vegaInputValues.setAll(e)}valueValidationFilter(t){return t.replace("text"===this.inputType?/\s/g:/\D/g,"")}getFirstEmptyIndex(){var t;const{length:e}=this;return null!==(t=Array.from({length:e},((t,e)=>this.vegaInputValues.get(e)||"")).findIndex((t=>!t||""===t)))&&void 0!==t?t:-1}}A([a()],k.prototype,"host",void 0),A([a({writable:!0})],k.prototype,"value",void 0),A([a({writable:!0})],k.prototype,"vegaInputValues",void 0),A([a()],k.prototype,"length",void 0),A([a()],k.prototype,"inputType",void 0),A([a()],k.prototype,"inputPasscodeRenderer",void 0),A([a()],k.prototype,"changeEventEmitter",void 0),A([a()],k.prototype,"completeEventEmitter",void 0),A([n("componentWillLoad")],k.prototype,"componentWillLoad",null),A([n("watchValue")],k.prototype,"watchValue",null),A([n("watchVegaInputValues")],k.prototype,"watchVegaInputValues",null);var E=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};class L extends j{constructor(){super((t=>[{keyCode:"Backspace",activeElementInScope:[this.inputPasscodeRenderer.getInputPasscodeContainerRef()],eventName:"keydown",callback:e=>{t.deletePasscode(e)}},{keyCode:["ArrowLeft","ArrowRight"],activeElementInScope:[this.inputPasscodeRenderer.getInputPasscodeContainerRef()],eventName:"keydown",callback:e=>{t.controlDirectionByKeyboard(e)}}])),this.deletePasscode=t=>{t.preventDefault();const e=this.inputPasscodeRenderer.getCurrentIndex();this.vegaInputValues.get(e)?this.vegaInputValues.withMutation((t=>{for(let i=e;i<this.length-1;i++)t[i]=t[i+1];t[this.length-1]=""})):!this.vegaInputValues.get(e)&&e>0&&(this.vegaInputValues.set(e-1,""),this.inputPasscodeRenderer.getVegaInputRefs()[e-1].doFocus())}}controlDirectionByKeyboard(t){t.preventDefault();const e=this.inputPasscodeRenderer.getCurrentIndex(),i=this.inputPasscodeRenderer.getVegaInputRefs();"ArrowLeft"===t.key&&e>0&&i[e-1].doFocus(),"ArrowRight"===t.key&&this.vegaInputValues.get(e)&&e<this.length-1&&i[e+1].doFocus()}}E([a()],L.prototype,"value",void 0),E([a()],L.prototype,"length",void 0),E([a()],L.prototype,"vegaInputValues",void 0),E([a()],L.prototype,"valueController",void 0),E([a()],L.prototype,"inputPasscodeRenderer",void 0);class F{constructor(t,e){this.length=0,this.array=[],t&&(this.array=t,this.length=t.length),e&&(this.onMutate=e)}onMutate(t){}push(...t){return this.withMutation((e=>{e.push(...t)}))}pop(){return this.withMutation((t=>{t.length>0&&t.pop()}))}set(t,e){return this.withMutation((i=>{t>=0&&(i[t]=e)}))}setAll(t){return this.withMutation((e=>{e.length=0;for(let i=0;i<t.length;i++)e[i]=t[i]}))}clear(){return this.withMutation((t=>{t.length=0}))}withMutation(t){const e=[...this.array];t(e);const i=new F(e,this.onMutate);return this.onMutate(i),i}get(t){return this.array[t]}join(t){return this.array.join(t)}toArray(){return this.array}}var O=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const T=class{constructor(t){i(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaComplete=s(this,"vegaComplete",7),this.complete=s(this,"complete",7),this.globalSlimmers={},this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new R:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputPasscodeRenderer.getInputPasscodeContainerRef(),touchableAreaGetter:()=>[...this.inputPasscodeRenderer.getVegaInputRefs()]}),this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.keyboardController=new L,this.valueController=new k,this.inputPasscodeRenderer=new C,this.changeEventEmitter=w(T,m),this.completeEventEmitter=w(T,v),this.eventPreventSlimmer=new y([m],(()=>this.host),{useCapture:!0}),this.vegaInputValues=new F(new Array,(t=>{this.vegaInputValues=t})),this.label="",this.disabled=!1,this.size="medium",this.hint="",this.length=4,this.inputType="numeric",this.value="",this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchVegaInputValues(){}watchLengthAndInputType(){}watchValue(){}watchValidationRules(){}render(){return d(this.inputPasscodeRenderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{vegaInputValues:["watchVegaInputValues"],length:["watchLengthAndInputType"],inputType:["watchLengthAndInputType"],value:["watchValue"],validationRules:["watchValidationRules"]}}};O([l()],T.prototype,"globalSlimmers",void 0),O([h()],T.prototype,"formFieldController",void 0),O([h()],T.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),O([h()],T.prototype,"keyboardController",void 0),O([h()],T.prototype,"valueController",void 0),O([h()],T.prototype,"inputPasscodeRenderer",void 0),O([h()],T.prototype,"changeEventEmitter",void 0),O([h()],T.prototype,"completeEventEmitter",void 0),O([h()],T.prototype,"eventPreventSlimmer",void 0),T.style=':host{display:inline-block}:host vega-field-label{margin-bottom:8px}:host vega-input::part(input-container){padding-left:0px;padding-right:0px}:host vega-input.small{width:38px;height:42px;box-sizing:border-box}:host vega-input.medium{width:42px;height:50px;box-sizing:border-box}:host vega-input::part(input){text-align:center}:host vega-input.small::part(input-container){padding-top:8px;padding-bottom:8px}:host vega-input.medium::part(input-container){padding-top:12px;padding-bottom:12px}:host .vega-input-passcode-container.error vega-input::part(input-container){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-input-passcode-container.error vega-input::part(input-container):hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-input-passcode-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));box-shadow:0 0 0}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{T as vega_input_passcode}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as r,g as s}from"./p-6b2342e0.js";import{R as o}from"./p-280cbcdb.js";import{c as a}from"./p-6ac8e655.js";import{s as n}from"./p-519a7d55.js";import{a as p,h as l,c as d}from"./p-ec2a1d4c.js";import{F as h}from"./p-b2df5cb1.js";import{I as c}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4415ad28.js";import{F as g}from"./p-a528714c.js";import{c as x}from"./p-de7109d3.js";import{C as b}from"./p-2d0d575f.js";import{i as v}from"./p-9af0e2e7.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-11e2dcf5.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-158108ea.js";import"./p-f1c672e4.js";const u=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!1===e.autoValidation}];var w=function(e,t,i,r){var s,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const j=class{constructor(r){e(this,r),this.vegaChange=t(this,"vegaChange",7),this.change=t(this,"change",7),this.globalSlimmers={},this.formFieldController=new h({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new o:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.colorPickerContainerRef,touchableAreaGetter:()=>[this.colorPickerTouchableAreaRef]}),this.changeEventEmitter=x(j,v),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(u),this.value="",this.hint="",this.disabled=!1,this.required=!1,this.label="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.isInline=!1,this.columns=8,this.renderColorPickerContainer=()=>{const e=this.getValidColumns();return i("div",{class:p([this.isInline?null:"color-picker-inline"]),ref:e=>this.colorPickerContainerRef=e},i("vega-flex",{direction:"row",gap:"size-8",alignItems:"center",style:{maxWidth:34*e-8+"px"}},this.colors.map((e=>{const t=this.value===e;return i("div",{id:e,class:{"color-picker-inline-items":!0,selected:t},ref:e=>this.colorPickerTouchableAreaRef=e,style:{backgroundColor:e},onClick:this.updateValueProp,role:"button",tabIndex:0,"aria-label":"color",onKeyDown:a()},t?i("vega-icon",{icon:"checkmark",size:"size-16",class:{"v-text-black":this.isDarkColorCheckmark(this.value),"v-text-white":!this.isDarkColorCheckmark(this.value)}}):null)}))))},this.renderHintMessage=()=>i("vega-text",null,this.hint),this.updateValueProp=async e=>{this.disabled||(this.value=String(e.currentTarget.getAttribute("id")))}}watchValue(){this.resetValueIfInvalid(),this.changeEventEmitter.emit(this.value),b.notify(g,{host:this.host,detail:this.value})}watchValidationRules(){}connectedCallback(){this.resetValueIfInvalid()}render(){return n(i(r,{class:{disabled:this.disabled}},this.renderLabelDom(),this.renderColorPickerContainer(),this.hint&&this.renderHintMessage()),this.host)}renderLabelDom(){return i("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label})}getValidColumns(){const e=Math.floor(this.columns);return Number.isFinite(e)&&e>0?e:1}isDarkColorCheckmark(e,t="#fcfcfc",i="#203645"){const r=this.getLuminance(e),s=this.getLuminance(t),o=this.getLuminance(i);return r>Math.sqrt((s+.05)*(o+.05))-.05}getLuminance(e){const t=[l(e).r/255,l(e).g/255,l(e).b/255].map((e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4));return.2126*t[0]+.7152*t[1]+.0722*t[2]}resetValueIfInvalid(){this.colors.some((e=>d(e).toUpperCase()==d(this.value).toUpperCase()))||(this.value="")}get host(){return s(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};w([f()],j.prototype,"globalSlimmers",void 0),w([c()],j.prototype,"formFieldController",void 0),w([c()],j.prototype,"changeEventEmitter",void 0),w([c()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),j.style=':host{display:inline-block;text-align:left;line-height:normal}:host vega-field-label{margin-bottom:8px}:host(.disabled) .color-picker-inline{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.disabled) .color-picker-inline-items:hover{box-shadow:none}:host(.disabled) .color-picker-inline-items:focus-within{box-shadow:none}:host .color-picker-inline{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding:12px;max-width:max-content}:host .color-picker-inline-items{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));border-radius:4px;width:24px;height:24px;cursor:pointer;align-items:center;justify-content:center}:host .color-picker-inline-items.selected{border-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1))}:host .color-picker-inline-items:hover{box-shadow:0 0 0 4px rgba(var(--v-ring-input-focus, 19, 98, 226, 0.25))}:host .color-picker-inline-items:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));box-shadow:0px 0px 0px 1px rgba(var(--v-bg-primary, 252, 252, 252, 1)) inset;border:1px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}:host .checkmark-black{color:rgba(var(--v-text-black, 32, 54, 69, 1))}:host .checkmark-white{color:rgba(var(--v-text-white, 252, 252, 252, 1))}:host vega-text{padding-left:8px;padding-right:8px;padding-top:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .color-picker-inline.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-hidden{display:none}:host vega-flex{flex-wrap:wrap}';export{j as vega_color_picker}
1
+ import{r as e,c as t,h as i,H as r,g as s}from"./p-6b2342e0.js";import{R as o}from"./p-280cbcdb.js";import{c as a}from"./p-6ac8e655.js";import{s as n}from"./p-519a7d55.js";import{a as p,h as l,c as h}from"./p-6e70d3cc.js";import{F as d}from"./p-c347e08a.js";import{I as c}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4415ad28.js";import{F as g}from"./p-a528714c.js";import{c as x}from"./p-6b5cb920.js";import{C as b}from"./p-2d0d575f.js";import{i as v}from"./p-9af0e2e7.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-f28a6074.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-af5cb9bc.js";import"./p-f1c672e4.js";const u=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!1===e.autoValidation}];var w=function(e,t,i,r){var s,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const j=class{constructor(r){e(this,r),this.vegaChange=t(this,"vegaChange",7),this.change=t(this,"change",7),this.globalSlimmers={},this.formFieldController=new d({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new o:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.colorPickerContainerRef,touchableAreaGetter:()=>[this.colorPickerTouchableAreaRef]}),this.changeEventEmitter=x(j,v),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(u),this.value="",this.hint="",this.disabled=!1,this.required=!1,this.label="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.isInline=!1,this.columns=8,this.renderColorPickerContainer=()=>{const e=this.getValidColumns();return i("div",{class:p([this.isInline?null:"color-picker-inline"]),ref:e=>this.colorPickerContainerRef=e},i("vega-flex",{direction:"row",gap:"size-8",alignItems:"center",style:{maxWidth:34*e-8+"px"}},this.colors.map((e=>{const t=this.value===e;return i("div",{id:e,class:{"color-picker-inline-items":!0,selected:t},ref:e=>this.colorPickerTouchableAreaRef=e,style:{backgroundColor:e},onClick:this.updateValueProp,role:"button",tabIndex:0,"aria-label":"color",onKeyDown:a()},t?i("vega-icon",{icon:"checkmark",size:"size-16",class:{"v-text-black":this.isDarkColorCheckmark(this.value),"v-text-white":!this.isDarkColorCheckmark(this.value)}}):null)}))))},this.renderHintMessage=()=>i("vega-text",null,this.hint),this.updateValueProp=async e=>{this.disabled||(this.value=String(e.currentTarget.getAttribute("id")))}}watchValue(){this.resetValueIfInvalid(),this.changeEventEmitter.emit(this.value),b.notify(g,{host:this.host,detail:this.value})}watchValidationRules(){}connectedCallback(){this.resetValueIfInvalid()}render(){return n(i(r,{class:{disabled:this.disabled}},this.renderLabelDom(),this.renderColorPickerContainer(),this.hint&&this.renderHintMessage()),this.host)}renderLabelDom(){return i("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label})}getValidColumns(){const e=Math.floor(this.columns);return Number.isFinite(e)&&e>0?e:1}isDarkColorCheckmark(e,t="#fcfcfc",i="#203645"){const r=this.getLuminance(e),s=this.getLuminance(t),o=this.getLuminance(i);return r>Math.sqrt((s+.05)*(o+.05))-.05}getLuminance(e){const t=[l(e).r/255,l(e).g/255,l(e).b/255].map((e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4));return.2126*t[0]+.7152*t[1]+.0722*t[2]}resetValueIfInvalid(){this.colors.some((e=>h(e).toUpperCase()==h(this.value).toUpperCase()))||(this.value="")}get host(){return s(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};w([f()],j.prototype,"globalSlimmers",void 0),w([c()],j.prototype,"formFieldController",void 0),w([c()],j.prototype,"changeEventEmitter",void 0),w([c()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),j.style=':host{display:inline-block;text-align:left;line-height:normal}:host vega-field-label{margin-bottom:8px}:host(.disabled) .color-picker-inline{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.disabled) .color-picker-inline-items:hover{box-shadow:none}:host(.disabled) .color-picker-inline-items:focus-within{box-shadow:none}:host .color-picker-inline{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding:12px;max-width:max-content}:host .color-picker-inline-items{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));border-radius:4px;width:24px;height:24px;cursor:pointer;align-items:center;justify-content:center}:host .color-picker-inline-items.selected{border-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1))}:host .color-picker-inline-items:hover{box-shadow:0 0 0 4px rgba(var(--v-ring-input-focus, 19, 98, 226, 0.25))}:host .color-picker-inline-items:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));box-shadow:0px 0px 0px 1px rgba(var(--v-bg-primary, 252, 252, 252, 1)) inset;border:1px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}:host .checkmark-black{color:rgba(var(--v-text-black, 32, 54, 69, 1))}:host .checkmark-white{color:rgba(var(--v-text-white, 252, 252, 252, 1))}:host vega-text{padding-left:8px;padding-right:8px;padding-top:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .color-picker-inline.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-hidden{display:none}:host vega-flex{flex-wrap:wrap}';export{j as vega_color_picker}
@@ -1 +1 @@
1
- import{V as t}from"./p-6e1ab235.js";import{c as s}from"./p-6a334573.js";import{C as a}from"./p-2d0d575f.js";import{O as o}from"./p-331a62d5.js";import{k as m,j as p}from"./p-6c43d54a.js";import{d as e}from"./p-11e2dcf5.js";class i extends t{constructor({propName:t}){super(),this.isAcceptableObserverPayload=t=>t.host===this.host&&t.stateName===this.propName,this.propName=t}connectedCallback(){this.subStateObserver=new o(this.isAcceptableObserverPayload.bind(this),(t=>{t.callback(this.propValue)})),a.register(e.getSubject(this.host,m),this.subStateObserver)}disconnectedCallback(){a.unregister(e.getSubject(this.host,m),this.subStateObserver)}subStateNotify(){a.notify(e.getSubject(this.host,p),{host:this.host,stateName:this.propName,value:this.propValue})}}function c(t,a,o){const m=[{mapFrom:"connectedCallback",mapTo:"connectedCallback"},{mapFrom:"disconnectedCallback",mapTo:"disconnectedCallback"}];return o&&m.push({mapFrom:o,mapTo:"subStateNotify"}),s(t,i,[{mapFrom:"host",mapTo:"host"},{mapFrom:a,mapTo:"propValue"}],m,[{propName:a}])}export{c}
1
+ import{V as t}from"./p-6e1ab235.js";import{c as s}from"./p-6a334573.js";import{C as a}from"./p-2d0d575f.js";import{O as o}from"./p-331a62d5.js";import{k as m,j as p}from"./p-6c43d54a.js";import{d as i}from"./p-f28a6074.js";class e extends t{constructor({propName:t}){super(),this.isAcceptableObserverPayload=t=>t.host===this.host&&t.stateName===this.propName,this.propName=t}connectedCallback(){this.subStateObserver=new o(this.isAcceptableObserverPayload.bind(this),(t=>{t.callback(this.propValue)})),a.register(i.getSubject(this.host,m),this.subStateObserver)}disconnectedCallback(){a.unregister(i.getSubject(this.host,m),this.subStateObserver)}subStateNotify(){a.notify(i.getSubject(this.host,p),{host:this.host,stateName:this.propName,value:this.propValue})}}function c(t,a,o){const m=[{mapFrom:"connectedCallback",mapTo:"connectedCallback"},{mapFrom:"disconnectedCallback",mapTo:"disconnectedCallback"}];return o&&m.push({mapFrom:o,mapTo:"subStateNotify"}),s(t,e,[{mapFrom:"host",mapTo:"host"},{mapFrom:a,mapTo:"propValue"}],m,[{propName:a}])}export{c}
@@ -1 +1 @@
1
- import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-ec2a1d4c.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-11e2dcf5.js";import{h as y,f as w,i as O}from"./p-6c43d54a.js";import{V as E}from"./p-3b791b5d.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-81dd00d0.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-158108ea.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}
1
+ import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-6e70d3cc.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-f28a6074.js";import{h as y,f as w,i as O}from"./p-6c43d54a.js";import{V as E}from"./p-3b791b5d.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-81dd00d0.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-af5cb9bc.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}
@@ -1 +1 @@
1
- import{h as e,F as t,r as o,c as r,H as i,g as a}from"./p-6b2342e0.js";import{s as l}from"./p-519a7d55.js";import{c as s,V as n,M as d,I as c}from"./p-6e1ab235.js";import{V as v,I as p}from"./p-4415ad28.js";import{V as h}from"./p-e1fbfd20.js";import{D as f}from"./p-11e2dcf5.js";import{a as g,i as u,y as b,o as m,z as x,A as w}from"./p-9af0e2e7.js";import{g as C}from"./p-8b5d3a52.js";import{c as y}from"./p-6ac8e655.js";import{t as j}from"./p-aacf6920.js";import{c as F}from"./p-de7109d3.js";import{C as R}from"./p-2d0d575f.js";import{F as L}from"./p-a528714c.js";import{F as k}from"./p-b2df5cb1.js";import{F as z}from"./p-0bb860cc.js";import{D as E}from"./p-b19b1c08.js";import{T as M}from"./p-57f220b5.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-331a62d5.js";import"./p-ec2a1d4c.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-158108ea.js";import"./p-280cbcdb.js";var V=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class I extends n{render(){return e(t,null,e("vega-field-label",{isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.vegaFileUploaderContainerRenderer.render(),this.hint?e("vega-hint",null,this.hint):null,this.vegaFileUploaderFileListRenderer.render())}}V([s()],I.prototype,"required",void 0),V([s()],I.prototype,"disabled",void 0),V([s()],I.prototype,"label",void 0),V([s()],I.prototype,"hint",void 0),V([s()],I.prototype,"vegaFileUploaderContainerRenderer",void 0),V([s()],I.prototype,"vegaFileUploaderFileListRenderer",void 0);var U=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class O extends n{constructor(){super(...arguments),this.handleDropAreaClick=e=>{e.stopPropagation(),this.shouldDisableUploadButton()||this.triggerFileInputClick()},this.triggerFileInputClick=()=>{this.inputElementRef.click()},this.inputChangeHandler=e=>{e.stopPropagation();const t=this.getVegaFilesFromFileList(e.target.files);this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(t)),this.inputElementRef.value=""},this.dropHandler=e=>{var t;if(e.preventDefault(),!this.shouldDisableUploadButton()){const o=this.getVegaFilesFromFileList(this.dropFileFilterController.process(null===(t=e.dataTransfer)||void 0===t?void 0:t.files));this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(o))}}}getUploaderContainerRef(){return this.uploaderContainerRef}render(){return e("div",{class:"vega-file-uploader-container",ref:e=>this.uploaderContainerRef=e},e("input",{onChange:this.inputChangeHandler,type:"file",multiple:!this.fileLimitController.isSingleMode(),accept:this.accept,style:{display:"none"},ref:e=>this.inputElementRef=e}),"uploadButton"===this.variant?this.renderUploadButton():this.renderUploadDropArea())}renderUploadButton(){return e("vega-button",{label:"Upload Document",icon:h.getIconKey("arrow-up-from-line"),variant:"secondary",size:"small",disabled:this.shouldDisableUploadButton(),ref:e=>{f.addUniqueObserverToNode(e,g,this.triggerFileInputClick)}})}renderUploadDropArea(){return e("vega-box",{class:{"vega-file-upload-area":!0,disabled:this.shouldDisableUploadButton()},padding:"size-24",border:"border-input-field",borderStyle:"dashed",backgroundColor:"bg-tertiary",corners:"rounded-8",tabIndex:0,onDrop:this.dropHandler,onDragEnter:this.preventDefaultBehavior,onDragOver:this.preventDefaultBehavior,onClick:this.handleDropAreaClick,onKeyDown:y()},e("vega-flex",{gap:"size-8",alignItems:"center",justifyContent:"center"},e("vega-icon",{color:"text-link",icon:h.getIconKey("arrow-up-from-line")}),e("vega-font",{color:"text-link",variant:"font-btn-label"},this.translationSlimmer.t("Select or drop your file here"))))}preventDefaultBehavior(e){e.preventDefault()}selectFileChangeEventEmitHandler(e){e&&e.length&&(this.selectFileChangeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value&&this.value.length?(new Array).concat(this.value,e):e))}getVegaFilesFromFileList(e){const t=[];return e&&e.length&&Array.from(e).map((e=>{t.push({key:C(),name:e.name,url:e})})),t}shouldDisableUploadButton(){return this.disabled||!!(this.value&&this.maxCount&&this.value.length>=this.maxCount)}filterExceedLimitFiles(e){const t=Number(this.maxCount);if(!isNaN(t)&&t&&e.length){const o=Math.max(0,t-(this.value?this.value.length:0));return e.slice(0,o)}return e}}h.register({"arrow-up-from-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3V208 320c0 17.7 14.3 32 32 32s32-14.3 32-32V208 141.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/></svg>'}}),U([s()],O.prototype,"variant",void 0),U([s()],O.prototype,"accept",void 0),U([s()],O.prototype,"disabled",void 0),U([s()],O.prototype,"value",void 0),U([s()],O.prototype,"selectFileChangeEventEmitter",void 0),U([s()],O.prototype,"vegaFileUploaderValueController",void 0),U([s()],O.prototype,"dropFileFilterController",void 0),U([s()],O.prototype,"translationSlimmer",void 0),U([s()],O.prototype,"fileLimitController",void 0),U([s()],O.prototype,"maxCount",void 0);var A=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class D extends n{constructor(){super(...arguments),this.fileRemoveHandler=e=>{this.removeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value.filter((t=>t!==e)))},this.fileReUploadHandler=e=>{this.retryEventEmitter.emit(e)},this.filePreviewHandler=e=>{this.previewEventEmitter.emit(e)}}render(){const t=!this.value||this.value.length<1;return e("div",{class:{"vega-file-uploader-file-list":!0,"vega-file-list-hidden":t}},!t&&this.value.map((t=>e("vega-box",{key:t.key,class:"vega-file-uploader-file",padding:"size-8",corners:"rounded-8"},e("vega-flex",{alignItems:"start",justifyContent:"space-between"},e("vega-flex",{class:"vega-file-status-and-name",gap:"size-8",alignItems:"start"},e("div",{style:{paddingTop:"3px"}},this.vegaFileUploaderFileStatusRenderer.render(t.status,t.uploadingPercent)),e("vega-flex",{gap:"size-4",direction:"col"},e("vega-font",{color:"done"===t.status||"error"===t.status?"text-primary":"text-secondary",variant:"font-field-label"},t.name),"error"===t.status&&t.errorMessage&&e("vega-font",{color:"text-error",variant:"font-footnote1-short"},t.errorMessage))),e("vega-flex",{gap:"size-4",class:"vega-file-list-buttons",justifyContent:"end"},t.previewable&&e("vega-button-circle",{class:"vega-file-preview-button",variant:"icon-only",size:"small",icon:"zoom-in",iconColor:"text-secondary",label:"Preview",tooltip:{disableInteractive:!0},ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.filePreviewHandler(t)}))}}),"error"===t.status&&e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("arrow-rotate-right"),iconColor:"text-secondary",label:"Retry",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileReUploadHandler(t)}))}}),e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("trash-can"),iconColor:"text-secondary",label:"Delete",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileRemoveHandler(t)}))}})))))))}}h.register({"trash-can":j,"arrow-rotate-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M456 224c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24s-24 10.7-24 24v80.1l-20-23.5C371 63.4 309.1 32 240 32C116.3 32 16 132.3 16 256s100.3 224 224 224c50.4 0 97-16.7 134.4-44.8c10.6-8 12.7-23 4.8-33.6s-23-12.7-33.6-4.8C316.2 418.9 279.7 432 240 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c54.3 0 102.9 24.6 135.2 63.4l.1 .2 0 0L402.9 176H312c-13.3 0-24 10.7-24 24s10.7 24 24 24H456z"/></svg>'}}),A([s()],D.prototype,"value",void 0),A([s()],D.prototype,"disabled",void 0),A([s()],D.prototype,"vegaFileUploaderFileStatusRenderer",void 0),A([s()],D.prototype,"removeEventEmitter",void 0),A([s()],D.prototype,"vegaFileUploaderValueController",void 0),A([s()],D.prototype,"retryEventEmitter",void 0),A([s()],D.prototype,"previewEventEmitter",void 0);class S extends n{render(t,o){switch(t){case"uploading":return e("vega-loading-indicator",Object.assign({class:"vega-file-list-status",mode:o?"determinate":"indeterminate",size:"micro"},o?{percent:o}:{}));case"done":return e("vega-icon",{class:"vega-file-list-status",color:"text-success",icon:h.getIconKey("circle-check-regular")});case"error":return e("vega-icon",{class:"vega-file-list-status",color:"text-error",icon:h.getIconKey("circle-xmark")});default:return e("vega-loading-indicator",{class:"vega-file-list-status",mode:"determinate",size:"micro"})}}}h.register({"circle-check-regular":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'},"circle-xmark":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M175 175C184.4 165.7 199.6 165.7 208.1 175L255.1 222.1L303 175C312.4 165.7 327.6 165.7 336.1 175C346.3 184.4 346.3 199.6 336.1 208.1L289.9 255.1L336.1 303C346.3 312.4 346.3 327.6 336.1 336.1C327.6 346.3 312.4 346.3 303 336.1L255.1 289.9L208.1 336.1C199.6 346.3 184.4 346.3 175 336.1C165.7 327.6 165.7 312.4 175 303L222.1 255.1L175 208.1C165.7 199.6 165.7 184.4 175 175V175zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'}});var B=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class H extends n{valueChangeHandler(e){!e||Array.isArray(e)?(this.changeEventEmitter.emit(e),R.notify(L,{host:this.host,detail:this.value})):e&&!Array.isArray(e)&&this.setValue(null)}setValue(e){this.value=e}}B([s()],H.prototype,"host",void 0),B([s({writable:!0})],H.prototype,"value",void 0),B([s()],H.prototype,"changeEventEmitter",void 0),B([d("watchValue")],H.prototype,"valueChangeHandler",null);var N=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class P extends n{isSingleMode(){return 1===Number(this.maxCount)}checkMaxCount(){null!==this.maxCount&&this.maxCount<1&&(this.maxCount=null)}}N([s({writable:!0})],P.prototype,"maxCount",void 0),N([d("componentDidLoad"),d("watchMaxCount")],P.prototype,"checkMaxCount",null);var q=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};const G=class{constructor(e){o(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.vegaSelectedFileChange=r(this,"vegaSelectedFileChange",7),this.selectedFileChange=r(this,"selectedFileChange",7),this.vegaRemove=r(this,"vegaRemove",7),this.remove=r(this,"remove",7),this.vegaRetry=r(this,"vegaRetry",7),this.retry=r(this,"retry",7),this.vegaPreview=r(this,"vegaPreview",7),this.preview=r(this,"preview",7),this.globalSlimmers={},this.translationSlimmer=new M,this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.formFieldController=new k({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new z:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaFileUploaderContainerRenderer.getUploaderContainerRef(),touchableAreaGetter:()=>[this.vegaFileUploaderContainerRenderer.getUploaderContainerRef()]}),this.vegaFileUploaderRenderer=new I,this.vegaFileUploaderContainerRenderer=new O,this.vegaFileUploaderFileListRenderer=new D,this.vegaFileUploaderFileStatusRenderer=new S,this.vegaFileUploaderValueController=new H,this.dropFileFilterController=new E,this.fileLimitController=new P,this.changeEventEmitter=F(G,u),this.selectFileChangeEventEmitter=F(G,b),this.removeEventEmitter=F(G,m),this.retryEventEmitter=F(G,x),this.previewEventEmitter=F(G,w),this.label="",this.variant="uploadArea",this.hint="",this.value=[],this.disabled=!1,this.maxCount=null,this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchValue(e){}watchMaxCount(){}watchValidationRules(){}render(){return l(e(i,null,this.vegaFileUploaderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],maxCount:["watchMaxCount"],validationRules:["watchValidationRules"]}}};q([p()],G.prototype,"globalSlimmers",void 0),q([c()],G.prototype,"translationSlimmer",void 0),q([c()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q([c()],G.prototype,"formFieldController",void 0),q([c()],G.prototype,"vegaFileUploaderRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderContainerRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderFileListRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderFileStatusRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderValueController",void 0),q([c()],G.prototype,"dropFileFilterController",void 0),q([c()],G.prototype,"fileLimitController",void 0),q([c()],G.prototype,"changeEventEmitter",void 0),q([c()],G.prototype,"selectFileChangeEventEmitter",void 0),q([c()],G.prototype,"removeEventEmitter",void 0),q([c()],G.prototype,"retryEventEmitter",void 0),q([c()],G.prototype,"previewEventEmitter",void 0),G.style=':host{display:inline-block;text-align:left;width:100%;line-height:normal}:host .vega-file-uploader-container .vega-file-upload-area{text-align:center}:host .vega-file-uploader-container .vega-file-upload-area:hover{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-input-field-hover, 115, 160, 190, 1))}:host .vega-file-uploader-container .vega-file-upload-area:hover vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:hover vega-font{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .vega-file-uploader-container .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-file-uploader-container .vega-file-upload-area:active{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area:active vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:active vega-font{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area.disabled{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1));outline:none}:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-icon,:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-file-uploader-container vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error .vega-file-upload-area{border-color:rgba(var(--v-border-color-input-field-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:hover{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .vega-file-uploader-container.error .vega-file-upload-area:active{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error vega-button::part(button),:host .vega-file-uploader-container.error vega-button::part(button):hover{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1));border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error vega-button::part(button):hover{background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}:host .vega-file-uploader-container.error vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error vega-button::part(button):active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1));border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2))}:host .vega-file-uploader-file-list .vega-file-uploader-file .vega-file-preview-button{visibility:hidden}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover{background-color:rgba(var(--v-bg-action-tertiary-hover, 4, 4, 28, 0.05))}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover .vega-file-preview-button{visibility:visible}:host .vega-file-uploader-file-list .vega-file-list-buttons{margin-left:8px;flex-shrink:0}:host .vega-file-uploader-file-list .vega-file-list-status svg{width:16px;height:16px}:host .vega-file-uploader-file-list .vega-file-status-and-name{padding-top:5px}:host .vega-file-uploader-file-list .vega-file-status-and-name vega-font{word-break:break-word}:host vega-field-label{margin-bottom:8px}:host .vega-file-uploader-file-list{margin-top:8px}:host .vega-file-uploader-file-list.vega-file-list-hidden{display:none}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{G as vega_file_uploader}
1
+ import{h as e,F as t,r as o,c as r,H as i,g as a}from"./p-6b2342e0.js";import{s as l}from"./p-519a7d55.js";import{c as s,V as n,M as c,I as d}from"./p-6e1ab235.js";import{V as v,I as p}from"./p-4415ad28.js";import{V as h}from"./p-e1fbfd20.js";import{D as f}from"./p-f28a6074.js";import{a as g,i as u,y as b,o as m,z as x,A as w}from"./p-9af0e2e7.js";import{g as C}from"./p-8b5d3a52.js";import{c as y}from"./p-6ac8e655.js";import{t as j}from"./p-aacf6920.js";import{c as F}from"./p-6b5cb920.js";import{C as R}from"./p-2d0d575f.js";import{F as L}from"./p-a528714c.js";import{F as k}from"./p-c347e08a.js";import{F as z}from"./p-0bb860cc.js";import{D as E}from"./p-b19b1c08.js";import{T as M}from"./p-57f220b5.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-af5cb9bc.js";import"./p-280cbcdb.js";var V=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class I extends n{render(){return e(t,null,e("vega-field-label",{isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.vegaFileUploaderContainerRenderer.render(),this.hint?e("vega-hint",null,this.hint):null,this.vegaFileUploaderFileListRenderer.render())}}V([s()],I.prototype,"required",void 0),V([s()],I.prototype,"disabled",void 0),V([s()],I.prototype,"label",void 0),V([s()],I.prototype,"hint",void 0),V([s()],I.prototype,"vegaFileUploaderContainerRenderer",void 0),V([s()],I.prototype,"vegaFileUploaderFileListRenderer",void 0);var U=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class O extends n{constructor(){super(...arguments),this.handleDropAreaClick=e=>{e.stopPropagation(),this.shouldDisableUploadButton()||this.triggerFileInputClick()},this.triggerFileInputClick=()=>{this.inputElementRef.click()},this.inputChangeHandler=e=>{e.stopPropagation();const t=this.getVegaFilesFromFileList(e.target.files);this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(t)),this.inputElementRef.value=""},this.dropHandler=e=>{var t;if(e.preventDefault(),!this.shouldDisableUploadButton()){const o=this.getVegaFilesFromFileList(this.dropFileFilterController.process(null===(t=e.dataTransfer)||void 0===t?void 0:t.files));this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(o))}}}getUploaderContainerRef(){return this.uploaderContainerRef}render(){return e("div",{class:"vega-file-uploader-container",ref:e=>this.uploaderContainerRef=e},e("input",{onChange:this.inputChangeHandler,type:"file",multiple:!this.fileLimitController.isSingleMode(),accept:this.accept,style:{display:"none"},ref:e=>this.inputElementRef=e}),"uploadButton"===this.variant?this.renderUploadButton():this.renderUploadDropArea())}renderUploadButton(){return e("vega-button",{label:"Upload Document",icon:h.getIconKey("arrow-up-from-line"),variant:"secondary",size:"small",disabled:this.shouldDisableUploadButton(),ref:e=>{f.addUniqueObserverToNode(e,g,this.triggerFileInputClick)}})}renderUploadDropArea(){return e("vega-box",{class:{"vega-file-upload-area":!0,disabled:this.shouldDisableUploadButton()},padding:"size-24",border:"border-input-field",borderStyle:"dashed",backgroundColor:"bg-tertiary",corners:"rounded-8",tabIndex:0,onDrop:this.dropHandler,onDragEnter:this.preventDefaultBehavior,onDragOver:this.preventDefaultBehavior,onClick:this.handleDropAreaClick,onKeyDown:y()},e("vega-flex",{gap:"size-8",alignItems:"center",justifyContent:"center"},e("vega-icon",{color:"text-link",icon:h.getIconKey("arrow-up-from-line")}),e("vega-font",{color:"text-link",variant:"font-btn-label"},this.translationSlimmer.t("Select or drop your file here"))))}preventDefaultBehavior(e){e.preventDefault()}selectFileChangeEventEmitHandler(e){e&&e.length&&(this.selectFileChangeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value&&this.value.length?(new Array).concat(this.value,e):e))}getVegaFilesFromFileList(e){const t=[];return e&&e.length&&Array.from(e).map((e=>{t.push({key:C(),name:e.name,url:e})})),t}shouldDisableUploadButton(){return this.disabled||!!(this.value&&this.maxCount&&this.value.length>=this.maxCount)}filterExceedLimitFiles(e){const t=Number(this.maxCount);if(!isNaN(t)&&t&&e.length){const o=Math.max(0,t-(this.value?this.value.length:0));return e.slice(0,o)}return e}}h.register({"arrow-up-from-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3V208 320c0 17.7 14.3 32 32 32s32-14.3 32-32V208 141.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/></svg>'}}),U([s()],O.prototype,"variant",void 0),U([s()],O.prototype,"accept",void 0),U([s()],O.prototype,"disabled",void 0),U([s()],O.prototype,"value",void 0),U([s()],O.prototype,"selectFileChangeEventEmitter",void 0),U([s()],O.prototype,"vegaFileUploaderValueController",void 0),U([s()],O.prototype,"dropFileFilterController",void 0),U([s()],O.prototype,"translationSlimmer",void 0),U([s()],O.prototype,"fileLimitController",void 0),U([s()],O.prototype,"maxCount",void 0);var A=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class D extends n{constructor(){super(...arguments),this.fileRemoveHandler=e=>{this.removeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value.filter((t=>t!==e)))},this.fileReUploadHandler=e=>{this.retryEventEmitter.emit(e)},this.filePreviewHandler=e=>{this.previewEventEmitter.emit(e)}}render(){const t=!this.value||this.value.length<1;return e("div",{class:{"vega-file-uploader-file-list":!0,"vega-file-list-hidden":t}},!t&&this.value.map((t=>e("vega-box",{key:t.key,class:"vega-file-uploader-file",padding:"size-8",corners:"rounded-8"},e("vega-flex",{alignItems:"start",justifyContent:"space-between"},e("vega-flex",{class:"vega-file-status-and-name",gap:"size-8",alignItems:"start"},e("div",{style:{paddingTop:"3px"}},this.vegaFileUploaderFileStatusRenderer.render(t.status,t.uploadingPercent)),e("vega-flex",{gap:"size-4",direction:"col"},e("vega-font",{color:"done"===t.status||"error"===t.status?"text-primary":"text-secondary",variant:"font-field-label"},t.name),"error"===t.status&&t.errorMessage&&e("vega-font",{color:"text-error",variant:"font-footnote1-short"},t.errorMessage))),e("vega-flex",{gap:"size-4",class:"vega-file-list-buttons",justifyContent:"end"},t.previewable&&e("vega-button-circle",{class:"vega-file-preview-button",variant:"icon-only",size:"small",icon:"zoom-in",iconColor:"text-secondary",label:"Preview",tooltip:{disableInteractive:!0},ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.filePreviewHandler(t)}))}}),"error"===t.status&&e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("arrow-rotate-right"),iconColor:"text-secondary",label:"Retry",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileReUploadHandler(t)}))}}),e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("trash-can"),iconColor:"text-secondary",label:"Delete",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileRemoveHandler(t)}))}})))))))}}h.register({"trash-can":j,"arrow-rotate-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M456 224c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24s-24 10.7-24 24v80.1l-20-23.5C371 63.4 309.1 32 240 32C116.3 32 16 132.3 16 256s100.3 224 224 224c50.4 0 97-16.7 134.4-44.8c10.6-8 12.7-23 4.8-33.6s-23-12.7-33.6-4.8C316.2 418.9 279.7 432 240 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c54.3 0 102.9 24.6 135.2 63.4l.1 .2 0 0L402.9 176H312c-13.3 0-24 10.7-24 24s10.7 24 24 24H456z"/></svg>'}}),A([s()],D.prototype,"value",void 0),A([s()],D.prototype,"disabled",void 0),A([s()],D.prototype,"vegaFileUploaderFileStatusRenderer",void 0),A([s()],D.prototype,"removeEventEmitter",void 0),A([s()],D.prototype,"vegaFileUploaderValueController",void 0),A([s()],D.prototype,"retryEventEmitter",void 0),A([s()],D.prototype,"previewEventEmitter",void 0);class S extends n{render(t,o){switch(t){case"uploading":return e("vega-loading-indicator",Object.assign({class:"vega-file-list-status",mode:o?"determinate":"indeterminate",size:"micro"},o?{percent:o}:{}));case"done":return e("vega-icon",{class:"vega-file-list-status",color:"text-success",icon:h.getIconKey("circle-check-regular")});case"error":return e("vega-icon",{class:"vega-file-list-status",color:"text-error",icon:h.getIconKey("circle-xmark")});default:return e("vega-loading-indicator",{class:"vega-file-list-status",mode:"determinate",size:"micro"})}}}h.register({"circle-check-regular":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'},"circle-xmark":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M175 175C184.4 165.7 199.6 165.7 208.1 175L255.1 222.1L303 175C312.4 165.7 327.6 165.7 336.1 175C346.3 184.4 346.3 199.6 336.1 208.1L289.9 255.1L336.1 303C346.3 312.4 346.3 327.6 336.1 336.1C327.6 346.3 312.4 346.3 303 336.1L255.1 289.9L208.1 336.1C199.6 346.3 184.4 346.3 175 336.1C165.7 327.6 165.7 312.4 175 303L222.1 255.1L175 208.1C165.7 199.6 165.7 184.4 175 175V175zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'}});var B=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class H extends n{valueChangeHandler(e){!e||Array.isArray(e)?(this.changeEventEmitter.emit(e),R.notify(L,{host:this.host,detail:this.value})):e&&!Array.isArray(e)&&this.setValue(null)}setValue(e){this.value=e}}B([s()],H.prototype,"host",void 0),B([s({writable:!0})],H.prototype,"value",void 0),B([s()],H.prototype,"changeEventEmitter",void 0),B([c("watchValue")],H.prototype,"valueChangeHandler",null);var N=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class P extends n{isSingleMode(){return 1===Number(this.maxCount)}checkMaxCount(){null!==this.maxCount&&this.maxCount<1&&(this.maxCount=null)}}N([s({writable:!0})],P.prototype,"maxCount",void 0),N([c("componentDidLoad"),c("watchMaxCount")],P.prototype,"checkMaxCount",null);var q=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};const G=class{constructor(e){o(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.vegaSelectedFileChange=r(this,"vegaSelectedFileChange",7),this.selectedFileChange=r(this,"selectedFileChange",7),this.vegaRemove=r(this,"vegaRemove",7),this.remove=r(this,"remove",7),this.vegaRetry=r(this,"vegaRetry",7),this.retry=r(this,"retry",7),this.vegaPreview=r(this,"vegaPreview",7),this.preview=r(this,"preview",7),this.globalSlimmers={},this.translationSlimmer=new M,this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.formFieldController=new k({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new z:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaFileUploaderContainerRenderer.getUploaderContainerRef(),touchableAreaGetter:()=>[this.vegaFileUploaderContainerRenderer.getUploaderContainerRef()]}),this.vegaFileUploaderRenderer=new I,this.vegaFileUploaderContainerRenderer=new O,this.vegaFileUploaderFileListRenderer=new D,this.vegaFileUploaderFileStatusRenderer=new S,this.vegaFileUploaderValueController=new H,this.dropFileFilterController=new E,this.fileLimitController=new P,this.changeEventEmitter=F(G,u),this.selectFileChangeEventEmitter=F(G,b),this.removeEventEmitter=F(G,m),this.retryEventEmitter=F(G,x),this.previewEventEmitter=F(G,w),this.label="",this.variant="uploadArea",this.hint="",this.value=[],this.disabled=!1,this.maxCount=null,this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchValue(e){}watchMaxCount(){}watchValidationRules(){}render(){return l(e(i,null,this.vegaFileUploaderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],maxCount:["watchMaxCount"],validationRules:["watchValidationRules"]}}};q([p()],G.prototype,"globalSlimmers",void 0),q([d()],G.prototype,"translationSlimmer",void 0),q([d()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q([d()],G.prototype,"formFieldController",void 0),q([d()],G.prototype,"vegaFileUploaderRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderContainerRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileListRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileStatusRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderValueController",void 0),q([d()],G.prototype,"dropFileFilterController",void 0),q([d()],G.prototype,"fileLimitController",void 0),q([d()],G.prototype,"changeEventEmitter",void 0),q([d()],G.prototype,"selectFileChangeEventEmitter",void 0),q([d()],G.prototype,"removeEventEmitter",void 0),q([d()],G.prototype,"retryEventEmitter",void 0),q([d()],G.prototype,"previewEventEmitter",void 0),G.style=':host{display:inline-block;text-align:left;width:100%;line-height:normal}:host .vega-file-uploader-container .vega-file-upload-area{text-align:center}:host .vega-file-uploader-container .vega-file-upload-area:hover{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-input-field-hover, 115, 160, 190, 1))}:host .vega-file-uploader-container .vega-file-upload-area:hover vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:hover vega-font{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .vega-file-uploader-container .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-file-uploader-container .vega-file-upload-area:active{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area:active vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:active vega-font{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area.disabled{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1));outline:none}:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-icon,:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-file-uploader-container vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error .vega-file-upload-area{border-color:rgba(var(--v-border-color-input-field-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:hover{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .vega-file-uploader-container.error .vega-file-upload-area:active{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error vega-button::part(button),:host .vega-file-uploader-container.error vega-button::part(button):hover{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1));border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error vega-button::part(button):hover{background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}:host .vega-file-uploader-container.error vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error vega-button::part(button):active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1));border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2))}:host .vega-file-uploader-file-list .vega-file-uploader-file .vega-file-preview-button{visibility:hidden}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover{background-color:rgba(var(--v-bg-action-tertiary-hover, 4, 4, 28, 0.05))}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover .vega-file-preview-button{visibility:visible}:host .vega-file-uploader-file-list .vega-file-list-buttons{margin-left:8px;flex-shrink:0}:host .vega-file-uploader-file-list .vega-file-list-status svg{width:16px;height:16px}:host .vega-file-uploader-file-list .vega-file-status-and-name{padding-top:5px}:host .vega-file-uploader-file-list .vega-file-status-and-name vega-font{word-break:break-word}:host vega-field-label{margin-bottom:8px}:host .vega-file-uploader-file-list{margin-top:8px}:host .vega-file-uploader-file-list.vega-file-list-hidden{display:none}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{G as vega_file_uploader}
@@ -1 +1 @@
1
- import{h as t,r as e,c as i,H as s,g as n}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as f,I as p}from"./p-4415ad28.js";import{c as h}from"./p-de7109d3.js";import{a as d,x as c}from"./p-9af0e2e7.js";import{c as m}from"./p-6ac8e655.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-11e2dcf5.js";import"./p-331a62d5.js";import"./p-ec2a1d4c.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";var x=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class g extends r{constructor(){super(...arguments),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:e,text:i,size:s,minWidth:n,maxWidth:a,placement:o="right",alignment:r="start",trigger:l="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return t("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:m()},i?t("vega-tooltip",{trigger:l,text:i,size:s,minWidth:n,maxWidth:a,alignment:r,placement:o},this.renderSuffixButton(e)):this.renderSuffixButton(e))}}renderSuffixButton(e){return t("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:e})}}x([o()],g.prototype,"suffixButtonProps",void 0),x([o()],g.prototype,"suffixButtonConfig",void 0),x([o()],g.prototype,"suffixButtonClickEventEmitter",void 0);var b=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const u=class{constructor(t){e(this,t),this.vegaClick=i(this,"vegaClick",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",1),this.labelButtonClick=i(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=h(u,d),this.suffixButtonClickEventEmitter=h(u,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new f,this.suffixElementRenderer=new g,this.suffixButtonProps=null,this.suffixButtonConfig=null,this.label="",this.isFieldRequired=!1,this.disabled=!1,this.handleClick=t=>{this.clickEventEmitter.emit(void 0,t)}}componentWillLoad(){""===this.label&&(this.label=this.host.textContent,this.host.textContent="")}render(){return a(t(s,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},t("label",null,t("span",{class:"vega-field-label"},this.label),t("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return n(this)}};b([p()],u.prototype,"globalSlimmers",void 0),b([l()],u.prototype,"clickEventEmitter",void 0),b([l()],u.prototype,"suffixButtonClickEventEmitter",void 0),b([l()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),b([l()],u.prototype,"suffixElementRenderer",void 0),u.style=':host{display:inline-block}:host(.disabled){pointer-events:none}:host(.hidden){display:none}label:first-of-type{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;word-break:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host(.disabled)>label>span.vega-field-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-field-label-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-field-label-required.hidden{display:none}.label-suffix-button{display:inline-block;margin-left:4px;vertical-align:top}';export{u as vega_field_label}
1
+ import{h as t,r as e,c as i,H as s,g as n}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as f,I as p}from"./p-4415ad28.js";import{c as h}from"./p-6b5cb920.js";import{a as d,x as c}from"./p-9af0e2e7.js";import{c as m}from"./p-6ac8e655.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-f28a6074.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";var x=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class b extends r{constructor(){super(...arguments),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:e,text:i,size:s,minWidth:n,maxWidth:a,placement:o="right",alignment:r="start",trigger:l="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return t("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:m()},i?t("vega-tooltip",{trigger:l,text:i,size:s,minWidth:n,maxWidth:a,alignment:r,placement:o},this.renderSuffixButton(e)):this.renderSuffixButton(e))}}renderSuffixButton(e){return t("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:e})}}x([o()],b.prototype,"suffixButtonProps",void 0),x([o()],b.prototype,"suffixButtonConfig",void 0),x([o()],b.prototype,"suffixButtonClickEventEmitter",void 0);var g=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const u=class{constructor(t){e(this,t),this.vegaClick=i(this,"vegaClick",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",1),this.labelButtonClick=i(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=h(u,d),this.suffixButtonClickEventEmitter=h(u,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new f,this.suffixElementRenderer=new b,this.suffixButtonProps=null,this.suffixButtonConfig=null,this.label="",this.isFieldRequired=!1,this.disabled=!1,this.handleClick=t=>{this.clickEventEmitter.emit(void 0,t)}}componentWillLoad(){""===this.label&&(this.label=this.host.textContent,this.host.textContent="")}render(){return a(t(s,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},t("label",null,t("span",{class:"vega-field-label"},this.label),t("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return n(this)}};g([p()],u.prototype,"globalSlimmers",void 0),g([l()],u.prototype,"clickEventEmitter",void 0),g([l()],u.prototype,"suffixButtonClickEventEmitter",void 0),g([l()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),g([l()],u.prototype,"suffixElementRenderer",void 0),u.style=':host{display:inline-block}:host(.disabled){pointer-events:none}:host(.hidden){display:none}label:first-of-type{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;word-break:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host(.disabled)>label>span.vega-field-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-field-label-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-field-label-required.hidden{display:none}.label-suffix-button{display:inline-block;margin-left:4px;vertical-align:top}';export{u as vega_field_label}
@@ -1 +1 @@
1
- import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as i,I as a}from"./p-4415ad28.js";import{c as l,V as c,I as d}from"./p-6e1ab235.js";import{s as h}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-6ac8e655.js";import{i as p}from"./p-f1c672e4.js";import{c as v}from"./p-de7109d3.js";import{a as w}from"./p-9af0e2e7.js";import{T as f}from"./p-57f220b5.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-11e2dcf5.js";import"./p-331a62d5.js";import"./p-ec2a1d4c.js";import"./p-b75ee3ba.js";import"./p-3b791b5d.js";import"./p-a528714c.js";var m=function(r,e,t,o){var s,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a};class g extends c{constructor(){super(...arguments),this.handleClick=r=>{this.disabled?r.stopPropagation():("vega"!==p.getSemantics(this.host).namespace&&r.stopPropagation(),this.clickEventEmitter.emit())}}render(){const e="clear"===this.variant,t=!e&&!!this.color;return r("div",{class:{"vega-color-swatch-container":!0,[`size-${this.size}`]:!0,[`shape-${this.shape}`]:!0,"swatch-clear":e},role:"button",part:"swatch-container","aria-label":this.getAriaLabel(),"aria-disabled":this.disabled?"true":"false",tabIndex:this.disabled?-1:0,onClick:this.handleClick,onKeyDown:b({composed:!0})},r("div",{class:"swatch",part:"swatch"},t&&r("span",{class:"color-fill",style:this.getFillColorStyles()}),e&&r("span",{class:"clear-line"}),this.selected&&!e&&r("vega-icon",{class:"check-icon",icon:"checkmark",size:"size-16",color:this.getCheckMarkColor()})),this.label&&this.renderLabel())}renderLabel(){return r("vega-font",{class:"swatch-label",variant:"font-field-value",color:this.disabled?"text-disabled":"text-primary"},this.label)}getAriaLabel(){return this.label?this.label:"clear"===this.variant?this.translationSlimmer.t("Clear color"):this.color?this.translationSlimmer.t("Color {0}",this.color):this.translationSlimmer.t("Color swatch")}getFillColorStyles(){const r={};return this.color&&(r.backgroundColor=this.color),r}getCheckMarkColor(){return this.color?new n(this.color).isDark()?"text-white":"text-black":"text-primary"}}m([l()],g.prototype,"host",void 0),m([l()],g.prototype,"variant",void 0),m([l()],g.prototype,"label",void 0),m([l()],g.prototype,"color",void 0),m([l()],g.prototype,"selected",void 0),m([l()],g.prototype,"size",void 0),m([l()],g.prototype,"disabled",void 0),m([l()],g.prototype,"shape",void 0),m([l()],g.prototype,"clickEventEmitter",void 0),m([l()],g.prototype,"translationSlimmer",void 0);var u=function(r,e,t,o){var s,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a};const x=class{constructor(r){e(this,r),this.vegaClick=t(this,"vegaClick",7),this.click=t(this,"click",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new i,this.translationSlimmer=new f,this.vegaColorSwatchRenderer=new g,this.clickEventEmitter=v(x,w),this.color="",this.selected=!1,this.label="",this.size="small",this.disabled=!1,this.variant="swatch",this.shape="basket"}render(){return h(r(o,{class:{disabled:this.disabled}},this.vegaColorSwatchRenderer.render()),this.host)}get host(){return s(this)}};u([a()],x.prototype,"globalSlimmers",void 0),u([d()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u([d()],x.prototype,"translationSlimmer",void 0),u([d()],x.prototype,"vegaColorSwatchRenderer",void 0),u([d()],x.prototype,"clickEventEmitter",void 0),x.style=":host{display:inline-block;vertical-align:middle}.vega-color-swatch-container{display:flex;flex-direction:row;align-items:center;border-radius:4px}.swatch{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:relative;flex-shrink:0;overflow:hidden}.shape-basket .swatch{border-radius:8px}.shape-block .swatch{border-radius:0px}.check-icon{position:relative;z-index:1}.swatch-clear .swatch{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}.swatch-clear .swatch .clear-line{position:absolute;width:141%;height:0;border-top-width:1px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1));transform:rotate(-45deg);transform-origin:center}.color-fill{position:absolute;display:block;top:0;left:0;width:100%;height:100%}.size-extra-small .swatch{width:24px;height:24px;min-width:24px}.size-extra-small.shape-basket .swatch{border-radius:4px}.size-small .swatch{width:40px;height:40px;min-width:40px}.size-small.shape-basket{border-radius:8px}.size-medium .swatch{width:48px;height:48px;min-width:48px}.size-medium.shape-basket{border-radius:8px}@media (hover: hover){:host(:not(.disabled)) .swatch:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}}.vega-color-swatch-container:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible .swatch{border-width:1px;border-style:solid;border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-color-swatch-container:focus-visible.swatch-clear{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible.swatch-clear .swatch{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}.vega-color-swatch-container:focus-visible.swatch-clear .swatch .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .vega-color-swatch-container{cursor:pointer}:host(.disabled) .vega-color-swatch-container{cursor:not-allowed}:host(.disabled) .swatch{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));pointer-events:none}:host(.disabled) .swatch .color-fill,:host(.disabled) .swatch .check-icon{opacity:0.5}:host(.disabled) .swatch .label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host(.disabled) .swatch .clear-line{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.swatch-label{margin-left:8px}";export{x as vega_color_swatch}
1
+ import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as i,I as a}from"./p-4415ad28.js";import{c as l,V as c,I as h}from"./p-6e1ab235.js";import{s as d}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-6ac8e655.js";import{i as p}from"./p-f1c672e4.js";import{c as v}from"./p-6b5cb920.js";import{a as w}from"./p-9af0e2e7.js";import{T as f}from"./p-57f220b5.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-f28a6074.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-b75ee3ba.js";import"./p-3b791b5d.js";import"./p-a528714c.js";var m=function(r,e,t,o){var s,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a};class g extends c{constructor(){super(...arguments),this.handleClick=r=>{this.disabled?r.stopPropagation():("vega"!==p.getSemantics(this.host).namespace&&r.stopPropagation(),this.clickEventEmitter.emit())}}render(){const e="clear"===this.variant,t=!e&&!!this.color;return r("div",{class:{"vega-color-swatch-container":!0,[`size-${this.size}`]:!0,[`shape-${this.shape}`]:!0,"swatch-clear":e},role:"button",part:"swatch-container","aria-label":this.getAriaLabel(),"aria-disabled":this.disabled?"true":"false",tabIndex:this.disabled?-1:0,onClick:this.handleClick,onKeyDown:b({composed:!0})},r("div",{class:"swatch",part:"swatch"},t&&r("span",{class:"color-fill",style:this.getFillColorStyles()}),e&&r("span",{class:"clear-line"}),this.selected&&!e&&r("vega-icon",{class:"check-icon",icon:"checkmark",size:"size-16",color:this.getCheckMarkColor()})),this.label&&this.renderLabel())}renderLabel(){return r("vega-font",{class:"swatch-label",variant:"font-field-value",color:this.disabled?"text-disabled":"text-primary"},this.label)}getAriaLabel(){return this.label?this.label:"clear"===this.variant?this.translationSlimmer.t("Clear color"):this.color?this.translationSlimmer.t("Color {0}",this.color):this.translationSlimmer.t("Color swatch")}getFillColorStyles(){const r={};return this.color&&(r.backgroundColor=this.color),r}getCheckMarkColor(){return this.color?new n(this.color).isDark()?"text-white":"text-black":"text-primary"}}m([l()],g.prototype,"host",void 0),m([l()],g.prototype,"variant",void 0),m([l()],g.prototype,"label",void 0),m([l()],g.prototype,"color",void 0),m([l()],g.prototype,"selected",void 0),m([l()],g.prototype,"size",void 0),m([l()],g.prototype,"disabled",void 0),m([l()],g.prototype,"shape",void 0),m([l()],g.prototype,"clickEventEmitter",void 0),m([l()],g.prototype,"translationSlimmer",void 0);var u=function(r,e,t,o){var s,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a};const x=class{constructor(r){e(this,r),this.vegaClick=t(this,"vegaClick",7),this.click=t(this,"click",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new i,this.translationSlimmer=new f,this.vegaColorSwatchRenderer=new g,this.clickEventEmitter=v(x,w),this.color="",this.selected=!1,this.label="",this.size="small",this.disabled=!1,this.variant="swatch",this.shape="basket"}render(){return d(r(o,{class:{disabled:this.disabled}},this.vegaColorSwatchRenderer.render()),this.host)}get host(){return s(this)}};u([a()],x.prototype,"globalSlimmers",void 0),u([h()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u([h()],x.prototype,"translationSlimmer",void 0),u([h()],x.prototype,"vegaColorSwatchRenderer",void 0),u([h()],x.prototype,"clickEventEmitter",void 0),x.style=":host{display:inline-block;vertical-align:middle}.vega-color-swatch-container{display:flex;flex-direction:row;align-items:center;border-radius:4px}.swatch{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:relative;flex-shrink:0;overflow:hidden}.shape-basket .swatch{border-radius:8px}.shape-block .swatch{border-radius:0px}.check-icon{position:relative;z-index:1}.swatch-clear .swatch{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}.swatch-clear .swatch .clear-line{position:absolute;width:141%;height:0;border-top-width:1px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1));transform:rotate(-45deg);transform-origin:center}.color-fill{position:absolute;display:block;top:0;left:0;width:100%;height:100%}.size-extra-small .swatch{width:24px;height:24px;min-width:24px}.size-extra-small.shape-basket .swatch{border-radius:4px}.size-small .swatch{width:40px;height:40px;min-width:40px}.size-small.shape-basket{border-radius:8px}.size-medium .swatch{width:48px;height:48px;min-width:48px}.size-medium.shape-basket{border-radius:8px}@media (hover: hover){:host(:not(.disabled)) .swatch:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}}.vega-color-swatch-container:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible .swatch{border-width:1px;border-style:solid;border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-color-swatch-container:focus-visible.swatch-clear{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible.swatch-clear .swatch{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}.vega-color-swatch-container:focus-visible.swatch-clear .swatch .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .vega-color-swatch-container{cursor:pointer}:host(.disabled) .vega-color-swatch-container{cursor:not-allowed}:host(.disabled) .swatch{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));pointer-events:none}:host(.disabled) .swatch .color-fill,:host(.disabled) .swatch .check-icon{opacity:0.5}:host(.disabled) .swatch .label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host(.disabled) .swatch .clear-line{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.swatch-label{margin-left:8px}";export{x as vega_color_swatch}