@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-kb-67792.0 → 0.0.0-bugfix-dev-kb-67792.2

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-0a690675.js → ConfigStorage-e49214c6.js} +1 -0
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-f79d220c.js → IExporterProvider-10b7fed5.js} +94 -4
  3. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  4. package/dist/cjs/{SnkFormConfigManager-d6d5db6d.js → SnkFormConfigManager-beebf47a.js} +8 -7
  5. package/dist/cjs/{SnkMessageBuilder-96b0f549.js → SnkMessageBuilder-cceebbae.js} +9 -13
  6. package/dist/cjs/{pesquisa-fetcher-cba1b3d0.js → dataunit-fetcher-d4873076.js} +87 -180
  7. package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/pesquisa-fetcher-a1d0353f.js +166 -0
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -3
  12. package/dist/cjs/snk-application.cjs.entry.js +35 -12
  13. package/dist/cjs/snk-attach.cjs.entry.js +71 -46
  14. package/dist/cjs/snk-crud.cjs.entry.js +101 -10
  15. package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
  16. package/dist/cjs/snk-data-unit-f0221097.js +690 -0
  17. package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +50 -10
  19. package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -2
  20. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
  23. package/dist/cjs/snk-form.cjs.entry.js +52 -7
  24. package/dist/cjs/snk-grid.cjs.entry.js +168 -111
  25. package/dist/cjs/{snk-guides-viewer-bfcad2d6.js → snk-guides-viewer-aafc3073.js} +43 -10
  26. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
  27. package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-simple-crud.cjs.entry.js +269 -40
  29. package/dist/cjs/snk-taskbar.cjs.entry.js +4 -3
  30. package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-9ad1f9c0.js} +3 -3
  31. package/dist/collection/collection-manifest.json +1 -1
  32. package/dist/collection/components/snk-application/snk-application.js +35 -11
  33. package/dist/collection/components/snk-attach/snk-attach.js +67 -44
  34. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
  35. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
  36. package/dist/collection/components/snk-crud/snk-crud.js +305 -7
  37. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +136 -2
  38. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
  39. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +134 -7
  40. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +97 -0
  41. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +74 -0
  42. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +54 -1
  43. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  44. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
  45. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  46. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +59 -52
  47. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
  48. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  49. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +20 -0
  50. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  51. package/dist/collection/components/snk-data-unit/snk-data-unit.js +540 -219
  52. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
  53. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
  55. package/dist/collection/components/snk-form/snk-form.js +102 -5
  56. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +7 -6
  57. package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
  58. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  59. package/dist/collection/components/snk-grid/snk-grid.js +242 -103
  60. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +407 -20
  61. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  62. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
  63. package/dist/collection/lib/@types/index.js +5 -0
  64. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
  65. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  66. package/dist/collection/lib/dataUnit/InMemoryLoader.js +7 -3
  67. package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
  68. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
  69. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  70. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  71. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
  72. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  73. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
  74. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
  75. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +53 -4
  76. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
  77. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
  78. package/dist/collection/lib/message/SnkMessageBuilder.js +5 -12
  79. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
  80. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +2 -1
  81. package/dist/components/ConfigStorage.js +1 -0
  82. package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
  83. package/dist/components/ISave.js +47 -0
  84. package/dist/components/SnkFormConfigManager.js +7 -6
  85. package/dist/components/SnkMessageBuilder.js +9 -13
  86. package/dist/components/dataunit-fetcher.js +84 -182
  87. package/dist/components/index2.js +198 -33
  88. package/dist/components/pesquisa-fetcher.js +164 -0
  89. package/dist/components/snk-actions-button2.js +4 -11
  90. package/dist/components/snk-application2.js +31 -9
  91. package/dist/components/snk-attach2.js +65 -41
  92. package/dist/components/snk-crud.js +110 -11
  93. package/dist/components/snk-data-exporter2.js +309 -85
  94. package/dist/components/snk-data-unit2.js +487 -217
  95. package/dist/components/snk-detail-view2.js +96 -14
  96. package/dist/components/snk-expression-item2.js +1 -1
  97. package/dist/components/snk-filter-bar2.js +6 -1
  98. package/dist/components/snk-form-config2.js +1 -1
  99. package/dist/components/snk-form-view2.js +72 -1
  100. package/dist/components/snk-form.js +53 -6
  101. package/dist/components/snk-grid2.js +171 -109
  102. package/dist/components/snk-personalized-filter2.js +1 -1
  103. package/dist/components/snk-simple-crud2.js +264 -25
  104. package/dist/components/snk-taskbar2.js +6 -5
  105. package/dist/esm/{ConfigStorage-8c2ddac8.js → ConfigStorage-e476378d.js} +1 -0
  106. package/dist/esm/{SnkMultiSelectionListDataSource-a4805051.js → IExporterProvider-d597f27d.js} +93 -5
  107. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  108. package/dist/esm/{SnkFormConfigManager-c01b9d9d.js → SnkFormConfigManager-298cd647.js} +8 -7
  109. package/dist/esm/{SnkMessageBuilder-72423074.js → SnkMessageBuilder-ae87b754.js} +9 -13
  110. package/dist/esm/{pesquisa-fetcher-34a8b8be.js → dataunit-fetcher-3d2ec959.js} +83 -181
  111. package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
  112. package/dist/esm/loader.js +1 -1
  113. package/dist/esm/pesquisa-fetcher-a87445a0.js +164 -0
  114. package/dist/esm/sankhyablocks.js +1 -1
  115. package/dist/esm/snk-actions-button_4.entry.js +5 -3
  116. package/dist/esm/snk-application.entry.js +34 -11
  117. package/dist/esm/snk-attach.entry.js +66 -41
  118. package/dist/esm/snk-crud.entry.js +101 -10
  119. package/dist/esm/snk-data-exporter.entry.js +316 -86
  120. package/dist/esm/snk-data-unit-1ef94aef.js +688 -0
  121. package/dist/esm/snk-data-unit.entry.js +12 -2
  122. package/dist/esm/snk-detail-view.entry.js +50 -10
  123. package/dist/esm/snk-filter-bar.entry.js +6 -2
  124. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  125. package/dist/esm/snk-form-config.entry.js +1 -1
  126. package/dist/esm/snk-form-view.entry.js +67 -0
  127. package/dist/esm/snk-form.entry.js +52 -7
  128. package/dist/esm/snk-grid.entry.js +166 -109
  129. package/dist/esm/{snk-guides-viewer-edeac29f.js → snk-guides-viewer-62124f3d.js} +43 -10
  130. package/dist/esm/snk-guides-viewer.entry.js +9 -7
  131. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  132. package/dist/esm/snk-simple-crud.entry.js +257 -28
  133. package/dist/esm/snk-taskbar.entry.js +4 -3
  134. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-d59867f1.js} +3 -3
  135. package/dist/sankhyablocks/p-08c28ddd.entry.js +1 -0
  136. package/dist/sankhyablocks/p-091ce761.js +60 -0
  137. package/dist/sankhyablocks/p-094eebf6.entry.js +1 -0
  138. package/dist/sankhyablocks/p-0c68f40f.entry.js +1 -0
  139. package/dist/sankhyablocks/p-162b9a59.entry.js +11 -0
  140. package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
  141. package/dist/sankhyablocks/p-25f1fc39.js +6 -0
  142. package/dist/sankhyablocks/p-2e9c764c.entry.js +1 -0
  143. package/dist/sankhyablocks/p-30cf616e.js +1 -0
  144. package/dist/sankhyablocks/{p-96621231.js → p-3287a6cc.js} +1 -1
  145. package/dist/sankhyablocks/p-421bec84.entry.js +1 -0
  146. package/dist/sankhyablocks/p-42f7b05d.entry.js +1 -0
  147. package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
  148. package/dist/sankhyablocks/p-5f016aed.js +1 -0
  149. package/dist/sankhyablocks/p-6c364d25.entry.js +1 -0
  150. package/dist/sankhyablocks/p-70001ac1.js +1 -0
  151. package/dist/sankhyablocks/p-74c665d5.entry.js +1 -0
  152. package/dist/sankhyablocks/p-76a65660.js +1 -0
  153. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  154. package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
  155. package/dist/sankhyablocks/p-8c1ff936.entry.js +1 -0
  156. package/dist/sankhyablocks/p-939e15d3.entry.js +1 -0
  157. package/dist/sankhyablocks/p-9863d682.js +1 -0
  158. package/dist/sankhyablocks/{p-41c2c191.entry.js → p-9dfda04a.entry.js} +1 -1
  159. package/dist/sankhyablocks/{p-c2ae0fab.entry.js → p-bd008859.entry.js} +1 -1
  160. package/dist/sankhyablocks/p-c273d6ee.js +1 -0
  161. package/dist/sankhyablocks/p-d65d98ed.entry.js +1 -0
  162. package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
  163. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  164. package/dist/types/components/snk-application/snk-application.d.ts +7 -3
  165. package/dist/types/components/snk-attach/snk-attach.d.ts +11 -9
  166. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
  167. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
  168. package/dist/types/components/snk-crud/snk-crud.d.ts +45 -1
  169. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
  170. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
  171. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +24 -0
  172. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +14 -0
  173. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +12 -0
  174. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
  175. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  176. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  177. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  178. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -1
  179. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
  180. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  181. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
  182. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  183. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +67 -3
  184. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
  185. package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
  186. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  187. package/dist/types/components/snk-form/snk-form.d.ts +14 -0
  188. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
  189. package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
  190. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +62 -4
  191. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  192. package/dist/types/components.d.ts +261 -4
  193. package/dist/types/lib/@types/index.d.ts +5 -0
  194. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
  195. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
  196. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
  197. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
  198. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  199. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  200. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  201. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
  202. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
  203. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
  204. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
  205. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
  206. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
  207. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  208. package/package.json +1 -1
  209. package/dist/cjs/snk-data-unit-559ac55c.js +0 -462
  210. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  211. package/dist/components/index3.js +0 -199
  212. package/dist/esm/snk-data-unit-44215df7.js +0 -460
  213. package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
  214. package/dist/sankhyablocks/p-176c3491.entry.js +0 -1
  215. package/dist/sankhyablocks/p-37e5d563.js +0 -65
  216. package/dist/sankhyablocks/p-38289a55.js +0 -1
  217. package/dist/sankhyablocks/p-46e55a95.entry.js +0 -1
  218. package/dist/sankhyablocks/p-4e728357.entry.js +0 -1
  219. package/dist/sankhyablocks/p-5571bdfe.js +0 -1
  220. package/dist/sankhyablocks/p-5630574e.js +0 -1
  221. package/dist/sankhyablocks/p-5f8c0426.entry.js +0 -1
  222. package/dist/sankhyablocks/p-80c64add.entry.js +0 -1
  223. package/dist/sankhyablocks/p-86af4cc2.js +0 -1
  224. package/dist/sankhyablocks/p-8b690717.js +0 -1
  225. package/dist/sankhyablocks/p-a1832166.entry.js +0 -1
  226. package/dist/sankhyablocks/p-a809d944.entry.js +0 -1
  227. package/dist/sankhyablocks/p-a97226f6.entry.js +0 -1
  228. package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
  229. package/dist/sankhyablocks/p-c5a9a5d9.entry.js +0 -1
  230. package/dist/sankhyablocks/p-c5aa7d70.entry.js +0 -11
  231. package/dist/sankhyablocks/p-cb0147ab.entry.js +0 -1
  232. package/dist/sankhyablocks/p-f0145e3b.js +0 -1
  233. package/dist/sankhyablocks/p-f03e4199.entry.js +0 -1
  234. package/dist/sankhyablocks/p-f607db63.entry.js +0 -1
  235. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -2,15 +2,16 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
