@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-65214.0 → 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 (235) hide show
  1. package/dist/cjs/{ConfigStorage-e49214c6.js → ConfigStorage-0a690675.js} +0 -1
  2. package/dist/cjs/{SnkFormConfigManager-beebf47a.js → SnkFormConfigManager-d6d5db6d.js} +7 -8
  3. package/dist/cjs/{SnkMessageBuilder-cceebbae.js → SnkMessageBuilder-96b0f549.js} +13 -9
  4. package/dist/cjs/{IExporterProvider-10b7fed5.js → SnkMultiSelectionListDataSource-f79d220c.js} +4 -94
  5. package/dist/cjs/{index-1dfc7a6e.js → index-0922807b.js} +0 -5
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{dataunit-fetcher-d4873076.js → pesquisa-fetcher-cba1b3d0.js} +180 -87
  8. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  9. package/dist/cjs/snk-actions-button_4.cjs.entry.js +3 -5
  10. package/dist/cjs/snk-application.cjs.entry.js +12 -35
  11. package/dist/cjs/snk-attach.cjs.entry.js +46 -71
  12. package/dist/cjs/snk-crud.cjs.entry.js +10 -101
  13. package/dist/cjs/snk-data-exporter.cjs.entry.js +85 -315
  14. package/dist/cjs/snk-data-unit-559ac55c.js +462 -0
  15. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -12
  16. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -50
  17. package/dist/cjs/snk-filter-bar.cjs.entry.js +12 -7
  18. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-form-view.cjs.entry.js +0 -67
  21. package/dist/cjs/snk-form.cjs.entry.js +7 -52
  22. package/dist/cjs/snk-grid.cjs.entry.js +110 -167
  23. package/dist/cjs/{snk-guides-viewer-aafc3073.js → snk-guides-viewer-bfcad2d6.js} +10 -43
  24. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -9
  25. package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
  26. package/dist/cjs/snk-simple-crud.cjs.entry.js +40 -268
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -4
  28. package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-3ecd1278.js} +3 -3
  29. package/dist/collection/collection-manifest.json +1 -1
  30. package/dist/collection/components/snk-application/snk-application.js +11 -35
  31. package/dist/collection/components/snk-attach/snk-attach.js +44 -67
  32. package/dist/collection/components/snk-crud/snk-crud.js +7 -305
  33. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -136
  34. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -161
  35. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +7 -134
  36. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -54
  37. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +52 -59
  38. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +0 -62
  39. package/dist/collection/components/snk-data-unit/snk-data-unit.js +219 -540
  40. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +11 -23
  41. package/dist/collection/components/snk-form/snk-form.js +5 -102
  42. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -7
  43. package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
  44. package/dist/collection/components/snk-grid/snk-grid.css +0 -2
  45. package/dist/collection/components/snk-grid/snk-grid.js +102 -241
  46. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +20 -406
  47. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  48. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
  49. package/dist/collection/lib/@types/index.js +0 -5
  50. package/dist/collection/lib/configs/ConfigStorage.js +0 -1
  51. package/dist/collection/lib/dataUnit/InMemoryLoader.js +3 -7
  52. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +0 -3
  53. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +0 -4
  54. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +13 -11
  55. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +0 -1
  56. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +4 -53
  57. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +34 -0
  58. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
  59. package/dist/collection/lib/message/SnkMessageBuilder.js +12 -5
  60. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +0 -2
  61. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -2
  62. package/dist/components/ConfigStorage.js +0 -1
  63. package/dist/components/SnkFormConfigManager.js +6 -7
  64. package/dist/components/SnkMessageBuilder.js +13 -9
  65. package/dist/components/dataunit-fetcher.js +182 -84
  66. package/dist/components/{IExporterProvider.js → field-search.js} +6 -93
  67. package/dist/components/index2.js +33 -198
  68. package/dist/components/index3.js +199 -0
  69. package/dist/components/snk-actions-button2.js +11 -4
  70. package/dist/components/snk-application2.js +9 -31
  71. package/dist/components/snk-attach2.js +41 -65
  72. package/dist/components/snk-crud.js +11 -110
  73. package/dist/components/snk-data-exporter2.js +85 -309
  74. package/dist/components/snk-data-unit2.js +217 -487
  75. package/dist/components/snk-detail-view2.js +14 -96
  76. package/dist/components/snk-expression-item2.js +1 -1
  77. package/dist/components/snk-filter-bar2.js +11 -7
  78. package/dist/components/snk-form-config2.js +1 -1
  79. package/dist/components/snk-form-view2.js +1 -72
  80. package/dist/components/snk-form.js +6 -53
  81. package/dist/components/snk-grid2.js +108 -170
  82. package/dist/components/snk-personalized-filter2.js +1 -1
  83. package/dist/components/snk-simple-crud2.js +25 -263
  84. package/dist/components/snk-taskbar2.js +5 -6
  85. package/dist/esm/{ConfigStorage-e476378d.js → ConfigStorage-8c2ddac8.js} +0 -1
  86. package/dist/esm/{SnkFormConfigManager-298cd647.js → SnkFormConfigManager-c01b9d9d.js} +7 -8
  87. package/dist/esm/{SnkMessageBuilder-ae87b754.js → SnkMessageBuilder-72423074.js} +13 -9
  88. package/dist/esm/{IExporterProvider-d597f27d.js → SnkMultiSelectionListDataSource-a4805051.js} +5 -93
  89. package/dist/esm/{index-3aa4977a.js → index-0ece87a6.js} +1 -6
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{dataunit-fetcher-3d2ec959.js → pesquisa-fetcher-34a8b8be.js} +181 -83
  92. package/dist/esm/sankhyablocks.js +1 -1
  93. package/dist/esm/snk-actions-button_4.entry.js +3 -5
  94. package/dist/esm/snk-application.entry.js +11 -34
  95. package/dist/esm/snk-attach.entry.js +41 -66
  96. package/dist/esm/snk-crud.entry.js +10 -101
  97. package/dist/esm/snk-data-exporter.entry.js +86 -316
  98. package/dist/esm/snk-data-unit-44215df7.js +460 -0
  99. package/dist/esm/snk-data-unit.entry.js +2 -12
  100. package/dist/esm/snk-detail-view.entry.js +10 -50
  101. package/dist/esm/snk-filter-bar.entry.js +12 -7
  102. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  103. package/dist/esm/snk-form-config.entry.js +1 -1
  104. package/dist/esm/snk-form-view.entry.js +0 -67
  105. package/dist/esm/snk-form.entry.js +7 -52
  106. package/dist/esm/snk-grid.entry.js +108 -165
  107. package/dist/esm/{snk-guides-viewer-62124f3d.js → snk-guides-viewer-edeac29f.js} +10 -43
  108. package/dist/esm/snk-guides-viewer.entry.js +7 -9
  109. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  110. package/dist/esm/snk-simple-crud.entry.js +28 -256
  111. package/dist/esm/snk-taskbar.entry.js +3 -4
  112. package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-2473c8ac.js} +3 -3
  113. package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
  114. package/dist/sankhyablocks/p-176c3491.entry.js +1 -0
  115. package/dist/sankhyablocks/p-37e5d563.js +65 -0
  116. package/dist/sankhyablocks/p-38289a55.js +1 -0
  117. package/dist/sankhyablocks/{p-9dfda04a.entry.js → p-41c2c191.entry.js} +1 -1
  118. package/dist/sankhyablocks/p-46e55a95.entry.js +1 -0
  119. package/dist/sankhyablocks/p-4e728357.entry.js +1 -0
  120. package/dist/sankhyablocks/p-5571bdfe.js +1 -0
  121. package/dist/sankhyablocks/p-5630574e.js +1 -0
  122. package/dist/sankhyablocks/p-5f8c0426.entry.js +1 -0
  123. package/dist/sankhyablocks/p-80c64add.entry.js +1 -0
  124. package/dist/sankhyablocks/p-86af4cc2.js +1 -0
  125. package/dist/sankhyablocks/p-8b690717.js +1 -0
  126. package/dist/sankhyablocks/{p-3287a6cc.js → p-96621231.js} +1 -1
  127. package/dist/sankhyablocks/p-a1832166.entry.js +1 -0
  128. package/dist/sankhyablocks/p-a809d944.entry.js +1 -0
  129. package/dist/sankhyablocks/p-a97226f6.entry.js +1 -0
  130. package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
  131. package/dist/sankhyablocks/{p-7e7a7473.js → p-ae4fc9a9.js} +1 -1
  132. package/dist/sankhyablocks/{p-bd008859.entry.js → p-c2ae0fab.entry.js} +1 -1
  133. package/dist/sankhyablocks/p-c5a9a5d9.entry.js +1 -0
  134. package/dist/sankhyablocks/p-c5aa7d70.entry.js +11 -0
  135. package/dist/sankhyablocks/p-cb0147ab.entry.js +1 -0
  136. package/dist/sankhyablocks/p-f0145e3b.js +1 -0
  137. package/dist/sankhyablocks/p-f03e4199.entry.js +1 -0
  138. package/dist/sankhyablocks/p-f607db63.entry.js +1 -0
  139. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  140. package/dist/types/components/snk-application/snk-application.d.ts +3 -7
  141. package/dist/types/components/snk-attach/snk-attach.d.ts +9 -11
  142. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -45
  143. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -23
  144. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +3 -28
  145. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -24
  146. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +4 -24
  147. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -4
  148. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +0 -21
  149. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +3 -67
  150. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -4
  151. package/dist/types/components/snk-form/snk-form.d.ts +0 -14
  152. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
  153. package/dist/types/components/snk-grid/snk-grid.d.ts +6 -46
  154. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -62
  155. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  156. package/dist/types/components.d.ts +4 -261
  157. package/dist/types/lib/@types/index.d.ts +0 -5
  158. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +1 -2
  159. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +1 -2
  160. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +0 -1
  161. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +0 -1
  162. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +0 -6
  163. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
  164. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +0 -3
  165. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -2
  166. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +0 -1
  167. package/package.json +1 -1
  168. package/dist/cjs/RecordIDUtils-3735135c.js +0 -43
  169. package/dist/cjs/pesquisa-fetcher-a1d0353f.js +0 -166
  170. package/dist/cjs/snk-data-unit-f0221097.js +0 -690
  171. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +0 -1
  172. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +0 -1
  173. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +0 -97
  174. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +0 -74
  175. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +0 -1
  176. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +0 -58
  177. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +0 -55
  178. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +0 -88
  179. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +0 -20
  180. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +0 -38
  181. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +0 -24
  182. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +0 -18
  183. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +0 -35
  184. package/dist/collection/lib/dataUnit/ValueFormatter.js +0 -4
  185. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +0 -1
  186. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +0 -1
  187. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +0 -1
  188. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +0 -22
  189. package/dist/components/ISave.js +0 -47
  190. package/dist/components/pesquisa-fetcher.js +0 -164
  191. package/dist/esm/RecordIDUtils-87d02110.js +0 -41
  192. package/dist/esm/pesquisa-fetcher-a87445a0.js +0 -164
  193. package/dist/esm/snk-data-unit-1ef94aef.js +0 -688
  194. package/dist/sankhyablocks/p-091ce761.js +0 -60
  195. package/dist/sankhyablocks/p-0c68f40f.entry.js +0 -1
  196. package/dist/sankhyablocks/p-162b9a59.entry.js +0 -11
  197. package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
  198. package/dist/sankhyablocks/p-25f1fc39.js +0 -6
  199. package/dist/sankhyablocks/p-2e9c764c.entry.js +0 -1
  200. package/dist/sankhyablocks/p-30cf616e.js +0 -1
  201. package/dist/sankhyablocks/p-421bec84.entry.js +0 -1
  202. package/dist/sankhyablocks/p-42f7b05d.entry.js +0 -1
  203. package/dist/sankhyablocks/p-51999ab5.entry.js +0 -1
  204. package/dist/sankhyablocks/p-52a6a293.entry.js +0 -1
  205. package/dist/sankhyablocks/p-5f016aed.js +0 -1
  206. package/dist/sankhyablocks/p-62f34e6f.entry.js +0 -1
  207. package/dist/sankhyablocks/p-684a2590.entry.js +0 -1
  208. package/dist/sankhyablocks/p-70001ac1.js +0 -1
  209. package/dist/sankhyablocks/p-74c665d5.entry.js +0 -1
  210. package/dist/sankhyablocks/p-76a65660.js +0 -1
  211. package/dist/sankhyablocks/p-7c4aabe2.js +0 -1
  212. package/dist/sankhyablocks/p-8c1ff936.entry.js +0 -1
  213. package/dist/sankhyablocks/p-939e15d3.entry.js +0 -1
  214. package/dist/sankhyablocks/p-9863d682.js +0 -1
  215. package/dist/sankhyablocks/p-c273d6ee.js +0 -1
  216. package/dist/sankhyablocks/p-d65d98ed.entry.js +0 -1
  217. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  218. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +0 -4
  219. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +0 -4
  220. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -14
  221. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +0 -12
  222. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +0 -5
  223. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +0 -17
  224. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +0 -17
  225. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +0 -77
  226. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +0 -4
  227. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
  228. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +0 -3
  229. package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +0 -3
  230. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +0 -11
  231. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +0 -2
  232. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +0 -3
  233. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +0 -10
  234. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +0 -7
  235. 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-1ef94aef.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-ae87b754.js';
