@sankhyalabs/ezui 5.22.0-dev.3 → 5.22.0-dev.31

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 (246) hide show
  1. package/dist/cjs/{RecordValidationProcessor-4c893e04.js → RecordValidationProcessor-10846595.js} +7 -1
  2. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-button.cjs.entry.js +12 -6
  9. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-card-item_3.cjs.entry.js +14 -5
  11. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-check.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  15. package/dist/cjs/ez-combo-box.cjs.entry.js +20 -3
  16. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +35 -6
  17. package/dist/cjs/ez-date-input.cjs.entry.js +4 -1
  18. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-form-view.cjs.entry.js +4 -3
  23. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  24. package/dist/cjs/ez-grid.cjs.entry.js +389 -57
  25. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  28. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-modal-container.cjs.entry.js +3 -2
  30. package/dist/cjs/ez-modal.cjs.entry.js +9 -3
  31. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
  32. package/dist/cjs/ez-number-input.cjs.entry.js +7 -2
  33. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-popup.cjs.entry.js +10 -3
  35. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-scroller_2.cjs.entry.js +4 -4
  37. package/dist/cjs/ez-search.cjs.entry.js +30 -6
  38. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +2 -2
  39. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  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 +1 -1
  43. package/dist/cjs/ez-tabselector.cjs.entry.js +9 -3
  44. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  49. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  50. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  51. package/dist/cjs/ezui.cjs.js +2 -2
  52. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  53. package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +3 -0
  54. package/dist/cjs/loader.cjs.js +2 -2
  55. package/dist/collection/components/ez-button/ez-button.css +13 -2
  56. package/dist/collection/components/ez-button/ez-button.js +12 -6
  57. package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
  58. package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
  59. package/dist/collection/components/ez-check/ez-check.css +1 -6
  60. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
  61. package/dist/collection/components/ez-combo-box/ez-combo-box.js +37 -2
  62. package/dist/collection/components/ez-date-input/ez-date-input.js +3 -0
  63. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +47 -5
  64. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
  65. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +165 -37
  66. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +99 -5
  67. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +73 -14
  68. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +9 -0
  69. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
  70. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +1 -0
  71. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +3 -0
  72. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +2 -0
  73. package/dist/collection/components/ez-grid/ez-grid.css +17 -7
  74. package/dist/collection/components/ez-grid/ez-grid.js +91 -4
  75. package/dist/collection/components/ez-list/ez-list.css +2 -1
  76. package/dist/collection/components/ez-modal/ez-modal.css +1 -1
  77. package/dist/collection/components/ez-modal/ez-modal.js +25 -1
  78. package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
  79. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
  80. package/dist/collection/components/ez-number-input/ez-number-input.js +24 -1
  81. package/dist/collection/components/ez-popup/ez-popup.css +5 -1
  82. package/dist/collection/components/ez-popup/ez-popup.js +26 -1
  83. package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
  84. package/dist/collection/components/ez-search/ez-search.css +19 -8
  85. package/dist/collection/components/ez-search/ez-search.js +82 -4
  86. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
  87. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
  88. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +3 -1
  89. package/dist/collection/components/ez-split-button/ez-split-button.css +1 -1
  90. package/dist/collection/components/ez-split-button/ez-split-button.js +3 -3
  91. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +1 -0
  92. package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -2
  93. package/dist/collection/utils/form/DataBinder.js +1 -1
  94. package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
  95. package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +7 -1
  96. package/dist/custom-elements/index.js +558 -106
  97. package/dist/esm/{RecordValidationProcessor-b00b8b77.js → RecordValidationProcessor-9c6cc267.js} +7 -1
  98. package/dist/esm/ez-actions-button.entry.js +1 -1
  99. package/dist/esm/ez-alert-list.entry.js +1 -1
  100. package/dist/esm/ez-alert.entry.js +1 -1
  101. package/dist/esm/ez-application.entry.js +1 -1
  102. package/dist/esm/ez-badge.entry.js +1 -1
  103. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  104. package/dist/esm/ez-button.entry.js +12 -6
  105. package/dist/esm/ez-calendar.entry.js +1 -1
  106. package/dist/esm/ez-card-item_3.entry.js +14 -5
  107. package/dist/esm/ez-chart.entry.js +1 -1
  108. package/dist/esm/ez-check.entry.js +2 -2
  109. package/dist/esm/ez-chip.entry.js +1 -1
  110. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  111. package/dist/esm/ez-combo-box.entry.js +20 -3
  112. package/dist/esm/ez-custom-form-input_2.entry.js +36 -7
  113. package/dist/esm/ez-date-input.entry.js +4 -1
  114. package/dist/esm/ez-date-time-input.entry.js +1 -1
  115. package/dist/esm/ez-dialog.entry.js +1 -1
  116. package/dist/esm/ez-dropdown.entry.js +1 -1
  117. package/dist/esm/ez-file-item.entry.js +1 -1
  118. package/dist/esm/ez-form-view.entry.js +4 -3
  119. package/dist/esm/ez-form.entry.js +3 -3
  120. package/dist/esm/ez-grid.entry.js +389 -57
  121. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  122. package/dist/esm/ez-icon.entry.js +1 -1
  123. package/dist/esm/ez-list.entry.js +2 -2
  124. package/dist/esm/ez-loading-bar.entry.js +1 -1
  125. package/dist/esm/ez-modal-container.entry.js +3 -2
  126. package/dist/esm/ez-modal.entry.js +9 -3
  127. package/dist/esm/ez-multi-selection-list.entry.js +2 -2
  128. package/dist/esm/ez-number-input.entry.js +7 -2
  129. package/dist/esm/ez-popover.entry.js +1 -1
  130. package/dist/esm/ez-popup.entry.js +10 -3
  131. package/dist/esm/ez-radio-button.entry.js +1 -1
  132. package/dist/esm/ez-scroller_2.entry.js +4 -4
  133. package/dist/esm/ez-search.entry.js +30 -6
  134. package/dist/esm/ez-sidebar-navigator.entry.js +2 -2
  135. package/dist/esm/ez-skeleton.entry.js +1 -1
  136. package/dist/esm/ez-split-button.entry.js +3 -3
  137. package/dist/esm/ez-split-item.entry.js +2 -2
  138. package/dist/esm/ez-split-panel.entry.js +1 -1
  139. package/dist/esm/ez-tabselector.entry.js +9 -3
  140. package/dist/esm/ez-text-area.entry.js +1 -1
  141. package/dist/esm/ez-text-input.entry.js +1 -1
  142. package/dist/esm/ez-time-input.entry.js +1 -1
  143. package/dist/esm/ez-toast.entry.js +1 -1
  144. package/dist/esm/ez-tree.entry.js +1 -1
  145. package/dist/esm/ez-upload.entry.js +1 -1
  146. package/dist/esm/ez-view-stack.entry.js +1 -1
  147. package/dist/esm/ezui.js +3 -3
  148. package/dist/esm/filter-column.entry.js +1 -1
  149. package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +3 -1
  150. package/dist/esm/loader.js +3 -3
  151. package/dist/ezui/ezui.esm.js +1 -1
  152. package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
  153. package/dist/ezui/{p-5b205c80.entry.js → p-044d46d5.entry.js} +1 -1
  154. package/dist/ezui/{p-1285c902.entry.js → p-11b09aa1.entry.js} +1 -1
  155. package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
  156. package/dist/ezui/{p-828e449a.entry.js → p-190c190f.entry.js} +2 -2
  157. package/dist/ezui/{p-8888d9ed.entry.js → p-1b08bf3c.entry.js} +1 -1
  158. package/dist/ezui/p-1bd07c43.entry.js +1 -0
  159. package/dist/ezui/p-2480e948.entry.js +1 -0
  160. package/dist/ezui/{p-af95cd16.entry.js → p-24ca32a3.entry.js} +1 -1
  161. package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
  162. package/dist/ezui/{p-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
  163. package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
  164. package/dist/ezui/{p-3b4eeeb6.entry.js → p-4b5f83a4.entry.js} +1 -1
  165. package/dist/ezui/p-52100a6e.entry.js +1 -0
  166. package/dist/ezui/p-554522db.entry.js +1 -0
  167. package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
  168. package/dist/ezui/p-6ec40dec.entry.js +1 -0
  169. package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
  170. package/dist/ezui/p-70f1c812.entry.js +1 -0
  171. package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
  172. package/dist/ezui/p-7946f2d4.entry.js +1 -0
  173. package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
  174. package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
  175. package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
  176. package/dist/ezui/{p-bcb53f27.entry.js → p-868b56f7.entry.js} +1 -1
  177. package/dist/ezui/p-8ac13678.entry.js +1 -0
  178. package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
  179. package/dist/ezui/p-9174ab3c.entry.js +1 -0
  180. package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
  181. package/dist/ezui/p-92748142.entry.js +1 -0
  182. package/dist/ezui/p-940760bf.entry.js +1 -0
  183. package/dist/ezui/{p-fcf0acce.entry.js → p-a7490128.entry.js} +1 -1
  184. package/dist/ezui/p-a921e3e7.entry.js +1 -0
  185. package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
  186. package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
  187. package/dist/ezui/p-b858fc6e.entry.js +1 -0
  188. package/dist/ezui/p-b9fa2526.entry.js +1 -0
  189. package/dist/ezui/{p-84e439b9.entry.js → p-bef7daac.entry.js} +1 -1
  190. package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
  191. package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
  192. package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
  193. package/dist/ezui/p-e03c2774.entry.js +1 -0
  194. package/dist/ezui/p-e18d9e6a.entry.js +1 -0
  195. package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
  196. package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
  197. package/dist/ezui/{p-922ac38b.entry.js → p-e7395eae.entry.js} +1 -1
  198. package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
  199. package/dist/ezui/{p-49456b34.entry.js → p-f291db18.entry.js} +1 -1
  200. package/dist/ezui/p-f42855b9.js +1 -0
  201. package/dist/ezui/p-f5ffadb1.entry.js +1 -0
  202. package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
  203. package/dist/ezui/p-ff233029.entry.js +1 -0
  204. package/dist/types/components/ez-button/ez-button.d.ts +2 -1
  205. package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
  206. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +5 -0
  207. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
  208. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
  209. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +44 -4
  210. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +25 -2
  211. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +21 -0
  212. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +20 -6
  213. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -0
  214. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -0
  215. package/dist/types/components/ez-grid/ez-grid.d.ts +16 -0
  216. package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
  217. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
  218. package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
  219. package/dist/types/components/ez-popup/ez-popup.d.ts +6 -0
  220. package/dist/types/components/ez-search/ez-search.d.ts +15 -0
  221. package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
  222. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -1
  223. package/dist/types/components.d.ts +101 -4
  224. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +2 -0
  225. package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
  226. package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -1
  227. package/package.json +1 -1
  228. package/dist/ezui/p-04f24913.js +0 -1
  229. package/dist/ezui/p-12ae1104.entry.js +0 -1
  230. package/dist/ezui/p-13d2fe2d.entry.js +0 -1
  231. package/dist/ezui/p-2097d0cf.entry.js +0 -1
  232. package/dist/ezui/p-2dcb50d4.entry.js +0 -1
  233. package/dist/ezui/p-30775e7f.entry.js +0 -1
  234. package/dist/ezui/p-3faa2b46.entry.js +0 -1
  235. package/dist/ezui/p-4d5235f1.entry.js +0 -1
  236. package/dist/ezui/p-784fe207.entry.js +0 -1
  237. package/dist/ezui/p-7922142b.entry.js +0 -1
  238. package/dist/ezui/p-7af81663.entry.js +0 -1
  239. package/dist/ezui/p-9ab22a07.entry.js +0 -1
  240. package/dist/ezui/p-a31b9c90.entry.js +0 -1
  241. package/dist/ezui/p-bae4e180.entry.js +0 -1
  242. package/dist/ezui/p-bc2f844e.entry.js +0 -1
  243. package/dist/ezui/p-bf79aaa1.entry.js +0 -1
  244. package/dist/ezui/p-d9401ea0.entry.js +0 -1
  245. package/dist/ezui/p-ecc2c1ec.entry.js +0 -1
  246. package/dist/ezui/p-f3c526cc.entry.js +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a7b0c73d.js');
5
+ const index = require('./index-9e5554cb.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
8
8
  const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
@@ -10,7 +10,7 @@ require('./DialogType-2114c337.js');
10
10
  require('./CheckMode-ecb90b87.js');
11
11
  const ICustomRender = require('./ICustomRender-6fafffce.js');
12
12
  const constants = require('./constants-2714478b.js');
13
- const RecordValidationProcessor = require('./RecordValidationProcessor-4c893e04.js');
13
+ const RecordValidationProcessor = require('./RecordValidationProcessor-10846595.js');
14
14
 
15
15
  /**
16
16
  * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
@@ -118853,6 +118853,87 @@ class DataSourceInterceptor {
118853
118853
  }
118854
118854
 
118855
118855
  class DataSource {
118856
+ handleDataSaved(action) {
118857
+ this._controller.clearInvalidCells();
118858
+ this.handleRefreshOrReload(action);
118859
+ this._controller.processContinuousInsert();
118860
+ }
118861
+ handleEditionCanceled(action) {
118862
+ if (this._options.enableGridInsert) {
118863
+ this._controller.processEditionCanceled();
118864
+ }
118865
+ this.handleRefreshOrReload(action);
118866
+ }
118867
+ handleSavingCanceled(action) {
118868
+ var _a, _b, _c, _d;
118869
+ if (!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fields) || !((_b = action.payload) === null || _b === void 0 ? void 0 : _b.recordId))
118870
+ return;
118871
+ 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);
118872
+ }
118873
+ handleDataChanged(action) {
118874
+ if (!this._options.enableGridInsert) {
118875
+ this.handleRefresh(action);
118876
+ return;
118877
+ }
118878
+ this.updateGridRowNodes(this.createRecordIdList(action));
118879
+ }
118880
+ createRecordIdList(action) {
118881
+ var _a, _b;
118882
+ if ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.records)
118883
+ return (_b = action.payload) === null || _b === void 0 ? void 0 : _b.records;
118884
+ return this._dataUnit.getSelectedRecord() ? [this._dataUnit.getSelectedRecord().__record__id__] : [];
118885
+ }
118886
+ /**
118887
+ * Nesse ponto, o registro já se encontra atualizado no DU,
118888
+ * basta então passar seu valor para que a garde possa atualizar sua linha.
118889
+ */
118890
+ updateGridRowNodes(recordIDList) {
118891
+ const recordsToUpdate = recordIDList === null || recordIDList === void 0 ? void 0 : recordIDList.map(id => this.getRecordById(id));
118892
+ this._controller.updateRows(recordsToUpdate);
118893
+ }
118894
+ getRecordById(recordId) {
118895
+ return this._dataUnit.records.find(record => record['__record__id__'] === recordId);
118896
+ }
118897
+ /**
118898
+ * Em caso de necessidade de reload (isWaitingToReload), eh preciso chamar o dataUnit.gotoPage, pois ele aplica tambem a ordenacao dos registros,
118899
+ * enquanto que o _controller.refresh apenas recarrega os dados na ordem que atua.
118900
+ */
118901
+ handleRefreshOrReload(action) {
118902
+ if (this._dataUnit.isWaitingToReload()) {
118903
+ this.handleReload();
118904
+ return;
118905
+ }
118906
+ this.handleRefresh(action);
118907
+ }
118908
+ handleReload() {
118909
+ this._dataUnit.setWaitingToReload(false);
118910
+ this._dataUnit.gotoPage(0);
118911
+ }
118912
+ handleRefresh(action) {
118913
+ if (this.isSilentChange(action)) {
118914
+ return;
118915
+ }
118916
+ this._controller.refresh(action.type === core.Action.DATA_SAVED);
118917
+ }
118918
+ handleRecordsAdded() {
118919
+ if (this._options.enableGridInsert) {
118920
+ this._controller.refresh();
118921
+ this.focusOnNewRecord();
118922
+ }
118923
+ }
118924
+ focusOnNewRecord() {
118925
+ /**
118926
+ * O SetTimeout eh utilizado pois é preciso aguardar que o novo registro seja renderizado na grade.
118927
+ * Tentamos utilizar a api da grade para adicionar um event listener, porém na versão que utilizamos, não existe
118928
+ * algo que resolva nosso cenário.
118929
+ *
118930
+ * Sugiro no futuro utilizar algo como o applyServerSideTransaction, porém será preciso lidar com os handlers
118931
+ * e callbacks implementados no AgGridController e GridEditionManager.
118932
+ */
118933
+ setTimeout(() => {
118934
+ this._controller.startEditionOnLastRow();
118935
+ }, 1000);
118936
+ }
118856
118937
  updateLoadedRecords(action) {
118857
118938
  const records = action.payload;
118858
118939
  if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
@@ -118904,15 +118985,22 @@ class DataSource {
118904
118985
  this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
118905
118986
  }
118906
118987
  break;
118907
- case core.Action.RECORDS_REMOVED:
118988
+ case core.Action.RECORDS_ADDED:
118989
+ case core.Action.RECORDS_COPIED:
118990
+ this.handleRecordsAdded();
118991
+ break;
118908
118992
  case core.Action.DATA_SAVED:
118993
+ this.handleDataSaved(action);
118994
+ break;
118909
118995
  case core.Action.EDITION_CANCELED:
118996
+ this.handleEditionCanceled(action);
118997
+ break;
118910
118998
  case core.Action.DATA_CHANGED:
118911
118999
  case core.Action.DATA_RESOLVED:
118912
- if (this.isSilentChange(action)) {
118913
- return;
118914
- }
118915
- this._controller.refresh();
119000
+ this.handleDataChanged(action);
119001
+ break;
119002
+ case core.Action.RECORDS_REMOVED:
119003
+ this.handleRefresh(action);
118916
119004
  break;
118917
119005
  case core.Action.SELECTION_CHANGED:
118918
119006
  case core.Action.NEXT_SELECTED:
@@ -118922,6 +119010,9 @@ class DataSource {
118922
119010
  case core.Action.RECORD_LOADED:
118923
119011
  this.updateLoadedRecords(action);
118924
119012
  break;
119013
+ case core.Action.SAVING_CANCELED:
119014
+ this.handleSavingCanceled(action);
119015
+ break;
118925
119016
  }
118926
119017
  };
118927
119018
  this._dataUnit = dataUnit;
@@ -118943,6 +119034,9 @@ class DataSource {
118943
119034
  setAutoFocus(autoFocus) {
118944
119035
  this._options.autoFocus = autoFocus;
118945
119036
  }
119037
+ setEnableGridInsert(enable) {
119038
+ this._options.enableGridInsert = enable;
119039
+ }
118946
119040
  getRows(params) {
118947
119041
  if (this.needReload(params)) {
118948
119042
  this._lastLoadingParams = params;
@@ -119376,6 +119470,7 @@ const buildComboBox = ({ required, props, eGridCell }) => {
119376
119470
  mode="slim"
119377
119471
  />`);
119378
119472
  combo.options = options;
119473
+ combo.stopPropagateEnterKeyEvent = true;
119379
119474
  combo.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
119380
119475
  return combo;
119381
119476
  };
@@ -119405,7 +119500,10 @@ const buildSearch = ({ name, required, readOnly, eGridCell, dataUnit }) => {
119405
119500
  />`);
119406
119501
  const loader = core.ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
119407
119502
  ezSearch.optionLoader = (argument) => loader(argument, name, dataUnit);
119503
+ ezSearch.ensureClearButtonVisible = true;
119504
+ ezSearch.suppressPreLoad = true;
119408
119505
  ezSearch.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
119506
+ ezSearch.stopPropagateEnterKeyEvent = true;
119409
119507
  ezSearch.valueGetter = () => ezSearch.getValueAsync();
119410
119508
  return ezSearch;
119411
119509
  };
@@ -119449,6 +119547,14 @@ class EzCellEditor {
119449
119547
  getValue() {
119450
119548
  return this._gui.valueGetter != undefined ? this._gui.valueGetter() : this._gui.value;
119451
119549
  }
119550
+ setGuiValue(value) {
119551
+ if (this._gui.valueSetter != undefined) {
119552
+ this._gui.valueSetter(value);
119553
+ }
119554
+ else {
119555
+ this._gui.value = value;
119556
+ }
119557
+ }
119452
119558
  isPopup() {
119453
119559
  return this._gui.isPopUp;
119454
119560
  }
@@ -119470,6 +119576,8 @@ class EzGridCustomCellEditor extends EzCellEditor {
119470
119576
  this._defaultGui = this.getDefaultGui();
119471
119577
  const fieldMetadata = super.getFieldMetadata();
119472
119578
  this._params = {
119579
+ cellPossition: getViewPortHeight(params.eGridCell),
119580
+ eGridCell: params.eGridCell,
119473
119581
  value: params.value,
119474
119582
  charPress: params.charPress,
119475
119583
  currentEditor: this._defaultGui,
@@ -119507,12 +119615,18 @@ class EzGridCustomCellEditor extends EzCellEditor {
119507
119615
  const element = core.HTMLBuilder.parseElement(editorElement);
119508
119616
  return element;
119509
119617
  }
119618
+ this._customGui = editorElement;
119510
119619
  return editorElement;
119511
119620
  }
119512
119621
  setValue(value) {
119513
119622
  this._value = value;
119514
119623
  }
119515
119624
  getValue() {
119625
+ var _a, _b;
119626
+ if ((_a = this._customGui) === null || _a === void 0 ? void 0 : _a.getValue)
119627
+ return this._customGui.getValue();
119628
+ if ((_b = this._customGui) === null || _b === void 0 ? void 0 : _b.hasAttribute('value'))
119629
+ return this._customGui.value;
119516
119630
  return this._value;
119517
119631
  }
119518
119632
  }
@@ -119596,15 +119710,17 @@ class EzGridCustomCellRender extends EzCellRender {
119596
119710
  }
119597
119711
 
119598
119712
  class GridEditionManager {
119599
- constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
119713
+ constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert) {
119600
119714
  this._dataUnit = dataUnit;
119601
119715
  this._recordValidationProcessor = new RecordValidationProcessor.RecordValidationProcessor(this._dataUnit, {
119602
119716
  getRequiredFields: () => this.getRequiredFields(),
119603
- markAsInvalid: () => { },
119604
- getMessageForField: () => null
119717
+ markAsInvalid: (invalidField, recordId) => { this.setInvalidCell(invalidField, recordId); },
119718
+ getMessageForField: () => null,
119605
119719
  }, recordsValidator);
119606
119720
  this._useEnterLikeTab = useEnterLikeTab;
119607
119721
  this._editionIsDisabled = editionIsDisabled;
119722
+ this._enableContinuousInsert = enableContinuousInsert;
119723
+ this._enableGridInsert = enableGridInsert;
119608
119724
  this._customEditors = customEditors;
119609
119725
  this._customRenders = customRenders;
119610
119726
  }
@@ -119619,20 +119735,35 @@ class GridEditionManager {
119619
119735
  };
119620
119736
  return options;
119621
119737
  }
119738
+ updateCurrentEditorGuiValue(updatedRowValue) {
119739
+ const editorInstances = this._gridOptions.api.getCellEditorInstances();
119740
+ if (!editorInstances || !editorInstances.length)
119741
+ return;
119742
+ const currentEditor = editorInstances[0];
119743
+ const fieldMetadata = currentEditor.getFieldMetadata();
119744
+ const fieldName = fieldMetadata.name;
119745
+ const value = updatedRowValue[fieldName];
119746
+ currentEditor.setGuiValue(value);
119747
+ }
119748
+ canContinuousInsert() {
119749
+ var _a;
119750
+ return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
119751
+ }
119622
119752
  proceedAutoSave() {
119623
119753
  if (!this._dataUnit.isDirty()) {
119624
119754
  this.saveSuccess();
119625
119755
  return;
119626
119756
  }
119627
- if (!this._isGridEdition || this._dataUnit.hasNewRecord()) {
119757
+ if (!this._isGridEdition) {
119628
119758
  return;
119629
119759
  }
119630
119760
  const currentRercord = this._dataUnit.getSelectedRecord();
119631
119761
  if (currentRercord == undefined) {
119632
119762
  return;
119633
119763
  }
119764
+ this._invalidCell = undefined;
119634
119765
  this._recordValidationProcessor
119635
- .validate()
119766
+ .validate(true)
119636
119767
  .then(() => {
119637
119768
  this._dataUnit.saveData()
119638
119769
  .then(() => this.saveSuccess())
@@ -119640,6 +119771,16 @@ class GridEditionManager {
119640
119771
  })
119641
119772
  .catch(reason => this.saveFail(reason));
119642
119773
  }
119774
+ async recordValidate() {
119775
+ if (!this._dataUnit.isDirty())
119776
+ return;
119777
+ try {
119778
+ this._invalidCell = undefined;
119779
+ await this._recordValidationProcessor.validate(false);
119780
+ }
119781
+ catch (error) { }
119782
+ this._gridOptions.api.refreshCells({ force: true });
119783
+ }
119643
119784
  navigateByEnterKey(keyboardEvent) {
119644
119785
  const backwards = keyboardEvent.shiftKey;
119645
119786
  if (this._useEnterLikeTab) {
@@ -119723,11 +119864,12 @@ class GridEditionManager {
119723
119864
  }
119724
119865
  }
119725
119866
  focusOnCell(cell) {
119867
+ var _a;
119726
119868
  if (cell == undefined) {
119727
119869
  return;
119728
119870
  }
119729
119871
  const { rowIndex, column } = cell;
119730
- this._gridOptions.api.getDisplayedRowAtIndex(rowIndex).setSelected(true, true);
119872
+ (_a = this._gridOptions.api.getDisplayedRowAtIndex(rowIndex)) === null || _a === void 0 ? void 0 : _a.setSelected(true, true);
119731
119873
  this._gridOptions.api.clearRangeSelection();
119732
119874
  this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [column] });
119733
119875
  this._gridOptions.api.startEditingCell({ colKey: column.getColId(), rowIndex });
@@ -119767,9 +119909,10 @@ class GridEditionManager {
119767
119909
  }
119768
119910
  }
119769
119911
  else {
119912
+ const actualRowIndex = rowIndex;
119770
119913
  rowIndex = rowIndex + 1;
119771
119914
  if (rowIndex >= this._dataUnit.records.length) {
119772
- rowIndex = 0;
119915
+ rowIndex = !this._enableGridInsert ? 0 : actualRowIndex;
119773
119916
  }
119774
119917
  }
119775
119918
  this._targetEditionCell = new TargetEdition(rowIndex, column, true);
@@ -119838,7 +119981,7 @@ class GridEditionManager {
119838
119981
  event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: value }));
119839
119982
  }
119840
119983
  this._isGridEdition = true;
119841
- this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__]);
119984
+ this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__], { suppressCreateNewRecord: true });
119842
119985
  this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
