@sankhyalabs/sankhyablocks 10.1.0-dev.1 → 10.1.0-dev.11

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 (197) hide show
  1. package/dist/cjs/{ConfigStorage-5a73e979.js → ConfigStorage-5c0590b3.js} +2 -2
  2. package/dist/cjs/{DataFetcher-eeb3b0b7.js → DataFetcher-5181a917.js} +23 -2
  3. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-28fe4668.js} +44 -0
  4. package/dist/cjs/{ISave-861e9d6d.js → ISave-0f98a457.js} +4 -4
  5. package/dist/cjs/{SnkFormConfigManager-8d4fded8.js → SnkFormConfigManager-1907ffed.js} +7 -7
  6. package/dist/cjs/{SnkMultiSelectionListDataSource-3b93f6a6.js → SnkMultiSelectionListDataSource-e4e38139.js} +4 -4
  7. package/dist/cjs/{auth-fetcher-8d8acd69.js → auth-fetcher-cff55b1f.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-1cea0695.js → dataunit-fetcher-1ba5e2cc.js} +1 -1
  9. package/dist/cjs/field-config_2.cjs.entry.js +1 -1
  10. package/dist/cjs/fields-layout.cjs.entry.js +6 -3
  11. package/dist/cjs/fields-selector.cjs.entry.js +1 -1
  12. package/dist/cjs/{form-config-fetcher-f347f884.js → form-config-fetcher-4a679e23.js} +1 -1
  13. package/dist/cjs/guides-configurator.cjs.entry.js +5 -3
  14. package/dist/cjs/index-1cf293c1.js +4 -0
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  17. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  18. package/dist/cjs/snk-actions-button_9.cjs.entry.js +14 -7
  19. package/dist/cjs/snk-application.cjs.entry.js +81 -69
  20. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  21. package/dist/cjs/snk-crud.cjs.entry.js +97 -6
  22. package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
  23. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  24. package/dist/cjs/{snk-data-unit-de248308.js → snk-data-unit-061487a8.js} +4 -2
  25. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  27. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-form-view.cjs.entry.js +2 -6
  30. package/dist/cjs/snk-form_2.cjs.entry.js +32 -9
  31. package/dist/cjs/snk-grid.cjs.entry.js +13 -10
  32. package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-2efe60a7.js} +84 -38
  33. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  34. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  35. package/dist/cjs/snk-pesquisa.cjs.entry.js +16 -5
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +9 -17
  37. package/dist/cjs/snk-taskbar.cjs.entry.js +64 -48
  38. package/dist/collection/collection-manifest.json +2 -1
  39. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.js +27 -0
  40. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +5 -25
  41. package/dist/collection/components/snk-application/snk-application.js +87 -44
  42. package/dist/collection/components/snk-attach/snk-attach.js +1 -1
  43. package/dist/collection/components/snk-crud/snk-crud.js +151 -2
  44. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +2 -6
  45. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +133 -34
  46. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
  47. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
  48. package/dist/collection/components/snk-data-unit/snk-data-unit.js +2 -0
  49. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  50. package/dist/collection/components/snk-form-config/FormConfigHelper.js +42 -0
  51. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
  52. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  53. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
  54. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -3
  55. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
  56. package/dist/collection/components/snk-form-config/snk-form-config.js +53 -6
  57. package/dist/collection/components/snk-grid/snk-grid.css +14 -0
  58. package/dist/collection/components/snk-grid/snk-grid.js +26 -4
  59. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +9 -2
  60. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +5 -1
  61. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +43 -0
  62. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +3 -11
  63. package/dist/collection/components/snk-taskbar/snk-taskbar.js +87 -48
  64. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
  65. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
  66. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
  67. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +8 -1
  68. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js +1 -1
  69. package/dist/components/DataFetcher.js +23 -2
  70. package/dist/components/ISave.js +3 -3
  71. package/dist/components/SnkFormConfigManager.js +6 -6
  72. package/dist/components/field-config2.js +43 -1
  73. package/dist/components/fields-layout2.js +6 -3
  74. package/dist/components/guides-configurator2.js +5 -3
  75. package/dist/components/index.d.ts +1 -0
  76. package/dist/components/index.js +1 -0
  77. package/dist/components/snk-application2.js +76 -63
  78. package/dist/components/snk-attach2.js +1 -1
  79. package/dist/components/snk-crud.js +96 -1
  80. package/dist/components/snk-custom-slot-guide.d.ts +11 -0
  81. package/dist/components/snk-custom-slot-guide.js +55 -0
  82. package/dist/components/snk-data-unit2.js +2 -0
  83. package/dist/components/snk-detail-view2.js +81 -34
  84. package/dist/components/snk-filter-number.js +1 -1
  85. package/dist/components/snk-form-config2.js +29 -5
  86. package/dist/components/snk-form-view2.js +2 -6
  87. package/dist/components/snk-grid2.js +9 -4
  88. package/dist/components/snk-layout-form-config2.js +9 -2
  89. package/dist/components/snk-pesquisa2.js +14 -2
  90. package/dist/components/snk-simple-crud2.js +3 -11
  91. package/dist/components/snk-taskbar2.js +66 -49
  92. package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-bd096633.js} +2 -2
  93. package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-5780ad39.js} +23 -2
  94. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-d09669f3.js} +43 -1
  95. package/dist/esm/{ISave-345481c1.js → ISave-8a22ec18.js} +4 -4
  96. package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-437e98bb.js} +7 -7
  97. package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-42125ef4.js} +4 -4
  98. package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-28b9d0db.js} +1 -1
  99. package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-c4251d80.js} +1 -1
  100. package/dist/esm/field-config_2.entry.js +1 -1
  101. package/dist/esm/fields-layout.entry.js +6 -3
  102. package/dist/esm/fields-selector.entry.js +1 -1
  103. package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-d0536a71.js} +1 -1
  104. package/dist/esm/guides-configurator.entry.js +5 -3
  105. package/dist/esm/index-479e1293.js +4 -0
  106. package/dist/esm/loader.js +1 -1
  107. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  108. package/dist/esm/sankhyablocks.js +1 -1
  109. package/dist/esm/snk-actions-button_9.entry.js +14 -7
  110. package/dist/esm/snk-application.entry.js +81 -69
  111. package/dist/esm/snk-attach.entry.js +5 -5
  112. package/dist/esm/snk-crud.entry.js +97 -6
  113. package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
  114. package/dist/esm/snk-data-exporter.entry.js +5 -5
  115. package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-4a1ef77f.js} +4 -2
  116. package/dist/esm/snk-data-unit.entry.js +3 -3
  117. package/dist/esm/snk-detail-view.entry.js +7 -7
  118. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  119. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  120. package/dist/esm/snk-form-view.entry.js +2 -6
  121. package/dist/esm/snk-form_2.entry.js +32 -9
  122. package/dist/esm/snk-grid.entry.js +13 -10
  123. package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-c182d058.js} +84 -38
  124. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  125. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  126. package/dist/esm/snk-pesquisa.entry.js +16 -5
  127. package/dist/esm/snk-simple-crud.entry.js +9 -17
  128. package/dist/esm/snk-taskbar.entry.js +65 -49
  129. package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-01ca59fc.entry.js} +1 -1
  130. package/dist/sankhyablocks/p-028fb380.entry.js +11 -0
  131. package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-03f02b12.entry.js} +1 -1
  132. package/dist/sankhyablocks/{p-1788d191.js → p-0e4f8b86.js} +1 -1
  133. package/dist/sankhyablocks/p-1037ea7b.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-6d241415.js → p-1b1373b6.js} +1 -1
  135. package/dist/sankhyablocks/{p-27005fac.entry.js → p-2e882241.entry.js} +1 -1
  136. package/dist/sankhyablocks/p-30a58e29.entry.js +1 -0
  137. package/dist/sankhyablocks/p-3b167a03.entry.js +1 -0
  138. package/dist/sankhyablocks/{p-e8c49c12.js → p-3c046287.js} +2 -2
  139. package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-42272de8.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-11346b8d.entry.js → p-4c2e2767.entry.js} +1 -1
  141. package/dist/sankhyablocks/{p-7fc46290.js → p-4db9dbf8.js} +1 -1
  142. package/dist/sankhyablocks/{p-626b7a17.js → p-55d7abe7.js} +1 -1
  143. package/dist/sankhyablocks/p-5d408e7e.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-9b6d4950.entry.js → p-6e5af618.entry.js} +1 -1
  145. package/dist/sankhyablocks/{p-144da1d1.entry.js → p-78d4b3e3.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-82a3d522.entry.js +1 -0
  147. package/dist/sankhyablocks/p-8b4d6719.js +1 -0
  148. package/dist/sankhyablocks/{p-e64958ba.entry.js → p-903fa0b4.entry.js} +1 -1
  149. package/dist/sankhyablocks/p-987cd79d.entry.js +1 -0
  150. package/dist/sankhyablocks/{p-88ed2793.js → p-9ab6ae1e.js} +2 -2
  151. package/dist/sankhyablocks/{p-c90f337a.entry.js → p-9f16d33e.entry.js} +1 -1
  152. package/dist/sankhyablocks/p-a1d23fef.js +1 -0
  153. package/dist/sankhyablocks/{p-bb0de89c.entry.js → p-a64ffe30.entry.js} +1 -1
  154. package/dist/sankhyablocks/p-aca74b21.js +1 -0
  155. package/dist/sankhyablocks/p-b7e891cc.entry.js +1 -0
  156. package/dist/sankhyablocks/{p-1d585081.js → p-b9699067.js} +1 -1
  157. package/dist/sankhyablocks/p-c98c79c3.entry.js +1 -0
  158. package/dist/sankhyablocks/p-d2ec9a24.entry.js +1 -0
  159. package/dist/sankhyablocks/{p-59b8f277.js → p-d3534985.js} +1 -1
  160. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-f3027bc9.entry.js} +1 -1
  161. package/dist/sankhyablocks/{p-f8f29e1a.entry.js → p-f35f2eb3.entry.js} +1 -1
  162. package/dist/sankhyablocks/p-fd05e31d.entry.js +1 -0
  163. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  164. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.d.ts +5 -0
  165. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  166. package/dist/types/components/snk-crud/snk-crud.d.ts +22 -0
  167. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +23 -0
  168. package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
  169. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +6 -1
  170. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  171. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  172. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  173. package/dist/types/components/snk-form-config/snk-form-config.d.ts +9 -2
  174. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  175. package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +2 -2
  176. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +8 -0
  177. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -1
  178. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +12 -4
  179. package/dist/types/components.d.ts +105 -0
  180. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  181. package/package.json +1 -1
  182. package/react/components.d.ts +1 -0
  183. package/react/components.js +1 -0
  184. package/react/components.js.map +1 -1
  185. package/dist/sankhyablocks/p-0cf9aa38.js +0 -1
  186. package/dist/sankhyablocks/p-1649f51e.entry.js +0 -1
  187. package/dist/sankhyablocks/p-2c86cfab.entry.js +0 -1
  188. package/dist/sankhyablocks/p-4759912d.entry.js +0 -1
  189. package/dist/sankhyablocks/p-56948f00.entry.js +0 -11
  190. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  191. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  192. package/dist/sankhyablocks/p-9f2cdaab.entry.js +0 -1
  193. package/dist/sankhyablocks/p-9fe91526.js +0 -1
  194. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  195. package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
  196. package/dist/sankhyablocks/p-af9d79e0.entry.js +0 -1
  197. package/dist/sankhyablocks/p-f25c50f7.entry.js +0 -1
