@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
@@ -1,5 +1,6 @@
1
1
  import { h, Fragment } from '@stencil/core';
2
- import { Action as DUAction, ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
3
+ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
3
4
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
4
5
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
5
6
  import { PresentationMode } from '../../lib/@types';
@@ -9,12 +10,8 @@ import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionLis
9
10
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
11
  import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
11
12
  import { CrudUtils } from '../../lib';
12
- import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
13
- import ServerSideExporterProvider from '../snk-data-exporter/providers/ServerSideExporterProvider';
14
13
  export class SnkGrid {
15
14
  constructor() {
16
- this._customEditors = new Map();
17
- this._customRenders = new Map();
18
15
  this._topTaskbarProcessor = new TaskbarProcessor({
19
16
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
20
17
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -34,14 +31,6 @@ export class SnkGrid {
34
31
  "snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
35
32
  "snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
36
33
  });
37
- this.dataUnitInterceptor = {
38
- interceptAction: async (action) => {
39
- if (action.type === DUAction.METADATA_LOADED) {
40
- return await this.interceptMetadataLoaded(action);
41
- }
42
- return action;
43
- }
44
- };
45
34
  this._dataUnit = undefined;
46
35
  this._dataState = undefined;
47
36
  this._gridConfig = undefined;
@@ -68,8 +57,6 @@ export class SnkGrid {
68
57
  this.disablePersonalizedFilter = undefined;
69
58
  this.gridLegacyConfigName = undefined;
70
59
  this.filterBarLegacyConfigName = undefined;
71
- this.autoLoad = undefined;
72
- this.autoFocus = true;
73
60
  }
74
61
  /**
75
62
  * Exibe a janela de configurações da grade.
@@ -114,42 +101,6 @@ export class SnkGrid {
114
101
  async findColumn() {
115
102
  await openFieldSearch(this._moreOptions, this._columnSearch);
116
103
  }
117
- /**
118
- * Registra um editor customizado para campos da grade e formulário
119
- */
120
- async addCustomEditor(fieldName, customEditor, detailContext) {
121
- if (this._grid) {
122
- this._grid.addCustomEditor(fieldName, customEditor, detailContext);
123
- return;
124
- }
125
- const newCustomEditors = new Map(this._customEditors);
126
- newCustomEditors.set(fieldName, { customEditor, detailContext });
127
- this._customEditors = newCustomEditors;
128
- }
129
- /**
130
- * Registra um render customizado para colunas da grid.
131
- */
132
- async addGridCustomRender(fieldName, customRender, detailContext) {
133
- if (this._grid) {
134
- this._grid.addGridCustomRender(fieldName, customRender, detailContext);
135
- return;
136
- }
137
- const newCustomRenders = new Map(this._customRenders);
138
- newCustomRenders.set(fieldName, { customRender, detailContext });
139
- this._customRenders = newCustomRenders;
140
- }
141
- /**
142
- * Registra um formatador de valores para uma coluna da grid.
143
- */
144
- async addCustomValueFormatter(columnName, customFormatter) {
145
- this._grid.addCustomValueFormatter(columnName, customFormatter);
146
- }
147
- /**
148
- * Remove o formatador de valores de uma coluna da grid.
149
- */
150
- async removeCustomValueFormatter(columnName) {
151
- this._grid.removeCustomValueFormatter(columnName);
152
- }
153
104
  /**
154
105
  * Atribui o foco para a grade.
155
106
  */
@@ -210,31 +161,106 @@ export class SnkGrid {
210
161
  });
211
162
  evt.stopPropagation();
212
163
  }
213
- async dataExporterProviderStore() {
214
- const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
215
- store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
164
+ buildColumnsMetadata(gridColumns) {
165
+ const columnsMetadata = [];
166
+ gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
167
+ var _a, _b;
168
+ /**
169
+ * TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
170
+ */
171
+ if (column.hidden && column.name !== "RECDESP") {
172
+ return;
173
+ }
174
+ const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
175
+ const columnData = {
176
+ label: column.label,
177
+ id: column.name,
178
+ width: column.width,
179
+ type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
180
+ userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
181
+ };
182
+ columnsMetadata.push(columnData);
183
+ if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
184
+ const mergedFrom = fieldData.properties.mergedFrom;
185
+ const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
186
+ const descriptionColumn = {
187
+ label: fieldData.properties.DESCRIPTIONENTITY,
188
+ id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
189
+ width: 200,
190
+ type: DataType.TEXT,
191
+ userInterface: UserInterface.LONGTEXT
192
+ };
193
+ columnsMetadata.push(descriptionColumn);
194
+ }
195
+ });
196
+ return columnsMetadata || [];
216
197
  }