4
4
  import './DataFetcher.js';
5
- import './dataunit-fetcher.js';
6
- import { P as PresentationMode } from './index2.js';
7
- import { d as defineCustomElement$w } from './snk-actions-button2.js';
5
+ import './pesquisa-fetcher.js';
6
+ import { P as PresentationMode } from './ISave.js';
8
7
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
8
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
+ import './dataunit-fetcher.js';
10
10
  import './filter-item-type.enum.js';
11
11
  import './form-config-fetcher.js';
12
12
  import { V as VIEW_MODE } from './constants.js';
13
13
  import { A as AutorizationType } from './auth-fetcher.js';
14
+ import { d as defineCustomElement$w } from './snk-actions-button2.js';
14
15
  import { d as defineCustomElement$v } from './snk-attach2.js';
15
16
  import { d as defineCustomElement$u } from './snk-config-options2.js';
16
17
  import { d as defineCustomElement$t } from './snk-configurator2.js';
@@ -50,8 +51,11 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
50
51
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
51
52
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
52
53
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
54
+ this.viewModeChanged = createEvent(this, "viewModeChanged", 7);
53
55
  this._keyDownHandler = async (event) => this.keyDownListener(event);
54
56
  this._viewHistory = [];
57
+ this._customEditors = new Map();
58
+ this._customRenders = new Map();
55
59
  this._dataUnit = undefined;