119843
119986
  }
119844
119987
  }
@@ -119848,6 +119991,36 @@ class GridEditionManager {
119848
119991
  setCellRenders(customRenders) {
119849
119992
  this._customRenders = customRenders;
119850
119993
  }
119994
+ setInvalidCell(invalidCell, recordId) {
119995
+ this._invalidCell = { field: invalidCell, recordId };
119996
+ }
119997
+ getInvalidCell() {
119998
+ return this._invalidCell;
119999
+ }
120000
+ processContinuousInsert() {
120001
+ if (!this.canContinuousInsert())
120002
+ return;
120003
+ this._dataUnit.addRecord();
120004
+ }
120005
+ clearInvalidCells(stopEdition) {
120006
+ this._invalidCell = undefined;
120007
+ if (stopEdition) {
120008
+ this._isGridEdition = false;
120009
+ }
120010
+ }
120011
+ setEnableContinuousInsert(enable) {
120012
+ this._enableContinuousInsert = enable;
120013
+ }
120014
+ hasInvalidField(fieldName, recordId) {
120015
+ if (!this.hasInvalidCell())
120016
+ return false;
120017
+ return this._invalidCell.field.name === fieldName && this._invalidCell.recordId === recordId;
120018
+ }
120019
+ hasInvalidCell() {
120020
+ if (!this._invalidCell || !this._invalidCell.field || !this._invalidCell.recordId)
120021
+ return false;
120022
+ return true;
120023
+ }
119851
120024
  }
