@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
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
1
+ import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME, LockManager, LockManagerOperation } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
4
4
  import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
@@ -29,8 +29,10 @@ export class SnkTaskbar {
29
29
  this.onSaveEvent = (action) => {
30
30
  switch (action.type) {
31
31
  case DUAction.FIELD_INVALIDATED:
32
+ case DUAction.INVALIDATE_CLEAN:
32
33
  case DUAction.DATA_SAVED:
33
34
  case DUAction.SAVING_ERROR:
35
+ case DUAction.SAVING_CANCELED:
34
36
  this._isWaitingForSave = false;
35
37
  break;
36
38
  case DUAction.SAVING_DATA:
@@ -67,6 +69,16 @@ export class SnkTaskbar {
67
69
  this.getCustomElements(true);
68
70
  }
69
71
  }
72
+ handleTaskbarSaveLocker() {
73
+ if (this._isWaitingForSave !== true) {
74
+ this._isWaitingForSave = true;
75
+ }
76
+ }
77
+ handleTaskbarSaveUnlocker() {
78
+ if (this._isWaitingForSave === true) {
79
+ this._isWaitingForSave = false;
80
+ }
81
+ }
70
82
  hasToSearchCustomElements(event) {
71
83
  return this.customSlotId === event.detail && !this._slotContainer;
72
84
  }
@@ -85,6 +97,14 @@ export class SnkTaskbar {
85
97
  this._hasToUpdateOverFlow = true;
86
98
  }
87
99
  }
100
+ observeIsWaitingForSave(newValue, oldValue) {
101
+ if (newValue == true && oldValue == false) {
102
+ this.taskbarSaveLocker.emit();
103
+ }
104
+ if (newValue == false && oldValue == true) {
105
+ this.taskbarSaveUnlocker.emit();
106
+ }
107
+ }
88
108
  // Internal methods
89
109
  elementsFromString(strButtons) {
90
110
  const elements = [];
@@ -129,42 +149,44 @@ export class SnkTaskbar {
129
149
  return key ? (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {}) : "";
130
150
  }
131
151
  elementClick(elem) {
132
- if (this.dataUnit) {
133
- switch (elem) {
134
- case TaskbarElement.PREVIOUS:
135
- this.dataUnit.previousRecord();
136
- break;
137
- case TaskbarElement.NEXT:
138
- this.dataUnit.nextRecord();
139
- break;
140
- case TaskbarElement.REFRESH:
141
- this.dataUnit.loadData();
142
- break;
143
- case TaskbarElement.CLONE:
144
- this.dataUnit.copySelected();
145
- break;
146
- case TaskbarElement.REMOVE:
147
- this.dataUnit.removeSelectedRecords();
148
- break;
149
- case TaskbarElement.INSERT:
150
- this.dataUnit.addRecord();
151
- break;
152
- case TaskbarElement.CANCEL:
153
- this.dataUnit.cancelEdition();
154
- break;
155
- case TaskbarElement.SAVE:
156
- if (!this._isWaitingForSave) {
157
- this._isWaitingForSave = true;
158
- this.dataUnit.saveData()
159
- .finally(() => {
160
- this._isWaitingForSave = false;
161
- });
162
- }
163
- break;
152
+ LockManager.whenResolve(this._element, LockManagerOperation.TASKBAR_CLICK).then(() => {
153
+ if (this.dataUnit) {
154
+ switch (elem) {
155
+ case TaskbarElement.PREVIOUS:
156
+ this.dataUnit.previousRecord();
157
+ break;
158
+ case TaskbarElement.NEXT:
159
+ this.dataUnit.nextRecord();
160
+ break;
161
+ case TaskbarElement.REFRESH:
162
+ this.dataUnit.loadData();
163
+ break;
164
+ case TaskbarElement.CLONE:
165
+ this.dataUnit.copySelected();
166
+ break;
167
+ case TaskbarElement.REMOVE:
168
+ this.dataUnit.removeSelectedRecords();
169
+ break;
170
+ case TaskbarElement.INSERT:
171
+ this.dataUnit.addRecord();
172
+ break;
173
+ case TaskbarElement.CANCEL:
174
+ this.dataUnit.cancelEdition();
175
+ break;
176
+ case TaskbarElement.SAVE:
177
+ if (!this._isWaitingForSave) {
178
+ this._isWaitingForSave = true;
179
+ this.dataUnit.saveData()
180
+ .finally(() => {
181
+ this._isWaitingForSave = false;
182
+ });
183
+ }
184
+ break;
185
+ }
164
186
  }
165
- }
166
- if (this.isEnabled(elem))
167
- this.actionClick.emit(elem);
187
+ if (this.isEnabled(elem))
188
+ this.actionClick.emit(elem);
189
+ });
168
190
  }
169
191
  isEnabled(elem) {
170
192
  if (!this.isAllowed(elem)) {
@@ -368,9 +390,10 @@ export class SnkTaskbar {
368
390
  this._lastWidth = this._element.getBoundingClientRect().width;
369
391
  }
370
392
  disconnectedCallback() {
371
- var _a;
393
+ var _a, _b;
394
+ (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.onSaveEvent);
372
395
  this.unlinkAllCustomElements();
373
- (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
396
+ (_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.destroy();
374
397
  }
375
398
  unlinkAllCustomElements() {
376
399
  var _a;
@@ -719,6 +742,36 @@ export class SnkTaskbar {
719
742
  "resolved": "string",
720
743
  "references": {}
721
744
  }
745
+ }, {
746
+ "method": "taskbarSaveLocker",
747
+ "name": "taskbarSaveLocker",
748
+ "bubbles": true,
749
+ "cancelable": true,
750
+ "composed": true,
751
+ "docs": {
752
+ "tags": [],
753
+ "text": "Emitido sempre que um save \u00E9 iniciado pela taskbar."
754
+ },
755
+ "complexType": {
756
+ "original": "void",
757
+ "resolved": "void",
758
+ "references": {}
759
+ }
760
+ }, {
761
+ "method": "taskbarSaveUnlocker",
762
+ "name": "taskbarSaveUnlocker",
763
+ "bubbles": true,
764
+ "cancelable": true,
765
+ "composed": true,
766
+ "docs": {
767
+ "tags": [],
768
+ "text": "Emitido sempre que o ocorre alguma action que libera o save."
769
+ },
770
+ "complexType": {
771
+ "original": "void",
772
+ "resolved": "void",
773
+ "references": {}
774
+ }
722
775
  }];
723
776
  }
724
777
  static get elementRef() { return "_element"; }
@@ -732,6 +785,9 @@ export class SnkTaskbar {
732
785
  }, {
733
786
  "propName": "_lastWidth",
734
787
  "methodName": "observeLastWidth"
788
+ }, {
789
+ "propName": "_isWaitingForSave",
790
+ "methodName": "observeIsWaitingForSave"
735
791
  }];
736
792
  }
737
793
  static get listeners() {
@@ -741,6 +797,18 @@ export class SnkTaskbar {
741
797
  "target": "window",
742
798
  "capture": false,
743
799
  "passive": false
800
+ }, {
801
+ "name": "taskbarSaveLocker",
802
+ "method": "handleTaskbarSaveLocker",
803
+ "target": "window",
804
+ "capture": false,
805
+ "passive": false
806
+ }, {
807
+ "name": "taskbarSaveUnlocker",
808
+ "method": "handleTaskbarSaveUnlocker",
809
+ "target": "window",
810
+ "capture": false,
811
+ "passive": false
744
812
  }];
745
813
  }
746
814
  }
@@ -1,4 +1,4 @@
1
- import { NumberUtils, ObjectUtils } from "@sankhyalabs/core";
1
+ import { NumberUtils, ObjectUtils, StringUtils } from "@sankhyalabs/core";
2
2
  export default class RmPrecisionCustomValueFormatter {
3
3
  setGrid(grid) {
4
4
  if (this._grid) {
@@ -8,7 +8,7 @@ export default class RmPrecisionCustomValueFormatter {
8
8
  this.refreshSelectedRows();
9
9
  }
10
10
  setDataState(dataState) {
11
- if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
11
+ if (this._dataState && ObjectUtils.equals(dataState === null || dataState === void 0 ? void 0 : dataState.metadataByRow, this._dataState.metadataByRow)) {
12
12
  return;
13
13
  }
14
14
  this._dataState = dataState;
@@ -16,7 +16,7 @@ export default class RmPrecisionCustomValueFormatter {
16
16
  }
17
17
  format(currentValue, column, recordId) {
18
18
  var _a;
19
- if (!currentValue) {
19
+ if (StringUtils.isEmpty(currentValue)) {
20
20
  return currentValue;
21
21
  }
22
22
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
@@ -1,5 +1,5 @@
1
1
  import { ChangeOperation, DataType, DataUnit, DateUtils, StringUtils, } from '@sankhyalabs/core';
2
- import { applyFilter, applySorting, buildPaginationInfo } from './dataUnitInMemoryUtils';
2
+ import { buildLoadDataResponse } from './dataUnitInMemoryUtils';
3
3
  export default class InMemoryLoader {
4
4
  constructor(metadata, records, config) {
5
5
  this.metadata = metadata;
@@ -82,9 +82,7 @@ export default class InMemoryLoader {
82
82
  return StringUtils.generateUUID();
83
83
  }
84
84
  inMemoryLoader(dataUnit, request, recordsIn) {
85
- let records = applyFilter(recordsIn, dataUnit, request.filters);
86
- records = applySorting(records, dataUnit, request.sort);
87
- return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
85
+ return buildLoadDataResponse(recordsIn, dataUnit, request);
88
86
  }
89
87
  metadaLoader() {
90
88
  return Promise.resolve(this._metadata);
@@ -11,6 +11,21 @@ export function applyFilter(records, dataUnit, filters) {
11
11
  }
12
12
  return records.filter(filterFunction);
13
13
  }
14
+ export function buildLoadDataResponse(recordsIn, dataUnit, request) {
15
+ let records = recordsIn ? [...recordsIn] : [];
16
+ records = applyFilter(records, dataUnit, request.filters);
17
+ records = applySorting(records, dataUnit, request.sort);
18
+ const { offset, limit } = request;
19
+ const paginationInfoBuilderParams = {
20
+ recordsLength: records.length,
21
+ offset,
22
+ recordsPerPage: limit,
23
+ };
24
+ return Promise.resolve({
25
+ records: getPagesByRecords(records, offset, limit),
26
+ paginationInfo: buildPaginationInfo(paginationInfoBuilderParams),
27
+ });
28
+ }
14
29
  export function applySorting(records, dataUnit, sorting) {
15
30
  if (sorting == undefined || sorting.length == 0) {
16
31
  return records;
@@ -21,17 +36,27 @@ export function applySorting(records, dataUnit, sorting) {
21
36
  }
22
37
  return records.sort(sortingFunction);
23
38
  }
24
- export function buildPaginationInfo(records, offset = 0, limit = 0) {
25
- if (records === undefined) {
26
- return undefined;
39
+ function hasValidLimitAndOffset(offset, limit) {
40
+ return offset >= 0 && limit >= 0;
41
+ }
42
+ export function getPagesByRecords(records, offset = 0, limit = 0) {
43
+ if (!records || !records.length || !hasValidLimitAndOffset(offset, limit))
44
+ return [];
45
+ if (limit === 0 && offset === 0)
46
+ return records;
47
+ return records.slice(offset, offset + limit);
48
+ }
49
+ export function buildPaginationInfo({ recordsLength = 0, offset = 0, recordsPerPage = 0 }) {
50
+ if (!recordsLength) {
51
+ return { currentPage: 0, firstRecord: 0, lastRecord: 0, total: 0, hasMore: false };
27
52
  }
28
- const total = (records === null || records === void 0 ? void 0 : records.length) || 0;
29
- const lastRecord = Math.min(offset + limit, total);
53
+ const lastRecordIndex = offset + recordsPerPage;
54
+ const lastRecord = lastRecordIndex ? Math.min(lastRecordIndex, recordsLength) : recordsLength;
30
55
  return {
31
- currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
32
- firstRecord: offset,
56
+ currentPage: recordsPerPage === 0 ? 0 : Math.ceil(offset / recordsPerPage),
57
+ firstRecord: offset + 1,
33
58
  lastRecord: lastRecord,
34
- total: total,
35
- hasMore: !!(total - lastRecord),
59
+ total: recordsLength,
60
+ hasMore: lastRecord < recordsLength,
36
61
  };
37
62
  }
@@ -6,7 +6,7 @@ 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, StringUtils, WarningException } from '@sankhyalabs/core';
9
+ import { ApplicationContext, ErrorException, ObjectUtils, ServiceCanceledException, StringUtils, WarningException } from '@sankhyalabs/core';
10
10
  import { batchRequests } from 'graphql-request';
11
11
  import UrlUtils from "../../../lib/utils/urlutils";
12
12
  import { PrintUtils } from '../../utils/PrintUtils';
@@ -266,7 +266,8 @@ export class DataFetcher {
266
266
  }
267
267
  payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
268
268
  }
269
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
269
+ const requestId = StringUtils.generateUUID();
270
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
270
271
  http.open("POST", url, true);
271
272
  http.withCredentials = true;
272
273
  http.send(ObjectUtils.objectToString(payloadJson));
@@ -306,7 +307,7 @@ export class DataFetcher {
306
307
  else if (http.readyState == 4 && http.status != 200) {
307
308
  reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
308
309
  }
309
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
310
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
310
311
  };
311
312
  });
312
313
  }
@@ -352,6 +353,7 @@ export class DataFetcher {
352
353
  }
353
354
  }
354
355
  async executePendingRequest(watingRequestsById) {
356
+ var _a, _b;
355
357
  const requestsBatch = [];
356
358
  let quietMode = true;
357
359
  watingRequestsById.forEach((waitingReq) => {
@@ -362,31 +364,36 @@ export class DataFetcher {
362
364
  const response = await this.fecthGraphQL(requestsBatch, quietMode);
363
365
  const { data: dataResponse, errors: errorsResponse, extensions } = response;
364
366
  //Reject promises with errors from query
365
- errorsResponse.forEach((errorResponse) => {
366
- Object.entries(errorResponse).forEach(async ([key, val]) => {
367
- const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
367
+ for (const errorResponse of errorsResponse) {
368
+ const values = Object.values(errorResponse);
369
+ for (const value of values) {
370
+ const waitingRequest = watingRequestsById.get(value.request.variables[value.index].queryID);
368
371
  const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
369
- Promise.race([
372
+ const data = await Promise.race([
370
373
  waitingRequest.promise,
371
374
  new Promise((resolve) => {
372
375
  resolve(false);
373
376
  })
374
- ]).then((data) => {
375
- var _a;
376
- if (!hasClientEvent || data === false) {
377
- (((_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));
377
+ ]);
378
+ if (!hasClientEvent || data === false) {
379
+ if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
380
+ (((_a = watingRequestsById.get(value.request.variables[value.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", value.message));
378
381
  }
379
- });
380
- });
381
- });
382
+ else {
383
+ (((_b = watingRequestsById.get(value.request.variables[value.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", value.message));
384
+ }
385
+ }
386
+ }
387
+ }
382
388
  //Resolve promises with data from query
383
- dataResponse.forEach((data) => {
384
- Object.entries(data).forEach(async ([key, val]) => {
389
+ for (const data of dataResponse) {
390
+ const entries = Object.entries(data);
391
+ for (const [key, val] of entries) {
385
392
  const waitingRequest = watingRequestsById.get(key);
386
393
  await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
387
394
  ((waitingRequest === null || waitingRequest === void 0 ? void 0 : waitingRequest.resolve) || Promise.resolve)(val);
388
- });
389
- });
395
+ }
396
+ }
390
397
  }
391
398
  buildGraphQlURL(quietMode) {
392
399
  const urlParams = UrlUtils.getQueryParams(location.search);
@@ -405,7 +412,8 @@ export class DataFetcher {
405
412
  const errorsResponse = [];
406
413
  const responseExtensions = [];
407
414
  const url = this.buildGraphQlURL(quietMode);
408
- DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request }));
415
+ const requestId = StringUtils.generateUUID();
416
+ DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
409
417
  try {
410
418
  const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
411
419
  response.forEach((resItem, index) => {
@@ -439,11 +447,11 @@ export class DataFetcher {
439
447
  });
440
448
  }
441
449
  else {
442
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
450
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
443
451
  throw new ErrorException("Falha de comunicação", err.message);
444
452
  }
445
453
  }
446
- DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
454
+ DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
447
455
  return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
448
456
  }
449
457
  isHttpError(err) {
@@ -6,21 +6,23 @@ const SERVICE = {
6
6
  download: "AnexoSistemaSP.baixar",
7
7
  };
8
8
  export class AnexoSistemaFetcher {
9
- constructor(entityName, registerKey, dataUnitName) {
9
+ constructor(entityName, dataUnitName) {
10
10
  var _a;
11
11
  this.entityName = entityName;
12
- this.registerKey = registerKey;
13
12
  this.dataUnitName = dataUnitName;
14
13
  this.validateFields = (fields) => {
15
14
  if (!!fields.LINK && !!fields.NOMEARQUIVO)
16
15
  throw new Error(SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
17
16
  if (!fields.LINK && !fields.NOMEARQUIVO)
18
17
  throw new Error(SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
19
- if (!this.registerKey)
18
+ if (!this._registerKey)
20
19
  throw new Error('Register key can not be null');
21
20
  };
22
21
  this.resourceID = (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID));
23
22
  }
23
+ set registerKey(registerKey) {
24
+ this._registerKey = registerKey;
25
+ }
24
26
  async save(change) {
25
27
  var _a, _b;
26
28
  let { updatingFields: fields } = change;
@@ -39,7 +41,7 @@ export class AnexoSistemaFetcher {
39
41
  nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
40
42
  link: fields.LINK,
41
43
  nameEntity: this.entityName,
42
- pkEntity: this.registerKey,
44
+ pkEntity: this._registerKey,
43
45
  typeAcess: fields.TIPOACESSO,
44
46
  typeApres: fields.TIPOAPRES,
45
47
  }
@@ -79,7 +81,7 @@ export class AnexoSistemaFetcher {
79
81
  nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
80
82
  link: fields.LINK,
81
83
  nameEntity: this.entityName,
82
- pkEntity: this.registerKey,
84
+ pkEntity: this._registerKey,
83
85
  typeAcess: fields.TIPOACESSO,
84
86
  typeApres: fields.TIPOAPRES,
85
87
  }
@@ -73,7 +73,7 @@ export default class DataUnitDataLoader {
73
73
  }
74
74
  const count = loadingInfo.count;
75
75
  if (loadingInfo.loadingInProgress) {
76
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
76
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
77
77
  return;
78
78
  }
79
79
  if (loadingInfo.needReload) {
@@ -81,7 +81,7 @@ export default class DataUnitDataLoader {
81
81
  dataUnit.gotoPage(0);
82
82
  return;
83
83
  }
84
- dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
84
+ dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
85
85
  }
86
86
  static registryLoading(dataUnit, loadingInfo) {
87
87
  if (loadingInfo == undefined) {
@@ -44,12 +44,19 @@ export class DatasetStrategy {
44
44
  const records = this.processRecords(dataUnit, fields, responseRecords);
45
45
  const loadingInProgress = pagerId != undefined;
46
46
  const count = loadingInfo.count + records.length;
47
+ const isInsertingNewRecord = dataUnit.hasNewRecord();
47
48
  const needReload = !loadingInProgress && localSorting.length > 0;
49
+ /**
50
+ * Caso precise recarregar dados, porém está no meio de uma inserção, os dados não devem recarregados instantaneamente,
51
+ * Mas sim, sinalizar que o dataUnit está aguardando para der recarregado.
52
+ */
53
+ if (needReload && isInsertingNewRecord) {
54
+ dataUnit.setWaitingToReload(true);
55
+ }
48
56
  return Promise.resolve({
49
57
  records,
50
58
  loadingInfo: Object.assign(Object.assign({}, loadingInfo), { pagerId,
51
- loadingInProgress, total: loadingInProgress ? undefined : count, count,
52
- needReload })
59
+ loadingInProgress, total: loadingInProgress ? undefined : count, count, needReload: needReload && !isInsertingNewRecord })
53
60
  });
54
61
  }
55
62
  catch (error) {
@@ -1,7 +1,7 @@
1
- import { gql } from "graphql-request";
2
- import { ObjectUtils } from "@sankhyalabs/core";
3
- import { ResourceFetcher } from "./resource-fetcher";
4
- import { DataFetcher } from "../DataFetcher";
1
+ import { gql } from 'graphql-request';
2
+ import { ObjectUtils } from '@sankhyalabs/core';
3
+ import { ResourceFetcher } from './resource-fetcher';
4
+ import { DataFetcher } from '../DataFetcher';
5
5
  export class FormConfigFetcher extends ResourceFetcher {
6
6
  constructor() {
7
7
  super();
@@ -155,7 +155,10 @@ export class FormConfigFetcher extends ResourceFetcher {
155
155
  query: this.queryConfig.get("fetchDefaultConfig"),
156
156
  })
157
157
  .then((result) => {
158
- resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
158
+ if (!(result === null || result === void 0 ? void 0 : result.resource)) {
159
+ resolve(null);
160
+ }
161
+ resolve(ObjectUtils.stringToObject(result === null || result === void 0 ? void 0 : result.resource));
159
162
  })
160
163
  .catch((error) => {
161
164
  reject(error);
@@ -175,6 +178,43 @@ export class FormConfigFetcher extends ResourceFetcher {
175
178
  return undefined;
176
179
  return this.buildLegacyConfigurableForm(response);
177
180
  }
181
+ async fetchSimpleFormConfig(configName) {
182
+ const payload = { 'requestBody': { 'formConfig': { 'configName': configName } } };
183
+ const response = await DataFetcher.get().callServiceBroker('FormConfig.getFormConfig', JSON.stringify(payload));
184
+ return this.processConfig(response);
185
+ }
186
+ async saveSimpleFormConfig(configName, fieldList) {
187
+ const payload = this.buildSaveSimpleFormConfigPayload(configName, fieldList);
188
+ const response = await DataFetcher.get().callServiceBroker('FormConfig.saveFormConfig', JSON.stringify(payload));
189
+ this.processConfig(response);
190
+ }
191
+ processConfig(response) {
192
+ if (ObjectUtils.isEmpty(response))
193
+ return [];
194
+ const fields = this.getResponseAsArray(response);
195
+ return fields.map(field => field.name);
196
+ }
197
+ getResponseAsArray(response) {
198
+ var _a, _b, _c;
199
+ 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 : [];
200
+ return Array.isArray(rawFields) ? rawFields : [rawFields];
201
+ }
202
+ buildSaveSimpleFormConfigPayload(configName, fieldNameList) {
203
+ const fieldList = fieldNameList.map(fieldName => { return { name: fieldName }; });
204
+ return {
205
+ formConfig: {
206
+ configName,
207
+ layout: {
208
+ field: fieldList,
209
+ },
210
+ metadata: { field: [] },
211
+ }
212
+ };
213
+ }
214
+ async restoreFormConfig(configName) {
215
+ const payload = { 'requestBody': { 'formConfig': { 'configName': configName } } };
216
+ await DataFetcher.get().callServiceBroker('FormConfig.restoreFormConfig', JSON.stringify(payload));
217
+ }
178
218
  buildLegacyConfigurableForm(config) {
179
219
  var _a, _b, _c;
180
220
  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 : [];
@@ -4,6 +4,7 @@ import { DataFetcher } from "../DataFetcher";
4
4
  export default class ParametersFetcher {
5
5
  constructor() {
6
6
  this._embeddedParams = new Map();
7
+ this._cachedParams = new Map();
7
8
  this.templateByQuery = new Map();
8
9
  try {
9
10
  if (window["MGE_PARAMS"] != undefined) {
@@ -33,11 +34,16 @@ export default class ParametersFetcher {
33
34
  if (this._embeddedParams.has(name)) {
34
35
  return Promise.resolve(this._embeddedParams.get(name));
35
36
  }
37
+ if (this._cachedParams.has(name)) {
38
+ return this._cachedParams.get(name);
39
+ }
36
40
  const completPath = `param://application?params=${name}`;
37
- return DataFetcher.get().callGraphQL({
41
+ const param = await DataFetcher.get().callGraphQL({
38
42
  values: { name: completPath },
39
43
  query: this.templateByQuery.get("fetchParam"),
40
44
  });
45
+ this._cachedParams.set(name, param);
46
+ return param;
41
47
  }
42
48
  async asString(name) {
43
49
  const paramArr = await this.getParam(name);
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, DataType } from "@sankhyalabs/core";
1
+ import { ApplicationContext, DataType, ErrorException } from "@sankhyalabs/core";
2
2
  import { gql } from "graphql-request";
3
3
  import { DataFetcher } from "../DataFetcher";
4
4
  export class PesquisaFetcher {
@@ -73,6 +73,9 @@ export 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 @@ export 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
  });
@@ -6,7 +6,7 @@ const snkDataUnitMessages = {
6
6
  },
7
7
  cancelInfo: {
8
8
  clone: "Duplicação descartada!",
9
- insert: "A inclusão descartada!",
9
+ insert: "A inclusão foi descartada!",
10
10
  update: "A edição foi descartada!"
11
11
  },
12
12
  confirm: {
@@ -7,7 +7,7 @@ const snkExporterMessages = {
7
7
  emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
8
8
  emailSenderOptStep_lblFormat: "Formato:",
9
9
  emailSenderOptStep_formatPDF: "PDF (.pdf)",
10
- emailSenderOptStep_formatXLSX: "Planilha (.xlsx)",
10
+ emailSenderOptStep_formatXLS: "Planilha (.xls)",
11
11
  emailSenderOptStep_export: "Exportar:",
12
12
  emailSenderOptStep_allData: "Toda a grade",
13
13
  emailSenderOptStep_currentPage: "Somente a página atual",