56
60
  this._dataState = undefined;
57
61
  this.attachmentRegisterKey = undefined;
@@ -74,6 +78,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
74
78
  this.filterBarLegacyConfigName = undefined;
75
79
  this.formLegacyConfigName = undefined;
76
80
  this.disablePersonalizedFilter = undefined;
81
+ this.autoLoad = undefined;
82
+ this.autoFocus = true;
83
+ this.domainMessagesBuilder = undefined;
84
+ this.setCustomFormTitle = undefined;
77
85
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
78
86
  }
79
87
  /**
@@ -109,6 +117,49 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
109
117
  async getFilterBar() {
110
118
  return await this._snkGrid.getFilterBar();
111
119
  }
120
+ /**
121
+ * Registra um editor customizado para campos da grade e formulário.
122
+ */
123
+ async addCustomEditor(fieldName, customEditor) {
124
+ if (this._guidesViewer && this._snkGrid) {
125
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
126
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
127
+ return;
128
+ }
129
+ const newCustomEditors = new Map(this._customEditors);
130
+ newCustomEditors.set(fieldName, customEditor);
131
+ this._customEditors = newCustomEditors;
132
+ }
133
+ /**
134
+ * Registra um render customizado para colunas da grid.
135
+ */
136
+ async addGridCustomRender(fieldName, customRender) {
137
+ if (this._snkGrid) {
138
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
139
+ return;
140
+ }
141
+ const newCustomRenders = new Map(this._customRenders);
142
+ newCustomRenders.set(fieldName, customRender);
143
+ this._customRenders = newCustomRenders;
144
+ }
145
+ /**
146
+ * Registra um formatador de valores para uma coluna da grid.
147
+ */
148
+ async addCustomValueFormatter(columnName, customFormatter) {
149
+ this._snkGrid.addCustomValueFormatter(columnName, customFormatter);
150
+ }
151
+ /**
152
+ * Remove o formatador de valores de uma coluna da grid.
153
+ */
154
+ async removeCustomValueFormatter(columnName) {
155
+ this._snkGrid.removeCustomValueFormatter(columnName);
156
+ }
157
+ /**
158
+ * Altera/adiciona uma propriedade nos metadados do campo.
159
+ */
160
+ async setFieldProp(fieldName, propName, value) {
161
+ await this._guidesViewer.setFieldProp(fieldName, propName, value);
162
+ }
112
163
  currentViewModeWatcher(currentView) {
113
164
  this._viewHistory = [...this._viewHistory.slice(-1), currentView];
114
165
  }
