@sankhyalabs/ezui 5.22.0-dev.9 → 5.22.0-dev.91

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 (334) hide show
  1. package/dist/cjs/{CSSVarsUtils-10c9d5b4.js → CSSVarsUtils-f20973d1.js} +1 -0
  2. package/dist/cjs/DataBinder-e92314c2.js +445 -0
  3. package/dist/cjs/FocusResolver-885f2173.js +35 -0
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +4 -3
  5. package/dist/cjs/ez-button.cjs.entry.js +11 -5
  6. package/dist/cjs/ez-card-item_2.cjs.entry.js +76 -0
  7. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +366 -0
  10. package/dist/cjs/ez-combo-box.cjs.entry.js +82 -155
  11. package/dist/cjs/ez-date-input.cjs.entry.js +13 -4
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +10 -4
  13. package/dist/cjs/ez-dialog.cjs.entry.js +14 -7
  14. package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
  15. package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +75 -8
  16. package/dist/cjs/ez-filter-input.cjs.entry.js +129 -0
  17. package/dist/cjs/ez-form-view.cjs.entry.js +28 -21
  18. package/dist/cjs/ez-form.cjs.entry.js +6 -325
  19. package/dist/cjs/ez-grid.cjs.entry.js +14959 -69757
  20. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-list.cjs.entry.js +258 -211
  22. package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
  23. package/dist/cjs/ez-modal.cjs.entry.js +12 -3
  24. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
  25. package/dist/cjs/ez-number-input.cjs.entry.js +15 -3
  26. package/dist/cjs/ez-popover-core_2.cjs.entry.js +1504 -0
  27. package/dist/cjs/ez-popup.cjs.entry.js +24 -2
  28. package/dist/cjs/ez-scroller_2.cjs.entry.js +3 -3
  29. package/dist/cjs/ez-search.cjs.entry.js +109 -48
  30. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
  32. package/dist/cjs/ez-split-item.cjs.entry.js +6 -3
  33. package/dist/cjs/ez-split-panel.cjs.entry.js +68 -6
  34. package/dist/cjs/ez-text-area.cjs.entry.js +68 -6
  35. package/dist/cjs/ez-text-input.cjs.entry.js +152 -16
  36. package/dist/cjs/ez-time-input.cjs.entry.js +7 -1
  37. package/dist/cjs/ez-tooltip.cjs.entry.js +55 -0
  38. package/dist/cjs/ez-tree.cjs.entry.js +5 -4
  39. package/dist/cjs/ezListHelper-0d3970b4.js +90 -0
  40. package/dist/cjs/ezui.cjs.js +1 -1
  41. package/dist/cjs/filter-column.cjs.entry.js +10 -47
  42. package/dist/cjs/index-a7b0c73d.js +22 -10
  43. package/dist/cjs/loader.cjs.js +1 -1
  44. package/dist/collection/collection-manifest.json +6 -1
  45. package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
  46. package/dist/collection/components/ez-button/ez-button.css +23 -13
  47. package/dist/collection/components/ez-button/ez-button.js +12 -6
  48. package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
  49. package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
  50. package/dist/collection/components/ez-check/ez-check.css +1 -6
  51. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
  52. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
  53. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +405 -0
  54. package/dist/collection/components/ez-combo-box/ez-combo-box.css +8 -246
  55. package/dist/collection/components/ez-combo-box/ez-combo-box.js +129 -166
  56. package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
  57. package/dist/collection/components/ez-date-input/ez-date-input.js +38 -4
  58. package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +1 -1
  59. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +35 -4
  60. package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
  61. package/dist/collection/components/ez-dialog/ez-dialog.js +14 -16
  62. package/dist/collection/components/ez-double-list/doubleListHelper.js +82 -0
  63. package/dist/collection/components/ez-double-list/ez-double-list.css +62 -0
  64. package/dist/collection/components/ez-double-list/ez-double-list.js +440 -0
  65. package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -8
  66. package/dist/collection/components/ez-filter-input/ez-filter-input.css +1 -1
  67. package/dist/collection/components/ez-filter-input/ez-filter-input.js +35 -4
  68. package/dist/collection/components/ez-form/ez-form.js +1 -0
  69. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +49 -6
  70. package/dist/collection/components/ez-form-view/ez-form-view.css +5 -2
  71. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
  72. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
  73. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
  74. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +8 -4
  75. package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
  76. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
  77. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
  78. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +1 -1
  79. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
  80. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +295 -63
  81. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +151 -31
  82. package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js +2 -1
  83. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +219 -42
  84. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +16 -0
  85. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -1
  86. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
  87. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +2 -0
  88. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
  89. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
  90. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +8 -1
  91. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
  92. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +2 -0
  93. package/dist/collection/components/ez-grid/ez-grid.css +95 -10
  94. package/dist/collection/components/ez-grid/ez-grid.js +315 -10
  95. package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
  96. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +9 -46
  97. package/dist/collection/components/ez-icon/ez-icon.css +156 -149
  98. package/dist/collection/components/ez-list/ez-list.css +5 -4
  99. package/dist/collection/components/ez-list/ez-list.js +301 -212
  100. package/dist/collection/components/ez-list/ezListHelper.js +85 -0
  101. package/dist/collection/components/ez-modal/ez-modal.css +7 -2
  102. package/dist/collection/components/ez-modal/ez-modal.js +13 -4
  103. package/dist/collection/components/ez-modal-container/ez-modal-container.css +1 -0
  104. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  105. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +3 -3
  106. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
  107. package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
  108. package/dist/collection/components/ez-number-input/ez-number-input.js +49 -1
  109. package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +3 -0
  110. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +385 -0
  111. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
  112. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
  113. package/dist/collection/components/ez-popup/ez-popup.css +8 -3
  114. package/dist/collection/components/ez-popup/ez-popup.js +43 -3
  115. package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
  116. package/dist/collection/components/ez-search/ez-search.css +22 -11
  117. package/dist/collection/components/ez-search/ez-search.js +193 -53
  118. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
  119. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
  120. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +4 -1
  121. package/dist/collection/components/ez-skeleton/ez-skeleton.css +54 -34
  122. package/dist/collection/components/ez-split-button/ez-split-button.css +52 -14
  123. package/dist/collection/components/ez-split-button/ez-split-button.js +3 -3
  124. package/dist/collection/components/ez-split-panel/ez-split-panel.css +15 -0
  125. package/dist/collection/components/ez-split-panel/ez-split-panel.js +106 -5
  126. package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +1 -0
  127. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +14 -2
  128. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +22 -1
  129. package/dist/collection/components/ez-text-area/ez-text-area.css +78 -29
  130. package/dist/collection/components/ez-text-area/ez-text-area.js +104 -4
  131. package/dist/collection/components/ez-text-input/ez-text-input.css +106 -91
  132. package/dist/collection/components/ez-text-input/ez-text-input.js +166 -15
  133. package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
  134. package/dist/collection/components/ez-tooltip/ez-tooltip.css +20 -0
  135. package/dist/collection/components/ez-tooltip/ez-tooltip.js +116 -0
  136. package/dist/collection/components/ez-tree/ez-tree.js +21 -1
  137. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +3 -3
  138. package/dist/collection/sw.js +46 -0
  139. package/dist/collection/utils/CSSVarsUtils.js +1 -0
  140. package/dist/collection/utils/FocusResolver.js +31 -0
  141. package/dist/collection/utils/ResponsiveInputUtils.js +26 -0
  142. package/dist/collection/utils/form/DataBinder.js +22 -7
  143. package/dist/collection/utils/form/FormMetadata.js +2 -1
  144. package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
  145. package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
  146. package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +7 -1
  147. package/dist/custom-elements/index.d.ts +30 -0
  148. package/dist/custom-elements/index.js +19539 -71833
  149. package/dist/esm/{CSSVarsUtils-71ce76be.js → CSSVarsUtils-acba92d7.js} +1 -0
  150. package/dist/esm/DataBinder-9c877244.js +441 -0
  151. package/dist/esm/FocusResolver-1ccbf850.js +33 -0
  152. package/dist/esm/ez-actions-button.entry.js +4 -3
  153. package/dist/esm/ez-button.entry.js +11 -5
  154. package/dist/esm/ez-card-item_2.entry.js +71 -0
  155. package/dist/esm/ez-check.entry.js +1 -1
  156. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  157. package/dist/esm/ez-combo-box-list_3.entry.js +360 -0
  158. package/dist/esm/ez-combo-box.entry.js +83 -156
  159. package/dist/esm/ez-date-input.entry.js +13 -4
  160. package/dist/esm/ez-date-time-input.entry.js +10 -4
  161. package/dist/esm/ez-dialog.entry.js +15 -8
  162. package/dist/esm/ez-double-list.entry.js +283 -0
  163. package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +75 -9
  164. package/dist/esm/ez-filter-input.entry.js +125 -0
  165. package/dist/esm/ez-form-view.entry.js +28 -21
  166. package/dist/esm/ez-form.entry.js +5 -324
  167. package/dist/esm/ez-grid.entry.js +14899 -69697
  168. package/dist/esm/ez-icon.entry.js +1 -1
  169. package/dist/esm/ez-list.entry.js +258 -211
  170. package/dist/esm/ez-modal-container.entry.js +2 -2
  171. package/dist/esm/ez-modal.entry.js +12 -3
  172. package/dist/esm/ez-multi-selection-list.entry.js +2 -2
  173. package/dist/esm/ez-number-input.entry.js +15 -3
  174. package/dist/esm/ez-popover-core_2.entry.js +1499 -0
  175. package/dist/esm/ez-popup.entry.js +24 -2
  176. package/dist/esm/ez-scroller_2.entry.js +3 -3
  177. package/dist/esm/ez-search.entry.js +109 -48
  178. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  179. package/dist/esm/ez-split-button.entry.js +2 -2
  180. package/dist/esm/ez-split-item.entry.js +6 -3
  181. package/dist/esm/ez-split-panel.entry.js +69 -7
  182. package/dist/esm/ez-text-area.entry.js +68 -6
  183. package/dist/esm/ez-text-input.entry.js +152 -16
  184. package/dist/esm/ez-time-input.entry.js +7 -1
  185. package/dist/esm/ez-tooltip.entry.js +51 -0
  186. package/dist/esm/ez-tree.entry.js +5 -4
  187. package/dist/esm/ezListHelper-00fb9b8d.js +87 -0
  188. package/dist/esm/ezui.js +1 -1
  189. package/dist/esm/filter-column.entry.js +10 -47
  190. package/dist/esm/index-baa5e267.js +22 -10
  191. package/dist/esm/loader.js +1 -1
  192. package/dist/ezui/ezui.esm.js +1 -1
  193. package/dist/ezui/p-0fa52b0f.entry.js +1 -0
  194. package/dist/ezui/p-0faf71c5.entry.js +1 -0
  195. package/dist/ezui/p-15134d97.entry.js +1 -0
  196. package/dist/ezui/p-17de16e5.entry.js +1 -0
  197. package/dist/ezui/p-17eabf46.entry.js +1 -0
  198. package/dist/ezui/p-1ad6c61b.entry.js +1 -0
  199. package/dist/ezui/p-20c024f7.entry.js +1 -0
  200. package/dist/ezui/p-2bb2a0c4.entry.js +1 -0
  201. package/dist/ezui/p-2f45506d.entry.js +1 -0
  202. package/dist/ezui/p-3195a7a7.entry.js +1 -0
  203. package/dist/ezui/p-31b71e50.entry.js +1 -0
  204. package/dist/ezui/p-3429080c.entry.js +1 -0
  205. package/dist/ezui/p-463be973.entry.js +309 -0
  206. package/dist/ezui/p-556468d9.entry.js +1 -0
  207. package/dist/ezui/p-56fe5341.entry.js +1 -0
  208. package/dist/ezui/p-58783dcf.entry.js +1 -0
  209. package/dist/ezui/p-65f471bc.entry.js +1 -0
  210. package/dist/ezui/p-6cdd3e0a.entry.js +1 -0
  211. package/dist/ezui/p-7bd15498.entry.js +1 -0
  212. package/dist/ezui/p-7e677b7b.entry.js +1 -0
  213. package/dist/ezui/{p-bf79aaa1.entry.js → p-7fdd479f.entry.js} +1 -1
  214. package/dist/ezui/p-80dfc50b.js +1 -0
  215. package/dist/ezui/p-990b4318.entry.js +1 -0
  216. package/dist/ezui/p-a4cee65d.entry.js +1 -0
  217. package/dist/ezui/p-acddfb2e.js +1 -0
  218. package/dist/ezui/p-b26f6c5b.entry.js +1 -0
  219. package/dist/ezui/p-c1527804.entry.js +1 -0
  220. package/dist/ezui/p-cb1535f7.entry.js +1 -0
  221. package/dist/ezui/p-cf87aacb.entry.js +1 -0
  222. package/dist/ezui/p-d9548bdf.entry.js +1 -0
  223. package/dist/ezui/p-da1b4a38.entry.js +1 -0
  224. package/dist/ezui/p-dc628ed3.js +1 -0
  225. package/dist/ezui/p-dc73e1fe.entry.js +1 -0
  226. package/dist/ezui/{p-84e439b9.entry.js → p-e347df9c.entry.js} +1 -1
  227. package/dist/ezui/p-e6a9041d.entry.js +1 -0
  228. package/dist/ezui/p-ea54d056.entry.js +1 -0
  229. package/dist/ezui/p-ec7db713.js +1 -0
  230. package/dist/ezui/p-f5931caa.entry.js +1 -0
  231. package/dist/ezui/p-fa6732f2.entry.js +1 -0
  232. package/dist/ezui/p-fd0a19d6.entry.js +1 -0
  233. package/dist/types/components/ez-button/ez-button.d.ts +2 -1
  234. package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
  235. package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
  236. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +17 -15
  237. package/dist/types/components/ez-date-input/ez-date-input.d.ts +6 -1
  238. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +6 -1
  239. package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -1
  240. package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
  241. package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
  242. package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
  243. package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
  244. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +6 -1
  245. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
  246. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
  247. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
  248. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
  249. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +71 -4
  250. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +36 -4
  251. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +25 -2
  252. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +33 -7
  253. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +4 -1
  254. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
  255. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  256. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
  257. package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
  258. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +2 -1
  259. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
  260. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
  261. package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
  262. package/dist/types/components/ez-grid/ez-grid.d.ts +54 -1
  263. package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +0 -11
  264. package/dist/types/components/ez-list/ez-list.d.ts +23 -2
  265. package/dist/types/components/ez-list/ezListHelper.d.ts +20 -0
  266. package/dist/types/components/ez-modal/ez-modal.d.ts +2 -1
  267. package/dist/types/components/ez-number-input/ez-number-input.d.ts +8 -0
  268. package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +68 -0
  269. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
  270. package/dist/types/components/ez-popup/ez-popup.d.ts +8 -1
  271. package/dist/types/components/ez-search/ez-search.d.ts +30 -6
  272. package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
  273. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +11 -0
  274. package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +9 -0
  275. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +5 -0
  276. package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
  277. package/dist/types/components/ez-text-input/ez-text-input.d.ts +24 -2
  278. package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
  279. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +21 -0
  280. package/dist/types/components/ez-tree/ez-tree.d.ts +4 -0
  281. package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
  282. package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +1 -0
  283. package/dist/types/components.d.ts +717 -29
  284. package/dist/types/utils/FocusResolver.d.ts +5 -0
  285. package/dist/types/utils/ResponsiveInputUtils.d.ts +6 -0
  286. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +2 -0
  287. package/dist/types/utils/form/DataBinder.d.ts +3 -0
  288. package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
  289. package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -1
  290. package/package.json +11 -3
  291. package/react/components.d.ts +5 -0
  292. package/react/components.js +5 -0
  293. package/react/components.js.map +1 -1
  294. package/dist/cjs/RecordValidationProcessor-4c893e04.js +0 -102
  295. package/dist/cjs/ez-card-item_3.cjs.entry.js +0 -183
  296. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -206
  297. package/dist/cjs/ez-skeleton.cjs.entry.js +0 -67
  298. package/dist/esm/RecordValidationProcessor-b00b8b77.js +0 -99
  299. package/dist/esm/ez-card-item_3.entry.js +0 -177
  300. package/dist/esm/ez-custom-form-input_2.entry.js +0 -201
  301. package/dist/esm/ez-skeleton.entry.js +0 -63
  302. package/dist/ezui/p-04f24913.js +0 -1
  303. package/dist/ezui/p-072e6347.entry.js +0 -1
  304. package/dist/ezui/p-1285c902.entry.js +0 -1
  305. package/dist/ezui/p-13d2fe2d.entry.js +0 -1
  306. package/dist/ezui/p-2097d0cf.entry.js +0 -1
  307. package/dist/ezui/p-32e553e5.entry.js +0 -304
  308. package/dist/ezui/p-34b6916c.entry.js +0 -1
  309. package/dist/ezui/p-3b4eeeb6.entry.js +0 -1
  310. package/dist/ezui/p-3faa2b46.entry.js +0 -1
  311. package/dist/ezui/p-42533ea4.entry.js +0 -1
  312. package/dist/ezui/p-49456b34.entry.js +0 -1
  313. package/dist/ezui/p-4d5235f1.entry.js +0 -1
  314. package/dist/ezui/p-5bd5e68f.entry.js +0 -1
  315. package/dist/ezui/p-784fe207.entry.js +0 -1
  316. package/dist/ezui/p-7922142b.entry.js +0 -1
  317. package/dist/ezui/p-7af81663.entry.js +0 -1
  318. package/dist/ezui/p-7bc07c31.entry.js +0 -1
  319. package/dist/ezui/p-85c8baae.entry.js +0 -1
  320. package/dist/ezui/p-8888d9ed.entry.js +0 -1
  321. package/dist/ezui/p-8f0144f6.entry.js +0 -1
  322. package/dist/ezui/p-9050d2cd.entry.js +0 -1
  323. package/dist/ezui/p-922ac38b.entry.js +0 -1
  324. package/dist/ezui/p-9ab22a07.entry.js +0 -1
  325. package/dist/ezui/p-9e11fc7b.js +0 -1
  326. package/dist/ezui/p-a31b9c90.entry.js +0 -1
  327. package/dist/ezui/p-af95cd16.entry.js +0 -1
  328. package/dist/ezui/p-bae4e180.entry.js +0 -1
  329. package/dist/ezui/p-baf80b13.entry.js +0 -1
  330. package/dist/ezui/p-bcb53f27.entry.js +0 -1
  331. package/dist/ezui/p-d9401ea0.entry.js +0 -1
  332. package/dist/ezui/p-e85c48d7.entry.js +0 -1
  333. package/dist/ezui/p-ecc2c1ec.entry.js +0 -1
  334. package/dist/ezui/p-fcf0acce.entry.js +0 -1
