@sankhyalabs/sankhyablocks 2.1.2 → 2.1.4
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/AuthorizationConfig-79ffae4b.js +7 -0
- package/dist/cjs/{form-config-fetcher-2de7c16a.js → ConfigStorage-c112de1d.js} +101 -1
- package/dist/cjs/{SnkMessageBuilder-89482d28.js → SnkMessageBuilder-61f00e7f.js} +33 -5
- package/dist/cjs/{constants-9056ca9e.js → constants-a47a5190.js} +15 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +32 -65
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/{snk-field-config_2.cjs.entry.js → snk-configurator_3.cjs.entry.js} +134 -13
- package/dist/cjs/snk-crud.cjs.entry.js +23 -6
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/{snk-configurator_6.cjs.entry.js → snk-filter-bar_7.cjs.entry.js} +528 -198
- package/dist/cjs/snk-form-config.cjs.entry.js +30 -24
- package/dist/cjs/snk-form.cjs.entry.js +30 -17
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-90350a55.js → taskbar-elements-a0b857c0.js} +5 -9
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/snk-application/snk-application.js +4 -3
- package/dist/collection/components/snk-configurator/AuthorizationConfig.js +5 -0
- package/dist/collection/components/snk-configurator/snk-configurator.css +124 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +126 -181
- package/dist/collection/components/snk-crud/snk-crud.js +23 -5
- package/dist/collection/components/snk-form/snk-form.js +37 -54
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +47 -28
- package/dist/collection/components/snk-grid/snk-grid.js +69 -20
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.css +166 -0
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +605 -0
- package/dist/collection/components/snk-grid/subcomponents/snk-select-box/snk-select-box.css +9 -0
- package/dist/collection/components/snk-grid/subcomponents/snk-select-box/snk-select-box.js +70 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +5 -9
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +39 -11
- package/dist/collection/lib/configs/ConfigStorage.js +15 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +5 -3
- package/dist/collection/lib/message/resources/snk-configurator.msg.js +0 -3
- package/dist/collection/lib/message/resources/snk-form.msg.js +3 -0
- package/dist/collection/lib/message/resources/snk-grid.msg.js +26 -0
- package/dist/collection/lib/utils/constants.js +14 -0
- package/dist/components/AuthorizationConfig.js +7 -0
- package/dist/components/{form-config-fetcher.js → ConfigStorage.js} +100 -2
- package/dist/components/SnkMessageBuilder.js +33 -5
- package/dist/components/constants.js +15 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/snk-application2.js +4 -37
- package/dist/components/snk-configurator2.js +63 -165
- package/dist/components/snk-crud.js +53 -29
- package/dist/components/snk-form-config2.js +25 -19
- package/dist/components/snk-form2.js +33 -32
- package/dist/components/{snk-config-modal.d.ts → snk-grid-config.d.ts} +4 -4
- package/dist/components/snk-grid-config.js +6 -0
- package/dist/components/snk-grid-config2.js +497 -0
- package/dist/components/snk-grid2.js +65 -27
- package/dist/components/snk-select-box.d.ts +11 -0
- package/dist/components/snk-select-box.js +6 -0
- package/dist/components/snk-select-box2.js +38 -0
- package/dist/components/snk-taskbar2.js +45 -33
- package/dist/esm/AuthorizationConfig-dcbd207a.js +7 -0
- package/dist/esm/{form-config-fetcher-96c6c2dc.js → ConfigStorage-99025655.js} +100 -2
- package/dist/esm/{SnkMessageBuilder-a27fc561.js → SnkMessageBuilder-f5ef87df.js} +33 -5
- package/dist/esm/{constants-c6039d3d.js → constants-babe1a08.js} +15 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +5 -38
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/{snk-field-config_2.entry.js → snk-configurator_3.entry.js} +134 -14
- package/dist/esm/snk-crud.entry.js +23 -6
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/{snk-configurator_6.entry.js → snk-filter-bar_7.entry.js} +529 -200
- package/dist/esm/snk-form-config.entry.js +25 -19
- package/dist/esm/snk-form.entry.js +30 -17
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/{taskbar-elements-0f41cd77.js → taskbar-elements-4d6584cd.js} +5 -9
- package/dist/sankhyablocks/p-105cd4a8.entry.js +1 -0
- package/dist/sankhyablocks/p-4131d41e.entry.js +1 -0
- package/dist/sankhyablocks/{p-8706fe65.entry.js → p-43aff8f5.entry.js} +1 -1
- package/dist/sankhyablocks/p-53f33e9d.entry.js +1 -0
- package/dist/sankhyablocks/p-639b8f6e.entry.js +76 -0
- package/dist/sankhyablocks/{p-a5b26df2.js → p-6673c77c.js} +1 -1
- package/dist/sankhyablocks/p-6ba8f415.js +26 -0
- package/dist/sankhyablocks/{p-2517529d.js → p-877bd6cf.js} +1 -1
- package/dist/sankhyablocks/p-87896198.entry.js +1 -0
- package/dist/sankhyablocks/p-bd6d4a83.js +1 -0
- package/dist/sankhyablocks/p-cae38f51.entry.js +1 -0
- package/dist/sankhyablocks/{p-f37cdeb5.entry.js → p-cd03ea9e.entry.js} +1 -1
- package/dist/sankhyablocks/p-dc36cfbf.js +1 -0
- package/dist/sankhyablocks/{p-92782503.entry.js → p-eb94df0b.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +0 -1
- package/dist/types/components/snk-configurator/AuthorizationConfig.d.ts +4 -0
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +21 -24
- package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
- package/dist/types/components/snk-form/snk-form.d.ts +6 -9
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +7 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +13 -3
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +66 -0
- package/dist/types/components/snk-grid/subcomponents/snk-select-box/snk-select-box.d.ts +7 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -4
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +3 -1
- package/dist/types/components.d.ts +104 -74
- package/dist/types/lib/configs/ConfigStorage.d.ts +3 -3
- package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +0 -1
- package/dist/types/lib/message/resources/snk-grid.msg.d.ts +2 -0
- package/dist/types/lib/utils/constants.d.ts +14 -0
- package/package.json +1 -1
- package/react/components.d.ts +2 -1
- package/react/components.js +2 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/configurableElementsStorage-93459c72.js +0 -20
- package/dist/cjs/snk-config-modal.cjs.entry.js +0 -62
- package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +0 -16
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +0 -122
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +0 -137
- package/dist/components/snk-config-modal.js +0 -6
- package/dist/components/snk-config-modal2.js +0 -91
- package/dist/esm/configurableElementsStorage-cdc144b5.js +0 -18
- package/dist/esm/snk-config-modal.entry.js +0 -58
- package/dist/sankhyablocks/p-361299e8.js +0 -26
- package/dist/sankhyablocks/p-599846fb.entry.js +0 -75
- package/dist/sankhyablocks/p-59d8c47a.js +0 -1
- package/dist/sankhyablocks/p-60eef7cd.entry.js +0 -1
- package/dist/sankhyablocks/p-626cf022.entry.js +0 -1
- package/dist/sankhyablocks/p-6511d132.entry.js +0 -1
- package/dist/sankhyablocks/p-cb8d71ba.entry.js +0 -1
- package/dist/sankhyablocks/p-ce7c38a1.entry.js +0 -1
- package/dist/sankhyablocks/p-d50651a3.js +0 -1
- package/dist/sankhyablocks/p-e8591491.entry.js +0 -1
- package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +0 -8
- package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +0 -38
|
@@ -12,7 +12,6 @@ export var TaskbarElement;
|
|
|
12
12
|
TaskbarElement["SAVE"] = "SAVE";
|
|
13
13
|
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
|
14
14
|
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
|
15
|
-
TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
|
|
16
15
|
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
17
16
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
18
17
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
@@ -23,11 +22,11 @@ export var AuthorizationElements;
|
|
|
23
22
|
AuthorizationElements["CLONE"] = "CLONE";
|
|
24
23
|
AuthorizationElements["REMOVE"] = "REMOVE";
|
|
25
24
|
AuthorizationElements["INSERT"] = "INSERT";
|
|
26
|
-
AuthorizationElements["
|
|
25
|
+
AuthorizationElements["CONFIGURATOR"] = "CONFIGURATOR";
|
|
27
26
|
})(AuthorizationElements || (AuthorizationElements = {}));
|
|
28
27
|
export var VisibleWhenForbidden;
|
|
29
28
|
(function (VisibleWhenForbidden) {
|
|
30
|
-
VisibleWhenForbidden["
|
|
29
|
+
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
|
31
30
|
})(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
|
|
32
31
|
export const buildCustomButton = (def, className, action, isEnabled) => {
|
|
33
32
|
const { hint, text, iconName } = def;
|
|
@@ -43,7 +42,7 @@ export const buildCustomButton = (def, className, action, isEnabled) => {
|
|
|
43
42
|
return textButton(def.name, className, text, hint, action, isEnabled);
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
export const buildElem = (element, className, getTitle, action, isEnabled, actions
|
|
45
|
+
export const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
|
|
47
46
|
const title = getTitle(element);
|
|
48
47
|
switch (element) {
|
|
49
48
|
case TaskbarElement.PREVIOUS:
|
|
@@ -69,11 +68,11 @@ export const buildElem = (element, className, getTitle, action, isEnabled, actio
|
|
|
69
68
|
case TaskbarElement.FORM_MODE:
|
|
70
69
|
return iconButton("list", element, className, title, action, isEnabled);
|
|
71
70
|
case TaskbarElement.CONFIGURATOR:
|
|
72
|
-
return
|
|
71
|
+
return iconButton("settings-inverted", element, className, title, action, isEnabled);
|
|
73
72
|
case TaskbarElement.MORE_OPTIONS:
|
|
74
73
|
return actions && actions.length > 0 ? h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
|
|
75
74
|
case TaskbarElement.DIVIDER:
|
|
76
|
-
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
|
|
75
|
+
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
|
|
77
76
|
}
|
|
78
77
|
};
|
|
79
78
|
function textButton(name, className, text, title, action, isEnabled) {
|
|
@@ -85,6 +84,3 @@ function iconButton(iconName, name, className, title, action, isEnabled) {
|
|
|
85
84
|
function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
|
|
86
85
|
return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
|
87
86
|
}
|
|
88
|
-
function configButton(element, className, getTitle, action, isEnabled, configName) {
|
|
89
|
-
return h("snk-configurator", { key: "configurator", configName: configName, title: getTitle(element), class: className, enabled: isEnabled(element), onChangeViewMode: (evt) => action(evt === null || evt === void 0 ? void 0 : evt.detail) });
|
|
90
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
|
+
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
|
3
4
|
import { TaskbarElement, buildElem, AuthorizationElements, buildCustomButton, VisibleWhenForbidden } from './elements/taskbar-elements';
|
|
4
5
|
export class SnkTaskbar {
|
|
5
6
|
constructor() {
|
|
@@ -25,17 +26,24 @@ export class SnkTaskbar {
|
|
|
25
26
|
// Internal methods
|
|
26
27
|
elementsFromString(strButtons) {
|
|
27
28
|
const elements = [];
|
|
28
|
-
if (strButtons)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
}
|
|
29
|
+
if (strButtons == null)
|
|
30
|
+
return elements;
|
|
31
|
+
strButtons.split(",").forEach(buttonName => {
|
|
32
|
+
buttonName = buttonName.trim();
|
|
33
|
+
if (VisibleWhenForbidden[buttonName] || this.isAllowed(buttonName)) {
|
|
34
|
+
elements.push(buttonName.trim());
|
|
35
|
+
}
|
|
36
|
+
});
|
|
36
37
|
return elements;
|
|
37
38
|
}
|
|
38
39
|
isAllowed(buttonName) {
|
|
40
|
+
if (buttonName === AuthorizationElements.CONFIGURATOR) {
|
|
41
|
+
return this._permissions
|
|
42
|
+
? this._permissions.isSup
|
|
43
|
+
|| this._permissions[AuthorizationConfig.CONFIG_GRID]
|
|
44
|
+
|| this._permissions[AuthorizationConfig.CONFIG]
|
|
45
|
+
: false;
|
|
46
|
+
}
|
|
39
47
|
if (AuthorizationElements[buttonName]) {
|
|
40
48
|
return this._permissions ? this._permissions.isSup || this._permissions[buttonName] : false;
|
|
41
49
|
}
|
|
@@ -100,7 +108,7 @@ export class SnkTaskbar {
|
|
|
100
108
|
className += "ez-padding-left--medium";
|
|
101
109
|
}
|
|
102
110
|
if (TaskbarElement[def.toString()]) {
|
|
103
|
-
return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList
|
|
111
|
+
return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
104
112
|
}
|
|
105
113
|
else {
|
|
106
114
|
return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -121,12 +129,32 @@ export class SnkTaskbar {
|
|
|
121
129
|
this._definitions = this.elementsFromString(this.buttons);
|
|
122
130
|
}
|
|
123
131
|
}
|
|
132
|
+
isDivider(element) {
|
|
133
|
+
var _a;
|
|
134
|
+
if (element === undefined) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return (_a = element.$attrs$) === null || _a === void 0 ? void 0 : _a["data-taskbar-divider"];
|
|
138
|
+
}
|
|
139
|
+
removeEmpty(elements) {
|
|
140
|
+
let lastElem;
|
|
141
|
+
return elements.filter(elem => {
|
|
142
|
+
if (elem == undefined) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
if (this.isDivider(lastElem) && this.isDivider(elem)) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
lastElem = elem;
|
|
149
|
+
return true;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
124
152
|
render() {
|
|
125
153
|
if (this._definitions === undefined) {
|
|
126
154
|
return undefined;
|
|
127
155
|
}
|
|
128
156
|
let index = 0;
|
|
129
|
-
return (h(Host, null, this._definitions.map((elem) => {
|
|
157
|
+
return (h(Host, null, this.removeEmpty(this._definitions.map((elem) => {
|
|
130
158
|
if (elem === TaskbarElement.DIVIDER) {
|
|
131
159
|
index = 0;
|
|
132
160
|
}
|
|
@@ -140,7 +168,7 @@ export class SnkTaskbar {
|
|
|
140
168
|
return this.getElement(index, this.customButtons.get(elem));
|
|
141
169
|
}
|
|
142
170
|
return h("slot", { name: elem });
|
|
143
|
-
})));
|
|
171
|
+
}))));
|
|
144
172
|
}
|
|
145
173
|
static get is() { return "snk-taskbar"; }
|
|
146
174
|
static get encapsulation() { return "scoped"; }
|
|
@@ -14,38 +14,38 @@ export class ConfigStorage {
|
|
|
14
14
|
application.getResourceID().then((resourceID) => {
|
|
15
15
|
const configName = application.configName;
|
|
16
16
|
ConfigStorage.resourceID = resourceID;
|
|
17
|
-
ConfigStorage.loadFormConfig(configName);
|
|
18
|
-
ConfigStorage.loadGridConfig(configName);
|
|
17
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
|
18
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
return this.instance;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
async loadFormConfig(name) {
|
|
25
25
|
if (name == undefined) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const cacheID =
|
|
29
|
-
if (!
|
|
30
|
-
|
|
28
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
|
|
29
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
|
30
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return ConfigStorage.configById.get(cacheID);
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
async loadGridConfig(name) {
|
|
35
35
|
if (name == undefined) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
const cacheID =
|
|
39
|
-
if (!
|
|
40
|
-
|
|
38
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
|
|
39
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
|
40
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return ConfigStorage.configById.get(cacheID);
|
|
43
43
|
}
|
|
44
44
|
static async saveFormConfig(config, name) {
|
|
45
45
|
if (config == undefined || name == undefined) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const cacheID = this.
|
|
48
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
|
|
49
49
|
this.configById.delete(cacheID);
|
|
50
50
|
return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
|
|
51
51
|
}
|
|
@@ -53,11 +53,11 @@ export class ConfigStorage {
|
|
|
53
53
|
if (config == undefined || name == undefined) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
const cacheID = this.
|
|
56
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
|
|
57
57
|
this.configById.delete(cacheID);
|
|
58
58
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
59
59
|
}
|
|
60
|
-
static
|
|
60
|
+
static buildCacheID(name, source) {
|
|
61
61
|
return `req_${source}_${name}_${this.resourceID}`;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -3,7 +3,8 @@ import snkFilterBarMessages from "./resources/snk-filter-bar.msg.js";
|
|
|
3
3
|
import snkTaskbarMessages from "./resources/snk-taskbar.msg.js";
|
|
4
4
|
import crudUtilsMessages from "./resources/crud-utils.msg.js";
|
|
5
5
|
import { snkFormMessages, snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg.js";
|
|
6
|
-
import { snkConfiguratorMessages
|
|
6
|
+
import { snkConfiguratorMessages } from "./resources/snk-configurator.msg.js";
|
|
7
|
+
import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg.js";
|
|
7
8
|
export class SnkMessageBuilder {
|
|
8
9
|
constructor() {
|
|
9
10
|
this._defaults = {
|
|
@@ -12,12 +13,13 @@ export class SnkMessageBuilder {
|
|
|
12
13
|
snkFormConfig: snkFormConfigMessages,
|
|
13
14
|
snkConfigOptions: snkConfigOptionsMessages,
|
|
14
15
|
snkTaskbar: snkTaskbarMessages,
|
|
15
|
-
snkConfigModal: snkConfigModalMessages,
|
|
16
16
|
snkFieldConfig: snkFieldConfigMessages,
|
|
17
17
|
snkFilterBar: snkFilterBarMessages,
|
|
18
18
|
snkConfigurator: snkConfiguratorMessages,
|
|
19
19
|
snkTabConfig: snkTabConfigMessages,
|
|
20
|
-
crudUtils: crudUtilsMessages
|
|
20
|
+
crudUtils: crudUtilsMessages,
|
|
21
|
+
snkGrid: snkGridMessages,
|
|
22
|
+
snkGridConfig: snkGridConfigMessages
|
|
21
23
|
};
|
|
22
24
|
this._currentOperation = OperationMap.CLEAN;
|
|
23
25
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export const snkConfiguratorMessages = {
|
|
2
|
-
msgSaveSuccessfully: "As configurações foram salvas com sucesso!"
|
|
3
|
-
};
|
|
4
|
-
export const snkConfigModalMessages = {
|
|
5
2
|
titleConfigurations: "Configurações",
|
|
6
3
|
subTitleModeConfig: "Modo de visualização",
|
|
7
4
|
labelConfigGrid: "Configurar grade",
|
|
@@ -52,6 +52,9 @@ export const snkFormConfigMessages = {
|
|
|
52
52
|
titleGroupExists: "Já existe um grupo com título",
|
|
53
53
|
infoValidTitle: "Por favor, digite um título válido.",
|
|
54
54
|
inTab: "na aba"
|
|
55
|
+
},
|
|
56
|
+
info: {
|
|
57
|
+
successfullyConfigSaved: "As configurações foram salvas com sucesso!"
|
|
55
58
|
}
|
|
56
59
|
};
|
|
57
60
|
export const snkFieldConfigMessages = {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const snkGridMessages = {};
|
|
2
|
+
export const snkGridConfigMessages = {
|
|
3
|
+
gridConfiguration: "Configuração da Grade",
|
|
4
|
+
columnVisibilityOrder: "Defina visibilidade e ordem das colunas.",
|
|
5
|
+
sortingSequence: "Sequência da ordenação",
|
|
6
|
+
findColumn: "Localizar coluna",
|
|
7
|
+
cancel: "Cancelar",
|
|
8
|
+
complete: "Concluir",
|
|
9
|
+
tab: {
|
|
10
|
+
columns: "Colunas",
|
|
11
|
+
lineOrdering: "Ordenação das linhas",
|
|
12
|
+
},
|
|
13
|
+
info: {
|
|
14
|
+
successfullyConfigSaved: "As configurações foram salvas com sucesso!"
|
|
15
|
+
},
|
|
16
|
+
confirm: {
|
|
17
|
+
cancel: "Descartar",
|
|
18
|
+
save: "Salvar",
|
|
19
|
+
alert: "Aviso",
|
|
20
|
+
msgCancel: "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?"
|
|
21
|
+
},
|
|
22
|
+
group: {
|
|
23
|
+
visible: "Visíveis",
|
|
24
|
+
hidden: "Ocultas"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -70,3 +70,17 @@ export const TAGS_BY_TYPE = {
|
|
|
70
70
|
INTEGERNUMBER: "ez-number-input",
|
|
71
71
|
DECIMALNUMBER: "ez-number-input"
|
|
72
72
|
};
|
|
73
|
+
export const ORDER_VALUES = {
|
|
74
|
+
none: {
|
|
75
|
+
value: "NA",
|
|
76
|
+
label: "N/A",
|
|
77
|
+
},
|
|
78
|
+
asc: {
|
|
79
|
+
value: "ASC",
|
|
80
|
+
label: "A-Z"
|
|
81
|
+
},
|
|
82
|
+
desc: {
|
|
83
|
+
value: "DESC",
|
|
84
|
+
label: "Z-A"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ErrorException, WarningException, StringUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
1
2
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
|
|
2
|
-
import { ErrorException, WarningException, StringUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
|
5
5
|
var global = typeof self !== 'undefined' ? self : commonjsGlobal;
|
|
@@ -6886,4 +6886,102 @@ var UserConfigType;
|
|
|
6886
6886
|
UserConfigType["SHARED"] = "SHARED";
|
|
6887
6887
|
})(UserConfigType || (UserConfigType = {}));
|
|
6888
6888
|
|
|
6889
|
-
|
|
6889
|
+
class GridConfigFetcher extends ResourceFetcher {
|
|
6890
|
+
constructor() {
|
|
6891
|
+
super(...arguments);
|
|
6892
|
+
this.GRID_CONFIG_VERSION = "V3:";
|
|
6893
|
+
}
|
|
6894
|
+
getConfig(_gridName, resourceID) {
|
|
6895
|
+
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
6896
|
+
return new Promise((resolve, reject) => {
|
|
6897
|
+
this.loadResource(completePath)
|
|
6898
|
+
.then(loadedResource => {
|
|
6899
|
+
let config = undefined;
|
|
6900
|
+
if (loadedResource) {
|
|
6901
|
+
config = JSON.parse(loadedResource);
|
|
6902
|
+
}
|
|
6903
|
+
resolve(config);
|
|
6904
|
+
}).catch((error) => {
|
|
6905
|
+
reject(error);
|
|
6906
|
+
});
|
|
6907
|
+
});
|
|
6908
|
+
}
|
|
6909
|
+
saveConfig(config, resourceID) {
|
|
6910
|
+
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
6911
|
+
return new Promise((resolve, reject) => {
|
|
6912
|
+
this.saveResource(config, completePath)
|
|
6913
|
+
.then((resp) => {
|
|
6914
|
+
resolve(resp);
|
|
6915
|
+
})
|
|
6916
|
+
.catch((error) => {
|
|
6917
|
+
reject(error);
|
|
6918
|
+
});
|
|
6919
|
+
});
|
|
6920
|
+
}
|
|
6921
|
+
}
|
|
6922
|
+
|
|
6923
|
+
const CONFIG_SOURCE = {
|
|
6924
|
+
form: "form",
|
|
6925
|
+
grid: "grid"
|
|
6926
|
+
};
|
|
6927
|
+
class ConfigStorage {
|
|
6928
|
+
static get() {
|
|
6929
|
+
if (!ConfigStorage.instance) {
|
|
6930
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
6931
|
+
if (application != undefined) {
|
|
6932
|
+
ConfigStorage.instance = new ConfigStorage();
|
|
6933
|
+
application.getResourceID().then((resourceID) => {
|
|
6934
|
+
const configName = application.configName;
|
|
6935
|
+
ConfigStorage.resourceID = resourceID;
|
|
6936
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
|
6937
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
|
6938
|
+
});
|
|
6939
|
+
}
|
|
6940
|
+
}
|
|
6941
|
+
return this.instance;
|
|
6942
|
+
}
|
|
6943
|
+
async loadFormConfig(name) {
|
|
6944
|
+
if (name == undefined) {
|
|
6945
|
+
return;
|
|
6946
|
+
}
|
|
6947
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
|
|
6948
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
|
6949
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
|
|
6950
|
+
}
|
|
6951
|
+
return ConfigStorage.configById.get(cacheID);
|
|
6952
|
+
}
|
|
6953
|
+
async loadGridConfig(name) {
|
|
6954
|
+
if (name == undefined) {
|
|
6955
|
+
return;
|
|
6956
|
+
}
|
|
6957
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
|
|
6958
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
|
6959
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
|
|
6960
|
+
}
|
|
6961
|
+
return ConfigStorage.configById.get(cacheID);
|
|
6962
|
+
}
|
|
6963
|
+
static async saveFormConfig(config, name) {
|
|
6964
|
+
if (config == undefined || name == undefined) {
|
|
6965
|
+
return;
|
|
6966
|
+
}
|
|
6967
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
|
|
6968
|
+
this.configById.delete(cacheID);
|
|
6969
|
+
return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
|
|
6970
|
+
}
|
|
6971
|
+
static async saveGridConfig(config, name) {
|
|
6972
|
+
if (config == undefined || name == undefined) {
|
|
6973
|
+
return;
|
|
6974
|
+
}
|
|
6975
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
|
|
6976
|
+
this.configById.delete(cacheID);
|
|
6977
|
+
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
6978
|
+
}
|
|
6979
|
+
static buildCacheID(name, source) {
|
|
6980
|
+
return `req_${source}_${name}_${this.resourceID}`;
|
|
6981
|
+
}
|
|
6982
|
+
}
|
|
6983
|
+
ConfigStorage.configById = new Map();
|
|
6984
|
+
ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
|
6985
|
+
ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
|
|
6986
|
+
|
|
6987
|
+
export { ConfigStorage as C, DataFetcher as D, FormConfigFetcher as F, GridConfigFetcher as G, ResourceFetcher as R, UrlUtils as U, UserConfigType as a, dist as d };
|
|
@@ -130,6 +130,9 @@ const snkFormConfigMessages = {
|
|
|
130
130
|
titleGroupExists: "Já existe um grupo com título",
|
|
131
131
|
infoValidTitle: "Por favor, digite um título válido.",
|
|
132
132
|
inTab: "na aba"
|
|
133
|
+
},
|
|
134
|
+
info: {
|
|
135
|
+
successfullyConfigSaved: "As configurações foram salvas com sucesso!"
|
|
133
136
|
}
|
|
134
137
|
};
|
|
135
138
|
const snkFieldConfigMessages = {
|
|
@@ -145,9 +148,6 @@ const snkTabConfigMessages = {
|
|
|
145
148
|
};
|
|
146
149
|
|
|
147
150
|
const snkConfiguratorMessages = {
|
|
148
|
-
msgSaveSuccessfully: "As configurações foram salvas com sucesso!"
|
|
149
|
-
};
|
|
150
|
-
const snkConfigModalMessages = {
|
|
151
151
|
titleConfigurations: "Configurações",
|
|
152
152
|
subTitleModeConfig: "Modo de visualização",
|
|
153
153
|
labelConfigGrid: "Configurar grade",
|
|
@@ -156,6 +156,33 @@ const snkConfigModalMessages = {
|
|
|
156
156
|
labelForm: "Formulário"
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
+
const snkGridMessages = {};
|
|
160
|
+
const snkGridConfigMessages = {
|
|
161
|
+
gridConfiguration: "Configuração da Grade",
|
|
162
|
+
columnVisibilityOrder: "Defina visibilidade e ordem das colunas.",
|
|
163
|
+
sortingSequence: "Sequência da ordenação",
|
|
164
|
+
findColumn: "Localizar coluna",
|
|
165
|
+
cancel: "Cancelar",
|
|
166
|
+
complete: "Concluir",
|
|
167
|
+
tab: {
|
|
168
|
+
columns: "Colunas",
|
|
169
|
+
lineOrdering: "Ordenação das linhas",
|
|
170
|
+
},
|
|
171
|
+
info: {
|
|
172
|
+
successfullyConfigSaved: "As configurações foram salvas com sucesso!"
|
|
173
|
+
},
|
|
174
|
+
confirm: {
|
|
175
|
+
cancel: "Descartar",
|
|
176
|
+
save: "Salvar",
|
|
177
|
+
alert: "Aviso",
|
|
178
|
+
msgCancel: "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?"
|
|
179
|
+
},
|
|
180
|
+
group: {
|
|
181
|
+
visible: "Visíveis",
|
|
182
|
+
hidden: "Ocultas"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
159
186
|
class SnkMessageBuilder {
|
|
160
187
|
constructor() {
|
|
161
188
|
this._defaults = {
|
|
@@ -164,12 +191,13 @@ class SnkMessageBuilder {
|
|
|
164
191
|
snkFormConfig: snkFormConfigMessages,
|
|
165
192
|
snkConfigOptions: snkConfigOptionsMessages,
|
|
166
193
|
snkTaskbar: snkTaskbarMessages,
|
|
167
|
-
snkConfigModal: snkConfigModalMessages,
|
|
168
194
|
snkFieldConfig: snkFieldConfigMessages,
|
|
169
195
|
snkFilterBar: snkFilterBarMessages,
|
|
170
196
|
snkConfigurator: snkConfiguratorMessages,
|
|
171
197
|
snkTabConfig: snkTabConfigMessages,
|
|
172
|
-
crudUtils: crudUtilsMessages
|
|
198
|
+
crudUtils: crudUtilsMessages,
|
|
199
|
+
snkGrid: snkGridMessages,
|
|
200
|
+
snkGridConfig: snkGridConfigMessages
|
|
173
201
|
};
|
|
174
202
|
this._currentOperation = OperationMap.CLEAN;
|
|
175
203
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -70,5 +70,19 @@ const TAGS_BY_TYPE = {
|
|
|
70
70
|
INTEGERNUMBER: "ez-number-input",
|
|
71
71
|
DECIMALNUMBER: "ez-number-input"
|
|
72
72
|
};
|
|
73
|
+
const ORDER_VALUES = {
|
|
74
|
+
none: {
|
|
75
|
+
value: "NA",
|
|
76
|
+
label: "N/A",
|
|
77
|
+
},
|
|
78
|
+
asc: {
|
|
79
|
+
value: "ASC",
|
|
80
|
+
label: "A-Z"
|
|
81
|
+
},
|
|
82
|
+
desc: {
|
|
83
|
+
value: "DESC",
|
|
84
|
+
label: "Z-A"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
73
87
|
|
|
74
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a, TAB_NAMES as b, TYPE_ACTIONS as c };
|
|
88
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a, TAB_NAMES as b, TYPE_ACTIONS as c };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* sankhyablocks custom elements */
|
|
2
2
|
export { SnkApplication as SnkApplication } from '../types/components/snk-application/snk-application';
|
|
3
|
-
export { SnkConfigModal as SnkConfigModal } from '../types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal';
|
|
4
3
|
export { SnkConfigOptions as SnkConfigOptions } from '../types/components/snk-form/subcomponents/snk-config-options/snk-config-options';
|
|
5
4
|
export { SnkConfigurator as SnkConfigurator } from '../types/components/snk-configurator/snk-configurator';
|
|
6
5
|
export { SnkCrud as SnkCrud } from '../types/components/snk-crud/snk-crud';
|
|
@@ -21,7 +20,9 @@ export { SnkFilterText as SnkFilterText } from '../types/components/snk-filter-b
|
|
|
21
20
|
export { SnkForm as SnkForm } from '../types/components/snk-form/snk-form';
|
|
22
21
|
export { SnkFormConfig as SnkFormConfig } from '../types/components/snk-form/subcomponents/snk-form-config/snk-form-config';
|
|
23
22
|
export { SnkGrid as SnkGrid } from '../types/components/snk-grid/snk-grid';
|
|
23
|
+
export { EzGridConfig as SnkGridConfig } from '../types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config';
|
|
24
24
|
export { SnkPesquisa as SnkPesquisa } from '../types/components/snk-pesquisa/snk-pesquisa';
|
|
25
|
+
export { SelectBox as SnkSelectBox } from '../types/components/snk-grid/subcomponents/snk-select-box/snk-select-box';
|
|
25
26
|
export { SnkTabConfig as SnkTabConfig } from '../types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config';
|
|
26
27
|
export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
|
|
27
28
|
export { TestePesquisa as TestePesquisa } from '../types/components/teste-pesquisa/teste-pesquisa';
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
2
|
export { SnkApplication, defineCustomElement as defineCustomElementSnkApplication } from './snk-application.js';
|
|
3
|
-
export { SnkConfigModal, defineCustomElement as defineCustomElementSnkConfigModal } from './snk-config-modal.js';
|
|
4
3
|
export { SnkConfigOptions, defineCustomElement as defineCustomElementSnkConfigOptions } from './snk-config-options.js';
|
|
5
4
|
export { SnkConfigurator, defineCustomElement as defineCustomElementSnkConfigurator } from './snk-configurator.js';
|
|
6
5
|
export { SnkCrud, defineCustomElement as defineCustomElementSnkCrud } from './snk-crud.js';
|
|
@@ -21,7 +20,9 @@ export { SnkFilterText, defineCustomElement as defineCustomElementSnkFilterText
|
|
|
21
20
|
export { SnkForm, defineCustomElement as defineCustomElementSnkForm } from './snk-form.js';
|
|
22
21
|
export { SnkFormConfig, defineCustomElement as defineCustomElementSnkFormConfig } from './snk-form-config.js';
|
|
23
22
|
export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './snk-grid.js';
|
|
23
|
+
export { SnkGridConfig, defineCustomElement as defineCustomElementSnkGridConfig } from './snk-grid-config.js';
|
|
24
24
|
export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
|
|
25
|
+
export { SnkSelectBox, defineCustomElement as defineCustomElementSnkSelectBox } from './snk-select-box.js';
|
|
25
26
|
export { SnkTabConfig, defineCustomElement as defineCustomElementSnkTabConfig } from './snk-tab-config.js';
|
|
26
27
|
export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
|
|
27
28
|
export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
|
-
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher } from './
|
|
3
|
+
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage.js';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
@@ -227,6 +227,7 @@ class DataUnitFetcher {
|
|
|
227
227
|
dataType
|
|
228
228
|
userInterface
|
|
229
229
|
calculated
|
|
230
|
+
group
|
|
230
231
|
properties{
|
|
231
232
|
name
|
|
232
233
|
value
|
|
@@ -546,40 +547,6 @@ class ParametersFetcher {
|
|
|
546
547
|
|
|
547
548
|
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
|
548
549
|
|
|
549
|
-
class GridConfigFetcher extends ResourceFetcher {
|
|
550
|
-
constructor() {
|
|
551
|
-
super(...arguments);
|
|
552
|
-
this.GRID_CONFIG_VERSION = "V3:";
|
|
553
|
-
}
|
|
554
|
-
getConfig(_gridName, resourceID) {
|
|
555
|
-
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
556
|
-
return new Promise((resolve, reject) => {
|
|
557
|
-
this.loadResource(completePath)
|
|
558
|
-
.then(loadedResource => {
|
|
559
|
-
let config = undefined;
|
|
560
|
-
if (loadedResource) {
|
|
561
|
-
config = JSON.parse(loadedResource);
|
|
562
|
-
}
|
|
563
|
-
resolve(config);
|
|
564
|
-
}).catch((error) => {
|
|
565
|
-
reject(error);
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
saveConfig(config, resourceID) {
|
|
570
|
-
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
571
|
-
return new Promise((resolve, reject) => {
|
|
572
|
-
this.saveResource(config, completePath)
|
|
573
|
-
.then((resp) => {
|
|
574
|
-
resolve(resp);
|
|
575
|
-
})
|
|
576
|
-
.catch((error) => {
|
|
577
|
-
reject(error);
|
|
578
|
-
});
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
550
|
class AuthFetcher extends ResourceFetcher {
|
|
584
551
|
getData(resourceID) {
|
|
585
552
|
const completePath = `cfg://auth/${resourceID}`;
|
|
@@ -867,7 +834,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
867
834
|
}
|
|
868
835
|
/**
|
|
869
836
|
* Retorna a configuração de um recurso por service broker
|
|
870
|
-
* Veja também o método "loadConfig"
|
|
871
837
|
*/
|
|
872
838
|
async getConfig(key) {
|
|
873
839
|
let payload = {
|
|
@@ -1257,6 +1223,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1257
1223
|
});
|
|
1258
1224
|
}
|
|
1259
1225
|
ErrorTracking.init();
|
|
1226
|
+
ConfigStorage.get();
|
|
1260
1227
|
this.getDefaultValues().then((defaultValues) => {
|
|
1261
1228
|
this._defaultValues = defaultValues;
|
|
1262
1229
|
});
|
|
@@ -1275,7 +1242,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1275
1242
|
});
|
|
1276
1243
|
}
|
|
1277
1244
|
render() {
|
|
1278
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "
|
|
1245
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
|
1279
1246
|
}
|
|
1280
1247
|
static get style() { return snkApplicationCss; }
|
|
1281
1248
|
}, [2, "snk-application", {
|