@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-76031.3 → 0.0.0-bugfix-dev-kb-80398.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ContinuousInsertUtils-2718aaaa.js → ContinuousInsertUtils-c27b439e.js} +3 -2
- package/dist/cjs/{SnkFormConfigManager-07f747be.js → SnkFormConfigManager-c11d8468.js} +1 -1
- package/dist/cjs/{constants-35ddd366.js → constants-241934b3.js} +9 -0
- package/dist/cjs/{dataunit-fetcher-c32fdff7.js → dataunit-fetcher-8291ac21.js} +21 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-3b86b6c4.js → pesquisa-fetcher-5c583c93.js} +16 -5
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +3 -2
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +72 -27
- package/dist/cjs/snk-attach.cjs.entry.js +3 -3
- package/dist/cjs/snk-config-options_3.cjs.entry.js +2 -2
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-2c7c1964.js → snk-data-unit-d75e6220.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -5
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +21 -6
- package/dist/cjs/{snk-guides-viewer-266339d2.js → snk-guides-viewer-bff0d27d.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +3 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.css +2 -0
- package/dist/collection/components/snk-application/snk-application.js +108 -28
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +3 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -3
- package/dist/collection/components/snk-grid/snk-grid.js +17 -3
- package/dist/collection/components/snk-pesquisa/pesquisaHelper.js +4 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +21 -7
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -5
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/utils/constants.js +9 -0
- package/dist/components/ContinuousInsertUtils.js +1 -0
- package/dist/components/ISave.js +16 -5
- package/dist/components/SnkFormConfigManager.js +1 -1
- package/dist/components/constants.js +10 -1
- package/dist/components/dataunit-fetcher.js +21 -7
- package/dist/components/pesquisa-grid2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +73 -25
- package/dist/components/snk-config-options2.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-filter-bar2.js +3 -3
- package/dist/components/snk-filter-item2.js +3 -3
- package/dist/components/snk-filter-number.js +1 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-grid2.js +18 -3
- package/dist/components/snk-pesquisa2.js +1 -0
- package/dist/components/snk-simple-form-config2.js +1 -0
- package/dist/components/snk-tab-config2.js +1 -1
- package/dist/esm/{ContinuousInsertUtils-deb7767f.js → ContinuousInsertUtils-6bf78c5e.js} +3 -2
- package/dist/esm/{SnkFormConfigManager-1ff928fa.js → SnkFormConfigManager-5022f87f.js} +1 -1
- package/dist/esm/{constants-7302ee87.js → constants-75abb876.js} +10 -1
- package/dist/esm/{dataunit-fetcher-26c2bed4.js → dataunit-fetcher-5247a708.js} +21 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-767abffa.js → pesquisa-fetcher-4284f2a3.js} +16 -5
- package/dist/esm/pesquisa-grid_2.entry.js +3 -2
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_5.entry.js +3 -3
- package/dist/esm/snk-application.entry.js +72 -27
- package/dist/esm/snk-attach.entry.js +3 -3
- package/dist/esm/snk-config-options_3.entry.js +2 -2
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +3 -3
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-a36df23f.js → snk-data-unit-bfd10c71.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -5
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +6 -6
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +21 -6
- package/dist/esm/{snk-guides-viewer-9f03a9a0.js → snk-guides-viewer-454ebc07.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +5 -5
- package/dist/esm/snk-pesquisa.entry.js +3 -2
- package/dist/esm/snk-simple-crud.entry.js +5 -5
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/sankhyablocks/p-03e6825e.js +1 -0
- package/dist/sankhyablocks/{p-edbe8e15.entry.js → p-198c48c5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-95ce311a.js → p-1d19a5b0.js} +1 -1
- package/dist/sankhyablocks/{p-2d3f9482.entry.js → p-23cd6abf.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8b4fc28f.entry.js → p-2953c481.entry.js} +1 -1
- package/dist/sankhyablocks/p-38179225.js +60 -0
- package/dist/sankhyablocks/{p-aaef93e8.js → p-3ba431c9.js} +1 -1
- package/dist/sankhyablocks/p-41c3bee5.js +6 -0
- package/dist/sankhyablocks/{p-18f58d73.js → p-478ab2b6.js} +1 -1
- package/dist/sankhyablocks/{p-6beac917.entry.js → p-4c9adf1c.entry.js} +1 -1
- package/dist/sankhyablocks/p-50bf8dbc.entry.js +1 -0
- package/dist/sankhyablocks/{p-09b4a36b.entry.js → p-643b2aaa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70ae0779.js → p-655bdd60.js} +1 -1
- package/dist/sankhyablocks/p-6fc8bfa2.entry.js +1 -0
- package/dist/sankhyablocks/{p-9070bfe3.entry.js → p-73b037a8.entry.js} +1 -1
- package/dist/sankhyablocks/p-79f823f3.entry.js +1 -0
- package/dist/sankhyablocks/{p-5dbed7b4.entry.js → p-8ad7c8bc.entry.js} +1 -1
- package/dist/sankhyablocks/p-91e34755.entry.js +1 -0
- package/dist/sankhyablocks/p-9a99c67b.entry.js +1 -0
- package/dist/sankhyablocks/{p-b896f0df.entry.js → p-a04f38aa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1f17a44e.entry.js → p-ae26e8d0.entry.js} +1 -1
- package/dist/sankhyablocks/p-bd234604.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d86c004.entry.js → p-c021a3a9.entry.js} +1 -1
- package/dist/sankhyablocks/p-d9bb48c4.entry.js +11 -0
- package/dist/sankhyablocks/{p-045398fb.entry.js → p-f8db6795.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +14 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -0
- package/dist/types/components.d.ts +4 -3
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +9 -2
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +7 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-01ba23cd.entry.js +0 -1
- package/dist/sankhyablocks/p-0d2c8bc8.entry.js +0 -1
- package/dist/sankhyablocks/p-270b83d1.entry.js +0 -1
- package/dist/sankhyablocks/p-4aca10f3.entry.js +0 -1
- package/dist/sankhyablocks/p-4fe8bb73.js +0 -6
- package/dist/sankhyablocks/p-78d49c74.js +0 -60
- package/dist/sankhyablocks/p-800a8209.entry.js +0 -1
- package/dist/sankhyablocks/p-86fc5865.js +0 -1
- package/dist/sankhyablocks/p-9cec99d8.entry.js +0 -11
- package/dist/sankhyablocks/p-d3a44f8f.entry.js +0 -1
|
@@ -9,6 +9,9 @@ import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
|
|
9
9
|
class ArrayRepository {
|
|
10
10
|
constructor(equalsFunction) {
|
|
11
11
|
this._list = [];
|
|
12
|
+
this._listCopy = [];
|
|
13
|
+
this._listLastUpdate = 0;
|
|
14
|
+
this._listCopyLastUpdate = 0;
|
|
12
15
|
this._equalsFunction = equalsFunction;
|
|
13
16
|
}
|
|
14
17
|
async load(filterFunction, sortingFunction, offset, limit) {
|
|
@@ -47,13 +50,13 @@ class ArrayRepository {
|
|
|
47
50
|
return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
|
|
48
51
|
}
|
|
49
52
|
async push(items) {
|
|
50
|
-
this.
|
|
53
|
+
this.updateList([...this._list, ...items]);
|
|
51
54
|
}
|
|
52
55
|
async clear() {
|
|
53
|
-
this.
|
|
56
|
+
this.updateList([]);
|
|
54
57
|
}
|
|
55
58
|
async delete(items) {
|
|
56
|
-
|
|
59
|
+
const list = this._list.filter(item => {
|
|
57
60
|
for (const removed of items) {
|
|
58
61
|
if (this._equalsFunction(item, removed)) {
|
|
59
62
|
return false;
|
|
@@ -61,20 +64,23 @@ class ArrayRepository {
|
|
|
61
64
|
}
|
|
62
65
|
return true;
|
|
63
66
|
});
|
|
67
|
+
this.updateList(list);
|
|
64
68
|
}
|
|
65
69
|
async update(items) {
|
|
66
|
-
|
|
70
|
+
const list = this._list.map(existingItem => {
|
|
67
71
|
const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
|
|
68
72
|
return newItem == undefined ? existingItem : newItem;
|
|
69
73
|
});
|
|
74
|
+
this.updateList(list);
|
|
70
75
|
}
|
|
71
76
|
async insert(itemReference, items) {
|
|
72
77
|
const itemPosition = this._list.indexOf(itemReference);
|
|
73
78
|
if (itemPosition == -1) {
|
|
74
|
-
this.
|
|
79
|
+
this.push(items);
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
77
|
-
|
|
82
|
+
const list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
|
|
83
|
+
this.updateList(list);
|
|
78
84
|
}
|
|
79
85
|
isOperating() {
|
|
80
86
|
return true;
|
|
@@ -86,7 +92,15 @@ class ArrayRepository {
|
|
|
86
92
|
return Promise.resolve(this._list.length);
|
|
87
93
|
}
|
|
88
94
|
getFromCache() {
|
|
89
|
-
|
|
95
|
+
if (this._listLastUpdate > this._listCopyLastUpdate) {
|
|
96
|
+
this._listCopyLastUpdate = this._listLastUpdate;
|
|
97
|
+
this._listCopy = ObjectUtils.copy(this._list);
|
|
98
|
+
}
|
|
99
|
+
return this._listCopy;
|
|
100
|
+
}
|
|
101
|
+
updateList(newList) {
|
|
102
|
+
this._list = newList;
|
|
103
|
+
this._listLastUpdate = Date.now();
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
106
|
|
|
@@ -7,6 +7,7 @@ import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
|
7
7
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
8
8
|
import './filter-item-type.enum.js';
|
|
9
9
|
import './form-config-fetcher.js';
|
|
10
|
+
import './constants.js';
|
|
10
11
|
|
|
11
12
|
const pesquisaGridCss = ".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";
|
|
12
13
|
|
|
@@ -8,6 +8,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
|
8
8
|
import './dataunit-fetcher.js';
|
|
9
9
|
import './filter-item-type.enum.js';
|
|
10
10
|
import './form-config-fetcher.js';
|
|
11
|
+
import './constants.js';
|
|
11
12
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
|
|
12
13
|
import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
|
13
14
|
|
|
@@ -7,6 +7,7 @@ import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
|
|
|
7
7
|
import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
|
|
8
8
|
import { a as PesquisaFetcher } from './ISave.js';
|
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
10
|
+
import { T as TEMPLATES_SKELETON } from './constants.js';
|
|
10
11
|
import { d as defineCustomElement$3 } from './pesquisa-grid2.js';
|
|
11
12
|
import { d as defineCustomElement$2 } from './pesquisa-tree2.js';
|
|
12
13
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
@@ -376,7 +377,7 @@ class RequestListenerFactory {
|
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
|
380
|
+
const snkApplicationCss = ".sc-snk-application-h{--scrim-z-index:var(--elevation--100, 100);display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
|
380
381
|
|
|
381
382
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
382
383
|
constructor() {
|
|
@@ -391,12 +392,14 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
391
392
|
this._duCache = new Map();
|
|
392
393
|
this._duPromises = new Map();
|
|
393
394
|
this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
|
|
394
|
-
this.
|
|
395
|
+
this._maxTimerAppLoading = 10000;
|
|
395
396
|
this._isBrowserTypeElectron = false;
|
|
396
397
|
this._pendingActions = new Map;
|
|
397
398
|
this._loadPkParameter = null;
|
|
398
399
|
this._isLoadedByPk = false;
|
|
399
400
|
this._applicationReady = false;
|
|
401
|
+
this._templateSkeleton = TEMPLATES_SKELETON.GRID;
|
|
402
|
+
this._activeScrimWindow = false;
|
|
400
403
|
this.enableLockManagerLoadingApp = undefined;
|
|
401
404
|
this.messagesBuilder = undefined;
|
|
402
405
|
this.configName = undefined;
|
|
@@ -892,12 +895,20 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
892
895
|
});
|
|
893
896
|
PreloadManager.removeRecords(dataUnit, records);
|
|
894
897
|
}
|
|
895
|
-
getCountSkeleton(
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
898
|
+
getCountSkeleton(skeletonHeight, spacingSkeleton, headerHeight) {
|
|
899
|
+
headerHeight = headerHeight || 160;
|
|
900
|
+
const containerHeight = window.innerHeight - headerHeight;
|
|
901
|
+
const skeletonSpacing = spacingSkeleton || 10;
|
|
902
|
+
const totalHeightPerSkeleton = skeletonHeight + skeletonSpacing;
|
|
903
|
+
const skeletonCount = Math.floor(containerHeight / totalHeightPerSkeleton) - 1;
|
|
899
904
|
return skeletonCount || 1;
|
|
900
905
|
}
|
|
906
|
+
getSkeletonRandomWidth() {
|
|
907
|
+
const min = 30;
|
|
908
|
+
const max = 100;
|
|
909
|
+
const randomWidth = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
910
|
+
return `${randomWidth}%`;
|
|
911
|
+
}
|
|
901
912
|
async getAuthList(auth) {
|
|
902
913
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
|
903
914
|
}
|
|
@@ -1377,6 +1388,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1377
1388
|
this.removeShortcuts();
|
|
1378
1389
|
if (this._lockManagerTimer)
|
|
1379
1390
|
clearTimeout(this._lockManagerTimer);
|
|
1391
|
+
if (this._scrimWindowTimer)
|
|
1392
|
+
clearTimeout(this._scrimWindowTimer);
|
|
1380
1393
|
}
|
|
1381
1394
|
async componentDidLoad() {
|
|
1382
1395
|
this.applicationLoading.emit(true);
|
|
@@ -1396,18 +1409,39 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1396
1409
|
this._applicationReady = true;
|
|
1397
1410
|
}
|
|
1398
1411
|
}
|
|
1399
|
-
async
|
|
1412
|
+
async showScrimApp(active) {
|
|
1413
|
+
if (!this.enableLockManagerLoadingApp || !this._applicationReady || !active) {
|
|
1414
|
+
this._activeScrimWindow = false;
|
|
1415
|
+
if (this._scrimWindowTimer)
|
|
1416
|
+
clearTimeout(this._scrimWindowTimer);
|
|
1417
|
+
return;
|
|
1418
|
+
}
|
|
1419
|
+
this._activeScrimWindow = true;
|
|
1420
|
+
this._scrimWindowTimer = setTimeout(async () => {
|
|
1421
|
+
if (this._activeScrimWindow) {
|
|
1422
|
+
this._activeScrimWindow = false;
|
|
1423
|
+
clearTimeout(this._scrimWindowTimer);
|
|
1424
|
+
}
|
|
1425
|
+
}, this._maxTimerAppLoading);
|
|
1426
|
+
}
|
|
1427
|
+
async changeTemplateSkeleton(templateSkeletonType) {
|
|
1428
|
+
this._templateSkeleton = templateSkeletonType ? templateSkeletonType : this._templateSkeleton;
|
|
1429
|
+
}
|
|
1430
|
+
async markToReload(templateSkeletonType) {
|
|
1400
1431
|
if (!this.enableLockManagerLoadingApp)
|
|
1401
1432
|
return;
|
|
1433
|
+
await this.changeTemplateSkeleton(templateSkeletonType);
|
|
1402
1434
|
this._applicationReady = false;
|
|
1403
1435
|
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
|
1404
1436
|
this.resolveApplicationReady();
|
|
1405
1437
|
}
|
|
1406
|
-
async addLoadingLock(forceReady = false) {
|
|
1438
|
+
async addLoadingLock(forceReady = false, templateSkeletonType) {
|
|
1407
1439
|
if (!this.enableLockManagerLoadingApp)
|
|
1408
1440
|
return;
|
|
1441
|
+
await this.changeTemplateSkeleton(templateSkeletonType);
|
|
1409
1442
|
if (forceReady) {
|
|
1410
1443
|
this._applicationReady = false;
|
|
1444
|
+
this._activeScrimWindow = this._applicationReady ? true : false;
|
|
1411
1445
|
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
|
1412
1446
|
}
|
|
1413
1447
|
this.resolveApplicationReady();
|
|
@@ -1444,7 +1478,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1444
1478
|
this.stopTimeoutLockManager();
|
|
1445
1479
|
this._applicationReady = true;
|
|
1446
1480
|
}
|
|
1447
|
-
}, this.
|
|
1481
|
+
}, this._maxTimerAppLoading);
|
|
1448
1482
|
}
|
|
1449
1483
|
initKeyboardManager() {
|
|
1450
1484
|
this._keyboardManager
|
|
@@ -1458,19 +1492,26 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1458
1492
|
.unbind("ctrl + d")
|
|
1459
1493
|
.unbind("F1");
|
|
1460
1494
|
}
|
|
1461
|
-
|
|
1462
|
-
renderLoadingSkeleton(template) {
|
|
1495
|
+
renderLoadingSkeleton() {
|
|
1463
1496
|
if (!this.enableLockManagerLoadingApp)
|
|
1464
1497
|
return;
|
|
1465
1498
|
if (this._isBrowserTypeElectron) {
|
|
1466
1499
|
return this.getSpinnerLoadingDefault();
|
|
1467
1500
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1501
|
+
else {
|
|
1502
|
+
switch (this._templateSkeleton) {
|
|
1503
|
+
case TEMPLATES_SKELETON.CUSTOM_TEMPLATE:
|
|
1504
|
+
case TEMPLATES_SKELETON.GRID:
|
|
1505
|
+
return this.getSkeletonTemplateGrid();
|
|
1506
|
+
case TEMPLATES_SKELETON.GRID_WITH_SIDEBAR:
|
|
1507
|
+
return this.getSkeletonTemplateGridWithSidebar();
|
|
1508
|
+
case TEMPLATES_SKELETON.GRID_WITH_PANEL:
|
|
1509
|
+
return this.getSkeletonTemplateGridWithPanel();
|
|
1510
|
+
case TEMPLATES_SKELETON.FORM_WITH_SIDEBAR:
|
|
1511
|
+
return this.getSkeletonTemplateFormWithSidebar();
|
|
1512
|
+
default:
|
|
1513
|
+
return this.getSkeletonTemplateGrid();
|
|
1514
|
+
}
|
|
1474
1515
|
}
|
|
1475
1516
|
}
|
|
1476
1517
|
getLoadingVisibilityStyle() {
|
|
@@ -1479,8 +1520,17 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1479
1520
|
display: this._applicationReady ? "none" : "unset"
|
|
1480
1521
|
};
|
|
1481
1522
|
}
|
|
1482
|
-
|
|
1483
|
-
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--
|
|
1523
|
+
getSkeletonTemplateGrid() {
|
|
1524
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-flex--column ez-margin--large ez-margin-top--medium" }, h("div", { class: "ez-margin-bottom--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "20%", height: "35px", animation: "progress" })), h("div", { class: "" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" }))), h("div", { class: "ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large", style: { height: "calc(-105px + 100vh)" } }, [1, 2, 3, 4].map((_, index) => (h("div", { class: "ez-margin-right--large", key: index, style: { width: "25%" } }, h("ez-skeleton", { count: this.getCountSkeleton(50, 10), variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" })))))));
|
|
1525
|
+
}
|
|
1526
|
+
getSkeletonTemplateGridWithSidebar() {
|
|
1527
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-flex--column ez-margin--large ez-margin-top--medium" }, h("div", { class: "ez-margin-bottom--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "20%", height: "35px", animation: "progress" })), h("div", { class: "" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" }))), h("div", { class: "ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large", style: { height: "calc(100vh - 160px)" } }, h("div", { class: "ez-flex ez-flex--column ez-margin-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(30, 6)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: this.getSkeletonRandomWidth(), height: "30px", animation: "progress", marginBottom: "10px" }))), h("div", { class: "ez-margin-right--large", style: { width: "75%" } }, h("ez-skeleton", { count: this.getCountSkeleton(50, 10), variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" })))));
|
|
1528
|
+
}
|
|
1529
|
+
getSkeletonTemplateGridWithPanel() {
|
|
1530
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--medium ez-padding--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" })), h("div", { class: "ez-flex ez-margin--medium ez-margin-top--medium", style: { maxHeight: "calc(-105px + 100vh)", overflow: "hidden" } }, h("div", { class: "", style: { width: "70%", overflow: "hidden" } }, h("div", { class: "ez-padding--medium", style: { height: "50%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100%", animation: "progress" })), h("div", { class: "ez-padding--medium", style: {} }, h("ez-skeleton", { count: 1, variant: "rect", width: "250px", height: "25px", animation: "progress" })), h("div", { class: "ez-flex ez-padding--medium", style: { height: "45%" } }, [1, 2].map(() => (h("div", { style: { width: "50%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100%", animation: "progress" })))))), h("div", { class: "ez-flex ez-flex--column ez-padding--medium", style: { width: "30%", overflow: "hidden" } }, Array(this.getCountSkeleton(30, 10)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" }))))));
|
|
1531
|
+
}
|
|
1532
|
+
getSkeletonTemplateFormWithSidebar() {
|
|
1533
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--medium ez-padding--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" })), h("div", { class: "ez-flex ez-margin--medium ez-margin-top--medium", style: { maxHeight: "calc(-105px + 100vh)", overflow: "hidden" } }, h("div", { class: "ez-flex ez-flex--column ez-margin-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(30, 6)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: this.getSkeletonRandomWidth(), height: "30px", animation: "progress", marginBottom: "10px" }))), h("div", { class: "ez-flex ez-flex--column", style: { width: "75%" } }, h("div", { class: "ez-padding--medium", style: { width: "100%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "30%", height: "25px", animation: "progress" })), h("div", { class: "ez-padding--medium", style: { height: "45%" } }, h("div", { class: "ez-flex", style: { width: "100%", height: "100%" } }, [1, 2, 3, 4].map((_, columnIndex) => (h("div", { key: columnIndex, class: "ez-padding-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(50, 20)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" }))))))), h("div", { class: "ez-padding--medium", style: { width: "100%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "30%", height: "25px", animation: "progress" })), h("div", { class: "ez-padding--medium", style: { height: "45%" } }, h("div", { class: "ez-flex", style: { width: "100%", height: "100%" } }, [1, 2, 3, 4].map((_, columnIndex) => (h("div", { key: columnIndex, class: "ez-padding-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(50, 20)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" })))))))))));
|
|
1484
1534
|
}
|
|
1485
1535
|
getSpinnerLoadingDefault() {
|
|
1486
1536
|
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner" }, h("ez-icon", { iconName: "sync", size: "x-large", class: "spin" }), h("span", { class: "ez-title ez-title--secondary ez-title--extra-large" }, "Carregando..."))));
|
|
@@ -1489,7 +1539,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1489
1539
|
return (h(Host, { style: {
|
|
1490
1540
|
visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
|
|
1491
1541
|
overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
|
|
1492
|
-
} }, h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = 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 }), this.renderLoadingSkeleton())));
|
|
1542
|
+
} }, h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = 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 }), this.renderLoadingSkeleton(), this._activeScrimWindow && (h("div", { class: "ez-scrim ez-scrim--light", style: { cursor: "progress", zIndex: "var(--scrim-z-index)" } })))));
|
|
1493
1543
|
}
|
|
1494
1544
|
get _element() { return this; }
|
|
1495
1545
|
static get watchers() { return {
|
|
@@ -1504,6 +1554,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1504
1554
|
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
|
1505
1555
|
"loadByPK": [16],
|
|
1506
1556
|
"_applicationReady": [32],
|
|
1557
|
+
"_templateSkeleton": [32],
|
|
1558
|
+
"_activeScrimWindow": [32],
|
|
1507
1559
|
"getKeyboardManager": [64],
|
|
1508
1560
|
"isUserSup": [64],
|
|
1509
1561
|
"addPendingAction": [64],
|
|
@@ -1555,6 +1607,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1555
1607
|
"getDataFetcher": [64],
|
|
1556
1608
|
"whenApplicationReady": [64],
|
|
1557
1609
|
"setSearchFilterContext": [64],
|
|
1610
|
+
"showScrimApp": [64],
|
|
1558
1611
|
"markToReload": [64],
|
|
1559
1612
|
"addLoadingLock": [64]
|
|
1560
1613
|
}]);
|
|
@@ -1564,11 +1617,6 @@ class PendingPromise {
|
|
|
1564
1617
|
this.reject = reject;
|
|
1565
1618
|
}
|
|
1566
1619
|
}
|
|
1567
|
-
var TEMPLATES_LOADING_SKELETON;
|
|
1568
|
-
(function (TEMPLATES_LOADING_SKELETON) {
|
|
1569
|
-
TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
|
|
1570
|
-
TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
|
|
1571
|
-
})(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
|
|
1572
1620
|
function defineCustomElement() {
|
|
1573
1621
|
if (typeof customElements === "undefined") {
|
|
1574
1622
|
return;
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { UserInterface, ObjectUtils, StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { a as VARS_BY_TYPE, D as DEFAULT_TYPE,
|
|
5
|
+
import { a as VARS_BY_TYPE, D as DEFAULT_TYPE, b as TAGS_BY_TYPE } from './constants.js';
|
|
6
6
|
|
|
7
7
|
const snkConfigOptionsCss = ".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
|
|
8
8
|
|
|
@@ -9,8 +9,8 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
|
9
9
|
import './dataunit-fetcher.js';
|
|
10
10
|
import './filter-item-type.enum.js';
|
|
11
11
|
import './form-config-fetcher.js';
|
|
12
|
-
import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
|
|
13
12
|
import { V as VIEW_MODE } from './constants.js';
|
|
13
|
+
import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
|
|
14
14
|
import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './ContinuousInsertUtils.js';
|
|
15
15
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
16
16
|
import { d as defineCustomElement$v } from './snk-actions-button2.js';
|
|
@@ -139,7 +139,7 @@ function buildNumber(item) {
|
|
|
139
139
|
const variation = props.variation;
|
|
140
140
|
if (variation === FilterNumberVariation.INTERVAL) {
|
|
141
141
|
const { start, end } = value !== null && value !== void 0 ? value : { start: 0, end: 0 };
|
|
142
|
-
if (start && end) {
|
|
142
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
143
143
|
return {
|
|
144
144
|
name: id,
|
|
145
145
|
expression: props.intervalExpression.fullfill,
|
|
@@ -149,7 +149,7 @@ function buildNumber(item) {
|
|
|
149
149
|
]
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
if (start) {
|
|
152
|
+
if (!isNaN(start)) {
|
|
153
153
|
return {
|
|
154
154
|
name: id,
|
|
155
155
|
expression: props.intervalExpression.onlystart,
|
|
@@ -158,7 +158,7 @@ function buildNumber(item) {
|
|
|
158
158
|
]
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
if (end) {
|
|
161
|
+
if (!isNaN(end)) {
|
|
162
162
|
return {
|
|
163
163
|
name: id,
|
|
164
164
|
expression: props.intervalExpression.onlyend,
|
|
@@ -207,13 +207,13 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
207
207
|
}
|
|
208
208
|
if (type === FilterItemType.NUMBER && props.variation === FilterNumberVariation.INTERVAL) {
|
|
209
209
|
const { start, end } = value;
|
|
210
|
-
if (start && end) {
|
|
210
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
211
211
|
return this.getMessage('snkFilterBar.fullIntervalTooltip', { LABEL: label, START_LABEL: start, END_LABEL: end });
|
|
212
212
|
}
|
|
213
|
-
if (start) {
|
|
213
|
+
if (!isNaN(start)) {
|
|
214
214
|
return `${label}: ${this.getMessage('snkFilterBar.onlyStartToltip')} ${Number(start)}`;
|
|
215
215
|
}
|
|
216
|
-
if (end) {
|
|
216
|
+
if (!isNaN(end)) {
|
|
217
217
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -23,7 +23,7 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
23
23
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
24
24
|
const start = this._startInterval.value;
|
|
25
25
|
const end = this._endInterval.value;
|
|
26
|
-
this.value = (start || end ? { start, end } : undefined);
|
|
26
|
+
this.value = (!isNaN(start) || !isNaN(end) ? { start, end } : undefined);
|
|
27
27
|
this.valueChanged.emit(this.value);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { a as Sortable, d as defineCustomElement$1 } from './snk-tab-config2.js';
|
|
3
3
|
import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { C as CONFIG_EVENTS,
|
|
5
|
+
import { C as CONFIG_EVENTS, c as CONFIG_SORTABLE_EVENTS, d as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants.js';
|
|
6
6
|
import { U as UserConfigType } from './form-config-fetcher.js';
|
|
7
7
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
8
8
|
import { d as defineCustomElement$3 } from './snk-config-options2.js';
|
|
@@ -12,6 +12,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
|
12
12
|
import './dataunit-fetcher.js';
|
|
13
13
|
import './filter-item-type.enum.js';
|
|
14
14
|
import './form-config-fetcher.js';
|
|
15
|
+
import './constants.js';
|
|
15
16
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
|
|
16
17
|
import { d as defineCustomElement$i } from './snk-actions-button2.js';
|
|
17
18
|
import { d as defineCustomElement$h } from './snk-data-exporter2.js';
|
|
@@ -290,10 +291,24 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
290
291
|
this._gridConfig = config;
|
|
291
292
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
292
293
|
}
|
|
294
|
+
fixColumNameCharset(columnName) {
|
|
295
|
+
try {
|
|
296
|
+
return decodeURIComponent(escape(columnName));
|
|
297
|
+
}
|
|
298
|
+
catch (e) {
|
|
299
|
+
return columnName;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
normalizeGridConfig(config) {
|
|
303
|
+
if (!config)
|
|
304
|
+
return config;
|
|
305
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
|
306
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
|
307
|
+
}
|
|
293
308
|
loadConfig() {
|
|
294
309
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
|
295
310
|
.then((config) => {
|
|
296
|
-
this.setGridConfig(config);
|
|
311
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
|
297
312
|
})
|
|
298
313
|
.catch((error) => {
|
|
299
314
|
console.warn(error);
|
|
@@ -305,12 +320,12 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
305
320
|
}
|
|
306
321
|
}
|
|
307
322
|
gridConfigChangeHandler(evt) {
|
|
308
|
-
const config = evt.detail;
|
|
323
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
309
324
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
|
310
325
|
evt.stopPropagation();
|
|
311
326
|
}
|
|
312
327
|
modalConfigChangeHandler(evt) {
|
|
313
|
-
const config = evt.detail;
|
|
328
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
314
329
|
this._grid.setColumnsState(config.columns)
|
|
315
330
|
.then(() => {
|
|
316
331
|
this.setGridConfig(config);
|
|
@@ -7,6 +7,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
|
7
7
|
import './dataunit-fetcher.js';
|
|
8
8
|
import './filter-item-type.enum.js';
|
|
9
9
|
import './form-config-fetcher.js';
|
|
10
|
+
import './constants.js';
|
|
10
11
|
import { d as defineCustomElement$2 } from './pesquisa-grid2.js';
|
|
11
12
|
import { d as defineCustomElement$1 } from './pesquisa-tree2.js';
|
|
12
13
|
|
|
@@ -7,6 +7,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
|
7
7
|
import './dataunit-fetcher.js';
|
|
8
8
|
import './filter-item-type.enum.js';
|
|
9
9
|
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
|
10
|
+
import './constants.js';
|
|
10
11
|
|
|
11
12
|
const snkSimpleFormConfigCss = ":host{display:block}.config-container{display:flex;flex-direction:column;align-items:center;justify-content:space-between}.config-lists{margin-bottom:12px}.config-actions{display:flex;flex-direction:row;justify-content:flex-end;width:100%;gap:12px}";
|
|
12
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
2
|
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CONFIG_EVENTS,
|
|
3
|
+
import { C as CONFIG_EVENTS, c as CONFIG_SORTABLE_EVENTS, K as KEY_EVENTS, e as TYPE_ACTIONS, d as TAB_NAMES } from './constants.js';
|
|
4
4
|
|
|
5
5
|
class AbstractEvent {
|
|
6
6
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { D as DataFetcher } from './DataFetcher-5221b992.js';
|
|
2
|
-
import './pesquisa-fetcher-
|
|
2
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
|
3
3
|
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
|
4
4
|
import './index-3aa4977a.js';
|
|
5
5
|
import './ISave-d8c8bc59.js';
|
|
6
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
7
7
|
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
8
|
-
import { P as PreloadManager } from './dataunit-fetcher-
|
|
8
|
+
import { P as PreloadManager } from './dataunit-fetcher-5247a708.js';
|
|
9
9
|
import './filter-item-type.enum-d45e026f.js';
|
|
10
10
|
import './form-config-fetcher-126e2471.js';
|
|
11
|
+
import './constants-75abb876.js';
|
|
11
12
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
|
12
13
|
import { h } from './index-a7d3d3f1.js';
|
|
13
14
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
|
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FormConfigFetcher } from './form-config-fetcher-126e2471.js';
|
|
4
|
-
import {
|
|
4
|
+
import { c as TAB_NAMES } from './constants-75abb876.js';
|
|
5
5
|
|
|
6
6
|
class SnkFormConfigManager {
|
|
7
7
|
constructor(configName, resourceID, onConfigChange, dataUnit) {
|
|
@@ -89,5 +89,14 @@ var SIMPLE_CRUD_MODE;
|
|
|
89
89
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["SERVER"] = 0] = "SERVER";
|
|
90
90
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["IN_MEMORY"] = 1] = "IN_MEMORY";
|
|
91
91
|
})(SIMPLE_CRUD_MODE || (SIMPLE_CRUD_MODE = {}));
|
|
92
|
+
// TODO: validar forma de compartilhar os templates com outros projetos
|
|
93
|
+
var TEMPLATES_SKELETON;
|
|
94
|
+
(function (TEMPLATES_SKELETON) {
|
|
95
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["CUSTOM_TEMPLATE"] = 0] = "CUSTOM_TEMPLATE";
|
|
96
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID"] = 1] = "GRID";
|
|
97
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID_WITH_SIDEBAR"] = 2] = "GRID_WITH_SIDEBAR";
|
|
98
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID_WITH_PANEL"] = 3] = "GRID_WITH_PANEL";
|
|
99
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["FORM_WITH_SIDEBAR"] = 4] = "FORM_WITH_SIDEBAR";
|
|
100
|
+
})(TEMPLATES_SKELETON || (TEMPLATES_SKELETON = {}));
|
|
92
101
|
|
|
93
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, SIMPLE_CRUD_MODE as S,
|
|
102
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, SIMPLE_CRUD_MODE as S, TEMPLATES_SKELETON as T, VIEW_MODE as V, CONFIG_SORTABLE_EVENTS as a, TYPE_ACTIONS as b, TAB_NAMES as c, VARS_BY_TYPE as d, TAGS_BY_TYPE as e };
|
|
@@ -9,6 +9,9 @@ import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
|
|
9
9
|
class ArrayRepository {
|
|
10
10
|
constructor(equalsFunction) {
|
|
11
11
|
this._list = [];
|
|
12
|
+
this._listCopy = [];
|
|
13
|
+
this._listLastUpdate = 0;
|
|
14
|
+
this._listCopyLastUpdate = 0;
|
|
12
15
|
this._equalsFunction = equalsFunction;
|
|
13
16
|
}
|
|
14
17
|
async load(filterFunction, sortingFunction, offset, limit) {
|
|
@@ -47,13 +50,13 @@ class ArrayRepository {
|
|
|
47
50
|
return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
|
|
48
51
|
}
|
|
49
52
|
async push(items) {
|
|
50
|
-
this.
|
|
53
|
+
this.updateList([...this._list, ...items]);
|
|
51
54
|
}
|
|
52
55
|
async clear() {
|
|
53
|
-
this.
|
|
56
|
+
this.updateList([]);
|
|
54
57
|
}
|
|
55
58
|
async delete(items) {
|
|
56
|
-
|
|
59
|
+
const list = this._list.filter(item => {
|
|
57
60
|
for (const removed of items) {
|
|
58
61
|
if (this._equalsFunction(item, removed)) {
|
|
59
62
|
return false;
|
|
@@ -61,20 +64,23 @@ class ArrayRepository {
|
|
|
61
64
|
}
|
|
62
65
|
return true;
|
|
63
66
|
});
|
|
67
|
+
this.updateList(list);
|
|
64
68
|
}
|
|
65
69
|
async update(items) {
|
|
66
|
-
|
|
70
|
+
const list = this._list.map(existingItem => {
|
|
67
71
|
const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
|
|
68
72
|
return newItem == undefined ? existingItem : newItem;
|
|
69
73
|
});
|
|
74
|
+
this.updateList(list);
|
|
70
75
|
}
|
|
71
76
|
async insert(itemReference, items) {
|
|
72
77
|
const itemPosition = this._list.indexOf(itemReference);
|
|
73
78
|
if (itemPosition == -1) {
|
|
74
|
-
this.
|
|
79
|
+
this.push(items);
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
77
|
-
|
|
82
|
+
const list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
|
|
83
|
+
this.updateList(list);
|
|
78
84
|
}
|
|
79
85
|
isOperating() {
|
|
80
86
|
return true;
|
|
@@ -86,7 +92,15 @@ class ArrayRepository {
|
|
|
86
92
|
return Promise.resolve(this._list.length);
|
|
87
93
|
}
|
|
88
94
|
getFromCache() {
|
|
89
|
-
|
|
95
|
+
if (this._listLastUpdate > this._listCopyLastUpdate) {
|
|
96
|
+
this._listCopyLastUpdate = this._listLastUpdate;
|
|
97
|
+
this._listCopy = ObjectUtils.copy(this._list);
|
|
98
|
+
}
|
|
99
|
+
return this._listCopy;
|
|
100
|
+
}
|
|
101
|
+
updateList(newList) {
|
|
102
|
+
this._list = newList;
|
|
103
|
+
this._listLastUpdate = Date.now();
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
106
|
|