@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,26 +1,88 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
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 { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
4
- import { T as TaskbarElement } from './taskbar-elements-d4d0b424.js';
5
- import './DataFetcher-aa159c5a.js';
6
- import './pesquisa-fetcher-dd3ca0a5.js';
7
- import { P as PresentationMode } from './index-0ece87a6.js';
8
- import './ISave-4412b20c.js';
5
+ import { T as TaskbarElement } from './taskbar-elements-ad766858.js';
6
+ import './DataFetcher-4b4b7beb.js';
7
+ import './pesquisa-fetcher-9cfab836.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-ce2ca127.js';
9
+ import { D as DataExporterOption, P as PresentationMode } from './index-0ece87a6.js';
10
+ import './ISave-d8c8bc59.js';
9
11
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import { I as InMemoryLoader } from './dataunit-fetcher-cbec1594.js';
12
- import './PreloadManager-c1c2f2b4.js';
13
+ import { I as InMemoryLoader } from './dataunit-fetcher-f3fa35b9.js';
13
14
  import './filter-item-type.enum-d45e026f.js';
14
- import './form-config-fetcher-36219cd3.js';
15
+ import { F as FormConfigFetcher } from './form-config-fetcher-5d72aaf1.js';
15
16
  import { T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search-efbe307f.js';
16
- import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-44494b0e.js';
17
- import './index-bdf75557.js';
17
+ import { C as ConfigStorage } from './ConfigStorage-174101b9.js';
18
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-3bdb3e1f.js';
19
+ import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
20
+ import { s as store } from './index-bdf75557.js';
18
21
  import './PrintUtils-3e4ff0f5.js';
19
- import './ResourceIDUtils-a114189a.js';
20
- import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
21
22
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
23
+ import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
24
+ import '@sankhyalabs/core/dist/utils/SortingUtils';
25
+ import './ResourceIDUtils-a114189a.js';
26
+
27
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
28
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
29
+
30
+ class ClientSideExporterProvider extends CommonsExporter {
31
+ getSelectedNumber() {
32
+ return this.dataUnit.getSelectionInfo().length;
33
+ }
34
+ getTotalRecords() {
35
+ var _a, _b, _c;
36
+ const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
37
+ 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;
38
+ }
39
+ getSelectedIDs() {
40
+ return getSelectedIDs(this.dataUnit);
41
+ }
42
+ getRecordID() {
43
+ var _a, _b, _c;
44
+ 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__;
45
+ }
46
+ async getRecords() {
47
+ if (this.dataUnit.records.length === 0) {
48
+ return Promise.resolve([]);
49
+ }
50
+ const selectionInfo = this.dataUnit.getSelectionInfo();
51
+ const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
52
+ return Promise.resolve(records == undefined ? [] : records);
53
+ }
54
+ getHiddenOptions() {
55
+ return [
56
+ DataExporterOption.EXPORT_BY_EMAIL,
57
+ DataExporterOption.EXPORT_PDF_TO_EMAIL,
58
+ DataExporterOption.EXPORT_XLS_TO_EMAIL,
59
+ DataExporterOption.EXPORT_PAGE_TO_PDF,
60
+ DataExporterOption.EXPORT_PAGE_TO_XLS
61
+ ];
62
+ }
63
+ formatValue(record, column) {
64
+ const { id, descriptionFrom } = column;
65
+ const value = record[descriptionFrom || id];
66
+ if (value == undefined) {
67
+ return "";
68
+ }
69
+ if (descriptionFrom != undefined) {
70
+ return value.label;
71
+ }
72
+ const fieldDescriptor = this.dataUnit.getField(id);
73
+ if (fieldDescriptor.userInterface === UserInterface.SEARCH) {
74
+ return value.value;
75
+ }
76
+ if (column.customFormatter) {
77
+ const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
78
+ const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
79
+ return formattedValue;
80
+ }
81
+ return this.dataUnit.getFormattedValue(id, value);
82
+ }
83
+ }
22
84
 
23
- 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}";
85
+ 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}";
24
86
 
