@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-57523.0 → 0.0.0-bugfix-dev-59880.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 (186) hide show
  1. package/dist/cjs/{ConfigStorage-7df9d3bb.js → ConfigStorage-9a53a42c.js} +12 -11
  2. package/dist/cjs/{form-config-fetcher-3c4daeb5.js → DataFetcher-515bda03.js} +0 -251
  3. package/dist/cjs/{IExporterProvider-c307e2b1.js → IExporterProvider-e286ef6a.js} +55 -12
  4. package/dist/cjs/{SnkFormConfigManager-4259edbe.js → SnkFormConfigManager-7b222c78.js} +4 -4
  5. package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-4a95fe86.js} +6 -12
  6. package/dist/cjs/{auth-fetcher-e6112be7.js → auth-fetcher-5acb0335.js} +1 -1
  7. package/dist/cjs/{pesquisa-fetcher-cbdaba63.js → dataunit-fetcher-7a08e4dd.js} +74 -175
  8. package/dist/cjs/form-config-fetcher-3f430aee.js +256 -0
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/pesquisa-fetcher-916a935c.js +166 -0
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +10 -8
  13. package/dist/cjs/snk-application.cjs.entry.js +49 -39
  14. package/dist/cjs/snk-attach.cjs.entry.js +19 -17
  15. package/dist/cjs/snk-crud.cjs.entry.js +95 -10
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -9
  17. package/dist/cjs/snk-data-unit-3718477f.js +670 -0
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +10 -2
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +48 -7
  20. package/dist/cjs/snk-filter-bar.cjs.entry.js +8 -3
  21. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -2
  22. package/dist/cjs/snk-form-config.cjs.entry.js +2 -1
  23. package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
  24. package/dist/cjs/snk-form.cjs.entry.js +53 -7
  25. package/dist/cjs/snk-grid.cjs.entry.js +103 -11
  26. package/dist/cjs/{snk-guides-viewer-b0c44e0c.js → snk-guides-viewer-66dd6949.js} +36 -7
  27. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
  28. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -2
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +153 -14
  30. package/dist/collection/collection-manifest.json +1 -1
  31. package/dist/collection/components/snk-application/snk-application.js +37 -17
  32. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
  33. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
  34. package/dist/collection/components/snk-crud/snk-crud.js +230 -7
  35. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +135 -0
  36. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
  37. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +112 -5
  38. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +14 -8
  39. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +5 -0
  40. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
  41. package/dist/collection/components/snk-data-unit/snk-data-unit.js +499 -176
  42. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
  43. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
  44. package/dist/collection/components/snk-form/snk-form.js +101 -4
  45. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +2 -2
  46. package/dist/collection/components/snk-grid/snk-grid.js +219 -8
  47. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +283 -9
  48. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
  49. package/dist/collection/lib/dataUnit/InMemoryLoader.js +6 -2
  50. package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
  51. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
  52. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
  53. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
  54. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +51 -1
  55. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
  56. package/dist/collection/lib/message/SnkMessageBuilder.js +25 -32
  57. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
  58. package/dist/components/ConfigStorage.js +2 -1
  59. package/dist/components/DataFetcher.js +7024 -0
  60. package/dist/components/IExporterProvider.js +54 -12
  61. package/dist/components/SnkFormConfigManager.js +2 -2
  62. package/dist/components/SnkMessageBuilder.js +6 -12
  63. package/dist/components/dataunit-fetcher.js +64 -166
  64. package/dist/components/form-config-fetcher.js +3 -7023
  65. package/dist/components/pesquisa-fetcher.js +164 -0
  66. package/dist/components/snk-actions-button2.js +4 -2
  67. package/dist/components/snk-application2.js +26 -17
  68. package/dist/components/snk-attach2.js +4 -2
  69. package/dist/components/snk-crud.js +101 -10
  70. package/dist/components/snk-data-exporter2.js +6 -4
  71. package/dist/components/snk-data-unit2.js +424 -177
  72. package/dist/components/snk-detail-view2.js +87 -9
  73. package/dist/components/snk-filter-bar2.js +6 -1
  74. package/dist/components/snk-form-config2.js +1 -1
  75. package/dist/components/snk-form-view2.js +72 -1
  76. package/dist/components/snk-form.js +52 -5
  77. package/dist/components/snk-grid2.js +109 -12
  78. package/dist/components/snk-simple-crud2.js +157 -11
  79. package/dist/esm/{ConfigStorage-928c3bf4.js → ConfigStorage-174101b9.js} +2 -1
  80. package/dist/esm/{form-config-fetcher-e3094014.js → DataFetcher-4b4b7beb.js} +1 -250
  81. package/dist/esm/{IExporterProvider-e2a1195d.js → IExporterProvider-cf5a56ee.js} +54 -12
  82. package/dist/esm/{SnkFormConfigManager-a87ade7a.js → SnkFormConfigManager-3bdb3e1f.js} +4 -4
  83. package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-3a767111.js} +6 -12
  84. package/dist/esm/{auth-fetcher-e1cb288f.js → auth-fetcher-9f86c346.js} +1 -1
  85. package/dist/esm/{pesquisa-fetcher-6d8e50bb.js → dataunit-fetcher-f3fa35b9.js} +63 -165
  86. package/dist/esm/form-config-fetcher-5d72aaf1.js +253 -0
  87. package/dist/esm/loader.js +1 -1
  88. package/dist/esm/pesquisa-fetcher-9cfab836.js +164 -0
  89. package/dist/esm/sankhyablocks.js +1 -1
  90. package/dist/esm/snk-actions-button_4.entry.js +5 -3
  91. package/dist/esm/snk-application.entry.js +30 -20
  92. package/dist/esm/snk-attach.entry.js +5 -3
  93. package/dist/esm/snk-crud.entry.js +95 -10
  94. package/dist/esm/snk-data-exporter.entry.js +8 -6
  95. package/dist/esm/snk-data-unit-8d6afa43.js +668 -0
  96. package/dist/esm/snk-data-unit.entry.js +10 -2
  97. package/dist/esm/snk-detail-view.entry.js +48 -7
  98. package/dist/esm/snk-filter-bar.entry.js +8 -3
  99. package/dist/esm/snk-filter-modal-item.entry.js +3 -2
  100. package/dist/esm/snk-form-config.entry.js +2 -1
  101. package/dist/esm/snk-form-view.entry.js +67 -0
  102. package/dist/esm/snk-form.entry.js +53 -7
  103. package/dist/esm/snk-grid.entry.js +104 -12
  104. package/dist/esm/{snk-guides-viewer-1fd41a25.js → snk-guides-viewer-11cf8dc7.js} +36 -7
  105. package/dist/esm/snk-guides-viewer.entry.js +8 -6
  106. package/dist/esm/snk-personalized-filter.entry.js +3 -2
  107. package/dist/esm/snk-simple-crud.entry.js +153 -14
  108. package/dist/sankhyablocks/p-010d475f.js +1 -0
  109. package/dist/sankhyablocks/p-0a28cb19.entry.js +1 -0
  110. package/dist/sankhyablocks/p-188e1432.entry.js +1 -0
  111. package/dist/sankhyablocks/p-1c6debe6.entry.js +1 -0
  112. package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
  113. package/dist/sankhyablocks/p-2a84e45b.entry.js +1 -0
  114. package/dist/sankhyablocks/p-2cc2d8fd.entry.js +1 -0
  115. package/dist/sankhyablocks/p-3e4c2cfe.entry.js +11 -0
  116. package/dist/sankhyablocks/p-4a8a149d.entry.js +1 -0
  117. package/dist/sankhyablocks/p-4ce73e88.js +1 -0
  118. package/dist/sankhyablocks/p-50e72d6c.js +1 -0
  119. package/dist/sankhyablocks/{p-e27496ed.js → p-566f5f50.js} +6 -6
  120. package/dist/sankhyablocks/p-59dccb7a.entry.js +1 -0
  121. package/dist/sankhyablocks/p-5bd78e4c.entry.js +1 -0
  122. package/dist/sankhyablocks/p-6b2be902.js +6 -0
  123. package/dist/sankhyablocks/p-8171e586.entry.js +1 -0
  124. package/dist/sankhyablocks/p-a6dfa396.js +1 -0
  125. package/dist/sankhyablocks/p-a97060b0.js +1 -0
  126. package/dist/sankhyablocks/p-aa854fa8.entry.js +1 -0
  127. package/dist/sankhyablocks/p-b27114c4.js +1 -0
  128. package/dist/sankhyablocks/p-b643f746.entry.js +1 -0
  129. package/dist/sankhyablocks/p-b68918fc.entry.js +1 -0
  130. package/dist/sankhyablocks/p-da7c81d6.entry.js +1 -0
  131. package/dist/sankhyablocks/p-e0c27486.js +26 -0
  132. package/dist/sankhyablocks/p-e238279a.entry.js +1 -0
  133. package/dist/sankhyablocks/p-eae66367.js +1 -0
  134. package/dist/sankhyablocks/p-fde91811.js +60 -0
  135. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  136. package/dist/types/components/snk-application/snk-application.d.ts +6 -2
  137. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
  138. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
  139. package/dist/types/components/snk-crud/snk-crud.d.ts +32 -1
  140. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
  141. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
  142. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +19 -0
  143. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +3 -0
  144. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +61 -2
  145. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
  146. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  147. package/dist/types/components/snk-form/snk-form.d.ts +14 -0
  148. package/dist/types/components/snk-grid/snk-grid.d.ts +42 -3
  149. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +40 -2
  150. package/dist/types/components.d.ts +180 -4
  151. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
  152. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
  153. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
  154. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
  155. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
  156. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
  157. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
  158. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
  159. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +2 -0
  160. package/package.json +1 -1
  161. package/dist/cjs/snk-data-unit-abd2113f.js +0 -427
  162. package/dist/esm/snk-data-unit-29eba11a.js +0 -425
  163. package/dist/sankhyablocks/p-029bfc09.js +0 -1
  164. package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
  165. package/dist/sankhyablocks/p-07825198.js +0 -1
  166. package/dist/sankhyablocks/p-0e8702f0.js +0 -1
  167. package/dist/sankhyablocks/p-13ea113d.entry.js +0 -1
  168. package/dist/sankhyablocks/p-314e2d1a.entry.js +0 -1
  169. package/dist/sankhyablocks/p-32556aa6.js +0 -1
  170. package/dist/sankhyablocks/p-3357af48.js +0 -1
  171. package/dist/sankhyablocks/p-3c2a1f4d.js +0 -65
  172. package/dist/sankhyablocks/p-3e7167dd.js +0 -1
  173. package/dist/sankhyablocks/p-536eeb16.js +0 -26
  174. package/dist/sankhyablocks/p-587f9dcf.entry.js +0 -1
  175. package/dist/sankhyablocks/p-61984566.entry.js +0 -1
  176. package/dist/sankhyablocks/p-61b6126e.entry.js +0 -1
  177. package/dist/sankhyablocks/p-65b6dba3.entry.js +0 -1
  178. package/dist/sankhyablocks/p-6a7bc5c8.entry.js +0 -1
  179. package/dist/sankhyablocks/p-6c9edfd8.entry.js +0 -1
  180. package/dist/sankhyablocks/p-89bde7d3.entry.js +0 -1
  181. package/dist/sankhyablocks/p-91dceecf.entry.js +0 -1
  182. package/dist/sankhyablocks/p-a40cbad8.entry.js +0 -1
  183. package/dist/sankhyablocks/p-b86ea293.entry.js +0 -1
  184. package/dist/sankhyablocks/p-d8ddb2a4.entry.js +0 -11
  185. package/dist/sankhyablocks/p-f92f1f5f.entry.js +0 -1
  186. package/dist/sankhyablocks/p-fa84e72f.entry.js +0 -1
