@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-48463.1 → 0.0.0-bugfix-dev-KB-49699.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-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 +12 -3
- package/dist/cjs/{snk-guides-viewer-c7293cfa.js → snk-guides-viewer-508bb6fe.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 -11
- package/dist/cjs/snk-taskbar.cjs.entry.js +12 -10
- package/dist/cjs/{taskbar-elements-1e4fb2e0.js → taskbar-elements-3ecd1278.js} +1 -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/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +120 -7
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +1 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +12 -8
- 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 +70 -8
- package/dist/components/snk-taskbar2.js +12 -10
- 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-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 +12 -3
- package/dist/esm/{snk-guides-viewer-47443f7c.js → snk-guides-viewer-18859840.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 -11
- package/dist/esm/snk-taskbar.entry.js +12 -10
- package/dist/esm/{taskbar-elements-846c027c.js → taskbar-elements-2473c8ac.js} +1 -1
- package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
- package/dist/sankhyablocks/p-1fa5a18c.entry.js +11 -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-ae4fc9a9.js +1 -0
- package/dist/sankhyablocks/{p-9fb97691.entry.js → p-b41a622a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0c9dd95e.entry.js → p-b4de81ac.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3c5b7cfc.entry.js → p-ba4871b5.entry.js} +1 -1
- package/dist/sankhyablocks/p-d01ceda6.entry.js +1 -0
- package/dist/sankhyablocks/p-d304659d.entry.js +1 -0
- package/dist/sankhyablocks/{p-99b1926b.entry.js → p-e4fb3308.entry.js} +1 -1
- package/dist/sankhyablocks/p-fbfab20b.entry.js +1 -0
- 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 +19 -2
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +104 -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-30735d1e.entry.js +0 -1
- package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
- package/dist/sankhyablocks/p-67aedbe0.js +0 -56
- package/dist/sankhyablocks/p-6ae58da0.js +0 -1
- package/dist/sankhyablocks/p-746fc99e.entry.js +0 -1
- package/dist/sankhyablocks/p-8c13d8d6.entry.js +0 -1
- package/dist/sankhyablocks/p-8c49760e.js +0 -1
- package/dist/sankhyablocks/p-9ea14b61.js +0 -1
- package/dist/sankhyablocks/p-c4bcdd4b.entry.js +0 -11
- package/dist/sankhyablocks/p-fca66dda.entry.js +0 -1
- package/dist/sankhyablocks/p-fd216f2e.entry.js +0 -1
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
9
|
+
const ConfigStorage = require('./ConfigStorage-34be11ce.js');
|
|
10
10
|
const index$1 = require('./index-0922807b.js');
|
|
11
11
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
12
12
|
const index$2 = require('./index-102ba62d.js');
|
|
@@ -73,6 +73,8 @@ const SnkGrid = class {
|
|
|
73
73
|
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
|
74
74
|
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
|
75
75
|
this.disablePersonalizedFilter = undefined;
|
|
76
|
+
this.gridLegacyConfigName = undefined;
|
|
77
|
+
this.filterBarLegacyConfigName = undefined;
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
78
80
|
* Exibe a janela de configurações da grade.
|
|
@@ -141,6 +143,11 @@ const SnkGrid = class {
|
|
|
141
143
|
console.warn(error);
|
|
142
144
|
});
|
|
143
145
|
}
|
|
146
|
+
addGridLegacyConfigName() {
|
|
147
|
+
if (this.gridLegacyConfigName && this.configName) {
|
|
148
|
+
ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
144
151
|
gridConfigChangeHandler(evt) {
|
|
145
152
|
const config = evt.detail;
|
|
146
153
|
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
|
@@ -265,6 +272,7 @@ const SnkGrid = class {
|
|
|
265
272
|
}
|
|
266
273
|
componentWillLoad() {
|
|
267
274
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
275
|
+
//TODO: substituir pelo metodo nativo closest
|
|
268
276
|
let parent = this._element.parentElement;
|
|
269
277
|
while (parent) {
|
|
270
278
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
@@ -294,6 +302,7 @@ const SnkGrid = class {
|
|
|
294
302
|
}
|
|
295
303
|
parent = parent.parentElement;
|
|
296
304
|
}
|
|
305
|
+
this.addGridLegacyConfigName();
|
|
297
306
|
this.loadConfig();
|
|
298
307
|
}
|
|
299
308
|
getHeaderDisabledButtons() {
|
|
@@ -408,7 +417,7 @@ const SnkGrid = class {
|
|
|
408
417
|
return undefined;
|
|
409
418
|
}
|
|
410
419
|
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
411
|
-
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
420
|
+
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
412
421
|
}
|
|
413
422
|
get _element() { return index.getElement(this); }
|
|
414
423
|
};
|
|
@@ -2,10 +2,10 @@
|
|
|
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
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
10
|
require('./DataFetcher-99f0f6ed.js');
|
|
11
11
|
require('./pesquisa-fetcher-94f6b316.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');
|
|
@@ -14,7 +14,7 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
16
16
|
require('./field-search-f56aa7d6.js');
|
|
17
|
-
require('./taskbar-elements-
|
|
17
|
+
require('./taskbar-elements-3ecd1278.js');
|
|
18
18
|
require('./index-0922807b.js');
|
|
19
19
|
require('./index-102ba62d.js');
|
|
20
20
|
require('./constants-35ddd366.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');
|
|
@@ -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 constants = require('./constants-35ddd366.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
9
9
|
require('./DataFetcher-99f0f6ed.js');
|
|
10
10
|
const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
|
|
11
11
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-5213120b.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,12 @@ 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;
|
|
72
|
+
this.ignoreReadOnlyFormFields = false;
|
|
69
73
|
}
|
|
70
74
|
getButtons(selected, changeModeBtn) {
|
|
71
|
-
return this.addConfigButton(this.resolveInMemoryBtns(selected ?
|
|
75
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
72
76
|
.concat(changeModeBtn));
|
|
73
77
|
}
|
|
74
78
|
addConfigButton(buttons) {
|
|
@@ -119,6 +123,44 @@ const SnkSimpleCrud = class {
|
|
|
119
123
|
this.dataStateChange.emit(newValue);
|
|
120
124
|
}
|
|
121
125
|
}
|
|
126
|
+
async observeFormLegacy() {
|
|
127
|
+
await this.handleUpdateFormLegacyConfig();
|
|
128
|
+
}
|
|
129
|
+
async observeGridLegacy() {
|
|
130
|
+
await this.handleUpdateGridLegacyConfig();
|
|
131
|
+
}
|
|
132
|
+
async handleUpdateGridLegacyConfig() {
|
|
133
|
+
if (this.gridLegacyConfigName) {
|
|
134
|
+
this.addGridLegacyConfigName();
|
|
135
|
+
if (this._gridConfigAlreadyLoaded) {
|
|
136
|
+
await this.loadGridConfig(true);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async handleUpdateFormLegacyConfig() {
|
|
141
|
+
var _a, _b, _c;
|
|
142
|
+
if (this.formLegacyConfigName) {
|
|
143
|
+
const legacyConfig = await this.fetchFormLegacyConfig();
|
|
144
|
+
if (!legacyConfig)
|
|
145
|
+
return;
|
|
146
|
+
const rawFields = (_c = (_b = (_a = legacyConfig === null || legacyConfig === void 0 ? void 0 : legacyConfig.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
|
|
147
|
+
const fields = Array.isArray(rawFields) ? rawFields : [rawFields];
|
|
148
|
+
const newConfig = { emptyConfig: false, fields: fields };
|
|
149
|
+
this.setFormConfig(newConfig, true);
|
|
150
|
+
this._formConfigManager.setConfig(this.formConfig);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async fetchFormLegacyConfig() {
|
|
154
|
+
const payload = {
|
|
155
|
+
'requestBody': {
|
|
156
|
+
'config': {
|
|
157
|
+
'chave': this.formLegacyConfigName,
|
|
158
|
+
'tipo': 'T',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
return await this.application.callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
|
|
163
|
+
}
|
|
122
164
|
openConfig(viewMode) {
|
|
123
165
|
this._snkConfigurator.close();
|
|
124
166
|
if (viewMode === constants.VIEW_MODE.GRID) {
|
|
@@ -137,10 +179,18 @@ const SnkSimpleCrud = class {
|
|
|
137
179
|
});
|
|
138
180
|
}
|
|
139
181
|
openFormConfig() {
|
|
182
|
+
//No momento não daremos suporte para configuraçao de formulário quando houver legacy config
|
|
183
|
+
if (this.formLegacyConfigName)
|
|
184
|
+
return;
|
|
140
185
|
this._showFormConfig = true;
|
|
141
186
|
}
|
|
142
|
-
|
|
143
|
-
if (this.
|
|
187
|
+
addGridLegacyConfigName() {
|
|
188
|
+
if (this.gridLegacyConfigName && this.configName) {
|
|
189
|
+
ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
loadGridConfig(forceUpdate) {
|
|
193
|
+
if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
|
|
144
194
|
return;
|
|
145
195
|
}
|
|
146
196
|
this._gridConfigAlreadyLoaded = true;
|
|
@@ -175,6 +225,7 @@ const SnkSimpleCrud = class {
|
|
|
175
225
|
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
|
176
226
|
return;
|
|
177
227
|
}
|
|
228
|
+
await this.addGridLegacyConfigName();
|
|
178
229
|
this.loadGridConfig();
|
|
179
230
|
this.loadFormConfig();
|
|
180
231
|
}
|
|
@@ -434,7 +485,9 @@ const SnkSimpleCrud = class {
|
|
|
434
485
|
this.gridConfig = config;
|
|
435
486
|
SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
|
436
487
|
}
|
|
437
|
-
setFormConfig(config) {
|
|
488
|
+
setFormConfig(config, forceUpdate) {
|
|
489
|
+
if (this.formConfig && !forceUpdate)
|
|
490
|
+
return;
|
|
438
491
|
this.formConfig = config;
|
|
439
492
|
}
|
|
440
493
|
closeGridConfig() {
|
|
@@ -443,6 +496,10 @@ const SnkSimpleCrud = class {
|
|
|
443
496
|
closeFormConfig() {
|
|
444
497
|
this._showFormConfig = false;
|
|
445
498
|
}
|
|
499
|
+
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
|
500
|
+
handleShowFormConfig() {
|
|
501
|
+
return this._showFormConfig && !this.formLegacyConfigName;
|
|
502
|
+
}
|
|
446
503
|
/* istanbul ignore next */
|
|
447
504
|
render() {
|
|
448
505
|
var _a, _b, _c;
|
|
@@ -451,12 +508,14 @@ const SnkSimpleCrud = class {
|
|
|
451
508
|
}
|
|
452
509
|
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
453
510
|
? 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.
|
|
511
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_b = this._formConfigManager) === null || _b === void 0 ? void 0 : _b.getConfig(this.ignoreReadOnlyFormFields ? (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode : false, this.dataUnit), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this._resourceID }))));
|
|
455
512
|
}
|
|
456
513
|
get _element() { return index.getElement(this); }
|
|
457
514
|
static get watchers() { return {
|
|
458
515
|
"mode": ["onModeChange"],
|
|
459
|
-
"dataState": ["observeDataState"]
|
|
516
|
+
"dataState": ["observeDataState"],
|
|
517
|
+
"formLegacyConfigName": ["observeFormLegacy"],
|
|
518
|
+
"gridLegacyConfigName": ["observeGridLegacy"]
|
|
460
519
|
}; }
|
|
461
520
|
};
|
|
462
521
|
SnkSimpleCrud.style = snkSimpleCrudCss;
|
|
@@ -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 AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
9
9
|
const index$1 = require('./index-0922807b.js');
|
|
10
10
|
require('./index-102ba62d.js');
|
|
11
11
|
|
|
@@ -58,7 +58,13 @@ const SnkTaskbar = class {
|
|
|
58
58
|
}
|
|
59
59
|
observeButtons() {
|
|
60
60
|
this._definitions = undefined;
|
|
61
|
-
requestAnimationFrame(() => {
|
|
61
|
+
requestAnimationFrame(() => {
|
|
62
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
observeDisabledButtons() {
|
|
66
|
+
var _a;
|
|
67
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
|
|
62
68
|
}
|
|
63
69
|
// Internal methods
|
|
64
70
|
elementsFromString(strButtons) {
|
|
@@ -213,7 +219,7 @@ const SnkTaskbar = class {
|
|
|
213
219
|
this._customElementsId.push(elementId);
|
|
214
220
|
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
|
|
215
221
|
}
|
|
216
|
-
return index.h("span", { key: elementId, id: elementId });
|
|
222
|
+
return index.h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
|
|
217
223
|
}
|
|
218
224
|
getCustomElements() {
|
|
219
225
|
var _a, _b;
|
|
@@ -337,12 +343,7 @@ const SnkTaskbar = class {
|
|
|
337
343
|
let index$1 = 0;
|
|
338
344
|
return (index.h(index.Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
|
339
345
|
var _a, _b;
|
|
340
|
-
|
|
341
|
-
index$1 = 0;
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
index$1++;
|
|
345
|
-
}
|
|
346
|
+
index$1++;
|
|
346
347
|
if (taskbarElements.TaskbarElement[elem]) {
|
|
347
348
|
return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
|
|
348
349
|
}
|
|
@@ -363,7 +364,8 @@ const SnkTaskbar = class {
|
|
|
363
364
|
}
|
|
364
365
|
get _element() { return index.getElement(this); }
|
|
365
366
|
static get watchers() { return {
|
|
366
|
-
"buttons": ["observeButtons"]
|
|
367
|
+
"buttons": ["observeButtons"],
|
|
368
|
+
"disabledButtons": ["observeDisabledButtons"]
|
|
367
369
|
}; }
|
|
368
370
|
};
|
|
369
371
|
SnkTaskbar.style = snkTaskbarCss;
|
|
@@ -91,7 +91,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
|
91
91
|
case exports.TaskbarElement.MORE_OPTIONS:
|
|
92
92
|
return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
|
|
93
93
|
case exports.TaskbarElement.DIVIDER:
|
|
94
|
-
return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-
|
|
94
|
+
return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
|
|
95
95
|
case exports.TaskbarElement.DATA_EXPORTER:
|
|
96
96
|
const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
|
97
97
|
return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
|
|
@@ -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
|
}
|