25
87
  const SnkSimpleCrud = class {
26
88
  constructor(hostRef) {
@@ -29,31 +91,117 @@ const SnkSimpleCrud = class {
29
91
  this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
30
92
  this.actionClick = createEvent(this, "actionClick", 7);
31
93
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
32
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
33
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
94
+ this.configuratorSave = createEvent(this, "configuratorSave", 7);
95
+ this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
34
96
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
35
97
  this._keyDownHandler = (event) => this.keyDownListener(event);
98
+ this._formConfigFetcher = new FormConfigFetcher();
99
+ this._customEditors = new Map();
100
+ this._customRenders = new Map();
36
101
  this._taskbarProcessor = new TaskbarProcessor({
37
- "snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
38
- "snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
39
- "snkSimpleCrudTaskbar.form_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(TaskbarElement.GRID_MODE),
40
- "snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(TaskbarElement.FORM_MODE),
102
+ "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
103
+ "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
104
+ "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
105
+ "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
41
106
  "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
42
107
  });
108
+ this._showPopUpGridConfig = false;
109
+ this._showFormConfig = false;
43
110
  this._currentViewMode = VIEW_MODE.GRID;
44
111
  this._config = undefined;
45
112
  this._fieldToGetFocus = undefined;
113
+ this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
46
114
  this.dataState = undefined;
47
115
  this.dataUnit = undefined;
116
+ this.entityName = undefined;
48
117
  this.mode = SIMPLE_CRUD_MODE.SERVER;
49
118
  this.gridConfig = undefined;
50
119
  this.formConfig = undefined;
51
120
  this._formFields = [];
121
+ this._fieldsProps = new Map();
52
122
  this.multipleSelection = undefined;
53
123
  this.useCancelConfirm = true;
124
+ this.pageSize = 150;
125
+ this.resourceID = undefined;
54
126
  this.taskbarManager = undefined;
55
127
  this.messagesBuilder = undefined;
56
128
  this.useEnterLikeTab = false;
129
+ this.actionsList = undefined;
130
+ this.configName = undefined;
131
+ this.showConfiguratorButtons = undefined;
132
+ this.gridLegacyConfigName = undefined;
133
+ this.formLegacyConfigName = undefined;
134
+ this.ignoreReadOnlyFormFields = false;
135
+ this.autoLoad = undefined;
136
+ }
137
+ /**
138
+ * Registra um editor customizado para campos da grade e formulário.
139
+ */
140
+ async addCustomEditor(fieldName, customEditor) {
141
+ if (this._grid && this._form) {
142
+ this._grid.addCustomEditor(fieldName, customEditor);
143
+ this._form.addCustomEditor(fieldName, customEditor);
144
+ return;
145
+ }
146
+ const newCustomEditors = new Map(this._customEditors);
147
+ newCustomEditors.set(fieldName, customEditor);
148
+ this._customEditors = newCustomEditors;
149
+ }
150
+ /**
151
+ * Registra um render customizado para colunas da grid.
152
+ */
153
+ async addGridCustomRender(fieldName, customRender) {
154
+ if (this._grid) {
155
+ this._grid.addGridCustomRender(fieldName, customRender);
156
+ return;
157
+ }
158
+ const newCustomRenders = new Map(this._customRenders);
159
+ newCustomRenders.set(fieldName, customRender);
160
+ this._customRenders = newCustomRenders;
161
+ }
162
+ handleResourceIDChanged(newValue, oldValue) {
163
+ if (StringUtils.isEmpty(newValue)) {
164
+ return;
165
+ }
166
+ if (newValue === oldValue) {
167
+ return;
168
+ }
169
+ this.loadFormConfig(true);
170
+ this.loadGridConfig(true);
171
+ }
172
+ /**
173
+ * Registra um formatador de valores para uma coluna da grid.
174
+ */
175
+ async addCustomValueFormatter(columnName, customFormatter) {
176
+ this._grid.addCustomValueFormatter(columnName, customFormatter);
177
+ }
178
+ /**
179
+ * Remove o formatador de valores de uma coluna da grid.
180
+ */
181
+ async removeCustomValueFormatter(columnName) {
182
+ this._grid.removeCustomValueFormatter(columnName);
183
+ }
184
+ /**
185
+ * Altera/adiciona uma propriedade nos metadados do campo.
186
+ */
187
+ async setFieldProp(fieldName, propName, value) {
188
+ const newCustomFieldProps = new Map(this._fieldsProps);
189
+ const currentProps = this._fieldsProps.get(fieldName);
190
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
191
+ this._fieldsProps = newCustomFieldProps;
192
+ }
193
+ getButtons(selected, extraButtons) {
194
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
195
+ .concat(extraButtons));
196
+ }
197
+ addConfigButton(buttons) {
198
+ if (this.configName === undefined) {
199
+ return buttons;
200
+ }
201
+ return buttons.concat(TaskbarElement.CONFIGURATOR);
202
+ }
203
+ get application() {
204
+ return ApplicationContext.getContextValue("__SNK__APPLICATION__");
57
205
  }
58
206
  resolveInMemoryBtns(taskbarButtons) {
59
207
  const newTaskBarConfig = [...taskbarButtons];
@@ -73,7 +221,10 @@ const SnkSimpleCrud = class {
73
221
  }
74
222
  actionClickListener(evt) {
75
223
  const act = evt.detail;
76
- if (act === TaskbarElement.GRID_MODE) {
224
+ if (act === TaskbarElement.CONFIGURATOR) {
225
+ this._snkConfigurator.open();
226
+ }
227
+ else if (act === TaskbarElement.GRID_MODE) {
77
228
  this.goToView(VIEW_MODE.GRID);
78
229
  }
79
230
  else if (act === TaskbarElement.FORM_MODE) {
@@ -81,43 +232,220 @@ const SnkSimpleCrud = class {
81
232
  }
82
233
  evt.stopPropagation();
83
234
  }
235
+ async onChangeEntityName(newValue) {
236
+ if (this.dataUnit)
237
+ return;
238
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
239
+ this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
240
+ }
84
241
  onModeChange() {
85
242
  if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
86
243
  this.initInMemoryDataUnit();
87
244
  }
88
245
  }
89
246
  observeDataState(newValue, oldValue) {
247
+ this.handleDataStateChange(newValue, oldValue);
248
+ }
249
+ async observeFormLegacy(newValue, oldValue) {
250
+ await this.handleUpdateFormLegacyConfig(newValue, oldValue);
251
+ }
252
+ async observeGridLegacy(newValue, oldValue) {
253
+ await this.handleUpdateGridLegacyConfig(newValue, oldValue);
254
+ }
255
+ async handleDataStateChange(newValue, oldValue) {
90
256
  if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
91
257
  this.dataStateChange.emit(newValue);
92
258
  }
259
+ await this.processRmPrecision();
260
+ }
261
+ async processRmPrecision() {
262
+ var _a, _b;
263
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
264
+ for (const field of fieldsWithRmPrecision || []) {
265
+ if (!field) {
266
+ continue;
267
+ }
268
+ 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);
269
+ if (!rmPrecision) {
270
+ continue;
271
+ }
272
+ await this.setFieldProp(field, 'precision', rmPrecision);
273
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
274
+ }
275
+ this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
276
+ }
277
+ async handleUpdateGridLegacyConfig(newValue, oldValue) {
278
+ if (newValue == undefined || newValue == oldValue) {
279
+ return;
280
+ }
281
+ if (!this._gridConfigAlreadyLoaded) {
282
+ return;
283
+ }
284
+ await this.loadGridConfig(true);
285
+ }
286
+ async handleUpdateFormLegacyConfig(newValue, oldValue) {
287
+ if (newValue == undefined || newValue == oldValue) {
288
+ return;
289
+ }
290
+ if (!this._formConfigAlreadyLoaded) {
291
+ return;
292
+ }
293
+ this.loadFormConfig(true);
294
+ }
295
+ openConfig(viewMode) {
296
+ this._snkConfigurator.close();
297
+ if (viewMode === VIEW_MODE.GRID) {
298
+ this.openGridConfig();
299
+ }
300
+ else if (viewMode === VIEW_MODE.FORM) {
301
+ this.openFormConfig();
302
+ }
303
+ }
304
+ openGridConfig() {
305
+ this._grid.getColumnsState()
306
+ .then((gridColumns) => {
307
+ this._snkGridConfig.columns = gridColumns.filter(c => c.name);
308
+ this._snkGridConfig.selectedIndex = 0;
309
+ this._showPopUpGridConfig = true;
310
+ });
311
+ }
312
+ async openFormConfig() {
313
+ var _a, _b;
314
+ //No momento não daremos suporte para configuraçao de formulário quando houver legacy config
315
+ if (this.formLegacyConfigName) {
316
+ const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
317
+ const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
318
+ await this.application.alert(title, message);
319
+ return;
320
+ }
321
+ this._showFormConfig = true;
322
+ }
323
+ addGridLegacyConfigName() {
324
+ if (this.gridLegacyConfigName && this.configName) {
325
+ ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
326
+ }
327
+ }
328
+ loadGridConfig(forceUpdate) {
329
+ if (this.configName === undefined) {
330
+ return;
331
+ }
332
+ if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
333
+ return;
334
+ }
335
+ this.addGridLegacyConfigName();
336
+ this._gridConfigAlreadyLoaded = true;
337
+ return new Promise((accept, reject) => {
338
+ ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
339
+ .then(config => {
340
+ this.setGridConfig(config);
341
+ accept();
342
+ })
343
+ .catch(reason => {
344
+ reject(reason);
345
+ });
346
+ });
347
+ }
348
+ formConfigIsLoaded() {
349
+ return this.formConfig != undefined || this._formConfigAlreadyLoaded;
93
350
  }
