@sankhyalabs/sankhyablocks 8.15.0-dev.5 → 8.15.0-dev.51

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 (312) hide show
  1. package/dist/cjs/{ConfigStorage-8009ecb2.js → ConfigStorage-8d4e9d53.js} +94 -21
  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-7d850fbc.js → SnkFormConfigManager-33995e92.js} +21 -13
  5. package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-66aa2557.js} +19 -1
  6. package/dist/cjs/SnkMultiSelectionListDataSource-8b5bfa05.js +140 -0
  7. package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-bb8e9ae4.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-d73f4449.js} +13 -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-bd4c52da.js → pesquisa-fetcher-036a9588.js} +498 -76
  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} +538 -8
  14. package/dist/cjs/snk-application.cjs.entry.js +44 -10
  15. package/dist/cjs/snk-attach.cjs.entry.js +413 -62
  16. package/dist/cjs/snk-crud.cjs.entry.js +17 -12
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +10 -6
  18. package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-41c29713.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 +66 -10
  23. package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
  24. package/dist/cjs/snk-filter-item.cjs.entry.js +13 -6
  25. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
  27. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
  28. package/dist/cjs/snk-form-config.cjs.entry.js +47 -27
  29. package/dist/cjs/snk-form.cjs.entry.js +11 -4
  30. package/dist/cjs/snk-grid.cjs.entry.js +37 -22
  31. package/dist/cjs/{snk-guides-viewer-cb176c4d.js → snk-guides-viewer-2f61fb02.js} +16 -11
  32. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -10
  33. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
  34. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  35. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +264 -27
  37. package/dist/cjs/snk-taskbar.cjs.entry.js +123 -15
  38. package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-3ecd1278.js} +9 -9
  39. package/dist/collection/collection-manifest.json +7 -7
  40. package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
  41. package/dist/collection/components/snk-application/snk-application.js +94 -11
  42. package/dist/collection/components/snk-attach/snk-attach.js +203 -39
  43. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  44. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  45. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  46. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  47. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  48. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +118 -0
  49. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  50. package/dist/collection/components/snk-crud/snk-crud.js +95 -3
  51. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
  52. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
  53. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +27 -3
  54. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +7 -3
  55. package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
  56. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
  57. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
  58. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
  59. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +31 -6
  60. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
  61. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +24 -1
  62. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +159 -5
  63. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  64. package/dist/collection/components/snk-form/snk-form.js +25 -1
  65. package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +20 -12
  66. package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +50 -30
  67. package/dist/collection/components/snk-grid/snk-grid.js +100 -16
  68. package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
  69. package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
  70. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
  71. package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
  72. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +10 -2
  73. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +467 -19
  74. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +18 -2
  75. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -9
  76. package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
  77. package/dist/collection/components/snk-taskbar/snk-taskbar.js +166 -14
  78. package/dist/collection/lib/configs/ConfigStorage.js +86 -16
  79. package/dist/collection/lib/dataUnit/InMemoryLoader.js +5 -40
  80. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
  81. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
  82. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  83. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  84. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  85. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  86. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  87. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  88. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  89. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +31 -3
  90. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +37 -23
  91. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
  92. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
  93. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
  94. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +11 -12
  95. package/dist/collection/lib/index.js +1 -1
  96. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  97. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
  98. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  99. package/dist/collection/lib/utils/CrudUtils.js +13 -1
  100. package/dist/components/ConfigStorage.js +92 -19
  101. package/dist/components/DataFetcher.js +5 -3
  102. package/dist/components/SnkFormConfigManager.js +19 -11
  103. package/dist/components/SnkMessageBuilder.js +19 -1
  104. package/dist/components/dataunit-fetcher.js +116 -77
  105. package/dist/components/field-search.js +93 -3
  106. package/dist/components/form-config-fetcher.js +12 -0
  107. package/dist/components/index.d.ts +6 -6
  108. package/dist/components/snk-actions-button2.js +1 -0
  109. package/dist/components/snk-application2.js +41 -2
  110. package/dist/components/snk-attach2.js +469 -69
  111. package/dist/components/snk-crud.js +15 -3
  112. package/dist/components/snk-data-exporter2.js +7 -3
  113. package/dist/components/snk-detail-view2.js +40 -7
  114. package/dist/components/snk-entity-list.js +5 -3
  115. package/dist/components/snk-filter-bar2.js +69 -8
  116. package/dist/components/snk-filter-detail2.js +5 -1
  117. package/dist/components/snk-filter-item2.js +14 -6
  118. package/dist/components/snk-filter-modal.js +4 -2
  119. package/dist/components/snk-filter-multi-select.js +2 -1
  120. package/dist/components/snk-form-config2.js +46 -26
  121. package/dist/components/snk-form.js +8 -0
  122. package/dist/components/snk-grid-config2.js +128 -102
  123. package/dist/components/snk-grid2.js +38 -17
  124. package/dist/components/snk-personalized-filter-editor.js +3 -1
  125. package/dist/components/snk-pesquisa2.js +1 -1
  126. package/dist/components/snk-simple-crud2.js +325 -31
  127. package/dist/components/snk-taskbar2.js +139 -25
  128. package/dist/components/taskbar-actions-button2.js +18 -2
  129. package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-6e241cd7.js} +94 -21
  130. package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
  131. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  132. package/dist/esm/{SnkFormConfigManager-9be0e7d4.js → SnkFormConfigManager-7a4e678f.js} +21 -13
  133. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0a4becdd.js} +19 -1
  134. package/dist/esm/SnkMultiSelectionListDataSource-4274be27.js +133 -0
  135. package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-8ec448b0.js} +1 -1
  136. package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-765b8498.js} +13 -1
  137. package/dist/esm/index-a7d3d3f1.js +2 -10
  138. package/dist/esm/loader.js +1 -1
  139. package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-a9e27c84.js} +486 -69
  140. package/dist/esm/sankhyablocks.js +1 -1
  141. package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +537 -9
  142. package/dist/esm/snk-application.entry.js +43 -9
  143. package/dist/esm/snk-attach.entry.js +413 -62
  144. package/dist/esm/snk-crud.entry.js +17 -12
  145. package/dist/esm/snk-data-exporter.entry.js +10 -6
  146. package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-de1d140d.js} +1 -1
  147. package/dist/esm/snk-data-unit.entry.js +2 -2
  148. package/dist/esm/snk-detail-view.entry.js +10 -12
  149. package/dist/esm/snk-entity-list.entry.js +5 -3
  150. package/dist/esm/snk-filter-bar.entry.js +66 -10
  151. package/dist/esm/snk-filter-detail.entry.js +4 -1
  152. package/dist/esm/snk-filter-item.entry.js +13 -6
  153. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  154. package/dist/esm/snk-filter-modal.entry.js +2 -1
  155. package/dist/esm/snk-filter-multi-select.entry.js +2 -1
  156. package/dist/esm/snk-form-config.entry.js +48 -28
  157. package/dist/esm/snk-form.entry.js +11 -4
  158. package/dist/esm/snk-grid.entry.js +38 -23
  159. package/dist/esm/{snk-guides-viewer-eeb8f354.js → snk-guides-viewer-16974807.js} +16 -11
  160. package/dist/esm/snk-guides-viewer.entry.js +8 -10
  161. package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
  162. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  163. package/dist/esm/snk-pesquisa.entry.js +1 -1
  164. package/dist/esm/snk-simple-crud.entry.js +264 -27
  165. package/dist/esm/snk-taskbar.entry.js +124 -16
  166. package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-2473c8ac.js} +9 -9
  167. package/dist/sankhyablocks/p-004c356e.js +26 -0
  168. package/dist/sankhyablocks/p-0624f62d.js +56 -0
  169. package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
  170. package/dist/sankhyablocks/p-1048bd26.entry.js +1 -0
  171. package/dist/sankhyablocks/{p-e6380c60.js → p-125bb902.js} +1 -1
  172. package/dist/sankhyablocks/p-1c7d57e5.entry.js +1 -0
  173. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  174. package/dist/sankhyablocks/{p-3520c088.entry.js → p-24ed6ad6.entry.js} +1 -1
  175. package/dist/sankhyablocks/p-32331e9b.entry.js +1 -0
  176. package/dist/sankhyablocks/p-32556aa6.js +1 -0
  177. package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
  178. package/dist/sankhyablocks/p-3f88728d.js +1 -0
  179. package/dist/sankhyablocks/p-433f0d45.entry.js +1 -0
  180. package/dist/sankhyablocks/p-4ab95a67.entry.js +1 -0
  181. package/dist/sankhyablocks/{p-32f0935f.js → p-52c8e589.js} +1 -1
  182. package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
  183. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  184. package/dist/sankhyablocks/p-751bd42a.entry.js +1 -0
  185. package/dist/sankhyablocks/{p-f514913b.entry.js → p-ac77949b.entry.js} +1 -1
  186. package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
  187. package/dist/sankhyablocks/p-b10b9934.entry.js +1 -0
  188. package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
  189. package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
  190. package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
  191. package/dist/sankhyablocks/p-bf39bdb8.entry.js +1 -0
  192. package/dist/sankhyablocks/p-c6751382.entry.js +11 -0
  193. package/dist/sankhyablocks/p-d0126ca0.js +65 -0
  194. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  195. package/dist/sankhyablocks/p-d6321b12.entry.js +1 -0
  196. package/dist/sankhyablocks/p-dcce8ca0.entry.js +1 -0
  197. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  198. package/dist/sankhyablocks/p-efeca7ba.js +1 -0
  199. package/dist/sankhyablocks/p-f7d0fab9.entry.js +1 -0
  200. package/dist/sankhyablocks/p-f7d9d148.entry.js +1 -0
  201. package/dist/sankhyablocks/p-fbc60023.js +1 -0
  202. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  203. package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
  204. package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
  205. package/dist/types/components/snk-application/snk-application.d.ts +15 -0
  206. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  207. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  208. package/dist/types/components/snk-attach/snk-attach.d.ts +28 -6
  209. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  210. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +40 -0
  211. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  212. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  213. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  214. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +16 -0
  215. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  216. package/dist/types/components/snk-crud/snk-crud.d.ts +21 -0
  217. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
  218. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -1
  219. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
  220. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +7 -3
  221. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
  222. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +27 -1
  223. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
  224. package/dist/types/components/snk-form/snk-form.d.ts +6 -1
  225. package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +2 -1
  226. package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +5 -3
  227. package/dist/types/components/snk-grid/snk-grid.d.ts +19 -1
  228. package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
  229. package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
  230. package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
  231. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +85 -4
  232. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +1 -0
  233. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +34 -1
  234. package/dist/types/components.d.ts +298 -12
  235. package/dist/types/lib/configs/ConfigStorage.d.ts +25 -1
  236. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
  237. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
  238. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  239. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  240. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  241. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  242. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  243. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  244. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -0
  245. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
  246. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -0
  247. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  248. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
  249. package/dist/types/lib/index.d.ts +1 -1
  250. package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
  251. package/package.json +15 -6
  252. package/dist/cjs/PreloadManager-84466da6.js +0 -224
  253. package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
  254. package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
  255. package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
  256. package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
  257. package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
  258. package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
  259. package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
  260. package/dist/esm/snk-grid-config.entry.js +0 -479
  261. package/dist/esm/snk-select-box.entry.js +0 -21
  262. package/dist/sankhyablocks/p-0874adb5.entry.js +0 -1
  263. package/dist/sankhyablocks/p-094c30cb.js +0 -1
  264. package/dist/sankhyablocks/p-0d7863ed.js +0 -26
  265. package/dist/sankhyablocks/p-11081798.entry.js +0 -1
  266. package/dist/sankhyablocks/p-20726710.entry.js +0 -1
  267. package/dist/sankhyablocks/p-29804fc5.js +0 -60
  268. package/dist/sankhyablocks/p-374d03f6.js +0 -1
  269. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  270. package/dist/sankhyablocks/p-585294ee.js +0 -56
  271. package/dist/sankhyablocks/p-6977a26c.entry.js +0 -1
  272. package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
  273. package/dist/sankhyablocks/p-6d20d38c.entry.js +0 -1
  274. package/dist/sankhyablocks/p-776ee8e3.js +0 -1
  275. package/dist/sankhyablocks/p-7d51d949.entry.js +0 -11
  276. package/dist/sankhyablocks/p-809f367d.entry.js +0 -1
  277. package/dist/sankhyablocks/p-95a3778f.entry.js +0 -1
  278. package/dist/sankhyablocks/p-98674137.entry.js +0 -1
  279. package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
  280. package/dist/sankhyablocks/p-b146a9f0.entry.js +0 -1
  281. package/dist/sankhyablocks/p-bedb8ad6.entry.js +0 -1
  282. package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
  283. package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
  284. package/dist/sankhyablocks/p-ca4d337a.entry.js +0 -1
  285. package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
  286. package/dist/sankhyablocks/p-cdd66657.entry.js +0 -1
  287. package/dist/sankhyablocks/p-d1f5bc50.js +0 -1
  288. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  289. package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
  290. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  291. package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
  292. package/dist/sankhyablocks/p-fd8814b9.entry.js +0 -1
  293. package/dist/sankhyablocks/p-ff6064e7.js +0 -1
  294. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  295. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  296. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  297. /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
  298. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
  299. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
  300. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
  301. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
  302. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
  303. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
  304. /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
  305. /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
  306. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  307. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
  308. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
  309. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
  310. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  311. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  312. /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, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './pesquisa-fetcher-a9e27c84.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-765b8498.js';
