@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38445.1 → 0.0.0-bugfix-dev-kb-67792.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-0a690675.js} +2 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
  3. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-d6d5db6d.js} +5 -8
  4. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-96b0f549.js} +13 -9
  5. package/dist/cjs/{IExporterProvider-597949f9.js → SnkMultiSelectionListDataSource-f79d220c.js} +6 -96
  6. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
  7. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
  8. package/dist/cjs/{index-1dfc7a6e.js → index-0922807b.js} +0 -5
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{dataunit-fetcher-688d3f05.js → pesquisa-fetcher-cba1b3d0.js} +181 -88
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -7
  13. package/dist/cjs/snk-application.cjs.entry.js +15 -38
  14. package/dist/cjs/snk-attach.cjs.entry.js +49 -74
  15. package/dist/cjs/snk-crud.cjs.entry.js +13 -99
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +88 -318
  17. package/dist/cjs/snk-data-unit-559ac55c.js +462 -0
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -12
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -51
  20. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-filter-bar.cjs.entry.js +14 -9
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  24. package/dist/cjs/snk-form-view.cjs.entry.js +0 -67
  25. package/dist/cjs/snk-form.cjs.entry.js +9 -54
  26. package/dist/cjs/snk-grid.cjs.entry.js +112 -169
  27. package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-bfcad2d6.js} +10 -38
  28. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -11
  29. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  30. package/dist/cjs/snk-simple-crud.cjs.entry.js +40 -267
  31. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -4
  32. package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-3ecd1278.js} +3 -3
  33. package/dist/collection/collection-manifest.json +1 -1
  34. package/dist/collection/components/snk-application/snk-application.js +11 -35
  35. package/dist/collection/components/snk-attach/snk-attach.js +44 -67
  36. package/dist/collection/components/snk-crud/snk-crud.js +7 -249
  37. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +0 -135
  38. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -161
  39. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -112
  40. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  41. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -54
  42. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +52 -59
  43. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -64
  44. package/dist/collection/components/snk-data-unit/snk-data-unit.js +214 -507
  45. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +11 -23
  46. package/dist/collection/components/snk-form/snk-form.js +5 -102
  47. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -6
  48. package/dist/collection/components/snk-grid/snk-grid.css +0 -2
  49. package/dist/collection/components/snk-grid/snk-grid.js +102 -241
  50. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +18 -386
  51. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  52. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
  53. package/dist/collection/lib/@types/index.js +0 -5
  54. package/dist/collection/lib/dataUnit/InMemoryLoader.js +3 -7
  55. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
  56. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +0 -3
  57. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +0 -4
  58. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +13 -11
  59. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +0 -1
  60. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +4 -53
  61. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +34 -0
  62. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
  63. package/dist/collection/lib/message/SnkMessageBuilder.js +12 -5
  64. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +0 -2
  65. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +0 -1
  66. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  67. package/dist/components/DataFetcher.js +8 -3
  68. package/dist/components/SnkFormConfigManager.js +3 -6
  69. package/dist/components/SnkMessageBuilder.js +13 -9
  70. package/dist/components/dataunit-fetcher.js +182 -84
  71. package/dist/components/{IExporterProvider.js → field-search.js} +6 -93
  72. package/dist/components/index2.js +33 -198
  73. package/dist/components/index3.js +199 -0
  74. package/dist/components/snk-actions-button2.js +11 -4
  75. package/dist/components/snk-application2.js +9 -31
  76. package/dist/components/snk-attach2.js +41 -65
  77. package/dist/components/snk-crud.js +11 -103
  78. package/dist/components/snk-data-exporter2.js +87 -311
  79. package/dist/components/snk-data-unit2.js +212 -470
  80. package/dist/components/snk-detail-view2.js +10 -87
  81. package/dist/components/snk-exporter-email-sender2.js +1 -1
  82. package/dist/components/snk-expression-item2.js +1 -1
  83. package/dist/components/snk-filter-bar2.js +11 -7
  84. package/dist/components/snk-form-view2.js +1 -72
  85. package/dist/components/snk-form.js +6 -53
  86. package/dist/components/snk-grid2.js +108 -170
  87. package/dist/components/snk-personalized-filter2.js +1 -1
  88. package/dist/components/snk-simple-crud2.js +23 -259
  89. package/dist/components/snk-taskbar2.js +5 -6
  90. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-8c2ddac8.js} +2 -2
  91. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
  92. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-c01b9d9d.js} +5 -8
  93. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-72423074.js} +13 -9
  94. package/dist/esm/{IExporterProvider-63a188b6.js → SnkMultiSelectionListDataSource-a4805051.js} +7 -95
  95. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
  96. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
  97. package/dist/esm/{index-3aa4977a.js → index-0ece87a6.js} +1 -6
  98. package/dist/esm/loader.js +1 -1
  99. package/dist/esm/{dataunit-fetcher-264191b2.js → pesquisa-fetcher-34a8b8be.js} +182 -84
  100. package/dist/esm/sankhyablocks.js +1 -1
  101. package/dist/esm/snk-actions-button_4.entry.js +5 -7
  102. package/dist/esm/snk-application.entry.js +14 -37
  103. package/dist/esm/snk-attach.entry.js +44 -69
  104. package/dist/esm/snk-crud.entry.js +13 -99
  105. package/dist/esm/snk-data-exporter.entry.js +89 -319
  106. package/dist/esm/snk-data-unit-44215df7.js +460 -0
  107. package/dist/esm/snk-data-unit.entry.js +2 -12
  108. package/dist/esm/snk-detail-view.entry.js +10 -51
  109. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  110. package/dist/esm/snk-filter-bar.entry.js +14 -9
  111. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  112. package/dist/esm/snk-form-config.entry.js +2 -2
  113. package/dist/esm/snk-form-view.entry.js +0 -67
  114. package/dist/esm/snk-form.entry.js +9 -54
  115. package/dist/esm/snk-grid.entry.js +110 -167
  116. package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-edeac29f.js} +10 -38
  117. package/dist/esm/snk-guides-viewer.entry.js +9 -11
  118. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  119. package/dist/esm/snk-simple-crud.entry.js +28 -255
  120. package/dist/esm/snk-taskbar.entry.js +3 -4
  121. package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-2473c8ac.js} +3 -3
  122. package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
  123. package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
  124. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  125. package/dist/sankhyablocks/p-176c3491.entry.js +1 -0
  126. package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
  127. package/dist/sankhyablocks/p-37e5d563.js +65 -0
  128. package/dist/sankhyablocks/p-38289a55.js +1 -0
  129. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-41c2c191.entry.js} +1 -1
  130. package/dist/sankhyablocks/p-46e55a95.entry.js +1 -0
  131. package/dist/sankhyablocks/p-4e728357.entry.js +1 -0
  132. package/dist/sankhyablocks/p-5571bdfe.js +1 -0
  133. package/dist/sankhyablocks/p-5630574e.js +1 -0
  134. package/dist/sankhyablocks/p-594bc21d.js +1 -0
  135. package/dist/sankhyablocks/p-5f8c0426.entry.js +1 -0
  136. package/dist/sankhyablocks/p-80c64add.entry.js +1 -0
  137. package/dist/sankhyablocks/p-86af4cc2.js +1 -0
  138. package/dist/sankhyablocks/p-8b690717.js +1 -0
  139. package/dist/sankhyablocks/{p-aff76a53.js → p-96621231.js} +1 -1
  140. package/dist/sankhyablocks/p-a1832166.entry.js +1 -0
  141. package/dist/sankhyablocks/p-a809d944.entry.js +1 -0
  142. package/dist/sankhyablocks/p-a97226f6.entry.js +1 -0
  143. package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-7e7a7473.js → p-ae4fc9a9.js} +1 -1
  145. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-c2ae0fab.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-c5a9a5d9.entry.js +1 -0
  147. package/dist/sankhyablocks/p-c5aa7d70.entry.js +11 -0
  148. package/dist/sankhyablocks/p-cb0147ab.entry.js +1 -0
  149. package/dist/sankhyablocks/p-f0145e3b.js +1 -0
  150. package/dist/sankhyablocks/{p-14a08904.entry.js → p-f03e4199.entry.js} +1 -1
  151. package/dist/sankhyablocks/p-f607db63.entry.js +1 -0
  152. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  153. package/dist/types/components/snk-application/snk-application.d.ts +3 -7
  154. package/dist/types/components/snk-attach/snk-attach.d.ts +9 -11
  155. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -36
  156. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -23
  157. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +3 -28
  158. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -19
  159. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +4 -24
  160. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -4
  161. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +0 -21
  162. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -61
  163. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -4
  164. package/dist/types/components/snk-form/snk-form.d.ts +0 -14
  165. package/dist/types/components/snk-grid/snk-grid.d.ts +6 -46
  166. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -58
  167. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  168. package/dist/types/components.d.ts +4 -220
  169. package/dist/types/lib/@types/index.d.ts +0 -5
  170. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +1 -2
  171. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +1 -2
  172. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +0 -1
  173. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +0 -1
  174. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +0 -6
  175. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
  176. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +0 -3
  177. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -2
  178. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +0 -1
  179. package/package.json +1 -1
  180. package/dist/cjs/RecordIDUtils-3735135c.js +0 -43
  181. package/dist/cjs/pesquisa-fetcher-680e198f.js +0 -166
  182. package/dist/cjs/snk-data-unit-685272e7.js +0 -679
  183. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +0 -1
  184. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +0 -1
  185. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +0 -97
  186. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +0 -74
  187. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +0 -1
  188. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +0 -58
  189. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +0 -55
  190. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +0 -88
  191. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +0 -20
  192. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +0 -38
  193. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +0 -24
  194. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +0 -18
  195. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +0 -35
  196. package/dist/collection/lib/dataUnit/ValueFormatter.js +0 -4
  197. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +0 -1
  198. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +0 -1
  199. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +0 -1
  200. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +0 -22
  201. package/dist/components/ISave.js +0 -47
  202. package/dist/components/pesquisa-fetcher.js +0 -164
  203. package/dist/esm/RecordIDUtils-87d02110.js +0 -41
  204. package/dist/esm/pesquisa-fetcher-03c8f919.js +0 -164
  205. package/dist/esm/snk-data-unit-63f83504.js +0 -677
  206. package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
  207. package/dist/sankhyablocks/p-19c18d06.entry.js +0 -1
  208. package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
  209. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  210. package/dist/sankhyablocks/p-30cf616e.js +0 -1
  211. package/dist/sankhyablocks/p-3a212712.js +0 -1
  212. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  213. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  214. package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
  215. package/dist/sankhyablocks/p-7a337364.js +0 -1
  216. package/dist/sankhyablocks/p-829d4045.js +0 -1
  217. package/dist/sankhyablocks/p-82a0bfb0.entry.js +0 -11
  218. package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
  219. package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
  220. package/dist/sankhyablocks/p-9863d682.js +0 -1
  221. package/dist/sankhyablocks/p-af8efd95.js +0 -6
  222. package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
  223. package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
  224. package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
  225. package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
  226. package/dist/sankhyablocks/p-cefba299.js +0 -1
  227. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  228. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  229. package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
  230. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  231. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +0 -4
  232. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +0 -4
  233. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -14
  234. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +0 -12
  235. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +0 -5
  236. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +0 -17
  237. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +0 -17
  238. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +0 -77
  239. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +0 -4
  240. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
  241. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +0 -3
  242. package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +0 -3
  243. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +0 -11
  244. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +0 -2
  245. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +0 -3
  246. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +0 -10
  247. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +0 -7
  248. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +0 -20