94
- componentWillRender() {
351
+ async loadFormConfig(forceLoad = false) {
352
+ if (this.configName === undefined) {
353
+ return;
354
+ }
355
+ if (this._formConfigManager == undefined) {
356
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
357
+ this._formConfigManager.setConfig(this.formConfig);
358
+ }
359
+ if (this.formConfigIsLoaded() && !forceLoad) {
360
+ return;
361
+ }
362
+ this._formConfigAlreadyLoaded = true;
363
+ let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
364
+ if (loadedLegacyConfig != undefined) {
365
+ this._formConfigManager.setConfig(loadedLegacyConfig);
366
+ this.setFormConfig(loadedLegacyConfig);
367
+ return;
368
+ }
369
+ this.setFormConfig(await this._formConfigManager.loadConfig());
370
+ }
371
+ async componentWillRender() {
372
+ this._resourceID = await this.application.getResourceID();
373
+ this.dataExporterProviderStore();
95
374
  this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
375
+ if (this.configName === undefined) {
376
+ return;
377
+ }
378
+ if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
379
+ return;
380
+ }
381
+ await this.addGridLegacyConfigName();
382
+ this.loadGridConfig();
383
+ this.loadFormConfig();
384
+ }
385
+ componentDidRender() {
386
+ this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
387
+ this.addGridCustomValueFormattters();
388
+ this.setFieldsProps();
389
+ this.setCustomRenders();
390
+ this.setCustomEditors();
96
391
  }
