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

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 +61 -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 +154 -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 +64 -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 +61 -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-85af23fe.entry.js +1 -0
  186. package/dist/sankhyablocks/{p-f514913b.entry.js → p-ac77949b.entry.js} +1 -1
  187. package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
  188. package/dist/sankhyablocks/p-b10b9934.entry.js +1 -0
  189. package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
  190. package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
  191. package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
  192. package/dist/sankhyablocks/p-bf39bdb8.entry.js +1 -0
  193. package/dist/sankhyablocks/p-c6751382.entry.js +11 -0
  194. package/dist/sankhyablocks/p-d0126ca0.js +65 -0
  195. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  196. package/dist/sankhyablocks/p-d6321b12.entry.js +1 -0
  197. package/dist/sankhyablocks/p-dcce8ca0.entry.js +1 -0
  198. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  199. package/dist/sankhyablocks/p-efeca7ba.js +1 -0
  200. package/dist/sankhyablocks/p-f7d0fab9.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 +26 -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
@@ -4,21 +4,117 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const DataFetcher = require('./DataFetcher-ba94ed5b.js');
8
- const ISave = require('./ISave-d68ce3cd.js');
7
+ const DataFetcher = require('./DataFetcher-99f0f6ed.js');
8
+ const pesquisaFetcher = require('./pesquisa-fetcher-036a9588.js');
9
+ require('./index-0922807b.js');
10
+ const ISave = require('./ISave-e91b70a7.js');
11
+ require('./filter-item-type.enum-a7ffdaa6.js');
12
+ require('./form-config-fetcher-d73f4449.js');
9
13
  const constants = require('./constants-35ddd366.js');
10
- const dataunitFetcher = require('./dataunit-fetcher-bd4c52da.js');
11
- const PreloadManager = require('./PreloadManager-84466da6.js');
12
- const taskbarElements = require('./taskbar-elements-01b85b99.js');
14
+ const authFetcher = require('./auth-fetcher-bb8e9ae4.js');
15
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
13
16
  require('./PrintUtils-bcaeb82f.js');
14
17
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
18
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
16
- require('./ResourceIDUtils-5ff86aa7.js');
17
19
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
18
- require('./index-0922807b.js');
20
+ require('./ResourceIDUtils-5ff86aa7.js');
19
21
  require('./index-102ba62d.js');
20
22
 
