@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-48570.0 → 0.0.0-bugfix-dev-KB-49699.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/cjs/{ConfigStorage-d4c99a5e.js → ConfigStorage-34be11ce.js} +68 -5
  2. package/dist/cjs/{SnkFormConfigManager-0ffd098d.js → SnkFormConfigManager-6211fb28.js} +6 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  5. package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
  6. package/dist/cjs/snk-application.cjs.entry.js +8 -2
  7. package/dist/cjs/snk-crud.cjs.entry.js +4 -1
  8. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  9. package/dist/cjs/snk-filter-bar.cjs.entry.js +8 -1
  10. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
  11. package/dist/cjs/snk-form.cjs.entry.js +9 -2
  12. package/dist/cjs/snk-grid.cjs.entry.js +11 -2
  13. package/dist/cjs/{snk-guides-viewer-75047f22.js → snk-guides-viewer-508bb6fe.js} +8 -1
  14. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  15. package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-simple-crud.cjs.entry.js +69 -11
  17. package/dist/cjs/snk-taskbar.cjs.entry.js +6 -1
  18. package/dist/collection/components/snk-application/snk-application.js +42 -2
  19. package/dist/collection/components/snk-crud/snk-crud.js +55 -1
  20. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +24 -0
  21. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +24 -0
  22. package/dist/collection/components/snk-form/snk-form.js +24 -0
  23. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -1
  24. package/dist/collection/components/snk-grid/snk-grid.js +44 -1
  25. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +122 -8
  26. package/dist/collection/components/snk-taskbar/snk-taskbar.js +7 -0
  27. package/dist/collection/lib/configs/ConfigStorage.js +63 -3
  28. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
  29. package/dist/components/ConfigStorage.js +68 -5
  30. package/dist/components/SnkFormConfigManager.js +5 -0
  31. package/dist/components/snk-application2.js +9 -1
  32. package/dist/components/snk-crud.js +7 -1
  33. package/dist/components/snk-detail-view2.js +8 -0
  34. package/dist/components/snk-filter-bar2.js +8 -0
  35. package/dist/components/snk-form.js +8 -0
  36. package/dist/components/snk-grid2.js +12 -1
  37. package/dist/components/snk-simple-crud2.js +70 -9
  38. package/dist/components/snk-taskbar2.js +6 -1
  39. package/dist/esm/{ConfigStorage-39ed8aeb.js → ConfigStorage-101a2b4c.js} +68 -5
  40. package/dist/esm/{SnkFormConfigManager-dd450734.js → SnkFormConfigManager-d86ba46f.js} +6 -1
  41. package/dist/esm/loader.js +1 -1
  42. package/dist/esm/sankhyablocks.js +1 -1
  43. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  44. package/dist/esm/snk-application.entry.js +8 -2
  45. package/dist/esm/snk-crud.entry.js +4 -1
  46. package/dist/esm/snk-detail-view.entry.js +3 -3
  47. package/dist/esm/snk-filter-bar.entry.js +8 -1
  48. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  49. package/dist/esm/snk-form.entry.js +9 -2
  50. package/dist/esm/snk-grid.entry.js +11 -2
  51. package/dist/esm/{snk-guides-viewer-8b679ee6.js → snk-guides-viewer-18859840.js} +8 -1
  52. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  53. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  54. package/dist/esm/snk-simple-crud.entry.js +69 -11
  55. package/dist/esm/snk-taskbar.entry.js +6 -1
  56. package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
  57. package/dist/sankhyablocks/p-1fa5a18c.entry.js +11 -0
  58. package/dist/sankhyablocks/p-5c0b53ce.js +56 -0
  59. package/dist/sankhyablocks/p-5dbc1a3f.js +1 -0
  60. package/dist/sankhyablocks/p-60fa6c7a.js +1 -0
  61. package/dist/sankhyablocks/p-64c1b368.entry.js +1 -0
  62. package/dist/sankhyablocks/p-650f7216.entry.js +1 -0
  63. package/dist/sankhyablocks/{p-9d608b62.entry.js → p-6b28cc74.entry.js} +1 -1
  64. package/dist/sankhyablocks/{p-827e4b01.entry.js → p-7ddd95b6.entry.js} +1 -1
  65. package/dist/sankhyablocks/{p-9fb97691.entry.js → p-b41a622a.entry.js} +1 -1
  66. package/dist/sankhyablocks/{p-d0bc5ef3.entry.js → p-b4de81ac.entry.js} +1 -1
  67. package/dist/sankhyablocks/p-d01ceda6.entry.js +1 -0
  68. package/dist/sankhyablocks/p-d304659d.entry.js +1 -0
  69. package/dist/sankhyablocks/{p-a1c630fb.entry.js → p-e4fb3308.entry.js} +1 -1
  70. package/dist/sankhyablocks/p-fbfab20b.entry.js +1 -0
  71. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  72. package/dist/types/components/snk-application/snk-application.d.ts +8 -0
  73. package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
  74. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -0
  75. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
  76. package/dist/types/components/snk-form/snk-form.d.ts +5 -0
  77. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -0
  78. package/dist/types/components/snk-grid/snk-grid.d.ts +9 -0
  79. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +19 -0
  80. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
  81. package/dist/types/components.d.ts +104 -0
  82. package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
  83. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
  84. package/package.json +1 -1
  85. package/dist/sankhyablocks/p-230f5148.entry.js +0 -1
  86. package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
  87. package/dist/sankhyablocks/p-4b0c5921.entry.js +0 -1
  88. package/dist/sankhyablocks/p-5eaecd30.entry.js +0 -1
  89. package/dist/sankhyablocks/p-61da4a55.entry.js +0 -1
  90. package/dist/sankhyablocks/p-67aedbe0.js +0 -56
  91. package/dist/sankhyablocks/p-746fc99e.entry.js +0 -1
  92. package/dist/sankhyablocks/p-8a00836e.js +0 -1
  93. package/dist/sankhyablocks/p-9ea14b61.js +0 -1
  94. package/dist/sankhyablocks/p-c4bcdd4b.entry.js +0 -11
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
8
8
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
- const ConfigStorage = require('./ConfigStorage-d4c99a5e.js');
9
+ const ConfigStorage = require('./ConfigStorage-34be11ce.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
11
  const fieldSearch = require('./field-search-f56aa7d6.js');
12
12
  const index$2 = require('./index-102ba62d.js');
@@ -73,6 +73,8 @@ const SnkGrid = class {
73
73
  this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
74
74
  this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
75
75
  this.disablePersonalizedFilter = undefined;
76
+ this.gridLegacyConfigName = undefined;
77
+ this.filterBarLegacyConfigName = undefined;
76
78
  }
77
79
  /**
78
80
  * Exibe a janela de configurações da grade.
@@ -141,6 +143,11 @@ const SnkGrid = class {
141
143
  console.warn(error);
142
144
  });
143
145
  }
146
+ addGridLegacyConfigName() {
147
+ if (this.gridLegacyConfigName && this.configName) {
148
+ ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
149
+ }
150
+ }
144
151
  gridConfigChangeHandler(evt) {
145
152
  const config = evt.detail;
146
153
  ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
@@ -265,6 +272,7 @@ const SnkGrid = class {
265
272
  }
266
273
  componentWillLoad() {
267
274
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
275
+ //TODO: substituir pelo metodo nativo closest
268
276
  let parent = this._element.parentElement;
269
277
  while (parent) {
270
278
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -294,6 +302,7 @@ const SnkGrid = class {
294
302
  }
295
303
  parent = parent.parentElement;
296
304
  }
305
+ this.addGridLegacyConfigName();
297
306
  this.loadConfig();
298
307
  }
299
308
  getHeaderDisabledButtons() {
@@ -408,7 +417,7 @@ const SnkGrid = class {
408
417
  return undefined;
409
418
  }
410
419
  return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
411
- index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
420
+ index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
412
421
  }
413
422
  get _element() { return index.getElement(this); }
414
423
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const SnkFormConfigManager = require('./SnkFormConfigManager-0ffd098d.js');
5
+ const SnkFormConfigManager = require('./SnkFormConfigManager-6211fb28.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-f56aa7d6.js');
8
8
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
@@ -41,6 +41,7 @@ const SnkGuidesViewer = class {
41
41
  this.presentationMode = undefined;
42
42
  this.resourceID = undefined;
43
43
  this.detailTaskbarCustomContainerId = undefined;
44
+ this.formLegacyConfigName = undefined;
44
45
  this._hasToCreateFieldSearch = true;
45
46
  this._breadcrumbItems = [];
46
47
  this._guides = undefined;
@@ -338,11 +339,17 @@ const SnkGuidesViewer = class {
338
339
  var _a;
339
340
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
340
341
  }
342
+ addFormLegacyConfigName() {
343
+ if (this.formLegacyConfigName) {
344
+ this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
345
+ }
346
+ }
341
347
  componentWillLoad() {
342
348
  if (this.resourceID == undefined) {
343
349
  throw new Error("Erro interno: resourceID não informado");
344
350
  }
345
351
  this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
352
+ this.addFormLegacyConfigName();
346
353
  this._configManager.loadConfig();
347
354
  }
348
355
  componentDidRender() {
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-75047f22.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-508bb6fe.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
- require('./SnkFormConfigManager-0ffd098d.js');
9
- require('./ConfigStorage-d4c99a5e.js');
8
+ require('./SnkFormConfigManager-6211fb28.js');
9
+ require('./ConfigStorage-34be11ce.js');
10
10
  require('./form-config-fetcher-9f1a13ca.js');
11
11
  require('./DataFetcher-99f0f6ed.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
8
- const ConfigStorage = require('./ConfigStorage-d4c99a5e.js');
8
+ const ConfigStorage = require('./ConfigStorage-34be11ce.js');
9
9
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
10
  const index$1 = require('./index-c5771aba.js');
11
11
  const index$2 = require('./index-102ba62d.js');
@@ -16,8 +16,8 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
16
  require('./filter-item-type.enum-a7ffdaa6.js');
17
17
  require('./form-config-fetcher-9f1a13ca.js');
18
18
  const fieldSearch = require('./field-search-f56aa7d6.js');
19
- const ConfigStorage = require('./ConfigStorage-d4c99a5e.js');
20
- const SnkFormConfigManager = require('./SnkFormConfigManager-0ffd098d.js');
19
+ const ConfigStorage = require('./ConfigStorage-34be11ce.js');
20
+ const SnkFormConfigManager = require('./SnkFormConfigManager-6211fb28.js');
21
21
  require('./index-102ba62d.js');
22
22
  require('./PrintUtils-bcaeb82f.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
@@ -67,6 +67,9 @@ const SnkSimpleCrud = class {
67
67
  this.actionsList = undefined;
68
68
  this.configName = undefined;
69
69
  this.showConfiguratorButtons = undefined;
70
+ this.gridLegacyConfigName = undefined;
71
+ this.formLegacyConfigName = undefined;
72
+ this.ignoreReadOnlyFormFields = false;
70
73
  }
71
74
  getButtons(selected, changeModeBtn) {
72
75
  return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
@@ -120,6 +123,44 @@ const SnkSimpleCrud = class {
120
123
  this.dataStateChange.emit(newValue);
121
124
  }
122
125
  }
126
+ async observeFormLegacy() {
127
+ await this.handleUpdateFormLegacyConfig();
128
+ }
129
+ async observeGridLegacy() {
130
+ await this.handleUpdateGridLegacyConfig();
131
+ }
132
+ async handleUpdateGridLegacyConfig() {
133
+ if (this.gridLegacyConfigName) {
134
+ this.addGridLegacyConfigName();
135
+ if (this._gridConfigAlreadyLoaded) {
136
+ await this.loadGridConfig(true);
137
+ }
138
+ }
139
+ }
140
+ async handleUpdateFormLegacyConfig() {
141
+ var _a, _b, _c;
142
+ if (this.formLegacyConfigName) {
143
+ const legacyConfig = await this.fetchFormLegacyConfig();
144
+ if (!legacyConfig)
145
+ return;
146
+ const rawFields = (_c = (_b = (_a = legacyConfig === null || legacyConfig === void 0 ? void 0 : legacyConfig.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
147
+ const fields = Array.isArray(rawFields) ? rawFields : [rawFields];
148
+ const newConfig = { emptyConfig: false, fields: fields };
149
+ this.setFormConfig(newConfig, true);
150
+ this._formConfigManager.setConfig(this.formConfig);
151
+ }
152
+ }
153
+ async fetchFormLegacyConfig() {
154
+ const payload = {
155
+ 'requestBody': {
156
+ 'config': {
157
+ 'chave': this.formLegacyConfigName,
158
+ 'tipo': 'T',
159
+ },
160
+ },
161
+ };
162
+ return await this.application.callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
163
+ }
123
164
  openConfig(viewMode) {
124
165
  this._snkConfigurator.close();
125
166
  if (viewMode === constants.VIEW_MODE.GRID) {
@@ -138,10 +179,18 @@ const SnkSimpleCrud = class {
138
179
  });
139
180
  }
140
181
  openFormConfig() {
182
+ //No momento não daremos suporte para configuraçao de formulário quando houver legacy config
183
+ if (this.formLegacyConfigName)
184
+ return;
141
185
  this._showFormConfig = true;
142
186
  }
143
- loadGridConfig() {
144
- if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
187
+ addGridLegacyConfigName() {
188
+ if (this.gridLegacyConfigName && this.configName) {
189
+ ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
190
+ }
191
+ }
192
+ loadGridConfig(forceUpdate) {
193
+ if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
145
194
  return;
146
195
  }
147
196
  this._gridConfigAlreadyLoaded = true;
@@ -176,6 +225,7 @@ const SnkSimpleCrud = class {
176
225
  if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
177
226
  return;
178
227
  }
228
+ await this.addGridLegacyConfigName();
179
229
  this.loadGridConfig();
180
230
  this.loadFormConfig();
181
231
  }
@@ -343,7 +393,9 @@ const SnkSimpleCrud = class {
343
393
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
344
394
  }
345
395
  handleFormSetFields(fields) {
346
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
396
+ if (!core.ObjectUtils.equals(this._formFields, fields)) {
397
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
398
+ }
347
399
  }
348
400
  fieldsOptionLoader(argument) {
349
401
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -433,7 +485,9 @@ const SnkSimpleCrud = class {
433
485
  this.gridConfig = config;
434
486
  SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
435
487
  }
436
- setFormConfig(config) {
488
+ setFormConfig(config, forceUpdate) {
489
+ if (this.formConfig && !forceUpdate)
490
+ return;
437
491
  this.formConfig = config;
438
492
  }
439
493
  closeGridConfig() {
@@ -442,22 +496,26 @@ const SnkSimpleCrud = class {
442
496
  closeFormConfig() {
443
497
  this._showFormConfig = false;
444
498
  }
499
+ //No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
500
+ handleShowFormConfig() {
501
+ return this._showFormConfig && !this.formLegacyConfigName;
502
+ }
445
503
  /* istanbul ignore next */
446
504
  render() {
447
- var _a;
505
+ var _a, _b, _c;
448
506
  if (this.dataUnit == undefined) {
449
507
  return;
450
508
  }
451
509
  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", 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", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
452
510
  ? undefined
453
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this._showFormConfig ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.formConfig,
454
- // config={this._formConfigManager?.getConfig(this.dataState?.insertionMode, this.dataUnit)}
455
- fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this._resourceID }))));
511
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_b = this._formConfigManager) === null || _b === void 0 ? void 0 : _b.getConfig(this.ignoreReadOnlyFormFields ? (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode : false, this.dataUnit), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this._resourceID }))));
456
512
  }