@@ -16,6 +16,38 @@ export class SnkCrud {
16
16
  this._viewHistory = [];
17
17
  this._customEditors = new Map();
18
18
  this._customRenders = new Map();
19
+ this.loadEntitySuggestions = async (argument) => {
20
+ var _a;
21
+ const value = (_a = argument === null || argument === void 0 ? void 0 : argument.argument) !== null && _a !== void 0 ? _a : '';
22
+ const mode = (argument === null || argument === void 0 ? void 0 : argument.mode) || "PREDICTIVE";
23
+ if (!value || value.trim().length === 0) {
24
+ return [];
25
+ }
26
+ try {
27
+ this._showMoreOnSearch = false;
28
+ const entityName = this._snkDataUnit.entityName;
29
+ if (mode === "PREDICTIVE") {
30
+ return await this.handlePredictiveSearch(value, entityName);
31
+ }
32
+ return await this._application.executePreparedSearch(mode, value, this.buildSearchOptions(entityName));
33
+ }
34
+ catch (error) {
35
+ console.error('Erro ao carregar sugestões de entidades:', error);
36
+ return [];
37
+ }
38
+ };
39
+ this.searchEntitySelect = async (item) => {
40
+ if (!this._entityPKField || !item) {
41
+ return;
42
+ }
43
+ try {
44
+ const pk = [{ name: this._entityPKField, value: item.value }];
45
+ await this.refreshDataUnitByPk(pk);
46
+ }
47
+ catch (error) {
48
+ console.error('Erro ao selecionar entidade:', error);
49
+ }
50
+ };
19
51
  this.dataUnitInterceptor = {
20
52
  interceptAction: (action) => {
21
53
  if (action.type === DUAction.DATA_SAVED) {
@@ -32,6 +64,8 @@ export class SnkCrud {
32
64
  this._resourceID = undefined;
33
65
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
34
66
  this.numberingConfig = undefined;
67
+ this._showMoreOnSearch = false;
68
+ this._entityPKField = undefined;
35
69
  this.enableLockManagerLoadingComp = false;
36
70
  this.enableLockManagerTaskbarClick = false;
37
71
  this.configName = undefined;
@@ -60,6 +94,8 @@ export class SnkCrud {
60
94
  this.layoutFormConfig = true;
61
95
  this.multipleEditionEnabled = true;
62
96
  this.paginationCounterMode = 'auto';
97
+ this.customGuidesConfig = [];
98
+ this.showEntitySearch = true;
63
99
  this.disableNumberingConfig = false;
64
100
  }
65
101
  /**
@@ -356,6 +392,49 @@ export class SnkCrud {
356
392
  var _a;
357
393
  (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
358
394
  }
395
+ async handlePredictiveSearch(argument, entityName) {
396
+ var _a, _b;
397
+ const response = await this._application.executePreparedSearchWithFullResponse(argument, this.buildSearchOptions(entityName, 5));
398
+ this._showMoreOnSearch = (_a = response === null || response === void 0 ? void 0 : response.hasMore) !== null && _a !== void 0 ? _a : false;
399
+ this._entityPKField = response === null || response === void 0 ? void 0 : response.pkField;
400
+ return (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : [];
401
+ }
402
+ async refreshDataUnitByPk(pks) {
403
+ try {
404
+ const pkField = pks[0].name;
405
+ const pkValue = pks[0].value;
406
+ // Criar filtro para a busca específica
407
+ const quickFilter = {
408
+ term: '',
409
+ filter: {
410
+ name: '',
411
+ params: [],
412
+ expression: `(${pkField} = ${pkValue})`
413
+ }
414
+ };
415
+ // Carregar dados com o filtro aplicado diretamente
416
+ await this._dataUnit.loadData(quickFilter);
417
+ // Navegar para o formulário se houver apenas um registro
418
+ if (this._dataUnit.records.length === 1) {
419
+ this._dataUnit.selectFirst();
420
+ this.gridToForm(true);
421
+ }
422
+ }
423
+ catch (error) {
424
+ console.error('Erro ao atualizar dataset:', error);
425
+ }
426
+ }
427
+ buildSearchOptions(entityName, limit) {
428
+ return {
429
+ entity: entityName,
430
+ entityDescription: entityName,
431
+ executeOnOpen: true,
432
+ searchOptions: {
433
+ localEntityName: entityName,
434
+ limit,
435
+ }
436
+ };
437
+ }
359
438
  async toggleView() {
360
439
  const currentView = await this._viewStack.getSelectedIndex();
361
440
  this.setViewMode(VIEW_MODE.GRID === currentView ? VIEW_MODE.FORM : VIEW_MODE.GRID);
@@ -462,12 +541,23 @@ export class SnkCrud {
462
541
  }
463
542
  this.configuratorCancel.emit();
464
543
  }
544
+ renderCustomGuideSlots() {
545
+ if (!this.customGuidesConfig)
546
+ return;
547
+ return this.customGuidesConfig.map(g => h("slot", { name: g.id }));
548
+ }
549
+ renderDynamicSearch(slotName) {
550
+ var _a;
551
+ if (!this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
552
+ return;
553
+ return (h("div", { slot: slotName, class: "entity-search-container", style: { position: 'relative', display: 'inline-block', marginLeft: '10px', minWidth: '200px' } }, h("ez-search", { label: "Buscar registros", optionLoader: this.loadEntitySuggestions, onEzChange: (evt) => this.searchEntitySelect(evt.detail), mode: "slim", showMore: this._showMoreOnSearch, suppressEmptyOption: true, suppressInputPersist: true })));
554
+ }
465
555
  render() {
466
556
  if (this._resourceID == undefined) {
467
557
  return;
468
558
  }
469
559
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
470
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, 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, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, 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, entityName: this._snkDataUnit.entityName, 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, layoutFormConfig: this.layoutFormConfig })), 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" }))));
560
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, 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" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, 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, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, 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, entityName: this._snkDataUnit.entityName, 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, layoutFormConfig: this.layoutFormConfig })), 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" }))));
471
561
  }
472
562
  static get is() { return "snk-crud"; }
473
563
  static get encapsulation() { return "scoped"; }
@@ -1004,6 +1094,48 @@ export class SnkCrud {
1004
1094
  "reflect": false,
1005
1095
  "defaultValue": "'auto'"
1006
1096
  },
1097
+ "customGuidesConfig": {
1098
+ "type": "unknown",
1099
+ "mutable": false,
1100
+ "complexType": {
1101
+ "original": "Array<CustomGuideItem>",
1102
+ "resolved": "CustomGuideItem[]",
1103
+ "references": {
1104
+ "Array": {
1105
+ "location": "global"
1106
+ },
1107
+ "CustomGuideItem": {
1108
+ "location": "import",
1109
+ "path": "./subcomponents/snk-guides-viewer"
1110
+ }
1111
+ }
1112
+ },
1113
+ "required": false,
1114
+ "optional": true,
1115
+ "docs": {
1116
+ "tags": [],
1117
+ "text": "Fornece as informa\u00E7\u00F5es das guias personalizadas."
1118
+ },
1119
+ "defaultValue": "[]"
1120
+ },
1121
+ "showEntitySearch": {
1122
+ "type": "boolean",
1123
+ "mutable": false,
1124
+ "complexType": {
1125
+ "original": "boolean",
1126
+ "resolved": "boolean",
1127
+ "references": {}
1128
+ },
1129
+ "required": false,
1130
+ "optional": true,
1131
+ "docs": {
1132
+ "tags": [],
1133
+ "text": "Define se o campo de busca de entidades ser\u00E1 exibido na barra superior."
1134
+ },
1135
+ "attribute": "show-entity-search",
1136
+ "reflect": false,
1137
+ "defaultValue": "true"
1138
+ },
1007
1139
  "disableNumberingConfig": {
1008
1140
  "type": "boolean",
1009
1141
  "mutable": false,
@@ -1033,11 +1165,28 @@ export class SnkCrud {
1033
1165
  "_canEdit": {},
1034
1166
  "_resourceID": {},
1035
1167
  "customContainerId": {},
1036
- "numberingConfig": {}
1168
+ "numberingConfig": {},
1169
+ "_showMoreOnSearch": {},
1170
+ "_entityPKField": {}
1037
1171
  };
1038
1172
  }
1039
1173
  static get events() {
1040
1174
  return [{
1175
+ "method": "snkShowGuide",
1176
+ "name": "snkShowGuide",
1177
+ "bubbles": true,
1178
+ "cancelable": true,
1179
+ "composed": true,
1180
+ "docs": {
1181
+ "tags": [],
1182
+ "text": "Emitido pelo guides-viewer sempre que houver mudan\u00E7a de guia."
1183
+ },
1184
+ "complexType": {
1185
+ "original": "string",
1186
+ "resolved": "string",
1187
+ "references": {}
1188
+ }
1189
+ }, {
1041
1190
  "method": "actionClick",
1042
1191
  "name": "actionClick",
1043
1192
  "bubbles": true,
@@ -6,7 +6,7 @@ export class SnkFormView {
6
6
  constructor() {
7
7
  this._customEditors = new Map();
8
8
  this._fieldProps = new Map();
9
- this._singleColumn = true;
9
+ this._singleColumn = false;
10
10
  this.levelPath = undefined;
11
11
  this.fieldSearch = undefined;
12
12
  this.label = undefined;
@@ -144,11 +144,7 @@ export class SnkFormView {
144
144
  }
145
145
  }
146
146
  setSingleColumn(layoutFormConfig) {
147
- if (!(layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config)) {
148
- this._singleColumn = true;
149
- return;
150
- }
151
- this._singleColumn = (layoutFormConfig.config === FormLayout.CASCADE);
147
+ this._singleColumn = (layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config) === FormLayout.CASCADE;
152
148
  }
153
149
  registerNotifyListeners(layoutFormConfig) {
154
150
  if (!layoutFormConfig)
@@ -30,6 +30,7 @@ export class SnkGuidesViewer {
30
30
  this.enableGridInsert = false;
31
31
  this.ignoreReadOnlyFormFields = undefined;
32
32
  this.getCustomTitle = undefined;
33
+ this.customGuidesConfig = [];
33
34
  this._hasToCreateFieldSearch = true;
34
35
  this._breadcrumbItems = [];
35
36
  this._guides = undefined;
@@ -44,6 +45,13 @@ export class SnkGuidesViewer {
44
45
  observeDataUnit() {
45
46
  this.loadGuides(true);
46
47
  }
48
+ async observeFormConfigManager(value) {
49
+ const showFormConfig = !!value;
50
+ await this._viewStack.show(showFormConfig ?
51
+ GUIDES_VIEWER_VIEW_MODE.CONFIG :
52
+ GUIDES_VIEWER_VIEW_MODE.GUIDES);
53
+ this.formConfigVisibilityChanged.emit(showFormConfig);
54
+ }
47
55
  observeDataState(newValue, oldValue) {
48
56
  var _a, _b, _c, _d, _e, _f;
49
57
  const newRecordsIds = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.selectionInfo) === null || _a === void 0 ? void 0 : _a.recordIds) !== null && _b !== void 0 ? _b : (_c = newValue === null || newValue === void 0 ? void 0 : newValue.selectedRecord) === null || _c === void 0 ? void 0 : _c['__record__id__'];
@@ -92,7 +100,8 @@ export class SnkGuidesViewer {
92
100
  * Atribui o foco para o componente.
93
101
  */
94
102
  async setFocus() {
95
- this._container.focus();
103
+ var _a;
104
+ (_a = this._container) === null || _a === void 0 ? void 0 : _a.focus();
96
105
  }
97
106
  /**
98
107
  * Recarrega os guias baseada nos metadados atuais.
@@ -142,7 +151,7 @@ export class SnkGuidesViewer {
142
151
  if (!this._configManager.isLoaded) {
143
152
  return;
144
153
  }
145
- this._masterFormMetadata = buildFormMetadata(this.masterFormConfig, this.dataUnit, true);
154
+ this._masterFormMetadata = buildFormMetadata(this.masterFormConfig, this.dataUnit, true, this.customGuidesConfig);
146
155
  const allSheets = this._masterFormMetadata.getAllSheets();
147
156
  const currentRecord = this.dataUnit.getSelectedRecord();
148
157
  const disableDetails = this.hasToDisableDetails(currentRecord);
@@ -153,6 +162,13 @@ export class SnkGuidesViewer {
153
162
  item.tooltip = this.getMessage("snkCrud.detail.tooltip.needSingleSelection");
154
163
  item.disabled = true;
155
164
  }
165
+ if (sheet.isCustom && sheet.ctxProps) {
166
+ Object.entries(sheet.ctxProps).forEach(([key, value]) => {
167
+ if (value !== undefined) {
168
+ item[key] = value;
169
+ }
170
+ });
171
+ }
156
172
  guides.push(item);
157
173
  });
158
174
  this._guides = guides;
@@ -288,38 +304,52 @@ export class SnkGuidesViewer {
288
304
  return `${this.entityPath}/${entityName}`;
289
305
  }
290
306
  getContent() {
291
- var _a, _b, _c, _d, _e;
292
307
  if (!this.selectedGuide) {
308
+ this.snkShowGuide.emit(undefined);
293
309
  return;
294
310
  }
295
311
  const guideId = this.selectedGuide.id;
296
- let content;
312
+ this.snkShowGuide.emit(guideId);
313
+ if (this.isCustomGuide(guideId)) {
314
+ return h("slot", { name: guideId });
315
+ }
297
316
  const levels = guideId.split("::");
298
317
  const currentLevel = levels.pop();
299
318
  const childEntityName = FormMetadata.getDetailName(currentLevel);
300
319
  let detailId = guideId;
301
- if (childEntityName || levels.length > 0) {
302
- let formName;
303
- let detailBranch;
304
- if (guideId.includes(FORM_NAME_PREFIX)) {
305
- [detailId, formName] = guideId.split(FORM_NAME_PREFIX);
306
- const pathSize = ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) || 0;
307
- detailBranch = pathSize > 1 ? this._breadcrumbItems[pathSize - 2] : this.selectedGuide;
308
- }
309
- else {
310
- detailBranch = this.selectedGuide;
311
- }
312
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode }));
320
+ if (this.isDetailGuide(childEntityName, levels)) {
321
+ return this.buildDetailGuideContent(guideId, detailId, levels, childEntityName);
322
+ }
323
+ return this.buildFormViewGuideContent(guideId);
324
+ }
325
+ buildFormViewGuideContent(cardId) {
326
+ var _a, _b, _c, _d;
327
+ const sheet = this._masterFormMetadata.getSheet(cardId);
328
+ if (!sheet)
329
+ return;
330
+ const cardConfig = (_b = (_a = this.masterFormConfig) === null || _a === void 0 ? void 0 : _a.cardsState) === null || _b === void 0 ? void 0 : _b.get(cardId);
331
+ return (h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_d = (_c = this.masterFormConfig) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: cardId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar()));
332
+ }
333
+ isDetailGuide(childEntityName, levels) {
334
+ return childEntityName || levels.length > 0;
335
+ }
336
+ buildDetailGuideContent(guideId, detailId, levels, childEntityName) {
337
+ var _a;
338
+ let formName;
339
+ let detailBranch;
340
+ if (guideId.includes(FORM_NAME_PREFIX)) {
341
+ [detailId, formName] = guideId.split(FORM_NAME_PREFIX);
342
+ const pathSize = ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) || 0;
343
+ detailBranch = pathSize > 1 ? this._breadcrumbItems[pathSize - 2] : this.selectedGuide;
313
344
  }
314
345
  else {
315
- const cardId = this.selectedGuide.id;
316
- const sheet = this._masterFormMetadata.getSheet(cardId);
317
- if (sheet) {
318
- const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
319
- content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
320
- }
346
+ detailBranch = this.selectedGuide;
321
347
  }
322
- return content;
348
+ return this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode }));
349
+ }
350
+ isCustomGuide(guideId) {
351
+ var _a;
352
+ return (_a = this.customGuidesConfig) === null || _a === void 0 ? void 0 : _a.map(g => g.id).includes(guideId);
323
353
  }
324
354
  onBreadcrumbClickHandler(item) {
325
355
  if ((item === null || item === void 0 ? void 0 : item.id) == undefined) {
@@ -457,7 +487,7 @@ export class SnkGuidesViewer {
457
487
  }
458
488
  buildTaskBar() {
459
489
  var _a;
460
- return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), actionsSettingsList: this.getSettingsListForm(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
490
+ return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), actionsSettingsList: this.getSettingsListForm(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", additionalSlotId: "GUIDES_VIEWER_DYNAMIC_SEARCH", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GUIDES_VIEWER_DYNAMIC_SEARCH" })));
461
491
  }
462
492
  async dataUnitActionHandler(action) {
463
493
  var _a;
@@ -531,6 +561,9 @@ export class SnkGuidesViewer {
531
561
  const labels = selectedRecords.map(record => this.messagesBuilder.getMessage("snkCrud.title", record));
532
562
  return `[${labels.join(", ")}]`;
533
563
  }
564
+ getCustomGuidesConfig() {
565
+ return this._currentDetail ? [] : this.customGuidesConfig;
566
+ }
534
567
  componentDidLoad() {
535
568
  this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
536
569
  this.initKeyboardManager();
@@ -547,17 +580,14 @@ export class SnkGuidesViewer {
547
580
  await this._mainForm.showSearchField();
548
581
  }, { description: this.getMessage("snkSimpleCrud.findFields"), element: this._element });
549
582
  }
550
- render() {
551
- var _a, _b;
583
+ renderFormConfig() {
552
584
  if (this._formEditorConfigManager != undefined) {
553
- return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null }));
585
+ return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, customGuidesConfig: this.getCustomGuidesConfig() }));
554
586
  }
555
- if (!this.dataUnit || !this._configManager.isLoaded) {
556
- return;
557
- }
558
- this.loadTaskbarProcessor();
559
- const showGuides = this._guides && (this._guides.length > 1);
560
- return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
587
+ }
588
+ renderGuidesNavigator(showGuides) {
589
+ var _a, _b;
590
+ return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabIndex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
561
591
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
562
592
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
563
593
  :
@@ -573,6 +603,14 @@ export class SnkGuidesViewer {
573
603
  fieldsProps: this._fieldsProps
574
604
  }), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
575
605
  }
606
+ render() {
607
+ if (!this.dataUnit || !this._configManager.isLoaded) {
608
+ return;
609
+ }
610
+ this.loadTaskbarProcessor();
611
+ const showGuides = this._guides && (this._guides.length > 1);
612
+ return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "guides-viewer-stack" }, h("stack-item", null, this.renderGuidesNavigator(showGuides)), h("stack-item", null, this.renderFormConfig())));
613
+ }
576
614
  static get is() { return "snk-guides-viewer"; }
577
615
  static get encapsulation() { return "scoped"; }
578
616
  static get originalStyleUrls() {
@@ -726,7 +764,7 @@ export class SnkGuidesViewer {
726
764
  },
727
765
  "selectedGuide": {
728
766
  "type": "unknown",
729
- "mutable": false,
767
+ "mutable": true,
730
768
  "complexType": {
731
769
  "original": "IGuideItem",
732
770
  "resolved": "IGuideItem",
@@ -924,6 +962,29 @@ export class SnkGuidesViewer {
924
962
  "tags": [],
925
963
  "text": "Fornece uma fun\u00E7\u00E3o para obter um t\u00EDtulo customizado do formul\u00E1rio."
926
964
  }
965
+ },
966
+ "customGuidesConfig": {
967
+ "type": "unknown",
968
+ "mutable": false,
969
+ "complexType": {
970
+ "original": "Array<CustomGuideItem>",
971
+ "resolved": "CustomGuideItem[]",
972
+ "references": {
973
+ "Array": {
974
+ "location": "global"
975
+ },
976
+ "CustomGuideItem": {
977
+ "location": "local"
978
+ }
979
+ }
980
+ },
981
+ "required": false,
982
+ "optional": true,
983
+ "docs": {
984
+ "tags": [],
985
+ "text": "Fornece as informa\u00E7\u00F5es das guias personalizadas."
986
+ },
987
+ "defaultValue": "[]"
927
988
  }
928
989
  };
929
990
  }
@@ -943,6 +1004,21 @@ export class SnkGuidesViewer {
943
1004
  }
944
1005
  static get events() {
945
1006
  return [{
1007
+ "method": "snkShowGuide",
1008
+ "name": "snkShowGuide",
1009
+ "bubbles": true,
1010
+ "cancelable": true,
1011
+ "composed": true,
1012
+ "docs": {
1013
+ "tags": [],
1014
+ "text": "Emitido quando a uma gua \u00E9 exibida no formul\u00E1rio."
1015
+ },
1016
+ "complexType": {
1017
+ "original": "string",
1018
+ "resolved": "string",
1019
+ "references": {}
1020
+ }
1021
+ }, {
946
1022
  "method": "snkMasterFormConfigChange",
947
1023
  "name": "snkMasterFormConfigChange",
948
1024
  "bubbles": true,
@@ -962,6 +1038,21 @@ export class SnkGuidesViewer {
962
1038
  }
963
1039
  }
964
1040
  }
1041
+ }, {
1042
+ "method": "formConfigVisibilityChanged",
1043
+ "name": "formConfigVisibilityChanged",
1044
+ "bubbles": true,
1045
+ "cancelable": true,
1046
+ "composed": true,
1047
+ "docs": {
1048
+ "tags": [],
1049
+ "text": "Emitido quando a visibilidade do configurador do formul\u00E1rio \u00E9 alterada."
1050
+ },
1051
+ "complexType": {
1052
+ "original": "boolean",
1053
+ "resolved": "boolean",
1054
+ "references": {}
1055
+ }
965
1056
  }, {
966
1057
  "method": "exit",
967
1058
  "name": "exit",
@@ -1159,6 +1250,9 @@ export class SnkGuidesViewer {
1159
1250
  return [{
1160
1251
  "propName": "dataUnit",
1161
1252
  "methodName": "observeDataUnit"
1253
+ }, {
1254
+ "propName": "_formEditorConfigManager",
1255
+ "methodName": "observeFormConfigManager"
1162
1256
  }, {
1163
1257
  "propName": "dataState",
1164
1258
  "methodName": "observeDataState"
@@ -1189,3 +1283,8 @@ var TASKBAR_ID;
1189
1283
  TASKBAR_ID["MUTIPLE_EDITION"] = "snkGuideViewer.multiple_edition";
1190
1284
  TASKBAR_ID["REGULAR"] = "snkGuideViewer.regular";
1191
1285
  })(TASKBAR_ID || (TASKBAR_ID = {}));
1286
+ var GUIDES_VIEWER_VIEW_MODE;
1287
+ (function (GUIDES_VIEWER_VIEW_MODE) {
1288
+ GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["GUIDES"] = 0] = "GUIDES";
1289
+ GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["CONFIG"] = 1] = "CONFIG";
1290
+ })(GUIDES_VIEWER_VIEW_MODE || (GUIDES_VIEWER_VIEW_MODE = {}));
@@ -0,0 +1,95 @@
1
+ import { h, Host } from '@stencil/core';
2
+ export class SnkCustomSlotGuide {
3
+ constructor() {
4
+ this.slotName = 'CUSTOM_SLOT_GUIDE';
5
+ }
6
+ onGuideChange(evt) {
7
+ const guideName = evt.detail;
8
+ if (guideName === this.slotName) {
9
+ this._element.style.setProperty('display', 'block');
10
+ }
11
+ else {
12
+ this._element.style.setProperty('display', 'none');
13
+ }
14
+ }
15
+ onFormConfigVisibilityChange(evt) {
16
+ const isFormConfigVisible = evt.detail;
17
+ if (isFormConfigVisible) {
18
+ this._element.style.setProperty('display', 'none');
19
+ }
20
+ }
21
+ componentDidLoad() {
22
+ this.snkCustomSlotGuideLoaded.emit(this.slotName);
23
+ }
24
+ render() {
25
+ return (h(Host, { slot: this.slotName, id: this.slotName, class: "custom-slot-guide-container" }, h("slot", null)));
26
+ }
27
+ static get is() { return "snk-custom-slot-guide"; }
28
+ static get encapsulation() { return "scoped"; }
29
+ static get originalStyleUrls() {
30
+ return {
31
+ "$": ["snk-custom-slot-guide.css"]
32
+ };
33
+ }
34
+ static get styleUrls() {
35
+ return {
36
+ "$": ["snk-custom-slot-guide.css"]
37
+ };
38
+ }
39
+ static get properties() {
40
+ return {
41
+ "slotName": {
42
+ "type": "string",
43
+ "mutable": false,
44
+ "complexType": {
45
+ "original": "string",
46
+ "resolved": "string",
47
+ "references": {}
48
+ },
49
+ "required": false,
50
+ "optional": false,
51
+ "docs": {
52
+ "tags": [],
53
+ "text": "Nome do slot onde os elementos customizados dever\u00E3o aparecer."
54
+ },
55
+ "attribute": "slot-name",
56
+ "reflect": false,
57
+ "defaultValue": "'CUSTOM_SLOT_GUIDE'"
58
+ }
59
+ };
60
+ }
61
+ static get events() {
62
+ return [{
63
+ "method": "snkCustomSlotGuideLoaded",
64
+ "name": "snkCustomSlotGuideLoaded",
65
+ "bubbles": true,
66
+ "cancelable": true,
67
+ "composed": true,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": "Emitido quando elemento \u00E9 carregado na tela."
71
+ },
72
+ "complexType": {
73
+ "original": "string",
74
+ "resolved": "string",
75
+ "references": {}
76
+ }
77
+ }];
78
+ }
79
+ static get elementRef() { return "_element"; }
80
+ static get listeners() {
81
+ return [{
82
+ "name": "snkShowGuide",
83
+ "method": "onGuideChange",
84
+ "target": "window",
85
+ "capture": false,
86
+ "passive": false
87
+ }, {
88
+ "name": "formConfigVisibilityChanged",
89
+ "method": "onFormConfigVisibilityChange",
90
+ "target": "window",
91
+ "capture": false,
92
+ "passive": false
93
+ }];
94
+ }
95
+ }
@@ -479,6 +479,8 @@ export class SnkDataUnit {
479
479
  return records;
480
480
  const parentSelectedRecord = parentDataUnit.getSelectedRecord();
481
481
  const selfInfo = parentDataUnit === null || parentDataUnit === void 0 ? void 0 : parentDataUnit.getChildInfo(this.getCleanDataUnitName());
482
+ if (!selfInfo)
483
+ return records;
482
484
  const { links } = selfInfo;
483
485
  if (!links || links.length === 0)
484
486
  return records;
@@ -143,7 +143,7 @@ export class SnkFilterPeriod {
143
143
  },
144
144
  "value": {
145
145
  "type": "number",
146
- "mutable": false,
146
+ "mutable": true,
147
147
  "complexType": {
148
148
  "original": "FilterNumberValueType",
149
149
  "resolved": "number | { start: number; end: number; }",