@@ -2,6 +2,93 @@ 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
+ if (this._options) {
7
+ this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
8
+ }
9
+ this._controller.clearInvalidCells();
10
+ this.handleRefreshOrReload(action);
11
+ this._controller.processContinuousInsert();
12
+ this._controller.showSelectionColumn();
13
+ }
14
+ handleEditionCanceled(action) {
15
+ if (this._options.enableGridInsert) {
16
+ this._controller.processEditionCanceled();
17
+ }
18
+ this.handleRefreshOrReload(action);
19
+ this._controller.showSelectionColumn();
20
+ }
21
+ handleSavingCanceled(action) {
22
+ var _a, _b, _c, _d;
23
+ if (!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fields) || !((_b = action.payload) === null || _b === void 0 ? void 0 : _b.recordId))
24
+ return;
25
+ 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);
26
+ }
27
+ handleDataChanged(action) {
28
+ if (!this._options.enableGridInsert) {
29
+ this.handleRefresh(action);
30
+ return;
31
+ }
32
+ this.updateGridRowNodes(this.createRecordIdList(action));
33
+ }
34
+ createRecordIdList(action) {
35
+ var _a, _b;
36
+ if ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.records)
37
+ return (_b = action.payload) === null || _b === void 0 ? void 0 : _b.records;
38
+ return this._dataUnit.getSelectedRecord() ? [this._dataUnit.getSelectedRecord().__record__id__] : [];
39
+ }
40
+ /**
41
+ * Nesse ponto, o registro já se encontra atualizado no DU,
42
+ * basta então passar seu valor para que a garde possa atualizar sua linha.
43
+ */
44
+ updateGridRowNodes(recordIDList) {
45
+ const recordsToUpdate = recordIDList === null || recordIDList === void 0 ? void 0 : recordIDList.map(id => this.getRecordById(id));
46
+ this._controller.updateRows(recordsToUpdate);
47
+ }
48
+ getRecordById(recordId) {
49
+ return this._dataUnit.records.find(record => record['__record__id__'] === recordId);
50
+ }
51
+ /**
52
+ * Em caso de necessidade de reload (isWaitingToReload), eh preciso chamar o dataUnit.gotoPage, pois ele aplica tambem a ordenacao dos registros,
53
+ * enquanto que o _controller.refresh apenas recarrega os dados na ordem que atua.
54
+ */
55
+ handleRefreshOrReload(action) {
56
+ if (this._dataUnit.isWaitingToReload()) {
57
+ this.handleReload();
58
+ return;
59
+ }
60
+ this.handleRefresh(action);
61
+ }
62
+ handleReload() {
63
+ this._dataUnit.setWaitingToReload(false);
64
+ this._dataUnit.gotoPage(0);
65
+ }
66
+ handleRefresh(action) {
67
+ if (this.isSilentChange(action)) {
68
+ return;
69
+ }
70
+ this._controller.refresh(action.type === Action.DATA_SAVED);
71
+ }
72
+ handleRecordsAdded() {
73
+ if (this._options.enableGridInsert) {
74
+ this._controller.hideSelectionColumn();
75
+ this._controller.refresh();
76
+ this.focusOnNewRecord();
77
+ }
78
+ }
79
+ focusOnNewRecord() {
80
+ /**
81
+ * O SetTimeout eh utilizado pois é preciso aguardar que o novo registro seja renderizado na grade.
82
+ * Tentamos utilizar a api da grade para adicionar um event listener, porém na versão que utilizamos, não existe
83
+ * algo que resolva nosso cenário.
84
+ *
85
+ * Sugiro no futuro utilizar algo como o applyServerSideTransaction, porém será preciso lidar com os handlers
86
+ * e callbacks implementados no AgGridController e GridEditionManager.
87
+ */
88
+ setTimeout(() => {
89
+ this._controller.startEditionOnLastRow();
90
+ }, 1000);
91
+ }
5
92
  updateLoadedRecords(action) {
6
93
  const records = action.payload;
7
94
  if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
@@ -28,12 +115,15 @@ export default class DataSource {
28
115
  return ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.silent) === true;
29
116
  }