@@ -139,6 +190,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
139
190
  else if (viewMode === VIEW_MODE.FORM) {
140
191
  this._guidesViewer.setFocus();
141
192
  }
193
+ this.viewModeChanged.emit(viewMode);
142
194
  }
143
195
  openConfig(viewMode) {
144
196
  this._snkConfigurator.close();
@@ -168,6 +220,29 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
168
220
  const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
169
221
  return joinedPrimaryKeys;
170
222
  }
223
+ setCustomRenders() {
224
+ if (!this._snkGrid) {
225
+ return;
226
+ }
227
+ for (const [fieldName, customRender] of this._customRenders) {
228
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
229
+ this._customRenders.delete(fieldName);
230
+ }
231
+ }
232
+ setCustomEditors() {
233
+ if (!this._snkGrid || !this._guidesViewer) {
234
+ return;
235
+ }
236
+ for (const [fieldName, customEditor] of this._customEditors) {
237
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
238
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
239
+ this._customEditors.delete(fieldName);
240
+ }
241
+ }
242
+ componentDidRender() {
243
+ this.setCustomRenders();
244
+ this.setCustomEditors();
245
+ }
171
246
  componentWillLoad() {
172
247
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
173
248
  let parent = this._element.parentElement;
@@ -179,6 +254,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
179
254
  this._snkDataUnit = parent;
180
255
  this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
181
256
  this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
257
+ this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
182
258
  this._dataUnit = this._snkDataUnit.dataUnit;
183
259
  this._dataState = this._snkDataUnit.dataState;
184
260
  if (!this._dataUnit) {
@@ -190,12 +266,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
190
266
  else {
191
267
  this.initDataUnit();
192
268
  }
193
- this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
194
- this._dataState = dataState;
195
- if (dataState.selectedRecord !== undefined) {
196
- this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
197
- }
198
- });
269
+ this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
199
270
  break;
