@sankhyalabs/sankhyablocks 8.15.0-dev.9 → 8.15.0-rc.10

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 (295) hide show
  1. package/dist/cjs/{ConfigStorage-302bbbd4.js → ConfigStorage-34be11ce.js} +70 -7
  2. package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
  3. package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
  4. package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-6211fb28.js} +7 -2
  5. package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-141aa18d.js} +15 -1
  6. package/dist/cjs/SnkMultiSelectionListDataSource-5213120b.js +140 -0
  7. package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
  9. package/dist/cjs/index-f9e81701.js +2 -10
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/{dataunit-fetcher-353e4af2.js → pesquisa-fetcher-94f6b316.js} +439 -39
  12. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  13. package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +524 -8
  14. package/dist/cjs/snk-application.cjs.entry.js +44 -10
  15. package/dist/cjs/snk-attach.cjs.entry.js +392 -62
  16. package/dist/cjs/snk-crud.cjs.entry.js +17 -12
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -5
  18. package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-6026a9f7.js} +1 -1
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -12
  21. package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +44 -8
  23. package/dist/cjs/snk-filter-item.cjs.entry.js +4 -47
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  25. package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
  26. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
  27. package/dist/cjs/snk-form-config.cjs.entry.js +47 -27
  28. package/dist/cjs/snk-form.cjs.entry.js +11 -4
  29. package/dist/cjs/snk-grid.cjs.entry.js +40 -22
  30. package/dist/cjs/{snk-guides-viewer-e60ccc5e.js → snk-guides-viewer-508bb6fe.js} +16 -11
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -10
  32. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
  33. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  34. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-simple-crud.cjs.entry.js +229 -27
  36. package/dist/cjs/snk-taskbar.cjs.entry.js +100 -14
  37. package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-3ecd1278.js} +9 -9
  38. package/dist/collection/collection-manifest.json +6 -6
  39. package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
  40. package/dist/collection/components/snk-application/snk-application.js +85 -2
  41. package/dist/collection/components/snk-attach/snk-attach.js +188 -39
  42. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  43. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  44. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  45. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  46. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  47. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
  48. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  49. package/dist/collection/components/snk-crud/snk-crud.js +95 -3
  50. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
  51. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
  52. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +27 -3
  53. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +6 -2
  54. package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
  55. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
  56. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
  57. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +4 -47
  58. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
  59. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +23 -1
  60. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +137 -3
  61. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  62. package/dist/collection/components/snk-form/snk-form.js +25 -1
  63. package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +6 -1
  64. package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +50 -30
  65. package/dist/collection/components/snk-grid/snk-grid.js +103 -16
  66. package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
  67. package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
  68. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
  69. package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
  70. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -0
  71. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +378 -18
  72. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +4 -2
  73. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -9
  74. package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
  75. package/dist/collection/components/snk-taskbar/snk-taskbar.js +139 -13
  76. package/dist/collection/lib/configs/ConfigStorage.js +63 -3
  77. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
  78. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
  79. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  80. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  81. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  82. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  83. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  84. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  85. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  86. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +17 -3
  87. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +29 -22
  88. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
  89. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
  90. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +11 -12
  91. package/dist/collection/lib/index.js +1 -1
  92. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  93. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
  94. package/dist/collection/lib/utils/CrudUtils.js +13 -1
  95. package/dist/components/ConfigStorage.js +68 -5
  96. package/dist/components/DataFetcher.js +5 -3
  97. package/dist/components/SnkFormConfigManager.js +5 -0
  98. package/dist/components/SnkMessageBuilder.js +15 -1
  99. package/dist/components/dataunit-fetcher.js +58 -38
  100. package/dist/components/field-search.js +93 -3
  101. package/dist/components/index.d.ts +6 -6
  102. package/dist/components/snk-actions-button2.js +1 -0
  103. package/dist/components/snk-application2.js +41 -2
  104. package/dist/components/snk-attach2.js +448 -69
  105. package/dist/components/snk-crud.js +15 -3
  106. package/dist/components/snk-data-exporter2.js +6 -2
  107. package/dist/components/snk-detail-view2.js +40 -7
  108. package/dist/components/snk-entity-list.js +5 -3
  109. package/dist/components/snk-filter-bar2.js +47 -6
  110. package/dist/components/snk-filter-item2.js +4 -47
  111. package/dist/components/snk-filter-modal.js +4 -2
  112. package/dist/components/snk-filter-multi-select.js +2 -1
  113. package/dist/components/snk-form-config2.js +46 -26
  114. package/dist/components/snk-form.js +8 -0
  115. package/dist/components/snk-grid-config2.js +128 -102
  116. package/dist/components/snk-grid2.js +41 -17
  117. package/dist/components/snk-personalized-filter-editor.js +3 -1
  118. package/dist/components/snk-pesquisa2.js +1 -1
  119. package/dist/components/snk-simple-crud2.js +285 -29
  120. package/dist/components/snk-taskbar2.js +114 -24
  121. package/dist/components/taskbar-actions-button2.js +4 -2
  122. package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-101a2b4c.js} +70 -7
  123. package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
  124. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  125. package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-d86ba46f.js} +7 -2
  126. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-9747ddd2.js} +15 -1
  127. package/dist/esm/SnkMultiSelectionListDataSource-7e7eada5.js +133 -0
  128. package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
  129. package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
  130. package/dist/esm/index-a7d3d3f1.js +2 -10
  131. package/dist/esm/loader.js +1 -1
  132. package/dist/esm/{dataunit-fetcher-0fc935a0.js → pesquisa-fetcher-f05a12ca.js} +429 -31
  133. package/dist/esm/sankhyablocks.js +1 -1
  134. package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +523 -9
  135. package/dist/esm/snk-application.entry.js +43 -9
  136. package/dist/esm/snk-attach.entry.js +392 -62
  137. package/dist/esm/snk-crud.entry.js +17 -12
  138. package/dist/esm/snk-data-exporter.entry.js +9 -5
  139. package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-4c343635.js} +1 -1
  140. package/dist/esm/snk-data-unit.entry.js +2 -2
  141. package/dist/esm/snk-detail-view.entry.js +10 -12
  142. package/dist/esm/snk-entity-list.entry.js +5 -3
  143. package/dist/esm/snk-filter-bar.entry.js +44 -8
  144. package/dist/esm/snk-filter-item.entry.js +4 -47
  145. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  146. package/dist/esm/snk-filter-modal.entry.js +2 -1
  147. package/dist/esm/snk-filter-multi-select.entry.js +2 -1
  148. package/dist/esm/snk-form-config.entry.js +48 -28
  149. package/dist/esm/snk-form.entry.js +11 -4
  150. package/dist/esm/snk-grid.entry.js +41 -23
  151. package/dist/esm/{snk-guides-viewer-98a8e45e.js → snk-guides-viewer-18859840.js} +16 -11
  152. package/dist/esm/snk-guides-viewer.entry.js +8 -10
  153. package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
  154. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  155. package/dist/esm/snk-pesquisa.entry.js +1 -1
  156. package/dist/esm/snk-simple-crud.entry.js +229 -27
  157. package/dist/esm/snk-taskbar.entry.js +101 -15
  158. package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-2473c8ac.js} +9 -9
  159. package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
  160. package/dist/sankhyablocks/p-1fa5a18c.entry.js +11 -0
  161. package/dist/sankhyablocks/p-20b46647.entry.js +1 -0
  162. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  163. package/dist/sankhyablocks/p-2897fb8c.js +1 -0
  164. package/dist/sankhyablocks/{p-ff6064e7.js → p-2936303b.js} +1 -1
  165. package/dist/sankhyablocks/p-2b909f08.entry.js +1 -0
  166. package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
  167. package/dist/sankhyablocks/p-50783a8b.js +1 -0
  168. package/dist/sankhyablocks/p-5c0b53ce.js +56 -0
  169. package/dist/sankhyablocks/p-5dbc1a3f.js +1 -0
  170. package/dist/sankhyablocks/p-60fa6c7a.js +1 -0
  171. package/dist/sankhyablocks/p-64c1b368.entry.js +1 -0
  172. package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-6b28cc74.entry.js} +1 -1
  173. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  174. package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-7ddd95b6.entry.js} +1 -1
  175. package/dist/sankhyablocks/p-7e05bd83.entry.js +1 -0
  176. package/dist/sankhyablocks/p-7f97fee2.entry.js +1 -0
  177. package/dist/sankhyablocks/p-86801b08.entry.js +1 -0
  178. package/dist/sankhyablocks/{p-32f0935f.js → p-9a5d1b39.js} +1 -1
  179. package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
  180. package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
  181. package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
  182. package/dist/sankhyablocks/p-b41a622a.entry.js +1 -0
  183. package/dist/sankhyablocks/p-b4de81ac.entry.js +1 -0
  184. package/dist/sankhyablocks/p-ba4871b5.entry.js +1 -0
  185. package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
  186. package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
  187. package/dist/sankhyablocks/p-d01ceda6.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  189. package/dist/sankhyablocks/p-d304659d.entry.js +1 -0
  190. package/dist/sankhyablocks/p-d78d4062.js +65 -0
  191. package/dist/sankhyablocks/p-e4fb3308.entry.js +1 -0
  192. package/dist/sankhyablocks/p-e7dbe53a.entry.js +1 -0
  193. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  194. package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
  195. package/dist/types/components/snk-application/snk-application.d.ts +15 -0
  196. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  197. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  198. package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
  199. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  200. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
  201. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  202. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  203. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  204. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
  205. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  206. package/dist/types/components/snk-crud/snk-crud.d.ts +21 -0
  207. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
  208. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -1
  209. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -2
  210. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
  211. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +24 -1
  212. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
  213. package/dist/types/components/snk-form/snk-form.d.ts +6 -1
  214. package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +1 -0
  215. package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +5 -3
  216. package/dist/types/components/snk-grid/snk-grid.d.ts +20 -1
  217. package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
  218. package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
  219. package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
  220. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +71 -4
  221. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +28 -1
  222. package/dist/types/components.d.ts +265 -12
  223. package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
  224. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  225. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  226. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  227. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  228. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  229. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  230. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
  231. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
  232. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  233. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
  234. package/dist/types/lib/index.d.ts +1 -1
  235. package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
  236. package/package.json +13 -6
  237. package/dist/cjs/PreloadManager-84466da6.js +0 -224
  238. package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
  239. package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
  240. package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
  241. package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
  242. package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
  243. package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
  244. package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
  245. package/dist/esm/snk-grid-config.entry.js +0 -479
  246. package/dist/esm/snk-select-box.entry.js +0 -21
  247. package/dist/sankhyablocks/p-0874adb5.entry.js +0 -1
  248. package/dist/sankhyablocks/p-094c30cb.js +0 -1
  249. package/dist/sankhyablocks/p-1d75d9f9.entry.js +0 -1
  250. package/dist/sankhyablocks/p-20726710.entry.js +0 -1
  251. package/dist/sankhyablocks/p-374d03f6.js +0 -1
  252. package/dist/sankhyablocks/p-41560fd8.entry.js +0 -1
  253. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  254. package/dist/sankhyablocks/p-573a07c5.js +0 -1
  255. package/dist/sankhyablocks/p-6678d5d4.entry.js +0 -1
  256. package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
  257. package/dist/sankhyablocks/p-71439fd9.entry.js +0 -1
  258. package/dist/sankhyablocks/p-761ed32f.entry.js +0 -1
  259. package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
  260. package/dist/sankhyablocks/p-90f9b4db.entry.js +0 -11
  261. package/dist/sankhyablocks/p-98674137.entry.js +0 -1
  262. package/dist/sankhyablocks/p-a91bb13d.js +0 -1
  263. package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
  264. package/dist/sankhyablocks/p-aa95fb2c.js +0 -56
  265. package/dist/sankhyablocks/p-abfa8101.entry.js +0 -1
  266. package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
  267. package/dist/sankhyablocks/p-b3020263.entry.js +0 -1
  268. package/dist/sankhyablocks/p-bf93a748.js +0 -60
  269. package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
  270. package/dist/sankhyablocks/p-c6f89389.entry.js +0 -1
  271. package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
  272. package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
  273. package/dist/sankhyablocks/p-cebae710.entry.js +0 -1
  274. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  275. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  276. package/dist/sankhyablocks/p-e6380c60.js +0 -1
  277. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  278. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  279. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  280. /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
  281. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
  282. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
  283. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
  284. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
  285. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
  286. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
  287. /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
  288. /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
  289. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  290. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
  291. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
  292. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
  293. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  294. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  295. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,20 +1,116 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
