@sankhyalabs/sankhyablocks 8.3.0 → 8.4.0-dev.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-e9d7fa82.js → ConfigStorage-f0f89379.js} +163 -51
- package/dist/cjs/{DataFetcher-39b63a1e.js → DataFetcher-4798bac3.js} +136 -244
- package/dist/cjs/ISave-d68ce3cd.js +8 -0
- package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
- package/dist/cjs/{SnkFormConfigManager-2f8eccd9.js → SnkFormConfigManager-d5fd8800.js} +19 -21
- package/dist/cjs/{auth-fetcher-d407c31c.js → auth-fetcher-f2967437.js} +2 -2
- package/dist/cjs/{dataunit-fetcher-15a7cc88.js → dataunit-fetcher-959c9a00.js} +1 -1
- package/dist/cjs/{form-config-fetcher-ab3ce222.js → form-config-fetcher-5e3d3b87.js} +66 -3
- package/dist/cjs/index-f9e81701.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-96c042aa.js → pesquisa-fetcher-7973c081.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +19 -11
- package/dist/cjs/snk-application.cjs.entry.js +60 -44
- package/dist/cjs/snk-attach.cjs.entry.js +9 -14
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +28 -11
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
- package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-7cc1846d.js} +5 -5
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +17 -13
- 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 +7 -16
- 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 +23 -22
- package/dist/cjs/{snk-guides-viewer-8518c61b.js → snk-guides-viewer-b7b680d2.js} +19 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -85
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-taskbar.cjs.entry.js +71 -5
- package/dist/cjs/{taskbar-elements-b98dd6e9.js → taskbar-elements-39949c7a.js} +4 -4
- package/dist/collection/collection-manifest.json +1 -0
- 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 +120 -65
- package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
- package/dist/collection/components/snk-crud/snk-crud.js +44 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +60 -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 +65 -28
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +22 -6
- 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 +8 -13
- 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 +108 -16
- 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 +23 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +4 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar-custom-elements.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +4 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +126 -5
- package/dist/collection/lib/configs/ConfigStorage.js +33 -44
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +118 -42
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
- package/dist/collection/lib/index.js +10 -0
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
- package/dist/collection/lib/utils/PrintUtils.js +18 -9
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/ConfigStorage.js +161 -48
- package/dist/components/DataFetcher.js +137 -244
- package/dist/components/PrintUtils.js +213 -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/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-actions-button2.js +23 -9
- package/dist/components/snk-application2.js +145 -129
- package/dist/components/snk-attach2.js +1 -8
- package/dist/components/snk-configurator2.js +3 -1
- package/dist/components/snk-crud.js +27 -8
- package/dist/components/snk-data-unit2.js +6 -5
- package/dist/components/snk-detail-view2.js +26 -10
- 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 +8 -13
- 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 +24 -17
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-crud2.js +30 -73
- package/dist/components/snk-taskbar-custom-elements.d.ts +11 -0
- package/dist/components/snk-taskbar-custom-elements.js +35 -0
- package/dist/components/snk-taskbar2.js +81 -9
- package/dist/esm/{ConfigStorage-1090289a.js → ConfigStorage-4441aa3d.js} +162 -49
- package/dist/esm/{DataFetcher-a4ed43e7.js → DataFetcher-1618bffe.js} +137 -244
- package/dist/esm/ISave-4412b20c.js +8 -0
- package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
- package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
- package/dist/esm/{SnkFormConfigManager-de537eca.js → SnkFormConfigManager-5a5f85a3.js} +19 -21
- package/dist/esm/{auth-fetcher-c53e0d6c.js → auth-fetcher-7861187e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-8d0bfa4a.js → dataunit-fetcher-53c007be.js} +1 -1
- package/dist/esm/{form-config-fetcher-4065db9a.js → form-config-fetcher-2fe67341.js} +65 -3
- package/dist/esm/index-a7d3d3f1.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-7460b876.js → pesquisa-fetcher-19e81fc8.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +19 -11
- package/dist/esm/snk-application.entry.js +60 -44
- package/dist/esm/snk-attach.entry.js +5 -10
- package/dist/esm/snk-configurator.entry.js +2 -1
- package/dist/esm/snk-crud.entry.js +30 -13
- package/dist/esm/snk-data-exporter.entry.js +3 -2
- package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-1715d2f1.js} +5 -5
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +17 -13
- 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 +8 -17
- 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 +23 -22
- package/dist/esm/{snk-guides-viewer-cdecff6e.js → snk-guides-viewer-e4fe884d.js} +19 -8
- package/dist/esm/snk-guides-viewer.entry.js +10 -9
- package/dist/esm/snk-personalized-filter.entry.js +14 -16
- package/dist/esm/snk-print-selector.entry.js +1 -3
- package/dist/esm/snk-simple-crud.entry.js +34 -76
- package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
- package/dist/esm/snk-taskbar.entry.js +71 -5
- package/dist/esm/{taskbar-elements-2c761819.js → taskbar-elements-0a6b8b95.js} +4 -4
- package/dist/sankhyablocks/p-0b99a775.entry.js +1 -0
- package/dist/sankhyablocks/p-1e30c376.entry.js +1 -0
- package/dist/sankhyablocks/p-1fa3acbe.entry.js +1 -0
- package/dist/sankhyablocks/p-27dbbb3a.entry.js +1 -0
- package/dist/sankhyablocks/p-29b1d77b.entry.js +11 -0
- package/dist/sankhyablocks/p-324ce41e.entry.js +1 -0
- package/dist/sankhyablocks/p-34604220.entry.js +1 -0
- package/dist/sankhyablocks/p-41820e28.entry.js +1 -0
- package/dist/sankhyablocks/p-4352324d.entry.js +1 -0
- package/dist/sankhyablocks/{p-9d18017a.js → p-449d25e0.js} +2 -2
- package/dist/sankhyablocks/p-5051a23a.entry.js +1 -0
- package/dist/sankhyablocks/p-5526ab67.js +1 -0
- package/dist/sankhyablocks/p-5b2ee1d3.js +1 -0
- package/dist/sankhyablocks/p-5da848bb.js +26 -0
- package/dist/sankhyablocks/p-6098d844.entry.js +1 -0
- package/dist/sankhyablocks/p-648a7c72.entry.js +1 -0
- package/dist/sankhyablocks/p-688dcb4c.js +1 -0
- package/dist/sankhyablocks/p-72fc257b.entry.js +1 -0
- package/dist/sankhyablocks/p-7d6eca73.entry.js +1 -0
- package/dist/sankhyablocks/p-81a7f74c.js +1 -0
- package/dist/sankhyablocks/p-8d884fab.js +1 -0
- package/dist/sankhyablocks/p-90b5d1af.entry.js +1 -0
- package/dist/sankhyablocks/p-989937ee.entry.js +1 -0
- package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
- package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
- package/dist/sankhyablocks/{p-b978da60.js → p-a75e892a.js} +1 -1
- package/dist/sankhyablocks/p-a81996df.js +1 -0
- package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
- package/dist/sankhyablocks/{p-a2493d11.js → p-c9841939.js} +1 -1
- package/dist/sankhyablocks/p-ca1522bc.entry.js +1 -0
- package/dist/sankhyablocks/p-cbed6235.entry.js +1 -0
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
- package/dist/sankhyablocks/p-daa687aa.js +56 -0
- package/dist/sankhyablocks/p-e1cb1f0b.js +1 -0
- package/dist/sankhyablocks/p-eb1a650a.entry.js +1 -0
- package/dist/sankhyablocks/p-f784010c.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 +9 -22
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -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 +13 -2
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- 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 +17 -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/processor/taskbar-processor.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +7 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +27 -0
- package/dist/types/components.d.ts +203 -22
- package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +2 -2
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
- package/dist/types/lib/index.d.ts +11 -0
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
- package/dist/types/lib/utils/PrintUtils.d.ts +1 -0
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +2 -2
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/filter-bar-config-fetcher-24548cec.js +0 -155
- package/dist/cjs/resource-fetcher-64102551.js +0 -68
- package/dist/components/filter-bar-config-fetcher.js +0 -153
- package/dist/components/resource-fetcher.js +0 -66
- package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +0 -153
- package/dist/esm/resource-fetcher-45a70066.js +0 -66
- package/dist/sankhyablocks/p-0848ee4d.entry.js +0 -1
- package/dist/sankhyablocks/p-0bd9c412.js +0 -1
- package/dist/sankhyablocks/p-0fb83448.js +0 -1
- package/dist/sankhyablocks/p-10b2aedc.entry.js +0 -1
- package/dist/sankhyablocks/p-1f63dcd4.entry.js +0 -1
- package/dist/sankhyablocks/p-216b2102.entry.js +0 -1
- package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
- package/dist/sankhyablocks/p-44e66c8d.js +0 -1
- package/dist/sankhyablocks/p-4514fc6a.entry.js +0 -1
- package/dist/sankhyablocks/p-50c13cc8.entry.js +0 -1
- package/dist/sankhyablocks/p-52c6b2e7.js +0 -1
- package/dist/sankhyablocks/p-564efc43.js +0 -1
- package/dist/sankhyablocks/p-5994af77.js +0 -56
- package/dist/sankhyablocks/p-6bb904bb.entry.js +0 -1
- package/dist/sankhyablocks/p-6e06175e.entry.js +0 -1
- package/dist/sankhyablocks/p-6f0795c8.entry.js +0 -1
- package/dist/sankhyablocks/p-7588f006.entry.js +0 -1
- package/dist/sankhyablocks/p-847e6c20.js +0 -17
- package/dist/sankhyablocks/p-8f3652bf.entry.js +0 -11
- package/dist/sankhyablocks/p-9471cbc9.entry.js +0 -1
- package/dist/sankhyablocks/p-a42dd503.entry.js +0 -1
- package/dist/sankhyablocks/p-b04fb9d4.js +0 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
- package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
- package/dist/sankhyablocks/p-c6feb995.entry.js +0 -1
- package/dist/sankhyablocks/p-d7c7a289.entry.js +0 -1
- package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
- package/dist/sankhyablocks/p-f3b7b69e.js +0 -10
- package/dist/sankhyablocks/p-f7eded3a.entry.js +0 -1
- package/dist/sankhyablocks/p-ff7383b0.entry.js +0 -1
@@ -4,12 +4,18 @@ 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 DataFetcher = require('./DataFetcher-
|
7
|
+
const DataFetcher = require('./DataFetcher-4798bac3.js');
|
8
8
|
const ParamType = require('./ParamType-90b440a0.js');
|
9
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./pesquisa-fetcher-7973c081.js');
|
10
10
|
require('./index-0e663819.js');
|
11
|
-
require('./
|
11
|
+
require('./ISave-d68ce3cd.js');
|
12
|
+
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
12
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
+
require('./filter-item-type.enum-aa823a00.js');
|
15
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
16
|
+
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
17
|
+
require('./_commonjsHelpers-537d719a.js');
|
18
|
+
require('./PrintUtils-bcaeb82f.js');
|
13
19
|
|
14
20
|
const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
|
15
21
|
class JavaExecutor {
|
@@ -164,13 +170,14 @@ const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
|
|
164
170
|
const NUFIN_COLUMN = 'NUFIN';
|
165
171
|
const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
|
166
172
|
class Actions {
|
167
|
-
constructor(actionsExecuteInterface, dataUnit) {
|
173
|
+
constructor(actionsExecuteInterface, dataUnit, appResourceId) {
|
168
174
|
var _a;
|
169
175
|
this._lastValuesCache = {};
|
170
176
|
this._actionsExecuteInterface = actionsExecuteInterface;
|
171
177
|
this._dataUnit = dataUnit;
|
172
178
|
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;
|
173
179
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
180
|
+
this._appResourceId = appResourceId;
|
174
181
|
}
|
175
182
|
apply(action, hasParamsToSave) {
|
176
183
|
this._application.closePopUp();
|
@@ -433,9 +440,7 @@ class Actions {
|
|
433
440
|
}
|
434
441
|
}
|
435
442
|
async buildResourceId(actionId) {
|
436
|
-
|
437
|
-
appResId = await this._application.getResourceID();
|
438
|
-
return appResId + '.actionconfig.' + actionId;
|
443
|
+
return this._appResourceId + '.actionconfig.' + actionId;
|
439
444
|
}
|
440
445
|
prepareAndExecute(execSource, executeAction) {
|
441
446
|
this.addRows(execSource);
|
@@ -593,7 +598,7 @@ const SnkActionsButton = class {
|
|
593
598
|
this.handleClick = (evt) => {
|
594
599
|
const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
|
595
600
|
const executor = new ExecutorFactory(selectedAction.type).executor;
|
596
|
-
const action = new Actions(executor, this._dataUnit);
|
601
|
+
const action = new Actions(executor, this._dataUnit, this._resourceID);
|
597
602
|
action.execute(Object.assign({}, selectedAction));
|
598
603
|
this._showDropdown = false;
|
599
604
|
};
|
@@ -651,12 +656,15 @@ const SnkActionsButton = class {
|
|
651
656
|
document.addEventListener("scroll", this.positionDropdown.bind(this));
|
652
657
|
}
|
653
658
|
async componentWillLoad() {
|
654
|
-
var _a;
|
655
659
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
656
|
-
this._resourceID = await this._application.getResourceID();
|
657
660
|
this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
|
658
|
-
|
661
|
+
const snkDataUnit = this._element.parentElement;
|
662
|
+
this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
|
663
|
+
this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
|
659
664
|
this._entityName = this._dataUnit.name.split('/')[2];
|
665
|
+
if (this._resourceID == undefined) {
|
666
|
+
this._resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
|
667
|
+
}
|
660
668
|
this.setEvents();
|
661
669
|
this.getActions().then(() => {
|
662
670
|
this.loadItems();
|
@@ -4,18 +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 DataFetcher = require('./DataFetcher-
|
7
|
+
const DataFetcher = require('./DataFetcher-4798bac3.js');
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
12
|
-
const authFetcher = require('./auth-fetcher-
|
9
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-7973c081.js');
|
10
|
+
const ConfigStorage = require('./ConfigStorage-f0f89379.js');
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-959c9a00.js');
|
12
|
+
const authFetcher = require('./auth-fetcher-f2967437.js');
|
13
13
|
const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
-
require('./
|
17
|
-
require('./
|
18
|
-
require('./filter-bar-config-fetcher-24548cec.js');
|
16
|
+
require('./PrintUtils-bcaeb82f.js');
|
17
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
19
18
|
require('./filter-item-type.enum-aa823a00.js');
|
20
19
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
21
20
|
|
@@ -256,16 +255,21 @@ const SnkApplication = class {
|
|
256
255
|
}
|
257
256
|
return this._parameters;
|
258
257
|
}
|
259
|
-
|
260
|
-
if (
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
258
|
+
async getAuth(resourceID) {
|
259
|
+
if (resourceID == undefined) {
|
260
|
+
return this.getApplicationAuth();
|
261
|
+
}
|
262
|
+
else {
|
263
|
+
return new Promise((resolve, reject) => {
|
264
|
+
this.authFetcher.getData(resourceID).then((authList) => {
|
265
|
+
resolve(authList);
|
266
|
+
}).catch(error => {
|
267
|
+
reject(error);
|
268
|
+
});
|
269
|
+
});
|
265
270
|
}
|
266
|
-
return this._resourceID;
|
267
271
|
}
|
268
|
-
|
272
|
+
async getApplicationAuth() {
|
269
273
|
if (this._auth) {
|
270
274
|
return Promise.resolve(this._auth);
|
271
275
|
}
|
@@ -274,7 +278,7 @@ const SnkApplication = class {
|
|
274
278
|
const waitingAuth = this._authPromises.length > 0;
|
275
279
|
this._authPromises.push(new PendingPromise(resolve, reject));
|
276
280
|
if (!waitingAuth) {
|
277
|
-
this.authFetcher.getData(this.
|
281
|
+
this.authFetcher.getData(this.applicationResourceID).then((authList) => {
|
278
282
|
this._auth = authList;
|
279
283
|
while (this._authPromises.length > 0) {
|
280
284
|
this._authPromises.pop().resolve(this._auth);
|
@@ -293,13 +297,23 @@ const SnkApplication = class {
|
|
293
297
|
*/
|
294
298
|
async isUserSup() {
|
295
299
|
return new Promise((resolve, reject) => {
|
296
|
-
this.
|
300
|
+
this.getAuth().then((authorization) => {
|
297
301
|
this.getAuthList(authorization).then((auths) => {
|
298
302
|
resolve(auths.isSup);
|
299
303
|
}).catch(error => reject(error));
|
300
304
|
});
|
301
305
|
});
|
302
306
|
}
|
307
|
+
/**
|
308
|
+
* Realiza a chamada ao Service Broker conforme o nome do serviço.
|
309
|
+
*
|
310
|
+
* @param serviceName - Nome do serviço
|
311
|
+
* @param payload - Dados que serão processados na ação
|
312
|
+
* @param options - Parâmetros de URL
|
313
|
+
*/
|
314
|
+
async callServiceBroker(serviceName, payload, options) {
|
315
|
+
return DataFetcher.DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
316
|
+
}
|
303
317
|
initOnboarding(onboardingKey) {
|
304
318
|
core.OnboardingUtils.getInstance().init(onboardingKey, window.envContext);
|
305
319
|
return Promise.resolve();
|
@@ -307,9 +321,9 @@ const SnkApplication = class {
|
|
307
321
|
/**
|
308
322
|
* Obtém `true` caso o usuário logado tem permissão pra determinada ação.
|
309
323
|
*/
|
310
|
-
async hasAccess(access) {
|
324
|
+
async hasAccess(access, resourceID) {
|
311
325
|
return new Promise((resolve, reject) => {
|
312
|
-
this.
|
326
|
+
this.getAuth(resourceID).then((authorization) => {
|
313
327
|
this.getAuthList(authorization).then((auths) => {
|
314
328
|
resolve(auths.isSup || auths.actions[access]);
|
315
329
|
}).catch(error => reject(error));
|
@@ -319,9 +333,9 @@ const SnkApplication = class {
|
|
319
333
|
/**
|
320
334
|
* Obtém todos os acessos do usuário logado.
|
321
335
|
*/
|
322
|
-
async getAllAccess() {
|
336
|
+
async getAllAccess(resourceID) {
|
323
337
|
return new Promise((resolve, reject) => {
|
324
|
-
this.
|
338
|
+
this.getAuth(resourceID).then((authorization) => {
|
325
339
|
this.getAuthList(authorization).then((auths) => {
|
326
340
|
const allAccess = {};
|
327
341
|
allAccess['isSup'] = auths.isSup;
|
@@ -505,13 +519,16 @@ const SnkApplication = class {
|
|
505
519
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
506
520
|
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
507
521
|
*/
|
508
|
-
async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
|
522
|
+
async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
|
523
|
+
if (resourceID == undefined) {
|
524
|
+
resourceID = this.applicationResourceID;
|
525
|
+
}
|
509
526
|
return new Promise((resolve, reject) => {
|
510
527
|
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
511
528
|
const waitingDu = duPromisses.length > 0;
|
512
529
|
duPromisses.push(new PendingPromise(resolve, reject));
|
513
530
|
if (!waitingDu) {
|
514
|
-
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName,
|
531
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
|
515
532
|
dataUnit.loadMetadata().then(() => {
|
516
533
|
if (dataUnitName) {
|
517
534
|
this.updateDataunitCache(undefined, dataUnitName, dataUnit);
|
@@ -542,14 +559,14 @@ const SnkApplication = class {
|
|
542
559
|
/**
|
543
560
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
544
561
|
*/
|
545
|
-
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
|
562
|
+
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
|
546
563
|
return new Promise((resolve, reject) => {
|
547
564
|
const dataUnit = this._duCache.get(dataUnitName);
|
548
565
|
if (dataUnit) {
|
549
566
|
resolve(dataUnit);
|
550
567
|
}
|
551
568
|
else {
|
552
|
-
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
|
569
|
+
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
|
553
570
|
resolve(dataUnit);
|
554
571
|
}).catch(reason => reject(reason));
|
555
572
|
}
|
@@ -598,11 +615,20 @@ const SnkApplication = class {
|
|
598
615
|
async callServiceBroker(serviceName, payload, options) {
|
599
616
|
return DataFetcher.DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
600
617
|
}
|
618
|
+
get applicationResourceID() {
|
619
|
+
if (!this._applicationResourceID) {
|
620
|
+
this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
|
621
|
+
this.urlParams.get("resourceID") ||
|
622
|
+
Workspace.resourceID ||
|
623
|
+
"unknown.resource.id";
|
624
|
+
}
|
625
|
+
return this._applicationResourceID;
|
626
|
+
}
|
601
627
|
/**
|
602
628
|
* Obtém o resourceID da tela em questão.
|
603
629
|
*/
|
604
630
|
async getResourceID() {
|
605
|
-
return Promise.resolve(this.
|
631
|
+
return Promise.resolve(this.applicationResourceID);
|
606
632
|
}
|
607
633
|
/**
|
608
634
|
* Obtém o UserId da tela em questão.
|
@@ -646,20 +672,14 @@ const SnkApplication = class {
|
|
646
672
|
async info(message, options) {
|
647
673
|
return utils.ApplicationUtils.info(message, options);
|
648
674
|
}
|
649
|
-
/**
|
650
|
-
* Obtém a configuração de grade.
|
651
|
-
*/
|
652
|
-
async loadGridConfig(name) {
|
653
|
-
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
654
|
-
}
|
655
675
|
/**
|
656
676
|
* Obtém os totalizadores da grade.
|
657
677
|
*/
|
658
678
|
async loadTotals(name, resourceID, filters) {
|
659
679
|
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
660
680
|
}
|
661
|
-
async getAuthList(
|
662
|
-
return await (new MGEAuthorization()).parseFromJSON(
|
681
|
+
async getAuthList(auth) {
|
682
|
+
return await (new MGEAuthorization()).parseFromJSON(auth);
|
663
683
|
}
|
664
684
|
get urlParams() {
|
665
685
|
if (!this._urlParams) {
|
@@ -673,12 +693,6 @@ const SnkApplication = class {
|
|
673
693
|
}
|
674
694
|
return this._dataUnitFetcher;
|
675
695
|
}
|
676
|
-
get gridConfigFetcher() {
|
677
|
-
if (!this._gridConfigFetcher) {
|
678
|
-
this._gridConfigFetcher = new ConfigStorage.GridConfigFetcher();
|
679
|
-
}
|
680
|
-
return this._gridConfigFetcher;
|
681
|
-
}
|
682
696
|
get totalsFetcher() {
|
683
697
|
if (!this._totalsFetcher) {
|
684
698
|
this._totalsFetcher = new TotalsFetcher();
|
@@ -776,7 +790,7 @@ const SnkApplication = class {
|
|
776
790
|
* Obtém o nome das telas da aplicação
|
777
791
|
*/
|
778
792
|
async getAppLabel() {
|
779
|
-
return Workspace.getAppLabel(this.
|
793
|
+
return Workspace.getAppLabel(this.applicationResourceID);
|
780
794
|
}
|
781
795
|
/**
|
782
796
|
* Adiciona um listener no fetcher de Pesquisa
|
@@ -848,6 +862,7 @@ const SnkApplication = class {
|
|
848
862
|
this._popUp.ezTitle = title;
|
849
863
|
}
|
850
864
|
componentWillLoad() {
|
865
|
+
core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
|
851
866
|
this._errorHandler = new SnkErrorHandler(this);
|
852
867
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
|
853
868
|
core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${DataFetcher.UrlUtils.getUrlBase()}/mge/upload/file`);
|
@@ -856,7 +871,7 @@ const SnkApplication = class {
|
|
856
871
|
});
|
857
872
|
core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
858
873
|
core.ErrorTracking.init();
|
859
|
-
ConfigStorage.ConfigStorage.
|
874
|
+
ConfigStorage.ConfigStorage.preload(this.applicationResourceID, this.configName);
|
860
875
|
}
|
861
876
|
connectedCallback() {
|
862
877
|
core.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
@@ -868,9 +883,10 @@ const SnkApplication = class {
|
|
868
883
|
componentDidLoad() {
|
869
884
|
this.applicationLoading.emit(true);
|
870
885
|
window.requestAnimationFrame(() => {
|
886
|
+
core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
|
871
887
|
this.applicationLoaded.emit(true);
|
872
888
|
});
|
873
|
-
core.ElementIDUtils.addIDInfo(this._element, `resource_${this.
|
889
|
+
core.ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
|
874
890
|
}
|
875
891
|
render() {
|
876
892
|
return (index.h("div", null, index.h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), index.h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), index.h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
@@ -4,23 +4,18 @@ 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 DataFetcher = require('./DataFetcher-
|
7
|
+
const DataFetcher = require('./DataFetcher-4798bac3.js');
|
8
|
+
const ISave = require('./ISave-d68ce3cd.js');
|
8
9
|
const constants = require('./constants-d187e03e.js');
|
9
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
10
|
-
const taskbarElements = require('./taskbar-elements-
|
10
|
+
const dataunitFetcher = require('./dataunit-fetcher-959c9a00.js');
|
11
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
11
12
|
require('./_commonjsHelpers-537d719a.js');
|
12
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
+
require('./PrintUtils-bcaeb82f.js');
|
13
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
16
|
require('./index-0e663819.js');
|
15
17
|
require('./index-102ba62d.js');
|
16
18
|
|
17
|
-
var SaveErrorsEnum;
|
18
|
-
(function (SaveErrorsEnum) {
|
19
|
-
SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
|
20
|
-
SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
|
21
|
-
SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
|
22
|
-
})(SaveErrorsEnum || (SaveErrorsEnum = {}));
|
23
|
-
|
24
19
|
class AttachFetcher {
|
25
20
|
constructor(entityName, registerKey, dataUnitName) {
|
26
21
|
var _a;
|
@@ -29,9 +24,9 @@ class AttachFetcher {
|
|
29
24
|
this.dataUnitName = dataUnitName;
|
30
25
|
this.validateFields = (fields) => {
|
31
26
|
if (!!fields.LINK && !!fields.NOMEARQUIVO)
|
32
|
-
throw new Error(SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
|
27
|
+
throw new Error(ISave.SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
|
33
28
|
if (!fields.LINK && !fields.NOMEARQUIVO)
|
34
|
-
throw new Error(SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
|
29
|
+
throw new Error(ISave.SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
|
35
30
|
if (!this.registerKey)
|
36
31
|
throw new Error('Register key can not be null');
|
37
32
|
};
|
@@ -200,11 +195,11 @@ class AttachmentDataUnitBuilder {
|
|
200
195
|
savePromise(change).then((records) => {
|
201
196
|
resolve(records);
|
202
197
|
}).catch((error) => {
|
203
|
-
if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
198
|
+
if (error.message === ISave.SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
204
199
|
this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
|
205
200
|
return resolve([]);
|
206
201
|
}
|
207
|
-
if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
202
|
+
if (error.message === ISave.SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
208
203
|
this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
|
209
204
|
return resolve([]);
|
210
205
|
}
|
@@ -20,6 +20,7 @@ const SnkConfigurator = class {
|
|
20
20
|
this._permissions = undefined;
|
21
21
|
this.showActionButtons = false;
|
22
22
|
this.configName = undefined;
|
23
|
+
this.resourceID = undefined;
|
23
24
|
this.viewMode = constants.VIEW_MODE.GRID;
|
24
25
|
this.messagesBuilder = undefined;
|
25
26
|
}
|
@@ -84,7 +85,7 @@ const SnkConfigurator = class {
|
|
84
85
|
componentWillLoad() {
|
85
86
|
this._application = core.ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
86
87
|
if (this._application) {
|
87
|
-
this._application.getAllAccess().then(access => (this._permissions = access));
|
88
|
+
this._application.getAllAccess(this.resourceID).then(access => (this._permissions = access));
|
88
89
|
}
|
89
90
|
else {
|
90
91
|
this._permissions = {};
|
@@ -4,16 +4,20 @@ 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 taskbarElements = require('./taskbar-elements-
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
7
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
8
|
+
require('./DataFetcher-4798bac3.js');
|
9
|
+
require('./pesquisa-fetcher-7973c081.js');
|
10
10
|
const index$1 = require('./index-0e663819.js');
|
11
|
+
require('./ISave-d68ce3cd.js');
|
12
|
+
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
13
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
+
require('./filter-item-type.enum-aa823a00.js');
|
15
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
11
16
|
const constants = require('./constants-d187e03e.js');
|
12
|
-
const authFetcher = require('./auth-fetcher-
|
17
|
+
const authFetcher = require('./auth-fetcher-f2967437.js');
|
13
18
|
require('./index-102ba62d.js');
|
14
19
|
require('./_commonjsHelpers-537d719a.js');
|
15
|
-
require('
|
16
|
-
require('./resource-fetcher-64102551.js');
|
20
|
+
require('./PrintUtils-bcaeb82f.js');
|
17
21
|
|
18
22
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
19
23
|
|
@@ -23,12 +27,14 @@ const SnkCrud = class {
|
|
23
27
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
24
28
|
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
25
29
|
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
30
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
26
31
|
this._viewHistory = [];
|
27
32
|
this._dataUnit = undefined;
|
28
33
|
this._dataState = undefined;
|
29
34
|
this.attachmentRegisterKey = undefined;
|
30
35
|
this._currentViewMode = constants.VIEW_MODE.GRID;
|
31
36
|
this._canEdit = undefined;
|
37
|
+
this._resourceID = undefined;
|
32
38
|
this.configName = undefined;
|
33
39
|
this.selectionToastConfig = undefined;
|
34
40
|
this.showActionButtons = false;
|
@@ -40,6 +46,7 @@ const SnkCrud = class {
|
|
40
46
|
this.presentationMode = index$1.PresentationMode.PRIMARY;
|
41
47
|
this.messagesBuilder = undefined;
|
42
48
|
this.useEnterLikeTab = false;
|
49
|
+
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
|
43
50
|
}
|
44
51
|
/**
|
45
52
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
@@ -123,7 +130,7 @@ const SnkCrud = class {
|
|
123
130
|
}
|
124
131
|
componentWillLoad() {
|
125
132
|
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
126
|
-
application.hasAccess(authFetcher.AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
133
|
+
application.hasAccess(authFetcher.AutorizationType.UPDATE, this._resourceID).then(canEdit => this._canEdit = canEdit);
|
127
134
|
let parent = this._element.parentElement;
|
128
135
|
while (parent) {
|
129
136
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -135,11 +142,11 @@ const SnkCrud = class {
|
|
135
142
|
if (!this._dataUnit) {
|
136
143
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
137
144
|
this._dataUnit = evt.detail;
|
138
|
-
this.initDataUnit();
|
145
|
+
this.initDataUnit(application);
|
139
146
|
});
|
140
147
|
}
|
141
148
|
else {
|
142
|
-
this.initDataUnit();
|
149
|
+
this.initDataUnit(application);
|
143
150
|
}
|
144
151
|
this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
|
145
152
|
this._dataState = dataState;
|
@@ -155,11 +162,18 @@ const SnkCrud = class {
|
|
155
162
|
this.configName = application.configName;
|
156
163
|
}
|
157
164
|
}
|
158
|
-
initDataUnit() {
|
165
|
+
async initDataUnit(application) {
|
159
166
|
this.addDataElementID();
|
160
167
|
if (!this.messagesBuilder) {
|
161
168
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
162
169
|
}
|
170
|
+
if (this._resourceID == undefined) {
|
171
|
+
//Tenta pegar o resourceID do snkDataUnit;
|
172
|
+
this._resourceID = this._snkDataUnit.resourceID;
|
173
|
+
if (this._resourceID == undefined) {
|
174
|
+
this._resourceID = await application.getResourceID();
|
175
|
+
}
|
176
|
+
}
|
163
177
|
}
|
164
178
|
handleConfiguratorEvent(evt, type) {
|
165
179
|
evt.stopImmediatePropagation();
|
@@ -170,8 +184,11 @@ const SnkCrud = class {
|
|
170
184
|
this.configuratorCancel.emit();
|
171
185
|
}
|
172
186
|
render() {
|
187
|
+
if (this._resourceID == undefined) {
|
188
|
+
return;
|
189
|
+
}
|
173
190
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
|
174
|
-
return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit }, index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit }, index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, index.h("div", { slot: "SnkConfigContainerSlot" }, index.h("slot", { name: "SnkConfigContainerSlot" })))));
|
191
|
+
return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID }, index.h("div", { slot: "SnkConfigContainerSlot" }, index.h("slot", { name: "SnkConfigContainerSlot" })))), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
175
192
|
}
|
176
193
|
get _element() { return index.getElement(this); }
|
177
194
|
static get watchers() { return {
|
@@ -7,10 +7,11 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const index = require('./index-0e663819.js');
|
9
9
|
const constants = require('./constants-d187e03e.js');
|
10
|
-
const DataFetcher = require('./DataFetcher-
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
10
|
+
const DataFetcher = require('./DataFetcher-4798bac3.js');
|
11
|
+
const snkDataUnit = require('./snk-data-unit-7cc1846d.js');
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
+
require('./PrintUtils-bcaeb82f.js');
|
14
15
|
require('./SnkMessageBuilder-d0abb63d.js');
|
15
16
|
|
16
17
|
class ItemBuilder {
|
@@ -72,6 +72,7 @@ const SnkDataUnit = class {
|
|
72
72
|
this.useCancelConfirm = true;
|
73
73
|
this.ignoreSaveMessage = undefined;
|
74
74
|
this.configName = undefined;
|
75
|
+
this.resourceID = undefined;
|
75
76
|
}
|
76
77
|
observePageSize() {
|
77
78
|
if (this.dataUnit) {
|
@@ -335,10 +336,10 @@ const SnkDataUnit = class {
|
|
335
336
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
336
337
|
if (this._parentSnkDataUnit) {
|
337
338
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
338
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
|
339
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
|
339
340
|
}
|
340
341
|
else {
|
341
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
|
342
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
342
343
|
}
|
343
344
|
}
|
344
345
|
async loadDataUnit() {
|
@@ -397,7 +398,7 @@ const SnkDataUnit = class {
|
|
397
398
|
//---------------------------------------------
|
398
399
|
componentWillLoad() {
|
399
400
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
400
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
401
|
+
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
401
402
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
402
403
|
if (this.messagesBuilder == undefined) {
|
403
404
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
@@ -405,8 +406,7 @@ const SnkDataUnit = class {
|
|
405
406
|
}
|
406
407
|
disconnectedCallback() {
|
407
408
|
if (this.dataUnit) {
|
408
|
-
this.dataUnit.
|
409
|
-
this.dataUnit.removeInterceptor(this);
|
409
|
+
this.dataUnit.releaseCallbacks();
|
410
410
|
}
|
411
411
|
}
|
412
412
|
componentDidLoad() {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
5
|
+
const snkDataUnit = require('./snk-data-unit-7cc1846d.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
@@ -3,23 +3,24 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
6
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-d5fd8800.js');
|
7
7
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./DataFetcher-4798bac3.js');
|
9
|
+
require('./pesquisa-fetcher-7973c081.js');
|
10
10
|
require('@sankhyalabs/core');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
|
-
|
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-5e3d3b87.js');
|
17
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
13
18
|
const constants = require('./constants-d187e03e.js');
|
14
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
19
|
+
const snkGuidesViewer = require('./snk-guides-viewer-b7b680d2.js');
|
15
20
|
const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
|
16
|
-
require('./ConfigStorage-
|
17
|
-
require('./form-config-fetcher-ab3ce222.js');
|
18
|
-
require('./resource-fetcher-64102551.js');
|
19
|
-
require('./filter-bar-config-fetcher-24548cec.js');
|
20
|
-
require('./filter-item-type.enum-aa823a00.js');
|
21
|
+
require('./ConfigStorage-f0f89379.js');
|
21
22
|
require('./_commonjsHelpers-537d719a.js');
|
22
|
-
require('
|
23
|
+
require('./PrintUtils-bcaeb82f.js');
|
23
24
|
require('./index-102ba62d.js');
|
24
25
|
require('./taskbar-processor-bce3f499.js');
|
25
26
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -74,11 +75,13 @@ const SnkDetailView = class {
|
|
74
75
|
index.registerInstance(this, hostRef);
|
75
76
|
this.snkDetailGuidesChange = index.createEvent(this, "snkDetailGuidesChange", 7);
|
76
77
|
this.snkSwitchGuide = index.createEvent(this, "snkSwitchGuide", 7);
|
78
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
77
79
|
this._disabledButtons = undefined;
|
78
80
|
this._currentView = undefined;
|
79
81
|
this.attachmentRegisterKey = undefined;
|
80
82
|
this.formConfigManager = undefined;
|
81
83
|
this.dataUnitName = undefined;
|
84
|
+
this.resourceID = undefined;
|
82
85
|
this.guideItemPath = undefined;
|
83
86
|
this.entityName = undefined;
|
84
87
|
this.label = undefined;
|
@@ -88,6 +91,7 @@ const SnkDetailView = class {
|
|
88
91
|
this.messagesBuilder = undefined;
|
89
92
|
this.branchGuide = undefined;
|
90
93
|
this.canEdit = true;
|
94
|
+
this.taskbarCustomContainerId = undefined;
|
91
95
|
}
|
92
96
|
observerDataState(newValue, oldValue) {
|
93
97
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
@@ -248,7 +252,7 @@ const SnkDetailView = class {
|
|
248
252
|
}
|
249
253
|
componentWillLoad() {
|
250
254
|
this._configName = `dynaform.${this.entityName}`;
|
251
|
-
this.formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
255
|
+
this.formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
|
252
256
|
this.formConfigManager.loadConfig();
|
253
257
|
if (this.messagesBuilder == undefined) {
|
254
258
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
@@ -257,7 +261,7 @@ const SnkDetailView = class {
|
|
257
261
|
render() {
|
258
262
|
this.updateLabel();
|
259
263
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
260
|
-
return (index.h(index.Host, null, index.h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === constants.VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, index.h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, index.h("stack-item", null, index.h("div", { class: "ez-box ez-box--shadow grid-container" }, index.h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, index.h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? index.h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), index.h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(constants.VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: index$1.PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), index.h("stack-item", null, index.h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath }, index.h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: index$1.PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
264
|
+
return (index.h(index.Host, null, index.h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === constants.VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, index.h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, index.h("stack-item", null, index.h("div", { class: "ez-box ez-box--shadow grid-container" }, index.h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, index.h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? index.h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), index.h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(constants.VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: index$1.PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }))), index.h("stack-item", null, index.h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, index.h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: index$1.PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
261
265
|
}
|
262
266
|
static get watchers() { return {
|
263
267
|
"dataState": ["observerDataState"]
|