@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-48570.0 → 0.0.0-bugfix-dev-KB-49747.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.
- 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/{SnkMultiSelectionListDataSource-5213120b.js → SnkMultiSelectionListDataSource-cae896f4.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-94f6b316.js → pesquisa-fetcher-16e4be85.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +9 -3
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +5 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
- 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 +13 -4
- package/dist/cjs/{snk-guides-viewer-75047f22.js → snk-guides-viewer-09ef0a84.js} +9 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +70 -13
- package/dist/cjs/snk-taskbar.cjs.entry.js +6 -1
- 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/snk-simple-crud.js +103 -8
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +7 -0
- 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/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -1
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/SnkFormConfigManager.js +5 -0
- package/dist/components/dataunit-fetcher.js +1 -1
- 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 -9
- package/dist/components/snk-taskbar2.js +6 -1
- 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/{SnkMultiSelectionListDataSource-7e7eada5.js → SnkMultiSelectionListDataSource-79774916.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-f05a12ca.js → pesquisa-fetcher-74b97d1c.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +2 -2
- package/dist/esm/snk-application.entry.js +9 -3
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +5 -2
- package/dist/esm/snk-detail-view.entry.js +4 -4
- 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 +13 -4
- package/dist/esm/{snk-guides-viewer-8b679ee6.js → snk-guides-viewer-b8147267.js} +9 -2
- package/dist/esm/snk-guides-viewer.entry.js +4 -4
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +70 -13
- package/dist/esm/snk-taskbar.entry.js +6 -1
- package/dist/sankhyablocks/{p-ba4871b5.entry.js → p-1ba55dd0.entry.js} +1 -1
- package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
- package/dist/sankhyablocks/{p-2897fb8c.js → p-1fca250b.js} +1 -1
- package/dist/sankhyablocks/{p-9fb97691.entry.js → p-324842c9.entry.js} +1 -1
- package/dist/sankhyablocks/p-360fc431.entry.js +1 -0
- package/dist/sankhyablocks/p-4b7ecfa7.entry.js +11 -0
- package/dist/sankhyablocks/p-5c0b53ce.js +56 -0
- package/dist/sankhyablocks/p-60fa6c7a.js +1 -0
- package/dist/sankhyablocks/p-64c1b368.entry.js +1 -0
- package/dist/sankhyablocks/p-6ae25c2c.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-d78d4062.js → p-8eb454fc.js} +3 -3
- package/dist/sankhyablocks/p-9baa835f.entry.js +1 -0
- package/dist/sankhyablocks/{p-d0bc5ef3.entry.js → p-a9c8085c.entry.js} +1 -1
- package/dist/sankhyablocks/p-d304659d.entry.js +1 -0
- package/dist/sankhyablocks/p-eaac4cf1.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1c630fb.entry.js → p-eb34f712.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/snk-simple-crud.d.ts +15 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- 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-230f5148.entry.js +0 -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-61da4a55.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
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-6211fb28.js');
|
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
|
-
require('./ConfigStorage-
|
|
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');
|
|
@@ -28,6 +28,7 @@ const SnkForm = class {
|
|
|
28
28
|
this.configName = undefined;
|
|
29
29
|
this.recordsValidator = undefined;
|
|
30
30
|
this.messagesBuilder = undefined;
|
|
31
|
+
this.formLegacyConfigName = undefined;
|
|
31
32
|
this.resourceID = undefined;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
@@ -75,8 +76,14 @@ const SnkForm = class {
|
|
|
75
76
|
this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
|
|
76
77
|
}
|
|
77
78
|
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID);
|
|
79
|
+
this.addFormLegacyConfig();
|
|
78
80
|
this._configManager.loadConfig();
|
|
79
81
|
}
|
|
82
|
+
addFormLegacyConfig() {
|
|
83
|
+
if (this.formLegacyConfigName) {
|
|
84
|
+
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
80
87
|
render() {
|
|
81
88
|
if (!this._dataUnit || !this._dataState) {
|
|
82
89
|
return undefined;
|
|
@@ -6,14 +6,14 @@ 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');
|
|
13
|
-
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-
|
|
13
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-cae896f4.js');
|
|
14
14
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
15
15
|
require('./DataFetcher-99f0f6ed.js');
|
|
16
|
-
require('./pesquisa-fetcher-
|
|
16
|
+
require('./pesquisa-fetcher-16e4be85.js');
|
|
17
17
|
require('./ISave-e91b70a7.js');
|
|
18
18
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
19
19
|
require('./filter-item-type.enum-a7ffdaa6.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,13 +2,13 @@
|
|
|
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');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
10
|
require('./DataFetcher-99f0f6ed.js');
|
|
11
|
-
require('./pesquisa-fetcher-
|
|
11
|
+
require('./pesquisa-fetcher-16e4be85.js');
|
|
12
12
|
const index$1 = require('./index-0922807b.js');
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
@@ -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-09ef0a84.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');
|
|
@@ -18,7 +18,7 @@ require('./taskbar-elements-3ecd1278.js');
|
|
|
18
18
|
require('./index-0922807b.js');
|
|
19
19
|
require('./index-102ba62d.js');
|
|
20
20
|
require('./constants-35ddd366.js');
|
|
21
|
-
require('./pesquisa-fetcher-
|
|
21
|
+
require('./pesquisa-fetcher-16e4be85.js');
|
|
22
22
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
24
24
|
require('./ResourceIDUtils-5ff86aa7.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');
|
|
@@ -7,8 +7,8 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const constants = require('./constants-35ddd366.js');
|
|
8
8
|
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
9
9
|
require('./DataFetcher-99f0f6ed.js');
|
|
10
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
|
11
|
-
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-
|
|
10
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-16e4be85.js');
|
|
11
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-cae896f4.js');
|
|
12
12
|
const index$1 = require('./index-0922807b.js');
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
@@ -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-
|
|
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');
|
|
@@ -67,6 +67,8 @@ 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;
|
|
70
72
|
}
|
|
71
73
|
getButtons(selected, changeModeBtn) {
|
|
72
74
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
@@ -120,6 +122,44 @@ const SnkSimpleCrud = class {
|
|
|
120
122
|
this.dataStateChange.emit(newValue);
|
|
121
123
|
}
|
|
122
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
|
+
}
|
|
123
163
|
openConfig(viewMode) {
|
|
124
164
|
this._snkConfigurator.close();
|
|
125
165
|
if (viewMode === constants.VIEW_MODE.GRID) {
|
|
@@ -138,10 +178,18 @@ const SnkSimpleCrud = class {
|
|
|
138
178
|
});
|
|
139
179
|
}
|
|
140
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;
|
|
141
184
|
this._showFormConfig = true;
|
|
142
185
|
}
|
|
143
|
-
|
|
144
|
-
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) {
|
|
145
193
|
return;
|
|
146
194
|
}
|
|
147
195
|
this._gridConfigAlreadyLoaded = true;
|
|
@@ -176,6 +224,7 @@ const SnkSimpleCrud = class {
|
|
|
176
224
|
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
|
177
225
|
return;
|
|
178
226
|
}
|
|
227
|
+
await this.addGridLegacyConfigName();
|
|
179
228
|
this.loadGridConfig();
|
|
180
229
|
this.loadFormConfig();
|
|
181
230
|
}
|
|
@@ -343,7 +392,9 @@ const SnkSimpleCrud = class {
|
|
|
343
392
|
return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
|
|
344
393
|
}
|
|
345
394
|
handleFormSetFields(fields) {
|
|
346
|
-
this._formFields
|
|
395
|
+
if (!core.ObjectUtils.equals(this._formFields, fields)) {
|
|
396
|
+
this._formFields = fields !== null && fields !== void 0 ? fields : [];
|
|
397
|
+
}
|
|
347
398
|
}
|
|
348
399
|
fieldsOptionLoader(argument) {
|
|
349
400
|
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
|
@@ -433,7 +484,9 @@ const SnkSimpleCrud = class {
|
|
|
433
484
|
this.gridConfig = config;
|
|
434
485
|
SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
|
435
486
|
}
|
|
436
|
-
setFormConfig(config) {
|
|
487
|
+
setFormConfig(config, forceUpdate) {
|
|
488
|
+
if (this.formConfig && !forceUpdate)
|
|
489
|
+
return;
|
|
437
490
|
this.formConfig = config;
|
|
438
491
|
}
|
|
439
492
|
closeGridConfig() {
|
|
@@ -442,22 +495,26 @@ const SnkSimpleCrud = class {
|
|
|
442
495
|
closeFormConfig() {
|
|
443
496
|
this._showFormConfig = false;
|
|
444
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
|
+
}
|
|
445
502
|
/* istanbul ignore next */
|
|
446
503
|
render() {
|
|
447
|
-
var _a;
|
|
504
|
+
var _a, _b, _c;
|
|
448
505
|
if (this.dataUnit == undefined) {
|
|
449
506
|
return;
|
|
450
507
|
}
|
|
451
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)
|
|
452
509
|
? 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.
|
|
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 }))));
|
|
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 }))));
|
|
456
511
|
}
|
|
457
512
|
get _element() { return index.getElement(this); }
|
|
458
513
|
static get watchers() { return {
|
|
459
514
|
"mode": ["onModeChange"],
|
|
460
|
-
"dataState": ["observeDataState"]
|
|
515
|
+
"dataState": ["observeDataState"],
|
|
516
|
+
"formLegacyConfigName": ["observeFormLegacy"],
|
|
517
|
+
"gridLegacyConfigName": ["observeGridLegacy"]
|
|
461
518
|
}; }
|
|
462
519
|
};
|
|
463
520
|
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
|
|
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
|
}
|