@sankhyalabs/sankhyablocks 8.15.0-dev.7 → 8.15.0-dev.70

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 (382) hide show
  1. package/dist/cjs/{ConfigStorage-8009ecb2.js → ConfigStorage-9a53a42c.js} +94 -21
  2. package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-515bda03.js} +7 -4
  3. package/dist/cjs/IExporterProvider-90690372.js +230 -0
  4. package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
  5. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  6. package/dist/cjs/{SnkFormConfigManager-7d850fbc.js → SnkFormConfigManager-7b222c78.js} +23 -15
  7. package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-4a95fe86.js} +25 -13
  8. package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5acb0335.js} +1 -1
  9. package/dist/cjs/{dataunit-fetcher-14108bec.js → dataunit-fetcher-7a08e4dd.js} +409 -77
  10. package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-3f430aee.js} +13 -1
  11. package/dist/cjs/index-f9e81701.js +2 -10
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{pesquisa-fetcher-ef050a47.js → pesquisa-fetcher-916a935c.js} +12 -13
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +526 -8
  16. package/dist/cjs/snk-application.cjs.entry.js +68 -24
  17. package/dist/cjs/snk-attach.cjs.entry.js +430 -71
  18. package/dist/cjs/snk-crud.cjs.entry.js +124 -28
  19. package/dist/cjs/snk-data-exporter.cjs.entry.js +207 -83
  20. package/dist/cjs/snk-data-unit-3718477f.js +670 -0
  21. package/dist/cjs/snk-data-unit.cjs.entry.js +11 -2
  22. package/dist/cjs/snk-detail-view.cjs.entry.js +52 -13
  23. package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
  24. package/dist/cjs/snk-filter-bar.cjs.entry.js +70 -10
  25. package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
  26. package/dist/cjs/snk-filter-item.cjs.entry.js +13 -6
  27. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
  29. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
  30. package/dist/cjs/snk-form-config.cjs.entry.js +47 -27
  31. package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
  32. package/dist/cjs/snk-form.cjs.entry.js +60 -8
  33. package/dist/cjs/snk-grid.cjs.entry.js +199 -122
  34. package/dist/cjs/{snk-guides-viewer-e7f76399.js → snk-guides-viewer-7fb9e5a1.js} +56 -20
  35. package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -10
  36. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
  37. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  38. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  39. package/dist/cjs/snk-simple-crud.cjs.entry.js +507 -39
  40. package/dist/cjs/snk-taskbar.cjs.entry.js +124 -15
  41. package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-d9392685.js} +11 -11
  42. package/dist/collection/collection-manifest.json +8 -8
  43. package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
  44. package/dist/collection/components/snk-application/snk-application.js +122 -19
  45. package/dist/collection/components/snk-attach/snk-attach.js +220 -53
  46. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  47. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  48. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  49. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  50. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  51. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +118 -0
  52. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  53. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
  54. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
  55. package/dist/collection/components/snk-crud/snk-crud.js +340 -19
  56. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +137 -2
  57. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
  58. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
  59. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +163 -13
  60. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
  61. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
  62. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +54 -1
  63. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  64. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
  65. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  66. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +44 -50
  67. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  68. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  69. package/dist/collection/components/snk-data-unit/snk-data-unit.js +500 -216
  70. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
  71. package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
  72. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
  73. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
  74. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
  75. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +31 -6
  76. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
  77. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +24 -1
  78. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +180 -5
  79. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  80. package/dist/collection/components/snk-form/snk-form.js +126 -5
  81. package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +22 -14
  82. package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +50 -30
  83. package/dist/collection/components/snk-grid/snk-grid.js +341 -115
  84. package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
  85. package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
  86. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
  87. package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
  88. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +10 -2
  89. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +824 -22
  90. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +4 -2
  91. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +11 -11
  92. package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
  93. package/dist/collection/components/snk-taskbar/snk-taskbar.js +167 -14
  94. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
  95. package/dist/collection/lib/configs/ConfigStorage.js +86 -16
  96. package/dist/collection/lib/dataUnit/InMemoryLoader.js +15 -42
  97. package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
  98. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
  99. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
  100. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +7 -4
  101. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  102. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  103. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  104. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  105. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  106. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  107. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  108. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  109. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  110. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
  111. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +30 -2
  112. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
  113. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
  114. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +87 -24
  115. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
  116. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
  117. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
  118. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
  119. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -13
  120. package/dist/collection/lib/index.js +1 -1
  121. package/dist/collection/lib/message/SnkMessageBuilder.js +25 -32
  122. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  123. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
  124. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
  125. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  126. package/dist/collection/lib/utils/CrudUtils.js +13 -1
  127. package/dist/components/ConfigStorage.js +92 -19
  128. package/dist/components/DataFetcher.js +7 -4
  129. package/dist/components/IExporterProvider.js +298 -0
  130. package/dist/components/ISave.js +42 -0
  131. package/dist/components/SnkFormConfigManager.js +21 -13
  132. package/dist/components/SnkMessageBuilder.js +25 -13
  133. package/dist/components/dataunit-fetcher.js +185 -241
  134. package/dist/components/form-config-fetcher.js +12 -0
  135. package/dist/components/index.d.ts +6 -6
  136. package/dist/components/index2.js +198 -33
  137. package/dist/{esm/pesquisa-fetcher-dd3ca0a5.js → components/pesquisa-fetcher.js} +13 -14
  138. package/dist/components/snk-actions-button2.js +4 -10
  139. package/dist/components/snk-application2.js +66 -18
  140. package/dist/components/snk-attach2.js +485 -78
  141. package/dist/components/snk-crud.js +131 -23
  142. package/dist/components/snk-data-exporter2.js +202 -83
  143. package/dist/components/snk-data-unit2.js +463 -214
  144. package/dist/components/snk-detail-view2.js +137 -23
  145. package/dist/components/snk-entity-list.js +5 -3
  146. package/dist/components/snk-expression-item2.js +1 -1
  147. package/dist/components/snk-filter-bar2.js +74 -8
  148. package/dist/components/snk-filter-detail2.js +5 -1
  149. package/dist/components/snk-filter-item2.js +14 -6
  150. package/dist/components/snk-filter-modal.js +4 -2
  151. package/dist/components/snk-filter-multi-select.js +2 -1
  152. package/dist/components/snk-form-config2.js +46 -26
  153. package/dist/components/snk-form-view2.js +72 -1
  154. package/dist/components/snk-form.js +60 -5
  155. package/dist/components/snk-grid-config2.js +128 -102
  156. package/dist/components/snk-grid2.js +207 -119
  157. package/dist/components/snk-personalized-filter-editor.js +3 -1
  158. package/dist/components/snk-personalized-filter2.js +1 -1
  159. package/dist/components/snk-pesquisa2.js +1 -1
  160. package/dist/components/snk-simple-crud2.js +568 -35
  161. package/dist/components/snk-taskbar2.js +144 -29
  162. package/dist/components/taskbar-actions-button2.js +4 -2
  163. package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-174101b9.js} +94 -21
  164. package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-4b4b7beb.js} +7 -4
  165. package/dist/esm/IExporterProvider-ce2ca127.js +221 -0
  166. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  167. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  168. package/dist/esm/{SnkFormConfigManager-9be0e7d4.js → SnkFormConfigManager-3bdb3e1f.js} +23 -15
  169. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-3a767111.js} +25 -13
  170. package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-9f86c346.js} +1 -1
  171. package/dist/esm/{dataunit-fetcher-cbec1594.js → dataunit-fetcher-f3fa35b9.js} +392 -70
  172. package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-5d72aaf1.js} +13 -1
  173. package/dist/esm/index-a7d3d3f1.js +2 -10
  174. package/dist/esm/loader.js +1 -1
  175. package/dist/esm/pesquisa-fetcher-9cfab836.js +164 -0
  176. package/dist/esm/sankhyablocks.js +1 -1
  177. package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +525 -9
  178. package/dist/esm/snk-application.entry.js +68 -24
  179. package/dist/esm/snk-attach.entry.js +430 -71
  180. package/dist/esm/snk-crud.entry.js +124 -28
  181. package/dist/esm/snk-data-exporter.entry.js +208 -84
  182. package/dist/esm/snk-data-unit-8d6afa43.js +668 -0
  183. package/dist/esm/snk-data-unit.entry.js +11 -2
  184. package/dist/esm/snk-detail-view.entry.js +52 -13
  185. package/dist/esm/snk-entity-list.entry.js +5 -3
  186. package/dist/esm/snk-filter-bar.entry.js +70 -10
  187. package/dist/esm/snk-filter-detail.entry.js +4 -1
  188. package/dist/esm/snk-filter-item.entry.js +13 -6
  189. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  190. package/dist/esm/snk-filter-modal.entry.js +2 -1
  191. package/dist/esm/snk-filter-multi-select.entry.js +2 -1
  192. package/dist/esm/snk-form-config.entry.js +48 -28
  193. package/dist/esm/snk-form-view.entry.js +67 -0
  194. package/dist/esm/snk-form.entry.js +60 -8
  195. package/dist/esm/snk-grid.entry.js +199 -122
  196. package/dist/esm/{snk-guides-viewer-c7aaf02a.js → snk-guides-viewer-dabd574c.js} +56 -20
  197. package/dist/esm/snk-guides-viewer.entry.js +10 -10
  198. package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
  199. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  200. package/dist/esm/snk-pesquisa.entry.js +1 -1
  201. package/dist/esm/snk-simple-crud.entry.js +500 -32
  202. package/dist/esm/snk-taskbar.entry.js +125 -16
  203. package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-ad766858.js} +11 -11
  204. package/dist/sankhyablocks/{p-9695f78b.js → p-010d475f.js} +1 -1
  205. package/dist/sankhyablocks/p-109e0551.js +1 -0
  206. package/dist/sankhyablocks/p-1918789e.js +1 -0
  207. package/dist/sankhyablocks/p-19ba2e08.entry.js +1 -0
  208. package/dist/sankhyablocks/p-1c628fb2.entry.js +1 -0
  209. package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
  210. package/dist/sankhyablocks/p-1e9c3f95.entry.js +1 -0
  211. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  212. package/dist/sankhyablocks/p-2a84e45b.entry.js +1 -0
  213. package/dist/sankhyablocks/p-2acc8816.entry.js +1 -0
  214. package/dist/sankhyablocks/p-2c9ea7b6.entry.js +1 -0
  215. package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
  216. package/dist/sankhyablocks/p-3e4c2cfe.entry.js +11 -0
  217. package/dist/sankhyablocks/p-4a8a149d.entry.js +1 -0
  218. package/dist/sankhyablocks/p-4ce73e88.js +1 -0
  219. package/dist/sankhyablocks/p-52df8935.entry.js +1 -0
  220. package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
  221. package/dist/sankhyablocks/p-566f5f50.js +56 -0
  222. package/dist/sankhyablocks/{p-3520c088.entry.js → p-59dccb7a.entry.js} +1 -1
  223. package/dist/sankhyablocks/p-5bd78e4c.entry.js +1 -0
  224. package/dist/sankhyablocks/p-61dd89eb.js +1 -0
  225. package/dist/sankhyablocks/p-6b2be902.js +6 -0
  226. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  227. package/dist/sankhyablocks/p-9863d682.js +1 -0
  228. package/dist/sankhyablocks/{p-e6380c60.js → p-a6dfa396.js} +1 -1
  229. package/dist/sankhyablocks/{p-f514913b.entry.js → p-aa854fa8.entry.js} +1 -1
  230. package/dist/sankhyablocks/p-aa9c4099.entry.js +1 -0
  231. package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
  232. package/dist/sankhyablocks/p-b27114c4.js +1 -0
  233. package/dist/sankhyablocks/p-b643f746.entry.js +1 -0
  234. package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
  235. package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
  236. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  237. package/dist/sankhyablocks/p-e0c27486.js +26 -0
  238. package/dist/sankhyablocks/p-e238279a.entry.js +1 -0
  239. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  240. package/dist/sankhyablocks/p-eae66367.js +1 -0
  241. package/dist/sankhyablocks/p-fde91811.js +60 -0
  242. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  243. package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
  244. package/dist/types/components/snk-application/snk-application.d.ts +21 -2
  245. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  246. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  247. package/dist/types/components/snk-attach/snk-attach.d.ts +33 -10
  248. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  249. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +40 -0
  250. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  251. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  252. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  253. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +16 -0
  254. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  255. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
  256. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
  257. package/dist/types/components/snk-crud/snk-crud.d.ts +53 -1
  258. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +24 -1
  259. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
  260. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +30 -1
  261. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
  262. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
  263. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
  264. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  265. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  266. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  267. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +3 -1
  268. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  269. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  270. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +61 -2
  271. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
  272. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
  273. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +7 -3
  274. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
  275. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +31 -1
  276. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
  277. package/dist/types/components/snk-form/snk-form.d.ts +20 -1
  278. package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +2 -1
  279. package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +5 -3
  280. package/dist/types/components/snk-grid/snk-grid.d.ts +65 -7
  281. package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
  282. package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
  283. package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
  284. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +138 -6
  285. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  286. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +34 -1
  287. package/dist/types/components.d.ts +502 -16
  288. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
  289. package/dist/types/lib/configs/ConfigStorage.d.ts +25 -1
  290. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -3
  291. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
  292. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
  293. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
  294. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  295. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  296. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  297. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  298. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  299. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  300. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  301. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  302. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  303. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -0
  304. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
  305. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
  306. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +7 -0
  307. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
  308. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
  309. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -0
  310. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  311. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
  312. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  313. package/dist/types/lib/index.d.ts +1 -1
  314. package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
  315. package/package.json +15 -6
  316. package/dist/cjs/PreloadManager-84466da6.js +0 -224
  317. package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
  318. package/dist/cjs/snk-data-unit-1bc69073.js +0 -462
  319. package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
  320. package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
  321. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  322. package/dist/components/field-search.js +0 -121
  323. package/dist/components/index3.js +0 -199
  324. package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
  325. package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
  326. package/dist/esm/snk-data-unit-6208ebf0.js +0 -460
  327. package/dist/esm/snk-grid-config.entry.js +0 -479
  328. package/dist/esm/snk-select-box.entry.js +0 -21
  329. package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
  330. package/dist/sankhyablocks/p-0874adb5.entry.js +0 -1
  331. package/dist/sankhyablocks/p-094c30cb.js +0 -1
  332. package/dist/sankhyablocks/p-0d7863ed.js +0 -26
  333. package/dist/sankhyablocks/p-11081798.entry.js +0 -1
  334. package/dist/sankhyablocks/p-20726710.entry.js +0 -1
  335. package/dist/sankhyablocks/p-25927311.entry.js +0 -1
  336. package/dist/sankhyablocks/p-32f0935f.js +0 -1
  337. package/dist/sankhyablocks/p-374d03f6.js +0 -1
  338. package/dist/sankhyablocks/p-3891ae6f.js +0 -60
  339. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  340. package/dist/sankhyablocks/p-585294ee.js +0 -56
  341. package/dist/sankhyablocks/p-6977a26c.entry.js +0 -1
  342. package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
  343. package/dist/sankhyablocks/p-776ee8e3.js +0 -1
  344. package/dist/sankhyablocks/p-809f367d.entry.js +0 -1
  345. package/dist/sankhyablocks/p-8c243e7e.entry.js +0 -11
  346. package/dist/sankhyablocks/p-8d16f9ce.js +0 -1
  347. package/dist/sankhyablocks/p-8d70b5d5.entry.js +0 -1
  348. package/dist/sankhyablocks/p-98674137.entry.js +0 -1
  349. package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
  350. package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
  351. package/dist/sankhyablocks/p-c4d19840.entry.js +0 -1
  352. package/dist/sankhyablocks/p-c627ba91.entry.js +0 -1
  353. package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
  354. package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
  355. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  356. package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
  357. package/dist/sankhyablocks/p-d81f20c4.entry.js +0 -1
  358. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  359. package/dist/sankhyablocks/p-dc8b6418.entry.js +0 -1
  360. package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
  361. package/dist/sankhyablocks/p-fd8814b9.entry.js +0 -1
  362. package/dist/sankhyablocks/p-ff6064e7.js +0 -1
  363. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  364. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
  365. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  366. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  367. /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
  368. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
  369. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
  370. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
  371. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
  372. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
  373. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
  374. /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
  375. /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
  376. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  377. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
  378. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
  379. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
  380. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  381. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  382. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,22 +1,92 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { ObjectUtils, ApplicationContext, DataType, UserInterface, StringUtils, JSUtils, FloatingManager } from '@sankhyalabs/core';
