@sankhyalabs/sankhyablocks 8.16.0-dev.6 → 8.16.0-dev.60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (302) hide show
  1. package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-9b965af9.js} +2 -2
  2. package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-42636ac1.js} +64 -22
  3. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-e059eb72.js} +28 -20
  4. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  5. package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-51caf3d0.js} +72 -16
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-a78242d1.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-228016f4.js} +48 -20
  9. package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
  10. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-91fba2b1.js} +42 -2
  11. package/dist/cjs/index-f9e81701.js +12 -32
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-2ec4811b.js} +10 -2
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/{snk-actions-button_4.cjs.entry.js → snk-actions-button_5.cjs.entry.js} +130 -36
  16. package/dist/cjs/snk-application.cjs.entry.js +119 -61
  17. package/dist/cjs/snk-attach.cjs.entry.js +46 -33
  18. package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +398 -12
  19. package/dist/cjs/snk-crud.cjs.entry.js +23 -8
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +23 -24
  21. package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-3d9b6ed4.js} +66 -34
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +12 -12
  24. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1422 -0
  26. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  27. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -1
  30. package/dist/cjs/snk-grid.cjs.entry.js +67 -21
  31. package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-421555af.js} +29 -13
  32. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  33. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +4 -4
  34. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  35. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  37. package/dist/cjs/snk-simple-crud.cjs.entry.js +97 -44
  38. package/dist/cjs/snk-taskbar.cjs.entry.js +64 -38
  39. package/dist/collection/collection-manifest.json +12 -31
  40. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  41. package/dist/collection/components/snk-actions-button/interfaces/index.js +1 -0
  42. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
  43. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +28 -0
  44. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +16 -0
  45. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +52 -0
  46. package/dist/collection/components/snk-application/snk-application.js +44 -54
  47. package/dist/collection/components/snk-attach/snk-attach.js +25 -16
  48. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js +8 -4
  49. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
  50. package/dist/collection/components/snk-crud/snk-crud.js +122 -3
  51. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -3
  52. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
  53. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +72 -6
  54. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  55. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +7 -7
  56. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
  57. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  58. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  59. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +3 -5
  60. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  61. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
  62. package/dist/collection/components/snk-data-unit/snk-data-unit.js +81 -32
  63. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
  64. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  65. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +2 -1
  66. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css +13 -0
  67. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -3
  68. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +8 -0
  69. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +5 -1
  70. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +3 -1
  71. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  72. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +79 -21
  73. package/dist/collection/components/snk-form/snk-form.js +2 -2
  74. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
  75. package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
  76. package/dist/collection/components/snk-form-config/snk-form-config.js +49 -8
  77. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  78. package/dist/collection/components/snk-grid/snk-grid.js +119 -8
  79. package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
  80. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  81. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +1 -1
  82. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +159 -35
  83. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css +22 -0
  84. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js +179 -0
  85. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  86. package/dist/collection/components/snk-taskbar/snk-taskbar.js +106 -38
  87. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  88. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
  89. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
  90. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -21
  91. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  92. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  93. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
  94. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +45 -5
  95. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +7 -1
  96. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +10 -2
  97. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  98. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  99. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  100. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  101. package/dist/collection/lib/utils/CrudUtils.js +25 -16
  102. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  103. package/dist/collection/sw.js +46 -0
  104. package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +65 -21
  105. package/dist/components/DataFetcher.js +29 -21
  106. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  107. package/dist/components/SnkFormConfigManager.js +70 -14
  108. package/dist/components/SnkMessageBuilder.js +7 -3
  109. package/dist/components/dataunit-fetcher.js +47 -17
  110. package/dist/components/form-config-fetcher.js +41 -1
  111. package/dist/components/index.d.ts +1 -0
  112. package/dist/components/index.js +1 -0
  113. package/dist/components/pesquisa-fetcher.js +10 -2
  114. package/dist/components/snk-actions-button2.js +39 -35
  115. package/dist/components/snk-application2.js +114 -55
  116. package/dist/components/snk-attach2.js +54 -59
  117. package/dist/components/snk-crud.js +84 -58
  118. package/dist/components/snk-data-exporter2.js +16 -17
  119. package/dist/components/snk-data-unit2.js +68 -72
  120. package/dist/components/snk-detail-view2.js +114 -104
  121. package/dist/components/snk-exporter-email-sender2.js +1 -1
  122. package/dist/components/snk-filter-bar2.js +41 -22
  123. package/dist/components/snk-filter-binary-select.js +1 -1
  124. package/dist/components/snk-filter-checkbox-list.js +1 -1
  125. package/dist/components/snk-filter-item2.js +5 -1
  126. package/dist/components/snk-filter-modal.js +3 -1
  127. package/dist/components/snk-filter-text.js +2 -1
  128. package/dist/components/snk-form-config2.js +34 -9
  129. package/dist/components/snk-form.js +2 -2
  130. package/dist/components/snk-grid2.js +62 -12
  131. package/dist/components/snk-personalized-filter-editor.js +4 -4
  132. package/dist/components/snk-print-selector.js +1 -1
  133. package/dist/components/snk-simple-bar2.js +1 -1
  134. package/dist/components/snk-simple-crud2.js +104 -64
  135. package/dist/components/snk-simple-form-config.d.ts +11 -0
  136. package/dist/components/snk-simple-form-config.js +6 -0
  137. package/dist/components/snk-simple-form-config2.js +119 -0
  138. package/dist/components/snk-taskbar2.js +66 -40
  139. package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-ff99377a.js} +2 -2
  140. package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-071e0b6a.js} +65 -24
  141. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-5034df59.js} +29 -21
  142. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  143. package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-a7770e24.js} +72 -16
  144. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
  145. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-0b78ca31.js} +1 -1
  146. package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
  147. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-56cb648b.js} +48 -18
  148. package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
  149. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-0c2620ef.js} +42 -2
  150. package/dist/esm/index-a7d3d3f1.js +12 -32
  151. package/dist/esm/loader.js +1 -1
  152. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-24e5bba0.js} +11 -3
  153. package/dist/esm/sankhyablocks.js +1 -1
  154. package/dist/esm/{snk-actions-button_4.entry.js → snk-actions-button_5.entry.js} +132 -39
  155. package/dist/esm/snk-application.entry.js +119 -61
  156. package/dist/esm/snk-attach.entry.js +47 -34
  157. package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +399 -15
  158. package/dist/esm/snk-configurator.entry.js +1 -1
  159. package/dist/esm/snk-crud.entry.js +24 -9
  160. package/dist/esm/snk-data-exporter.entry.js +24 -25
  161. package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-9fa7d2b9.js} +66 -34
  162. package/dist/esm/snk-data-unit.entry.js +5 -5
  163. package/dist/esm/snk-detail-view.entry.js +13 -13
  164. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  165. package/dist/esm/snk-field-config.entry.js +1 -1
  166. package/dist/esm/snk-filter-bar_4.entry.js +1415 -0
  167. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  168. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  169. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  170. package/dist/esm/snk-filter-text.entry.js +2 -1
  171. package/dist/esm/snk-grid.entry.js +62 -16
  172. package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-b740a1fe.js} +30 -14
  173. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  174. package/dist/esm/snk-personalized-filter-editor.entry.js +4 -4
  175. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  176. package/dist/esm/snk-print-selector.entry.js +1 -1
  177. package/dist/esm/snk-simple-bar.entry.js +1 -1
  178. package/dist/esm/snk-simple-crud.entry.js +95 -42
  179. package/dist/esm/snk-tab-config.entry.js +1 -1
  180. package/dist/esm/snk-taskbar.entry.js +65 -39
  181. package/dist/sankhyablocks/p-00278e07.js +1 -0
  182. package/dist/sankhyablocks/p-036b4807.entry.js +1 -0
  183. package/dist/sankhyablocks/p-0d2a2e9e.entry.js +1 -0
  184. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  185. package/dist/sankhyablocks/p-17425c72.js +1 -0
  186. package/dist/sankhyablocks/p-23736d75.js +1 -0
  187. package/dist/sankhyablocks/p-29643bef.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
  189. package/dist/sankhyablocks/p-342eeb3b.js +1 -0
  190. package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-35882caf.entry.js} +1 -1
  191. package/dist/sankhyablocks/p-365d8ed4.entry.js +1 -0
  192. package/dist/sankhyablocks/p-399e1b74.entry.js +1 -0
  193. package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
  194. package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
  195. package/dist/sankhyablocks/p-47178038.entry.js +1 -0
  196. package/dist/sankhyablocks/p-47d24ac8.js +60 -0
  197. package/dist/sankhyablocks/p-53ae0296.entry.js +1 -0
  198. package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
  199. package/dist/sankhyablocks/p-619aeac8.entry.js +1 -0
  200. package/dist/sankhyablocks/p-65650e05.entry.js +1 -0
  201. package/dist/sankhyablocks/p-72a451c8.js +1 -0
  202. package/dist/sankhyablocks/{p-52920496.js → p-763edad2.js} +1 -1
  203. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  204. package/dist/sankhyablocks/p-82274cb0.js +1 -0
  205. package/dist/sankhyablocks/p-89c92727.entry.js +1 -0
  206. package/dist/sankhyablocks/{p-c1d57831.entry.js → p-89da2953.entry.js} +1 -1
  207. package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
  208. package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
  209. package/dist/sankhyablocks/p-8cf0a9fe.entry.js +1 -0
  210. package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
  211. package/dist/sankhyablocks/p-acca8a69.js +26 -0
  212. package/dist/sankhyablocks/p-c271fbf1.js +1 -0
  213. package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
  214. package/dist/sankhyablocks/p-c629c07a.entry.js +1 -0
  215. package/dist/sankhyablocks/p-c76e7e28.entry.js +1 -0
  216. package/dist/sankhyablocks/p-e6683406.js +6 -0
  217. package/dist/sankhyablocks/{p-47db7e88.entry.js → p-e9432f45.entry.js} +1 -1
  218. package/dist/sankhyablocks/p-eda55eef.entry.js +11 -0
  219. package/dist/sankhyablocks/p-fcc662c6.js +1 -0
  220. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  221. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  222. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
  223. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
  224. package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +11 -0
  225. package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +12 -0
  226. package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +13 -0
  227. package/dist/types/components/snk-application/snk-application.d.ts +9 -13
  228. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  229. package/dist/types/components/snk-crud/snk-crud.d.ts +21 -0
  230. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +15 -0
  231. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
  232. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
  233. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +7 -0
  234. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  235. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +9 -0
  236. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
  237. package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
  238. package/dist/types/components/snk-grid/snk-grid.d.ts +21 -0
  239. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +24 -3
  240. package/dist/types/components/snk-simple-form-config/snk-simple-form-config.d.ts +33 -0
  241. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  242. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  243. package/dist/types/components.d.ts +197 -0
  244. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
  245. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  246. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  247. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
  248. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +8 -2
  249. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  250. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  251. package/dist/types/lib/utils/CrudUtils.d.ts +1 -0
  252. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  253. package/package.json +4 -3
  254. package/react/components.d.ts +1 -0
  255. package/react/components.js +1 -0
  256. package/react/components.js.map +1 -1
  257. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  258. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
  259. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  260. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  261. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  262. package/dist/cjs/snk-form.cjs.entry.js +0 -143
  263. package/dist/esm/snk-config-options.entry.js +0 -235
  264. package/dist/esm/snk-filter-bar.entry.js +0 -710
  265. package/dist/esm/snk-filter-item.entry.js +0 -308
  266. package/dist/esm/snk-filter-list.entry.js +0 -148
  267. package/dist/esm/snk-filter-modal.entry.js +0 -245
  268. package/dist/esm/snk-form.entry.js +0 -139
  269. package/dist/sankhyablocks/p-045eae4d.entry.js +0 -11
  270. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  271. package/dist/sankhyablocks/p-2a408684.js +0 -1
  272. package/dist/sankhyablocks/p-3a212712.js +0 -1
  273. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  274. package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
  275. package/dist/sankhyablocks/p-4e5e1313.entry.js +0 -1
  276. package/dist/sankhyablocks/p-4f3717df.entry.js +0 -1
  277. package/dist/sankhyablocks/p-62ba211a.entry.js +0 -1
  278. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  279. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  280. package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
  281. package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
  282. package/dist/sankhyablocks/p-7a337364.js +0 -1
  283. package/dist/sankhyablocks/p-7a85fd49.entry.js +0 -1
  284. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  285. package/dist/sankhyablocks/p-913a9979.js +0 -1
  286. package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
  287. package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
  288. package/dist/sankhyablocks/p-9863d682.js +0 -1
  289. package/dist/sankhyablocks/p-af8efd95.js +0 -6
  290. package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
  291. package/dist/sankhyablocks/p-c2495304.js +0 -1
  292. package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
  293. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  294. package/dist/sankhyablocks/p-d6e26ea8.entry.js +0 -1
  295. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  296. package/dist/sankhyablocks/p-df5451c7.js +0 -26
  297. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  298. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  299. package/dist/sankhyablocks/p-fa4d8cb4.js +0 -1
  300. package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
  301. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  302. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -235,6 +235,21 @@ function applyFilter(records, dataUnit, filters) {
235
235
  }
