@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-11997.0 → 0.0.0-bugfix-dev-KB-99999.0

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 (407) hide show
  1. package/dist/cjs/{ConfigStorage-0e4275f5.js → ConfigStorage-8009ecb2.js} +20 -4
  2. package/dist/cjs/{DataFetcher-bd3d53a8.js → DataFetcher-ba94ed5b.js} +142 -102
  3. package/dist/cjs/{PersonalizedFilterUtils-1aeb625d.js → PersonalizedFilterUtils-0184ffbb.js} +11 -4
  4. package/dist/cjs/PreloadManager-84466da6.js +224 -0
  5. package/dist/cjs/{SnkFormConfigManager-5b485cd4.js → SnkFormConfigManager-7d850fbc.js} +23 -6
  6. package/dist/cjs/{SnkMessageBuilder-d0abb63d.js → SnkMessageBuilder-7293d0ad.js} +29 -8
  7. package/dist/cjs/{SnkMultiSelectionListDataSource-804ff4c7.js → SnkMultiSelectionListDataSource-ba5838c2.js} +15 -0
  8. package/dist/cjs/Sortable-fb1c4cbb.js +2853 -0
  9. package/dist/cjs/{auth-fetcher-1583fe43.js → auth-fetcher-c8467c07.js} +1 -1
  10. package/dist/cjs/{constants-d187e03e.js → constants-35ddd366.js} +4 -0
  11. package/dist/cjs/dataunit-fetcher-de65b9fc.js +725 -0
  12. package/dist/cjs/{taskbar-processor-bce3f499.js → field-search-f56aa7d6.js} +35 -0
  13. package/dist/cjs/{filter-item-type.enum-aa823a00.js → filter-item-type.enum-a7ffdaa6.js} +1 -0
  14. package/dist/cjs/filterNumberVariation-d65332da.js +7 -0
  15. package/dist/cjs/{form-config-fetcher-f6cb55e6.js → form-config-fetcher-df043d3d.js} +1 -1
  16. package/dist/cjs/{index-0e663819.js → index-0922807b.js} +1 -0
  17. package/dist/cjs/index-f9e81701.js +10 -6
  18. package/dist/cjs/loader.cjs.js +1 -1
  19. package/dist/cjs/{pesquisa-fetcher-3356b3df.js → pesquisa-fetcher-ef050a47.js} +1 -1
  20. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  21. package/dist/cjs/{snk-actions-button.cjs.entry.js → snk-actions-button_2.cjs.entry.js} +214 -91
  22. package/dist/cjs/snk-application.cjs.entry.js +474 -140
  23. package/dist/cjs/snk-attach.cjs.entry.js +27 -11
  24. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-configurator.cjs.entry.js +17 -2
  26. package/dist/cjs/snk-crud.cjs.entry.js +127 -17
  27. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +20 -0
  28. package/dist/cjs/snk-data-exporter.cjs.entry.js +12 -11
  29. package/dist/cjs/{snk-data-unit-7cc1846d.js → snk-data-unit-1bc69073.js} +15 -5
  30. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  31. package/dist/cjs/snk-detail-view.cjs.entry.js +34 -14
  32. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +2 -2
  34. package/dist/cjs/snk-filter-bar.cjs.entry.js +163 -17
  35. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +52 -0
  37. package/dist/cjs/snk-filter-detail.cjs.entry.js +9 -2
  38. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +2 -2
  39. package/dist/cjs/snk-filter-item.cjs.entry.js +39 -15
  40. package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
  41. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -9
  42. package/dist/cjs/snk-filter-modal.cjs.entry.js +38 -7
  43. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  44. package/dist/cjs/snk-filter-number.cjs.entry.js +42 -3
  45. package/dist/cjs/snk-filter-period.cjs.entry.js +3 -3
  46. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  47. package/dist/cjs/snk-form-config.cjs.entry.js +16 -15
  48. package/dist/cjs/snk-form-view.cjs.entry.js +14 -0
  49. package/dist/cjs/snk-form.cjs.entry.js +6 -7
  50. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -7
  51. package/dist/cjs/snk-grid.cjs.entry.js +131 -40
  52. package/dist/cjs/{snk-guides-viewer-5e22097d.js → snk-guides-viewer-7f9b6d94.js} +161 -22
  53. package/dist/cjs/snk-guides-viewer.cjs.entry.js +16 -13
  54. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  55. package/dist/cjs/snk-personalized-filter.cjs.entry.js +24 -13
  56. package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
  57. package/dist/cjs/snk-simple-crud.cjs.entry.js +127 -103
  58. package/dist/cjs/snk-tab-config.cjs.entry.js +12 -11
  59. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -3
  60. package/dist/cjs/{taskbar-elements-39949c7a.js → taskbar-elements-01b85b99.js} +4 -4
  61. package/dist/collection/collection-manifest.json +3 -1
  62. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js +2 -2
  63. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js +2 -2
  64. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js +2 -2
  65. package/dist/collection/components/snk-actions-button/clientEvent/index.js +81 -76
  66. package/dist/collection/components/snk-actions-button/snk-actions-button.css +4 -11
  67. package/dist/collection/components/snk-actions-button/snk-actions-button.js +2 -2
  68. package/dist/collection/components/snk-application/snk-application.js +485 -84
  69. package/dist/collection/components/snk-attach/snk-attach.css +6 -0
  70. package/dist/collection/components/snk-attach/snk-attach.js +15 -3
  71. package/dist/collection/components/snk-attach/structure/data-unit-builder.js +4 -1
  72. package/dist/collection/components/snk-configurator/snk-configurator.js +33 -1
  73. package/dist/collection/components/snk-crud/snk-crud.js +136 -10
  74. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +21 -1
  75. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +45 -0
  76. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +178 -22
  77. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +3 -0
  78. package/dist/collection/components/{snk-taskbar/snk-taskbar-custom-elements.js → snk-custom-slot-elements/snk-custom-slot-elements.js} +10 -10
  79. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +1 -9
  80. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
  81. package/dist/collection/components/snk-data-unit/snk-data-unit.js +15 -12
  82. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +69 -2
  83. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.js +5 -0
  84. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +95 -0
  85. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +93 -8
  86. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +2 -2
  87. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +1 -0
  88. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +7 -0
  89. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +38 -14
  90. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +1 -1
  91. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +87 -6
  92. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +4 -3
  93. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +5 -6
  94. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +218 -7
  95. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  96. package/dist/collection/components/snk-form/SnkFormConfigManager.js +22 -5
  97. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +10 -8
  98. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +10 -8
  99. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +11 -0
  100. package/dist/collection/components/snk-grid/snk-grid.css +7 -2
  101. package/dist/collection/components/snk-grid/snk-grid.js +166 -39
  102. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +32 -6
  103. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +13 -4
  104. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +8 -2
  105. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +115 -6
  106. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +6 -0
  107. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +310 -0
  108. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -3
  109. package/dist/collection/components/snk-taskbar/snk-taskbar.css +0 -4
  110. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -1
  111. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +31 -0
  112. package/dist/collection/lib/@types/index.js +1 -0
  113. package/dist/collection/lib/dataUnit/InMemoryLoader.js +74 -15
  114. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +61 -43
  115. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +118 -0
  116. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +80 -0
  117. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +139 -0
  118. package/dist/collection/lib/http/data-fetcher/fetchers/{dataunit-fetcher.js → data-unit/dataunit-fetcher.js} +49 -100
  119. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js +1 -0
  120. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js +1 -0
  121. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js +1 -0
  122. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js +1 -0
  123. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js +1 -0
  124. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js +68 -0
  125. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +162 -0
  126. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +3 -2
  127. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js +3 -2
  128. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +14 -1
  129. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +3 -0
  130. package/dist/collection/lib/index.js +1 -1
  131. package/dist/collection/lib/message/SnkMessageBuilder.js +9 -3
  132. package/dist/collection/lib/message/resources/snk-application.msg.js +9 -0
  133. package/dist/collection/lib/message/resources/snk-crud.msg.js +1 -0
  134. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +5 -4
  135. package/dist/collection/lib/message/resources/snk-grid.msg.js +3 -1
  136. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  137. package/dist/collection/lib/utils/constants.js +3 -0
  138. package/dist/collection/lib/utils/urlutils.js +10 -4
  139. package/dist/collection/lib/workspace/workspace.js +27 -0
  140. package/dist/components/ConfigStorage.js +17 -1
  141. package/dist/components/DataFetcher.js +101 -61
  142. package/dist/components/PersonalizedFilterUtils.js +10 -3
  143. package/dist/components/SnkFormConfigManager.js +22 -5
  144. package/dist/components/SnkMessageBuilder.js +29 -8
  145. package/dist/components/constants.js +4 -1
  146. package/dist/components/dataunit-fetcher.js +846 -100
  147. package/dist/components/{SnkMultiSelectionListDataSource.js → field-search.js} +44 -1
  148. package/dist/components/filter-item-type.enum.js +1 -0
  149. package/dist/components/filterNumberVariation.js +7 -0
  150. package/dist/components/index.d.ts +3 -1
  151. package/dist/components/index.js +3 -1
  152. package/dist/components/index2.js +1 -0
  153. package/dist/components/snk-actions-button2.js +91 -86
  154. package/dist/components/snk-application2.js +392 -55
  155. package/dist/components/snk-attach2.js +39 -19
  156. package/dist/components/snk-configurator2.js +18 -2
  157. package/dist/components/snk-crud.js +184 -70
  158. package/dist/components/snk-custom-slot-elements.d.ts +11 -0
  159. package/dist/components/snk-custom-slot-elements.js +35 -0
  160. package/dist/components/snk-data-exporter2.js +7 -5
  161. package/dist/components/snk-data-unit2.js +15 -5
  162. package/dist/components/snk-detail-view2.js +264 -96
  163. package/dist/components/snk-filter-bar2.js +164 -13
  164. package/dist/components/snk-filter-checkbox-list.d.ts +11 -0
  165. package/dist/components/snk-filter-checkbox-list.js +68 -0
  166. package/dist/components/snk-filter-detail2.js +7 -0
  167. package/dist/components/snk-filter-item2.js +38 -14
  168. package/dist/components/snk-filter-list.js +1 -1
  169. package/dist/components/snk-filter-modal-item2.js +4 -3
  170. package/dist/components/snk-filter-modal.js +40 -7
  171. package/dist/components/snk-filter-number.js +43 -2
  172. package/dist/components/snk-filter-period.js +2 -2
  173. package/dist/components/snk-form-config2.js +13 -11
  174. package/dist/components/snk-form-view2.js +15 -0
  175. package/dist/components/snk-grid2.js +166 -68
  176. package/dist/components/snk-personalized-filter2.js +18 -6
  177. package/dist/components/snk-simple-crud2.js +132 -104
  178. package/dist/components/snk-tab-config2.js +2203 -6233
  179. package/dist/components/snk-taskbar2.js +16 -10
  180. package/dist/components/taskbar-actions-button.d.ts +11 -0
  181. package/dist/components/taskbar-actions-button.js +6 -0
  182. package/dist/components/taskbar-actions-button2.js +140 -0
  183. package/dist/esm/{ConfigStorage-f359573c.js → ConfigStorage-1244b8b0.js} +20 -4
  184. package/dist/esm/{DataFetcher-8daff9ad.js → DataFetcher-aa159c5a.js} +101 -61
  185. package/dist/esm/{PersonalizedFilterUtils-75fb0106.js → PersonalizedFilterUtils-e2b38ef7.js} +11 -4
  186. package/dist/esm/PreloadManager-c1c2f2b4.js +222 -0
  187. package/dist/esm/{SnkFormConfigManager-35876bad.js → SnkFormConfigManager-9be0e7d4.js} +24 -7
  188. package/dist/esm/{SnkMessageBuilder-68c1c25a.js → SnkMessageBuilder-ca843d1b.js} +29 -8
  189. package/dist/esm/{SnkMultiSelectionListDataSource-892f37f9.js → SnkMultiSelectionListDataSource-44494b0e.js} +11 -0
  190. package/dist/esm/Sortable-83960219.js +2851 -0
  191. package/dist/esm/{auth-fetcher-299fed55.js → auth-fetcher-c05dc474.js} +1 -1
  192. package/dist/esm/{constants-3644f1b6.js → constants-8457af36.js} +4 -1
  193. package/dist/esm/dataunit-fetcher-e218c6d2.js +722 -0
  194. package/dist/esm/{taskbar-processor-94402e6e.js → field-search-efbe307f.js} +34 -1
  195. package/dist/esm/{filter-item-type.enum-5028ed3f.js → filter-item-type.enum-d45e026f.js} +1 -0
  196. package/dist/esm/filterNumberVariation-8cee02ea.js +7 -0
  197. package/dist/esm/{form-config-fetcher-8ef7be16.js → form-config-fetcher-36219cd3.js} +1 -1
  198. package/dist/esm/{index-1564817d.js → index-0ece87a6.js} +1 -0
  199. package/dist/esm/index-a7d3d3f1.js +10 -6
  200. package/dist/esm/loader.js +1 -1
  201. package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-dd3ca0a5.js} +1 -1
  202. package/dist/esm/sankhyablocks.js +1 -1
  203. package/dist/esm/{snk-actions-button.entry.js → snk-actions-button_2.entry.js} +215 -93
  204. package/dist/esm/snk-application.entry.js +475 -141
  205. package/dist/esm/snk-attach.entry.js +27 -11
  206. package/dist/esm/snk-config-options.entry.js +1 -1
  207. package/dist/esm/snk-configurator.entry.js +18 -3
  208. package/dist/esm/snk-crud.entry.js +128 -18
  209. package/dist/esm/snk-custom-slot-elements.entry.js +16 -0
  210. package/dist/esm/snk-data-exporter.entry.js +13 -12
  211. package/dist/esm/{snk-data-unit-1715d2f1.js → snk-data-unit-6208ebf0.js} +16 -6
  212. package/dist/esm/snk-data-unit.entry.js +2 -2
  213. package/dist/esm/snk-detail-view.entry.js +34 -14
  214. package/dist/esm/snk-field-config.entry.js +1 -1
  215. package/dist/esm/snk-filter-advanced-mode_2.entry.js +2 -2
  216. package/dist/esm/snk-filter-bar.entry.js +165 -19
  217. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  218. package/dist/esm/snk-filter-checkbox-list.entry.js +48 -0
  219. package/dist/esm/snk-filter-detail.entry.js +9 -2
  220. package/dist/esm/snk-filter-field-search_2.entry.js +2 -2
  221. package/dist/esm/snk-filter-item.entry.js +39 -15
  222. package/dist/esm/snk-filter-list.entry.js +1 -1
  223. package/dist/esm/snk-filter-modal-item.entry.js +9 -9
  224. package/dist/esm/snk-filter-modal.entry.js +38 -7
  225. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  226. package/dist/esm/snk-filter-number.entry.js +42 -3
  227. package/dist/esm/snk-filter-period.entry.js +3 -3
  228. package/dist/esm/snk-filter-search.entry.js +1 -1
  229. package/dist/esm/snk-form-config.entry.js +16 -15
  230. package/dist/esm/snk-form-view.entry.js +14 -0
  231. package/dist/esm/snk-form.entry.js +6 -7
  232. package/dist/esm/snk-grid-config.entry.js +6 -7
  233. package/dist/esm/snk-grid.entry.js +132 -41
  234. package/dist/esm/{snk-guides-viewer-b0e32a7d.js → snk-guides-viewer-9d5e073f.js} +161 -22
  235. package/dist/esm/snk-guides-viewer.entry.js +16 -13
  236. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  237. package/dist/esm/snk-personalized-filter.entry.js +24 -13
  238. package/dist/esm/snk-select-box.entry.js +1 -1
  239. package/dist/esm/snk-simple-crud.entry.js +126 -102
  240. package/dist/esm/snk-tab-config.entry.js +12 -11
  241. package/dist/esm/snk-taskbar.entry.js +3 -3
  242. package/dist/esm/{taskbar-elements-0a6b8b95.js → taskbar-elements-d4d0b424.js} +4 -4
  243. package/dist/sankhyablocks/p-01ba23cd.entry.js +1 -0
  244. package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
  245. package/dist/sankhyablocks/{p-5c1aacc7.js → p-057fad05.js} +1 -1
  246. package/dist/sankhyablocks/p-0874adb5.entry.js +1 -0
  247. package/dist/sankhyablocks/p-094c30cb.js +1 -0
  248. package/dist/sankhyablocks/p-0d084a0f.entry.js +1 -0
  249. package/dist/sankhyablocks/{p-c870b530.js → p-0d7863ed.js} +1 -1
  250. package/dist/sankhyablocks/p-11081798.entry.js +1 -0
  251. package/dist/sankhyablocks/p-143425c0.entry.js +1 -0
  252. package/dist/sankhyablocks/{p-cb37982f.entry.js → p-20726710.entry.js} +1 -1
  253. package/dist/sankhyablocks/p-32f0935f.js +1 -0
  254. package/dist/sankhyablocks/p-3520c088.entry.js +1 -0
  255. package/dist/sankhyablocks/p-374d03f6.js +1 -0
  256. package/dist/sankhyablocks/p-38289a55.js +1 -0
  257. package/dist/sankhyablocks/{p-25c5428f.entry.js → p-3ab6df3d.entry.js} +1 -1
  258. package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
  259. package/dist/sankhyablocks/{p-eb636e15.entry.js → p-41f8bfa3.entry.js} +1 -1
  260. package/dist/sankhyablocks/p-4775a293.entry.js +1 -0
  261. package/dist/sankhyablocks/p-4b0938f6.entry.js +1 -0
  262. package/dist/sankhyablocks/p-585294ee.js +56 -0
  263. package/dist/sankhyablocks/p-5f74c859.entry.js +1 -0
  264. package/dist/sankhyablocks/p-69754d94.entry.js +1 -0
  265. package/dist/sankhyablocks/p-6977a26c.entry.js +1 -0
  266. package/dist/sankhyablocks/{p-648a7c72.entry.js → p-69efa80d.entry.js} +1 -1
  267. package/dist/sankhyablocks/p-70589af8.entry.js +1 -0
  268. package/dist/sankhyablocks/p-776ee8e3.js +1 -0
  269. package/dist/sankhyablocks/{p-959e0835.entry.js → p-7e2ded86.entry.js} +1 -1
  270. package/dist/sankhyablocks/p-7f9d6b5d.entry.js +11 -0
  271. package/dist/sankhyablocks/{p-0885ed3c.entry.js → p-8002dcd0.entry.js} +1 -1
  272. package/dist/sankhyablocks/p-809f367d.entry.js +1 -0
  273. package/dist/sankhyablocks/p-8437508f.js +1 -0
  274. package/dist/sankhyablocks/p-8eb67fa4.entry.js +1 -0
  275. package/dist/sankhyablocks/{p-f30526a7.entry.js → p-95df461f.entry.js} +1 -1
  276. package/dist/sankhyablocks/p-9695f78b.js +1 -0
  277. package/dist/sankhyablocks/{p-838f8234.entry.js → p-98674137.entry.js} +1 -1
  278. package/dist/sankhyablocks/p-a87229cd.entry.js +1 -0
  279. package/dist/sankhyablocks/p-a9e5b094.entry.js +1 -0
  280. package/dist/sankhyablocks/p-aaa3ee68.entry.js +1 -0
  281. package/dist/sankhyablocks/p-b0ef4383.js +1 -0
  282. package/dist/sankhyablocks/p-ba627e85.js +60 -0
  283. package/dist/sankhyablocks/p-c22c1d8e.js +1 -0
  284. package/dist/sankhyablocks/p-c2495304.js +1 -0
  285. package/dist/sankhyablocks/{p-26ad62b9.entry.js → p-c758265f.entry.js} +1 -1
  286. package/dist/sankhyablocks/{p-fe49067d.entry.js → p-c8622597.entry.js} +1 -1
  287. package/dist/sankhyablocks/p-cb7419e0.entry.js +1 -0
  288. package/dist/sankhyablocks/p-d1007720.entry.js +1 -0
  289. package/dist/sankhyablocks/{p-a1e1b305.entry.js → p-d3f53df2.entry.js} +1 -1
  290. package/dist/sankhyablocks/p-d6317851.entry.js +1 -0
  291. package/dist/sankhyablocks/{p-b13cb8b5.js → p-d9bb09b3.js} +2 -2
  292. package/dist/sankhyablocks/p-e3132789.entry.js +1 -0
  293. package/dist/sankhyablocks/p-e6380c60.js +1 -0
  294. package/dist/sankhyablocks/p-f514913b.entry.js +1 -0
  295. package/dist/sankhyablocks/p-fa80e546.js +1 -0
  296. package/dist/sankhyablocks/p-fa816fb2.js +1 -0
  297. package/dist/sankhyablocks/p-fd8814b9.entry.js +1 -0
  298. package/dist/sankhyablocks/{p-584d7212.js → p-ff1990ad.js} +1 -1
  299. package/dist/sankhyablocks/p-ff6064e7.js +1 -0
  300. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  301. package/dist/types/components/snk-actions-button/clientEvent/index.d.ts +1 -1
  302. package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
  303. package/dist/types/components/snk-application/snk-application.d.ts +90 -15
  304. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  305. package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
  306. package/dist/types/components/snk-crud/snk-crud.d.ts +13 -0
  307. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +3 -0
  308. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +10 -1
  309. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +49 -12
  310. package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +7 -0
  311. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  312. package/dist/types/components/snk-filter-bar/filter-item/editors/enum/filterNumberVariation.d.ts +4 -0
  313. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +27 -0
  314. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +24 -2
  315. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +2 -1
  316. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  317. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +15 -1
  318. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +30 -0
  319. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +5 -1
  320. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +6 -1
  321. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +2 -0
  322. package/dist/types/components/snk-grid/snk-grid.d.ts +20 -6
  323. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +4 -1
  324. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +1 -1
  325. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +24 -2
  326. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +59 -0
  327. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +18 -2
  328. package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +4 -0
  329. package/dist/types/components.d.ts +256 -32
  330. package/dist/types/lib/@types/index.d.ts +2 -1
  331. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +5 -1
  332. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +8 -4
  333. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +13 -0
  334. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +19 -0
  335. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +22 -0
  336. package/dist/types/lib/http/data-fetcher/fetchers/{dataunit-fetcher.d.ts → data-unit/dataunit-fetcher.d.ts} +5 -3
  337. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.d.ts +6 -0
  338. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.d.ts +7 -0
  339. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +10 -0
  340. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.d.ts +4 -0
  341. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.d.ts +6 -0
  342. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.d.ts +9 -0
  343. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +16 -0
  344. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
  345. package/dist/types/lib/index.d.ts +1 -1
  346. package/dist/types/lib/message/resources/snk-application.msg.d.ts +2 -0
  347. package/dist/types/lib/message/resources/snk-simple-crud.msg.d.ts +2 -0
  348. package/dist/types/lib/utils/constants.d.ts +3 -4
  349. package/dist/types/lib/workspace/workspace.d.ts +6 -0
  350. package/package.json +4 -4
  351. package/react/components.d.ts +3 -1
  352. package/react/components.js +3 -1
  353. package/react/components.js.map +1 -1
  354. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  355. package/dist/cjs/dataunit-fetcher-910be4ce.js +0 -356
  356. package/dist/cjs/draggable.bundle-82a25c06.js +0 -6886
  357. package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +0 -20
  358. package/dist/collection/components/snk-data-unit/snk-data-unit.css +0 -6
  359. package/dist/components/_commonjsHelpers.js +0 -17
  360. package/dist/components/snk-taskbar-custom-elements.d.ts +0 -11
  361. package/dist/components/snk-taskbar-custom-elements.js +0 -35
  362. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  363. package/dist/esm/dataunit-fetcher-bd8f9572.js +0 -354
  364. package/dist/esm/draggable.bundle-41d56f06.js +0 -6884
  365. package/dist/esm/pesquisa-fetcher-27819123.js +0 -165
  366. package/dist/esm/snk-taskbar-custom-elements.entry.js +0 -16
  367. package/dist/sankhyablocks/p-0df2ead8.entry.js +0 -11
  368. package/dist/sankhyablocks/p-112455b1.js +0 -1
  369. package/dist/sankhyablocks/p-324ce41e.entry.js +0 -1
  370. package/dist/sankhyablocks/p-34604220.entry.js +0 -1
  371. package/dist/sankhyablocks/p-4a78e118.js +0 -1
  372. package/dist/sankhyablocks/p-5534e08c.js +0 -1
  373. package/dist/sankhyablocks/p-5d04ae42.entry.js +0 -1
  374. package/dist/sankhyablocks/p-6a38bda5.entry.js +0 -1
  375. package/dist/sankhyablocks/p-7bcd2f89.js +0 -56
  376. package/dist/sankhyablocks/p-7bd5aea7.js +0 -1
  377. package/dist/sankhyablocks/p-8014cc25.entry.js +0 -1
  378. package/dist/sankhyablocks/p-928efcaa.entry.js +0 -1
  379. package/dist/sankhyablocks/p-989937ee.entry.js +0 -1
  380. package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
  381. package/dist/sankhyablocks/p-a7ee0e6f.entry.js +0 -1
  382. package/dist/sankhyablocks/p-ac0556a3.js +0 -1
  383. package/dist/sankhyablocks/p-ae6aff81.js +0 -1
  384. package/dist/sankhyablocks/p-b244640b.js +0 -1
  385. package/dist/sankhyablocks/p-b6d6b172.js +0 -1
  386. package/dist/sankhyablocks/p-bba91710.entry.js +0 -1
  387. package/dist/sankhyablocks/p-bd628455.entry.js +0 -1
  388. package/dist/sankhyablocks/p-c2beb95c.js +0 -1
  389. package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
  390. package/dist/sankhyablocks/p-c9841939.js +0 -1
  391. package/dist/sankhyablocks/p-d3ec3586.entry.js +0 -1
  392. package/dist/sankhyablocks/p-d708b4ab.entry.js +0 -1
  393. package/dist/sankhyablocks/p-d84bc5c1.js +0 -1
  394. package/dist/sankhyablocks/p-de76b8a8.js +0 -76
  395. package/dist/sankhyablocks/p-e19014a9.entry.js +0 -1
  396. package/dist/sankhyablocks/p-e1cb1f0b.js +0 -1
  397. package/dist/sankhyablocks/p-e3a82e1c.entry.js +0 -1
  398. package/dist/sankhyablocks/p-e9b53a9a.entry.js +0 -1
  399. package/dist/sankhyablocks/p-ebf8c5df.entry.js +0 -1
  400. package/dist/sankhyablocks/p-ed5f1204.entry.js +0 -1
  401. package/dist/sankhyablocks/p-f9395c20.entry.js +0 -1
  402. package/dist/sankhyablocks/p-f94b999e.entry.js +0 -1
  403. package/dist/sankhyablocks/p-fa9d3f73.js +0 -1
  404. package/dist/sankhyablocks/p-fb1ecd0b.entry.js +0 -1
  405. package/dist/sankhyablocks/p-fcd09423.entry.js +0 -1
  406. package/dist/sankhyablocks/p-fd15aaac.entry.js +0 -1
  407. package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +0 -7