2
+ import { UserInterface, StringUtils, ApplicationContext, ObjectUtils, DataType, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
3
+ import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
4
  import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
4
5
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
5
6
  import './DataFetcher.js';
6
- import { I as InMemoryLoader } from './dataunit-fetcher.js';
7
- import { P as PresentationMode } from './index2.js';
8
- import { d as defineCustomElement$6 } from './snk-actions-button2.js';
7
+ import './pesquisa-fetcher.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, R as RmPrecisionCustomValueFormatter, b as buildFieldSearch, o as openFieldSearch, a as CrudUtils } from './IExporterProvider.js';
9
+ import { D as DataExporterOption, P as PresentationMode } from './ISave.js';
9
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
+ import { I as InMemoryLoader } from './dataunit-fetcher.js';
11
13
  import './filter-item-type.enum.js';
12
- import './form-config-fetcher.js';
13
- import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search.js';
14
- import { d as defineCustomElement$5 } from './snk-data-exporter2.js';
15
- import { d as defineCustomElement$4 } from './snk-data-unit2.js';
16
- import { d as defineCustomElement$3 } from './snk-exporter-email-sender2.js';
14
+ import { F as FormConfigFetcher } from './form-config-fetcher.js';
15
+ import { C as ConfigStorage } from './ConfigStorage.js';
16
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
17
+ import { g as getSelectedIDs, d as defineCustomElement$9 } from './snk-data-unit2.js';
18
+ import { s as store } from './index2.js';
19
+ import { d as defineCustomElement$d } from './snk-actions-button2.js';
20
+ import { d as defineCustomElement$c } from './snk-config-options2.js';
21
+ import { d as defineCustomElement$b } from './snk-configurator2.js';
22
+ import { d as defineCustomElement$a } from './snk-data-exporter2.js';
23
+ import { d as defineCustomElement$8 } from './snk-exporter-email-sender2.js';
24
+ import { d as defineCustomElement$7 } from './snk-field-config2.js';
25
+ import { d as defineCustomElement$6 } from './snk-form-config2.js';
26
+ import { d as defineCustomElement$5 } from './snk-grid-config2.js';
27
+ import { d as defineCustomElement$4 } from './snk-select-box2.js';
28
+ import { d as defineCustomElement$3 } from './snk-tab-config2.js';
17
29
  import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
18
30
 
19
- const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
31
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
32
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
33
+
34
+ class ClientSideExporterProvider extends CommonsExporter {
35
+ getSelectedNumber() {
36
+ return this.dataUnit.getSelectionInfo().length;
37
+ }
38
+ getTotalRecords() {
39
+ var _a, _b, _c;
40
+ const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
41
+ return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
42
+ }
43
+ getSelectedIDs() {
44
+ return getSelectedIDs(this.dataUnit);
45
+ }
46
+ getRecordID() {
47
+ var _a, _b, _c;
48
+ return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
49
+ }
50
+ async getRecords() {
51
+ if (this.dataUnit.records.length === 0) {
52
+ return Promise.resolve([]);
53
+ }
54
+ const selectionInfo = this.dataUnit.getSelectionInfo();
55
+ const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
56
+ return Promise.resolve(records == undefined ? [] : records);
57
+ }
58
+ getHiddenOptions() {
59
+ return [
60
+ DataExporterOption.EXPORT_BY_EMAIL,
61
+ DataExporterOption.EXPORT_PDF_TO_EMAIL,
62
+ DataExporterOption.EXPORT_XLS_TO_EMAIL,
63
+ DataExporterOption.EXPORT_PAGE_TO_PDF,
64
+ DataExporterOption.EXPORT_PAGE_TO_XLS
65
+ ];
66
+ }
67
+ formatValue(record, column) {
68
+ const { id, descriptionFrom } = column;
69
+ const value = record[descriptionFrom || id];
70
+ if (value == undefined) {
71
+ return "";
72
+ }
73
+ if (descriptionFrom != undefined) {
74
+ return value.label;
75
+ }
76
+ const fieldDescriptor = this.dataUnit.getField(id);
77
+ if (fieldDescriptor.userInterface === UserInterface.SEARCH) {
78
+ return value.value;
79
+ }
80
+ if (column.customFormatter) {
81
+ const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
82
+ const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
83
+ return formattedValue;
84
+ }
85
+ return this.dataUnit.getFormattedValue(id, value);
86
+ }
87
+ }
88
+
89
+ const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
20
90
 
21
91
  const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
22
92
  constructor() {
@@ -26,31 +96,117 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
26
96
  this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
27
97
  this.actionClick = createEvent(this, "actionClick", 7);
28
98
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
29
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
30
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
99
+ this.configuratorSave = createEvent(this, "configuratorSave", 7);
100
+ this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
31
101
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
32
102
  this._keyDownHandler = (event) => this.keyDownListener(event);
103
+ this._formConfigFetcher = new FormConfigFetcher();
104
+ this._customEditors = new Map();
105
+ this._customRenders = new Map();
33
106
  this._taskbarProcessor = new TaskbarProcessor({
34
- "snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
35
- "snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
36
- "snkSimpleCrudTaskbar.form_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(TaskbarElement.GRID_MODE),
37
- "snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(TaskbarElement.FORM_MODE),
107
+ "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
108
+ "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
109
+ "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
110
+ "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
38
111
  "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
39
112
  });
113
+ this._showPopUpGridConfig = false;
114
+ this._showFormConfig = false;
40
115
  this._currentViewMode = VIEW_MODE.GRID;
41
116
  this._config = undefined;
42
117
  this._fieldToGetFocus = undefined;
118
+ this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
43
119
  this.dataState = undefined;
44
120
  this.dataUnit = undefined;
121
+ this.entityName = undefined;
45
122
  this.mode = SIMPLE_CRUD_MODE.SERVER;
46
123
  this.gridConfig = undefined;
47
124
  this.formConfig = undefined;
48
125
  this._formFields = [];
126
+ this._fieldsProps = new Map();
49
127
  this.multipleSelection = undefined;
50
128
  this.useCancelConfirm = true;
129
+ this.pageSize = 150;
130
+ this.resourceID = undefined;
51
131
  this.taskbarManager = undefined;
52
132
  this.messagesBuilder = undefined;
53
133
  this.useEnterLikeTab = false;
134
+ this.actionsList = undefined;
135
+ this.configName = undefined;
136
+ this.showConfiguratorButtons = undefined;
137
+ this.gridLegacyConfigName = undefined;
138
+ this.formLegacyConfigName = undefined;
139
+ this.ignoreReadOnlyFormFields = false;
140
+ this.autoLoad = undefined;
141
+ }
142
+ /**
143
+ * Registra um editor customizado para campos da grade e formulário.
144
+ */
145
+ async addCustomEditor(fieldName, customEditor) {
146
+ if (this._grid && this._form) {
147
+ this._grid.addCustomEditor(fieldName, customEditor);
148
+ this._form.addCustomEditor(fieldName, customEditor);
149
+ return;
150
+ }
151
+ const newCustomEditors = new Map(this._customEditors);
152
+ newCustomEditors.set(fieldName, customEditor);
153
+ this._customEditors = newCustomEditors;
154
+ }
155
+ /**
156
+ * Registra um render customizado para colunas da grid.
157
+ */
158
+ async addGridCustomRender(fieldName, customRender) {
159
+ if (this._grid) {
160
+ this._grid.addGridCustomRender(fieldName, customRender);
161
+ return;
162
+ }
163
+ const newCustomRenders = new Map(this._customRenders);
164
+ newCustomRenders.set(fieldName, customRender);
165
+ this._customRenders = newCustomRenders;
166
+ }
167
+ handleResourceIDChanged(newValue, oldValue) {
168
+ if (StringUtils.isEmpty(newValue)) {
169
+ return;
170
+ }
171
+ if (newValue === oldValue) {
172
+ return;
173
+ }
174
+ this.loadFormConfig(true);
175
+ this.loadGridConfig(true);
176
+ }
177
+ /**
178
+ * Registra um formatador de valores para uma coluna da grid.
179
+ */
180
+ async addCustomValueFormatter(columnName, customFormatter) {
181
+ this._grid.addCustomValueFormatter(columnName, customFormatter);
182
+ }
183
+ /**
184
+ * Remove o formatador de valores de uma coluna da grid.
185
+ */
186
+ async removeCustomValueFormatter(columnName) {
187
+ this._grid.removeCustomValueFormatter(columnName);
188
+ }
189
+ /**
190
+ * Altera/adiciona uma propriedade nos metadados do campo.
191
+ */
192
+ async setFieldProp(fieldName, propName, value) {
193
+ const newCustomFieldProps = new Map(this._fieldsProps);
194
+ const currentProps = this._fieldsProps.get(fieldName);
195
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
196
+ this._fieldsProps = newCustomFieldProps;
197
+ }
198
+ getButtons(selected, extraButtons) {
199
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
200
+ .concat(extraButtons));
201
+ }
202
+ addConfigButton(buttons) {
203
+ if (this.configName === undefined) {
204
+ return buttons;
205
+ }
206
+ return buttons.concat(TaskbarElement.CONFIGURATOR);
207
+ }
208
+ get application() {
209
+ return ApplicationContext.getContextValue("__SNK__APPLICATION__");
54
210
  }
