@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
@@ -3,18 +3,17 @@ import { Action, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import './DataFetcher.js';
6
- import './pesquisa-fetcher.js';
7
- import { P as PresentationMode } from './ISave.js';
6
+ import './dataunit-fetcher.js';
7
+ import { P as PresentationMode } from './index2.js';
8
+ import { d as defineCustomElement$u } from './snk-actions-button2.js';
8
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher.js';
11
11
  import './filter-item-type.enum.js';
12
12
  import './form-config-fetcher.js';
13
13
  import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
14
14
  import { V as VIEW_MODE } from './constants.js';
15
- import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './IExporterProvider.js';
15
+ import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search.js';
16
16
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
17
- import { d as defineCustomElement$u } from './snk-actions-button2.js';
18
17
  import { d as defineCustomElement$t } from './snk-attach2.js';
19
18
  import { d as defineCustomElement$s } from './snk-config-options2.js';
20
19
  import { d as defineCustomElement$r } from './snk-configurator2.js';
@@ -70,16 +69,12 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
70
69
  this.resourceID = undefined;
71
70
  this.detailTaskbarCustomContainerId = undefined;
72
71
  this.formLegacyConfigName = undefined;
73
- this.getCustomTitle = undefined;
74
72
  this._hasToCreateFieldSearch = true;
75
73
  this._breadcrumbItems = [];
76
74
  this._guides = undefined;
77
75
  this._formEditorConfigManager = undefined;
78
76
  this._formEditorDataUnit = undefined;
79
77
  this._fieldToGetFocus = undefined;
80
- this._customEditors = undefined;
81
- this._customRenders = undefined;
82
- this._fieldsProps = {};
83
78
  }
84
79
  observeDataUnit() {
85
80
  this.loadGuides(true);
@@ -110,28 +105,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
110
105
  async findField() {
111
106
  await openFieldSearch(this._moreOptions, this._fieldSearch);
112
107
  }
113
- /**
114
- * Registra um editor customizado para campos da grade e formulário
115
- */
116
- async addCustomEditor(fieldName, customEditor) {
117
- this._customEditors = Object.assign(Object.assign({}, this._customEditors), { [fieldName]: customEditor });
118
- }
119
- /**
120
- * Registra um render customizado para colunas da grid.
121
- */
122
- async addGridCustomRender(fieldName, customRender) {
123
- this._customRenders = Object.assign(Object.assign({}, this._customRenders), { [fieldName]: customRender });
124
- }
125
- ;
126
- /**
127
- * Altera/adiciona uma propriedade nos metadados do campo.
128
- */
129
- async setFieldProp(fieldName, propName, value) {
130
- const newFieldsProps = {
131
- [fieldName]: Object.assign(Object.assign({}, this._fieldsProps[fieldName]), { [propName]: value })
132
- };
133
- this._fieldsProps = Object.assign(Object.assign({}, this._fieldsProps), newFieldsProps);
134
- }
135
108
  /**
136
109
  * Atribui o foco para o componente.
137
110
  */
@@ -157,7 +130,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
157
130
  }
158
131
  onContentCardChanged(evt) {
159
132
  SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
160
- .then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
133
+ .then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, this.dataUnit));
161
134
  }