@@ -6,16 +6,14 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
6
6
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
7
7
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
8
8
  };
9
- import { ApplicationContext, ErrorException, ObjectUtils, WarningException } from '@sankhyalabs/core';
9
+ import { ApplicationContext, ErrorException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
10
10
  import { batchRequests } from 'graphql-request';
11
11
  import UrlUtils from "../../../lib/utils/urlutils";
12
- import { StringUtils } from '@sankhyalabs/core';
13
- import { ServiceBrokerRecaller } from './recaller/ServiceBrokerRecaller';
14
- import { GraphQLRecaller } from './recaller/GraphQLRecaller';
15
12
  import { PrintUtils } from '../../utils/PrintUtils';
13
+ import { GraphQLRecaller } from './recaller/GraphQLRecaller';
14
+ import { ServiceBrokerRecaller } from './recaller/ServiceBrokerRecaller';
16
15
  export class DataFetcher {
17
16
  constructor() {
18
- this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
19
17
  this.ready = true;
20
18
  this.watingRequestsById = new Map();
21
19
  }
@@ -37,6 +35,12 @@ export class DataFetcher {
37
35
  this.instance.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
38
36
  return this.instance;
39
37
  }
38
+ static getGraphQLPath() {
39
+ if (StringUtils.isEmpty(this.instance.graphqlPath) && this.instance.application != undefined) {
40
+ this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
41
+ }
42
+ return this.instance.graphqlPath;
43
+ }
40
44
  static addRequestListener(listener) {
41
45
  const index = DataFetcher.requestListener.indexOf(listener);
42
46
  if (index < 0) {
@@ -86,7 +90,7 @@ export class DataFetcher {
86
90
  }
87
91
  return new ErrorException(title, statusMessage, tsErrorCode);
88
92
  }
89
- async callGraphQL(req) {
93
+ async callGraphQL(req, quietMode = false) {
90
94
  var _a;
91
95
  if (this.ready) {
92
96
  this.pause();
@@ -104,22 +108,22 @@ export class DataFetcher {
104
108
  if (this.ready) {
105
109
  return new Promise(async (resolve, reject) => {
106
110
  let query = this.getQueryTemplate(req);
107
- const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
111
+ const res = await this.fecthGraphQL([{ document: query, variables: req.values }], quietMode);
108
112
  if (res.errors.length > 0) {
109
- if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
113
+ if (!(await this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject))) {
110
114
  const error = this.processGraphQlErrorInfo(res.errors);
111
115
  reject(error);
112
116
  }
113
117
  }
114
118
  else {
115
119
  resolve(res.data[0][reqKey]);
116
- this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject);
120
+ await this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject);
117
121
  }
118
122
  });
119
123
  }
120
124
  else {
121
125
  if (!this.watingRequestsById.has(reqKey)) {
122
- this.watingRequestsById.set(reqKey, new WaitingRequest(req));
126
+ this.watingRequestsById.set(reqKey, new WaitingRequest(req, quietMode));
123
127
  }
124
128
  return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
125
129
  }
@@ -127,7 +131,7 @@ export class DataFetcher {
127
131
  resolveURL() {
128
132
  return UrlUtils.getUrlBase();
129
133
  }
130
- proccesGraphQLClientEvents(extensions, originalRequest, resolve, reject) {
134
+ async proccesGraphQLClientEvents(extensions, originalRequest, resolve, reject) {
131
135
  if (extensions == undefined) {
132
136
  return false;
133
137
  }
@@ -142,8 +146,8 @@ export class DataFetcher {
142
146
  throw new WarningException("ClientEvent não registrado", `Ocorreu o client event ${id} porém não há client event registrado na aplicação.`);
143
147
  }
144
148
  const handlers = DataFetcher.clientEventsByID.get(id);
145
- handlers.forEach(handler => {
146
- handler({ id, content: JSON.parse(clientEvents[id]) }, new GraphQLRecaller(originalRequest, resolve, reject));
149
+ handlers.forEach(async (handler) => {
150
+ await handler({ id, content: JSON.parse(clientEvents[id]) }, new GraphQLRecaller(originalRequest, resolve, reject));
147
151
  });
148
152
  }
149
153
  return Object.keys(clientEvents).length > 0;
@@ -229,9 +233,9 @@ export class DataFetcher {
229
233
  const urlParams = UrlUtils.getQueryParams(location.search);
230
234
  return {
231
235
  baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
232
- appName: "SankhyaBlocks",
236
+ appName: window['APPLICATION_NAME'] || "SankhyaBlocks",
233
237
  mgeSession: `${window['mgeSession'] || urlParams.get("mgeSession")}`,
234
- globalID: "85C0093DFA240EAB699B4E47A10215BD",
238
+ globalID: window['GLOBALID'] || StringUtils.generateUUID(),
235
239
  resourceID: (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID))
236
240
  };
237
241
  }
@@ -347,44 +351,54 @@ export class DataFetcher {
347
351
  }
348
352
  async executePendingRequest(watingRequestsById) {
349
353
  const requestsBatch = [];
350
- watingRequestsById.forEach(async (waitingReq) => {
351
- let query = this.getQueryTemplate(waitingReq.request);
354
+ let quietMode = true;
355
+ watingRequestsById.forEach((waitingReq) => {
356
+ const query = this.getQueryTemplate(waitingReq.request);
352
357
  requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
358
+ quietMode = quietMode && waitingReq.quietMode;
353
359
  });
354
- let res = undefined;
355
- let dataResponse = [];
356
- let errorsResponse = [];
357
- res = await this.fecthGrapql(requestsBatch);
358
- dataResponse = res.data;
359
- errorsResponse = res.errors;
360
+ const response = await this.fecthGraphQL(requestsBatch, quietMode);
361
+ const { data: dataResponse, errors: errorsResponse, extensions } = response;
360
362
  //Reject promises with errors from query
361
363
  errorsResponse.forEach((errorResponse) => {
362
- Object.entries(errorResponse).forEach(([_key, val]) => {
364
+ Object.entries(errorResponse).forEach(async ([key, val]) => {
363
365
  var _a;
364
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
366
+ const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
367
+ const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
368
+ if (!hasClientEvent) {
369
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
370
+ }
365
371
  });
366
372
  });
367
373
  //Resolve promises with data from query
368
374
  dataResponse.forEach((data) => {
369
- Object.entries(data).forEach(([key, val]) => {
370
- var _a;
371
- (((_a = watingRequestsById.get(key)) === null || _a === void 0 ? void 0 : _a.resolve) || Promise.resolve)(val);
375
+ Object.entries(data).forEach(async ([key, val]) => {
376
+ const waitingRequest = watingRequestsById.get(key);
377
+ await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
378
+ ((waitingRequest === null || waitingRequest === void 0 ? void 0 : waitingRequest.resolve) || Promise.resolve)(val);
372
379
  });
373
380
  });
374
381
  }
375
- async fecthGrapql(request) {
376
- let res = undefined;
377
- let dataResponse = [];
378
- let errorsResponse = [];
379
- let url = `${this.resolveURL() + this.GRAPHQL_PATH}`;
380
- const responseExtensions = [];
381
- if (window['mgeSession']) {
382
- url += `?mgeSession=${window['mgeSession']}`;
382
+ buildGraphQlURL(quietMode) {
383
+ const mgeSession = window["mgeSession"];
384
+ let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
385
+ if (mgeSession) {
386
+ url += `?mgeSession=${mgeSession}`;
383
387
  }
384
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
388
+ if (quietMode) {
389
+ url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
390
+ }
391
+ return url;
392
+ }
393
+ async fecthGraphQL(request, quietMode) {
394
+ const dataResponse = [];
395
+ const errorsResponse = [];
396
+ const responseExtensions = [];
397
+ const url = this.buildGraphQlURL(quietMode);
398
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request }));
385
399
  try {
386
- res = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
387
- res.forEach((resItem, index) => {
400
+ const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
401
+ response.forEach((resItem, index) => {
388
402
  var _a;
389
403
  if (((_a = resItem === null || resItem === void 0 ? void 0 : resItem.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
390
404
  errorsResponse.push(resItem.errors.map((item) => this.normalizeErrorResponse(item, request, index)));
@@ -399,7 +413,7 @@ export class DataFetcher {
399
413
  }
400
414
  catch (err) {
401
415
  if (!this.isHttpError(err)) {
402
- res = err.response;
416
+ const res = err.response;
403
417
  const req = err.request;
404
418
  Object.entries(res).forEach(([key, val]) => {
405
419
  if (val.errors) {
@@ -415,11 +429,11 @@ export class DataFetcher {
415
429
  });
416
430
  }
417
431
  else {
418
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
432
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
419
433
  throw new ErrorException("Falha de comunicação", err.message);
420
434
  }
421
435
  }
422
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
436
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
423
437
  return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
424
438
  }
425
439
  isHttpError(err) {
@@ -465,7 +479,7 @@ DataFetcher.SERVICE_BROKER_STATUS = {
465
479
  };
466
480
  DataFetcher.clientEventsByID = new Map();
467
481
  class WaitingRequest {
468
- constructor(req) {
482
+ constructor(req, quietMode) {
469
483
  this._resolve = () => { };
470
484
  this._reject = () => { };
471
485
  this._request = undefined;
@@ -474,6 +488,7 @@ class WaitingRequest {
474
488
  this._resolve = resolve;
475
489
  this._reject = reject;
476
490
  });
491
+ this._quietMode = quietMode;
477
492
  }
478
493
  get resolve() {
479
494
  return this._resolve;
@@ -487,4 +502,7 @@ class WaitingRequest {
487
502
  get request() {
488
503
  return this._request;
489
504
  }
505
+ get quietMode() {
506
+ return this._quietMode;
507
+ }
490
508
  }
@@ -0,0 +1,118 @@
1
+ import PreloadManager from "./cache/PreloadManager";
2
+ import { DatasetStrategy } from "./loadstrategy/DatasetStrategy";
3
+ export default class DataUnitDataLoader {
4
+ static async debounce(dataUnit, callBack) {
5
+ const duName = dataUnit.name;
6
+ if (DataUnitDataLoader._debouncingTimeouts[duName]) {
7
+ clearTimeout(DataUnitDataLoader._debouncingTimeouts[duName]);
8
+ delete DataUnitDataLoader._debouncingTimeouts[duName];
9
+ }
10
+ DataUnitDataLoader._debouncingTimeouts[duName] = setTimeout(() => {
11
+ delete DataUnitDataLoader._debouncingTimeouts[duName];
12
+ callBack();
13
+ }, 100);
14
+ }
15
+ static async loadData(dataUnit, request) {
16
+ return new Promise((resolve, reject) => {
17
+ DataUnitDataLoader.debounce(dataUnit, () => {
18
+ PreloadManager.loadData(dataUnit, request, this.loadFromServer)
19
+ .then(resp => resolve(resp))
20
+ .catch(reason => reject(reason));
21
+ });
22
+ });
23
+ }
24
+ static async loadFromServer(dataUnit, request, loadingInfo) {
25
+ try {
26
+ //Registramos a request com as informações de carga para determinarmos a última.
27
+ //Caso o usuário inicie outro refresh antes de terminar, devemos ignorar o resultado.
28
+ loadingInfo = DataUnitDataLoader.registryLoading(dataUnit, loadingInfo);
29
+ const loadResult = await DataUnitDataLoader.callLoader(dataUnit, request, loadingInfo);
30
+ if (loadResult == undefined) {
31
+ //Essa request foi originada de refresh antigo. Será ignorada;
32
+ return;
33
+ }
34
+ const loadedRecords = loadResult.records;
35
+ const paginationInfo = DataUnitDataLoader.buildPaginationInfo(loadedRecords.length, request, loadResult.loadingInfo);
36
+ const records = paginationInfo == undefined ? loadedRecords : loadedRecords.slice(0, paginationInfo.lastRecord);
37
+ return Promise.resolve({ records, paginationInfo });
38
+ }
39
+ catch (error) {
40
+ console.error(error);
41
+ return Promise.reject(error);
42
+ }
43
+ }
44
+ static async callLoader(dataUnit, request, requestLoadingInfo, dataLoader) {
45
+ if (dataLoader == undefined) {
46
+ //dataLoader = new DataUnitStrategy();
47
+ dataLoader = new DatasetStrategy();
48
+ }
49
+ const result = await dataLoader.load(dataUnit, request, requestLoadingInfo);
50
+ const { records, loadingInfo: responseLoadingInfo } = result;
51
+ if (DataUnitDataLoader.isOldRequest(dataUnit, responseLoadingInfo)) {
52
+ return Promise.resolve(undefined);
53
+ }
54
+ const recreateCache = !dataLoader.canSlice() || responseLoadingInfo.count === 0;
55
+ PreloadManager.cacheRecords(dataUnit, records, recreateCache, responseLoadingInfo.loadingInProgress);
56
+ if (PreloadManager.isCacheEnabled(dataUnit) && responseLoadingInfo.loadingInProgress) {
57
+ const newRequest = Object.assign(Object.assign({}, request), { offset: responseLoadingInfo.count });
58
+ const newLoadingInfo = Object.assign(Object.assign({}, responseLoadingInfo), { pageNumber: (responseLoadingInfo.pageNumber || 0) + 1, quiet: true });
59
+ this.callLoader(dataUnit, newRequest, newLoadingInfo, dataLoader)
60
+ .then(result => DataUnitDataLoader.afterLoadingPage(dataUnit, result.loadingInfo))
61
+ .catch(reason => console.error(reason));
62
+ }
63
+ return Promise.resolve(result);
64
+ }
65
+ static afterLoadingPage(dataUnit, loadingInfo) {
66
+ PreloadManager.setLoadingStatus(dataUnit, loadingInfo.loadingInProgress);
67
+ const dataUnitPagination = dataUnit.getPaginationInfo();
68
+ if (dataUnitPagination == undefined) {
69
+ return;
70
+ }
71
+ const count = loadingInfo.count;
72
+ if (loadingInfo.loadingInProgress) {
73
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
74
+ return;
75
+ }
76
+ if (loadingInfo.needReload) {
77
+ //Ir para a primeira página, faz com que o loadData seja chamado novamente
78
+ dataUnit.gotoPage(0);
79
+ return;
80
+ }
81
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
82
+ }
83
+ static registryLoading(dataUnit, loadingInfo) {
84
+ if (loadingInfo == undefined) {
85
+ loadingInfo = { requestTime: new Date().getTime(), count: 0 };
86
+ }
87
+ DataUnitDataLoader._requestTimeByDataUnit.set(dataUnit.name, loadingInfo.requestTime);
88
+ return loadingInfo;
89
+ }
90
+ static isOldRequest(dataUnit, loadingInfo) {
91
+ return DataUnitDataLoader._requestTimeByDataUnit.get(dataUnit.name) > loadingInfo.requestTime;
92
+ }
93
+ static buildPaginationInfo(pageSize, request, loadingInfo) {
94
+ let { limit, offset } = request;
95
+ if (!limit) {
96
+ return undefined;
97
+ }
98
+ if (loadingInfo.pageNumber === 1) {
99
+ // Quando o loader não é capaz de fatiar os registros
100
+ // ele pode decidir por uma carga completa, o que faz o
101
+ // controle de paginação voltar pra primeira página.
102
+ offset = 0;
103
+ }
104
+ const { total, count, loadingInProgress } = loadingInfo;
105
+ const firstRecord = (count === 0 || pageSize === 0) ? 0 : offset + 1;
106
+ const lastRecord = offset + Math.min(pageSize, limit);
107
+ return {
108
+ total,
109
+ count,
110
+ lastRecord,
111
+ firstRecord,
112
+ currentPage: offset / limit,
113
+ hasMore: lastRecord < count || loadingInProgress
114
+ };
115
+ }
116
+ }
117
+ DataUnitDataLoader._requestTimeByDataUnit = new Map();
118
+ DataUnitDataLoader._debouncingTimeouts = {};
@@ -0,0 +1,80 @@
1
+ export class ArrayRepository {
2
+ constructor(equalsFunction) {
3
+ this._list = [];
4
+ this._equalsFunction = equalsFunction;
5
+ }
6
+ async load(filterFunction, sortingFunction, offset, limit) {
7
+ let result = [].concat(this._list);
8
+ if (filterFunction != undefined) {
9
+ result = this._list.filter(item => filterFunction(item));
10
+ }
11
+ if (sortingFunction != undefined) {
12
+ result = result.sort(sortingFunction);
13
+ }
14
+ const count = result.length;
15
+ if (limit != undefined) {
16
+ const start = offset || 0;
17
+ const end = limit ? start + limit : result.length;
18
+ result = result.slice(start, end);
19
+ }
20
+ return Promise.resolve({ result, count });
21
+ }
22
+ async distict(itemProcessor) {
23
+ const processedItems = [];
24
+ let hasEmpty = false;
25
+ for (const item of this._list) {
26
+ const processedItem = itemProcessor(item);
27
+ if (processedItem == undefined) {
28
+ continue;
29
+ }
30
+ if (processedItem.value == undefined) {
31
+ hasEmpty = true;
32
+ continue;
33
+ }
34
+ processedItems.push(processedItem);
35
+ }
36
+ if (hasEmpty) {
37
+ processedItems.push({ key: "", value: null });
38
+ }
39
+ return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
40
+ }
41
+ async push(items) {
42
+ this._list.push(...items);
43
+ }
44
+ async clear() {
45
+ this._list = [];
46
+ }
47
+ async delete(items) {
48
+ this._list = this._list.filter(item => {
49
+ for (const removed of items) {
50
+ if (this._equalsFunction(item, removed)) {
51
+ return false;
52
+ }
53
+ }
54
+ return true;
55
+ });
56
+ }
57
+ async update(items) {
58
+ this._list = this._list.map(existingItem => {
59
+ const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
60
+ return newItem == undefined ? existingItem : newItem;
61
+ });
62
+ }
63
+ async insert(itemReference, items) {
64
+ const itemPosition = this._list.indexOf(itemReference);
65
+ if (itemPosition == -1) {
66
+ this._list.push(...items);
67
+ return;
68
+ }
69
+ this._list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
70
+ }
71
+ isOperating() {
72
+ return true;
73
+ }
74
+ async isEmpty() {
75
+ return Promise.resolve(this._list.length === 0);
76
+ }
77
+ async count() {
78
+ return Promise.resolve(this._list.length);
79
+ }
80
+ }
@@ -0,0 +1,139 @@
1
+ import { DataUnit, FieldComparator, SortMode } from "@sankhyalabs/core";
2
+ import { ArrayRepository } from "./ArrayRepository";
3
+ import { ColumnFilterManager } from "@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";
4
+ export default class PreloadManager {
5
+ static setLoadingStatus(dataUnit, loadingInProgress) {
6
+ this._loadingStatus.set(dataUnit.name, loadingInProgress);
7
+ }
8
+ static isCacheEnabled(_dataUnit) {
9
+ return true;
10
+ }
11
+ static cacheRecords(dataUnit, records, resetDatabase, loadingInProgress) {
12
+ PreloadManager.setLoadingStatus(dataUnit, loadingInProgress);
13
+ if (PreloadManager.isCacheEnabled(dataUnit)) {
14
+ this.getRepository(dataUnit).push(records);
15
+ }
16
+ else {
17
+ if (resetDatabase) {
18
+ this._repositories.delete(dataUnit.name);
19
+ }
20
+ }
21
+ }
22
+ static getSortingFunction(dataUnit, sorting) {
23
+ if (sorting == undefined || sorting.length == 0) {
24
+ return undefined;
25
+ }
26
+ return (recordA, recordB) => {
27
+ for (const sort of sorting) {
28
+ const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
29
+ if (result != 0) {
30
+ return result;
31
+ }
32
+ }
33
+ };
34
+ }
35
+ static async getDistinct(dataUnit, fieldName) {
36
+ if (!PreloadManager.isCacheEnabled(dataUnit)) {
37
+ return Promise.resolve(ColumnFilterManager.compileDistinct(fieldName, dataUnit));
38
+ }
39
+ let filterFunction;
40
+ const request = dataUnit.getLastLoadRequest();
41
+ if (request != undefined) {
42
+ const columnFilters = ColumnFilterManager.getColumnFilters(request.filters, fieldName);
43
+ filterFunction = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
44
+ }
45
+ return new Promise((accept, reject) => {
46
+ PreloadManager.getRepository(dataUnit).distict(record => {
47
+ if (filterFunction != undefined && !filterFunction(record)) {
48
+ return undefined;
49
+ }
50
+ const fieldValue = record[fieldName];
51
+ if (fieldValue == undefined) {
52
+ return { key: null, value: null };
53
+ }
54
+ const value = fieldValue.value != undefined ? fieldValue.value : fieldValue;
55
+ return { key: dataUnit.getFormattedValue(fieldName, fieldValue), value };
56
+ })
57
+ .then(result => {
58
+ if (result == undefined) {
59
+ accept(undefined);
60
+ return;
61
+ }
62
+ accept(Array.from(result.entries()).map(([label, value]) => ({ label, value, check: true })));
63
+ })
64
+ .catch(reason => reject(reason));
65
+ });
66
+ }
67
+ static async loadData(dataUnit, request, loadFromServer) {
68
+ try {
69
+ if (PreloadManager.isCacheEnabled(dataUnit)) {
70
+ let useCache = request.source === "EZ_GRID_LOADING_SOURCE" || request.source === DataUnit.CHANGING_PAGE_LOADING_SOURCE;
71
+ if (useCache) {
72
+ const isCacheEmpty = await PreloadManager.getRepository(dataUnit).isEmpty();
73
+ if (!isCacheEmpty) {
74
+ return PreloadManager.loadFromCache(dataUnit, request);
75
+ }
76
+ }
77
+ //Como não vamos aproveitar o cache, ele precisa ser limpo.
78
+ PreloadManager.getRepository(dataUnit).clear().catch(() => { });
79
+ }
80
+ return loadFromServer(dataUnit, request);
81
+ }
82
+ catch (error) {
83
+ console.error(error);
84
+ return Promise.reject(error);
85
+ }
86
+ }
87
+ static insertRecords(dataUnit, reference, records) {
88
+ if (PreloadManager.isCacheEnabled(dataUnit)) {
89
+ PreloadManager.getRepository(dataUnit).insert(reference, records);
90
+ }
91
+ }
92
+ static updateRecords(dataUnit, records) {
93
+ if (PreloadManager.isCacheEnabled(dataUnit)) {
94
+ PreloadManager.getRepository(dataUnit).update(records);
95
+ }
96
+ }
97
+ static removeRecords(dataUnit, records) {
98
+ if (PreloadManager.isCacheEnabled(dataUnit)) {
99
+ PreloadManager.getRepository(dataUnit).delete(records);
100
+ }
101
+ }
102
+ static async countRecords(dataUnit) {
103
+ if (PreloadManager.isCacheEnabled(dataUnit)) {
104
+ return PreloadManager.getRepository(dataUnit).count();
105
+ }
106
+ return Promise.resolve(0);
107
+ }
108
+ static getRepository(dataUnit) {
109
+ const name = dataUnit.name;
110
+ if (!PreloadManager._repositories.has(name)) {
111
+ PreloadManager._repositories.set(name, new ArrayRepository((recordA, recordB) => recordA.__record__id__ === recordB.__record__id__));
112
+ }
113
+ return PreloadManager._repositories.get(name);
114
+ }
115
+ static async loadFromCache(dataUnit, request) {
116
+ return new Promise((accept, reject) => {
117
+ const columnFilters = ColumnFilterManager.getColumnFilters(request.filters, "");
118
+ const { limit, offset, sort } = request;
119
+ PreloadManager.getRepository(dataUnit)
120
+ .load(ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values())), PreloadManager.getSortingFunction(dataUnit, sort), offset, limit)
121
+ .then(loadResult => {
122
+ const stillLoading = PreloadManager._loadingStatus.get(dataUnit.name);
123
+ const { count, result: records } = loadResult;
124
+ const firstRecord = count == 0 ? 0 : offset + 1;
125
+ const lastRecord = offset + Math.min(records.length, limit);
126
+ const currentPage = offset / limit;
127
+ const paginationInfo = {
128
+ count, currentPage, firstRecord, lastRecord,
129
+ hasMore: stillLoading || (lastRecord < count),
130
+ total: stillLoading ? undefined : count
131
+ };
132
+ accept({ records, paginationInfo });
133
+ })
134
+ .catch(reason => reject(reason));
135
+ });
136
+ }
137
+ }
138
+ PreloadManager._repositories = new Map();
139
+ PreloadManager._loadingStatus = new Map();