55
211
  resolveInMemoryBtns(taskbarButtons) {
56
212
  const newTaskBarConfig = [...taskbarButtons];
@@ -70,7 +226,10 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
70
226
  }
71
227
  actionClickListener(evt) {
72
228
  const act = evt.detail;
73
- if (act === TaskbarElement.GRID_MODE) {
229
+ if (act === TaskbarElement.CONFIGURATOR) {
230
+ this._snkConfigurator.open();
231
+ }
232
+ else if (act === TaskbarElement.GRID_MODE) {
74
233
  this.goToView(VIEW_MODE.GRID);
75
234
  }
76
235
  else if (act === TaskbarElement.FORM_MODE) {
@@ -78,43 +237,220 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
78
237
  }
79
238
  evt.stopPropagation();
80
239
  }
240
+ async onChangeEntityName(newValue) {
241
+ if (this.dataUnit)
242
+ return;
243
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
244
+ this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
245
+ }
81
246
  onModeChange() {
82
247
  if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
83
248
  this.initInMemoryDataUnit();
84
249
  }
85
250
  }
86
251
  observeDataState(newValue, oldValue) {
252
+ this.handleDataStateChange(newValue, oldValue);
253
+ }
254
+ async observeFormLegacy(newValue, oldValue) {
255
+ await this.handleUpdateFormLegacyConfig(newValue, oldValue);
256
+ }
257
+ async observeGridLegacy(newValue, oldValue) {
258
+ await this.handleUpdateGridLegacyConfig(newValue, oldValue);
259
+ }
260
+ async handleDataStateChange(newValue, oldValue) {
87
261
  if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
88
262
  this.dataStateChange.emit(newValue);
89
263
  }
