@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
@@ -4,23 +4,23 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-01b85b99.js');
8
- require('./DataFetcher-ba94ed5b.js');
9
- require('./pesquisa-fetcher-ef050a47.js');
7
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
8
+ require('./DataFetcher-515bda03.js');
9
+ require('./pesquisa-fetcher-916a935c.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
- require('./ISave-d68ce3cd.js');
11
+ require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./dataunit-fetcher-14108bec.js');
15
- require('./PreloadManager-84466da6.js');
14
+ require('./dataunit-fetcher-7a08e4dd.js');
16
15
  require('./filter-item-type.enum-a7ffdaa6.js');
17
- require('./form-config-fetcher-df043d3d.js');
16
+ require('./form-config-fetcher-3f430aee.js');
18
17
  const constants = require('./constants-35ddd366.js');
19
- const authFetcher = require('./auth-fetcher-c8467c07.js');
18
+ const authFetcher = require('./auth-fetcher-5acb0335.js');
20
19
  require('./index-102ba62d.js');
21
20
  require('./PrintUtils-bcaeb82f.js');
22
- require('./ResourceIDUtils-5ff86aa7.js');
23
21
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
22
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
23
+ require('./ResourceIDUtils-5ff86aa7.js');
24
24
 
25
25
  const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
26
26
 
@@ -33,6 +33,8 @@ const SnkCrud = class {
33
33
  this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
34
34
  this._keyDownHandler = async (event) => this.keyDownListener(event);
35
35
  this._viewHistory = [];
36
+ this._customEditors = new Map();
37
+ this._customRenders = new Map();
36
38
  this._dataUnit = undefined;
37
39
  this._dataState = undefined;
38
40
  this.attachmentRegisterKey = undefined;
@@ -40,6 +42,7 @@ const SnkCrud = class {
40
42
  this._canEdit = undefined;
41
43
  this._resourceID = undefined;
42
44
  this.configName = undefined;
45
+ this.filterBarTitle = undefined;
43
46
  this.selectionToastConfig = undefined;
44
47
  this.showActionButtons = false;
45
48
  this.actionsList = undefined;
@@ -50,6 +53,11 @@ const SnkCrud = class {
50
53
  this.presentationMode = index$1.PresentationMode.PRIMARY;
51
54
  this.messagesBuilder = undefined;
52
55
  this.useEnterLikeTab = false;
56
+ this.gridLegacyConfigName = undefined;
57
+ this.filterBarLegacyConfigName = undefined;
58
+ this.formLegacyConfigName = undefined;
59
+ this.disablePersonalizedFilter = undefined;
60
+ this.autoLoad = undefined;
53
61
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
54
62
  }
55
63
  /**
@@ -85,6 +93,49 @@ const SnkCrud = class {
85
93
  async getFilterBar() {
86
94
  return await this._snkGrid.getFilterBar();
87
95
  }
96
+ /**
97
+ * Registra um editor customizado para campos da grade e formulário.
98
+ */
99
+ async addCustomEditor(fieldName, customEditor) {
100
+ if (this._guidesViewer && this._snkGrid) {
101
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
102
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
103
+ return;
104
+ }
105
+ const newCustomEditors = new Map(this._customEditors);
106
+ newCustomEditors.set(fieldName, customEditor);
107
+ this._customEditors = newCustomEditors;
108
+ }
109
+ /**
110
+ * Registra um render customizado para colunas da grid.
111
+ */
112
+ async addGridCustomRender(fieldName, customRender) {
113
+ if (this._snkGrid) {
114
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
115
+ return;
116
+ }
117
+ const newCustomRenders = new Map(this._customRenders);
118
+ newCustomRenders.set(fieldName, customRender);
119
+ this._customRenders = newCustomRenders;
120
+ }
121
+ /**
122
+ * Registra um formatador de valores para uma coluna da grid.
123
+ */
124
+ async addCustomValueFormatter(columnName, customFormatter) {
125
+ this._snkGrid.addCustomValueFormatter(columnName, customFormatter);
126
+ }
127
+ /**
128
+ * Remove o formatador de valores de uma coluna da grid.
129
+ */
130
+ async removeCustomValueFormatter(columnName) {
131
+ this._snkGrid.removeCustomValueFormatter(columnName);
132
+ }
133
+ /**
134
+ * Altera/adiciona uma propriedade nos metadados do campo.
135
+ */
136
+ async setFieldProp(fieldName, propName, value) {
137
+ await this._guidesViewer.setFieldProp(fieldName, propName, value);
138
+ }
88
139
  currentViewModeWatcher(currentView) {
89
140
  this._viewHistory = [...this._viewHistory.slice(-1), currentView];
90
141
  }
@@ -109,6 +160,12 @@ const SnkCrud = class {
109
160
  setViewMode(viewMode) {
110
161
  this._viewStack.show(viewMode);
111
162
  this._currentViewMode = viewMode;
163
+ if (viewMode === constants.VIEW_MODE.GRID) {
164
+ this._snkGrid.setFocus();
165
+ }
166
+ else if (viewMode === constants.VIEW_MODE.FORM) {
167
+ this._guidesViewer.setFocus();
168
+ }
112
169
  }
113
170
  openConfig(viewMode) {
114
171
  this._snkConfigurator.close();
@@ -138,6 +195,29 @@ const SnkCrud = class {
138
195
  const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
139
196
  return joinedPrimaryKeys;
140
197
  }
198
+ setCustomRenders() {
199
+ if (!this._snkGrid) {
200
+ return;
201
+ }
202
+ for (const [fieldName, customRender] of this._customRenders) {
203
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
204
+ this._customRenders.delete(fieldName);
205
+ }
206
+ }
207
+ setCustomEditors() {
208
+ if (!this._snkGrid || !this._guidesViewer) {
209
+ return;
210
+ }
211
+ for (const [fieldName, customEditor] of this._customEditors) {
212
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
213
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
214
+ this._customEditors.delete(fieldName);
215
+ }
216
+ }
217
+ componentDidRender() {
218
+ this.setCustomRenders();
219
+ this.setCustomEditors();
220
+ }
141
221
  componentWillLoad() {
142
222
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
143
223
  let parent = this._element.parentElement;
@@ -160,12 +240,7 @@ const SnkCrud = class {
160
240
  else {
161
241
  this.initDataUnit();
162
242
  }
163
- this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
164
- this._dataState = dataState;
165
- if (dataState.selectedRecord !== undefined) {
166
- this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
167
- }
168
- });
243
+ this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
169
244
  break;
170
245
  }
171
246
  parent = parent.parentElement;
@@ -181,8 +256,28 @@ const SnkCrud = class {
181
256
  this.removeShortcuts();
182
257
  window.removeEventListener("keydown", this._keyDownHandler);
183
258
  }
259
+ async handleDataStateChange(evt) {
260
+ var _a;
261
+ this._dataState = evt.detail;
262
+ if (this._dataState.selectedRecord !== undefined) {
263
+ this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
264
+ }
265
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
266
+ for (const field of fieldsWithRmPrecision || []) {
267
+ if (!field) {
268
+ continue;
269
+ }
270
+ const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
271
+ if (!rmPrecision) {
272
+ continue;
273
+ }
274
+ await this.setFieldProp(field, 'precision', rmPrecision);
275
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
276
+ }
277
+ }
184
278
  async initKeyboardManager() {
185
- const keyboardManager = await this._application.getKeyboardManager();
279
+ var _a;
280
+ const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
186
281
  if (keyboardManager) {
187
282
  const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
188
283
  async function saveDataUnitHandlingFocus() {
@@ -199,39 +294,40 @@ const SnkCrud = class {
199
294
  element.focus();
200
295
  }
201
296
  keyboardManager
202
- .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade." })
203
- .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados." })
204
- .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados." })
205
- .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro." })
206
- .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado." })
207
- .bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado." })
297
+ .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
298
+ .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
299
+ .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
300
+ .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
301
+ .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
302
+ .bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
208
303
  .bind("ctrl + .", () => {
209
304
  if (dataUnit.getSelectionInfo().records.length === 0) {
210
305
  return dataUnit.selectFirst();
211
306
  }
212
307
  return dataUnit.nextRecord();
213
308
  }, {
214
- description: "Avança para o próximo registro."
309
+ description: "Avança para o próximo registro.", element: this._element
215
310
  })
216
- .bind("ctrl + ,", dataUnit.previousRecord.bind(dataUnit), { description: "Retorna ao registro anterior." })
311
+ .bind("ctrl + ,", dataUnit.previousRecord.bind(dataUnit), { description: "Retorna ao registro anterior.", element: this._element })
217
312
  .bind("F5", async () => {
218
313
  const currentView = await this._viewStack.getSelectedIndex();
219
314
  if (constants.VIEW_MODE.GRID === currentView) {
220
315
  dataUnit.loadData();
221
316
  }
222
- }, { description: "Atualiza os dados." })
317
+ }, { description: "Atualiza os dados.", element: this._element })
223
318
  .bind("Escape", () => {
224
319
  if (dataUnit.isDirty()) {
225
320
  dataUnit.cancelEdition();
226
321
  }
227
322
  }, {
228
323
  debounceTime: 1000,
229
- description: "Cancela uma ação."
324
+ description: "Cancela uma ação.", element: this._element
230
325
  });
231
326
  }
232
327
  }
233
328
  async removeShortcuts() {
234
- const keyboardManager = await this._application.getKeyboardManager();
329
+ var _a;
330
+ const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
235
331
  if (keyboardManager) {
236
332
  keyboardManager
237
333
  .unbind("F6")
@@ -298,7 +394,7 @@ const SnkCrud = class {
298
394
  return;
299
395
  }
300
396
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
301
- return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
397
+ return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
302
398
  }
303
399
  get _element() { return index.getElement(this); }
304
400
  static get watchers() { return {
@@ -7,11 +7,21 @@ const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const index = require('./index-0922807b.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
- const DataFetcher = require('./DataFetcher-ba94ed5b.js');
11
- const snkDataUnit = require('./snk-data-unit-1bc69073.js');
12
- require('./PrintUtils-bcaeb82f.js');
10
+ const DataFetcher = require('./DataFetcher-515bda03.js');
11
+ const snkDataUnit = require('./snk-data-unit-3718477f.js');
12
+ require('./pesquisa-fetcher-916a935c.js');
13
+ require('./ISave-e91b70a7.js');
14
+ require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./SnkMessageBuilder-7293d0ad.js');
16
+ require('./dataunit-fetcher-7a08e4dd.js');
17
+ require('./filter-item-type.enum-a7ffdaa6.js');
18
+ require('./form-config-fetcher-3f430aee.js');
19
+ require('./PrintUtils-bcaeb82f.js');
20
+ require('./SnkMessageBuilder-4a95fe86.js');
21
+ require('./RecordIDUtils-3735135c.js');
22
+ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
23
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
24
+ require('./ResourceIDUtils-5ff86aa7.js');
15
25
 
16
26
  class ItemBuilder {
17
27
  constructor(getMessage, selectedNumber) {
@@ -153,38 +163,6 @@ class ItemBuilder {
153
163
  }
154
164
  }
155
165
 
156
- var __rest = (undefined && undefined.__rest) || function (s, e) {
157
- var t = {};
158
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
159
- t[p] = s[p];
160
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
161
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
162
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
163
- t[p[i]] = s[p[i]];
164
- }
165
- return t;
166
- };
167
- function fetchDataExporter(_a) {
168
- var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
169
- const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
170
- const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
171
- const payload = { serviceName, requestBody };
172
- return new Promise((resolve, reject) => {
173
- DataFetcher.DataFetcher.get()
174
- .callServiceBroker(serviceName, core.ObjectUtils.objectToString(payload))
175
- .then(result => resolve(getFormatResponse$1(result)))
176
- .catch(error => reject(error));
177
- });
178
- }
179
- function getFormatResponse$1(result) {
180
- var _a;
181
- const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
182
- if (response == undefined) {
183
- return;
184
- }
185
- return core.ObjectUtils.stringToObject(response);
186
- }
187
-
188
166
  function getMessage(application, key, params) {
189
167
  var _a;
190
168
  return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
@@ -213,16 +191,165 @@ function getFormatResponse(result) {
213
191
  return core.ObjectUtils.stringToObject(response);
214
192
  }
215
193
 
194
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
195
+ var t = {};
196
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
197
+ t[p] = s[p];
198
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
199
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
200
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
201
+ t[p[i]] = s[p[i]];
202
+ }
203
+ return t;
204
+ };
205
+ class ServerSideExporterStrategy {
206
+ constructor(provider) {
207
+ this._provider = provider;
208
+ }
209
+ async getParams(resolveProps) {
210
+ var _a, _b, _c, _d, _e, _f;
211
+ const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
212
+ const columns = await this._provider.getColumnsMetadata();
213
+ const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
214
+ const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
215
+ const selectedIDs = this._provider.getSelectedIDs();
216
+ const option = resolveProps.exportOption;
217
+ const currentPageOptions = [
218
+ index.DataExporterOption.EXPORT_PAGE_TO_PDF,
219
+ index.DataExporterOption.EXPORT_PAGE_TO_XLS
220
+ ];
221
+ delete resolveProps.exportOption;
222
+ let params = Object.assign({ filters,
223
+ columns,
224
+ sort,
225
+ resourceURI, selectedIDs: selectedIDs.slice(0, this._provider.getExportLimit()) }, resolveProps);
226
+ if (currentPageOptions.includes(option) || resolveProps.type == "page") {
227
+ const offset = this._provider.getOffset();
228
+ const limit = this._provider.getPageSize();
229
+ params = Object.assign(Object.assign({}, params), { offset,
230
+ limit, selectedIDs: [] });
231
+ }
232
+ else if (resolveProps.type == "all") {
233
+ params = Object.assign(Object.assign({}, params), { offset: 0, limit: this._provider.getExportLimit(), selectedIDs: [] });
234
+ }
235
+ return Promise.resolve(params);
236
+ }
237
+ async executeExport(resolveProps) {
238
+ const _a = await this.getParams(resolveProps), { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
239
+ const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
240
+ const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
241
+ const payload = { serviceName, requestBody };
242
+ return new Promise((resolve, reject) => {
243
+ DataFetcher.DataFetcher.get()
244
+ .callServiceBroker(serviceName, core.ObjectUtils.objectToString(payload))
245
+ .then(result => resolve(this.getFormatResponse(result)))
246
+ .catch(error => reject(error));
247
+ });
248
+ }
249
+ getFormatResponse(result) {
250
+ var _a;
251
+ const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
252
+ if (response == undefined) {
253
+ return;
254
+ }
255
+ return core.ObjectUtils.stringToObject(response);
256
+ }
257
+ }
258
+
259
+ class ClientSideExporterStrategy {
260
+ constructor(provider) {
261
+ this._provider = provider;
262
+ }
263
+ async executeExport(resolveProps) {
264
+ const { methodName, titleGrid } = resolveProps;
265
+ const records = await this._provider.getRecords();
266
+ const columns = await this._provider.getColumnsMetadata();
267
+ const [serviceName, processor] = this.getExecutor(methodName);
268
+ const payload = {
269
+ serviceName,
270
+ requestBody: {
271
+ grid: {
272
+ titleGrid,
273
+ columns: this.buildColumnsObject(columns),
274
+ rows: this.buildRowsObject(columns, records),
275
+ customOptions: { xlsxExtension: false }
276
+ }
277
+ }
278
+ };
279
+ return new Promise((resolve, reject) => {
280
+ DataFetcher.DataFetcher.get()
281
+ .callServiceBroker(serviceName, payload)
282
+ .then(result => resolve(processor(result)))
283
+ .catch(error => reject(error));
284
+ });
285
+ }
286
+ getExecutor(methodName) {
287
+ if (methodName === "exportToPDF") {
288
+ return [
289
+ "GridPDFBuilderSP.buildPDFFromJson",
290
+ responseBody => ({
291
+ fileSessionKey: responseBody.chavePDF.valor,
292
+ canPrint: responseBody.permiteImprimir.valor === "S",
293
+ canExport: responseBody.permiteExportar.valor === "S",
294
+ canSendEmail: responseBody.canSendEmail.valor === "S",
295
+ useAppPrint: true
296
+ })
297
+ ];
298
+ }
299
+ return [
300
+ "GridXLSBuilderSP.buildXLSFromJson",
301
+ responseBody => ({
302
+ fileSessionKey: responseBody.chaveXLS.valor,
303
+ canPrint: false,
304
+ canExport: false,
305
+ useAppPrint: false,
306
+ canSendEmail: false
307
+ })
308
+ ];
309
+ }
310
+ buildColumnsObject(columns) {
311
+ return {
312
+ column: columns.map((column, index) => {
313
+ const { label, id, width, userInterface } = column;
314
+ return Object.assign({ index: index + 1, id,
315
+ label,
316
+ width, presentationType: "P" }, (TYPE_MAP[userInterface] || { type: "S", align: "left" }));
317
+ })
318
+ };
319
+ }
320
+ buildRowsObject(columns, records) {
321
+ return {
322
+ row: records.map(rawRecord => {
323
+ const record = {};
324
+ columns.forEach((column, index) => record["c" + (index + 1)] = { $: this.formatValue(rawRecord, column) });
325
+ return record;
326
+ })
327
+ };
328
+ }
329
+ formatValue(record, column) {
330
+ if (this._provider.formatValue != undefined) {
331
+ return this._provider.formatValue(record, column);
332
+ }
333
+ return record[column.id] || "";
334
+ }
335
+ }
336
+ const TYPE_MAP = {
337
+ [core.UserInterface.DATE]: { type: "D", align: "center" },
338
+ [core.UserInterface.DATETIME]: { type: "H", align: "center" },
339
+ [core.UserInterface.TIME]: { type: "I", align: "right" },
340
+ [core.UserInterface.ELAPSEDTIME]: { type: "I", align: "right" },
341
+ [core.UserInterface.DECIMALNUMBER]: { type: "F", align: "right" },
342
+ [core.UserInterface.INTEGERNUMBER]: { type: "I", align: "right" },
343
+ [core.UserInterface.SEARCH]: { type: "S", align: "right" }
344
+ };
345
+
216
346
  const snkDataExporterCss = ".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";
217
347
 
218
- const LIMIT_PER_EXPORT = 5000;
219
348
  const SnkDataExporter = class {
220
349
  constructor(hostRef) {
221
350
  index$1.registerInstance(this, hostRef);
222
351
  this._selectedNumber = 0;
223
352
  this._customPrefix = "$custom$";
224
- this._items = [];
225
- this._showDropdown = false;
226
353
  this._releasedToExport = [
227
354
  index.DataExporterOption.EXPORT_TO_PDF,
228
355
  index.DataExporterOption.EXPORT_TO_XLS,
@@ -232,6 +359,8 @@ const SnkDataExporter = class {
232
359
  index.DataExporterOption.EXPORT_PAGE_TO_PDF,
233
360
  index.DataExporterOption.EXPORT_PAGE_TO_XLS
234
361
  ];
362
+ this._items = [];
363
+ this._showDropdown = false;
235
364
  this.provider = null;
236
365
  this.messagesBuilder = undefined;
237
366
  }
@@ -302,33 +431,16 @@ const SnkDataExporter = class {
302
431
  if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
303
432
  return;
304
433
  }
305
- const filters = this.provider.getFilters();
306
- const columns = await this.provider.getColumnsMetadata();
307
- const sort = this.provider.getOrders();
308
- const resourceURI = this.provider.getResourceURI();
309
- const selectedIDs = this.provider.getSelectedIDs();
310
- const option = resolveProps.exportOption;
311
- const currentPageOptions = [
312
- index.DataExporterOption.EXPORT_PAGE_TO_PDF,
313
- index.DataExporterOption.EXPORT_PAGE_TO_XLS
314
- ];
315
- delete resolveProps.exportOption;
316
- let params = Object.assign({ filters,
317
- columns,
318
- sort,
319
- resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
320
- if (currentPageOptions.includes(option) || resolveProps.type == "page") {
321
- const offset = this.provider.getOffset();
322
- const limit = this.provider.getLimit();
323
- params = Object.assign(Object.assign({}, params), { offset,
324
- limit, selectedIDs: [] });
325
- }
326
- else if (resolveProps.type == "all") {
327
- params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
328
- }
329
- fetchDataExporter(params)
434
+ this.getExporterStrategy().executeExport(resolveProps)
330
435
  .then((result) => callbackResolver(result))
331
- .catch((exception) => utils.ApplicationUtils.error(this.getMessage("snkDataExporter.message.exportError"), exception ? exception.statusMessage : this.getMessage("snkDataExporter.message.exportError")));
436
+ .catch((exception) => {
437
+ console.error(exception);
438
+ let { title, message, statusMessage } = exception || {};
439
+ utils.ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
440
+ });
441
+ }
442
+ getExporterStrategy() {
443
+ return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
332
444
  }
333
445
  getOptionKey(option) {
334
446
  return Object.keys(index.DataExporterOption)
@@ -337,7 +449,7 @@ const SnkDataExporter = class {
337
449
  });
338
450
  }
339
451
  dispatchExporter(option) {
340
- var _a;
452
+ var _a, _b, _c;
341
453
  const optionKey = this.getOptionKey(option);
342
454
  const fileType = (_a = index.DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : index.DataExporterType.EXPORT_TO_PDF;
343
455
  const isDownload = index.DataExporterType[optionKey] === index.DataExporterType.EXPORT_TO_XLS;
@@ -346,7 +458,7 @@ const SnkDataExporter = class {
346
458
  fileName: this._appLabel,
347
459
  titleGrid: this._appLabel,
348
460
  exportOption: option,
349
- limit: LIMIT_PER_EXPORT
461
+ limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b)
350
462
  };
351
463
  this.resolveExporter(params, (response) => {
352
464
  fileViewer(Object.assign(Object.assign({}, response), { fileType,
@@ -354,7 +466,7 @@ const SnkDataExporter = class {
354
466
  });
355
467
  }
356
468
  async processExporter(evt) {
357
- var _a, _b, _c, _d;
469
+ var _a, _b, _c, _d, _e, _f, _g;
358
470
  const item = evt === null || evt === void 0 ? void 0 : evt.detail;
359
471
  const exportCurrentPageOptions = [index.DataExporterOption.EXPORT_PAGE_TO_PDF, index.DataExporterOption.EXPORT_PAGE_TO_XLS];
360
472
  const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
@@ -362,18 +474,19 @@ const SnkDataExporter = class {
362
474
  return;
363
475
  const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
364
476
  const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
365
- const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getLimit();
477
+ const totalPerPage = (_e = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getPageSize) === null || _e === void 0 ? void 0 : _e.call(_d);
478
+ const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
366
479
  let limitExceeded = false;
367
- if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= LIMIT_PER_EXPORT) || isCustomReport) {
480
+ if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= exportLimit) || isCustomReport) {
368
481
  limitExceeded = false;
369
482
  }
370
483
  else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
371
- limitExceeded = selectedRecords.length > LIMIT_PER_EXPORT;
484
+ limitExceeded = selectedRecords.length > exportLimit;
372
485
  }
373
- else if (totalRecords > LIMIT_PER_EXPORT)
486
+ else if (totalRecords > exportLimit)
374
487
  limitExceeded = true;
375
488
  if (limitExceeded) {
376
- const formattedLimit = LIMIT_PER_EXPORT.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
489
+ const formattedLimit = exportLimit.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
377
490
  const limitModalMessages = {
378
491
  title: this.getMessage("snkDataExporter.limitExceeded.title"),
379
492
  description: `
@@ -398,7 +511,7 @@ const SnkDataExporter = class {
398
511
  this._showDropdown = false;
399
512
  return;
400
513
  }
401
- if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
514
+ if (!this.getFilteredReleasedToExport().includes(item === null || item === void 0 ? void 0 : item.id)) {
402
515
  return;
403
516
  }
404
517
  if (item.id === index.DataExporterOption.EXPORT_BY_EMAIL) {
@@ -409,9 +522,20 @@ const SnkDataExporter = class {
409
522
  }
410
523
  this._showDropdown = false;
411
524
  }
525
+ getFilteredReleasedToExport() {
526
+ var _a, _b;
527
+ if (this.provider == undefined) {
528
+ return this._releasedToExport;
529
+ }
530
+ const hiddenOptions = (_b = (_a = this.provider).getHiddenOptions) === null || _b === void 0 ? void 0 : _b.call(_a);
531
+ if (hiddenOptions == undefined) {
532
+ return this._releasedToExport;
533
+ }
534
+ return this._releasedToExport.filter(option => !hiddenOptions.includes(option));
535
+ }
412
536
  loadItems() {
413
537
  const items = [];
414
- this._releasedToExport
538
+ this.getFilteredReleasedToExport()
415
539
  .forEach((option) => {
416
540
  var _a;
417
541
  (_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
@@ -419,8 +543,8 @@ const SnkDataExporter = class {
419
543
  this.loadPersonalizedItems(items);
420
544
  }
421
545
  async loadPersonalizedItems(items) {
422
- var _a;
423
- const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
546
+ var _a, _b;
547
+ const recordID = (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID) === null || _b === void 0 ? void 0 : _b.call(_a);
424
548
  if (recordID == undefined) {
425
549
  this._items = items;
426
550
  return;
@@ -436,18 +560,18 @@ const SnkDataExporter = class {
436
560
  this._items = items;
437
561
  }
438
562
  openPersonalizedReports(option) {
439
- var _a;
563
+ var _a, _b;
440
564
  const pkObject = [];
441
565
  const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
442
- (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
443
- const fields = [];
566
+ (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs) === null || _b === void 0 ? void 0 : _b.call(_a).forEach(({ name, type, value }, index) => {
567
+ const fields = {};
444
568
  fields['fields'] = [];
445
569
  // Se for o primeiro elemento, adiciona essa primeira PK
446
570
  if (index === 0) {
447
571
  pkObject[`PK_${name}`] = { type: this.parseDataType(type), value };
448
572
  pkObject['pks'] = [];
449
573
  }
450
- const dataFields = { nome: name, tipo: type, valor: value };
574
+ const dataFields = { nome: `PK_${name}`, tipo: this.parseDataType(type), valor: value };
451
575
  fields['fields'].push(dataFields);
452
576
  pkObject['pks'].push(fields);
453
577
  });
@@ -464,8 +588,8 @@ const SnkDataExporter = class {
464
588
  }
465
589
  }
466
590
  loadDropdown() {
467
- var _a, _b;
468
- this._selectedNumber = ((_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs()) === null || _b === void 0 ? void 0 : _b.length) || 0;
591
+ var _a;
592
+ this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedNumber()) || 0;
469
593
  this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
470
594
  this.loadItems();
471
595
  }