@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-kb-67792.0 → 0.0.0-bugfix-dev-kb-67792.2

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 (235) hide show
  1. package/dist/cjs/{ConfigStorage-0a690675.js → ConfigStorage-e49214c6.js} +1 -0
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-f79d220c.js → IExporterProvider-10b7fed5.js} +94 -4
  3. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  4. package/dist/cjs/{SnkFormConfigManager-d6d5db6d.js → SnkFormConfigManager-beebf47a.js} +8 -7
  5. package/dist/cjs/{SnkMessageBuilder-96b0f549.js → SnkMessageBuilder-cceebbae.js} +9 -13
  6. package/dist/cjs/{pesquisa-fetcher-cba1b3d0.js → dataunit-fetcher-d4873076.js} +87 -180
  7. package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/pesquisa-fetcher-a1d0353f.js +166 -0
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -3
  12. package/dist/cjs/snk-application.cjs.entry.js +35 -12
  13. package/dist/cjs/snk-attach.cjs.entry.js +71 -46
  14. package/dist/cjs/snk-crud.cjs.entry.js +101 -10
  15. package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
  16. package/dist/cjs/snk-data-unit-f0221097.js +690 -0
  17. package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +50 -10
  19. package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -2
  20. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
  23. package/dist/cjs/snk-form.cjs.entry.js +52 -7
  24. package/dist/cjs/snk-grid.cjs.entry.js +168 -111
  25. package/dist/cjs/{snk-guides-viewer-bfcad2d6.js → snk-guides-viewer-aafc3073.js} +43 -10
  26. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
  27. package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-simple-crud.cjs.entry.js +269 -40
  29. package/dist/cjs/snk-taskbar.cjs.entry.js +4 -3
  30. package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-9ad1f9c0.js} +3 -3
  31. package/dist/collection/collection-manifest.json +1 -1
  32. package/dist/collection/components/snk-application/snk-application.js +35 -11
  33. package/dist/collection/components/snk-attach/snk-attach.js +67 -44
  34. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
  35. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
  36. package/dist/collection/components/snk-crud/snk-crud.js +305 -7
  37. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +136 -2
  38. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
  39. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +134 -7
  40. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +97 -0
  41. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +74 -0
  42. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +54 -1
  43. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  44. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
  45. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  46. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +59 -52
  47. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
  48. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  49. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +20 -0
  50. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  51. package/dist/collection/components/snk-data-unit/snk-data-unit.js +540 -219
  52. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
  53. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
  55. package/dist/collection/components/snk-form/snk-form.js +102 -5
  56. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +7 -6
  57. package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
  58. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  59. package/dist/collection/components/snk-grid/snk-grid.js +242 -103
  60. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +407 -20
  61. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  62. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
  63. package/dist/collection/lib/@types/index.js +5 -0
  64. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
  65. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  66. package/dist/collection/lib/dataUnit/InMemoryLoader.js +7 -3
  67. package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
  68. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
  69. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  70. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  71. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
  72. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  73. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
  74. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
  75. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +53 -4
  76. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
  77. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
  78. package/dist/collection/lib/message/SnkMessageBuilder.js +5 -12
  79. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
  80. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +2 -1
  81. package/dist/components/ConfigStorage.js +1 -0
  82. package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
  83. package/dist/components/ISave.js +47 -0
  84. package/dist/components/SnkFormConfigManager.js +7 -6
  85. package/dist/components/SnkMessageBuilder.js +9 -13
  86. package/dist/components/dataunit-fetcher.js +84 -182
  87. package/dist/components/index2.js +198 -33
  88. package/dist/components/pesquisa-fetcher.js +164 -0
  89. package/dist/components/snk-actions-button2.js +4 -11
  90. package/dist/components/snk-application2.js +31 -9
  91. package/dist/components/snk-attach2.js +65 -41
  92. package/dist/components/snk-crud.js +110 -11
  93. package/dist/components/snk-data-exporter2.js +309 -85
  94. package/dist/components/snk-data-unit2.js +487 -217
  95. package/dist/components/snk-detail-view2.js +96 -14
  96. package/dist/components/snk-expression-item2.js +1 -1
  97. package/dist/components/snk-filter-bar2.js +6 -1
  98. package/dist/components/snk-form-config2.js +1 -1
  99. package/dist/components/snk-form-view2.js +72 -1
  100. package/dist/components/snk-form.js +53 -6
  101. package/dist/components/snk-grid2.js +171 -109
  102. package/dist/components/snk-personalized-filter2.js +1 -1
  103. package/dist/components/snk-simple-crud2.js +264 -25
  104. package/dist/components/snk-taskbar2.js +6 -5
  105. package/dist/esm/{ConfigStorage-8c2ddac8.js → ConfigStorage-e476378d.js} +1 -0
  106. package/dist/esm/{SnkMultiSelectionListDataSource-a4805051.js → IExporterProvider-d597f27d.js} +93 -5
  107. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  108. package/dist/esm/{SnkFormConfigManager-c01b9d9d.js → SnkFormConfigManager-298cd647.js} +8 -7
  109. package/dist/esm/{SnkMessageBuilder-72423074.js → SnkMessageBuilder-ae87b754.js} +9 -13
  110. package/dist/esm/{pesquisa-fetcher-34a8b8be.js → dataunit-fetcher-3d2ec959.js} +83 -181
  111. package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
  112. package/dist/esm/loader.js +1 -1
  113. package/dist/esm/pesquisa-fetcher-a87445a0.js +164 -0
  114. package/dist/esm/sankhyablocks.js +1 -1
  115. package/dist/esm/snk-actions-button_4.entry.js +5 -3
  116. package/dist/esm/snk-application.entry.js +34 -11
  117. package/dist/esm/snk-attach.entry.js +66 -41
  118. package/dist/esm/snk-crud.entry.js +101 -10
  119. package/dist/esm/snk-data-exporter.entry.js +316 -86
  120. package/dist/esm/snk-data-unit-1ef94aef.js +688 -0
  121. package/dist/esm/snk-data-unit.entry.js +12 -2
  122. package/dist/esm/snk-detail-view.entry.js +50 -10
  123. package/dist/esm/snk-filter-bar.entry.js +6 -2
  124. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  125. package/dist/esm/snk-form-config.entry.js +1 -1
  126. package/dist/esm/snk-form-view.entry.js +67 -0
  127. package/dist/esm/snk-form.entry.js +52 -7
  128. package/dist/esm/snk-grid.entry.js +166 -109
  129. package/dist/esm/{snk-guides-viewer-edeac29f.js → snk-guides-viewer-62124f3d.js} +43 -10
  130. package/dist/esm/snk-guides-viewer.entry.js +9 -7
  131. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  132. package/dist/esm/snk-simple-crud.entry.js +257 -28
  133. package/dist/esm/snk-taskbar.entry.js +4 -3
  134. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-d59867f1.js} +3 -3
  135. package/dist/sankhyablocks/p-08c28ddd.entry.js +1 -0
  136. package/dist/sankhyablocks/p-091ce761.js +60 -0
  137. package/dist/sankhyablocks/p-094eebf6.entry.js +1 -0
  138. package/dist/sankhyablocks/p-0c68f40f.entry.js +1 -0
  139. package/dist/sankhyablocks/p-162b9a59.entry.js +11 -0
  140. package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
  141. package/dist/sankhyablocks/p-25f1fc39.js +6 -0
  142. package/dist/sankhyablocks/p-2e9c764c.entry.js +1 -0
  143. package/dist/sankhyablocks/p-30cf616e.js +1 -0
  144. package/dist/sankhyablocks/{p-96621231.js → p-3287a6cc.js} +1 -1
  145. package/dist/sankhyablocks/p-421bec84.entry.js +1 -0
  146. package/dist/sankhyablocks/p-42f7b05d.entry.js +1 -0
  147. package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
  148. package/dist/sankhyablocks/p-5f016aed.js +1 -0
  149. package/dist/sankhyablocks/p-6c364d25.entry.js +1 -0
  150. package/dist/sankhyablocks/p-70001ac1.js +1 -0
  151. package/dist/sankhyablocks/p-74c665d5.entry.js +1 -0
  152. package/dist/sankhyablocks/p-76a65660.js +1 -0
  153. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  154. package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
  155. package/dist/sankhyablocks/p-8c1ff936.entry.js +1 -0
  156. package/dist/sankhyablocks/p-939e15d3.entry.js +1 -0
  157. package/dist/sankhyablocks/p-9863d682.js +1 -0
  158. package/dist/sankhyablocks/{p-41c2c191.entry.js → p-9dfda04a.entry.js} +1 -1
  159. package/dist/sankhyablocks/{p-c2ae0fab.entry.js → p-bd008859.entry.js} +1 -1
  160. package/dist/sankhyablocks/p-c273d6ee.js +1 -0
  161. package/dist/sankhyablocks/p-d65d98ed.entry.js +1 -0
  162. package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
  163. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  164. package/dist/types/components/snk-application/snk-application.d.ts +7 -3
  165. package/dist/types/components/snk-attach/snk-attach.d.ts +11 -9
  166. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
  167. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
  168. package/dist/types/components/snk-crud/snk-crud.d.ts +45 -1
  169. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
  170. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
  171. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +24 -0
  172. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +14 -0
  173. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +12 -0
  174. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
  175. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  176. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  177. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  178. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -1
  179. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
  180. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  181. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
  182. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  183. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +67 -3
  184. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
  185. package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
  186. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  187. package/dist/types/components/snk-form/snk-form.d.ts +14 -0
  188. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
  189. package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
  190. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +62 -4
  191. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  192. package/dist/types/components.d.ts +261 -4
  193. package/dist/types/lib/@types/index.d.ts +5 -0
  194. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
  195. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
  196. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
  197. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
  198. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  199. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  200. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  201. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
  202. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
  203. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
  204. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
  205. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
  206. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
  207. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  208. package/package.json +1 -1
  209. package/dist/cjs/snk-data-unit-559ac55c.js +0 -462
  210. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  211. package/dist/components/index3.js +0 -199
  212. package/dist/esm/snk-data-unit-44215df7.js +0 -460
  213. package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
  214. package/dist/sankhyablocks/p-176c3491.entry.js +0 -1
  215. package/dist/sankhyablocks/p-37e5d563.js +0 -65
  216. package/dist/sankhyablocks/p-38289a55.js +0 -1
  217. package/dist/sankhyablocks/p-46e55a95.entry.js +0 -1
  218. package/dist/sankhyablocks/p-4e728357.entry.js +0 -1
  219. package/dist/sankhyablocks/p-5571bdfe.js +0 -1
  220. package/dist/sankhyablocks/p-5630574e.js +0 -1
  221. package/dist/sankhyablocks/p-5f8c0426.entry.js +0 -1
  222. package/dist/sankhyablocks/p-80c64add.entry.js +0 -1
  223. package/dist/sankhyablocks/p-86af4cc2.js +0 -1
  224. package/dist/sankhyablocks/p-8b690717.js +0 -1
  225. package/dist/sankhyablocks/p-a1832166.entry.js +0 -1
  226. package/dist/sankhyablocks/p-a809d944.entry.js +0 -1
  227. package/dist/sankhyablocks/p-a97226f6.entry.js +0 -1
  228. package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
  229. package/dist/sankhyablocks/p-c5a9a5d9.entry.js +0 -1
  230. package/dist/sankhyablocks/p-c5aa7d70.entry.js +0 -11
  231. package/dist/sankhyablocks/p-cb0147ab.entry.js +0 -1
  232. package/dist/sankhyablocks/p-f0145e3b.js +0 -1
  233. package/dist/sankhyablocks/p-f03e4199.entry.js +0 -1
  234. package/dist/sankhyablocks/p-f607db63.entry.js +0 -1
  235. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -11,16 +11,21 @@ import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/
