@sankhyalabs/sankhyablocks 8.15.0-dev.30 → 8.15.0-dev.32
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/{SnkMessageBuilder-e7dcf408.js → SnkMessageBuilder-141aa18d.js} +2 -1
- package/dist/cjs/SnkMultiSelectionListDataSource-5213120b.js +140 -0
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-c416a6b7.js → pesquisa-fetcher-94f6b316.js} +231 -20
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +517 -2
- package/dist/cjs/snk-application.cjs.entry.js +2 -3
- package/dist/cjs/snk-attach.cjs.entry.js +4 -5
- package/dist/cjs/snk-crud.cjs.entry.js +3 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +7 -3
- package/dist/cjs/{snk-data-unit-82c08a8c.js → snk-data-unit-6026a9f7.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -7
- package/dist/cjs/snk-form-config.cjs.entry.js +45 -25
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +11 -20
- package/dist/cjs/{snk-guides-viewer-bd69fce4.js → snk-guides-viewer-75047f22.js} +3 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -5
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +148 -17
- package/dist/cjs/snk-taskbar.cjs.entry.js +6 -9
- package/dist/cjs/{taskbar-elements-1e4fb2e0.js → taskbar-elements-3ecd1278.js} +1 -1
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +5 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
- package/dist/collection/components/snk-form/snk-form.js +1 -1
- package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +50 -30
- package/dist/collection/components/snk-grid/snk-grid.js +5 -16
- package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
- package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +226 -14
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +1 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +5 -8
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -8
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/SnkMessageBuilder.js +2 -1
- package/dist/components/dataunit-fetcher.js +1 -8
- package/dist/components/field-search.js +93 -3
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-attach2.js +54 -12
- package/dist/components/snk-data-exporter2.js +5 -1
- package/dist/components/snk-detail-view2.js +29 -4
- package/dist/components/snk-form-config2.js +46 -26
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +10 -17
- package/dist/components/snk-personalized-filter-editor.js +3 -1
- package/dist/components/snk-simple-crud2.js +204 -24
- package/dist/components/snk-taskbar2.js +6 -9
- package/dist/esm/{SnkMessageBuilder-0fb796b9.js → SnkMessageBuilder-9747ddd2.js} +2 -1
- package/dist/esm/SnkMultiSelectionListDataSource-7e7eada5.js +133 -0
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-ab16a2e8.js → pesquisa-fetcher-f05a12ca.js} +222 -12
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +516 -3
- package/dist/esm/snk-application.entry.js +2 -3
- package/dist/esm/snk-attach.entry.js +3 -4
- package/dist/esm/snk-crud.entry.js +3 -4
- package/dist/esm/snk-data-exporter.entry.js +7 -3
- package/dist/esm/{snk-data-unit-5d201fb3.js → snk-data-unit-4c343635.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +6 -7
- package/dist/esm/snk-form-config.entry.js +46 -26
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +12 -21
- package/dist/esm/{snk-guides-viewer-fde82cc1.js → snk-guides-viewer-8b679ee6.js} +3 -4
- package/dist/esm/snk-guides-viewer.entry.js +4 -5
- package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
- package/dist/esm/snk-simple-crud.entry.js +149 -18
- package/dist/esm/snk-taskbar.entry.js +6 -9
- package/dist/esm/{taskbar-elements-846c027c.js → taskbar-elements-2473c8ac.js} +1 -1
- package/dist/sankhyablocks/p-20b46647.entry.js +1 -0
- package/dist/sankhyablocks/p-230f5148.entry.js +1 -0
- package/dist/sankhyablocks/p-2897fb8c.js +1 -0
- package/dist/sankhyablocks/{p-05243555.js → p-2936303b.js} +1 -1
- package/dist/sankhyablocks/p-2e493bef.entry.js +1 -0
- package/dist/sankhyablocks/p-4b0c5921.entry.js +1 -0
- package/dist/sankhyablocks/p-5eaecd30.entry.js +1 -0
- package/dist/sankhyablocks/{p-fcdcb0e2.entry.js → p-746fc99e.entry.js} +1 -1
- package/dist/sankhyablocks/p-7e05bd83.entry.js +1 -0
- package/dist/sankhyablocks/p-8a00836e.js +1 -0
- package/dist/sankhyablocks/{p-f3d1c48e.js → p-9a5d1b39.js} +1 -1
- package/dist/sankhyablocks/p-9fb97691.entry.js +1 -0
- package/dist/sankhyablocks/p-a1c630fb.entry.js +1 -0
- package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-ba4871b5.entry.js +1 -0
- package/dist/sankhyablocks/{p-fd0a8d68.entry.js → p-c4bcdd4b.entry.js} +3 -3
- package/dist/sankhyablocks/p-d0bc5ef3.entry.js +1 -0
- package/dist/sankhyablocks/p-d78d4062.js +65 -0
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +1 -1
- package/dist/types/components/snk-form/snk-form.d.ts +1 -1
- package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +5 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -1
- package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
- package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +46 -1
- package/dist/types/components.d.ts +26 -10
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/PreloadManager-84466da6.js +0 -224
- package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
- package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
- package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
- package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
- package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-0b0b36ac.entry.js +0 -1
- package/dist/sankhyablocks/p-11ad137d.entry.js +0 -1
- package/dist/sankhyablocks/p-57212bb5.js +0 -1
- package/dist/sankhyablocks/p-5f5b58b6.entry.js +0 -1
- package/dist/sankhyablocks/p-84bb8f47.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-91b7f78a.entry.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-b7004423.entry.js +0 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-c4874327.entry.js +0 -1
- package/dist/sankhyablocks/p-c6247955.js +0 -65
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-d4802f81.entry.js +0 -1
- package/dist/sankhyablocks/p-e3bd000e.entry.js +0 -1
- package/dist/sankhyablocks/p-fb842329.entry.js +0 -1
- package/dist/sankhyablocks/p-fdc4cb9b.entry.js +0 -1
- /package/dist/cjs/{SnkFormConfigManager-3621bfc4.js → SnkFormConfigManager-0ffd098d.js} +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +0 -0
- /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
- /package/dist/esm/{SnkFormConfigManager-692e20c7.js → SnkFormConfigManager-dd450734.js} +0 -0
- /package/dist/sankhyablocks/{p-725d04ba.js → p-9ea14b61.js} +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
@@ -5,25 +5,26 @@ 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
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
10
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
|
11
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-5213120b.js');
|
11
12
|
const index$1 = require('./index-0922807b.js');
|
12
13
|
require('./ISave-e91b70a7.js');
|
13
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./PreloadManager-84466da6.js');
|
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
|
19
|
+
const ConfigStorage = require('./ConfigStorage-d4c99a5e.js');
|
20
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-0ffd098d.js');
|
20
21
|
require('./index-102ba62d.js');
|
21
22
|
require('./PrintUtils-bcaeb82f.js');
|
22
|
-
require('./ResourceIDUtils-5ff86aa7.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
24
|
+
require('./ResourceIDUtils-5ff86aa7.js');
|
24
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
25
26
|
|
26
|
-
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}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
|
27
|
+
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}";
|
27
28
|
|
28
29
|
const SnkSimpleCrud = class {
|
29
30
|
constructor(hostRef) {
|
@@ -32,20 +33,25 @@ const SnkSimpleCrud = class {
|
|
32
33
|
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
33
34
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
34
35
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
36
|
+
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
37
|
+
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
35
38
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
36
39
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
37
40
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
38
41
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
39
42
|
this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
|
40
|
-
"snkSimpleCrudTaskbar.form_regular": this.
|
41
|
-
"snkSimpleCrudTaskbar.grid_regular": this.
|
42
|
-
"snkSimpleCrudTaskbar.form_selected": this.
|
43
|
-
"snkSimpleCrudTaskbar.grid_selected": this.
|
43
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, taskbarElements.TaskbarElement.GRID_MODE),
|
44
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, taskbarElements.TaskbarElement.FORM_MODE),
|
45
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, taskbarElements.TaskbarElement.GRID_MODE),
|
46
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, taskbarElements.TaskbarElement.FORM_MODE),
|
44
47
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
45
48
|
});
|
49
|
+
this._showPopUpGridConfig = false;
|
50
|
+
this._showFormConfig = false;
|
46
51
|
this._currentViewMode = constants.VIEW_MODE.GRID;
|
47
52
|
this._config = undefined;
|
48
53
|
this._fieldToGetFocus = undefined;
|
54
|
+
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
|
49
55
|
this.dataState = undefined;
|
50
56
|
this.dataUnit = undefined;
|
51
57
|
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
@@ -59,6 +65,20 @@ const SnkSimpleCrud = class {
|
|
59
65
|
this.useEnterLikeTab = false;
|
60
66
|
this.actionsList = undefined;
|
61
67
|
this.configName = undefined;
|
68
|
+
this.showConfiguratorButtons = undefined;
|
69
|
+
}
|
70
|
+
getButtons(selected, changeModeBtn) {
|
71
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? this.REGULAR_DEFAULT_BTNS : this.REGULAR_SELECTED_BTNS)
|
72
|
+
.concat(changeModeBtn));
|
73
|
+
}
|
74
|
+
addConfigButton(buttons) {
|
75
|
+
if (this.configName === undefined) {
|
76
|
+
return buttons;
|
77
|
+
}
|
78
|
+
return buttons.concat(taskbarElements.TaskbarElement.CONFIGURATOR);
|
79
|
+
}
|
80
|
+
get application() {
|
81
|
+
return core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
62
82
|
}
|
63
83
|
resolveInMemoryBtns(taskbarButtons) {
|
64
84
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -78,7 +98,10 @@ const SnkSimpleCrud = class {
|
|
78
98
|
}
|
79
99
|
actionClickListener(evt) {
|
80
100
|
const act = evt.detail;
|
81
|
-
if (act === taskbarElements.TaskbarElement.
|
101
|
+
if (act === taskbarElements.TaskbarElement.CONFIGURATOR) {
|
102
|
+
this._snkConfigurator.open();
|
103
|
+
}
|
104
|
+
else if (act === taskbarElements.TaskbarElement.GRID_MODE) {
|
82
105
|
this.goToView(constants.VIEW_MODE.GRID);
|
83
106
|
}
|
84
107
|
else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
|
@@ -96,8 +119,64 @@ const SnkSimpleCrud = class {
|
|
96
119
|
this.dataStateChange.emit(newValue);
|
97
120
|
}
|
98
121
|
}
|
99
|
-
|
122
|
+
openConfig(viewMode) {
|
123
|
+
this._snkConfigurator.close();
|
124
|
+
if (viewMode === constants.VIEW_MODE.GRID) {
|
125
|
+
this.openGridConfig();
|
126
|
+
}
|
127
|
+
else if (viewMode === constants.VIEW_MODE.FORM) {
|
128
|
+
this.openFormConfig();
|
129
|
+
}
|
130
|
+
}
|
131
|
+
openGridConfig() {
|
132
|
+
this._grid.getColumnsState()
|
133
|
+
.then((gridColumns) => {
|
134
|
+
this._snkGridConfig.columns = gridColumns.filter(c => c.name);
|
135
|
+
this._snkGridConfig.selectedIndex = 0;
|
136
|
+
this._showPopUpGridConfig = true;
|
137
|
+
});
|
138
|
+
}
|
139
|
+
openFormConfig() {
|
140
|
+
this._showFormConfig = true;
|
141
|
+
}
|
142
|
+
loadGridConfig() {
|
143
|
+
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
this._gridConfigAlreadyLoaded = true;
|
147
|
+
return new Promise((accept, reject) => {
|
148
|
+
ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this._resourceID)
|
149
|
+
.then(config => {
|
150
|
+
this.setGridConfig(config);
|
151
|
+
accept();
|
152
|
+
})
|
153
|
+
.catch(reason => {
|
154
|
+
reject(reason);
|
155
|
+
});
|
156
|
+
});
|
157
|
+
}
|
158
|
+
async loadFormConfig() {
|
159
|
+
if (this._formConfigManager == undefined) {
|
160
|
+
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this._resourceID);
|
161
|
+
this._formConfigManager.setConfig(this.formConfig);
|
162
|
+
}
|
163
|
+
if (this.formConfig != undefined || this._formConfigAlreadyLoaded) {
|
164
|
+
return;
|
165
|
+
}
|
166
|
+
this._formConfigAlreadyLoaded = true;
|
167
|
+
this.setFormConfig(await this._formConfigManager.loadConfig());
|
168
|
+
}
|
169
|
+
async componentWillRender() {
|
170
|
+
this._resourceID = await this.application.getResourceID();
|
100
171
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
172
|
+
if (this.configName === undefined) {
|
173
|
+
return;
|
174
|
+
}
|
175
|
+
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
176
|
+
return;
|
177
|
+
}
|
178
|
+
this.loadGridConfig();
|
179
|
+
this.loadFormConfig();
|
101
180
|
}
|
102
181
|
componentWillLoad() {
|
103
182
|
this.processMetadata();
|
@@ -105,8 +184,7 @@ const SnkSimpleCrud = class {
|
|
105
184
|
this.configDatasource();
|
106
185
|
}
|
107
186
|
configDatasource() {
|
108
|
-
|
109
|
-
this._multiSelectionListDataSource.setApplication(application);
|
187
|
+
this._multiSelectionListDataSource.setApplication(this.application);
|
110
188
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
111
189
|
}
|
112
190
|
getTaskBarId() {
|
@@ -147,6 +225,20 @@ const SnkSimpleCrud = class {
|
|
147
225
|
getRecords() {
|
148
226
|
return Promise.resolve(this.dataUnit.records);
|
149
227
|
}
|
228
|
+
/**
|
229
|
+
* Usado para abrir o configurator do CRUD
|
230
|
+
*/
|
231
|
+
async openConfigurator() {
|
232
|
+
var _a;
|
233
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
|
234
|
+
}
|
235
|
+
/**
|
236
|
+
* Usado para fechar o configurator do CRUD
|
237
|
+
*/
|
238
|
+
async closeConfigurator() {
|
239
|
+
var _a;
|
240
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
241
|
+
}
|
150
242
|
processMetadata() {
|
151
243
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
152
244
|
const fieldMetadata = [];
|
@@ -201,6 +293,14 @@ const SnkSimpleCrud = class {
|
|
201
293
|
this.dataUnit.clearSelection();
|
202
294
|
}
|
203
295
|
}
|
296
|
+
handleConfiguratorEvent(evt, type) {
|
297
|
+
evt.stopImmediatePropagation();
|
298
|
+
if (type === 'SAVE') {
|
299
|
+
this.configuratorSave.emit();
|
300
|
+
return;
|
301
|
+
}
|
302
|
+
this.configuratorCancel.emit();
|
303
|
+
}
|
204
304
|
getColumnSearch(actionButton, item) {
|
205
305
|
if (this._columnSearch != undefined) {
|
206
306
|
return this._columnSearch;
|
@@ -314,11 +414,42 @@ const SnkSimpleCrud = class {
|
|
314
414
|
disconnectedCallback() {
|
315
415
|
window.removeEventListener("keydown", this._keyDownHandler);
|
316
416
|
}
|
417
|
+
gridConfigChangeHandler(evt) {
|
418
|
+
const config = evt.detail;
|
419
|
+
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this._resourceID);
|
420
|
+
evt.stopPropagation();
|
421
|
+
}
|
422
|
+
modalConfigChangeHandler(evt) {
|
423
|
+
const config = evt.detail;
|
424
|
+
this._grid.setColumnsState(config.columns)
|
425
|
+
.then(() => {
|
426
|
+
this.setGridConfig(config);
|
427
|
+
this.closeGridConfig();
|
428
|
+
});
|
429
|
+
evt.stopPropagation();
|
430
|
+
}
|
431
|
+
setGridConfig(config) {
|
432
|
+
this.gridConfig = config;
|
433
|
+
SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
434
|
+
}
|
435
|
+
setFormConfig(config) {
|
436
|
+
this.formConfig = config;
|
437
|
+
}
|
438
|
+
closeGridConfig() {
|
439
|
+
this._showPopUpGridConfig = false;
|
440
|
+
}
|
441
|
+
closeFormConfig() {
|
442
|
+
this._showFormConfig = false;
|
443
|
+
}
|
444
|
+
/* istanbul ignore next */
|
317
445
|
render() {
|
318
|
-
var _a;
|
319
|
-
|
446
|
+
var _a, _b, _c;
|
447
|
+
if (this.dataUnit == undefined) {
|
448
|
+
return;
|
449
|
+
}
|
450
|
+
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)
|
320
451
|
? undefined
|
321
|
-
: 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:
|
452
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this._showFormConfig ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_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._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 }))));
|
322
453
|
}
|
323
454
|
get _element() { return index.getElement(this); }
|
324
455
|
static get watchers() { return {
|
@@ -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,9 @@ 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
|
+
});
|
62
64
|
}
|
63
65
|
// Internal methods
|
64
66
|
elementsFromString(strButtons) {
|
@@ -213,7 +215,7 @@ const SnkTaskbar = class {
|
|
213
215
|
this._customElementsId.push(elementId);
|
214
216
|
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
|
215
217
|
}
|
216
|
-
return index.h("span", { key: elementId, id: elementId });
|
218
|
+
return index.h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
|
217
219
|
}
|
218
220
|
getCustomElements() {
|
219
221
|
var _a, _b;
|
@@ -337,12 +339,7 @@ const SnkTaskbar = class {
|
|
337
339
|
let index$1 = 0;
|
338
340
|
return (index.h(index.Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
339
341
|
var _a, _b;
|
340
|
-
|
341
|
-
index$1 = 0;
|
342
|
-
}
|
343
|
-
else {
|
344
|
-
index$1++;
|
345
|
-
}
|
342
|
+
index$1++;
|
346
343
|
if (taskbarElements.TaskbarElement[elem]) {
|
347
344
|
return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
|
348
345
|
}
|
@@ -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 });
|
@@ -6,7 +6,6 @@
|
|
6
6
|
"./components/snk-taskbar/snk-taskbar.js",
|
7
7
|
"./components/snk-filter-bar/filter-list/snk-filter-list.js",
|
8
8
|
"./components/snk-print-selector/snk-print-selector.js",
|
9
|
-
"./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
|
10
9
|
"./components/snk-actions-button/snk-actions-button.js",
|
11
10
|
"./components/snk-actions-button/subcomponents/snk-actions-form.js",
|
12
11
|
"./components/snk-actions-button/subcomponents/snk-client-confirm.js",
|
@@ -35,12 +34,13 @@
|
|
35
34
|
"./components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js",
|
36
35
|
"./components/snk-filter-field-search/snk-filter-field-search.js",
|
37
36
|
"./components/snk-form/snk-form.js",
|
38
|
-
"./components/snk-form/subcomponents/snk-config
|
39
|
-
"./components/snk-form
|
40
|
-
"./components/snk-form/subcomponents/snk-
|
37
|
+
"./components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.js",
|
38
|
+
"./components/snk-form-config/snk-form-config.js",
|
39
|
+
"./components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js",
|
40
|
+
"./components/snk-form-config/subcomponents/snk-field-config/snk-field-config.js",
|
41
41
|
"./components/snk-grid/snk-grid.js",
|
42
|
-
"./components/snk-grid
|
43
|
-
"./components/snk-grid/
|
42
|
+
"./components/snk-grid-config/snk-grid-config.js",
|
43
|
+
"./components/snk-grid-config/snk-select-box/snk-select-box.js",
|
44
44
|
"./components/snk-personalized-filter/snk-personalized-filter.js",
|
45
45
|
"./components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js",
|
46
46
|
"./components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js",
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Action } from '@sankhyalabs/core';
|
2
2
|
import { Host, forceUpdate, h } from '@stencil/core';
|
3
|
-
import { SnkFormConfigManager } from '../../../snk-form/SnkFormConfigManager';
|
3
|
+
import { SnkFormConfigManager } from '../../../snk-form-config/SnkFormConfigManager';
|
4
4
|
import { buildFormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
5
5
|
import { PresentationMode } from '../../../../lib';
|
6
6
|
import { TaskbarElement } from '../../../snk-taskbar/elements/taskbar-elements';
|
@@ -236,7 +236,7 @@ export class SnkDetailView {
|
|
236
236
|
"references": {
|
237
237
|
"SnkFormConfigManager": {
|
238
238
|
"location": "import",
|
239
|
-
"path": "../../../snk-form/SnkFormConfigManager"
|
239
|
+
"path": "../../../snk-form-config/SnkFormConfigManager"
|
240
240
|
}
|
241
241
|
}
|
242
242
|
},
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Action as DUAction, ElementIDUtils } from '@sankhyalabs/core';
|
2
2
|
import { Fragment, h } from '@stencil/core';
|
3
|
-
import { SnkFormConfigManager } from '../../snk-form/SnkFormConfigManager';
|
3
|
+
import { SnkFormConfigManager } from '../../snk-form-config/SnkFormConfigManager';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import TaskbarProcessor from '../../snk-taskbar/processor/taskbar-processor';
|
6
6
|
import { TaskbarElement } from '../../snk-taskbar/elements/taskbar-elements';
|
@@ -120,7 +120,11 @@ export class SnkDataExporter {
|
|
120
120
|
}
|
121
121
|
fetchDataExporter(params)
|
122
122
|
.then((result) => callbackResolver(result))
|
123
|
-
.catch((exception) =>
|
123
|
+
.catch((exception) => {
|
124
|
+
console.error(exception);
|
125
|
+
let { title, message, statusMessage } = exception || {};
|
126
|
+
ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
127
|
+
});
|
124
128
|
}
|
125
129
|
getOptionKey(option) {
|
126
130
|
return Object.keys(DataExporterOption)
|
@@ -55,8 +55,10 @@ export class SnkFilterPersonalized {
|
|
55
55
|
return this.presentationMode === EPresentationMode.MODAL;
|
56
56
|
}
|
57
57
|
doSearch(mode, argument, param) {
|
58
|
+
const context = Object.assign({}, param.searchContext);
|
59
|
+
context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
|
58
60
|
return new Promise((resolve, reject) => {
|
59
|
-
this._application.executePreparedSearch(mode, argument,
|
61
|
+
this._application.executePreparedSearch(mode, argument, context)
|
60
62
|
.then(result => {
|
61
63
|
resolve(result);
|
62
64
|
}).catch(reason => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
2
2
|
import { h } from '@stencil/core';
|
3
|
-
import { SnkFormConfigManager } from '
|
3
|
+
import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
|
4
4
|
import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
|
5
5
|
export class SnkForm {
|
6
6
|
constructor() {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
2
2
|
import { Sortable } from '@shopify/draggable';
|
3
|
-
import { ObjectUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
+
import { ObjectUtils, ArrayUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from "@sankhyalabs/ezui/dist/collection/utils";
|
5
|
-
import { ACTION_CONFIG, CONFIG_EVENTS, CONFIG_SORTABLE_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "
|
6
|
-
import { UserConfigType } from "
|
5
|
+
import { ACTION_CONFIG, CONFIG_EVENTS, CONFIG_SORTABLE_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "../../lib/utils/constants";
|
6
|
+
import { UserConfigType } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
7
7
|
import { buildFormConfigFromDataUnit } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
8
8
|
const CONTAINER_ID = {
|
9
9
|
collapsibleBox: "EZ-COLLAPSIBLE-BOX",
|
@@ -25,6 +25,7 @@ export class SnkFormConfig {
|
|
25
25
|
this._formFieldsStyle = "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config";
|
26
26
|
this._fieldsAvailableStyle = "ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config";
|
27
27
|
this._fieldFloatingStyle = "form-config__field-config--dragged";
|
28
|
+
this._sortableTimer = 100;
|
28
29
|
this._formConfigOptions = [];
|
29
30
|
this._fieldConfigSelected = undefined;
|
30
31
|
this._layoutFormConfig = undefined;
|
@@ -39,20 +40,27 @@ export class SnkFormConfig {
|
|
39
40
|
this.messagesBuilder = undefined;
|
40
41
|
}
|
41
42
|
observeConfigManager() {
|
42
|
-
this.loadConfig();
|
43
|
+
this.loadConfig(this._sortableTimer);
|
43
44
|
}
|
44
|
-
loadFields() {
|
45
|
+
loadFields(updateTimer = 0) {
|
45
46
|
this._layoutFormConfig = [];
|
46
|
-
|
47
|
+
if (updateTimer > 0) {
|
48
|
+
setTimeout(() => {
|
49
|
+
this.buildFields();
|
50
|
+
}, updateTimer);
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
this.buildFields();
|
54
|
+
}
|
47
55
|
}
|
48
56
|
buildFields() {
|
49
57
|
this.buildFormConfig();
|
50
58
|
this.buildAvailableFields();
|
51
59
|
}
|
52
|
-
loadFormConfig() {
|
60
|
+
loadFormConfig(updateTimer) {
|
53
61
|
var _a;
|
54
62
|
this._formConfig = this.getConfig();
|
55
|
-
this.loadFields();
|
63
|
+
this.loadFields(updateTimer);
|
56
64
|
this.controlFieldConfig();
|
57
65
|
if (((_a = this._filterFieldsAvailable) === null || _a === void 0 ? void 0 : _a.value) != undefined) {
|
58
66
|
this._filterFieldsAvailable.value = "";
|
@@ -95,12 +103,12 @@ export class SnkFormConfig {
|
|
95
103
|
}
|
96
104
|
}
|
97
105
|
resetChangeConfig() {
|
98
|
-
this.loadFormConfig();
|
106
|
+
this.loadFormConfig(this._sortableTimer);
|
99
107
|
this.clearTempGroups();
|
100
108
|
}
|
101
109
|
resetChangeOptionConfig() {
|
102
110
|
this._formConfigChanged = false;
|
103
|
-
this.loadConfig();
|
111
|
+
this.loadConfig(this._sortableTimer);
|
104
112
|
this.clearTempGroups();
|
105
113
|
}
|
106
114
|
getTabsToSave() {
|
@@ -318,7 +326,9 @@ export class SnkFormConfig {
|
|
318
326
|
&& oldContainer.id === newContainer.id) {
|
319
327
|
evt.cancel();
|
320
328
|
this._fieldsAvailable = [];
|
321
|
-
|
329
|
+
setTimeout(() => {
|
330
|
+
this.buildAvailableFields();
|
331
|
+
}, this._sortableTimer);
|
322
332
|
return true;
|
323
333
|
}
|
324
334
|
return false;
|
@@ -361,7 +371,11 @@ export class SnkFormConfig {
|
|
361
371
|
if (isNewGroup) {
|
362
372
|
this.clearTempGroups(true);
|
363
373
|
}
|
364
|
-
|
374
|
+
const sortableTimer = oldContainer.dataset.groupName !== newContainer.dataset.groupName
|
375
|
+
|| (newContainer.id === CONTAINER_ID.withoutGroup && oldContainer.id === CONTAINER_ID.fieldsAvailable)
|
376
|
+
? this._sortableTimer
|
377
|
+
: 0;
|
378
|
+
this.updateFieldsToSave(sortableTimer);
|
365
379
|
}, this._renderTimer);
|
366
380
|
return true;
|
367
381
|
}
|
@@ -391,12 +405,12 @@ export class SnkFormConfig {
|
|
391
405
|
return;
|
392
406
|
}
|
393
407
|
}
|
394
|
-
updateFieldsToSave() {
|
408
|
+
updateFieldsToSave(updateTimer = 0) {
|
395
409
|
const fields = this.getFieldsToSave();
|
396
410
|
if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
|
397
411
|
this._formConfig.fields = fields;
|
398
412
|
}
|
399
|
-
this.loadFields();
|
413
|
+
this.loadFields(updateTimer);
|
400
414
|
this._formConfigChanged = true;
|
401
415
|
}
|
402
416
|
controlSortableField() {
|
@@ -426,7 +440,7 @@ export class SnkFormConfig {
|
|
426
440
|
controlStopDraggingGroup(evt) {
|
427
441
|
if (evt.data.newIndex !== evt.data.oldIndex) {
|
428
442
|
setTimeout(() => {
|
429
|
-
this.updateFieldsToSave();
|
443
|
+
this.updateFieldsToSave(this._sortableTimer);
|
430
444
|
}, this._renderTimer);
|
431
445
|
}
|
432
446
|
}
|
@@ -499,7 +513,7 @@ export class SnkFormConfig {
|
|
499
513
|
});
|
500
514
|
if (tabs.length > 0) {
|
501
515
|
this._formConfig.tabs = tabs;
|
502
|
-
this.loadFields();
|
516
|
+
this.loadFields(this._sortableTimer);
|
503
517
|
this.controlFieldConfig();
|
504
518
|
this._formConfigChanged = true;
|
505
519
|
}
|
@@ -523,13 +537,13 @@ export class SnkFormConfig {
|
|
523
537
|
if (config != undefined) {
|
524
538
|
this._formConfig = config;
|
525
539
|
this._tabSelected = 1;
|
526
|
-
this.loadFields();
|
540
|
+
this.loadFields(this._sortableTimer);
|
527
541
|
this.controlFieldConfig();
|
528
542
|
this.clearTempGroups();
|
529
543
|
}
|
530
544
|
}
|
531
|
-
loadConfig() {
|
532
|
-
this.loadFormConfig();
|
545
|
+
loadConfig(updateTimer = 0) {
|
546
|
+
this.loadFormConfig(updateTimer);
|
533
547
|
this.loadUserConfig();
|
534
548
|
}
|
535
549
|
addNewGroup() {
|
@@ -570,7 +584,7 @@ export class SnkFormConfig {
|
|
570
584
|
});
|
571
585
|
}
|
572
586
|
else {
|
573
|
-
this.updateFieldsToSave();
|
587
|
+
this.updateFieldsToSave(this._sortableTimer);
|
574
588
|
}
|
575
589
|
}
|
576
590
|
checkGroupExists(newLabel, indexGroup, isTempGroup = false) {
|
@@ -616,7 +630,7 @@ export class SnkFormConfig {
|
|
616
630
|
field.group = newLabel;
|
617
631
|
}
|
618
632
|
});
|
619
|
-
this.loadFields();
|
633
|
+
this.loadFields(this._sortableTimer);
|
620
634
|
this.controlFieldConfig();
|
621
635
|
this._formConfigChanged = true;
|
622
636
|
}
|
@@ -830,14 +844,14 @@ export class SnkFormConfig {
|
|
830
844
|
this._formConfigChanged = true;
|
831
845
|
this.resetSortables();
|
832
846
|
}
|
833
|
-
controlRemoveFieldConfig(fieldConfig) {
|
847
|
+
controlRemoveFieldConfig(fieldConfig, updateTimer) {
|
834
848
|
var _a;
|
835
849
|
this._formConfigChanged = false;
|
836
850
|
if (fieldConfig == undefined) {
|
837
851
|
return;
|
838
852
|
}
|
839
853
|
this._formConfig.fields = (_a = this._formConfig.fields) === null || _a === void 0 ? void 0 : _a.filter((field) => field.name !== fieldConfig.name);
|
840
|
-
this.loadFields();
|
854
|
+
this.loadFields(updateTimer);
|
841
855
|
this.controlFieldConfig();
|
842
856
|
this._formConfigChanged = true;
|
843
857
|
this.resetSortables();
|
@@ -846,14 +860,14 @@ export class SnkFormConfig {
|
|
846
860
|
this.controlSortableField();
|
847
861
|
this.controlSortableGroup();
|
848
862
|
}
|
849
|
-
handleFieldConfigChange(evt) {
|
863
|
+
handleFieldConfigChange(evt, updateTimer = 0) {
|
850
864
|
const { field: fieldConfig, type: actionType } = evt.detail;
|
851
865
|
if (actionType === ACTION_CONFIG.configuration) {
|
852
866
|
this.controlFieldConfig(fieldConfig);
|
853
867
|
return;
|
854
868
|
}
|
855
869
|
if (actionType === ACTION_CONFIG.remove) {
|
856
|
-
this.controlRemoveFieldConfig(fieldConfig);
|
870
|
+
this.controlRemoveFieldConfig(fieldConfig, updateTimer);
|
857
871
|
return;
|
858
872
|
}
|
859
873
|
if (actionType === ACTION_CONFIG.add) {
|
@@ -874,7 +888,7 @@ export class SnkFormConfig {
|
|
874
888
|
tab.label = newLabel;
|
875
889
|
}
|
876
890
|
});
|
877
|
-
this.loadFields();
|
891
|
+
this.loadFields(this._sortableTimer);
|
878
892
|
this.controlFieldConfig();
|
879
893
|
this._formConfigChanged = true;
|
880
894
|
}
|
@@ -894,7 +908,7 @@ export class SnkFormConfig {
|
|
894
908
|
this._formConfig.tabs = (_a = this._formConfig.tabs) === null || _a === void 0 ? void 0 : _a.filter((tab) => {
|
895
909
|
return tab.label !== tabSelected.detail.label;
|
896
910
|
});
|
897
|
-
this.loadFields();
|
911
|
+
this.loadFields(this._sortableTimer);
|
898
912
|
this.controlFieldConfig();
|
899
913
|
this._formConfigChanged = true;
|
900
914
|
}
|
@@ -907,7 +921,7 @@ export class SnkFormConfig {
|
|
907
921
|
tab.visible = !tab.visible;
|
908
922
|
}
|
909
923
|
});
|
910
|
-
this.loadFields();
|
924
|
+
this.loadFields(this._sortableTimer);
|
911
925
|
this.controlFieldConfig();
|
912
926
|
this._formConfigChanged = true;
|
913
927
|
}
|
@@ -932,6 +946,12 @@ export class SnkFormConfig {
|
|
932
946
|
this.controlSortableField();
|
933
947
|
this.controlSortableGroup();
|
934
948
|
}
|
949
|
+
async componentWillRender() {
|
950
|
+
if (this.messagesBuilder == undefined) {
|
951
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
952
|
+
this.messagesBuilder = application.messagesBuilder;
|
953
|
+
}
|
954
|
+
}
|
935
955
|
componentWillLoad() {
|
936
956
|
this.loadConfig();
|
937
957
|
}
|
@@ -1005,7 +1025,7 @@ export class SnkFormConfig {
|
|
1005
1025
|
"references": {
|
1006
1026
|
"SnkFormConfigManager": {
|
1007
1027
|
"location": "import",
|
1008
|
-
"path": "
|
1028
|
+
"path": "./SnkFormConfigManager"
|
1009
1029
|
}
|
1010
1030
|
}
|
1011
1031
|
},
|
@@ -1025,7 +1045,7 @@ export class SnkFormConfig {
|
|
1025
1045
|
"references": {
|
1026
1046
|
"SnkMessageBuilder": {
|
1027
1047
|
"location": "import",
|
1028
|
-
"path": "
|
1048
|
+
"path": "../../lib/message/SnkMessageBuilder"
|
1029
1049
|
}
|
1030
1050
|
}
|
1031
1051
|
},
|