217
- addElementID() {
218
- const dataInfo = { dataUnit: this._dataUnit };
219
- ElementIDUtils.addIDInfo(this._element, null, dataInfo);
198
+ getPaginationInfo() {
199
+ var _a;
200
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
220
201
  }
221
- loadGridCustomFormatters(fields) {
222
- if (!fields || !this._grid) {
202
+ getExporterOffset(paginationInfo) {
203
+ if (paginationInfo == undefined) {
223
204
  return;
224
205
  }
225
- fields.forEach((field) => {
226
- var _a;
227
- if ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) {
228
- this.addCustomValueFormatter(field.name, this._rmPrecisionCustomValueFormatter);
206
+ const offset = paginationInfo.firstRecord;
207
+ if (offset > 0) {
208
+ return (offset - 1);
209
+ }
210
+ return offset;
211
+ }
212
+ async dataExporterProviderStore() {
213
+ var _a;
214
+ const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
215
+ const dataExporterProvider = {
216
+ getFilters: () => {
217
+ var _a;
218
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
219
+ },
220
+ getColumnsMetadata: async () => {
221
+ var _a;
222
+ const columnsState = await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
223
+ return this.buildColumnsMetadata(columnsState);
224
+ },
225
+ getOrders: () => {
226
+ var _a;
227
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
228
+ },
229
+ getResourceURI: () => {
230
+ var _a;
231
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
232
+ },
233
+ getSelectedNumber: () => {
234
+ var _a, _b;
235
+ return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length;
236
+ },
237
+ getTotalRecords: () => {
238
+ var _a, _b, _c;
239
+ const { total } = ((_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
240
+ return total !== null && total !== void 0 ? total : (_c = (_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
241
+ },
242
+ getSelectedIDs: () => {
243
+ return selectedIDs || [];
244
+ },
245
+ getOffset: () => {
246
+ return this.getExporterOffset(this.getPaginationInfo());
247
+ },
248
+ getLimit: () => {
249
+ var _a;
250
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
251
+ },
252
+ getRecordID: () => {
253
+ var _a, _b, _c;
254
+ return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
229
255
  }
230
- });
256
+ };
257
+ store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
231
258
  }
232
- async interceptMetadataLoaded(action) {
233
- this.loadGridCustomFormatters(action.payload.fields);
234
- return action;
259
+ addElementID() {
260
+ const dataInfo = { dataUnit: this._dataUnit };
261
+ ElementIDUtils.addIDInfo(this._element, null, dataInfo);
235
262
  }
236
- finishLoading() {
237
- this._dataUnit.addInterceptor(this.dataUnitInterceptor);
263
+ finshLoading() {
238
264
  CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
239
265
  this.addElementID();
240
266
  if (this.columnFilterDataSource != undefined) {
@@ -242,24 +268,6 @@ export class SnkGrid {
242
268
  this.columnFilterDataSource.setDataUnit(this._dataUnit);
243
269
  }
244
270
  }
245
- setCustomRenders() {
246
- if (!this._grid) {
247
- return;
248
- }
249
- for (const [fieldName, customRenderProps] of this._customRenders) {
250
- this._grid.addGridCustomRender(fieldName, customRenderProps.customRender, customRenderProps.detailContext);
251
- this._customRenders.delete(fieldName);
252
- }
253
- }
254
- setCustomEditors() {
255
- if (!this._grid) {
256
- return;
257
- }
258
- for (const [fieldName, customEditorProps] of this._customEditors) {
259
- this._grid.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
260
- this._customEditors.delete(fieldName);
261
- }
262
- }
263
271
  componentWillLoad() {
264
272
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
265
273
  //TODO: substituir pelo metodo nativo closest
@@ -271,15 +279,17 @@ export class SnkGrid {
271
279
  if (!this._dataUnit) {
272
280
  this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
273
281
  this._dataUnit = evt.detail;
274
- this.finishLoading();
282
+ this.finshLoading();
275
283
  });
276
284
  }
277
285
  else {
278
- this.finishLoading();
286
+ this.finshLoading();
279
287
  }
280
288
  if (!this.messagesBuilder)
281
289
  this.messagesBuilder = this._snkDataUnit.messagesBuilder;
282
- this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
290
+ this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
291
+ this._dataState = evt.detail;
292
+ });
283
293
  this._snkDataUnit.addEventListener("cancelEdition", () => {
284
294
  var _a;
285
295
  if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
@@ -290,20 +300,9 @@ export class SnkGrid {
290
300
  }
291
301
  parent = parent.parentElement;
292
302
  }
293
- this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
294
303
  this.addGridLegacyConfigName();
295
304
  this.loadConfig();
296
305
  }
297
- componentDidRender() {
298
- this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
299
- this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
300
- this.setCustomRenders();
301
- this.setCustomEditors();
302
- }
303
- async handleDataStateChange(evt) {
304
- this._dataState = evt.detail;
305
- this._rmPrecisionCustomValueFormatter.setDataState(this._dataState);
306
- }
307
306
  getHeaderDisabledButtons() {
308
307
  var _a;
309
308
  const disabledButtons = [];
@@ -415,8 +414,8 @@ export class SnkGrid {
415
414
  if (!this._dataUnit) {
416
415
  return undefined;
417
416
  }
418
- return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
419
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
417
+ return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
418
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
420
419
  }
421
420
  static get is() { return "snk-grid"; }
422
421
  static get encapsulation() { return "scoped"; }
@@ -827,41 +826,6 @@ export class SnkGrid {
827
826
  },
828
827
  "attribute": "filter-bar-legacy-config-name",
829
828
  "reflect": false
830
- },
831
- "autoLoad": {
832
- "type": "boolean",
833
- "mutable": false,
834
- "complexType": {
835
- "original": "boolean",
836
- "resolved": "boolean",
837
- "references": {}
838
- },
839
- "required": false,
840
- "optional": true,
841
- "docs": {
842
- "tags": [],
843
- "text": "Define se a carga dos dados ser\u00E1 feita assim que o componente for carregado."
844
- },
845
- "attribute": "auto-load",
846
- "reflect": false
847
- },
848
- "autoFocus": {
849
- "type": "boolean",
850
- "mutable": false,
851
- "complexType": {
852
- "original": "boolean",
853
- "resolved": "boolean",
854
- "references": {}
855
- },
856
- "required": false,
857
- "optional": true,
858
- "docs": {
859
- "tags": [],
860
- "text": "Define se a grid ser\u00E1 focada ao ser carregada."
861
- },
862
- "attribute": "auto-focus",
863
- "reflect": false,
864
- "defaultValue": "true"
865
829
  }
866
830
  };
867
831
  }
@@ -1015,109 +979,6 @@ export class SnkGrid {
1015
979
  "tags": []
1016
980
  }
1017
981
  },
1018
- "addCustomEditor": {
1019
- "complexType": {
1020
- "signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
1021
- "parameters": [{
1022
- "tags": [],
1023
- "text": ""
1024
- }, {
1025
- "tags": [],
1026
- "text": ""
1027
- }, {
1028
- "tags": [],
1029
- "text": ""
1030
- }],
1031
- "references": {
1032
- "Promise": {
1033
- "location": "global"
1034
- },
1035
- "ICustomEditor": {
1036
- "location": "import",
1037
- "path": "@sankhyalabs/ezui/dist/types/utils"
1038
- }
1039
- },
1040
- "return": "Promise<void>"
1041
- },
1042
- "docs": {
1043
- "text": "Registra um editor customizado para campos da grade e formul\u00E1rio",
1044
- "tags": []
1045
- }
1046
- },
1047
- "addGridCustomRender": {
1048
- "complexType": {
1049
- "signature": "(fieldName: string, customRender: ICustomRender, detailContext?: string) => Promise<void>",
1050
- "parameters": [{
1051
- "tags": [],
1052
- "text": ""
1053
- }, {
1054
- "tags": [],
1055
- "text": ""
1056
- }, {
1057
- "tags": [],
1058
- "text": ""
1059
- }],
1060
- "references": {
1061
- "Promise": {
1062
- "location": "global"
1063
- },
1064
- "ICustomRender": {
1065
- "location": "import",
1066
- "path": "@sankhyalabs/ezui/dist/types/utils"
1067
- }
1068
- },
1069
- "return": "Promise<void>"
1070
- },
1071
- "docs": {
1072
- "text": "Registra um render customizado para colunas da grid.",
1073
- "tags": []
1074
- }
1075
- },
1076
- "addCustomValueFormatter": {
1077
- "complexType": {
1078
- "signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
1079
- "parameters": [{
1080
- "tags": [],
1081
- "text": ""
1082
- }, {
1083
- "tags": [],
1084
- "text": ""
1085
- }],
1086
- "references": {
1087
- "Promise": {
1088
- "location": "global"
1089
- },
1090
- "ICustomFormatter": {
1091
- "location": "import",
1092
- "path": "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces"
1093
- }
1094
- },
1095
- "return": "Promise<void>"
1096
- },
1097
- "docs": {
1098
- "text": "Registra um formatador de valores para uma coluna da grid.",
1099
- "tags": []
1100
- }
1101
- },
1102
- "removeCustomValueFormatter": {
1103
- "complexType": {
1104
- "signature": "(columnName: string) => Promise<void>",
1105
- "parameters": [{
1106
- "tags": [],
1107
- "text": ""
1108
- }],
1109
- "references": {
1110
- "Promise": {
1111
- "location": "global"
1112
- }
1113
- },
1114
- "return": "Promise<void>"
1115
- },
1116
- "docs": {
1117
- "text": "Remove o formatador de valores de uma coluna da grid.",
1118
- "tags": []
1119
- }
1120
- },
1121
982
  "setFocus": {
1122
983
  "complexType": {
1123
984
  "signature": "() => Promise<void>",