264
+ await this.processRmPrecision();
265
+ }
266
+ async processRmPrecision() {
267
+ var _a, _b;
268
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
269
+ for (const field of fieldsWithRmPrecision || []) {
270
+ if (!field) {
271
+ continue;
272
+ }
273
+ 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);
274
+ if (!rmPrecision) {
275
+ continue;
276
+ }
277
+ await this.setFieldProp(field, 'precision', rmPrecision);
278
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
279
+ }
280
+ this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
281
+ }
282
+ async handleUpdateGridLegacyConfig(newValue, oldValue) {
283
+ if (newValue == undefined || newValue == oldValue) {
284
+ return;
285
+ }
286
+ if (!this._gridConfigAlreadyLoaded) {
287
+ return;
288
+ }
289
+ await this.loadGridConfig(true);
290
+ }
291
+ async handleUpdateFormLegacyConfig(newValue, oldValue) {
292
+ if (newValue == undefined || newValue == oldValue) {
293
+ return;
294
+ }
295
+ if (!this._formConfigAlreadyLoaded) {
296
+ return;
297
+ }
298
+ this.loadFormConfig(true);
299
+ }
300
+ openConfig(viewMode) {
301
+ this._snkConfigurator.close();
302
+ if (viewMode === VIEW_MODE.GRID) {
303
+ this.openGridConfig();
304
+ }
305
+ else if (viewMode === VIEW_MODE.FORM) {
306
+ this.openFormConfig();
307
+ }
308
+ }
309
+ openGridConfig() {
310
+ this._grid.getColumnsState()
311
+ .then((gridColumns) => {
312
+ this._snkGridConfig.columns = gridColumns.filter(c => c.name);
313
+ this._snkGridConfig.selectedIndex = 0;
314
+ this._showPopUpGridConfig = true;
315
+ });
316
+ }
317
+ async openFormConfig() {
318
+ var _a, _b;
319
+ //No momento não daremos suporte para configuraçao de formulário quando houver legacy config
320
+ if (this.formLegacyConfigName) {
321
+ const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
322
+ const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
323
+ await this.application.alert(title, message);
324
+ return;
325
+ }
326
+ this._showFormConfig = true;
90
327
  }