@@ -0,0 +1,164 @@
1
+ import { DataType, ApplicationContext } from '@sankhyalabs/core';
2
+ import { d as dist, D as DataFetcher } from './DataFetcher.js';
3
+
4
+ class PesquisaFetcher {
5
+ constructor() {
6
+ this._defaultPageSize = 100;
7
+ this._templateByQuery = new Map();
8
+ this._searchListenersByDataUnit = new Map();
9
+ this.buldTemplates();
10
+ }
11
+ buldTemplates() {
12
+ this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
13
+ $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
14
+ value
15
+ label
16
+ }
17
+ }`);
18
+ }
19
+ loadSearchOptions(entityName, argument, criteria, options) {
20
+ var _a;
21
+ const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
22
+ argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
23
+ criteria === null || criteria === void 0 ? void 0 : criteria.params.forEach(param => {
24
+ if (param.dataType === DataType.OBJECT) {
25
+ param.value = JSON.stringify(param.value);
26
+ }
27
+ });
28
+ const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, options);
29
+ const values = {
30
+ argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
31
+ entityName,
32
+ criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
33
+ options: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || options,
34
+ };
35
+ if (values.options) {
36
+ (_a = values.options) === null || _a === void 0 ? true : delete _a.dataUnitId;
37
+ }
38
+ return new Promise((resolve, reject) => {
39
+ DataFetcher.get()
40
+ .callGraphQL({
41
+ values,
42
+ query: this._templateByQuery.get("search"),
43
+ })
44
+ .then((result) => {
45
+ resolve(result);
46
+ })
47
+ .catch((error) => {
48
+ reject(error);
49
+ });
50
+ });
51
+ }
52
+ loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
53
+ var _a, _b, _c, _d, _e;
54
+ const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
55
+ const values = {
56
+ argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
57
+ criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
58
+ searchOptions: Object.assign(Object.assign({}, searchOptions), listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions),
59
+ };
60
+ const serviceName = "PesquisaSP.getSuggestion";
61
+ const externalCriteria = {
62
+ query: {
63
+ $: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
64
+ }
65
+ };
66
+ if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
67
+ externalCriteria.params = {
68
+ param: values.criteria.params.map(param => {
69
+ let value = param.value;
70
+ if (typeof value === "string") {
71
+ const match = /CTX\{([^}]+)\}/.exec(value);
72
+ if (match) {
73
+ value = ApplicationContext.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${match[1]})__`);
74
+ }
75
+ }
76
+ let type = param.dataType;
77
+ if (type === DataType.OBJECT) {
78
+ value = value.value;
79
+ type = "S";
80
+ }
81
+ else {
82
+ type = convertParamType(param.dataType);
83
+ }
84
+ return { $: value, type };
85
+ })
86
+ };
87
+ }
88
+ const options = searchOptions != undefined
89
+ ? Object.assign(Object.assign({}, values === null || values === void 0 ? void 0 : values.searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
90
+ const reqBody = {
91
+ "serviceName": serviceName,
92
+ "requestBody": {
93
+ "criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_e = values.searchOptions) === null || _e === void 0 ? void 0 : _e.rootEntity }, { options }),
94
+ "clientEventList": {
95
+ "clientEvent": []
96
+ }
97
+ }
98
+ };
99
+ return new Promise((resolve, reject) => {
100
+ DataFetcher.get()
101
+ .callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
102
+ .then(result => resolve(result))
103
+ .catch(error => reject(error));
104
+ });
105
+ }
106
+ addSearchListener(entityName, dataUnitID, listener) {
107
+ var _a;
108
+ const dataUnitSearchListeners = this._searchListenersByDataUnit.get(dataUnitID) || [];
109
+ const entityListener = dataUnitSearchListeners.find(currentListener => currentListener.entity === entityName);
110
+ if (!entityListener) {
111
+ this._searchListenersByDataUnit.set(dataUnitID, [...dataUnitSearchListeners, { entity: entityName, listener }]);
112
+ }
113
+ else {
114
+ for (const type of Object.keys(listener)) {
115
+ if (type in entityListener.listener) {
116
+ const listenerFunctionIsEquals = ((_a = entityListener.listener[type]) === null || _a === void 0 ? void 0 : _a.toString()) === listener[type].toString();
117
+ if (listenerFunctionIsEquals)
118
+ continue;
119
+ entityListener.listener[type] = listener[type];
120
+ }
121
+ }
122
+ }
123
+ return () => {
124
+ const newListeners = dataUnitSearchListeners.filter(currentListener => currentListener.entity !== entityName);
125
+ if (!newListeners.length) {
126
+ this._searchListenersByDataUnit.delete(dataUnitID);
127
+ return;
128
+ }
129
+ this._searchListenersByDataUnit.set(dataUnitID, newListeners);
130
+ };
131
+ }
132
+ applySearchListener(listenerType, entityName, argument, criteria, searchOptions) {
133
+ var _a;
134
+ const dataUnitId = searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.dataUnitId;
135
+ if (!dataUnitId)
136
+ return;
137
+ const entityListener = (_a = this._searchListenersByDataUnit.get(dataUnitId)) === null || _a === void 0 ? void 0 : _a.find(({ entity }) => entity === entityName);
138
+ if (!entityListener)
139
+ return;
140
+ const { listener } = entityListener;
141
+ if (!(listenerType in listener))
142
+ return;
143
+ return listener[listenerType]({ argument, criteria, searchOptions });
144
+ }
145
+ }
146
+ function convertParamType(dataType) {
147
+ //Alerta: Cuidado pra não contaminar o DataType com a implementação
148
+ //atual da pesquisa... em geral, somente inteiros,
149
+ //data (com ou sem hora) e string são realmente relevantes
150
+ switch (dataType) {
151
+ case DataType.NUMBER:
152
+ return "I";
153
+ case DataType.DATE:
154
+ return "D";
155
+ default:
156
+ return "S";
157
+ }
158
+ }
159
+ var SearchListenerType;
160
+ (function (SearchListenerType) {
161
+ SearchListenerType["beforeSearch"] = "beforeSearch";
162
+ })(SearchListenerType || (SearchListenerType = {}));
163
+
164
+ export { PesquisaFetcher as P };
@@ -1,12 +1,14 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './form-config-fetcher.js';
3
+ import { D as DataFetcher } from './DataFetcher.js';
4
4
  import { P as ParamType } from './ParamType.js';