97
392
  componentWillLoad() {
98
393
  this.processMetadata();
99
394
  this.onModeChange();
100
395
  this.configDatasource();
396
+ this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
397
+ }
398
+ componentDidLoad() {
399
+ CSSVarsUtils.applyVarsGrid(this._element, this._grid);
400
+ }
401
+ setCustomRenders() {
402
+ if (!this._grid) {
403
+ return;
404
+ }
405
+ for (const [fieldName, customRender] of this._customRenders) {
406
+ this._grid.addGridCustomRender(fieldName, customRender);
407
+ this._customRenders.delete(fieldName);
408
+ }
409
+ }
410
+ setCustomEditors() {
411
+ if (!this._grid || !this._form) {
412
+ return;
413
+ }
414
+ for (const [fieldName, customEditor] of this._customEditors) {
415
+ this._grid.addCustomEditor(fieldName, customEditor);
416
+ this._form.addCustomEditor(fieldName, customEditor);
417
+ this._customEditors.delete(fieldName);
418
+ }
101
419
  }
102
420
  configDatasource() {
103
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
104
- this._multiSelectionListDataSource.setApplication(application);
421
+ this._multiSelectionListDataSource.setApplication(this.application);
105
422
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
106
423
  }
424
+ setFieldsProps() {
425
+ if (!this._form) {
426
+ return;
427
+ }
428
+ for (const [fieldName, props] of this._fieldsProps) {
429
+ for (const prop in props) {
430
+ this._form.setFieldProp(fieldName, prop, props[prop]);
431
+ }
432
+ this._fieldsProps.delete(fieldName);
433
+ }
434
+ }
107
435
  getTaskBarId() {
108
- var _a, _b, _c;
436
+ var _a, _b;
109
437
  if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
110
438
  return "snkSimpleCrudTaskbar.finish_edition";
111
439
  }
