@sankhyalabs/sankhyablocks 8.14.11 → 8.15.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 (201) hide show
  1. package/dist/cjs/{ConfigStorage-8009ecb2.js → ConfigStorage-302bbbd4.js} +24 -14
  2. package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
  3. package/dist/cjs/{SnkFormConfigManager-7d850fbc.js → SnkFormConfigManager-71c4768e.js} +1 -1
  4. package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
  5. package/dist/cjs/{field-search-ca27041a.js → field-search-f56aa7d6.js} +29 -1
  6. package/dist/cjs/{index-0e663819.js → index-0922807b.js} +1 -0
  7. package/dist/cjs/index-f9e81701.js +2 -2
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{dataunit-fetcher-d839c5d7.js → pesquisa-fetcher-7a08d110.js} +173 -6
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/{snk-actions-button.cjs.entry.js → snk-actions-button_2.cjs.entry.js} +133 -4
  12. package/dist/cjs/snk-application.cjs.entry.js +65 -6
  13. package/dist/cjs/snk-attach.cjs.entry.js +389 -58
  14. package/dist/cjs/snk-crud.cjs.entry.js +8 -9
  15. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  16. package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
  17. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
  19. package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -3
  20. package/dist/cjs/snk-filter-item.cjs.entry.js +47 -1
  21. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-form.cjs.entry.js +2 -2
  23. package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
  24. package/dist/cjs/snk-grid.cjs.entry.js +51 -42
  25. package/dist/cjs/{snk-guides-viewer-88a7f880.js → snk-guides-viewer-546509df.js} +10 -21
  26. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
  27. package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-simple-crud.cjs.entry.js +20 -42
  29. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  30. package/dist/cjs/{taskbar-elements-39949c7a.js → taskbar-elements-01b85b99.js} +4 -4
  31. package/dist/collection/collection-manifest.json +2 -1
  32. package/dist/collection/components/snk-application/snk-application.js +65 -5
  33. package/dist/collection/components/snk-attach/snk-attach.js +188 -39
  34. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  35. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  36. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  37. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  38. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  39. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
  40. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  41. package/dist/collection/components/snk-crud/snk-crud.js +5 -5
  42. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +6 -19
  43. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +47 -1
  44. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +5 -2
  45. package/dist/collection/components/snk-grid/snk-grid.js +59 -53
  46. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +15 -36
  47. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +6 -0
  48. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +324 -0
  49. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -3
  50. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
  51. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +28 -1
  52. package/dist/collection/lib/@types/index.js +1 -0
  53. package/dist/collection/lib/configs/ConfigStorage.js +24 -14
  54. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  55. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  56. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  57. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  58. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  59. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  60. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  61. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +11 -6
  62. package/dist/collection/lib/index.js +1 -1
  63. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  64. package/dist/components/ConfigStorage.js +24 -14
  65. package/dist/components/SnkMessageBuilder.js +13 -0
  66. package/dist/components/dataunit-fetcher.js +11 -6
  67. package/dist/components/field-search.js +29 -2
  68. package/dist/components/index.d.ts +1 -0
  69. package/dist/components/index.js +1 -0
  70. package/dist/components/index2.js +1 -0
  71. package/dist/components/snk-actions-button2.js +1 -0
  72. package/dist/components/snk-application2.js +62 -2
  73. package/dist/components/snk-attach2.js +414 -71
  74. package/dist/components/snk-crud.js +69 -63
  75. package/dist/components/snk-detail-view2.js +95 -94
  76. package/dist/components/snk-filter-bar2.js +5 -2
  77. package/dist/components/snk-filter-item2.js +47 -1
  78. package/dist/components/snk-grid2.js +91 -76
  79. package/dist/components/snk-simple-crud2.js +31 -46
  80. package/dist/components/snk-taskbar2.js +15 -9
  81. package/dist/components/taskbar-actions-button.d.ts +11 -0
  82. package/dist/components/taskbar-actions-button.js +6 -0
  83. package/dist/components/taskbar-actions-button2.js +154 -0
  84. package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-4151acc8.js} +24 -14
  85. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  86. package/dist/esm/{SnkFormConfigManager-9be0e7d4.js → SnkFormConfigManager-5c7d3771.js} +1 -1
  87. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
  88. package/dist/esm/{field-search-c6938ee4.js → field-search-efbe307f.js} +29 -2
  89. package/dist/esm/{index-1564817d.js → index-0ece87a6.js} +1 -0
  90. package/dist/esm/index-a7d3d3f1.js +2 -2
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/{dataunit-fetcher-cf01a8f4.js → pesquisa-fetcher-d6ff9386.js} +173 -7
  93. package/dist/esm/sankhyablocks.js +1 -1
  94. package/dist/esm/{snk-actions-button.entry.js → snk-actions-button_2.entry.js} +134 -6
  95. package/dist/esm/snk-application.entry.js +65 -6
  96. package/dist/esm/snk-attach.entry.js +390 -59
  97. package/dist/esm/snk-crud.entry.js +8 -9
  98. package/dist/esm/snk-data-exporter.entry.js +3 -3
  99. package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
  100. package/dist/esm/snk-data-unit.entry.js +2 -2
  101. package/dist/esm/snk-detail-view.entry.js +9 -10
  102. package/dist/esm/snk-filter-bar.entry.js +6 -3
  103. package/dist/esm/snk-filter-item.entry.js +47 -1
  104. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  105. package/dist/esm/snk-form.entry.js +2 -2
  106. package/dist/esm/snk-grid-config.entry.js +1 -1
  107. package/dist/esm/snk-grid.entry.js +52 -43
  108. package/dist/esm/{snk-guides-viewer-fde509bf.js → snk-guides-viewer-4e56a2e0.js} +10 -21
  109. package/dist/esm/snk-guides-viewer.entry.js +8 -9
  110. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  111. package/dist/esm/snk-simple-crud.entry.js +19 -41
  112. package/dist/esm/snk-taskbar.entry.js +2 -2
  113. package/dist/esm/{taskbar-elements-0a6b8b95.js → taskbar-elements-d4d0b424.js} +4 -4
  114. package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
  115. package/dist/sankhyablocks/{p-fd8814b9.entry.js → p-1d75d9f9.entry.js} +1 -1
  116. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  117. package/dist/sankhyablocks/p-32460e98.entry.js +11 -0
  118. package/dist/sankhyablocks/p-374d03f6.js +1 -0
  119. package/dist/sankhyablocks/p-38289a55.js +1 -0
  120. package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-3963b9c1.entry.js} +1 -1
  121. package/dist/sankhyablocks/p-42af1bbf.js +65 -0
  122. package/dist/sankhyablocks/{p-776ee8e3.js → p-573a07c5.js} +1 -1
  123. package/dist/sankhyablocks/{p-d4fb9642.entry.js → p-69efa80d.entry.js} +1 -1
  124. package/dist/sankhyablocks/{p-6977a26c.entry.js → p-71439fd9.entry.js} +1 -1
  125. package/dist/sankhyablocks/{p-11081798.entry.js → p-761ed32f.entry.js} +1 -1
  126. package/dist/sankhyablocks/p-7d8d7fe9.entry.js +1 -0
  127. package/dist/sankhyablocks/{p-f514913b.entry.js → p-7f3c7b09.entry.js} +1 -1
  128. package/dist/sankhyablocks/p-8c74258e.entry.js +1 -0
  129. package/dist/sankhyablocks/p-8f0488b8.entry.js +1 -0
  130. package/dist/sankhyablocks/p-9ebcfeb6.entry.js +1 -0
  131. package/dist/sankhyablocks/p-aa95fb2c.js +56 -0
  132. package/dist/sankhyablocks/p-b05ab13d.entry.js +1 -0
  133. package/dist/sankhyablocks/p-c2137023.entry.js +1 -0
  134. package/dist/sankhyablocks/p-c2495304.js +1 -0
  135. package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
  136. package/dist/sankhyablocks/p-d82f6eda.entry.js +1 -0
  137. package/dist/sankhyablocks/p-dcb6aad1.entry.js +1 -0
  138. package/dist/sankhyablocks/{p-3520c088.entry.js → p-e0fd9555.entry.js} +1 -1
  139. package/dist/sankhyablocks/p-e8812d8a.js +1 -0
  140. package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
  141. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  142. package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
  143. package/dist/types/components/snk-application/snk-application.d.ts +4 -1
  144. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  145. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  146. package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
  147. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  148. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
  149. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  150. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  151. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  152. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
  153. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  154. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -1
  155. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -0
  156. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -4
  157. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +6 -5
  158. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +60 -0
  159. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +16 -0
  160. package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +2 -0
  161. package/dist/types/components.d.ts +111 -11
  162. package/dist/types/lib/@types/index.d.ts +2 -1
  163. package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
  164. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  165. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  166. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  167. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  168. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  169. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  170. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
  171. package/dist/types/lib/index.d.ts +1 -1
  172. package/package.json +8 -6
  173. package/react/components.d.ts +1 -0
  174. package/react/components.js +1 -0
  175. package/react/components.js.map +1 -1
  176. package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
  177. package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
  178. package/dist/sankhyablocks/p-08ced1fd.entry.js +0 -1
  179. package/dist/sankhyablocks/p-3160fa64.js +0 -60
  180. package/dist/sankhyablocks/p-34774923.entry.js +0 -1
  181. package/dist/sankhyablocks/p-38ab8a3b.entry.js +0 -1
  182. package/dist/sankhyablocks/p-3ab540cc.entry.js +0 -11
  183. package/dist/sankhyablocks/p-3ecd72a4.js +0 -1
  184. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  185. package/dist/sankhyablocks/p-5534e08c.js +0 -1
  186. package/dist/sankhyablocks/p-585294ee.js +0 -56
  187. package/dist/sankhyablocks/p-6ea96bb1.entry.js +0 -1
  188. package/dist/sankhyablocks/p-936addf1.js +0 -1
  189. package/dist/sankhyablocks/p-c53926eb.entry.js +0 -1
  190. package/dist/sankhyablocks/p-c9841939.js +0 -1
  191. package/dist/sankhyablocks/p-cfbebb49.entry.js +0 -1
  192. package/dist/sankhyablocks/p-d2923a2a.entry.js +0 -1
  193. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  194. package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
  195. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  196. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  197. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  198. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  199. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  200. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  201. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -5,18 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const constants = require('./constants-35ddd366.js');
