@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.0-rc.1
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-12397f18.js → ConfigStorage-e9d7fa82.js} +51 -163
- package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-39b63a1e.js} +29 -67
- package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-2f8eccd9.js} +21 -19
- package/dist/cjs/{auth-fetcher-319a4cb2.js → auth-fetcher-d407c31c.js} +2 -2
- package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-15a7cc88.js} +1 -1
- package/dist/cjs/filter-bar-config-fetcher-24548cec.js +155 -0
- package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-ab3ce222.js} +3 -66
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-96c042aa.js} +1 -1
- package/dist/cjs/resource-fetcher-64102551.js +68 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +11 -18
- package/dist/cjs/snk-application.cjs.entry.js +44 -49
- package/dist/cjs/snk-attach.cjs.entry.js +13 -7
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -2
- package/dist/cjs/snk-crud.cjs.entry.js +10 -25
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-e89e07bd.js} +3 -4
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +12 -14
- package/dist/cjs/snk-entity-list.cjs.entry.js +4 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -14
- package/dist/cjs/snk-filter-detail.cjs.entry.js +15 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +19 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -6
- package/dist/cjs/snk-form.cjs.entry.js +8 -12
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
- package/dist/cjs/snk-grid.cjs.entry.js +20 -17
- package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8518c61b.js} +7 -17
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +16 -13
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +72 -20
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -2
- package/dist/collection/components/snk-actions-button/actions/index.js +4 -3
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +4 -8
- package/dist/collection/components/snk-application/snk-application.js +65 -60
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -19
- package/dist/collection/components/snk-crud/snk-crud.js +6 -40
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -42
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +28 -47
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +4 -21
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +12 -2
- 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 +16 -21
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -28
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +19 -17
- package/dist/collection/components/snk-form/snk-form.js +2 -46
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +15 -5
- package/dist/collection/components/snk-grid/snk-grid.js +15 -51
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +1 -19
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +12 -28
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +0 -22
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -19
- package/dist/collection/lib/configs/ConfigStorage.js +44 -33
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +59 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -38
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +24 -0
- package/dist/collection/lib/index.js +0 -10
- package/dist/collection/lib/utils/urlutils.js +0 -29
- package/dist/components/ConfigStorage.js +48 -161
- package/dist/components/DataFetcher.js +29 -67
- package/dist/components/SnkFormConfigManager.js +19 -17
- package/dist/components/auth-fetcher.js +1 -1
- package/dist/components/filter-bar-config-fetcher.js +153 -0
- package/dist/components/form-config-fetcher.js +2 -64
- package/dist/components/resource-fetcher.js +66 -0
- package/dist/components/snk-actions-button2.js +9 -23
- package/dist/components/snk-application2.js +128 -134
- package/dist/components/snk-attach2.js +8 -1
- package/dist/components/snk-configurator2.js +1 -3
- package/dist/components/snk-crud.js +6 -23
- package/dist/components/snk-data-unit2.js +3 -5
- package/dist/components/snk-detail-view2.js +8 -20
- package/dist/components/snk-entity-list.js +4 -0
- package/dist/components/snk-filter-bar2.js +12 -12
- package/dist/components/snk-filter-detail2.js +12 -2
- package/dist/components/snk-filter-modal-item2.js +16 -5
- package/dist/components/snk-form-config2.js +15 -5
- package/dist/components/snk-form-view2.js +1 -6
- package/dist/components/snk-form.js +2 -9
- package/dist/components/snk-grid-config2.js +2 -4
- package/dist/components/snk-grid2.js +16 -17
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-simple-crud2.js +60 -8
- package/dist/components/snk-taskbar2.js +1 -3
- package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-1090289a.js} +49 -162
- package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-a4ed43e7.js} +29 -67
- package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-de537eca.js} +21 -19
- package/dist/esm/{auth-fetcher-6d9664b7.js → auth-fetcher-c53e0d6c.js} +1 -1
- package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-8d0bfa4a.js} +1 -1
- package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +153 -0
- package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-4065db9a.js} +3 -65
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-7460b876.js} +1 -1
- package/dist/esm/resource-fetcher-45a70066.js +66 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +11 -18
- package/dist/esm/snk-application.entry.js +44 -49
- package/dist/esm/snk-attach.entry.js +9 -3
- package/dist/esm/snk-configurator.entry.js +1 -2
- package/dist/esm/snk-crud.entry.js +10 -25
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-8c4d944d.js} +3 -4
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +12 -14
- package/dist/esm/snk-entity-list.entry.js +4 -0
- package/dist/esm/snk-filter-bar.entry.js +17 -14
- package/dist/esm/snk-filter-detail.entry.js +16 -2
- package/dist/esm/snk-filter-modal-item.entry.js +20 -6
- package/dist/esm/snk-form-config.entry.js +18 -7
- package/dist/esm/snk-form-view.entry.js +1 -6
- package/dist/esm/snk-form.entry.js +8 -12
- package/dist/esm/snk-grid-config.entry.js +6 -5
- package/dist/esm/snk-grid.entry.js +20 -17
- package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-cdecff6e.js} +7 -17
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +16 -13
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +62 -10
- package/dist/esm/snk-taskbar.entry.js +1 -2
- package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-0848ee4d.entry.js} +1 -1
- package/dist/sankhyablocks/p-0bd9c412.js +1 -0
- package/dist/sankhyablocks/p-0fb83448.js +1 -0
- package/dist/sankhyablocks/p-10b2aedc.entry.js +1 -0
- package/dist/sankhyablocks/p-1f63dcd4.entry.js +1 -0
- package/dist/sankhyablocks/p-216b2102.entry.js +1 -0
- package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
- package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
- package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
- package/dist/sankhyablocks/p-50c13cc8.entry.js +1 -0
- package/dist/sankhyablocks/p-52c6b2e7.js +1 -0
- package/dist/sankhyablocks/p-564efc43.js +1 -0
- package/dist/sankhyablocks/p-5994af77.js +56 -0
- package/dist/sankhyablocks/p-6bb904bb.entry.js +1 -0
- package/dist/sankhyablocks/p-6e06175e.entry.js +1 -0
- package/dist/sankhyablocks/p-6f0795c8.entry.js +1 -0
- package/dist/sankhyablocks/p-7588f006.entry.js +1 -0
- package/dist/sankhyablocks/p-847e6c20.js +17 -0
- package/dist/sankhyablocks/p-8f3652bf.entry.js +11 -0
- package/dist/sankhyablocks/p-9471cbc9.entry.js +1 -0
- package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
- package/dist/sankhyablocks/p-a42dd503.entry.js +1 -0
- package/dist/sankhyablocks/p-b04fb9d4.js +1 -0
- package/dist/sankhyablocks/{p-2d333d22.js → p-b978da60.js} +1 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +1 -0
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +1 -0
- package/dist/sankhyablocks/p-c6380ea2.entry.js +1 -0
- package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
- package/dist/sankhyablocks/p-d7c7a289.entry.js +1 -0
- package/dist/sankhyablocks/p-de69b4b0.entry.js +1 -0
- package/dist/sankhyablocks/p-f3b7b69e.js +10 -0
- package/dist/sankhyablocks/p-f7eded3a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff7383b0.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -2
- package/dist/types/components/snk-application/snk-application.d.ts +13 -8
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +0 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -5
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -8
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +0 -5
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +2 -9
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -4
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
- 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 +4 -5
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +4 -5
- package/dist/types/components/snk-form/snk-form.d.ts +1 -9
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +2 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -5
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +0 -4
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +1 -5
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -4
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
- package/dist/types/components.d.ts +21 -125
- package/dist/types/lib/configs/ConfigStorage.d.ts +13 -11
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +0 -11
- package/dist/types/lib/utils/urlutils.d.ts +0 -14
- package/package.json +2 -2
- package/dist/cjs/ISave-d68ce3cd.js +0 -8
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +0 -12
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
- package/dist/components/ResourceIDUtils.js +0 -10
- package/dist/esm/ISave-4412b20c.js +0 -8
- package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
- package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
- package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
- package/dist/sankhyablocks/p-41e897f1.js +0 -56
- package/dist/sankhyablocks/p-48a40939.js +0 -1
- package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
- package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
- package/dist/sankhyablocks/p-688dcb4c.js +0 -1
- package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
- package/dist/sankhyablocks/p-787071a8.js +0 -1
- package/dist/sankhyablocks/p-8481bb59.entry.js +0 -1
- package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
- package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
- package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
- package/dist/sankhyablocks/p-9e7d65a4.js +0 -1
- package/dist/sankhyablocks/p-a52a6c9d.js +0 -26
- package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
- package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
- package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
- package/dist/sankhyablocks/p-e086cc2a.entry.js +0 -1
- package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
- package/dist/sankhyablocks/p-ed41b38c.js +0 -1
- package/dist/sankhyablocks/p-ed705cbb.entry.js +0 -1
- package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
- package/dist/sankhyablocks/p-f74fe358.js +0 -1
- package/dist/sankhyablocks/p-f91e0c5d.entry.js +0 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +0 -3
@@ -4,20 +4,17 @@ 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 constants = require('./constants-d187e03e.js');
|
7
|
+
const constants$1 = require('./constants-d187e03e.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./DataFetcher-39b63a1e.js');
|
10
|
+
require('./pesquisa-fetcher-96c042aa.js');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
|
-
require('./ISave-d68ce3cd.js');
|
13
|
-
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./filter-item-type.enum-aa823a00.js');
|
16
|
-
require('./form-config-fetcher-5d62ab62.js');
|
17
12
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
13
|
+
const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
18
14
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
|
19
15
|
require('./index-102ba62d.js');
|
20
16
|
require('./_commonjsHelpers-537d719a.js');
|
17
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
21
18
|
|
22
19
|
class InMemoryLoader {
|
23
20
|
constructor(metadata, records) {
|
@@ -25,7 +22,7 @@ class InMemoryLoader {
|
|
25
22
|
this.metadata = metadata;
|
26
23
|
this._dataUnit = new core.DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
27
24
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
28
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
25
|
+
this._dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
|
29
26
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
30
27
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
31
28
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -62,6 +59,62 @@ class InMemoryLoader {
|
|
62
59
|
metadaLoader() {
|
63
60
|
return Promise.resolve(this._metadata);
|
64
61
|
}
|
62
|
+
dataLoader(dataUnit, request) {
|
63
|
+
const filters = this.getColumnFilters(dataUnit);
|
64
|
+
let records = this.applyFilters(filters);
|
65
|
+
if (request.sort) {
|
66
|
+
request.sort.forEach(sort => {
|
67
|
+
records = records.sort((recordA, recordB) => {
|
68
|
+
const fieldA = recordA[sort.field];
|
69
|
+
const fieldB = recordB[sort.field];
|
70
|
+
const sortFn = this.getSortFn(sort.dataType);
|
71
|
+
return sortFn(fieldA, fieldB) * (sort.mode == core.SortMode.ASC ? 1 : -1);
|
72
|
+
});
|
73
|
+
});
|
74
|
+
}
|
75
|
+
return Promise.resolve({ records: records });
|
76
|
+
}
|
77
|
+
applyFilters(filters) {
|
78
|
+
let records = [...this._records];
|
79
|
+
filters.forEach(filter => {
|
80
|
+
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
81
|
+
});
|
82
|
+
return records;
|
83
|
+
}
|
84
|
+
getColumnFilters(dataUnit) {
|
85
|
+
var _a, _b;
|
86
|
+
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
87
|
+
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(constants.DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
88
|
+
return columnFilters.map(filter => {
|
89
|
+
var _a, _b;
|
90
|
+
return {
|
91
|
+
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(constants.DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
92
|
+
values: filter.params.map(param => param.value),
|
93
|
+
};
|
94
|
+
});
|
95
|
+
}
|
96
|
+
getSortFn(type) {
|
97
|
+
switch (type) {
|
98
|
+
case core.DataType.NUMBER:
|
99
|
+
return this.sortNumber;
|
100
|
+
case core.DataType.DATE:
|
101
|
+
return this.sortDate;
|
102
|
+
case core.DataType.OBJECT:
|
103
|
+
return this.sortObject;
|
104
|
+
default:
|
105
|
+
return core.StringUtils.compare;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
sortObject(a, b) {
|
109
|
+
return core.StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
110
|
+
}
|
111
|
+
sortNumber(a, b) {
|
112
|
+
return a - b;
|
113
|
+
}
|
114
|
+
sortDate(a, b) {
|
115
|
+
let timeA = a.getTime(), timeB = b.getTime();
|
116
|
+
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
117
|
+
}
|
65
118
|
saveLoader(_dataUnit, changes) {
|
66
119
|
return new Promise((resolve) => {
|
67
120
|
let dataUnitRecords = [];
|
@@ -104,7 +157,6 @@ const SnkSimpleCrud = class {
|
|
104
157
|
this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
|
105
158
|
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
106
159
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
107
|
-
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
108
160
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
109
161
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
110
162
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
@@ -115,11 +167,11 @@ const SnkSimpleCrud = class {
|
|
115
167
|
"snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
|
116
168
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
117
169
|
});
|
118
|
-
this._currentViewMode = constants.VIEW_MODE.GRID;
|
170
|
+
this._currentViewMode = constants$1.VIEW_MODE.GRID;
|
119
171
|
this._config = undefined;
|
120
172
|
this.dataState = undefined;
|
121
173
|
this.dataUnit = undefined;
|
122
|
-
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
174
|
+
this.mode = constants$1.SIMPLE_CRUD_MODE.SERVER;
|
123
175
|
this.gridConfig = undefined;
|
124
176
|
this.formConfig = undefined;
|
125
177
|
this.multipleSelection = undefined;
|
@@ -130,7 +182,7 @@ const SnkSimpleCrud = class {
|
|
130
182
|
}
|
131
183
|
resolveInMemoryBtns(taskbarButtons) {
|
132
184
|
const newTaskBarConfig = [...taskbarButtons];
|
133
|
-
if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
185
|
+
if (this.mode === constants$1.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
134
186
|
newTaskBarConfig.splice(1, 1);
|
135
187
|
}
|
136
188
|
return newTaskBarConfig;
|
@@ -147,15 +199,15 @@ const SnkSimpleCrud = class {
|
|
147
199
|
actionClickListener(evt) {
|
148
200
|
const act = evt.detail;
|
149
201
|
if (act === taskbarElements.TaskbarElement.GRID_MODE) {
|
150
|
-
this.goToView(constants.VIEW_MODE.GRID);
|
202
|
+
this.goToView(constants$1.VIEW_MODE.GRID);
|
151
203
|
}
|
152
204
|
else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
|
153
|
-
this.goToView(constants.VIEW_MODE.FORM);
|
205
|
+
this.goToView(constants$1.VIEW_MODE.FORM);
|
154
206
|
}
|
155
207
|
evt.stopPropagation();
|
156
208
|
}
|
157
209
|
onModeChange() {
|
158
|
-
if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
210
|
+
if (this.mode == constants$1.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
159
211
|
this.initInMemoryDataUnit();
|
160
212
|
}
|
161
213
|
}
|
@@ -185,9 +237,9 @@ const SnkSimpleCrud = class {
|
|
185
237
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
186
238
|
!this.dataState.selectionInfo.isAllRecords() &&
|
187
239
|
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
188
|
-
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
240
|
+
return this._currentViewMode === constants$1.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
189
241
|
}
|
190
|
-
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
242
|
+
return this._currentViewMode === constants$1.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
191
243
|
}
|
192
244
|
initInMemoryDataUnit() {
|
193
245
|
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
@@ -265,13 +317,13 @@ const SnkSimpleCrud = class {
|
|
265
317
|
handleCancelEdit() {
|
266
318
|
var _a;
|
267
319
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
268
|
-
this.goToView(constants.VIEW_MODE.GRID);
|
320
|
+
this.goToView(constants$1.VIEW_MODE.GRID);
|
269
321
|
this.dataUnit.clearSelection();
|
270
322
|
}
|
271
323
|
}
|
272
324
|
render() {
|
273
325
|
var _a;
|
274
|
-
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
326
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants$1.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants$1.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants$1.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
275
327
|
? undefined
|
276
328
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
277
329
|
}
|
@@ -33,7 +33,6 @@ const SnkTaskbar = class {
|
|
33
33
|
};
|
34
34
|
this._permissions = undefined;
|
35
35
|
this.configName = undefined;
|
36
|
-
this.resourceID = undefined;
|
37
36
|
this.buttons = undefined;
|
38
37
|
this.customButtons = undefined;
|
39
38
|
this.actionsList = undefined;
|
@@ -175,7 +174,7 @@ const SnkTaskbar = class {
|
|
175
174
|
componentWillLoad() {
|
176
175
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
177
176
|
if (this._application) {
|
178
|
-
this._application.getAllAccess(
|
177
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
179
178
|
}
|
180
179
|
else {
|
181
180
|
this._permissions = {};
|
@@ -8,14 +8,13 @@ const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
|
|
8
8
|
const NUFIN_COLUMN = 'NUFIN';
|
9
9
|
const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
|
10
10
|
export default class Actions {
|
11
|
-
constructor(actionsExecuteInterface, dataUnit
|
11
|
+
constructor(actionsExecuteInterface, dataUnit) {
|
12
12
|
var _a;
|
13
13
|
this._lastValuesCache = {};
|
14
14
|
this._actionsExecuteInterface = actionsExecuteInterface;
|
15
15
|
this._dataUnit = dataUnit;
|
16
16
|
this._selectedRows = ((_a = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo()) === null || _a === void 0 ? void 0 : _a.isAllRecords()) ? [] : dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo().records;
|
17
17
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
18
|
-
this._appResourceId = appResourceId;
|
19
18
|
}
|
20
19
|
apply(action, hasParamsToSave) {
|
21
20
|
this._application.closePopUp();
|
@@ -278,7 +277,9 @@ export default class Actions {
|
|
278
277
|
}
|
279
278
|
}
|
280
279
|
async buildResourceId(actionId) {
|
281
|
-
|
280
|
+
let appResId = '';
|
281
|
+
appResId = await this._application.getResourceID();
|
282
|
+
return appResId + '.actionconfig.' + actionId;
|
282
283
|
}
|
283
284
|
prepareAndExecute(execSource, executeAction) {
|
284
285
|
this.addRows(execSource);
|
@@ -4,14 +4,13 @@ import { DataFetcher } from '../../lib/http/data-fetcher/DataFetcher';
|
|
4
4
|
import ExecutorFactory from './actions/factory/executor.factory';
|
5
5
|
import Actions from './actions';
|
6
6
|
import ClientEventConfirm from './clientEvent';
|
7
|
-
import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
|
8
7
|
export class SnkActionsButton {
|
9
8
|
constructor() {
|
10
9
|
this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
|
11
10
|
this.handleClick = (evt) => {
|
12
11
|
const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
|
13
12
|
const executor = new ExecutorFactory(selectedAction.type).executor;
|
14
|
-
const action = new Actions(executor, this._dataUnit
|
13
|
+
const action = new Actions(executor, this._dataUnit);
|
15
14
|
action.execute(Object.assign({}, selectedAction));
|
16
15
|
this._showDropdown = false;
|
17
16
|
};
|
@@ -69,15 +68,12 @@ export class SnkActionsButton {
|
|
69
68
|
document.addEventListener("scroll", this.positionDropdown.bind(this));
|
70
69
|
}
|
71
70
|
async componentWillLoad() {
|
71
|
+
var _a;
|
72
72
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
73
|
+
this._resourceID = await this._application.getResourceID();
|
73
74
|
this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
|
74
|
-
|
75
|
-
this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
|
76
|
-
this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
|
75
|
+
this._dataUnit = (_a = this._element.parentElement) === null || _a === void 0 ? void 0 : _a.dataUnit;
|
77
76
|
this._entityName = this._dataUnit.name.split('/')[2];
|
78
|
-
if (this._resourceID == undefined) {
|
79
|
-
this._resourceID = await ResourceIDUtils.getResourceID();
|
80
|
-
}
|
81
77
|
this.setEvents();
|
82
78
|
this.getActions().then(() => {
|
83
79
|
this.loadItems();
|
@@ -13,6 +13,7 @@ import Workspace from "../../lib/workspace/workspace";
|
|
13
13
|
import AppletCaller from "../../lib/applet-caller/applet-caller";
|
14
14
|
import ParametersFetcher from "../../lib/http/data-fetcher/fetchers/parameters-fecher";
|
15
15
|
import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
|
16
|
+
import GridConfigFetcher from "../../lib/http/data-fetcher/fetchers/grid-config-fetcher";
|
16
17
|
import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
|
17
18
|
import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
18
19
|
/**
|
@@ -35,21 +36,16 @@ export class SnkApplication {
|
|
35
36
|
}
|
36
37
|
return this._parameters;
|
37
38
|
}
|
38
|
-
|
39
|
-
if (
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
this.authFetcher.getData(resourceID).then((authList) => {
|
45
|
-
resolve(authList);
|
46
|
-
}).catch(error => {
|
47
|
-
reject(error);
|
48
|
-
});
|
49
|
-
});
|
39
|
+
get resourceID() {
|
40
|
+
if (!this._resourceID) {
|
41
|
+
this._resourceID = this.urlParams.get("workspaceResourceID") ||
|
42
|
+
this.urlParams.get("resourceID") ||
|
43
|
+
Workspace.resourceID ||
|
44
|
+
"unknown.resource.id";
|
50
45
|
}
|
46
|
+
return this._resourceID;
|
51
47
|
}
|
52
|
-
|
48
|
+
get auth() {
|
53
49
|
if (this._auth) {
|
54
50
|
return Promise.resolve(this._auth);
|
55
51
|
}
|
@@ -58,7 +54,7 @@ export class SnkApplication {
|
|
58
54
|
const waitingAuth = this._authPromises.length > 0;
|
59
55
|
this._authPromises.push(new PendingPromise(resolve, reject));
|
60
56
|
if (!waitingAuth) {
|
61
|
-
this.authFetcher.getData(this.
|
57
|
+
this.authFetcher.getData(this.resourceID).then((authList) => {
|
62
58
|
this._auth = authList;
|
63
59
|
while (this._authPromises.length > 0) {
|
64
60
|
this._authPromises.pop().resolve(this._auth);
|
@@ -77,7 +73,7 @@ export class SnkApplication {
|
|
77
73
|
*/
|
78
74
|
async isUserSup() {
|
79
75
|
return new Promise((resolve, reject) => {
|
80
|
-
this.
|
76
|
+
this.auth.then((authorization) => {
|
81
77
|
this.getAuthList(authorization).then((auths) => {
|
82
78
|
resolve(auths.isSup);
|
83
79
|
}).catch(error => reject(error));
|
@@ -91,9 +87,9 @@ export class SnkApplication {
|
|
91
87
|
/**
|
92
88
|
* Obtém `true` caso o usuário logado tem permissão pra determinada ação.
|
93
89
|
*/
|
94
|
-
async hasAccess(access
|
90
|
+
async hasAccess(access) {
|
95
91
|
return new Promise((resolve, reject) => {
|
96
|
-
this.
|
92
|
+
this.auth.then((authorization) => {
|
97
93
|
this.getAuthList(authorization).then((auths) => {
|
98
94
|
resolve(auths.isSup || auths.actions[access]);
|
99
95
|
}).catch(error => reject(error));
|
@@ -103,9 +99,9 @@ export class SnkApplication {
|
|
103
99
|
/**
|
104
100
|
* Obtém todos os acessos do usuário logado.
|
105
101
|
*/
|
106
|
-
async getAllAccess(
|
102
|
+
async getAllAccess() {
|
107
103
|
return new Promise((resolve, reject) => {
|
108
|
-
this.
|
104
|
+
this.auth.then((authorization) => {
|
109
105
|
this.getAuthList(authorization).then((auths) => {
|
110
106
|
const allAccess = {};
|
111
107
|
allAccess['isSup'] = auths.isSup;
|
@@ -289,16 +285,13 @@ export class SnkApplication {
|
|
289
285
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
290
286
|
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
291
287
|
*/
|
292
|
-
async createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
293
|
-
if (resourceID == undefined) {
|
294
|
-
resourceID = this.applicationResourceID;
|
295
|
-
}
|
288
|
+
async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
|
296
289
|
return new Promise((resolve, reject) => {
|
297
290
|
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
298
291
|
const waitingDu = duPromisses.length > 0;
|
299
292
|
duPromisses.push(new PendingPromise(resolve, reject));
|
300
293
|
if (!waitingDu) {
|
301
|
-
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
|
294
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID, parentDataUnit, configName);
|
302
295
|
dataUnit.loadMetadata().then(() => {
|
303
296
|
if (dataUnitName) {
|
304
297
|
this.updateDataunitCache(undefined, dataUnitName, dataUnit);
|
@@ -329,14 +322,14 @@ export class SnkApplication {
|
|
329
322
|
/**
|
330
323
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
331
324
|
*/
|
332
|
-
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName
|
325
|
+
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
|
333
326
|
return new Promise((resolve, reject) => {
|
334
327
|
const dataUnit = this._duCache.get(dataUnitName);
|
335
328
|
if (dataUnit) {
|
336
329
|
resolve(dataUnit);
|
337
330
|
}
|
338
331
|
else {
|
339
|
-
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
332
|
+
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
|
340
333
|
resolve(dataUnit);
|
341
334
|
}).catch(reason => reject(reason));
|
342
335
|
}
|
@@ -385,20 +378,11 @@ export class SnkApplication {
|
|
385
378
|
async callServiceBroker(serviceName, payload, options) {
|
386
379
|
return DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
387
380
|
}
|
388
|
-
get applicationResourceID() {
|
389
|
-
if (!this._applicationResourceID) {
|
390
|
-
this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
|
391
|
-
this.urlParams.get("resourceID") ||
|
392
|
-
Workspace.resourceID ||
|
393
|
-
"unknown.resource.id";
|
394
|
-
}
|
395
|
-
return this._applicationResourceID;
|
396
|
-
}
|
397
381
|
/**
|
398
382
|
* Obtém o resourceID da tela em questão.
|
399
383
|
*/
|
400
384
|
async getResourceID() {
|
401
|
-
return Promise.resolve(this.
|
385
|
+
return Promise.resolve(this.resourceID);
|
402
386
|
}
|
403
387
|
/**
|
404
388
|
* Obtém o UserId da tela em questão.
|
@@ -442,14 +426,20 @@ export class SnkApplication {
|
|
442
426
|
async info(message, options) {
|
443
427
|
return ApplicationUtils.info(message, options);
|
444
428
|
}
|
429
|
+
/**
|
430
|
+
* Obtém a configuração de grade.
|
431
|
+
*/
|
432
|
+
async loadGridConfig(name) {
|
433
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
434
|
+
}
|
445
435
|
/**
|
446
436
|
* Obtém os totalizadores da grade.
|
447
437
|
*/
|
448
438
|
async loadTotals(name, resourceID, filters) {
|
449
439
|
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
450
440
|
}
|
451
|
-
async getAuthList(
|
452
|
-
return await (new MGEAuthorization()).parseFromJSON(
|
441
|
+
async getAuthList(_auth) {
|
442
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
453
443
|
}
|
454
444
|
get urlParams() {
|
455
445
|
if (!this._urlParams) {
|
@@ -463,6 +453,12 @@ export class SnkApplication {
|
|
463
453
|
}
|
464
454
|
return this._dataUnitFetcher;
|
465
455
|
}
|
456
|
+
get gridConfigFetcher() {
|
457
|
+
if (!this._gridConfigFetcher) {
|
458
|
+
this._gridConfigFetcher = new GridConfigFetcher();
|
459
|
+
}
|
460
|
+
return this._gridConfigFetcher;
|
461
|
+
}
|
466
462
|
get totalsFetcher() {
|
467
463
|
if (!this._totalsFetcher) {
|
468
464
|
this._totalsFetcher = new TotalsFetcher();
|
@@ -562,7 +558,7 @@ export class SnkApplication {
|
|
562
558
|
* Obtém o nome das telas da aplicação
|
563
559
|
*/
|
564
560
|
async getAppLabel() {
|
565
|
-
return Workspace.getAppLabel(this.
|
561
|
+
return Workspace.getAppLabel(this._resourceID);
|
566
562
|
}
|
567
563
|
/**
|
568
564
|
* Adiciona um listener no fetcher de Pesquisa
|
@@ -634,7 +630,6 @@ export class SnkApplication {
|
|
634
630
|
this._popUp.ezTitle = title;
|
635
631
|
}
|
636
632
|
componentWillLoad() {
|
637
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
|
638
633
|
this._errorHandler = new SnkErrorHandler(this);
|
639
634
|
this.messagesBuilder = new SnkMessageBuilder();
|
640
635
|
ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
@@ -643,7 +638,7 @@ export class SnkApplication {
|
|
643
638
|
});
|
644
639
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
645
640
|
ErrorTracking.init();
|
646
|
-
ConfigStorage.
|
641
|
+
ConfigStorage.get();
|
647
642
|
}
|
648
643
|
connectedCallback() {
|
649
644
|
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
@@ -655,10 +650,9 @@ export class SnkApplication {
|
|
655
650
|
componentDidLoad() {
|
656
651
|
this.applicationLoading.emit(true);
|
657
652
|
window.requestAnimationFrame(() => {
|
658
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
|
659
653
|
this.applicationLoaded.emit(true);
|
660
654
|
});
|
661
|
-
ElementIDUtils.addIDInfo(this._element, `resource_${this.
|
655
|
+
ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
|
662
656
|
}
|
663
657
|
render() {
|
664
658
|
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
@@ -788,13 +782,10 @@ export class SnkApplication {
|
|
788
782
|
},
|
789
783
|
"hasAccess": {
|
790
784
|
"complexType": {
|
791
|
-
"signature": "(access: AutorizationType
|
785
|
+
"signature": "(access: AutorizationType) => Promise<boolean>",
|
792
786
|
"parameters": [{
|
793
787
|
"tags": [],
|
794
788
|
"text": ""
|
795
|
-
}, {
|
796
|
-
"tags": [],
|
797
|
-
"text": ""
|
798
789
|
}],
|
799
790
|
"references": {
|
800
791
|
"Promise": {
|
@@ -814,11 +805,8 @@ export class SnkApplication {
|
|
814
805
|
},
|
815
806
|
"getAllAccess": {
|
816
807
|
"complexType": {
|
817
|
-
"signature": "(
|
818
|
-
"parameters": [
|
819
|
-
"tags": [],
|
820
|
-
"text": ""
|
821
|
-
}],
|
808
|
+
"signature": "() => Promise<any>",
|
809
|
+
"parameters": [],
|
822
810
|
"references": {
|
823
811
|
"Promise": {
|
824
812
|
"location": "global"
|
@@ -1167,7 +1155,7 @@ export class SnkApplication {
|
|
1167
1155
|
},
|
1168
1156
|
"createDataunit": {
|
1169
1157
|
"complexType": {
|
1170
|
-
"signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string
|
1158
|
+
"signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>",
|
1171
1159
|
"parameters": [{
|
1172
1160
|
"tags": [],
|
1173
1161
|
"text": ""
|
@@ -1180,9 +1168,6 @@ export class SnkApplication {
|
|
1180
1168
|
}, {
|
1181
1169
|
"tags": [],
|
1182
1170
|
"text": ""
|
1183
|
-
}, {
|
1184
|
-
"tags": [],
|
1185
|
-
"text": ""
|
1186
1171
|
}],
|
1187
1172
|
"references": {
|
1188
1173
|
"Promise": {
|
@@ -1249,7 +1234,7 @@ export class SnkApplication {
|
|
1249
1234
|
},
|
1250
1235
|
"getDataUnit": {
|
1251
1236
|
"complexType": {
|
1252
|
-
"signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string
|
1237
|
+
"signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>",
|
1253
1238
|
"parameters": [{
|
1254
1239
|
"tags": [],
|
1255
1240
|
"text": ""
|
@@ -1262,9 +1247,6 @@ export class SnkApplication {
|
|
1262
1247
|
}, {
|
1263
1248
|
"tags": [],
|
1264
1249
|
"text": ""
|
1265
|
-
}, {
|
1266
|
-
"tags": [],
|
1267
|
-
"text": ""
|
1268
1250
|
}],
|
1269
1251
|
"references": {
|
1270
1252
|
"Promise": {
|
@@ -1658,6 +1640,29 @@ export class SnkApplication {
|
|
1658
1640
|
"tags": []
|
1659
1641
|
}
|
1660
1642
|
},
|
1643
|
+
"loadGridConfig": {
|
1644
|
+
"complexType": {
|
1645
|
+
"signature": "(name: string) => Promise<IGridConfig>",
|
1646
|
+
"parameters": [{
|
1647
|
+
"tags": [],
|
1648
|
+
"text": ""
|
1649
|
+
}],
|
1650
|
+
"references": {
|
1651
|
+
"Promise": {
|
1652
|
+
"location": "global"
|
1653
|
+
},
|
1654
|
+
"IGridConfig": {
|
1655
|
+
"location": "import",
|
1656
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
1657
|
+
}
|
1658
|
+
},
|
1659
|
+
"return": "Promise<IGridConfig>"
|
1660
|
+
},
|
1661
|
+
"docs": {
|
1662
|
+
"text": "Obt\u00E9m a configura\u00E7\u00E3o de grade.",
|
1663
|
+
"tags": []
|
1664
|
+
}
|
1665
|
+
},
|
1661
1666
|
"loadTotals": {
|
1662
1667
|
"complexType": {
|
1663
1668
|
"signature": "(name: string, resourceID: string, filters: Array<Filter>) => Promise<Map<string, number>>",
|
@@ -8,7 +8,6 @@ export class SnkConfigurator {
|
|
8
8
|
this._permissions = undefined;
|
9
9
|
this.showActionButtons = false;
|
10
10
|
this.configName = undefined;
|
11
|
-
this.resourceID = undefined;
|
12
11
|
this.viewMode = VIEW_MODE.GRID;
|
13
12
|
this.messagesBuilder = undefined;
|
14
13
|
}
|
@@ -73,7 +72,7 @@ export class SnkConfigurator {
|
|
73
72
|
componentWillLoad() {
|
74
73
|
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
75
74
|
if (this._application) {
|
76
|
-
this._application.getAllAccess(
|
75
|
+
this._application.getAllAccess().then(access => (this._permissions = access));
|
77
76
|
}
|
78
77
|
else {
|
79
78
|
this._permissions = {};
|
@@ -131,23 +130,6 @@ export class SnkConfigurator {
|
|
131
130
|
"attribute": "config-name",
|
132
131
|
"reflect": false
|
133
132
|
},
|
134
|
-
"resourceID": {
|
135
|
-
"type": "string",
|
136
|
-
"mutable": false,
|
137
|
-
"complexType": {
|
138
|
-
"original": "string",
|
139
|
-
"resolved": "string",
|
140
|
-
"references": {}
|
141
|
-
},
|
142
|
-
"required": false,
|
143
|
-
"optional": false,
|
144
|
-
"docs": {
|
145
|
-
"tags": [],
|
146
|
-
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
147
|
-
},
|
148
|
-
"attribute": "resource-i-d",
|
149
|
-
"reflect": false
|
150
|
-
},
|
151
133
|
"viewMode": {
|
152
134
|
"type": "number",
|
153
135
|
"mutable": false,
|