91
- componentWillRender() {
328
+ addGridLegacyConfigName() {
329
+ if (this.gridLegacyConfigName && this.configName) {
330
+ ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
331
+ }
332
+ }
333
+ loadGridConfig(forceUpdate) {
334
+ if (this.configName === undefined) {
335
+ return;
336
+ }
337
+ if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
338
+ return;
339
+ }
340
+ this.addGridLegacyConfigName();
341
+ this._gridConfigAlreadyLoaded = true;
342
+ return new Promise((accept, reject) => {
343
+ ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
344
+ .then(config => {
345
+ this.setGridConfig(config);
346
+ accept();
347
+ })
348
+ .catch(reason => {
349
+ reject(reason);
350
+ });
351
+ });
352
+ }
353
+ formConfigIsLoaded() {
354
+ return this.formConfig != undefined || this._formConfigAlreadyLoaded;
355
+ }
356
+ async loadFormConfig(forceLoad = false) {
357
+ if (this.configName === undefined) {
358
+ return;
359
+ }
360
+ if (this._formConfigManager == undefined) {
361
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
362
+ this._formConfigManager.setConfig(this.formConfig);
363
+ }
364
+ if (this.formConfigIsLoaded() && !forceLoad) {
365
+ return;
366
+ }
367
+ this._formConfigAlreadyLoaded = true;
368
+ let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
369
+ if (loadedLegacyConfig != undefined) {
370
+ this._formConfigManager.setConfig(loadedLegacyConfig);
371
+ this.setFormConfig(loadedLegacyConfig);
372
+ return;
373
+ }
374
+ this.setFormConfig(await this._formConfigManager.loadConfig());
375
+ }
376
+ async componentWillRender() {
377
+ this._resourceID = await this.application.getResourceID();
378
+ this.dataExporterProviderStore();
92
379
  this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
380
+ if (this.configName === undefined) {
381
+ return;
382
+ }
383
+ if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
384
+ return;
385
+ }
386
+ await this.addGridLegacyConfigName();
387
+ this.loadGridConfig();
388
+ this.loadFormConfig();
389
+ }
390
+ componentDidRender() {
391
+ this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
392
+ this.addGridCustomValueFormattters();
393
+ this.setFieldsProps();
394
+ this.setCustomRenders();
395
+ this.setCustomEditors();
93
396
  }
