@sankhyalabs/ezui 5.21.0-dev.4 → 5.21.0-dev.40

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 (282) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/ICustomRender-6fafffce.js +13 -0
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -1
  4. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-button.cjs.entry.js +3 -3
  10. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-chart.cjs.entry.js +433 -0
  13. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -1
  16. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -1
  17. package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +100 -1
  18. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-form-view.cjs.entry.js +35 -4
  24. package/dist/cjs/ez-form.cjs.entry.js +78 -3
  25. package/dist/cjs/ez-grid.cjs.entry.js +374 -53
  26. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-list.cjs.entry.js +12 -4
  29. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-modal-container.cjs.entry.js +3 -3
  31. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-number-input.cjs.entry.js +38 -32
  34. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-scroller_3.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-search.cjs.entry.js +45 -35
  39. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
  42. package/dist/cjs/ez-split-panel.cjs.entry.js +2 -2
  43. package/dist/cjs/ez-tabselector.cjs.entry.js +35 -30
  44. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  49. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  50. package/dist/cjs/ezui.cjs.js +2 -2
  51. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  52. package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +11 -4
  53. package/dist/cjs/loader.cjs.js +2 -2
  54. package/dist/collection/collection-manifest.json +2 -0
  55. package/dist/collection/components/ez-button/ez-button.css +7 -0
  56. package/dist/collection/components/ez-button/ez-button.js +1 -1
  57. package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
  58. package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
  59. package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
  60. package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
  61. package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
  62. package/dist/collection/components/ez-chart/components/index.js +5 -0
  63. package/dist/collection/components/ez-chart/ez-chart.css +5 -0
  64. package/dist/collection/components/ez-chart/ez-chart.js +284 -0
  65. package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
  66. package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
  67. package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
  68. package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
  69. package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
  70. package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
  71. package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
  72. package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
  73. package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
  74. package/dist/collection/components/ez-form/ez-form.js +130 -4
  75. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +278 -0
  76. package/dist/collection/components/ez-form-view/ez-form-view.js +110 -1
  77. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
  78. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +69 -22
  79. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +10 -1
  80. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
  81. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +59 -0
  82. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
  83. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
  84. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
  85. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +10 -3
  86. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
  87. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
  88. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
  89. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
  90. package/dist/collection/components/ez-grid/ez-grid.css +1 -0
  91. package/dist/collection/components/ez-grid/ez-grid.js +265 -13
  92. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
  93. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  94. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
  95. package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
  96. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
  97. package/dist/collection/components/ez-list/ez-list.css +6 -2
  98. package/dist/collection/components/ez-list/ez-list.js +28 -2
  99. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
  100. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  101. package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
  102. package/dist/collection/components/ez-search/ez-search.js +43 -34
  103. package/dist/collection/components/ez-split-panel/ez-split-panel.css +1 -0
  104. package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -29
  105. package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
  106. package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
  107. package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
  108. package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
  109. package/dist/collection/utils/form/DataBinder.js +26 -0
  110. package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
  111. package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
  112. package/dist/collection/utils/index.js +2 -0
  113. package/dist/custom-elements/index.d.ts +12 -0
  114. package/dist/custom-elements/index.js +1161 -165
  115. package/dist/esm/ICustomRender-875b5a40.js +13 -0
  116. package/dist/esm/ez-actions-button.entry.js +2 -1
  117. package/dist/esm/ez-alert-list.entry.js +1 -1
  118. package/dist/esm/ez-alert.entry.js +1 -1
  119. package/dist/esm/ez-application.entry.js +1 -1
  120. package/dist/esm/ez-badge.entry.js +1 -1
  121. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  122. package/dist/esm/ez-button.entry.js +3 -3
  123. package/dist/esm/ez-calendar.entry.js +1 -1
  124. package/dist/esm/ez-card-item_3.entry.js +1 -1
  125. package/dist/esm/ez-chart.entry.js +429 -0
  126. package/dist/esm/ez-check.entry.js +1 -1
  127. package/dist/esm/ez-chip.entry.js +1 -1
  128. package/dist/esm/ez-collapsible-box.entry.js +2 -1
  129. package/dist/esm/ez-combo-box.entry.js +2 -1
  130. package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +101 -3
  131. package/dist/esm/ez-date-input.entry.js +1 -1
  132. package/dist/esm/ez-date-time-input.entry.js +1 -1
  133. package/dist/esm/ez-dialog.entry.js +1 -1
  134. package/dist/esm/ez-dropdown.entry.js +1 -1
  135. package/dist/esm/ez-file-item.entry.js +1 -1
  136. package/dist/esm/ez-form-view.entry.js +35 -4
  137. package/dist/esm/ez-form.entry.js +79 -4
  138. package/dist/esm/ez-grid.entry.js +374 -53
  139. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  140. package/dist/esm/ez-icon.entry.js +1 -1
  141. package/dist/esm/ez-list.entry.js +12 -4
  142. package/dist/esm/ez-loading-bar.entry.js +1 -1
  143. package/dist/esm/ez-modal-container.entry.js +3 -3
  144. package/dist/esm/ez-modal.entry.js +1 -1
  145. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  146. package/dist/esm/ez-number-input.entry.js +39 -33
  147. package/dist/esm/ez-popover.entry.js +1 -1
  148. package/dist/esm/ez-popup.entry.js +1 -1
  149. package/dist/esm/ez-radio-button.entry.js +1 -1
  150. package/dist/esm/ez-scroller_3.entry.js +1 -1
  151. package/dist/esm/ez-search.entry.js +45 -35
  152. package/dist/esm/ez-skeleton.entry.js +1 -1
  153. package/dist/esm/ez-split-button.entry.js +1 -1
  154. package/dist/esm/ez-split-item.entry.js +2 -1
  155. package/dist/esm/ez-split-panel.entry.js +2 -2
  156. package/dist/esm/ez-tabselector.entry.js +35 -30
  157. package/dist/esm/ez-text-area.entry.js +1 -1
  158. package/dist/esm/ez-text-input.entry.js +1 -1
  159. package/dist/esm/ez-time-input.entry.js +1 -1
  160. package/dist/esm/ez-toast.entry.js +1 -1
  161. package/dist/esm/ez-upload.entry.js +1 -1
  162. package/dist/esm/ez-view-stack.entry.js +1 -1
  163. package/dist/esm/ezui.js +3 -3
  164. package/dist/esm/filter-column.entry.js +1 -1
  165. package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +11 -5
  166. package/dist/esm/loader.js +3 -3
  167. package/dist/ezui/ezui.esm.js +1 -1
  168. package/dist/ezui/p-034e21ca.entry.js +1 -0
  169. package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
  170. package/dist/ezui/{p-91f626d3.entry.js → p-0e551dd4.entry.js} +1 -1
  171. package/dist/ezui/{p-af2ecb1b.entry.js → p-11b09aa1.entry.js} +1 -1
  172. package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
  173. package/dist/ezui/{p-af95cd16.entry.js → p-24ca32a3.entry.js} +1 -1
  174. package/dist/ezui/p-2af4e2de.entry.js +1 -0
  175. package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
  176. package/dist/ezui/p-31674f8e.entry.js +1 -0
  177. package/dist/ezui/{p-bf79aaa1.entry.js → p-33792b2b.entry.js} +1 -1
  178. package/dist/ezui/{p-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
  179. package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
  180. package/dist/ezui/p-439fbc78.entry.js +1 -0
  181. package/dist/ezui/p-4607fb89.js +1 -0
  182. package/dist/ezui/p-569a0b9a.entry.js +1 -0
  183. package/dist/ezui/p-5fefcdc9.entry.js +1 -0
  184. package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
  185. package/dist/ezui/p-6ec40dec.entry.js +1 -0
  186. package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
  187. package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
  188. package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
  189. package/dist/ezui/p-81cffa53.entry.js +1 -0
  190. package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
  191. package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
  192. package/dist/ezui/p-868b56f7.entry.js +1 -0
  193. package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
  194. package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
  195. package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
  196. package/dist/ezui/{p-f3c526cc.entry.js → p-9a11e223.entry.js} +1 -1
  197. package/dist/ezui/{p-7af81663.entry.js → p-9a23d513.entry.js} +1 -1
  198. package/dist/ezui/p-9aa27e69.entry.js +1 -0
  199. package/dist/ezui/{p-784fe207.entry.js → p-9c2e2d68.entry.js} +1 -1
  200. package/dist/ezui/p-a35b41e6.entry.js +1 -0
  201. package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
  202. package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
  203. package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
  204. package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
  205. package/dist/ezui/p-c5a80844.entry.js +1 -0
  206. package/dist/ezui/{p-d9401ea0.entry.js → p-cd1a2e6b.entry.js} +1 -1
  207. package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
  208. package/dist/ezui/p-de870657.entry.js +1 -0
  209. package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
  210. package/dist/ezui/{p-b44741b0.entry.js → p-e0c91525.entry.js} +2 -2
  211. package/dist/ezui/p-e151e795.entry.js +1 -0
  212. package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
  213. package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
  214. package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
  215. package/dist/ezui/p-f1c3f85d.entry.js +1 -0
  216. package/dist/ezui/{p-49456b34.entry.js → p-f291db18.entry.js} +1 -1
  217. package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
  218. package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
  219. package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
  220. package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
  221. package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
  222. package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
  223. package/dist/types/components/ez-chart/components/index.d.ts +5 -0
  224. package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
  225. package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
  226. package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
  227. package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
  228. package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
  229. package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
  230. package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
  231. package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
  232. package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
  233. package/dist/types/components/ez-form/ez-form.d.ts +20 -1
  234. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +48 -0
  235. package/dist/types/components/ez-form-view/ez-form-view.d.ts +16 -1
  236. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +42 -0
  237. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +17 -4
  238. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -0
  239. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
  240. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
  241. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
  242. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
  243. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
  244. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +6 -0
  245. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
  246. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
  247. package/dist/types/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
  248. package/dist/types/components/ez-grid/ez-grid.d.ts +39 -1
  249. package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
  250. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  251. package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
  252. package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
  253. package/dist/types/components/ez-list/ez-list.d.ts +5 -0
  254. package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
  255. package/dist/types/components/ez-search/ez-search.d.ts +4 -2
  256. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +3 -2
  257. package/dist/types/components.d.ts +248 -5
  258. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +31 -0
  259. package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
  260. package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
  261. package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
  262. package/dist/types/utils/form/DataBinder.d.ts +3 -0
  263. package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
  264. package/dist/types/utils/index.d.ts +2 -0
  265. package/package.json +2 -1
  266. package/react/components.d.ts +2 -0
  267. package/react/components.js +2 -0
  268. package/react/components.js.map +1 -1
  269. package/dist/ezui/p-0447d17c.entry.js +0 -1
  270. package/dist/ezui/p-20ec22c0.entry.js +0 -1
  271. package/dist/ezui/p-2a1a0e04.entry.js +0 -1
  272. package/dist/ezui/p-44c5b6a5.entry.js +0 -1
  273. package/dist/ezui/p-637f69f2.entry.js +0 -1
  274. package/dist/ezui/p-8defa6d3.entry.js +0 -1
  275. package/dist/ezui/p-99ead599.entry.js +0 -1
  276. package/dist/ezui/p-9aefaa52.entry.js +0 -1
  277. package/dist/ezui/p-b041333c.entry.js +0 -1
  278. package/dist/ezui/p-b567fa8c.entry.js +0 -1
  279. package/dist/ezui/p-bae3d0aa.entry.js +0 -1
  280. package/dist/ezui/p-bc2f844e.entry.js +0 -1
  281. package/dist/ezui/p-cc2dc4f4.entry.js +0 -1
  282. package/dist/ezui/p-db77a984.entry.js +0 -1
@@ -1,9 +1,10 @@
1
- import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-baa5e267.js';
1
+ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-5a720e56.js';
2
2
  import { Action, ObjectUtils as ObjectUtils$1, HTMLBuilder, ApplicationContext, UserInterface, StringUtils as StringUtils$1, NumberUtils as NumberUtils$1, MaskFormatter, DataType, SortMode, ElementIDUtils, FieldComparator, DateUtils as DateUtils$1, ArrayUtils as ArrayUtils$1, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
3
3
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
4
  import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
+ import { C as CustomEditorSource, a as CustomRenderSource } from './ICustomRender-875b5a40.js';
7
8
  import { D as DISTINCT_FILTER_NAME_PREFIX, E as EZ_GRID_LOADING_SOURCE } from './constants-4e0d35b7.js';
8
9
  import { b as buildFieldMetadata, R as RecordValidationProcessor } from './RecordValidationProcessor-b00b8b77.js';
9
10
 
@@ -118856,6 +118857,11 @@ class DataSource {
118856
118857
  });
118857
118858
  }