457
513
  get _element() { return index.getElement(this); }
458
514
  static get watchers() { return {
459
515
  "mode": ["onModeChange"],
460
- "dataState": ["observeDataState"]
516
+ "dataState": ["observeDataState"],
517
+ "formLegacyConfigName": ["observeFormLegacy"],
518
+ "gridLegacyConfigName": ["observeGridLegacy"]
461
519
  }; }
462
520
  };
463
521
  SnkSimpleCrud.style = snkSimpleCrudCss;
@@ -62,6 +62,10 @@ const SnkTaskbar = class {
62
62
  requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
63
63
  });
64
64
  }
65
+ observeDisabledButtons() {
66
+ var _a;
67
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
68
+ }
65
69
  // Internal methods
66
70
  elementsFromString(strButtons) {
67
71
  const elements = [];
@@ -360,7 +364,8 @@ const SnkTaskbar = class {
360
364
  }
361
365
  get _element() { return index.getElement(this); }
362
366
  static get watchers() { return {
363
- "buttons": ["observeButtons"]
367
+ "buttons": ["observeButtons"],
368
+ "disabledButtons": ["observeDisabledButtons"]
364
369
  }; }
365
370
  };
366
371
  SnkTaskbar.style = snkTaskbarCss;
@@ -3,7 +3,7 @@ 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";
5
5
  import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
