@sankhyalabs/sankhyablocks 8.15.3 → 8.16.0-dev.10

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 (234) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-a343e418.js} +1 -0
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-3c08d25c.js → IExporterProvider-597949f9.js} +94 -4
  3. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  4. package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-166cbd1f.js} +8 -7
  5. package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-897ffd08.js} +9 -13
  6. package/dist/cjs/{pesquisa-fetcher-562d281f.js → dataunit-fetcher-688d3f05.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-680e198f.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-8fa7917a.js +689 -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 +165 -108
  25. package/dist/cjs/{snk-guides-viewer-bb6087cd.js → snk-guides-viewer-9c682034.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 +268 -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 +538 -218
  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.js +240 -101
  59. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +406 -20
  60. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  61. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
  62. package/dist/collection/lib/@types/index.js +5 -0
  63. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
  64. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  65. package/dist/collection/lib/dataUnit/InMemoryLoader.js +7 -3
  66. package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
  67. package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
  68. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  69. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  70. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
  71. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  72. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
  73. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
  74. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +53 -4
  75. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
  76. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
  77. package/dist/collection/lib/message/SnkMessageBuilder.js +5 -12
  78. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
  79. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +2 -1
  80. package/dist/components/ConfigStorage.js +1 -0
  81. package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
  82. package/dist/components/ISave.js +47 -0
  83. package/dist/components/SnkFormConfigManager.js +7 -6
  84. package/dist/components/SnkMessageBuilder.js +9 -13
  85. package/dist/components/dataunit-fetcher.js +84 -182
  86. package/dist/components/index2.js +198 -33
  87. package/dist/components/pesquisa-fetcher.js +164 -0
  88. package/dist/components/snk-actions-button2.js +4 -11
  89. package/dist/components/snk-application2.js +31 -9
  90. package/dist/components/snk-attach2.js +65 -41
  91. package/dist/components/snk-crud.js +110 -11
  92. package/dist/components/snk-data-exporter2.js +309 -85
  93. package/dist/components/snk-data-unit2.js +485 -216
  94. package/dist/components/snk-detail-view2.js +96 -14
  95. package/dist/components/snk-expression-item2.js +1 -1
  96. package/dist/components/snk-filter-bar2.js +6 -1
  97. package/dist/components/snk-form-config2.js +1 -1
  98. package/dist/components/snk-form-view2.js +72 -1
  99. package/dist/components/snk-form.js +53 -6
  100. package/dist/components/snk-grid2.js +168 -106
  101. package/dist/components/snk-personalized-filter2.js +1 -1
  102. package/dist/components/snk-simple-crud2.js +263 -25
  103. package/dist/components/snk-taskbar2.js +6 -5
  104. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-3806514e.js} +1 -0
  105. package/dist/esm/{SnkMultiSelectionListDataSource-6a879955.js → IExporterProvider-63a188b6.js} +93 -5
  106. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  107. package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-31b24066.js} +8 -7
  108. package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-571462fb.js} +9 -13
  109. package/dist/esm/{pesquisa-fetcher-c7ce8ee7.js → dataunit-fetcher-264191b2.js} +83 -181
  110. package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
  111. package/dist/esm/loader.js +1 -1
  112. package/dist/esm/pesquisa-fetcher-03c8f919.js +164 -0
  113. package/dist/esm/sankhyablocks.js +1 -1
  114. package/dist/esm/snk-actions-button_4.entry.js +5 -3
  115. package/dist/esm/snk-application.entry.js +34 -11
  116. package/dist/esm/snk-attach.entry.js +66 -41
  117. package/dist/esm/snk-crud.entry.js +101 -10
  118. package/dist/esm/snk-data-exporter.entry.js +316 -86
  119. package/dist/esm/snk-data-unit-f5cbe64b.js +687 -0
  120. package/dist/esm/snk-data-unit.entry.js +12 -2
  121. package/dist/esm/snk-detail-view.entry.js +50 -10
  122. package/dist/esm/snk-filter-bar.entry.js +6 -2
  123. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  124. package/dist/esm/snk-form-config.entry.js +1 -1
  125. package/dist/esm/snk-form-view.entry.js +67 -0
  126. package/dist/esm/snk-form.entry.js +52 -7
  127. package/dist/esm/snk-grid.entry.js +163 -106
  128. package/dist/esm/{snk-guides-viewer-1d95ebf2.js → snk-guides-viewer-8f6960a2.js} +43 -10
  129. package/dist/esm/snk-guides-viewer.entry.js +9 -7
  130. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  131. package/dist/esm/snk-simple-crud.entry.js +256 -28
  132. package/dist/esm/snk-taskbar.entry.js +4 -3
  133. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-d59867f1.js} +3 -3
  134. package/dist/sankhyablocks/p-17def7cd.js +1 -0
  135. package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
  136. package/dist/sankhyablocks/p-28ee0972.js +1 -0
  137. package/dist/sankhyablocks/p-2a408684.js +1 -0
  138. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-2c68b3ae.entry.js} +1 -1
  139. package/dist/sankhyablocks/p-30cf616e.js +1 -0
  140. package/dist/sankhyablocks/p-3a212712.js +1 -0
  141. package/dist/sankhyablocks/p-450c60e4.entry.js +1 -0
  142. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-47db7e88.entry.js} +1 -1
  143. package/dist/sankhyablocks/p-4e5e1313.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-aff76a53.js → p-52920496.js} +1 -1
  145. package/dist/sankhyablocks/p-62ba211a.entry.js +1 -0
  146. package/dist/sankhyablocks/p-6bb2f3e9.entry.js +1 -0
  147. package/dist/sankhyablocks/p-7505da04.entry.js +1 -0
  148. package/dist/sankhyablocks/p-7619bdb1.entry.js +11 -0
  149. package/dist/sankhyablocks/p-7a85fd49.entry.js +1 -0
  150. package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
  151. package/dist/sankhyablocks/p-7ef9c55c.js +1 -0
  152. package/dist/sankhyablocks/p-80042dc6.entry.js +1 -0
  153. package/dist/sankhyablocks/p-8c59edd7.entry.js +1 -0
  154. package/dist/sankhyablocks/p-9606509c.entry.js +1 -0
  155. package/dist/sankhyablocks/p-9863d682.js +1 -0
  156. package/dist/sankhyablocks/p-ae93d46a.entry.js +1 -0
  157. package/dist/sankhyablocks/p-af8efd95.js +6 -0
  158. package/dist/sankhyablocks/p-d6e26ea8.entry.js +1 -0
  159. package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
  160. package/dist/sankhyablocks/p-f4450320.entry.js +1 -0
  161. package/dist/sankhyablocks/p-fe79f83a.js +60 -0
  162. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  163. package/dist/types/components/snk-application/snk-application.d.ts +7 -3
  164. package/dist/types/components/snk-attach/snk-attach.d.ts +11 -9
  165. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
  166. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
  167. package/dist/types/components/snk-crud/snk-crud.d.ts +45 -1
  168. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
  169. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
  170. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +24 -0
  171. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +14 -0
  172. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +12 -0
  173. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
  174. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  175. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  176. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  177. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -1
  178. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
  179. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  180. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
  181. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  182. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +66 -2
  183. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
  184. package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
  185. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  186. package/dist/types/components/snk-form/snk-form.d.ts +14 -0
  187. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
  188. package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
  189. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +62 -4
  190. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  191. package/dist/types/components.d.ts +261 -4
  192. package/dist/types/lib/@types/index.d.ts +5 -0
  193. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
  194. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
  195. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
  196. package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
  197. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  198. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  199. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  200. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
  201. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
  202. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
  203. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
  204. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
  205. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
  206. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  207. package/package.json +1 -1
  208. package/dist/cjs/snk-data-unit-41c29713.js +0 -462
  209. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  210. package/dist/components/index3.js +0 -199
  211. package/dist/esm/snk-data-unit-de1d140d.js +0 -460
  212. package/dist/sankhyablocks/p-032fe52e.js +0 -1
  213. package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
  214. package/dist/sankhyablocks/p-0594db5a.entry.js +0 -1
  215. package/dist/sankhyablocks/p-06e13db2.js +0 -1
  216. package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
  217. package/dist/sankhyablocks/p-1403a4b6.entry.js +0 -1
  218. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  219. package/dist/sankhyablocks/p-15802c59.entry.js +0 -1
  220. package/dist/sankhyablocks/p-235dc7b1.js +0 -65
  221. package/dist/sankhyablocks/p-32556aa6.js +0 -1
  222. package/dist/sankhyablocks/p-38289a55.js +0 -1
  223. package/dist/sankhyablocks/p-3c632d48.js +0 -1
  224. package/dist/sankhyablocks/p-3f833983.entry.js +0 -1
  225. package/dist/sankhyablocks/p-52c8e589.js +0 -1
  226. package/dist/sankhyablocks/p-5e1502b6.entry.js +0 -11
  227. package/dist/sankhyablocks/p-74d349c3.entry.js +0 -1
  228. package/dist/sankhyablocks/p-93167e28.entry.js +0 -1
  229. package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
  230. package/dist/sankhyablocks/p-bd47dd16.entry.js +0 -1
  231. package/dist/sankhyablocks/p-c1f88236.entry.js +0 -1
  232. package/dist/sankhyablocks/p-ccdd5332.entry.js +0 -1
  233. package/dist/sankhyablocks/p-ee9536bc.entry.js +0 -1
  234. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -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 };
