@sankhyalabs/sankhyablocks 8.1.0-dev.1 → 8.1.0-dev.11
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/README.md +1 -1
- package/dist/cjs/{ConfigStorage-73e7afff.js → ConfigStorage-d688c739.js} +163 -50
- package/dist/cjs/{DataFetcher-004811c6.js → DataFetcher-d2c6ae38.js} +29 -0
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
- package/dist/cjs/{SnkFormConfigManager-d1f1a222.js → SnkFormConfigManager-29b73c81.js} +19 -21
- package/dist/cjs/{auth-fetcher-58237931.js → auth-fetcher-da975ac5.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-029eafbd.js → dataunit-fetcher-58ad78a7.js} +1 -1
- package/dist/cjs/{form-config-fetcher-181767c9.js → form-config-fetcher-761994b9.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-9a97994a.js → pesquisa-fetcher-bb0bb679.js} +1 -1
- package/dist/cjs/{resource-fetcher-c0332609.js → resource-fetcher-95d24dff.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +13 -10
- package/dist/cjs/snk-application.cjs.entry.js +48 -44
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +21 -9
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-cc7a7ed0.js → snk-data-unit-80a00ae4.js} +4 -4
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +11 -10
- package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
- package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -17
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -19
- package/dist/cjs/snk-form-config.cjs.entry.js +7 -17
- package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
- package/dist/cjs/snk-form.cjs.entry.js +13 -8
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -6
- package/dist/cjs/snk-grid.cjs.entry.js +18 -20
- package/dist/cjs/{snk-guides-viewer-27f87d90.js → snk-guides-viewer-f67f9cea.js} +12 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +15 -71
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
- package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
- package/dist/collection/components/snk-application/snk-application.js +58 -65
- package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
- package/dist/collection/components/snk-crud/snk-crud.js +40 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +42 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +47 -28
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -8
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
- package/dist/collection/components/snk-form/snk-form.js +46 -2
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
- package/dist/collection/components/snk-grid/snk-grid.js +51 -15
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +22 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.css +1 -1
- package/dist/collection/lib/configs/ConfigStorage.js +33 -44
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -59
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/ConfigStorage.js +161 -48
- package/dist/components/DataFetcher.js +29 -0
- package/dist/components/ResourceIDUtils.js +10 -0
- package/dist/components/SnkFormConfigManager.js +17 -19
- package/dist/components/auth-fetcher.js +1 -1
- package/dist/components/form-config-fetcher.js +64 -2
- package/dist/components/snk-actions-button2.js +11 -8
- package/dist/components/snk-application2.js +42 -38
- package/dist/components/snk-configurator2.js +3 -1
- package/dist/components/snk-crud.js +18 -5
- package/dist/components/snk-data-unit2.js +5 -4
- package/dist/components/snk-detail-view2.js +15 -7
- package/dist/components/snk-entity-list.js +0 -4
- package/dist/components/snk-filter-bar2.js +12 -12
- package/dist/components/snk-filter-detail2.js +2 -12
- package/dist/components/snk-filter-modal-item2.js +5 -16
- package/dist/components/snk-form-config2.js +5 -15
- package/dist/components/snk-form-view2.js +6 -1
- package/dist/components/snk-form.js +9 -2
- package/dist/components/snk-grid-config2.js +4 -2
- package/dist/components/snk-grid2.js +17 -16
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-simple-crud2.js +3 -59
- package/dist/components/snk-taskbar2.js +3 -1
- package/dist/esm/{ConfigStorage-19a7260b.js → ConfigStorage-cfe03e99.js} +163 -49
- package/dist/esm/{DataFetcher-e0fc5549.js → DataFetcher-aaaff866.js} +29 -0
- package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
- package/dist/esm/{SnkFormConfigManager-1a42eb02.js → SnkFormConfigManager-bfd8eabd.js} +19 -21
- package/dist/esm/{auth-fetcher-83a946f8.js → auth-fetcher-7860d777.js} +1 -1
- package/dist/esm/{dataunit-fetcher-6a695723.js → dataunit-fetcher-9dfcdb1d.js} +1 -1
- package/dist/esm/{form-config-fetcher-9e167008.js → form-config-fetcher-4a34b86a.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-9118eb7a.js → pesquisa-fetcher-01d058e6.js} +1 -1
- package/dist/{components/resource-fetcher.js → esm/resource-fetcher-b36ac145.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +13 -10
- package/dist/esm/snk-application.entry.js +48 -44
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-configurator.entry.js +2 -1
- package/dist/esm/snk-crud.entry.js +21 -9
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-77508763.js → snk-data-unit-3ab57d1a.js} +4 -4
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +11 -10
- package/dist/esm/snk-entity-list.entry.js +0 -4
- package/dist/esm/snk-filter-bar.entry.js +15 -17
- package/dist/esm/snk-filter-detail.entry.js +2 -16
- package/dist/esm/snk-filter-modal-item.entry.js +7 -20
- package/dist/esm/snk-form-config.entry.js +8 -18
- package/dist/esm/snk-form-view.entry.js +6 -1
- package/dist/esm/snk-form.entry.js +13 -8
- package/dist/esm/snk-grid-config.entry.js +6 -6
- package/dist/esm/snk-grid.entry.js +18 -20
- package/dist/esm/{snk-guides-viewer-c47cd45e.js → snk-guides-viewer-3ea14ab4.js} +12 -7
- package/dist/esm/snk-guides-viewer.entry.js +7 -8
- package/dist/esm/snk-personalized-filter.entry.js +14 -16
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +5 -61
- package/dist/esm/snk-taskbar.entry.js +2 -1
- package/dist/sankhyablocks/{p-e7e54737.entry.js → p-05bcad8a.entry.js} +1 -1
- package/dist/sankhyablocks/p-0ae5b923.entry.js +1 -0
- package/dist/sankhyablocks/p-15230263.js +1 -0
- package/dist/sankhyablocks/p-18fa618e.entry.js +1 -0
- package/dist/sankhyablocks/{p-0ed0fc02.entry.js → p-1b81c379.entry.js} +1 -1
- package/dist/sankhyablocks/{p-98f9d076.js → p-2dd0f891.js} +2 -2
- package/dist/sankhyablocks/p-330f584a.entry.js +1 -0
- package/dist/sankhyablocks/{p-968741cc.js → p-48a40939.js} +1 -1
- package/dist/sankhyablocks/p-4c33a77c.entry.js +1 -0
- package/dist/sankhyablocks/p-53884b5f.entry.js +1 -0
- package/dist/sankhyablocks/{p-df8621b4.js → p-60791bb6.js} +1 -1
- package/dist/sankhyablocks/{p-f88c45bf.js → p-64c2cec3.js} +1 -1
- package/dist/sankhyablocks/p-688dcb4c.js +1 -0
- package/dist/sankhyablocks/p-70e785db.entry.js +1 -0
- package/dist/sankhyablocks/{p-0a4c753d.js → p-85affa29.js} +1 -1
- package/dist/sankhyablocks/p-861a3495.entry.js +1 -0
- package/dist/sankhyablocks/p-878b0dd3.entry.js +1 -0
- package/dist/sankhyablocks/p-97d2fbd9.entry.js +1 -0
- package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
- package/dist/sankhyablocks/p-9d591463.js +1 -0
- package/dist/sankhyablocks/p-9d93da18.js +56 -0
- package/dist/sankhyablocks/{p-34085ced.entry.js → p-9f387187.entry.js} +1 -1
- package/dist/sankhyablocks/p-aa4c112f.entry.js +11 -0
- package/dist/sankhyablocks/p-bae87498.entry.js +1 -0
- package/dist/sankhyablocks/{p-2ac9c585.js → p-bee6b5d7.js} +1 -1
- package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
- package/dist/sankhyablocks/p-cc67bd06.entry.js +1 -0
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
- package/dist/sankhyablocks/p-e070d7a3.entry.js +1 -0
- package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
- package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
- package/dist/sankhyablocks/{p-7b8b8ae9.js → p-f737f7e1.js} +1 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
- package/dist/types/components/snk-application/snk-application.d.ts +8 -13
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +8 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +9 -2
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -2
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
- package/dist/types/components/snk-form/snk-form.d.ts +9 -1
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -1
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
- package/dist/types/components.d.ts +125 -21
- package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +3 -3
- package/dist/cjs/filter-bar-config-fetcher-2b8ed9d0.js +0 -155
- package/dist/components/filter-bar-config-fetcher.js +0 -153
- package/dist/esm/filter-bar-config-fetcher-06e02851.js +0 -153
- package/dist/esm/resource-fetcher-768d5556.js +0 -66
- package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
- package/dist/sankhyablocks/p-22c6fe1a.entry.js +0 -1
- package/dist/sankhyablocks/p-34a1357a.entry.js +0 -1
- package/dist/sankhyablocks/p-4721c3db.js +0 -1
- package/dist/sankhyablocks/p-6759adae.entry.js +0 -1
- package/dist/sankhyablocks/p-7e285d6c.entry.js +0 -11
- package/dist/sankhyablocks/p-815a42c0.entry.js +0 -1
- package/dist/sankhyablocks/p-8a41172a.entry.js +0 -1
- package/dist/sankhyablocks/p-8f8184ff.js +0 -56
- package/dist/sankhyablocks/p-976e56e9.js +0 -1
- package/dist/sankhyablocks/p-bc735728.entry.js +0 -1
- package/dist/sankhyablocks/p-be684b38.entry.js +0 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
- package/dist/sankhyablocks/p-c0f656af.entry.js +0 -1
- package/dist/sankhyablocks/p-c44f6aaf.entry.js +0 -1
- package/dist/sankhyablocks/p-c57bd935.entry.js +0 -1
- package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
- package/dist/sankhyablocks/p-cfd7da4a.entry.js +0 -1
- package/dist/sankhyablocks/p-d1b89765.js +0 -1
- package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
- package/dist/sankhyablocks/p-e28129aa.entry.js +0 -1
- package/dist/sankhyablocks/p-f31bfdee.entry.js +0 -1
- package/dist/sankhyablocks/p-fe010e54.entry.js +0 -1
@@ -41,6 +41,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
41
41
|
this.entityUri = undefined;
|
42
42
|
this.filterId = undefined;
|
43
43
|
this.configName = undefined;
|
44
|
+
this.resourceID = undefined;
|
44
45
|
}
|
45
46
|
/*
|
46
47
|
* Cria um novo filtro se não houver nenhum filtro existente
|
@@ -77,17 +78,15 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
77
78
|
this._filterAssistent = ObjectUtils.copy(newPersonalizedFilter);
|
78
79
|
}
|
79
80
|
loadFilter(newValue, oldValue) {
|
80
|
-
if (newValue == null || oldValue == newValue) {
|
81
|
+
if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
|
81
82
|
return;
|
82
83
|
}
|
83
|
-
ConfigStorage.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
90
|
-
});
|
84
|
+
ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
|
85
|
+
.then((resp) => {
|
86
|
+
const personalizedFilter = this.addLabelToItems(resp);
|
87
|
+
this._filterAssistent = personalizedFilter;
|
88
|
+
this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
|
89
|
+
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
91
90
|
});
|
92
91
|
}
|
93
92
|
componentWillLoad() {
|
@@ -112,7 +111,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
112
111
|
return this._application.messagesBuilder.getMessage(key, params);
|
113
112
|
}
|
114
113
|
saveFilter() {
|
115
|
-
ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.configName).then((personalizedFilter) => {
|
114
|
+
ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName).then((personalizedFilter) => {
|
116
115
|
this._elButtonSave.enabled = false;
|
117
116
|
const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
|
118
117
|
ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
|
@@ -123,7 +122,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
123
122
|
});
|
124
123
|
}
|
125
124
|
removeFilter() {
|
126
|
-
ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.configName);
|
125
|
+
ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
|
127
126
|
}
|
128
127
|
hasChangesToSave() {
|
129
128
|
return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
|
@@ -301,6 +300,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
301
300
|
"entityUri": [1025, "entity-uri"],
|
302
301
|
"filterId": [1025, "filter-id"],
|
303
302
|
"configName": [1025, "config-name"],
|
303
|
+
"resourceID": [1, "resource-i-d"],
|
304
304
|
"_filterAssistentMode": [32],
|
305
305
|
"_filterAssistent": [32],
|
306
306
|
"createPersonalizedFilter": [64]
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { DataUnit,
|
2
|
+
import { DataUnit, defaultDataLoader, StringUtils, ChangeOperation, ObjectUtils, ApplicationContext, DataType, UserInterface } from '@sankhyalabs/core';
|
3
3
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
|
4
4
|
import { T as TaskbarElement, d as defineCustomElement$1 } from './snk-taskbar2.js';
|
5
5
|
import './DataFetcher.js';
|
6
6
|
import './pesquisa-fetcher.js';
|
7
7
|
import { P as PresentationMode } from './index2.js';
|
8
8
|
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
9
|
-
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
9
|
import { d as defineCustomElement$5 } from './snk-actions-button2.js';
|
11
10
|
import { d as defineCustomElement$4 } from './snk-data-exporter2.js';
|
12
11
|
import { d as defineCustomElement$3 } from './snk-data-unit2.js';
|
@@ -18,7 +17,7 @@ class InMemoryLoader {
|
|
18
17
|
this.metadata = metadata;
|
19
18
|
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
20
19
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
21
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
20
|
+
this._dataUnit.dataLoader = (dataUnit, request) => defaultDataLoader(dataUnit, request, this._records);
|
22
21
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
23
22
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
24
23
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -55,62 +54,6 @@ class InMemoryLoader {
|
|
55
54
|
metadaLoader() {
|
56
55
|
return Promise.resolve(this._metadata);
|
57
56
|
}
|
58
|
-
dataLoader(dataUnit, request) {
|
59
|
-
const filters = this.getColumnFilters(dataUnit);
|
60
|
-
let records = this.applyFilters(filters);
|
61
|
-
if (request.sort) {
|
62
|
-
request.sort.forEach(sort => {
|
63
|
-
records = records.sort((recordA, recordB) => {
|
64
|
-
const fieldA = recordA[sort.field];
|
65
|
-
const fieldB = recordB[sort.field];
|
66
|
-
const sortFn = this.getSortFn(sort.dataType);
|
67
|
-
return sortFn(fieldA, fieldB) * (sort.mode == SortMode.ASC ? 1 : -1);
|
68
|
-
});
|
69
|
-
});
|
70
|
-
}
|
71
|
-
return Promise.resolve({ records: records });
|
72
|
-
}
|
73
|
-
applyFilters(filters) {
|
74
|
-
let records = [...this._records];
|
75
|
-
filters.forEach(filter => {
|
76
|
-
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
77
|
-
});
|
78
|
-
return records;
|
79
|
-
}
|
80
|
-
getColumnFilters(dataUnit) {
|
81
|
-
var _a, _b;
|
82
|
-
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
83
|
-
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
84
|
-
return columnFilters.map(filter => {
|
85
|
-
var _a, _b;
|
86
|
-
return {
|
87
|
-
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
88
|
-
values: filter.params.map(param => param.value),
|
89
|
-
};
|
90
|
-
});
|
91
|
-
}
|
92
|
-
getSortFn(type) {
|
93
|
-
switch (type) {
|
94
|
-
case DataType.NUMBER:
|
95
|
-
return this.sortNumber;
|
96
|
-
case DataType.DATE:
|
97
|
-
return this.sortDate;
|
98
|
-
case DataType.OBJECT:
|
99
|
-
return this.sortObject;
|
100
|
-
default:
|
101
|
-
return StringUtils.compare;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
sortObject(a, b) {
|
105
|
-
return StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
106
|
-
}
|
107
|
-
sortNumber(a, b) {
|
108
|
-
return a - b;
|
109
|
-
}
|
110
|
-
sortDate(a, b) {
|
111
|
-
let timeA = a.getTime(), timeB = b.getTime();
|
112
|
-
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
113
|
-
}
|
114
57
|
saveLoader(_dataUnit, changes) {
|
115
58
|
return new Promise((resolve) => {
|
116
59
|
let dataUnitRecords = [];
|
@@ -154,6 +97,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
154
97
|
this.dataStateChange = createEvent(this, "dataStateChange", 3);
|
155
98
|
this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
|
156
99
|
this.actionClick = createEvent(this, "actionClick", 7);
|
100
|
+
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
157
101
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
158
102
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
159
103
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
@@ -145,6 +145,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
145
145
|
};
|
146
146
|
this._permissions = undefined;
|
147
147
|
this.configName = undefined;
|
148
|
+
this.resourceID = undefined;
|
148
149
|
this.buttons = undefined;
|
149
150
|
this.customButtons = undefined;
|
150
151
|
this.actionsList = undefined;
|
@@ -286,7 +287,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
286
287
|
componentWillLoad() {
|
287
288
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
288
289
|
if (this._application) {
|
289
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
290
|
+
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
290
291
|
}
|
291
292
|
else {
|
292
293
|
this._permissions = {};
|
@@ -330,6 +331,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
330
331
|
static get style() { return snkTaskbarCss; }
|
331
332
|
}, [6, "snk-taskbar", {
|
332
333
|
"configName": [1, "config-name"],
|
334
|
+
"resourceID": [1, "resource-i-d"],
|
333
335
|
"buttons": [1],
|
334
336
|
"customButtons": [16],
|
335
337
|
"actionsList": [16],
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-e0fc5549.js';
|
1
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-4a34b86a.js';
|
2
|
+
import { R as ResourceFetcher } from './resource-fetcher-b36ac145.js';
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-aaaff866.js';
|
6
5
|
|
7
6
|
class GridConfigFetcher extends ResourceFetcher {
|
8
7
|
constructor() {
|
@@ -44,6 +43,131 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
44
43
|
}
|
45
44
|
}
|
46
45
|
|
46
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
47
|
+
var t = {};
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
49
|
+
t[p] = s[p];
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
53
|
+
t[p[i]] = s[p[i]];
|
54
|
+
}
|
55
|
+
return t;
|
56
|
+
};
|
57
|
+
function normalizeValue(value, type) {
|
58
|
+
if (value == undefined) {
|
59
|
+
return value;
|
60
|
+
}
|
61
|
+
if (value instanceof Date) {
|
62
|
+
return value.toISOString();
|
63
|
+
}
|
64
|
+
if (typeof value === "object") {
|
65
|
+
if (value instanceof Array) {
|
66
|
+
return value.map(item => {
|
67
|
+
if (FilterItemType.MULTI_LIST === type) {
|
68
|
+
const values = __rest(item, ["label"]);
|
69
|
+
return normalizeValue(values);
|
70
|
+
}
|
71
|
+
return normalizeValue(item);
|
72
|
+
});
|
73
|
+
}
|
74
|
+
else {
|
75
|
+
const normalized = Object.assign({}, value);
|
76
|
+
Object.keys(value).forEach(prop => {
|
77
|
+
if (value[prop] !== undefined) {
|
78
|
+
normalized[prop] = normalizeValue(value[prop], type);
|
79
|
+
}
|
80
|
+
else {
|
81
|
+
delete normalized[prop];
|
82
|
+
}
|
83
|
+
});
|
84
|
+
return normalized;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
return value;
|
88
|
+
}
|
89
|
+
class FilterBarConfigFetcher extends ResourceFetcher {
|
90
|
+
normalize(items) {
|
91
|
+
return items.map(item => {
|
92
|
+
const { id, value, fixed, visible, type, groupedItems } = item;
|
93
|
+
const stateItem = { id };
|
94
|
+
if (value) {
|
95
|
+
stateItem["value"] = normalizeValue(value, type);
|
96
|
+
}
|
97
|
+
if (fixed) {
|
98
|
+
stateItem["fixed"] = fixed;
|
99
|
+
}
|
100
|
+
if (groupedItems) {
|
101
|
+
if (groupedItems.length === 0) {
|
102
|
+
return;
|
103
|
+
}
|
104
|
+
if (groupedItems.filter(item => item.visible).length > 0) {
|
105
|
+
stateItem["visible"] = true;
|
106
|
+
}
|
107
|
+
stateItem["groupedItems"] = this.normalize(groupedItems);
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
if (visible) {
|
111
|
+
stateItem["visible"] = true;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
return stateItem;
|
115
|
+
}).filter(item => item != undefined);
|
116
|
+
}
|
117
|
+
saveConfig(items, resourceID, configName) {
|
118
|
+
return this.saveResource(this.normalize(items), this.getPath(resourceID, configName));
|
119
|
+
}
|
120
|
+
getConfig(resourceID, configName, urlParams) {
|
121
|
+
return new Promise((accept, reject) => {
|
122
|
+
this.loadResource(this.getPath(resourceID, configName, urlParams))
|
123
|
+
.then((configAsString) => {
|
124
|
+
let fieldsList;
|
125
|
+
if (configAsString) {
|
126
|
+
const filterBarConfig = JSON.parse(configAsString);
|
127
|
+
fieldsList = this.buildFieldList(filterBarConfig.items);
|
128
|
+
}
|
129
|
+
accept(fieldsList || []);
|
130
|
+
})
|
131
|
+
.catch((error) => {
|
132
|
+
reject(error);
|
133
|
+
});
|
134
|
+
});
|
135
|
+
}
|
136
|
+
buildFieldList(items) {
|
137
|
+
return items.map(item => {
|
138
|
+
var _a, _b;
|
139
|
+
if (item.type === FilterItemType.MULTI_LIST) {
|
140
|
+
const multiListValue = item.value;
|
141
|
+
item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
|
142
|
+
}
|
143
|
+
return item;
|
144
|
+
});
|
145
|
+
}
|
146
|
+
getPath(resourceID, name, urlParams) {
|
147
|
+
let path = `cfg://filter/FilterBarState:${resourceID}`;
|
148
|
+
if (name) {
|
149
|
+
path += `.${name}`;
|
150
|
+
}
|
151
|
+
if (urlParams) {
|
152
|
+
path += this.buildQueryString(urlParams);
|
153
|
+
}
|
154
|
+
return path;
|
155
|
+
}
|
156
|
+
buildQueryString(urlParams) {
|
157
|
+
let queryString = '?';
|
158
|
+
for (let key in urlParams) {
|
159
|
+
if (!urlParams.hasOwnProperty(key)) {
|
160
|
+
continue;
|
161
|
+
}
|
162
|
+
if (queryString.length > 1) {
|
163
|
+
queryString += '&';
|
164
|
+
}
|
165
|
+
queryString += key + '=' + urlParams[key];
|
166
|
+
}
|
167
|
+
return queryString;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
|
47
171
|
class PersonalizedFilterFetcher {
|
48
172
|
constructor() {
|
49
173
|
this.templateByQuery = new Map();
|
@@ -218,83 +342,73 @@ const CONFIG_SOURCE = {
|
|
218
342
|
filterBar: "filterBar"
|
219
343
|
};
|
220
344
|
class ConfigStorage {
|
221
|
-
static
|
222
|
-
|
223
|
-
|
224
|
-
if (application != undefined) {
|
225
|
-
const configName = application.configName;
|
226
|
-
const resourceID = await application.getResourceID();
|
227
|
-
ConfigStorage.instance = new ConfigStorage();
|
228
|
-
ConfigStorage.resourceID = resourceID;
|
229
|
-
ConfigStorage.instance.loadFormConfig(configName);
|
230
|
-
ConfigStorage.instance.loadGridConfig(configName);
|
231
|
-
}
|
232
|
-
}
|
233
|
-
return this.instance;
|
345
|
+
static preload(resourceID, configName) {
|
346
|
+
ConfigStorage.loadFormConfig(configName, resourceID);
|
347
|
+
ConfigStorage.loadGridConfig(configName, resourceID);
|
234
348
|
}
|
235
|
-
async loadFilterBarConfig(name, urlParams) {
|
236
|
-
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
349
|
+
static async loadFilterBarConfig(name, resourceID, urlParams) {
|
350
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
|
237
351
|
if (!ConfigStorage.configById.has(cacheID)) {
|
238
|
-
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(
|
352
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
|
239
353
|
}
|
240
354
|
return ConfigStorage.configById.get(cacheID);
|
241
355
|
}
|
242
|
-
async loadFormConfig(name) {
|
243
|
-
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
|
356
|
+
static async loadFormConfig(name, resourceID) {
|
357
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
|
244
358
|
if (!ConfigStorage.configById.has(cacheID)) {
|
245
|
-
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name,
|
359
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
|
246
360
|
}
|
247
361
|
return ConfigStorage.configById.get(cacheID);
|
248
362
|
}
|
249
|
-
async loadGridConfig(name) {
|
250
|
-
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
|
363
|
+
static async loadGridConfig(name, resourceID) {
|
364
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
|
251
365
|
if (!ConfigStorage.configById.has(cacheID)) {
|
252
|
-
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name,
|
366
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
|
253
367
|
}
|
254
368
|
return ConfigStorage.configById.get(cacheID);
|
255
369
|
}
|
256
|
-
static async saveFilterBarConfig(config, name) {
|
257
|
-
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
370
|
+
static async saveFilterBarConfig(config, name, resourceID) {
|
371
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
|
258
372
|
this.configById.delete(cacheID);
|
259
|
-
return this.filterBarConfigFetcher.saveConfig(config,
|
373
|
+
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
260
374
|
}
|
261
|
-
static async saveFormConfig(config, name) {
|
262
|
-
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
|
375
|
+
static async saveFormConfig(config, name, resourceID) {
|
376
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
|
263
377
|
this.configById.delete(cacheID);
|
264
|
-
return this.formConfigFetcher.saveConfig(config, name,
|
378
|
+
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
265
379
|
}
|
266
|
-
static async saveCardState(config, name) {
|
267
|
-
return this.formConfigFetcher.saveCardState(config, name,
|
380
|
+
static async saveCardState(config, name, resourceID) {
|
381
|
+
return this.formConfigFetcher.saveCardState(config, name, resourceID);
|
268
382
|
}
|
269
|
-
static async saveGridConfig(config, name) {
|
383
|
+
static async saveGridConfig(config, name, resourceID) {
|
270
384
|
if (config == undefined) {
|
271
385
|
return;
|
272
386
|
}
|
273
|
-
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
|
387
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
|
274
388
|
this.configById.delete(cacheID);
|
275
|
-
return this.gridConfigFetcher.saveConfig(config, name,
|
389
|
+
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
276
390
|
}
|
277
|
-
static async loadPersonalizedFilter(filterId, configName) {
|
278
|
-
return this.personalizedFilterFetcher.loadPersonalizedFilter(
|
391
|
+
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
392
|
+
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
|
279
393
|
}
|
280
|
-
static async savePersonalizedFilter(personalizedFilter, configName) {
|
394
|
+
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
281
395
|
//Ao criar ou alterar um filtro personalizado,
|
282
396
|
//precisamos remover o cache do status da filterbar.
|
283
|
-
const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar);
|
397
|
+
const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar, resourceID);
|
284
398
|
this.configById.delete(cacheID);
|
285
|
-
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter,
|
399
|
+
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
286
400
|
}
|
287
|
-
static async removePersonalizedFilter(personalizedFilter, configName) {
|
288
|
-
return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter,
|
401
|
+
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
402
|
+
return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter, resourceID, configName);
|
289
403
|
}
|
290
404
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
291
405
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
292
406
|
}
|
293
|
-
static buildCacheID(name, source) {
|
407
|
+
static buildCacheID(name, source, resourceID) {
|
294
408
|
if (name == undefined) {
|
295
|
-
return `req_${source}_${
|
409
|
+
return `req_${source}_${resourceID}`;
|
296
410
|
}
|
297
|
-
return `req_${source}_${name}_${
|
411
|
+
return `req_${source}_${name}_${resourceID}`;
|
298
412
|
}
|
299
413
|
}
|
300
414
|
ConfigStorage.configById = new Map();
|
@@ -303,4 +417,4 @@ ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
|
303
417
|
ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
|
304
418
|
ConfigStorage.personalizedFilterFetcher = new PersonalizedFilterFetcher();
|
305
419
|
|
306
|
-
export { ConfigStorage as C,
|
420
|
+
export { ConfigStorage as C, PersonalizedFilterFetcher as P };
|
@@ -6434,6 +6434,35 @@ class UrlUtils {
|
|
6434
6434
|
return window['mock_url'];
|
6435
6435
|
return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
|
6436
6436
|
}
|
6437
|
+
/**
|
6438
|
+
* Extrai da URL o parâmetro que contém o resourceId da tela desejada.
|
6439
|
+
*
|
6440
|
+
*/
|
6441
|
+
static getResourceIdFromUrlToken(url) {
|
6442
|
+
try {
|
6443
|
+
const parts = url.split('/');
|
6444
|
+
const encodedValue = parts[1];
|
6445
|
+
return atob(encodedValue);
|
6446
|
+
}
|
6447
|
+
catch (error) {
|
6448
|
+
throw new Error('Erro ao obter resourceId:' + error);
|
6449
|
+
}
|
6450
|
+
}
|
6451
|
+
/**
|
6452
|
+
* Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
|
6453
|
+
*
|
6454
|
+
*/
|
6455
|
+
static getPkObjectFromUrlToken(url) {
|
6456
|
+
try {
|
6457
|
+
const parts = url.split('/');
|
6458
|
+
const encodedObjectPart = parts[parts.length - 2];
|
6459
|
+
const decodedObjectPart = atob(encodedObjectPart);
|
6460
|
+
return JSON.parse(decodedObjectPart);
|
6461
|
+
}
|
6462
|
+
catch (error) {
|
6463
|
+
throw new Error('Erro ao obter a PK do objeto:' + error);
|
6464
|
+
}
|
6465
|
+
}
|
6437
6466
|
}
|
6438
6467
|
|
6439
6468
|
class ServiceBrokerRecaller {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
2
|
+
|
3
|
+
class ResourceIDUtils {
|
4
|
+
static async getResourceID() {
|
5
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
6
|
+
return application.getResourceID();
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
export { ResourceIDUtils as R };
|
@@ -1,31 +1,29 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-cfe03e99.js';
|
2
2
|
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-4a34b86a.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
|
-
constructor(configName, onConfigChange) {
|
6
|
+
constructor(configName, resourceID, onConfigChange) {
|
7
|
+
this._resourceID = resourceID;
|
7
8
|
this._configName = configName;
|
8
9
|
this._onConfigChange = onConfigChange;
|
9
10
|
}
|
10
11
|
async loadConfig() {
|
11
12
|
return new Promise(resolve => {
|
12
|
-
ConfigStorage.
|
13
|
-
.then((
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
.catch((error) => {
|
20
|
-
console.warn(error);
|
21
|
-
});
|
13
|
+
ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
14
|
+
.then((config) => {
|
15
|
+
this.setConfig(config);
|
16
|
+
resolve(config);
|
17
|
+
})
|
18
|
+
.catch((error) => {
|
19
|
+
console.warn(error);
|
22
20
|
});
|
23
21
|
});
|
24
22
|
}
|
25
23
|
saveConfig(config) {
|
26
24
|
const configToSave = ObjectUtils.copy(config);
|
27
25
|
return new Promise(accept => {
|
28
|
-
ConfigStorage.saveFormConfig(config, this._configName)
|
26
|
+
ConfigStorage.saveFormConfig(config, this._configName, this._resourceID)
|
29
27
|
.then((response) => {
|
30
28
|
this.setConfig(Object.assign(Object.assign({}, configToSave), response));
|
31
29
|
accept(Object.assign(Object.assign({}, configToSave), response));
|
@@ -40,7 +38,7 @@ class SnkFormConfigManager {
|
|
40
38
|
cardsState.set(cardId, propertyChanged === "fixed" ?
|
41
39
|
this.updateFixSequence(Object.assign(Object.assign({}, currentConfig), { fixed: cardConfig.fixed }), cardsState)
|
42
40
|
: Object.assign(Object.assign({}, currentConfig), { [propertyChanged]: cardConfig[propertyChanged] }));
|
43
|
-
ConfigStorage.saveCardState(cardsState, this._configName)
|
41
|
+
ConfigStorage.saveCardState(cardsState, this._configName, this._resourceID)
|
44
42
|
.then(savedCardConfig => {
|
45
43
|
this._config = Object.assign(Object.assign({}, this._config), { cardsState });
|
46
44
|
resolve(savedCardConfig);
|
@@ -116,18 +114,18 @@ class SnkFormConfigManager {
|
|
116
114
|
}
|
117
115
|
return this._formConfigFetcher;
|
118
116
|
}
|
119
|
-
async fetchUserAvailableConfigs(
|
117
|
+
async fetchUserAvailableConfigs() {
|
120
118
|
if (this._configName != undefined) {
|
121
119
|
//FIXME: Precisamos preparar o backend para retornar as configurações disponíveis para details;
|
122
120
|
return Promise.resolve(undefined);
|
123
121
|
}
|
124
|
-
return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,
|
122
|
+
return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, this._resourceID);
|
125
123
|
}
|
126
|
-
async fetchLegacyConfig(
|
127
|
-
return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,
|
124
|
+
async fetchLegacyConfig() {
|
125
|
+
return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, this._resourceID);
|
128
126
|
}
|
129
|
-
async fetchDefaultConfig(
|
130
|
-
return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,
|
127
|
+
async fetchDefaultConfig() {
|
128
|
+
return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
|
131
129
|
}
|
132
130
|
}
|
133
131
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DataUnit, StringUtils, DataType, DataUnitStorage, ChangeOperation } from '@sankhyalabs/core';
|
2
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
2
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-aaaff866.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
1
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-aaaff866.js';
|
2
2
|
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import { R as ResourceFetcher } from './resource-fetcher-
|
3
|
+
import { R as ResourceFetcher } from './resource-fetcher-b36ac145.js';
|
4
4
|
|
5
5
|
class FormConfigFetcher extends ResourceFetcher {
|
6
6
|
constructor() {
|