@sankhyalabs/sankhyablocks 8.16.0-dev.4 → 8.16.0-dev.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-ecc0ed20.js} +3 -2
  2. package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-37c7cbcf.js} +64 -22
  3. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
  4. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  5. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-a36ae041.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-ed497282.js} +5 -2
  11. package/dist/cjs/index-f9e81701.js +8 -28
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-490a86c3.js} +7 -2
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  16. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  17. package/dist/cjs/snk-attach.cjs.entry.js +38 -29
  18. package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +381 -7
  19. package/dist/cjs/snk-crud.cjs.entry.js +16 -7
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +19 -18
  21. package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-b460f1da.js} +42 -22
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +12 -13
  24. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1411 -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-grid.cjs.entry.js +58 -21
  30. package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-de0a5c57.js} +27 -14
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  32. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  34. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +66 -27
  37. package/dist/cjs/snk-taskbar.cjs.entry.js +24 -1
  38. package/dist/collection/collection-manifest.json +11 -31
  39. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  40. package/dist/collection/components/snk-attach/snk-attach.js +25 -16
  41. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
  42. package/dist/collection/components/snk-crud/snk-crud.js +97 -2
  43. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
  44. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
  45. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +70 -7
  46. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  47. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +4 -4
  48. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
  49. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  50. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  51. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
  52. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  53. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
  54. package/dist/collection/components/snk-data-unit/snk-data-unit.js +57 -20
  55. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
  56. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  57. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +1 -1
  58. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  59. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
  60. package/dist/collection/components/snk-form/snk-form.js +2 -2
  61. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
  62. package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
  63. package/dist/collection/components/snk-form-config/snk-form-config.js +32 -3
  64. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  65. package/dist/collection/components/snk-grid/snk-grid.js +74 -8
  66. package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
  67. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  68. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
  69. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +91 -16
  70. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  71. package/dist/collection/components/snk-taskbar/snk-taskbar.js +65 -0
  72. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  73. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  74. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
  75. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
  76. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
  77. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  78. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  79. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
  80. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  81. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +6 -1
  82. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  83. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  84. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  85. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  86. package/dist/collection/lib/utils/CrudUtils.js +25 -16
  87. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  88. package/dist/collection/sw.js +46 -0
  89. package/dist/components/ConfigStorage.js +1 -0
  90. package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +65 -21
  91. package/dist/components/DataFetcher.js +22 -16
  92. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  93. package/dist/components/SnkFormConfigManager.js +72 -18
  94. package/dist/components/SnkMessageBuilder.js +7 -3
  95. package/dist/components/dataunit-fetcher.js +47 -17
  96. package/dist/components/form-config-fetcher.js +4 -1
  97. package/dist/components/pesquisa-fetcher.js +6 -1
  98. package/dist/components/snk-actions-button2.js +12 -9
  99. package/dist/components/snk-attach2.js +34 -25
  100. package/dist/components/snk-crud.js +15 -2
  101. package/dist/components/snk-data-exporter2.js +12 -11
  102. package/dist/components/snk-data-unit2.js +44 -60
  103. package/dist/components/snk-detail-view2.js +28 -13
  104. package/dist/components/snk-exporter-email-sender2.js +1 -1
  105. package/dist/components/snk-filter-bar2.js +35 -22
  106. package/dist/components/snk-filter-binary-select.js +1 -1
  107. package/dist/components/snk-filter-checkbox-list.js +1 -1
  108. package/dist/components/snk-form-config2.js +17 -4
  109. package/dist/components/snk-form.js +2 -2
  110. package/dist/components/snk-grid2.js +51 -12
  111. package/dist/components/snk-personalized-filter-editor.js +1 -1
  112. package/dist/components/snk-print-selector.js +1 -1
  113. package/dist/components/snk-simple-bar2.js +1 -1
  114. package/dist/components/snk-simple-crud2.js +59 -16
  115. package/dist/components/snk-taskbar2.js +25 -2
  116. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
  117. package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-881c41a9.js} +65 -24
  118. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
  119. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  120. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-f1a0fc92.js} +74 -20
  121. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
  122. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
  123. package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
  124. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-fd58c640.js} +48 -18
  125. package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
  126. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
  127. package/dist/esm/index-a7d3d3f1.js +8 -28
  128. package/dist/esm/loader.js +1 -1
  129. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-50fc7e6b.js} +7 -2
  130. package/dist/esm/sankhyablocks.js +1 -1
  131. package/dist/esm/snk-actions-button_4.entry.js +18 -15
  132. package/dist/esm/snk-application.entry.js +7 -7
  133. package/dist/esm/snk-attach.entry.js +39 -30
  134. package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +382 -10
  135. package/dist/esm/snk-configurator.entry.js +1 -1
  136. package/dist/esm/snk-crud.entry.js +17 -8
  137. package/dist/esm/snk-data-exporter.entry.js +20 -19
  138. package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-590225b5.js} +42 -22
  139. package/dist/esm/snk-data-unit.entry.js +5 -5
  140. package/dist/esm/snk-detail-view.entry.js +13 -14
  141. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  142. package/dist/esm/snk-field-config.entry.js +1 -1
  143. package/dist/esm/snk-filter-bar_4.entry.js +1404 -0
  144. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  145. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  146. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  147. package/dist/esm/snk-grid.entry.js +53 -16
  148. package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-2f4dcdc5.js} +28 -15
  149. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  150. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  151. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  152. package/dist/esm/snk-print-selector.entry.js +1 -1
  153. package/dist/esm/snk-simple-bar.entry.js +1 -1
  154. package/dist/esm/snk-simple-crud.entry.js +63 -24
  155. package/dist/esm/snk-tab-config.entry.js +1 -1
  156. package/dist/esm/snk-taskbar.entry.js +24 -1
  157. package/dist/sankhyablocks/p-052213ba.entry.js +1 -0
  158. package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
  159. package/dist/sankhyablocks/p-0b6cd238.entry.js +1 -0
  160. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  161. package/dist/sankhyablocks/p-17425c72.js +1 -0
  162. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
  163. package/dist/sankhyablocks/p-23736d75.js +1 -0
  164. package/dist/sankhyablocks/p-242d010e.entry.js +1 -0
  165. package/dist/sankhyablocks/p-275de842.entry.js +1 -0
  166. package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
  167. package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
  168. package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
  169. package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
  170. package/dist/sankhyablocks/p-47bce500.js +60 -0
  171. package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
  172. package/dist/sankhyablocks/p-583517ba.entry.js +1 -0
  173. package/dist/sankhyablocks/p-5b51491f.entry.js +1 -0
  174. package/dist/sankhyablocks/p-5e51e833.entry.js +1 -0
  175. package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
  176. package/dist/sankhyablocks/p-6114ee36.entry.js +1 -0
  177. package/dist/sankhyablocks/p-72c10005.entry.js +1 -0
  178. package/dist/sankhyablocks/p-7bd9683d.js +1 -0
  179. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  180. package/dist/sankhyablocks/{p-af8efd95.js → p-8a9638ae.js} +2 -2
  181. package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
  182. package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
  183. package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
  184. package/dist/sankhyablocks/p-ab1645fb.entry.js +1 -0
  185. package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
  186. package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
  187. package/dist/sankhyablocks/p-cefb0ee1.entry.js +1 -0
  188. package/dist/sankhyablocks/p-cfa1b199.js +1 -0
  189. package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-dbe6174a.entry.js} +2 -2
  190. package/dist/sankhyablocks/p-f3434fc4.js +1 -0
  191. package/dist/sankhyablocks/p-fa6c5826.entry.js +1 -0
  192. package/dist/sankhyablocks/p-fadc8339.js +1 -0
  193. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
  194. package/dist/sankhyablocks/p-fd13b4d2.js +1 -0
  195. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  196. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  197. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  198. package/dist/types/components/snk-crud/snk-crud.d.ts +17 -0
  199. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +15 -0
  200. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
  201. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
  202. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
  203. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
  204. package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
  205. package/dist/types/components/snk-grid/snk-grid.d.ts +11 -0
  206. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +13 -0
  207. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  208. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  209. package/dist/types/components.d.ts +113 -0
  210. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
  211. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  212. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
  213. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  214. package/dist/types/lib/utils/CrudUtils.d.ts +1 -0
  215. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  216. package/package.json +4 -3
  217. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  218. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
  219. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  220. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  221. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  222. package/dist/cjs/snk-form.cjs.entry.js +0 -143
  223. package/dist/esm/snk-config-options.entry.js +0 -235
  224. package/dist/esm/snk-filter-bar.entry.js +0 -710
  225. package/dist/esm/snk-filter-item.entry.js +0 -308
  226. package/dist/esm/snk-filter-list.entry.js +0 -148
  227. package/dist/esm/snk-filter-modal.entry.js +0 -245
  228. package/dist/esm/snk-form.entry.js +0 -139
  229. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  230. package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
  231. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  232. package/dist/sankhyablocks/p-3a212712.js +0 -1
  233. package/dist/sankhyablocks/p-3a216b81.entry.js +0 -1
  234. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  235. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  236. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  237. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  238. package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
  239. package/dist/sankhyablocks/p-7a337364.js +0 -1
  240. package/dist/sankhyablocks/p-829d4045.js +0 -1
  241. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  242. package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
  243. package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
  244. package/dist/sankhyablocks/p-9863d682.js +0 -1
  245. package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
  246. package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
  247. package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
  248. package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
  249. package/dist/sankhyablocks/p-c2495304.js +0 -1
  250. package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
  251. package/dist/sankhyablocks/p-cefba299.js +0 -1
  252. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  253. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  254. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  255. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  256. package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
  257. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  258. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -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, ServiceCanceledException, ObjectUtils, 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';
