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

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 +376 -54
  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 +71 -23
  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 +1163 -166
  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 +376 -54
  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-b44741b0.entry.js → p-3bb2491c.entry.js} +2 -2
  180. package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
  181. package/dist/ezui/p-439fbc78.entry.js +1 -0
  182. package/dist/ezui/p-4607fb89.js +1 -0
  183. package/dist/ezui/p-569a0b9a.entry.js +1 -0
  184. package/dist/ezui/p-5fefcdc9.entry.js +1 -0
  185. package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
  186. package/dist/ezui/p-6ec40dec.entry.js +1 -0
  187. package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
  188. package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
  189. package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
  190. package/dist/ezui/p-81cffa53.entry.js +1 -0
  191. package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
  192. package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
  193. package/dist/ezui/p-868b56f7.entry.js +1 -0
  194. package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
  195. package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
  196. package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
  197. package/dist/ezui/{p-f3c526cc.entry.js → p-9a11e223.entry.js} +1 -1
  198. package/dist/ezui/{p-7af81663.entry.js → p-9a23d513.entry.js} +1 -1
  199. package/dist/ezui/p-9aa27e69.entry.js +1 -0
  200. package/dist/ezui/{p-784fe207.entry.js → p-9c2e2d68.entry.js} +1 -1
  201. package/dist/ezui/p-a35b41e6.entry.js +1 -0
  202. package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
  203. package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
  204. package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
  205. package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
  206. package/dist/ezui/p-c5a80844.entry.js +1 -0
  207. package/dist/ezui/{p-d9401ea0.entry.js → p-cd1a2e6b.entry.js} +1 -1
  208. package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
  209. package/dist/ezui/p-de870657.entry.js +1 -0
  210. package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
  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
@@ -2,12 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a7b0c73d.js');
5
+ const index = require('./index-9e5554cb.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
8
8
  const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
9
9
  require('./DialogType-2114c337.js');
10
10
  require('./CheckMode-ecb90b87.js');
11
+ const ICustomRender = require('./ICustomRender-6fafffce.js');
11
12
  const constants = require('./constants-2714478b.js');
12
13
  const RecordValidationProcessor = require('./RecordValidationProcessor-4c893e04.js');
13
14
 
@@ -118860,6 +118861,11 @@ class DataSource {
118860
118861
  });
118861
118862
  }
118862
118863
  }
118864
+ handleFocusFirstRow() {
118865
+ if (this._options.autoFocus) {
118866
+ this._controller.setFocusFirstRow();
118867
+ }
118868
+ }
118863
118869
  isSilentChange(action) {
118864
118870
  //TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
118865
118871
  var _a, _b;
@@ -118867,7 +118873,7 @@ class DataSource {
118867
118873
  return false;
118868
118874
  }
118869
118875
  if (action.type === core.Action.DATA_CHANGED) {
118870
- 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;
118876
+ 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; });
118871
118877
  }
118872
118878
  if (action.type === core.Action.EDITION_CANCELED) {
118873
118879
  return ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.silent) === true;
@@ -118891,6 +118897,7 @@ class DataSource {
118891
118897
  this._options.onPaginationChange(this._dataUnit.getPaginationInfo(), action.payload.selectFirstRecord);
118892
118898
  }
118893
118899
  this.updateSelection();
118900
+ this.handleFocusFirstRow();
118894
118901
  break;
118895
118902
  case core.Action.PAGINATION_UPDATED:
118896
118903
  if (this._options) {
@@ -118933,6 +118940,9 @@ class DataSource {
118933
118940
  this._controller.selectRows(selectionInfo.recordIds, true);
118934
118941
  }
118935
118942
  }