8
- const taskbarElements = require('./taskbar-elements-39949c7a.js');
8
+ const taskbarElements = require('./taskbar-elements-01b85b99.js');
9
9
  require('./DataFetcher-ba94ed5b.js');
10
- require('./pesquisa-fetcher-ef050a47.js');
11
- const index$1 = require('./index-0e663819.js');
12
- require('./ISave-d68ce3cd.js');
10
+ const pesquisaFetcher = require('./pesquisa-fetcher-7a08d110.js');
11
+ const index$1 = require('./index-0922807b.js');
12
+ require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- const dataunitFetcher = require('./dataunit-fetcher-d839c5d7.js');
16
15
  require('./PreloadManager-84466da6.js');
17
16
  require('./filter-item-type.enum-a7ffdaa6.js');
18
17
  require('./form-config-fetcher-df043d3d.js');
19
- const fieldSearch = require('./field-search-ca27041a.js');
18
+ const fieldSearch = require('./field-search-f56aa7d6.js');
20
19
  const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-ba5838c2.js');
21
20
  require('./index-102ba62d.js');
22
21
  require('./PrintUtils-bcaeb82f.js');
@@ -121,7 +120,7 @@ const SnkSimpleCrud = class {
121
120
  return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
122
121
  }
123
122
  initInMemoryDataUnit() {
124
- this._inMemoryLoader = new dataunitFetcher.InMemoryLoader(this._metadata);
123
+ this._inMemoryLoader = new pesquisaFetcher.InMemoryLoader(this._metadata);
125
124
  this.dataUnit = this._inMemoryLoader.dataUnit;
126
125
  this.dataUnitReady.emit(this.dataUnit);
127
126
  }