@@ -0,0 +1,460 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a7d3d3f1.js';
2
+ import { Action, ObjectUtils, JSUtils, DataUnitAction, ApplicationContext, DataType } from '@sankhyalabs/core';
3
+ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
+ import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-72423074.js';
5
+
6
+ const SnkDataUnit = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.dataStateChange = createEvent(this, "dataStateChange", 3);
10
+ this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
11
+ this.messagesBuilderUpdated = createEvent(this, "messagesBuilderUpdated", 3);
12
+ this.insertionMode = createEvent(this, "insertionMode", 3);
13
+ this.cancelEdition = createEvent(this, "cancelEdition", 3);
14
+ this._onDataUnitResolve = [];
15
+ this._openedAlert = false;
16
+ this._dataUnitObserver = (action) => {
17
+ var _a, _b;
18
+ const duState = this.buildDataState();
19
+ this.dataState = duState;
20
+ if (action.type === Action.DATA_SAVED) {
21
+ if (this.ignoreSaveMessage) {
22
+ return;
23
+ }
24
+ const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
25
+ if (msg != undefined) {
26
+ this.showSuccessMessage(msg);
27
+ }
28
+ }
29
+ if (action.type === Action.RECORDS_ADDED || action.type === Action.RECORDS_COPIED) {
30
+ this.insertionMode.emit();
31
+ }
32
+ if (action.type === Action.EDITION_CANCELED) {
33
+ this.cancelEdition.emit();
34
+ }
35
+ if (action.type === Action.RECORDS_REMOVED) {
36
+ const cachedRecords = action.payload.cachedRecords;
37
+ let removeFinishMsg;
38
+ if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
39
+ removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
40
+ }
41
+ else {
42
+ removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
43
+ }
44
+ if (removeFinishMsg != undefined) {
45
+ this.showSuccessMessage(removeFinishMsg);
46
+ }
47
+ const recordsCount = (_b = (_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
48
+ const paginationInfo = this.dataUnit.getPaginationInfo();
49
+ if (paginationInfo) {
50
+ if (recordsCount > 0 || paginationInfo.hasMore) {
51
+ this.dataUnit.gotoPage(paginationInfo.currentPage);
52
+ }
53
+ else {
54
+ this.dataUnit.gotoPage(0);
55
+ }
56
+ }
57
+ }
58
+ this.messagesBuilder.currentOperation = this.getMessageOperation();
59
+ };
60
+ this.dataState = undefined;
61
+ this.messagesBuilder = undefined;
62
+ this.dataUnitName = undefined;
63
+ this.entityName = undefined;
64
+ this.pageSize = 150;
65
+ this.dataUnit = undefined;
66
+ this.beforeSave = undefined;
67
+ this.afterSave = undefined;
68
+ this.useCancelConfirm = true;
69
+ this.ignoreSaveMessage = undefined;
70
+ this.configName = undefined;
71
+ this.resourceID = undefined;
72
+ }
73
+ observePageSize() {
74
+ if (this.dataUnit) {
75
+ this.dataUnit.pageSize = this.pageSize;
76
+ }
77
+ }
78
+ observeDataUnitName(newValue, oldValue) {
79
+ if (oldValue != newValue) {
80
+ if (this.dataUnit) {
81
+ this._application.updateDataunitCache(oldValue, this.dataUnitName, this.dataUnit);
82
+ }
83
+ else {
84
+ this.loadDataUnit();
85
+ }
86
+ }
87
+ }
88
+ observeEntityName(newValue, oldValue) {
89
+ if (oldValue != newValue) {
90
+ this.dataUnit = undefined;
91
+ this.entityName = newValue;
92
+ this.loadDataUnit();
93
+ }
94
+ }
95
+ observeDataState(newValue, oldValue) {
96
+ if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
97
+ this.dataStateChange.emit(newValue);
98
+ }
99
+ }
100
+ observeDataUnit() {
101
+ this.handlerLinkFields();
102
+ this.dataUnitReady.emit(this.dataUnit);
103
+ }
104
+ observeMessagesBuilder(newValue) {
105
+ if (newValue) {
106
+ this.messagesBuilderUpdated.emit(newValue);
107
+ }
108
+ }
109
+ /**
110
+ * Obtém o dataUnit.
111
+ */
112
+ async getDataUnit() {
113
+ return new Promise((resolve) => {
114
+ if (this.dataUnit) {
115
+ resolve(this.dataUnit);
116
+ }
117
+ else {
118
+ this._onDataUnitResolve.push(resolve);
119
+ }
120
+ });
121
+ }
122
+ /**
123
+ * Método que retorna a lista de IDs dos registros selecionados.
124
+ * @returns Retorna a lista de IDs dos registros selecionados.
125
+ */
126
+ async getSelectedRecordsIDsInfo() {
127
+ var _a;
128
+ const selectionInfo = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
129
+ if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
130
+ return [];
131
+ }
132
+ const selectedRecordsIDsInfo = [];
133
+ const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.records;
134
+ if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
135
+ selectedRecords.forEach(({ __record__id__ }) => {
136
+ if (!this.dataUnit.isNewRecord(__record__id__)) {
137
+ /*
138
+ Esse if foi necessário para tratar corretamente o ID
139
+ do record quando está sendo utilizado no modo standAlone
140
+ isso não faz a exportação da grid funcionar no modo standAlone
141
+ mas deixa de causar erro nas oprações de CRUD.
142
+ */
143
+ if (!JSUtils.isBase64(__record__id__)) {
144
+ selectedRecordsIDsInfo.push({
145
+ name: "__record__id__",
146
+ type: DataType.TEXT,
147
+ value: __record__id__
148
+ });
149
+ return;
150
+ }
151
+ const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
152
+ Object.entries(revertBase64ToObject).forEach(([name, value]) => {
153
+ var _a;
154
+ const metadataField = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
155
+ if (metadataField == undefined) {
156
+ return;
157
+ }
158
+ selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
159
+ });
160
+ }
161
+ });
162
+ }
163
+ return selectedRecordsIDsInfo;
164
+ }
165
+ getCleanOnCopyFields() {
166
+ var _a;
167
+ return (_a = this.dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields.filter(field => { var _a; return (_a = field.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; }).map(field => field.name);
168
+ }
169
+ async interceptAction(action) {
170
+ return new Promise(resolve => {
171
+ var _a, _b, _c, _d, _e;
172
+ switch (action.type) {
173
+ case Action.RECORDS_ADDED:
174
+ if (this.isAllowed("INSERT")) {
175
+ resolve(action);
176
+ }
177
+ else {
178
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenInsert"));
179
+ }
180
+ break;
181
+ case Action.RECORDS_COPIED:
182
+ if (this.isAllowed("CLONE")) {
183
+ const cleanFields = this.getCleanOnCopyFields();
184
+ if (cleanFields.length > 0) {
185
+ const records = action.payload;
186
+ action = new DataUnitAction(Action.RECORDS_COPIED, records.map(record => {
187
+ const newRecord = Object.assign({}, record);
188
+ cleanFields.forEach(fieldName => delete newRecord[fieldName]);
189
+ return newRecord;
190
+ }));
191
+ }
192
+ resolve(action);
193
+ }
194
+ else {
195
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenClone"));
196
+ }
197
+ break;
198
+ case Action.DATA_CHANGED:
199
+ case Action.CHANGING_DATA:
200
+ if (this.isAllowed("UPDATE"))
201
+ return resolve(action);
202
+ if (this._openedAlert)
203
+ return this.dataUnit.cancelEdition();
204
+ this._openedAlert = true;
205
+ this.dataUnit.cancelEdition();
206
+ ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate")).then(() => {
207
+ this._openedAlert = false;
208
+ });
209
+ break;
210
+ case Action.SAVING_DATA:
211
+ if (this.beforeSave) {
212
+ const continueAction = this.beforeSave(this.dataUnit);
213
+ if (continueAction instanceof Promise) {
214
+ continueAction.then(result => resolve(result ? action : undefined));
215
+ }
216
+ else {
217
+ resolve(continueAction ? action : undefined);
218
+ }
219
+ }
220
+ else {
221
+ resolve(action);
222
+ }
223
+ break;
224
+ case Action.DATA_SAVED:
225
+ if (this.afterSave) {
226
+ this.afterSave(this.dataUnit);
227
+ }
228
+ else {
229
+ resolve(action);
230
+ }
231
+ break;
232
+ case Action.EDITION_CANCELED:
233
+ if (!this.useCancelConfirm)
234
+ return resolve(action);
235
+ if (this.dataState.hasDirtyRecords) {
236
+ const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
237
+ if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fromParent) || ((_b = action.payload) === null || _b === void 0 ? void 0 : _b.silent)) {
238
+ resolve(action);
239
+ return;
240
+ }
241
+ if (cancelConfirmation == undefined) {
242
+ this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo"));
243
+ resolve(action);
244
+ }
245
+ else {
246
+ const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
247
+ ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
248
+ .then((result) => {
249
+ result && this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo"));
250
+ resolve(result ? action : undefined);
251
+ });
252
+ }
253
+ }
254
+ else {
255
+ resolve(action);
256
+ }
257
+ break;
258
+ case Action.REMOVING_RECORDS:
259
+ if (this.isAllowed("REMOVE")) {
260
+ let multipleSelection = false;
261
+ let removeConfirmation = !((_c = action.payload) === null || _c === void 0 ? void 0 : _c.silent) && this.getMessage("snkDataUnit.removeConfirmation");
262
+ const selection = (_d = this.dataUnit) === null || _d === void 0 ? void 0 : _d.getSelectionInfo();
263
+ if (!((_e = action.payload) === null || _e === void 0 ? void 0 : _e.silent) && (selection === null || selection === void 0 ? void 0 : selection.length) > 1) {
264
+ removeConfirmation = this.getMessage("snkDataUnit.removeAllConfirmation", { size: selection.length });
265
+ multipleSelection = true;
266
+ }
267
+ if (!removeConfirmation) {
268
+ resolve(action);
269
+ }
270
+ else {
271
+ const options = {
272
+ canClose: false,
273
+ labelCancel: this.getMessage(`snkDataUnit.confirm.${multipleSelection ? "no" : "cancel"}`),
274
+ labelConfirm: this.getMessage(`snkDataUnit.confirm.${multipleSelection ? "yes" : "delete"}`),
275
+ btnConfirmDanger: false
276
+ };
277
+ const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
278
+ ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, DialogType.WARN, options)
279
+ .then((result) => resolve(result ? action : undefined));
280
+ }
281
+ }
282
+ else {
283
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenRemove"));
284
+ }
285
+ break;
286
+ default:
287
+ resolve(action);
288
+ }
289
+ });
290
+ }
291
+ showSuccessMessage(message) {
292
+ ApplicationUtils.info(message, { iconName: "check" });
293
+ }
294
+ isAllowed(flag) {
295
+ return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
296
+ }
297
+ buildDataState() {
298
+ const selectionInfo = this.dataUnit.getSelectionInfo();
299
+ const isStartingInsertionMode = (this.dataUnit.hasDirtyRecords() || this.dataUnit.hasWaitingChanges()) && (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isEmpty());
300
+ return new DataStateImpl({
301
+ insertionMode: this.dataUnit.hasNewRecord(),
302
+ isStartingInsertionMode,
303
+ hasNext: this.dataUnit.hasNext(),
304
+ hasPrevious: this.dataUnit.hasPrevious(),
305
+ copyMode: this.dataUnit.hasCopiedRecord(),
306
+ isDirty: this.dataUnit.isDirty(),
307
+ hasDirtyRecords: this.dataUnit.hasDirtyRecords(),
308
+ selectedRecords: undefined,
309
+ selectionInfo,
310
+ selectedRecord: this.dataUnit.getSelectedRecord(),
311
+ recordsIsEmpty: this.dataUnit.records.length === 0
312
+ });
313
+ }
314
+ /**
315
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
316
+ * através de um pequeno modulo na estrutura da aplicação:
317
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
318
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
319
+ */
320
+ getMessage(key, params = undefined) {
321
+ if (!params) {
322
+ params = this.getMessageParams();
323
+ }
324
+ return this.messagesBuilder.getMessage(key, params);
325
+ }
326
+ getMessageParams() {
327
+ //FIXME: Devido ao recurso de multiseleção do dataunit, precisaremos criar um mecanismo para
328
+ //oferecer todos os registros selecionados para a mensagem, pois mensagens podem ficar incorretas.
329
+ return this.dataState.selectedRecord;
330
+ }
331
+ getMessageOperation() {
332
+ if (this.dataState.copyMode) {
333
+ return OperationMap.CLONE;
334
+ }
335
+ if (this.dataState.insertionMode || this.dataState.isStartingInsertionMode) {
336
+ return OperationMap.INSERT;
337
+ }
338
+ if (this.dataState.isDirty) {
339
+ return OperationMap.UPDATE;
340
+ }
341
+ return OperationMap.CLEAN;
342
+ }
343
+ async getDataUnitParentOrChild() {
344
+ var _a;
345
+ const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
346
+ if (this._parentSnkDataUnit) {
347
+ this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
348
+ return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
349
+ }
350
+ else {
351
+ return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
352
+ }
353
+ }
354
+ async loadDataUnit() {
355
+ if (this.dataUnit == null && this._application && this.entityName) {
356
+ this.dataUnit = await this.getDataUnitParentOrChild();
357
+ }
358
+ if (this.dataUnit) {
359
+ this.dataUnit.pageSize = this.pageSize;
360
+ this.dataUnit.unsubscribe(this._dataUnitObserver);
361
+ this.dataUnit.addInterceptor(this);
362
+ this.dataUnit.subscribe(this._dataUnitObserver);
363
+ this.dataState = this.buildDataState();
364
+ let resolver;
365
+ while (resolver = this._onDataUnitResolve.pop()) {
366
+ resolver(this.dataUnit);
367
+ }
368
+ }
369
+ }
370
+ getParentSnkDataUnit() {
371
+ let currentElement = this.element;
372
+ while (currentElement.parentNode) {
373
+ if (currentElement.parentNode.nodeName === 'SNK-DATA-UNIT') {
374
+ return currentElement.parentNode;
375
+ }
376
+ currentElement = currentElement.parentNode;
377
+ }
378
+ return;
379
+ }
380
+ handlerLinkFields() {
381
+ var _a, _b;
382
+ const metadata = Object.assign({}, this.dataUnit.metadata);
383
+ if (!this._parentDataUnit)
384
+ return;
385
+ const child = this._parentDataUnit.getChildInfo(this.entityName);
386
+ if (!child)
387
+ return;
388
+ const fieldsLink = (_a = child === null || child === void 0 ? void 0 : child.links) === null || _a === void 0 ? void 0 : _a.map(link => link.target);
389
+ (_b = metadata === null || metadata === void 0 ? void 0 : metadata.fields) === null || _b === void 0 ? void 0 : _b.forEach(field => {
390
+ if (fieldsLink === null || fieldsLink === void 0 ? void 0 : fieldsLink.includes(field.name)) {
391
+ field.visible = false;
392
+ }
393
+ });
394
+ this.dataUnit.metadata = metadata;
395
+ }
396
+ static getNearestInstance(element) {
397
+ let parent = element.parentElement;
398
+ while (parent) {
399
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
400
+ return parent;
401
+ }
402
+ parent = parent.parentElement;
403
+ }
404
+ }
405
+ //---------------------------------------------
406
+ // Lifecycle web component
407
+ //---------------------------------------------
408
+ componentWillLoad() {
409
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
410
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
411
+ this._parentSnkDataUnit = this.getParentSnkDataUnit();
412
+ if (this.messagesBuilder == undefined) {
413
+ this.messagesBuilder = new SnkMessageBuilder(this.entityName);
414
+ }
415
+ }
416
+ disconnectedCallback() {
417
+ if (this.dataUnit) {
418
+ this.dataUnit.releaseCallbacks();
419
+ }
420
+ }
421
+ componentDidLoad() {
422
+ this.loadDataUnit();
423
+ }
424
+ render() {
425
+ return (h(Host, null));
426
+ }
427
+ get element() { return getElement(this); }
428
+ static get watchers() { return {
429
+ "pageSize": ["observePageSize"],
430
+ "dataUnitName": ["observeDataUnitName"],
431
+ "entityName": ["observeEntityName"],
432
+ "dataState": ["observeDataState"],
433
+ "dataUnit": ["observeDataUnit"],
434
+ "messagesBuilder": ["observeMessagesBuilder"]
435
+ }; }
436
+ };
437
+ class DataStateImpl {
438
+ constructor(datastate) {
439
+ this.copyMode = datastate.copyMode;
440
+ this.insertionMode = datastate.insertionMode;
441
+ this.isStartingInsertionMode = datastate.isStartingInsertionMode;
442
+ this.isDirty = datastate.isDirty;
443
+ this.hasDirtyRecords = datastate.hasDirtyRecords;
444
+ this.hasNext = datastate.hasNext;
445
+ this.hasPrevious = datastate.hasPrevious;
446
+ this.selectionInfo = datastate.selectionInfo;
447
+ this.selectedRecord = datastate.selectedRecord;
448
+ this.recordsIsEmpty = datastate.recordsIsEmpty;
449
+ }
450
+ get selectedRecords() {
451
+ var _a;
452
+ console.warn("SnkDataUnit: O método `selectedRecords` foi descontinuado. Use o método `selectionInfo`.");
453
+ if ((_a = this.selectionInfo) === null || _a === void 0 ? void 0 : _a.isAllRecords()) {
454
+ throw new Error("Erro interno: Impossível obter os registros selecionados. A seleção atual é virtual. Use o atributo `selectionInfo`.");
455
+ }
456
+ return this.selectionInfo.records;
457
+ }
458
+ }
459
+
460
+ export { SnkDataUnit as S };
@@ -1,15 +1,5 @@
1
- export { S as snk_data_unit } from './snk-data-unit-63f83504.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-44215df7.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
- import './SnkMessageBuilder-89925609.js';
6
- import './dataunit-fetcher-264191b2.js';
7
- import './DataFetcher-c1baf61d.js';
8
- import './PrintUtils-3e4ff0f5.js';
9
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
- import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
12
- import '@sankhyalabs/core/dist/utils/SortingUtils';
13
- import './ResourceIDUtils-a114189a.js';
14
- import './RecordIDUtils-87d02110.js';
15
- import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
5
+ import './SnkMessageBuilder-72423074.js';
@@ -1,24 +1,22 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { Action } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-d4554df9.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c01b9d9d.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import './DataFetcher-c1baf61d.js';
6
- import './pesquisa-fetcher-03c8f919.js';
7
- import { P as PresentationMode } from './index-3aa4977a.js';
5
+ import './DataFetcher-773a3e4b.js';
6
+ import './pesquisa-fetcher-34a8b8be.js';
7
+ import { P as PresentationMode } from './index-0ece87a6.js';
8
8
  import './ISave-d8c8bc59.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './dataunit-fetcher-264191b2.js';