118943
+ setAutoFocus(autoFocus) {
118944
+ this._options.autoFocus = autoFocus;
118945
+ }
118936
118946
  getRows(params) {
118937
118947
  if (this.needReload(params)) {
118938
118948
  this._lastLoadingParams = params;
@@ -119318,8 +119328,9 @@ const buildDateTime = ({ readOnly }) => {
119318
119328
  };
119319
119329
 
119320
119330
  const buildDecimal = ({ readOnly, props }) => {
119321
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
119322
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
119331
+ var _a, _b;
119332
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
119333
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
119323
119334
  return buildNumeric(readOnly, precision, prettyPrecision);
119324
119335
  };
119325
119336
  const buildInteger = ({ readOnly }) => {
@@ -119412,11 +119423,12 @@ uiBuilders.set(core.UserInterface.LONGTEXT, buildTextAreaInput);
119412
119423
  uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
119413
119424
  class EzCellEditor {
119414
119425
  init(params) {
119426
+ this._rowData = params.data;
119415
119427
  const fieldName = params.column.getColId();
119416
119428
  const dataUnit = params.context.dataUnit;
119417
- const fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119418
- const builder = uiBuilders.get(fieldMetadata.userInterface) || buildTextInput;
119419
- this._gui = builder(fieldMetadata);
119429
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119430
+ const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
119431
+ this._gui = builder(this._fieldMetadata);
119420
119432
  if (this._gui.valueSetter != undefined) {
119421
119433
  this._gui.valueSetter(params.value);
119422
119434
  }
@@ -119440,10 +119452,151 @@ class EzCellEditor {
119440
119452
  isPopup() {
119441
119453
  return this._gui.isPopUp;
119442
119454
  }
119455
+ getFieldMetadata() {
119456
+ return this._fieldMetadata;
119457
+ }
119458
+ getRecord() {
119459
+ return this._rowData;
119460
+ }
119461
+ }
119462
+
119463
+ class EzGridCustomCellEditor extends EzCellEditor {
119464
+ init(params) {
119465
+ var _a, _b;
119466
+ this._value = params.value;
119467
+ this._fieldName = params.column.getColId();
119468
+ this._customEditorInstance = params.customEditorsInfo.customEditor;
119469
+ super.init(params);
119470
+ this._defaultGui = this.getDefaultGui();
119471
+ const fieldMetadata = super.getFieldMetadata();
119472
+ this._params = {
119473
+ value: params.value,
119474
+ charPress: params.charPress,
119475
+ currentEditor: this._defaultGui,
119476
+ name: this._fieldName,
119477
+ source: ICustomRender.CustomEditorSource.GRID,
119478
+ detailContext: params.customEditorsInfo.detailContext,
119479
+ setValue: (value) => this.setValue(value),
119480
+ getValue: () => this.getValue(),
119481
+ record: super.getRecord(),
119482
+ editorMetadata: {
119483
+ hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
119484
+ label: fieldMetadata.label,
119485
+ userInterface: fieldMetadata.userInterface,
119486
+ props: fieldMetadata.props,
119487
+ optionLoader: fieldMetadata.optionLoader,
119488
+ options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
119489
+ },
119490
+ };
119491
+ }
119492
+ getDefaultGui() {
119493
+ const gui = super.getGui();
119494
+ gui.value = this._value;
119495
+ gui.onkeyup = (event) => {
119496
+ const value = event.target.value;
119497
+ this.setValue(value);
119498
+ };
119499
+ return gui;
119500
+ }
119501
+ getGui() {
119502
+ const editorElement = this._customEditorInstance.getEditorElement(this._params);
119503
+ if (!editorElement) {
119504
+ return this._defaultGui;
119505
+ }
119506
+ if (typeof editorElement === 'string') {
119507
+ const element = core.HTMLBuilder.parseElement(editorElement);
119508
+ return element;
119509
+ }
119510
+ return editorElement;
119511
+ }
119512
+ setValue(value) {
119513
+ this._value = value;
119514
+ }
119515
+ getValue() {
119516
+ return this._value;
119517
+ }
119518
+ }
119519
+
119520
+ class EzCellRender {
119521
+ init(params) {
119522
+ const span = document.createElement('span');
119523
+ this._currentParams = params;
119524
+ span.textContent = params.value;
119525
+ const fieldName = params.column.getColId();
119526
+ const dataUnit = params.context.dataUnit;
119527
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119528
+ this._gui = span;
119529
+ }
119530
+ refresh() {
119531
+ try {
119532
+ this._currentParams.refreshCell();
119533
+ return true;
119534
+ }
119535
+ catch (_a) {
119536
+ return false;
119537
+ }
119538
+ }
119539
+ getGui() {
119540
+ return this._gui;
119541
+ }
119542
+ afterGuiAttached() {
119543
+ this.focusIn();
119544
+ }
119545
+ focusIn() {
119546
+ this._gui.focus();
119547
+ this._gui.setFocus({ selectText: true });
119548
+ }
119549
+ getValue() {
119550
+ return this._currentParams.getValue();
119551
+ }
119552
+ isPopup() {
119553
+ return this._gui.isPopUp;
119554
+ }
119555
+ getFieldMetadata() {
119556
+ return this._fieldMetadata;
119557
+ }
119558
+ }
119559
+
119560
+ class EzGridCustomCellRender extends EzCellRender {
119561
+ init(params) {
119562
+ var _a, _b;
119563
+ this._fieldName = params.column.getColId();
119564
+ this._customRenderInstance = params.customRendersInfo.customRender;
119565
+ super.init(params);
119566
+ const fieldMetadata = super.getFieldMetadata();
119567
+ this._params = {
119568
+ value: params.value,
119569
+ charPress: '',
119570
+ currentRender: super.getGui(),
119571
+ name: this._fieldName,
119572
+ source: ICustomRender.CustomRenderSource.GRID,
119573
+ getValue: () => params.getValue(),
119574
+ detailContext: params.customRendersInfo.detailContext,
119575
+ renderMetadata: {
119576
+ hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
119577
+ label: fieldMetadata.label,
119578
+ userInterface: fieldMetadata.userInterface,
119579
+ props: fieldMetadata.props,
119580
+ optionLoader: fieldMetadata.optionLoader,
119581
+ options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
119582
+ }
119583
+ };
119584
+ }
119585
+ getGui() {
119586
+ const editorElement = this._customRenderInstance.getRenderElement(this._params);
119587
+ if (!editorElement) {
119588
+ return super.getGui();
119589
+ }
119590
+ if (typeof editorElement === 'string') {
119591
+ const element = core.HTMLBuilder.parseElement(editorElement);
119592
+ return element;
119593
+ }
119594
+ return editorElement;
119595
+ }
119443
119596
  }
119444
119597
 
119445
119598
  class GridEditionManager {
119446
- constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
119599
+ constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
119447
119600
  this._dataUnit = dataUnit;
119448
119601
  this._recordValidationProcessor = new RecordValidationProcessor.RecordValidationProcessor(this._dataUnit, {
119449
119602
  getRequiredFields: () => this.getRequiredFields(),
@@ -119452,6 +119605,8 @@ class GridEditionManager {
119452
119605
  }, recordsValidator);
119453
119606
  this._useEnterLikeTab = useEnterLikeTab;
119454
119607
  this._editionIsDisabled = editionIsDisabled;
119608
+ this._customEditors = customEditors;
119609
+ this._customRenders = customRenders;
119455
119610
  }
119456
119611
  configureGrid(options) {
119457
119612
  this._gridOptions = options;
@@ -119518,6 +119673,30 @@ class GridEditionManager {
119518
119673
  col.suppressKeyboardEvent = (params) => {
119519
119674
  return params.event.key === KeyCode.ENTER;
119520
119675
  };
119676
+ col.cellEditorSelector = (params) => {
119677
+ var _a;
119678
+ if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
119679
+ const customEditor = this._customEditors.get(params.colDef.field);
119680
+ return {
119681
+ component: EzGridCustomCellEditor,
119682
+ params: {
119683
+ customEditorsInfo: customEditor,
119684
+ }
119685
+ };
119686
+ }
119687
+ };
119688
+ col.cellRendererSelector = (params) => {
119689
+ var _a;
119690
+ if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
119691
+ const customRender = this._customRenders.get(params.colDef.field);
119692
+ return {
119693
+ component: EzGridCustomCellRender,
119694
+ params: {
119695
+ customRendersInfo: customRender,
119696
+ }
119697
+ };
119698
+ }
119699
+ };
119521
119700
  return col;
119522
119701
  }
119523
119702
  getRequiredFields() {
@@ -119659,6 +119838,12 @@ class GridEditionManager {
119659
119838
  this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
119660
119839
  }
119661
119840
  }
119841
+ setCellEditors(customEditors) {
119842
+ this._customEditors = customEditors;
119843
+ }
119844
+ setCellRenders(customRenders) {
119845
+ this._customRenders = customRenders;
119846
+ }
119662
119847
  }
119663
119848
  class TargetEdition {
119664
119849
  constructor(rowIndex, column, backwards) {
@@ -119695,14 +119880,13 @@ class AgGridController {
119695
119880
  this.STATUS_COL_ID = 'statusColumn';
119696
119881
  this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
119697
119882
  this.BLOCK_LOAD_DEBOUNCE = 100;
119698
- this.DEFAULT_FONT_SIZE = 14;
119699
- this.DEFAULT_ICON_SIZE = 12;
119700
- this.DEFAULT_MAX_SIZE = 200;
119883
+ this.DOC_WIDTH = 1150;
119701
119884
  this._menuItems = [];
119702
119885
  this._idAttribName = '__record__id__';
119703
119886
  this._gridConfig = [];
119704
119887
  this._filteredColumns = new Map();
119705
119888
  this._filterColumnleftPosition = 0;
119889
+ this._customFormatters = new Map();
119706
119890
  this._enterprise = enterprise;
119707
119891
  }
119708
119892
  getGridConfig() {
@@ -119779,6 +119963,8 @@ class AgGridController {
119779
119963
  }
119780
119964
  initDatagrid(container, options) {
119781
119965
  var _a;
119966
+ this._options = options;
119967
+ this._container = container;
119782
119968
  if (this._grid === undefined) {
119783
119969
  LicenseManager.setLicenseKey(core.ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
119784
119970
  this._columnStateChangeCallback = options.onColumnStateChange;
@@ -119786,7 +119972,7 @@ class AgGridController {
119786
119972
  this._doubleClickCallBack = options.onDoubleClick;
119787
119973
  this._multipleSelection = options.allowMultipleSelection;
119788
119974
  this._dataUnit = options.dataUnit;
119789
- this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
119975
+ this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
119790
119976
  this._statusResolver = options.statusResolver;
119791
119977
  if (this._dataUnit) {
119792
119978
  this._dataUnit.sortingProvider = this;
@@ -119848,6 +120034,7 @@ class AgGridController {
119848
120034
  this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
119849
120035
  }
119850
120036
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
120037
+ this._customFormatters = options.customFormatters;
119851
120038
  }
119852
120039
  }
119853
120040
  processFormatterCellCallback(params) {
@@ -120131,12 +120318,33 @@ class AgGridController {
120131
120318
  throw new Error('Erro interno: Grid ainda não inicializado.');
120132
120319
  }
120133
120320
  this._gridOptions.api.refreshServerSide({ purge: true });
120321
+ this._options.onRefresh();
120322
+ }
120323
+ focusOnGridContainer() {
120324
+ this._container.setAttribute('tabindex', '-1');
120325
+ this._container.focus();
120326
+ }
120327
+ setFocus() {
120328
+ var _a, _b;
120329
+ if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
120330
+ this.setFocusFirstRow();
120331
+ }
120332
+ else {
120333
+ this.focusOnGridContainer();
120334
+ }
120335
+ }
120336
+ setAutoFocus(autoFocus) {
120337
+ var _a;
120338
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
120134
120339
  }
120135
120340
  setFocusFirstRow() {
120136
120341
  const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
120137
120342
  if (firstRow) {
120138
120343
  this.setFocusOnRow(firstRow.rowIndex);
120139
120344
  }
120345
+ else {
120346
+ this.focusOnGridContainer();
120347
+ }
120140
120348
  }
120141
120349
  setFocusLastRow() {
120142
120350
  const lastRow = this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());
@@ -120214,9 +120422,11 @@ class AgGridController {
120214
120422
  //Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
120215
120423
  //Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
120216
120424
  const columnsOffset = colDef.length - columns.length;
120425
+ this._gridConfig = state;
120217
120426
  let sort = [];
120218
- state.forEach((cfgColumn, index) => {
120219
- const colWidth = this.getColumnWidth(cfgColumn);
120427
+ state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
120428
+ var _a;
120429
+ const colWidth = (_a = this._gridOptions.columnApi.getColumn(cfgColumn.name)) === null || _a === void 0 ? void 0 : _a.getActualWidth();
120220
120430
  this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
120221
120431
  this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
120222
120432
  visibleColumns.push(cfgColumn.name);
@@ -120231,7 +120441,11 @@ class AgGridController {
120231
120441
  state: sort,
120232
120442
  defaultState: { sort: null },
120233
120443
  });
120234
- this._gridConfig = state;
120444
+ }
120445
+ getAdaptiveWidth(width) {
120446
+ const widthGrid = this._container.clientWidth;
120447
+ const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
120448
+ return Math.round(adaptiveWidth);
120235
120449
  }
120236
120450
  getColumnsState() {
120237
120451
  if (this._grid === undefined) {
@@ -120240,13 +120454,15 @@ class AgGridController {
120240
120454
  const colState = this._gridOptions.columnApi.getColumnState();
120241
120455
  return colState
120242
120456
  .map(s => {
120243
- const def = this._gridOptions.columnApi.getColumn(s.colId).getColDef();
120457
+ const column = this._gridOptions.columnApi.getColumn(s.colId);
120458
+ const def = column.getColDef();
120459
+ const width = this.getAdaptiveWidth(column.getActualWidth());
120244
120460
  const label = def.headerName;
120245
120461
  const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
120246
120462
  const colState = { label, name };
120247
120463
  this.conditionalSet(colState, 'sort', s.sort);
120248
120464
  this.conditionalSet(colState, 'sortIndex', s.sortIndex);
120249
- this.conditionalSet(colState, 'width', s.width);
120465
+ this.conditionalSet(colState, 'width', width);
120250
120466
  this.conditionalSet(colState, 'pinned', s.pinned !== null);
120251
120467
  this.conditionalSet(colState, 'hidden', s.hide);
120252
120468
  const props = new Map();
@@ -120312,12 +120528,19 @@ class AgGridController {
120312
120528
  showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
120313
120529
  },
120314
120530
  valueFormatter: params => {
120315
- if (params.value === undefined) {
120531
+ if (params.value === undefined || params.value === null) {
120316
120532
  return "";
120317
120533
  }
120318
120534
  if (params.value instanceof Promise) {
120319
120535
  return "Carregando...";
120320
120536
  }
120537
+ const customFormatter = this._customFormatters.get(source.name);
120538
+ if (customFormatter) {
120539
+ const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
120540
+ if (formattedValue) {
120541
+ return formattedValue;
120542
+ }
120543
+ }
120321
120544
  if (this._dataUnit) {
120322
120545
  return this._dataUnit.getFormattedValue(source.name, params.value);
120323
120546
  }
@@ -120326,6 +120549,13 @@ class AgGridController {
120326
120549
  cellStyle: this.getStyleByColumn(source),
120327
120550
  });
120328
120551
  }
120552
+ setCustomFormatters(customFormatters) {
120553
+ this._customFormatters = customFormatters;
120554
+ }
120555
+ refreshSelectedRows() {
120556
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
120557
+ this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
120558
+ }
120329
120559
  getInitCellStyle() {
120330
120560
  return {
120331
120561
  'line-height': this.getRowHeight() - 1 + 'px',
@@ -120486,26 +120716,52 @@ class AgGridController {
120486
120716
  host[attribute] = value;
120487
120717
  }
120488
120718
  }
120489
- getColumnWidth(cfgColumn) {
120490
- var _a, _b;
120491
- if (cfgColumn == undefined) {
120719
+ setCellEditors(customEditors) {
120720
+ var _a;
120721
+ if (!this._editionManager) {
120722
+ this._customEditors = customEditors;
120492
120723
  return;
120493
120724
  }
120494
- if (cfgColumn.customWidth != undefined) {
120495
- return cfgColumn.customWidth;
120496
- }
120497
- const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
120498
- if ((field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH) {
120499
- return this.DEFAULT_MAX_SIZE;
120725
+ this._editionManager.setCellEditors(customEditors);
120726
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120727
+ }
120728
+ setCellRenders(customRenders) {
120729
+ var _a;
120730
+ if (!this._editionManager) {
120731
+ this._customRenders = customRenders;
120732
+ return;
120500
120733
  }
120501
- 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;
120502
- return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
120734
+ this._editionManager.setCellRenders(customRenders);
120735
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120736
+ }
120737
+ }
120738
+
120739
+ function enableSelectAll(total) {
120740
+ return total !== undefined;
120741
+ }
120742
+ function buildSelectAllLabel(allRecordSelected, count, total) {
120743
+ if (allRecordSelected)
120744
+ return 'Selecionar apenas a página atual';
120745
+ if (total === undefined)
120746
+ return `Carregando todos os ${count} registros`;
120747
+ return `Selecionar todos os ${total} registros`;
120748
+ }
120749
+ function buildSelectAllTitle(total) {
120750
+ if (enableSelectAll(total))
120751
+ return '';
120752
+ return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
120753
+ }
120754
+ function getText(selectionCount, allSelectedRecords) {
120755
+ if (allSelectedRecords) {
120756
+ return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
120503
120757
  }
120758
+ const pluralCharacter = selectionCount > 1 ? "s" : "";
120759
+ return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
120504
120760
  }
120505
120761
 
120506
120762
  const SelectionCounter = (props) => {
120507
120763
  const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
120508
- const { total, hasMore } = paginationInfo || {};
120764
+ const { total, hasMore, count } = paginationInfo || {};
120509
120765
  const shouldRenderSelectionButton = () => {
120510
120766
  if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
120511
120767
  return false;
@@ -120519,20 +120775,11 @@ const SelectionCounter = (props) => {
120519
120775
  index.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"))),
120520
120776
  index.h("div", { class: "ez-flex ez-margin-right--medium" },
120521
120777
  shouldRenderSelectionButton() &&
120522
- index.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"}`))),
120523
- index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
120778
+ index.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"}`))),
120779
+ index.h("ez-button", Object.assign({ key: "clearAllSelectionEzButton", class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
120524
120780
  index.h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
120525
120781
  index.h("ez-icon", { iconName: "close" })))));
120526
120782
  };
120527
- function getText(selectionCount, allSelectedRecords) {
120528
- if (allSelectedRecords) {
120529
- return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
120530
- }
120531
- else {
120532
- const pluralChar = selectionCount > 1 ? "s" : "";
120533
- return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
120534
- }
120535
- }
120536
120783
  function getElementID(sufix) {
120537
120784
  return {
120538
120785
  [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(sufix)
@@ -120694,7 +120941,7 @@ class InMemoryFilterColumnDataSource {
120694
120941
  }
120695
120942
  }
120696
120943
 
120697
- 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}";
120944
+ 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}";
120698
120945
 
120699
120946
  const windowInstace = window;
120700
120947
  const matches = (text, filter) => {
@@ -120712,6 +120959,8 @@ const EzGrid = class {
120712
120959
  this.componentReady = index.createEvent(this, "componentReady", 7);
120713
120960
  this._gridController = new AgGridController(false);
120714
120961
  this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
120962
+ this._customEditor = new Map();
120963
+ this._customRenders = new Map();
120715
120964
  this._paginationInfo = undefined;
120716
120965
  this._paginationChangedByKeyboard = true;
120717
120966
  this._showSelectionCounter = false;
@@ -120719,6 +120968,7 @@ const EzGrid = class {
120719
120968
  this._currentPageSelected = undefined;
120720
120969
  this._selectionCount = undefined;
120721
120970
  this._hasLeftButtons = false;
120971
+ this._customFormatters = new Map();
120722
120972
  this.multipleSelection = undefined;
120723
120973
  this.config = undefined;
120724
120974
  this.selectionToastConfig = undefined;
@@ -120729,6 +120979,7 @@ const EzGrid = class {
120729
120979
  this.useEnterLikeTab = false;
120730
120980
  this.recordsValidator = undefined;
120731
120981
  this.canEdit = true;
120982
+ this.autoFocus = true;
120732
120983
  }
120733
120984
  /**
120734
120985
  * Aplica a definição de colunas.
@@ -120790,6 +121041,69 @@ const EzGrid = class {
120790
121041
  async filterColumns(search) {
120791
121042
  return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
120792
121043
  }
121044
+ /**
121045
+ * Registra um editor customizado para campos da grade e formulário.
121046
+ */
121047
+ async addCustomEditor(fieldName, customEditor, detailContext) {
121048
+ const newCustomEditor = new Map(this._customEditor);
121049
+ newCustomEditor.set(fieldName, {
121050
+ customEditor,
121051
+ detailContext,
121052
+ });
121053
+ this._customEditor = newCustomEditor;
121054
+ this._gridController.setCellEditors(newCustomEditor);
121055
+ }
121056
+ /**
121057
+ * Registra um render customizado para colunas da grid.
121058
+ */
121059
+ async addGridCustomRender(fieldName, customRender, detailContext) {
121060
+ const newCustomRenders = new Map(this._customRenders);
121061
+ newCustomRenders.set(fieldName, { customRender, detailContext });
121062
+ this._customRenders = newCustomRenders;
121063
+ this._gridController.setCellRenders(newCustomRenders);
121064
+ }
121065
+ /**
121066
+ * Registra um formatador de valores para uma coluna da grid.
121067
+ */
121068
+ async addCustomValueFormatter(columnName, customFormatter) {
121069
+ if (!columnName || !customFormatter) {
121070
+ return;
121071
+ }
121072
+ const newCustomFormatters = new Map(this._customFormatters);
121073
+ newCustomFormatters.set(columnName, customFormatter);
121074
+ this._customFormatters = newCustomFormatters;
121075
+ this._gridController.setCustomFormatters(newCustomFormatters);
121076
+ }
121077
+ /**
121078
+ * Remove o formatador de valores de uma coluna da grid.
121079
+ */
121080
+ async removeCustomValueFormatter(columnName) {
121081
+ if (!columnName) {
121082
+ return;
121083
+ }
121084
+ const newCustomFormatters = new Map(this._customFormatters);
121085
+ newCustomFormatters.delete(columnName);
121086
+ this._customFormatters = newCustomFormatters;
121087
+ this._gridController.setCustomFormatters(newCustomFormatters);
121088
+ }
121089
+ /**
121090
+ * Atualiza linhas da grade.
121091
+ */
121092
+ async refreshSelectedRows() {
121093
+ this._gridController.refreshSelectedRows();
121094
+ }
121095
+ /**
121096
+ * Retorna o formatador customizado da coluna caso exista.
121097
+ */
121098
+ async getCustomValueFormatter(columnName) {
121099
+ return this._customFormatters.get(columnName);
121100
+ }
121101
+ /**
121102
+ * Atribui o foco para a grade.
121103
+ */
121104
+ async setFocus() {
121105
+ this._gridController.setFocus();
121106
+ }
120793
121107
  observeConfig(config) {
120794
121108
  this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
120795
121109
  }
@@ -120943,7 +121257,9 @@ const EzGrid = class {
120943
121257
  const dataInfo = { dataUnit: this.dataUnit };
120944
121258
  core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
120945
121259
  const dtInfo = { id: 'ezGrid' };
120946
- core.ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
121260
+ if (this._refPaginationControl) {
121261
+ core.ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
121262
+ }
120947
121263
  }
120948
121264
  previousPage() {
120949
121265
  if (this.dataUnit) {
@@ -120963,14 +121279,10 @@ const EzGrid = class {
120963
121279
  (_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
120964
121280
  }
120965
121281
  getPaginationControl() {
120966
- if (this._paginationInfo) {
120967
- const { currentPage, hasMore } = this._paginationInfo;
120968
- return [
120969
- index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, index.h("span", { class: "grid-header__pagination-label" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
120970
- index.h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, index.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" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
120971
- ];
120972
- }
120973
- return null;
121282
+ if (!this._paginationInfo)
121283
+ return null;
121284
+ const { currentPage, hasMore } = this._paginationInfo;
121285
+ return (index.h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, index.h("span", { class: "grid-header__pagination-label" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), index.h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, index.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" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
120974
121286
  }
120975
121287
  componentDidLoad() {
120976
121288
  this._gridController.initDatagrid(this._container, {
@@ -120991,7 +121303,14 @@ const EzGrid = class {
120991
121303
  statusResolver: this.statusResolver,
120992
121304
  useEnterLikeTab: this.useEnterLikeTab,
120993
121305
  recordsValidator: this.recordsValidator,
120994
- editionIsDisabled: () => !this.canEdit
121306
+ editionIsDisabled: () => !this.canEdit,
121307
+ customFormatters: this._customFormatters,
121308
+ autoFocus: this.autoFocus,
121309
+ onRefresh: () => {
121310
+ if (this.dataUnit) {
121311
+ this.setSelection(this.dataUnit.getSelectionInfo());
121312
+ }
121313
+ }
120995
121314
  });
120996
121315
  if (this.config) {
120997
121316
  this.observeConfig(this.config);
@@ -121007,7 +121326,7 @@ const EzGrid = class {
121007
121326
  }
121008
121327
  handlePaginationChange(selectFirstRecord, paginationInfo) {
121009
121328
  var _a;
121010
- if (selectFirstRecord !== false) {
121329
+ if (selectFirstRecord !== false && this.autoFocus) {
121011
121330
  if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
121012
121331
  this._gridController.setFocusLastRow();
121013
121332
  }
@@ -121077,6 +121396,9 @@ const EzGrid = class {
121077
121396
  if (!this.dataUnit.name.includes("InMemoryDataUnit"))
121078
121397
  return;
121079
121398
  }
121399
+ componentDidUpdate() {
121400
+ this._gridController.setAutoFocus(this.autoFocus);
121401
+ }
121080
121402
  getDataSource() {
121081
121403
  var _a;
121082
121404
  return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
@@ -121086,7 +121408,7 @@ const EzGrid = class {
121086
121408
  }
121087
121409
  render() {
121088
121410
  var _a;
121089
- return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: "grid-header__container grid-header__left-container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121411
+ return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: "grid-header__container grid-header__left-container" }, index.h("slot", { name: "leftButtons" })), this.getPaginationControl())), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121090
121412
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
121091
121413
  ` }, index.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) })), index.h("div", { class: "grid__footer" }, index.h("slot", { name: "footer" }))));
121092
121414
  }