162
135
  /**
163
136
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -280,7 +253,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
280
253
  if (sheet == undefined) {
281
254
  return;
282
255
  }
283
- return h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps });
256
+ return h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); } });
284
257
  })));
285
258
  }
286
259
  wrapDetail(levels, content) {
@@ -322,14 +295,14 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
322
295
  else {
323
296
  detailBranch = this.selectedGuide;
324
297
  }
325
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders }));
298
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId }));
326
299
  }
327
300
  else {
328
301
  const cardId = this.selectedGuide.id;
329
302
  const sheet = this._masterFormMetadata.getSheet(cardId);
330
303
  if (sheet) {
331
304
  const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
332
- content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
305
+ content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler() }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
333
306
  }
334
307
  }
335
308
  return content;
@@ -508,10 +481,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
508
481
  }
509
482
  return "";
510
483
  }
511
- getTitle() {
512
- var _a, _b;
513
- return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
514
- }
515
484
  componentDidLoad() {
516
485
  this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
517
486
  }
@@ -525,7 +494,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
525
494
  }
526
495
  this.loadTaskbarProcessor();
527
496
  const showGuides = this._guides && (this._guides.length > 1);
528
- return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
497
+ return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
529
498
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
530
499
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
531
500
  :
@@ -536,9 +505,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
536
505
  dataUnit: this.dataUnit,
537
506
  recordsValidator: this.recordsValidator,
538
507
  fieldToFocus: this._fieldToGetFocus,
539
- onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
540
- propsCustomEditor: this._customEditors,
541
- fieldsProps: this._fieldsProps
508
+ onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this)
542
509
  }), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
543
510
  }
544
511
  static get watchers() { return {
@@ -563,21 +530,14 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
563
530
  "resourceID": [1, "resource-i-d"],
564
531
  "detailTaskbarCustomContainerId": [1, "detail-taskbar-custom-container-id"],
565
532
  "formLegacyConfigName": [1, "form-legacy-config-name"],
566
- "getCustomTitle": [16],
567
533
  "_hasToCreateFieldSearch": [32],
568
534
  "_breadcrumbItems": [32],
569
535
  "_guides": [32],
570
536
  "_formEditorConfigManager": [32],
571
537
  "_formEditorDataUnit": [32],
572
538
  "_fieldToGetFocus": [32],
573
- "_customEditors": [32],
574
- "_customRenders": [32],
575
- "_fieldsProps": [32],
576
539
  "showFormConfig": [64],
577
540
  "findField": [64],
578
- "addCustomEditor": [64],
579
- "addGridCustomRender": [64],
580
- "setFieldProp": [64],
581
541
  "setFocus": [64]
582
542
  }, [[2, "actionClick", "onActionClick"], [0, "snkContentCardChanged", "onContentCardChanged"]]]);
583
543
  function defineCustomElement$1() {
@@ -812,8 +772,6 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
812
772
  this.branchGuide = undefined;
813
773
  this.canEdit = true;
814
774
  this.taskbarCustomContainerId = undefined;
815
- this.customEditors = undefined;
816
- this.customRenders = undefined;
817
775
  }
818
776
  observeDataUnit(newDataUnit, oldDataUnit) {
819
777
  newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
@@ -881,38 +839,10 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
881
839
  this._snkGrid.scrollIntoView({ behavior: "smooth", block: "start" });
882
840
  }
883
841
  }
884
- /**
885
- * Registra um editor customizado para campos da grade e formulário.
886
- */
887
- async addCustomEditor(fieldName, customEditor) {
888
- var _a;
889
- const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
890
- this._snkGrid.addCustomEditor(fieldName, customEditor, detailContext);
891
- this._snkFormView.addCustomEditor(fieldName, customEditor, detailContext);
892
- }
893
- async observerPropsCustomEditor(newValue) {
894
- for (const fieldName in newValue) {
895
- await this.addCustomEditor(fieldName, newValue[fieldName]);
896
- }
897
- }
898
- /**
899
- * Registra um render customizado para colunas da grid.
900
- */
901
- async addGridCustomRender(fieldName, customRender) {
902
- var _a;
903
- const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
904
- await this._snkGrid.addGridCustomRender(fieldName, customRender, detailContext);
905
- }
906
842
  onContentCardChanged(evt) {
907
843
  SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this.formConfigManager).then(() => forceUpdate(this));
908
844
  evt.stopPropagation();
909
845
  }
910
- async observeCustomRenders(newValue) {
911
- for (const field in newValue) {
912
- const customRender = newValue[field];
913
- await this.addGridCustomRender(field, customRender);
914
- }
915
- }
916
846
  updateLabel() {
917
847
  const guideItemPathSize = this.guideItemPath ? this.guideItemPath.length : 0;
918
848
  if (guideItemPathSize > 0) {
@@ -944,13 +874,14 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
944
874
  return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
945
875
  }
946
876
  loadMetadata() {
877
+ var _a;
947
878
  if (!this.dataUnit) {
948
879
  return;
949
880
  }
950
881
  if (!this.formConfigManager.isLoaded) {
951
882
  return;
952
883
  }
953
- const formConfig = this.formConfigManager.getConfig(this.dataUnit);
884
+ const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
954
885
  //this._cardsState = formConfig?.cardsState;
955
886
  this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
956
887
  }
@@ -1014,10 +945,6 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
1014
945
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
1015
946
  }
1016
947
  }