6
- import { ConfigStorage } from "../../lib/configs/ConfigStorage";
6
+ import { ConfigStorage } from '../../lib/configs/ConfigStorage';
7
7
  import { DataFetcher } from "../../lib/http/data-fetcher/DataFetcher";
8
8
  import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
9
9
  import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher";
@@ -33,6 +33,8 @@ export class SnkApplication {
33
33
  this._isLoadedByPk = false;
34
34
  this.messagesBuilder = undefined;
35
35
  this.configName = undefined;
36
+ this.gridLegacyConfigName = undefined;
37
+ this.formLegacyConfigName = undefined;
36
38
  this.loadByPK = undefined;
37
39
  }
38
40
  async processPendingActions(actionsLocker) {
@@ -941,7 +943,11 @@ export class SnkApplication {
941
943
  ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
942
944
  this.registerPkChangeListener();
943
945
  ErrorTracking.init();
944
- ConfigStorage.preload(this.applicationResourceID, this.configName);
946
+ let legacyConfig = {
947
+ gridLegacyConfig: this.gridLegacyConfigName,
948
+ formLegacyConfig: this.formLegacyConfigName
949
+ };
950
+ ConfigStorage.preload(this.applicationResourceID, this.configName, legacyConfig);
945
951
  document.addEventListener("click", () => Workspace.applicationClick());
946
952
  this._waitingAppReady.forEach(resolve => resolve());
947
953
  }
@@ -1030,6 +1036,40 @@ export class SnkApplication {
1030
1036
  "attribute": "config-name",
1031
1037
  "reflect": false
1032
1038
  },
1039
+ "gridLegacyConfigName": {
1040
+ "type": "string",
1041
+ "mutable": false,
1042
+ "complexType": {
1043
+ "original": "string",
1044
+ "resolved": "string",
1045
+ "references": {}
1046
+ },
1047
+ "required": false,
1048
+ "optional": false,
1049
+ "docs": {
1050
+ "tags": [],
1051
+ "text": "Chave da configura\u00E7\u00E3o legado da grade."
1052
+ },
1053
+ "attribute": "grid-legacy-config-name",
1054
+ "reflect": false
1055
+ },
1056
+ "formLegacyConfigName": {
1057
+ "type": "string",
1058
+ "mutable": false,
1059
+ "complexType": {
1060
+ "original": "string",
1061
+ "resolved": "string",
1062
+ "references": {}
1063
+ },
1064
+ "required": false,
1065
+ "optional": false,
1066
+ "docs": {
1067
+ "tags": [],
1068
+ "text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
1069
+ },
1070
+ "attribute": "form-legacy-config-name",
1071
+ "reflect": false
1072
+ },
1033
1073
  "loadByPK": {
1034
1074
  "type": "unknown",
1035
1075
  "mutable": false,
@@ -31,6 +31,9 @@ export class SnkCrud {
31
31
  this.presentationMode = PresentationMode.PRIMARY;
32
32
  this.messagesBuilder = undefined;
33
33
  this.useEnterLikeTab = false;
34
+ this.gridLegacyConfigName = undefined;
35
+ this.filterBarLegacyConfigName = undefined;
36
+ this.formLegacyConfigName = undefined;
34
37
  this.disablePersonalizedFilter = undefined;
35
38
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
36
39
  }
@@ -282,7 +285,7 @@ export class SnkCrud {
282
285
  return;
283
286
  }
284
287
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
285
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter }, 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 }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
288
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
286
289
  }
