@sankhyalabs/ezui 5.22.0-dev.6 → 5.22.0-dev.61

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 (331) hide show
  1. package/dist/cjs/DataBinder-b4ef826a.js +445 -0
  2. package/dist/cjs/FocusResolver-885f2173.js +35 -0
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +4 -3
  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 +12 -6
  10. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-card-item_3.cjs.entry.js +24 -8
  12. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-check.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  16. package/dist/cjs/ez-combo-box.cjs.entry.js +68 -14
  17. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +37 -7
  18. package/dist/cjs/ez-date-input.cjs.entry.js +15 -5
  19. package/dist/cjs/ez-date-time-input.cjs.entry.js +12 -5
  20. package/dist/cjs/ez-dialog.cjs.entry.js +11 -3
  21. package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +76 -9
  22. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-form-view.cjs.entry.js +23 -22
  24. package/dist/cjs/ez-form.cjs.entry.js +7 -326
  25. package/dist/cjs/ez-grid.cjs.entry.js +14819 -69705
  26. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-icon.cjs.entry.js +2 -2
  28. package/dist/cjs/ez-list.cjs.entry.js +7 -8
  29. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-modal-container.cjs.entry.js +3 -2
  31. package/dist/cjs/ez-modal.cjs.entry.js +20 -5
  32. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +3 -3
  33. package/dist/cjs/ez-number-input.cjs.entry.js +16 -3
  34. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-popup.cjs.entry.js +22 -3
  36. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-scroller_2.cjs.entry.js +4 -4
  38. package/dist/cjs/ez-search.cjs.entry.js +106 -46
  39. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +2 -2
  40. package/dist/cjs/ez-split-button.cjs.entry.js +3 -3
  41. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  42. package/dist/cjs/ez-split-panel.cjs.entry.js +15 -5
  43. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-text-area.cjs.entry.js +68 -6
  45. package/dist/cjs/ez-text-input.cjs.entry.js +154 -17
  46. package/dist/cjs/ez-time-input.cjs.entry.js +9 -2
  47. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-tooltip.cjs.entry.js +55 -0
  49. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  50. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  51. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  52. package/dist/cjs/ezui.cjs.js +2 -2
  53. package/dist/cjs/filter-column.cjs.entry.js +3 -3
  54. package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +9 -6
  55. package/dist/cjs/loader.cjs.js +2 -2
  56. package/dist/collection/collection-manifest.json +2 -1
  57. package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
  58. package/dist/collection/components/ez-button/ez-button.css +23 -13
  59. package/dist/collection/components/ez-button/ez-button.js +12 -6
  60. package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
  61. package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
  62. package/dist/collection/components/ez-check/ez-check.css +1 -6
  63. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
  64. package/dist/collection/components/ez-combo-box/ez-combo-box.css +13 -1
  65. package/dist/collection/components/ez-combo-box/ez-combo-box.js +130 -15
  66. package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
  67. package/dist/collection/components/ez-date-input/ez-date-input.js +58 -5
  68. package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +1 -1
  69. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +55 -5
  70. package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
  71. package/dist/collection/components/ez-dialog/ez-dialog.js +9 -1
  72. package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -8
  73. package/dist/collection/components/ez-filter-input/ez-filter-input.js +55 -5
  74. package/dist/collection/components/ez-form/ez-form.js +1 -0
  75. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +49 -6
  76. package/dist/collection/components/ez-form-view/ez-form-view.css +5 -2
  77. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
  78. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
  79. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
  80. package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
  81. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
  82. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
  83. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +1 -1
  84. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
  85. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +258 -53
  86. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +107 -5
  87. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +219 -42
  88. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +16 -0
  89. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
  90. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +2 -0
  91. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
  92. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
  93. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +4 -1
  94. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
  95. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +2 -0
  96. package/dist/collection/components/ez-grid/ez-grid.css +28 -7
  97. package/dist/collection/components/ez-grid/ez-grid.js +200 -7
  98. package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
  99. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +1 -1
  100. package/dist/collection/components/ez-icon/ez-icon.css +153 -149
  101. package/dist/collection/components/ez-list/ez-list.css +2 -1
  102. package/dist/collection/components/ez-list/ez-list.js +6 -7
  103. package/dist/collection/components/ez-modal/ez-modal.css +5 -1
  104. package/dist/collection/components/ez-modal/ez-modal.js +38 -5
  105. package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
  106. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +2 -3
  107. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
  108. package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
  109. package/dist/collection/components/ez-number-input/ez-number-input.js +68 -1
  110. package/dist/collection/components/ez-popup/ez-popup.css +7 -3
  111. package/dist/collection/components/ez-popup/ez-popup.js +38 -1
  112. package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
  113. package/dist/collection/components/ez-search/ez-search.css +21 -10
  114. package/dist/collection/components/ez-search/ez-search.js +189 -49
  115. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
  116. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
  117. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +3 -1
  118. package/dist/collection/components/ez-split-button/ez-split-button.css +50 -14
  119. package/dist/collection/components/ez-split-button/ez-split-button.js +3 -3
  120. package/dist/collection/components/ez-split-panel/ez-split-panel.js +35 -4
  121. package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +1 -0
  122. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +1 -0
  123. package/dist/collection/components/ez-text-area/ez-text-area.css +73 -28
  124. package/dist/collection/components/ez-text-area/ez-text-area.js +103 -3
  125. package/dist/collection/components/ez-text-input/ez-text-input.css +106 -91
  126. package/dist/collection/components/ez-text-input/ez-text-input.js +185 -15
  127. package/dist/collection/components/ez-time-input/ez-time-input.js +44 -1
  128. package/dist/collection/components/ez-tooltip/ez-tooltip.css +20 -0
  129. package/dist/collection/components/ez-tooltip/ez-tooltip.js +116 -0
  130. package/dist/collection/sw.js +46 -0
  131. package/dist/collection/utils/FocusResolver.js +31 -0
  132. package/dist/collection/utils/ResponsiveInputUtils.js +26 -0
  133. package/dist/collection/utils/form/DataBinder.js +20 -5
  134. package/dist/collection/utils/form/FormMetadata.js +2 -1
  135. package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
  136. package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
  137. package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +7 -1
  138. package/dist/custom-elements/index.d.ts +6 -0
  139. package/dist/custom-elements/index.js +15977 -70298
  140. package/dist/esm/DataBinder-d2ecbb0f.js +441 -0
  141. package/dist/esm/FocusResolver-1ccbf850.js +33 -0
  142. package/dist/esm/ez-actions-button.entry.js +4 -3
  143. package/dist/esm/ez-alert-list.entry.js +1 -1
  144. package/dist/esm/ez-alert.entry.js +1 -1
  145. package/dist/esm/ez-application.entry.js +1 -1
  146. package/dist/esm/ez-badge.entry.js +1 -1
  147. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  148. package/dist/esm/ez-button.entry.js +12 -6
  149. package/dist/esm/ez-calendar.entry.js +1 -1
  150. package/dist/esm/ez-card-item_3.entry.js +24 -8
  151. package/dist/esm/ez-chart.entry.js +1 -1
  152. package/dist/esm/ez-check.entry.js +2 -2
  153. package/dist/esm/ez-chip.entry.js +1 -1
  154. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  155. package/dist/esm/ez-combo-box.entry.js +69 -15
  156. package/dist/esm/ez-custom-form-input_2.entry.js +38 -8
  157. package/dist/esm/ez-date-input.entry.js +15 -5
  158. package/dist/esm/ez-date-time-input.entry.js +12 -5
  159. package/dist/esm/ez-dialog.entry.js +11 -3
  160. package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +76 -10
  161. package/dist/esm/ez-file-item.entry.js +1 -1
  162. package/dist/esm/ez-form-view.entry.js +23 -22
  163. package/dist/esm/ez-form.entry.js +6 -325
  164. package/dist/esm/ez-grid.entry.js +14819 -69705
  165. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  166. package/dist/esm/ez-icon.entry.js +2 -2
  167. package/dist/esm/ez-list.entry.js +7 -8
  168. package/dist/esm/ez-loading-bar.entry.js +1 -1
  169. package/dist/esm/ez-modal-container.entry.js +3 -2
  170. package/dist/esm/ez-modal.entry.js +20 -5
  171. package/dist/esm/ez-multi-selection-list.entry.js +3 -3
  172. package/dist/esm/ez-number-input.entry.js +16 -3
  173. package/dist/esm/ez-popover.entry.js +1 -1
  174. package/dist/esm/ez-popup.entry.js +22 -3
  175. package/dist/esm/ez-radio-button.entry.js +1 -1
  176. package/dist/esm/ez-scroller_2.entry.js +4 -4
  177. package/dist/esm/ez-search.entry.js +106 -46
  178. package/dist/esm/ez-sidebar-navigator.entry.js +2 -2
  179. package/dist/esm/ez-split-button.entry.js +3 -3
  180. package/dist/esm/ez-split-item.entry.js +2 -2
  181. package/dist/esm/ez-split-panel.entry.js +15 -5
  182. package/dist/esm/ez-tabselector.entry.js +1 -1
  183. package/dist/esm/ez-text-area.entry.js +68 -6
  184. package/dist/esm/ez-text-input.entry.js +154 -17
  185. package/dist/esm/ez-time-input.entry.js +9 -2
  186. package/dist/esm/ez-toast.entry.js +1 -1
  187. package/dist/esm/ez-tooltip.entry.js +51 -0
  188. package/dist/esm/ez-tree.entry.js +1 -1
  189. package/dist/esm/ez-upload.entry.js +1 -1
  190. package/dist/esm/ez-view-stack.entry.js +1 -1
  191. package/dist/esm/ezui.js +3 -3
  192. package/dist/esm/filter-column.entry.js +3 -3
  193. package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +9 -7
  194. package/dist/esm/loader.js +3 -3
  195. package/dist/ezui/ezui.esm.js +1 -1
  196. package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
  197. package/dist/ezui/{p-5b205c80.entry.js → p-044d46d5.entry.js} +1 -1
  198. package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
  199. package/dist/ezui/p-16e21a40.entry.js +1 -0
  200. package/dist/ezui/p-18a2a28a.entry.js +1 -0
  201. package/dist/ezui/{p-8888d9ed.entry.js → p-1b08bf3c.entry.js} +1 -1
  202. package/dist/ezui/p-2f53435e.entry.js +1 -0
  203. package/dist/ezui/p-319d36b7.entry.js +1 -0
  204. package/dist/ezui/p-397e3026.entry.js +1 -0
  205. package/dist/ezui/p-3af64edd.entry.js +1 -0
  206. package/dist/ezui/p-3c10cd94.entry.js +1 -0
  207. package/dist/ezui/p-46a46507.entry.js +1 -0
  208. package/dist/ezui/p-554522db.entry.js +1 -0
  209. package/dist/ezui/p-5d01d189.entry.js +1 -0
  210. package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
  211. package/dist/ezui/p-6bda82d1.entry.js +1 -0
  212. package/dist/ezui/p-6d31c43c.entry.js +1 -0
  213. package/dist/ezui/p-6d8b3298.entry.js +1 -0
  214. package/dist/ezui/p-6ec40dec.entry.js +1 -0
  215. package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
  216. package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
  217. package/dist/ezui/p-7f5afb1f.entry.js +1 -0
  218. package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
  219. package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
  220. package/dist/ezui/p-854f8504.entry.js +1 -0
  221. package/dist/ezui/p-8c32bd97.entry.js +309 -0
  222. package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
  223. package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
  224. package/dist/ezui/p-a1c0eadf.entry.js +1 -0
  225. package/dist/ezui/{p-072e6347.entry.js → p-a563df31.entry.js} +1 -1
  226. package/dist/ezui/p-a921e3e7.entry.js +1 -0
  227. package/dist/ezui/p-aa543378.entry.js +1 -0
  228. package/dist/ezui/p-aee8d615.entry.js +1 -0
  229. package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
  230. package/dist/ezui/p-b6241ea3.entry.js +1 -0
  231. package/dist/ezui/p-b858fc6e.entry.js +1 -0
  232. package/dist/ezui/{p-84e439b9.entry.js → p-bef7daac.entry.js} +1 -1
  233. package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
  234. package/dist/ezui/p-c7d1333c.entry.js +1 -0
  235. package/dist/ezui/p-cce6c015.entry.js +1 -0
  236. package/dist/ezui/p-ceadecd9.js +1 -0
  237. package/dist/ezui/p-dc628ed3.js +1 -0
  238. package/dist/ezui/p-def75121.entry.js +1 -0
  239. package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
  240. package/dist/ezui/p-e18d9e6a.entry.js +1 -0
  241. package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
  242. package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
  243. package/dist/ezui/{p-922ac38b.entry.js → p-e7395eae.entry.js} +1 -1
  244. package/dist/ezui/p-ec5f987d.entry.js +1 -0
  245. package/dist/ezui/p-efbe0b73.entry.js +1 -0
  246. package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
  247. package/dist/ezui/{p-baf80b13.entry.js → p-fad4f1dd.entry.js} +1 -1
  248. package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
  249. package/dist/types/components/ez-button/ez-button.d.ts +2 -1
  250. package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
  251. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +16 -1
  252. package/dist/types/components/ez-date-input/ez-date-input.d.ts +10 -1
  253. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +10 -1
  254. package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -0
  255. package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
  256. package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
  257. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +10 -1
  258. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
  259. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
  260. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
  261. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +56 -4
  262. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +32 -4
  263. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +23 -1
  264. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +33 -7
  265. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +4 -1
  266. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
  267. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  268. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
  269. package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
  270. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +2 -1
  271. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
  272. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
  273. package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
  274. package/dist/types/components/ez-grid/ez-grid.d.ts +33 -1
  275. package/dist/types/components/ez-modal/ez-modal.d.ts +7 -1
  276. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
  277. package/dist/types/components/ez-number-input/ez-number-input.d.ts +12 -0
  278. package/dist/types/components/ez-popup/ez-popup.d.ts +7 -0
  279. package/dist/types/components/ez-search/ez-search.d.ts +31 -4
  280. package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
  281. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +4 -0
  282. package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +9 -0
  283. package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
  284. package/dist/types/components/ez-text-input/ez-text-input.d.ts +28 -2
  285. package/dist/types/components/ez-time-input/ez-time-input.d.ts +8 -0
  286. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +21 -0
  287. package/dist/types/components.d.ts +323 -14
  288. package/dist/types/utils/FocusResolver.d.ts +5 -0
  289. package/dist/types/utils/ResponsiveInputUtils.d.ts +6 -0
  290. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +2 -0
  291. package/dist/types/utils/form/DataBinder.d.ts +3 -0
  292. package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
  293. package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -1
  294. package/package.json +12 -4
  295. package/react/components.d.ts +1 -0
  296. package/react/components.js +1 -0
  297. package/react/components.js.map +1 -1
  298. package/dist/cjs/RecordValidationProcessor-4c893e04.js +0 -102
  299. package/dist/cjs/ez-skeleton.cjs.entry.js +0 -67
  300. package/dist/esm/RecordValidationProcessor-b00b8b77.js +0 -99
  301. package/dist/esm/ez-skeleton.entry.js +0 -63
  302. package/dist/ezui/p-04f24913.js +0 -1
  303. package/dist/ezui/p-1285c902.entry.js +0 -1
  304. package/dist/ezui/p-13d2fe2d.entry.js +0 -1
  305. package/dist/ezui/p-2097d0cf.entry.js +0 -1
  306. package/dist/ezui/p-30775e7f.entry.js +0 -1
  307. package/dist/ezui/p-3b4eeeb6.entry.js +0 -1
  308. package/dist/ezui/p-3faa2b46.entry.js +0 -1
  309. package/dist/ezui/p-49456b34.entry.js +0 -1
  310. package/dist/ezui/p-4d5235f1.entry.js +0 -1
  311. package/dist/ezui/p-5bd5e68f.entry.js +0 -1
  312. package/dist/ezui/p-784fe207.entry.js +0 -1
  313. package/dist/ezui/p-7922142b.entry.js +0 -1
  314. package/dist/ezui/p-7af81663.entry.js +0 -1
  315. package/dist/ezui/p-7bc07c31.entry.js +0 -1
  316. package/dist/ezui/p-85c8baae.entry.js +0 -1
  317. package/dist/ezui/p-8f0144f6.entry.js +0 -1
  318. package/dist/ezui/p-9050d2cd.entry.js +0 -1
  319. package/dist/ezui/p-9ab22a07.entry.js +0 -1
  320. package/dist/ezui/p-a31b9c90.entry.js +0 -1
  321. package/dist/ezui/p-af95cd16.entry.js +0 -1
  322. package/dist/ezui/p-bae4e180.entry.js +0 -1
  323. package/dist/ezui/p-bc2f844e.entry.js +0 -1
  324. package/dist/ezui/p-bcb53f27.entry.js +0 -1
  325. package/dist/ezui/p-bf79aaa1.entry.js +0 -1
  326. package/dist/ezui/p-d9401ea0.entry.js +0 -1
  327. package/dist/ezui/p-da8ae82b.entry.js +0 -304
  328. package/dist/ezui/p-e85c48d7.entry.js +0 -1
  329. package/dist/ezui/p-ecc2c1ec.entry.js +0 -1
  330. package/dist/ezui/p-f3c526cc.entry.js +0 -1
  331. package/dist/ezui/p-fcf0acce.entry.js +0 -1