236
236
  return records.filter(filterFunction);
237
237
  }
238
+ function buildLoadDataResponse(recordsIn, dataUnit, request) {
239
+ let records = recordsIn ? [...recordsIn] : [];
240
+ records = applyFilter(records, dataUnit, request.filters);
241
+ records = applySorting(records, dataUnit, request.sort);
242
+ const { offset, limit } = request;
243
+ const paginationInfoBuilderParams = {
244
+ recordsLength: records.length,
245
+ offset,
246
+ recordsPerPage: limit,
247
+ };
248
+ return Promise.resolve({
249
+ records: getPagesByRecords(records, offset, limit),
250
+ paginationInfo: buildPaginationInfo(paginationInfoBuilderParams),
251
+ });
252
+ }
238
253
  function applySorting(records, dataUnit, sorting) {
239
254
  if (sorting == undefined || sorting.length == 0) {
240
255
  return records;
@@ -245,18 +260,28 @@ function applySorting(records, dataUnit, sorting) {
245
260
  }
246
261
  return records.sort(sortingFunction);
247
262
  }
248
- function buildPaginationInfo(records, offset = 0, limit = 0) {
249
- if (records === undefined) {
250
- return undefined;
263
+ function hasValidLimitAndOffset(offset, limit) {
264
+ return offset >= 0 && limit >= 0;
265
+ }
266
+ function getPagesByRecords(records, offset = 0, limit = 0) {
267
+ if (!records || !records.length || !hasValidLimitAndOffset(offset, limit))
268
+ return [];
269
+ if (limit === 0 && offset === 0)
270
+ return records;
271
+ return records.slice(offset, offset + limit);
272
+ }
273
+ function buildPaginationInfo({ recordsLength = 0, offset = 0, recordsPerPage = 0 }) {
274
+ if (!recordsLength) {
275
+ return { currentPage: 0, firstRecord: 0, lastRecord: 0, total: 0, hasMore: false };
251
276
  }
252
- const total = (records === null || records === void 0 ? void 0 : records.length) || 0;
253
- const lastRecord = Math.min(offset + limit, total);
277
+ const lastRecordIndex = offset + recordsPerPage;
278
+ const lastRecord = lastRecordIndex ? Math.min(lastRecordIndex, recordsLength) : recordsLength;
254
279
  return {
255
- currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
256
- firstRecord: offset,
280
+ currentPage: recordsPerPage === 0 ? 0 : Math.ceil(offset / recordsPerPage),
281
+ firstRecord: offset + 1,
257
282
  lastRecord: lastRecord,
258
- total: total,
259
- hasMore: !!(total - lastRecord),
283
+ total: recordsLength,
284
+ hasMore: lastRecord < recordsLength,
260
285
  };
261
286
  }
262
287
 
@@ -342,9 +367,7 @@ class InMemoryLoader {
342
367
  return StringUtils.generateUUID();
343
368
  }
344
369
  inMemoryLoader(dataUnit, request, recordsIn) {
345
- let records = applyFilter(recordsIn, dataUnit, request.filters);
346
- records = applySorting(records, dataUnit, request.sort);
347
- return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
370
+ return buildLoadDataResponse(recordsIn, dataUnit, request);
348
371
  }
349
372
  metadaLoader() {
350
373
  return Promise.resolve(this._metadata);
@@ -424,12 +447,19 @@ class DatasetStrategy {
424
447
  const records = this.processRecords(dataUnit, fields, responseRecords);
425
448
  const loadingInProgress = pagerId != undefined;
426
449
  const count = loadingInfo.count + records.length;
450
+ const isInsertingNewRecord = dataUnit.hasNewRecord();
427
451
  const needReload = !loadingInProgress && localSorting.length > 0;
452
+ /**
453
+ * Caso precise recarregar dados, porém está no meio de uma inserção, os dados não devem recarregados instantaneamente,
454
+ * Mas sim, sinalizar que o dataUnit está aguardando para der recarregado.
455
+ */
456
+ if (needReload && isInsertingNewRecord) {
457
+ dataUnit.setWaitingToReload(true);
458
+ }
428
459
  return Promise.resolve({
429
460
  records,
430
461
  loadingInfo: Object.assign(Object.assign({}, loadingInfo), { pagerId,
431
- loadingInProgress, total: loadingInProgress ? undefined : count, count,
432
- needReload })
462
+ loadingInProgress, total: loadingInProgress ? undefined : count, count, needReload: needReload && !isInsertingNewRecord })
433
463
  });
434
464
  }
435
465
  catch (error) {
@@ -682,7 +712,7 @@ class DataUnitDataLoader {
682
712
  }
683
713
  const count = loadingInfo.count;
684
714
  if (loadingInfo.loadingInProgress) {
685
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
715
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
686
716
  return;
687
717
  }
688
718
  if (loadingInfo.needReload) {
@@ -690,7 +720,7 @@ class DataUnitDataLoader {
690
720
  dataUnit.gotoPage(0);
691
721
  return;
692
722
  }
693
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
723
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
694
724
  }
695
725
  static registryLoading(dataUnit, loadingInfo) {
696
726
  if (loadingInfo == undefined) {
@@ -1052,4 +1082,4 @@ class DataUnitFetcher {
1052
1082
  }
1053
1083
  }
1054
1084
 
1055
- export { DataUnitFetcher as D, InMemoryLoader as I, PreloadManager as P, applyFilter as a, applySorting as b, buildPaginationInfo as c, DatasetStrategy as d, getRecordValue as g };
1085
+ export { DataUnitFetcher as D, InMemoryLoader as I, PreloadManager as P, DatasetStrategy as a, buildLoadDataResponse as b, getRecordValue as g };
@@ -217,7 +217,10 @@ class FormConfigFetcher extends ResourceFetcher {
217
217
  query: this.queryConfig.get("fetchDefaultConfig"),
218
218
  })
219
219
  .then((result) => {
220
- resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
220
+ if (!(result === null || result === void 0 ? void 0 : result.resource)) {
221
+ resolve(null);
222
+ }
223
+ resolve(ObjectUtils.stringToObject(result === null || result === void 0 ? void 0 : result.resource));
221
224
  })
222
225
  .catch((error) => {
223
226
  reject(error);
@@ -237,6 +240,43 @@ class FormConfigFetcher extends ResourceFetcher {
237
240
  return undefined;
238
241
  return this.buildLegacyConfigurableForm(response);
239
242
  }
243
+ async fetchSimpleFormConfig(configName) {
244
+ const payload = { 'requestBody': { 'formConfig': { 'configName': configName } } };
245
+ const response = await DataFetcher.get().callServiceBroker('FormConfig.getFormConfig', JSON.stringify(payload));
246
+ return this.processConfig(response);
247
+ }
248
+ async saveSimpleFormConfig(configName, fieldList) {
249
+ const payload = this.buildSaveSimpleFormConfigPayload(configName, fieldList);
250
+ const response = await DataFetcher.get().callServiceBroker('FormConfig.saveFormConfig', JSON.stringify(payload));
251
+ this.processConfig(response);
252
+ }
253
+ processConfig(response) {
254
+ if (ObjectUtils.isEmpty(response))
255
+ return [];
256
+ const fields = this.getResponseAsArray(response);
257
+ return fields.map(field => field.name);
258
+ }
259
+ getResponseAsArray(response) {
260
+ var _a, _b, _c;
261
+ const rawFields = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
262
+ return Array.isArray(rawFields) ? rawFields : [rawFields];
263
+ }
264
+ buildSaveSimpleFormConfigPayload(configName, fieldNameList) {
265
+ const fieldList = fieldNameList.map(fieldName => { return { name: fieldName }; });
266
+ return {
267
+ formConfig: {
268
+ configName,
269
+ layout: {
270
+ field: fieldList,
271
+ },
272
+ metadata: { field: [] },
273
+ }
274
+ };
275
+ }
276
+ async restoreFormConfig(configName) {
277
+ const payload = { 'requestBody': { 'formConfig': { 'configName': configName } } };
278
+ await DataFetcher.get().callServiceBroker('FormConfig.restoreFormConfig', JSON.stringify(payload));
279
+ }
240
280
  buildLegacyConfigurableForm(config) {
241
281
  var _a, _b, _c;
242
282
  const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
@@ -47,6 +47,7 @@ export { SnkPrintSelector as SnkPrintSelector } from '../types/components/snk-pr
47
47
  export { SelectBox as SnkSelectBox } from '../types/components/snk-grid-config/snk-select-box/snk-select-box';
48
48
  export { SnkSimpleBar as SnkSimpleBar } from '../types/components/snk-simple-bar/snk-simple-bar';
49
49
  export { SnkSimpleCrud as SnkSimpleCrud } from '../types/components/snk-simple-crud/snk-simple-crud';
50
+ export { SnkSimpleFormConfig as SnkSimpleFormConfig } from '../types/components/snk-simple-form-config/snk-simple-form-config';
50
51
  export { SnkTabConfig as SnkTabConfig } from '../types/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config';
51
52
  export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
52
53
  export { TaskbarActionsButton as TaskbarActionsButton } from '../types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button';
@@ -47,6 +47,7 @@ export { SnkPrintSelector, defineCustomElement as defineCustomElementSnkPrintSel
47
47
  export { SnkSelectBox, defineCustomElement as defineCustomElementSnkSelectBox } from './snk-select-box.js';
48
48
  export { SnkSimpleBar, defineCustomElement as defineCustomElementSnkSimpleBar } from './snk-simple-bar.js';
49
49
  export { SnkSimpleCrud, defineCustomElement as defineCustomElementSnkSimpleCrud } from './snk-simple-crud.js';
50
+ export { SnkSimpleFormConfig, defineCustomElement as defineCustomElementSnkSimpleFormConfig } from './snk-simple-form-config.js';
50
51
  export { SnkTabConfig, defineCustomElement as defineCustomElementSnkTabConfig } from './snk-tab-config.js';
51
52
  export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
52
53
  export { TaskbarActionsButton, defineCustomElement as defineCustomElementTaskbarActionsButton } from './taskbar-actions-button.js';
@@ -1,4 +1,4 @@
1
- import { DataType, ApplicationContext } from '@sankhyalabs/core';
1
+ import { DataType, ApplicationContext, ErrorException } from '@sankhyalabs/core';
2
2
  import { d as dist, D as DataFetcher } from './DataFetcher.js';
3
3
 
4
4
  class PesquisaFetcher {
@@ -73,6 +73,9 @@ class PesquisaFetcher {
73
73
  value = ApplicationContext.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${match[1]})__`);
74
74
  }
75
75
  }
76
+ if (param.dataType === DataType.NUMBER && value === undefined) {
77
+ throw new ErrorException("Falha detectada", `O campo ${param.name} deve ser informado.`);
78
+ }
76
79
  let type = param.dataType;
77
80
  if (type === DataType.OBJECT) {
78
81
  value = value.value;
@@ -96,9 +99,14 @@ class PesquisaFetcher {
96
99
  }
97
100
  }
98
101
  };
102
+ const urlOptions = {
103
+ urlParams: {
104
+ "quietMode": true
105
+ }
106
+ };
99
107
  return new Promise((resolve, reject) => {
100
108
  DataFetcher.get()
101
- .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
109
+ .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody), urlOptions)
102
110
  .then(result => resolve(result))
103
111
  .catch(error => reject(error));
104
112
  });
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
4
  import { P as ParamType } from './ParamType.js';
5
5
  import './pesquisa-fetcher.js';
@@ -9,6 +9,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
9
  import './dataunit-fetcher.js';
10
10
  import './filter-item-type.enum.js';
11
11
  import './form-config-fetcher.js';
12
+ import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
12
13
  import { R as ResourceIDUtils } from './ResourceIDUtils.js';
13
14
 
14
15
  const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
@@ -161,7 +162,6 @@ var RefreshType;
161
162
 
162
163
  const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
163
164
  const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
164
- const NUFIN_COLUMN = 'NUFIN';
165
165
  const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
166
166
  class Actions {
167
167
  constructor(actionsExecuteInterface, dataUnit, appResourceId) {
@@ -173,6 +173,10 @@ class Actions {
173
173
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
174
174
  this._appResourceId = appResourceId;
175
175
  }
176
+ getPrimaryKeys() {
177
+ const ids = getSelectedRecordsIDsInfo(this._dataUnit);
178
+ return ids.map(({ name }) => name);
179
+ }
176
180
  apply(action, hasParamsToSave) {
177
181
  this._application.closePopUp();
178
182
  this._actionsExecuteInterface.execute(action, this._dataUnit)
@@ -441,6 +445,7 @@ class Actions {
441
445
  executeAction(execSource);
442
446
  }
443
447
  addRows(execSource) {
448
+ const primaryKeys = this.getPrimaryKeys();
444
449
  const rows = {
445
450
  row: []
446
451
  };
@@ -454,15 +459,13 @@ class Actions {
454
459
  delete sourceRow[MASTER_ROW_PROPERTY];
455
460
  delete sourceRow[ENTITY_NAME_PROPERTY];
456
461
  }
457
- for (const fieldName in sourceRow) {
458
- if (fieldName !== NUFIN_COLUMN)
459
- continue;
460
- if (!row.field) {
461
- row.field = [];
462
- }
462
+ if (!row.field) {
463
+ row.field = [];
464
+ }
465
+ for (const primaryKey of primaryKeys) {
463
466
  row.field.push({
464
- fieldName: fieldName,
465
- $: sourceRow[fieldName]
467
+ fieldName: primaryKey,
468
+ $: sourceRow[primaryKey]
466
469
  });
467
470
  }
468
471
  rows.row.push(row);
@@ -595,6 +598,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
595
598
  super();
596
599
  this.__registerHost();
597
600
  this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
601
+ this._actions = [];
598
602
  this.handleClick = (evt) => {
599
603
  const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
600
604
  const executor = new ExecutorFactory(selectedAction.type).executor;
@@ -604,27 +608,22 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
604
608
  };
605
609
  this._items = [];
606
610
  this._showDropdown = false;
607
- this._actions = [];
608
- this._isOrderActions = false;
609
611
  }
610
612
  async getActions() {
611
- let param = {
612
- param: {
613
- entityName: this._entityName,
614
- resourceID: this._resourceID
615
- }
616
- };
617
- return DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param).then((result) => {
613
+ const actions = await ServiceUtils.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`, async () => {
618
614
  var _a;
619
- if (!((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action))
620
- return;
621
- if (this._isOrderActions) {
622
- this._actions = ArrayUtils.sortAlphabetically(result.actions.action, 'description');
623
- }
624
- else {
625
- this._actions = result.actions.action;
626
- }
627
- });
615
+ const param = {
616
+ param: {
617
+ entityName: this._entityName,
618
+ resourceID: this._resourceID,
619
+ },
620
+ };
621
+ const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
622
+ return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
623
+ }, StorageType.IN_MEMORY_CACHE);
624
+ this._actions = SnkActionsButton.parameters.isOrderActions
625
+ ? ArrayUtils.sortAlphabetically(actions, 'description')
626
+ : actions;
628
627
  }
629
628
  controlDropdown() {
630
629
  this._showDropdown = !this._showDropdown;
@@ -657,7 +656,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
657
656
  }
658
657
  async componentWillLoad() {
659
658
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
660
- this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
659
+ await this.loadParameters();
661
660
  const snkDataUnit = this._element.parentElement;
662
661
  this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
663
662
  this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
@@ -666,9 +665,8 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
666
665
  this._resourceID = await ResourceIDUtils.getResourceID();
667
666
  }
668
667
  this.setEvents();
669
- this.getActions().then(() => {
670
- this.loadItems();
671
- });
668
+ await this.getActions();
669
+ this.loadItems();
672
670
  }
673
671
  async componentDidLoad() {
674
672
  if (!this._element)
@@ -695,6 +693,11 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
695
693
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
696
694
  };
697
695
  }
696
+ async loadParameters() {
697
+ if (SnkActionsButton.parameters.isOrderActions != null)
698
+ return;
699
+ SnkActionsButton.parameters.isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
700
+ }
698
701
  render() {
699
702
  return (h(Host, null, (this._actions && this._actions.length > 0) &&
700
703
  (h("div", { class: `ez-padding-left--medium snk-actions-button
@@ -710,10 +713,11 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
710
713
  static get style() { return snkActionsButtonCss; }
711
714
  }, [2, "snk-actions-button", {
712
715
  "_items": [32],
713
- "_showDropdown": [32],
714
- "_actions": [32],
715
- "_isOrderActions": [32]
716
+ "_showDropdown": [32]
716
717
  }]);
718
+ SnkActionsButton.parameters = {
719
+ isOrderActions: null
720
+ };
717
721
  function defineCustomElement() {
718
722
  if (typeof customElements === "undefined") {
719
723
  return;
@@ -4,7 +4,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
7
- import { D as DataUnitFetcher } from './dataunit-fetcher.js';
7
+ import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
8
8
  import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
10
10
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
@@ -74,6 +74,7 @@ class TotalsFetcher {
74
74
  class ParametersFetcher {
75
75
  constructor() {
76
76
  this._embeddedParams = new Map();
77
+ this._cachedParams = new Map();
77
78
  this.templateByQuery = new Map();
78
79
  try {
79
80
  if (window["MGE_PARAMS"] != undefined) {
@@ -103,11 +104,16 @@ class ParametersFetcher {
103
104
  if (this._embeddedParams.has(name)) {
104
105
  return Promise.resolve(this._embeddedParams.get(name));
105
106
  }
107
+ if (this._cachedParams.has(name)) {
108
+ return this._cachedParams.get(name);
109
+ }
106
110
  const completPath = `param://application?params=${name}`;
107
- return DataFetcher.get().callGraphQL({
111
+ const param = await DataFetcher.get().callGraphQL({
108
112
  values: { name: completPath },
109
113
  query: this.templateByQuery.get("fetchParam"),
110
114
  });
115
+ this._cachedParams.set(name, param);
116
+ return param;
111
117
  }
112
118
  async asString(name) {
113
119
  const paramArr = await this.getParam(name);
@@ -274,6 +280,99 @@ class SnkErrorHandler {
274
280
  }
275
281
  }
276
282
 
283
+ class DebouncedRequestListener {
284
+ constructor() {
285
+ this._debounceTime = 1500;
286
+ this.requests = new Map();
287
+ this.requestsLoadingBar = [];
288
+ }
289
+ onRequestStart(param) {
290
+ if (param.url.includes("quietMode=true")) {
291
+ return;
292
+ }
293
+ this.requestsLoadingBar.push(param.requestId);
294
+ const timeout = setTimeout(() => {
295
+ this.ezLoadingBar.show();
296
+ }, this._debounceTime);
297
+ this.requests.set(param.requestId, timeout);
298
+ }
299
+ ;
300
+ onRequestEnd(param) {
301
+ const timeoutId = this.requests.get(param.requestId);
302
+ clearTimeout(timeoutId);
303
+ if (this.requestsLoadingBar.includes(param.requestId)) {
304
+ this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
305
+ !this.requestsLoadingBar.length && this.ezLoadingBar.hide();
306
+ }
307
+ }
308
+ ;
309
+ }
310
+
311
+ class RequestListenerLoadingBar {
312
+ constructor() {
313
+ this._debounceTime = 1000;
314
+ this._ignoredNameTypes = ["totals"];
315
+ this._countRequest = 0;
316
+ }
317
+ onRequestStart(param) {
318
+ if (this.isIgnoreLoadingOnRequest(param)) {
319
+ return;
320
+ }
321
+ this._countRequest++;
322
+ this.ezLoadingBar.show();
323
+ if (this._timerLoading) {
324
+ clearTimeout(this._timerLoading);
325
+ }
326
+ }
327
+ ;
328
+ onRequestEnd(param) {
329
+ if (this.isIgnoreLoadingOnRequest(param)) {
330
+ return;
331
+ }
332
+ this._countRequest--;
333
+ this._timerLoading = setTimeout(() => {
334
+ if (this._countRequest <= 0) {
335
+ this.ezLoadingBar.hide();
336
+ }
337
+ }, this._debounceTime);
338
+ }
339
+ ;
340
+ isIgnoreLoadingOnRequest(param) {
341
+ if (param == undefined) {
342
+ return false;
343
+ }
344
+ if (param.url.includes("quietMode=true")) {
345
+ return true;
346
+ }
347
+ if (param.requestBody == undefined) {
348
+ return false;
349
+ }
350
+ if (param.requestBody.length == 1) {
351
+ const { name } = param.requestBody[0].variables;
352
+ if (name) {
353
+ const nameParts = name.split(":");
354
+ const nameType = nameParts[0];
355
+ return this._ignoredNameTypes.indexOf(nameType) >= 0;
356
+ }
357
+ }
358
+ return false;
359
+ }
360
+ ;
361
+ }
362
+
363
+ class RequestListenerFactory {
364
+ static create({ strategy }) {
365
+ switch (strategy) {
366
+ case 'request_name':
367
+ return new RequestListenerLoadingBar();
368
+ case 'request_time':
369
+ return new DebouncedRequestListener();
370
+ default:
371
+ throw new Error('Strategy not found');
372
+ }
373
+ }
374
+ }
375
+
277
376
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
278
377
 
279
378
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -288,7 +387,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
288
387
  this._waitingAppReady = new Array();
289
388
  this._duCache = new Map();
290
389
  this._duPromises = new Map();
291
- this._requestListener = new RequestListenerLoadingBar();
390
+ this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
292
391
  this._pendingActions = new Map;
293
392
  this._loadPkParameter = null;
294
393
  this._isLoadedByPk = false;
@@ -776,6 +875,16 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
776
875
  async isLoadedByPk() {
777
876
  return Promise.resolve(this._isLoadedByPk);
778
877
  }
878
+ /**
879
+ * Remove registro do cache do PreLoader do dataunit.
880
+ * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
881
+ */
882
+ async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
883
+ const records = recordsIDs.map(id => {
884
+ return { "__record__id__": id };
885
+ });
886
+ PreloadManager.removeRecords(dataUnit, records);
887
+ }
779
888
  async getAuthList(auth) {
780
889
  return await (new MGEAuthorization()).parseFromJSON(auth);
781
890
  }
@@ -1262,7 +1371,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1262
1371
  .unbind("F1");
1263
1372
  }
1264
1373
  render() {
1265
- return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1374
+ return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1266
1375
  }
1267
1376
  get _element() { return this; }
1268
1377
  static get watchers() { return {
@@ -1314,6 +1423,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1314
1423
  "info": [64],
1315
1424
  "loadTotals": [64],
1316
1425
  "isLoadedByPk": [64],
1426
+ "preloadMangerRemoveRecord": [64],
1317
1427
  "executeSearch": [64],
1318
1428
  "executePreparedSearch": [64],
1319
1429
  "isDebugMode": [64],
@@ -1326,57 +1436,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1326
1436
  "whenApplicationReady": [64],
1327
1437
  "setSearchFilterContext": [64]
1328
1438
  }]);
1329
- class RequestListenerLoadingBar {
1330
- constructor() {
1331
- this._debounceTime = 1000;
1332
- this._ignoredNameTypes = ["totals"];
1333
- this._countRequest = 0;
1334
- }
1335
- onRequestStart(param) {
1336
- if (this.isIgnoreLoadingOnRequest(param)) {
1337
- return;
1338
- }
1339
- this._countRequest++;
1340
- this.loadingBar.show();
1341
- if (this._timerLoading) {
1342
- clearTimeout(this._timerLoading);
1343
- }
1344
- }
1345
- ;
1346
- onRequestEnd(param) {
1347
- if (this.isIgnoreLoadingOnRequest(param)) {
1348
- return;
1349
- }
1350
- this._countRequest--;
1351
- this._timerLoading = setTimeout(() => {
1352
- if (this._countRequest <= 0) {
1353
- this.loadingBar.hide();
1354
- }
1355
- }, this._debounceTime);
1356
- }
1357
- ;
1358
- isIgnoreLoadingOnRequest(param) {
1359
- if (param == undefined) {
1360
- return false;
1361
- }
1362
- if (param.url.includes("quietMode=true")) {
1363
- return true;
1364
- }
1365
- if (param.requestBody == undefined) {
1366
- return false;
1367
- }
1368
- if (param.requestBody.length == 1) {
1369
- const { name } = param.requestBody[0].variables;
1370
- if (name) {
1371
- const nameParts = name.split(":");
1372
- const nameType = nameParts[0];
1373
- return this._ignoredNameTypes.indexOf(nameType) >= 0;
1374
- }
1375
- }
1376
- return false;
1377
- }
1378
- ;
1379
- }
1380
1439
  class PendingPromise {
1381
1440
  constructor(resolve, reject) {
1382
1441
  this.resolve = resolve;