287
290
  static get is() { return "snk-crud"; }
288
291
  static get encapsulation() { return "scoped"; }
@@ -536,6 +539,57 @@ export class SnkCrud {
536
539
  "reflect": false,
537
540
  "defaultValue": "false"
538
541
  },
542
+ "gridLegacyConfigName": {
543
+ "type": "string",
544
+ "mutable": false,
545
+ "complexType": {
546
+ "original": "string",
547
+ "resolved": "string",
548
+ "references": {}
549
+ },
550
+ "required": false,
551
+ "optional": false,
552
+ "docs": {
553
+ "tags": [],
554
+ "text": "Chave da configura\u00E7\u00E3o legado da grade."
555
+ },
556
+ "attribute": "grid-legacy-config-name",
557
+ "reflect": false
558
+ },
559
+ "filterBarLegacyConfigName": {
560
+ "type": "string",
561
+ "mutable": false,
562
+ "complexType": {
563
+ "original": "string",
564
+ "resolved": "string",
565
+ "references": {}
566
+ },
567
+ "required": false,
568
+ "optional": false,
569
+ "docs": {
570
+ "tags": [],
571
+ "text": "Chave da configura\u00E7\u00E3o legado da barra de filtros."
572
+ },
573
+ "attribute": "filter-bar-legacy-config-name",
574
+ "reflect": false
575
+ },
576
+ "formLegacyConfigName": {
577
+ "type": "string",
578
+ "mutable": false,
579
+ "complexType": {
580
+ "original": "string",
581
+ "resolved": "string",
582
+ "references": {}
583
+ },
584
+ "required": false,
585
+ "optional": false,
586
+ "docs": {
587
+ "tags": [],
588
+ "text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
589
+ },
590
+ "attribute": "form-legacy-config-name",
591
+ "reflect": false
592
+ },
539
593
  "disablePersonalizedFilter": {
540
594
  "type": "boolean",
541
595
  "mutable": false,
@@ -26,6 +26,7 @@ export class SnkGuidesViewer {
26
26
  this.presentationMode = undefined;
27
27
  this.resourceID = undefined;
28
28
  this.detailTaskbarCustomContainerId = undefined;
29
+ this.formLegacyConfigName = undefined;
29
30
  this._hasToCreateFieldSearch = true;
30
31
  this._breadcrumbItems = [];
31
32
  this._guides = undefined;
@@ -323,11 +324,17 @@ export class SnkGuidesViewer {
323
324
  var _a;
324
325
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
325
326
  }
327
+ addFormLegacyConfigName() {
328
+ if (this.formLegacyConfigName) {
329
+ this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
330
+ }
331
+ }
326
332
  componentWillLoad() {
327
333
  if (this.resourceID == undefined) {
328
334
  throw new Error("Erro interno: resourceID não informado");
329
335
  }
330
336
  this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
337
+ this.addFormLegacyConfigName();
331
338
  this._configManager.loadConfig();
332
339
  }
333
340
  componentDidRender() {
@@ -740,6 +747,23 @@ export class SnkGuidesViewer {
740
747
  },
741
748
  "attribute": "detail-taskbar-custom-container-id",
742
749
  "reflect": false
750
+ },
751
+ "formLegacyConfigName": {
752
+ "type": "string",
753
+ "mutable": false,
754
+ "complexType": {
755
+ "original": "string",
756
+ "resolved": "string",
757
+ "references": {}
758
+ },
759
+ "required": false,
760
+ "optional": false,
761
+ "docs": {
762
+ "tags": [],
763
+ "text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
764
+ },
765
+ "attribute": "form-legacy-config-name",
766
+ "reflect": false
743
767
  }
744
768
  };
745
769
  }