@@ -2,10 +2,11 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
4
  import { P as ParamType } from './ParamType.js';
5
- import './dataunit-fetcher.js';
6
- import './index2.js';
5
+ import './pesquisa-fetcher.js';
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';
10
11
  import './form-config-fetcher.js';
11
12
  import { R as ResourceIDUtils } from './ResourceIDUtils.js';
@@ -158,14 +159,6 @@ var RefreshType;
158
159
  RefreshType["ALL"] = "ALL";
159
160
  })(RefreshType || (RefreshType = {}));
160
161
 
161
- var SaveErrorsEnum;
162
- (function (SaveErrorsEnum) {
163
- SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
164
- SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
165
- SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
166
- SaveErrorsEnum["DESCRIPTION_CANNOT_BE_CHANGED"] = "DESCRIPTION_CANNOT_BE_CHANGED";
167
- })(SaveErrorsEnum || (SaveErrorsEnum = {}));
168
-
169
162
  const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
170
163
  const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
171
164
  const NUFIN_COLUMN = 'NUFIN';
@@ -735,4 +728,4 @@ function defineCustomElement() {
735
728
  } });
736
729
  }
737
730
 
738
- export { SnkActionsButton as S, SaveErrorsEnum as a, defineCustomElement as d };
731
+ export { SnkActionsButton as S, defineCustomElement as d };
@@ -4,7 +4,8 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage.js';
5
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
 