- import { ApplicationContext, DataType, Action } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-aa159c5a.js';
4
- import { S as SaveErrorsEnum } from './ISave-4412b20c.js';
2
+ import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
+ import { D as DataFetcher } from './DataFetcher-a650ae58.js';
4
+ import { a as PreloadManager, D as DataUnitFetcher } from './pesquisa-fetcher-f05a12ca.js';
5
+ import './index-0ece87a6.js';
6
+ import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
+ import './filter-item-type.enum-d45e026f.js';
8
+ import './form-config-fetcher-f121f880.js';
5
9
  import { d as VIEW_MODE } from './constants-8457af36.js';
6
- import { D as DataUnitFetcher } from './dataunit-fetcher-0fc935a0.js';
7
- import { P as PreloadManager } from './PreloadManager-c1c2f2b4.js';
8
- import { T as TaskbarElement } from './taskbar-elements-d4d0b424.js';
10
+ import { A as AutorizationType } from './auth-fetcher-17dc5b5e.js';
11
+ import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
9
12
  import './PrintUtils-3e4ff0f5.js';
10
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
14
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
12
- import './ResourceIDUtils-a114189a.js';
13
15
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
14
- import './index-0ece87a6.js';
16
+ import './ResourceIDUtils-a114189a.js';
15
17
  import './index-bdf75557.js';