94
397
  componentWillLoad() {
95
398
  this.processMetadata();
96
399
  this.onModeChange();
97
400
  this.configDatasource();
401
+ this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
402
+ }
403
+ componentDidLoad() {
404
+ CSSVarsUtils.applyVarsGrid(this._element, this._grid);
405
+ }
406
+ setCustomRenders() {
407
+ if (!this._grid) {
408
+ return;
409
+ }
410
+ for (const [fieldName, customRender] of this._customRenders) {
411
+ this._grid.addGridCustomRender(fieldName, customRender);
412
+ this._customRenders.delete(fieldName);
413
+ }
414
+ }
415
+ setCustomEditors() {
416
+ if (!this._grid || !this._form) {
417
+ return;
418
+ }
419
+ for (const [fieldName, customEditor] of this._customEditors) {
420
+ this._grid.addCustomEditor(fieldName, customEditor);
421
+ this._form.addCustomEditor(fieldName, customEditor);
422
+ this._customEditors.delete(fieldName);
423
+ }
98
424
  }
99
425
  configDatasource() {
100
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
101
- this._multiSelectionListDataSource.setApplication(application);
426
+ this._multiSelectionListDataSource.setApplication(this.application);
102
427
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
103
428
  }
429
+ setFieldsProps() {
430
+ if (!this._form) {
431
+ return;
432
+ }
433
+ for (const [fieldName, props] of this._fieldsProps) {
434
+ for (const prop in props) {
435
+ this._form.setFieldProp(fieldName, prop, props[prop]);
436
+ }
437
+ this._fieldsProps.delete(fieldName);
438
+ }
439
+ }
104
440
  getTaskBarId() {
105
- var _a, _b, _c;
441
+ var _a, _b;
106
442
  if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
107
443
  return "snkSimpleCrudTaskbar.finish_edition";
108
444
  }
109
445
  if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
110
446
  !this.dataState.selectionInfo.isAllRecords() &&
111
- ((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
447
+ this.dataState.selectionInfo.length > 0) {
112
448
  return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
113
449
  }
114
450
  return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
115
451
  }