5
- import './dataunit-fetcher.js';
5
+ import './pesquisa-fetcher.js';
6
6
  import './ISave.js';
7
7
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
8
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
+ import './dataunit-fetcher.js';
9
10
  import './filter-item-type.enum.js';
11
+ import './form-config-fetcher.js';
10
12
  import { R as ResourceIDUtils } from './ResourceIDUtils.js';
11
13
 
12
14
  const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
@@ -2,9 +2,10 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
2
2
  import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage.js';
5
- import { d as dist, D as DataFetcher, U as UrlUtils } from './form-config-fetcher.js';
5
+ import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
7
- import { D as DataUnitFetcher, P as PesquisaFetcher } from './dataunit-fetcher.js';
7
+ import { D as DataUnitFetcher } from './dataunit-fetcher.js';
8
+ import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
8
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
9
10
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
10
11
 
@@ -606,7 +607,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
606
607
  * Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
607
608
  * passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
608
609
  */
609
- async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
610
+ async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options) {
610
611
  if (resourceID == undefined) {
611
612
  resourceID = this.applicationResourceID;
612
613
  }
@@ -616,21 +617,29 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
616
617
  duPromisses.push(new PendingPromise(resolve, reject));
617
618
  if (!waitingDu) {
618
619
  const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
619
- dataUnit.loadMetadata().then(() => {
620
- if (dataUnitName) {
621
- this.updateDataunitCache(undefined, dataUnitName, dataUnit);
622
- }
623
- while (duPromisses.length > 0) {
624
- duPromisses.pop().resolve(dataUnit);
625
- }
626
- }).catch(reason => {
627
- while (duPromisses.length > 0) {
628
- duPromisses.pop().reject(reason);
629
- }
630
- });
620
+ if (options === null || options === void 0 ? void 0 : options.skipLoadMetadata) {
621
+ this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
622
+ }
623
+ else {
624
+ dataUnit.loadMetadata().then(() => {
625
+ this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
626
+ }).catch(reason => {
627
+ while (duPromisses.length > 0) {
628
+ duPromisses.pop().reject(reason);
629
+ }
630
+ });
631
+ }
631
632
  }
632
633
  });