16
18
 
19
+ const SERVICE$1 = {
20
+ save: "Attach.save",
21
+ delete: "Attach.remove",
22
+ view: "Attach.view",
23
+ repository: "RepositorioArquivoSP.abreArquivo"
24
+ };
17
25
  class AttachFetcher {
26
+ constructor(dataUnitName) {
27
+ this.dataUnitName = dataUnitName;
28
+ }
29
+ async save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }) {
30
+ var _a, _b;
31
+ const isInsert = operation == "INSERT";
32
+ const dataBody = isInsert ? fields : record;
33
+ if (!isInsert && (fields === null || fields === void 0 ? void 0 : fields.DESCRICAO) && (fields === null || fields === void 0 ? void 0 : fields.DESCRICAO) !== (record === null || record === void 0 ? void 0 : record.DESCRICAO)) {
34
+ throw new Error(SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED);
35
+ }
36
+ const reqBody = {
37
+ "anexo": {
38
+ "codata": isInsert ? fields === null || fields === void 0 ? void 0 : fields.REGISTER_KEY : record === null || record === void 0 ? void 0 : record.CODATA,
39
+ "sequencia": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.SEQUENCIA) || "0",
40
+ "tipo": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.TIPO) || "N",
41
+ "descricao": dataBody === null || dataBody === void 0 ? void 0 : dataBody.DESCRICAO,
42
+ "arquivo": (_b = (_a = fields.CAMINHO_ARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name,
43
+ "ehInclusao": isInsert ? "S" : "N",
44
+ "ehArquivoRepositorio": "N"
45
+ }
46
+ };
47
+ return new Promise((resolve, reject) => {
48
+ DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
49
+ .then(result => {
50
+ var _a;
51
+ return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
52
+ })
53
+ .catch(error => reject(error));
54
+ });
55
+ }
56
+ async edit(change) {
57
+ throw new Error("Method not implemented.");
58
+ }
59
+ async delete(record) {
60
+ var request = {
61
+ anexo: {
62
+ codata: record.CODATA,
63
+ tipo: record.TIPO,
64
+ descricao: record.DESCRICAO,
65
+ }
66
+ };
67
+ const result = await DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
68
+ return Promise.resolve(result);
69
+ }
70
+ async getDownloadKey(record) {
71
+ var _a, _b, _c;
72
+ if (record.EHARQUIVOREPOSITORIO == 'S') {
73
+ const request = {
74
+ config: {
75
+ path: record.ARQUIVO,
76
+ tipoconteudo: record.TIPOCONTEUDO
77
+ }
78
+ };
79
+ const result = await DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
80
+ return Promise.resolve({
81
+ chave: {
82
+ valor: (_b = (_a = result === null || result === void 0 ? void 0 : result.responseBody) === null || _a === void 0 ? void 0 : _a.chave) === null || _b === void 0 ? void 0 : _b.valor
83
+ }
84
+ });
85
+ }
86
+ const criteria = {
87
+ anexo: {
88
+ codata: record.CODATA,
89
+ codemp: record.CODEMP,
90
+ sequencia: record.SEQUENCIA,
91
+ tipo: record.TIPO,
92
+ descricao: record.DESCRICAO,
93
+ tipoConteudo: record.TIPOCONTEUDO
94
+ }
95
+ };
96
+ const result = await DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
97
+ if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
98
+ return Promise.resolve({
99
+ chave: {
100
+ valor: (_c = result === null || result === void 0 ? void 0 : result.chaveAnexo) === null || _c === void 0 ? void 0 : _c.idChaveAnexo
101
+ }
102
+ });
103
+ }
104
+ return Promise.reject(new Error("File not found."));
105
+ }
106
+ }
107
+
108
+ const SERVICE = {
109
+ save: "AnexoSistemaSP.salvar",
110
+ delete: "AnexoSistemaSP.excluir",
111
+ download: "AnexoSistemaSP.baixar",
112
+ };
113
+ class AnexoSistemaFetcher {
18
114
  constructor(entityName, registerKey, dataUnitName) {
19
115
  var _a;
20
116
  this.entityName = entityName;
@@ -32,14 +128,13 @@ class AttachFetcher {
32
128
  }
33
129
  async save(change) {
34
130
  var _a, _b;
35
- const serviceName = "AnexoSistemaSP.salvar";
36
131
  let { updatingFields: fields } = change;
37
132
  fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
38
133
  try {
39
134
  this.validateFields(fields);
40
135
  const fileInfo = !fields.LINK ? fields.NOMEARQUIVO : null;
41
136
  const reqBody = {
42
- serviceName,
137
+ serviceName: SERVICE.save,
43
138
  requestBody: {
44
139
  params: {
45
140
  resourceID: this.resourceID,
@@ -55,7 +150,7 @@ class AttachFetcher {
55
150
  }
56
151
  }
57
152
  };
58
- const result = await DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
153
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
59
154
  return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
60
155
  }
61
156
  catch (error) {
@@ -64,7 +159,6 @@ class AttachFetcher {
64
159
  }
65
160
  async edit(change) {
66
161
  var _a, _b, _c;
67
- const serviceName = "AnexoSistemaSP.salvar";
68
162
  let { updatingFields: fields, record } = change;
69
163
  const getFieldValue = (fieldValue) => {
70
164
  if (fields[fieldValue] !== undefined)
@@ -78,7 +172,7 @@ class AttachFetcher {
78
172
  try {
79
173
  this.validateFields(fields);
80
174
  const reqBody = {
81
- serviceName,
175
+ serviceName: SERVICE.save,
82
176
  requestBody: {
83
177
  params: {
84
178
  resourceID: this.resourceID,
@@ -96,7 +190,7 @@ class AttachFetcher {
96
190
  }
97
191
  }
98
192
  };
99
- const result = await DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
193
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
100
194
  return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
101
195
  }
102
196
  catch (error) {
@@ -105,10 +199,9 @@ class AttachFetcher {
105
199
  }
106
200
  delete(record) {
107
201
  var _a;
108
- const serviceName = "AnexoSistemaSP.excluir";
109
202
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
110
203
  const reqBody = {
111
- serviceName,
204
+ serviceName: SERVICE.delete,
112
205
  requestBody: {
113
206
  paramsDelete: {
114
207
  keyAttach: record.CHAVEARQUIVO,
@@ -120,17 +213,16 @@ class AttachFetcher {
120
213
  }
121
214
  };
122
215
  return new Promise((resolve, reject) => {
123
- DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
216
+ DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
124
217
  .then(result => resolve(result))
125
218
  .catch(error => reject(error));
126
219
  });
127
220
  }
128
221
  getDownloadKey(record) {
129
222
  var _a;
130
- const serviceName = "AnexoSistemaSP.baixar";
131
223
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
132
224
  const reqBody = {
133
- serviceName,
225
+ serviceName: SERVICE.download,
134
226
  requestBody: {
135
227
  paramsDown: {
136
228
  nameAttach: attachField === null || attachField === void 0 ? void 0 : attachField.name,
@@ -142,34 +234,37 @@ class AttachFetcher {
142
234
  }
143
235
  };
144
236
  return new Promise((resolve, reject) => {
145
- DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
237
+ DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
146
238
  .then(result => resolve(result))
147
239
  .catch(error => reject(error));
148
240
  });
149
241
  }
150
242
  }
151
243
 
152
- class AttachmentDataUnitBuilder {
244
+ class AnexoSistemaDataUnitFactory {
153
245
  constructor(entityName, getMessage) {
154
246
  this.entityName = entityName;
155
247
  this.getMessage = getMessage;
156
248
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
157
249
  }
158
- initLoaders(dataUnit, attachFetcher, onSuccess) {
250
+ initLoaders(dataUnit, fetcher, onSuccess) {
159
251
  if (!this.loader)
160
252
  this.loader = dataUnit.dataLoader;
161
253
  dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
162
- dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, attachFetcher).then((recordIds) => {
254
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
163
255
  if (recordIds.length)
164
256
  onSuccess();
165
257
  return recordIds;
166
258
  });
167
- dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, attachFetcher).then((recordIds) => {
259
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
168
260
  if (recordIds.length)
169
261
  onSuccess();
170
262
  return recordIds;
171
263
  });
172
264
  }
265
+ metadataLoader(dataUnit) {
266
+ throw new Error("Method not implemented.");
267
+ }
173
268
  dataLoader(dataUnit, request) {
174
269
  return new Promise(resolve => {
175
270
  this.loader(dataUnit, request).then(response => {
@@ -185,11 +280,11 @@ class AttachmentDataUnitBuilder {
185
280
  });
186
281
  });
187
282
  }
188
- saveLoader(changes, attachFetcher) {
283
+ saveLoader(changes, fetcher) {
189
284
  return new Promise((resolve) => {
190
285
  var _a;
191
286
  const change = Array.isArray(changes) ? changes[0] : {};
192
- const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ? attachFetcher.edit.bind(attachFetcher) : attachFetcher.save.bind(attachFetcher);
287
+ const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ? fetcher.edit.bind(fetcher) : fetcher.save.bind(fetcher);
193
288
  savePromise(change).then((records) => {
194
289
  resolve(records);
195
290
  }).catch((error) => {
@@ -209,11 +304,11 @@ class AttachmentDataUnitBuilder {
209
304
  });
210
305
  });
211
306
  }
212
- removeLoader(dataUnit, ids, attachFetcher) {
307
+ removeLoader(dataUnit, ids, fetcher) {
213
308
  return new Promise((resolve) => {
214
309
  const { records } = dataUnit.getSelectionInfo();
215
310
  const recordToDelete = records[0];
216
- attachFetcher.delete(recordToDelete).then(() => {
311
+ fetcher.delete(recordToDelete).then(() => {
217
312
  PreloadManager.removeRecords(dataUnit, [recordToDelete]);
218
313
  return resolve(ids);
219
314
  });
@@ -254,6 +349,175 @@ class AttachmentDataUnitBuilder {
254
349
  }
255
350
  }
256
351
 
352
+ const application$1 = ApplicationContext.getContextValue("__SNK__APPLICATION__");
353
+ const getMessage$1 = (key) => {
354
+ var _a, _b;
355
+ return (_b = (_a = application$1 === null || application$1 === void 0 ? void 0 : application$1.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage) === null || _b === void 0 ? void 0 : _b.call(_a, key, null);
356
+ };
357
+ const attachCrudConfig = {
358
+ grid: {
359
+ columns: [
360
+ { name: "CODATA", orderIndex: 0, width: 0 },
361
+ { name: "DESCRICAO", orderIndex: 1, width: 0 },
362
+ { name: "ARQUIVO", orderIndex: 2, width: 0 },
363
+ { name: "DTALTER", orderIndex: 3, width: 0 },
364
+ { name: "USUARIO", orderIndex: 4, width: 0 },
365
+ ],
366
+ },
367
+ form: {
368
+ emptyConfig: false,
369
+ fields: [
370
+ {
371
+ name: "DESCRICAO",
372
+ label: getMessage$1("snkAttach.attachMetadata.lblDescription"),
373
+ visible: true,
374
+ readOnly: false,
375
+ required: true,
376
+ },
377
+ {
378
+ name: "CAMINHO_ARQUIVO",
379
+ label: getMessage$1("snkAttach.attachMetadata.lblFile"),
380
+ visible: true,
381
+ readOnly: false,
382
+ required: true,
383
+ },
384
+ ],
385
+ },
386
+ };
387
+ const attachFetcherMetadataBuilder = {
388
+ name: "Attach",
389
+ label: "Attach List",
390
+ fields: [
391
+ { name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: DataType.TEXT },
392
+ { name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: DataType.TEXT },
393
+ { name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: DataType.TEXT },
394
+ { name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: DataType.TEXT },
395
+ { name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: DataType.TEXT },
396
+ {
397
+ name: "CAMINHO_ARQUIVO",
398
+ label: getMessage$1("snkAttach.attachMetadata.lblFileUpload"),
399
+ dataType: DataType.OBJECT,
400
+ userInterface: UserInterface.FILE,
401
+ readOnly: false,
402
+ required: true,
403
+ visible: true,
404
+ properties: {
405
+ subTitle: getMessage$1("snkAttach.attachMetadata.lblSubTitle"),
406
+ MAX_FILES: 1,
407
+ STORAGESTRATEGY: "SESSION",
408
+ INTERNAL_FILENAME: "Attach.upload",
409
+ }
410
+ },
411
+ ],
412
+ };
413
+
414
+ const SERVICE_LOAD = "Attach.load";
415
+ class AttachFetcherDataUnitFactory {
416
+ constructor(getMessage) {
417
+ this.getMessage = getMessage;
418
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
419
+ }
420
+ initLoaders(dataUnit, fetcher, onSuccess) {
421
+ dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
422
+ dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
423
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
424
+ if (recordIds.length)
425
+ onSuccess();
426
+ return recordIds;
427
+ });
428
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
429
+ if (recordIds.length)
430
+ onSuccess();
431
+ return recordIds;
432
+ });
433
+ }
434
+ metadataLoader(_) {
435
+ return Promise.resolve(attachFetcherMetadataBuilder);
436
+ }
437
+ async dataLoader(_, request) {
438
+ if (!request.source) {
439
+ return Promise.resolve({ records: [] });
440
+ }
441
+ const criteria = {
442
+ criteria: {
443
+ codata: request.source,
444
+ tipoAnexo: "N"
445
+ }
446
+ };
447
+ const applicationDataFetcher = await this._application.getDataFetcher();
448
+ const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
449
+ const records = [];
450
+ anexo.forEach((param) => {
451
+ records.push(Object.assign({ __record__id__: StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
452
+ name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
453
+ }] }, param));
454
+ });
455
+ return Promise.resolve({ records });
456
+ }
457
+ saveLoader(changes, fetcher) {
458
+ return new Promise((resolve) => {
459
+ const change = Array.isArray(changes) ? changes[0] : {};
460
+ fetcher.save(change)
461
+ .then(resolve)
462
+ .catch((error) => {
463
+ if (error.message === SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
464
+ this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
465
+ return resolve([]);
466
+ }
467
+ if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
468
+ this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
469
+ return resolve([]);
470
+ }
471
+ if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
472
+ this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
473
+ return resolve([]);
474
+ }
475
+ if (error.message) {
476
+ this._application.error((error.title || error.name), error.message);
477
+ return resolve([]);
478
+ }
479
+ resolve([]);
480
+ });
481
+ });
482
+ }
483
+ removeLoader(dataUnit, ids, fetcher) {
484
+ return new Promise((resolve) => {
485
+ dataUnit.getSelectionInfo().records.forEach(async (record) => {
486
+ this._application.hasAccess(AutorizationType.REMOVE)
487
+ .then(async (hasAccess) => {
488
+ if (hasAccess) {
489
+ await fetcher.delete(record);
490
+ resolve(ids);
491
+ }
492
+ });
493
+ });
494
+ });
495
+ }
496
+ getFilters() {
497
+ throw new Error('Method not implemented.');
498
+ }
499
+ getInterceptions(dataUnit, action, crudRef) {
500
+ return new Promise((resolve) => {
501
+ if (action.type === Action.EDITION_CANCELED) {
502
+ if (!dataUnit.isDirty())
503
+ return resolve(action);
504
+ return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
505
+ if (cancellationConfirmed) {
506
+ crudRef.goToView(VIEW_MODE.GRID);
507
+ return resolve(action);
508
+ }
509
+ return resolve(undefined);
510
+ });
511
+ }
512
+ if (action.type === Action.DATA_SAVED) {
513
+ dataUnit.loadData();
514
+ return resolve(action);
515
+ }
516
+ resolve(action);
517
+ });
518
+ }
519
+ }
520
+
257
521
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
258
522
  const getMessage = (key) => {
259
523
  var _a, _b;
@@ -300,7 +564,7 @@ const buildTaskBarManager = () => {
300
564
  };
301
565
  };
302
566
 
303
- const crudConfig = {
567
+ const anexoSistemaCrudConfig = {
304
568
  grid: {
305
569
  columns: [
306
570
  { name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },
@@ -346,40 +610,60 @@ const SnkAttach = class {
346
610
  constructor(hostRef) {
347
611
  registerInstance(this, hostRef);
348
612
  this.back = createEvent(this, "back", 7);
349
- this.handleTaskbarClick = ({ detail: taskbar }) => {
613
+ this.handleTaskbarClick = async ({ detail: taskbar }) => {
350
614
  if (["DOWNLOAD", "LINK"].includes(taskbar))
351
- return this.downloadAttachment(this.dataUnit.getSelectedRecord());
615
+ return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
616
+ if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
617
+ await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
618
+ }
352
619
  };
353
620
  this.handleBack = () => {
354
- this.dataUnit.cancelEdition().then((cancelationConfirmed) => {
621
+ this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
355
622
  if (cancelationConfirmed)
356
623
  this.back.emit();
357
624
  });
358
625
  };
359
626
  this.handleFinish = () => {
360
- if (!this.dataUnit.isDirty())
627
+ if (!this._currentDataUnit.isDirty())
361
628
  return this.back.emit();
362
- this.dataUnit.saveData().then(() => {
629
+ this._currentDataUnit.saveData().then(() => {
363
630
  this.showFinishedToast();
364
631
  this.back.emit();
365
632
  });
366
633
  };
634
+ this.fetcherType = "AnexoSistema";
635
+ this.fetcher = undefined;
636
+ this.dataUnit = undefined;
637
+ this.dataUnitBuilder = undefined;
367
638
  this.registerKey = undefined;
368
639
  this.entityName = undefined;
369
640
  this.messagesBuilder = undefined;
370
- this.dataUnit = undefined;
641
+ this._currentFetcher = undefined;
642
+ this._currentDataUnit = undefined;
371
643
  this.crudConfig = undefined;
372
644
  }
373
645
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
374
- var _a;
375
- if (this.dataUnit == null) {
646
+ var _a, _b, _c, _d;
647
+ if (this._currentDataUnit == null) {
376
648
  this.loadAttachmentDataUnit();
377
649
  }
378
650
  if (oldRegisterKey !== newRegisterKey) {
379
651
  this.returnToGridMode();
380
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
381
- this._dataUnitBuilder.initLoaders(this.dataUnit, this._attachFetcher, () => { this.returnToGridMode(); });
382
- this.dataUnit.loadData();
652
+ if (this.fetcherType === "AnexoSistema") {
653
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
654
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
655
+ return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
656
+ }
657
+ if (this.fetcherType === "Attach") {
658
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
659
+ if (hasMoreOneItem)
660
+ return;
661
+ }
662
+ return this._currentDataUnit
663
+ .loadMetadata()
664
+ .then(() => {
665
+ this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
666
+ });
383
667
  }
384
668
  }
385
669
  /**
@@ -402,44 +686,90 @@ const SnkAttach = class {
402
686
  window.open(`${selectedRecord.LINK}`);
403
687
  return;
404
688
  }
405
- this._attachFetcher.getDownloadKey(selectedRecord).then(({ chave }) => {
406
- window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}&forcarDownload=S`);
689
+ this._currentFetcher
690
+ .getDownloadKey(selectedRecord)
691
+ .then(({ chave }) => {
692
+ var _a;
693
+ let forceDownload = false;
694
+ if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
695
+ forceDownload = true;
696
+ }
697
+ window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
407
698
  });
408
699
  }
409
700
  returnToGridMode() {
410
- this.dataUnit.clearSelection();
701
+ var _a;
702
+ (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
411
703
  if (this._crudElement)
412
704
  this._crudElement.goToView(VIEW_MODE.GRID);
413
705
  }
414
706
  loadAttachmentDataUnit() {
415
- var _a;
416
707
  try {
417
- const dataUnit = this.dataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
418
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
419
- if (!dataUnit.metadata)
420
- dataUnit.loadMetadata().then(() => {
421
- this.crudConfig = crudConfig;
422
- });
423
- this._dataUnitBuilder = new AttachmentDataUnitBuilder(this.entityName, this.getMessage.bind(this));
424
- dataUnit.addFilterProvider({ getFilter: () => this._dataUnitBuilder.getFilters(this.registerKey) });
425
- dataUnit.addInterceptor({ interceptAction: (action) => this._dataUnitBuilder.getInterceptions(dataUnit, action, this._crudElement) });
426
- this.dataUnit = dataUnit;
427
- this.dataUnit.loadData().then(() => {
428
- this.disableEditFieldsNotInForm();
429
- });
430
- return this.dataUnit;
708
+ switch (this.fetcherType) {
709
+ case "AnexoSistema":
710
+ this.loadAnexoSistema();
711
+ break;
712
+ case "Attach":
713
+ this.loadAttach();
714
+ break;
715
+ default:
716
+ this._currentFetcher = this.fetcher;
717
+ this._currentDataUnit = this.dataUnit;
718
+ this._currentDataUnitBuilder = this.dataUnitBuilder;
719
+ }
431
720
  }
432
721
  catch (error) {
433
722
  throw new Error('There was an error while creating the data unit');
434
723
  }
435
724
  }
725
+ loadAnexoSistema() {
726
+ var _a;
727
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
728
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
729
+ if (!this._currentDataUnit.metadata) {
730
+ this._currentDataUnit
731
+ .loadMetadata()
732
+ .then(() => this.crudConfig = anexoSistemaCrudConfig);
733
+ }
734
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
735
+ this._currentDataUnit.addFilterProvider({
736
+ getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
737
+ });
738
+ this._currentDataUnit.addInterceptor({
739
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
740
+ });
741
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
742
+ }
743
+ loadAttach() {
744
+ var _a;
745
+ this._currentFetcher = new AttachFetcher();
746
+ this._currentDataUnit = new DataUnit();
747
+ this._currentDataUnit.addInterceptor({
748
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
749
+ });
750
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
751
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
752
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
753
+ this.returnToGridMode();
754
+ });
755
+ if (!this._currentDataUnit.metadata) {
756
+ this._currentDataUnit
757
+ .loadMetadata()
758
+ .then(() => {
759
+ this.crudConfig = attachCrudConfig;
760
+ this._currentDataUnit
761
+ .loadData(undefined, undefined, true, this.registerKey)
762
+ .then(this.disableEditFieldsNotInForm.bind(this));
763
+ });
764
+ }
765
+ }
436
766
  disableEditFieldsNotInForm() {
437
767
  var _a;
438
768
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
439
769
  var _a;
440
770
  const fieldName = column.name;
441
771
  if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
442
- this.dataUnit.disableField(fieldName);
772
+ this._currentDataUnit.disableField(fieldName);
443
773
  }
444
774
  });
445
775
  }
@@ -447,15 +777,15 @@ const SnkAttach = class {
447
777
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
448
778
  }
449
779
  componentWillRender() {
450
- if (this.dataUnit == null) {
780
+ if (this._currentDataUnit == null) {
451
781
  this.loadAttachmentDataUnit();
452
782
  }
453
783
  }
454
784
  render() {
455
785
  var _a, _b;
456
- if (!this.dataUnit)
786
+ if (!this._currentDataUnit)
457
787
  return null;
458
- return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
788
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
459
789
  }
460
790
  static get watchers() { return {
461
791
  "registerKey": ["registerKeyWatcher"]