1017
- async componentDidLoad() {
1018
- await this.observerPropsCustomEditor(this.customEditors);
1019
- await this.observeCustomRenders(this.customRenders);
1020
- }
1021
948
  async dataUnitActionHandler(action) {
1022
949
  if (action.type === Action.FIELD_INVALIDATED) {
1023
950
  this.addErrorBadgeToBranchGuide();
@@ -1027,9 +954,6 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
1027
954
  this.branchGuide = Object.assign(Object.assign({}, this.branchGuide), { badge: 'error' });
1028
955
  this.snkDetailGuidesChange.emit(new GuideBuilder(this.branchGuide, this._formMetadata, this.dataUnit));
1029
956
  }
1030
- normalizeBranchGuideId(id) {
1031
- return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
1032
- }
1033
957
  render() {
1034
958
  this.updateLabel();
1035
959
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
@@ -1037,9 +961,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
1037
961
  }
1038
962
  static get watchers() { return {
1039
963
  "dataUnit": ["observeDataUnit"],
1040
- "dataState": ["observerDataState"],
1041
- "customEditors": ["observerPropsCustomEditor"],
1042
- "customRenders": ["observeCustomRenders"]
964
+ "dataState": ["observerDataState"]
1043
965
  }; }
1044
966
  static get style() { return snkDetailViewCss; }
1045
967
  }, [6, "snk-detail-view", {
@@ -1056,16 +978,12 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
1056
978
  "branchGuide": [1040],
1057
979
  "canEdit": [4, "can-edit"],
1058
980
  "taskbarCustomContainerId": [1, "taskbar-custom-container-id"],
1059
- "customEditors": [16],
1060
- "customRenders": [16],
1061
981
  "_disabledButtons": [32],
1062
982
  "_currentView": [32],
1063
983
  "attachmentRegisterKey": [32],
1064
984
  "changeViewMode": [64],
1065
985
  "configGrid": [64],
1066
- "showUp": [64],
1067
- "addCustomEditor": [64],
1068
- "addGridCustomRender": [64]
986
+ "showUp": [64]
1069
987
  }, [[0, "snkContentCardChanged", "onContentCardChanged"]]]);
1070
988
  SnkDetailView.REGEX_FORM_ID = /__FORM:[^:]+/g;