112
440
  if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
113
441
  !this.dataState.selectionInfo.isAllRecords() &&
114
- ((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
442
+ this.dataState.selectionInfo.length > 0) {
115
443
  return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
116
444
  }
117
445
  return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
118
446
  }
119
447
  initInMemoryDataUnit() {
120
- this._inMemoryLoader = new InMemoryLoader(this._metadata);
448
+ this._inMemoryLoader = new InMemoryLoader(this._metadata, undefined, { autoLoad: this.autoLoad });
121
449
  this.dataUnit = this._inMemoryLoader.dataUnit;
122
450
  this.dataUnitReady.emit(this.dataUnit);
123
451
  }
@@ -142,6 +470,26 @@ const SnkSimpleCrud = class {
142
470
  getRecords() {
143
471
  return Promise.resolve(this.dataUnit.records);
144
472
  }
473
+ /**
474
+ * Usado para abrir o configurator do CRUD
475
+ */
476
+ async openConfigurator() {
477
+ var _a;
478
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
479
+ }
480
+ /**
481
+ * Usado para fechar o configurator do CRUD
482
+ */
483
+ async closeConfigurator() {
484
+ var _a;
485
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
486
+ }
487
+ async updateConfig() {
488
+ if (this._formConfigManager == undefined) {
489
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
490
+ }
491
+ this._formConfigManager.setConfig(this.formConfig);
492
+ }
145
493
  processMetadata() {
146
494
  const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
147
495
  const fieldMetadata = [];
@@ -172,6 +520,23 @@ const SnkSimpleCrud = class {
172
520
  };
173
521
  }
174
522
  }
523
+ addGridCustomValueFormattters() {
524
+ var _a, _b, _c;
525
+ 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);
526
+ if (!metadataFields) {
527
+ return;
528
+ }
529
+ const fieldsWithRmPrecision = [];
530
+ metadataFields.forEach((field) => {
531
+ var _a;
532
+ if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
533
+ fieldsWithRmPrecision.push(field.name);
534
+ }
535
+ });
536
+ fieldsWithRmPrecision.forEach(field => {
537
+ this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
538
+ });
539
+ }
175
540
  onDataStateChange(evt) {
176
541
  this.dataState = Object.assign({}, evt.detail);
177
542
  }
@@ -196,6 +561,14 @@ const SnkSimpleCrud = class {
196
561
  this.dataUnit.clearSelection();
197
562
  }
198
563
  }
