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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -3,7 +3,7 @@ import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataU
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
4
  import './pesquisa-fetcher.js';
5
5
  import { S as SaveErrorsEnum } from './ISave.js';
6
- import { P as PreloadManager, a as applyFilter, b as applySorting, c as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
6
+ import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
7
7
  import './filter-item-type.enum.js';
8
8
  import './form-config-fetcher.js';
9
9
  import { V as VIEW_MODE } from './constants.js';
@@ -119,21 +119,23 @@ const SERVICE = {
119
119
  download: "AnexoSistemaSP.baixar",
120
120
  };
121
121
  class AnexoSistemaFetcher {
122
- constructor(entityName, registerKey, dataUnitName) {
122
+ constructor(entityName, dataUnitName) {
123
123
  var _a;
124
124
  this.entityName = entityName;
125
- this.registerKey = registerKey;
126
125
  this.dataUnitName = dataUnitName;
127
126
  this.validateFields = (fields) => {
128
127
  if (!!fields.LINK && !!fields.NOMEARQUIVO)
129
128
  throw new Error(SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
130
129
  if (!fields.LINK && !fields.NOMEARQUIVO)
131
130
  throw new Error(SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
132
- if (!this.registerKey)
131
+ if (!this._registerKey)
133
132
  throw new Error('Register key can not be null');
134
133
  };
135
134
  this.resourceID = (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID));
136
135
  }
136
+ set registerKey(registerKey) {
137
+ this._registerKey = registerKey;
138
+ }
137
139
  async save(change) {
138
140
  var _a, _b;
139
141
  let { updatingFields: fields } = change;
@@ -152,7 +154,7 @@ class AnexoSistemaFetcher {
152
154
  nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
153
155
  link: fields.LINK,
154
156
  nameEntity: this.entityName,
155
- pkEntity: this.registerKey,
157
+ pkEntity: this._registerKey,
156
158
  typeAcess: fields.TIPOACESSO,
157
159
  typeApres: fields.TIPOAPRES,
158
160
  }
@@ -192,7 +194,7 @@ class AnexoSistemaFetcher {
192
194
  nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
193
195
  link: fields.LINK,
194
196
  nameEntity: this.entityName,
195
- pkEntity: this.registerKey,
197
+ pkEntity: this._registerKey,
196
198
  typeAcess: fields.TIPOACESSO,
197
199
  typeApres: fields.TIPOAPRES,
198
200
  }
@@ -464,9 +466,7 @@ class AttachFetcherDataUnitFactory {
464
466
  });
465
467
  this._records = records;
466
468
  }
467
- let records = applyFilter(this._records, dataUnit, request.filters);
468
- records = applySorting(records, dataUnit, request.sort);
469
- return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
469
+ return buildLoadDataResponse(this._records, dataUnit, request);
470
470
  }
471
471
  saveLoader(changes, fetcher) {
472
472
  return new Promise((resolve) => {
@@ -663,11 +663,20 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
663
663
  this.loadAttachmentDataUnit();
664
664
  }
665
665
  if (oldRegisterKey !== newRegisterKey) {
666
+ if (this._currentFetcher instanceof AnexoSistemaFetcher) {
667
+ this._currentFetcher.registerKey = newRegisterKey;
668
+ }
666
669
  await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
667
670
  }
668
671
  }
672
+ getAnexoSistemaFetcherInstance() {
673
+ var _a;
674
+ const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
675
+ anexoSistemaFetcher.registerKey = this.registerKey;
676
+ return anexoSistemaFetcher;
677
+ }
669
678
  async initAttach() {
670
- var _a, _b, _c, _d, _e, _f;
679
+ var _a, _b, _c, _d, _e;
671
680
  if (!this.fetcherType && !this.registerKey)
672
681
  return;
673
682
  if (!this.fetcherType) {
@@ -675,18 +684,18 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
675
684
  }
676
685
  this.returnToGridMode();
677
686
  if (this.fetcherType === "AnexoSistema") {
678
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
679
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
680
- await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
687
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
688
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
689
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
681
690
  return;
682
691
  }
683
692
  if (this.fetcherType === "Attach") {
684
- const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
693
+ const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
685
694
  if (hasMoreOneItem)
686
695
  return;
687
696
  }
688
- await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata());
689
- await ((_f = this._currentDataUnit) === null || _f === void 0 ? void 0 : _f.loadData(undefined, undefined, true, this.registerKey));
697
+ await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
698
+ await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
690
699
  }
691
700
  /**
692
701
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -745,11 +754,11 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
745
754
  }
746
755
  }
747
756
  async loadAnexoSistema() {
748
- var _a, _b, _c;
757
+ var _a, _b;
749
758
  this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
750
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
759
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
751
760
  if (!this._currentDataUnit.metadata) {
752
- await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata());
761
+ await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
753
762
  this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
754
763
  }
755
764
  this.initDataUnitLoaders();
@@ -759,7 +768,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
759
768
  this._currentDataUnit.addInterceptor({
760
769
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
761
770
  });
762
- await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
771
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
763
772
  this.disableEditFieldsNotInForm();
764
773
  }
765
774
  async loadAttach() {
@@ -785,16 +794,16 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
785
794
  }
786
795
  }
787
796
  initDataUnitLoaders() {
788
- var _a, _b, _c;
797
+ var _a, _b;
789
798
  if (this.fetcherType === "AnexoSistema") {
790
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
799
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
791
800
  this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
792
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
801
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
793
802
  }
794
803
  if (this.fetcherType === "Attach") {
795
804
  this._currentFetcher = new AttachFetcher();
796
805
  this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
797
- (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
806
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
798
807
  this.returnToGridMode();
799
808
  await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
800
809
  });
@@ -838,7 +847,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
838
847
  var _a, _b;
839
848
  if (!this._currentDataUnit)
840
849
  return null;
841
- return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this) }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
850
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this) }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
842
851
  }
843
852
  static get watchers() { return {
844
853
  "registerKey": ["registerKeyWatcher"]
@@ -51,6 +51,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
51
51
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
52
52
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
53
53
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
54
+ this.viewModeChanged = createEvent(this, "viewModeChanged", 7);
54
55
  this._keyDownHandler = async (event) => this.keyDownListener(event);
55
56
  this._viewHistory = [];
56
57
  this._customEditors = new Map();
@@ -79,6 +80,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
79
80
  this.disablePersonalizedFilter = undefined;
80
81
  this.autoLoad = undefined;
81
82
  this.autoFocus = true;
83
+ this.enableGridInsert = false;
84
+ this.domainMessagesBuilder = undefined;
85
+ this.ignoreReadOnlyFormFields = undefined;
86
+ this.setCustomFormTitle = undefined;
82
87
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
83
88
  }
84
89
  /**
@@ -187,6 +192,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
187
192
  else if (viewMode === VIEW_MODE.FORM) {
188
193
  this._guidesViewer.setFocus();
189
194
  }
195
+ this.viewModeChanged.emit(viewMode);
190
196
  }
191
197
  openConfig(viewMode) {
192
198
  this._snkConfigurator.close();
@@ -202,6 +208,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
202
208
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
203
209
  }
204
210
  insertionModeHandler() {
211
+ if (this.enableGridInsert)
212
+ return;
205
213
  this.gridToForm();
206
214
  }
207
215
  cancelHandler() {
@@ -250,6 +258,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
250
258
  this._snkDataUnit = parent;
251
259
  this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
252
260
  this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
261
+ this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
253
262
  this._dataUnit = this._snkDataUnit.dataUnit;
254
263
  this._dataState = this._snkDataUnit.dataState;
255
264
  if (!this._dataUnit) {
@@ -414,8 +423,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
414
423
  if (this._resourceID == undefined) {
415
424
  return;
416
425
  }
417
- this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
418
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
426
+ this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
427
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
419
428
  }
420
429
  get _element() { return this; }
421
430
  static get watchers() { return {
@@ -441,6 +450,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
441
450
  "disablePersonalizedFilter": [4, "disable-personalized-filter"],
442
451
  "autoLoad": [4, "auto-load"],
443
452
  "autoFocus": [4, "auto-focus"],
453
+ "enableGridInsert": [4, "enable-grid-insert"],
454
+ "domainMessagesBuilder": [1, "domain-messages-builder"],
455
+ "ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
456
+ "setCustomFormTitle": [16],
444
457
  "_dataUnit": [32],
445
458
  "_dataState": [32],
446
459
  "attachmentRegisterKey": [32],
@@ -124,7 +124,7 @@ class ItemBuilder {
124
124
  getExportToXLS(groupName) {
125
125
  return {
126
126
  id: DataExporterOption.EXPORT_TO_XLS,
127
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
127
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
128
128
  group: groupName
129
129
  };
130
130
  }
@@ -167,7 +167,7 @@ class ItemBuilder {
167
167
  getExportPageToXLS() {
168
168
  return {
169
169
  id: DataExporterOption.EXPORT_PAGE_TO_XLS,
170
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
170
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
171
171
  };
172
172
  }
173
173
  /**
@@ -284,11 +284,11 @@ class ServerSideExporterStrategy {
284
284
  return visibleColumns;
285
285
  }
286
286
  async getParams(resolveProps) {
287
- var _a, _b, _c, _d, _e, _f;
287
+ var _a, _b, _c, _d, _e, _f, _g;
288
288
  const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
289
- const columns = [DataExporterType.EXPORT_TO_PDF, DataExporterType.EXPORT_PAGE_TO_PDF, DataExporterType.EXPORT_PDF_TO_EMAIL, DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
290
- const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
291
- const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
289
+ const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
290
+ const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
291
+ const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
292
292
  const selectedIDs = this._provider.getSelectedIDs();
293
293
  const option = resolveProps.exportOption;
294
294
  const currentPageOptions = [
@@ -343,15 +343,16 @@ class ClientSideExporterStrategy {
343
343
  return visibleColumns;
344
344
  }
345
345
  async executeExport(resolveProps) {
346
- const { methodName, titleGrid } = resolveProps;
346
+ var _a;
347
+ const { methodName, gridTitle } = resolveProps;
347
348
  const records = await this._provider.getRecords();
348
- const columns = [DataExporterType.EXPORT_TO_PDF, DataExporterType.EXPORT_PAGE_TO_PDF, DataExporterType.EXPORT_PDF_TO_EMAIL, DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
349
+ const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
349
350
  const [serviceName, processor] = this.getExecutor(methodName);
350
351
  const payload = {
351
352
  serviceName,
352
353
  requestBody: {
353
354
  grid: {
354
- titleGrid,
355
+ gridTitle,
355
356
  columns: this.buildColumnsObject(columns),
356
357
  rows: this.buildRowsObject(columns, records),
357
358
  customOptions: { xlsxExtension: false }
@@ -462,7 +463,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
462
463
  resolver: ({ type, format, email: { to, subject, message } }) => {
463
464
  var _a;
464
465
  const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
465
- this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
466
+ this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, gridTitle: this._appLabel }, () => {
466
467
  this._snkEmailSender.close();
467
468
  ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
468
469
  });
@@ -550,7 +551,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
550
551
  const params = {
551
552
  methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
552
553
  fileName: this._appLabel,
553
- titleGrid: this._appLabel,
554
+ gridTitle: this._appLabel,
554
555
  exportOption: option,
555
556
  limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
556
557
  type: this.getExportType(option),
@@ -1,47 +1,10 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { JSUtils, DataType, Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
2
+ import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder.js';
5
- import { g as getRecordValue, d as DatasetStrategy } from './dataunit-fetcher.js';
5
+ import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher.js';
6
6
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
7
-
8
- const getSelectedIDs = (dataUnit) => {
9
- const selectionInfo = dataUnit.getSelectionInfo();
10
- if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
11
- return [];
12
- }
13
- const selectedRecordsIDsInfo = [];
14
- const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds;
15
- if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
16
- selectedRecords.forEach(recordId => {
17
- if (!dataUnit.isNewRecord(recordId)) {
18
- /*
19
- Esse if foi necessário para tratar corretamente o ID
20
- do record quando está sendo utilizado no modo standAlone
21
- isso não faz a exportação da grid funcionar no modo standAlone
22
- mas deixa de causar erro nas oprações de CRUD.
23
- */
24
- if (!JSUtils.isBase64(recordId)) {
25
- selectedRecordsIDsInfo.push({
26
- name: "__record__id__",
27
- type: DataType.TEXT,
28
- value: recordId
29
- });
30
- return;
31
- }
32
- const revertBase64ToObject = JSON.parse(window.atob(recordId));
33
- Object.entries(revertBase64ToObject).forEach(([name, value]) => {
34
- const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
35
- if (metadataField == undefined) {
36
- return;
37
- }
38
- selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
39
- });
40
- }
41
- });
42
- }
43
- return selectedRecordsIDsInfo;
44
- };
7
+ import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
45
8
 