12
11
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-30fb808f.js';
14
- import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
12
+ import './form-config-fetcher-e0382e5a.js';
13
+ import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
15
14
  import { d as VIEW_MODE } from './constants-8457af36.js';
16
- import { S as SnkGuidesViewer } from './snk-guides-viewer-151f6091.js';
17
- import { S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
18
- import './ConfigStorage-86187da3.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-edeac29f.js';
16
+ import { S as SnkMessageBuilder } from './SnkMessageBuilder-72423074.js';
17
+ import './ConfigStorage-8c2ddac8.js';
19
18
  import './PrintUtils-3e4ff0f5.js';
20
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
21
- import '@sankhyalabs/core/dist/utils/SortingUtils';
22
20
  import './ResourceIDUtils-a114189a.js';
23
21
  import './index-bdf75557.js';
24
22
  import './field-search-efbe307f.js';
@@ -91,8 +89,6 @@ const SnkDetailView = class {
91
89
  this.branchGuide = undefined;
92
90
  this.canEdit = true;
93
91
  this.taskbarCustomContainerId = undefined;
94
- this.customEditors = undefined;
95
- this.customRenders = undefined;
96
92
  }
97
93
  observeDataUnit(newDataUnit, oldDataUnit) {
98
94
  newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
@@ -160,38 +156,10 @@ const SnkDetailView = class {
160
156
  this._snkGrid.scrollIntoView({ behavior: "smooth", block: "start" });
161
157
  }
162
158
  }
163
- /**
164
- * Registra um editor customizado para campos da grade e formulário.
165
- */
166
- async addCustomEditor(fieldName, customEditor) {
167
- var _a;
168
- const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
169
- this._snkGrid.addCustomEditor(fieldName, customEditor, detailContext);
170
- this._snkFormView.addCustomEditor(fieldName, customEditor, detailContext);
171
- }
172
- async observerPropsCustomEditor(newValue) {
173
- for (const fieldName in newValue) {
174
- await this.addCustomEditor(fieldName, newValue[fieldName]);
175
- }
176
- }
177
- /**
178
- * Registra um render customizado para colunas da grid.
179
- */
180
- async addGridCustomRender(fieldName, customRender) {
181
- var _a;
182
- const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
183
- await this._snkGrid.addGridCustomRender(fieldName, customRender, detailContext);
184
- }
185
159
  onContentCardChanged(evt) {
186
160
  SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this.formConfigManager).then(() => forceUpdate(this));
187
161
  evt.stopPropagation();
188
162
  }