30
117
  }
31
- constructor(dataUnit, controller, options) {
118
+ constructor(dataUnit, controller, options, resolveLoading) {
119
+ var _a;
32
120
  this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
33
121
  this.duObserver = (action) => {
122
+ var _a;
34
123
  switch (action.type) {
35
124
  case Action.METADATA_LOADED:
36
125
  this._controller.setColumnsDef(this.buildColumnDefs());
126
+ (_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
37
127
  break;
38
128
  case Action.LOADING_DATA:
39
129
  this._waitingForLoad = true;
@@ -53,15 +143,22 @@ export default class DataSource {
53
143
  this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
54
144
  }
55
145
  break;
56
- case Action.RECORDS_REMOVED:
146
+ case Action.RECORDS_ADDED:
147
+ case Action.RECORDS_COPIED:
148
+ this.handleRecordsAdded();
149
+ break;
57
150
  case Action.DATA_SAVED:
151
+ this.handleDataSaved(action);
152
+ break;
58
153
  case Action.EDITION_CANCELED:
154
+ this.handleEditionCanceled(action);
155
+ break;
59
156
  case Action.DATA_CHANGED:
60
157
  case Action.DATA_RESOLVED:
61
- if (this.isSilentChange(action)) {
62
- return;
63
- }
64
- this._controller.refresh();
158
+ this.handleDataChanged(action);
159
+ break;
160
+ case Action.RECORDS_REMOVED:
161
+ this.handleRefresh(action);
65
162
  break;
66
163
  case Action.SELECTION_CHANGED:
67
164
  case Action.NEXT_SELECTED:
@@ -71,14 +168,24 @@ export default class DataSource {
71
168
  case Action.RECORD_LOADED:
72
169
  this.updateLoadedRecords(action);
73
170
  break;
171
+ case Action.SAVING_CANCELED:
172
+ this.handleSavingCanceled(action);
173
+ break;
74
174
  }
75
175
  };
76
- this._dataUnit = dataUnit;
77
- this._controller = controller;
78
- this._controller.setColumnsDef(this.buildColumnDefs());
79
- this._options = options;
80
- this._dataUnit.subscribe(this.duObserver);
81
- this._dataUnit.addInterceptor(new DataSourceInterceptor(this._controller));
176
+ try {
177
+ this._resolveLoading = resolveLoading;
178
+ this._dataUnit = dataUnit;
179
+ this._controller = controller;
180
+ this._controller.setColumnsDef(this.buildColumnDefs());
181
+ this._options = options;
182
+ this._dataUnit.subscribe(this.duObserver);
183
+ this._dataUnit.addInterceptor(new DataSourceInterceptor(this._controller));
184
+ }
185
+ finally {
186
+ if (this._dataUnit.metadata)
187
+ (_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
188
+ }
82
189
  }
83
190
  updateSelection() {
84
191
  const selectionInfo = this._dataUnit.getSelectionInfo();
@@ -92,6 +199,9 @@ export default class DataSource {
92
199
  setAutoFocus(autoFocus) {
93
200
  this._options.autoFocus = autoFocus;
94
201
  }
202
+ setEnableGridInsert(enable) {
203
+ this._options.enableGridInsert = enable;
204
+ }
95
205
  getRows(params) {
96
206
  if (this.needReload(params)) {
97
207
  this._lastLoadingParams = params;
@@ -119,27 +229,37 @@ export default class DataSource {
119
229
  destroy() {
120
230
  this._dataUnit.unsubscribe(this.duObserver);
121
231
  }
232
+ registryListeners() {
233
+ var _a, _b;
234
+ (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.duObserver);
235
+ (_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.subscribe(this.duObserver);
236
+ }
122
237
  buildColumnDefs() {
123
- const gridConfig = this._controller.getGridConfig() || [];
124
- const columnDefs = [];
125
- if (this._dataUnit.metadata) {
126
- this._dataUnit.metadata.fields.sort((a, b) => {
127
- const indexA = gridConfig.findIndex(value => value.name === a.name);
128
- const indexB = gridConfig.findIndex(value => value.name === b.name);
129
- return indexA - indexB;
130
- });
131
- this._dataUnit.metadata.fields.forEach(f => {
132
- var _a;
133
- if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
134
- const props = new Map();
135
- const properties = this._dataUnit.getField(f.name).properties;
136
- for (const value in properties) {
137
- props.set(value, properties[value]);
238
+ try {
239
+ const gridConfig = this._controller.getGridConfig() || [];
240
+ const columnDefs = [];
241
+ if (this._dataUnit.metadata) {
242
+ this._dataUnit.metadata.fields.sort((a, b) => {
243
+ const indexA = gridConfig.findIndex(value => value.name === a.name);
244
+ const indexB = gridConfig.findIndex(value => value.name === b.name);
245
+ return indexA - indexB;
246
+ });
247
+ this._dataUnit.metadata.fields.forEach(f => {
248
+ var _a;
249
+ if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
250
+ const props = new Map();
251
+ const properties = this._dataUnit.getField(f.name).properties;
252
+ for (const value in properties) {
253
+ props.set(value, properties[value]);
254
+ }
255
+ columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
138
256
  }
139
- columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
140
- }
141
- });
257
+ });
258
+ }
259
+ return columnDefs;
260
+ }
261
+ catch (error) {
262
+ console.warn(error);
142
263
  }
143
- return columnDefs;
144
264
  }
145
265
  }
@@ -1,5 +1,6 @@
1
1
  import { Action } from "@sankhyalabs/core";
2
2
  import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
3
+ import { DataUnit } from "@sankhyalabs/core";
3
4
  export class DataSourceInterceptor {
4
5
  constructor(controller) {
5
6
  this._controller = controller;
@@ -11,7 +12,7 @@ export class DataSourceInterceptor {
11
12
  interceptAction(action) {
12
13
  var _a;
13
14
  if (action.type === Action.LOADING_DATA) {
14
- if (EZ_GRID_LOADING_SOURCE !== action.payload.source) {
15
+ if (EZ_GRID_LOADING_SOURCE !== action.payload.source && DataUnit.CHANGING_PAGE_LOADING_SOURCE !== action.payload.source) {
15
16
  action.payload.filters = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== undefined ? this.clearColumnFilter(action.payload.filters) : action.payload.filters;
16
17
  this._controller.clearFilter();
17
18
  }
@@ -1,53 +1,144 @@
1
- import { UserInterface } from "@sankhyalabs/core";
2
- import { KeyCode } from "ag-grid-community";
3
- import { RecordValidationProcessor } from "../../../../utils/validators/recordvalidator/RecordValidationProcessor";
4
- import EzCellEditor from "./editor/EzCellEditor";
5
- import EzGridCustomCellEditor from "./components/EzGridCustomCellEditor";
6
- import EzGridCustomCellRender from "./components/EzGridCustomCellRender";
1
+ import { LockManager, LockManagerOperation, UserInterface } from '@sankhyalabs/core';
2
+ import { KeyCode, } from "@ag-grid-community/core";
3
+ import { RecordValidationProcessor } from '../../../../utils/validators/recordvalidator/RecordValidationProcessor';
4
+ import EzCellEditor from './editor/EzCellEditor';
5
+ import EzGridCustomCellEditor from './components/EzGridCustomCellEditor';
6
+ import EzGridCustomCellRender from './components/EzGridCustomCellRender';
7
+ import { DataBinder } from '../../../../utils';
7
8
  export default class GridEditionManager {
8
- constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
9
+ constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert, lockerId) {
9
10
  this._dataUnit = dataUnit;
10
11
  this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
11
12
  getRequiredFields: () => this.getRequiredFields(),
12
- markAsInvalid: () => { },
13
- getMessageForField: () => null
13
+ markAsInvalid: (invalidField, recordId) => { this.pushInvalidCell(invalidField, recordId); },
14
+ getMessageForField: () => null,
14
15
  }, recordsValidator);
15
16
  this._useEnterLikeTab = useEnterLikeTab;
16
17
  this._editionIsDisabled = editionIsDisabled;
18
+ this._enableContinuousInsert = enableContinuousInsert;
19
+ this._enableGridInsert = enableGridInsert;
17
20
  this._customEditors = customEditors;
18
21
  this._customRenders = customRenders;
22
+ this._lockerId = lockerId;
19
23
  }
20
24
  configureGrid(options) {
21
25
  this._gridOptions = options;
22
26
  options.readOnlyEdit = true;
23
27
  options.onCellEditRequest = evt => this.onCellEditRequest(evt);
28
+ options.onCellEditingStarted = async (evt) => {
29
+ var _a;
30
+ if (this._dataUnit.hasNewRecord()) {
31
+ this.handleCellEditingStartedRowAdd(evt);
32
+ }
33
+ else {
34
+ this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt.column, rowPinned: undefined };
35
+ }
36
+ (_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
37
+ this._currentEditLock = LockManager.lock(this._lockerId, LockManagerOperation.TASKBAR_CLICK);
38
+ };
39
+ options.onCellEditingStopped = () => {
40
+ var _a;
41
+ (_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
42
+ };
24
43
  options.onCellKeyDown = evt => {
25
44
  if (evt.event && evt["column"]) {
26
45
  this.onCellKeyDown(evt);
27
46
  }
28
47
  };
48
+ options.isRowSelectable = (node) => this.isSelectableRow(node);
49
+ options.onCellFocused = () => this.lockFocusWhenAddRow();
29
50
  return options;
30
51
  }
31
- proceedAutoSave() {
32
- if (!this._dataUnit.isDirty()) {
33
- this.saveSuccess();
52
+ updateCurrentEditorGuiValue(updatedRowValue) {
53
+ const editorInstances = this._gridOptions.api.getCellEditorInstances();
54
+ if (!editorInstances || !editorInstances.length)
55
+ return;
56
+ const currentEditor = editorInstances[0];
57
+ const fieldMetadata = currentEditor.getFieldMetadata();
58
+ const fieldName = fieldMetadata.name;
59
+ const value = updatedRowValue[fieldName];
60
+ currentEditor.setGuiValue(value);
61
+ }
62
+ lockFocusWhenAddRow() {
63
+ var _a, _b, _c, _d;
64
+ const api = this._gridOptions.api;
65
+ const newFocusCell = api.getFocusedCell();
66
+ const rowIndex = newFocusCell === null || newFocusCell === void 0 ? void 0 : newFocusCell.rowIndex;
67
+ const recordId = (_b = (_a = this._dataUnit.getAddedRecords()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.__record__id__;
68
+ const rowNode = api.getRowNode(recordId);
69
+ if (!this._dataUnit.hasNewRecord() || rowIndex == (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
34
70
  return;
35
71
  }
36
- if (!this._isGridEdition || this._dataUnit.hasNewRecord()) {
72
+ const lastCell = (_d = (_c = this._lastCellOpened) !== null && _c !== void 0 ? _c : this._lastCellEdited) !== null && _d !== void 0 ? _d : this._lastCellClicked;
73
+ if ((lastCell === null || lastCell === void 0 ? void 0 : lastCell.rowIndex) < (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
37
74
  return;
38
75
  }
39
- const currentRercord = this._dataUnit.getSelectedRecord();
40
- if (currentRercord == undefined) {
76
+ api.clearFocusedCell();
77
+ if (!lastCell || (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) == undefined) {
41
78
  return;
42
79
  }
43
- this._recordValidationProcessor
44
- .validate()
45
- .then(() => {
46
- this._dataUnit.saveData()
47
- .then(() => this.saveSuccess())
48
- .catch(reason => this.saveFail(reason));
49
- })
50
- .catch(reason => this.saveFail(reason));
80
+ lastCell.rowIndex = rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex;
81
+ this.focusOnCell(lastCell);
82
+ }
83
+ handleCellEditingStartedRowAdd(evt) {
84
+ var _a, _b, _c, _d, _e;
85
+ const nodeId = (_a = evt.node) === null || _a === void 0 ? void 0 : _a.id;
86
+ const addedRecordId = (_c = (_b = this._dataUnit.getAddedRecords()) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
87
+ if (nodeId == addedRecordId) {
88
+ this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt === null || evt === void 0 ? void 0 : evt.column, rowPinned: undefined };
89
+ return;
90
+ }
91
+ evt.api.stopEditing();
92
+ const rowIndex = (_d = evt.api.getRowNode(addedRecordId)) === null || _d === void 0 ? void 0 : _d.rowIndex;
93
+ this._lastCellOpened = this._lastCellEdited = { rowIndex: rowIndex, column: (_e = this._lastCellEdited) === null || _e === void 0 ? void 0 : _e.column, rowPinned: undefined };
94
+ }
95
+ isSelectableRow(node) {
96
+ if (!this._dataUnit.hasNewRecord()) {
97
+ return true;
98
+ }
99
+ if (!this._dataUnit.isNewRecord(node.id)) {
100
+ return false;
101
+ }
102
+ return true;
103
+ }
104
+ canContinuousInsert() {
105
+ var _a;
106
+ return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
107
+ }
108
+ async proceedAutoSave() {
109
+ if (!this._dataUnit.isDirty()) {
110
+ this.saveSuccess();
111
+ return true;
112
+ }
113
+ const currentRecord = this._dataUnit.getSelectedRecord();
114
+ if (currentRecord == undefined) {
115
+ return true;
116
+ }
117
+ this.clearInvalidCells(false);
118
+ try {
119
+ await this._recordValidationProcessor.validate(true);
120
+ await this.saveDataUnit();
121
+ this.saveSuccess();
122
+ return true;
123
+ }
124
+ catch (reason) {
125
+ this.saveFail(reason);
126
+ return false;
127
+ }
128
+ }
129
+ async saveDataUnit() {
130
+ await this._dataUnit.saveData();
131
+ return true;
132
+ }
133
+ async recordValidate() {
134
+ if (!this._dataUnit.isDirty())
135
+ return;
136
+ try {
137
+ this.clearInvalidCells(false);
138
+ await this._recordValidationProcessor.validate(false);
139
+ }
140
+ catch (error) { }
141
+ this._gridOptions.api.refreshCells({ force: true });
51
142
  }
52
143
  navigateByEnterKey(keyboardEvent) {
53
144
  const backwards = keyboardEvent.shiftKey;
@@ -71,6 +162,13 @@ export default class GridEditionManager {
71
162
  return { ezCellEditor: EzCellEditor };
72
163
  }
73
164
  verifyClickToEdition(api, cellClicked) {
165
+ var _a, _b;
166
+ const selectedRecordID = (_a = this._dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
167
+ if (this._dataUnit.hasNewRecord() && selectedRecordID) {
168
+ const dataUnitRecordIndex = (_b = api.getRowNode(selectedRecordID)) === null || _b === void 0 ? void 0 : _b.rowIndex;
169
+ if (dataUnitRecordIndex != cellClicked.rowIndex)
170
+ return;
171
+ }
74
172
  if (this.isSecondClick(cellClicked)) {
75
173
  api.startEditingCell({ rowIndex: cellClicked.rowIndex, colKey: cellClicked.column.getColId() });
76
174
  }
@@ -80,6 +178,9 @@ export default class GridEditionManager {
80
178
  col.cellEditor = 'ezCellEditor';
81
179
  col.editable = params => this.canEdit(params);
82
180
  col.suppressKeyboardEvent = (params) => {
181
+ if (params.event.key === KeyCode.ESCAPE && params.editing) {
182
+ return this._dataUnit.isDirty();
183
+ }
83
184
  return params.event.key === KeyCode.ENTER;
84
185
  };
85
186
  col.cellEditorSelector = (params) => {
@@ -109,10 +210,21 @@ export default class GridEditionManager {
109
210
  return col;
110
211
  }
111
212
  getRequiredFields() {
112
- return this._gridOptions.columnApi.getAllDisplayedColumns().filter(c => {
113
- const fieldDefinition = this._dataUnit.getField(c.getColId());
114
- return fieldDefinition && fieldDefinition.required;
115
- }).map(c => c.getColId());
213
+ const formRequiredFields = this.getFormRequiredFields();
214
+ return this._gridOptions.columnApi.getAllDisplayedColumns()
215
+ .filter(column => {
216
+ const fieldDefinition = this._dataUnit.getField(column.getColId());
217
+ return (fieldDefinition && fieldDefinition.required) || formRequiredFields.includes(column.getColId());
218
+ })
219
+ .map(column => column.getColId());
220
+ }
221
+ getFormRequiredFields() {
222
+ const formRequiredFields = [];
223
+ const dataBinders = DataBinder.getDataBindersByDataUnit(this._dataUnit);
224
+ dataBinders.forEach(dataBinder => {
225
+ formRequiredFields.push(...dataBinder.getFormRequiredFields());
226
+ });
227
+ return formRequiredFields;
116
228
  }
117
229
  saveSuccess() {
118
230
  var _a;
@@ -125,18 +237,20 @@ export default class GridEditionManager {
125
237
  this._isGridEdition = false;
126
238
  }
127
239
  saveFail(reason) {
128
- this.focusOnCell(this._lastCellEdited);
240
+ var _a;
241
+ this.focusOnCell((_a = this._lastCellOpened) !== null && _a !== void 0 ? _a : this._lastCellEdited);
129
242
  this._isGridEdition = false;
130
243
  if (reason) {
131
- Promise.reject(reason);
244
+ throw reason;
132
245
  }
133
246
  }
134
247
  focusOnCell(cell) {
248
+ var _a;
135
249
  if (cell == undefined) {
136
250
  return;
137
251
  }
138
252
  const { rowIndex, column } = cell;
139
- this._gridOptions.api.getDisplayedRowAtIndex(rowIndex).setSelected(true, true);
253
+ (_a = this._gridOptions.api.getDisplayedRowAtIndex(rowIndex)) === null || _a === void 0 ? void 0 : _a.setSelected(true, true);
140
254
  this._gridOptions.api.clearRangeSelection();
141
255
  this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [column] });
142
256
  this._gridOptions.api.startEditingCell({ colKey: column.getColId(), rowIndex });
@@ -176,9 +290,10 @@ export default class GridEditionManager {
176
290
  }
177
291
  }
178
292
  else {
293
+ const actualRowIndex = rowIndex;
179
294
  rowIndex = rowIndex + 1;
180
295
  if (rowIndex >= this._dataUnit.records.length) {
181
- rowIndex = 0;
296
+ rowIndex = !this._enableGridInsert ? 0 : actualRowIndex;
182
297
  }
183
298
  }
184
299
  this._targetEditionCell = new TargetEdition(rowIndex, column, true);
@@ -191,6 +306,9 @@ export default class GridEditionManager {
191
306
  this.moveEditionVertically(api, 1);
192
307
  }
193
308
  moveEditionVertically(api, offset) {
309
+ if (this._dataUnit.hasNewRecord() && this._isGridEdition) {
310
+ return;
311
+ }
194
312
  const editionCell = api.getEditingCells()[0];
195
313
  if (!editionCell) {
196
314
  return;
@@ -235,28 +353,87 @@ export default class GridEditionManager {
235
353
  return true;
236
354
  }
237
355
  onCellEditRequest(event) {
238
- const fieldName = event.colDef.field;
356
+ var _a;
239
357
  const value = event.newValue;
240
- if (event.oldValue != value) {
241
- if (value instanceof Promise) {
242
- const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
243
- event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue }));
244
- value.then(resolved => event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: resolved })));
245
- }
246
- else {
247
- event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: value }));
248
- }
358
+ if (event.oldValue == value) {
359
+ (_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
360
+ return;
361
+ }
362
+ if (value instanceof Promise) {
363
+ this.handlePromiseValue(event, value);
364
+ return;
365
+ }
366
+ this.updateCellValue(event, value);
367
+ }
368
+ async handlePromiseValue(event, value) {
369
+ const fieldName = event.colDef.field;
370
+ const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
371
+ const initialValue = (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue;
372
+ event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: initialValue }));
373
+ const resolved = await value;
374
+ return this.updateCellValue(event, resolved);
375
+ }
376
+ updateCellValue(event, newValue) {
377
+ var _a;
378
+ const fieldName = event.colDef.field;
379
+ event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: newValue }));
380
+ (_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
381
+ if (event.oldValue !== newValue) {
249
382
  this._isGridEdition = true;
250
- this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__]);
383
+ this._dataUnit.setFieldValue(fieldName, newValue, [event.data.__record__id__], { suppressCreateNewRecord: true });
251
384
  this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
252
385
  }
253
386
  }
254
387
  setCellEditors(customEditors) {
388
+ var _a;
255
389
  this._customEditors = customEditors;
390
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.stopEditing();
256
391
  }
257
392
  setCellRenders(customRenders) {
258
393
  this._customRenders = customRenders;
259
394
  }
395
+ pushInvalidCell(invalidField, recordId) {
396
+ this._invalidCells.push({ field: invalidField, recordId });
397
+ this._nextInvalidCell = this._invalidCells[0];
398
+ }
399
+ getInvalidCells() {
400
+ return this._invalidCells;
401
+ }
402
+ getNextInvalidCell() {
403
+ return this._nextInvalidCell;
404
+ }
405
+ async processContinuousInsert() {
406
+ if (!this.canContinuousInsert())
407
+ return;
408
+ this._dataUnit.addRecord();
409
+ }
410
+ clearInvalidCells(stopEdition) {
411
+ this._invalidCells = [];
412
+ this._nextInvalidCell = undefined;
413
+ if (stopEdition) {
414
+ this._isGridEdition = false;
415
+ }
416
+ }
417
+ setEnableContinuousInsert(enable) {
418
+ this._enableContinuousInsert = enable;
419
+ }
420
+ hasInvalidField(fieldName, recordId) {
421
+ if (!this.hasInvalidCell())
422
+ return false;
423
+ this._nextInvalidCell = this._invalidCells[0];
424
+ const containsFieldName = this._nextInvalidCell.field.name === fieldName;
425
+ const containsRecordId = this._nextInvalidCell.recordId === recordId;
426
+ return containsFieldName && containsRecordId;
427
+ }
428
+ hasInvalidCell() {
429
+ var _a, _b, _c;
430
+ const hasInvalidCell = ((_a = this._invalidCells) === null || _a === void 0 ? void 0 : _a.length) > 0;
431
+ const hasField = (_b = this._invalidCells) === null || _b === void 0 ? void 0 : _b.filter(invalidCell => { invalidCell.field; });
432
+ const hasRecordId = (_c = this._invalidCells) === null || _c === void 0 ? void 0 : _c.filter(invalidCell => { invalidCell.recordId; });
433
+ if (!hasInvalidCell || !hasField || !hasRecordId)
434
+ return false;
435
+ return true;
436
+ }
260
437
  }
261
438
  class TargetEdition {
262
439
  constructor(rowIndex, column, backwards) {
@@ -1,6 +1,8 @@
1
1
  import { HTMLBuilder } from "@sankhyalabs/core";
2
2
  import { CustomEditorSource } from "../../../../../utils/customEditor/interfaces/ICustomEditor";
3
3
  import EzCellEditor from "../editor/EzCellEditor";
4
+ import { getViewPortHeight } from "../editor/GridEditorUtils";
5
+ import FocusResolver from "../../../../../utils/FocusResolver";
4
6
  export default class EzGridCustomCellEditor extends EzCellEditor {
5
7
  init(params) {
6
8
  var _a, _b;
@@ -11,6 +13,8 @@ export default class EzGridCustomCellEditor extends EzCellEditor {
11
13
  this._defaultGui = this.getDefaultGui();
12
14
  const fieldMetadata = super.getFieldMetadata();
13
15
  this._params = {
16
+ cellPossition: getViewPortHeight(params.eGridCell),
17
+ eGridCell: params.eGridCell,
14
18
  value: params.value,
15
19
  charPress: params.charPress,
16
20
  currentEditor: this._defaultGui,
@@ -48,12 +52,24 @@ export default class EzGridCustomCellEditor extends EzCellEditor {
48
52
  const element = HTMLBuilder.parseElement(editorElement);
49
53
  return element;
50
54
  }
55
+ this._customGui = editorElement;
51
56
  return editorElement;
52
57
  }
53
58
  setValue(value) {
54
59
  this._value = value;
55
60
  }
56
61
  getValue() {
62
+ var _a, _b;
63
+ if ((_a = this._customGui) === null || _a === void 0 ? void 0 : _a.getValue)
64
+ return this._customGui.getValue();
65
+ if ((_b = this._customGui) === null || _b === void 0 ? void 0 : _b.hasAttribute('value'))
66
+ return this._customGui.value;
57
67
  return this._value;
58
68
  }
69
+ afterGuiAttached() {
70
+ this.focusIn();
71
+ }
72
+ focusIn() {
73
+ FocusResolver.resolveFocus(this._customGui);
74
+ }
59
75
  }
@@ -6,7 +6,7 @@ export class EzGridCustomHeader {
6
6
  this.element.classList.add('ag-cell-label-container');
7
7
  this.element.setAttribute('title', (_a = this.params.tooltip) !== null && _a !== void 0 ? _a : '');
8
8
  this.element.innerHTML = `
9
- <div class='ez-flex ez-flex--justify-between'>
9
+ <div id='filter-column-${agParams.column.getColId()}-${agParams.context.dataUnit.dataUnitId}' class='ez-flex ez-flex--justify-between'>
10
10
  <i id='ez-grid-filter-icon' class='ez-icon-filter' style='color:#008561'></i>
11
11
  <i id='ez-grid-menu-icon' class='ez-icon-dots-vertical'></i>
12
12
  </div>