@@ -352,6 +352,7 @@ export class DataFetcher {
352
352
  }
353
353
  }
354
354
  async executePendingRequest(watingRequestsById) {
355
+ var _a, _b;
355
356
  const requestsBatch = [];
356
357
  let quietMode = true;
357
358
  watingRequestsById.forEach((waitingReq) => {
@@ -362,31 +363,36 @@ export class DataFetcher {
362
363
  const response = await this.fecthGraphQL(requestsBatch, quietMode);
363
364
  const { data: dataResponse, errors: errorsResponse, extensions } = response;
364
365
  //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);
366
+ for (const errorResponse of errorsResponse) {
367
+ const values = Object.values(errorResponse);
368
+ for (const value of values) {
369
+ const waitingRequest = watingRequestsById.get(value.request.variables[value.index].queryID);
368
370
  const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
369
- Promise.race([
371
+ const data = await Promise.race([
370
372
  waitingRequest.promise,
371
373
  new Promise((resolve) => {
372
374
  resolve(false);
373
375
  })
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));
376
+ ]);
377
+ if (!hasClientEvent || data === false) {
378
+ if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
379
+ (((_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
380
  }
379
- });
380
- });
381
- });
381
+ else {
382
+ (((_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));
383
+ }
384
+ }
385
+ }
386
+ }
382
387
  //Resolve promises with data from query
383
- dataResponse.forEach((data) => {
384
- Object.entries(data).forEach(async ([key, val]) => {
388
+ for (const data of dataResponse) {
389
+ const entries = Object.entries(data);
390
+ for (const [key, val] of entries) {
385
391
  const waitingRequest = watingRequestsById.get(key);
386
392
  await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
387
393
  ((waitingRequest === null || waitingRequest === void 0 ? void 0 : waitingRequest.resolve) || Promise.resolve)(val);
388
- });
389
- });
394
+ }
395
+ }
390
396
  }