6
- import './dataunit-fetcher-3d2ec959.js';
7
- import './DataFetcher-773a3e4b.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-298cd647.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c01b9d9d.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import './DataFetcher-773a3e4b.js';
6
- import './pesquisa-fetcher-a87445a0.js';
7
- import { P as PresentationMode } from './index-3aa4977a.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-3d2ec959.js';
12
11
  import './filter-item-type.enum-d45e026f.js';
13
12
  import './form-config-fetcher-e0382e5a.js';
14
- import { T as TaskbarElement } from './taskbar-elements-d59867f1.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-62124f3d.js';
17
- import { S as SnkMessageBuilder } from './SnkMessageBuilder-ae87b754.js';
18
- import './ConfigStorage-e476378d.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) {
@@ -223,13 +191,14 @@ const SnkDetailView = class {
223
191
  return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
224
192
  }
225
193
  loadMetadata() {
194
+ var _a;
226
195
  if (!this.dataUnit) {
227
196
  return;
228
197
  }
229
198
  if (!this.formConfigManager.isLoaded) {
230
199
  return;
231
200
  }
232
- const formConfig = this.formConfigManager.getConfig(this.dataUnit);
201
+ const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
233
202
  //this._cardsState = formConfig?.cardsState;
234
203
  this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
235
204
  }