189
- async observeCustomRenders(newValue) {
190
- for (const field in newValue) {
191
- const customRender = newValue[field];
192
- await this.addGridCustomRender(field, customRender);
193
- }
194
- }
195
163
  updateLabel() {
196
164
  const guideItemPathSize = this.guideItemPath ? this.guideItemPath.length : 0;
197
165
  if (guideItemPathSize > 0) {
@@ -294,10 +262,6 @@ const SnkDetailView = class {
294
262
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
295
263
  }
296
264
  }
297
- async componentDidLoad() {
298
- await this.observerPropsCustomEditor(this.customEditors);
299
- await this.observeCustomRenders(this.customRenders);
300
- }
301
265
  async dataUnitActionHandler(action) {
302
266
  if (action.type === Action.FIELD_INVALIDATED) {
303
267
  this.addErrorBadgeToBranchGuide();
@@ -307,9 +271,6 @@ const SnkDetailView = class {
307
271
  this.branchGuide = Object.assign(Object.assign({}, this.branchGuide), { badge: 'error' });
308
272
  this.snkDetailGuidesChange.emit(new GuideBuilder(this.branchGuide, this._formMetadata, this.dataUnit));
309
273
  }
310
- normalizeBranchGuideId(id) {
311
- return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
312
- }
313
274
  render() {
314
275
  this.updateLabel();
315
276
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
@@ -317,9 +278,7 @@ const SnkDetailView = class {
317
278
  }
318
279
  static get watchers() { return {
319
280
  "dataUnit": ["observeDataUnit"],
320
- "dataState": ["observerDataState"],
321
- "customEditors": ["observerPropsCustomEditor"],
322
- "customRenders": ["observeCustomRenders"]
281
+ "dataState": ["observerDataState"]
323
282
  }; }
324
283
  };
325
284
  SnkDetailView.REGEX_FORM_ID = /__FORM:[^:]+/g;
@@ -16,7 +16,7 @@ const OptionsStep = ({ getMessage, changeInfo, data }) => {
16
16
  const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
17
17
  const formatOptions = [
18
18
  { label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
19
- { label: getMessage("snkExporter.emailSenderOptStep_formatXLSX"), value: "xlsx" }
19
+ { label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
20
20
  ];
21
21
  const typeOptions = [
22
22
  { label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
8
8
  import { F as FilterNumberVariation } from './filterNumberVariation-8cee02ea.js';
9
9
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
10
10
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
11
- import './form-config-fetcher-30fb808f.js';
12
- import './DataFetcher-c1baf61d.js';
11
+ import './form-config-fetcher-e0382e5a.js';
12
+ import './DataFetcher-773a3e4b.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
15
 
@@ -265,7 +265,7 @@ const SnkFilterBar = class {
265
265
  //campos Hard Fixed não variam a ordem
266
266
  if (!item.hardFixed) {
267
267
  index += item.fixed ? 100000 : 0;
268
- index += item.value == undefined ? 0 : 10000;
268
+ index = this.handleValueSortIndex(item, index);
269
269
  index += this._updateSequence.lastIndexOf(item.id) + 1;
270
270
  }
271
271
  return index;
@@ -282,12 +282,19 @@ const SnkFilterBar = class {
282
282
  this.messagesBuilder = undefined;
283
283
  this.disablePersonalizedFilter = undefined;
284
284
  this.filterBarLegacyConfigName = undefined;
285
- this.autoLoad = undefined;
286
285
  this.allowDefault = undefined;
287
286
  this.scrollerLocked = false;
288
287
  this.showPersonalizedFilter = false;
289
288
  this.personalizedFilterId = undefined;
290
289
  }
290
+ handleValueSortIndex(item, index) {
291
+ if (item.value != undefined)
292
+ return (index + 10000);
293
+ if (item.type === FilterItemType.PERSONALIZED && item.visible) {
294
+ index += 10000;
295
+ }
296
+ return index;
297
+ }
291
298
  observeFilterConfig(newValue, oldValue) {
292
299
  if (ObjectUtils.equals(newValue, oldValue))
293
300
  return;
@@ -429,10 +436,7 @@ const SnkFilterBar = class {
429
436
  }
430
437
  async doLoadData(forceReload = false) {
431
438
  try {
432
- if (this._firstLoad && this.autoLoad === false) {
433
- return;
434
- }
435
- if (this._firstLoad && !forceReload && this.autoLoad === undefined) {
439
+ if (this._firstLoad && !forceReload) {
436
440
  let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
437
441
  if (!autoLoad) {
438
442
  return;
@@ -583,6 +587,7 @@ const SnkFilterBar = class {
583
587
  .then((filters) => {
584
588
  accept();
585
589
  this.filterConfig = filters.map(item => this.normalizeItem(item));
590
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
586
591
  })
587
592
  .catch(reason => {
588
593
  throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
@@ -2,10 +2,10 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
- import './form-config-fetcher-30fb808f.js';
8
- import './DataFetcher-c1baf61d.js';
7
+ import './form-config-fetcher-e0382e5a.js';
8
+ import './DataFetcher-773a3e4b.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11