23
+ const SERVICE$1 = {
24
+ save: "Attach.save",
25
+ delete: "Attach.remove",
26
+ view: "Attach.view",
27
+ repository: "RepositorioArquivoSP.abreArquivo"
28
+ };
21
29
  class AttachFetcher {
30
+ constructor(dataUnitName) {
31
+ this.dataUnitName = dataUnitName;
32
+ }
33
+ async save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }) {
34
+ var _a, _b;
35
+ const isInsert = operation == "INSERT";
36
+ const dataBody = isInsert ? fields : record;
37
+ 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)) {
38
+ throw new Error(ISave.SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED);
39
+ }
40
+ const reqBody = {
41
+ "anexo": {
42
+ "codata": isInsert ? fields === null || fields === void 0 ? void 0 : fields.REGISTER_KEY : record === null || record === void 0 ? void 0 : record.CODATA,
43
+ "sequencia": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.SEQUENCIA) || "0",
44
+ "tipo": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.TIPO) || "N",
45
+ "descricao": dataBody === null || dataBody === void 0 ? void 0 : dataBody.DESCRICAO,
46
+ "arquivo": (_b = (_a = fields.CAMINHO_ARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name,
47
+ "ehInclusao": isInsert ? "S" : "N",
48
+ "ehArquivoRepositorio": "N"
49
+ }
50
+ };
51
+ return new Promise((resolve, reject) => {
52
+ DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
53
+ .then(result => {
54
+ var _a;
55
+ return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
56
+ })
57
+ .catch(error => reject(error));
58
+ });
59
+ }
60
+ async edit(change) {
61
+ throw new Error("Method not implemented.");
62
+ }
63
+ async delete(record) {
64
+ var request = {
65
+ anexo: {
66
+ codata: record.CODATA,
67
+ tipo: record.TIPO,
68
+ descricao: record.DESCRICAO,
69
+ }
70
+ };
71
+ const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
72
+ return Promise.resolve(result);
73
+ }
74
+ async getDownloadKey(record) {
75
+ var _a, _b, _c;
76
+ if (record.EHARQUIVOREPOSITORIO == 'S') {
77
+ const request = {
78
+ config: {
79
+ path: record.ARQUIVO,
80
+ tipoconteudo: record.TIPOCONTEUDO
81
+ }
82
+ };
83
+ const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
84
+ return Promise.resolve({
85
+ chave: {
86
+ 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
87
+ }
88
+ });
89
+ }
90
+ const criteria = {
91
+ anexo: {
92
+ codata: record.CODATA,
93
+ codemp: record.CODEMP,
94
+ sequencia: record.SEQUENCIA,
95
+ tipo: record.TIPO,
96
+ descricao: record.DESCRICAO,
97
+ tipoConteudo: record.TIPOCONTEUDO
98
+ }
99
+ };
100
+ const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
101
+ if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
102
+ return Promise.resolve({
103
+ chave: {
104
+ valor: (_c = result === null || result === void 0 ? void 0 : result.chaveAnexo) === null || _c === void 0 ? void 0 : _c.idChaveAnexo
105
+ }
106
+ });
107
+ }
108
+ return Promise.reject(new Error("File not found."));
109
+ }
110
+ }
111
+
112
+ const SERVICE = {
113
+ save: "AnexoSistemaSP.salvar",
114
+ delete: "AnexoSistemaSP.excluir",
115
+ download: "AnexoSistemaSP.baixar",
116
+ };
117
+ class AnexoSistemaFetcher {
22
118
  constructor(entityName, registerKey, dataUnitName) {
23
119
  var _a;
24
120
  this.entityName = entityName;
@@ -36,14 +132,13 @@ class AttachFetcher {
36
132
  }
37
133
  async save(change) {
38
134
  var _a, _b;
39
- const serviceName = "AnexoSistemaSP.salvar";
40
135
  let { updatingFields: fields } = change;
41
136
  fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
42
137
  try {
43
138
  this.validateFields(fields);
44
139
  const fileInfo = !fields.LINK ? fields.NOMEARQUIVO : null;
45
140
  const reqBody = {
46
- serviceName,
141
+ serviceName: SERVICE.save,
47
142
  requestBody: {
48
143
  params: {
49
144
  resourceID: this.resourceID,
@@ -59,7 +154,7 @@ class AttachFetcher {
59
154
  }
60
155
  }
61
156
  };
62
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
157
+ const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
63
158
  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 })]);
64
159
  }