@@ -293,10 +262,6 @@ const SnkDetailView = class {
293
262
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
294
263
  }
295
264
  }
296
- async componentDidLoad() {
297
- await this.observerPropsCustomEditor(this.customEditors);
298
- await this.observeCustomRenders(this.customRenders);
299
- }
300
265
  async dataUnitActionHandler(action) {
301
266
  if (action.type === Action.FIELD_INVALIDATED) {
302
267
  this.addErrorBadgeToBranchGuide();
@@ -306,9 +271,6 @@ const SnkDetailView = class {
306
271
  this.branchGuide = Object.assign(Object.assign({}, this.branchGuide), { badge: 'error' });
307
272
  this.snkDetailGuidesChange.emit(new GuideBuilder(this.branchGuide, this._formMetadata, this.dataUnit));
308
273
  }
309
- normalizeBranchGuideId(id) {
310
- return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
311
- }
312
274
  render() {
313
275
  this.updateLabel();
314
276
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
@@ -316,9 +278,7 @@ const SnkDetailView = class {
316
278
  }
317
279
  static get watchers() { return {
318
280
  "dataUnit": ["observeDataUnit"],
319
- "dataState": ["observerDataState"],
320
- "customEditors": ["observerPropsCustomEditor"],
321
- "customRenders": ["observeCustomRenders"]
281
+ "dataState": ["observerDataState"]
322
282
  }; }
323
283
  };
324
284
  SnkDetailView.REGEX_FORM_ID = /__FORM:[^:]+/g;
@@ -1,7 +1,7 @@
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-e476378d.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';
@@ -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,7 +2,7 @@ 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-e476378d.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
7
  import './form-config-fetcher-e0382e5a.js';
8
8
  import './DataFetcher-773a3e4b.js';
@@ -76,7 +76,7 @@ const SnkFormConfig = class {
76
76
  }
77
77
  }
78
78
  getConfig() {
79
- let config = this.configManager.getConfig(this.dataUnit);
79
+ let config = this.configManager.getConfig(false, this.dataUnit);
80
80
  if (config.fields && config.fields.length === 0) {
81
81
  config = undefined;
82
82
  }