@sankhyalabs/sankhyablocks 8.15.0-dev.35 → 8.15.0-dev.37
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.
- package/dist/cjs/{ConfigStorage-d4c99a5e.js → ConfigStorage-34be11ce.js} +68 -5
- package/dist/cjs/{SnkFormConfigManager-0ffd098d.js → SnkFormConfigManager-6211fb28.js} +6 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +8 -2
- package/dist/cjs/snk-crud.cjs.entry.js +4 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +8 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +9 -2
- package/dist/cjs/snk-grid.cjs.entry.js +11 -2
- package/dist/cjs/{snk-guides-viewer-75047f22.js → snk-guides-viewer-508bb6fe.js} +8 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +68 -10
- package/dist/collection/components/snk-application/snk-application.js +42 -2
- package/dist/collection/components/snk-crud/snk-crud.js +55 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +24 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +24 -0
- package/dist/collection/components/snk-form/snk-form.js +24 -0
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -1
- package/dist/collection/components/snk-grid/snk-grid.js +44 -1
- package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +101 -7
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/SnkFormConfigManager.js +5 -0
- package/dist/components/snk-application2.js +9 -1
- package/dist/components/snk-crud.js +7 -1
- package/dist/components/snk-detail-view2.js +8 -0
- package/dist/components/snk-filter-bar2.js +8 -0
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid2.js +12 -1
- package/dist/components/snk-simple-crud2.js +68 -8
- package/dist/esm/{ConfigStorage-39ed8aeb.js → ConfigStorage-101a2b4c.js} +68 -5
- package/dist/esm/{SnkFormConfigManager-dd450734.js → SnkFormConfigManager-d86ba46f.js} +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +8 -2
- package/dist/esm/snk-crud.entry.js +4 -1
- package/dist/esm/snk-detail-view.entry.js +3 -3
- package/dist/esm/snk-filter-bar.entry.js +8 -1
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +9 -2
- package/dist/esm/snk-grid.entry.js +11 -2
- package/dist/esm/{snk-guides-viewer-8b679ee6.js → snk-guides-viewer-18859840.js} +8 -1
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +68 -10
- package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
- package/dist/sankhyablocks/p-1fa5a18c.entry.js +11 -0
- package/dist/sankhyablocks/p-2b909f08.entry.js +1 -0
- package/dist/sankhyablocks/p-5c0b53ce.js +56 -0
- package/dist/sankhyablocks/p-5dbc1a3f.js +1 -0
- package/dist/sankhyablocks/p-60fa6c7a.js +1 -0
- package/dist/sankhyablocks/p-64c1b368.entry.js +1 -0
- package/dist/sankhyablocks/p-650f7216.entry.js +1 -0
- package/dist/sankhyablocks/{p-9d608b62.entry.js → p-6b28cc74.entry.js} +1 -1
- package/dist/sankhyablocks/{p-827e4b01.entry.js → p-7ddd95b6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9fb97691.entry.js → p-b41a622a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d0bc5ef3.entry.js → p-b4de81ac.entry.js} +1 -1
- package/dist/sankhyablocks/p-d01ceda6.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1c630fb.entry.js → p-e4fb3308.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +8 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
- package/dist/types/components/snk-form/snk-form.d.ts +5 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +9 -0
- package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +15 -2
- package/dist/types/components.d.ts +96 -0
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
- package/dist/sankhyablocks/p-4b0c5921.entry.js +0 -1
- package/dist/sankhyablocks/p-5eaecd30.entry.js +0 -1
- package/dist/sankhyablocks/p-67aedbe0.js +0 -56
- package/dist/sankhyablocks/p-746fc99e.entry.js +0 -1
- package/dist/sankhyablocks/p-8a00836e.js +0 -1
- package/dist/sankhyablocks/p-9ea14b61.js +0 -1
- package/dist/sankhyablocks/p-c4bcdd4b.entry.js +0 -11
- package/dist/sankhyablocks/p-f0177ee1.entry.js +0 -1
@@ -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-
|
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-
|
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-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-508bb6fe.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
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-
|
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,14 +16,17 @@ 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-
|
20
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
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');
|
24
24
|
require('./ResourceIDUtils-5ff86aa7.js');
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
26
26
|
|
27
|
+
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
28
|
+
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
29
|
+
|
27
30
|
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
|
28
31
|
|
29
32
|
const SnkSimpleCrud = class {
|
@@ -35,8 +38,6 @@ const SnkSimpleCrud = class {
|
|
35
38
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
36
39
|
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
37
40
|
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
38
|
-
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
39
|
-
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
40
41
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
41
42
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
42
43
|
this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
|
@@ -66,9 +67,11 @@ const SnkSimpleCrud = class {
|
|
66
67
|
this.actionsList = undefined;
|
67
68
|
this.configName = undefined;
|
68
69
|
this.showConfiguratorButtons = undefined;
|
70
|
+
this.gridLegacyConfigName = undefined;
|
71
|
+
this.formLegacyConfigName = undefined;
|
69
72
|
}
|
70
73
|
getButtons(selected, changeModeBtn) {
|
71
|
-
return this.addConfigButton(this.resolveInMemoryBtns(selected ?
|
74
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
72
75
|
.concat(changeModeBtn));
|
73
76
|
}
|
74
77
|
addConfigButton(buttons) {
|
@@ -119,6 +122,44 @@ const SnkSimpleCrud = class {
|
|
119
122
|
this.dataStateChange.emit(newValue);
|
120
123
|
}
|
121
124
|
}
|
125
|
+
async observeFormLegacy() {
|
126
|
+
await this.handleUpdateFormLegacyConfig();
|
127
|
+
}
|
128
|
+
async observeGridLegacy() {
|
129
|
+
await this.handleUpdateGridLegacyConfig();
|
130
|
+
}
|
131
|
+
async handleUpdateGridLegacyConfig() {
|
132
|
+
if (this.gridLegacyConfigName) {
|
133
|
+
this.addGridLegacyConfigName();
|
134
|
+
if (this._gridConfigAlreadyLoaded) {
|
135
|
+
await this.loadGridConfig(true);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
async handleUpdateFormLegacyConfig() {
|
140
|
+
var _a, _b, _c;
|
141
|
+
if (this.formLegacyConfigName) {
|
142
|
+
const legacyConfig = await this.fetchFormLegacyConfig();
|
143
|
+
if (!legacyConfig)
|
144
|
+
return;
|
145
|
+
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 : [];
|
146
|
+
const fields = Array.isArray(rawFields) ? rawFields : [rawFields];
|
147
|
+
const newConfig = { emptyConfig: false, fields: fields };
|
148
|
+
this.setFormConfig(newConfig, true);
|
149
|
+
this._formConfigManager.setConfig(this.formConfig);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
async fetchFormLegacyConfig() {
|
153
|
+
const payload = {
|
154
|
+
'requestBody': {
|
155
|
+
'config': {
|
156
|
+
'chave': this.formLegacyConfigName,
|
157
|
+
'tipo': 'T',
|
158
|
+
},
|
159
|
+
},
|
160
|
+
};
|
161
|
+
return await this.application.callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
|
162
|
+
}
|
122
163
|
openConfig(viewMode) {
|
123
164
|
this._snkConfigurator.close();
|
124
165
|
if (viewMode === constants.VIEW_MODE.GRID) {
|
@@ -137,10 +178,18 @@ const SnkSimpleCrud = class {
|
|
137
178
|
});
|
138
179
|
}
|
139
180
|
openFormConfig() {
|
181
|
+
//No momento não daremos suporte para configuraçao de formulário quando houver legacy config
|
182
|
+
if (this.formLegacyConfigName)
|
183
|
+
return;
|
140
184
|
this._showFormConfig = true;
|
141
185
|
}
|
142
|
-
|
143
|
-
if (this.
|
186
|
+
addGridLegacyConfigName() {
|
187
|
+
if (this.gridLegacyConfigName && this.configName) {
|
188
|
+
ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
loadGridConfig(forceUpdate) {
|
192
|
+
if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
|
144
193
|
return;
|
145
194
|
}
|
146
195
|
this._gridConfigAlreadyLoaded = true;
|
@@ -175,6 +224,7 @@ const SnkSimpleCrud = class {
|
|
175
224
|
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
176
225
|
return;
|
177
226
|
}
|
227
|
+
await this.addGridLegacyConfigName();
|
178
228
|
this.loadGridConfig();
|
179
229
|
this.loadFormConfig();
|
180
230
|
}
|
@@ -434,7 +484,9 @@ const SnkSimpleCrud = class {
|
|
434
484
|
this.gridConfig = config;
|
435
485
|
SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
436
486
|
}
|
437
|
-
setFormConfig(config) {
|
487
|
+
setFormConfig(config, forceUpdate) {
|
488
|
+
if (this.formConfig && !forceUpdate)
|
489
|
+
return;
|
438
490
|
this.formConfig = config;
|
439
491
|
}
|
440
492
|
closeGridConfig() {
|
@@ -443,6 +495,10 @@ const SnkSimpleCrud = class {
|
|
443
495
|
closeFormConfig() {
|
444
496
|
this._showFormConfig = false;
|
445
497
|
}
|
498
|
+
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
499
|
+
handleShowFormConfig() {
|
500
|
+
return this._showFormConfig && !this.formLegacyConfigName;
|
501
|
+
}
|
446
502
|
/* istanbul ignore next */
|
447
503
|
render() {
|
448
504
|
var _a, _b, _c;
|
@@ -451,12 +507,14 @@ const SnkSimpleCrud = class {
|
|
451
507
|
}
|
452
508
|
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)
|
453
509
|
? undefined
|
454
|
-
: 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.
|
510
|
+
: 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((_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode, 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 }))));
|
455
511
|
}
|
456
512
|
get _element() { return index.getElement(this); }
|
457
513
|
static get watchers() { return {
|
458
514
|
"mode": ["onModeChange"],
|
459
|
-
"dataState": ["observeDataState"]
|
515
|
+
"dataState": ["observeDataState"],
|
516
|
+
"formLegacyConfigName": ["observeFormLegacy"],
|
517
|
+
"gridLegacyConfigName": ["observeGridLegacy"]
|
460
518
|
}; }
|
461
519
|
};
|
462
520
|
SnkSimpleCrud.style = snkSimpleCrudCss;
|
@@ -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
|
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
|
-
|
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
|
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)
|