@@ -289,6 +290,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
289
290
  this._duPromises = new Map();
290
291
  this._requestListener = new RequestListenerLoadingBar();
291
292
  this._pendingActions = new Map;
293
+ this._loadPkParameter = null;
292
294
  this._isLoadedByPk = false;
293
295
  this.messagesBuilder = undefined;
294
296
  this.configName = undefined;
@@ -346,6 +348,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
346
348
  });
347
349
  }
348
350
  }
351
+ watchPropHandler(newValue, _) {
352
+ if (newValue && this._loadPkParameter) {
353
+ this.loadByPK(this._loadPkParameter.pk, this._loadPkParameter.redirect);
354
+ this._loadPkParameter = null;
355
+ }
356
+ }
349
357
  /**
350
358
  * Obtém o controlador de teclado.
351
359
  *
@@ -620,12 +628,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
620
628
  if (!waitingDu) {
621
629
  const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
622
630
  dataUnit.loadMetadata().then(() => {
623
- if (dataUnitName) {
624
- this.updateDataunitCache(undefined, dataUnitName, dataUnit);
625
- }
626
- while (duPromisses.length > 0) {
627
- duPromisses.pop().resolve(dataUnit);
628
- }
631
+ this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
629
632
  }).catch(reason => {
630
633
  while (duPromisses.length > 0) {
631
634
  duPromisses.pop().reject(reason);
@@ -634,6 +637,14 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
634
637
  }
635
638
  });
636
639
  }
640
+ processResolveDataUnit(dataUnit, dataUnitName, duPromisses) {
641
+ if (dataUnitName) {
642
+ this.updateDataunitCache(undefined, dataUnitName, dataUnit);
643
+ }
644
+ while (duPromisses.length > 0) {
645
+ duPromisses.pop().resolve(dataUnit);
646
+ }
647
+ }
637
648
  /**
638
649
  * Atualiza o cache de dataunits da aplicação.
639
650
  * @param oldName - Nome do dataunit que está em cache.
@@ -1047,15 +1058,23 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1047
1058
  return;
1048
1059
  const resourceIDfromUrl = this.getResourceIdFromToken();
1049
1060
  const pkObject = UrlUtils.getPkObjectFromUrlToken(top.window.location.hash);
1050
- if (pkObject == undefined || resourceIDfromUrl !== this.applicationResourceID)
1061
+ const redirectFrom = window["redirectFrom"];
1062
+ if (pkObject === undefined) {
1051
1063
  return;
1064
+ }
1065
+ if (!redirectFrom || redirectFrom.split("_")[0].indexOf(resourceIDfromUrl.split("_")[0]) === -1) {
1066
+ if (resourceIDfromUrl !== this.applicationResourceID) {
1067
+ return;
1068
+ }
1069
+ }
1052
1070
  const pkParam = { pk: pkObject };
1053
1071
  this._isLoadedByPk = true;
1054
1072
  if (this.loadByPK) {
1055
- this.loadByPK(pkParam);
1073
+ this.loadByPK(pkParam, redirectFrom);
1056
1074
  this._currentPkParameter = pkHash;
1057
1075
  return;
1058
1076
  }
1077
+ this._loadPkParameter = { pk: pkParam, redirect: redirectFrom };
1059
1078
  this.defaultLoadByPK(pkParam, pkHash);
1060
1079
  }
1061
1080
  getResourceIdFromToken() {
@@ -1246,6 +1265,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1246
1265
  return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1247
1266
  }
1248
1267
  get _element() { return this; }
1268
+ static get watchers() { return {
1269
+ "loadByPK": ["watchPropHandler"]
1270
+ }; }
1249
1271
  static get style() { return snkApplicationCss; }
1250
1272
  }, [2, "snk-application", {
1251
1273
  "messagesBuilder": [1040],
@@ -1,14 +1,15 @@
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
3
  import { D as DataFetcher } from './DataFetcher.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';
5
- import './index2.js';
6
- import { a as SaveErrorsEnum, d as defineCustomElement$f } from './snk-actions-button2.js';
4
+ import './pesquisa-fetcher.js';
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';
7
7
  import './filter-item-type.enum.js';
8
8
  import './form-config-fetcher.js';
9
9
  import { V as VIEW_MODE } from './constants.js';
10
10
  import { A as AutorizationType } from './auth-fetcher.js';
11
11
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
12
+ import { d as defineCustomElement$f } from './snk-actions-button2.js';
12
13
  import { d as defineCustomElement$e } from './snk-config-options2.js';
13
14
  import { d as defineCustomElement$d } from './snk-configurator2.js';
14
15
  import { d as defineCustomElement$c } from './snk-data-exporter2.js';
@@ -656,26 +657,37 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
656
657
  this._currentDataUnit = undefined;
657
658
  this.crudConfig = undefined;
658
659
  }
659
- registerKeyWatcher(newRegisterKey, oldRegisterKey) {
660
- var _a, _b, _c, _d, _e, _f;
661
- if (!this._currentDataUnit) {
660
+ async registerKeyWatcher(newRegisterKey, oldRegisterKey) {
661
+ var _a;
662
+ if (this._currentDataUnit == null) {
662
663
  this.loadAttachmentDataUnit();
663
664
  }
664
665
  if (oldRegisterKey !== newRegisterKey) {
665
- this.returnToGridMode();
666
- if (this.fetcherType === "AnexoSistema") {
667
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
668
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
669
- return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
670
- }
671
- if (this.fetcherType === "Attach") {
672
- const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
673
- if (hasMoreOneItem)
674
- return;
675
- }
676
- return (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
666
+ await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
677
667
  }
678
668
  }
669
+ async initAttach() {
670
+ var _a, _b, _c, _d, _e, _f;
671
+ if (!this.fetcherType && !this.registerKey)
672
+ return;
673
+ if (!this.fetcherType) {
674
+ this.fetcherType = "AnexoSistema";
675
+ }
676
+ this.returnToGridMode();
677
+ if (this.fetcherType === "AnexoSistema") {
678
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
679
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
680
+ await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
681
+ return;
682
+ }
683
+ if (this.fetcherType === "Attach") {
684
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
685
+ if (hasMoreOneItem)
686
+ return;
687
+ }
688
+ await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata());
689
+ await ((_f = this._currentDataUnit) === null || _f === void 0 ? void 0 : _f.loadData(undefined, undefined, true, this.registerKey));
690
+ }
679
691
  /**
680
692
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
681
693
  * através de um pequeno modulo na estrutura da aplicação:
@@ -713,14 +725,14 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
713
725
  if (this._crudElement)
714
726
  this._crudElement.goToView(VIEW_MODE.GRID);
715
727
  }
716
- loadAttachmentDataUnit() {
728
+ async loadAttachmentDataUnit() {
717
729
  try {
718
730
  switch (this.fetcherType) {
719
731
  case "AnexoSistema":
720
- this.loadAnexoSistema();
732
+ await this.loadAnexoSistema();
721
733
  break;
722
734
  case "Attach":
723
- this.loadAttach();
735
+ await this.loadAttach();
724
736
  break;
725
737
  default:
726
738
  this._currentFetcher = this.fetcher;
@@ -732,28 +744,29 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
732
744
  throw new Error('There was an error while creating the data unit');
733
745
  }
734
746
  }
735
- loadAnexoSistema() {
736
- var _a;
737
- this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
747
+ async loadAnexoSistema() {
748
+ var _a, _b, _c;
749
+ this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
738
750
  this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
739
751
  if (!this._currentDataUnit.metadata) {
740
- this._currentDataUnit
741
- .loadMetadata()
742
- .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
752
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata());
753
+ this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
743
754
  }
744
- this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
755
+ this.initDataUnitLoaders();
745
756
  this._currentDataUnit.addFilterProvider({
746
757
  getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
747
758
  });
748
759
  this._currentDataUnit.addInterceptor({
749
760
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
750
761
  });
751
- this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
762
+ await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
763
+ this.disableEditFieldsNotInForm();
752
764
  }
753
- loadAttach() {
754
- var _a, _b, _c;
765
+ async loadAttach() {
766
+ var _a, _b;
755
767
  this._currentFetcher = new AttachFetcher();
756
768
  this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
769
+ this.initDataUnitLoaders();
757
770
  this._currentDataUnit.addInterceptor({
758
771
  interceptAction: (action) => {
759
772
  var _a;
@@ -764,16 +777,26 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
764
777
  return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
765
778
  }
766
779
  });
767
- this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
768
- (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
769
- this.returnToGridMode();
770
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
771
- });
772
780
  if (!this._currentDataUnit.metadata) {
773
- (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
774
- var _a, _b;
775
- this.crudConfig = Object.assign({}, attachCrudConfig);
776
- (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
781
+ await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
782
+ this.crudConfig = Object.assign({}, attachCrudConfig);
783
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData(undefined, undefined, true, this.registerKey));
784
+ this.disableEditFieldsNotInForm();
785
+ }
786
+ }
787
+ initDataUnitLoaders() {
788
+ var _a, _b, _c;
789
+ if (this.fetcherType === "AnexoSistema") {
790
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
791
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
792
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
793
+ }
794
+ if (this.fetcherType === "Attach") {
795
+ this._currentFetcher = new AttachFetcher();
796
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
797
+ (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
798
+ this.returnToGridMode();
799
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
777
800
  });
778
801
  }
779
802
  }
@@ -787,8 +810,9 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
787
810
  }
788
811
  });
789
812
  }
790
- componentWillLoad() {
813
+ async componentWillLoad() {
791
814
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
815
+ await this.initAttach();
792
816
  }
793
817
  componentWillRender() {
794
818
  if (!this.fetcherType) {