@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,18 +1,123 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { ApplicationContext, DataType, Action } from '@sankhyalabs/core';
2
+ import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
- import { a as SaveErrorsEnum, d as defineCustomElement$8 } from './snk-actions-button2.js';
4
+ import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
5
+ import './index2.js';
6
+ import { a as SaveErrorsEnum, d as defineCustomElement$f } from './snk-actions-button2.js';
7
+ import './filter-item-type.enum.js';
8
+ import './form-config-fetcher.js';
5
9
  import { V as VIEW_MODE } from './constants.js';
6
- import { a as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
10
+ import { A as AutorizationType } from './auth-fetcher.js';
7
11
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
8
- import { d as defineCustomElement$7 } from './snk-data-exporter2.js';
9
- import { d as defineCustomElement$6 } from './snk-data-unit2.js';
10
- import { d as defineCustomElement$5 } from './snk-exporter-email-sender2.js';
11
- import { d as defineCustomElement$4 } from './snk-simple-bar2.js';
12
- import { d as defineCustomElement$3 } from './snk-simple-crud2.js';
12
+ import { d as defineCustomElement$e } from './snk-config-options2.js';
13
+ import { d as defineCustomElement$d } from './snk-configurator2.js';
14
+ import { d as defineCustomElement$c } from './snk-data-exporter2.js';
15
+ import { d as defineCustomElement$b } from './snk-data-unit2.js';
16
+ import { d as defineCustomElement$a } from './snk-exporter-email-sender2.js';
17
+ import { d as defineCustomElement$9 } from './snk-field-config2.js';
18
+ import { d as defineCustomElement$8 } from './snk-form-config2.js';
19
+ import { d as defineCustomElement$7 } from './snk-grid-config2.js';
20
+ import { d as defineCustomElement$6 } from './snk-select-box2.js';
21
+ import { d as defineCustomElement$5 } from './snk-simple-bar2.js';
22
+ import { d as defineCustomElement$4 } from './snk-simple-crud2.js';
23
+ import { d as defineCustomElement$3 } from './snk-tab-config2.js';
13
24
  import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
14
25
 
26
+ const SERVICE$1 = {
27
+ save: "Attach.save",
28
+ delete: "Attach.remove",
29
+ view: "Attach.view",
30
+ repository: "RepositorioArquivoSP.abreArquivo"
31
+ };
15
32
  class AttachFetcher {
33
+ constructor(dataUnitName) {
34
+ this.dataUnitName = dataUnitName;
35
+ }
36
+ async save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }) {
37
+ var _a, _b;
38
+ const isInsert = operation == "INSERT";
39
+ const dataBody = isInsert ? fields : record;
40
+ 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)) {
41
+ throw new Error(SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED);
42
+ }
43
+ const reqBody = {
44
+ "anexo": {
45
+ "codata": isInsert ? fields === null || fields === void 0 ? void 0 : fields.REGISTER_KEY : record === null || record === void 0 ? void 0 : record.CODATA,
46
+ "sequencia": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.SEQUENCIA) || "0",
47
+ "tipo": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.TIPO) || "N",
48
+ "descricao": dataBody === null || dataBody === void 0 ? void 0 : dataBody.DESCRICAO,
49
+ "arquivo": (_b = (_a = fields.CAMINHO_ARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name,
50
+ "ehInclusao": isInsert ? "S" : "N",
51
+ "ehArquivoRepositorio": "N"
52
+ }
53
+ };
54
+ return new Promise((resolve, reject) => {
55
+ DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
56
+ .then(result => {
57
+ var _a;
58
+ return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
59
+ })
60
+ .catch(error => reject(error));
61
+ });
62
+ }
63
+ async edit(change) {
64
+ throw new Error("Method not implemented.");
65
+ }
66
+ async delete(record) {
67
+ var request = {
68
+ anexo: {
69
+ codata: record.CODATA,
70
+ tipo: record.TIPO,
71
+ descricao: record.DESCRICAO,
72
+ }
73
+ };
74
+ const result = await DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
75
+ return Promise.resolve(result);
76
+ }
77
+ async getDownloadKey(record) {
78
+ var _a, _b, _c;
79
+ if (record.EHARQUIVOREPOSITORIO == 'S') {
80
+ const request = {
81
+ config: {
82
+ path: record.ARQUIVO,
83
+ tipoconteudo: record.TIPOCONTEUDO
84
+ }
85
+ };
86
+ const result = await DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
87
+ return Promise.resolve({
88
+ chave: {
89
+ 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
90
+ }
91
+ });
92
+ }
93
+ const criteria = {
94
+ anexo: {
95
+ codata: record.CODATA,
96
+ codemp: record.CODEMP,
97
+ sequencia: record.SEQUENCIA,
98
+ tipo: record.TIPO,
99
+ descricao: record.DESCRICAO,
100
+ tipoConteudo: record.TIPOCONTEUDO
101
+ }
102
+ };
103
+ const result = await DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
104
+ if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
105
+ return Promise.resolve({
106
+ chave: {
107
+ valor: (_c = result === null || result === void 0 ? void 0 : result.chaveAnexo) === null || _c === void 0 ? void 0 : _c.idChaveAnexo
108
+ }
109
+ });
110
+ }
111
+ return Promise.reject(new Error("File not found."));
112
+ }
113
+ }
114
+
115
+ const SERVICE = {
116
+ save: "AnexoSistemaSP.salvar",
117
+ delete: "AnexoSistemaSP.excluir",
118
+ download: "AnexoSistemaSP.baixar",
119
+ };
120
+ class AnexoSistemaFetcher {
16
121
  constructor(entityName, registerKey, dataUnitName) {
17
122
  var _a;
18
123
  this.entityName = entityName;
@@ -30,14 +135,13 @@ class AttachFetcher {
30
135
  }
31
136
  async save(change) {
32
137
  var _a, _b;
33
- const serviceName = "AnexoSistemaSP.salvar";
34
138
  let { updatingFields: fields } = change;
35
139
  fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
36
140
  try {
37
141
  this.validateFields(fields);
38
142
  const fileInfo = !fields.LINK ? fields.NOMEARQUIVO : null;
39
143
  const reqBody = {
40
- serviceName,
144
+ serviceName: SERVICE.save,
41
145
  requestBody: {
42
146
  params: {
43
147
  resourceID: this.resourceID,
@@ -53,7 +157,7 @@ class AttachFetcher {
53
157
  }
54
158
  }
55
159
  };
56
- const result = await DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
160
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
57
161
  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 })]);
58
162
  }
59
163
  catch (error) {
@@ -62,7 +166,6 @@ class AttachFetcher {
62
166
  }
63
167
  async edit(change) {
64
168
  var _a, _b, _c;
65
- const serviceName = "AnexoSistemaSP.salvar";
66
169
  let { updatingFields: fields, record } = change;
67
170
  const getFieldValue = (fieldValue) => {
68
171
  if (fields[fieldValue] !== undefined)
@@ -76,7 +179,7 @@ class AttachFetcher {
76
179
  try {
77
180
  this.validateFields(fields);
78
181
  const reqBody = {
79
- serviceName,
182
+ serviceName: SERVICE.save,
80
183
  requestBody: {
81
184
  params: {
82
185
  resourceID: this.resourceID,
@@ -94,7 +197,7 @@ class AttachFetcher {
94
197
  }
95
198
  }
96
199
  };
97
- const result = await DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
200
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
98
201
  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 })]);
99
202
  }
100
203
  catch (error) {
@@ -103,10 +206,9 @@ class AttachFetcher {
103
206
  }
104
207
  delete(record) {
105
208
  var _a;
106
- const serviceName = "AnexoSistemaSP.excluir";
107
209
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
108
210
  const reqBody = {
109
- serviceName,
211
+ serviceName: SERVICE.delete,
110
212
  requestBody: {
111
213
  paramsDelete: {
112
214
  keyAttach: record.CHAVEARQUIVO,
@@ -118,17 +220,16 @@ class AttachFetcher {
118
220
  }
119
221
  };
120
222
  return new Promise((resolve, reject) => {
121
- DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
223
+ DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
122
224
  .then(result => resolve(result))
123
225
  .catch(error => reject(error));
124
226
  });
125
227
  }
126
228
  getDownloadKey(record) {
127
229
  var _a;
128
- const serviceName = "AnexoSistemaSP.baixar";
129
230
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
130
231
  const reqBody = {
131
- serviceName,
232
+ serviceName: SERVICE.download,
132
233
  requestBody: {
133
234
  paramsDown: {
134
235
  nameAttach: attachField === null || attachField === void 0 ? void 0 : attachField.name,
@@ -140,34 +241,37 @@ class AttachFetcher {
140
241
  }
141
242
  };
142
243
  return new Promise((resolve, reject) => {
143
- DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
244
+ DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
144
245
  .then(result => resolve(result))
145
246
  .catch(error => reject(error));
146
247
  });
147
248
  }
148
249
  }
149
250
 
150
- class AttachmentDataUnitBuilder {
251
+ class AnexoSistemaDataUnitFactory {
151
252
  constructor(entityName, getMessage) {
152
253
  this.entityName = entityName;
153
254
  this.getMessage = getMessage;
154
255
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
155
256
  }
156
- initLoaders(dataUnit, attachFetcher, onSuccess) {
257
+ initLoaders(dataUnit, fetcher, onSuccess) {
157
258
  if (!this.loader)
158
259
  this.loader = dataUnit.dataLoader;
159
260
  dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
160
- dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, attachFetcher).then((recordIds) => {
261
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
161
262
  if (recordIds.length)
162
263
  onSuccess();
163
264
  return recordIds;
164
265
  });
165
- dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, attachFetcher).then((recordIds) => {
266
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
166
267
  if (recordIds.length)
167
268
  onSuccess();
168
269
  return recordIds;
169
270
  });
170
271
  }
272
+ metadataLoader(dataUnit) {
273
+ throw new Error("Method not implemented.");
274
+ }
171
275
  dataLoader(dataUnit, request) {
172
276
  return new Promise(resolve => {
173
277
  this.loader(dataUnit, request).then(response => {
@@ -183,11 +287,11 @@ class AttachmentDataUnitBuilder {
183
287
  });
184
288
  });
185
289
  }
186
- saveLoader(changes, attachFetcher) {
290
+ saveLoader(changes, fetcher) {
187
291
  return new Promise((resolve) => {
188
292
  var _a;
189
293
  const change = Array.isArray(changes) ? changes[0] : {};
190
- 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);
294
+ 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);
191
295
  savePromise(change).then((records) => {
192
296
  resolve(records);
193
297
  }).catch((error) => {
@@ -207,11 +311,11 @@ class AttachmentDataUnitBuilder {
207
311
  });
208
312
  });
209
313
  }
210
- removeLoader(dataUnit, ids, attachFetcher) {
314
+ removeLoader(dataUnit, ids, fetcher) {
211
315
  return new Promise((resolve) => {
212
316
  const { records } = dataUnit.getSelectionInfo();
213
317
  const recordToDelete = records[0];
214
- attachFetcher.delete(recordToDelete).then(() => {
318
+ fetcher.delete(recordToDelete).then(() => {
215
319
  PreloadManager.removeRecords(dataUnit, [recordToDelete]);
216
320
  return resolve(ids);
217
321
  });
@@ -252,6 +356,181 @@ class AttachmentDataUnitBuilder {
252
356
  }
253
357
  }
254
358
 
359
+ const application$1 = ApplicationContext.getContextValue("__SNK__APPLICATION__");
360
+ const getMessage$1 = (key) => {
361
+ var _a, _b;
362
+ 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);
363
+ };
364
+ const attachCrudConfig = {
365
+ grid: {
366
+ columns: [
367
+ { name: "CODATA", orderIndex: 0, width: 0 },
368
+ { name: "DESCRICAO", orderIndex: 1, width: 0 },
369
+ { name: "ARQUIVO", orderIndex: 2, width: 0 },
370
+ { name: "DTALTER", orderIndex: 3, width: 0 },
371
+ { name: "USUARIO", orderIndex: 4, width: 0 },
372
+ ],
373
+ },
374
+ form: {
375
+ emptyConfig: false,
376
+ fields: [
377
+ {
378
+ name: "DESCRICAO",
379
+ label: getMessage$1("snkAttach.attachMetadata.lblDescription"),
380
+ visible: true,
381
+ readOnly: false,
382
+ required: true,
383
+ },
384
+ {
385
+ name: "CAMINHO_ARQUIVO",
386
+ label: getMessage$1("snkAttach.attachMetadata.lblFile"),
387
+ visible: true,
388
+ readOnly: false,
389
+ required: true,
390
+ },
391
+ ],
392
+ },
393
+ };
394
+ const attachFetcherMetadataBuilder = {
395
+ name: "Attach",
396
+ label: "Attach List",
397
+ fields: [
398
+ { name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: DataType.TEXT },
399
+ { name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: DataType.TEXT, readOnly: false },
400
+ { name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: DataType.TEXT },
401
+ { name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: DataType.TEXT },
402
+ { name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: DataType.TEXT },
403
+ {
404
+ name: "CAMINHO_ARQUIVO",
405
+ label: getMessage$1("snkAttach.attachMetadata.lblFileUpload"),
406
+ dataType: DataType.OBJECT,
407
+ userInterface: UserInterface.FILE,
408
+ readOnly: false,
409
+ required: true,
410
+ visible: true,
411
+ properties: {
412
+ subTitle: getMessage$1("snkAttach.attachMetadata.lblSubTitle"),
413
+ MAX_FILES: 1,
414
+ STORAGESTRATEGY: "SESSION",
415
+ INTERNAL_FILENAME: "Attach.upload",
416
+ }
417
+ },
418
+ ],
419
+ };
420
+
421
+ const SERVICE_LOAD = "Attach.load";
422
+ class AttachFetcherDataUnitFactory {
423
+ constructor(getMessage) {
424
+ this.getMessage = getMessage;
425
+ this._records = [];
426
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
427
+ }
428
+ initLoaders(dataUnit, fetcher, onSuccess) {
429
+ dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
430
+ dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
431
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
432
+ if (recordIds.length)
433
+ onSuccess();
434
+ return recordIds;
435
+ });
436
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
437
+ if (recordIds.length)
438
+ onSuccess();
439
+ return recordIds;
440
+ });
441
+ }
442
+ metadataLoader(_) {
443
+ return Promise.resolve(attachFetcherMetadataBuilder);
444
+ }
445
+ async dataLoader(dataUnit, request) {
446
+ if (!request.source) {
447
+ return Promise.resolve({ records: this._records });
448
+ }
449
+ if (!Number.isNaN(Number(request.source))) {
450
+ const criteria = {
451
+ criteria: {
452
+ codata: request.source,
453
+ tipoAnexo: "N"
454
+ }
455
+ };
456
+ const applicationDataFetcher = await this._application.getDataFetcher();
457
+ const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
458
+ const records = [];
459
+ anexo.forEach((param) => {
460
+ records.push(Object.assign({ __record__id__: StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
461
+ name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
462
+ }] }, param));
463
+ });
464
+ this._records = records;
465
+ }
466
+ let records = applyFilter(this._records, dataUnit, request.filters);
467
+ records = applySorting(records, dataUnit, request.sort);
468
+ return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
469
+ }
470
+ saveLoader(changes, fetcher) {
471
+ return new Promise((resolve) => {
472
+ const change = Array.isArray(changes) ? changes[0] : {};
473
+ fetcher.save(change)
474
+ .then(resolve)
475
+ .catch((error) => {
476
+ if (error.message === SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
477
+ this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
478
+ return resolve([]);
479
+ }
480
+ if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
481
+ this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
482
+ return resolve([]);
483
+ }
484
+ if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
485
+ this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
486
+ return resolve([]);
487
+ }
488
+ if (error.message) {
489
+ this._application.error((error.title || error.name), error.message);
490
+ return resolve([]);
491
+ }
492
+ resolve([]);
493
+ });
494
+ });
495
+ }
496
+ removeLoader(dataUnit, ids, fetcher) {
497
+ return new Promise((resolve) => {
498
+ dataUnit.getSelectionInfo().records.forEach(async (record) => {
499
+ this._application.hasAccess(AutorizationType.REMOVE)
500
+ .then(async (hasAccess) => {
501
+ if (hasAccess) {
502
+ await fetcher.delete(record);
503
+ resolve(ids);
504
+ }
505
+ });
506
+ });
507
+ });
508
+ }
509
+ getFilters() {
510
+ throw new Error('Method not implemented.');
511
+ }
512
+ getInterceptions(dataUnit, action, crudRef) {
513
+ return new Promise((resolve) => {
514
+ if (action.type === Action.EDITION_CANCELED) {
515
+ if (!dataUnit.isDirty())
516
+ return resolve(action);
517
+ return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
518
+ if (cancellationConfirmed) {
519
+ crudRef.goToView(VIEW_MODE.GRID);
520
+ return resolve(action);
521
+ }
522
+ return resolve(undefined);
523
+ });
524
+ }
525
+ if (action.type === Action.DATA_SAVED) {
526
+ dataUnit.loadData();
527
+ return resolve(action);
528
+ }
529
+ resolve(action);
530
+ });
531
+ }
532
+ }
533
+
255
534
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
256
535
  const getMessage = (key) => {
257
536
  var _a, _b;
@@ -298,7 +577,7 @@ const buildTaskBarManager = () => {
298
577
  };
299
578
  };
300
579
 
301
- const crudConfig = {
580
+ const anexoSistemaCrudConfig = {
302
581
  grid: {
303
582
  columns: [
304
583
  { name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },
@@ -345,40 +624,56 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
345
624
  super();
346
625
  this.__registerHost();
347
626
  this.back = createEvent(this, "back", 7);
348
- this.handleTaskbarClick = ({ detail: taskbar }) => {
627
+ this.handleTaskbarClick = async ({ detail: taskbar }) => {
349
628
  if (["DOWNLOAD", "LINK"].includes(taskbar))
350
- return this.downloadAttachment(this.dataUnit.getSelectedRecord());
629
+ return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
630
+ if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
631
+ await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
632
+ }
351
633
  };
352
634
  this.handleBack = () => {
353
- this.dataUnit.cancelEdition().then((cancelationConfirmed) => {
635
+ this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
354
636
  if (cancelationConfirmed)
355
637
  this.back.emit();
356
638
  });
357
639
  };
358
640
  this.handleFinish = () => {
359
- if (!this.dataUnit.isDirty())
641
+ if (!this._currentDataUnit.isDirty())
360
642
  return this.back.emit();
361
- this.dataUnit.saveData().then(() => {
643
+ this._currentDataUnit.saveData().then(() => {
362
644
  this.showFinishedToast();
363
645
  this.back.emit();
364
646
  });
365
647
  };
648
+ this.fetcherType = undefined;
649
+ this.fetcher = undefined;
650
+ this.dataUnit = undefined;
651
+ this.dataUnitBuilder = undefined;
366
652
  this.registerKey = undefined;
367
653
  this.entityName = undefined;
368
654
  this.messagesBuilder = undefined;
369
- this.dataUnit = undefined;
655
+ this._currentFetcher = undefined;
656
+ this._currentDataUnit = undefined;
370
657
  this.crudConfig = undefined;
371
658
  }
372
659
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
373
- var _a;
374
- if (this.dataUnit == null) {
660
+ var _a, _b, _c, _d, _e, _f;
661
+ if (!this._currentDataUnit) {
375
662
  this.loadAttachmentDataUnit();
376
663
  }
377
664
  if (oldRegisterKey !== newRegisterKey) {
378
665
  this.returnToGridMode();
379
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
380
- this._dataUnitBuilder.initLoaders(this.dataUnit, this._attachFetcher, () => { this.returnToGridMode(); });
381
- this.dataUnit.loadData();
666
+ if (this.fetcherType === "AnexoSistema") {
667
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
668
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
669
+ return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
670
+ }
671
+ if (this.fetcherType === "Attach") {
672
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
673
+ if (hasMoreOneItem)
674
+ return;
675
+ }
676
+ 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));
382
677
  }
383
678
  }
384
679
  /**
@@ -401,44 +696,94 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
401
696
  window.open(`${selectedRecord.LINK}`);
402
697
  return;
403
698
  }
404
- this._attachFetcher.getDownloadKey(selectedRecord).then(({ chave }) => {
405
- window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}&forcarDownload=S`);
699
+ this._currentFetcher
700
+ .getDownloadKey(selectedRecord)
701
+ .then(({ chave }) => {
702
+ var _a;
703
+ let forceDownload = false;
704
+ if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
705
+ forceDownload = true;
706
+ }
707
+ window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
406
708
  });
407
709
  }
408
710
  returnToGridMode() {
409
- this.dataUnit.clearSelection();
711
+ var _a;
712
+ (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
410
713
  if (this._crudElement)
411
714
  this._crudElement.goToView(VIEW_MODE.GRID);
412
715
  }
413
716
  loadAttachmentDataUnit() {
414
- var _a;
415
717
  try {
416
- const dataUnit = this.dataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
417
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
418
- if (!dataUnit.metadata)
419
- dataUnit.loadMetadata().then(() => {
420
- this.crudConfig = crudConfig;
421
- });
422
- this._dataUnitBuilder = new AttachmentDataUnitBuilder(this.entityName, this.getMessage.bind(this));
423
- dataUnit.addFilterProvider({ getFilter: () => this._dataUnitBuilder.getFilters(this.registerKey) });
424
- dataUnit.addInterceptor({ interceptAction: (action) => this._dataUnitBuilder.getInterceptions(dataUnit, action, this._crudElement) });
425
- this.dataUnit = dataUnit;
426
- this.dataUnit.loadData().then(() => {
427
- this.disableEditFieldsNotInForm();
428
- });
429
- return this.dataUnit;
718
+ switch (this.fetcherType) {
719
+ case "AnexoSistema":
720
+ this.loadAnexoSistema();
721
+ break;
722
+ case "Attach":
723
+ this.loadAttach();
724
+ break;
725
+ default:
726
+ this._currentFetcher = this.fetcher;
727
+ this._currentDataUnit = this.dataUnit;
728
+ this._currentDataUnitBuilder = this.dataUnitBuilder;
729
+ }
430
730
  }
431
731
  catch (error) {
432
732
  throw new Error('There was an error while creating the data unit');
433
733
  }
434
734
  }
735
+ loadAnexoSistema() {
736
+ var _a;
737
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
738
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
739
+ if (!this._currentDataUnit.metadata) {
740
+ this._currentDataUnit
741
+ .loadMetadata()
742
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
743
+ }
744
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
745
+ this._currentDataUnit.addFilterProvider({
746
+ getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
747
+ });
748
+ this._currentDataUnit.addInterceptor({
749
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
750
+ });
751
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
752
+ }
753
+ loadAttach() {
754
+ var _a, _b, _c;
755
+ this._currentFetcher = new AttachFetcher();
756
+ this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
757
+ this._currentDataUnit.addInterceptor({
758
+ interceptAction: (action) => {
759
+ var _a;
760
+ if (action.type === Action.METADATA_LOADED) {
761
+ this.crudConfig = Object.assign({}, attachCrudConfig);
762
+ (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
763
+ }
764
+ return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
765
+ }
766
+ });
767
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
768
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
769
+ this.returnToGridMode();
770
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
771
+ });
772
+ if (!this._currentDataUnit.metadata) {
773
+ (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
774
+ var _a, _b;
775
+ this.crudConfig = Object.assign({}, attachCrudConfig);
776
+ (_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));
777
+ });
778
+ }
779
+ }
435
780
  disableEditFieldsNotInForm() {
436
781
  var _a;
437
782
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
438
783
  var _a;
439
784
  const fieldName = column.name;
440
785
  if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
441
- this.dataUnit.disableField(fieldName);
786
+ this._currentDataUnit.disableField(fieldName);
442
787
  }
443
788
  });
444
789
  }
@@ -446,32 +791,52 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
446
791
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
447
792
  }
448
793
  componentWillRender() {
449
- if (this.dataUnit == null) {
794
+ if (!this.fetcherType) {
795
+ this.fetcherType = "AnexoSistema";
796
+ }
797
+ if (this._currentDataUnit == null) {
450
798
  this.loadAttachmentDataUnit();
451
799
  }
452
800
  }
801
+ async handleOnDataStateChange({ detail }) {
802
+ if (this.fetcherType !== 'Attach')
803
+ return;
804
+ if (!detail.insertionMode) {
805
+ this._currentDataUnit.disableField('DESCRICAO');
806
+ }
807
+ else {
808
+ this._currentDataUnit.enableField('DESCRICAO');
809
+ }
810
+ await this._currentDataUnit.loadMetadata();
811
+ }
812
+ ;
453
813
  render() {
454
814
  var _a, _b;
455
- if (!this.dataUnit)
815
+ if (!this._currentDataUnit)
456
816
  return null;
457
- 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")))))))));
817
+ 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")))))))));
458
818
  }
459
819
  static get watchers() { return {
460
820
  "registerKey": ["registerKeyWatcher"]
461
821
  }; }
462
822
  static get style() { return snkAttachCss; }
463
823
  }, [2, "snk-attach", {
824
+ "fetcherType": [1, "fetcher-type"],
825
+ "fetcher": [16],
826
+ "dataUnit": [16],
827
+ "dataUnitBuilder": [16],
464
828
  "registerKey": [1, "register-key"],
465
829
  "entityName": [1, "entity-name"],
466
830
  "messagesBuilder": [1040],
467
- "dataUnit": [32],
831
+ "_currentFetcher": [32],
832
+ "_currentDataUnit": [32],
468
833
  "crudConfig": [32]
469
834
  }]);
470
835
  function defineCustomElement() {
471
836
  if (typeof customElements === "undefined") {
472
837
  return;
473
838
  }
474
- const components = ["snk-attach", "snk-actions-button", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-simple-bar", "snk-simple-crud", "snk-taskbar", "taskbar-actions-button"];
839
+ const components = ["snk-attach", "snk-actions-button", "snk-config-options", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-field-config", "snk-form-config", "snk-grid-config", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-tab-config", "snk-taskbar", "taskbar-actions-button"];
475
840
  components.forEach(tagName => { switch (tagName) {
476
841
  case "snk-attach":
477
842
  if (!customElements.get(tagName)) {
@@ -480,30 +845,65 @@ function defineCustomElement() {
480
845
  break;
481
846
  case "snk-actions-button":
482
847
  if (!customElements.get(tagName)) {
483
- defineCustomElement$8();
848
+ defineCustomElement$f();
849
+ }
850
+ break;
851
+ case "snk-config-options":
852
+ if (!customElements.get(tagName)) {
853
+ defineCustomElement$e();
854
+ }
855
+ break;
856
+ case "snk-configurator":
857
+ if (!customElements.get(tagName)) {
858
+ defineCustomElement$d();
484
859
  }
485
860
  break;
486
861
  case "snk-data-exporter":
487
862
  if (!customElements.get(tagName)) {
488
- defineCustomElement$7();
863
+ defineCustomElement$c();
489
864
  }
490
865
  break;
491
866
  case "snk-data-unit":
492
867
  if (!customElements.get(tagName)) {
493
- defineCustomElement$6();
868
+ defineCustomElement$b();
494
869
  }
495
870
  break;
496
871
  case "snk-exporter-email-sender":
497
872
  if (!customElements.get(tagName)) {
498
- defineCustomElement$5();
873
+ defineCustomElement$a();
874
+ }
875
+ break;
876
+ case "snk-field-config":
877
+ if (!customElements.get(tagName)) {
878
+ defineCustomElement$9();
879
+ }
880
+ break;
881
+ case "snk-form-config":
882
+ if (!customElements.get(tagName)) {
883
+ defineCustomElement$8();
884
+ }
885
+ break;
886
+ case "snk-grid-config":
887
+ if (!customElements.get(tagName)) {
888
+ defineCustomElement$7();
889
+ }
890
+ break;
891
+ case "snk-select-box":
892
+ if (!customElements.get(tagName)) {
893
+ defineCustomElement$6();
499
894
  }
500
895
  break;
501
896
  case "snk-simple-bar":
502
897
  if (!customElements.get(tagName)) {
503
- defineCustomElement$4();
898
+ defineCustomElement$5();
504
899
  }
505
900
  break;
506
901
  case "snk-simple-crud":
902
+ if (!customElements.get(tagName)) {
903
+ defineCustomElement$4();
904
+ }
905
+ break;
906
+ case "snk-tab-config":
507
907
  if (!customElements.get(tagName)) {
508
908
  defineCustomElement$3();
509
909
  }