391
397
  buildGraphQlURL(quietMode) {
392
398
  const urlParams = UrlUtils.getQueryParams(location.search);
@@ -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) {
@@ -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);
@@ -96,9 +96,14 @@ export class PesquisaFetcher {
96
96
  }
97
97
  }
98
98
  };
99
+ const urlOptions = {
100
+ urlParams: {
101
+ "quietMode": true
102
+ }
103
+ };
99
104
  return new Promise((resolve, reject) => {
100
105
  DataFetcher.get()
101
- .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
106
+ .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody), urlOptions)
102
107
  .then(result => resolve(result))
103
108
  .catch(error => reject(error));
104
109
  });
@@ -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",
@@ -1,5 +1,9 @@
1
1
  export const snkGridMessages = {
2
- findColumn: "Busca de colunas"
2
+ findColumn: "Busca de colunas",
3
+ cancelConfirmation: {
4
+ title: "Aviso",
5
+ message: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?</b>",
6
+ }
3
7
  };
4
8
  export const snkGridConfigMessages = {
5
9
  gridConfiguration: "Configuração da Grade",
@@ -0,0 +1,31 @@
1
+ import { h } from '@stencil/core';
2
+ import { StringUtils } from '@sankhyalabs/core';
3
+ export class ContinuousInsertUtils {
4
+ constructor(snkApplication, resourceID, configName) {
5
+ this.snkApplication = snkApplication;
6
+ this.keyConfigEnableContinuousInsert = `${resourceID}enableContinuousInsert${configName ? configName : ''}`;
7
+ }
8
+ handleSaveConfig(enableContinuousInsert) {
9
+ return this.snkApplication.saveConfig(this.keyConfigEnableContinuousInsert, enableContinuousInsert);
10
+ }
11
+ getConfig() {
12
+ return this.snkApplication.getConfig(this.keyConfigEnableContinuousInsert).then(value => {
13
+ if (value) {
14
+ return value == "true" ? true : false;
15
+ }
16
+ return false;
17
+ }).catch(() => {
18
+ return false;
19
+ });
20
+ }
21
+ actionContinuousInsert(enableContinuousInsert, handleEnableContinuousInsert) {
22
+ return {
23
+ value: StringUtils.generateUUID(),
24
+ label: enableContinuousInsert ? 'Desativar inclusão contínua' : 'Ativar inclusão contínua',
25
+ enabled: true,
26
+ itemBuilder: () => {
27
+ return (h("div", { class: "ez-dropdown__item-wrapper", onClick: handleEnableContinuousInsert }, h("span", { class: "ez-dropdown__item-label" }, enableContinuousInsert ? 'Desativar inclusão contínua' : 'Ativar inclusão contínua')));
28
+ },
29
+ };
30
+ }
31
+ }
@@ -13,6 +13,28 @@ export class CrudUtils {
13
13
  });