46
9
  const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
47
10
  constructor() {
@@ -97,6 +60,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
97
60
  this.ignoreSaveMessage = undefined;
98
61
  this.configName = undefined;
99
62
  this.resourceID = undefined;
63
+ this.domainMessagesBuilder = undefined;
100
64
  }
101
65
  observePageSize() {
102
66
  if (this.dataUnit) {
@@ -152,7 +116,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
152
116
  * @returns Retorna a lista de IDs dos registros selecionados.
153
117
  */
154
118
  async getSelectedRecordsIDsInfo() {
155
- return Promise.resolve(getSelectedIDs(this.dataUnit));
119
+ return getSelectedRecordsIDsInfo(this.dataUnit);
156
120
  }
157
121
  /**
158
122
  * Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
@@ -513,21 +477,15 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
513
477
  if (this.ignoreSaveMessage) {
514
478
  return;
515
479
  }
516
- const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
480
+ const saveOperation = action.payload.changes[0]._operation.toLowerCase();
481
+ const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
517
482
  if (msg != undefined) {
518
483
  this.showSuccessMessage(msg);
519
484
  }
520
485
  }
521
486
  handleRecordsRemoved(action) {
522
487
  var _a, _b;
523
- const cachedRecords = action.payload.cachedRecords;
524
- let removeFinishMsg;
525
- if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
526
- removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
527
- }
528
- else {
529
- removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
530
- }
488
+ let removeFinishMsg = this.buildRemoveFinishMessage(action);
531
489
  if (removeFinishMsg != undefined) {
532
490
  this.showSuccessMessage(removeFinishMsg);
533
491
  }
@@ -538,16 +496,27 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
538
496
  this.dataUnit.gotoPage(page);
539
497
  }
540
498
  }
499
+ buildRemoveFinishMessage(action) {
500
+ const records = action.payload.records;
501
+ if (!records || !records.length)
502
+ return undefined;
503
+ if ((records === null || records === void 0 ? void 0 : records.length) > 1)
504
+ return this.getMessage('snkDataUnit.removeAllInfo', { size: records.length });
505
+ return this.getMessage('snkDataUnit.removeInfo', records);
506
+ }
541
507
  /**
542
508
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
543
509
  * através de um pequeno modulo na estrutura da aplicação:
544
510
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
545
511
  * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
546
512
  */
547
- getMessage(key, params = undefined) {
513
+ getMessage(key, params = undefined, customOperation) {
548
514
  if (!params) {
549
515
  params = this.getMessageParams();
550
516
  }
517
+ if (customOperation) {
518
+ this.messagesBuilder.currentOperation = customOperation;
519
+ }
551
520
  return this.messagesBuilder.getMessage(key, params);
552
521
  }
553
522
  getMessageParams() {
@@ -578,19 +547,28 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
578
547
  return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
579
548
  }
580
549
  }
550
+ updateMetadataWithRMP() {
551
+ this.fillFieldsWithRmp(this.dataUnit.metadata);
552
+ this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
553
+ const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
554
+ this.dataUnit.metadata = dataUnitUpdatedMetadata;
555
+ }
581
556
  async loadDataUnit() {
582
- var _a;
557
+ var _a, _b;
583
558
  if (this.dataUnit == null && this._application && this.entityName) {
584
559
  this.dataUnit = await this.getDataUnitParentOrChild();
585
560
  }
586
561
  if (this.dataUnit) {
587
562
  this.dataUnit.pageSize = this.pageSize;
588
563
  this.dataUnit.unsubscribe(this._dataUnitObserver);
589
- this.dataUnit.addInterceptor(this);
590
564
  this.dataUnit.subscribe(this._dataUnitObserver);
591
- await this.dataUnit.loadMetadata();
592
- if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
593
- this.getMetadataByRow(this.dataUnit);
565
+ if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
566
+ this.updateMetadataWithRMP();
567
+ }
568
+ this.dataUnit.addInterceptor(this);
569
+ if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
570
+ const { records } = this.getMetadataByRow(this.dataUnit);
571
+ this.dataUnit.records = records;
594
572
  }
595
573
  this.dataState = this.buildDataState();
596
574
  let resolver;
@@ -654,6 +632,13 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
654
632
  parent = parent.parentElement;
655
633
  }
656
634
  }