@@ -204,12 +203,6 @@ const SnkSimpleCrud = class {
204
203
  if (this._columnSearch != undefined) {
205
204
  return this._columnSearch;
206
205
  }
207
- actionButton.addEventListener("ezPopoverOpen", () => {
208
- if (this._columnSearch) {
209
- const realElement = this._columnSearch["$elm$"];
210
- realElement.value = null;
211
- }
212
- });
213
206
  this._moreOptions = actionButton;
214
207
  this._columnSearch = fieldSearch.buildFieldSearch(item, ({ argument }) => new Promise(accept => {
215
208
  this._grid.filterColumns(argument).then((columns) => {
@@ -218,9 +211,10 @@ const SnkSimpleCrud = class {
218
211
  .map(column => ({ label: column.label, value: column.name })));
219
212
  });
220
213
  }), (option) => {
214
+ var _a;
221
215
  if (option != undefined) {
222
216
  this._grid.locateColumn(option.value);
223
- actionButton.hideActions();
217
+ (_a = actionButton["hideActions"]) === null || _a === void 0 ? void 0 : _a.call(actionButton);
224
218
  }
225
219
  });
226
220
  return this._columnSearch;
@@ -262,14 +256,16 @@ const SnkSimpleCrud = class {
262
256
  getActionsList() {
263
257
  var _a, _b;
264
258
  return [{
265
- value: "",
259
+ value: core.StringUtils.generateUUID(),
266
260
  label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
261
+ disableCloseOnSelect: true,
262
+ eagerInitialize: true,
267
263
  itemBuilder: (actionButton, item) => (this._currentViewMode === constants.VIEW_MODE.GRID)
268
264
  ? this.getColumnSearch(actionButton, item)
269
265
  : this.getFieldSearch(actionButton, item)
270
266
  }];
271
267
  }
272
- keyDownListener(event) {
268
+ async keyDownListener(event) {
273
269
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
274
270
  return;
275
271
  }
@@ -281,39 +277,21 @@ const SnkSimpleCrud = class {
281
277
  }
282
278
  core.FloatingManager.closeAll();
283
279
  if (this._currentViewMode === constants.VIEW_MODE.GRID) {
284
- this.findColumn();
280
+ await this.findColumn();
285
281
  }
286
282
  else {
287
- this.findField();
283
+ await this.findField();
288
284
  }
289
285
  event.preventDefault();
290
286
  }
291
287
  async findField() {
292
- if (!this._moreOptions) {
293
- return;
294
- }
295
- if (!(await this._moreOptions.isOpened())) {
296
- this._moreOptions.showActions();
297
- return;
298
- }
299
- if (this._fieldSearch) {
300
- const realElement = this._fieldSearch["$elm$"];
301
- realElement.value = null;
302
- requestAnimationFrame(() => realElement.setFocus());
303
- }
288
+ await this.openSeach(this._fieldSearch);
304
289
  }
305
290
  async findColumn() {
306
- if (!this._moreOptions) {
307
- return;
308
- }
309
- if (!(await this._moreOptions.isOpened())) {
310
- this._moreOptions.showActions();
311
- }
312
- if (this._columnSearch) {
313
- const realElement = this._columnSearch["$elm$"];
314
- realElement.value = null;
315
- requestAnimationFrame(() => realElement.setFocus());
316
- }
291
+ await this.openSeach(this._columnSearch);
292
+ }
293
+ async openSeach(fieldSearch$1) {
294
+ await fieldSearch.openFieldSearch(this._moreOptions, fieldSearch$1);
317
295
  }
318
296
  clearFieldToFocusHandler() {
319
297
  this._fieldToGetFocus = undefined;
@@ -326,7 +304,7 @@ const SnkSimpleCrud = class {
326
304
  }
327
305
  render() {
328
306
  var _a;
329
- return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
307
+ return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
330
308
  ? undefined
331
309
  : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
332
310
  }
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
8
- const taskbarElements = require('./taskbar-elements-39949c7a.js');
9
- const index$1 = require('./index-0e663819.js');
8
+ const taskbarElements = require('./taskbar-elements-01b85b99.js');
9
+ const index$1 = require('./index-0922807b.js');
10
10
  require('./index-102ba62d.js');
11
11
 
12
12
  const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
- const index$2 = require('./index-0e663819.js');
4
+ const index$2 = require('./index-0922807b.js');
5
5
  const index$1 = require('./index-102ba62d.js');
6
6
 
7
7
  exports.TaskbarElement = void 0;
@@ -89,7 +89,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
89
89
  case exports.TaskbarElement.CONFIGURATOR:
90
90
  return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
91
91
  case exports.TaskbarElement.MORE_OPTIONS:
92
- return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
92
+ return actionButton(element, dataElementId, title, isEnabled, actions, action);
93
93
  case exports.TaskbarElement.DIVIDER:
94
94
  return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
95
95
  case exports.TaskbarElement.DATA_EXPORTER:
@@ -111,9 +111,9 @@ function iconTextButton(iconName, name, className, dataElementId, text, title, a
111
111
  return index.h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
112
112
  index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
113
113
  }
114
- function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
114
+ function actionButton(element, dataElementId, title, isEnabled, actions, action) {
115
115
  return actions && actions.length > 0
116
- ? index.h("ez-actions-button", { key: dataElementId, title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
116
+ ? index.h("taskbar-actions-button", { key: dataElementId, title: title, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
117
117
  : undefined;
118
118
  }
119
119
 
@@ -5,6 +5,7 @@
5
5
  "./components/snk-data-unit/snk-data-unit.js",
6
6
  "./components/snk-taskbar/snk-taskbar.js",
7
7
  "./components/snk-filter-bar/filter-list/snk-filter-list.js",
8
+ "./components/snk-print-selector/snk-print-selector.js",
8
9
  "./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
9
10
  "./components/snk-actions-button/snk-actions-button.js",
10
11
  "./components/snk-actions-button/subcomponents/snk-actions-form.js",
@@ -47,9 +48,9 @@
47
48
  "./components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js",
48
49
  "./components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js",
49
50
  "./components/snk-pesquisa/snk-pesquisa.js",
50
- "./components/snk-print-selector/snk-print-selector.js",
51
51
  "./components/snk-simple-bar/snk-simple-bar.js",
52
52
  "./components/snk-simple-crud/snk-simple-crud.js",
53
+ "./components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js",
53
54
  "./components/teste-pesquisa/teste-pesquisa.js"
54
55
  ],
55
56
  "compiler": {
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, DataType, DependencyType, ElementIDUtils, ErrorTracking, OnboardingUtils, StringUtils, KeyboardManager } from "@sankhyalabs/core";
1
+ import { ApplicationContext, DataType, DependencyType, ElementIDUtils, ErrorTracking, OnboardingUtils, StringUtils, KeyboardManager, ObjectUtils, ArrayUtils, SearchUtils } from "@sankhyalabs/core";
2
2
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
3
  import { h } from "@stencil/core";
4
4
  import AppletCaller from "../../lib/applet-caller/applet-caller";
@@ -582,11 +582,53 @@ export class SnkApplication {
582
582
  return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
583
583
  }
584
584
  }
585
+ filterInvalidFields(resp, item, mdByName) {
586
+ let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
587
+ let accept = !StringUtils.isEmpty(item[field.fieldName]) &&
588
+ field.visible !== false &&
589
+ field.type !== 'B' &&
590
+ resp.pkField !== field.fieldName &&
591
+ resp.descriptionField !== field.fieldName &&
592
+ (field.isPrimaryKey || !field.isLinkField) &&
593
+ !(field.type === 'S' && field.presentationType === 'H');
594
+ if (accept) {
595
+ mdByName[field.fieldName] = field;
596
+ }
597
+ //Condição que trata o problema de trazer imagem no entityCard na pesquisa de registros
598
+ if (typeof item[field.fieldName] === 'string' && (item[field.fieldName].indexOf('<img') > -1 || item[field.fieldName].indexOf('<svg') > -1)) {
599
+ return false;
600
+ }
601
+ return accept;
602
+ });
603
+ return fieldsMetadata;
604
+ }
605
+ filterMathFields(matchFields, fields, qtyFields, mdByName) {
606
+ if (matchFields && Array.isArray(matchFields)) {
607
+ matchFields.forEach((matchField) => {
608
+ let fieldMD = ArrayUtils.removeReference(fields, mdByName[matchField]);
609
+ if (fieldMD) {
610
+ fields.unshift(fieldMD);
611
+ }
612
+ });
613
+ }
614
+ fields = fields.slice(0, qtyFields);
615
+ return fields;
616
+ }
617
+ builOptionItem(argument, item, fields, descriptionField, pkField) {
618
+ var _a;
619
+ let exibitionItem = {
620
+ value: StringUtils.highlightValue(argument, item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
621
+ label: descriptionField ? StringUtils.highlightValue(argument, item['__matchFields'], item[descriptionField], fields, true) : "",
622
+ details: SearchUtils.buildDetails(argument, fields, item)
623
+ };
624
+ return exibitionItem;
625
+ }
585
626
  /**
586
627
  * Obtém as opções em componentes de pesquisa
587
628
  * Ex.: snk-config-options
588
629
  */
589
630
  async executePreparedSearch(mode, argument, options) {
631
+ const mdByName = {};
590
632
  const { entity, entityDescription, criteria, searchOptions } = options;
591
633
  if (mode === "ADVANCED") {
592
634
  return new Promise(accept => {
@@ -604,7 +646,25 @@ export class SnkApplication {
604
646
  });
605
647
  }
606
648
  else {
607
- return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
649
+ return new Promise((resolve, reject) => {
650
+ this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
651
+ .then(result => {
652
+ result = ObjectUtils.stringToObject(result.json.$);
653
+ let descriptionField = result.descriptionField;
654
+ let pkField = result.pkField;
655
+ const list = [];
656
+ result.data.forEach((item) => {
657
+ let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
658
+ let qtyFields = 6;
659
+ let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
660
+ list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
661
+ });
662
+ resolve(list);
663
+ })
664
+ .catch(error => {
665
+ reject(error);
666
+ });
667
+ });
608
668
  }
609
669
  }
610
670
  /**
@@ -2083,11 +2143,11 @@ export class SnkApplication {
2083
2143
  },
2084
2144
  "IOption": {
2085
2145
  "location": "import",
2086
- "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
2146
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
2087
2147
  },
2088
2148
  "ISearchArgument": {
2089
2149
  "location": "import",
2090
- "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
2150
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
2091
2151
  },
2092
2152
  "DataUnit": {
2093
2153
  "location": "import",
@@ -2127,7 +2187,7 @@ export class SnkApplication {
2127
2187
  },
2128
2188
  "IOption": {
2129
2189
  "location": "import",
2130
- "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
2190
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
2131
2191
  },
2132
2192
  "Array": {
2133
2193
  "location": "global"
@@ -1,47 +1,66 @@
1
1
  import { h } from "@stencil/core";
2
- import { ApplicationContext } from "@sankhyalabs/core";
3
- import { AttachFetcher } from "../../lib/http/data-fetcher/fetchers/attach-fetcher";
2
+ import { DataUnit, ApplicationContext } from "@sankhyalabs/core";
3
+ import { AnexoSistemaFetcher, AttachFetcher, DataUnitFetcher } from "../../lib";
4
4
  import { VIEW_MODE } from "../../lib/utils/constants";
5
- import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher";
6
- import { AttachmentDataUnitBuilder, buildTaskBarManager, crudConfig } from "./structure";
5
+ import { AnexoSistemaDataUnitFactory, AttachFetcherDataUnitFactory, buildTaskBarManager, anexoSistemaCrudConfig, attachCrudConfig } from "./structure";
7
6
  const RESOURCE_ID = 'AnexoSistema';
8
7
  const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
9
8
  export class SnkAttach {
10
9
  constructor() {
11
- this.handleTaskbarClick = ({ detail: taskbar }) => {
10
+ this.handleTaskbarClick = async ({ detail: taskbar }) => {
12
11
  if (["DOWNLOAD", "LINK"].includes(taskbar))
13
- return this.downloadAttachment(this.dataUnit.getSelectedRecord());
12
+ return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
13
+ if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
14
+ await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
15
+ }
14
16
  };
15
17
  this.handleBack = () => {
16
- this.dataUnit.cancelEdition().then((cancelationConfirmed) => {
18
+ this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
17
19
  if (cancelationConfirmed)
18
20
  this.back.emit();
19
21
  });
20
22
  };
21
23
  this.handleFinish = () => {
22
- if (!this.dataUnit.isDirty())
24
+ if (!this._currentDataUnit.isDirty())
23
25
  return this.back.emit();
24
- this.dataUnit.saveData().then(() => {
26
+ this._currentDataUnit.saveData().then(() => {
25
27
  this.showFinishedToast();
26
28
  this.back.emit();
27
29
  });
28
30
  };
31
+ this.fetcherType = "AnexoSistema";
32
+ this.fetcher = undefined;
33
+ this.dataUnit = undefined;
34
+ this.dataUnitBuilder = undefined;
29
35
  this.registerKey = undefined;
30
36
  this.entityName = undefined;
31
37
  this.messagesBuilder = undefined;
32
- this.dataUnit = undefined;
38
+ this._currentFetcher = undefined;
39
+ this._currentDataUnit = undefined;
33
40
  this.crudConfig = undefined;
34
41
  }
35
42
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
36
- var _a;
37
- if (this.dataUnit == null) {
43
+ var _a, _b, _c, _d;
44
+ if (this._currentDataUnit == null) {
38
45
  this.loadAttachmentDataUnit();
39
46
  }
40
47
  if (oldRegisterKey !== newRegisterKey) {
41
48
  this.returnToGridMode();
42
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
43
- this._dataUnitBuilder.initLoaders(this.dataUnit, this._attachFetcher, () => { this.returnToGridMode(); });
44
- this.dataUnit.loadData();
49
+ if (this.fetcherType === "AnexoSistema") {
50
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
51
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
52
+ return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
53
+ }
54
+ if (this.fetcherType === "Attach") {
55
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
56
+ if (hasMoreOneItem)
57
+ return;
58
+ }
59
+ return this._currentDataUnit
60
+ .loadMetadata()
61
+ .then(() => {
62
+ this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
63
+ });
45
64
  }
46
65
  }
47
66
  /**
@@ -64,44 +83,90 @@ export class SnkAttach {
64
83
  window.open(`${selectedRecord.LINK}`);
65
84
  return;
66
85
  }
67
- this._attachFetcher.getDownloadKey(selectedRecord).then(({ chave }) => {
68
- window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}&forcarDownload=S`);
86
+ this._currentFetcher
87
+ .getDownloadKey(selectedRecord)
88
+ .then(({ chave }) => {
89
+ var _a;
90
+ let forceDownload = false;
91
+ if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
92
+ forceDownload = true;
93
+ }
94
+ window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
69
95
  });
70
96
  }
71
97
  returnToGridMode() {
72
- this.dataUnit.clearSelection();
98
+ var _a;
99
+ (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
73
100
  if (this._crudElement)
74
101
  this._crudElement.goToView(VIEW_MODE.GRID);
75
102
  }
76
103
  loadAttachmentDataUnit() {
77
- var _a;
78
104
  try {
79
- const dataUnit = this.dataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
80
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
81
- if (!dataUnit.metadata)
82
- dataUnit.loadMetadata().then(() => {
83
- this.crudConfig = crudConfig;
84
- });
85
- this._dataUnitBuilder = new AttachmentDataUnitBuilder(this.entityName, this.getMessage.bind(this));
86
- dataUnit.addFilterProvider({ getFilter: () => this._dataUnitBuilder.getFilters(this.registerKey) });
87
- dataUnit.addInterceptor({ interceptAction: (action) => this._dataUnitBuilder.getInterceptions(dataUnit, action, this._crudElement) });
88
- this.dataUnit = dataUnit;
89
- this.dataUnit.loadData().then(() => {
90
- this.disableEditFieldsNotInForm();
91
- });
92
- return this.dataUnit;
105
+ switch (this.fetcherType) {
106
+ case "AnexoSistema":
107
+ this.loadAnexoSistema();
108
+ break;
109
+ case "Attach":
110
+ this.loadAttach();
111
+ break;
112
+ default:
113
+ this._currentFetcher = this.fetcher;
114
+ this._currentDataUnit = this.dataUnit;
115
+ this._currentDataUnitBuilder = this.dataUnitBuilder;
116
+ }
93
117
  }
94
118
  catch (error) {
95
119
  throw new Error('There was an error while creating the data unit');
96
120
  }
97
121
  }
122
+ loadAnexoSistema() {
123
+ var _a;
124
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
125
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
126
+ if (!this._currentDataUnit.metadata) {
127
+ this._currentDataUnit
128
+ .loadMetadata()
129
+ .then(() => this.crudConfig = anexoSistemaCrudConfig);
130
+ }
131
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
132
+ this._currentDataUnit.addFilterProvider({
133
+ getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
134
+ });
135
+ this._currentDataUnit.addInterceptor({
136
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
137
+ });
138
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
139
+ }
140
+ loadAttach() {
141
+ var _a;
142
+ this._currentFetcher = new AttachFetcher();
143
+ this._currentDataUnit = new DataUnit();
144
+ this._currentDataUnit.addInterceptor({
145
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
146
+ });
147
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
148
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
149
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
150
+ this.returnToGridMode();
151
+ });
152
+ if (!this._currentDataUnit.metadata) {
153
+ this._currentDataUnit
154
+ .loadMetadata()
155
+ .then(() => {
156
+ this.crudConfig = attachCrudConfig;
157
+ this._currentDataUnit
158
+ .loadData(undefined, undefined, true, this.registerKey)
159
+ .then(this.disableEditFieldsNotInForm.bind(this));
160
+ });
161
+ }
162
+ }
98
163
  disableEditFieldsNotInForm() {
99
164
  var _a;
100
165
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
101
166
  var _a;
102
167
  const fieldName = column.name;
103
168
  if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
104
- this.dataUnit.disableField(fieldName);
169
+ this._currentDataUnit.disableField(fieldName);
105
170
  }
106
171
  });
107
172
  }
@@ -109,15 +174,15 @@ export class SnkAttach {
109
174
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
110
175
  }
111
176
  componentWillRender() {
112
- if (this.dataUnit == null) {
177
+ if (this._currentDataUnit == null) {
113
178
  this.loadAttachmentDataUnit();
114
179
  }
115
180
  }
116
181
  render() {
117
182
  var _a, _b;
118
- if (!this.dataUnit)
183
+ if (!this._currentDataUnit)
119
184
  return null;
120
- return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
185
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
121
186
  }
122
187
  static get is() { return "snk-attach"; }
123
188
  static get encapsulation() { return "scoped"; }
@@ -133,6 +198,89 @@ export class SnkAttach {
133
198
  }
134
199
  static get properties() {
135
200
  return {
201
+ "fetcherType": {
202
+ "type": "string",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "TFetcherType",
206
+ "resolved": "\"AnexoSistema\" | \"Another\" | \"Attach\"",
207
+ "references": {
208
+ "TFetcherType": {
209
+ "location": "import",
210
+ "path": "./interfaces/TFetcherType"
211
+ }
212
+ }
213
+ },
214
+ "required": false,
215
+ "optional": false,
216
+ "docs": {
217
+ "tags": [],
218
+ "text": "FetcherType define o tipo de fetcher respons\u00E1vel por carregar os dados do DataUnit."
219
+ },
220
+ "attribute": "fetcher-type",
221
+ "reflect": false,
222
+ "defaultValue": "\"AnexoSistema\""
223
+ },
224
+ "fetcher": {
225
+ "type": "unknown",
226
+ "mutable": false,
227
+ "complexType": {
228
+ "original": "AttachFetcherFacadeInterface",
229
+ "resolved": "AttachFetcherFacadeInterface",
230
+ "references": {
231
+ "AttachFetcherFacadeInterface": {
232
+ "location": "import",
233
+ "path": "../../lib"
234
+ }
235
+ }
236
+ },
237
+ "required": false,
238
+ "optional": false,
239
+ "docs": {
240
+ "tags": [],
241
+ "text": "Fetcher respons\u00E1vel por carregar os dados do DataUnit."
242
+ }
243
+ },
244
+ "dataUnit": {
245
+ "type": "unknown",
246
+ "mutable": false,
247
+ "complexType": {
248
+ "original": "DataUnit",
249
+ "resolved": "DataUnit",
250
+ "references": {
251
+ "DataUnit": {
252
+ "location": "import",
253
+ "path": "@sankhyalabs/core"
254
+ }
255
+ }
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "DataUnit respons\u00E1vel por carregar os dados."
262
+ }
263
+ },
264
+ "dataUnitBuilder": {
265
+ "type": "unknown",
266
+ "mutable": false,
267
+ "complexType": {
268
+ "original": "FetcherFacade",
269
+ "resolved": "FetcherFacade",
270
+ "references": {
271
+ "FetcherFacade": {
272
+ "location": "import",
273
+ "path": "./structure"
274
+ }
275
+ }
276
+ },
277
+ "required": false,
278
+ "optional": false,
279
+ "docs": {
280
+ "tags": [],
281
+ "text": "DataUnitBuilder respons\u00E1vel por implementar dados a serem utilizados no DataUnit."
282
+ }
283
+ },
136
284
  "registerKey": {
137
285
  "type": "string",
138
286
  "mutable": false,
@@ -158,7 +306,7 @@ export class SnkAttach {
158
306
  "resolved": "string",
159
307
  "references": {}
160
308
  },
161
- "required": true,
309
+ "required": false,
162
310
  "optional": false,
163
311
  "docs": {
164
312
  "tags": [],
@@ -191,7 +339,8 @@ export class SnkAttach {
191
339
  }
192
340
  static get states() {
193
341
  return {
194
- "dataUnit": {},
342
+ "_currentFetcher": {},
343
+ "_currentDataUnit": {},
195
344
  "crudConfig": {}
196
345
  };
197
346
  }
@@ -1,4 +1,4 @@
1
- export const crudConfig = {
1
+ export const anexoSistemaCrudConfig = {
2
2
  grid: {
3
3
  columns: [
4
4
  { name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },