@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
@@ -86,29 +86,29 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
86
86
  case TaskbarElement.CONFIGURATOR:
87
87
  return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
88
88
  case TaskbarElement.MORE_OPTIONS:
89
- return actionButton(element, dataElementId, title, isEnabled, actions, action);
89
+ return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
90
90
  case TaskbarElement.DIVIDER:
91
- return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
91
+ return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
92
92
  case TaskbarElement.DATA_EXPORTER:
93
93
  const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
94
- return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId });
94
+ return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
95
95
  case TaskbarElement.ATTACH:
96
96
  return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
97
97
  case TaskbarElement.ACTIONS_BUTTON:
98
- return h("snk-actions-button", { "data-element-id": dataElementId });
98
+ return h("snk-actions-button", { "data-element-id": dataElementId, "data-taskbar-element": element });
99
99
  }
100
100
  };
101
101
  function textButton(name, className, dataElementId, text, title, action, isEnabled) {
102
- return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
102
+ return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-taskbar-label": text, "data-taskbar-element": name, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
103
103
  }
104
104
  function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
105
- return h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
105
+ return h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-taskbar-label": title, "data-taskbar-element": name, "data-taskbar-icon": iconName, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
106
106
  }
107
107
  function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
108
- return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
108
+ return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-taskbar-label": text, "data-taskbar-icon": iconName, "data-taskbar-element": name, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
109
109
  }
110
- function actionButton(element, dataElementId, title, isEnabled, actions, action) {
110
+ function actionButton(element, className, dataElementId, title, isEnabled, actions, action) {
111
111
  return actions && actions.length > 0
112
- ? h("taskbar-actions-button", { key: dataElementId, title: title, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
112
+ ? h("taskbar-actions-button", { class: className, key: dataElementId, title: title, "data-taskbar-element": element, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
113
113
  : undefined;
114
114
  }
@@ -1,3 +1,20 @@
1
1
  :host {
2
2
  display: flex;
3
+ flex-wrap: wrap;
4
+ }
5
+
6
+ :host.no-wrap {
7
+ flex-wrap: nowrap;
8
+ }
9
+
10
+ :host.full-width{
11
+ width: 100%;
12
+ }
13
+
14
+ :host.align-right{
15
+ justify-content: flex-end;
16
+ }
17
+
18
+ .overflowed {
19
+ display: none;
3
20
  }
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
1
+ import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
4
4
  import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
@@ -6,6 +6,9 @@ import { PresentationMode } from '../../lib/@types';
6
6
  export class SnkTaskbar {
7
7
  constructor() {
8
8
  this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
9
+ this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
10
+ this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
11
+ this.NOT_OVERFLOW_ELEMENTS = ["moreOptions", "dataExporter_snkDataExporter", "actionsButton_snkActionsButton"];
9
12
  this._titleKeyByElement = {
10
13
  [TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
11
14
  [TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
@@ -23,11 +26,17 @@ export class SnkTaskbar {
23
26
  [TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
24
27
  };
25
28
  this._permissions = undefined;
29
+ this._overFlowedElements = [];
26
30
  this._customElements = undefined;
27
31
  this._customElementsId = undefined;
28
32
  this._slotContainer = undefined;
33
+ this._hiddenActionsList = [];
34
+ this._lastWidth = undefined;
35
+ this._hasToUpdateOverFlow = false;
36
+ this.alignRigth = false;
29
37
  this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
30
38
  this.customContainerId = undefined;
39
+ this.overflowStrategy = 'hiddenItems';
31
40
  this.configName = undefined;
32
41
  this.resourceID = undefined;
33
42
  this.buttons = undefined;
@@ -41,6 +50,18 @@ export class SnkTaskbar {
41
50
  }
42
51
  observeButtons() {
43
52
  this._definitions = undefined;
53
+ requestAnimationFrame(() => {
54
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
55
+ });
56
+ }
57
+ observeDisabledButtons() {
58
+ var _a;
59
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
60
+ }
61
+ observeLastWidth(newValue, oldValue) {
62
+ if (oldValue === 0 && newValue !== 0) {
63
+ this._hasToUpdateOverFlow = true;
64
+ }
44
65
  }
45
66
  // Internal methods
46
67
  elementsFromString(strButtons) {
@@ -136,12 +157,19 @@ export class SnkTaskbar {
136
157
  }
137
158
  const taskbarElement = TaskbarElement[def.toString()];
138
159
  if (taskbarElement) {
139
- return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName, this.presentationMode);
160
+ return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
140
161
  }
141
162
  else {
142
163
  return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
143
164
  }
144
165
  }
166
+ buildDynamicActionsList() {
167
+ var _a;
168
+ if (this._hiddenActionsList.length) {
169
+ return [...((_a = this.actionsList) !== null && _a !== void 0 ? _a : []), { type: 'divider', label: "", value: "" }, ...this._hiddenActionsList];
170
+ }
171
+ return this.actionsList;
172
+ }
145
173
  getIdElemBtnNative(taskbarElem) {
146
174
  return StringUtils.toCamelCase(taskbarElem);
147
175
  }
@@ -182,11 +210,13 @@ export class SnkTaskbar {
182
210
  });
183
211
  }
184
212
  addCustomElementContainer(elem) {
213
+ var _a;
185
214
  const elementId = `${this.TASKBAR_ITEM_ID_PREFIX}${elem}`;
186
215
  if (!this._customElementsId.includes(elementId)) {
187
216
  this._customElementsId.push(elementId);
217
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
188
218
  }
189
- return h("span", { key: elementId, id: elementId });
219
+ return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
190
220
  }
191
221
  getCustomElements() {
192
222
  var _a, _b;
@@ -216,20 +246,95 @@ export class SnkTaskbar {
216
246
  this.getCustomElements();
217
247
  }
218
248
  componentWillRender() {
249
+ this.handleDefinitions();
250
+ this.validatePresentationMode();
251
+ this.updateOverFlowIfNeeded();
252
+ }
253
+ handleDefinitions() {
219
254
  if (this._definitions == undefined && this._permissions) {
220
255
  this._definitions = this.elementsFromString(this.buttons);
221
256
  }
222
- this.validatePresentationMode();
257
+ }
258
+ updateOverFlowIfNeeded() {
259
+ if (this._hasToUpdateOverFlow) {
260
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
261
+ this._hasToUpdateOverFlow = false;
262
+ }
263
+ }
264
+ handleOverFlow(overFlowingElements) {
265
+ const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
266
+ this.resetOverFlowedElements();
267
+ this.doOverFlowElements(elementsToHandle);
268
+ }
269
+ resetOverFlowedElements() {
270
+ this._overFlowedElements.forEach(element => {
271
+ element.classList.remove(OVERFLOWED_CLASS_NAME);
272
+ });
273
+ this._hiddenActionsList = [];
274
+ this._overFlowedElements = [];
275
+ }
276
+ doOverFlowElements(overFlowedElements) {
277
+ overFlowedElements.forEach(element => {
278
+ element.classList.add(OVERFLOWED_CLASS_NAME);
279
+ this._overFlowedElements.push(element);
280
+ this.addItemToActionList(element);
281
+ });
282
+ }
283
+ addItemToActionList(element) {
284
+ const taskbarElement = this.getTaskbarElementName(element);
285
+ if (taskbarElement && this.isEnabled(taskbarElement) && this.isAllowed(taskbarElement)) {
286
+ const optionItem = {
287
+ value: taskbarElement,
288
+ label: this.getTaskbarElementLabel(element),
289
+ iconName: this.getTaskbarElementIcon(element)
290
+ };
291
+ this._hiddenActionsList.push(optionItem);
292
+ }
293
+ }
294
+ getTaskbarElementName(element) {
295
+ var _a;
296
+ return (_a = element.getAttribute('data-taskbar-element')) !== null && _a !== void 0 ? _a : "";
297
+ }
298
+ getTaskbarElementIcon(element) {
299
+ var _a;
300
+ return (_a = element.getAttribute('data-taskbar-icon')) !== null && _a !== void 0 ? _a : "";
301
+ }
302
+ getTaskbarElementLabel(element) {
303
+ var _a;
304
+ return (_a = element.getAttribute('data-taskbar-label')) !== null && _a !== void 0 ? _a : "";
305
+ }
306
+ hasToIgnoreOverFlow(element) {
307
+ return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
308
+ }
309
+ handleOverFlowStrategy() {
310
+ if (this.overflowStrategy === 'hiddenItems') {
311
+ this._overFlowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
312
+ }
313
+ }
314
+ buildOverFlowWatcherParams() {
315
+ return {
316
+ element: this._element,
317
+ callback: this.handleOverFlow.bind(this),
318
+ overFlowDirection: OverflowDirection.HORIZONTAL,
319
+ notOverFlow: this.NOT_OVERFLOW_ELEMENTS
320
+ };
223
321
  }
224
322
  componentDidLoad() {
225
323
  const dataInfo = { dataUnit: this.dataUnit };
226
324
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
325
+ this.handleOverFlowStrategy();
227
326
  }
228
327
  componentDidRender() {
229
328
  this.appendCustomElementsInTaskbar();
329
+ this.updateLastWidth();
330
+ }
331
+ updateLastWidth() {
332
+ this._lastWidth = this._element.getBoundingClientRect().width;
230
333
  }
231
334
  disconnectedCallback() {
335
+ var _a;
232
336
  this.unlinkAllCustomElements();
337
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
233
338
  }
234
339
  unlinkAllCustomElements() {
235
340
  var _a;
@@ -247,14 +352,9 @@ export class SnkTaskbar {
247
352
  return undefined;
248
353
  }
249
354
  let index = 0;
250
- return (h(Host, null, this.removeEmpty(this._definitions.map((elem) => {
251
- var _a;
252
- if (elem === TaskbarElement.DIVIDER) {
253
- index = 0;
254
- }
255
- else {
256
- index++;
257
- }
355
+ return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
356
+ var _a, _b;
357
+ index++;
258
358
  if (TaskbarElement[elem]) {
259
359
  return this.getElement(index, TaskbarElement[elem]);
260
360
  }
@@ -264,8 +364,14 @@ export class SnkTaskbar {
264
364
  if (this._customElements.has(elem)) {
265
365
  return this.addCustomElementContainer(elem);
266
366
  }
367
+ (_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.addNotOverFlowElement(elem);
267
368
  return h("slot", { name: elem });
268
- })), h("div", { class: "taskbar-custom-elements-container" }, h("slot", { name: this.customSlotId }))));
369
+ })), h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, h("slot", { name: this.customSlotId }))));
370
+ }
371
+ getHostClasses() {
372
+ if (this.overflowStrategy !== 'hiddenItems')
373
+ return 'no-wrap';
374
+ return `full-width ${this.alignRigth ? 'align-right' : ""}`;
269
375
  }
270
376
  static get is() { return "snk-taskbar"; }
271
377
  static get encapsulation() { return "scoped"; }
@@ -281,6 +387,24 @@ export class SnkTaskbar {
281
387
  }
282
388
  static get properties() {
283
389
  return {
390
+ "alignRigth": {
391
+ "type": "boolean",
392
+ "mutable": false,
393
+ "complexType": {
394
+ "original": "boolean",
395
+ "resolved": "boolean",
396
+ "references": {}
397
+ },
398
+ "required": false,
399
+ "optional": false,
400
+ "docs": {
401
+ "tags": [],
402
+ "text": "Usado para determinar O alinhamento dos items na taskbar."
403
+ },
404
+ "attribute": "align-rigth",
405
+ "reflect": false,
406
+ "defaultValue": "false"
407
+ },
284
408
  "customSlotId": {
285
409
  "type": "string",
286
410
  "mutable": false,
@@ -316,6 +440,24 @@ export class SnkTaskbar {
316
440
  "attribute": "custom-container-id",
317
441
  "reflect": false
318
442
  },
443
+ "overflowStrategy": {
444
+ "type": "string",
445
+ "mutable": false,
446
+ "complexType": {
447
+ "original": "'hiddenItems' | 'none'",
448
+ "resolved": "\"hiddenItems\" | \"none\"",
449
+ "references": {}
450
+ },
451
+ "required": false,
452
+ "optional": false,
453
+ "docs": {
454
+ "tags": [],
455
+ "text": "Define como ser\u00E1 o comportamento da taskbar quando ocorrer overflow"
456
+ },
457
+ "attribute": "overflow-strategy",
458
+ "reflect": false,
459
+ "defaultValue": "'hiddenItems'"
460
+ },
319
461
  "configName": {
320
462
  "type": "string",
321
463
  "mutable": false,
@@ -515,9 +657,13 @@ export class SnkTaskbar {
515
657
  static get states() {
516
658
  return {
517
659
  "_permissions": {},
660
+ "_overFlowedElements": {},
518
661
  "_customElements": {},
519
662
  "_customElementsId": {},
520
- "_slotContainer": {}
663
+ "_slotContainer": {},
664
+ "_hiddenActionsList": {},
665
+ "_lastWidth": {},
666
+ "_hasToUpdateOverFlow": {}
521
667
  };
522
668
  }
523
669
  static get events() {
@@ -543,6 +689,12 @@ export class SnkTaskbar {
543
689
  return [{
544
690
  "propName": "buttons",
545
691
  "methodName": "observeButtons"
692
+ }, {
693
+ "propName": "disabledButtons",
694
+ "methodName": "observeDisabledButtons"
695
+ }, {
696
+ "propName": "_lastWidth",
697
+ "methodName": "observeLastWidth"
546
698
  }];
547
699
  }
548
700
  }
@@ -2,17 +2,37 @@ import { FormConfigFetcher } from "../http/data-fetcher/fetchers/form-config-fet
2
2
  import GridConfigFetcher from "../http/data-fetcher/fetchers/grid-config-fetcher";
3
3
  import FilterBarConfigFetcher from "../http/data-fetcher/fetchers/filter-bar-config-fetcher";
4
4
  import PersonalizedFilterFetcher from "../http/data-fetcher/fetchers/personalized-filter-fetcher";
5
- const CONFIG_SOURCE = {
6
- form: "form",
7
- grid: "grid",
8
- filterBar: "filterBar"
9
- };
5
+ export var CONFIG_SOURCE;
6
+ (function (CONFIG_SOURCE) {
7
+ CONFIG_SOURCE["form"] = "form";
8
+ CONFIG_SOURCE["grid"] = "grid";
9
+ CONFIG_SOURCE["filterBar"] = "filterBar";
10
+ })(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
10
11
  export class ConfigStorage {
11
- static preload(resourceID, configName) {
12
+ static addFilterBarLegacyConfig(configName, legacyConfigName) {
13
+ this.validateConfigName(configName, legacyConfigName);
14
+ this.filterBarLegacyConfig.set(configName, legacyConfigName);
15
+ }
16
+ static addFormLegacyConfig(configName, legacyConfigName) {
17
+ this.validateConfigName(configName, legacyConfigName);
18
+ this.formLegacyConfig.set(configName, legacyConfigName);
19
+ }
20
+ static addGridLegacyConfig(configName, legacyConfigName) {
21
+ this.validateConfigName(configName, legacyConfigName);
22
+ this.gridLegacyConfig.set(configName, legacyConfigName);
23
+ }
24
+ static preload(resourceID, configName, legacyConfigs) {
25
+ if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.gridLegacyConfig)) {
26
+ ConfigStorage.addGridLegacyConfig(configName, legacyConfigs.gridLegacyConfig);
27
+ }
28
+ if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.formLegacyConfig)) {
29
+ ConfigStorage.addFormLegacyConfig(configName, legacyConfigs.formLegacyConfig);
30
+ }
12
31
  ConfigStorage.loadFormConfig(configName, resourceID);
13
32
  ConfigStorage.loadGridConfig(configName, resourceID);
14
33
  }
15
34
  static async loadFilterBarConfig(name, resourceID, urlParams) {
35
+ urlParams = this.handleLegacyConfig(name, CONFIG_SOURCE.filterBar, urlParams);
16
36
  const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
17
37
  if (!ConfigStorage.configById.has(cacheID)) {
18
38
  ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
@@ -20,6 +40,7 @@ export class ConfigStorage {
20
40
  return ConfigStorage.configById.get(cacheID);
21
41
  }
22
42
  static async loadFormConfig(name, resourceID) {
43
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
23
44
  const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
24
45
  if (!ConfigStorage.configById.has(cacheID)) {
25
46
  ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
@@ -27,6 +48,7 @@ export class ConfigStorage {
27
48
  return ConfigStorage.configById.get(cacheID);
28
49
  }
29
50
  static async loadGridConfig(name, resourceID) {
51
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
30
52
  const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
31
53
  if (!ConfigStorage.configById.has(cacheID)) {
32
54
  ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
@@ -34,13 +56,12 @@ export class ConfigStorage {
34
56
  return ConfigStorage.configById.get(cacheID);
35
57
  }
36
58
  static async saveFilterBarConfig(config, name, resourceID) {
37
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
38
- this.configById.delete(cacheID);
59
+ await this.deleteFilterBarConfigCache(name, resourceID);
39
60
  return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
40
61
  }
41
62
  static async saveFormConfig(config, name, resourceID) {
42
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
43
- this.configById.delete(cacheID);
63
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
64
+ await this.deleteFormConfigCache(name, resourceID);
44
65
  return this.formConfigFetcher.saveConfig(config, name, resourceID);
45
66
  }
46
67
  static async saveCardState(config, name, resourceID) {
@@ -50,18 +71,17 @@ export class ConfigStorage {
50
71
  if (config == undefined) {
51
72
  return;
52
73
  }
53
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
54
- this.configById.delete(cacheID);
74
+ await this.deleteGridConfigCache(name, resourceID);
55
75
  return this.gridConfigFetcher.saveConfig(config, name, resourceID);
56
76
  }
57
77
  static async loadPersonalizedFilter(filterId, resourceID, configName) {
58
- return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
78
+ const legacyConfigName = this.filterBarLegacyConfig.get(configName);
79
+ return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName, legacyConfigName);
59
80
  }
60
81
  static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
61
- //Ao criar ou alterar um filtro personalizado,
82
+ //Ao criar ou alterar um filtro personalizado,
62
83
  //precisamos remover o cache do status da filterbar.
63
- const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar, resourceID);
64
- this.configById.delete(cacheID);
84
+ await this.deleteFilterBarConfigCache(configName, resourceID);
65
85
  return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
66
86
  }
67
87
  static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
@@ -70,6 +90,51 @@ export class ConfigStorage {
70
90
  static async validatePersonalizedFilter(dataUnitName, expression) {
71
91
  return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
72
92
  }
93
+ static async deleteGridConfigCache(name, resourceID) {
94
+ await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
95
+ }
96
+ static async deleteFormConfigCache(name, resourceID) {
97
+ await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
98
+ }
99
+ static async deleteFilterBarConfigCache(name, resourceID) {
100
+ await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
101
+ }
102
+ static validateConfigName(configName, legacyConfigName) {
103
+ if (!configName)
104
+ throw Error(this.CONFIG_NAME_ERROR_MESSAGE);
105
+ if (!legacyConfigName)
106
+ throw Error(this.LEGACY_CONFIG_NAME_ERROR_MESSAGE);
107
+ }
108
+ static handleLegacyConfig(configName, configSource, urlParams) {
109
+ let legacyConfigName;
110
+ switch (configSource) {
111
+ case CONFIG_SOURCE.filterBar:
112
+ legacyConfigName = this.filterBarLegacyConfig.get(configName);
113
+ break;
114
+ case CONFIG_SOURCE.grid:
115
+ legacyConfigName = this.gridLegacyConfig.get(configName);
116
+ break;
117
+ case CONFIG_SOURCE.form:
118
+ legacyConfigName = this.formLegacyConfig.get(configName);
119
+ }
120
+ const params = urlParams ? Object.assign({}, urlParams) : {};
121
+ if (legacyConfigName) {
122
+ params['legacyResourceID'] = legacyConfigName;
123
+ }
124
+ return params;
125
+ }
126
+ static handleLegacyConfigAsString(name, source) {
127
+ const params = this.handleLegacyConfig(name, source);
128
+ const legacyResourceID = params['legacyResourceID'];
129
+ if (legacyResourceID) {
130
+ name = name + `?legacyResourceID=${legacyResourceID}`;
131
+ }
132
+ return name;
133
+ }
134
+ static async deleteConfigCache(name, resourceID, source) {
135
+ const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
136
+ this.configById.delete(cacheID);
137
+ }
73
138
  static buildCacheID(name, source, resourceID) {
74
139
  if (name == undefined) {
75
140
  return `req_${source}_${resourceID}`;
@@ -77,6 +142,11 @@ export class ConfigStorage {
77
142
  return `req_${source}_${name}_${resourceID}`;
78
143
  }
79
144
  }
145
+ ConfigStorage.CONFIG_NAME_ERROR_MESSAGE = "ConfigName precisa ser informado.";
146
+ ConfigStorage.LEGACY_CONFIG_NAME_ERROR_MESSAGE = "LegacyConfigName precisa ser informado.";
147
+ ConfigStorage.filterBarLegacyConfig = new Map();
148
+ ConfigStorage.formLegacyConfig = new Map();
149
+ ConfigStorage.gridLegacyConfig = new Map();
80
150
  ConfigStorage.configById = new Map();
81
151
  ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
82
152
  ConfigStorage.formConfigFetcher = new FormConfigFetcher();
@@ -1,6 +1,5 @@
1
1
  import { ChangeOperation, DataType, DataUnit, DateUtils, StringUtils, } from '@sankhyalabs/core';
2
- import { ColumnFilterManager } from "@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";
3
- import PreloadManager from '../http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
2
+ import { applyFilter, applySorting, buildPaginationInfo } from './dataUnitInMemoryUtils';
4
3
  export default class InMemoryLoader {
5
4
  constructor(metadata, records) {
6
5
  this.metadata = metadata;
@@ -16,7 +15,7 @@ export default class InMemoryLoader {
16
15
  if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
17
16
  this._initialRecords = this.dataUnit.records;
18
17
  }
19
- return this._initialRecords;
18
+ return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
20
19
  }
21
20
  get dataUnit() {
22
21
  return this._dataUnit;
@@ -74,30 +73,9 @@ export default class InMemoryLoader {
74
73
  return StringUtils.generateUUID();
75
74
  }
76
75
  inMemoryLoader(dataUnit, request, recordsIn) {
77
- let records = this.applyFilter(recordsIn, dataUnit, request.filters);
78
- records = this.applySorting(records, dataUnit, request.sort);
79
- return Promise.resolve({ records, paginationInfo: buildPaginationInfo(request, records) });
80
- }
81
- applyFilter(records, dataUnit, filters) {
82
- const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
83
- if (columnFilters == undefined || columnFilters.size == 0) {
84
- return records;
85
- }
86
- const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
87
- if (filterFunciton == undefined) {
88
- return records;
89
- }
90
- return records.filter(filterFunciton);
91
- }
92
- applySorting(records, dataUnit, sorting) {
93
- if (sorting == undefined || sorting.length == 0) {
94
- return records;
95
- }
96
- const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
97
- if (sortingFunction == undefined) {
98
- return records;
99
- }
100
- return records.sort(sortingFunction);
76
+ let records = applyFilter(recordsIn, dataUnit, request.filters);
77
+ records = applySorting(records, dataUnit, request.sort);
78
+ return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
101
79
  }
102
80
  metadaLoader() {
103
81
  return Promise.resolve(this._metadata);
@@ -130,16 +108,3 @@ export default class InMemoryLoader {
130
108
  }
131
109
  }
132
110
  InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
133
- function buildPaginationInfo({ offset, limit }, records) {
134
- if (offset === undefined || limit === undefined) {
135
- return undefined;
136
- }
137
- const lastRecord = Math.min(offset + limit, records.length);
138
- return {
139
- currentPage: Math.ceil(offset / limit),
140
- firstRecord: offset,
141
- lastRecord: lastRecord,
142
- total: records.length,
143
- hasMore: !!(records.length - lastRecord),
144
- };
145
- }
@@ -0,0 +1,33 @@
1
+ import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
2
+ import PreloadManager from '../http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
3
+ export function applyFilter(records, dataUnit, filters) {
4
+ const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
5
+ if (!(columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.size)) {
6
+ return records;
7
+ }
8
+ const filterFunction = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
9
+ if (filterFunction == undefined) {
10
+ return records;
11
+ }
12
+ return records.filter(filterFunction);
13
+ }
14
+ export function applySorting(records, dataUnit, sorting) {
15
+ if (sorting == undefined || sorting.length == 0) {
16
+ return records;
17
+ }
18
+ const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
19
+ if (sortingFunction == undefined) {
20
+ return records;
21
+ }
22
+ return records.sort(sortingFunction);
23
+ }
24
+ export function buildPaginationInfo(records, offset = 0, limit = 0) {
25
+ const lastRecord = Math.min(offset + limit, records.length);
26
+ return {
27
+ currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
28
+ firstRecord: offset,
29
+ lastRecord: lastRecord,
30
+ total: records.length,
31
+ hasMore: !!(records.length - lastRecord),
32
+ };
33
+ }
@@ -275,7 +275,6 @@ export class DataFetcher {
275
275
  if (http.readyState == 4 && http.status == 200) {
276
276
  try {
277
277
  const jsonResp = JSON.parse(http.responseText);
278
- await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
279
278
  /**
280
279
  * Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
281
280
  *
@@ -286,8 +285,10 @@ export class DataFetcher {
286
285
  if (this.isServiceBrokerError(jsonResp)) {
287
286
  reject(this.processServiceBrokerErrorInfo(jsonResp));
288
287
  }
289
- else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED && jsonResp.statusMessage) {
290
- console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
288
+ else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
289
+ if (jsonResp.statusMessage) {
290
+ console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
291
+ }
291
292
  }
292
293
  else {
293
294
  accept(jsonResp.responseBody);
@@ -295,6 +296,7 @@ export class DataFetcher {
295
296
  (_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
296
297
  }
297
298
  }
299
+ this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
298
300
  }
299
301
  catch (err) {
300
302
  console.warn(`Erro ao executar serviço: ${err}`);