633
634
  }
635
+ processResolveDataUnit(dataUnit, dataUnitName, duPromisses) {
636
+ if (dataUnitName) {
637
+ this.updateDataunitCache(undefined, dataUnitName, dataUnit);
638
+ }
639
+ while (duPromisses.length > 0) {
640
+ duPromisses.pop().resolve(dataUnit);
641
+ }
642
+ }
634
643
  /**
635
644
  * Atualiza o cache de dataunits da aplicação.
636
645
  * @param oldName - Nome do dataunit que está em cache.
@@ -646,14 +655,14 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
646
655
  /**
647
656
  * Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
648
657
  */
649
- async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
658
+ async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options) {
650
659
  return new Promise((resolve, reject) => {
651
660
  const dataUnit = this._duCache.get(dataUnitName);
652
661
  if (dataUnit) {
653
662
  resolve(dataUnit);
654
663
  }
655
664
  else {
656
- this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
665
+ this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options).then(dataUnit => {
657
666
  resolve(dataUnit);
658
667
  }).catch(reason => reject(reason));
659
668
  }
@@ -1,9 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './form-config-fetcher.js';
4
- import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
3
+ import { D as DataFetcher } from './DataFetcher.js';
4
+ import './pesquisa-fetcher.js';
5
5
  import { S as SaveErrorsEnum } from './ISave.js';
6
+ import { P as PreloadManager, a as applyFilter, b as applySorting, c as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
6
7
  import './filter-item-type.enum.js';
8
+ import './form-config-fetcher.js';
7
9
  import { V as VIEW_MODE } from './constants.js';
8
10
  import { A as AutorizationType } from './auth-fetcher.js';
9
11
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
@@ -1,12 +1,14 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
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
- import './form-config-fetcher.js';
5
- import './dataunit-fetcher.js';
4
+ import './DataFetcher.js';
5
+ import './pesquisa-fetcher.js';
6
6
  import { P as PresentationMode } from './ISave.js';
7
7
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
8
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
+ import './dataunit-fetcher.js';
9
10
  import './filter-item-type.enum.js';
11
+ import './form-config-fetcher.js';
10
12
  import { V as VIEW_MODE } from './constants.js';
11
13
  import { A as AutorizationType } from './auth-fetcher.js';
12
14
  import { d as defineCustomElement$w } from './snk-actions-button2.js';
@@ -51,6 +53,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
51
53
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
52
54
  this._keyDownHandler = async (event) => this.keyDownListener(event);
53
55
  this._viewHistory = [];
56
+ this._customEditors = new Map();
57
+ this._customRenders = new Map();
54
58
  this._dataUnit = undefined;
55
59
  this._dataState = undefined;
56
60
  this.attachmentRegisterKey = undefined;
@@ -73,6 +77,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
73
77
  this.filterBarLegacyConfigName = undefined;
74
78
  this.formLegacyConfigName = undefined;
75
79
  this.disablePersonalizedFilter = undefined;
80
+ this.autoLoad = undefined;
76
81
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
77
82
  }
78
83
  /**
@@ -108,6 +113,49 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
113
  async getFilterBar() {
109
114
  return await this._snkGrid.getFilterBar();
110
115
  }
116
+ /**
117
+ * Registra um editor customizado para campos da grade e formulário.
118
+ */
119
+ async addCustomEditor(fieldName, customEditor) {
120
+ if (this._guidesViewer && this._snkGrid) {
121
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
122
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
123
+ return;
124
+ }
125
+ const newCustomEditors = new Map(this._customEditors);
126
+ newCustomEditors.set(fieldName, customEditor);
127
+ this._customEditors = newCustomEditors;
128
+ }
129
+ /**
130
+ * Registra um render customizado para colunas da grid.
131
+ */
132
+ async addGridCustomRender(fieldName, customRender) {
133
+ if (this._snkGrid) {
134
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
135
+ return;
136
+ }
137
+ const newCustomRenders = new Map(this._customRenders);
138
+ newCustomRenders.set(fieldName, customRender);
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._snkGrid.addCustomValueFormatter(columnName, customFormatter);
146
+ }
147
+ /**
148
+ * Remove o formatador de valores de uma coluna da grid.
149
+ */
150
+ async removeCustomValueFormatter(columnName) {
151
+ this._snkGrid.removeCustomValueFormatter(columnName);
152
+ }
153
+ /**
154
+ * Altera/adiciona uma propriedade nos metadados do campo.
155
+ */
156
+ async setFieldProp(fieldName, propName, value) {
157
+ await this._guidesViewer.setFieldProp(fieldName, propName, value);
158
+ }
111
159
  currentViewModeWatcher(currentView) {
112
160
  this._viewHistory = [...this._viewHistory.slice(-1), currentView];
113
161
  }
@@ -161,6 +209,29 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
161
209
  const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
162
210
  return joinedPrimaryKeys;
163
211
  }
212
+ setCustomRenders() {
213
+ if (!this._snkGrid) {
214
+ return;
215
+ }
216
+ for (const [fieldName, customRender] of this._customRenders) {
217
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
218
+ this._customRenders.delete(fieldName);
219
+ }
220
+ }
221
+ setCustomEditors() {
222
+ if (!this._snkGrid || !this._guidesViewer) {
223
+ return;
224
+ }
225
+ for (const [fieldName, customEditor] of this._customEditors) {
226
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
227
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
228
+ this._customEditors.delete(fieldName);
229
+ }
230
+ }
231
+ componentDidRender() {
232
+ this.setCustomRenders();
233
+ this.setCustomEditors();
234
+ }
164
235
  componentWillLoad() {
165
236
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
166
237
  let parent = this._element.parentElement;
@@ -183,12 +254,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
183
254
  else {
184
255
  this.initDataUnit();
185
256
  }
186
- this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
187
- this._dataState = dataState;
188
- if (dataState.selectedRecord !== undefined) {
189
- this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
190
- }
191
- });
257
+ this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
192
258
  break;