5
9
  import { d as VIEW_MODE } from './constants-8457af36.js';
6
- import { D as DataUnitFetcher } from './dataunit-fetcher-65714f21.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-8ec448b0.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,181 @@ 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, readOnly: false },
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._records = [];
419
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
420
+ }
421
+ initLoaders(dataUnit, fetcher, onSuccess) {
422
+ dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
423
+ dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
424
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
425
+ if (recordIds.length)
426
+ onSuccess();
427
+ return recordIds;
428
+ });
429
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
430
+ if (recordIds.length)
431
+ onSuccess();
432
+ return recordIds;
433
+ });
434
+ }
435
+ metadataLoader(_) {
436
+ return Promise.resolve(attachFetcherMetadataBuilder);
437
+ }
438
+ async dataLoader(dataUnit, request) {
439
+ if (!request.source) {
440
+ return Promise.resolve({ records: this._records });
441
+ }
442
+ if (!Number.isNaN(Number(request.source))) {
443
+ const criteria = {
444
+ criteria: {
445
+ codata: request.source,
446
+ tipoAnexo: "N"
447
+ }
448
+ };
449
+ const applicationDataFetcher = await this._application.getDataFetcher();
450
+ const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
451
+ const records = [];
452
+ anexo.forEach((param) => {
453
+ records.push(Object.assign({ __record__id__: StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
454
+ name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
455
+ }] }, param));
456
+ });
457
+ this._records = records;
458
+ }
459
+ let records = applyFilter(this._records, dataUnit, request.filters);
460
+ records = applySorting(records, dataUnit, request.sort);
461
+ return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
462
+ }
463
+ saveLoader(changes, fetcher) {
464
+ return new Promise((resolve) => {
465
+ const change = Array.isArray(changes) ? changes[0] : {};
466
+ fetcher.save(change)
467
+ .then(resolve)
468
+ .catch((error) => {
469
+ if (error.message === SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
470
+ this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
471
+ return resolve([]);
472
+ }
473
+ if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
474
+ this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
475
+ return resolve([]);
476
+ }
477
+ if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
478
+ this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
479
+ return resolve([]);
480
+ }
481
+ if (error.message) {
482
+ this._application.error((error.title || error.name), error.message);
483
+ return resolve([]);
484
+ }
485
+ resolve([]);
486
+ });
487
+ });
488
+ }
489
+ removeLoader(dataUnit, ids, fetcher) {
490
+ return new Promise((resolve) => {
491
+ dataUnit.getSelectionInfo().records.forEach(async (record) => {
492
+ this._application.hasAccess(AutorizationType.REMOVE)
493
+ .then(async (hasAccess) => {
494
+ if (hasAccess) {
495
+ await fetcher.delete(record);
496
+ resolve(ids);
497
+ }
498
+ });
499
+ });
500
+ });
501
+ }
502
+ getFilters() {
503
+ throw new Error('Method not implemented.');
504
+ }
505
+ getInterceptions(dataUnit, action, crudRef) {
506
+ return new Promise((resolve) => {
507
+ if (action.type === Action.EDITION_CANCELED) {
508
+ if (!dataUnit.isDirty())
509
+ return resolve(action);
510
+ return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
511
+ if (cancellationConfirmed) {
512
+ crudRef.goToView(VIEW_MODE.GRID);
513
+ return resolve(action);
514
+ }
515
+ return resolve(undefined);
516
+ });
517
+ }
518
+ if (action.type === Action.DATA_SAVED) {
519
+ dataUnit.loadData();
520
+ return resolve(action);
521
+ }
522
+ resolve(action);
523
+ });
524
+ }
525
+ }
526
+
257
527
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
258
528
  const getMessage = (key) => {
259
529
  var _a, _b;
@@ -300,7 +570,7 @@ const buildTaskBarManager = () => {
300
570
  };
301
571
  };