1071
989
  function defineCustomElement() {
@@ -4,7 +4,7 @@ import { a as SelectedItemType, d as defineCustomElement$2 } from './snk-filter-
4
4
  import { ApplicationUtils, CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { fieldBuilder } from '@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder';
6
6
  import { a as FilterOperand } from './PersonalizedFilterUtils.js';
7
- import { s as store } from './index2.js';
7
+ import { s as store } from './index3.js';
8
8
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
9
9
  import { d as defineCustomElement$1 } from './snk-filter-param-config2.js';
10
10
 
@@ -271,7 +271,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
271
271
  //campos Hard Fixed não variam a ordem
272
272
  if (!item.hardFixed) {
273
273
  index += item.fixed ? 100000 : 0;
274
- index += item.value == undefined ? 0 : 10000;
274
+ index = this.handleValueSortIndex(item, index);
275
275
  index += this._updateSequence.lastIndexOf(item.id) + 1;
276
276
  }
277
277
  return index;
@@ -288,12 +288,19 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
288
288
  this.messagesBuilder = undefined;
289
289
  this.disablePersonalizedFilter = undefined;
290
290
  this.filterBarLegacyConfigName = undefined;
291
- this.autoLoad = undefined;
292
291
  this.allowDefault = undefined;
293
292
  this.scrollerLocked = false;
294
293
  this.showPersonalizedFilter = false;
295
294
  this.personalizedFilterId = undefined;
296
295
  }
296
+ handleValueSortIndex(item, index) {
297
+ if (item.value != undefined)
298
+ return (index + 10000);
299
+ if (item.type === FilterItemType.PERSONALIZED && item.visible) {
300
+ index += 10000;
301
+ }
302
+ return index;
303
+ }
297
304
  observeFilterConfig(newValue, oldValue) {
298
305
  if (ObjectUtils.equals(newValue, oldValue))
299
306
  return;
@@ -435,10 +442,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
435
442
  }
436
443
  async doLoadData(forceReload = false) {
437
444
  try {
438
- if (this._firstLoad && this.autoLoad === false) {
439
- return;
440
- }
441
- if (this._firstLoad && !forceReload && this.autoLoad === undefined) {
445
+ if (this._firstLoad && !forceReload) {
442
446
  let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
443
447
  if (!autoLoad) {
444
448
  return;
@@ -589,6 +593,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
589
593
  .then((filters) => {
590
594
  accept();
591
595
  this.filterConfig = filters.map(item => this.normalizeItem(item));
596
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
592
597
  })
593
598
  .catch(reason => {
594
599
  throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
@@ -721,7 +726,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
721
726
  "messagesBuilder": [1040],
722
727
  "disablePersonalizedFilter": [4, "disable-personalized-filter"],
723
728
  "filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
724
- "autoLoad": [4, "auto-load"],
725
729
  "allowDefault": [32],
726
730
  "scrollerLocked": [32],
727
731
  "showPersonalizedFilter": [32],
@@ -76,7 +76,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
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
  }
@@ -12,8 +12,6 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  this.snkContentCardChanged = createEvent(this, "snkContentCardChanged", 7);
13
13
  this.snkRequestClearFieldToFocus = createEvent(this, "snkRequestClearFieldToFocus", 7);
14
14
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
15
- this._customEditors = new Map();
16
- this._fieldProps = new Map();
17
15
  this.levelPath = undefined;
18
16
  this.label = undefined;
19
17
  this.name = undefined;
@@ -27,47 +25,12 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
27
25
  this.canFix = true;
28
26
  this.recordsValidator = undefined;
29
27
  this.fieldToFocus = undefined;
30
- this.customEditors = undefined;
31
- this.fieldsProps = undefined;
32
28
  }
33
29
  async showUp() {
34
30
  if (this._formView) {
35
31
  this._formView.showUp();
36
32
  }
37
33
  }
38
- /**
39
- * Registra um editor customizado para campos da grade e formulário
40
- */
41
- async addCustomEditor(fieldName, customEditor, detailContext) {
42
- if (this._formView) {
43
- this._formView.addCustomEditor(fieldName, customEditor, detailContext);
44
- return;
45
- }
46
- const newCustomEditors = new Map(this._customEditors);
47
- newCustomEditors.set(fieldName, { customEditor, detailContext });
48
- this._customEditors = newCustomEditors;
49
- }
50
- observePropsCustomEditor(newValue) {
51
- for (const fieldName in newValue) {
52
- this.addCustomEditor(fieldName, newValue[fieldName]);
53
- }
54
- }
55
- /**
56
- * Altera/adiciona uma propriedade nos metadados do campo.
57
- */
58
- async setFieldProp(fieldName, propName, value) {
59
- const props = this._fieldProps.get(fieldName) || [];
60
- this._fieldProps.set(fieldName, [...props, { propName, value }]);
61
- }
62
- async observeFieldsProps(newValue) {
63
- for (const field in newValue) {
64
- const fieldProps = newValue[field];
65
- const propNames = Object.keys(fieldProps);
66
- for (const propName of propNames) {
67
- await this.setFieldProp(field, propName, fieldProps[propName]);
68
- }
69
- }
70
- }
71
34
  changeFix() {
72
35
  this.fixed = !this.fixed;
73
36
  this.emitEvent("fixed");
@@ -126,13 +89,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
126
89
  this._dataBinder.onDisconnectedCallback();
127
90
  }
128
91
  }
129
- componentDidLoad() {
130
- this.observePropsCustomEditor(this.customEditors);
131
- this.observeFieldsProps(this.fieldsProps);
132
- }
133
92
  componentDidRender() {
134
- this.setCustomEditors();
135
- this.setFieldProps();
136
93
  if (this.fieldToFocus == undefined) {
137
94
  return;
138
95
  }
@@ -144,26 +101,6 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
144
101
  this.snkRequestClearFieldToFocus.emit();
145
102
  });
146
103
  }
147
- setCustomEditors() {
148
- if (!this._formView) {
149
- return;
150
- }
151
- for (const [fieldName, customEditorProps] of this._customEditors) {
152
- this._formView.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
153
- this._customEditors.delete(fieldName);
154
- }
155
- }
156
- setFieldProps() {
157
- if (!this._formView) {
158
- return;
159
- }
160
- for (const [fieldName, propsToChange] of this._fieldProps) {
161
- propsToChange.forEach(prop => {
162
- this._formView.setFieldProp(fieldName, prop.propName, prop.value);
163
- this._fieldProps.delete(fieldName);
164
- });
165
- }
166
- }
167
104
  render() {
168
105
  return (h(Host, { class: "ez-box__container" }, h("div", { class: "summary-header ez-flex ez-size-width--full" }, h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
169
106
  h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.fixed ? "un-pin" : "push-pin", "data-element-id": ElementIDUtils.getInternalIDInfo("toggleFixed_ezFormCard"), onClick: () => this.changeFix(), title: this.fixed ? "Desafixar" : "Fixar" }), this.canExpand &&
@@ -173,10 +110,6 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
173
110
  :
174
111
  h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
175
112
  }
176
- static get watchers() { return {
177
- "customEditors": ["observePropsCustomEditor"],
178
- "fieldsProps": ["observeFieldsProps"]
179
- }; }
180
113
  static get style() { return snkFormViewCss; }
181
114
  }, [6, "snk-form-view", {
182
115
  "levelPath": [1, "level-path"],
@@ -192,11 +125,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
192
125
  "canFix": [4, "can-fix"],
193
126
  "recordsValidator": [16],
194
127
  "fieldToFocus": [1, "field-to-focus"],
195
- "customEditors": [16],
196
- "fieldsProps": [16],
197
- "showUp": [64],
198
- "addCustomEditor": [64],
199
- "setFieldProp": [64]
128
+ "showUp": [64]
200
129
  }]);
201
130
  function defineCustomElement() {
202
131
  if (typeof customElements === "undefined") {
@@ -16,7 +16,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
16
  this.exit = createEvent(this, "exit", 7);
17
17
  this.actionClick = createEvent(this, "actionClick", 7);
18
18
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
19
- this._customEditors = new Map();
20
19
  this._dataUnit = undefined;
21
20
  this._dataState = undefined;
22
21
  this._showFormConfig = false;
@@ -39,24 +38,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
39
38
  async hideConfig() {
40
39
  this._showFormConfig = false;
41
40
  }
42
- /**
43
- * Registra um editor customizado para campos da grade e formulário.
44
- */
45
- async addCustomEditor(fieldName, customEditor) {
46
- if (this._form) {
47
- this._form.addCustomEditor(fieldName, customEditor);
48
- return;
49
- }
50
- const newCustomEditors = new Map(this._customEditors);
51
- newCustomEditors.set(fieldName, customEditor);
52
- this._customEditors = newCustomEditors;
53
- }
54
- /**
55
- * Altera/adiciona uma propriedade nos metadados do campo.
56
- */
57
- async setFieldProp(fieldName, propName, value) {
58
- await this._form.setFieldProp(fieldName, propName, value);
59
- }
60
41
  closeConfig() {
61
42
  this.hideConfig();
62
43
  }
@@ -64,18 +45,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
64
45
  const dataInfo = { dataUnit: this._dataUnit };
65
46
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
66
47
  }
67
- setCustomEditors() {
68
- if (!this._form) {
69
- return;
70
- }
71
- for (const [fieldName, customEditor] of this._customEditors) {
72
- this._form.addCustomEditor(fieldName, customEditor);
73
- this._customEditors.delete(fieldName);
74
- }
75
- }
76
- async componentDidRender() {
77
- this.setCustomEditors();
78
- }
79
48
  async componentWillLoad() {
80
49
  let parent = this._element.parentElement;
81
50
  while (parent) {
@@ -91,7 +60,9 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
91
60
  this._dataUnit = evt.detail;
92
61
  });
93
62
  }
94
- this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
63
+ this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
64
+ this._dataState = evt.detail;
65
+ });
95
66
  break;
