@sankhyalabs/sankhyablocks 8.15.0-dev.7 → 8.15.0-dev.8
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-8009ecb2.js → ConfigStorage-302bbbd4.js} +24 -14
- package/dist/cjs/{SnkFormConfigManager-7d850fbc.js → SnkFormConfigManager-71c4768e.js} +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +1 -1
- package/dist/cjs/{snk-guides-viewer-e7f76399.js → snk-guides-viewer-c8b9374f.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +5 -2
- package/dist/collection/lib/configs/ConfigStorage.js +24 -14
- package/dist/components/ConfigStorage.js +24 -14
- package/dist/components/snk-filter-bar2.js +5 -2
- package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-4151acc8.js} +24 -14
- package/dist/esm/{SnkFormConfigManager-9be0e7d4.js → SnkFormConfigManager-5c7d3771.js} +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +3 -3
- package/dist/esm/snk-filter-bar.entry.js +6 -3
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +1 -1
- package/dist/esm/{snk-guides-viewer-c7aaf02a.js → snk-guides-viewer-8da24475.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/sankhyablocks/{p-fd8814b9.entry.js → p-1d75d9f9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-776ee8e3.js → p-573a07c5.js} +1 -1
- package/dist/sankhyablocks/{p-11081798.entry.js → p-761ed32f.entry.js} +1 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +1 -0
- package/dist/sankhyablocks/{p-f514913b.entry.js → p-7f3c7b09.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c627ba91.entry.js → p-a9e4bb55.entry.js} +1 -1
- package/dist/sankhyablocks/{p-dc8b6418.entry.js → p-aa0ae6bc.entry.js} +1 -1
- package/dist/sankhyablocks/p-aa95fb2c.js +56 -0
- package/dist/sankhyablocks/{p-809f367d.entry.js → p-b05ab13d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8c243e7e.entry.js → p-ba3d3fa9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8d16f9ce.js → p-c6e477ff.js} +1 -1
- package/dist/sankhyablocks/{p-3520c088.entry.js → p-e0fd9555.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-585294ee.js +0 -56
- package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
@@ -353,11 +353,12 @@ class PersonalizedFilterFetcher {
|
|
353
353
|
}
|
354
354
|
}
|
355
355
|
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
356
|
+
var CONFIG_SOURCE;
|
357
|
+
(function (CONFIG_SOURCE) {
|
358
|
+
CONFIG_SOURCE["form"] = "form";
|
359
|
+
CONFIG_SOURCE["grid"] = "grid";
|
360
|
+
CONFIG_SOURCE["filterBar"] = "filterBar";
|
361
|
+
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
361
362
|
class ConfigStorage {
|
362
363
|
static preload(resourceID, configName) {
|
363
364
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
@@ -385,13 +386,11 @@ class ConfigStorage {
|
|
385
386
|
return ConfigStorage.configById.get(cacheID);
|
386
387
|
}
|
387
388
|
static async saveFilterBarConfig(config, name, resourceID) {
|
388
|
-
|
389
|
-
this.configById.delete(cacheID);
|
389
|
+
await this.deleteFilterBarConfigCache(name, resourceID);
|
390
390
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
391
391
|
}
|
392
392
|
static async saveFormConfig(config, name, resourceID) {
|
393
|
-
|
394
|
-
this.configById.delete(cacheID);
|
393
|
+
await this.deleteFormConfigCache(name, resourceID);
|
395
394
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
396
395
|
}
|
397
396
|
static async saveCardState(config, name, resourceID) {
|
@@ -401,18 +400,16 @@ class ConfigStorage {
|
|
401
400
|
if (config == undefined) {
|
402
401
|
return;
|
403
402
|
}
|
404
|
-
|
405
|
-
this.configById.delete(cacheID);
|
403
|
+
await this.deleteGridConfigCache(name, resourceID);
|
406
404
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
407
405
|
}
|
408
406
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
409
407
|
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
|
410
408
|
}
|
411
409
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
412
|
-
//Ao criar ou alterar um filtro personalizado,
|
410
|
+
//Ao criar ou alterar um filtro personalizado,
|
413
411
|
//precisamos remover o cache do status da filterbar.
|
414
|
-
|
415
|
-
this.configById.delete(cacheID);
|
412
|
+
await this.deleteFilterBarConfigCache(configName, resourceID);
|
416
413
|
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
417
414
|
}
|
418
415
|
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
@@ -421,6 +418,19 @@ class ConfigStorage {
|
|
421
418
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
422
419
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
423
420
|
}
|
421
|
+
static async deleteGridConfigCache(name, resourceID) {
|
422
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
|
423
|
+
}
|
424
|
+
static async deleteFormConfigCache(name, resourceID) {
|
425
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
|
426
|
+
}
|
427
|
+
static async deleteFilterBarConfigCache(name, resourceID) {
|
428
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
429
|
+
}
|
430
|
+
static async deleteConfigCache(name, resourceID, source) {
|
431
|
+
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
432
|
+
this.configById.delete(cacheID);
|
433
|
+
}
|
424
434
|
static buildCacheID(name, source, resourceID) {
|
425
435
|
if (name == undefined) {
|
426
436
|
return `req_${source}_${resourceID}`;
|
@@ -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 utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
9
9
|
const DataFetcher = require('./DataFetcher-ba94ed5b.js');
|
10
10
|
const authFetcher = require('./auth-fetcher-c8467c07.js');
|
11
11
|
const dataunitFetcher = require('./dataunit-fetcher-14108bec.js');
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-71c4768e.js');
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
9
9
|
require('./DataFetcher-ba94ed5b.js');
|
10
10
|
require('./pesquisa-fetcher-ef050a47.js');
|
@@ -18,9 +18,9 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
18
|
require('./form-config-fetcher-df043d3d.js');
|
19
19
|
const taskbarElements = require('./taskbar-elements-01b85b99.js');
|
20
20
|
const constants = require('./constants-35ddd366.js');
|
21
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
21
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c8b9374f.js');
|
22
22
|
const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
|
23
|
-
require('./ConfigStorage-
|
23
|
+
require('./ConfigStorage-302bbbd4.js');
|
24
24
|
require('./PrintUtils-bcaeb82f.js');
|
25
25
|
require('./ResourceIDUtils-5ff86aa7.js');
|
26
26
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index$1 = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
11
11
|
const index = require('./index-c5771aba.js');
|
@@ -322,7 +322,7 @@ const SnkFilterBar = class {
|
|
322
322
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
323
323
|
*/
|
324
324
|
async reload() {
|
325
|
-
this.loadConfigFromStorage();
|
325
|
+
this.loadConfigFromStorage(true);
|
326
326
|
}
|
327
327
|
/**
|
328
328
|
* Retorna um item de filtro pelo ID.
|
@@ -529,7 +529,10 @@ const SnkFilterBar = class {
|
|
529
529
|
loadPermitions() {
|
530
530
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
531
531
|
}
|
532
|
-
loadConfigFromStorage() {
|
532
|
+
async loadConfigFromStorage(clearCache) {
|
533
|
+
if (clearCache) {
|
534
|
+
await ConfigStorage.ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
535
|
+
}
|
533
536
|
return new Promise(accept => {
|
534
537
|
ConfigStorage.ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
535
538
|
.then((filters) => {
|
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
8
8
|
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
10
10
|
const filterType_enum = require('./filter-type.enum-b14ce507.js');
|
11
11
|
require('./form-config-fetcher-df043d3d.js');
|
12
12
|
require('./DataFetcher-ba94ed5b.js');
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-71c4768e.js');
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
9
|
-
require('./ConfigStorage-
|
9
|
+
require('./ConfigStorage-302bbbd4.js');
|
10
10
|
require('./form-config-fetcher-df043d3d.js');
|
11
11
|
require('./DataFetcher-ba94ed5b.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const CheckMode = require('@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
10
10
|
const constants = require('./constants-35ddd366.js');
|
11
11
|
require('./form-config-fetcher-df043d3d.js');
|
12
12
|
require('./DataFetcher-ba94ed5b.js');
|
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
8
8
|
const taskbarElements = require('./taskbar-elements-01b85b99.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
10
10
|
const index$1 = require('./index-0922807b.js');
|
11
11
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
12
12
|
const index$2 = require('./index-102ba62d.js');
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-71c4768e.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-01b85b99.js');
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c8b9374f.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
8
|
+
require('./SnkFormConfigManager-71c4768e.js');
|
9
|
+
require('./ConfigStorage-302bbbd4.js');
|
10
10
|
require('./form-config-fetcher-df043d3d.js');
|
11
11
|
require('./DataFetcher-ba94ed5b.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
@@ -74,7 +74,7 @@ export class SnkFilterBar {
|
|
74
74
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
75
75
|
*/
|
76
76
|
async reload() {
|
77
|
-
this.loadConfigFromStorage();
|
77
|
+
this.loadConfigFromStorage(true);
|
78
78
|
}
|
79
79
|
/**
|
80
80
|
* Retorna um item de filtro pelo ID.
|
@@ -282,7 +282,10 @@ export class SnkFilterBar {
|
|
282
282
|
loadPermitions() {
|
283
283
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
284
284
|
}
|
285
|
-
loadConfigFromStorage() {
|
285
|
+
async loadConfigFromStorage(clearCache) {
|
286
|
+
if (clearCache) {
|
287
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
288
|
+
}
|
286
289
|
return new Promise(accept => {
|
287
290
|
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
288
291
|
.then((filters) => {
|
@@ -2,11 +2,12 @@ import { FormConfigFetcher } from "../http/data-fetcher/fetchers/form-config-fet
|
|
2
2
|
import GridConfigFetcher from "../http/data-fetcher/fetchers/grid-config-fetcher";
|
3
3
|
import FilterBarConfigFetcher from "../http/data-fetcher/fetchers/filter-bar-config-fetcher";
|
4
4
|
import PersonalizedFilterFetcher from "../http/data-fetcher/fetchers/personalized-filter-fetcher";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
var CONFIG_SOURCE;
|
6
|
+
(function (CONFIG_SOURCE) {
|
7
|
+
CONFIG_SOURCE["form"] = "form";
|
8
|
+
CONFIG_SOURCE["grid"] = "grid";
|
9
|
+
CONFIG_SOURCE["filterBar"] = "filterBar";
|
10
|
+
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
10
11
|
export class ConfigStorage {
|
11
12
|
static preload(resourceID, configName) {
|
12
13
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
@@ -34,13 +35,11 @@ export class ConfigStorage {
|
|
34
35
|
return ConfigStorage.configById.get(cacheID);
|
35
36
|
}
|
36
37
|
static async saveFilterBarConfig(config, name, resourceID) {
|
37
|
-
|
38
|
-
this.configById.delete(cacheID);
|
38
|
+
await this.deleteFilterBarConfigCache(name, resourceID);
|
39
39
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
40
40
|
}
|
41
41
|
static async saveFormConfig(config, name, resourceID) {
|
42
|
-
|
43
|
-
this.configById.delete(cacheID);
|
42
|
+
await this.deleteFormConfigCache(name, resourceID);
|
44
43
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
45
44
|
}
|
46
45
|
static async saveCardState(config, name, resourceID) {
|
@@ -50,18 +49,16 @@ export class ConfigStorage {
|
|
50
49
|
if (config == undefined) {
|
51
50
|
return;
|
52
51
|
}
|
53
|
-
|
54
|
-
this.configById.delete(cacheID);
|
52
|
+
await this.deleteGridConfigCache(name, resourceID);
|
55
53
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
56
54
|
}
|
57
55
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
58
56
|
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
|
59
57
|
}
|
60
58
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
61
|
-
//Ao criar ou alterar um filtro personalizado,
|
59
|
+
//Ao criar ou alterar um filtro personalizado,
|
62
60
|
//precisamos remover o cache do status da filterbar.
|
63
|
-
|
64
|
-
this.configById.delete(cacheID);
|
61
|
+
await this.deleteFilterBarConfigCache(configName, resourceID);
|
65
62
|
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
66
63
|
}
|
67
64
|
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
@@ -70,6 +67,19 @@ export class ConfigStorage {
|
|
70
67
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
71
68
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
72
69
|
}
|
70
|
+
static async deleteGridConfigCache(name, resourceID) {
|
71
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
|
72
|
+
}
|
73
|
+
static async deleteFormConfigCache(name, resourceID) {
|
74
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
|
75
|
+
}
|
76
|
+
static async deleteFilterBarConfigCache(name, resourceID) {
|
77
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
78
|
+
}
|
79
|
+
static async deleteConfigCache(name, resourceID, source) {
|
80
|
+
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
81
|
+
this.configById.delete(cacheID);
|
82
|
+
}
|
73
83
|
static buildCacheID(name, source, resourceID) {
|
74
84
|
if (name == undefined) {
|
75
85
|
return `req_${source}_${resourceID}`;
|
@@ -351,11 +351,12 @@ class PersonalizedFilterFetcher {
|
|
351
351
|
}
|
352
352
|
}
|
353
353
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
354
|
+
var CONFIG_SOURCE;
|
355
|
+
(function (CONFIG_SOURCE) {
|
356
|
+
CONFIG_SOURCE["form"] = "form";
|
357
|
+
CONFIG_SOURCE["grid"] = "grid";
|
358
|
+
CONFIG_SOURCE["filterBar"] = "filterBar";
|
359
|
+
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
359
360
|
class ConfigStorage {
|
360
361
|
static preload(resourceID, configName) {
|
361
362
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
@@ -383,13 +384,11 @@ class ConfigStorage {
|
|
383
384
|
return ConfigStorage.configById.get(cacheID);
|
384
385
|
}
|
385
386
|
static async saveFilterBarConfig(config, name, resourceID) {
|
386
|
-
|
387
|
-
this.configById.delete(cacheID);
|
387
|
+
await this.deleteFilterBarConfigCache(name, resourceID);
|
388
388
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
389
389
|
}
|
390
390
|
static async saveFormConfig(config, name, resourceID) {
|
391
|
-
|
392
|
-
this.configById.delete(cacheID);
|
391
|
+
await this.deleteFormConfigCache(name, resourceID);
|
393
392
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
394
393
|
}
|
395
394
|
static async saveCardState(config, name, resourceID) {
|
@@ -399,18 +398,16 @@ class ConfigStorage {
|
|
399
398
|
if (config == undefined) {
|
400
399
|
return;
|
401
400
|
}
|
402
|
-
|
403
|
-
this.configById.delete(cacheID);
|
401
|
+
await this.deleteGridConfigCache(name, resourceID);
|
404
402
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
405
403
|
}
|
406
404
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
407
405
|
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
|
408
406
|
}
|
409
407
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
410
|
-
//Ao criar ou alterar um filtro personalizado,
|
408
|
+
//Ao criar ou alterar um filtro personalizado,
|
411
409
|
//precisamos remover o cache do status da filterbar.
|
412
|
-
|
413
|
-
this.configById.delete(cacheID);
|
410
|
+
await this.deleteFilterBarConfigCache(configName, resourceID);
|
414
411
|
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
415
412
|
}
|
416
413
|
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
@@ -419,6 +416,19 @@ class ConfigStorage {
|
|
419
416
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
420
417
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
421
418
|
}
|
419
|
+
static async deleteGridConfigCache(name, resourceID) {
|
420
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
|
421
|
+
}
|
422
|
+
static async deleteFormConfigCache(name, resourceID) {
|
423
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
|
424
|
+
}
|
425
|
+
static async deleteFilterBarConfigCache(name, resourceID) {
|
426
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
427
|
+
}
|
428
|
+
static async deleteConfigCache(name, resourceID, source) {
|
429
|
+
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
430
|
+
this.configById.delete(cacheID);
|
431
|
+
}
|
422
432
|
static buildCacheID(name, source, resourceID) {
|
423
433
|
if (name == undefined) {
|
424
434
|
return `req_${source}_${resourceID}`;
|
@@ -324,7 +324,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
324
324
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
325
325
|
*/
|
326
326
|
async reload() {
|
327
|
-
this.loadConfigFromStorage();
|
327
|
+
this.loadConfigFromStorage(true);
|
328
328
|
}
|
329
329
|
/**
|
330
330
|
* Retorna um item de filtro pelo ID.
|
@@ -531,7 +531,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
531
531
|
loadPermitions() {
|
532
532
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
533
533
|
}
|
534
|
-
loadConfigFromStorage() {
|
534
|
+
async loadConfigFromStorage(clearCache) {
|
535
|
+
if (clearCache) {
|
536
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
537
|
+
}
|
535
538
|
return new Promise(accept => {
|
536
539
|
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
537
540
|
.then((filters) => {
|
@@ -351,11 +351,12 @@ class PersonalizedFilterFetcher {
|
|
351
351
|
}
|
352
352
|
}
|
353
353
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
354
|
+
var CONFIG_SOURCE;
|
355
|
+
(function (CONFIG_SOURCE) {
|
356
|
+
CONFIG_SOURCE["form"] = "form";
|
357
|
+
CONFIG_SOURCE["grid"] = "grid";
|
358
|
+
CONFIG_SOURCE["filterBar"] = "filterBar";
|
359
|
+
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
359
360
|
class ConfigStorage {
|
360
361
|
static preload(resourceID, configName) {
|
361
362
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
@@ -383,13 +384,11 @@ class ConfigStorage {
|
|
383
384
|
return ConfigStorage.configById.get(cacheID);
|
384
385
|
}
|
385
386
|
static async saveFilterBarConfig(config, name, resourceID) {
|
386
|
-
|
387
|
-
this.configById.delete(cacheID);
|
387
|
+
await this.deleteFilterBarConfigCache(name, resourceID);
|
388
388
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
389
389
|
}
|
390
390
|
static async saveFormConfig(config, name, resourceID) {
|
391
|
-
|
392
|
-
this.configById.delete(cacheID);
|
391
|
+
await this.deleteFormConfigCache(name, resourceID);
|
393
392
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
394
393
|
}
|
395
394
|
static async saveCardState(config, name, resourceID) {
|
@@ -399,18 +398,16 @@ class ConfigStorage {
|
|
399
398
|
if (config == undefined) {
|
400
399
|
return;
|
401
400
|
}
|
402
|
-
|
403
|
-
this.configById.delete(cacheID);
|
401
|
+
await this.deleteGridConfigCache(name, resourceID);
|
404
402
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
405
403
|
}
|
406
404
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
407
405
|
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
|
408
406
|
}
|
409
407
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
410
|
-
//Ao criar ou alterar um filtro personalizado,
|
408
|
+
//Ao criar ou alterar um filtro personalizado,
|
411
409
|
//precisamos remover o cache do status da filterbar.
|
412
|
-
|
413
|
-
this.configById.delete(cacheID);
|
410
|
+
await this.deleteFilterBarConfigCache(configName, resourceID);
|
414
411
|
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
415
412
|
}
|
416
413
|
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
@@ -419,6 +416,19 @@ class ConfigStorage {
|
|
419
416
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
420
417
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
421
418
|
}
|
419
|
+
static async deleteGridConfigCache(name, resourceID) {
|
420
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
|
421
|
+
}
|
422
|
+
static async deleteFormConfigCache(name, resourceID) {
|
423
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
|
424
|
+
}
|
425
|
+
static async deleteFilterBarConfigCache(name, resourceID) {
|
426
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
427
|
+
}
|
428
|
+
static async deleteConfigCache(name, resourceID, source) {
|
429
|
+
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
430
|
+
this.configById.delete(cacheID);
|
431
|
+
}
|
422
432
|
static buildCacheID(name, source, resourceID) {
|
423
433
|
if (name == undefined) {
|
424
434
|
return `req_${source}_${resourceID}`;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FormConfigFetcher } from './form-config-fetcher-36219cd3.js';
|
4
4
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-aa159c5a.js';
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-c05dc474.js';
|
7
7
|
import { D as DataUnitFetcher } from './dataunit-fetcher-cbec1594.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
|
2
2
|
import { Action } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-5c7d3771.js';
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import './DataFetcher-aa159c5a.js';
|
6
6
|
import './pesquisa-fetcher-dd3ca0a5.js';
|
@@ -14,9 +14,9 @@ import './filter-item-type.enum-d45e026f.js';
|
|
14
14
|
import './form-config-fetcher-36219cd3.js';
|
15
15
|
import { T as TaskbarElement } from './taskbar-elements-d4d0b424.js';
|
16
16
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
17
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
17
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-8da24475.js';
|
18
18
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-ca843d1b.js';
|
19
|
-
import './ConfigStorage-
|
19
|
+
import './ConfigStorage-4151acc8.js';
|
20
20
|
import './PrintUtils-3e4ff0f5.js';
|
21
21
|
import './ResourceIDUtils-a114189a.js';
|
22
22
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
7
7
|
import { F as FilterOperand } from './index-ae591a44.js';
|
@@ -318,7 +318,7 @@ const SnkFilterBar = class {
|
|
318
318
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
319
319
|
*/
|
320
320
|
async reload() {
|
321
|
-
this.loadConfigFromStorage();
|
321
|
+
this.loadConfigFromStorage(true);
|
322
322
|
}
|
323
323
|
/**
|
324
324
|
* Retorna um item de filtro pelo ID.
|
@@ -525,7 +525,10 @@ const SnkFilterBar = class {
|
|
525
525
|
loadPermitions() {
|
526
526
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
527
527
|
}
|
528
|
-
loadConfigFromStorage() {
|
528
|
+
async loadConfigFromStorage(clearCache) {
|
529
|
+
if (clearCache) {
|
530
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
531
|
+
}
|
529
532
|
return new Promise(accept => {
|
530
533
|
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
531
534
|
.then((filters) => {
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
6
6
|
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
7
7
|
import './form-config-fetcher-36219cd3.js';
|
8
8
|
import './DataFetcher-aa159c5a.js';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-5c7d3771.js';
|
4
4
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
5
|
-
import './ConfigStorage-
|
5
|
+
import './ConfigStorage-4151acc8.js';
|
6
6
|
import './form-config-fetcher-36219cd3.js';
|
7
7
|
import './DataFetcher-aa159c5a.js';
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
6
6
|
import { O as ORDER_VALUES } from './constants-8457af36.js';
|
7
7
|
import './form-config-fetcher-36219cd3.js';
|
8
8
|
import './DataFetcher-aa159c5a.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElem
|
|
2
2
|
import { ElementIDUtils, ApplicationContext, StringUtils, DataType } from '@sankhyalabs/core';
|
3
3
|
import { SortMode, UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
4
|
import { T as TaskbarElement } from './taskbar-elements-d4d0b424.js';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
6
6
|
import { P as PresentationMode } from './index-0ece87a6.js';
|
7
7
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
|
8
8
|
import { s as store } from './index-bdf75557.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-5c7d3771.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-d4d0b424.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-8da24475.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
|
-
import './SnkFormConfigManager-
|
5
|
-
import './ConfigStorage-
|
4
|
+
import './SnkFormConfigManager-5c7d3771.js';
|
5
|
+
import './ConfigStorage-4151acc8.js';
|
6
6
|
import './form-config-fetcher-36219cd3.js';
|
7
7
|
import './DataFetcher-aa159c5a.js';
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|