119852
120025
  class TargetEdition {
119853
120026
  constructor(rowIndex, column, backwards) {
@@ -119891,6 +120064,8 @@ class AgGridController {
119891
120064
  this._filteredColumns = new Map();
119892
120065
  this._filterColumnleftPosition = 0;
119893
120066
  this._customFormatters = new Map();
120067
+ this._gridShowDom = false;
120068
+ this.peddingExecutionsOnGridShow = [];
119894
120069
  this._enterprise = enterprise;
119895
120070
  }
119896
120071
  getGridConfig() {
@@ -119976,7 +120151,7 @@ class AgGridController {
119976
120151
  this._doubleClickCallBack = options.onDoubleClick;
119977
120152
  this._multipleSelection = options.allowMultipleSelection;
119978
120153
  this._dataUnit = options.dataUnit;
119979
- this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
120154
+ this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert);
119980
120155
  this._statusResolver = options.statusResolver;
119981
120156
  if (this._dataUnit) {
119982
120157
  this._dataUnit.sortingProvider = this;
@@ -119996,6 +120171,9 @@ class AgGridController {
119996
120171
  defaultColDef: {
119997
120172
  headerClass: 'ez-grid__cell-header',
119998
120173
  cellClass: 'ez-grid__cell-body',
120174
+ cellClassRules: {
120175
+ 'invalidValue': (params) => this._editionManager.hasInvalidField(params.colDef.field, params.data["__record__id__"]),
120176
+ },
119999
120177
  cellStyle: {
120000
120178
  height: '100%'
120001
120179
  }
@@ -120026,10 +120204,6 @@ class AgGridController {
120026
120204
  else {
120027
120205
  this._grid = new Grid(container, this._gridOptions);
120028
120206
  }
120029
- container.addEventListener('focusout', (event) => {
120030
- if (!container.contains(event.relatedTarget))
120031
- this._gridOptions.api.clearFocusedCell();
120032
- });
120033
120207
  const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
120034
120208
  if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
120035
120209
  this.selectAll(true);
@@ -120039,6 +120213,23 @@ class AgGridController {
120039
120213
  }
120040
120214
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
120041
120215
  this._customFormatters = options.customFormatters;
120216
+ const observerCallback = (entries) => {
120217
+ entries.forEach(entry => {
120218
+ if (entry.isIntersecting) {
120219
+ this._gridShowDom = true;
120220
+ this.peddingExecutionsOnGridShow.forEach(func => func());
120221
+ this.peddingExecutionsOnGridShow = [];
120222
+ }
120223
+ else {
120224
+ this._gridShowDom = false;
120225
+ }
120226
+ });
120227
+ };
120228
+ this.observer = new IntersectionObserver(observerCallback, {
120229
+ root: null,
120230
+ threshold: 0.1
120231
+ });
120232
+ this.observer.observe(container);
120042
120233
  }
120043
120234
  }
120044
120235
  processFormatterCellCallback(params) {
@@ -120229,10 +120420,17 @@ class AgGridController {
120229
120420
  throw new Error('Erro interno: Grid ainda não inicializado.');
120230
120421
  }
120231
120422
  }
120232
- updateRows() {
120423
+ updateRows(rows) {
120233
120424
  if (this._grid === undefined) {
120234
120425
  throw new Error('Erro interno: Grid ainda não inicializado.');
120235
120426
  }
120427
+ rows === null || rows === void 0 ? void 0 : rows.forEach(row => this.updateRowData(row));
120428
+ }
120429
+ updateRowData(row) {
120430
+ const node = this._gridOptions.api.getRowNode(row[this._idAttribName]);
120431
+ node.setData(Object.assign({}, row));
120432
+ this._editionManager.updateCurrentEditorGuiValue(row);
120433
+ this._editionManager.recordValidate();
120236
120434
  }
120237
120435
  selectAll(quietly = false) {
120238
120436
  try {
@@ -120315,14 +120513,42 @@ class AgGridController {
120315
120513
  });
120316
120514
  r.setData(data);
120317
120515
  });
120516
+ this._gridOptions.api.refreshCells({ force: true });
120517
+ const invalidCell = this._editionManager.getInvalidCell();
120518
+ if (invalidCell) {
120519
+ const rowNode = this._gridOptions.api.getRowNode(invalidCell.recordId);
120520
+ if (rowNode && invalidCell.field) {
120521
+ this.startEdition(rowNode.rowIndex, this._gridOptions.columnApi.getColumn(invalidCell.field.name));
120522
+ }
120523
+ }
120318
120524
  }
120319
120525
  }
120320
- refresh() {
120526
+ savingCanceled(fields, recordId) {
120527
+ const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
120528
+ const rowIndex = this._gridOptions.api.getRowNode(recordId).rowIndex;
120529
+ const columnFocus = displayedColumns.find(column => this.isColumnEditable(rowIndex, column) && fields.find(field => field.name === column.getColId()));
120530
+ this.focusByCollAndRow(columnFocus, rowIndex);
120531
+ this.startEdition(rowIndex, columnFocus);
120532
+ }
120533
+ refresh(scrollToSelectedRow = false) {
120321
120534
  if (this._grid === undefined) {
120322
120535
  throw new Error('Erro interno: Grid ainda não inicializado.');
120323
120536
  }
120324
120537
  this._gridOptions.api.refreshServerSide({ purge: true });
120325
120538
  this._options.onRefresh();
120539
+ if (scrollToSelectedRow)
120540
+ this.scrollToSelectedRow();
120541
+ }
120542
+ scrollToSelectedRow() {
120543
+ const rowNode = this._gridOptions.api.getSelectedNodes();
120544
+ if (!rowNode || rowNode.length === 0)
120545
+ return;
120546
+ if (this._gridShowDom) {
120547
+ this._gridOptions.api.ensureNodeVisible(rowNode[0]);
120548
+ }
120549
+ else {
120550
+ this.peddingExecutionsOnGridShow.push(() => this._gridOptions.api.ensureNodeVisible(rowNode[0]));
120551
+ }
120326
120552
  }
120327
120553
  focusOnGridContainer() {
120328
120554
  this._container.setAttribute('tabindex', '-1');
@@ -120341,6 +120567,14 @@ class AgGridController {
120341
120567
  var _a;
120342
120568
  (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
120343
120569
  }
120570
+ setEnableGridInsert(enable) {
120571
+ var _a;
120572
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setEnableGridInsert(enable);
120573
+ }
120574
+ setEnableContinuousInsert(enable) {
120575
+ var _a;
120576
+ (_a = this._editionManager) === null || _a === void 0 ? void 0 : _a.setEnableContinuousInsert(enable);
120577
+ }
120344
120578
  setFocusFirstRow() {
120345
120579
  const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
120346
120580
  if (firstRow) {
@@ -120356,9 +120590,53 @@ class AgGridController {
120356
120590
  this.setFocusOnRow(lastRow.rowIndex);
120357
120591
  }
120358
120592
  }
120593
+ startEditionOnRowByIndex(rowIndex) {
120594
+ this._dataUnit.setSelectionByIndex([rowIndex]);
120595
+ const firstCol = this.getFirstEditableColl(rowIndex);
120596
+ if (!firstCol)
120597
+ return;
120598
+ this.focusByCollAndRow(firstCol, rowIndex);
120599
+ this.startEdition(rowIndex, firstCol);
120600
+ }
120601
+ startEditionOnLastRow() {
120602
+ var _a;
120603
+ if (this._gridShowDom) {
120604
+ const newRowIndex = ((_a = this._dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) - 1;
120605
+ this.startEditionOnRowByIndex(newRowIndex);
120606
+ }
120607
+ }
120608
+ startEdition(rowIndex, firstCol) {
120609
+ this._gridOptions.api.clearRangeSelection();
120610
+ this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
120611
+ this._gridOptions.api.setFocusedCell(rowIndex, firstCol);
120612
+ this._gridOptions.api.startEditingCell({ rowIndex, colKey: firstCol });
120613
+ const cellEditor = this._gridOptions.api.getCellEditorInstances()[0];
120614
+ if (cellEditor) {
120615
+ cellEditor.focusIn();
120616
+ }
120617
+ }
120618
+ getFirstEditableColl(rowIndex) {
120619
+ try {
120620
+ const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
120621
+ return displayedColumns.find(column => this.isColumnEditable(rowIndex, column));
120622
+ }
120623
+ catch (e) {
120624
+ console.warn(e);
120625
+ }
120626
+ }
120627
+ isColumnEditable(rowIndex, column) {
120628
+ if (column.getColDef().headerName === '' || rowIndex === -1)
120629
+ return false;
120630
+ const rowId = this._dataUnit.records[rowIndex][this._idAttribName];
120631
+ const rowNode = this._gridOptions.api.getRowNode(rowId);
120632
+ return column.isCellEditable(rowNode);
120633
+ }
120359
120634
  setFocusOnRow(rowIndex) {
120360
120635
  let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
120361
- let firstCell = displayedColumns.find(column => column.getColDef().headerName !== '');
120636
+ let firstColl = displayedColumns.find(column => column.getColDef().headerName !== '');
120637
+ this.focusByCollAndRow(firstColl, rowIndex);
120638
+ }
120639
+ focusByCollAndRow(firstCell, rowIndex) {
120362
120640
  this._gridOptions.api.ensureColumnVisible(firstCell);
120363
120641
  this._gridOptions.api.ensureIndexVisible(rowIndex);
120364
120642
  this._gridOptions.api.setFocusedCell(rowIndex, firstCell);
@@ -120680,35 +120958,40 @@ class AgGridController {
120680
120958
  return false;
120681
120959
  }
120682
120960
  onSelectionChange(event) {
120683
- if (this._selectionChangeCallback) {
120684
- clearTimeout(this._selectionChangeDeboucing);
120685
- this._selectionChangeDeboucing = window.setTimeout(() => {
120686
- this._editionManager.proceedAutoSave();
120687
- if (this._dataUnit) {
120688
- if (event.context.selectionChangeQuietly) {
120689
- const selectionInfo = this._dataUnit;
120690
- this._selectionChangeCallback({
120691
- selection: selectionInfo.records,
120692
- selectionHeaderStatus: this.getSelectionHeaderStatus(),
120693
- });
120694
- }
120695
- else {
120696
- this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((r) => r.__record__id__)).then(selectionInfo => {
120697
- this._selectionChangeCallback({
120698
- selection: selectionInfo.records,
120699
- selectionHeaderStatus: this.getSelectionHeaderStatus(),
120700
- });
120701
- });
120702
- }
120703
- }
120704
- else {
120705
- this._selectionChangeCallback({
120706
- selection: this._gridOptions.api.getSelectedRows(),
120707
- selectionHeaderStatus: this.getSelectionHeaderStatus(),
120708
- });
120709
- }
120710
- }, 0);
120961
+ if (!this._selectionChangeCallback)
120962
+ return;
120963
+ clearTimeout(this._selectionChangeDeboucing);
120964
+ this._selectionChangeDeboucing = window.setTimeout(() => {
120965
+ this.handleExecuteProceedAutosave();
120966
+ this.processBuildSelectionChangeCallback(event);
120967
+ }, 0);
120968
+ }
120969
+ handleExecuteProceedAutosave() {
120970
+ if (this._gridShowDom) {
120971
+ this._editionManager.proceedAutoSave();
120972
+ }
120973
+ }
120974
+ processBuildSelectionChangeCallback(event) {
120975
+ if (this._dataUnit) {
120976
+ this.handleBuildSelectionChangeWithDU(event.context.selectionChangeQuietly);
120977
+ return;
120711
120978
  }
120979
+ this.buildSelectionChangeCallback(this._gridOptions.api.getSelectedRows());
120980
+ }
120981
+ handleBuildSelectionChangeWithDU(quietly) {
120982
+ if (quietly) {
120983
+ this.buildSelectionChangeCallback(this._dataUnit.records);
120984
+ return;
120985
+ }
120986
+ this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows()
120987
+ .map((r) => r.__record__id__))
120988
+ .then(selectionInfo => this.buildSelectionChangeCallback(selectionInfo.records));
120989
+ }
120990
+ buildSelectionChangeCallback(records) {
120991
+ this._selectionChangeCallback({
120992
+ selection: records,
120993
+ selectionHeaderStatus: this.getSelectionHeaderStatus(),
120994
+ });
120712
120995
  }
120713
120996
  onRowDoubleClick(evt) {
120714
120997
  if (this._doubleClickCallBack) {
@@ -120720,6 +121003,12 @@ class AgGridController {
120720
121003
  host[attribute] = value;
120721
121004
  }
120722
121005
  }
121006
+ processEditionCanceled() {
121007
+ this.clearInvalidCells(true);
121008
+ if (this._gridShowDom) {
121009
+ this._dataUnit.clearSelection();
121010
+ }
121011
+ }
120723
121012
  setCellEditors(customEditors) {
120724
121013
  var _a;
120725
121014
  if (!this._editionManager) {
@@ -120738,6 +121027,18 @@ class AgGridController {
120738
121027
  this._editionManager.setCellRenders(customRenders);
120739
121028
  (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120740
121029
  }
121030
+ clearInvalidCells(stopEdition) {
121031
+ if (!this._editionManager)
121032
+ return;
121033
+ this._editionManager.clearInvalidCells(stopEdition);
121034
+ this._gridOptions.api.refreshCells({ force: true });
121035
+ }
121036
+ processContinuousInsert() {
121037
+ this._editionManager.processContinuousInsert();
121038
+ }
121039
+ destroy() {
121040
+ this.observer.disconnect();
121041
+ }
120741
121042
  }
120742
121043
 
120743
121044
  function enableSelectAll(total) {
@@ -120945,7 +121246,7 @@ class InMemoryFilterColumnDataSource {
120945
121246
  }
120946
121247
  }
120947
121248
 
120948
- const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}";
121249
+ const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{justify-content:flex-end;flex-wrap:nowrap}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}.pagination-contracted.sc-ez-grid{width:100px}.pagination-expanded.sc-ez-grid{min-width:150px}.left__header-contracted.sc-ez-grid{width:calc(100% - 100px)}.left__header-expanded.sc-ez-grid{flex-grow:1}";
120949
121250
 
120950
121251
  const windowInstace = window;
120951
121252
  const matches = (text, filter) => {
@@ -120984,6 +121285,9 @@ const EzGrid = class {
120984
121285
  this.recordsValidator = undefined;
120985
121286
  this.canEdit = true;
120986
121287
  this.autoFocus = true;
121288
+ this.paginationCounterMode = 'show';
121289
+ this.enableGridInsert = false;
121290
+ this.enableContinuousInsert = true;
120987
121291
  }
120988
121292
  /**
120989
121293
  * Aplica a definição de colunas.
@@ -121119,6 +121423,14 @@ const EzGrid = class {
121119
121423
  this._refPaginationLabelTooltip.setAttribute('data-tooltip', this._getPaginationTooltip());
121120
121424
  }
121121
121425
  }
121426
+ observePaginationCounterMode(newValue) {
121427
+ if (newValue === 'hidden') {
121428
+ this._hidePaginationDescription();
121429
+ }
121430
+ if (newValue === 'show') {
121431
+ this._showPaginationDescription();
121432
+ }
121433
+ }
121122
121434
  onSelectionChange(evt) {
121123
121435
  this._currentPageSelected = evt.detail.selectionHeaderStatus === true;
121124
121436
  if (this.dataUnit) {
@@ -121282,11 +121594,16 @@ const EzGrid = class {
121282
121594
  this._paginationChangedByKeyboard = false;
121283
121595
  (_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
121284
121596
  }
121597
+ resolvePaginationClassMode() {
121598
+ if (this.paginationCounterMode == 'show')
121599
+ return "pagination-expanded";
121600
+ return "pagination-contracted";
121601
+ }
121285
121602
  getPaginationControl() {
121286
121603
  if (!this._paginationInfo)
121287
121604
  return null;
121288
121605
  const { currentPage, hasMore } = this._paginationInfo;
121289
- return (index.h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, index.h("span", { class: "grid-header__pagination-label" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), index.h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, index.h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
121606
+ return (index.h("div", { class: `grid-header__container grid-header__pagination ${this.resolvePaginationClassMode()}`, ref: ref => (this._refPaginationControl = ref) }, index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, index.h("span", { class: "grid-header__pagination-label" }, this.paginationCounterMode == 'show' && index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this.paginationCounterMode == 'show' && this._getRemainingPageLabel())), index.h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium", title: `${this._getActualPageLabel()} ${this._getRemainingPageLabel()}` }, index.h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
121290
121607
  }
121291
121608
  componentDidLoad() {
121292
121609
  this._gridController.initDatagrid(this._container, {
@@ -121310,6 +121627,8 @@ const EzGrid = class {
121310
121627
  editionIsDisabled: () => !this.canEdit,
121311
121628
  customFormatters: this._customFormatters,
121312
121629
  autoFocus: this.autoFocus,
121630
+ enableGridInsert: this.enableGridInsert,
121631
+ enableContinuousInsert: this.enableContinuousInsert,
121313
121632
  onRefresh: () => {
121314
121633
  if (this.dataUnit) {
121315
121634
  this.setSelection(this.dataUnit.getSelectionInfo());
@@ -121326,7 +121645,8 @@ const EzGrid = class {
121326
121645
  this.setEvents();
121327
121646
  this.componentReady.emit();
121328
121647
  this._gridController.configFilterColumn(this._filterColumn);
121329
- this._initHeaderOverflowWatcher();
121648
+ if (this.paginationCounterMode === 'auto')
121649
+ this._initHeaderOverflowWatcher();
121330
121650
  }
121331
121651
  handlePaginationChange(selectFirstRecord, paginationInfo) {
121332
121652
  var _a;
@@ -121353,7 +121673,8 @@ const EzGrid = class {
121353
121673
  return this._getActualPageLabel() + this._getRemainingPageLabel();
121354
121674
  }
121355
121675
  _initHeaderOverflowWatcher() {
121356
- this._headerOverflowWatcher = new core.OverflowWatcher(this.buildOverFlowWatcherParams());
121676
+ if (this._refPaginationControl)
121677
+ this._headerOverflowWatcher = new core.OverflowWatcher(this.buildOverFlowWatcherParams());
121357
121678
  }
121358
121679
  buildOverFlowWatcherParams() {
121359
121680
  return {
@@ -121402,6 +121723,11 @@ const EzGrid = class {
121402
121723
  }
121403
121724
  componentDidUpdate() {
121404
121725
  this._gridController.setAutoFocus(this.autoFocus);
121726
+ this._gridController.setEnableGridInsert(this.enableGridInsert);
121727
+ this._gridController.setEnableContinuousInsert(this.enableContinuousInsert);
121728
+ if (this.dataUnit) {
121729
+ this.setSelection(this.dataUnit.getSelectionInfo());
121730
+ }
121405
121731
  }
121406
121732
  getDataSource() {
121407
121733
  var _a;
@@ -121410,9 +121736,14 @@ const EzGrid = class {
121410
121736
  hideHeader() {
121411
121737
  return (!!this._element.getAttribute("no-header") && !this._paginationInfo);
121412
121738
  }
121739
+ resolveLeftHeaderClass() {
121740
+ if (this.paginationCounterMode == 'show')
121741
+ return "left__header-expanded";
121742
+ return "left__header-contracted";
121743
+ }
121413
121744
  render() {
121414
121745
  var _a;
121415
- return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: "grid-header__container grid-header__left-container" }, index.h("slot", { name: "leftButtons" })), this.getPaginationControl())), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121746
+ return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--small grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: `grid-header__container grid-header__left-container ${this.resolveLeftHeaderClass()}` }, index.h("slot", { name: "leftButtons" })), this.getPaginationControl())), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121416
121747
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
121417
121748
  ` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), index.h("div", { class: "grid__footer" }, index.h("slot", { name: "footer" }))));
121418
121749
  }
@@ -121420,7 +121751,8 @@ const EzGrid = class {
121420
121751
  get _element() { return index.getElement(this); }
121421
121752
  static get watchers() { return {
121422
121753
  "config": ["observeConfig"],
121423
- "_paginationInfo": ["updatePaginationTooltip"]
121754
+ "_paginationInfo": ["updatePaginationTooltip"],
121755
+ "paginationCounterMode": ["observePaginationCounterMode"]
121424
121756
  }; }
121425
121757
  };
121426
121758
  EzGrid.style = ezGridCss;