116
452
  initInMemoryDataUnit() {
117
- this._inMemoryLoader = new InMemoryLoader(this._metadata);
453
+ this._inMemoryLoader = new InMemoryLoader(this._metadata, undefined, { autoLoad: this.autoLoad });
118
454
  this.dataUnit = this._inMemoryLoader.dataUnit;
119
455
  this.dataUnitReady.emit(this.dataUnit);
120
456
  }
@@ -139,6 +475,26 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
139
475
  getRecords() {
140
476
  return Promise.resolve(this.dataUnit.records);
141
477
  }
478
+ /**
479
+ * Usado para abrir o configurator do CRUD
480
+ */
481
+ async openConfigurator() {
482
+ var _a;
483
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
484
+ }
485
+ /**
486
+ * Usado para fechar o configurator do CRUD
487
+ */
488
+ async closeConfigurator() {
489
+ var _a;
490
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
491
+ }
492
+ async updateConfig() {
493
+ if (this._formConfigManager == undefined) {
494
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
495
+ }
496
+ this._formConfigManager.setConfig(this.formConfig);
497
+ }
142
498
  processMetadata() {
143
499
  const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
144
500
  const fieldMetadata = [];
@@ -169,6 +525,23 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
169
525
  };
170
526
  }
171
527
  }
528
+ addGridCustomValueFormattters() {
529
+ var _a, _b, _c;
530
+ 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);
531
+ if (!metadataFields) {
532
+ return;
533
+ }
534
+ const fieldsWithRmPrecision = [];
535
+ metadataFields.forEach((field) => {
536
+ var _a;
537
+ if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
538
+ fieldsWithRmPrecision.push(field.name);
539
+ }
540
+ });
541
+ fieldsWithRmPrecision.forEach(field => {
542
+ this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
543
+ });
544
+ }
172
545
  onDataStateChange(evt) {
173
546
  this.dataState = Object.assign({}, evt.detail);
174
547
  }
@@ -193,6 +566,14 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
193
566
  this.dataUnit.clearSelection();
194
567
  }
195
568
  }