14
14
  }
15
15
  }
16
+ static parseCrudResults(entities, onlyFirst) {
17
+ if (!Array.isArray(entities)) {
18
+ entities = [entities];
19
+ }
20
+ const crudFindResults = [];
21
+ for (const entity of entities) {
22
+ let crudFindResult = {
23
+ fields: new Map()
24
+ };
25
+ for (let key in entity) {
26
+ let fieldValue = entity[key];
27
+ if (fieldValue.hasOwnProperty('$')) {
28
+ crudFindResult.fields.set(key, fieldValue.$);
29
+ }
30
+ if (onlyFirst) {
31
+ break;
32
+ }
33
+ }
34
+ crudFindResults.push(crudFindResult);
35
+ }
36
+ return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
37
+ }
16
38
  static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
17
39
  const SERVICE_CRUD_FIND = "mge@crud.find";
18
40
  let parsedFields = [];
@@ -61,24 +83,11 @@ export class CrudUtils {
61
83
  DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
62
84
  var _a;
63
85
  let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
64
- if (entities != undefined) {
65
- let crudFindResult = {
66
- fields: new Map()
67
- };
68
- for (let key in entities) {
69
- let fieldValue = entities[key];
70
- if (fieldValue.hasOwnProperty('$')) {
71
- crudFindResult.fields.set(key, fieldValue.$);
72
- }
73
- if (onlyFirst) {
74
- break;
75
- }
76
- }
77
- resolve(crudFindResult);
78
- }
79
- else {
86
+ if (!entities) {
80
87
  resolve(null);
81
88
  }
89
+ const crudFindResults = this.parseCrudResults(entities, onlyFirst);
90
+ resolve(crudFindResults);
82
91
  });
83
92
  });
84
93
  }
@@ -1,29 +1,29 @@
1
1
  import { DataType, JSUtils } from "@sankhyalabs/core";