11
11
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
12
12
  import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
13
13
  import { REGULAR_DEFAULT_BTNS, REGULAR_SELECTED_BTNS } from './regular-buttons';
14
+ import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
15
+ import ClientSideExporterProvider from '../snk-data-exporter/providers/ClientSideExporterProvider';
16
+ import store from "../../lib/store";
14
17
  export class SnkSimpleCrud {
15
18
  constructor() {
16
19
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
17
20
  this._keyDownHandler = (event) => this.keyDownListener(event);
18
21
  this._formConfigFetcher = new FormConfigFetcher();
22
+ this._customEditors = new Map();
23
+ this._customRenders = new Map();
19
24
  this._taskbarProcessor = new TaskbarProcessor({
20
- "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, TaskbarElement.GRID_MODE),
21
- "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, TaskbarElement.FORM_MODE),
22
- "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, TaskbarElement.GRID_MODE),
23
- "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, TaskbarElement.FORM_MODE),
25
+ "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
26
+ "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
27
+ "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
28
+ "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
24
29
  "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
25
30
  });
26
31
  this._showPopUpGridConfig = false;
@@ -31,12 +36,15 @@ export class SnkSimpleCrud {
31
36
  this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
32
37
  this.dataState = undefined;
33
38
  this.dataUnit = undefined;
39
+ this.entityName = undefined;
34
40
  this.mode = SIMPLE_CRUD_MODE.SERVER;
35
41
  this.gridConfig = undefined;
36
42
  this.formConfig = undefined;
37
43
  this._formFields = [];
44
+ this._fieldsProps = new Map();
38
45
  this.multipleSelection = undefined;
39
46
  this.useCancelConfirm = true;
47
+ this.pageSize = 150;
40
48
  this.resourceID = undefined;
41
49
  this.taskbarManager = undefined;
42
50
  this.messagesBuilder = undefined;
@@ -47,6 +55,34 @@ export class SnkSimpleCrud {
47
55
  this.gridLegacyConfigName = undefined;
48
56
  this.formLegacyConfigName = undefined;
49
57
  this.ignoreReadOnlyFormFields = false;
58
+ this.autoFocus = true;
59
+ this.domainMessagesBuilder = undefined;
60
+ this.autoLoad = undefined;
61
+ }
62
+ /**
63
+ * Registra um editor customizado para campos da grade e formulário.
64
+ */
65
+ async addCustomEditor(fieldName, customEditor) {
66
+ if (this._grid && this._form) {
67
+ this._grid.addCustomEditor(fieldName, customEditor);
68
+ this._form.addCustomEditor(fieldName, customEditor);
69
+ return;
70
+ }
71
+ const newCustomEditors = new Map(this._customEditors);
72
+ newCustomEditors.set(fieldName, customEditor);
73
+ this._customEditors = newCustomEditors;
74
+ }
75
+ /**
76
+ * Registra um render customizado para colunas da grid.
77
+ */
78
+ async addGridCustomRender(fieldName, customRender) {
79
+ if (this._grid) {
80
+ this._grid.addGridCustomRender(fieldName, customRender);
81
+ return;
82
+ }
83
+ const newCustomRenders = new Map(this._customRenders);
84
+ newCustomRenders.set(fieldName, customRender);
85
+ this._customRenders = newCustomRenders;
50
86
  }
51
87
  handleResourceIDChanged(newValue, oldValue) {
52
88
  if (StringUtils.isEmpty(newValue)) {
@@ -58,9 +94,30 @@ export class SnkSimpleCrud {
58
94
  this.loadFormConfig(true);
59
95
  this.loadGridConfig(true);
60
96
  }
61
- getButtons(selected, changeModeBtn) {
97
+ /**
98
+ * Registra um formatador de valores para uma coluna da grid.
99
+ */
100
+ async addCustomValueFormatter(columnName, customFormatter) {
101
+ this._grid.addCustomValueFormatter(columnName, customFormatter);
102
+ }
103
+ /**
104
+ * Remove o formatador de valores de uma coluna da grid.
105
+ */
106
+ async removeCustomValueFormatter(columnName) {
107
+ this._grid.removeCustomValueFormatter(columnName);
108
+ }
109
+ /**
110
+ * Altera/adiciona uma propriedade nos metadados do campo.
111
+ */
112
+ async setFieldProp(fieldName, propName, value) {
113
+ const newCustomFieldProps = new Map(this._fieldsProps);
114
+ const currentProps = this._fieldsProps.get(fieldName);
115
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
116
+ this._fieldsProps = newCustomFieldProps;
117
+ }
118
+ getButtons(selected, extraButtons) {
62
119
  return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
63
- .concat(changeModeBtn));
120
+ .concat(extraButtons));
64
121
  }
65
122
  addConfigButton(buttons) {
66
123
  if (this.configName === undefined) {
@@ -100,15 +157,19 @@ export class SnkSimpleCrud {
100
157
  }
101
158
  evt.stopPropagation();
102
159
  }
160
+ async onChangeEntityName(newValue) {
161
+ if (this.dataUnit)
162
+ return;
163
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
164
+ this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
165
+ }
103
166
  onModeChange() {
104
167
  if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
105
168
  this.initInMemoryDataUnit();
106
169
  }
107
170
  }
108
171
  observeDataState(newValue, oldValue) {
109
- if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
110
- this.dataStateChange.emit(newValue);
111
- }
172
+ this.handleDataStateChange(newValue, oldValue);
112
173
  }
113
174
  async observeFormLegacy(newValue, oldValue) {
114
175
  await this.handleUpdateFormLegacyConfig(newValue, oldValue);
@@ -116,6 +177,29 @@ export class SnkSimpleCrud {
116
177
  async observeGridLegacy(newValue, oldValue) {
117
178
  await this.handleUpdateGridLegacyConfig(newValue, oldValue);
118
179
  }
180
+ async handleDataStateChange(newValue, oldValue) {
181
+ if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
182
+ this.dataStateChange.emit(newValue);
183
+ }
184
+ await this.processRmPrecision();
185
+ }
186
+ async processRmPrecision() {
187
+ var _a, _b;
188
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
189
+ for (const field of fieldsWithRmPrecision || []) {
190
+ if (!field) {
191
+ continue;
192
+ }
193
+ const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
194
+ if (!rmPrecision && rmPrecision !== 0) {
195
+ continue;
196
+ }
197
+ await this.setFieldProp(field, 'precision', rmPrecision);
198
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
199
+ }
200
+ ;
201
+ this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
202
+ }
119
203
  async handleUpdateGridLegacyConfig(newValue, oldValue) {
120
204
  if (newValue == undefined || newValue == oldValue) {
121
205
  return;
@@ -212,6 +296,7 @@ export class SnkSimpleCrud {
212
296
  }
213
297
  async componentWillRender() {
214
298
  this._resourceID = await this.application.getResourceID();
299
+ this.dataExporterProviderStore();
215
300
  this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
216
301
  if (this.configName === undefined) {
217
302
  return;
@@ -223,32 +308,70 @@ export class SnkSimpleCrud {
223
308
  this.loadGridConfig();
224
309
  this.loadFormConfig();
225
310
  }
311
+ componentDidRender() {
312
+ this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
313
+ this.addGridCustomValueFormattters();
314
+ this.setFieldsProps();
315
+ this.setCustomRenders();
316
+ this.setCustomEditors();
317
+ }
226
318
  componentWillLoad() {
227
319
  this.processMetadata();
228
320
  this.onModeChange();
229
321
  this.configDatasource();
322
+ this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
230
323
  }
231
324
  componentDidLoad() {
232
325
  CSSVarsUtils.applyVarsGrid(this._element, this._grid);
233
326
  }
327
+ setCustomRenders() {
328
+ if (!this._grid) {
329
+ return;
330
+ }
331
+ for (const [fieldName, customRender] of this._customRenders) {
332
+ this._grid.addGridCustomRender(fieldName, customRender);
333
+ this._customRenders.delete(fieldName);
334
+ }
335
+ }
336
+ setCustomEditors() {
337
+ if (!this._grid || !this._form) {
338
+ return;
339
+ }
340
+ for (const [fieldName, customEditor] of this._customEditors) {
341
+ this._grid.addCustomEditor(fieldName, customEditor);
342
+ this._form.addCustomEditor(fieldName, customEditor);
343
+ this._customEditors.delete(fieldName);
344
+ }
345
+ }
234
346
  configDatasource() {
235
347
  this._multiSelectionListDataSource.setApplication(this.application);
236
348
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
237
349
  }
350
+ setFieldsProps() {
351
+ if (!this._form) {
352
+ return;
353
+ }
354
+ for (const [fieldName, props] of this._fieldsProps) {
355
+ for (const prop in props) {
356
+ this._form.setFieldProp(fieldName, prop, props[prop]);
357
+ }
358
+ this._fieldsProps.delete(fieldName);
359
+ }
360
+ }
238
361
  getTaskBarId() {
239
- var _a, _b, _c;
362
+ var _a, _b;
240
363
  if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
241
364
  return "snkSimpleCrudTaskbar.finish_edition";
242
365
  }
243
366
  if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
244
367
  !this.dataState.selectionInfo.isAllRecords() &&
245
- ((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
368
+ this.dataState.selectionInfo.length > 0) {
246
369
  return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
247
370
  }
248
371
  return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
249
372
  }
250
373
  initInMemoryDataUnit() {
251
- this._inMemoryLoader = new InMemoryLoader(this._metadata);
374
+ this._inMemoryLoader = new InMemoryLoader(this._metadata, undefined, { autoLoad: this.autoLoad });
252
375
  this.dataUnit = this._inMemoryLoader.dataUnit;
253
376
  this.dataUnitReady.emit(this.dataUnit);
254
377
  }
@@ -287,12 +410,11 @@ export class SnkSimpleCrud {
287
410
  var _a;
288
411
  (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
289
412
  }
290
- updateConfig() {
413
+ async updateConfig() {
291
414
  if (this._formConfigManager == undefined) {
292
415
  this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
293
416
  }
294
417
  this._formConfigManager.setConfig(this.formConfig);
295
- return;
296
418
  }
297
419
  processMetadata() {
298
420
  const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
@@ -324,11 +446,28 @@ export class SnkSimpleCrud {
324
446
  };
325
447
  }
326
448
  }
449
+ addGridCustomValueFormattters() {
450
+ var _a, _b, _c;
451
+ const metadataFields = ((_a = this._metadata) === null || _a === void 0 ? void 0 : _a.fields) || ((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.fields);
452
+ if (!metadataFields) {
453
+ return;
454
+ }
455
+ const fieldsWithRmPrecision = [];
456
+ metadataFields.forEach((field) => {
457
+ var _a;
458
+ if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
459
+ fieldsWithRmPrecision.push(field.name);
460
+ }
461
+ });
462
+ fieldsWithRmPrecision.forEach(field => {
463
+ this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
464
+ });
465
+ }
327
466
  onDataStateChange(evt) {
328
467
  this.dataState = Object.assign({}, evt.detail);
329
468
  }
330
469
  getTaskBarDisabledButtons() {
331
- var _a, _b, _c, _d;
470
+ var _a, _b, _c, _d, _e, _f;
332
471
  const disabledButtons = [];
333
472
  if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
334
473
  disabledButtons.push(TaskbarElement.NEXT);
@@ -339,6 +478,9 @@ export class SnkSimpleCrud {
339
478
  if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
340
479
  disabledButtons.push(TaskbarElement.FORM_MODE);
341
480
  }
481
+ if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
482
+ disabledButtons.push(TaskbarElement.CLONE);
483
+ }
342
484
  return disabledButtons;
343
485
  }
344
486
  handleCancelEdit() {
@@ -482,9 +624,23 @@ export class SnkSimpleCrud {
482
624
  .then(() => {
483
625
  this.setGridConfig(config);
484
626
  this.closeGridConfig();
627
+ this.dataExporterProviderStore();
485
628
  });
486
629
  evt.stopPropagation();
487
630
  }
631
+ async dataExporterProviderStore() {
632
+ if (this.dataUnit == undefined) {
633
+ return;
634
+ }
635
+ if (this._grid == undefined) {
636
+ return;
637
+ }
638
+ const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
639
+ store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
640
+ }
641
+ getDataExporterStoreKey() {
642
+ return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
643
+ }
488
644
  setGridConfig(config) {
489
645
  this.gridConfig = config;
490
646
  CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
@@ -500,6 +656,15 @@ export class SnkSimpleCrud {
500
656
  closeFormConfig() {
501
657
  this._showFormConfig = false;
502
658
  }
659
+ getPageSize() {
660
+ if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
661
+ return 0;
662
+ }
663
+ if (this.pageSize == undefined) {
664
+ return 150;
665
+ }
666
+ return this.pageSize;
667
+ }
503
668
  //No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
504
669
  handleShowFormConfig() {
505
670
  return this._showFormConfig && !this.formLegacyConfigName;
@@ -508,22 +673,31 @@ export class SnkSimpleCrud {
508
673
  return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
509
674
  }
510
675
  getFormConfig() {
511
- var _a, _b;
512
- const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
676
+ var _a;
677
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
513
678
  if (!this.configName && !configFromManager) {
514
679
  return this.formConfig;
515
680
  }
516
681
  return configFromManager;
517
682
  }
683
+ updateFormConfig() {
684
+ const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
685
+ this.setFormConfig(newConfig, true);
686
+ if (this._formConfigManager == undefined) {
687
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
688
+ }
689
+ this._formConfigManager.setConfig(this.formConfig);
690
+ }
518
691
  /* istanbul ignore next */
519
692
  render() {
520
693
  var _a;
521
694
  if (this.dataUnit == undefined) {
522
695
  return;
523
696
  }
524
- return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
697
+ const taskbarContent = (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
698
+ return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === VIEW_MODE.FORM && taskbarContent, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
525
699
  ? undefined
526
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
700
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, this._currentViewMode === VIEW_MODE.GRID && taskbarContent, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
527
701
  }
528
702
  static get is() { return "snk-simple-crud"; }
529
703
  static get encapsulation() { return "scoped"; }
@@ -579,6 +753,23 @@ export class SnkSimpleCrud {
579
753
  "text": ""
580
754
  }
581
755
  },
756
+ "entityName": {
757
+ "type": "string",
758
+ "mutable": false,
759
+ "complexType": {
760
+ "original": "string",
761
+ "resolved": "string",
762
+ "references": {}
763
+ },
764
+ "required": false,
765
+ "optional": false,
766
+ "docs": {
767
+ "tags": [],
768
+ "text": "Define o nome da entidade que o componente vai utilizar para fazer as opera\u00E7\u00F5es de CRUD"
769
+ },
770
+ "attribute": "entity-name",
771
+ "reflect": false
772
+ },
582
773
  "mode": {
583
774
  "type": "number",
584
775
  "mutable": false,
@@ -677,6 +868,24 @@ export class SnkSimpleCrud {
677
868
  "reflect": false,
678
869
  "defaultValue": "true"
679
870
  },
871
+ "pageSize": {
872
+ "type": "number",
873
+ "mutable": false,
874
+ "complexType": {
875
+ "original": "number",
876
+ "resolved": "number",
877
+ "references": {}
878
+ },
879
+ "required": false,
880
+ "optional": false,
881
+ "docs": {
882
+ "tags": [],
883
+ "text": "Determina quantas linhas s\u00E3o retornadas por p\u00E1gina."
884
+ },
885
+ "attribute": "page-size",
886
+ "reflect": false,
887
+ "defaultValue": "150"
888
+ },
680
889
  "resourceID": {
681
890
  "type": "string",
682
891
  "mutable": false,
@@ -860,6 +1069,58 @@ export class SnkSimpleCrud {
860
1069
  "attribute": "ignore-read-only-form-fields",
861
1070
  "reflect": false,
862
1071
  "defaultValue": "false"
1072
+ },
1073
+ "autoFocus": {
1074
+ "type": "boolean",
1075
+ "mutable": false,
1076
+ "complexType": {
1077
+ "original": "boolean",
1078
+ "resolved": "boolean",
1079
+ "references": {}
1080
+ },
1081
+ "required": false,
1082
+ "optional": true,
1083
+ "docs": {
1084
+ "tags": [],
1085
+ "text": "Define se a grid ser\u00E1 focada ao ser carregada."
1086
+ },
1087
+ "attribute": "auto-focus",
1088
+ "reflect": false,
1089
+ "defaultValue": "true"
1090
+ },
1091
+ "domainMessagesBuilder": {
1092
+ "type": "string",
1093
+ "mutable": false,
1094
+ "complexType": {
1095
+ "original": "string",
1096
+ "resolved": "string",
1097
+ "references": {}
1098
+ },
1099
+ "required": false,
1100
+ "optional": false,
1101
+ "docs": {
1102
+ "tags": [],
1103
+ "text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
1104
+ },
1105
+ "attribute": "domain-messages-builder",
1106
+ "reflect": false
1107
+ },
1108
+ "autoLoad": {
1109
+ "type": "boolean",
1110
+ "mutable": false,
1111
+ "complexType": {
1112
+ "original": "boolean",
1113
+ "resolved": "boolean",
1114
+ "references": {}
1115
+ },
1116
+ "required": false,
1117
+ "optional": true,
1118
+ "docs": {
1119
+ "tags": [],
1120
+ "text": "Define se a carga dos dados ser\u00E1 feita assim que o componente for carregado."
1121
+ },
1122
+ "attribute": "auto-load",
1123
+ "reflect": false
863
1124
  }
864
1125
  };
865
1126
  }
@@ -871,7 +1132,8 @@ export class SnkSimpleCrud {
871
1132
  "_config": {},
872
1133
  "_fieldToGetFocus": {},
873
1134
  "_customContainerId": {},
874
- "_formFields": {}
1135
+ "_formFields": {},
1136
+ "_fieldsProps": {}
875
1137
  };
876
1138
  }
877
1139
  static get events() {
@@ -986,6 +1248,128 @@ export class SnkSimpleCrud {
986
1248
  }
987
1249
  static get methods() {
988
1250
  return {
1251
+ "addCustomEditor": {
1252
+ "complexType": {
1253
+ "signature": "(fieldName: string, customEditor: ICustomEditor) => Promise<void>",
1254
+ "parameters": [{
1255
+ "tags": [],
1256
+ "text": ""
1257
+ }, {
1258
+ "tags": [],
1259
+ "text": ""
1260
+ }],
1261
+ "references": {
1262
+ "Promise": {
1263
+ "location": "global"
1264
+ },
1265
+ "ICustomEditor": {
1266
+ "location": "import",
1267
+ "path": "@sankhyalabs/ezui/dist/types/utils"
1268
+ }
1269
+ },
1270
+ "return": "Promise<void>"
1271
+ },
1272
+ "docs": {
1273
+ "text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
1274
+ "tags": []
1275
+ }
1276
+ },
1277
+ "addGridCustomRender": {
1278
+ "complexType": {
1279
+ "signature": "(fieldName: string, customRender: ICustomRender) => Promise<void>",
1280
+ "parameters": [{
1281
+ "tags": [],
1282
+ "text": ""
1283
+ }, {
1284
+ "tags": [],
1285
+ "text": ""
1286
+ }],
1287
+ "references": {
1288
+ "Promise": {
1289
+ "location": "global"
1290
+ },
1291
+ "ICustomRender": {
1292
+ "location": "import",
1293
+ "path": "@sankhyalabs/ezui/dist/types/utils"
1294
+ }
1295
+ },
1296
+ "return": "Promise<void>"
1297
+ },
1298
+ "docs": {
1299
+ "text": "Registra um render customizado para colunas da grid.",
1300
+ "tags": []
1301
+ }
1302
+ },
1303
+ "addCustomValueFormatter": {
1304
+ "complexType": {
1305
+ "signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
1306
+ "parameters": [{
1307
+ "tags": [],
1308
+ "text": ""
1309
+ }, {
1310
+ "tags": [],
1311
+ "text": ""
1312
+ }],
1313
+ "references": {
1314
+ "Promise": {
1315
+ "location": "global"
1316
+ },
1317
+ "ICustomFormatter": {
1318
+ "location": "import",
1319
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces"
1320
+ }
1321
+ },
1322
+ "return": "Promise<void>"
1323
+ },
1324
+ "docs": {
1325
+ "text": "Registra um formatador de valores para uma coluna da grid.",
1326
+ "tags": []
1327
+ }
1328
+ },
1329
+ "removeCustomValueFormatter": {
1330
+ "complexType": {
1331
+ "signature": "(columnName: string) => Promise<void>",
1332
+ "parameters": [{
1333
+ "tags": [],
1334
+ "text": ""
1335
+ }],
1336
+ "references": {
1337
+ "Promise": {
1338
+ "location": "global"
1339
+ }
1340
+ },
1341
+ "return": "Promise<void>"
1342
+ },
1343
+ "docs": {
1344
+ "text": "Remove o formatador de valores de uma coluna da grid.",
1345
+ "tags": []
1346
+ }
1347
+ },
1348
+ "setFieldProp": {
1349
+ "complexType": {
1350
+ "signature": "(fieldName: string, propName: string, value: any) => Promise<void>",
1351
+ "parameters": [{
1352
+ "tags": [],
1353
+ "text": ""
1354
+ }, {
1355
+ "tags": [],
1356
+ "text": ""
1357
+ }, {
1358
+ "tags": [],
1359
+ "text": ""
1360
+ }],
1361
+ "references": {
1362
+ "Promise": {
1363
+ "location": "global"
1364
+ }
1365
+ },
1366
+ "return": "Promise<void>"
1367
+ },
1368
+ "docs": {
1369
+ "text": "Altera/adiciona uma propriedade nos metadados do campo.",
1370
+ "tags": []
1371
+ }
1372
+ },
989
1373
  "goToView": {
990
1374
  "complexType": {
991
1375
  "signature": "(view: VIEW_MODE) => Promise<void>",
@@ -1136,6 +1520,9 @@ export class SnkSimpleCrud {
1136
1520
  return [{
1137
1521
  "propName": "resourceID",
1138
1522
  "methodName": "handleResourceIDChanged"
1523
+ }, {
1524
+ "propName": "entityName",
1525
+ "methodName": "onChangeEntityName"
1139
1526
  }, {
1140
1527
  "propName": "mode",
1141
1528
  "methodName": "onModeChange"
@@ -47,7 +47,7 @@ export const buildCustomButton = (def, className, dataElementId, action, isEnabl
47
47
  return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
48
48
  }
49
49
  };
50
- export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
50
+ export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, dataExporterStoreKey, presentationMode) => {
51
51
  var _a;
52
52
  const title = getTitle(element);
53
53
  switch (element) {
@@ -90,7 +90,7 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
90
90
  case TaskbarElement.DIVIDER:
91
91
  return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
92
92
  case TaskbarElement.DATA_EXPORTER:
93
- const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
93
+ const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[dataExporterStoreKey];
94
94
  return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
95
95
  case TaskbarElement.ATTACH:
96
96
  return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
@@ -184,8 +184,9 @@ export class SnkTaskbar {
184
184
  className += "ez-padding-left--medium";
185
185
  }
186
186
  const taskbarElement = TaskbarElement[def.toString()];
187
+ const dataExporterStoreKey = this._element.dataset.exporterStoreKey || this.configName;
187
188
  if (taskbarElement) {
188
- return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
189
+ return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), dataExporterStoreKey, this.presentationMode);
189
190
  }
190
191
  else {
191
192
  return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));