564
+ handleConfiguratorEvent(evt, type) {
565
+ evt.stopImmediatePropagation();
566
+ if (type === 'SAVE') {
567
+ this.configuratorSave.emit();
568
+ return;
569
+ }
570
+ this.configuratorCancel.emit();
571
+ }
199
572
  getColumnSearch(actionButton, item) {
200
573
  if (this._columnSearch != undefined) {
201
574
  return this._columnSearch;
@@ -237,7 +610,9 @@ const SnkSimpleCrud = class {
237
610
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
238
611
  }
239
612
  handleFormSetFields(fields) {
240
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
613
+ if (!ObjectUtils.equals(this._formFields, fields)) {
614
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
615
+ }
241
616
  }
242
617
  fieldsOptionLoader(argument) {
243
618
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -252,7 +627,7 @@ const SnkSimpleCrud = class {
252
627
  }
253
628
  getActionsList() {
254
629
  var _a, _b;
255
- return [{
630
+ const hardList = [{
256
631
  value: StringUtils.generateUUID(),
257
632
  label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
258
633
  disableCloseOnSelect: true,
@@ -261,6 +636,16 @@ const SnkSimpleCrud = class {
261
636
  ? this.getColumnSearch(actionButton, item)
262
637
  : this.getFieldSearch(actionButton, item)
263
638
  }];
639
+ if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
640
+ const taskbarID = this.getTopTaskBarId();
641
+ return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
642
+ }
643
+ return hardList.concat(this.actionsList);
644
+ }
645
+ getTopTaskBarId() {
646
+ var _a;
647
+ return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
648
+ `snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
264
649
  }
265
650
  async keyDownListener(event) {
266
651
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
@@ -299,16 +684,99 @@ const SnkSimpleCrud = class {
299
684
  disconnectedCallback() {
300
685
  window.removeEventListener("keydown", this._keyDownHandler);
301
686
  }
687
+ gridConfigChangeHandler(evt) {
688
+ const config = evt.detail;
689
+ ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
690
+ evt.stopPropagation();
691
+ }
692
+ modalConfigChangeHandler(evt) {
693
+ const config = evt.detail;
694
+ this._grid.setColumnsState(config.columns)
695
+ .then(() => {
696
+ this.setGridConfig(config);
697
+ this.closeGridConfig();
698
+ this.dataExporterProviderStore();
699
+ });
700
+ evt.stopPropagation();
701
+ }
702
+ async dataExporterProviderStore() {
703
+ if (this.dataUnit == undefined) {
704
+ return;
705
+ }
706
+ if (this._grid == undefined) {
707
+ return;
708
+ }
709
+ const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
710
+ store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
711
+ }
712
+ getDataExporterStoreKey() {
713
+ return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
714
+ }
715
+ setGridConfig(config) {
716
+ this.gridConfig = config;
717
+ CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
718
+ }
719
+ setFormConfig(config, forceUpdate) {
720
+ if (this.formConfig && !forceUpdate)
721
+ return;
722
+ this.formConfig = config;
723
+ }
724
+ closeGridConfig() {
725
+ this._showPopUpGridConfig = false;
726
+ }
727
+ closeFormConfig() {
728
+ this._showFormConfig = false;
729
+ }
730
+ getPageSize() {
731
+ if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
732
+ return 0;
733
+ }
734
+ if (this.pageSize == undefined) {
735
+ return 150;
736
+ }
737
+ return this.pageSize;
738
+ }
739
+ //No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
740
+ handleShowFormConfig() {
741
+ return this._showFormConfig && !this.formLegacyConfigName;
742
+ }
743
+ resolveResourceID() {
744
+ return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
745
+ }
746
+ getFormConfig() {
747
+ var _a, _b;
748
+ 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);
749
+ if (!this.configName && !configFromManager) {
750
+ return this.formConfig;
751
+ }
752
+ return configFromManager;
753
+ }
754
+ updateFormConfig() {
755
+ const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
756
+ this.setFormConfig(newConfig, true);
757
+ if (this._formConfigManager == undefined) {
758
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
759
+ }
760
+ this._formConfigManager.setConfig(this.formConfig);
761
+ }
762
+ /* istanbul ignore next */
302
763
  render() {
303
764
  var _a;
304
- 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)
765
+ if (this.dataUnit == undefined) {
766
+ return;
767
+ }
768
+ 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)
305
769
  ? undefined
306
- : 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) }))))));
770
+ : 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() }))));
307
771
  }
308
772
  get _element() { return getElement(this); }
309
773
  static get watchers() { return {
774
+ "resourceID": ["handleResourceIDChanged"],
775
+ "entityName": ["onChangeEntityName"],
310
776
  "mode": ["onModeChange"],
311
- "dataState": ["observeDataState"]
777
+ "dataState": ["observeDataState"],
778
+ "formLegacyConfigName": ["observeFormLegacy"],
779
+ "gridLegacyConfigName": ["observeGridLegacy"]
312
780
  }; }
313
781
  };
314
782
  SnkSimpleCrud.style = snkSimpleCrudCss;