635
+ instanceMessagesBuilder() {
636
+ var _a;
637
+ if (this.messagesBuilder) {
638
+ return;
639
+ }
640
+ this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
641
+ }
657
642
  //---------------------------------------------
658
643
  // Lifecycle web component
659
644
  //---------------------------------------------
@@ -661,9 +646,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
661
646
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
662
647
  this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
663
648
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
664
- if (this.messagesBuilder == undefined) {
665
- this.messagesBuilder = new SnkMessageBuilder(this.entityName);
666
- }
649
+ this.instanceMessagesBuilder();
667
650
  }
668
651
  disconnectedCallback() {
669
652
  if (this.dataUnit) {
@@ -699,6 +682,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
699
682
  "ignoreSaveMessage": [4, "ignore-save-message"],
700
683
  "configName": [1, "config-name"],
701
684
  "resourceID": [1, "resource-i-d"],
685
+ "domainMessagesBuilder": [1, "domain-messages-builder"],
702
686
  "fieldsToLink": [32],
703
687
  "getDataUnit": [64],
704
688
  "getSelectedRecordsIDsInfo": [64],
@@ -744,4 +728,4 @@ function defineCustomElement() {
744
728
  } });
745
729
  }
746
730
 
747
- export { SnkDataUnit as S, defineCustomElement as d, getSelectedIDs as g };
731
+ export { SnkDataUnit as S, defineCustomElement as d };