200
271
  }
201
272
  parent = parent.parentElement;
@@ -211,6 +282,25 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
211
282
  this.removeShortcuts();
212
283
  window.removeEventListener("keydown", this._keyDownHandler);
213
284
  }
285
+ async handleDataStateChange(evt) {
286
+ var _a;
287
+ this._dataState = evt.detail;
288
+ if (this._dataState.selectedRecord !== undefined) {
289
+ this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
290
+ }
291
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
292
+ for (const field of fieldsWithRmPrecision || []) {
293
+ if (!field) {
294
+ continue;
295
+ }
296
+ const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
297
+ if (!rmPrecision && rmPrecision !== 0) {
298
+ continue;
299
+ }
300
+ await this.setFieldProp(field, 'precision', rmPrecision);
301
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
302
+ }
303
+ }
214
304
  async initKeyboardManager() {
215
305
  var _a;
216
306
  const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
@@ -330,7 +420,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
330
420
  return;
331
421
  }
332
422
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
333
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
423
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, getCustomTitle: this.setCustomFormTitle }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
334
424
  }
335
425
  get _element() { return this; }
336
426
  static get watchers() { return {
@@ -354,6 +444,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
354
444
  "filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
355
445
  "formLegacyConfigName": [1, "form-legacy-config-name"],
356
446
  "disablePersonalizedFilter": [4, "disable-personalized-filter"],
447
+ "autoLoad": [4, "auto-load"],
448
+ "autoFocus": [4, "auto-focus"],
449
+ "domainMessagesBuilder": [1, "domain-messages-builder"],
450
+ "setCustomFormTitle": [16],
357
451
  "_dataUnit": [32],
358
452
  "_dataState": [32],
359
453
  "attachmentRegisterKey": [32],
@@ -365,7 +459,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
365
459
  "openConfigurator": [64],
366
460
  "closeConfigurator": [64],
367
461
  "reloadFilterBar": [64],
368
- "getFilterBar": [64]
462
+ "getFilterBar": [64],
463
+ "addCustomEditor": [64],
464
+ "addGridCustomRender": [64],
465
+ "addCustomValueFormatter": [64],
466
+ "removeCustomValueFormatter": [64],
467
+ "setFieldProp": [64]
369
468
  }]);
370
469
  function defineCustomElement$1() {
371
470
  if (typeof customElements === "undefined") {