2
- export const getSelectedIDs = (dataUnit) => {
3
- const selectionInfo = dataUnit.getSelectionInfo();
2
+ export function getSelectedRecordsIDsInfo(dataUnit) {
3
+ const selectionInfo = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo();
4
4
  if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
5
5
  return [];
6
6
  }
7
7
  const selectedRecordsIDsInfo = [];
8
- const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds;
8
+ const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.records;
9
9
  if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
10
- selectedRecords.forEach(recordId => {
11
- if (!dataUnit.isNewRecord(recordId)) {
10
+ selectedRecords.forEach(({ __record__id__ }) => {
11
+ if (!dataUnit.isNewRecord(__record__id__)) {
12
12
  /*
13
13
  Esse if foi necessário para tratar corretamente o ID
14
14
  do record quando está sendo utilizado no modo standAlone
15
15
  isso não faz a exportação da grid funcionar no modo standAlone
16
16
  mas deixa de causar erro nas oprações de CRUD.
17
17
  */
18
- if (!JSUtils.isBase64(recordId)) {
18
+ if (!JSUtils.isBase64(__record__id__)) {
19
19
  selectedRecordsIDsInfo.push({
20
20
  name: "__record__id__",
21
21
  type: DataType.TEXT,
22
- value: recordId
22
+ value: __record__id__
23
23
  });
24
24
  return;
25
25
  }
26
- const revertBase64ToObject = JSON.parse(window.atob(recordId));
26
+ const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
27
27
  Object.entries(revertBase64ToObject).forEach(([name, value]) => {
28
28
  const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
29
29
  if (metadataField == undefined) {
@@ -35,4 +35,4 @@ export const getSelectedIDs = (dataUnit) => {
35
35
  });
36
36
  }
37
37
  return selectedRecordsIDsInfo;
38
- };
38
+ }
@@ -0,0 +1,46 @@
1
+ import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
2
+ import { registerRoute } from 'workbox-routing';
3
+ import { StaleWhileRevalidate, CacheFirst } from 'workbox-strategies';
4
+ import { CacheableResponsePlugin } from 'workbox-cacheable-response';
5
+ import { ExpirationPlugin } from 'workbox-expiration';
6
+
7
+ // Placeholder for Workbox to inject the precache manifest
8
+ precacheAndRoute([]);
9
+
10
+ // Additional custom logic follows...
11
+ registerRoute(
12
+ ({ url }) =>
13
+ url.pathname.endsWith('/service.sbr') &&
14
+ url.searchParams.has('serviceName'),
15
+ new StaleWhileRevalidate({
16
+ cacheName: 'api-cache',
17
+ plugins: [new CacheableResponsePlugin({ statuses: [200] })],
18
+ })
19
+ );
20
+
21
+ registerRoute(
22
+ ({ request }) =>
23
+ ['image', 'font', 'style'].includes(request.destination),
24
+ new CacheFirst({
25
+ cacheName: 'assets-cache',
26
+ plugins: [
27
+ new CacheableResponsePlugin({ statuses: [0, 200] }),
28
+ new ExpirationPlugin({ maxEntries: 50, maxAgeSeconds: 30 * 24 * 60 * 60 }),
29
+ ],
30
+ })
31
+ );
32
+
33
+ registerRoute(
34
+ ({ request }) => request.mode === 'navigate',
35
+ createHandlerBoundToURL('/index.html')
36
+ );
37
+
38
+ self.addEventListener('install', (event) => {
39
+ console.log('Service Worker installing.');
40
+ self.skipWaiting();
41
+ });
42
+
43
+ self.addEventListener('activate', (event) => {
44
+ console.log('Service Worker activating.');
45
+ clients.claim();
46
+ });
@@ -423,6 +423,7 @@ class ConfigStorage {
423
423
  if (config == undefined) {
424
424
  return;
425
425
  }
426
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
426
427
  await this.deleteGridConfigCache(name, resourceID);
427
428
  return this.gridConfigFetcher.saveConfig(config, name, resourceID);
428
429
  }
@@ -1,6 +1,6 @@
1
1
  import { D as DataFetcher } from './DataFetcher.js';
2
2
  import './pesquisa-fetcher.js';
3
- import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, NumberUtils, DataType } from '@sankhyalabs/core';
3
+ import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
4
4
  import './ISave.js';
5
5
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
6
6
  import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -23,6 +23,28 @@ class CrudUtils {
23
23
  });
24
24
  }
25
25
  }
26
+ static parseCrudResults(entities, onlyFirst) {
27
+ if (!Array.isArray(entities)) {
28
+ entities = [entities];
29
+ }
30
+ const crudFindResults = [];
31
+ for (const entity of entities) {
32
+ let crudFindResult = {
33
+ fields: new Map()
34
+ };
35
+ for (let key in entity) {
36
+ let fieldValue = entity[key];
37
+ if (fieldValue.hasOwnProperty('$')) {
38
+ crudFindResult.fields.set(key, fieldValue.$);
39
+ }
40
+ if (onlyFirst) {
41
+ break;
42
+ }
43
+ }
44
+ crudFindResults.push(crudFindResult);
45
+ }
46
+ return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
47
+ }
26
48
  static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
27
49
  const SERVICE_CRUD_FIND = "mge@crud.find";
28
50
  let parsedFields = [];
@@ -70,24 +92,11 @@ class CrudUtils {
70
92
  DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
71
93
  var _a;
72
94
  let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
73
- if (entities != undefined) {
74
- let crudFindResult = {
75
- fields: new Map()
76
- };
77
- for (let key in entities) {
78
- let fieldValue = entities[key];
79
- if (fieldValue.hasOwnProperty('$')) {
80
- crudFindResult.fields.set(key, fieldValue.$);
81
- }
82
- if (onlyFirst) {
83
- break;
84
- }
85
- }
86
- resolve(crudFindResult);
87
- }
88
- else {
95
+ if (!entities) {
89
96
  resolve(null);
90
97
  }
98
+ const crudFindResults = this.parseCrudResults(entities, onlyFirst);
99
+ resolve(crudFindResults);
91
100
  });
92
101
  });
93
102
  }