569
+ handleConfiguratorEvent(evt, type) {
570
+ evt.stopImmediatePropagation();
571
+ if (type === 'SAVE') {
572
+ this.configuratorSave.emit();
573
+ return;
574
+ }
575
+ this.configuratorCancel.emit();
576
+ }
196
577
  getColumnSearch(actionButton, item) {
197
578
  if (this._columnSearch != undefined) {
198
579
  return this._columnSearch;
@@ -234,7 +615,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
234
615
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
235
616
  }
236
617
  handleFormSetFields(fields) {
237
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
618
+ if (!ObjectUtils.equals(this._formFields, fields)) {
619
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
620
+ }
238
621
  }
239
622
  fieldsOptionLoader(argument) {
240
623
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -249,7 +632,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
249
632
  }
250
633
  getActionsList() {
251
634
  var _a, _b;
252
- return [{
635
+ const hardList = [{
253
636
  value: StringUtils.generateUUID(),
254
637
  label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
255
638
  disableCloseOnSelect: true,
@@ -258,6 +641,16 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
258
641
  ? this.getColumnSearch(actionButton, item)
259
642
  : this.getFieldSearch(actionButton, item)
260
643
  }];
644
+ if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
645
+ const taskbarID = this.getTopTaskBarId();
646
+ return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
647
+ }
648
+ return hardList.concat(this.actionsList);
649
+ }
650
+ getTopTaskBarId() {
651
+ var _a;
652
+ return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
653
+ `snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
261
654
  }
262
655
  async keyDownListener(event) {
263
656
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
@@ -296,43 +689,148 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
296
689
  disconnectedCallback() {
297
690
  window.removeEventListener("keydown", this._keyDownHandler);
298
691
  }
692
+ gridConfigChangeHandler(evt) {
693
+ const config = evt.detail;
694
+ ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
695
+ evt.stopPropagation();
696
+ }
697
+ modalConfigChangeHandler(evt) {
698
+ const config = evt.detail;
699
+ this._grid.setColumnsState(config.columns)
700
+ .then(() => {
701
+ this.setGridConfig(config);
702
+ this.closeGridConfig();
703
+ this.dataExporterProviderStore();
704
+ });
705
+ evt.stopPropagation();
706
+ }
707
+ async dataExporterProviderStore() {
708
+ if (this.dataUnit == undefined) {
709
+ return;
710
+ }
711
+ if (this._grid == undefined) {
712
+ return;
713
+ }
714
+ const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
715
+ store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
716
+ }
717
+ getDataExporterStoreKey() {
718
+ return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
719
+ }
720
+ setGridConfig(config) {
721
+ this.gridConfig = config;
722
+ CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
723
+ }
724
+ setFormConfig(config, forceUpdate) {
725
+ if (this.formConfig && !forceUpdate)
726
+ return;
727
+ this.formConfig = config;
728
+ }
729
+ closeGridConfig() {
730
+ this._showPopUpGridConfig = false;
731
+ }
732
+ closeFormConfig() {
733
+ this._showFormConfig = false;
734
+ }
735
+ getPageSize() {
736
+ if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
737
+ return 0;
738
+ }
739
+ if (this.pageSize == undefined) {
740
+ return 150;
741
+ }
742
+ return this.pageSize;
743
+ }
744
+ //No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
745
+ handleShowFormConfig() {
746
+ return this._showFormConfig && !this.formLegacyConfigName;
747
+ }
748
+ resolveResourceID() {
749
+ return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
750
+ }
751
+ getFormConfig() {
752
+ var _a, _b;
753
+ 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);
754
+ if (!this.configName && !configFromManager) {
755
+ return this.formConfig;
756
+ }
757
+ return configFromManager;
758
+ }
759
+ updateFormConfig() {
760
+ const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
761
+ this.setFormConfig(newConfig, true);
762
+ if (this._formConfigManager == undefined) {
763
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
764
+ }
765
+ this._formConfigManager.setConfig(this.formConfig);
766
+ }
767
+ /* istanbul ignore next */
299
768
  render() {
300
769
  var _a;
301
- 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 ez-margin-bottom--large", 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", { ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
770
+ if (this.dataUnit == undefined) {
771
+ return;
772
+ }
773
+ 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) }, 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, "data-exporter-store-key": this.getDataExporterStoreKey(), 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)
302
774
  ? undefined
303
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
775
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, 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() }))));
304
776
  }
305
777
  get _element() { return this; }
306
778
  static get watchers() { return {
779
+ "resourceID": ["handleResourceIDChanged"],
780
+ "entityName": ["onChangeEntityName"],
307
781
  "mode": ["onModeChange"],
308
- "dataState": ["observeDataState"]
782
+ "dataState": ["observeDataState"],
783
+ "formLegacyConfigName": ["observeFormLegacy"],
784
+ "gridLegacyConfigName": ["observeGridLegacy"]
309
785
  }; }
310
786
  static get style() { return snkSimpleCrudCss; }
311
787
  }, [6, "snk-simple-crud", {
312
788
  "dataState": [16],
313
789
  "dataUnit": [16],
790
+ "entityName": [1, "entity-name"],
314
791
  "mode": [2],
315
- "gridConfig": [16],
316
- "formConfig": [16],
792
+ "gridConfig": [1040],
793
+ "formConfig": [1040],
317
794
  "multipleSelection": [4, "multiple-selection"],
318
795
  "useCancelConfirm": [4, "use-cancel-confirm"],
796
+ "pageSize": [2, "page-size"],
797
+ "resourceID": [1, "resource-i-d"],
319
798
  "taskbarManager": [16],
320
799
  "messagesBuilder": [1040],
321
800
  "useEnterLikeTab": [4, "use-enter-like-tab"],
801
+ "actionsList": [16],
802
+ "configName": [1025, "config-name"],
803
+ "showConfiguratorButtons": [4, "show-configurator-buttons"],
804
+ "gridLegacyConfigName": [1, "grid-legacy-config-name"],
805
+ "formLegacyConfigName": [1, "form-legacy-config-name"],
806
+ "ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
807
+ "autoLoad": [4, "auto-load"],
808
+ "_showPopUpGridConfig": [32],
809
+ "_showFormConfig": [32],
322
810
  "_currentViewMode": [32],
323
811
  "_config": [32],
324
812
  "_fieldToGetFocus": [32],
813
+ "_customContainerId": [32],
325
814
  "_formFields": [32],
815
+ "_fieldsProps": [32],
816
+ "addCustomEditor": [64],
817
+ "addGridCustomRender": [64],
818
+ "addCustomValueFormatter": [64],
819
+ "removeCustomValueFormatter": [64],
820
+ "setFieldProp": [64],
326
821
  "goToView": [64],
327
822
  "setMetadata": [64],
328
823
  "setRecords": [64],
329
- "getRecords": [64]
824
+ "getRecords": [64],
825
+ "openConfigurator": [64],
826
+ "closeConfigurator": [64],
827
+ "updateConfig": [64]
330
828
  }, [[0, "actionClick", "actionClickListener"]]]);
331
829
  function defineCustomElement() {
332
830
  if (typeof customElements === "undefined") {
333
831
  return;
334
832
  }
335
- const components = ["snk-simple-crud", "snk-actions-button", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-taskbar", "taskbar-actions-button"];
833
+ const components = ["snk-simple-crud", "snk-actions-button", "snk-config-options", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-field-config", "snk-form-config", "snk-grid-config", "snk-select-box", "snk-tab-config", "snk-taskbar", "taskbar-actions-button"];
336
834
  components.forEach(tagName => { switch (tagName) {
337
835
  case "snk-simple-crud":
338
836
  if (!customElements.get(tagName)) {
@@ -341,20 +839,55 @@ function defineCustomElement() {
341
839
  break;
342
840
  case "snk-actions-button":
343
841
  if (!customElements.get(tagName)) {
344
- defineCustomElement$6();
842
+ defineCustomElement$d();
843
+ }
844
+ break;
845
+ case "snk-config-options":
846
+ if (!customElements.get(tagName)) {
847
+ defineCustomElement$c();
848
+ }
849
+ break;
850
+ case "snk-configurator":
851
+ if (!customElements.get(tagName)) {
852
+ defineCustomElement$b();
345
853
  }
346
854
  break;
347
855
  case "snk-data-exporter":
348
856
  if (!customElements.get(tagName)) {
349
- defineCustomElement$5();
857
+ defineCustomElement$a();
350
858
  }
351
859
  break;
352
860
  case "snk-data-unit":
353
861
  if (!customElements.get(tagName)) {
354
- defineCustomElement$4();
862
+ defineCustomElement$9();
355
863
  }
356
864
  break;
357
865
  case "snk-exporter-email-sender":
866
+ if (!customElements.get(tagName)) {
867
+ defineCustomElement$8();
868
+ }
869
+ break;
870
+ case "snk-field-config":
871
+ if (!customElements.get(tagName)) {
872
+ defineCustomElement$7();
873
+ }
874
+ break;
875
+ case "snk-form-config":
876
+ if (!customElements.get(tagName)) {
877
+ defineCustomElement$6();
878
+ }
879
+ break;
880
+ case "snk-grid-config":
881
+ if (!customElements.get(tagName)) {
882
+ defineCustomElement$5();
883
+ }
884
+ break;
885
+ case "snk-select-box":
886
+ if (!customElements.get(tagName)) {
887
+ defineCustomElement$4();
888
+ }
889
+ break;
890
+ case "snk-tab-config":
358
891
  if (!customElements.get(tagName)) {
359
892
  defineCustomElement$3();
360
893
  }