65
160
  catch (error) {
@@ -68,7 +163,6 @@ class AttachFetcher {
68
163
  }
69
164
  async edit(change) {
70
165
  var _a, _b, _c;
71
- const serviceName = "AnexoSistemaSP.salvar";
72
166
  let { updatingFields: fields, record } = change;
73
167
  const getFieldValue = (fieldValue) => {
74
168
  if (fields[fieldValue] !== undefined)
@@ -82,7 +176,7 @@ class AttachFetcher {
82
176
  try {
83
177
  this.validateFields(fields);
84
178
  const reqBody = {
85
- serviceName,
179
+ serviceName: SERVICE.save,
86
180
  requestBody: {
87
181
  params: {
88
182
  resourceID: this.resourceID,
@@ -100,7 +194,7 @@ class AttachFetcher {
100
194
  }
101
195
  }
102
196
  };
103
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
197
+ const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
104
198
  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 })]);
105
199
  }
106
200
  catch (error) {
@@ -109,10 +203,9 @@ class AttachFetcher {
109
203
  }
110
204
  delete(record) {
111
205
  var _a;
112
- const serviceName = "AnexoSistemaSP.excluir";
113
206
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
114
207
  const reqBody = {
115
- serviceName,
208
+ serviceName: SERVICE.delete,
116
209
  requestBody: {
117
210
  paramsDelete: {
118
211
  keyAttach: record.CHAVEARQUIVO,
@@ -124,17 +217,16 @@ class AttachFetcher {
124
217
  }
125
218
  };
126
219
  return new Promise((resolve, reject) => {
127
- DataFetcher.DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
220
+ DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
128
221
  .then(result => resolve(result))
129
222
  .catch(error => reject(error));
130
223
  });
131
224
  }
132
225
  getDownloadKey(record) {
133
226
  var _a;
134
- const serviceName = "AnexoSistemaSP.baixar";
135
227
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
136
228
  const reqBody = {
137
- serviceName,
229
+ serviceName: SERVICE.download,
138
230
  requestBody: {
139
231
  paramsDown: {
140
232
  nameAttach: attachField === null || attachField === void 0 ? void 0 : attachField.name,
@@ -146,34 +238,37 @@ class AttachFetcher {
146
238
  }
147
239
  };
148
240
  return new Promise((resolve, reject) => {
149
- DataFetcher.DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
241
+ DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
150
242
  .then(result => resolve(result))
151
243
  .catch(error => reject(error));
152
244
  });
153
245
  }
154
246
  }
155
247
 
156
- class AttachmentDataUnitBuilder {
248
+ class AnexoSistemaDataUnitFactory {
157
249
  constructor(entityName, getMessage) {
158
250
  this.entityName = entityName;
159
251
  this.getMessage = getMessage;
160
252
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
161
253
  }
162
- initLoaders(dataUnit, attachFetcher, onSuccess) {
254
+ initLoaders(dataUnit, fetcher, onSuccess) {
163
255
  if (!this.loader)
164
256
  this.loader = dataUnit.dataLoader;
165
257
  dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
166
- dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, attachFetcher).then((recordIds) => {
258
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
167
259
  if (recordIds.length)
168
260
  onSuccess();
169
261
  return recordIds;
170
262
  });
171
- dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, attachFetcher).then((recordIds) => {
263
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
172
264
  if (recordIds.length)
173
265
  onSuccess();
174
266
  return recordIds;
175
267
  });
176
268
  }
269
+ metadataLoader(dataUnit) {
270
+ throw new Error("Method not implemented.");
271
+ }
177
272
  dataLoader(dataUnit, request) {
178
273
  return new Promise(resolve => {
179
274
  this.loader(dataUnit, request).then(response => {
@@ -189,11 +284,11 @@ class AttachmentDataUnitBuilder {
189
284
  });
190
285
  });
191
286
  }
192
- saveLoader(changes, attachFetcher) {
287
+ saveLoader(changes, fetcher) {
193
288
  return new Promise((resolve) => {
194
289
  var _a;
195
290
  const change = Array.isArray(changes) ? changes[0] : {};
196
- 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);
291
+ 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);
197
292
  savePromise(change).then((records) => {
198
293
  resolve(records);
199
294
  }).catch((error) => {
@@ -213,12 +308,12 @@ class AttachmentDataUnitBuilder {
213
308
  });
214
309
  });
215
310
  }
216
- removeLoader(dataUnit, ids, attachFetcher) {
311
+ removeLoader(dataUnit, ids, fetcher) {
217
312
  return new Promise((resolve) => {
218
313
  const { records } = dataUnit.getSelectionInfo();
219
314
  const recordToDelete = records[0];
220
- attachFetcher.delete(recordToDelete).then(() => {
221
- PreloadManager.PreloadManager.removeRecords(dataUnit, [recordToDelete]);
315
+ fetcher.delete(recordToDelete).then(() => {
316
+ pesquisaFetcher.PreloadManager.removeRecords(dataUnit, [recordToDelete]);
222
317
  return resolve(ids);
223
318
  });
224
319
  });
@@ -258,6 +353,181 @@ class AttachmentDataUnitBuilder {
258
353
  }
259
354
  }
260
355
 
356
+ const application$1 = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
357
+ const getMessage$1 = (key) => {
358
+ var _a, _b;
359
+ 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);
360
+ };
361
+ const attachCrudConfig = {
362
+ grid: {
363
+ columns: [
364
+ { name: "CODATA", orderIndex: 0, width: 0 },
365
+ { name: "DESCRICAO", orderIndex: 1, width: 0 },
366
+ { name: "ARQUIVO", orderIndex: 2, width: 0 },
367
+ { name: "DTALTER", orderIndex: 3, width: 0 },
368
+ { name: "USUARIO", orderIndex: 4, width: 0 },
369
+ ],
370
+ },
371
+ form: {
372
+ emptyConfig: false,
373
+ fields: [
374
+ {
375
+ name: "DESCRICAO",
376
+ label: getMessage$1("snkAttach.attachMetadata.lblDescription"),
377
+ visible: true,
378
+ readOnly: false,
379
+ required: true,
380
+ },
381
+ {
382
+ name: "CAMINHO_ARQUIVO",
383
+ label: getMessage$1("snkAttach.attachMetadata.lblFile"),
384
+ visible: true,
385
+ readOnly: false,
386
+ required: true,
387
+ },
388
+ ],
389
+ },
390
+ };
391
+ const attachFetcherMetadataBuilder = {
392
+ name: "Attach",
393
+ label: "Attach List",
394
+ fields: [
395
+ { name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: core.DataType.TEXT },
396
+ { name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: core.DataType.TEXT, readOnly: false },
397
+ { name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: core.DataType.TEXT },
398
+ { name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: core.DataType.TEXT },
399
+ { name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: core.DataType.TEXT },
400
+ {
401
+ name: "CAMINHO_ARQUIVO",
402
+ label: getMessage$1("snkAttach.attachMetadata.lblFileUpload"),
403
+ dataType: core.DataType.OBJECT,
404
+ userInterface: core.UserInterface.FILE,
405
+ readOnly: false,
406
+ required: true,
407
+ visible: true,
408
+ properties: {
409
+ subTitle: getMessage$1("snkAttach.attachMetadata.lblSubTitle"),
410
+ MAX_FILES: 1,
411
+ STORAGESTRATEGY: "SESSION",
412
+ INTERNAL_FILENAME: "Attach.upload",
413
+ }
414
+ },
415
+ ],
416
+ };
417
+
418
+ const SERVICE_LOAD = "Attach.load";
419
+ class AttachFetcherDataUnitFactory {
420
+ constructor(getMessage) {
421
+ this.getMessage = getMessage;
422
+ this._records = [];
423
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
424
+ }
425
+ initLoaders(dataUnit, fetcher, onSuccess) {
426
+ dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
427
+ dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
428
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
429
+ if (recordIds.length)
430
+ onSuccess();
431
+ return recordIds;
432
+ });
433
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
434
+ if (recordIds.length)
435
+ onSuccess();
436
+ return recordIds;
437
+ });
438
+ }
439
+ metadataLoader(_) {
440
+ return Promise.resolve(attachFetcherMetadataBuilder);
441
+ }
442
+ async dataLoader(dataUnit, request) {
443
+ if (!request.source) {
444
+ return Promise.resolve({ records: this._records });
445
+ }
446
+ if (!Number.isNaN(Number(request.source))) {
447
+ const criteria = {
448
+ criteria: {
449
+ codata: request.source,
450
+ tipoAnexo: "N"
451
+ }
452
+ };
453
+ const applicationDataFetcher = await this._application.getDataFetcher();
454
+ const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
455
+ const records = [];
456
+ anexo.forEach((param) => {
457
+ records.push(Object.assign({ __record__id__: core.StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
458
+ name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
459
+ }] }, param));
460
+ });
461
+ this._records = records;
462
+ }
463
+ let records = pesquisaFetcher.applyFilter(this._records, dataUnit, request.filters);
464
+ records = pesquisaFetcher.applySorting(records, dataUnit, request.sort);
465
+ return Promise.resolve({ records, paginationInfo: pesquisaFetcher.buildPaginationInfo(records, request.offset, request.limit) });
466
+ }
467
+ saveLoader(changes, fetcher) {
468
+ return new Promise((resolve) => {
469
+ const change = Array.isArray(changes) ? changes[0] : {};
470
+ fetcher.save(change)
471
+ .then(resolve)
472
+ .catch((error) => {
473
+ if (error.message === ISave.SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
474
+ this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
475
+ return resolve([]);
476
+ }
477
+ if (error.message === ISave.SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
478
+ this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
479
+ return resolve([]);
480
+ }
481
+ if (error.message === ISave.SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
482
+ this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
483
+ return resolve([]);
484
+ }
485
+ if (error.message) {
486
+ this._application.error((error.title || error.name), error.message);
487
+ return resolve([]);
488
+ }
489
+ resolve([]);
490
+ });
491
+ });
492
+ }
493
+ removeLoader(dataUnit, ids, fetcher) {
494
+ return new Promise((resolve) => {
495
+ dataUnit.getSelectionInfo().records.forEach(async (record) => {
496
+ this._application.hasAccess(authFetcher.AutorizationType.REMOVE)
497
+ .then(async (hasAccess) => {
498
+ if (hasAccess) {
499
+ await fetcher.delete(record);
500
+ resolve(ids);
501
+ }
502
+ });
503
+ });
504
+ });
505
+ }
506
+ getFilters() {
507
+ throw new Error('Method not implemented.');
508
+ }
509
+ getInterceptions(dataUnit, action, crudRef) {
510
+ return new Promise((resolve) => {
511
+ if (action.type === core.Action.EDITION_CANCELED) {
512
+ if (!dataUnit.isDirty())
513
+ return resolve(action);
514
+ return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
515
+ if (cancellationConfirmed) {
516
+ crudRef.goToView(constants.VIEW_MODE.GRID);
517
+ return resolve(action);
518
+ }
519
+ return resolve(undefined);
520
+ });
521
+ }
522
+ if (action.type === core.Action.DATA_SAVED) {
523
+ dataUnit.loadData();
524
+ return resolve(action);
525
+ }
526
+ resolve(action);
527
+ });
528
+ }
529
+ }
530
+
261
531
  const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
262
532
  const getMessage = (key) => {
263
533
  var _a, _b;
@@ -304,7 +574,7 @@ const buildTaskBarManager = () => {
304
574
  };
305
575
  };
306
576
 
307
- const crudConfig = {
577
+ const anexoSistemaCrudConfig = {
308
578
  grid: {
309
579
  columns: [
310
580
  { name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },
@@ -350,40 +620,56 @@ const SnkAttach = class {
350
620
  constructor(hostRef) {
351
621
  index.registerInstance(this, hostRef);
352
622
  this.back = index.createEvent(this, "back", 7);
353
- this.handleTaskbarClick = ({ detail: taskbar }) => {
623
+ this.handleTaskbarClick = async ({ detail: taskbar }) => {
354
624
  if (["DOWNLOAD", "LINK"].includes(taskbar))
355
- return this.downloadAttachment(this.dataUnit.getSelectedRecord());
625
+ return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
626
+ if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
627
+ await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
628
+ }
356
629
  };
357
630
  this.handleBack = () => {
358
- this.dataUnit.cancelEdition().then((cancelationConfirmed) => {
631
+ this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
359
632
  if (cancelationConfirmed)
360
633
  this.back.emit();
361
634
  });
362
635
  };
363
636
  this.handleFinish = () => {
364
- if (!this.dataUnit.isDirty())
637
+ if (!this._currentDataUnit.isDirty())
365
638
  return this.back.emit();
366
- this.dataUnit.saveData().then(() => {
639
+ this._currentDataUnit.saveData().then(() => {
367
640
  this.showFinishedToast();
368
641
  this.back.emit();
369
642
  });
370
643
  };
644
+ this.fetcherType = undefined;
645
+ this.fetcher = undefined;
646
+ this.dataUnit = undefined;
647
+ this.dataUnitBuilder = undefined;
371
648
  this.registerKey = undefined;
372
649
  this.entityName = undefined;
373
650
  this.messagesBuilder = undefined;
374
- this.dataUnit = undefined;
651
+ this._currentFetcher = undefined;
652
+ this._currentDataUnit = undefined;
375
653
  this.crudConfig = undefined;
376
654
  }
377
655
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
378
- var _a;
379
- if (this.dataUnit == null) {
656
+ var _a, _b, _c, _d, _e, _f;
657
+ if (!this._currentDataUnit) {
380
658
  this.loadAttachmentDataUnit();
381
659
  }
382
660
  if (oldRegisterKey !== newRegisterKey) {
383
661
  this.returnToGridMode();
384
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
385
- this._dataUnitBuilder.initLoaders(this.dataUnit, this._attachFetcher, () => { this.returnToGridMode(); });
386
- this.dataUnit.loadData();
662
+ if (this.fetcherType === "AnexoSistema") {
663
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
664
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
665
+ return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
666
+ }
667
+ if (this.fetcherType === "Attach") {
668
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
669
+ if (hasMoreOneItem)
670
+ return;
671
+ }
672
+ 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));
387
673
  }
388
674
  }
389
675
  /**
@@ -406,44 +692,94 @@ const SnkAttach = class {
406
692
  window.open(`${selectedRecord.LINK}`);
407
693
  return;
408
694
  }
409
- this._attachFetcher.getDownloadKey(selectedRecord).then(({ chave }) => {
410
- window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}&forcarDownload=S`);
695
+ this._currentFetcher
696
+ .getDownloadKey(selectedRecord)
697
+ .then(({ chave }) => {
698
+ var _a;
699
+ let forceDownload = false;
700
+ if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
701
+ forceDownload = true;
702
+ }
703
+ window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
411
704
  });
412
705
  }
413
706
  returnToGridMode() {
414
- this.dataUnit.clearSelection();
707
+ var _a;
708
+ (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
415
709
  if (this._crudElement)
416
710
  this._crudElement.goToView(constants.VIEW_MODE.GRID);
417
711
  }
418
712
  loadAttachmentDataUnit() {
419
- var _a;
420
713
  try {
421
- const dataUnit = this.dataUnit || new dataunitFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
422
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
423
- if (!dataUnit.metadata)
424
- dataUnit.loadMetadata().then(() => {
425
- this.crudConfig = crudConfig;
426
- });
427
- this._dataUnitBuilder = new AttachmentDataUnitBuilder(this.entityName, this.getMessage.bind(this));
428
- dataUnit.addFilterProvider({ getFilter: () => this._dataUnitBuilder.getFilters(this.registerKey) });
429
- dataUnit.addInterceptor({ interceptAction: (action) => this._dataUnitBuilder.getInterceptions(dataUnit, action, this._crudElement) });
430
- this.dataUnit = dataUnit;
431
- this.dataUnit.loadData().then(() => {
432
- this.disableEditFieldsNotInForm();
433
- });
434
- return this.dataUnit;
714
+ switch (this.fetcherType) {
715
+ case "AnexoSistema":
716
+ this.loadAnexoSistema();
717
+ break;
718
+ case "Attach":
719
+ this.loadAttach();
720
+ break;
721
+ default:
722
+ this._currentFetcher = this.fetcher;
723
+ this._currentDataUnit = this.dataUnit;
724
+ this._currentDataUnitBuilder = this.dataUnitBuilder;
725
+ }
435
726
  }
436
727
  catch (error) {
437
728
  throw new Error('There was an error while creating the data unit');
438
729
  }
439
730
  }
731
+ loadAnexoSistema() {
732
+ var _a;
733
+ this._currentDataUnit = this._currentDataUnit || new pesquisaFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
734
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
735
+ if (!this._currentDataUnit.metadata) {
736
+ this._currentDataUnit
737
+ .loadMetadata()
738
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
739
+ }
740
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
741
+ this._currentDataUnit.addFilterProvider({
742
+ getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
743
+ });
744
+ this._currentDataUnit.addInterceptor({
745
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
746
+ });
747
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
748
+ }
749
+ loadAttach() {
750
+ var _a, _b, _c;
751
+ this._currentFetcher = new AttachFetcher();
752
+ this._currentDataUnit = new core.DataUnit(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
753
+ this._currentDataUnit.addInterceptor({
754
+ interceptAction: (action) => {
755
+ var _a;
756
+ if (action.type === core.Action.METADATA_LOADED) {
757
+ this.crudConfig = Object.assign({}, attachCrudConfig);
758
+ (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
759
+ }
760
+ return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
761
+ }
762
+ });
763
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
764
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
765
+ this.returnToGridMode();
766
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
767
+ });
768
+ if (!this._currentDataUnit.metadata) {
769
+ (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
770
+ var _a, _b;
771
+ this.crudConfig = Object.assign({}, attachCrudConfig);
772
+ (_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));
773
+ });
774
+ }
775
+ }
440
776
  disableEditFieldsNotInForm() {
441
777
  var _a;
442
778
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
443
779
  var _a;
444
780
  const fieldName = column.name;
445
781
  if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
446
- this.dataUnit.disableField(fieldName);
782
+ this._currentDataUnit.disableField(fieldName);
447
783
  }
448
784
  });
449
785
  }
@@ -451,15 +787,30 @@ const SnkAttach = class {
451
787
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
452
788
  }
453
789
  componentWillRender() {
454
- if (this.dataUnit == null) {
790
+ if (!this.fetcherType) {
791
+ this.fetcherType = "AnexoSistema";
792
+ }
793
+ if (this._currentDataUnit == null) {
455
794
  this.loadAttachmentDataUnit();
456
795
  }
457
796
  }
797
+ async handleOnDataStateChange({ detail }) {
798
+ if (this.fetcherType !== 'Attach')
799
+ return;
800
+ if (!detail.insertionMode) {
801
+ this._currentDataUnit.disableField('DESCRICAO');
802
+ }
803
+ else {
804
+ this._currentDataUnit.enableField('DESCRICAO');
805
+ }
806
+ await this._currentDataUnit.loadMetadata();
807
+ }
808
+ ;
458
809
  render() {
459
810
  var _a, _b;
460
- if (!this.dataUnit)
811
+ if (!this._currentDataUnit)
461
812
  return null;
462
- return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.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 }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
813
+ return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.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) }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
463
814
  }
464
815
  static get watchers() { return {
465
816
  "registerKey": ["registerKeyWatcher"]