@@ -124,12 +133,16 @@ class TaskbarProcessor {
124
133
  });
125
134
  }
126
135
  getButtonsArray(taskbarId, taskbarManager, dataState) {
127
- const defaults = this._defaultButtons[taskbarId];
136
+ const defaults = this.getButtonsFromKey(taskbarId);
128
137
  if (taskbarManager) {
129
138
  return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
130
139
  }
131
140
  return defaults;
132
141
  }
142
+ getButtonsFromKey(taskbarId) {
143
+ const btnsValue = this._defaultButtons[taskbarId];
144
+ return typeof btnsValue === 'function' ? btnsValue() : btnsValue;
145
+ }
133
146
  isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
134
147
  const originalValue = disabled.includes(buttonName) ? false : true;
135
148
  if (taskbarManager && taskbarManager.isEnabled) {
@@ -217,7 +230,7 @@ class RmPrecisionCustomValueFormatter {
217
230
  this.refreshSelectedRows();
218
231
  }
219
232
  setDataState(dataState) {
220
- if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
233
+ if (this._dataState && ObjectUtils.equals(dataState === null || dataState === void 0 ? void 0 : dataState.metadataByRow, this._dataState.metadataByRow)) {
221
234
  return;
222
235
  }
223
236
  this._dataState = dataState;
@@ -225,7 +238,7 @@ class RmPrecisionCustomValueFormatter {
225
238
  }
226
239
  format(currentValue, column, recordId) {
227
240
  var _a;
228
- if (!currentValue) {
241
+ if (StringUtils.isEmpty(currentValue)) {
229
242
  return currentValue;
230
243
  }
231
244
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
@@ -295,4 +308,35 @@ class CommonsExporter {
295
308
  }
296
309
  }
297
310
 
298
- export { CommonsExporter as C, RmPrecisionCustomValueFormatter as R, SnkMultiSelectionListDataSource as S, TaskbarProcessor as T, CrudUtils as a, buildFieldSearch as b, openFieldSearch as o };
311
+ class ContinuousInsertUtils {
312
+ constructor(snkApplication, resourceID, configName) {
313
+ this.snkApplication = snkApplication;
314
+ this.keyConfigEnableContinuousInsert = `${resourceID}enableContinuousInsert${configName ? configName : ''}`;
315
+ }
316
+ handleSaveConfig(enableContinuousInsert) {
317
+ return this.snkApplication.saveConfig(this.keyConfigEnableContinuousInsert, enableContinuousInsert);
318
+ }
319
+ getConfig() {
320
+ return this.snkApplication.getConfig(this.keyConfigEnableContinuousInsert).then(value => {
321
+ if (value) {
322
+ return value == "true" ? true : false;
323
+ }
324
+ return false;
325
+ }).catch(() => {
326
+ return false;
327
+ });
328
+ }
329
+ actionContinuousInsert(enableContinuousInsert, handleEnableContinuousInsert) {
330
+ return {
331
+ value: StringUtils.generateUUID(),
332
+ label: enableContinuousInsert ? 'Desativar inclusão contínua' : 'Ativar inclusão contínua',
333
+ enabled: true,
334
+ itemBuilder: () => {
335
+ return (h("div", { class: "ez-dropdown__item-wrapper", onClick: handleEnableContinuousInsert },
336
+ h("span", { class: "ez-dropdown__item-label" }, enableContinuousInsert ? 'Desativar inclusão contínua' : 'Ativar inclusão contínua')));
337
+ },
338
+ };
339
+ }
340
+ }
341
+
342
+ export { CommonsExporter as C, RmPrecisionCustomValueFormatter as R, SnkMultiSelectionListDataSource as S, TaskbarProcessor as T, CrudUtils as a, buildFieldSearch as b, ContinuousInsertUtils as c, openFieldSearch as o };