@sankhyalabs/ezui 5.22.0-dev.8 → 5.22.0-dev.80

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 (311) hide show
  1. package/dist/cjs/DataBinder-e92314c2.js +445 -0
  2. package/dist/cjs/FocusResolver-885f2173.js +35 -0
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +3 -2
  4. package/dist/cjs/ez-button.cjs.entry.js +11 -5
  5. package/dist/cjs/ez-card-item_2.cjs.entry.js +76 -0
  6. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +67 -13
  9. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +35 -5
  10. package/dist/cjs/ez-date-input.cjs.entry.js +14 -4
  11. package/dist/cjs/ez-date-time-input.cjs.entry.js +11 -4
  12. package/dist/cjs/ez-dialog.cjs.entry.js +14 -7
  13. package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
  14. package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +75 -8
  15. package/dist/cjs/ez-filter-input.cjs.entry.js +130 -0
  16. package/dist/cjs/ez-form-view.cjs.entry.js +29 -22
  17. package/dist/cjs/ez-form.cjs.entry.js +6 -325
  18. package/dist/cjs/ez-grid.cjs.entry.js +14861 -69696
  19. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-list.cjs.entry.js +258 -211
  21. package/dist/cjs/ez-modal-container.cjs.entry.js +2 -1
  22. package/dist/cjs/ez-modal.cjs.entry.js +19 -4
  23. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
  24. package/dist/cjs/ez-number-input.cjs.entry.js +15 -2
  25. package/dist/cjs/ez-popup.cjs.entry.js +24 -2
  26. package/dist/cjs/ez-scroller_2.cjs.entry.js +3 -3
  27. package/dist/cjs/ez-search.cjs.entry.js +108 -47
  28. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
  30. package/dist/cjs/ez-split-item.cjs.entry.js +5 -2
  31. package/dist/cjs/ez-split-panel.cjs.entry.js +68 -6
  32. package/dist/cjs/ez-text-area.cjs.entry.js +68 -6
  33. package/dist/cjs/ez-text-input.cjs.entry.js +153 -16
  34. package/dist/cjs/ez-time-input.cjs.entry.js +8 -1
  35. package/dist/cjs/ez-tooltip.cjs.entry.js +55 -0
  36. package/dist/cjs/ez-tree.cjs.entry.js +5 -4
  37. package/dist/cjs/ezListHelper-0d3970b4.js +90 -0
  38. package/dist/cjs/ezui.cjs.js +1 -1
  39. package/dist/cjs/filter-column.cjs.entry.js +2 -2
  40. package/dist/cjs/index-a7b0c73d.js +16 -8
  41. package/dist/cjs/loader.cjs.js +1 -1
  42. package/dist/collection/collection-manifest.json +3 -1
  43. package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
  44. package/dist/collection/components/ez-button/ez-button.css +23 -13
  45. package/dist/collection/components/ez-button/ez-button.js +12 -6
  46. package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
  47. package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
  48. package/dist/collection/components/ez-check/ez-check.css +1 -6
  49. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
  50. package/dist/collection/components/ez-combo-box/ez-combo-box.css +13 -1
  51. package/dist/collection/components/ez-combo-box/ez-combo-box.js +130 -15
  52. package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
  53. package/dist/collection/components/ez-date-input/ez-date-input.js +58 -5
  54. package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +1 -1
  55. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +55 -5
  56. package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
  57. package/dist/collection/components/ez-dialog/ez-dialog.js +14 -16
  58. package/dist/collection/components/ez-double-list/doubleListHelper.js +82 -0
  59. package/dist/collection/components/ez-double-list/ez-double-list.css +62 -0
  60. package/dist/collection/components/ez-double-list/ez-double-list.js +440 -0
  61. package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -8
  62. package/dist/collection/components/ez-filter-input/ez-filter-input.js +55 -5
  63. package/dist/collection/components/ez-form/ez-form.js +1 -0
  64. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +49 -6
  65. package/dist/collection/components/ez-form-view/ez-form-view.css +5 -2
  66. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
  67. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
  68. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
  69. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +8 -4
  70. package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
  71. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
  72. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
  73. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +1 -1
  74. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
  75. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +292 -63
  76. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +151 -31
  77. package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js +2 -1
  78. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +219 -42
  79. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +16 -0
  80. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
  81. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +2 -0
  82. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
  83. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
  84. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +8 -1
  85. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
  86. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +2 -0
  87. package/dist/collection/components/ez-grid/ez-grid.css +47 -8
  88. package/dist/collection/components/ez-grid/ez-grid.js +280 -9
  89. package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
  90. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +1 -1
  91. package/dist/collection/components/ez-icon/ez-icon.css +155 -149
  92. package/dist/collection/components/ez-list/ez-list.css +2 -1
  93. package/dist/collection/components/ez-list/ez-list.js +301 -212
  94. package/dist/collection/components/ez-list/ezListHelper.js +85 -0
  95. package/dist/collection/components/ez-modal/ez-modal.css +5 -1
  96. package/dist/collection/components/ez-modal/ez-modal.js +38 -5
  97. package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
  98. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +2 -3
  99. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
  100. package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
  101. package/dist/collection/components/ez-number-input/ez-number-input.js +68 -1
  102. package/dist/collection/components/ez-popup/ez-popup.css +8 -3
  103. package/dist/collection/components/ez-popup/ez-popup.js +43 -3
  104. package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
  105. package/dist/collection/components/ez-search/ez-search.css +21 -10
  106. package/dist/collection/components/ez-search/ez-search.js +211 -53
  107. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
  108. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
  109. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +3 -1
  110. package/dist/collection/components/ez-skeleton/ez-skeleton.css +54 -34
  111. package/dist/collection/components/ez-split-button/ez-split-button.css +50 -14
  112. package/dist/collection/components/ez-split-button/ez-split-button.js +3 -3
  113. package/dist/collection/components/ez-split-panel/ez-split-panel.css +15 -0
  114. package/dist/collection/components/ez-split-panel/ez-split-panel.js +106 -5
  115. package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +1 -0
  116. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +14 -2
  117. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +22 -1
  118. package/dist/collection/components/ez-text-area/ez-text-area.css +78 -29
  119. package/dist/collection/components/ez-text-area/ez-text-area.js +104 -4
  120. package/dist/collection/components/ez-text-input/ez-text-input.css +106 -91
  121. package/dist/collection/components/ez-text-input/ez-text-input.js +185 -15
  122. package/dist/collection/components/ez-time-input/ez-time-input.js +44 -1
  123. package/dist/collection/components/ez-tooltip/ez-tooltip.css +20 -0
  124. package/dist/collection/components/ez-tooltip/ez-tooltip.js +116 -0
  125. package/dist/collection/components/ez-tree/ez-tree.js +21 -1
  126. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +3 -3
  127. package/dist/collection/sw.js +46 -0
  128. package/dist/collection/utils/FocusResolver.js +31 -0
  129. package/dist/collection/utils/ResponsiveInputUtils.js +26 -0
  130. package/dist/collection/utils/form/DataBinder.js +22 -7
  131. package/dist/collection/utils/form/FormMetadata.js +2 -1
  132. package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
  133. package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
  134. package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +7 -1
  135. package/dist/custom-elements/index.d.ts +12 -0
  136. package/dist/custom-elements/index.js +16502 -70294
  137. package/dist/esm/DataBinder-9c877244.js +441 -0
  138. package/dist/esm/FocusResolver-1ccbf850.js +33 -0
  139. package/dist/esm/ez-actions-button.entry.js +3 -2
  140. package/dist/esm/ez-button.entry.js +11 -5
  141. package/dist/esm/ez-card-item_2.entry.js +71 -0
  142. package/dist/esm/ez-check.entry.js +1 -1
  143. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  144. package/dist/esm/ez-combo-box.entry.js +68 -14
  145. package/dist/esm/ez-custom-form-input_2.entry.js +36 -6
  146. package/dist/esm/ez-date-input.entry.js +14 -4
  147. package/dist/esm/ez-date-time-input.entry.js +11 -4
  148. package/dist/esm/ez-dialog.entry.js +15 -8
  149. package/dist/esm/ez-double-list.entry.js +283 -0
  150. package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +75 -9
  151. package/dist/esm/ez-filter-input.entry.js +126 -0
  152. package/dist/esm/ez-form-view.entry.js +29 -22
  153. package/dist/esm/ez-form.entry.js +5 -324
  154. package/dist/esm/ez-grid.entry.js +14891 -69726
  155. package/dist/esm/ez-icon.entry.js +1 -1
  156. package/dist/esm/ez-list.entry.js +258 -211
  157. package/dist/esm/ez-modal-container.entry.js +2 -1
  158. package/dist/esm/ez-modal.entry.js +19 -4
  159. package/dist/esm/ez-multi-selection-list.entry.js +2 -2
  160. package/dist/esm/ez-number-input.entry.js +15 -2
  161. package/dist/esm/ez-popup.entry.js +24 -2
  162. package/dist/esm/ez-scroller_2.entry.js +3 -3
  163. package/dist/esm/ez-search.entry.js +108 -47
  164. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  165. package/dist/esm/ez-split-button.entry.js +2 -2
  166. package/dist/esm/ez-split-item.entry.js +5 -2
  167. package/dist/esm/ez-split-panel.entry.js +69 -7
  168. package/dist/esm/ez-text-area.entry.js +68 -6
  169. package/dist/esm/ez-text-input.entry.js +153 -16
  170. package/dist/esm/ez-time-input.entry.js +8 -1
  171. package/dist/esm/ez-tooltip.entry.js +51 -0
  172. package/dist/esm/ez-tree.entry.js +5 -4
  173. package/dist/esm/ezListHelper-00fb9b8d.js +87 -0
  174. package/dist/esm/ezui.js +1 -1
  175. package/dist/esm/filter-column.entry.js +2 -2
  176. package/dist/esm/index-baa5e267.js +16 -8
  177. package/dist/esm/loader.js +1 -1
  178. package/dist/ezui/ezui.esm.js +1 -1
  179. package/dist/ezui/p-14b769d7.entry.js +1 -0
  180. package/dist/ezui/p-16e612fc.entry.js +1 -0
  181. package/dist/ezui/p-17eabf46.entry.js +1 -0
  182. package/dist/ezui/p-2475fd6e.entry.js +1 -0
  183. package/dist/ezui/p-2bb2a0c4.entry.js +1 -0
  184. package/dist/ezui/p-2f45506d.entry.js +1 -0
  185. package/dist/ezui/p-35464ae8.entry.js +1 -0
  186. package/dist/ezui/p-354abfe8.entry.js +1 -0
  187. package/dist/ezui/{p-baf80b13.entry.js → p-35d467a8.entry.js} +1 -1
  188. package/dist/ezui/p-3f2dd525.entry.js +1 -0
  189. package/dist/ezui/p-420f97ff.entry.js +1 -0
  190. package/dist/ezui/p-50d83a46.entry.js +1 -0
  191. package/dist/ezui/p-654b3f99.entry.js +1 -0
  192. package/dist/ezui/p-65f471bc.entry.js +1 -0
  193. package/dist/ezui/p-6cdd3e0a.entry.js +1 -0
  194. package/dist/ezui/p-6d79930d.entry.js +1 -0
  195. package/dist/ezui/p-6f22a385.entry.js +1 -0
  196. package/dist/ezui/p-7409eeaa.entry.js +1 -0
  197. package/dist/ezui/p-7e677b7b.entry.js +1 -0
  198. package/dist/ezui/{p-bf79aaa1.entry.js → p-7fdd479f.entry.js} +1 -1
  199. package/dist/ezui/p-80dfc50b.js +1 -0
  200. package/dist/ezui/p-990b4318.entry.js +1 -0
  201. package/dist/ezui/p-a6fe527a.entry.js +1 -0
  202. package/dist/ezui/p-acddfb2e.js +1 -0
  203. package/dist/ezui/p-b6597f49.entry.js +309 -0
  204. package/dist/ezui/p-b6a4e6de.entry.js +1 -0
  205. package/dist/ezui/p-c3045972.entry.js +1 -0
  206. package/dist/ezui/p-ca6340a9.entry.js +1 -0
  207. package/dist/ezui/p-cf87aacb.entry.js +1 -0
  208. package/dist/ezui/p-da1b4a38.entry.js +1 -0
  209. package/dist/ezui/p-dc628ed3.js +1 -0
  210. package/dist/ezui/p-dc8b36c3.entry.js +1 -0
  211. package/dist/ezui/{p-84e439b9.entry.js → p-e347df9c.entry.js} +1 -1
  212. package/dist/ezui/p-e3e3fd7a.entry.js +1 -0
  213. package/dist/ezui/p-ea54d056.entry.js +1 -0
  214. package/dist/ezui/p-f43dbada.entry.js +1 -0
  215. package/dist/ezui/p-fa6732f2.entry.js +1 -0
  216. package/dist/ezui/p-fec696ab.entry.js +1 -0
  217. package/dist/types/components/ez-button/ez-button.d.ts +2 -1
  218. package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
  219. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +16 -1
  220. package/dist/types/components/ez-date-input/ez-date-input.d.ts +10 -1
  221. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +10 -1
  222. package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -1
  223. package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
  224. package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
  225. package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
  226. package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
  227. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +10 -1
  228. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
  229. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
  230. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
  231. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
  232. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +71 -4
  233. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +36 -4
  234. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +25 -2
  235. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +33 -7
  236. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +4 -1
  237. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
  238. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  239. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
  240. package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
  241. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +2 -1
  242. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
  243. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
  244. package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
  245. package/dist/types/components/ez-grid/ez-grid.d.ts +49 -1
  246. package/dist/types/components/ez-list/ez-list.d.ts +23 -2
  247. package/dist/types/components/ez-list/ezListHelper.d.ts +20 -0
  248. package/dist/types/components/ez-modal/ez-modal.d.ts +7 -1
  249. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
  250. package/dist/types/components/ez-number-input/ez-number-input.d.ts +12 -0
  251. package/dist/types/components/ez-popup/ez-popup.d.ts +8 -1
  252. package/dist/types/components/ez-search/ez-search.d.ts +34 -6
  253. package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
  254. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +11 -0
  255. package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +9 -0
  256. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +5 -0
  257. package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
  258. package/dist/types/components/ez-text-input/ez-text-input.d.ts +28 -2
  259. package/dist/types/components/ez-time-input/ez-time-input.d.ts +8 -0
  260. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +21 -0
  261. package/dist/types/components/ez-tree/ez-tree.d.ts +4 -0
  262. package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
  263. package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +1 -0
  264. package/dist/types/components.d.ts +486 -27
  265. package/dist/types/utils/FocusResolver.d.ts +5 -0
  266. package/dist/types/utils/ResponsiveInputUtils.d.ts +6 -0
  267. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +2 -0
  268. package/dist/types/utils/form/DataBinder.d.ts +3 -0
  269. package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
  270. package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -1
  271. package/package.json +12 -4
  272. package/react/components.d.ts +2 -0
  273. package/react/components.js +2 -0
  274. package/react/components.js.map +1 -1
  275. package/dist/cjs/RecordValidationProcessor-4c893e04.js +0 -102
  276. package/dist/cjs/ez-card-item_3.cjs.entry.js +0 -183
  277. package/dist/cjs/ez-skeleton.cjs.entry.js +0 -67
  278. package/dist/esm/RecordValidationProcessor-b00b8b77.js +0 -99
  279. package/dist/esm/ez-card-item_3.entry.js +0 -177
  280. package/dist/esm/ez-skeleton.entry.js +0 -63
  281. package/dist/ezui/p-04f24913.js +0 -1
  282. package/dist/ezui/p-072e6347.entry.js +0 -1
  283. package/dist/ezui/p-1285c902.entry.js +0 -1
  284. package/dist/ezui/p-13d2fe2d.entry.js +0 -1
  285. package/dist/ezui/p-2097d0cf.entry.js +0 -1
  286. package/dist/ezui/p-30775e7f.entry.js +0 -1
  287. package/dist/ezui/p-32e553e5.entry.js +0 -304
  288. package/dist/ezui/p-3b4eeeb6.entry.js +0 -1
  289. package/dist/ezui/p-3faa2b46.entry.js +0 -1
  290. package/dist/ezui/p-49456b34.entry.js +0 -1
  291. package/dist/ezui/p-4d5235f1.entry.js +0 -1
  292. package/dist/ezui/p-5bd5e68f.entry.js +0 -1
  293. package/dist/ezui/p-784fe207.entry.js +0 -1
  294. package/dist/ezui/p-7922142b.entry.js +0 -1
  295. package/dist/ezui/p-7af81663.entry.js +0 -1
  296. package/dist/ezui/p-7bc07c31.entry.js +0 -1
  297. package/dist/ezui/p-85c8baae.entry.js +0 -1
  298. package/dist/ezui/p-8888d9ed.entry.js +0 -1
  299. package/dist/ezui/p-8f0144f6.entry.js +0 -1
  300. package/dist/ezui/p-9050d2cd.entry.js +0 -1
  301. package/dist/ezui/p-922ac38b.entry.js +0 -1
  302. package/dist/ezui/p-9ab22a07.entry.js +0 -1
  303. package/dist/ezui/p-a31b9c90.entry.js +0 -1
  304. package/dist/ezui/p-af95cd16.entry.js +0 -1
  305. package/dist/ezui/p-bae4e180.entry.js +0 -1
  306. package/dist/ezui/p-bcb53f27.entry.js +0 -1
  307. package/dist/ezui/p-d9401ea0.entry.js +0 -1
  308. package/dist/ezui/p-e85c48d7.entry.js +0 -1
  309. package/dist/ezui/p-ecc2c1ec.entry.js +0 -1
  310. package/dist/ezui/p-f3c526cc.entry.js +0 -1
  311. package/dist/ezui/p-fcf0acce.entry.js +0 -1
