@sankhyalabs/sankhyablocks 3.4.0 → 3.4.2
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-8b5e3261.js → ConfigStorage-cfac5a0b.js} +184 -36
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -111
- package/dist/cjs/snk-configurator_3.cjs.entry.js +9 -8
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +23 -33
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -5
- package/dist/cjs/snk-form.cjs.entry.js +10 -12
- package/dist/collection/components/snk-application/snk-application.js +2 -129
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +15 -12
- package/dist/collection/components/snk-form/snk-form.js +9 -11
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +2 -4
- package/dist/collection/components/snk-grid/snk-grid.js +8 -7
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +23 -45
- package/dist/collection/lib/configs/ConfigStorage.js +22 -12
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +49 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +8 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +23 -18
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +11 -5
- package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js +1 -0
- package/dist/collection/lib/http/data-fetcher/recaller/DataFetcherRecaller.js +14 -0
- package/dist/components/ConfigStorage.js +123 -35
- package/dist/components/DataFetcher.js +62 -2
- package/dist/components/index.d.ts +1 -1
- package/dist/components/snk-application2.js +0 -113
- package/dist/components/snk-filter-bar2.js +15 -12
- package/dist/components/snk-form-config2.js +2 -4
- package/dist/components/snk-form2.js +9 -11
- package/dist/components/snk-grid-config.js +2 -2
- package/dist/components/snk-grid-config2.js +9 -21
- package/dist/components/snk-grid2.js +8 -7
- package/dist/esm/{ConfigStorage-4654f57b.js → ConfigStorage-77bd9902.js} +185 -37
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -111
- package/dist/esm/snk-configurator_3.entry.js +9 -8
- package/dist/esm/snk-data-exporter_8.entry.js +23 -33
- package/dist/esm/snk-form-config.entry.js +3 -5
- package/dist/esm/snk-form.entry.js +10 -12
- package/dist/sankhyablocks/p-032e1308.entry.js +1 -0
- package/dist/sankhyablocks/{p-e906ba66.entry.js → p-32f9dc8a.entry.js} +5 -5
- package/dist/sankhyablocks/p-43c135c4.entry.js +1 -0
- package/dist/sankhyablocks/{p-f559c71a.entry.js → p-705b7671.entry.js} +1 -1
- package/dist/sankhyablocks/{p-93d8ea09.js → p-bbd0cf7a.js} +6 -6
- package/dist/sankhyablocks/p-db6d6b59.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -16
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -2
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +5 -5
- package/dist/types/components.d.ts +8 -16
- package/dist/types/lib/configs/ConfigStorage.d.ts +7 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -1
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/interfaces/IClientEventResponse.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/recaller/DataFetcherRecaller.d.ts +7 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-125c2d01.entry.js +0 -1
- package/dist/sankhyablocks/p-a2ea13ed.entry.js +0 -1
- package/dist/sankhyablocks/p-b326cf51.entry.js +0 -1
|
@@ -6437,6 +6437,20 @@ class UrlUtils {
|
|
|
6437
6437
|
}
|
|
6438
6438
|
}
|
|
6439
6439
|
|
|
6440
|
+
class DataFetcherRecaller {
|
|
6441
|
+
constructor(serviceName, requestBody, callback) {
|
|
6442
|
+
this.serviceName = serviceName;
|
|
6443
|
+
this.requestBody = requestBody;
|
|
6444
|
+
this.callback = callback;
|
|
6445
|
+
}
|
|
6446
|
+
reCall(requestBody) {
|
|
6447
|
+
if (requestBody) {
|
|
6448
|
+
this.requestBody = requestBody;
|
|
6449
|
+
}
|
|
6450
|
+
DataFetcher.get().callServiceBroker(this.serviceName, this.requestBody);
|
|
6451
|
+
}
|
|
6452
|
+
}
|
|
6453
|
+
|
|
6440
6454
|
class DataFetcher {
|
|
6441
6455
|
constructor() {
|
|
6442
6456
|
this.GRAPHQL_PATH = "/mge/graphql";
|
|
@@ -6536,14 +6550,44 @@ class DataFetcher {
|
|
|
6536
6550
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6537
6551
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6538
6552
|
const http = new XMLHttpRequest();
|
|
6553
|
+
var payloadJson = {};
|
|
6554
|
+
if ('string' == typeof payload) {
|
|
6555
|
+
payload = core.ObjectUtils.stringToObject(payload);
|
|
6556
|
+
}
|
|
6557
|
+
if (!payload.hasOwnProperty('requestBody')) {
|
|
6558
|
+
payloadJson['requestBody'] = payload;
|
|
6559
|
+
}
|
|
6560
|
+
else {
|
|
6561
|
+
payloadJson = payload;
|
|
6562
|
+
}
|
|
6563
|
+
for (let [key] of DataFetcher.clientEventsByID) {
|
|
6564
|
+
if (!payloadJson['requestBody'].hasOwnProperty('clientEventList')) {
|
|
6565
|
+
payloadJson['requestBody']['clientEventList'] = {
|
|
6566
|
+
clientEvent: []
|
|
6567
|
+
};
|
|
6568
|
+
}
|
|
6569
|
+
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
6570
|
+
}
|
|
6539
6571
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6540
6572
|
http.open("POST", url, true);
|
|
6541
6573
|
http.withCredentials = true;
|
|
6542
|
-
http.send(
|
|
6574
|
+
http.send(core.ObjectUtils.objectToString(payloadJson));
|
|
6543
6575
|
http.onreadystatechange = function () {
|
|
6544
6576
|
if (this.readyState == 4 && this.status == 200) {
|
|
6545
6577
|
try {
|
|
6546
6578
|
const jsonResp = JSON.parse(this.responseText);
|
|
6579
|
+
if (jsonResp.hasOwnProperty('clientEvents')) {
|
|
6580
|
+
jsonResp.clientEvents.forEach(clientEvent => {
|
|
6581
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
|
6582
|
+
var handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
|
6583
|
+
handlers.forEach(handler => {
|
|
6584
|
+
handler({ id: clientEvent.id, content: clientEvent }, new DataFetcherRecaller(serviceName, payloadJson, accept));
|
|
6585
|
+
});
|
|
6586
|
+
}
|
|
6587
|
+
});
|
|
6588
|
+
if (jsonResp.status == 4)
|
|
6589
|
+
return;
|
|
6590
|
+
}
|
|
6547
6591
|
if (jsonResp.status == 1) {
|
|
6548
6592
|
accept(jsonResp.responseBody);
|
|
6549
6593
|
}
|
|
@@ -6666,9 +6710,25 @@ class DataFetcher {
|
|
|
6666
6710
|
error.index = Number(requestIndex);
|
|
6667
6711
|
return error;
|
|
6668
6712
|
}
|
|
6713
|
+
static addClientEvent(eventID, handler) {
|
|
6714
|
+
let clientEvent = DataFetcher.clientEventsByID.get(eventID);
|
|
6715
|
+
if (clientEvent != undefined) {
|
|
6716
|
+
clientEvent.push(handler);
|
|
6717
|
+
}
|
|
6718
|
+
else {
|
|
6719
|
+
DataFetcher.clientEventsByID.set(eventID, [handler]);
|
|
6720
|
+
}
|
|
6721
|
+
}
|
|
6722
|
+
static hasClientEvent(eventID) {
|
|
6723
|
+
return DataFetcher.clientEventsByID.has(eventID);
|
|
6724
|
+
}
|
|
6725
|
+
static removeClientEvent(eventID) {
|
|
6726
|
+
return DataFetcher.clientEventsByID.delete(eventID);
|
|
6727
|
+
}
|
|
6669
6728
|
}
|
|
6670
6729
|
DataFetcher.appTagName = "snk-application";
|
|
6671
6730
|
DataFetcher.requestListener = [];
|
|
6731
|
+
DataFetcher.clientEventsByID = new Map();
|
|
6672
6732
|
class WaitingRequest {
|
|
6673
6733
|
constructor(req) {
|
|
6674
6734
|
this._resolve = () => { };
|
|
@@ -6786,15 +6846,17 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6786
6846
|
}
|
|
6787
6847
|
loadFormConfig(formName, resourceID) {
|
|
6788
6848
|
return new Promise((accept, reject) => {
|
|
6789
|
-
|
|
6790
|
-
.
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
}
|
|
6849
|
+
Promise.all([
|
|
6850
|
+
this.loadResource(this.getPath(resourceID, formName))
|
|
6851
|
+
])
|
|
6852
|
+
.then(([configAsString]) => {
|
|
6853
|
+
const config = configAsString ? JSON.parse(configAsString) : {};
|
|
6854
|
+
const { tabs, fields } = config;
|
|
6855
|
+
if (tabs) {
|
|
6856
|
+
const allTabs = new Map(tabs.map(t => [t.label, t]));
|
|
6857
|
+
fields === null || fields === void 0 ? void 0 : fields.forEach(f => { var _a; return f.tab = ((_a = allTabs.get(this.getTabName(f.tab))) === null || _a === void 0 ? void 0 : _a.label) || allTabs.get(this.getTabName(f.tab)); });
|
|
6858
|
+
}
|
|
6859
|
+
if (fields) {
|
|
6798
6860
|
config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
|
6799
6861
|
if ("readonly" in field) {
|
|
6800
6862
|
const readOnly = field['readonly'] === true;
|
|
@@ -6803,11 +6865,8 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6803
6865
|
}
|
|
6804
6866
|
return field;
|
|
6805
6867
|
});
|
|
6806
|
-
accept(config);
|
|
6807
|
-
}
|
|
6808
|
-
else {
|
|
6809
|
-
reject(`Sem configuração pro formulário "${formName}".`);
|
|
6810
6868
|
}
|
|
6869
|
+
accept(config);
|
|
6811
6870
|
})
|
|
6812
6871
|
.catch((error) => {
|
|
6813
6872
|
reject(error);
|
|
@@ -6821,11 +6880,11 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6821
6880
|
return tab; //string type
|
|
6822
6881
|
}
|
|
6823
6882
|
saveConfig(config, formName, resourceID) {
|
|
6824
|
-
const completePath =
|
|
6883
|
+
const completePath = this.getPath(resourceID, formName);
|
|
6825
6884
|
return new Promise((resolve, reject) => {
|
|
6826
6885
|
this.saveResource(config, completePath)
|
|
6827
6886
|
.then((resp) => {
|
|
6828
|
-
resolve(resp);
|
|
6887
|
+
resolve(JSON.parse(resp.resource));
|
|
6829
6888
|
})
|
|
6830
6889
|
.catch((error) => {
|
|
6831
6890
|
reject(error);
|
|
@@ -6833,7 +6892,7 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6833
6892
|
});
|
|
6834
6893
|
}
|
|
6835
6894
|
fetchUserAvailableConfigs(formName, resourceID) {
|
|
6836
|
-
const name =
|
|
6895
|
+
const name = this.getPath(resourceID, formName);
|
|
6837
6896
|
return new Promise((resolve, reject) => {
|
|
6838
6897
|
DataFetcher.get()
|
|
6839
6898
|
.callGraphQL({
|
|
@@ -6849,7 +6908,7 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6849
6908
|
});
|
|
6850
6909
|
}
|
|
6851
6910
|
fetchLegacyConfig(formName, resourceID) {
|
|
6852
|
-
const name =
|
|
6911
|
+
const name = this.getPath(resourceID, formName);
|
|
6853
6912
|
return new Promise((resolve, reject) => {
|
|
6854
6913
|
DataFetcher.get()
|
|
6855
6914
|
.callGraphQL({
|
|
@@ -6865,7 +6924,7 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6865
6924
|
});
|
|
6866
6925
|
}
|
|
6867
6926
|
fetchDefaultConfig(formName, resourceID) {
|
|
6868
|
-
const name =
|
|
6927
|
+
const name = this.getPath(resourceID, formName);
|
|
6869
6928
|
return new Promise((resolve, reject) => {
|
|
6870
6929
|
DataFetcher.get()
|
|
6871
6930
|
.callGraphQL({
|
|
@@ -6880,6 +6939,12 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6880
6939
|
});
|
|
6881
6940
|
});
|
|
6882
6941
|
}
|
|
6942
|
+
getPath(resourceID, name, authority = "form") {
|
|
6943
|
+
if (name) {
|
|
6944
|
+
return `cfg://${authority}/${resourceID}/${name}`;
|
|
6945
|
+
}
|
|
6946
|
+
return `cfg://${authority}/${resourceID}`;
|
|
6947
|
+
}
|
|
6883
6948
|
}
|
|
6884
6949
|
exports.UserConfigType = void 0;
|
|
6885
6950
|
(function (UserConfigType) {
|
|
@@ -6893,8 +6958,8 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
6893
6958
|
super(...arguments);
|
|
6894
6959
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
6895
6960
|
}
|
|
6896
|
-
getConfig(
|
|
6897
|
-
const completePath =
|
|
6961
|
+
getConfig(gridName, resourceID) {
|
|
6962
|
+
const completePath = this.getPath(resourceID, gridName);
|
|
6898
6963
|
return new Promise((resolve, reject) => {
|
|
6899
6964
|
this.loadResource(completePath)
|
|
6900
6965
|
.then(loadedResource => {
|
|
@@ -6908,23 +6973,98 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
6908
6973
|
});
|
|
6909
6974
|
});
|
|
6910
6975
|
}
|
|
6911
|
-
saveConfig(config, resourceID) {
|
|
6912
|
-
const completePath =
|
|
6976
|
+
saveConfig(config, gridName, resourceID) {
|
|
6977
|
+
const completePath = this.getPath(resourceID, gridName);
|
|
6913
6978
|
return new Promise((resolve, reject) => {
|
|
6914
6979
|
this.saveResource(config, completePath)
|
|
6915
6980
|
.then((resp) => {
|
|
6916
|
-
resolve(resp);
|
|
6981
|
+
resolve(JSON.parse(resp.resource));
|
|
6982
|
+
})
|
|
6983
|
+
.catch((error) => {
|
|
6984
|
+
reject(error);
|
|
6985
|
+
});
|
|
6986
|
+
});
|
|
6987
|
+
}
|
|
6988
|
+
getPath(resourceID, name) {
|
|
6989
|
+
if (name) {
|
|
6990
|
+
return `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}/${name}`;
|
|
6991
|
+
}
|
|
6992
|
+
return `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
6993
|
+
}
|
|
6994
|
+
}
|
|
6995
|
+
|
|
6996
|
+
function normalizeValue(value) {
|
|
6997
|
+
if (value == undefined) {
|
|
6998
|
+
return value;
|
|
6999
|
+
}
|
|
7000
|
+
if (value instanceof Date) {
|
|
7001
|
+
return value.toISOString();
|
|
7002
|
+
}
|
|
7003
|
+
if (typeof value === "object") {
|
|
7004
|
+
if (value instanceof Array) {
|
|
7005
|
+
return value.map(item => normalizeValue(item));
|
|
7006
|
+
}
|
|
7007
|
+
else {
|
|
7008
|
+
const normalized = Object.assign({}, value);
|
|
7009
|
+
Object.keys(value).forEach(prop => {
|
|
7010
|
+
if (value[prop]) {
|
|
7011
|
+
normalized[prop] = normalizeValue(value[prop]);
|
|
7012
|
+
}
|
|
7013
|
+
else {
|
|
7014
|
+
delete normalized[prop];
|
|
7015
|
+
}
|
|
7016
|
+
});
|
|
7017
|
+
return normalized;
|
|
7018
|
+
}
|
|
7019
|
+
}
|
|
7020
|
+
return value;
|
|
7021
|
+
}
|
|
7022
|
+
class FilterBarConfigFetcher extends ResourceFetcher {
|
|
7023
|
+
saveConfig(items, resourceID, configName) {
|
|
7024
|
+
const state = items.map(item => {
|
|
7025
|
+
const { id, value, fixed, visible } = item;
|
|
7026
|
+
const stateItem = { id };
|
|
7027
|
+
if (value) {
|
|
7028
|
+
stateItem["value"] = normalizeValue(value);
|
|
7029
|
+
}
|
|
7030
|
+
if (fixed) {
|
|
7031
|
+
stateItem["fixed"] = fixed;
|
|
7032
|
+
}
|
|
7033
|
+
if (visible) {
|
|
7034
|
+
stateItem["visible"] = true;
|
|
7035
|
+
}
|
|
7036
|
+
return stateItem;
|
|
7037
|
+
});
|
|
7038
|
+
return this.saveResource(state, this.getPath(resourceID, configName));
|
|
7039
|
+
}
|
|
7040
|
+
getConfig(resourceID, configName) {
|
|
7041
|
+
return new Promise((accept, reject) => {
|
|
7042
|
+
this.loadResource(this.getPath(resourceID, configName))
|
|
7043
|
+
.then((configAsString) => {
|
|
7044
|
+
let fieldsList;
|
|
7045
|
+
if (configAsString) {
|
|
7046
|
+
const filterBarConfig = JSON.parse(configAsString);
|
|
7047
|
+
fieldsList = filterBarConfig.items;
|
|
7048
|
+
}
|
|
7049
|
+
accept(fieldsList || []);
|
|
6917
7050
|
})
|
|
6918
7051
|
.catch((error) => {
|
|
6919
7052
|
reject(error);
|
|
6920
7053
|
});
|
|
6921
7054
|
});
|
|
6922
7055
|
}
|
|
7056
|
+
getPath(resourceID, name) {
|
|
7057
|
+
if (name) {
|
|
7058
|
+
return `cfg://filter/FilterBarState:${resourceID}/${name}`;
|
|
7059
|
+
}
|
|
7060
|
+
return `cfg://filter/FilterBarState:${resourceID}`;
|
|
7061
|
+
}
|
|
6923
7062
|
}
|
|
6924
7063
|
|
|
6925
7064
|
const CONFIG_SOURCE = {
|
|
6926
7065
|
form: "form",
|
|
6927
|
-
grid: "grid"
|
|
7066
|
+
grid: "grid",
|
|
7067
|
+
filterBar: "filterBar"
|
|
6928
7068
|
};
|
|
6929
7069
|
class ConfigStorage {
|
|
6930
7070
|
static async get() {
|
|
@@ -6935,16 +7075,21 @@ class ConfigStorage {
|
|
|
6935
7075
|
const resourceID = await application.getResourceID();
|
|
6936
7076
|
ConfigStorage.instance = new ConfigStorage();
|
|
6937
7077
|
ConfigStorage.resourceID = resourceID;
|
|
7078
|
+
ConfigStorage.instance.loadFilterBarConfig(configName);
|
|
6938
7079
|
ConfigStorage.instance.loadFormConfig(configName);
|
|
6939
7080
|
ConfigStorage.instance.loadGridConfig(configName);
|
|
6940
7081
|
}
|
|
6941
7082
|
}
|
|
6942
7083
|
return this.instance;
|
|
6943
7084
|
}
|
|
6944
|
-
async
|
|
6945
|
-
|
|
6946
|
-
|
|
7085
|
+
async loadFilterBarConfig(name) {
|
|
7086
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
|
7087
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
|
7088
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(ConfigStorage.resourceID, name));
|
|
6947
7089
|
}
|
|
7090
|
+
return ConfigStorage.configById.get(cacheID);
|
|
7091
|
+
}
|
|
7092
|
+
async loadFormConfig(name) {
|
|
6948
7093
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
|
|
6949
7094
|
if (!ConfigStorage.configById.has(cacheID)) {
|
|
6950
7095
|
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
|
|
@@ -6952,36 +7097,39 @@ class ConfigStorage {
|
|
|
6952
7097
|
return ConfigStorage.configById.get(cacheID);
|
|
6953
7098
|
}
|
|
6954
7099
|
async loadGridConfig(name) {
|
|
6955
|
-
if (name == undefined) {
|
|
6956
|
-
return;
|
|
6957
|
-
}
|
|
6958
7100
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
|
|
6959
7101
|
if (!ConfigStorage.configById.has(cacheID)) {
|
|
6960
7102
|
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
|
|
6961
7103
|
}
|
|
6962
7104
|
return ConfigStorage.configById.get(cacheID);
|
|
6963
7105
|
}
|
|
7106
|
+
static async saveFilterBarConfig(config, name) {
|
|
7107
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
|
7108
|
+
this.configById.delete(cacheID);
|
|
7109
|
+
return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
|
|
7110
|
+
}
|
|
6964
7111
|
static async saveFormConfig(config, name) {
|
|
6965
|
-
if (config == undefined || name == undefined) {
|
|
6966
|
-
return;
|
|
6967
|
-
}
|
|
6968
7112
|
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
|
|
6969
7113
|
this.configById.delete(cacheID);
|
|
6970
7114
|
return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
|
|
6971
7115
|
}
|
|
6972
7116
|
static async saveGridConfig(config, name) {
|
|
6973
|
-
if (config == undefined
|
|
7117
|
+
if (config == undefined) {
|
|
6974
7118
|
return;
|
|
6975
7119
|
}
|
|
6976
7120
|
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
|
|
6977
7121
|
this.configById.delete(cacheID);
|
|
6978
|
-
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7122
|
+
return this.gridConfigFetcher.saveConfig(config, name, this.resourceID);
|
|
6979
7123
|
}
|
|
6980
7124
|
static buildCacheID(name, source) {
|
|
7125
|
+
if (name == undefined) {
|
|
7126
|
+
return `req_${source}_${this.resourceID}`;
|
|
7127
|
+
}
|
|
6981
7128
|
return `req_${source}_${name}_${this.resourceID}`;
|
|
6982
7129
|
}
|
|
6983
7130
|
}
|
|
6984
7131
|
ConfigStorage.configById = new Map();
|
|
7132
|
+
ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
|
|
6985
7133
|
ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
|
6986
7134
|
ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
|
|
6987
7135
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-param-config.cjs",[[2,"snk-filter-param-config",{"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-exporter-email-sender.cjs",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config.cjs",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-data-exporter_8.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"
|
|
17
|
+
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-param-config.cjs",[[2,"snk-filter-param-config",{"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-exporter-email-sender.cjs",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config.cjs",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-data-exporter_8.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-crud.cjs",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-param-config.cjs",[[2,"snk-filter-param-config",{"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-exporter-email-sender.cjs",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config.cjs",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-data-exporter_8.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"
|
|
20
|
+
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-param-config.cjs",[[2,"snk-filter-param-config",{"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-exporter-email-sender.cjs",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config.cjs",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-data-exporter_8.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-crud.cjs",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
7
|
+
const ConfigStorage = require('./ConfigStorage-cfac5a0b.js');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
const SnkMessageBuilder = require('./SnkMessageBuilder-e6dee2c2.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
@@ -626,68 +626,6 @@ var AutorizationType;
|
|
|
626
626
|
AutorizationType["CONFIG_GRID"] = "G";
|
|
627
627
|
})(AutorizationType || (AutorizationType = {}));
|
|
628
628
|
|
|
629
|
-
function normalizeValue(value) {
|
|
630
|
-
if (value == undefined) {
|
|
631
|
-
return value;
|
|
632
|
-
}
|
|
633
|
-
if (value instanceof Date) {
|
|
634
|
-
return value.toISOString();
|
|
635
|
-
}
|
|
636
|
-
if (typeof value === "object") {
|
|
637
|
-
if (value instanceof Array) {
|
|
638
|
-
return value.map(item => normalizeValue(item));
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
const normalized = Object.assign({}, value);
|
|
642
|
-
Object.keys(value).forEach(prop => {
|
|
643
|
-
if (value[prop]) {
|
|
644
|
-
normalized[prop] = normalizeValue(value[prop]);
|
|
645
|
-
}
|
|
646
|
-
else {
|
|
647
|
-
delete normalized[prop];
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
return normalized;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
return value;
|
|
654
|
-
}
|
|
655
|
-
class FilterBarConfigFetcher extends ConfigStorage.ResourceFetcher {
|
|
656
|
-
saveConfig(items, resourceID, configName) {
|
|
657
|
-
const state = items.map(item => {
|
|
658
|
-
const { id, value, fixed, visible } = item;
|
|
659
|
-
const stateItem = { id };
|
|
660
|
-
if (value) {
|
|
661
|
-
stateItem["value"] = normalizeValue(value);
|
|
662
|
-
}
|
|
663
|
-
if (fixed) {
|
|
664
|
-
stateItem["fixed"] = fixed;
|
|
665
|
-
}
|
|
666
|
-
if (visible) {
|
|
667
|
-
stateItem["visible"] = true;
|
|
668
|
-
}
|
|
669
|
-
return stateItem;
|
|
670
|
-
});
|
|
671
|
-
return this.saveResource(state, `cfg://filter/FilterBarState:${resourceID}/${configName}`);
|
|
672
|
-
}
|
|
673
|
-
getConfig(resourceID, configName) {
|
|
674
|
-
return new Promise((accept, reject) => {
|
|
675
|
-
this.loadResource(`cfg://filter/FilterBarState:${resourceID}/${configName}`)
|
|
676
|
-
.then((configAsString) => {
|
|
677
|
-
let fieldsList;
|
|
678
|
-
if (configAsString) {
|
|
679
|
-
const filterBarConfig = JSON.parse(configAsString);
|
|
680
|
-
fieldsList = filterBarConfig.items;
|
|
681
|
-
}
|
|
682
|
-
accept(fieldsList || []);
|
|
683
|
-
})
|
|
684
|
-
.catch((error) => {
|
|
685
|
-
reject(error);
|
|
686
|
-
});
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
629
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
692
630
|
|
|
693
631
|
const SnkApplication = class {
|
|
@@ -1075,38 +1013,6 @@ const SnkApplication = class {
|
|
|
1075
1013
|
async loadTotals(name, resourceID, filters) {
|
|
1076
1014
|
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
|
1077
1015
|
}
|
|
1078
|
-
/**
|
|
1079
|
-
* Salva a configuração de grade.
|
|
1080
|
-
*/
|
|
1081
|
-
async saveGridConfig(config) {
|
|
1082
|
-
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Obtém as configurações da barra de filtros
|
|
1086
|
-
*/
|
|
1087
|
-
async getFilterBarConfig(name) {
|
|
1088
|
-
return new Promise((accept, reject) => {
|
|
1089
|
-
if (this.configName === name && this._filterBarConfig) {
|
|
1090
|
-
accept(this._filterBarConfig);
|
|
1091
|
-
}
|
|
1092
|
-
else if (this.configName === name && this._filterConfigPromise != undefined) {
|
|
1093
|
-
Promise.all([this._filterConfigPromise])
|
|
1094
|
-
.then(result => accept(result[0]))
|
|
1095
|
-
.catch(reason => reject(reason[0]));
|
|
1096
|
-
}
|
|
1097
|
-
else {
|
|
1098
|
-
this.filterBarConfigFetcher.getConfig(this.resourceID, name)
|
|
1099
|
-
.then(config => accept(config))
|
|
1100
|
-
.catch(reason => reject(reason));
|
|
1101
|
-
}
|
|
1102
|
-
});
|
|
1103
|
-
}
|
|
1104
|
-
/**
|
|
1105
|
-
* Salva as configurações da barra de filtros
|
|
1106
|
-
*/
|
|
1107
|
-
async saveFilterBarConfig(config, name) {
|
|
1108
|
-
return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
|
|
1109
|
-
}
|
|
1110
1016
|
/**
|
|
1111
1017
|
* Salva a configuração de formulário.
|
|
1112
1018
|
*/
|
|
@@ -1170,12 +1076,6 @@ const SnkApplication = class {
|
|
|
1170
1076
|
}
|
|
1171
1077
|
return this._authFetcher;
|
|
1172
1078
|
}
|
|
1173
|
-
get filterBarConfigFetcher() {
|
|
1174
|
-
if (!this._filterBarConfigFetcher) {
|
|
1175
|
-
this._filterBarConfigFetcher = new FilterBarConfigFetcher();
|
|
1176
|
-
}
|
|
1177
|
-
return this._filterBarConfigFetcher;
|
|
1178
|
-
}
|
|
1179
1079
|
get defaultValuesFetcher() {
|
|
1180
1080
|
if (!this._defaultValuesFetcher) {
|
|
1181
1081
|
this._defaultValuesFetcher = new DefaultValuesFetcher();
|
|
@@ -1283,16 +1183,6 @@ const SnkApplication = class {
|
|
|
1283
1183
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
1284
1184
|
});
|
|
1285
1185
|
core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
1286
|
-
if (this.configName) {
|
|
1287
|
-
this._filterConfigPromise = new Promise((accept, reject) => {
|
|
1288
|
-
this.filterBarConfigFetcher.getConfig(this.resourceID, this.configName)
|
|
1289
|
-
.then(config => {
|
|
1290
|
-
this._filterBarConfig = config;
|
|
1291
|
-
accept(config);
|
|
1292
|
-
})
|
|
1293
|
-
.catch(reason => reject(reason));
|
|
1294
|
-
});
|
|
1295
|
-
}
|
|
1296
1186
|
core.ErrorTracking.init();
|
|
1297
1187
|
ConfigStorage.ConfigStorage.get();
|
|
1298
1188
|
this.getDefaultValues().then((defaultValues) => {
|