@sankhyalabs/ezui 7.2.0-dev.6 → 7.2.0-dev.8

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 (289) hide show
  1. package/dist/cjs/{ApplicationUtils-dc653b57.js → ApplicationUtils-50f74c38.js} +1 -1
  2. package/dist/cjs/{app-globals-16ec1ff7.js → app-globals-18e8b9df.js} +1 -1
  3. package/dist/cjs/classic-search-list_7.cjs.entry.js +4 -4
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +3 -3
  5. package/dist/cjs/ez-alert-list.cjs.entry.js +2 -2
  6. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-avatar.cjs.entry.js +2 -2
  9. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-calendar.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-classic-combo-box.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-classic-date-input.cjs.entry.js +2 -2
  19. package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +2 -2
  20. package/dist/cjs/ez-classic-input.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-classic-number-input.cjs.entry.js +2 -2
  22. package/dist/cjs/ez-classic-search-plus.cjs.entry.js +26 -13
  23. package/dist/cjs/ez-classic-search.cjs.entry.js +3 -3
  24. package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-classic-time-input.cjs.entry.js +2 -2
  26. package/dist/cjs/ez-collapsible-box.cjs.entry.js +3 -3
  27. package/dist/cjs/ez-combo-box.cjs.entry.js +3 -3
  28. package/dist/cjs/ez-date-input.cjs.entry.js +2 -2
  29. package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -2
  30. package/dist/cjs/ez-dialog.cjs.entry.js +2 -2
  31. package/dist/cjs/ez-double-list.cjs.entry.js +2 -2
  32. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-file-item.cjs.entry.js +2 -2
  35. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
  37. package/dist/cjs/ez-form.cjs.entry.js +4 -4
  38. package/dist/cjs/ez-grid-pagination.cjs.entry.js +2 -2
  39. package/dist/cjs/ez-grid-view.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-grid.cjs.entry.js +4 -4
  41. package/dist/cjs/ez-guide-navigator.cjs.entry.js +2 -2
  42. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-link-builder_6.cjs.entry.js +2 -2
  44. package/dist/cjs/ez-list-item.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  46. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
  48. package/dist/cjs/ez-modal.cjs.entry.js +2 -2
  49. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
  50. package/dist/cjs/ez-number-input.cjs.entry.js +2 -2
  51. package/dist/cjs/ez-pagination.cjs.entry.js +2 -2
  52. package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
  53. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +1 -1
  54. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  55. package/dist/cjs/ez-popup.cjs.entry.js +2 -2
  56. package/dist/cjs/ez-progress-bar.cjs.entry.js +1 -1
  57. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  58. package/dist/cjs/ez-record-navigation.cjs.entry.js +2 -2
  59. package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +1 -1
  60. package/dist/cjs/ez-scroller_2.cjs.entry.js +2 -2
  61. package/dist/cjs/ez-search-plus.cjs.entry.js +12 -3
  62. package/dist/cjs/ez-search-result-list.cjs.entry.js +2 -2
  63. package/dist/cjs/ez-search.cjs.entry.js +3 -3
  64. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +2 -2
  65. package/dist/cjs/ez-skeleton.cjs.entry.js +2 -2
  66. package/dist/cjs/ez-sortable-list.cjs.entry.js +3 -3
  67. package/dist/cjs/ez-spinner.cjs.entry.js +2 -2
  68. package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
  69. package/dist/cjs/ez-split-item.cjs.entry.js +3 -3
  70. package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
  71. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  72. package/dist/cjs/ez-tag-input.cjs.entry.js +1 -1
  73. package/dist/cjs/ez-tag.cjs.entry.js +1 -1
  74. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  75. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  76. package/dist/cjs/ez-tile-medium.cjs.entry.js +1 -1
  77. package/dist/cjs/ez-tile.cjs.entry.js +1 -1
  78. package/dist/cjs/ez-time-input.cjs.entry.js +2 -2
  79. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  80. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  81. package/dist/cjs/ez-tree.cjs.entry.js +2 -2
  82. package/dist/cjs/ez-underface.cjs.entry.js +1 -1
  83. package/dist/cjs/ez-upload.cjs.entry.js +3 -3
  84. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  85. package/dist/cjs/ezui.cjs.js +4 -4
  86. package/dist/cjs/filter-column.cjs.entry.js +2 -2
  87. package/dist/cjs/{index-a8537087.js → index-8faf8416.js} +3 -0
  88. package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +0 -3
  89. package/dist/cjs/loader.cjs.js +4 -4
  90. package/dist/cjs/{search-column-c0485015.js → search-column-1c884d08.js} +3 -3
  91. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js +26 -11
  92. package/dist/collection/components/ez-search-plus/ez-search-plus.js +9 -0
  93. package/dist/collection/components/ez-sortable-list/ez-sortable-list.css +1 -1
  94. package/dist/collection/utils/i18n/locales/en-us.js +1 -0
  95. package/dist/collection/utils/i18n/locales/es-es.js +1 -0
  96. package/dist/collection/utils/i18n/locales/pt-br.js +1 -0
  97. package/dist/custom-elements/index.js +37 -12
  98. package/dist/esm/{ApplicationUtils-e99e53c8.js → ApplicationUtils-7eb5d339.js} +1 -1
  99. package/dist/esm/{app-globals-6e27b3bb.js → app-globals-94e67ab2.js} +1 -1
  100. package/dist/esm/classic-search-list_7.entry.js +4 -4
  101. package/dist/esm/ez-actions-button.entry.js +3 -3
  102. package/dist/esm/ez-alert-list.entry.js +2 -2
  103. package/dist/esm/ez-alert.entry.js +1 -1
  104. package/dist/esm/ez-application.entry.js +1 -1
  105. package/dist/esm/ez-avatar.entry.js +2 -2
  106. package/dist/esm/ez-badge.entry.js +1 -1
  107. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  108. package/dist/esm/ez-button.entry.js +1 -1
  109. package/dist/esm/ez-calendar.entry.js +2 -2
  110. package/dist/esm/ez-card-item.entry.js +1 -1
  111. package/dist/esm/ez-chart.entry.js +1 -1
  112. package/dist/esm/ez-check.entry.js +1 -1
  113. package/dist/esm/ez-chip.entry.js +1 -1
  114. package/dist/esm/ez-classic-combo-box.entry.js +1 -1
  115. package/dist/esm/ez-classic-date-input.entry.js +2 -2
  116. package/dist/esm/ez-classic-date-time-input.entry.js +2 -2
  117. package/dist/esm/ez-classic-input.entry.js +1 -1
  118. package/dist/esm/ez-classic-number-input.entry.js +2 -2
  119. package/dist/esm/ez-classic-search-plus.entry.js +26 -13
  120. package/dist/esm/ez-classic-search.entry.js +3 -3
  121. package/dist/esm/ez-classic-text-area.entry.js +1 -1
  122. package/dist/esm/ez-classic-time-input.entry.js +2 -2
  123. package/dist/esm/ez-collapsible-box.entry.js +3 -3
  124. package/dist/esm/ez-combo-box.entry.js +3 -3
  125. package/dist/esm/ez-date-input.entry.js +2 -2
  126. package/dist/esm/ez-date-time-input.entry.js +2 -2
  127. package/dist/esm/ez-dialog.entry.js +2 -2
  128. package/dist/esm/ez-double-list.entry.js +2 -2
  129. package/dist/esm/ez-dropdown.entry.js +1 -1
  130. package/dist/esm/ez-empty-card.entry.js +1 -1
  131. package/dist/esm/ez-file-item.entry.js +2 -2
  132. package/dist/esm/ez-filter-input.entry.js +1 -1
  133. package/dist/esm/ez-form-view.entry.js +2 -2
  134. package/dist/esm/ez-form.entry.js +4 -4
  135. package/dist/esm/ez-grid-pagination.entry.js +2 -2
  136. package/dist/esm/ez-grid-view.entry.js +1 -1
  137. package/dist/esm/ez-grid.entry.js +4 -4
  138. package/dist/esm/ez-guide-navigator.entry.js +2 -2
  139. package/dist/esm/ez-icon.entry.js +1 -1
  140. package/dist/esm/ez-link-builder_6.entry.js +2 -2
  141. package/dist/esm/ez-list-item.entry.js +1 -1
  142. package/dist/esm/ez-list.entry.js +2 -2
  143. package/dist/esm/ez-loading-bar.entry.js +1 -1
  144. package/dist/esm/ez-modal-container.entry.js +2 -2
  145. package/dist/esm/ez-modal.entry.js +2 -2
  146. package/dist/esm/ez-multi-selection-list.entry.js +2 -2
  147. package/dist/esm/ez-number-input.entry.js +2 -2
  148. package/dist/esm/ez-pagination.entry.js +2 -2
  149. package/dist/esm/ez-popover-core.entry.js +1 -1
  150. package/dist/esm/ez-popover-plus_3.entry.js +1 -1
  151. package/dist/esm/ez-popover.entry.js +1 -1
  152. package/dist/esm/ez-popup.entry.js +2 -2
  153. package/dist/esm/ez-progress-bar.entry.js +1 -1
  154. package/dist/esm/ez-radio-button.entry.js +1 -1
  155. package/dist/esm/ez-record-navigation.entry.js +2 -2
  156. package/dist/esm/ez-rich-toolbar-item.entry.js +1 -1
  157. package/dist/esm/ez-scroller_2.entry.js +2 -2
  158. package/dist/esm/ez-search-plus.entry.js +12 -3
  159. package/dist/esm/ez-search-result-list.entry.js +2 -2
  160. package/dist/esm/ez-search.entry.js +3 -3
  161. package/dist/esm/ez-sidebar-navigator.entry.js +2 -2
  162. package/dist/esm/ez-skeleton.entry.js +2 -2
  163. package/dist/esm/ez-sortable-list.entry.js +3 -3
  164. package/dist/esm/ez-spinner.entry.js +2 -2
  165. package/dist/esm/ez-split-button.entry.js +2 -2
  166. package/dist/esm/ez-split-item.entry.js +3 -3
  167. package/dist/esm/ez-split-panel.entry.js +1 -1
  168. package/dist/esm/ez-tabselector.entry.js +1 -1
  169. package/dist/esm/ez-tag-input.entry.js +1 -1
  170. package/dist/esm/ez-tag.entry.js +1 -1
  171. package/dist/esm/ez-text-area.entry.js +1 -1
  172. package/dist/esm/ez-text-input.entry.js +1 -1
  173. package/dist/esm/ez-tile-medium.entry.js +1 -1
  174. package/dist/esm/ez-tile.entry.js +1 -1
  175. package/dist/esm/ez-time-input.entry.js +2 -2
  176. package/dist/esm/ez-toast.entry.js +1 -1
  177. package/dist/esm/ez-tooltip.entry.js +1 -1
  178. package/dist/esm/ez-tree.entry.js +2 -2
  179. package/dist/esm/ez-underface.entry.js +1 -1
  180. package/dist/esm/ez-upload.entry.js +3 -3
  181. package/dist/esm/ez-view-stack.entry.js +1 -1
  182. package/dist/esm/ezui.js +5 -5
  183. package/dist/esm/filter-column.entry.js +2 -2
  184. package/dist/esm/{index-a031816b.js → index-4dc8ed82.js} +3 -0
  185. package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +1 -3
  186. package/dist/esm/loader.js +5 -5
  187. package/dist/esm/{search-column-9aaf3738.js → search-column-e79eb0f3.js} +3 -3
  188. package/dist/ezui/ezui.esm.js +1 -1
  189. package/dist/ezui/{p-ddfd7ecf.entry.js → p-00162042.entry.js} +1 -1
  190. package/dist/ezui/{p-f80fb048.entry.js → p-0298252e.entry.js} +1 -1
  191. package/dist/ezui/{p-712f059e.entry.js → p-05ee4e45.entry.js} +1 -1
  192. package/dist/ezui/{p-49eb13ea.entry.js → p-0d80e3ec.entry.js} +1 -1
  193. package/dist/ezui/{p-f6c5078e.entry.js → p-159f4beb.entry.js} +1 -1
  194. package/dist/ezui/{p-f9a7255c.entry.js → p-160a268d.entry.js} +1 -1
  195. package/dist/ezui/{p-c6021712.entry.js → p-178cb9df.entry.js} +1 -1
  196. package/dist/ezui/{p-1d624aa7.entry.js → p-19a60062.entry.js} +1 -1
  197. package/dist/ezui/{p-cdd18178.entry.js → p-1b01db47.entry.js} +1 -1
  198. package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
  199. package/dist/ezui/{p-efa7b5a1.entry.js → p-1ec7f65c.entry.js} +1 -1
  200. package/dist/ezui/{p-787c6496.entry.js → p-1f1ba5b9.entry.js} +1 -1
  201. package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
  202. package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
  203. package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
  204. package/dist/ezui/{p-82a2b0bc.entry.js → p-2490ff37.entry.js} +1 -1
  205. package/dist/ezui/{p-169d460d.entry.js → p-2528e988.entry.js} +1 -1
  206. package/dist/ezui/{p-efa5e822.entry.js → p-28658422.entry.js} +1 -1
  207. package/dist/ezui/{p-7ca13a5f.entry.js → p-2a1c1daf.entry.js} +1 -1
  208. package/dist/ezui/{p-5b680898.entry.js → p-361a4bfa.entry.js} +2 -2
  209. package/dist/ezui/{p-815716be.entry.js → p-373a7b4e.entry.js} +1 -1
  210. package/dist/ezui/{p-08ccdf00.entry.js → p-377125c7.entry.js} +1 -1
  211. package/dist/ezui/{p-7808d0c0.entry.js → p-39e1c05d.entry.js} +1 -1
  212. package/dist/ezui/{p-c719e15f.entry.js → p-3a167b3f.entry.js} +1 -1
  213. package/dist/ezui/{p-f7ca8634.entry.js → p-411c0222.entry.js} +1 -1
  214. package/dist/ezui/{p-87739608.entry.js → p-44183c39.entry.js} +1 -1
  215. package/dist/ezui/{p-24582dd6.js → p-46b0b0c7.js} +1 -1
  216. package/dist/ezui/{p-47c5b2d8.entry.js → p-4cf0ed43.entry.js} +1 -1
  217. package/dist/ezui/{p-0ad696a3.entry.js → p-4dca017c.entry.js} +1 -1
  218. package/dist/ezui/p-517498c1.js +1 -0
  219. package/dist/ezui/{p-a0080b19.entry.js → p-57bf1a88.entry.js} +1 -1
  220. package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
  221. package/dist/ezui/{p-c754774e.entry.js → p-6020f3d5.entry.js} +1 -1
  222. package/dist/ezui/{p-32201585.entry.js → p-61e11a7a.entry.js} +1 -1
  223. package/dist/ezui/{p-51e34317.entry.js → p-6369a0cd.entry.js} +1 -1
  224. package/dist/ezui/{p-0b531233.entry.js → p-6d596a5a.entry.js} +1 -1
  225. package/dist/ezui/{p-1723f728.entry.js → p-6f77a359.entry.js} +1 -1
  226. package/dist/ezui/{p-0913a517.entry.js → p-6fde1c11.entry.js} +1 -1
  227. package/dist/ezui/p-714f2b21.entry.js +1 -0
  228. package/dist/ezui/{p-f04a298d.entry.js → p-77f112e0.entry.js} +1 -1
  229. package/dist/ezui/{p-91e7574c.entry.js → p-78c8a5e7.entry.js} +1 -1
  230. package/dist/ezui/{p-26b01fe6.entry.js → p-78d2b5a5.entry.js} +1 -1
  231. package/dist/ezui/{p-a6df6cdc.entry.js → p-7df45688.entry.js} +1 -1
  232. package/dist/ezui/{p-e195eaad.entry.js → p-7f792043.entry.js} +1 -1
  233. package/dist/ezui/{p-39084308.entry.js → p-854fa107.entry.js} +1 -1
  234. package/dist/ezui/{p-aebfbcdd.entry.js → p-8c0ad73d.entry.js} +1 -1
  235. package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
  236. package/dist/ezui/{p-78e975b4.entry.js → p-91c9d50e.entry.js} +1 -1
  237. package/dist/ezui/{p-05e68ab3.entry.js → p-93e1c917.entry.js} +1 -1
  238. package/dist/ezui/{p-12c6b66f.entry.js → p-96120941.entry.js} +1 -1
  239. package/dist/ezui/{p-1827fced.entry.js → p-9883faa0.entry.js} +1 -1
  240. package/dist/ezui/{p-3286d016.entry.js → p-9f58cc27.entry.js} +1 -1
  241. package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
  242. package/dist/ezui/{p-bc693db6.entry.js → p-a0bf1fc7.entry.js} +1 -1
  243. package/dist/ezui/{p-27421015.entry.js → p-a0f51b99.entry.js} +1 -1
  244. package/dist/ezui/{p-9bcfa689.entry.js → p-a3075f52.entry.js} +1 -1
  245. package/dist/ezui/{p-f26b97e9.entry.js → p-a3ada561.entry.js} +1 -1
  246. package/dist/ezui/{p-894392ca.entry.js → p-a4735a12.entry.js} +1 -1
  247. package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
  248. package/dist/ezui/{p-1ee006d6.entry.js → p-b39b7880.entry.js} +1 -1
  249. package/dist/ezui/{p-69344c23.js → p-b6579f86.js} +1 -1
  250. package/dist/ezui/{p-d321c2b8.entry.js → p-b72322ad.entry.js} +1 -1
  251. package/dist/ezui/{p-9fb33cd8.entry.js → p-b8a83790.entry.js} +1 -1
  252. package/dist/ezui/p-bc2f844e.entry.js +1 -0
  253. package/dist/ezui/{p-1b30bb80.entry.js → p-bce082cf.entry.js} +1 -1
  254. package/dist/ezui/{p-14a932b7.entry.js → p-c626a0e4.entry.js} +1 -1
  255. package/dist/ezui/{p-55d2be5c.entry.js → p-cf66ace0.entry.js} +1 -1
  256. package/dist/ezui/{p-d5565a0f.entry.js → p-d5c2d721.entry.js} +1 -1
  257. package/dist/ezui/{p-a9432878.entry.js → p-d6742c1e.entry.js} +1 -1
  258. package/dist/ezui/{p-770cf2b8.entry.js → p-d6f50207.entry.js} +1 -1
  259. package/dist/ezui/p-d8cc640d.entry.js +1 -0
  260. package/dist/ezui/{p-76835bee.entry.js → p-dce34f38.entry.js} +1 -1
  261. package/dist/ezui/{p-707b073d.entry.js → p-dd522434.entry.js} +1 -1
  262. package/dist/ezui/{p-fd1e22b8.entry.js → p-dfe374b1.entry.js} +1 -1
  263. package/dist/ezui/{p-71e982ef.entry.js → p-e5df0199.entry.js} +1 -1
  264. package/dist/ezui/{p-000159dc.entry.js → p-e75c7a23.entry.js} +1 -1
  265. package/dist/ezui/{p-e9b409c1.entry.js → p-e7a7c594.entry.js} +1 -1
  266. package/dist/ezui/{p-b21efe83.entry.js → p-e8c57463.entry.js} +1 -1
  267. package/dist/ezui/{p-dc5fd882.entry.js → p-f01c3171.entry.js} +1 -1
  268. package/dist/ezui/{p-980f1f18.entry.js → p-f34ec732.entry.js} +1 -1
  269. package/dist/ezui/{p-b7c0368d.entry.js → p-f678b330.entry.js} +1 -1
  270. package/dist/ezui/p-f8e18112.entry.js +1 -0
  271. package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
  272. package/dist/ezui/{p-73b578a3.js → p-fc57648e.js} +1 -1
  273. package/dist/ezui/{p-1b7d0c1c.entry.js → p-fc72aeb8.entry.js} +1 -1
  274. package/dist/ezui/{p-b6fcfa4f.entry.js → p-fd784a7f.entry.js} +1 -1
  275. package/dist/ezui/p-fda563e0.entry.js +1 -0
  276. package/dist/ezui/{p-73042259.entry.js → p-ffffdccf.entry.js} +1 -1
  277. package/dist/types/components/ez-classic-search-plus/ez-classic-search-plus.d.ts +3 -0
  278. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
  279. package/dist/types/utils/i18n/locales/en-us.d.ts +1 -0
  280. package/dist/types/utils/i18n/locales/es-es.d.ts +1 -0
  281. package/dist/types/utils/i18n/locales/pt-br.d.ts +1 -0
  282. package/dist/types/utils/i18n/translations.d.ts +3 -0
  283. package/package.json +1 -1
  284. package/dist/ezui/p-14d6aeb8.entry.js +0 -1
  285. package/dist/ezui/p-2241dea1.js +0 -1
  286. package/dist/ezui/p-6ec40dec.entry.js +0 -1
  287. package/dist/ezui/p-810b81ad.entry.js +0 -1
  288. package/dist/ezui/p-ba335c16.entry.js +0 -1
  289. package/dist/ezui/p-f1f083b6.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as e,h as r,H as a,g as o}from"./p-e4c7eb39.js";import{ElementIDUtils as i}from"@sankhyalabs/core";const l=class{constructor(r){t(this,r),this.ezChange=e(this,"ezChange",7),this.LINE_HEIGHT=24,this.HEIGHT_RATIO=1.4,this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.rows=4,this.canShowError=!0,this.mode="regular",this.enableResize=!0,this.autoRows=!1,this.autoFocus=!1,this.alternativePlaceholder=void 0,this.forceLabelFloat=!1}observeErrorMessage(){var t,e,r,a;"string"==typeof this.errorMessage&&""!==this.errorMessage?(null===(t=this._container)||void 0===t||t.classList.add("hasError"),null===(e=this._messageBoxElem)||void 0===e||e.classList.add("hasError")):(null===(r=this._container)||void 0===r||r.classList.remove("hasError"),null===(a=this._messageBoxElem)||void 0===a||a.classList.remove("hasError"))}observeValue(t,e){this._inputElem&&t!=e&&(this.canChangeValue()&&(this._inputElem.value=this.value||""),this.adjustFloatingLabel(),this.errorMessage="",this.ezChange.emit(this.value))}observeMode(){null==this._initialRows&&(this._initialRows=this.rows>0?this.rows:void 0);const t=this._initialRows>0?this._initialRows:"slim"!=this.mode?4:2;t!==this.rows&&(this.rows=t)}observeRows(){const t=this.rows>0?this.rows:"slim"!=this.mode?4:2;t!==this.rows&&this.updateRows(t)}observeAutoRows(){var t,e;this.autoRows?(null===(t=this._resizeObserver)||void 0===t||t.disconnect(),this.initializeResizeObserver()):null===(e=this._resizeObserver)||void 0===e||e.disconnect()}observeAlternativePlaceholder(t){this.forceLabelFloat=!!t}async appendTextToSelection(t){var e,r,a,o;const i=this._inputElem.selectionStart,l=this._inputElem.selectionEnd,s=null!==(r=null===(e=this.value)||void 0===e?void 0:e.substring(0,i))&&void 0!==r?r:"",n=null!==(o=null===(a=this.value)||void 0===a?void 0:a.substring(l))&&void 0!==o?o:"";this.value=`${s}${t}${n}`;const c=i+t.length;this._inputElem.setSelectionRange(i===l?c:i,c),await this.setFocus()}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}canChangeValue(){return this._inputElem&&(this.value||"")!==this._inputElem.value}adjustFloatingLabel(){if(!this.forceLabelFloat&&this.label&&this._labelElem){const t=this.value&&this.value.toString().length>0,e=this._labelElem.classList.contains("textarea__label--floated");t||this.isFocused()?e||this._labelElem.classList.add("textarea__label--floated"):e&&this._labelElem.classList.remove("textarea__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}updateRows(t){this.rows=t,this._initialRows=t}calculateMaxRows(){const t=this._hostElement.parentElement;if(!t)return;const e=Math.max((null==t?void 0:t.clientHeight)||0,this.LINE_HEIGHT);if(e>0){const t=Math.floor(e/this.LINE_HEIGHT*this.HEIGHT_RATIO);t!==this.rows&&this.updateRows(t)}}initializeResizeObserver(){if(!this.autoRows)return;const t=this._hostElement.parentElement;if(t){try{null!=this._resizeObserver&&this._resizeObserver.unobserve(t),this._resizeObserver=new ResizeObserver(this.calculateMaxRows.bind(this)),this._resizeObserver.observe(t)}catch(t){console.warn(t)}this.calculateMaxRows()}}handleFocusout(){this.adjustFloatingLabel(),this._container&&this._container.classList.contains("textarea--focus")&&this._container.classList.remove("textarea--focus")}handleChange(){this.canChangeValue()&&(this.value=this._inputElem.value)}handleFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("textarea__label--floated")&&this._labelElem.classList.add("textarea__label--floated"),this._container&&!this._container.classList.contains("textarea--focus")&&this._container.classList.add("textarea--focus")}connectedCallback(){this.initializeResizeObserver()}disconnectedCallback(){var t;null===(t=this._resizeObserver)||void 0===t||t.disconnect()}buildPlaceholder(){return this.alternativePlaceholder?this.alternativePlaceholder:"slim"===this.mode&&this.label?this.label:""}buildLabelClass(){let t=this.enabled?"textarea__label":"textarea__label textarea__label--disabled";return this.errorMessage&&(t+=" hasError"),this.forceLabelFloat&&(t+=" textarea__label--floated"),t}renderErrorTooltip(){if(this.canShowError&&"slim"!=this.mode&&this.errorMessage)return r("div",{class:"tooltip-container"},r("ez-tooltip",{type:"error",message:this.errorMessage},r("ez-icon",{class:"tooltip-icon "+(this.errorMessage?"hasError":""),"data-element-id":i.getInternalIDInfo("tooltip-icon"),iconName:"alert-circle"})))}renderLabel(){return this.label&&"slim"!=this.mode?r("label",{ref:t=>this._labelElem=t,class:this.buildLabelClass(),onClick:()=>this._inputElem.focus(),title:this.label},this.label):null}renderTextArea(){return r("textarea",{onFocus:()=>this.handleFocus(),"data-element-id":i.getInternalIDInfo("input"),ref:t=>this._inputElem=t,value:this.value,disabled:!this.enabled,class:{"textarea--slim":"slim"===this.mode},placeholder:this.buildPlaceholder(),onInput:()=>this.handleChange(),onFocusout:()=>this.handleFocusout(),rows:this.rows})}componentDidLoad(){this.observeErrorMessage(),this.adjustFloatingLabel(),this.observeMode(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus()}))}render(){return i.addIDInfoIfNotExists(this._hostElement,"input"),r(a,null,r("div",{class:"textarea "+(this.enabled?"":"textarea--disabled"),ref:t=>this._container=t},this.renderLabel(),r("div",{class:"input-container "+(this.enableResize?"textarea--resizable":"")},this.renderTextArea(),this.renderErrorTooltip())))}get _hostElement(){return o(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],mode:["observeMode"],rows:["observeRows"],autoRows:["observeAutoRows"],alternativePlaceholder:["observeAlternativePlaceholder"]}}};l.style=":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #2B3A54);--text-area__input--background-color:var(--background--light, #FFFFFF);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--color--strokes, #DCE0E8);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--background--medium, #F0F3F7);--text-area__input--disabled--color:var(--text--primary, #626E82);--text-area__input--disabled--border--color:var(--color--strokes, #DCE0E8);--text-area__input--error--border-color:var(--color-alert--error-800, #BD0025);--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color-alert--error-800, #BD0025);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;--text-area__scrollbar--color-default:var(--scrollbar--default, #626e82);--text-area__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--text-area__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--text-area__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--text-area__scrollbar--border-radius:var(--border--radius-small, 6px);--text-area__scrollbar--width:var(--space--small, 6px);--ez-text-area__tooltip-icon--spacing:var(--space--large);--ez-text-area__tooltip-icon---width:var(--space--large);--ez-text-area__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-area__tooltip-icon---vertical-margin:10px;--ez-text-area__tooltip_icon--error--color:var(--color-alert--error-800, #BD0025);display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{display:flex;flex-direction:column;height:calc(100% - 16px);box-sizing:border-box;border:none;resize:none;width:100%;padding:0;background:none;min-height:42px;font-weight:var(--text-area--font-weight);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);margin-top:calc(var(--space--medium, 12px) + 4px);scrollbar-width:thin;scrollbar-color:var(--text-area__scrollbar--color-clicked) var(--text-area__scrollbar--color-background)}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color);border:var(--text-area__input--disabled--border);cursor:not-allowed}textarea::-webkit-scrollbar{background-color:var(--text-area__scrollbar--color-background);width:var(--text-area__scrollbar--width);max-width:var(--text-area__scrollbar--width);min-width:var(--text-area__scrollbar--width)}textarea::-webkit-scrollbar-thumb{background-color:var(--text-area__scrollbar--color-default);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-track{background-color:var(--text-area__scrollbar--color-background);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-thumb:vertical:hover,textarea::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--text-area__scrollbar--color-hover)}textarea::-webkit-scrollbar-thumb:vertical:active,textarea::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--text-area__scrollbar--color-clicked)}.textarea{width:100%;min-height:42px;max-width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--disabled{border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--disabled--border--color);background-color:var(--text-area__input--disabled--background-color);cursor:not-allowed}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color);cursor:not-allowed}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-ms-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:disabled::-webkit-input-placeholder,.textarea--slim:disabled:-moz-placeholder,.textarea--slim:disabled::-moz-placeholder,.textarea--slim:disabled:-ms-input-placeholder,.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color);cursor:not-allowed}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-area__tooltip_icon--error--color)}.input-container{display:flex;align-items:center}.textarea--resizable{resize:vertical;overflow:auto;min-height:42px}";export{l as ez_text_area}
1
+ import{r as t,c as e,h as a,H as r,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as i}from"@sankhyalabs/core";const l=class{constructor(a){t(this,a),this.ezChange=e(this,"ezChange",7),this.LINE_HEIGHT=24,this.HEIGHT_RATIO=1.4,this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.rows=4,this.canShowError=!0,this.mode="regular",this.enableResize=!0,this.autoRows=!1,this.autoFocus=!1,this.alternativePlaceholder=void 0,this.forceLabelFloat=!1}observeErrorMessage(){var t,e,a,r;"string"==typeof this.errorMessage&&""!==this.errorMessage?(null===(t=this._container)||void 0===t||t.classList.add("hasError"),null===(e=this._messageBoxElem)||void 0===e||e.classList.add("hasError")):(null===(a=this._container)||void 0===a||a.classList.remove("hasError"),null===(r=this._messageBoxElem)||void 0===r||r.classList.remove("hasError"))}observeValue(t,e){this._inputElem&&t!=e&&(this.canChangeValue()&&(this._inputElem.value=this.value||""),this.adjustFloatingLabel(),this.errorMessage="",this.ezChange.emit(this.value))}observeMode(){null==this._initialRows&&(this._initialRows=this.rows>0?this.rows:void 0);const t=this._initialRows>0?this._initialRows:"slim"!=this.mode?4:2;t!==this.rows&&(this.rows=t)}observeRows(){const t=this.rows>0?this.rows:"slim"!=this.mode?4:2;t!==this.rows&&this.updateRows(t)}observeAutoRows(){var t,e;this.autoRows?(null===(t=this._resizeObserver)||void 0===t||t.disconnect(),this.initializeResizeObserver()):null===(e=this._resizeObserver)||void 0===e||e.disconnect()}observeAlternativePlaceholder(t){this.forceLabelFloat=!!t}async appendTextToSelection(t){var e,a,r,o;const i=this._inputElem.selectionStart,l=this._inputElem.selectionEnd,s=null!==(a=null===(e=this.value)||void 0===e?void 0:e.substring(0,i))&&void 0!==a?a:"",n=null!==(o=null===(r=this.value)||void 0===r?void 0:r.substring(l))&&void 0!==o?o:"";this.value=`${s}${t}${n}`;const c=i+t.length;this._inputElem.setSelectionRange(i===l?c:i,c),await this.setFocus()}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}canChangeValue(){return this._inputElem&&(this.value||"")!==this._inputElem.value}adjustFloatingLabel(){if(!this.forceLabelFloat&&this.label&&this._labelElem){const t=this.value&&this.value.toString().length>0,e=this._labelElem.classList.contains("textarea__label--floated");t||this.isFocused()?e||this._labelElem.classList.add("textarea__label--floated"):e&&this._labelElem.classList.remove("textarea__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}updateRows(t){this.rows=t,this._initialRows=t}calculateMaxRows(){const t=this._hostElement.parentElement;if(!t)return;const e=Math.max((null==t?void 0:t.clientHeight)||0,this.LINE_HEIGHT);if(e>0){const t=Math.floor(e/this.LINE_HEIGHT*this.HEIGHT_RATIO);t!==this.rows&&this.updateRows(t)}}initializeResizeObserver(){if(!this.autoRows)return;const t=this._hostElement.parentElement;if(t){try{null!=this._resizeObserver&&this._resizeObserver.unobserve(t),this._resizeObserver=new ResizeObserver(this.calculateMaxRows.bind(this)),this._resizeObserver.observe(t)}catch(t){console.warn(t)}this.calculateMaxRows()}}handleFocusout(){this.adjustFloatingLabel(),this._container&&this._container.classList.contains("textarea--focus")&&this._container.classList.remove("textarea--focus")}handleChange(){this.canChangeValue()&&(this.value=this._inputElem.value)}handleFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("textarea__label--floated")&&this._labelElem.classList.add("textarea__label--floated"),this._container&&!this._container.classList.contains("textarea--focus")&&this._container.classList.add("textarea--focus")}connectedCallback(){this.initializeResizeObserver()}disconnectedCallback(){var t;null===(t=this._resizeObserver)||void 0===t||t.disconnect()}buildPlaceholder(){return this.alternativePlaceholder?this.alternativePlaceholder:"slim"===this.mode&&this.label?this.label:""}buildLabelClass(){let t=this.enabled?"textarea__label":"textarea__label textarea__label--disabled";return this.errorMessage&&(t+=" hasError"),this.forceLabelFloat&&(t+=" textarea__label--floated"),t}renderErrorTooltip(){if(this.canShowError&&"slim"!=this.mode&&this.errorMessage)return a("div",{class:"tooltip-container"},a("ez-tooltip",{type:"error",message:this.errorMessage},a("ez-icon",{class:"tooltip-icon "+(this.errorMessage?"hasError":""),"data-element-id":i.getInternalIDInfo("tooltip-icon"),iconName:"alert-circle"})))}renderLabel(){return this.label&&"slim"!=this.mode?a("label",{ref:t=>this._labelElem=t,class:this.buildLabelClass(),onClick:()=>this._inputElem.focus(),title:this.label},this.label):null}renderTextArea(){return a("textarea",{onFocus:()=>this.handleFocus(),"data-element-id":i.getInternalIDInfo("input"),ref:t=>this._inputElem=t,value:this.value,disabled:!this.enabled,class:{"textarea--slim":"slim"===this.mode},placeholder:this.buildPlaceholder(),onInput:()=>this.handleChange(),onFocusout:()=>this.handleFocusout(),rows:this.rows})}componentDidLoad(){this.observeErrorMessage(),this.adjustFloatingLabel(),this.observeMode(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus()}))}render(){return i.addIDInfoIfNotExists(this._hostElement,"input"),a(r,null,a("div",{class:"textarea "+(this.enabled?"":"textarea--disabled"),ref:t=>this._container=t},this.renderLabel(),a("div",{class:"input-container "+(this.enableResize?"textarea--resizable":"")},this.renderTextArea(),this.renderErrorTooltip())))}get _hostElement(){return o(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],mode:["observeMode"],rows:["observeRows"],autoRows:["observeAutoRows"],alternativePlaceholder:["observeAlternativePlaceholder"]}}};l.style=":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #2B3A54);--text-area__input--background-color:var(--background--light, #FFFFFF);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--color--strokes, #DCE0E8);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--background--medium, #F0F3F7);--text-area__input--disabled--color:var(--text--primary, #626E82);--text-area__input--disabled--border--color:var(--color--strokes, #DCE0E8);--text-area__input--error--border-color:var(--color-alert--error-800, #BD0025);--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color-alert--error-800, #BD0025);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;--text-area__scrollbar--color-default:var(--scrollbar--default, #626e82);--text-area__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--text-area__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--text-area__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--text-area__scrollbar--border-radius:var(--border--radius-small, 6px);--text-area__scrollbar--width:var(--space--small, 6px);--ez-text-area__tooltip-icon--spacing:var(--space--large);--ez-text-area__tooltip-icon---width:var(--space--large);--ez-text-area__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-area__tooltip-icon---vertical-margin:10px;--ez-text-area__tooltip_icon--error--color:var(--color-alert--error-800, #BD0025);display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{display:flex;flex-direction:column;height:calc(100% - 16px);box-sizing:border-box;border:none;resize:none;width:100%;padding:0;background:none;min-height:42px;font-weight:var(--text-area--font-weight);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);margin-top:calc(var(--space--medium, 12px) + 4px);scrollbar-width:thin;scrollbar-color:var(--text-area__scrollbar--color-clicked) var(--text-area__scrollbar--color-background)}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color);border:var(--text-area__input--disabled--border);cursor:not-allowed}textarea::-webkit-scrollbar{background-color:var(--text-area__scrollbar--color-background);width:var(--text-area__scrollbar--width);max-width:var(--text-area__scrollbar--width);min-width:var(--text-area__scrollbar--width)}textarea::-webkit-scrollbar-thumb{background-color:var(--text-area__scrollbar--color-default);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-track{background-color:var(--text-area__scrollbar--color-background);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-thumb:vertical:hover,textarea::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--text-area__scrollbar--color-hover)}textarea::-webkit-scrollbar-thumb:vertical:active,textarea::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--text-area__scrollbar--color-clicked)}.textarea{width:100%;min-height:42px;max-width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--disabled{border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--disabled--border--color);background-color:var(--text-area__input--disabled--background-color);cursor:not-allowed}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color);cursor:not-allowed}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-ms-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:disabled::-webkit-input-placeholder,.textarea--slim:disabled:-moz-placeholder,.textarea--slim:disabled::-moz-placeholder,.textarea--slim:disabled:-ms-input-placeholder,.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color);cursor:not-allowed}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-area__tooltip_icon--error--color)}.input-container{display:flex;align-items:center}.textarea--resizable{resize:vertical;overflow:auto;min-height:42px}";export{l as ez_text_area}
@@ -1 +1 @@
1
- import{r as i,h as t,g as s,H as e}from"./p-e4c7eb39.js";import{JSUtils as h,ElementIDUtils as l}from"@sankhyalabs/core";const o=class{constructor(t){i(this,t),this._dataKey=""}async show(i){i!==this._focusedIndex&&0<=i&&i<this._totalStackItems&&(this.policyHideRemove(),this.policyShowAppend(i),this._focusedIndex=i)}async getSelectedIndex(){return this._focusedIndex}policyHideRemove(){let i=this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);this.checkElementVisibility(i)}policyShowAppend(i){let t=this._hostElem.querySelector(`#${this._dataKey}_el_${i}`);t?t.setAttribute("style","visibility: visible"):this._hostElem.append(this._elemList[i])}checkElementVisibility(i){"hide"!==i.getAttribute("hidePolicy")&&i.getAttribute("hidePolicy")?"remove"===i.getAttribute("hidePolicy")&&i.remove():i.setAttribute("style","display: none")}componentWillRender(){this._dataKey="id_".concat(h.generateUUID()),this._elemList||(this._elemList=[],this._focusedIndex=0,this._totalStackItems=0,this._hostElem.classList.add("ez-view-stack__container"),this._hostElem.querySelectorAll(":scope > stack-item").forEach(((i,t)=>{i.setAttribute("id",`${this._dataKey}_el_${t}`),0!==t?this.checkElementVisibility(i):i.setAttribute("style","visibility: visible"),this._totalStackItems++,this._elemList.push(i)})))}componentDidLoad(){l.addIDInfo(this._hostElem)}disconectCallback(){this._hostElem=null,this._elemList=null}render(){return t(e,null)}get _hostElem(){return s(this)}};o.style=":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";export{o as ez_view_stack}
1
+ import{r as i,h as t,g as s,H as e}from"./p-23a36bb6.js";import{JSUtils as h,ElementIDUtils as l}from"@sankhyalabs/core";const o=class{constructor(t){i(this,t),this._dataKey=""}async show(i){i!==this._focusedIndex&&0<=i&&i<this._totalStackItems&&(this.policyHideRemove(),this.policyShowAppend(i),this._focusedIndex=i)}async getSelectedIndex(){return this._focusedIndex}policyHideRemove(){let i=this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);this.checkElementVisibility(i)}policyShowAppend(i){let t=this._hostElem.querySelector(`#${this._dataKey}_el_${i}`);t?t.setAttribute("style","visibility: visible"):this._hostElem.append(this._elemList[i])}checkElementVisibility(i){"hide"!==i.getAttribute("hidePolicy")&&i.getAttribute("hidePolicy")?"remove"===i.getAttribute("hidePolicy")&&i.remove():i.setAttribute("style","display: none")}componentWillRender(){this._dataKey="id_".concat(h.generateUUID()),this._elemList||(this._elemList=[],this._focusedIndex=0,this._totalStackItems=0,this._hostElem.classList.add("ez-view-stack__container"),this._hostElem.querySelectorAll(":scope > stack-item").forEach(((i,t)=>{i.setAttribute("id",`${this._dataKey}_el_${t}`),0!==t?this.checkElementVisibility(i):i.setAttribute("style","visibility: visible"),this._totalStackItems++,this._elemList.push(i)})))}componentDidLoad(){l.addIDInfo(this._hostElem)}disconectCallback(){this._hostElem=null,this._elemList=null}render(){return t(e,null)}get _hostElem(){return s(this)}};o.style=":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";export{o as ez_view_stack}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as e,g as a}from"./p-e4c7eb39.js";import{DateUtils as n,ElementIDUtils as h}from"@sankhyalabs/core";import{C as o}from"./p-ec7db713.js";import{i as r}from"./p-69344c23.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this.ezInput=i(this,"ezInput",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mode="regular",this.size="default",this.required=!1,this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i){const s=n.validateDate(t),e=n.validateDate(i);if((null==s?void 0:s.getTime())!==(null==e?void 0:e.getTime())){const t=this.getTextValue(s)||"";!n.strToDate(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===s?void 0:s)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}changeValue(t){const i=n.validateDate(this.value),s=n.validateDate(t);(null==i?void 0:i.getTime())!==(null==s?void 0:s.getTime())?this.value=s:this._changePending=!1}async handleChangeCalendar(t){this.changeValue(this._calendar.value),this.ezInput.emit(this._calendar.value),this._popover.hide(),await this.setFocus(),t.stopPropagation()}handleBlur(){if(this._changePending)try{const t=this._textInput.value,i=n.strToDate(t);if(i||!t){this.errorMessage="";const t=n.validateDate(this.value),s=n.validateDate(i);(null==t?void 0:t.getTime())===(null==s?void 0:s.getTime())?(s&&(this._textInput.value=this.getTextValue(s)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):(this._focused=!1,this.changeValue(s))}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-classic-date-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){return t?n.formatDate(t):void 0}handleInput(t){const i=n.strToDate(this._textInput.value),s=n.validateDate(this.value),e=n.validateDate(i);if((null==s?void 0:s.getTime())!==(null==e?void 0:e.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"===t.data||"h"===t.data){const t=new Date;this.ezInput.emit(t),this.changeValue(t)}}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await r()}componentDidLoad(){o.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),s(e,null,s("ez-classic-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),mask:"##/##/####",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,size:this.size,canShowError:this.canShowError,alternativePlaceholder:this.alternativePlaceholder,required:this.required,leftIconName:"calendar",leftIconClickable:this.enabled,onIconClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},onEzChange:t=>t.stopPropagation()}),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id"),onEzVisibilityChange:t=>t.stopPropagation()},s("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>this.handleChangeCalendar(t),value:this.value})))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};l.style=':host{display:block;width:100%;--ez-classic-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-date-input__input--border-color:var(--ez-classic-date-input__input--background-color);--ez-classic-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-classic-date-input__calendar-image);mask-image:var(--ez-classic-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-classic-input{--text-input__input--background-color:var(--ez-classic-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-classic-date-input__input--border-color, #DCE0E8)}';export{l as ez_classic_date_input}
1
+ import{r as t,c as i,h as s,H as e,g as a}from"./p-23a36bb6.js";import{DateUtils as n,ElementIDUtils as h}from"@sankhyalabs/core";import{C as o}from"./p-ec7db713.js";import{i as r}from"./p-b6579f86.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this.ezInput=i(this,"ezInput",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mode="regular",this.size="default",this.required=!1,this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i){const s=n.validateDate(t),e=n.validateDate(i);if((null==s?void 0:s.getTime())!==(null==e?void 0:e.getTime())){const t=this.getTextValue(s)||"";!n.strToDate(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===s?void 0:s)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}changeValue(t){const i=n.validateDate(this.value),s=n.validateDate(t);(null==i?void 0:i.getTime())!==(null==s?void 0:s.getTime())?this.value=s:this._changePending=!1}async handleChangeCalendar(t){this.changeValue(this._calendar.value),this.ezInput.emit(this._calendar.value),this._popover.hide(),await this.setFocus(),t.stopPropagation()}handleBlur(){if(this._changePending)try{const t=this._textInput.value,i=n.strToDate(t);if(i||!t){this.errorMessage="";const t=n.validateDate(this.value),s=n.validateDate(i);(null==t?void 0:t.getTime())===(null==s?void 0:s.getTime())?(s&&(this._textInput.value=this.getTextValue(s)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):(this._focused=!1,this.changeValue(s))}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-classic-date-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){return t?n.formatDate(t):void 0}handleInput(t){const i=n.strToDate(this._textInput.value),s=n.validateDate(this.value),e=n.validateDate(i);if((null==s?void 0:s.getTime())!==(null==e?void 0:e.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"===t.data||"h"===t.data){const t=new Date;this.ezInput.emit(t),this.changeValue(t)}}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await r()}componentDidLoad(){o.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),s(e,null,s("ez-classic-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),mask:"##/##/####",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,size:this.size,canShowError:this.canShowError,alternativePlaceholder:this.alternativePlaceholder,required:this.required,leftIconName:"calendar",leftIconClickable:this.enabled,onIconClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},onEzChange:t=>t.stopPropagation()}),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id"),onEzVisibilityChange:t=>t.stopPropagation()},s("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>this.handleChangeCalendar(t),value:this.value})))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};l.style=':host{display:block;width:100%;--ez-classic-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-date-input__input--border-color:var(--ez-classic-date-input__input--background-color);--ez-classic-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-classic-date-input__calendar-image);mask-image:var(--ez-classic-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-classic-input{--text-input__input--background-color:var(--ez-classic-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-classic-date-input__input--border-color, #DCE0E8)}';export{l as ez_classic_date_input}
@@ -1 +1 @@
1
- import{r as e,c as l,h as a,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as o}from"@sankhyalabs/core";const i=class{constructor(a){e(this,a),this.valueChange=l(this,"valueChange",7),this.removeChip=l(this,"removeChip",7),this.actionClick=l(this,"actionClick",7),this.iconClick=l(this,"iconClick",7),this.label=void 0,this.enabled=!0,this.removePosition=void 0,this.mode=void 0,this.value=!1,this.showNativeTooltip=!1,this.disableAutoUpdateValue=!1,this.maxWidth=void 0,this.size="default",this.iconNameLeft=void 0,this.iconNameRight=void 0,this.type="primary",this.tabIndex=0,this.removeWithKeyboard=!1,this._isOverflowing=!1}async setFocus(){this._containerElem.focus()}async setBlur(){this._containerElem.blur()}handleValueChange(){this.swichState(),this.valueChange.emit(this.value)}handleClick(){if(this.enabled)return"action"===this.mode?this.actionClick.emit():this.disableAutoUpdateValue?void 0:this.handleValueChange()}handleClickRemoveButton(e){this.enabled&&(e.stopPropagation(),this.removeChip.emit())}handleIconClick(e,l){this.enabled&&(e.stopPropagation(),this.iconClick.emit({icon:l}))}swichState(){this.enabled&&(this.value=!this.value)}checkIsOverflowing(){this._isOverflowing=!!this._labelElem&&this._labelElem.offsetWidth<this._labelElem.scrollWidth}handleDeleteKey(){this.removeWithKeyboard?this.removeChip.emit():"action"===this.mode?this.actionClick.emit():(this.swichState(),this.valueChange.emit(this.value))}handleKeyDown(e){"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||(e.preventDefault(),this.handleDeleteKey())}componentDidLoad(){this._element&&o.addIDInfo(this._element,"ezChip"),this._containerElem&&this._containerElem.setAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME,o.getInternalIDInfo("button")),this.checkIsOverflowing()}render(){let e="default";return this.enabled?this.value&&"action"!==this.mode&&(e="active"):e="disabled",a("ez-tooltip",{active:this.showNativeTooltip||this._isOverflowing,message:this.label},a("button",{ref:e=>this._containerElem=e,class:{"label__container--row-reverse":"left"===this.removePosition,label__container:!0},"data-color-state":e,"data-color-type":this.type,"data-size":this.size,onClick:this.handleClick.bind(this),tabIndex:this.tabIndex,style:{maxWidth:this.maxWidth},onKeyDown:this.handleKeyDown.bind(this)},this.iconNameLeft&&a("ez-icon",{size:"medium","icon-name":this.iconNameLeft,onClick:e=>this.handleIconClick(e,"left")}),a("slot",{name:"leftIcon"}),a("label",{ref:e=>this._labelElem=e,class:{"label__text--disabled":!this.enabled,label__text:!0}},this.label),a("slot",{name:"rightIcon"}),this.iconNameRight&&a("ez-icon",{size:"medium","icon-name":this.iconNameRight,onClick:e=>this.handleIconClick(e,"right")}),"action"!==this.mode&&this.removePosition&&a("ez-icon",{class:"btn-close",size:"medium","icon-name":"close",onClick:e=>this.handleClickRemoveButton(e)})))}get _element(){return r(this)}};i.style=':host{--ez-label-chip--height:32px;--ez-label-chip__label--font-size:var(--font-size--default, 14px);--ez-label-chip__label--font-family:var(--font-pattern, Arial);--ez-label-chip__label--font-weight:var(--font-weight--regular, 400);--ez-label-chip__horizontal-padding:var(--space--8, 8px);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-radius:var(--border--radius-large, 24px);--ez-label-chip__label__container--border:1px solid;--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container-color--disabled:var(--color--gray-80, #F9F9F9);--ez-label-chip__label__container--background-color:var(--color--ocean-green-600, #008561);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--ocean-green-700, #00684C);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--text--disabled:var(--color--gray-300, #A4A5A7);--ez-label-chip__label__container--default--border-color--active:var(--color--ocean-green-200);--ez-label-chip__label__container--secondary--border-color--active:var(--color--gray-200);--ez-label-chip__label__container--margin:0px}.label__text{cursor:pointer;white-space:nowrap;user-select:none;text-overflow:ellipsis;overflow:hidden;max-width:100%;font-family:var(--ez-label-chip__label--font-family);font-size:var(--ez-label-chip__label--font-size);font-weight:var(--ez-label-chip__label--font-weight)}.label__text--disabled{cursor:not-allowed}.label__container{cursor:pointer;width:max-content;display:flex;flex-wrap:wrap;align-items:center;gap:var(--space--4);outline:none;height:var(--ez-label-chip--height);border:var(--ez-label-chip__label__container--border);border-radius:var(--ez-label-chip__label__container--border-radius);padding:0 var(--ez-label-chip__horizontal-padding);outline-color:var(--ez-label-chip__label__container--default--border-color--active);margin:var(--ez-label-chip__label__container--margin)}.label__container[data-size="default"]{height:var(--ez-label-chip--height, 32px)}.label__container[data-size="medium"]{height:42px}.label__container[data-size="large"]{height:50px}.label__container--row-reverse{flex-direction:row-reverse}.label__container--disabled{cursor:not-allowed}.label__container:hover{-webkit-transition:150ms -webkit-filter linear;transition:150ms filter linear, 150ms -webkit-filter linear;filter:brightness(90%)}.label__container:focus{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--ez-label-chip__label__container--default--border-color--active)}.label__container:active{-webkit-transition:150ms -webkit-filter linear;transition:150ms filter linear, 150ms -webkit-filter linear;filter:brightness(85%)}.label__container ez-icon{--ez-icon--color:var(--ez-label-chip__label--icon--primary)}:host .label__container ::slotted(ez-icon){--ez-icon--color:var(--ez-label-chip__label--icon--primary)}.label__container[data-color-state="default"]{border-color:var(--ez-label-chip__label__container--border-color-strokes);background-color:var(--ez-label-chip__label__container--background-color);color:var(--ez-label-chip__label--text--primary)}.label__container[data-color-state="active"]{border-color:var(--ez-label-chip__label__container--border-color-active);background-color:var(--ez-label-chip__label__container--default--background-color--active);color:var(--ez-label-chip__label__container--default--color--active)}.label__container:focus{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--ez-label-chip__label__container--default--border-color--active)}.label__container[data-color-type="secondary"]{--ez-label-chip__label--icon--primary:var(--color--gray-300, #A4A5A7);--ez-label-chip__label__container--border-color-strokes:var(--color--gray-200, #D2D2D3);--ez-label-chip__label__container--background-color:var(--color--gray-70, #F7F7F8);--ez-label-chip__label--text--primary:var(--color--ocean-green-1000, #00281D);--ez-label-chip__label__container--border-color-active:var(--color--gray-200, #D2D2D3);--ez-label-chip__label__container--default--background-color--active:var(--color--primary-300, #6BB8A3);--ez-label-chip__label__container--default--color--active:var(--color--ocean-green-600, #008561);--ez-label-chip__label__container--default--border-color--active:var(--color--ocean-green-600, #008561)}.label__container[data-color-type="error"]{--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--red-600, #BD0025);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--red-700, #97001E);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="error-light"]{--ez-label-chip__label--icon--primary:var(--color--red-600, #BD0025);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--red-200, #F2CCD3);--ez-label-chip__label--text--primary:var(--color--red-600, #BD0025);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--red-300, #E599A8);--ez-label-chip__label__container--default--color--active:var(--color--red-600, #BD0025);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="warning"]{--ez-label-chip__label--icon--primary:var(--color--yellow-900, #604701);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--yellow-600, #EFB103);--ez-label-chip__label--text--primary:var(--color--yellow-900, #604701);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--yellow-700, #BF8E02);--ez-label-chip__label__container--default--color--active:var(--color--yellow-900, #604701);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="warning-light"]{--ez-label-chip__label--icon--primary:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--yellow-200, #FDF6E4);--ez-label-chip__label--text--primary:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--yellow-300, #F6EB8A);--ez-label-chip__label__container--default--color--active:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="success"]{--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--green-600, #157A00);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--green-700, #116200);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="success-light"]{--ez-label-chip__label--icon--primary:var(--color--green-600, #157A00);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--green-200, #C8E6C9);--ez-label-chip__label--text--primary:var(--color--green-600, #157A00);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--green-300, #A5D6A7);--ez-label-chip__label__container--default--color--active:var(--color--green-600, #157A00);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-state="disabled"]{border-color:var(--ez-label-chip__label__container-color--disabled);background-color:var(--ez-label-chip__label__container-color--disabled);color:var(--ez-label-chip__label__container--text--disabled);cursor:not-allowed;filter:none}.label__container[data-color-state="disabled"] ez-icon{--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}:host .label__container[data-color-state="disabled"] ::slotted(ez-icon){--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}';export{i as ez_chip}
1
+ import{r as e,c as l,h as a,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as o}from"@sankhyalabs/core";const i=class{constructor(a){e(this,a),this.valueChange=l(this,"valueChange",7),this.removeChip=l(this,"removeChip",7),this.actionClick=l(this,"actionClick",7),this.iconClick=l(this,"iconClick",7),this.label=void 0,this.enabled=!0,this.removePosition=void 0,this.mode=void 0,this.value=!1,this.showNativeTooltip=!1,this.disableAutoUpdateValue=!1,this.maxWidth=void 0,this.size="default",this.iconNameLeft=void 0,this.iconNameRight=void 0,this.type="primary",this.tabIndex=0,this.removeWithKeyboard=!1,this._isOverflowing=!1}async setFocus(){this._containerElem.focus()}async setBlur(){this._containerElem.blur()}handleValueChange(){this.swichState(),this.valueChange.emit(this.value)}handleClick(){if(this.enabled)return"action"===this.mode?this.actionClick.emit():this.disableAutoUpdateValue?void 0:this.handleValueChange()}handleClickRemoveButton(e){this.enabled&&(e.stopPropagation(),this.removeChip.emit())}handleIconClick(e,l){this.enabled&&(e.stopPropagation(),this.iconClick.emit({icon:l}))}swichState(){this.enabled&&(this.value=!this.value)}checkIsOverflowing(){this._isOverflowing=!!this._labelElem&&this._labelElem.offsetWidth<this._labelElem.scrollWidth}handleDeleteKey(){this.removeWithKeyboard?this.removeChip.emit():"action"===this.mode?this.actionClick.emit():(this.swichState(),this.valueChange.emit(this.value))}handleKeyDown(e){"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||(e.preventDefault(),this.handleDeleteKey())}componentDidLoad(){this._element&&o.addIDInfo(this._element,"ezChip"),this._containerElem&&this._containerElem.setAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME,o.getInternalIDInfo("button")),this.checkIsOverflowing()}render(){let e="default";return this.enabled?this.value&&"action"!==this.mode&&(e="active"):e="disabled",a("ez-tooltip",{active:this.showNativeTooltip||this._isOverflowing,message:this.label},a("button",{ref:e=>this._containerElem=e,class:{"label__container--row-reverse":"left"===this.removePosition,label__container:!0},"data-color-state":e,"data-color-type":this.type,"data-size":this.size,onClick:this.handleClick.bind(this),tabIndex:this.tabIndex,style:{maxWidth:this.maxWidth},onKeyDown:this.handleKeyDown.bind(this)},this.iconNameLeft&&a("ez-icon",{size:"medium","icon-name":this.iconNameLeft,onClick:e=>this.handleIconClick(e,"left")}),a("slot",{name:"leftIcon"}),a("label",{ref:e=>this._labelElem=e,class:{"label__text--disabled":!this.enabled,label__text:!0}},this.label),a("slot",{name:"rightIcon"}),this.iconNameRight&&a("ez-icon",{size:"medium","icon-name":this.iconNameRight,onClick:e=>this.handleIconClick(e,"right")}),"action"!==this.mode&&this.removePosition&&a("ez-icon",{class:"btn-close",size:"medium","icon-name":"close",onClick:e=>this.handleClickRemoveButton(e)})))}get _element(){return r(this)}};i.style=':host{--ez-label-chip--height:32px;--ez-label-chip__label--font-size:var(--font-size--default, 14px);--ez-label-chip__label--font-family:var(--font-pattern, Arial);--ez-label-chip__label--font-weight:var(--font-weight--regular, 400);--ez-label-chip__horizontal-padding:var(--space--8, 8px);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-radius:var(--border--radius-large, 24px);--ez-label-chip__label__container--border:1px solid;--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container-color--disabled:var(--color--gray-80, #F9F9F9);--ez-label-chip__label__container--background-color:var(--color--ocean-green-600, #008561);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--ocean-green-700, #00684C);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--text--disabled:var(--color--gray-300, #A4A5A7);--ez-label-chip__label__container--default--border-color--active:var(--color--ocean-green-200);--ez-label-chip__label__container--secondary--border-color--active:var(--color--gray-200);--ez-label-chip__label__container--margin:0px}.label__text{cursor:pointer;white-space:nowrap;user-select:none;text-overflow:ellipsis;overflow:hidden;max-width:100%;font-family:var(--ez-label-chip__label--font-family);font-size:var(--ez-label-chip__label--font-size);font-weight:var(--ez-label-chip__label--font-weight)}.label__text--disabled{cursor:not-allowed}.label__container{cursor:pointer;width:max-content;display:flex;flex-wrap:wrap;align-items:center;gap:var(--space--4);outline:none;height:var(--ez-label-chip--height);border:var(--ez-label-chip__label__container--border);border-radius:var(--ez-label-chip__label__container--border-radius);padding:0 var(--ez-label-chip__horizontal-padding);outline-color:var(--ez-label-chip__label__container--default--border-color--active);margin:var(--ez-label-chip__label__container--margin)}.label__container[data-size="default"]{height:var(--ez-label-chip--height, 32px)}.label__container[data-size="medium"]{height:42px}.label__container[data-size="large"]{height:50px}.label__container--row-reverse{flex-direction:row-reverse}.label__container--disabled{cursor:not-allowed}.label__container:hover{-webkit-transition:150ms -webkit-filter linear;transition:150ms filter linear, 150ms -webkit-filter linear;filter:brightness(90%)}.label__container:focus{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--ez-label-chip__label__container--default--border-color--active)}.label__container:active{-webkit-transition:150ms -webkit-filter linear;transition:150ms filter linear, 150ms -webkit-filter linear;filter:brightness(85%)}.label__container ez-icon{--ez-icon--color:var(--ez-label-chip__label--icon--primary)}:host .label__container ::slotted(ez-icon){--ez-icon--color:var(--ez-label-chip__label--icon--primary)}.label__container[data-color-state="default"]{border-color:var(--ez-label-chip__label__container--border-color-strokes);background-color:var(--ez-label-chip__label__container--background-color);color:var(--ez-label-chip__label--text--primary)}.label__container[data-color-state="active"]{border-color:var(--ez-label-chip__label__container--border-color-active);background-color:var(--ez-label-chip__label__container--default--background-color--active);color:var(--ez-label-chip__label__container--default--color--active)}.label__container:focus{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--ez-label-chip__label__container--default--border-color--active)}.label__container[data-color-type="secondary"]{--ez-label-chip__label--icon--primary:var(--color--gray-300, #A4A5A7);--ez-label-chip__label__container--border-color-strokes:var(--color--gray-200, #D2D2D3);--ez-label-chip__label__container--background-color:var(--color--gray-70, #F7F7F8);--ez-label-chip__label--text--primary:var(--color--ocean-green-1000, #00281D);--ez-label-chip__label__container--border-color-active:var(--color--gray-200, #D2D2D3);--ez-label-chip__label__container--default--background-color--active:var(--color--primary-300, #6BB8A3);--ez-label-chip__label__container--default--color--active:var(--color--ocean-green-600, #008561);--ez-label-chip__label__container--default--border-color--active:var(--color--ocean-green-600, #008561)}.label__container[data-color-type="error"]{--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--red-600, #BD0025);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--red-700, #97001E);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="error-light"]{--ez-label-chip__label--icon--primary:var(--color--red-600, #BD0025);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--red-200, #F2CCD3);--ez-label-chip__label--text--primary:var(--color--red-600, #BD0025);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--red-300, #E599A8);--ez-label-chip__label__container--default--color--active:var(--color--red-600, #BD0025);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="warning"]{--ez-label-chip__label--icon--primary:var(--color--yellow-900, #604701);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--yellow-600, #EFB103);--ez-label-chip__label--text--primary:var(--color--yellow-900, #604701);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--yellow-700, #BF8E02);--ez-label-chip__label__container--default--color--active:var(--color--yellow-900, #604701);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="warning-light"]{--ez-label-chip__label--icon--primary:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--yellow-200, #FDF6E4);--ez-label-chip__label--text--primary:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--yellow-300, #F6EB8A);--ez-label-chip__label__container--default--color--active:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="success"]{--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--green-600, #157A00);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--green-700, #116200);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="success-light"]{--ez-label-chip__label--icon--primary:var(--color--green-600, #157A00);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--green-200, #C8E6C9);--ez-label-chip__label--text--primary:var(--color--green-600, #157A00);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--green-300, #A5D6A7);--ez-label-chip__label__container--default--color--active:var(--color--green-600, #157A00);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-state="disabled"]{border-color:var(--ez-label-chip__label__container-color--disabled);background-color:var(--ez-label-chip__label__container-color--disabled);color:var(--ez-label-chip__label__container--text--disabled);cursor:not-allowed;filter:none}.label__container[data-color-state="disabled"] ez-icon{--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}:host .label__container[data-color-state="disabled"] ::slotted(ez-icon){--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}';export{i as ez_chip}
@@ -1 +1 @@
1
- import{r as i,c as t,h as a,H as n,g as e}from"./p-e4c7eb39.js";import{i as o}from"./p-69344c23.js";import{Action as s,ElementIDUtils as r}from"@sankhyalabs/core";const h=class{constructor(a){i(this,a),this.pageChange=t(this,"pageChange",7),this._dataUnitInitialized=!1,this.paginationInfo=void 0,this.leftButtonDisabled=void 0,this.rightButtonDisabled=void 0,this.paginationCounterMode="auto",this.dataUnit=void 0,this.paginationTextPosition="left",this.buttonsSize="large"}async previousPage(){this.dataUnit&&(await this.dataUnit.previousPage(),this.handlePageChange("previous"))}async nextPage(){this.dataUnit&&(await this.dataUnit.nextPage(),this.handlePageChange("next"))}async firstPage(){this.dataUnit&&(await this.dataUnit.gotoPage(0),this.handlePageChange("previous"))}async lastPage(){this.dataUnit&&(await this.dataUnit.gotoPage(this.getTotalPages()-1),this.handlePageChange("next"))}onDataUnitChange(){this.initializeDataUnit()}shouldPresentPaginationLabel(){return"hidden"!==this.paginationCounterMode}getRemainingPageLabel(){var i;return this.paginationInfo?`${null==this.paginationInfo.total?this.i18n("ez-grid-pagination.remainingPageLabel",{count:(null!==(i=this.paginationInfo.count)&&void 0!==i?i:0)+1}):this.i18n("ez-grid-pagination.remainingTotalLabel",{total:this.paginationInfo.total,count:this.paginationInfo.count})}`:""}getActualPageLabel(){var i,t;return this.paginationInfo?`${null!==(i=this.paginationInfo.firstRecord)&&void 0!==i?i:0} - ${null!==(t=this.paginationInfo.lastRecord)&&void 0!==t?t:0}`:"0-0"}getPaginationCount(){var i;if(!this.paginationInfo||!this.dataUnit)return"0-0";const t=(null!==(i=this.paginationInfo.currentPage)&&void 0!==i?i:0)+1;let a=this.getTotalPages();return this.i18n("ez-grid-pagination.pageCounter",{currentPage:t,totalPages:a})}getTotalPages(){var i;return void 0!==this.paginationInfo.total?Math.ceil(this.paginationInfo.total/this.dataUnit.pageSize):Math.ceil((null!==(i=this.paginationInfo.count)&&void 0!==i?i:0)/this.dataUnit.pageSize)}handlePageChange(i){this.setPaginationInfo(),this.setStatusButtonPagination(),this.pageChange.emit(i)}async handleCancelPagination(){var i;this.dataUnit&&(this.dataUnit.cancelPagination=!0,await(null===(i=this._cancelPaginationPopoverElement)||void 0===i?void 0:i.hide()))}handleShowCancelPagination(){var i,t,a;this.hasToShowCancelPagination()?(null===(t=this._cancelPaginationPopoverElement)||void 0===t?void 0:t.opened)||null===(a=this._cancelPaginationPopoverElement)||void 0===a||a.show("15px"):null===(i=this._cancelPaginationPopoverElement)||void 0===i||i.hide()}hasToShowCancelPagination(){return!(!this.dataUnit||!this.paginationInfo)&&(!this.dataUnit.cancelPagination&&void 0===this.paginationInfo.total&&this.paginationInfo.count>this.dataUnit.pageSize)}setPaginationInfo(){this.paginationInfo=this.dataUnit&&this.dataUnit.getPaginationInfo()||null}dataUnitObserver(i){switch(i.type){case s.PAGINATION_UPDATED:this.setPaginationInfo(),this.setStatusButtonPagination(),this.handleShowCancelPagination();break;case s.DATA_LOADED:this.setPaginationInfo()}}getLeftButtonDisabledStatus(){var i,t;return!this.dataUnit||(null!==(t=null===(i=this.paginationInfo)||void 0===i?void 0:i.currentPage)&&void 0!==t?t:0)<=0}getRightButtonDisabledStatus(){var i;return!this.dataUnit||!(null===(i=this.paginationInfo)||void 0===i?void 0:i.hasMore)}setStatusButtonPagination(){this.leftButtonDisabled=this.getLeftButtonDisabledStatus(),this.rightButtonDisabled=this.getRightButtonDisabledStatus()}initializeDataUnit(){this.dataUnit&&!this._dataUnitInitialized&&(this.setPaginationInfo(),this.setStatusButtonPagination(),this._dataUnitObserverBound=this.dataUnitObserver.bind(this),this.dataUnit.subscribe(this._dataUnitObserverBound),this._dataUnitInitialized=!0)}addInfoId(){this._element&&r.addIDInfo(this._element)}renderCancelPagination(){return a("ez-popover",{ref:i=>this._cancelPaginationPopoverElement=i,"overlay-type":"none",autoClose:!1},a("div",{class:"cancel-pagination"},a("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),a("span",{onClick:()=>this.handleCancelPagination(),class:"cancel-pagination-btn"},this.i18n("ez-grid-pagination.cancelPagination"))))}async connectedCallback(){this.i18n=await o(),this.initializeDataUnit()}componentDidLoad(){this.addInfoId()}disconnectedCallback(){this.dataUnit&&this._dataUnitInitialized&&this._dataUnitObserverBound&&this.dataUnit.unsubscribe(this._dataUnitObserverBound)}render(){return a(n,null,a("div",{id:"grid-pagination--container",class:{pagination__container:!0,"pagination-expanded":"hidden"!==this.paginationCounterMode,"pagination-contracted":"hidden"===this.paginationCounterMode,"pagination-text-right":"right"===this.paginationTextPosition}},a("div",{id:"grid-pagination--page-navigator",class:"pagination__page-navigator"},a("div",{id:"grid-pagination--row-summary-panel",class:"pagination__row-summary-panel"},a("span",{class:"pagination__label","aria-live":"polite","aria-atomic":"true",title:`${this.getActualPageLabel()} ${this.getRemainingPageLabel()}`},this.shouldPresentPaginationLabel()&&this.getActualPageLabel(),this.shouldPresentPaginationLabel()&&this.getRemainingPageLabel())),this.renderCancelPagination(),a("div",{id:"grid-pagination--page-summary-panel",class:{"pagination__page-summary-panel":!0,pagination__container:!0,"pagination-expanded":"hidden"!==this.paginationCounterMode,"pagination-contracted":"hidden"===this.paginationCounterMode,"pagination-text-right":"right"===this.paginationTextPosition}},a("div",{id:"grid-pagination--first-tooltip",class:{"pagination__buttons-container":!0,disabled:this.leftButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.firstPage")},a("ez-icon",{size:this.buttonsSize,iconName:"dual-chevron-left",onClick:()=>!this.leftButtonDisabled&&this.firstPage()}))),a("div",{id:"grid-pagination--previous-tooltip",class:{"pagination__buttons-container":!0,disabled:this.leftButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.previousPage")},a("ez-icon",{size:this.buttonsSize,iconName:"chevron-left",onClick:()=>!this.leftButtonDisabled&&this.previousPage()}))),a("div",{class:"pagination__container-label"},a("span",{class:"pagination__label","aria-live":"polite","aria-atomic":"true",title:`${this.getActualPageLabel()} ${this.getRemainingPageLabel()}`},this.shouldPresentPaginationLabel()&&this.getPaginationCount())),a("div",{id:"grid-pagination--next-tooltip",class:{"pagination__buttons-container":!0,disabled:this.rightButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.nextPage")},a("ez-icon",{size:this.buttonsSize,iconName:"chevron-right",onClick:()=>!this.rightButtonDisabled&&this.nextPage()}))),a("div",{id:"grid-pagination--last-tooltip",class:{"pagination__buttons-container":!0,disabled:this.rightButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.lastPage")},a("ez-icon",{size:this.buttonsSize,iconName:"dual-chevron-right",onClick:()=>!this.rightButtonDisabled&&this.lastPage()})))))))}get _element(){return e(this)}static get watchers(){return{dataUnit:["onDataUnitChange"]}}};h.style=":host{display:block}.pagination__container{display:flex;align-items:center;flex-grow:1;flex-shrink:1;flex-wrap:nowrap;justify-content:flex-end}.pagination__buttons-container{display:flex;border-radius:50%;background-color:var(--color--ocean-green-90, #E1E2E5);cursor:pointer}.pagination__buttons-container ez-icon{--ez-icon--color:var(--color--ocean-green-600, #008561)}.pagination__buttons-container.disabled{background-color:#DEDEDE;cursor:not-allowed;pointer-events:auto}.pagination__buttons-container.disabled ez-icon{--ez-icon--color:var(--color--petroleum-300, #848D9C);pointer-events:none}.pagination__page-navigator{display:flex;align-items:center}.pagination__row-summary-panel{font-size:var(--font-size--default, 14px);font-family:var(--font--pattern, 'Roboto');color:var(--color--petroleum-300, #848D9C);font-weight:var(--font-weight--regular, 400);padding:var(--space--8, 8px) var(--space--16, 16px)}.pagination__page-summary-panel{display:flex;align-items:center;padding:var(--space--8, 8px) var(--space--16, 16px);gap:var(--space--4, 4px)}.pagination__container-label{margin:0 var(--space--8, 8px)}.pagination-contracted{width:100px}.pagination-expanded{min-width:150px}.pagination__label{font-family:var(--font--pattern, 'Roboto');color:var(--color--petroleum-300, #848D9C);font-weight:var(--font-weight--regular, 400);width:100%;white-space:nowrap}.cancel-pagination{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--space--4, 4px);padding:var(--space--8, 8px)}.spin{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.cancel-pagination-btn{color:var(--color--red-600, #BD0025);font-size:var(--font-size--medium, 16px);font-weight:var(--font-weight--semi-bold, 600);font-family:var(--font--pattern, 'Roboto');text-wrap:nowrap;cursor:pointer}.pagination-text-right{flex-direction:row-reverse}";export{h as ez_grid_pagination}
1
+ import{r as i,c as t,h as a,H as n,g as e}from"./p-23a36bb6.js";import{i as o}from"./p-b6579f86.js";import{Action as s,ElementIDUtils as r}from"@sankhyalabs/core";const h=class{constructor(a){i(this,a),this.pageChange=t(this,"pageChange",7),this._dataUnitInitialized=!1,this.paginationInfo=void 0,this.leftButtonDisabled=void 0,this.rightButtonDisabled=void 0,this.paginationCounterMode="auto",this.dataUnit=void 0,this.paginationTextPosition="left",this.buttonsSize="large"}async previousPage(){this.dataUnit&&(await this.dataUnit.previousPage(),this.handlePageChange("previous"))}async nextPage(){this.dataUnit&&(await this.dataUnit.nextPage(),this.handlePageChange("next"))}async firstPage(){this.dataUnit&&(await this.dataUnit.gotoPage(0),this.handlePageChange("previous"))}async lastPage(){this.dataUnit&&(await this.dataUnit.gotoPage(this.getTotalPages()-1),this.handlePageChange("next"))}onDataUnitChange(){this.initializeDataUnit()}shouldPresentPaginationLabel(){return"hidden"!==this.paginationCounterMode}getRemainingPageLabel(){var i;return this.paginationInfo?`${null==this.paginationInfo.total?this.i18n("ez-grid-pagination.remainingPageLabel",{count:(null!==(i=this.paginationInfo.count)&&void 0!==i?i:0)+1}):this.i18n("ez-grid-pagination.remainingTotalLabel",{total:this.paginationInfo.total,count:this.paginationInfo.count})}`:""}getActualPageLabel(){var i,t;return this.paginationInfo?`${null!==(i=this.paginationInfo.firstRecord)&&void 0!==i?i:0} - ${null!==(t=this.paginationInfo.lastRecord)&&void 0!==t?t:0}`:"0-0"}getPaginationCount(){var i;if(!this.paginationInfo||!this.dataUnit)return"0-0";const t=(null!==(i=this.paginationInfo.currentPage)&&void 0!==i?i:0)+1;let a=this.getTotalPages();return this.i18n("ez-grid-pagination.pageCounter",{currentPage:t,totalPages:a})}getTotalPages(){var i;return void 0!==this.paginationInfo.total?Math.ceil(this.paginationInfo.total/this.dataUnit.pageSize):Math.ceil((null!==(i=this.paginationInfo.count)&&void 0!==i?i:0)/this.dataUnit.pageSize)}handlePageChange(i){this.setPaginationInfo(),this.setStatusButtonPagination(),this.pageChange.emit(i)}async handleCancelPagination(){var i;this.dataUnit&&(this.dataUnit.cancelPagination=!0,await(null===(i=this._cancelPaginationPopoverElement)||void 0===i?void 0:i.hide()))}handleShowCancelPagination(){var i,t,a;this.hasToShowCancelPagination()?(null===(t=this._cancelPaginationPopoverElement)||void 0===t?void 0:t.opened)||null===(a=this._cancelPaginationPopoverElement)||void 0===a||a.show("15px"):null===(i=this._cancelPaginationPopoverElement)||void 0===i||i.hide()}hasToShowCancelPagination(){return!(!this.dataUnit||!this.paginationInfo)&&(!this.dataUnit.cancelPagination&&void 0===this.paginationInfo.total&&this.paginationInfo.count>this.dataUnit.pageSize)}setPaginationInfo(){this.paginationInfo=this.dataUnit&&this.dataUnit.getPaginationInfo()||null}dataUnitObserver(i){switch(i.type){case s.PAGINATION_UPDATED:this.setPaginationInfo(),this.setStatusButtonPagination(),this.handleShowCancelPagination();break;case s.DATA_LOADED:this.setPaginationInfo()}}getLeftButtonDisabledStatus(){var i,t;return!this.dataUnit||(null!==(t=null===(i=this.paginationInfo)||void 0===i?void 0:i.currentPage)&&void 0!==t?t:0)<=0}getRightButtonDisabledStatus(){var i;return!this.dataUnit||!(null===(i=this.paginationInfo)||void 0===i?void 0:i.hasMore)}setStatusButtonPagination(){this.leftButtonDisabled=this.getLeftButtonDisabledStatus(),this.rightButtonDisabled=this.getRightButtonDisabledStatus()}initializeDataUnit(){this.dataUnit&&!this._dataUnitInitialized&&(this.setPaginationInfo(),this.setStatusButtonPagination(),this._dataUnitObserverBound=this.dataUnitObserver.bind(this),this.dataUnit.subscribe(this._dataUnitObserverBound),this._dataUnitInitialized=!0)}addInfoId(){this._element&&r.addIDInfo(this._element)}renderCancelPagination(){return a("ez-popover",{ref:i=>this._cancelPaginationPopoverElement=i,"overlay-type":"none",autoClose:!1},a("div",{class:"cancel-pagination"},a("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),a("span",{onClick:()=>this.handleCancelPagination(),class:"cancel-pagination-btn"},this.i18n("ez-grid-pagination.cancelPagination"))))}async connectedCallback(){this.i18n=await o(),this.initializeDataUnit()}componentDidLoad(){this.addInfoId()}disconnectedCallback(){this.dataUnit&&this._dataUnitInitialized&&this._dataUnitObserverBound&&this.dataUnit.unsubscribe(this._dataUnitObserverBound)}render(){return a(n,null,a("div",{id:"grid-pagination--container",class:{pagination__container:!0,"pagination-expanded":"hidden"!==this.paginationCounterMode,"pagination-contracted":"hidden"===this.paginationCounterMode,"pagination-text-right":"right"===this.paginationTextPosition}},a("div",{id:"grid-pagination--page-navigator",class:"pagination__page-navigator"},a("div",{id:"grid-pagination--row-summary-panel",class:"pagination__row-summary-panel"},a("span",{class:"pagination__label","aria-live":"polite","aria-atomic":"true",title:`${this.getActualPageLabel()} ${this.getRemainingPageLabel()}`},this.shouldPresentPaginationLabel()&&this.getActualPageLabel(),this.shouldPresentPaginationLabel()&&this.getRemainingPageLabel())),this.renderCancelPagination(),a("div",{id:"grid-pagination--page-summary-panel",class:{"pagination__page-summary-panel":!0,pagination__container:!0,"pagination-expanded":"hidden"!==this.paginationCounterMode,"pagination-contracted":"hidden"===this.paginationCounterMode,"pagination-text-right":"right"===this.paginationTextPosition}},a("div",{id:"grid-pagination--first-tooltip",class:{"pagination__buttons-container":!0,disabled:this.leftButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.firstPage")},a("ez-icon",{size:this.buttonsSize,iconName:"dual-chevron-left",onClick:()=>!this.leftButtonDisabled&&this.firstPage()}))),a("div",{id:"grid-pagination--previous-tooltip",class:{"pagination__buttons-container":!0,disabled:this.leftButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.previousPage")},a("ez-icon",{size:this.buttonsSize,iconName:"chevron-left",onClick:()=>!this.leftButtonDisabled&&this.previousPage()}))),a("div",{class:"pagination__container-label"},a("span",{class:"pagination__label","aria-live":"polite","aria-atomic":"true",title:`${this.getActualPageLabel()} ${this.getRemainingPageLabel()}`},this.shouldPresentPaginationLabel()&&this.getPaginationCount())),a("div",{id:"grid-pagination--next-tooltip",class:{"pagination__buttons-container":!0,disabled:this.rightButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.nextPage")},a("ez-icon",{size:this.buttonsSize,iconName:"chevron-right",onClick:()=>!this.rightButtonDisabled&&this.nextPage()}))),a("div",{id:"grid-pagination--last-tooltip",class:{"pagination__buttons-container":!0,disabled:this.rightButtonDisabled}},a("ez-tooltip",{message:this.i18n("ez-grid-pagination.lastPage")},a("ez-icon",{size:this.buttonsSize,iconName:"dual-chevron-right",onClick:()=>!this.rightButtonDisabled&&this.lastPage()})))))))}get _element(){return e(this)}static get watchers(){return{dataUnit:["onDataUnitChange"]}}};h.style=":host{display:block}.pagination__container{display:flex;align-items:center;flex-grow:1;flex-shrink:1;flex-wrap:nowrap;justify-content:flex-end}.pagination__buttons-container{display:flex;border-radius:50%;background-color:var(--color--ocean-green-90, #E1E2E5);cursor:pointer}.pagination__buttons-container ez-icon{--ez-icon--color:var(--color--ocean-green-600, #008561)}.pagination__buttons-container.disabled{background-color:#DEDEDE;cursor:not-allowed;pointer-events:auto}.pagination__buttons-container.disabled ez-icon{--ez-icon--color:var(--color--petroleum-300, #848D9C);pointer-events:none}.pagination__page-navigator{display:flex;align-items:center}.pagination__row-summary-panel{font-size:var(--font-size--default, 14px);font-family:var(--font--pattern, 'Roboto');color:var(--color--petroleum-300, #848D9C);font-weight:var(--font-weight--regular, 400);padding:var(--space--8, 8px) var(--space--16, 16px)}.pagination__page-summary-panel{display:flex;align-items:center;padding:var(--space--8, 8px) var(--space--16, 16px);gap:var(--space--4, 4px)}.pagination__container-label{margin:0 var(--space--8, 8px)}.pagination-contracted{width:100px}.pagination-expanded{min-width:150px}.pagination__label{font-family:var(--font--pattern, 'Roboto');color:var(--color--petroleum-300, #848D9C);font-weight:var(--font-weight--regular, 400);width:100%;white-space:nowrap}.cancel-pagination{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--space--4, 4px);padding:var(--space--8, 8px)}.spin{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.cancel-pagination-btn{color:var(--color--red-600, #BD0025);font-size:var(--font-size--medium, 16px);font-weight:var(--font-weight--semi-bold, 600);font-family:var(--font--pattern, 'Roboto');text-wrap:nowrap;cursor:pointer}.pagination-text-right{flex-direction:row-reverse}";export{h as ez_grid_pagination}
@@ -0,0 +1 @@
1
+ import{r as s,c as e,h as i,H as t,g as a}from"./p-23a36bb6.js";import{StringUtils as r,KeyboardManager as l,ElementIDUtils as c}from"@sankhyalabs/core";import"./p-46b0b0c7.js";import{C as o}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as n}from"./p-b6579f86.js";import{S as h}from"./p-5895e687.js";import"./p-47e4a8ce.js";const d=class{constructor(i){s(this,i),this.ezChange=e(this,"ezChange",7),this.SEARCH_DESCRIPTION_TIMEOUT=2e3,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,this._ignoreNextValue=!1,this.value=void 0,this.enabled=!0,this.disableCodeInput=!1,this.disableDescriptionInput=!1,this.label=void 0,this.hideDescriptionInput=!1,this.canShowError=!0,this.errorMessage=void 0,this.mode="regular",this.size="default",this.required=!1,this.contextProperties=void 0,this.optionLoader=void 0,this.showOptionValue=!0,this.stopPropagateEnterKeyEvent=!1,this.autoFocus=!1,this.showSelectedValue=!0,this.suppressEmptyOption=!1,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.suppressSearch=!1,this.suppressPreLoad=!0,this.ensureClearButtonVisible=!1,this.descriptionValue="",this.codeValue="",this.isLoadingDescription=!1,this.searchDescriptionIsOpen=!1,this.visibleOptions=void 0,this.showLoading=!0,this.canShowClearButton=!1,this.isHoveringDescription=!1}async observeValue(s,e){var i;if(this._ignoreNextValue)return void(this._ignoreNextValue=!1);const t=this.normalizeValueToCodeValue(s);if(t!==this.normalizeValueToCodeValue(e)){if(void 0===t)return this.clearSearch(),void this.ezChange.emit(void 0);this.canShowClearButton=this.getClearButtonStatus(),this.codeValue=t;try{if(this.descriptionValue=await this.normalizeCodeToDescriptionValue(s),null==this.descriptionValue)throw new Error("Valor não encontrado!")}catch(s){throw this._ignoreNextValue=!0,this.clearSearch(),console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",s),"WarningException"===(null===(i=null==s?void 0:s.constructor)||void 0===i?void 0:i.name)&&(this.errorMessage=s.message),s}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value),this.errorMessage=null}}async setFocus(s){var e;this.disableCodeInput?null===(e=this._textInputDescriptionValue)||void 0===e||e.setFocus(s):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(s):this._textInputCodeValue.setFocus(s)}async getValueAsync(){if(!this.isLoadingDescription){const s=this.buildCurrentValue();return new Promise((e=>e(s)))}return new Promise((s=>{let e=setInterval((()=>{if(!this.isLoadingDescription){clearInterval(e);const i=this.buildCurrentValue();s(i)}}),this.INTERVAL_TO_RETRY_ASYNC_VALUE)}))}async clearValue(){this.clearSearch()}async setBlur(){var s,e;null===(s=this._textInputCodeValue)||void 0===s||s.setBlur(),null===(e=this._textInputDescriptionValue)||void 0===e||e.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async componentWillLoad(){this.i18n=await n(),this.value&&r.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){o.applyVarsTextInput(this.el,this._textInputCodeValue),o.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this._textInputCodeValue.value=null,this.hideDescriptionInput||(this._textInputDescriptionValue.value=null),this.value=null,this.codeValue=null,this.descriptionValue=null,this.canShowClearButton=!1}async normalizeCodeToDescriptionValue(s){if(!s)return"";if("string"==typeof s)try{if((null==(s=JSON.parse(s))?void 0:s.value)&&!(null==s?void 0:s.label))return await this.loadDescriptionValueByCode(null==s?void 0:s.value)}catch(e){return await this.loadDescriptionValueByCode(s)}return"object"!=typeof s?await this.loadDescriptionValueByCode(s):null==s?void 0:s.label}normalizeValueToCodeValue(s){if(s){if("string"==typeof s)try{s=JSON.parse(s)}catch(e){return s}return"object"!=typeof s?"number"==typeof s?String(s):s:null==s?void 0:s.value}}async loadDescriptionValueByCode(s){if(!this.optionLoader)return console.warn(this.i18n("ez-classic-search-plus.optionLoaderNotDefined")),"";try{this.isLoadingDescription=!0;const e={mode:h.LOAD_DESCRIPTION,argument:s},i=await this.optionLoader(e);return i?Array.isArray(i)?i[0].label:i.label:""}finally{this.isLoadingDescription=!1}}handleCodeInputFocusOut(){this.cancelSelection(),this.codeValue!=this._textInputCodeValue.value&&(this.value=this._textInputCodeValue.value)}handleSearchClick(){this.loadAdvancedSearch()}async loadAdvancedSearch(){if(!this.optionLoader)return void console.warn(this.i18n("ez-classic-search-plus.optionLoaderNotDefined"));const s={mode:h.ADVANCED,argument:""};let e;try{e=await this.optionLoader(s,this.contextProperties)}catch(s){}e&&(this.value=e)}buildCurrentValue(){if(!r.isEmpty(this.codeValue))return{value:this.codeValue,label:this.descriptionValue}}async handleTextInputChangeHandler(s){this.searchDescriptionIsOpen||this._popover.showUnder(this.el);const e=s.target.value;this.canShowClearButton=this.getClearButtonStatus(),await this.debounceLoaderOptions(e)}async debounceLoaderOptions(s){return this._debounceSearch&&clearTimeout(this._debounceSearch),new Promise((e=>{this._debounceSearch=setTimeout((async()=>{await this.processOptionsLoader(s),e()}),this.SEARCH_DESCRIPTION_TIMEOUT)}))}updateKeyOption(s){return Object.assign(Object.assign({},s),{presentationValue:s.value,presentationLabel:s.label})}parseSearchOptions(s=[]){if(Array.isArray(s)){const e=s[0];return e?"label"in e||"value"in e?s.map((s=>this.updateKeyOption(s))):s:[]}return("label"in s||"value"in s)&&this.updateKeyOption(s),[s]}async processOptionsLoader(s){try{this.showLoading=!0;const e={mode:h.PREDICTIVE,argument:s},i=await this.optionLoader(e);this.visibleOptions=this.parseSearchOptions(i)}finally{this.showLoading=!1}}handleSelectItem(s){this.value=s.detail,this._popover.hide(),window.requestAnimationFrame((()=>{var s;null===(s=this._textInputDescriptionValue)||void 0===s||s.setFocus({selectText:!0})}))}async handleArrowUp(){this.isOptionsVisible()&&await this._classicSearchList.previousOption()}async handleArrowDown(){this.isOptionsVisible()&&await this._classicSearchList.nextOption()}async selectCurrentItem(){var s;await(null===(s=this._classicSearchList)||void 0===s?void 0:s.selectCurrentItem())}async cancelSelection(){var s,e,i;const t="object"==typeof this.value?null===(s=this.value)||void 0===s?void 0:s.label:"";this._textInputDescriptionValue&&t&&this._textInputDescriptionValue.value!=t&&(this._textInputDescriptionValue.value=t),await(null===(e=this._classicSearchList)||void 0===e?void 0:e.cancelSelection()),null===(i=this._popover)||void 0===i||i.hide()}async handleInputTab(){await this.cancelSelection()}async handleInputEsc(){var s;await this.cancelSelection(),await(null===(s=this._latestFocusedInputElement)||void 0===s?void 0:s.setFocus({selectText:!0}))}async initKeyboardManager(){this._keyboardManager=new l;const s={element:this.el,propagate:!0};this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),Object.assign(Object.assign({},s),{propagate:!1})).bind("ArrowDown",(()=>this.handleArrowDown()),Object.assign(Object.assign({},s),{propagate:!1})).bind("Enter",(()=>this.selectCurrentItem()),Object.assign(Object.assign({},s),{propagate:!this.stopPropagateEnterKeyEvent})).bind("Tab",(()=>this.handleInputTab()),s).bind("Escape",(()=>this.handleInputEsc()),s)}disconnectedCallback(){this._keyboardManager.unbind("ArrowUp").unbind("ArrowDown").unbind("Enter").unbind("Tab").unbind("Escape")}isOptionsVisible(){return this._popover.opened}setLatestFocusedInputElement(s){this._latestFocusedInputElement=s}handleCodeInputFocus(){this.setLatestFocusedInputElement(this._textInputCodeValue)}handleDescriptionInputFocus(){this.setLatestFocusedInputElement(this._textInputDescriptionValue)}handleOnEzVisibilityChange(s){s.stopPropagation(),this.searchDescriptionIsOpen=s.detail}getClearButtonStatus(){var s,e;return!!(this.ensureClearButtonVisible||(null===(s=this._textInputCodeValue)||void 0===s?void 0:s.value)||(null===(e=this._textInputDescriptionValue)||void 0===e?void 0:e.value)||this.value)}render(){return c.addIDInfoIfNotExists(this.el,"input"),i(t,null,i("div",{class:"ez-classic-search-plus__wrapper"},i("div",{class:"ez-classic-search-plus__label-container"},i("label",{title:this.label},this.label),this.required&&i("span",{class:"required-indicator"},"*")),i("div",{class:"ez-classic-search-plus__container"},i("ez-classic-input",{ref:s=>this._textInputCodeValue=s,class:{"ez-classic-search-plus__code-input":!this.hideDescriptionInput,"ez-classic-search-plus__code-input-no-border":!this.hideDescriptionInput,"ez-classic-search-plus__code-input-full":this.hideDescriptionInput},"data-element-id":c.getInternalIDInfo("codeInput"),"data-slave-mode":"true",enabled:!this.disableCodeInput&&this.enabled,size:this.size,label:null,errorMessage:this.hideDescriptionInput?this.errorMessage:"",value:this.codeValue,onFocusout:()=>this.handleCodeInputFocusOut(),onFocus:()=>this.handleCodeInputFocus(),leftIconName:"search",leftIconClickable:this.enabled,onIconClick:()=>this.handleSearchClick(),onEzChange:s=>s.stopPropagation(),state:this.errorMessage&&this.canShowError?"error":"default"}),!this.hideDescriptionInput&&i("div",{class:"description-input-container",onMouseEnter:()=>this.isHoveringDescription=!0,onMouseLeave:()=>this.isHoveringDescription=!1},i("ez-classic-input",{ref:s=>this._textInputDescriptionValue=s,tabIndex:-1,class:{"ez-classic-search-plus__text-input":!0},"data-element-id":c.getInternalIDInfo("textInput"),"data-slave-mode":"true",enabled:!this.disableDescriptionInput&&this.enabled,label:null,size:this.size,value:this.descriptionValue,onInput:s=>this.handleTextInputChangeHandler(s),onFocus:()=>this.handleDescriptionInputFocus(),rightIconName:this.canShowClearButton&&this.isHoveringDescription?"close":null,rightIconClickable:this.enabled,onIconClick:()=>this.clearSearch(),onEzChange:s=>s.stopPropagation(),rightIconTooltip:this.i18n("ez-classic-search-plus.clearValue"),state:this.errorMessage&&this.canShowError?"error":"default"}),i("ez-popover-plus",{ref:s=>this._popover=s,anchorElement:this.el,autoClose:!0,boxWidth:"fit-content",overlayType:"none",useAnchorSize:!0,onEzVisibilityChange:s=>this.handleOnEzVisibilityChange(s),"data-element-id":this.el.getAttribute("data-element-id")},i("ez-classic-search-result-list",{ref:s=>this._classicSearchList=s,showLoading:this.showLoading,visibleOptions:this.visibleOptions,value:this.value,showOptionValue:this.showOptionValue,onChangeValue:s=>this.handleSelectItem(s)})))),i("div",{class:"ez-classic-search-plus__error-container"},i("span",null,this.errorMessage))))}get el(){return a(this)}static get watchers(){return{value:["observeValue"]}}};d.style=":host{--ez-classic-search--height:42px;--ez-classic-search--width:100%;--ez-classic-search__icon--width:48px;--ez-classic-search--border-radius:var(--border--radius-medium, 12px);--ez-classic-search--border-radius-small:var(--border--radius-small, 6px);--ez-classic-search--font-size:var(--text--medium, 14px);--ez-classic-search--font-family:var(--font-pattern, Arial);--ez-classic-search--font-weight--large:var(--text-weight--large, 500);--ez-classic-search--font-weight--medium:var(--text-weight--medium, 400);--ez-classic-search--background-color--xlight:var(--background--xlight, #fff);--ez-classic-search--background-medium:var(--background--medium, #f0f3f7);--ez-classic-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-classic-search__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-search__input--border:var(--border--medium, 2px solid);--ez-classic-search__input--border-color:var(--ez-classic-search__input--background-color);--ez-classic-search__input--focus--border-color:var(--color--primary, #008561);--ez-classic-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-classic-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-classic-search__input--error--border-color:#CC2936;--ez-classic-search__btn--color:var(--title--primary, #2B3A54);--ez-classic-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-classic-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-classic-search__label--color:var(--title--primary, #2B3A54);--ez-classic-search__list-title--primary:var(--title--primary, #2B3A54);--ez-classic-search__list-text--primary:var(--text--primary, #626e82);--ez-classic-search__list-height:calc(var(--ez-classic-search--font-size) + var(--ez-classic-search--space--medium) + 4px);--ez-classic-search__list-min-width:64px;--ez-classic-search--space--medium:var(--space--medium, 12px);--ez-classic-search--space--small:var(--space--small, 6px);--ez-classic-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-classic-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-classic-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-classic-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-classic-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-classic-search__scrollbar--width:var(--space--medium, 12px);--ez-classic-input--helptext-color:var(--color--ocean-green-1000, #00281D);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-classic-search--width);font-family:var(--font--pattern, Arial, sans-serif)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-classic-input__input--border-color:var(--color--strokes, #dce0e8);--ez-classic-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-classic-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-classic-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-classic-search--background-color--xlight);border-radius:var(--ez-classic-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.list-options{margin-top:0px;box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-classic-search__scrollbar--color-clicked) var(--ez-classic-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-classic-search__scrollbar--color-background);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-classic-search__scrollbar--color-default);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-classic-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-classic-search__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-classic-search--border-radius-small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size);line-height:var(--ez-classic-search--line-height)}.item__label{font-weight:var(--ez-classic-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-classic-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-classic-search__list-text--primary);font-weight:var(--ez-classic-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-classic-search__list-height)}.message__no-result{color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-classic-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-classic-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-classic-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-classic-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-classic-search__btn-disabled--color)}.btn:hover{color:var(--ez-classic-search__btn-hover--color)}.btn__close{visibility:hidden}ez-classic-input:hover .btn__close,ez-c-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}.ez-classic-search-plus__container{display:flex;flex-grow:1;gap:3px}.ez-classic-search-plus__wrapper{display:flex;flex-direction:column;flex-grow:1;overflow:hidden}.ez-classic-search-plus__label-container{display:flex;flex-grow:1;gap:3px;overflow:hidden}.ez-classic-search-plus__label-container label{overflow:hidden;text-overflow:ellipsis;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);white-space:nowrap}.ez-classic-search-plus__text-input{--ez-classic-input--border-top-left-radius:0px;--ez-classic-input--border-bottom-left-radius:0px;outline:none}.ez-classic-search-plus__code-input-no-border{--ez-classic-input--border-top-right-radius:0px;--ez-classic-input--border-bottom-right-radius:0px}.ez-classic-search-plus__code-input{max-width:85px;--ez-classic-input--padding-inline:6px;--ez-classic-input--gap:6px}.ez-classic-search-plus__code-input-full{width:100%}.description-input-container{width:100%;outline:none}.required-indicator{font-size:var(--font--size--default, 14px);font-family:var(--font--pattern, 'Roboto');color:var(--color--red-600, #BD0025);margin-left:var(--space--4, 4px);vertical-align:top}.ez-classic-search-plus__error-container{display:flex;flex-grow:1;gap:3px;overflow:hidden}.ez-classic-search-plus__error-container span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-classic-input--helptext-color)}";export{d as ez_classic_search_plus}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as h,g as n}from"./p-e4c7eb39.js";import{StringUtils as r}from"@sankhyalabs/core";var e=function(t,i){return Number(t.slice(0,-1*i.length))},o=function(t){return t.endsWith("px")?{value:t,type:"px",numeric:e(t,"px")}:t.endsWith("fr")?{value:t,type:"fr",numeric:e(t,"fr")}:t.endsWith("%")?{value:t,type:"%",numeric:e(t,"%")}:"auto"===t?{value:t,type:"auto"}:null},u=function(t){return t.split(" ").map(o)},c=function(t,i,s){return i.concat(s).map((function(i){return i.style[t]})).filter((function(t){return void 0!==t&&""!==t}))},a=function(t){for(var i=0;i<t.length;i++)if(t[i].numeric>0)return i;return null},l=function(){return!1},d=function(t,i,s){t.style[i]=s},f=function(t,i,s){var h=t[i];return void 0!==h?h:s};function m(t){var i;return(i=[]).concat.apply(i,Array.from(t.ownerDocument.styleSheets).map((function(t){var i=[];try{i=Array.from(t.cssRules||[])}catch(t){}return i}))).filter((function(i){var s=!1;try{s=t.matches(i.selectorText)}catch(t){}return s}))}var w=function(t,i,s){this.direction=t,this.element=i.element,this.track=i.track,"column"===t?(this.gridTemplateProp="grid-template-columns",this.gridGapProp="grid-column-gap",this.cursor=f(s,"columnCursor",f(s,"cursor","col-resize")),this.snapOffset=f(s,"columnSnapOffset",f(s,"snapOffset",30)),this.dragInterval=f(s,"columnDragInterval",f(s,"dragInterval",1)),this.clientAxis="clientX",this.optionStyle=f(s,"gridTemplateColumns")):"row"===t&&(this.gridTemplateProp="grid-template-rows",this.gridGapProp="grid-row-gap",this.cursor=f(s,"rowCursor",f(s,"cursor","row-resize")),this.snapOffset=f(s,"rowSnapOffset",f(s,"snapOffset",30)),this.dragInterval=f(s,"rowDragInterval",f(s,"dragInterval",1)),this.clientAxis="clientY",this.optionStyle=f(s,"gridTemplateRows")),this.onDragStart=f(s,"onDragStart",l),this.onDragEnd=f(s,"onDragEnd",l),this.onDrag=f(s,"onDrag",l),this.writeStyle=f(s,"writeStyle",d),this.startDragging=this.startDragging.bind(this),this.stopDragging=this.stopDragging.bind(this),this.drag=this.drag.bind(this),this.minSizeStart=i.minSizeStart,this.minSizeEnd=i.minSizeEnd,i.element&&(this.element.addEventListener("mousedown",this.startDragging),this.element.addEventListener("touchstart",this.startDragging))};w.prototype.getDimensions=function(){var t=this.grid.getBoundingClientRect(),i=t.width,s=t.height,h=t.bottom,n=t.left,r=t.right;"column"===this.direction?(this.start=t.top,this.end=h,this.size=s):"row"===this.direction&&(this.start=n,this.end=r,this.size=i)},w.prototype.getSizeAtTrack=function(t,i){return function(t,i,s,h){return void 0===s&&(s=0),void 0===h&&(h=!1),i.slice(0,h?t+1:t).reduce((function(t,i){return t+i.numeric}),0)+(s?t*s:0)}(t,this.computedPixels,this.computedGapPixels,i)},w.prototype.getSizeOfTrack=function(t){return this.computedPixels[t].numeric},w.prototype.getRawTracks=function(){var t=c(this.gridTemplateProp,[this.grid],m(this.grid));if(!t.length){if(this.optionStyle)return this.optionStyle;throw Error("Unable to determine grid template tracks from styles.")}return t[0]},w.prototype.getGap=function(){var t=c(this.gridGapProp,[this.grid],m(this.grid));return t.length?t[0]:null},w.prototype.getRawComputedTracks=function(){return window.getComputedStyle(this.grid)[this.gridTemplateProp]},w.prototype.getRawComputedGap=function(){return window.getComputedStyle(this.grid)[this.gridGapProp]},w.prototype.setTracks=function(t){this.tracks=t.split(" "),this.trackValues=u(t)},w.prototype.setComputedTracks=function(t){this.computedTracks=t.split(" "),this.computedPixels=u(t)},w.prototype.setGap=function(t){this.gap=t},w.prototype.setComputedGap=function(t){var i;this.computedGap=t,this.computedGapPixels=((i=this.computedGap).endsWith("px")?Number(i.slice(0,-1*"px".length)):null)||0},w.prototype.getMousePosition=function(t){return"touches"in t?t.touches[0][this.clientAxis]:t[this.clientAxis]},w.prototype.startDragging=function(t){if(!("button"in t)||0===t.button){t.preventDefault(),this.grid=this.element?this.element.parentNode:t.target.parentNode,this.getDimensions(),this.setTracks(this.getRawTracks()),this.setComputedTracks(this.getRawComputedTracks()),this.setGap(this.getGap()),this.setComputedGap(this.getRawComputedGap());var i=this.trackValues.filter((function(t){return"%"===t.type})),s=this.trackValues.filter((function(t){return"fr"===t.type}));if(this.totalFrs=s.length,this.totalFrs){var h=a(s);null!==h&&(this.frToPixels=this.computedPixels[h].numeric/s[h].numeric)}if(i.length){var n=a(i);null!==n&&(this.percentageToPixels=this.computedPixels[n].numeric/i[n].numeric)}var r=this.getSizeAtTrack(this.track,!1)+this.start;if(this.dragStartOffset=this.getMousePosition(t)-r,this.aTrack=this.track-1,!(this.track<this.tracks.length-1))throw Error("Invalid track index: "+this.track+". Track must be between two other tracks and only "+this.tracks.length+" tracks were found.");this.bTrack=this.track+1,this.aTrackStart=this.getSizeAtTrack(this.aTrack,!1)+this.start,this.bTrackEnd=this.getSizeAtTrack(this.bTrack,!0)+this.start,this.dragging=!0,window.addEventListener("mouseup",this.stopDragging),window.addEventListener("touchend",this.stopDragging),window.addEventListener("touchcancel",this.stopDragging),window.addEventListener("mousemove",this.drag),window.addEventListener("touchmove",this.drag),this.grid.addEventListener("selectstart",l),this.grid.addEventListener("dragstart",l),this.grid.style.userSelect="none",this.grid.style.webkitUserSelect="none",this.grid.style.MozUserSelect="none",this.grid.style.pointerEvents="none",this.grid.style.cursor=this.cursor,window.document.body.style.cursor=this.cursor,this.onDragStart(this.direction,this.track)}},w.prototype.stopDragging=function(){this.dragging=!1,this.cleanup(),this.onDragEnd(this.direction,this.track),this.needsDestroy&&(this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),this.destroyCb(),this.needsDestroy=!1,this.destroyCb=null)},w.prototype.drag=function(t){var i=this.getMousePosition(t),s=this.getSizeOfTrack(this.track),h=this.aTrackStart+this.minSizeStart+this.dragStartOffset+this.computedGapPixels,n=this.bTrackEnd-this.minSizeEnd-this.computedGapPixels-(s-this.dragStartOffset);i<h+this.snapOffset&&(i=h),i>n-this.snapOffset&&(i=n),i<h?i=h:i>n&&(i=n);var r=i-this.aTrackStart-this.dragStartOffset-this.computedGapPixels,e=this.bTrackEnd-i+this.dragStartOffset-s-this.computedGapPixels;if(this.dragInterval>1){var o=Math.round(r/this.dragInterval)*this.dragInterval;e-=o-r,r=o}r<this.minSizeStart&&(r=this.minSizeStart),e<this.minSizeEnd&&(e=this.minSizeEnd),"px"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=r+"px":"fr"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=1===this.totalFrs?"1fr":r/this.frToPixels+"fr":"%"===this.trackValues[this.aTrack].type&&(this.tracks[this.aTrack]=r/this.percentageToPixels+"%"),"px"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=e+"px":"fr"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=1===this.totalFrs?"1fr":e/this.frToPixels+"fr":"%"===this.trackValues[this.bTrack].type&&(this.tracks[this.bTrack]=e/this.percentageToPixels+"%");var u=this.tracks.join(" ");this.writeStyle(this.grid,this.gridTemplateProp,u),this.onDrag(this.direction,this.track,u)},w.prototype.cleanup=function(){window.removeEventListener("mouseup",this.stopDragging),window.removeEventListener("touchend",this.stopDragging),window.removeEventListener("touchcancel",this.stopDragging),window.removeEventListener("mousemove",this.drag),window.removeEventListener("touchmove",this.drag),this.grid&&(this.grid.removeEventListener("selectstart",l),this.grid.removeEventListener("dragstart",l),this.grid.style.userSelect="",this.grid.style.webkitUserSelect="",this.grid.style.MozUserSelect="",this.grid.style.pointerEvents="",this.grid.style.cursor=""),window.document.body.style.cursor=""},w.prototype.destroy=function(t,i){void 0===t&&(t=!0),t||!1===this.dragging?(this.cleanup(),this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),i&&i()):(this.needsDestroy=!0,i&&(this.destroyCb=i))};var v=function(t,i,s){return i in t?t[i]:s},p=function(t,i){return function(s){if(s.track<1)throw Error("Invalid track index: "+s.track+". Track must be between two other tracks.");var h="column"===t?i.columnMinSizes||{}:i.rowMinSizes||{},n="column"===t?"columnMinSize":"rowMinSize";return new w(t,Object.assign({},{minSizeStart:v(h,s.track-1,f(i,n,f(i,"minSize",0))),minSizeEnd:v(h,s.track+1,f(i,n,f(i,"minSize",0)))},s),i)}},g=function(t){var i=this;this.columnGutters={},this.rowGutters={},this.options=Object.assign({},{columnGutters:t.columnGutters||[],rowGutters:t.rowGutters||[],columnMinSizes:t.columnMinSizes||{},rowMinSizes:t.rowMinSizes||{}},t),this.options.columnGutters.forEach((function(t){i.columnGutters[t.track]=p("column",i.options)(t)})),this.options.rowGutters.forEach((function(t){i.rowGutters[t.track]=p("row",i.options)(t)}))};g.prototype.addColumnGutter=function(t,i){this.columnGutters[i]&&this.columnGutters[i].destroy(),this.columnGutters[i]=p("column",this.options)({element:t,track:i})},g.prototype.addRowGutter=function(t,i){this.rowGutters[i]&&this.rowGutters[i].destroy(),this.rowGutters[i]=p("row",this.options)({element:t,track:i})},g.prototype.removeColumnGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.columnGutters[t]&&this.columnGutters[t].destroy(i,(function(){delete s.columnGutters[t]}))},g.prototype.removeRowGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.rowGutters[t]&&this.rowGutters[t].destroy(i,(function(){delete s.rowGutters[t]}))},g.prototype.handleDragStart=function(t,i,s){"column"===i?(this.columnGutters[s]&&this.columnGutters[s].destroy(),this.columnGutters[s]=p("column",this.options)({track:s}),this.columnGutters[s].startDragging(t)):"row"===i&&(this.rowGutters[s]&&this.rowGutters[s].destroy(),this.rowGutters[s]=p("row",this.options)({track:s}),this.rowGutters[s].startDragging(t))},g.prototype.destroy=function(t){var i=this;void 0===t&&(t=!0),Object.keys(this.columnGutters).forEach((function(s){return i.columnGutters[s].destroy(t,(function(){delete i.columnGutters[s]}))})),Object.keys(this.rowGutters).forEach((function(s){return i.rowGutters[s].destroy(t,(function(){delete i.rowGutters[s]}))}))};const b=class{constructor(s){t(this,s),this.resizeEnd=i(this,"resizeEnd",7),this._items=[],this._buildInProgress=!1,this.direction="column",this.anchorToExpand=!1,this.structural=!1}rebuildLayout(){Array.from(this._element.querySelectorAll(".ez-split-gutter")).reverse().forEach((t=>{t.remove()})),Array.from(this._element.getElementsByTagName("EzSplitPanel")).reverse().forEach((t=>{t.rebuildLayout()})),this.buildItems(),this.initSplit()}buildItems(){this._panelID=r.generateUUID(),this._element.dataset.panelId=this._panelID,this._element.dataset.uniqueId="EzSplitPanel";let t=Array.from(this._element.children);this._items=t.filter((t=>{var i;return"EZ-SPLIT-ITEM"===(null===(i=t.tagName)||void 0===i?void 0:i.toUpperCase())}));let i=1;this._items.forEach(((t,s)=>{t.dataset.trackNumber=i.toString(),this._items.length>1&&s!=this._items.length-1&&this.addItemGutter(t),i+=2}))}componentDidLoad(){this.buildItems(),this.initSplit(),this._mutationObserver=new MutationObserver((t=>{for(const i of t)if("childList"===i.type&&!this._buildInProgress){this._buildInProgress=!0,window.requestAnimationFrame((()=>{this.rebuildLayout()})),window.requestAnimationFrame((()=>this._buildInProgress=!1));break}})),this._mutationObserver.observe(this._element,{childList:!0,subtree:!1})}disconnectedCallback(){null!=this._mutationObserver&&this._mutationObserver.disconnect()}initSplit(){var t;this._items.length&&(this._element.style["row"===this.direction?"grid-template-rows":"grid-template-columns"]=this.getGridTemplate(),this.removeGuttersMargin(),t=this.getGutters(),new g(t))}handlePanelDragEnd(){const t=this._items.map((t=>({id:t.id,height:t.clientHeight,width:t.clientWidth})));this.resizeEnd.emit({panelId:this._element.id,items:t})}getGutters(){const t={columnGutters:[],rowGutters:[],onDragEnd:()=>this.handlePanelDragEnd()};if(!this._items.length)return t;const i="row"===this.direction?"rowGutters":"columnGutters";return this._items.forEach(((s,h)=>{if(h===this._items.length-1)return;let n=s.dataset.trackNumber;h===this._items.length-1&&(n=this._items.length.toString()),t[i].push({track:Number(n),element:this._element.querySelector(`ez-split-panel[data-panel-id="${this._panelID}"] > [data-item-track="${s.dataset.trackNumber}"]`)})})),t}addItemGutter(t){const i=document.createElement("div");i.classList.add("ez-split-gutter"),i.classList.add(this.direction),i.classList.add("row"===this.direction?"ez-split-gutter__row":"ez-split-gutter__column"),i.dataset.itemTrack=`${t.dataset.trackNumber}`,i.dataset.trackNumber=(Number(t.dataset.trackNumber)+1).toString(),t.parentNode.insertBefore(i,t.nextSibling)}getElementStyle(){return{display:"grid",height:"100%",width:"100%",position:this.anchorToExpand?"relative":"unset"}}calcFreeSpacePercentage(){const t=this._items.reduce(((t,i)=>{var s;return t+((null===(s=i.size)||void 0===s?void 0:s.includes("%"))?Number(i.size.replace("%","")):0)}),0),i=this._items.filter((t=>void 0===t.size)).length;return i&&t?(100-t)/i:null}getGridTemplate(){let t="";const i=this.calcFreeSpacePercentage();return this._items.forEach(((s,h)=>{let n=s.size||"1fr";!s.size&&i&&(n=`${i}%`),t+=h!==this._items.length-1?0!==h?` ${n} 5px`:`${n} 5px`:` ${n}`})),t}removeGuttersMargin(){this._items.length<=1||("column"!=this.direction?"row"!=this.direction||this.removeGuttersMarginRow():this.removeGuttersMarginColumn())}removeGuttersMarginColumn(){this._items.forEach(((t,i)=>{0!=i?i!==this._items.length-1?(t.style.marginRight="0",t.style.marginLeft="0"):t.style.marginLeft="0":t.style.marginRight="0"}))}removeGuttersMarginRow(){this._items.length<=1||this._items.forEach(((t,i)=>{0!=i?i!==this._items.length-1?(t.style.marginBottom="0",t.style.marginTop="0"):t.style.marginTop="0":t.style.marginBottom="0"}))}render(){return s(h,{class:this.structural?"structural__panel":"content__panel",style:this.getElementStyle()})}get _element(){return n(this)}};b.style=".ez-split-gutter{cursor:grab;background-color:transparent;max-width:100%}.ez-split-gutter__row{cursor:ns-resize}.ez-split-gutter__column{cursor:ew-resize}.structural__panel{background:none;box-shadow:none;outline:none;padding:0;margin:0;border:0}";export{b as ez_split_panel}
1
+ import{r as t,c as i,h as s,H as h,g as n}from"./p-23a36bb6.js";import{StringUtils as r}from"@sankhyalabs/core";var e=function(t,i){return Number(t.slice(0,-1*i.length))},o=function(t){return t.endsWith("px")?{value:t,type:"px",numeric:e(t,"px")}:t.endsWith("fr")?{value:t,type:"fr",numeric:e(t,"fr")}:t.endsWith("%")?{value:t,type:"%",numeric:e(t,"%")}:"auto"===t?{value:t,type:"auto"}:null},u=function(t){return t.split(" ").map(o)},c=function(t,i,s){return i.concat(s).map((function(i){return i.style[t]})).filter((function(t){return void 0!==t&&""!==t}))},a=function(t){for(var i=0;i<t.length;i++)if(t[i].numeric>0)return i;return null},l=function(){return!1},d=function(t,i,s){t.style[i]=s},f=function(t,i,s){var h=t[i];return void 0!==h?h:s};function m(t){var i;return(i=[]).concat.apply(i,Array.from(t.ownerDocument.styleSheets).map((function(t){var i=[];try{i=Array.from(t.cssRules||[])}catch(t){}return i}))).filter((function(i){var s=!1;try{s=t.matches(i.selectorText)}catch(t){}return s}))}var w=function(t,i,s){this.direction=t,this.element=i.element,this.track=i.track,"column"===t?(this.gridTemplateProp="grid-template-columns",this.gridGapProp="grid-column-gap",this.cursor=f(s,"columnCursor",f(s,"cursor","col-resize")),this.snapOffset=f(s,"columnSnapOffset",f(s,"snapOffset",30)),this.dragInterval=f(s,"columnDragInterval",f(s,"dragInterval",1)),this.clientAxis="clientX",this.optionStyle=f(s,"gridTemplateColumns")):"row"===t&&(this.gridTemplateProp="grid-template-rows",this.gridGapProp="grid-row-gap",this.cursor=f(s,"rowCursor",f(s,"cursor","row-resize")),this.snapOffset=f(s,"rowSnapOffset",f(s,"snapOffset",30)),this.dragInterval=f(s,"rowDragInterval",f(s,"dragInterval",1)),this.clientAxis="clientY",this.optionStyle=f(s,"gridTemplateRows")),this.onDragStart=f(s,"onDragStart",l),this.onDragEnd=f(s,"onDragEnd",l),this.onDrag=f(s,"onDrag",l),this.writeStyle=f(s,"writeStyle",d),this.startDragging=this.startDragging.bind(this),this.stopDragging=this.stopDragging.bind(this),this.drag=this.drag.bind(this),this.minSizeStart=i.minSizeStart,this.minSizeEnd=i.minSizeEnd,i.element&&(this.element.addEventListener("mousedown",this.startDragging),this.element.addEventListener("touchstart",this.startDragging))};w.prototype.getDimensions=function(){var t=this.grid.getBoundingClientRect(),i=t.width,s=t.height,h=t.bottom,n=t.left,r=t.right;"column"===this.direction?(this.start=t.top,this.end=h,this.size=s):"row"===this.direction&&(this.start=n,this.end=r,this.size=i)},w.prototype.getSizeAtTrack=function(t,i){return function(t,i,s,h){return void 0===s&&(s=0),void 0===h&&(h=!1),i.slice(0,h?t+1:t).reduce((function(t,i){return t+i.numeric}),0)+(s?t*s:0)}(t,this.computedPixels,this.computedGapPixels,i)},w.prototype.getSizeOfTrack=function(t){return this.computedPixels[t].numeric},w.prototype.getRawTracks=function(){var t=c(this.gridTemplateProp,[this.grid],m(this.grid));if(!t.length){if(this.optionStyle)return this.optionStyle;throw Error("Unable to determine grid template tracks from styles.")}return t[0]},w.prototype.getGap=function(){var t=c(this.gridGapProp,[this.grid],m(this.grid));return t.length?t[0]:null},w.prototype.getRawComputedTracks=function(){return window.getComputedStyle(this.grid)[this.gridTemplateProp]},w.prototype.getRawComputedGap=function(){return window.getComputedStyle(this.grid)[this.gridGapProp]},w.prototype.setTracks=function(t){this.tracks=t.split(" "),this.trackValues=u(t)},w.prototype.setComputedTracks=function(t){this.computedTracks=t.split(" "),this.computedPixels=u(t)},w.prototype.setGap=function(t){this.gap=t},w.prototype.setComputedGap=function(t){var i;this.computedGap=t,this.computedGapPixels=((i=this.computedGap).endsWith("px")?Number(i.slice(0,-1*"px".length)):null)||0},w.prototype.getMousePosition=function(t){return"touches"in t?t.touches[0][this.clientAxis]:t[this.clientAxis]},w.prototype.startDragging=function(t){if(!("button"in t)||0===t.button){t.preventDefault(),this.grid=this.element?this.element.parentNode:t.target.parentNode,this.getDimensions(),this.setTracks(this.getRawTracks()),this.setComputedTracks(this.getRawComputedTracks()),this.setGap(this.getGap()),this.setComputedGap(this.getRawComputedGap());var i=this.trackValues.filter((function(t){return"%"===t.type})),s=this.trackValues.filter((function(t){return"fr"===t.type}));if(this.totalFrs=s.length,this.totalFrs){var h=a(s);null!==h&&(this.frToPixels=this.computedPixels[h].numeric/s[h].numeric)}if(i.length){var n=a(i);null!==n&&(this.percentageToPixels=this.computedPixels[n].numeric/i[n].numeric)}var r=this.getSizeAtTrack(this.track,!1)+this.start;if(this.dragStartOffset=this.getMousePosition(t)-r,this.aTrack=this.track-1,!(this.track<this.tracks.length-1))throw Error("Invalid track index: "+this.track+". Track must be between two other tracks and only "+this.tracks.length+" tracks were found.");this.bTrack=this.track+1,this.aTrackStart=this.getSizeAtTrack(this.aTrack,!1)+this.start,this.bTrackEnd=this.getSizeAtTrack(this.bTrack,!0)+this.start,this.dragging=!0,window.addEventListener("mouseup",this.stopDragging),window.addEventListener("touchend",this.stopDragging),window.addEventListener("touchcancel",this.stopDragging),window.addEventListener("mousemove",this.drag),window.addEventListener("touchmove",this.drag),this.grid.addEventListener("selectstart",l),this.grid.addEventListener("dragstart",l),this.grid.style.userSelect="none",this.grid.style.webkitUserSelect="none",this.grid.style.MozUserSelect="none",this.grid.style.pointerEvents="none",this.grid.style.cursor=this.cursor,window.document.body.style.cursor=this.cursor,this.onDragStart(this.direction,this.track)}},w.prototype.stopDragging=function(){this.dragging=!1,this.cleanup(),this.onDragEnd(this.direction,this.track),this.needsDestroy&&(this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),this.destroyCb(),this.needsDestroy=!1,this.destroyCb=null)},w.prototype.drag=function(t){var i=this.getMousePosition(t),s=this.getSizeOfTrack(this.track),h=this.aTrackStart+this.minSizeStart+this.dragStartOffset+this.computedGapPixels,n=this.bTrackEnd-this.minSizeEnd-this.computedGapPixels-(s-this.dragStartOffset);i<h+this.snapOffset&&(i=h),i>n-this.snapOffset&&(i=n),i<h?i=h:i>n&&(i=n);var r=i-this.aTrackStart-this.dragStartOffset-this.computedGapPixels,e=this.bTrackEnd-i+this.dragStartOffset-s-this.computedGapPixels;if(this.dragInterval>1){var o=Math.round(r/this.dragInterval)*this.dragInterval;e-=o-r,r=o}r<this.minSizeStart&&(r=this.minSizeStart),e<this.minSizeEnd&&(e=this.minSizeEnd),"px"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=r+"px":"fr"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=1===this.totalFrs?"1fr":r/this.frToPixels+"fr":"%"===this.trackValues[this.aTrack].type&&(this.tracks[this.aTrack]=r/this.percentageToPixels+"%"),"px"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=e+"px":"fr"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=1===this.totalFrs?"1fr":e/this.frToPixels+"fr":"%"===this.trackValues[this.bTrack].type&&(this.tracks[this.bTrack]=e/this.percentageToPixels+"%");var u=this.tracks.join(" ");this.writeStyle(this.grid,this.gridTemplateProp,u),this.onDrag(this.direction,this.track,u)},w.prototype.cleanup=function(){window.removeEventListener("mouseup",this.stopDragging),window.removeEventListener("touchend",this.stopDragging),window.removeEventListener("touchcancel",this.stopDragging),window.removeEventListener("mousemove",this.drag),window.removeEventListener("touchmove",this.drag),this.grid&&(this.grid.removeEventListener("selectstart",l),this.grid.removeEventListener("dragstart",l),this.grid.style.userSelect="",this.grid.style.webkitUserSelect="",this.grid.style.MozUserSelect="",this.grid.style.pointerEvents="",this.grid.style.cursor=""),window.document.body.style.cursor=""},w.prototype.destroy=function(t,i){void 0===t&&(t=!0),t||!1===this.dragging?(this.cleanup(),this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),i&&i()):(this.needsDestroy=!0,i&&(this.destroyCb=i))};var v=function(t,i,s){return i in t?t[i]:s},p=function(t,i){return function(s){if(s.track<1)throw Error("Invalid track index: "+s.track+". Track must be between two other tracks.");var h="column"===t?i.columnMinSizes||{}:i.rowMinSizes||{},n="column"===t?"columnMinSize":"rowMinSize";return new w(t,Object.assign({},{minSizeStart:v(h,s.track-1,f(i,n,f(i,"minSize",0))),minSizeEnd:v(h,s.track+1,f(i,n,f(i,"minSize",0)))},s),i)}},g=function(t){var i=this;this.columnGutters={},this.rowGutters={},this.options=Object.assign({},{columnGutters:t.columnGutters||[],rowGutters:t.rowGutters||[],columnMinSizes:t.columnMinSizes||{},rowMinSizes:t.rowMinSizes||{}},t),this.options.columnGutters.forEach((function(t){i.columnGutters[t.track]=p("column",i.options)(t)})),this.options.rowGutters.forEach((function(t){i.rowGutters[t.track]=p("row",i.options)(t)}))};g.prototype.addColumnGutter=function(t,i){this.columnGutters[i]&&this.columnGutters[i].destroy(),this.columnGutters[i]=p("column",this.options)({element:t,track:i})},g.prototype.addRowGutter=function(t,i){this.rowGutters[i]&&this.rowGutters[i].destroy(),this.rowGutters[i]=p("row",this.options)({element:t,track:i})},g.prototype.removeColumnGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.columnGutters[t]&&this.columnGutters[t].destroy(i,(function(){delete s.columnGutters[t]}))},g.prototype.removeRowGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.rowGutters[t]&&this.rowGutters[t].destroy(i,(function(){delete s.rowGutters[t]}))},g.prototype.handleDragStart=function(t,i,s){"column"===i?(this.columnGutters[s]&&this.columnGutters[s].destroy(),this.columnGutters[s]=p("column",this.options)({track:s}),this.columnGutters[s].startDragging(t)):"row"===i&&(this.rowGutters[s]&&this.rowGutters[s].destroy(),this.rowGutters[s]=p("row",this.options)({track:s}),this.rowGutters[s].startDragging(t))},g.prototype.destroy=function(t){var i=this;void 0===t&&(t=!0),Object.keys(this.columnGutters).forEach((function(s){return i.columnGutters[s].destroy(t,(function(){delete i.columnGutters[s]}))})),Object.keys(this.rowGutters).forEach((function(s){return i.rowGutters[s].destroy(t,(function(){delete i.rowGutters[s]}))}))};const b=class{constructor(s){t(this,s),this.resizeEnd=i(this,"resizeEnd",7),this._items=[],this._buildInProgress=!1,this.direction="column",this.anchorToExpand=!1,this.structural=!1}rebuildLayout(){Array.from(this._element.querySelectorAll(".ez-split-gutter")).reverse().forEach((t=>{t.remove()})),Array.from(this._element.getElementsByTagName("EzSplitPanel")).reverse().forEach((t=>{t.rebuildLayout()})),this.buildItems(),this.initSplit()}buildItems(){this._panelID=r.generateUUID(),this._element.dataset.panelId=this._panelID,this._element.dataset.uniqueId="EzSplitPanel";let t=Array.from(this._element.children);this._items=t.filter((t=>{var i;return"EZ-SPLIT-ITEM"===(null===(i=t.tagName)||void 0===i?void 0:i.toUpperCase())}));let i=1;this._items.forEach(((t,s)=>{t.dataset.trackNumber=i.toString(),this._items.length>1&&s!=this._items.length-1&&this.addItemGutter(t),i+=2}))}componentDidLoad(){this.buildItems(),this.initSplit(),this._mutationObserver=new MutationObserver((t=>{for(const i of t)if("childList"===i.type&&!this._buildInProgress){this._buildInProgress=!0,window.requestAnimationFrame((()=>{this.rebuildLayout()})),window.requestAnimationFrame((()=>this._buildInProgress=!1));break}})),this._mutationObserver.observe(this._element,{childList:!0,subtree:!1})}disconnectedCallback(){null!=this._mutationObserver&&this._mutationObserver.disconnect()}initSplit(){var t;this._items.length&&(this._element.style["row"===this.direction?"grid-template-rows":"grid-template-columns"]=this.getGridTemplate(),this.removeGuttersMargin(),t=this.getGutters(),new g(t))}handlePanelDragEnd(){const t=this._items.map((t=>({id:t.id,height:t.clientHeight,width:t.clientWidth})));this.resizeEnd.emit({panelId:this._element.id,items:t})}getGutters(){const t={columnGutters:[],rowGutters:[],onDragEnd:()=>this.handlePanelDragEnd()};if(!this._items.length)return t;const i="row"===this.direction?"rowGutters":"columnGutters";return this._items.forEach(((s,h)=>{if(h===this._items.length-1)return;let n=s.dataset.trackNumber;h===this._items.length-1&&(n=this._items.length.toString()),t[i].push({track:Number(n),element:this._element.querySelector(`ez-split-panel[data-panel-id="${this._panelID}"] > [data-item-track="${s.dataset.trackNumber}"]`)})})),t}addItemGutter(t){const i=document.createElement("div");i.classList.add("ez-split-gutter"),i.classList.add(this.direction),i.classList.add("row"===this.direction?"ez-split-gutter__row":"ez-split-gutter__column"),i.dataset.itemTrack=`${t.dataset.trackNumber}`,i.dataset.trackNumber=(Number(t.dataset.trackNumber)+1).toString(),t.parentNode.insertBefore(i,t.nextSibling)}getElementStyle(){return{display:"grid",height:"100%",width:"100%",position:this.anchorToExpand?"relative":"unset"}}calcFreeSpacePercentage(){const t=this._items.reduce(((t,i)=>{var s;return t+((null===(s=i.size)||void 0===s?void 0:s.includes("%"))?Number(i.size.replace("%","")):0)}),0),i=this._items.filter((t=>void 0===t.size)).length;return i&&t?(100-t)/i:null}getGridTemplate(){let t="";const i=this.calcFreeSpacePercentage();return this._items.forEach(((s,h)=>{let n=s.size||"1fr";!s.size&&i&&(n=`${i}%`),t+=h!==this._items.length-1?0!==h?` ${n} 5px`:`${n} 5px`:` ${n}`})),t}removeGuttersMargin(){this._items.length<=1||("column"!=this.direction?"row"!=this.direction||this.removeGuttersMarginRow():this.removeGuttersMarginColumn())}removeGuttersMarginColumn(){this._items.forEach(((t,i)=>{0!=i?i!==this._items.length-1?(t.style.marginRight="0",t.style.marginLeft="0"):t.style.marginLeft="0":t.style.marginRight="0"}))}removeGuttersMarginRow(){this._items.length<=1||this._items.forEach(((t,i)=>{0!=i?i!==this._items.length-1?(t.style.marginBottom="0",t.style.marginTop="0"):t.style.marginTop="0":t.style.marginBottom="0"}))}render(){return s(h,{class:this.structural?"structural__panel":"content__panel",style:this.getElementStyle()})}get _element(){return n(this)}};b.style=".ez-split-gutter{cursor:grab;background-color:transparent;max-width:100%}.ez-split-gutter__row{cursor:ns-resize}.ez-split-gutter__column{cursor:ew-resize}.structural__panel{background:none;box-shadow:none;outline:none;padding:0;margin:0;border:0}";export{b as ez_split_panel}
@@ -1 +1 @@
1
- import{UserInterface as t,Action as s,StringUtils as i,ApplicationContext as e,ObjectUtils as n,WaitingChangeException as a,DataUnitAction as h}from"@sankhyalabs/core";import{A as r}from"./p-24582dd6.js";import{g as o}from"./p-69344c23.js";import{h as l}from"./p-e4c7eb39.js";const c=(s,i)=>{var e,n;let a,h,{name:r,label:o,group:l}=Object.assign({},i),{readOnly:c,required:d}=Object.assign({},i);return s&&(o=o||s.label,r=r||s.name,d=null!==(e=s.required)&&void 0!==e?e:null==i?void 0:i.required,c=null!==(n=s.readOnly)&&void 0!==n?n:null==i?void 0:i.readOnly,a=s.properties,h=s.userInterface),{name:r,label:o,group:l,readOnly:c,required:d,props:a,userInterface:h||t.SHORTTEXT}};class d{constructor(t,s,i){this._dataUnit=t,this._validationSource=s,this._validator=i,this._i18n=o()}validate(t=!0){return new Promise(((s,i)=>{const e=this._dataUnit.getModifiedRecords();for(let s=0;s<e.length;s++){const n=e[s],a=[];let h=this.validateRequired(n);if(h&&!h.isValid&&a.push(h),this._validator&&(h=this._validator.validateRecord(n),h&&!h.isValid&&a.push(h)),a.length>0){if(!t&&a[0].invalidFields.length>0){this._validationSource.markAsInvalid(a[0].invalidFields[0],n.__record__id__),i();break}this.processValidationResult(a,n.__record__id__),i();break}}return s()}))}validateRequired(t){const s=this._validationSource.getRequiredFields(),i=[];if(new Set(s).forEach((s=>{const e=t[s];if(null==e||""===e){const e=this._validationSource.getMessageForField(s,t.__record__id__);i.push(e?{name:s,message:e}:{name:s,message:this._i18n("utils.requiredField")})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:this._i18n("utils.requiredFieldMessage")}}processValidationResult(t,s){t.forEach((t=>{const i=t.invalidFields;if(this._dataUnit.savingCanceled(i,s),i&&i.forEach((t=>{this.markAsInvalid(t,s)})),t.infoMessage&&r.info(t.infoMessage),t.errorMessage){const{errorTitle:s,errorMessage:i}=t;r.error(s,i)}}))}markAsInvalid(t,s){this._dataUnit.setInvalidField(t.name,t.message,s),this._validationSource.markAsInvalid(t,s)}}class u{constructor(t){this.onDataUnitEvent=t=>{var i;switch(t.type){case s.MULTIPLE_EDITION_CHANGED:this.clearInvalid(),this.updateAllFieldsValues();break;case s.DATA_LOADED:case s.DATA_SAVED:case s.RECORDS_REMOVED:case s.RECORDS_ADDED:case s.RECORDS_COPIED:case s.EDITION_CANCELED:case s.SELECTION_CHANGED:case s.NEXT_SELECTED:case s.PREVIOUS_SELECTED:this.clearInvalid();case s.DATA_CHANGED:case s.CHANGE_UNDONE:case s.CHANGE_REDONE:case s.RECORD_LOADED:this.updateAllFieldsValues(),this.clearFieldError(Object.keys(t.payload)[0]);break;case s.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._uuid=i.generateUUID(),this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this),this.setContextDataBinder(t)}get dataBinderId(){return this._uuid}setContextDataBinder(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,i=[...s.get(t.dataUnitId)||[],this];s.set(t.dataUnitId,i),e.setContextValue("__DATABINDER_BY_DATAUNIT__",s)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const s=this.getDefaultValues();s&&Object.keys(s).forEach((i=>{this._dataUnit.setFieldValue(i,s[i],t)}))}}bind(t,s,i,e){t.forEach((t=>{const{fieldName:i,contextName:e}=t.dataset;null!=e&&e!==s||this.updateBind(i,t)})),this._formMetadata=i,this._recordValidatorProcessor=new d(this._dataUnit,{getRequiredFields:()=>this.getFormRequiredFields(),markAsInvalid:t=>this.markInvalid(t),getMessageForField:t=>this.getErrorMessage(t)},e)}getFormRequiredFields(){return this._formMetadata.getRequiredFields()}disconnectDataUnit(){const t=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,s=t.get(this._dataUnit.dataUnitId).filter((t=>t.dataBinderId!==this.dataBinderId));t.set(this._dataUnit.dataUnitId,s),e.setContextValue("__DATABINDER_BY_DATAUNIT__",t)}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this),this.disconnectDataUnit()}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._fields.has(t.name)){const s=this._fields.get(t.name).field;this.updateErrorMessage(t.name,s,t.message)}}setFocus(t){if(!this._fields.has(t))return;const s=this._fields.get(t).field;"function"==typeof s.setFocus&&s.setFocus()}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}clearFieldError(t){var s;const i=null===(s=this._fields.get(t))||void 0===s?void 0:s.field;i&&i.errorMessage&&(i.errorMessage="",this._dataUnit.clearInvalid(this.getCurrentRecordId(),t))}updateFieldValue(t,s){const i=this._fields.get(t);try{i&&(i.listen=!1),this._dataUnit.isMultipleEdition&&this.hasMultipleValuesBetweenRecords(t)?(s.value=void 0,s.alternativePlaceholder="Múltiplos Valores"):(s.value=this._dataUnit.getFieldValue(t),s.alternativePlaceholder=void 0),this.updateErrorMessage(t,s)}finally{i&&(i.listen=!0)}}hasMultipleValuesBetweenRecords(t){var s,i;const e=null!==(i=null===(s=this._dataUnit.getSelectionInfo())||void 0===s?void 0:s.records)&&void 0!==i?i:[];if(e.length<=1)return!1;const a=e[0][t];return!e.every((s=>n.equals(s[t],a)))}validate(){return this._recordValidatorProcessor.validate()}static async validateByDataunit(t){try{const s=this.getDataBindersByDataUnit(t);return await Promise.all(s.map((t=>t.validate()))),!0}catch(t){return!1}}static getDataBindersByDataUnit(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__");return(null==s?void 0:s.get(t.dataUnitId))||[]}updateErrorMessage(t,s,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),s.errorMessage||(s.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,s){const i=this._fields.get(t);i&&i.destroy(),this.bindSearchOptionsLoader(t,s),this.updateFieldValue(t,s),this.updateErrorMessage(t,s),this._fields.set(t,_.create(t,s,((t,s)=>this.changeStarted(t,s)),(t=>this.cancelWaitingChange(t)),((t,s)=>this.setFieldValue(t,s)))),this.applyEzUploadContext(t,s)}changeStarted(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!s.blocking&&null==s.promise){const i=this._fields.get(t);i&&(s.promise=new Promise(((t,s)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=s})))}this._dataUnit.startChange(t,s)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const s=this._fields.get(t);s&&s.rejectWaitingChange(new a("Change canceled",t))}}setFieldValue(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.isMultipleEdition){const i=this._dataUnit.getSelectionInfo();this._dataUnit.setFieldValue(t,s,i.recordIds)}else{const i=this._dataUnit.getSelectedRecord();this._dataUnit.setFieldValue(t,s,i?[i.__record__id__]:void 0)}if(this._dataUnit.waitingForChange(t)){const s=this._fields.get(t);s&&s.acceptWaitingChange()}}bindSearchOptionsLoader(t,s){if(("EZ-SEARCH"===s.nodeName||"EZ-CLASSIC-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-SEARCH-PLUS"===s.nodeName?"__EZUI__SEARCH__PLUS__OPTION__LOADER__":"__EZUI__SEARCH__OPTION__LOADER__");i&&(s.optionLoader=(s,e)=>i(s,t,this._dataUnit,e))}}applyEzUploadContext(t,s){var i,n;if("EZ-UPLOAD"===s.nodeName){s.urlUpload=e.getContextValue("__EZUI__UPLOAD__ADD__URL__"),s.urlDelete=e.getContextValue("__EZUI__UPLOAD__DEL__URL__");const a=this._dataUnit.getField(t),h=null===(i=a.properties)||void 0===i?void 0:i.DESTINATION;h&&(s.requestHeaders={XTRAINF:`{"destination": "${h}"}`}),s.maxFiles=(null===(n=a.properties)||void 0===n?void 0:n.MAX_FILES)||0}}updateAllFieldsValues(){var t;null===(t=this._fields)||void 0===t||t.forEach((t=>{this.updateFieldValue(t.fieldName,t.field)}))}interceptAction(t){if(t.type===s.RECORDS_COPIED){const i=this._formMetadata.getCleanOnCopyFields();if(i)return new h(s.RECORDS_COPIED,t.payload.map((t=>{const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s})))}if(t.type===s.SAVING_DATA)return new Promise((s=>{this.validate().then((()=>s(t))).catch((()=>{}))}));if(t.type===s.RECORDS_ADDED){const i=this.getDefaultValues();if(i)return new h(s.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),i))))}return t}getDefaultValues(){var t;const s=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(s){const t={};for(const i in s)t[i]=this._dataUnit.valueFromString(i,s[i]);return t}}}class _{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,s,i,e,n){const a=new _;return a.field=s,a.fieldName=t,a.startChangeListener=s=>{a.listen&&i(t,s.detail)},a.field.addEventListener(a.startChangeEventName,a.startChangeListener),a.cancelWaitingChangeListener=()=>{a.listen&&e(t)},a.field.addEventListener(a.cancelWaitingChangeEventName,a.cancelWaitingChangeListener),a.changeListener=s=>{a.listen&&n(t,s.detail)},a.field.addEventListener(a.changeEventName,a.changeListener),a}}const v="ctrl+f",A=240,p=(t,s,i)=>l("ez-search",{class:"ez-padding--medium",style:{"--ez-search--min-width":"240px"},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:s=>{window.dispatchEvent(new CustomEvent("ezCloseSplitButtonDropdown",{detail:{action:t,value:s.detail}})),requestAnimationFrame((()=>{i(s.detail)}))},ignoreLimitCharsToSearch:!0}),f=async t=>{requestAnimationFrame((async()=>{if(t){const s=t.t;if(!s)return;s.value=null,await s.setFocus()}}))};export{u as D,d as R,v as S,p as a,c as b,A as c,f}
1
+ import{UserInterface as t,Action as s,StringUtils as i,ApplicationContext as e,ObjectUtils as n,WaitingChangeException as a,DataUnitAction as h}from"@sankhyalabs/core";import{A as r}from"./p-46b0b0c7.js";import{g as o}from"./p-b6579f86.js";import{h as l}from"./p-23a36bb6.js";const c=(s,i)=>{var e,n;let a,h,{name:r,label:o,group:l}=Object.assign({},i),{readOnly:c,required:d}=Object.assign({},i);return s&&(o=o||s.label,r=r||s.name,d=null!==(e=s.required)&&void 0!==e?e:null==i?void 0:i.required,c=null!==(n=s.readOnly)&&void 0!==n?n:null==i?void 0:i.readOnly,a=s.properties,h=s.userInterface),{name:r,label:o,group:l,readOnly:c,required:d,props:a,userInterface:h||t.SHORTTEXT}};class d{constructor(t,s,i){this._dataUnit=t,this._validationSource=s,this._validator=i,this._i18n=o()}validate(t=!0){return new Promise(((s,i)=>{const e=this._dataUnit.getModifiedRecords();for(let s=0;s<e.length;s++){const n=e[s],a=[];let h=this.validateRequired(n);if(h&&!h.isValid&&a.push(h),this._validator&&(h=this._validator.validateRecord(n),h&&!h.isValid&&a.push(h)),a.length>0){if(!t&&a[0].invalidFields.length>0){this._validationSource.markAsInvalid(a[0].invalidFields[0],n.__record__id__),i();break}this.processValidationResult(a,n.__record__id__),i();break}}return s()}))}validateRequired(t){const s=this._validationSource.getRequiredFields(),i=[];if(new Set(s).forEach((s=>{const e=t[s];if(null==e||""===e){const e=this._validationSource.getMessageForField(s,t.__record__id__);i.push(e?{name:s,message:e}:{name:s,message:this._i18n("utils.requiredField")})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:this._i18n("utils.requiredFieldMessage")}}processValidationResult(t,s){t.forEach((t=>{const i=t.invalidFields;if(this._dataUnit.savingCanceled(i,s),i&&i.forEach((t=>{this.markAsInvalid(t,s)})),t.infoMessage&&r.info(t.infoMessage),t.errorMessage){const{errorTitle:s,errorMessage:i}=t;r.error(s,i)}}))}markAsInvalid(t,s){this._dataUnit.setInvalidField(t.name,t.message,s),this._validationSource.markAsInvalid(t,s)}}class u{constructor(t){this.onDataUnitEvent=t=>{var i;switch(t.type){case s.MULTIPLE_EDITION_CHANGED:this.clearInvalid(),this.updateAllFieldsValues();break;case s.DATA_LOADED:case s.DATA_SAVED:case s.RECORDS_REMOVED:case s.RECORDS_ADDED:case s.RECORDS_COPIED:case s.EDITION_CANCELED:case s.SELECTION_CHANGED:case s.NEXT_SELECTED:case s.PREVIOUS_SELECTED:this.clearInvalid();case s.DATA_CHANGED:case s.CHANGE_UNDONE:case s.CHANGE_REDONE:case s.RECORD_LOADED:this.updateAllFieldsValues(),this.clearFieldError(Object.keys(t.payload)[0]);break;case s.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._uuid=i.generateUUID(),this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this),this.setContextDataBinder(t)}get dataBinderId(){return this._uuid}setContextDataBinder(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,i=[...s.get(t.dataUnitId)||[],this];s.set(t.dataUnitId,i),e.setContextValue("__DATABINDER_BY_DATAUNIT__",s)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const s=this.getDefaultValues();s&&Object.keys(s).forEach((i=>{this._dataUnit.setFieldValue(i,s[i],t)}))}}bind(t,s,i,e){t.forEach((t=>{const{fieldName:i,contextName:e}=t.dataset;null!=e&&e!==s||this.updateBind(i,t)})),this._formMetadata=i,this._recordValidatorProcessor=new d(this._dataUnit,{getRequiredFields:()=>this.getFormRequiredFields(),markAsInvalid:t=>this.markInvalid(t),getMessageForField:t=>this.getErrorMessage(t)},e)}getFormRequiredFields(){return this._formMetadata.getRequiredFields()}disconnectDataUnit(){const t=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,s=t.get(this._dataUnit.dataUnitId).filter((t=>t.dataBinderId!==this.dataBinderId));t.set(this._dataUnit.dataUnitId,s),e.setContextValue("__DATABINDER_BY_DATAUNIT__",t)}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this),this.disconnectDataUnit()}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._fields.has(t.name)){const s=this._fields.get(t.name).field;this.updateErrorMessage(t.name,s,t.message)}}setFocus(t){if(!this._fields.has(t))return;const s=this._fields.get(t).field;"function"==typeof s.setFocus&&s.setFocus()}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}clearFieldError(t){var s;const i=null===(s=this._fields.get(t))||void 0===s?void 0:s.field;i&&i.errorMessage&&(i.errorMessage="",this._dataUnit.clearInvalid(this.getCurrentRecordId(),t))}updateFieldValue(t,s){const i=this._fields.get(t);try{i&&(i.listen=!1),this._dataUnit.isMultipleEdition&&this.hasMultipleValuesBetweenRecords(t)?(s.value=void 0,s.alternativePlaceholder="Múltiplos Valores"):(s.value=this._dataUnit.getFieldValue(t),s.alternativePlaceholder=void 0),this.updateErrorMessage(t,s)}finally{i&&(i.listen=!0)}}hasMultipleValuesBetweenRecords(t){var s,i;const e=null!==(i=null===(s=this._dataUnit.getSelectionInfo())||void 0===s?void 0:s.records)&&void 0!==i?i:[];if(e.length<=1)return!1;const a=e[0][t];return!e.every((s=>n.equals(s[t],a)))}validate(){return this._recordValidatorProcessor.validate()}static async validateByDataunit(t){try{const s=this.getDataBindersByDataUnit(t);return await Promise.all(s.map((t=>t.validate()))),!0}catch(t){return!1}}static getDataBindersByDataUnit(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__");return(null==s?void 0:s.get(t.dataUnitId))||[]}updateErrorMessage(t,s,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),s.errorMessage||(s.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,s){const i=this._fields.get(t);i&&i.destroy(),this.bindSearchOptionsLoader(t,s),this.updateFieldValue(t,s),this.updateErrorMessage(t,s),this._fields.set(t,_.create(t,s,((t,s)=>this.changeStarted(t,s)),(t=>this.cancelWaitingChange(t)),((t,s)=>this.setFieldValue(t,s)))),this.applyEzUploadContext(t,s)}changeStarted(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!s.blocking&&null==s.promise){const i=this._fields.get(t);i&&(s.promise=new Promise(((t,s)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=s})))}this._dataUnit.startChange(t,s)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const s=this._fields.get(t);s&&s.rejectWaitingChange(new a("Change canceled",t))}}setFieldValue(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.isMultipleEdition){const i=this._dataUnit.getSelectionInfo();this._dataUnit.setFieldValue(t,s,i.recordIds)}else{const i=this._dataUnit.getSelectedRecord();this._dataUnit.setFieldValue(t,s,i?[i.__record__id__]:void 0)}if(this._dataUnit.waitingForChange(t)){const s=this._fields.get(t);s&&s.acceptWaitingChange()}}bindSearchOptionsLoader(t,s){if(("EZ-SEARCH"===s.nodeName||"EZ-CLASSIC-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-SEARCH-PLUS"===s.nodeName?"__EZUI__SEARCH__PLUS__OPTION__LOADER__":"__EZUI__SEARCH__OPTION__LOADER__");i&&(s.optionLoader=(s,e)=>i(s,t,this._dataUnit,e))}}applyEzUploadContext(t,s){var i,n;if("EZ-UPLOAD"===s.nodeName){s.urlUpload=e.getContextValue("__EZUI__UPLOAD__ADD__URL__"),s.urlDelete=e.getContextValue("__EZUI__UPLOAD__DEL__URL__");const a=this._dataUnit.getField(t),h=null===(i=a.properties)||void 0===i?void 0:i.DESTINATION;h&&(s.requestHeaders={XTRAINF:`{"destination": "${h}"}`}),s.maxFiles=(null===(n=a.properties)||void 0===n?void 0:n.MAX_FILES)||0}}updateAllFieldsValues(){var t;null===(t=this._fields)||void 0===t||t.forEach((t=>{this.updateFieldValue(t.fieldName,t.field)}))}interceptAction(t){if(t.type===s.RECORDS_COPIED){const i=this._formMetadata.getCleanOnCopyFields();if(i)return new h(s.RECORDS_COPIED,t.payload.map((t=>{const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s})))}if(t.type===s.SAVING_DATA)return new Promise((s=>{this.validate().then((()=>s(t))).catch((()=>{}))}));if(t.type===s.RECORDS_ADDED){const i=this.getDefaultValues();if(i)return new h(s.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),i))))}return t}getDefaultValues(){var t;const s=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(s){const t={};for(const i in s)t[i]=this._dataUnit.valueFromString(i,s[i]);return t}}}class _{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,s,i,e,n){const a=new _;return a.field=s,a.fieldName=t,a.startChangeListener=s=>{a.listen&&i(t,s.detail)},a.field.addEventListener(a.startChangeEventName,a.startChangeListener),a.cancelWaitingChangeListener=()=>{a.listen&&e(t)},a.field.addEventListener(a.cancelWaitingChangeEventName,a.cancelWaitingChangeListener),a.changeListener=s=>{a.listen&&n(t,s.detail)},a.field.addEventListener(a.changeEventName,a.changeListener),a}}const v="ctrl+f",A=240,f=(t,s,i)=>l("ez-search",{class:"ez-padding--medium",style:{"--ez-search--min-width":"240px"},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:s=>{window.dispatchEvent(new CustomEvent("ezCloseSplitButtonDropdown",{detail:{action:t,value:s.detail}})),requestAnimationFrame((()=>{i(s.detail)}))},ignoreLimitCharsToSearch:!0}),p=async t=>{requestAnimationFrame((async()=>{if(t){const s=t.t;if(!s)return;s.value=null,await s.setFocus()}}))};export{u as D,d as R,v as S,f as a,c as b,A as c,p as f}
@@ -1 +1 @@
1
- import{r as t,c as i,h as o,H as e,g as s}from"./p-e4c7eb39.js";import{c as r,f as h,s as n}from"./p-d2601b25.js";const a=class{constructor(o){t(this,o),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(t,i){t!==i&&(t?this.openPopover():this.hidePopover())}async updatePosition(t,i){this.updateOptionPosition(t,i),await this.updatePositionPopover()}async show(t,i){this.updateOptionPosition(t,i),this.opened=!0}async showUnder(t,i){i&&(this.options=i),this.anchorElement=t,this.opened=!0}async hide(){this.opened=!1}async setOptions(t){Object.assign(this.options,t)}async setAnchorElement(t){this.anchorElement=t}parseSizePixel(t,i){return t?"string"==typeof t?Number(t.replace("px","")):null!=t?t:0:null!=i?i:0}updateOptionPosition(t,i){Object.assign(this.options,{horizontalGap:this.parseSizePixel(i,this.options.horizontalGap),verticalGap:this.parseSizePixel(t,this.options.verticalGap)})}getElement(t){return"string"==typeof t?document.getElementById(t):t}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const t of this.anchorElement){const i=this.getElement(t);if(i)return i}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const t=this.getAnchorElement();await r(t,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[h(),n({padding:5})],strategy:"fixed"}).then((({x:t,y:i,placement:o})=>{const e=o.includes("bottom")?i+this.options.verticalGap:i-this.options.verticalGap,s=o.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${e}px`,left:`${s}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){if(this._box&&this.opened){if(this._box.style.display="flex",this._box.style.visibility="hidden",this.useAnchorSize){const t=this.getAnchorElement().getBoundingClientRect().width;this._box.style.width=`${t<this.minWidth?this.minWidth:t}px`}await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible"}}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}handlePositionUpdate(){this.opened&&this.updatePositionPopover()}componentWillLoad(){window.addEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.addEventListener("resize",this.handlePositionUpdate.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.removeEventListener("resize",this.handlePositionUpdate.bind(this),!0),this._resizeObserver.disconnect()}render(){return o(e,null,o("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),o("section",{ref:t=>this._box=t,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},o("slot",null)))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};a.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);--ez-popover__box--overlay-z-index:var(--elevation--24, 24);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--ez-popover__box--overlay-z-index)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{a as ez_popover_core}
1
+ import{r as t,c as i,h as o,H as e,g as s}from"./p-23a36bb6.js";import{c as r,f as h,s as n}from"./p-d2601b25.js";const a=class{constructor(o){t(this,o),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(t,i){t!==i&&(t?this.openPopover():this.hidePopover())}async updatePosition(t,i){this.updateOptionPosition(t,i),await this.updatePositionPopover()}async show(t,i){this.updateOptionPosition(t,i),this.opened=!0}async showUnder(t,i){i&&(this.options=i),this.anchorElement=t,this.opened=!0}async hide(){this.opened=!1}async setOptions(t){Object.assign(this.options,t)}async setAnchorElement(t){this.anchorElement=t}parseSizePixel(t,i){return t?"string"==typeof t?Number(t.replace("px","")):null!=t?t:0:null!=i?i:0}updateOptionPosition(t,i){Object.assign(this.options,{horizontalGap:this.parseSizePixel(i,this.options.horizontalGap),verticalGap:this.parseSizePixel(t,this.options.verticalGap)})}getElement(t){return"string"==typeof t?document.getElementById(t):t}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const t of this.anchorElement){const i=this.getElement(t);if(i)return i}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const t=this.getAnchorElement();await r(t,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[h(),n({padding:5})],strategy:"fixed"}).then((({x:t,y:i,placement:o})=>{const e=o.includes("bottom")?i+this.options.verticalGap:i-this.options.verticalGap,s=o.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${e}px`,left:`${s}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){if(this._box&&this.opened){if(this._box.style.display="flex",this._box.style.visibility="hidden",this.useAnchorSize){const t=this.getAnchorElement().getBoundingClientRect().width;this._box.style.width=`${t<this.minWidth?this.minWidth:t}px`}await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible"}}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}handlePositionUpdate(){this.opened&&this.updatePositionPopover()}componentWillLoad(){window.addEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.addEventListener("resize",this.handlePositionUpdate.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.removeEventListener("resize",this.handlePositionUpdate.bind(this),!0),this._resizeObserver.disconnect()}render(){return o(e,null,o("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),o("section",{ref:t=>this._box=t,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},o("slot",null)))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};a.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);--ez-popover__box--overlay-z-index:var(--elevation--24, 24);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--ez-popover__box--overlay-z-index)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{a as ez_popover_core}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,F as e,H as l}from"./p-e4c7eb39.js";import{i as h}from"./p-69344c23.js";import{ArrayUtils as n}from"@sankhyalabs/core";var o;!function(t){t.DATASOURCE_RESULTS="DATASOURCE_RESULTS",t.DATASOURCE_RESULTS_EMPTY="DATASOURCE_RESULTS_EMPTY",t.DATASOURCE_INIT="DATASOURCE_INIT",t.OPTIONS_EMPTY="OPTIONS_EMPTY",t.OPTIONS="OPTIONS"}(o||(o={}));const a=class{constructor(s){t(this,s),this.changeFilteredOptions=i(this,"changeFilteredOptions",7),this.columnName=void 0,this.dataSource=void 0,this.useOptions=!1,this.options=void 0,this.isTextSearch=!1,this.filteredOptions=void 0,this.displayOptions=void 0,this.viewScenario=void 0,this.displayOptionToCheckAllItems=!0}async componentWillLoad(){this.i18n=await h()}async clearFilteredOptions(){this.setInitialScenario(),this.filteredOptions=[],this.searchInput&&await this.searchInput.clearValue(),this.filterInput&&(this.filterInput.value="")}onChangeUseOptions(){this.setInitialScenario()}onChangeOptions(){this.options&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.options)),this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.setInitialScenario()}onChangeFilteredOptions(t){this.displayOptions=this.filteredOptions,this.displayOptionToCheckAllItems=this.filteredOptions.length>1,this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.changeFilteredOptions.emit(t)}componentDidLoad(){this.onChangeOptions()}componentDidRender(){this.changeCheckAllValeuFromFilteredOptions()}ordenationByCheckStateAndAlphabetically(t){const i=[],s=[];let e;return t.forEach((t=>{null==t.value||""===t.label?e=Object.assign(Object.assign({},t),{label:this.i18n("ez-multi-selection-list.empty")}):t.check?i.push(t):s.push(t)})),(null==e?[]:[e]).concat(null==this.dataSource?n.sortAlphabetically(i):this.dataSource.sortItems(this.columnName,i)).concat(null==this.dataSource?n.sortAlphabetically(s):this.dataSource.sortItems(this.columnName,s))}changeCheckAllValeuFromFilteredOptions(){var t,i,s,e;const l=null===(t=this.filteredOptions)||void 0===t?void 0:t.every((t=>!0===t.check)),h=null===(i=this.filteredOptions)||void 0===i?void 0:i.every((t=>!1===t.check)),n=(null===(s=this.filteredOptions)||void 0===s?void 0:s.some((t=>!1===t.check)))&&(null===(e=this.filteredOptions)||void 0===e?void 0:e.some((t=>!0===t.check)))&&(!l||!h);return this.checkInput&&l?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!0)):this.checkInput&&n?(this.checkInput.indeterminate=!0,void(this.checkInput.value=!1)):this.checkInput&&h?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!1)):void 0}setInitialScenario(){if(this.useOptions)return this.viewScenario=o.OPTIONS,void this.changeCheckAllValeuFromFilteredOptions();this.viewScenario=this.options&&this.options.length>0?o.DATASOURCE_RESULTS:o.DATASOURCE_INIT}async searchWithDataSource(t,i){const{argument:s,mode:e}=t;if("PRELOAD"!==e&&i)return this.dataSource.fetchData(s,i)}async handleSearchOnDataSource(t){var i;const s=null!==(i=this.filteredOptions)&&void 0!==i?i:[];t.detail&&!s.some((i=>i.value==t.detail.value))&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...s,t.detail])),this.viewScenario=o.DATASOURCE_RESULTS,await this.searchInput.clearValue()}async handleRemoveItemFromOptions(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.filteredOptions.filter((i=>i.value!==t.value))),0===this.filteredOptions.length&&(this.viewScenario=o.DATASOURCE_INIT),this.searchInput&&await this.searchInput.clearValue()}handleSearchOnOption(t){if(t.detail)return this.displayOptions=n.applyStringFilter(t.detail,this.filteredOptions,!0),void(this.viewScenario=0===this.displayOptions.length?o.OPTIONS_EMPTY:o.OPTIONS);this.displayOptions=this.filteredOptions,this.viewScenario=o.OPTIONS}handleChangeSelectAllItems(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...this.filteredOptions.map((i=>(i.check=!!t.detail,i)))])}handleChangeSelectedItem(t){const{detail:i}=t;this.filteredOptions.find((t=>t.label===i.label)).check=i.check,this.changeFilteredOptions.emit(this.filteredOptions)}buildViewList(t){return s(e,null,this.displayOptionToCheckAllItems&&s("ez-check",{ref:t=>this.checkInput=t,label:this.i18n("ez-multi-selection-list.selectAll"),class:"multi-selection__select-all",onEzChange:this.handleChangeSelectAllItems.bind(this)}),s("ez-list",{class:"multi-selection__list",dataSource:this.displayOptions.map((t=>Object.assign(Object.assign({},t),{id:t.value}))),listMode:"check",hoverFeedback:!0,onEzCheckChange:this.handleChangeSelectedItem.bind(this),itemSlotBuilder:t?this.buildDeleteIconSlot.bind(this):null}))}buildDeleteIconSlot(t){return s("ez-icon",{style:{cursor:"pointer"},iconName:"delete",onClick:()=>this.handleRemoveItemFromOptions(t)})}buildInitViewWithDataSource(){return s("multi-selection-box-message",{message:this.i18n("ez-multi-selection-list.initMessage")})}buildViewEmptyResults(){return s("multi-selection-box-message",{message:this.i18n("ez-multi-selection-list.emptyResults")})}scenarioToDisplay(t){const i={[o.DATASOURCE_INIT]:()=>this.buildInitViewWithDataSource(),[o.DATASOURCE_RESULTS]:()=>this.buildViewList(!0),[o.DATASOURCE_RESULTS_EMPTY]:()=>this.buildViewEmptyResults(),[o.OPTIONS_EMPTY]:()=>this.buildViewEmptyResults(),[o.OPTIONS]:()=>this.buildViewList(!1)}[t];return i?i():void 0}render(){return s(l,null,s("div",{class:"multi-selection"},this.useOptions?s("ez-filter-input",{ref:t=>this.filterInput=t,label:this.i18n("ez-multi-selection-list.search"),onEzChange:this.handleSearchOnOption.bind(this)}):s("ez-search",{class:"multi-selection__input",label:this.i18n("ez-multi-selection-list.search"),ref:t=>this.searchInput=t,suppressEmptyOption:!0,showOptionValue:!1,showSelectedValue:!1,optionLoader:t=>this.searchWithDataSource(t,this.columnName),onEzChange:this.handleSearchOnDataSource.bind(this),isTextSearch:this.isTextSearch}),s("ez-scroll",{class:"multi-selection__content-options"},this.scenarioToDisplay(this.viewScenario))))}static get watchers(){return{useOptions:["onChangeUseOptions"],options:["onChangeOptions"],filteredOptions:["onChangeFilteredOptions"]}}};a.style=".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;--ez-multi-selection-default-height:322px;display:block;width:304px;height:var(--ez-multi-selection-default-height);min-height:fit-content;max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{a as ez_multi_selection_list}
1
+ import{r as t,c as i,h as s,F as e,H as l}from"./p-23a36bb6.js";import{i as h}from"./p-b6579f86.js";import{ArrayUtils as n}from"@sankhyalabs/core";var o;!function(t){t.DATASOURCE_RESULTS="DATASOURCE_RESULTS",t.DATASOURCE_RESULTS_EMPTY="DATASOURCE_RESULTS_EMPTY",t.DATASOURCE_INIT="DATASOURCE_INIT",t.OPTIONS_EMPTY="OPTIONS_EMPTY",t.OPTIONS="OPTIONS"}(o||(o={}));const a=class{constructor(s){t(this,s),this.changeFilteredOptions=i(this,"changeFilteredOptions",7),this.columnName=void 0,this.dataSource=void 0,this.useOptions=!1,this.options=void 0,this.isTextSearch=!1,this.filteredOptions=void 0,this.displayOptions=void 0,this.viewScenario=void 0,this.displayOptionToCheckAllItems=!0}async componentWillLoad(){this.i18n=await h()}async clearFilteredOptions(){this.setInitialScenario(),this.filteredOptions=[],this.searchInput&&await this.searchInput.clearValue(),this.filterInput&&(this.filterInput.value="")}onChangeUseOptions(){this.setInitialScenario()}onChangeOptions(){this.options&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.options)),this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.setInitialScenario()}onChangeFilteredOptions(t){this.displayOptions=this.filteredOptions,this.displayOptionToCheckAllItems=this.filteredOptions.length>1,this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.changeFilteredOptions.emit(t)}componentDidLoad(){this.onChangeOptions()}componentDidRender(){this.changeCheckAllValeuFromFilteredOptions()}ordenationByCheckStateAndAlphabetically(t){const i=[],s=[];let e;return t.forEach((t=>{null==t.value||""===t.label?e=Object.assign(Object.assign({},t),{label:this.i18n("ez-multi-selection-list.empty")}):t.check?i.push(t):s.push(t)})),(null==e?[]:[e]).concat(null==this.dataSource?n.sortAlphabetically(i):this.dataSource.sortItems(this.columnName,i)).concat(null==this.dataSource?n.sortAlphabetically(s):this.dataSource.sortItems(this.columnName,s))}changeCheckAllValeuFromFilteredOptions(){var t,i,s,e;const l=null===(t=this.filteredOptions)||void 0===t?void 0:t.every((t=>!0===t.check)),h=null===(i=this.filteredOptions)||void 0===i?void 0:i.every((t=>!1===t.check)),n=(null===(s=this.filteredOptions)||void 0===s?void 0:s.some((t=>!1===t.check)))&&(null===(e=this.filteredOptions)||void 0===e?void 0:e.some((t=>!0===t.check)))&&(!l||!h);return this.checkInput&&l?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!0)):this.checkInput&&n?(this.checkInput.indeterminate=!0,void(this.checkInput.value=!1)):this.checkInput&&h?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!1)):void 0}setInitialScenario(){if(this.useOptions)return this.viewScenario=o.OPTIONS,void this.changeCheckAllValeuFromFilteredOptions();this.viewScenario=this.options&&this.options.length>0?o.DATASOURCE_RESULTS:o.DATASOURCE_INIT}async searchWithDataSource(t,i){const{argument:s,mode:e}=t;if("PRELOAD"!==e&&i)return this.dataSource.fetchData(s,i)}async handleSearchOnDataSource(t){var i;const s=null!==(i=this.filteredOptions)&&void 0!==i?i:[];t.detail&&!s.some((i=>i.value==t.detail.value))&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...s,t.detail])),this.viewScenario=o.DATASOURCE_RESULTS,await this.searchInput.clearValue()}async handleRemoveItemFromOptions(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.filteredOptions.filter((i=>i.value!==t.value))),0===this.filteredOptions.length&&(this.viewScenario=o.DATASOURCE_INIT),this.searchInput&&await this.searchInput.clearValue()}handleSearchOnOption(t){if(t.detail)return this.displayOptions=n.applyStringFilter(t.detail,this.filteredOptions,!0),void(this.viewScenario=0===this.displayOptions.length?o.OPTIONS_EMPTY:o.OPTIONS);this.displayOptions=this.filteredOptions,this.viewScenario=o.OPTIONS}handleChangeSelectAllItems(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...this.filteredOptions.map((i=>(i.check=!!t.detail,i)))])}handleChangeSelectedItem(t){const{detail:i}=t;this.filteredOptions.find((t=>t.label===i.label)).check=i.check,this.changeFilteredOptions.emit(this.filteredOptions)}buildViewList(t){return s(e,null,this.displayOptionToCheckAllItems&&s("ez-check",{ref:t=>this.checkInput=t,label:this.i18n("ez-multi-selection-list.selectAll"),class:"multi-selection__select-all",onEzChange:this.handleChangeSelectAllItems.bind(this)}),s("ez-list",{class:"multi-selection__list",dataSource:this.displayOptions.map((t=>Object.assign(Object.assign({},t),{id:t.value}))),listMode:"check",hoverFeedback:!0,onEzCheckChange:this.handleChangeSelectedItem.bind(this),itemSlotBuilder:t?this.buildDeleteIconSlot.bind(this):null}))}buildDeleteIconSlot(t){return s("ez-icon",{style:{cursor:"pointer"},iconName:"delete",onClick:()=>this.handleRemoveItemFromOptions(t)})}buildInitViewWithDataSource(){return s("multi-selection-box-message",{message:this.i18n("ez-multi-selection-list.initMessage")})}buildViewEmptyResults(){return s("multi-selection-box-message",{message:this.i18n("ez-multi-selection-list.emptyResults")})}scenarioToDisplay(t){const i={[o.DATASOURCE_INIT]:()=>this.buildInitViewWithDataSource(),[o.DATASOURCE_RESULTS]:()=>this.buildViewList(!0),[o.DATASOURCE_RESULTS_EMPTY]:()=>this.buildViewEmptyResults(),[o.OPTIONS_EMPTY]:()=>this.buildViewEmptyResults(),[o.OPTIONS]:()=>this.buildViewList(!1)}[t];return i?i():void 0}render(){return s(l,null,s("div",{class:"multi-selection"},this.useOptions?s("ez-filter-input",{ref:t=>this.filterInput=t,label:this.i18n("ez-multi-selection-list.search"),onEzChange:this.handleSearchOnOption.bind(this)}):s("ez-search",{class:"multi-selection__input",label:this.i18n("ez-multi-selection-list.search"),ref:t=>this.searchInput=t,suppressEmptyOption:!0,showOptionValue:!1,showSelectedValue:!1,optionLoader:t=>this.searchWithDataSource(t,this.columnName),onEzChange:this.handleSearchOnDataSource.bind(this),isTextSearch:this.isTextSearch}),s("ez-scroll",{class:"multi-selection__content-options"},this.scenarioToDisplay(this.viewScenario))))}static get watchers(){return{useOptions:["onChangeUseOptions"],options:["onChangeOptions"],filteredOptions:["onChangeFilteredOptions"]}}};a.style=".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;--ez-multi-selection-default-height:322px;display:block;width:304px;height:var(--ez-multi-selection-default-height);min-height:fit-content;max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{a as ez_multi_selection_list}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as r,g as s}from"./p-23a36bb6.js";import{StringUtils as a,KeyboardManager as o,ElementIDUtils as l}from"@sankhyalabs/core";import{A as n}from"./p-46b0b0c7.js";import{C as h}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as c}from"./p-b6579f86.js";import{S as d}from"./p-5895e687.js";import"./p-47e4a8ce.js";const u=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.ezEmptySearch=t(this,"ezEmptySearch",7),this.SEARCH_DESCRIPTION_TIMEOUT=300,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,this._ignoreNextValue=!1,this.value=void 0,this.enabled=!0,this.disableCodeInput=!1,this.disableDescriptionInput=!1,this.label=void 0,this.codLabel=void 0,this.hideDescriptionInput=!1,this.canShowError=!0,this.errorMessage=void 0,this.mode="regular",this.contextProperties=void 0,this.optionLoader=void 0,this.showOptionValue=!0,this.stopPropagateEnterKeyEvent=!1,this.autoFocus=!1,this.showSelectedValue=!0,this.suppressEmptyOption=!1,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.suppressSearch=!1,this.suppressPreLoad=!0,this.ensureClearButtonVisible=!1,this.descriptionValue="",this.codeValue="",this.isLoadingDescription=!1,this.searchDescriptionIsOpen=!1,this.visibleOptions=void 0,this.showLoading=!0}async observeValue(e,t){var i;if(this._ignoreNextValue)return void(this._ignoreNextValue=!1);const r=this.normalizeValueToCodeValue(e);if(r===this.normalizeValueToCodeValue(t))return;if(void 0===r)return this.codeValue=void 0,this.descriptionValue=void 0,this.cleanFieldsRef(),void this.ezChange.emit(void 0);this.codeValue=r;let s=!0;try{this.descriptionValue=await this.normalizeCodeToDescriptionValue(e),null==this.descriptionValue&&console.error(`Valor de descrição não encontrado! ${this.label}: ${this.codeValue}`)}catch(e){await n.info(e.message);const t="string"==typeof this.value?this.value:null===(i=this.value)||void 0===i?void 0:i.value;this.ezEmptySearch.emit(t),this.errorMessage=e.message,s=!1,this._ignoreNextValue=!0,this.clearSearch(),console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",e)}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value),s&&(this.errorMessage=null)}canShowLoadSpinDescription(){return this.isLoadingDescription}async setFocus(e){var t,i;this.disableCodeInput?null===(t=this._textInputDescriptionValue)||void 0===t||t.setFocus(e):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(e):null===(i=this._textInputCodeValue)||void 0===i||i.setFocus(e)}async getValueAsync(){if(!this.isLoadingDescription){const e=this.buildCurrentValue();return new Promise((t=>t(e)))}return new Promise((e=>{let t=setInterval((()=>{if(!this.isLoadingDescription){clearInterval(t);const i=this.buildCurrentValue();e(i)}}),this.INTERVAL_TO_RETRY_ASYNC_VALUE)}))}async clearValue(){this.clearSearch()}async setBlur(){var e,t;null===(e=this._textInputCodeValue)||void 0===e||e.setBlur(),null===(t=this._textInputDescriptionValue)||void 0===t||t.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async componentWillLoad(){this.i18n=await c(),this.value&&a.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){h.applyVarsTextInput(this.el,this._textInputCodeValue),h.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this.value=null,this.codeValue=null,this.descriptionValue=null,!this.hideDescriptionInput&&this._textInputDescriptionValue&&(this._textInputDescriptionValue.value=null)}getCodLabel(){var e;return this.hideDescriptionInput?this.label:null!==(e=this.codLabel)&&void 0!==e?e:this.i18n("ez-search-plus.defaultCodeLabel")}async normalizeCodeToDescriptionValue(e){if(!e)return"";if("string"==typeof e)try{if((null==(e=JSON.parse(e))?void 0:e.value)&&!(null==e?void 0:e.label))return await this.loadDescriptionValueByCode(null==e?void 0:e.value)}catch(t){return await this.loadDescriptionValueByCode(e)}return"object"!=typeof e?await this.loadDescriptionValueByCode(e):null==e?void 0:e.label}normalizeValueToCodeValue(e){if(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){return e}return"object"!=typeof e?"number"==typeof e?String(e):e:null==e?void 0:e.value}}async loadDescriptionValueByCode(e){if(!this.optionLoader)return console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined")),"";try{this.isLoadingDescription=!0;const t={mode:d.LOAD_DESCRIPTION,argument:e},i=await this.optionLoader(t);return i?Array.isArray(i)?i[0].label:i.label:""}finally{this.isLoadingDescription=!1}}handleCodeInputFocusOut(){this.cancelSelection(),this.codeValue!=this._textInputCodeValue.value&&(this.value=this._textInputCodeValue.value)}handleSearchClick(){this.loadAdvancedSearch()}async loadAdvancedSearch(){if(!this.optionLoader)return void console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined"));const e={mode:d.ADVANCED,argument:""};let t;try{t=await this.optionLoader(e,this.contextProperties)}catch(e){}t&&(this.value=t)}buildCurrentValue(){if(!a.isEmpty(this.codeValue))return{value:this.codeValue,label:this.descriptionValue}}async handleTextInputChangeHandler(e){this.searchDescriptionIsOpen||this._popover.showUnder(this.el);const t=e.target.value;await this.debounceLoaderOptions(t)}async debounceLoaderOptions(e){return this._debounceSearch&&clearTimeout(this._debounceSearch),new Promise((t=>{this._debounceSearch=setTimeout((async()=>{await this.processOptionsLoader(e),t()}),this.SEARCH_DESCRIPTION_TIMEOUT)}))}updateKeyOption(e){return Object.assign(Object.assign({},e),{presentationValue:e.value,presentationLabel:e.label})}parseSearchOptions(e=[]){if(Array.isArray(e)){const t=e[0];return t?"label"in t||"value"in t?e.map((e=>this.updateKeyOption(e))):e:[]}return("label"in e||"value"in e)&&this.updateKeyOption(e),[e]}async processOptionsLoader(e){try{this.showLoading=!0;const t={mode:d.PREDICTIVE,argument:e},i=await this.optionLoader(t);this.visibleOptions=this.parseSearchOptions(i)}finally{this.showLoading=!1}}handleSelectItem(e){this.value=e.detail,this._popover.hide(),window.requestAnimationFrame((()=>{var e;null===(e=this._textInputDescriptionValue)||void 0===e||e.setFocus({selectText:!0})}))}async handleArrowUp(){this.isOptionsVisible()&&await this._searchList.previousOption()}async handleArrowDown(){this.isOptionsVisible()&&await this._searchList.nextOption()}async selectCurrentItem(){var e;await(null===(e=this._searchList)||void 0===e?void 0:e.selectCurrentItem())}async cancelSelection(){var e,t,i;const r="object"==typeof this.value?null===(e=this.value)||void 0===e?void 0:e.label:"";this._textInputDescriptionValue&&r&&this._textInputDescriptionValue.value!=r&&(this._textInputDescriptionValue.value=r),await(null===(t=this._searchList)||void 0===t?void 0:t.cancelSelection()),null===(i=this._popover)||void 0===i||i.hide()}async handleInputTab(){await this.cancelSelection()}async handleInputEsc(){var e;await this.cancelSelection(),await(null===(e=this._latestFocusedInputElement)||void 0===e?void 0:e.setFocus({selectText:!0}))}async initKeyboardManager(){this._keyboardManager=new o;const e={element:this.el,propagate:!0};this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),Object.assign(Object.assign({},e),{propagate:!1})).bind("ArrowDown",(()=>this.handleArrowDown()),Object.assign(Object.assign({},e),{propagate:!1})).bind("Enter",(()=>this.selectCurrentItem()),Object.assign(Object.assign({},e),{propagate:!this.stopPropagateEnterKeyEvent})).bind("Tab",(()=>this.handleInputTab()),e).bind("Escape",(()=>this.handleInputEsc()),e)}disconnectedCallback(){this._keyboardManager.unbind("ArrowUp").unbind("ArrowDown").unbind("Enter").unbind("Tab").unbind("Escape")}isOptionsVisible(){return this._popover.opened}setLatestFocusedInputElement(e){this._latestFocusedInputElement=e}handleCodeInputFocus(){this.setLatestFocusedInputElement(this._textInputCodeValue)}handleDescriptionInputFocus(){this.setLatestFocusedInputElement(this._textInputDescriptionValue)}cleanFieldsRef(){this._textInputCodeValue&&(this._textInputCodeValue.value=null),this._textInputDescriptionValue&&(this._textInputDescriptionValue.value=null)}getRightIconElement(){var e,t;return this.ensureClearButtonVisible||this.value||(null===(e=this._textInputCodeValue)||void 0===e?void 0:e.value)||(null===(t=this._textInputDescriptionValue)||void 0===t?void 0:t.value)?i("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):null}getLeftIconElement(){return i("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handleSearchClick()},this.canShowLoadSpinDescription()?i("div",{class:"message__loading"}):i("ez-icon",{iconName:"search"}))}handleOnEzVisibilityChange(e){e.stopPropagation(),this.searchDescriptionIsOpen=e.detail}render(){return l.addIDInfoIfNotExists(this.el,"input"),i(r,null,i("div",{class:"ez-search-plus__container"},i("ez-text-input",{ref:e=>this._textInputCodeValue=e,class:{"ez-search-plus__code-input":!this.hideDescriptionInput,"ez-search-plus__code-input-no-border":!this.hideDescriptionInput,"ez-search-plus__code-input-full":this.hideDescriptionInput},"data-element-id":l.getInternalIDInfo("codeInput"),"data-slave-mode":"true",enabled:!this.disableCodeInput&&this.enabled,mode:this.mode,label:this.getCodLabel(),canShowError:this.canShowError,hasInvalid:!a.isEmpty(this.errorMessage),errorMessage:this.hideDescriptionInput?this.errorMessage:"",value:this.codeValue,onFocusout:()=>this.handleCodeInputFocusOut(),onFocus:()=>this.handleCodeInputFocus()},this.getLeftIconElement()),!this.hideDescriptionInput&&i("div",{class:"description-input-container"},i("ez-text-input",{ref:e=>this._textInputDescriptionValue=e,tabIndex:-1,class:"ez-search-plus__text-input","data-element-id":l.getInternalIDInfo("textInput"),"data-slave-mode":"true",enabled:!this.disableDescriptionInput&&this.enabled,label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,value:this.descriptionValue,onInput:e=>this.handleTextInputChangeHandler(e),onFocus:()=>this.handleDescriptionInputFocus()},this.getRightIconElement()),i("ez-popover-plus",{ref:e=>this._popover=e,anchorElement:this.el,autoClose:!0,boxWidth:"fit-content",overlayType:"none",useAnchorSize:!0,onEzVisibilityChange:e=>this.handleOnEzVisibilityChange(e),"data-element-id":this.el.getAttribute("data-element-id")},i("ez-search-result-list",{ref:e=>this._searchList=e,showLoading:this.showLoading,visibleOptions:this.visibleOptions,value:this.value,showOptionValue:this.showOptionValue,onChangeValue:e=>this.handleSelectItem(e)})))))}get el(){return s(this)}static get watchers(){return{value:["observeValue"]}}};u.style=":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.list-options{margin-top:0px;box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}.ez-search-plus__container{display:flex;flex-grow:1;gap:3px}.ez-search-plus__text-input{--ez-text-input--border-top-left-radius:0px;--ez-text-input--border-bottom-left-radius:0px;outline:none}.ez-search-plus__code-input-no-border{--ez-text-input--border-top-right-radius:0px;--ez-text-input--border-bottom-right-radius:0px}.ez-search-plus__code-input{max-width:85px}.ez-search-plus__code-input-full{width:100%}.description-input-container{width:100%;outline:none}";export{u as ez_search_plus}