@@ -1,12 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
- const ezTextAreaCss = ":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, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--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--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;width:100%;padding:0;background:none;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)}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{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--resizable{resize:both}.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)}.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{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled:-moz-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled::-moz-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled:-ms-input-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color)}";
4
+ const ezTextAreaCss = ":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--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{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--resizable{resize:vertical}.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}";
5
5
 
6
6
  const EzTextArea = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
9
  this.ezChange = createEvent(this, "ezChange", 7);
10
+ this.LINE_HEIGHT = 24;
11
+ this.HEIGHT_RATIO = 1.4;
10
12
  this.label = undefined;
11
13
  this.value = undefined;
12
14
  this.enabled = true;
@@ -14,7 +16,9 @@ const EzTextArea = class {
14
16
  this.rows = 4;
15
17
  this.canShowError = true;
16
18
  this.mode = "regular";
17
- this.enableResize = false;
19
+ this.enableResize = true;
20
+ this.autoRows = false;
21
+ this.autoFocus = false;
18
22
  }
19
23
  observeErrorMessage() {
20
24
  var _a, _b, _c, _d;
@@ -52,8 +56,17 @@ const EzTextArea = class {
52
56
  observeRows() {
53
57
  const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
54
58
  if (rows !== this.rows) {
55
- this.rows = rows;
56
- this._initialRows = rows;
59
+ this.updateRows(rows);
60
+ }
61
+ }
62
+ observeAutoRows() {
63
+ var _a, _b;
64
+ if (this.autoRows) {
65
+ (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
66
+ this.initializeResizeObserver();
67
+ }
68
+ else {
69
+ (_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
57
70
  }
58
71
  }
59
72
  //---------------------------------------------
@@ -122,6 +135,42 @@ const EzTextArea = class {
122
135
  isFocused() {
123
136
  return this._hostElement.shadowRoot.activeElement !== null;
124
137
  }
138
+ updateRows(newRows) {
139
+ this.rows = newRows;
140
+ this._initialRows = newRows;
141
+ }
142
+ calculateMaxRows() {
143
+ const parentElement = this._hostElement.parentElement;
144
+ if (!parentElement) {
145
+ return;
146
+ }
147
+ const height = Math.max((parentElement === null || parentElement === void 0 ? void 0 : parentElement.clientHeight) || 0, this.LINE_HEIGHT);
148
+ if (height > 0) {
149
+ const maxRows = Math.floor(height / this.LINE_HEIGHT * this.HEIGHT_RATIO);
150
+ if (maxRows !== this.rows) {
151
+ this.updateRows(maxRows);
152
+ }
153
+ }
154
+ }
155
+ initializeResizeObserver() {
156
+ if (!this.autoRows) {
157
+ return;
158
+ }
159
+ const parentElement = this._hostElement.parentElement;
160
+ if (parentElement) {
161
+ try {
162
+ if (this._resizeObserver != undefined) {
163
+ this._resizeObserver.unobserve(parentElement);
164
+ }
165
+ this._resizeObserver = new ResizeObserver(this.calculateMaxRows.bind(this));
166
+ this._resizeObserver.observe(parentElement);
167
+ }
168
+ catch (e) {
169
+ console.warn(e);
170
+ }
171
+ this.calculateMaxRows();
172
+ }
173
+ }
125
174
  //---------------------------------------------
126
175
  // Event handlers
127
176
  //---------------------------------------------
@@ -144,6 +193,13 @@ const EzTextArea = class {
144
193
  this._container.classList.add("textarea--focus");
145
194
  }
146
195
  }
196
+ connectedCallback() {
197
+ this.initializeResizeObserver();
198
+ }
199
+ disconnectedCallback() {
200
+ var _a;
201
+ (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
202
+ }
147
203
  //---------------------------------------------
148
204
  // Lifecycle web component
149
205
  //---------------------------------------------
@@ -151,10 +207,15 @@ const EzTextArea = class {
151
207
  this.observeErrorMessage();
152
208
  this.adjustFloatingLabel();
153
209
  this.observeMode();
210
+ if (this.autoFocus) {
211
+ requestAnimationFrame(() => {
212
+ this.setFocus();
213
+ });
214
+ }
154
215
  }
155
216
  render() {
156
217
  ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
157
- return (h(Host, null, h("div", { class: "textarea", ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
218
+ return (h(Host, null, h("div", { class: `textarea ${this.enabled ? "" : "textarea--disabled"}`, ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
158
219
  h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
159
220
  : null, h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo("input"), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: {
160
221
  "textarea--slim": this.mode === "slim",
@@ -167,7 +228,8 @@ const EzTextArea = class {
167
228
  "errorMessage": ["observeErrorMessage"],
168
229
  "value": ["observeValue"],
169
230
  "mode": ["observeMode"],
170
- "rows": ["observeRows"]
231
+ "rows": ["observeRows"],
232
+ "autoRows": ["observeAutoRows"]
171
233
  }; }
172
234
  };
173
235
  EzTextArea.style = ezTextAreaCss;
@@ -1,7 +1,34 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
2
  import { MaskFormatter, ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
- const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--ez-text-input__input--focus--border-color);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:read-only{cursor:default}.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(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__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(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}";
4
+ /**
5
+ * Aplica comportamento de elipses a um input caso o texto ultrapasse o tamanho disponível.
6
+ *
7
+ * @param inputElement A referência ao elemento input (HTMLInputElement).
8
+ */
9
+ const applyEllipsisToInput = (inputElement) => {
10
+ if (!inputElement || !inputElement.style) {
11
+ console.error('[applyEllipsisToInput] Referência ao elemento input é inválida.');
12
+ return;
13
+ }
14
+ inputElement.style.textOverflow = 'ellipsis';
15
+ inputElement.style.overflow = 'hidden';
16
+ inputElement.style.whiteSpace = 'nowrap';
17
+ const adjustEllipsis = () => {
18
+ const value = inputElement.value || '';
19
+ const isOverflowing = inputElement.scrollWidth > inputElement.clientWidth;
20
+ if (isOverflowing) {
21
+ inputElement.setAttribute('title', value);
22
+ }
23
+ else {
24
+ inputElement.removeAttribute('title');
25
+ }
26
+ };
27
+ inputElement.addEventListener('input', adjustEllipsis);
28
+ adjustEllipsis();
29
+ };
30
+
31
+ const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__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(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;z-index:var(--elevation--4);border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";
5
32
 
6
33
  const EzTextInput = class {
7
34
  constructor(hostRef) {
@@ -12,23 +39,27 @@ const EzTextInput = class {
12
39
  this.enabled = true;
13
40
  this.errorMessage = undefined;
14
41
  this.mask = undefined;
42
+ this.cleanValueMask = false;
15
43
  this.canShowError = true;
16
44
  this.restrict = undefined;
17
45
  this.mode = "regular";
18
46
  this.noBorder = false;
19
47
  this.password = false;
48
+ this.autoFocus = false;
49
+ this.noMargin = false;
50
+ this.hasRightSlotContent = false;
20
51
  }
21
52
  observeErrorMessage() {
22
53
  if (this._inputElem) {
23
54
  this.isInvalid().then((hasError) => {
24
- var _a, _b;
55
+ var _a;
25
56
  if (hasError) {
26
57
  this._inputElem.classList.add("hasError");
27
- (_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
58
+ (_a = this._tooltipPositioningObserver) === null || _a === void 0 ? void 0 : _a.observe(this._inputElem);
28
59
  }
29
60
  else {
30
61
  this._inputElem.classList.remove("hasError");
31
- (_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
62
+ this.removeGlobalTooltip();
32
63
  }
33
64
  });
34
65
  }
@@ -126,7 +157,12 @@ const EzTextInput = class {
126
157
  const value = this._inputElem.value;
127
158
  if (value && this._maskFormatter) {
128
159
  try {
129
- this._inputElem.value = this._maskFormatter.format(value);
160
+ if (this.cleanValueMask) {
161
+ this.applyMask(value);
162
+ }
163
+ else {
164
+ this._inputElem.value = this._maskFormatter.format(value);
165
+ }
130
166
  }
131
167
  catch (e) {
132
168
  this.errorMessage = e.message;
@@ -144,8 +180,34 @@ const EzTextInput = class {
144
180
  }
145
181
  controlChangeValue() {
146
182
  if (this._inputElem && (this.value || '') !== this._inputElem.value) {
147
- this.value = this._inputElem.value;
183
+ if (this.cleanValueMask) {
184
+ this.value = this._maskFormatter.removeMask(this._inputElem.value);
185
+ }
186
+ else {
187
+ this.value = this._inputElem.value;
188
+ }
189
+ }
190
+ }
191
+ applyMask(value) {
192
+ if (!value || value === "")
193
+ return value;
194
+ if (this._maskFormatter) {
195
+ try {
196
+ const formattedValue = this._maskFormatter.applyMask(this._maskFormatter.removeMask(value));
197
+ if (this._inputElem) {
198
+ this._inputElem.value = formattedValue;
199
+ return this._inputElem.value;
200
+ }
201
+ else {
202
+ this.value = formattedValue;
203
+ return this.value;
204
+ }
205
+ }
206
+ catch (e) {
207
+ this.errorMessage = e.message;
208
+ }
148
209
  }
210
+ return value;
149
211
  }
150
212
  handleChange() {
151
213
  if (!this._inputElem) {
@@ -161,8 +223,10 @@ const EzTextInput = class {
161
223
  this.controlChangeValue();
162
224
  }
163
225
  handleSlotChange(ev) {
226
+ var _a;
164
227
  const slot = ev.target;
165
228
  const content = slot.assignedElements()[0];
229
+ this.hasRightSlotContent = false;
166
230
  if (content) {
167
231
  content.style.position = "absolute";
168
232
  content.style.display = "flex";
@@ -188,6 +252,10 @@ const EzTextInput = class {
188
252
  if (this._labelElem) {
189
253
  this._labelElem.classList.add("input__label--right");
190
254
  }
255
+ if (this._tooltipIconElem) {
256
+ this._tooltipIconElem.classList.add("rightIconSlot");
257
+ }
258
+ this.hasRightSlotContent = ((_a = content.children) === null || _a === void 0 ? void 0 : _a.length) > 0;
191
259
  }
192
260
  slot.name && ElementIDUtils.addIDInfo(content, slot.name);
193
261
  }
@@ -199,21 +267,50 @@ const EzTextInput = class {
199
267
  }
200
268
  this.adjustColorContentSlot("var(--ez-text-input__input--focus--icon-color)");
201
269
  }
270
+ renderGlobalTooltip() {
271
+ const tooltip = document.createElement('ez-tooltip');
272
+ tooltip.errorMessage = this.errorMessage;
273
+ tooltip.anchoringElement = this._tooltipIconElem;
274
+ document.body.appendChild(tooltip);
275
+ this._tooltipElem = tooltip;
276
+ }
277
+ removeGlobalTooltip() {
278
+ var _a;
279
+ if (!this._tooltipElem)
280
+ return;
281
+ this._tooltipElem.remove();
282
+ this._tooltipElem = undefined;
283
+ (_a = this._tooltipPositioningObserver) === null || _a === void 0 ? void 0 : _a.unobserve(this._inputElem);
284
+ }
285
+ createTooltipPositioningObserver() {
286
+ const observer = new ResizeObserver(() => {
287
+ if (!this._tooltipElem)
288
+ return;
289
+ if (!this._tooltipIconElem)
290
+ return;
291
+ clearTimeout(this._observerDebounceTimeout);
292
+ this._observerDebounceTimeout = setTimeout(async () => {
293
+ if (this._tooltipElem) {
294
+ await this._tooltipElem.positionTooltip();
295
+ }
296
+ }, 200);
297
+ });
298
+ this._tooltipPositioningObserver = observer;
299
+ }
202
300
  //---------------------------------------------
203
301
  // Lifecycle web component
204
302
  //---------------------------------------------
205
- componentDidLoad() {
206
- this.observeErrorMessage();
207
- this.observeMask();
208
- this.adjustFloatingLabel();
209
- this.adjustBorderInput();
210
- }
211
303
  componentWillLoad() {
212
304
  this.observeMask();
213
305
  if (this.value) {
214
306
  if (this._maskFormatter) {
215
307
  try {
216
- this.value = this._maskFormatter.format(this.value);
308
+ if (this.cleanValueMask) {
309
+ this.applyMask(this.value);
310
+ }
311
+ else {
312
+ this.value = this._maskFormatter.format(this.value);
313
+ }
217
314
  }
218
315
  catch (e) {
219
316
  this.errorMessage = e.message;
@@ -225,12 +322,52 @@ const EzTextInput = class {
225
322
  }
226
323
  }
227
324
  }
325
+ componentDidLoad() {
326
+ var _a, _b;
327
+ this.observeErrorMessage();
328
+ this.observeMask();
329
+ this.adjustFloatingLabel();
330
+ this.adjustBorderInput();
331
+ if (this.autoFocus) {
332
+ requestAnimationFrame(() => {
333
+ this.setFocus({ selectText: true });
334
+ });
335
+ }
336
+ (_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.addEventListener('focus', () => {
337
+ var _a;
338
+ this._inputElem.setSelectionRange(0, (_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.value.length);
339
+ });
340
+ this.createTooltipPositioningObserver();
341
+ if (this._inputElem) {
342
+ (_b = this._tooltipPositioningObserver) === null || _b === void 0 ? void 0 : _b.observe(this._inputElem);
343
+ applyEllipsisToInput(this._inputElem);
344
+ }
345
+ }
346
+ componentDidRender() {
347
+ if (this._tooltipIconElem && !this._tooltipElem) {
348
+ this.renderGlobalTooltip();
349
+ }
350
+ }
351
+ componentDidUpdate() {
352
+ if (this._tooltipIconElem && this._tooltipElem) {
353
+ this._tooltipElem.positionTooltip();
354
+ }
355
+ }
356
+ disconnectedCallback() {
357
+ if (this._tooltipPositioningObserver) {
358
+ this._tooltipPositioningObserver.disconnect();
359
+ }
360
+ if (this._observerDebounceTimeout) {
361
+ clearTimeout(this._observerDebounceTimeout);
362
+ }
363
+ this.removeGlobalTooltip();
364
+ }
228
365
  render() {
229
366
  ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
230
367
  return (h(Host, { style: this._hostElement.classList.contains("grid_editor") ? { "height": "100%" } : null }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
231
- h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
232
- : null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
233
- h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage, "data-element-id": ElementIDUtils.getInternalIDInfo("message_box") }, this.errorMessage)));
368
+ h("label", { ref: (el) => this._labelElem = el, class: `${this.enabled ? "input__label" : "input__label input__label--disabled"} ${this.errorMessage ? "hasError" : ""}`, onClick: () => this._inputElem.focus(), title: this.label }, this.label)
369
+ : null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: `${this.mode === "slim" ? "input--slim" : ""} ${this.noMargin ? "no--margin" : ""}`, placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.mask && this.cleanValueMask ? this.applyMask(this.value) : this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), this.canShowError && this.mode != "slim" && this.errorMessage &&
370
+ h("ez-icon", { class: `tooltip-icon ${this.errorMessage ? "hasError" : ""} ${this.hasRightSlotContent ? "rightIconSlot" : ""}`, "data-element-id": ElementIDUtils.getInternalIDInfo("tooltip-icon"), ref: (el) => this._tooltipIconElem = el, iconName: "alert-circle" }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }, " ")));
234
371
  }
235
372
  get _hostElement() { return getElement(this); }
236
373
  static get watchers() { return {
@@ -17,6 +17,8 @@ const EzTimeInput = class {
17
17
  this.showSeconds = false;
18
18
  this.mode = "regular";
19
19
  this.canShowError = true;
20
+ this.autoFocus = false;
21
+ this.noMargin = false;
20
22
  }
21
23
  observeErrorMessage() {
22
24
  var _a;
@@ -137,6 +139,11 @@ const EzTimeInput = class {
137
139
  //---------------------------------------------
138
140
  componentDidLoad() {
139
141
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
142
+ if (this.autoFocus) {
143
+ requestAnimationFrame(() => {
144
+ this.setFocus({ selectText: true });
145
+ });
146
+ }
140
147
  }
141
148
  componentWillLoad() {
142
149
  this.observeShowSeconds();
@@ -149,7 +156,7 @@ const EzTimeInput = class {
149
156
  }
150
157
  render() {
151
158
  ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
152
- return (h(Host, null, h("ez-text-input", { class: "time__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: (el) => this._textInput = el, "data-slave-mode": "true", value: this._viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
159
+ return (h(Host, null, h("ez-text-input", { class: "time__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: (el) => this._textInput = el, "data-slave-mode": "true", value: this._viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError, noMargin: this.noMargin }, h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
153
160
  }
154
161
  static get assetsDirs() { return ["../assets"]; }
155
162
  get _elem() { return getElement(this); }
@@ -0,0 +1,51 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-baa5e267.js';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
+
4
+ const ezTooltipCss = ":host{position:absolute;z-index:var(--elevation--24);background:var(--color-alert--error-800, #BD0025);padding:var(--space--extra-small, 3px) var(--space--small, 6px);color:var(--color--inverted);border-radius:var(--border--radius-small);display:none;transform:translateX(calc(-50% + 12px)) translateY(8px)}.tooltip::after{--triangle-size:8px;content:'';right:50%;border:var(--triangle-size) solid transparent;border-bottom-color:var(--color-alert--error-800, #BD0025);position:absolute;transform:translateX(calc(50%)) translateY(-100%)}";
5
+
6
+ const EzTooltip = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.errorMessage = undefined;
10
+ this.anchoringElement = undefined;
11
+ }
12
+ /**
13
+ * TODO: Implementar a possibilidade de definir a posição do tooltip.
14
+ */
15
+ // @Prop() tooltipSide: 'left' | 'right' | 'top' | 'bottom' = 'bottom';
16
+ /**
17
+ * Reposiciona o tooltip de acordo com a posição do elemento de ancoragem.
18
+ */
19
+ async positionTooltip() {
20
+ const anchorRect = this.anchoringElement.getBoundingClientRect();
21
+ const top = (anchorRect.bottom + window.scrollY);
22
+ const left = (anchorRect.left + window.scrollX);
23
+ this._element.style.top = `${top}px`;
24
+ this._element.style.left = `${left}px`;
25
+ }
26
+ setEvents() {
27
+ window.addEventListener('scroll', () => {
28
+ this.positionTooltip();
29
+ }, { capture: true });
30
+ window.addEventListener('resize', () => {
31
+ this.positionTooltip();
32
+ }, { capture: true });
33
+ this.anchoringElement.addEventListener('mouseover', () => {
34
+ this._element.style.display = 'block';
35
+ });
36
+ this.anchoringElement.addEventListener('mouseout', () => {
37
+ this._element.style.display = 'none';
38
+ });
39
+ }
40
+ componentDidLoad() {
41
+ this.positionTooltip();
42
+ this.setEvents();
43
+ }
44
+ render() {
45
+ return (h("div", { inert: true, class: "tooltip", role: "tooltip", "data-element-id": ElementIDUtils.getInternalIDInfo("tooltip") }, this.errorMessage));
46
+ }
47
+ get _element() { return getElement(this); }
48
+ };
49
+ EzTooltip.style = ezTooltipCss;
50
+
51
+ export { EzTooltip as ez_tooltip };
@@ -15,7 +15,7 @@ const defaultTooltipResolver = (item, _enabled, _level) => {
15
15
  };
16
16
 
17
17
  const TreeItem = (props) => {
18
- const { node, selectedId, itemClick, iconClick, iconResolver, tooltipResolver, itemsList } = props;
18
+ const { node, selectedId, itemClick, iconClick, iconResolver, tooltipResolver, itemsList, itemDoubleClick } = props;
19
19
  if (!node.visible) {
20
20
  return;
21
21
  }
@@ -29,7 +29,7 @@ const TreeItem = (props) => {
29
29
  itemsList.push(treeItem);
30
30
  }
31
31
  return (h("ul", { class: level === 1 ? "first-level" : undefined },
32
- h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ? "tree-item-error" : ""}`, onClick: () => available && itemClick(treeItem) }, {
32
+ h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ? "tree-item-error" : ""}`, onClick: () => available && itemClick(treeItem), onDblClick: () => available && itemDoubleClick(treeItem) }, {
33
33
  disabled,
34
34
  selected: treeItem.id === selectedId,
35
35
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezTreeItem_${treeItem.id}`)
@@ -40,7 +40,7 @@ const TreeItem = (props) => {
40
40
  h("label", { class: `item-label ${treeItem.bold ? "item-label--bold" : ""}` }, treeItem.label)),
41
41
  getBadgeElement(treeItem.id, treeItem.badge, treeItem.id === selectedId)),
42
42
  expanded
43
- && node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList }))));
43
+ && node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList, itemDoubleClick: itemDoubleClick }))));
44
44
  };
45
45
  function getBadgeElement(itemId, badge, isSelectedItem) {
46
46
  if (badge == undefined) {
@@ -306,6 +306,7 @@ const EzTree = class {
306
306
  registerInstance(this, hostRef);
307
307
  this.ezChange = createEvent(this, "ezChange", 7);
308
308
  this.ezOpenItem = createEvent(this, "ezOpenItem", 7);
309
+ this.ezDbClickItem = createEvent(this, "ezDbClickItem", 7);
309
310
  this._onItemClick = (item) => {
310
311
  this.value = item;
311
312
  };
@@ -575,7 +576,7 @@ const EzTree = class {
575
576
  :
576
577
  this._tree.getChildren().map(node => {
577
578
  var _a;
578
- return h(TreeItem, { selectedId: (_a = this.value) === null || _a === void 0 ? void 0 : _a.id, node: node, itemClick: this._onItemClick, iconClick: this._onIconClick, iconResolver: this.iconResolver, tooltipResolver: this.tooltipResolver || defaultTooltipResolver, itemsList: this._visibleItems });
579
+ return h(TreeItem, { selectedId: (_a = this.value) === null || _a === void 0 ? void 0 : _a.id, node: node, itemClick: this._onItemClick, iconClick: this._onIconClick, iconResolver: this.iconResolver, tooltipResolver: this.tooltipResolver || defaultTooltipResolver, itemsList: this._visibleItems, itemDoubleClick: (item) => this.ezDbClickItem.emit(item) });
579
580
  })));
580
581
  }
581
582
  get _element() { return getElement(this); }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * O dragElement é posicionado ANTERIORMENTE ao targetIndex.
3
+ * Ex: no array: ["A", "B", "C", "D", "E"]
4
+ * se o dragItem for "B" e o targetIndex 3 (referente à "D"),
5
+ * "B" será posicionado logo antes de "D".
6
+ * O resultado será: ["A", "C", "B", "D", "E"]
7
+ *
8
+ * @param configs
9
+ */
10
+ function processListOnDrop(configs) {
11
+ let newList;
12
+ if (hasToMoveMultipleItems(configs)) {
13
+ newList = processMoveMultipleItems(configs);
14
+ }
15
+ else {
16
+ newList = processMoveSingleItem(configs);
17
+ configs.clearSelection();
18
+ }
19
+ return newList;
20
+ }
21
+ function hasToMoveMultipleItems(configs) {
22
+ const { enableMultipleSelection, listItems, dragItem, moveToFinal, targetIndex } = configs;
23
+ if (!enableMultipleSelection)
24
+ return false;
25
+ const selectedItemsIndexes = getSelectedIndices(listItems);
26
+ if (selectedItemsIndexes.length <= 1)
27
+ return false;
28
+ if (!selectedItemsIndexes.includes(dragItem.index))
29
+ return false;
30
+ if (!isContinuousSequence(selectedItemsIndexes))
31
+ return false;
32
+ if (moveToFinal)
33
+ return true;
34
+ return !selectedItemsIndexes.includes(targetIndex);
35
+ }
36
+ function processMoveSingleItem(configs) {
37
+ const { listItems, dragItem, targetIndex, moveToFinal } = configs;
38
+ const newList = [...listItems];
39
+ newList.splice(dragItem.index, 1);
40
+ if (moveToFinal) {
41
+ newList.push(dragItem.item);
42
+ }
43
+ else {
44
+ const adjustedIndex = (targetIndex > dragItem.index) ? Math.max(0, targetIndex - 1) : targetIndex;
45
+ newList.splice(adjustedIndex, 0, dragItem.item);
46
+ }
47
+ return newList;
48
+ }
49
+ function processMoveMultipleItems(configs) {
50
+ const { listItems, moveToFinal, targetIndex } = configs;
51
+ const selectedItems = listItems.filter(item => item.selected);
52
+ const selectedItemsIndexes = getSelectedIndices(listItems);
53
+ const minorIndex = Math.min(...selectedItemsIndexes);
54
+ const majorIndex = Math.max(...selectedItemsIndexes);
55
+ const qtdToMove = selectedItems.length;
56
+ const newList = [...listItems];
57
+ newList.splice(minorIndex, qtdToMove);
58
+ if (moveToFinal) {
59
+ newList.push(...selectedItems);
60
+ }
61
+ else {
62
+ let adjustedIndex = (targetIndex > majorIndex) ? Math.max(0, targetIndex - qtdToMove) : targetIndex;
63
+ newList.splice(adjustedIndex, 0, ...selectedItems);
64
+ }
65
+ return newList;
66
+ }
67
+ function isContinuousSequence(numbers) {
68
+ if (numbers.length === 0)
69
+ return false;
70
+ const sortedNumbers = [...numbers].sort((a, b) => a - b);
71
+ for (let i = 1; i < sortedNumbers.length; i++) {
72
+ if (sortedNumbers[i] !== sortedNumbers[i - 1] + 1) {
73
+ return false;
74
+ }
75
+ }
76
+ return true;
77
+ }
78
+ function getSelectedIndices(listItems) {
79
+ return listItems.reduce((indices, item, index) => {
80
+ if (item.selected) {
81
+ indices.push(index);
82
+ }
83
+ return indices;
84
+ }, []);
85
+ }
86
+
87
+ export { isContinuousSequence as i, processListOnDrop as p };