@@ -1,6 +1,6 @@
1
- import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
2
- import { Grid } from 'ag-grid-community';
3
- import { Grid as EnterpriseGrid, LicenseManager } from 'ag-grid-enterprise';
1
+ import { ApplicationContext, DataType, LockManager, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
2
+ import { Grid } from "@ag-grid-community/core";
3
+ import { LicenseManager } from '@ag-grid-enterprise/core';
4
4
  import DataSource from './DataSource';
5
5
  import { EzGridCustomHeader } from './components/EzGridCustomHeader';
6
6
  import { CellRendererStatus } from './components/cellRendererStatus';
@@ -8,6 +8,12 @@ import SelectionHeader from './components/selectionHeader';
8
8
  import gridTerms from './i18n/pt-BR';
9
9
  import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from '../../../../utils/constants';
10
10
  import GridEditionManager from './GridEditionManager';
11
+ import { ModuleRegistry } from '@ag-grid-community/core';
12
+ import { EnterpriseCoreModule } from '@ag-grid-enterprise/core';
13
+ import { RangeSelectionModule } from '@ag-grid-enterprise/range-selection';
14
+ import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';
15
+ import { ClipboardModule } from '@ag-grid-enterprise/clipboard';
16
+ import { MenuModule } from '@ag-grid-enterprise/menu';
11
17
  export default class AgGridController {
12
18
  configFilterColumn(filterColumn) {
13
19
  this._filterColumn = filterColumn;
@@ -27,7 +33,7 @@ export default class AgGridController {
27
33
  var _a;
28
34
  (_a = this._filterColumn) === null || _a === void 0 ? void 0 : _a.show(configs);
29
35
  }
30
- constructor(enterprise) {
36
+ constructor(_enterprise) {
31
37
  this.DEFAULT_ROW_HEIGHT = 30;
32
38
  this.DEFAULT_HEADER_ROW_HEIGHT = 32;
33
39
  this.CHECK_BOX_COL_ID = 'checkBoxColumn';
@@ -41,7 +47,15 @@ export default class AgGridController {
41
47
  this._filteredColumns = new Map();
42
48
  this._filterColumnleftPosition = 0;
43
49
  this._customFormatters = new Map();
44
- this._enterprise = enterprise;
50
+ this._gridShowDom = false;
51
+ this.peddingExecutionsOnGridShow = [];
52
+ ModuleRegistry.registerModules([
53
+ EnterpriseCoreModule,
54
+ RangeSelectionModule,
55
+ ServerSideRowModelModule,
56
+ ClipboardModule,
57
+ MenuModule
58
+ ]);
45
59
  }
46
60
  getGridConfig() {
47
61
  return this._gridConfig;
@@ -119,6 +133,7 @@ export default class AgGridController {
119
133
  var _a;
120
134
  this._options = options;
121
135
  this._container = container;
136
+ const lockerId = options.enableLockManger ? LockManager.addLockManagerCtxId(this._container) : null;
122
137
  if (this._grid === undefined) {
123
138
  LicenseManager.setLicenseKey(ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
124
139
  this._columnStateChangeCallback = options.onColumnStateChange;
@@ -126,7 +141,7 @@ export default class AgGridController {
126
141
  this._doubleClickCallBack = options.onDoubleClick;
127
142
  this._multipleSelection = options.allowMultipleSelection;
128
143
  this._dataUnit = options.dataUnit;
129
- this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
144
+ this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert, lockerId);
130
145
  this._statusResolver = options.statusResolver;
131
146
  if (this._dataUnit) {
132
147
  this._dataUnit.sortingProvider = this;
@@ -146,6 +161,9 @@ export default class AgGridController {
146
161
  defaultColDef: {
147
162
  headerClass: 'ez-grid__cell-header',
148
163
  cellClass: 'ez-grid__cell-body',
164
+ cellClassRules: {
165
+ 'invalidValue': (params) => this._editionManager.hasInvalidField(params.colDef.field, params.data["__record__id__"]),
166
+ },
149
167
  cellStyle: {
150
168
  height: '100%'
151
169
  }
@@ -170,12 +188,7 @@ export default class AgGridController {
170
188
  this.setOptionsEvents(this._gridOptions);
171
189
  this.setOptionsSupress(this._gridOptions);
172
190
  this._gridOptions = this._editionManager.configureGrid(this._gridOptions);
173
- if (this._enterprise) {
174
- this._grid = new EnterpriseGrid(container, this._gridOptions);
175
- }
176
- else {
177
- this._grid = new Grid(container, this._gridOptions);
178
- }
191
+ this._grid = new Grid(container, this._gridOptions);
179
192
  const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
180
193
  if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
181
194
  this.selectAll(true);
@@ -185,6 +198,23 @@ export default class AgGridController {
185
198
  }
186
199
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
187
200
  this._customFormatters = options.customFormatters;
201
+ const observerCallback = (entries) => {
202
+ entries.forEach(entry => {
203
+ if (entry.isIntersecting) {
204
+ this._gridShowDom = true;
205
+ this.peddingExecutionsOnGridShow.forEach(func => func());
206
+ this.peddingExecutionsOnGridShow = [];
207
+ }
208
+ else {
209
+ this._gridShowDom = false;
210
+ }
211
+ });
212
+ };
213
+ this.observer = new IntersectionObserver(observerCallback, {
214
+ root: null,
215
+ threshold: 0.1
216
+ });
217
+ this.observer.observe(container);
188
218
  }
189
219
  }
190
220
  processFormatterCellCallback(params) {
@@ -318,7 +348,7 @@ export default class AgGridController {
318
348
  defineRowModelType(opt, sourceOptions) {
319
349
  if (this._dataUnit != undefined) {
320
350
  opt.rowModelType = 'serverSide';
321
- opt.serverSideDatasource = new DataSource(this._dataUnit, this, sourceOptions);
351
+ opt.serverSideDatasource = this._dataSource = new DataSource(this._dataUnit, this, sourceOptions);
322
352
  opt.serverSideSortOnServer = true;
323
353
  opt.columnDefs = this._colDefs;
324
354
  }
@@ -375,10 +405,17 @@ export default class AgGridController {
375
405
  throw new Error('Erro interno: Grid ainda não inicializado.');
376
406
  }
377
407
  }
378
- updateRows() {
408
+ updateRows(rows) {
379
409
  if (this._grid === undefined) {
380
410
  throw new Error('Erro interno: Grid ainda não inicializado.');
381
411
  }
412
+ rows === null || rows === void 0 ? void 0 : rows.forEach(row => this.updateRowData(row));
413
+ }
414
+ updateRowData(row) {
415
+ const node = this._gridOptions.api.getRowNode(row[this._idAttribName]);
416
+ node.setData(Object.assign({}, row));
417
+ this._editionManager.updateCurrentEditorGuiValue(row);
418
+ this._editionManager.recordValidate();
382
419
  }
383
420
  selectAll(quietly = false) {
384
421
  try {
@@ -461,14 +498,45 @@ export default class AgGridController {
461
498
  });
462
499
  r.setData(data);
463
500
  });
501
+ this._gridOptions.api.refreshCells({ force: true });
502
+ const invalidCell = this._editionManager.getNextInvalidCell();
503
+ if (invalidCell) {
504
+ const rowNode = this._gridOptions.api.getRowNode(invalidCell.recordId);
505
+ if (rowNode && invalidCell.field) {
506
+ this.startEdition(rowNode.rowIndex, this._gridOptions.columnApi.getColumn(invalidCell.field.name));
507
+ }
508
+ }
464
509
  }
465
510
  }
466
- refresh() {
511
+ savingCanceled(fields, recordId) {
512
+ if (!this._gridShowDom)
513
+ return;
514
+ const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
515
+ const rowIndex = this._gridOptions.api.getRowNode(recordId).rowIndex;
516
+ const columnFocus = displayedColumns.find(column => this.isColumnEditable(rowIndex, column) && fields.find(field => field.name === column.getColId()));
517
+ this.focusByCollAndRow(columnFocus, rowIndex);
518
+ this.startEdition(rowIndex, columnFocus);
519
+ }
520
+ refresh(scrollToSelectedRow = false) {
467
521
  if (this._grid === undefined) {
468
522
  throw new Error('Erro interno: Grid ainda não inicializado.');
469
523
  }
524
+ this._gridOptions.api.clearRangeSelection();
470
525
  this._gridOptions.api.refreshServerSide({ purge: true });
471
526
  this._options.onRefresh();
527
+ if (scrollToSelectedRow)
528
+ this.scrollToSelectedRow();
529
+ }
530
+ scrollToSelectedRow() {
531
+ const rowNode = this._gridOptions.api.getSelectedNodes();
532
+ if (!rowNode || rowNode.length === 0)
533
+ return;
534
+ if (this._gridShowDom) {
535
+ this._gridOptions.api.ensureNodeVisible(rowNode[0]);
536
+ }
537
+ else {
538
+ this.peddingExecutionsOnGridShow.push(() => this._gridOptions.api.ensureNodeVisible(rowNode[0]));
539
+ }
472
540
  }
473
541
  focusOnGridContainer() {
474
542
  this._container.setAttribute('tabindex', '-1');
@@ -476,17 +544,28 @@ export default class AgGridController {
476
544
  }
477
545
  setFocus() {
478
546
  var _a, _b;
479
- if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
480
- this.setFocusFirstRow();
481
- }
482
- else {
547
+ if (!((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length)) {
483
548
  this.focusOnGridContainer();
549
+ return;
550
+ }
551
+ if (!this._dataUnit.getSelectedRecord()) {
552
+ this.setFocusFirstRow();
553
+ return;
484
554
  }
555
+ this.syncSelectWithDataUnit();
485
556
  }
486
557
  setAutoFocus(autoFocus) {
487
558
  var _a;
488
559
  (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
489
560
  }
561
+ setEnableGridInsert(enable) {
562
+ var _a;
563
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setEnableGridInsert(enable);
564
+ }
565
+ setEnableContinuousInsert(enable) {
566
+ var _a;
567
+ (_a = this._editionManager) === null || _a === void 0 ? void 0 : _a.setEnableContinuousInsert(enable);
568
+ }
490
569
  setFocusFirstRow() {
491
570
  const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
492
571
  if (firstRow) {
@@ -502,9 +581,73 @@ export default class AgGridController {
502
581
  this.setFocusOnRow(lastRow.rowIndex);
503
582
  }
504
583
  }
584
+ startEditionOnRowByIndex(rowIndex) {
585
+ this._dataUnit.setSelectionByIndex([rowIndex]);
586
+ const firstCol = this.getFirstEditableColl(rowIndex);
587
+ if (!firstCol)
588
+ return;
589
+ this.focusByCollAndRow(firstCol, rowIndex);
590
+ this.startEdition(rowIndex, firstCol);
591
+ }
592
+ startEditionOnLastRow() {
593
+ var _a;
594
+ if (this._gridShowDom) {
595
+ const newRowIndex = ((_a = this._dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) - 1;
596
+ this.startEditionOnRowByIndex(newRowIndex);
597
+ }
598
+ }
599
+ syncSelectWithDataUnit() {
600
+ const rowNode = this._gridOptions.api.getRowNode(this._dataUnit.getSelectedRecord().__record__id__);
601
+ if ((rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) < 0)
602
+ return;
603
+ const rowRange = this._gridOptions.api.getCellRanges().find(row => row.startRow.rowIndex === rowNode.rowIndex);
604
+ if ((rowRange === null || rowRange === void 0 ? void 0 : rowRange.columns.length) > 0) {
605
+ if (this._dataUnit.hasNewRecord()) {
606
+ this.startEdition(rowNode.rowIndex, rowRange.columns[0]);
607
+ return;
608
+ }
609
+ this.focusByCollAndRow(rowRange.columns[0], rowNode.rowIndex);
610
+ this._gridOptions.api.addCellRange({ rowStartIndex: rowNode.rowIndex, rowEndIndex: rowNode.rowIndex, columns: rowRange.columns });
611
+ return;
612
+ }
613
+ this._gridOptions.api.clearRangeSelection();
614
+ this.setFocusOnRow(rowNode.rowIndex);
615
+ }
616
+ startEdition(rowIndex, firstCol) {
617
+ if (!this._gridShowDom)
618
+ return;
619
+ this._gridOptions.api.clearRangeSelection();
620
+ this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
621
+ this._gridOptions.api.setFocusedCell(rowIndex, firstCol);
622
+ this._gridOptions.api.startEditingCell({ rowIndex, colKey: firstCol });
623
+ const cellEditor = this._gridOptions.api.getCellEditorInstances()[0];
624
+ if (cellEditor) {
625
+ cellEditor.focusIn();
626
+ }
627
+ }
628
+ getFirstEditableColl(rowIndex) {
629
+ try {
630
+ const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
631
+ return displayedColumns.find(column => this.isColumnEditable(rowIndex, column));
632
+ }
633
+ catch (e) {
634
+ console.warn(e);
635
+ }
636
+ }
637
+ isColumnEditable(rowIndex, column) {
638
+ if (column.getColDef().headerName === '' || rowIndex === -1)
639
+ return false;
640
+ const rowId = this._dataUnit.records[rowIndex][this._idAttribName];
641
+ const rowNode = this._gridOptions.api.getRowNode(rowId);
642
+ return column.isCellEditable(rowNode);
643
+ }
505
644
  setFocusOnRow(rowIndex) {
506
645
  let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
507
- let firstCell = displayedColumns.find(column => column.getColDef().headerName !== '');
646
+ let firstColl = displayedColumns.find(column => column.getColDef().headerName !== '');
647
+ this.focusByCollAndRow(firstColl, rowIndex);
648
+ this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstColl] });
649
+ }
650
+ focusByCollAndRow(firstCell, rowIndex) {
508
651
  this._gridOptions.api.ensureColumnVisible(firstCell);
509
652
  this._gridOptions.api.ensureIndexVisible(rowIndex);
510
653
  this._gridOptions.api.setFocusedCell(rowIndex, firstCell);
@@ -542,6 +685,14 @@ export default class AgGridController {
542
685
  this._gridOptions.api.setColumnDefs(this._colDefs);
543
686
  }
544
687
  }
688
+ hideSelectionColumn() {
689
+ var _a, _b;
690
+ (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.columnApi) === null || _b === void 0 ? void 0 : _b.setColumnVisible(this.CHECK_BOX_COL_ID, false);
691
+ }
692
+ showSelectionColumn() {
693
+ var _a, _b;
694
+ (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.columnApi) === null || _b === void 0 ? void 0 : _b.setColumnVisible(this.CHECK_BOX_COL_ID, true);
695
+ }
545
696
  getColumnsDef() {
546
697
  if (this._grid === undefined) {
547
698
  throw new Error('Erro interno: Grid ainda não inicializado.');
@@ -826,38 +977,54 @@ export default class AgGridController {
826
977
  return false;
827
978
  }
828
979
  onSelectionChange(event) {
829
- if (this._selectionChangeCallback) {
830
- clearTimeout(this._selectionChangeDeboucing);
831
- this._selectionChangeDeboucing = window.setTimeout(() => {
832
- this._editionManager.proceedAutoSave();
833
- if (this._dataUnit) {
834
- if (event.context.selectionChangeQuietly) {
835
- const selectionInfo = this._dataUnit;
836
- this._selectionChangeCallback({
837
- selection: selectionInfo.records,
838
- selectionHeaderStatus: this.getSelectionHeaderStatus(),
839
- });
840
- }
841
- else {
842
- this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((r) => r.__record__id__)).then(selectionInfo => {
843
- this._selectionChangeCallback({
844
- selection: selectionInfo.records,
845
- selectionHeaderStatus: this.getSelectionHeaderStatus(),
846
- });
847
- });
848
- }
849
- }
850
- else {
851
- this._selectionChangeCallback({
852
- selection: this._gridOptions.api.getSelectedRows(),
853
- selectionHeaderStatus: this.getSelectionHeaderStatus(),
854
- });
855
- }
856
- }, 0);
980
+ var _a, _b;
981
+ const selectedRowId = (_b = (_a = event.api.getSelectedNodes()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
982
+ const isNewRecord = this._dataUnit.isNewRecord(selectedRowId);
983
+ if (!this._selectionChangeCallback)
984
+ return;
985
+ clearTimeout(this._selectionChangeDeboucing);
986
+ this._selectionChangeDeboucing = window.setTimeout(async () => {
987
+ const saveSuccess = (!isNewRecord && selectedRowId) ? await this.handleExecuteProceedAutosave() : true;
988
+ if (!saveSuccess)
989
+ return;
990
+ this.processBuildSelectionChangeCallback(event);
991
+ }, 0);
992
+ }
993
+ async handleExecuteProceedAutosave() {
994
+ if (this._gridShowDom) {
995
+ return await this._editionManager.proceedAutoSave();
996
+ }
997
+ return true;
998
+ }
999
+ processBuildSelectionChangeCallback(event) {
1000
+ if (this._dataUnit) {
1001
+ this.handleBuildSelectionChangeWithDU(event.context.selectionChangeQuietly);
1002
+ return;
1003
+ }
1004
+ this.buildSelectionChangeCallback(this._gridOptions.api.getSelectedRows());
1005
+ }
1006
+ handleBuildSelectionChangeWithDU(quietly) {
1007
+ if (quietly) {
1008
+ this.buildSelectionChangeCallback(this._dataUnit.records);
1009
+ return;
857
1010
  }
1011
+ this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows()
1012
+ .map((r) => r.__record__id__))
1013
+ .then(selectionInfo => this.buildSelectionChangeCallback(selectionInfo.records));
1014
+ }
1015
+ buildSelectionChangeCallback(records) {
1016
+ this._selectionChangeCallback({
1017
+ selection: records,
1018
+ selectionHeaderStatus: this.getSelectionHeaderStatus(),
1019
+ });
858
1020
  }
859
1021
  onRowDoubleClick(evt) {
860
- if (this._doubleClickCallBack) {
1022
+ var _a, _b;
1023
+ if (this._doubleClickCallBack && (!this._options.enableGridInsert || !this._dataUnit.hasNewRecord())) {
1024
+ /**
1025
+ * Evita mudança de view e a grade permanecer no modo de edição.
1026
+ */
1027
+ (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.stopEditing();
861
1028
  this._doubleClickCallBack(evt.data);
862
1029
  }
863
1030
  }
@@ -866,22 +1033,60 @@ export default class AgGridController {
866
1033
  host[attribute] = value;
867
1034
  }
868
1035
  }
1036
+ processEditionCanceled() {
1037
+ this.clearInvalidCells(true);
1038
+ if (this._gridShowDom) {
1039
+ this._dataUnit.clearSelection();
1040
+ }
1041
+ }
869
1042
  setCellEditors(customEditors) {
870
- var _a;
1043
+ var _a, _b, _c, _d, _e;
871
1044
  if (!this._editionManager) {
872
1045
  this._customEditors = customEditors;
873
1046
  return;
874
1047
  }
1048
+ const currentEditingCells = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.getEditingCells();
875
1049
  this._editionManager.setCellEditors(customEditors);
876
- (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
1050
+ if ((currentEditingCells === null || currentEditingCells === void 0 ? void 0 : currentEditingCells.length) > 0) {
1051
+ this._gridOptions.api.startEditingCell({ colKey: (_d = (_c = currentEditingCells[0]) === null || _c === void 0 ? void 0 : _c.column) === null || _d === void 0 ? void 0 : _d.getColId(), rowIndex: (_e = currentEditingCells[0]) === null || _e === void 0 ? void 0 : _e.rowIndex });
1052
+ }
877
1053
  }
878
1054
  setCellRenders(customRenders) {
879
- var _a;
1055
+ var _a, _b, _c, _d, _e, _f;
880
1056
  if (!this._editionManager) {
881
1057
  this._customRenders = customRenders;
882
1058
  return;
883
1059
  }
884
1060
  this._editionManager.setCellRenders(customRenders);
885
- (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
1061
+ const currentEditingCells = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.getEditingCells();
1062
+ (_c = this._gridOptions) === null || _c === void 0 ? void 0 : _c.api.redrawRows();
1063
+ if ((currentEditingCells === null || currentEditingCells === void 0 ? void 0 : currentEditingCells.length) > 0) {
1064
+ this._gridOptions.api.startEditingCell({ colKey: (_e = (_d = currentEditingCells[0]) === null || _d === void 0 ? void 0 : _d.column) === null || _e === void 0 ? void 0 : _e.getColId(), rowIndex: (_f = currentEditingCells[0]) === null || _f === void 0 ? void 0 : _f.rowIndex });
1065
+ }
1066
+ }
1067
+ clearInvalidCells(stopEdition) {
1068
+ if (!this._editionManager)
1069
+ return;
1070
+ this._editionManager.clearInvalidCells(stopEdition);
1071
+ this._gridOptions.api.refreshCells({ force: true });
1072
+ }
1073
+ processContinuousInsert() {
1074
+ this._editionManager.processContinuousInsert();
1075
+ }
1076
+ destroy() {
1077
+ var _a;
1078
+ this.observer.disconnect();
1079
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.destroy();
1080
+ }
1081
+ registryListeners() {
1082
+ var _a;
1083
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.registryListeners();
1084
+ }
1085
+ resetPaginationState() {
1086
+ var _a, _b;
1087
+ (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.clearRangeSelection();
1088
+ }
1089
+ stopEdit() {
1090
+ this._gridOptions.api.stopEditing();
886
1091
  }
887
1092
  }
@@ -2,6 +2,90 @@ import { Action, ObjectUtils } from '@sankhyalabs/core';
2
2
  import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
3
3
  import { DataSourceInterceptor } from "./DataSourceInterceptor";
4
4
  export default class DataSource {
5
+ handleDataSaved(action) {
6
+ this._controller.clearInvalidCells();
7
+ this.handleRefreshOrReload(action);
8
+ this._controller.processContinuousInsert();
9
+ this._controller.showSelectionColumn();
10
+ }
11
+ handleEditionCanceled(action) {
12
+ if (this._options.enableGridInsert) {
13
+ this._controller.processEditionCanceled();
14
+ }
15
+ this.handleRefreshOrReload(action);
16
+ this._controller.showSelectionColumn();
17
+ }
18
+ handleSavingCanceled(action) {
19
+ var _a, _b, _c, _d;
20
+ if (!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fields) || !((_b = action.payload) === null || _b === void 0 ? void 0 : _b.recordId))
21
+ return;
22
+ this._controller.savingCanceled((_c = action.payload) === null || _c === void 0 ? void 0 : _c.fields, (_d = action.payload) === null || _d === void 0 ? void 0 : _d.recordId);
23
+ }
24
+ handleDataChanged(action) {
25
+ if (!this._options.enableGridInsert) {
26
+ this.handleRefresh(action);
27
+ return;
28
+ }
29
+ this.updateGridRowNodes(this.createRecordIdList(action));
30
+ }
31
+ createRecordIdList(action) {
32
+ var _a, _b;
33
+ if ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.records)
34
+ return (_b = action.payload) === null || _b === void 0 ? void 0 : _b.records;
35
+ return this._dataUnit.getSelectedRecord() ? [this._dataUnit.getSelectedRecord().__record__id__] : [];
36
+ }
37
+ /**
38
+ * Nesse ponto, o registro já se encontra atualizado no DU,
39
+ * basta então passar seu valor para que a garde possa atualizar sua linha.
40
+ */
41
+ updateGridRowNodes(recordIDList) {
42
+ const recordsToUpdate = recordIDList === null || recordIDList === void 0 ? void 0 : recordIDList.map(id => this.getRecordById(id));
43
+ this._controller.updateRows(recordsToUpdate);
44
+ }
45
+ getRecordById(recordId) {
46
+ return this._dataUnit.records.find(record => record['__record__id__'] === recordId);
47
+ }
48
+ /**
49
+ * Em caso de necessidade de reload (isWaitingToReload), eh preciso chamar o dataUnit.gotoPage, pois ele aplica tambem a ordenacao dos registros,
50
+ * enquanto que o _controller.refresh apenas recarrega os dados na ordem que atua.
51
+ */
52
+ handleRefreshOrReload(action) {
53
+ if (this._dataUnit.isWaitingToReload()) {
54
+ this.handleReload();
55
+ return;
56
+ }
57
+ this.handleRefresh(action);
58
+ }
59
+ handleReload() {
60
+ this._dataUnit.setWaitingToReload(false);
61
+ this._dataUnit.gotoPage(0);
62
+ }
63
+ handleRefresh(action) {
64
+ if (this.isSilentChange(action)) {
65
+ return;
66
+ }
67
+ this._controller.refresh(action.type === Action.DATA_SAVED);
68
+ }
69
+ handleRecordsAdded() {
70
+ if (this._options.enableGridInsert) {
71
+ this._controller.hideSelectionColumn();
72
+ this._controller.refresh();
73
+ this.focusOnNewRecord();
74
+ }
75
+ }
76
+ focusOnNewRecord() {
77
+ /**
78
+ * O SetTimeout eh utilizado pois é preciso aguardar que o novo registro seja renderizado na grade.
79
+ * Tentamos utilizar a api da grade para adicionar um event listener, porém na versão que utilizamos, não existe
80
+ * algo que resolva nosso cenário.
81
+ *
82
+ * Sugiro no futuro utilizar algo como o applyServerSideTransaction, porém será preciso lidar com os handlers
83
+ * e callbacks implementados no AgGridController e GridEditionManager.
84
+ */
85
+ setTimeout(() => {
86
+ this._controller.startEditionOnLastRow();
87
+ }, 1000);
88
+ }
5
89
  updateLoadedRecords(action) {
6
90
  const records = action.payload;
7
91
  if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
@@ -53,15 +137,22 @@ export default class DataSource {
53
137
  this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
54
138
  }
55
139
  break;
56
- case Action.RECORDS_REMOVED:
140
+ case Action.RECORDS_ADDED:
141
+ case Action.RECORDS_COPIED:
142
+ this.handleRecordsAdded();
143
+ break;
57
144
  case Action.DATA_SAVED:
145
+ this.handleDataSaved(action);
146
+ break;
58
147
  case Action.EDITION_CANCELED:
148
+ this.handleEditionCanceled(action);
149
+ break;
59
150
  case Action.DATA_CHANGED:
60
151
  case Action.DATA_RESOLVED:
61
- if (this.isSilentChange(action)) {
62
- return;
63
- }
64
- this._controller.refresh();
152
+ this.handleDataChanged(action);
153
+ break;
154
+ case Action.RECORDS_REMOVED:
155
+ this.handleRefresh(action);
65
156
  break;
66
157
  case Action.SELECTION_CHANGED:
67
158
  case Action.NEXT_SELECTED:
@@ -71,6 +162,9 @@ export default class DataSource {
71
162
  case Action.RECORD_LOADED:
72
163
  this.updateLoadedRecords(action);
73
164
  break;
165
+ case Action.SAVING_CANCELED:
166
+ this.handleSavingCanceled(action);
167
+ break;
74
168
  }
75
169
  };
76
170
  this._dataUnit = dataUnit;
@@ -92,6 +186,9 @@ export default class DataSource {
92
186
  setAutoFocus(autoFocus) {
93
187
  this._options.autoFocus = autoFocus;
94
188
  }
189
+ setEnableGridInsert(enable) {
190
+ this._options.enableGridInsert = enable;
191
+ }
95
192
  getRows(params) {
96
193
  if (this.needReload(params)) {
97
194
  this._lastLoadingParams = params;
@@ -119,6 +216,11 @@ export default class DataSource {
119
216
  destroy() {
120
217
  this._dataUnit.unsubscribe(this.duObserver);
121
218
  }
219
+ registryListeners() {
220
+ var _a, _b;
221
+ (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.duObserver);
222
+ (_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.subscribe(this.duObserver);
223
+ }
122
224
  buildColumnDefs() {
123
225
  const gridConfig = this._controller.getGridConfig() || [];
124
226
  const columnDefs = [];