118858
118859
  }
118860
+ handleFocusFirstRow() {
118861
+ if (this._options.autoFocus) {
118862
+ this._controller.setFocusFirstRow();
118863
+ }
118864
+ }
118859
118865
  isSilentChange(action) {
118860
118866
  //TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
118861
118867
  var _a, _b;
@@ -118863,7 +118869,7 @@ class DataSource {
118863
118869
  return false;
118864
118870
  }
118865
118871
  if (action.type === Action.DATA_CHANGED) {
118866
- return ((_a = Object.keys(action === null || action === void 0 ? void 0 : action.payload)) === null || _a === void 0 ? void 0 : _a.filter(changeName => changeName.startsWith("transient.") || changeName === "records").length) > 0;
118872
+ return (_a = Object.keys(action === null || action === void 0 ? void 0 : action.payload)) === null || _a === void 0 ? void 0 : _a.some(key => { var _a; return (key.startsWith("transient.") && action.payload[key]) || ((_a = action.payload.records) === null || _a === void 0 ? void 0 : _a.length) > 0; });
118867
118873
  }
118868
118874
  if (action.type === Action.EDITION_CANCELED) {
118869
118875
  return ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.silent) === true;
@@ -118887,6 +118893,7 @@ class DataSource {
118887
118893
  this._options.onPaginationChange(this._dataUnit.getPaginationInfo(), action.payload.selectFirstRecord);
118888
118894
  }
118889
118895
  this.updateSelection();
118896
+ this.handleFocusFirstRow();
118890
118897
  break;
118891
118898
  case Action.PAGINATION_UPDATED:
118892
118899
  if (this._options) {
@@ -118929,6 +118936,9 @@ class DataSource {
118929
118936
  this._controller.selectRows(selectionInfo.recordIds, true);
118930
118937
  }
118931
118938
  }
118939
+ setAutoFocus(autoFocus) {
118940
+ this._options.autoFocus = autoFocus;
118941
+ }
118932
118942
  getRows(params) {
118933
118943
  if (this.needReload(params)) {
118934
118944
  this._lastLoadingParams = params;
@@ -119314,8 +119324,9 @@ const buildDateTime = ({ readOnly }) => {
119314
119324
  };
119315
119325
 
119316
119326
  const buildDecimal = ({ readOnly, props }) => {
119317
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
119318
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
119327
+ var _a, _b;
119328
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
119329
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
119319
119330
  return buildNumeric(readOnly, precision, prettyPrecision);
119320
119331
  };
119321
119332
  const buildInteger = ({ readOnly }) => {
@@ -119408,11 +119419,12 @@ uiBuilders.set(UserInterface.LONGTEXT, buildTextAreaInput);
119408
119419
  uiBuilders.set(UserInterface.SEARCH, buildSearch);
119409
119420
  class EzCellEditor {
119410
119421
  init(params) {
119422
+ this._rowData = params.data;
119411
119423
  const fieldName = params.column.getColId();
119412
119424
  const dataUnit = params.context.dataUnit;
119413
- const fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119414
- const builder = uiBuilders.get(fieldMetadata.userInterface) || buildTextInput;
119415
- this._gui = builder(fieldMetadata);
119425
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119426
+ const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
119427
+ this._gui = builder(this._fieldMetadata);
119416
119428
  if (this._gui.valueSetter != undefined) {
119417
119429
  this._gui.valueSetter(params.value);
119418
119430
  }
@@ -119436,10 +119448,151 @@ class EzCellEditor {
119436
119448
  isPopup() {
119437
119449
  return this._gui.isPopUp;
119438
119450
  }
119451
+ getFieldMetadata() {
119452
+ return this._fieldMetadata;
119453
+ }
119454
+ getRecord() {
119455
+ return this._rowData;
119456
+ }
119457
+ }
119458
+
119459
+ class EzGridCustomCellEditor extends EzCellEditor {
119460
+ init(params) {
119461
+ var _a, _b;
119462
+ this._value = params.value;
119463
+ this._fieldName = params.column.getColId();
119464
+ this._customEditorInstance = params.customEditorsInfo.customEditor;
119465
+ super.init(params);
119466
+ this._defaultGui = this.getDefaultGui();
119467
+ const fieldMetadata = super.getFieldMetadata();
119468
+ this._params = {
119469
+ value: params.value,
119470
+ charPress: params.charPress,
119471
+ currentEditor: this._defaultGui,
119472
+ name: this._fieldName,
119473
+ source: CustomEditorSource.GRID,
119474
+ detailContext: params.customEditorsInfo.detailContext,
119475
+ setValue: (value) => this.setValue(value),
119476
+ getValue: () => this.getValue(),
119477
+ record: super.getRecord(),
119478
+ editorMetadata: {
119479
+ hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
119480
+ label: fieldMetadata.label,
119481
+ userInterface: fieldMetadata.userInterface,
119482
+ props: fieldMetadata.props,
119483
+ optionLoader: fieldMetadata.optionLoader,
119484
+ options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
119485
+ },
119486
+ };
119487
+ }
119488
+ getDefaultGui() {
119489
+ const gui = super.getGui();
119490
+ gui.value = this._value;
119491
+ gui.onkeyup = (event) => {
119492
+ const value = event.target.value;
119493
+ this.setValue(value);
119494
+ };
119495
+ return gui;
119496
+ }
119497
+ getGui() {
119498
+ const editorElement = this._customEditorInstance.getEditorElement(this._params);
119499
+ if (!editorElement) {
119500
+ return this._defaultGui;
119501
+ }
119502
+ if (typeof editorElement === 'string') {
119503
+ const element = HTMLBuilder.parseElement(editorElement);
119504
+ return element;
119505
+ }
119506
+ return editorElement;
119507
+ }
119508
+ setValue(value) {
119509
+ this._value = value;
119510
+ }
119511
+ getValue() {
119512
+ return this._value;
119513
+ }
119514
+ }
119515
+
119516
+ class EzCellRender {
119517
+ init(params) {
119518
+ const span = document.createElement('span');
119519
+ this._currentParams = params;
119520
+ span.textContent = params.value;
119521
+ const fieldName = params.column.getColId();
119522
+ const dataUnit = params.context.dataUnit;
119523
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119524
+ this._gui = span;
119525
+ }
119526
+ refresh() {
119527
+ try {
119528
+ this._currentParams.refreshCell();
119529
+ return true;
119530
+ }
119531
+ catch (_a) {
119532
+ return false;
119533
+ }
119534
+ }
119535
+ getGui() {
119536
+ return this._gui;
119537
+ }
119538
+ afterGuiAttached() {
119539
+ this.focusIn();
119540
+ }
119541
+ focusIn() {
119542
+ this._gui.focus();
119543
+ this._gui.setFocus({ selectText: true });
119544
+ }
119545
+ getValue() {
119546
+ return this._currentParams.getValue();
119547
+ }
119548
+ isPopup() {
119549
+ return this._gui.isPopUp;
119550
+ }
119551
+ getFieldMetadata() {
119552
+ return this._fieldMetadata;
119553
+ }
119554
+ }
119555
+
119556
+ class EzGridCustomCellRender extends EzCellRender {
119557
+ init(params) {
119558
+ var _a, _b;
119559
+ this._fieldName = params.column.getColId();
119560
+ this._customRenderInstance = params.customRendersInfo.customRender;
119561
+ super.init(params);
119562
+ const fieldMetadata = super.getFieldMetadata();
119563
+ this._params = {
119564
+ value: params.value,
119565
+ charPress: '',
119566
+ currentRender: super.getGui(),
119567
+ name: this._fieldName,
119568
+ source: CustomRenderSource.GRID,
119569
+ getValue: () => params.getValue(),
119570
+ detailContext: params.customRendersInfo.detailContext,
119571
+ renderMetadata: {
119572
+ hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
119573
+ label: fieldMetadata.label,
119574
+ userInterface: fieldMetadata.userInterface,
119575
+ props: fieldMetadata.props,
119576
+ optionLoader: fieldMetadata.optionLoader,
119577
+ options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
119578
+ }
119579
+ };
119580
+ }
119581
+ getGui() {
119582
+ const editorElement = this._customRenderInstance.getRenderElement(this._params);
119583
+ if (!editorElement) {
119584
+ return super.getGui();
119585
+ }
119586
+ if (typeof editorElement === 'string') {
119587
+ const element = HTMLBuilder.parseElement(editorElement);
119588
+ return element;
119589
+ }
119590
+ return editorElement;
119591
+ }
119439
119592
  }
119440
119593
 
119441
119594
  class GridEditionManager {
119442
- constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
119595
+ constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
119443
119596
  this._dataUnit = dataUnit;
119444
119597
  this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
119445
119598
  getRequiredFields: () => this.getRequiredFields(),
@@ -119448,6 +119601,8 @@ class GridEditionManager {
119448
119601
  }, recordsValidator);
119449
119602
  this._useEnterLikeTab = useEnterLikeTab;
119450
119603
  this._editionIsDisabled = editionIsDisabled;
119604
+ this._customEditors = customEditors;
119605
+ this._customRenders = customRenders;
119451
119606
  }
119452
119607
  configureGrid(options) {
119453
119608
  this._gridOptions = options;
@@ -119514,6 +119669,30 @@ class GridEditionManager {
119514
119669
  col.suppressKeyboardEvent = (params) => {
119515
119670
  return params.event.key === KeyCode.ENTER;
119516
119671
  };
119672
+ col.cellEditorSelector = (params) => {
119673
+ var _a;
119674
+ if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
119675
+ const customEditor = this._customEditors.get(params.colDef.field);
119676
+ return {
119677
+ component: EzGridCustomCellEditor,
119678
+ params: {
119679
+ customEditorsInfo: customEditor,
119680
+ }
119681
+ };
119682
+ }
119683
+ };
119684
+ col.cellRendererSelector = (params) => {
119685
+ var _a;
119686
+ if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
119687
+ const customRender = this._customRenders.get(params.colDef.field);
119688
+ return {
119689
+ component: EzGridCustomCellRender,
119690
+ params: {
119691
+ customRendersInfo: customRender,
119692
+ }
119693
+ };
119694
+ }
119695
+ };
119517
119696
  return col;
119518
119697
  }
119519
119698
  getRequiredFields() {
@@ -119655,6 +119834,12 @@ class GridEditionManager {
119655
119834
  this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
119656
119835
  }
119657
119836
  }
119837
+ setCellEditors(customEditors) {
119838
+ this._customEditors = customEditors;
119839
+ }
119840
+ setCellRenders(customRenders) {
119841
+ this._customRenders = customRenders;
119842
+ }
119658
119843
  }
119659
119844
  class TargetEdition {
119660
119845
  constructor(rowIndex, column, backwards) {
@@ -119691,14 +119876,13 @@ class AgGridController {
119691
119876
  this.STATUS_COL_ID = 'statusColumn';
119692
119877
  this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
119693
119878
  this.BLOCK_LOAD_DEBOUNCE = 100;
119694
- this.DEFAULT_FONT_SIZE = 14;
119695
- this.DEFAULT_ICON_SIZE = 12;
119696
- this.DEFAULT_MAX_SIZE = 200;
119879
+ this.DOC_WIDTH = 1150;
119697
119880
  this._menuItems = [];
119698
119881
  this._idAttribName = '__record__id__';
119699
119882
  this._gridConfig = [];
119700
119883
  this._filteredColumns = new Map();
119701
119884
  this._filterColumnleftPosition = 0;
119885
+ this._customFormatters = new Map();
119702
119886
  this._enterprise = enterprise;
119703
119887
  }
119704
119888
  getGridConfig() {
@@ -119775,6 +119959,8 @@ class AgGridController {
119775
119959
  }
119776
119960
  initDatagrid(container, options) {
119777
119961
  var _a;
119962
+ this._options = options;
119963
+ this._container = container;
119778
119964
  if (this._grid === undefined) {
119779
119965
  LicenseManager.setLicenseKey(ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
119780
119966
  this._columnStateChangeCallback = options.onColumnStateChange;
@@ -119782,7 +119968,7 @@ class AgGridController {
119782
119968
  this._doubleClickCallBack = options.onDoubleClick;
119783
119969
  this._multipleSelection = options.allowMultipleSelection;
119784
119970
  this._dataUnit = options.dataUnit;
119785
- this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
119971
+ this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
119786
119972
  this._statusResolver = options.statusResolver;
119787
119973
  if (this._dataUnit) {
119788
119974
  this._dataUnit.sortingProvider = this;
@@ -119844,6 +120030,7 @@ class AgGridController {
119844
120030
  this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
119845
120031
  }
119846
120032
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
120033
+ this._customFormatters = options.customFormatters;
119847
120034
  }
119848
120035
  }
119849
120036
  processFormatterCellCallback(params) {
@@ -120127,12 +120314,33 @@ class AgGridController {
120127
120314
  throw new Error('Erro interno: Grid ainda não inicializado.');
120128
120315
  }
120129
120316
  this._gridOptions.api.refreshServerSide({ purge: true });
120317
+ this._options.onRefresh();
120318
+ }
120319
+ focusOnGridContainer() {
120320
+ this._container.setAttribute('tabindex', '-1');
120321
+ this._container.focus();
120322
+ }
120323
+ setFocus() {
120324
+ var _a, _b;
120325
+ if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
120326
+ this.setFocusFirstRow();
120327
+ }
120328
+ else {
120329
+ this.focusOnGridContainer();
120330
+ }
120331
+ }
120332
+ setAutoFocus(autoFocus) {
120333
+ var _a;
120334
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
120130
120335
  }
120131
120336
  setFocusFirstRow() {
120132
120337
  const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
120133
120338
  if (firstRow) {
120134
120339
  this.setFocusOnRow(firstRow.rowIndex);
120135
120340
  }
120341
+ else {
120342
+ this.focusOnGridContainer();
120343
+ }
120136
120344
  }
120137
120345
  setFocusLastRow() {
120138
120346
  const lastRow = this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());
@@ -120211,8 +120419,8 @@ class AgGridController {
120211
120419
  //Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
120212
120420
  const columnsOffset = colDef.length - columns.length;
120213
120421
  let sort = [];
120214
- state.forEach((cfgColumn, index) => {
120215
- const colWidth = this.getColumnWidth(cfgColumn);
120422
+ state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
120423
+ const colWidth = this._gridOptions.columnApi.getColumn(cfgColumn.name).getActualWidth();
120216
120424
  this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
120217
120425
  this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
120218
120426
  visibleColumns.push(cfgColumn.name);
@@ -120229,6 +120437,11 @@ class AgGridController {
120229
120437
  });
120230
120438
  this._gridConfig = state;
120231
120439
  }
120440
+ getAdaptiveWidth(width) {
120441
+ const widthGrid = this._container.clientWidth;
120442
+ const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
120443
+ return Math.round(adaptiveWidth);
120444
+ }
120232
120445
  getColumnsState() {
120233
120446
  if (this._grid === undefined) {
120234
120447
  throw new Error('Erro interno: Grid ainda não inicializado.');
@@ -120236,13 +120449,15 @@ class AgGridController {
120236
120449
  const colState = this._gridOptions.columnApi.getColumnState();
120237
120450
  return colState
120238
120451
  .map(s => {
120239
- const def = this._gridOptions.columnApi.getColumn(s.colId).getColDef();
120452
+ const column = this._gridOptions.columnApi.getColumn(s.colId);
120453
+ const def = column.getColDef();
120454
+ const width = this.getAdaptiveWidth(column.getActualWidth());
120240
120455
  const label = def.headerName;
120241
120456
  const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
120242
120457
  const colState = { label, name };
120243
120458
  this.conditionalSet(colState, 'sort', s.sort);
120244
120459
  this.conditionalSet(colState, 'sortIndex', s.sortIndex);
120245
- this.conditionalSet(colState, 'width', s.width);
120460
+ this.conditionalSet(colState, 'width', width);
120246
120461
  this.conditionalSet(colState, 'pinned', s.pinned !== null);
120247
120462
  this.conditionalSet(colState, 'hidden', s.hide);
120248
120463
  const props = new Map();
@@ -120308,12 +120523,19 @@ class AgGridController {
120308
120523
  showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
120309
120524
  },
120310
120525
  valueFormatter: params => {
120311
- if (params.value === undefined) {
120526
+ if (params.value === undefined || params.value === null) {
120312
120527
  return "";
120313
120528
  }
120314
120529
  if (params.value instanceof Promise) {
120315
120530
  return "Carregando...";
120316
120531
  }
120532
+ const customFormatter = this._customFormatters.get(source.name);
120533
+ if (customFormatter) {
120534
+ const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
120535
+ if (formattedValue) {
120536
+ return formattedValue;
120537
+ }
120538
+ }
120317
120539
  if (this._dataUnit) {
120318
120540
  return this._dataUnit.getFormattedValue(source.name, params.value);
120319
120541
  }
@@ -120322,6 +120544,13 @@ class AgGridController {
120322
120544
  cellStyle: this.getStyleByColumn(source),
120323
120545
  });
120324
120546
  }
120547
+ setCustomFormatters(customFormatters) {
120548
+ this._customFormatters = customFormatters;
120549
+ }
120550
+ refreshSelectedRows() {
120551
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
120552
+ this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
120553
+ }
120325
120554
  getInitCellStyle() {
120326
120555
  return {
120327
120556
  'line-height': this.getRowHeight() - 1 + 'px',
@@ -120482,26 +120711,52 @@ class AgGridController {
120482
120711
  host[attribute] = value;
120483
120712
  }
120484
120713
  }
120485
- getColumnWidth(cfgColumn) {
120486
- var _a, _b;
120487
- if (cfgColumn == undefined) {
120714
+ setCellEditors(customEditors) {
120715
+ var _a;
120716
+ if (!this._editionManager) {
120717
+ this._customEditors = customEditors;
120488
120718
  return;
120489
120719
  }
120490
- if (cfgColumn.customWidth != undefined) {
120491
- return cfgColumn.customWidth;
120492
- }
120493
- const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
120494
- if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
120495
- return this.DEFAULT_MAX_SIZE;
120720
+ this._editionManager.setCellEditors(customEditors);
120721
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120722
+ }
120723
+ setCellRenders(customRenders) {
120724
+ var _a;
120725
+ if (!this._editionManager) {
120726
+ this._customRenders = customRenders;
120727
+ return;
120496
120728
  }
120497
- const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
120498
- return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
120729
+ this._editionManager.setCellRenders(customRenders);
120730
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120731
+ }
120732
+ }
120733
+
120734
+ function enableSelectAll(total) {
120735
+ return total !== undefined;
120736
+ }
120737
+ function buildSelectAllLabel(allRecordSelected, count, total) {
120738
+ if (allRecordSelected)
120739
+ return 'Selecionar apenas a página atual';
120740
+ if (total === undefined)
120741
+ return `Carregando todos os ${count} registros`;
120742
+ return `Selecionar todos os ${total} registros`;
120743
+ }
120744
+ function buildSelectAllTitle(total) {
120745
+ if (enableSelectAll(total))
120746
+ return '';
120747
+ return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
120748
+ }
120749
+ function getText(selectionCount, allSelectedRecords) {
120750
+ if (allSelectedRecords) {
120751
+ return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
120499
120752
  }
120753
+ const pluralCharacter = selectionCount > 1 ? "s" : "";
120754
+ return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
120500
120755
  }
120501
120756
 
120502
120757
  const SelectionCounter = (props) => {
120503
120758
  const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
120504
- const { total, hasMore } = paginationInfo || {};
120759
+ const { total, hasMore, count } = paginationInfo || {};
120505
120760
  const shouldRenderSelectionButton = () => {
120506
120761
  if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
120507
120762
  return false;
@@ -120515,20 +120770,11 @@ const SelectionCounter = (props) => {
120515
120770
  h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
120516
120771
  h("div", { class: "ez-flex ez-margin-right--medium" },
120517
120772
  shouldRenderSelectionButton() &&
120518
- h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allRecordSelected ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
120519
- h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
120773
+ h("ez-button", Object.assign({ key: "selectAllRecordsEzButton", title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
120774
+ h("ez-button", Object.assign({ key: "clearAllSelectionEzButton", class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
120520
120775
  h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
120521
120776
  h("ez-icon", { iconName: "close" })))));
120522
120777
  };
120523
- function getText(selectionCount, allSelectedRecords) {
120524
- if (allSelectedRecords) {
120525
- return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
120526
- }
120527
- else {
120528
- const pluralChar = selectionCount > 1 ? "s" : "";
120529
- return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
120530
- }
120531
- }
120532
120778
  function getElementID(sufix) {
120533
120779
  return {
120534
120780
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
@@ -120690,7 +120936,7 @@ class InMemoryFilterColumnDataSource {
120690
120936
  }
120691
120937
  }
120692
120938
 
120693
- const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}";
120939
+ const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}";
120694
120940
 
120695
120941
  const windowInstace = window;
120696
120942
  const matches = (text, filter) => {
@@ -120708,6 +120954,8 @@ const EzGrid = class {
120708
120954
  this.componentReady = createEvent(this, "componentReady", 7);
120709
120955
  this._gridController = new AgGridController(false);
120710
120956
  this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
120957
+ this._customEditor = new Map();
120958
+ this._customRenders = new Map();
120711
120959
  this._paginationInfo = undefined;
120712
120960
  this._paginationChangedByKeyboard = true;
120713
120961
  this._showSelectionCounter = false;
@@ -120715,6 +120963,7 @@ const EzGrid = class {
120715
120963
  this._currentPageSelected = undefined;
120716
120964
  this._selectionCount = undefined;
120717
120965
  this._hasLeftButtons = false;
120966
+ this._customFormatters = new Map();
120718
120967
  this.multipleSelection = undefined;
120719
120968
  this.config = undefined;
120720
120969
  this.selectionToastConfig = undefined;
@@ -120725,6 +120974,7 @@ const EzGrid = class {
120725
120974
  this.useEnterLikeTab = false;
120726
120975
  this.recordsValidator = undefined;
120727
120976
  this.canEdit = true;
120977
+ this.autoFocus = true;
120728
120978
  }
120729
120979
  /**
120730
120980
  * Aplica a definição de colunas.
@@ -120786,6 +121036,69 @@ const EzGrid = class {
120786
121036
  async filterColumns(search) {
120787
121037
  return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
120788
121038
  }
121039
+ /**
121040
+ * Registra um editor customizado para campos da grade e formulário.
121041
+ */
121042
+ async addCustomEditor(fieldName, customEditor, detailContext) {
121043
+ const newCustomEditor = new Map(this._customEditor);
121044
+ newCustomEditor.set(fieldName, {
121045
+ customEditor,
121046
+ detailContext,
121047
+ });
121048
+ this._customEditor = newCustomEditor;
121049
+ this._gridController.setCellEditors(newCustomEditor);
121050
+ }
121051
+ /**
121052
+ * Registra um render customizado para colunas da grid.
121053
+ */
121054
+ async addGridCustomRender(fieldName, customRender, detailContext) {
121055
+ const newCustomRenders = new Map(this._customRenders);
121056
+ newCustomRenders.set(fieldName, { customRender, detailContext });
121057
+ this._customRenders = newCustomRenders;
121058
+ this._gridController.setCellRenders(newCustomRenders);
121059
+ }
121060
+ /**
121061
+ * Registra um formatador de valores para uma coluna da grid.
121062
+ */
121063
+ async addCustomValueFormatter(columnName, customFormatter) {
121064
+ if (!columnName || !customFormatter) {
121065
+ return;
121066
+ }
121067
+ const newCustomFormatters = new Map(this._customFormatters);
121068
+ newCustomFormatters.set(columnName, customFormatter);
121069
+ this._customFormatters = newCustomFormatters;
121070
+ this._gridController.setCustomFormatters(newCustomFormatters);
121071
+ }
121072
+ /**
121073
+ * Remove o formatador de valores de uma coluna da grid.
121074
+ */
121075
+ async removeCustomValueFormatter(columnName) {
121076
+ if (!columnName) {
121077
+ return;
121078
+ }
121079
+ const newCustomFormatters = new Map(this._customFormatters);
121080
+ newCustomFormatters.delete(columnName);
121081
+ this._customFormatters = newCustomFormatters;
121082
+ this._gridController.setCustomFormatters(newCustomFormatters);
121083
+ }
121084
+ /**
121085
+ * Atualiza linhas da grade.
121086
+ */
121087
+ async refreshSelectedRows() {
121088
+ this._gridController.refreshSelectedRows();
121089
+ }
121090
+ /**
121091
+ * Retorna o formatador customizado da coluna caso exista.
121092
+ */
121093
+ async getCustomValueFormatter(columnName) {
121094
+ return this._customFormatters.get(columnName);
121095
+ }
121096
+ /**
121097
+ * Atribui o foco para a grade.
121098
+ */
121099
+ async setFocus() {
121100
+ this._gridController.setFocus();
121101
+ }
120789
121102
  observeConfig(config) {
120790
121103
  this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
120791
121104
  }
@@ -120939,7 +121252,9 @@ const EzGrid = class {
120939
121252
  const dataInfo = { dataUnit: this.dataUnit };
120940
121253
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
120941
121254
  const dtInfo = { id: 'ezGrid' };
120942
- ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
121255
+ if (this._refPaginationControl) {
121256
+ ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
121257
+ }
120943
121258
  }
120944
121259
  previousPage() {
120945
121260
  if (this.dataUnit) {
@@ -120959,14 +121274,10 @@ const EzGrid = class {
120959
121274
  (_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
120960
121275
  }
120961
121276
  getPaginationControl() {
120962
- if (this._paginationInfo) {
120963
- const { currentPage, hasMore } = this._paginationInfo;
120964
- return [
120965
- h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
120966
- h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
120967
- ];
120968
- }
120969
- return null;
121277
+ if (!this._paginationInfo)
121278
+ return null;
121279
+ const { currentPage, hasMore } = this._paginationInfo;
121280
+ return (h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
120970
121281
  }
120971
121282
  componentDidLoad() {
120972
121283
  this._gridController.initDatagrid(this._container, {
@@ -120987,7 +121298,14 @@ const EzGrid = class {
120987
121298
  statusResolver: this.statusResolver,
120988
121299
  useEnterLikeTab: this.useEnterLikeTab,
120989
121300
  recordsValidator: this.recordsValidator,
120990
- editionIsDisabled: () => !this.canEdit
121301
+ editionIsDisabled: () => !this.canEdit,
121302
+ customFormatters: this._customFormatters,
121303
+ autoFocus: this.autoFocus,
121304
+ onRefresh: () => {
121305
+ if (this.dataUnit) {
121306
+ this.setSelection(this.dataUnit.getSelectionInfo());
121307
+ }
121308
+ }
120991
121309
  });
120992
121310
  if (this.config) {
120993
121311
  this.observeConfig(this.config);
@@ -121003,7 +121321,7 @@ const EzGrid = class {
121003
121321
  }
121004
121322
  handlePaginationChange(selectFirstRecord, paginationInfo) {
121005
121323
  var _a;
121006
- if (selectFirstRecord !== false) {
121324
+ if (selectFirstRecord !== false && this.autoFocus) {
121007
121325
  if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
121008
121326
  this._gridController.setFocusLastRow();
121009
121327
  }
@@ -121073,6 +121391,9 @@ const EzGrid = class {
121073
121391
  if (!this.dataUnit.name.includes("InMemoryDataUnit"))
121074
121392
  return;
121075
121393
  }
121394
+ componentDidUpdate() {
121395
+ this._gridController.setAutoFocus(this.autoFocus);
121396
+ }
121076
121397
  getDataSource() {
121077
121398
  var _a;
121078
121399
  return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
@@ -121082,7 +121403,7 @@ const EzGrid = class {
121082
121403
  }
121083
121404
  render() {
121084
121405
  var _a;
121085
- return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121406
+ return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), this.getPaginationControl())), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121086
121407
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
121087
121408
  ` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
121088
121409
  }