96
67
  }
97
68
  parent = parent.parentElement;
@@ -101,23 +72,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
101
72
  }
102
73
  this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
103
74
  this.addFormLegacyConfig();
104
- await this._configManager.loadConfig();
105
- }
106
- async handleDataStateChange(evt) {
107
- var _a;
108
- this._dataState = evt.detail;
109
- const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
110
- for (const field of fieldsWithRmPrecision || []) {
111
- if (!field) {
112
- continue;
113
- }
114
- const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
115
- if (!rmPrecision && rmPrecision !== 0) {
116
- continue;
117
- }
118
- await this.setFieldProp(field, 'precision', rmPrecision);
119
- await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
120
- }
75
+ this._configManager.loadConfig();
121
76
  }
122
77
  addFormLegacyConfig() {
123
78
  if (this.formLegacyConfigName) {
@@ -128,7 +83,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
128
83
  if (!this._dataUnit || !this._dataState) {
129
84
  return undefined;
130
85
  }
131
- return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
86
+ return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
132
87
  h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
133
88
  }
134
89
  get _element() { return this; }
@@ -144,9 +99,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
144
99
  "_showFormConfig": [32],
145
100
  "_configManager": [32],
146
101
  "showConfig": [64],
147
- "hideConfig": [64],
148
- "addCustomEditor": [64],
149
- "setFieldProp": [64]
102
+ "hideConfig": [64]
150
103
  }]);
151
104
  function defineCustomElement$1() {
152
105
  if (typeof customElements === "undefined") {