193
259
  }
194
260
  parent = parent.parentElement;
@@ -204,6 +270,25 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
204
270
  this.removeShortcuts();
205
271
  window.removeEventListener("keydown", this._keyDownHandler);
206
272
  }
273
+ async handleDataStateChange(evt) {
274
+ var _a;
275
+ this._dataState = evt.detail;
276
+ if (this._dataState.selectedRecord !== undefined) {
277
+ this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
278
+ }
279
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
280
+ for (const field of fieldsWithRmPrecision || []) {
281
+ if (!field) {
282
+ continue;
283
+ }
284
+ const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
285
+ if (!rmPrecision && rmPrecision !== 0) {
286
+ continue;
287
+ }
288
+ await this.setFieldProp(field, 'precision', rmPrecision);
289
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
290
+ }
291
+ }
207
292
  async initKeyboardManager() {
208
293
  var _a;
209
294
  const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
@@ -323,7 +408,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
323
408
  return;
324
409
  }
325
410
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
326
- 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" }))));
411
+ 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 }, 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" }))));
327
412
  }
328
413
  get _element() { return this; }
329
414
  static get watchers() { return {
@@ -347,6 +432,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
347
432
  "filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
348
433
  "formLegacyConfigName": [1, "form-legacy-config-name"],
349
434
  "disablePersonalizedFilter": [4, "disable-personalized-filter"],
435
+ "autoLoad": [4, "auto-load"],
350
436
  "_dataUnit": [32],
351
437
  "_dataState": [32],
352
438
  "attachmentRegisterKey": [32],
@@ -358,7 +444,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
358
444
  "openConfigurator": [64],
359
445
  "closeConfigurator": [64],
360
446
  "reloadFilterBar": [64],
361
- "getFilterBar": [64]
447
+ "getFilterBar": [64],
448
+ "addCustomEditor": [64],
449
+ "addGridCustomRender": [64],
450
+ "addCustomValueFormatter": [64],
451
+ "removeCustomValueFormatter": [64],
452
+ "setFieldProp": [64]
362
453
  }]);
363
454
  function defineCustomElement$1() {
364
455
  if (typeof customElements === "undefined") {
@@ -3,12 +3,14 @@ import { ApplicationContext, ObjectUtils, UserInterface, DataType, ElementIDUtil
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './ISave.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants.js';
6
- import { D as DataFetcher } from './form-config-fetcher.js';
6
+ import { D as DataFetcher } from './DataFetcher.js';
7
7
  import { S as SnkDataUnit } from './snk-data-unit2.js';
8
- import './dataunit-fetcher.js';
8
+ import './pesquisa-fetcher.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
+ import './dataunit-fetcher.js';
11
12
  import './filter-item-type.enum.js';
13
+ import './form-config-fetcher.js';
12
14
  import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
13
15
 
14
16
  class ItemBuilder {
@@ -577,8 +579,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
577
579
  }
578
580
  }
579
581
  loadDropdown() {
580
- var _a, _b;
581
- this._selectedNumber = ((_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs()) === null || _b === void 0 ? void 0 : _b.length) || 0;
582
+ var _a;
583
+ this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedNumber()) || 0;
582
584
  this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
583
585
  this.loadItems();
584
586
  }