302
572
 
303
- const crudConfig = {
573
+ const anexoSistemaCrudConfig = {
304
574
  grid: {
305
575
  columns: [
306
576
  { name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },
@@ -346,40 +616,56 @@ const SnkAttach = class {
346
616
  constructor(hostRef) {
347
617
  registerInstance(this, hostRef);
348
618
  this.back = createEvent(this, "back", 7);
349
- this.handleTaskbarClick = ({ detail: taskbar }) => {
619
+ this.handleTaskbarClick = async ({ detail: taskbar }) => {
350
620
  if (["DOWNLOAD", "LINK"].includes(taskbar))
351
- return this.downloadAttachment(this.dataUnit.getSelectedRecord());
621
+ return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
622
+ if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
623
+ await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
624
+ }
352
625
  };
353
626
  this.handleBack = () => {
354
- this.dataUnit.cancelEdition().then((cancelationConfirmed) => {
627
+ this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
355
628
  if (cancelationConfirmed)
356
629
  this.back.emit();
357
630
  });
358
631
  };
359
632
  this.handleFinish = () => {
360
- if (!this.dataUnit.isDirty())
633
+ if (!this._currentDataUnit.isDirty())
361
634
  return this.back.emit();
362
- this.dataUnit.saveData().then(() => {
635
+ this._currentDataUnit.saveData().then(() => {
363
636
  this.showFinishedToast();
364
637
  this.back.emit();
365
638
  });
366
639
  };
640
+ this.fetcherType = undefined;
641
+ this.fetcher = undefined;
642
+ this.dataUnit = undefined;
643
+ this.dataUnitBuilder = undefined;
367
644
  this.registerKey = undefined;
368
645
  this.entityName = undefined;
369
646
  this.messagesBuilder = undefined;
370
- this.dataUnit = undefined;
647
+ this._currentFetcher = undefined;
648
+ this._currentDataUnit = undefined;
371
649
  this.crudConfig = undefined;
372
650
  }
373
651
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
374
- var _a;
375
- if (this.dataUnit == null) {
652
+ var _a, _b, _c, _d, _e, _f;
653
+ if (!this._currentDataUnit) {
376
654
  this.loadAttachmentDataUnit();
377
655
  }
378
656
  if (oldRegisterKey !== newRegisterKey) {
379
657
  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();
658
+ if (this.fetcherType === "AnexoSistema") {
659
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
660
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
661
+ return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
662
+ }
663
+ if (this.fetcherType === "Attach") {
664
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
665
+ if (hasMoreOneItem)
666
+ return;
667
+ }
668
+ return (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
383
669
  }
384
670
  }
385
671
  /**
@@ -402,44 +688,94 @@ const SnkAttach = class {
402
688
  window.open(`${selectedRecord.LINK}`);
403
689
  return;
404
690
  }
405
- this._attachFetcher.getDownloadKey(selectedRecord).then(({ chave }) => {
406
- window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}&forcarDownload=S`);
691
+ this._currentFetcher
692
+ .getDownloadKey(selectedRecord)
693
+ .then(({ chave }) => {
694
+ var _a;
695
+ let forceDownload = false;
696
+ if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
697
+ forceDownload = true;
698
+ }
699
+ window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
407
700
  });
408
701
  }
409
702
  returnToGridMode() {
410
- this.dataUnit.clearSelection();
703
+ var _a;
704
+ (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
411
705
  if (this._crudElement)
412
706
  this._crudElement.goToView(VIEW_MODE.GRID);
413
707
  }
414
708
  loadAttachmentDataUnit() {
415
- var _a;
416
709
  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;
710
+ switch (this.fetcherType) {
711
+ case "AnexoSistema":
712
+ this.loadAnexoSistema();
713
+ break;
714
+ case "Attach":
715
+ this.loadAttach();
716
+ break;
717
+ default:
718
+ this._currentFetcher = this.fetcher;
719
+ this._currentDataUnit = this.dataUnit;
720
+ this._currentDataUnitBuilder = this.dataUnitBuilder;
721
+ }
431
722
  }
432
723
  catch (error) {
433
724
  throw new Error('There was an error while creating the data unit');
434
725
  }
435
726
  }
727
+ loadAnexoSistema() {
728
+ var _a;
729
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
730
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
731
+ if (!this._currentDataUnit.metadata) {
732
+ this._currentDataUnit
733
+ .loadMetadata()
734
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
735
+ }
736
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
737
+ this._currentDataUnit.addFilterProvider({
738
+ getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
739
+ });
740
+ this._currentDataUnit.addInterceptor({
741
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
742
+ });
743
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
744
+ }
745
+ loadAttach() {
746
+ var _a, _b, _c;
747
+ this._currentFetcher = new AttachFetcher();
748
+ this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
749
+ this._currentDataUnit.addInterceptor({
750
+ interceptAction: (action) => {
751
+ var _a;
752
+ if (action.type === Action.METADATA_LOADED) {
753
+ this.crudConfig = Object.assign({}, attachCrudConfig);
754
+ (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
755
+ }
756
+ return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
757
+ }
758
+ });
759
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
760
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
761
+ this.returnToGridMode();
762
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
763
+ });
764
+ if (!this._currentDataUnit.metadata) {
765
+ (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
766
+ var _a, _b;
767
+ this.crudConfig = Object.assign({}, attachCrudConfig);
768
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
769
+ });
770
+ }
771
+ }
436
772
  disableEditFieldsNotInForm() {
437
773
  var _a;
438
774
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
439
775
  var _a;
440
776
  const fieldName = column.name;
441
777
  if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
442
- this.dataUnit.disableField(fieldName);
778
+ this._currentDataUnit.disableField(fieldName);
443
779
  }
444
780
  });
445
781
  }
@@ -447,15 +783,30 @@ const SnkAttach = class {
447
783
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
448
784
  }
449
785
  componentWillRender() {
450
- if (this.dataUnit == null) {
786
+ if (!this.fetcherType) {
787
+ this.fetcherType = "AnexoSistema";
788
+ }
789
+ if (this._currentDataUnit == null) {
451
790
  this.loadAttachmentDataUnit();
452
791
  }
453
792
  }
793
+ async handleOnDataStateChange({ detail }) {
794
+ if (this.fetcherType !== 'Attach')
795
+ return;
796
+ if (!detail.insertionMode) {
797
+ this._currentDataUnit.disableField('DESCRICAO');
798
+ }
799
+ else {
800
+ this._currentDataUnit.enableField('DESCRICAO');
801
+ }
802
+ await this._currentDataUnit.loadMetadata();
803
+ }
804
+ ;
454
805
  render() {
455
806
  var _a, _b;
456
- if (!this.dataUnit)
807
+ if (!this._currentDataUnit)
457
808
  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")))))))));
809
+ 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, onDataStateChange: this.handleOnDataStateChange.bind(this) }, 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
810
  }
460
811
  static get watchers() { return {
461
812
  "registerKey": ["registerKeyWatcher"]