@@ -35,6 +35,7 @@ export class SnkFilterBar {
35
35
  this.filterConfig = undefined;
36
36
  this.messagesBuilder = undefined;
37
37
  this.disablePersonalizedFilter = undefined;
38
+ this.filterBarLegacyConfigName = undefined;
38
39
  this.allowDefault = undefined;
39
40
  this.scrollerLocked = false;
40
41
  this.showPersonalizedFilter = false;
@@ -303,6 +304,11 @@ export class SnkFilterBar {
303
304
  loadPermitions() {
304
305
  this._application.isUserSup().then(value => this.allowDefault = value);
305
306
  }
307
+ addFilterBarLegacyConfigName() {
308
+ if (this.filterBarLegacyConfigName && this.configName) {
309
+ ConfigStorage.addFilterBarLegacyConfig(this.configName, this.filterBarLegacyConfigName);
310
+ }
311
+ }
306
312
  async loadConfigFromStorage(clearCache) {
307
313
  if (clearCache) {
308
314
  await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
@@ -409,6 +415,7 @@ export class SnkFilterBar {
409
415
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
410
416
  if (this._application) {
411
417
  this.loadPermitions();
418
+ this.addFilterBarLegacyConfigName();
412
419
  this.loadConfigFromStorage();
413
420
  }
414
421
  this.attachDataUnit();
@@ -589,6 +596,23 @@ export class SnkFilterBar {
589
596
  },
590
597
  "attribute": "disable-personalized-filter",
591
598
  "reflect": false
599
+ },
600
+ "filterBarLegacyConfigName": {
601
+ "type": "string",
602
+ "mutable": false,
603
+ "complexType": {
604
+ "original": "string",
605
+ "resolved": "string",
606
+ "references": {}
607
+ },
608
+ "required": false,
609
+ "optional": false,
610
+ "docs": {
611
+ "tags": [],
612
+ "text": "Chave da configura\u00E7\u00E3o legado da barra de filtros."
613
+ },
614
+ "attribute": "filter-bar-legacy-config-name",
615
+ "reflect": false
592
616
  }
593
617
  };
594
618
  }
@@ -11,6 +11,7 @@ export class SnkForm {
11
11
  this.configName = undefined;
12
12
  this.recordsValidator = undefined;
13
13
  this.messagesBuilder = undefined;
14
+ this.formLegacyConfigName = undefined;
14
15
  this.resourceID = undefined;
15
16
  }
16
17
  /**
@@ -58,8 +59,14 @@ export class SnkForm {
58
59
  this.resourceID = await ResourceIDUtils.getResourceID();
59
60
  }
60
61
  this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
62
+ this.addFormLegacyConfig();
61
63
  this._configManager.loadConfig();
62
64
  }
65
+ addFormLegacyConfig() {
66
+ if (this.formLegacyConfigName) {
67
+ this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
68
+ }
69
+ }
63
70
  render() {
64
71
  if (!this._dataUnit || !this._dataState) {
65
72
  return undefined;
@@ -138,6 +145,23 @@ export class SnkForm {
138
145
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
139
146
  }
140
147
  },
148
+ "formLegacyConfigName": {
149
+ "type": "string",
150
+ "mutable": false,
151
+ "complexType": {
152
+ "original": "string",
153
+ "resolved": "string",
154
+ "references": {}
155
+ },
156
+ "required": false,
157
+ "optional": false,
158
+ "docs": {
159
+ "tags": [],
160
+ "text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
161
+ },
162
+ "attribute": "form-legacy-config-name",
163
+ "reflect": false
164
+ },
141
165
  "resourceID": {
142
166
  "type": "string",
143
167
  "mutable": false,
@@ -1,4 +1,4 @@
1
- import { ConfigStorage } from "../../lib/configs/ConfigStorage";
1
+ import { ConfigStorage } from '../../lib/configs/ConfigStorage';
2
2
  import { ObjectUtils, StringUtils } from "@sankhyalabs/core";
3
3
  import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
4
4
  export class SnkFormConfigManager {
@@ -7,6 +7,11 @@ export class SnkFormConfigManager {
7
7
  this._configName = configName;
8
8
  this._onConfigChange = onConfigChange;
9
9
  }
10
+ addFormLegacyConfig(legacyConfigName) {
11
+ if (this._configName) {
12
+ ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
13
+ }
14
+ }
10
15
  async loadConfig() {
11
16
  return new Promise(resolve => {
12
17
  ConfigStorage.loadFormConfig(this._configName, this._resourceID)