@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,16 +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-39b63a1e.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-96c042aa.js');
|
10
|
+
const ConfigStorage = require('./ConfigStorage-e9d7fa82.js');
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-15a7cc88.js');
|
12
|
+
const authFetcher = require('./auth-fetcher-d407c31c.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('./form-config-fetcher-
|
16
|
+
require('./form-config-fetcher-ab3ce222.js');
|
17
|
+
require('./resource-fetcher-64102551.js');
|
18
|
+
require('./filter-bar-config-fetcher-24548cec.js');
|
17
19
|
require('./filter-item-type.enum-aa823a00.js');
|
18
20
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
19
21
|
|
@@ -254,21 +256,16 @@ const SnkApplication = class {
|
|
254
256
|
}
|
255
257
|
return this._parameters;
|
256
258
|
}
|
257
|
-
|
258
|
-
if (
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
this.authFetcher.getData(resourceID).then((authList) => {
|
264
|
-
resolve(authList);
|
265
|
-
}).catch(error => {
|
266
|
-
reject(error);
|
267
|
-
});
|
268
|
-
});
|
259
|
+
get resourceID() {
|
260
|
+
if (!this._resourceID) {
|
261
|
+
this._resourceID = this.urlParams.get("workspaceResourceID") ||
|
262
|
+
this.urlParams.get("resourceID") ||
|
263
|
+
Workspace.resourceID ||
|
264
|
+
"unknown.resource.id";
|
269
265
|
}
|
266
|
+
return this._resourceID;
|
270
267
|
}
|
271
|
-
|
268
|
+
get auth() {
|
272
269
|
if (this._auth) {
|
273
270
|
return Promise.resolve(this._auth);
|
274
271
|
}
|
@@ -277,7 +274,7 @@ const SnkApplication = class {
|
|
277
274
|
const waitingAuth = this._authPromises.length > 0;
|
278
275
|
this._authPromises.push(new PendingPromise(resolve, reject));
|
279
276
|
if (!waitingAuth) {
|
280
|
-
this.authFetcher.getData(this.
|
277
|
+
this.authFetcher.getData(this.resourceID).then((authList) => {
|
281
278
|
this._auth = authList;
|
282
279
|
while (this._authPromises.length > 0) {
|
283
280
|
this._authPromises.pop().resolve(this._auth);
|
@@ -296,7 +293,7 @@ const SnkApplication = class {
|
|
296
293
|
*/
|
297
294
|
async isUserSup() {
|
298
295
|
return new Promise((resolve, reject) => {
|
299
|
-
this.
|
296
|
+
this.auth.then((authorization) => {
|
300
297
|
this.getAuthList(authorization).then((auths) => {
|
301
298
|
resolve(auths.isSup);
|
302
299
|
}).catch(error => reject(error));
|
@@ -310,9 +307,9 @@ const SnkApplication = class {
|
|
310
307
|
/**
|
311
308
|
* Obtém `true` caso o usuário logado tem permissão pra determinada ação.
|
312
309
|
*/
|
313
|
-
async hasAccess(access
|
310
|
+
async hasAccess(access) {
|
314
311
|
return new Promise((resolve, reject) => {
|
315
|
-
this.
|
312
|
+
this.auth.then((authorization) => {
|
316
313
|
this.getAuthList(authorization).then((auths) => {
|
317
314
|
resolve(auths.isSup || auths.actions[access]);
|
318
315
|
}).catch(error => reject(error));
|
@@ -322,9 +319,9 @@ const SnkApplication = class {
|
|
322
319
|
/**
|
323
320
|
* Obtém todos os acessos do usuário logado.
|
324
321
|
*/
|
325
|
-
async getAllAccess(
|
322
|
+
async getAllAccess() {
|
326
323
|
return new Promise((resolve, reject) => {
|
327
|
-
this.
|
324
|
+
this.auth.then((authorization) => {
|
328
325
|
this.getAuthList(authorization).then((auths) => {
|
329
326
|
const allAccess = {};
|
330
327
|
allAccess['isSup'] = auths.isSup;
|
@@ -508,16 +505,13 @@ const SnkApplication = class {
|
|
508
505
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
509
506
|
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
510
507
|
*/
|
511
|
-
async createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
512
|
-
if (resourceID == undefined) {
|
513
|
-
resourceID = this.applicationResourceID;
|
514
|
-
}
|
508
|
+
async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
|
515
509
|
return new Promise((resolve, reject) => {
|
516
510
|
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
517
511
|
const waitingDu = duPromisses.length > 0;
|
518
512
|
duPromisses.push(new PendingPromise(resolve, reject));
|
519
513
|
if (!waitingDu) {
|
520
|
-
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
|
514
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID, parentDataUnit, configName);
|
521
515
|
dataUnit.loadMetadata().then(() => {
|
522
516
|
if (dataUnitName) {
|
523
517
|
this.updateDataunitCache(undefined, dataUnitName, dataUnit);
|
@@ -548,14 +542,14 @@ const SnkApplication = class {
|
|
548
542
|
/**
|
549
543
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
550
544
|
*/
|
551
|
-
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName
|
545
|
+
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
|
552
546
|
return new Promise((resolve, reject) => {
|
553
547
|
const dataUnit = this._duCache.get(dataUnitName);
|
554
548
|
if (dataUnit) {
|
555
549
|
resolve(dataUnit);
|
556
550
|
}
|
557
551
|
else {
|
558
|
-
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
552
|
+
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
|
559
553
|
resolve(dataUnit);
|
560
554
|
}).catch(reason => reject(reason));
|
561
555
|
}
|
@@ -604,20 +598,11 @@ const SnkApplication = class {
|
|
604
598
|
async callServiceBroker(serviceName, payload, options) {
|
605
599
|
return DataFetcher.DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
606
600
|
}
|
607
|
-
get applicationResourceID() {
|
608
|
-
if (!this._applicationResourceID) {
|
609
|
-
this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
|
610
|
-
this.urlParams.get("resourceID") ||
|
611
|
-
Workspace.resourceID ||
|
612
|
-
"unknown.resource.id";
|
613
|
-
}
|
614
|
-
return this._applicationResourceID;
|
615
|
-
}
|
616
601
|
/**
|
617
602
|
* Obtém o resourceID da tela em questão.
|
618
603
|
*/
|
619
604
|
async getResourceID() {
|
620
|
-
return Promise.resolve(this.
|
605
|
+
return Promise.resolve(this.resourceID);
|
621
606
|
}
|
622
607
|
/**
|
623
608
|
* Obtém o UserId da tela em questão.
|
@@ -661,14 +646,20 @@ const SnkApplication = class {
|
|
661
646
|
async info(message, options) {
|
662
647
|
return utils.ApplicationUtils.info(message, options);
|
663
648
|
}
|
649
|
+
/**
|
650
|
+
* Obtém a configuração de grade.
|
651
|
+
*/
|
652
|
+
async loadGridConfig(name) {
|
653
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
654
|
+
}
|
664
655
|
/**
|
665
656
|
* Obtém os totalizadores da grade.
|
666
657
|
*/
|
667
658
|
async loadTotals(name, resourceID, filters) {
|
668
659
|
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
669
660
|
}
|
670
|
-
async getAuthList(
|
671
|
-
return await (new MGEAuthorization()).parseFromJSON(
|
661
|
+
async getAuthList(_auth) {
|
662
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
672
663
|
}
|
673
664
|
get urlParams() {
|
674
665
|
if (!this._urlParams) {
|
@@ -682,6 +673,12 @@ const SnkApplication = class {
|
|
682
673
|
}
|
683
674
|
return this._dataUnitFetcher;
|
684
675
|
}
|
676
|
+
get gridConfigFetcher() {
|
677
|
+
if (!this._gridConfigFetcher) {
|
678
|
+
this._gridConfigFetcher = new ConfigStorage.GridConfigFetcher();
|
679
|
+
}
|
680
|
+
return this._gridConfigFetcher;
|
681
|
+
}
|
685
682
|
get totalsFetcher() {
|
686
683
|
if (!this._totalsFetcher) {
|
687
684
|
this._totalsFetcher = new TotalsFetcher();
|
@@ -779,7 +776,7 @@ const SnkApplication = class {
|
|
779
776
|
* Obtém o nome das telas da aplicação
|
780
777
|
*/
|
781
778
|
async getAppLabel() {
|
782
|
-
return Workspace.getAppLabel(this.
|
779
|
+
return Workspace.getAppLabel(this._resourceID);
|
783
780
|
}
|
784
781
|
/**
|
785
782
|
* Adiciona um listener no fetcher de Pesquisa
|
@@ -851,7 +848,6 @@ const SnkApplication = class {
|
|
851
848
|
this._popUp.ezTitle = title;
|
852
849
|
}
|
853
850
|
componentWillLoad() {
|
854
|
-
core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
|
855
851
|
this._errorHandler = new SnkErrorHandler(this);
|
856
852
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
|
857
853
|
core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${DataFetcher.UrlUtils.getUrlBase()}/mge/upload/file`);
|
@@ -860,7 +856,7 @@ const SnkApplication = class {
|
|
860
856
|
});
|
861
857
|
core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
862
858
|
core.ErrorTracking.init();
|
863
|
-
ConfigStorage.ConfigStorage.
|
859
|
+
ConfigStorage.ConfigStorage.get();
|
864
860
|
}
|
865
861
|
connectedCallback() {
|
866
862
|
core.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
@@ -872,10 +868,9 @@ const SnkApplication = class {
|
|
872
868
|
componentDidLoad() {
|
873
869
|
this.applicationLoading.emit(true);
|
874
870
|
window.requestAnimationFrame(() => {
|
875
|
-
core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
|
876
871
|
this.applicationLoaded.emit(true);
|
877
872
|
});
|
878
|
-
core.ElementIDUtils.addIDInfo(this._element, `resource_${this.
|
873
|
+
core.ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
|
879
874
|
}
|
880
875
|
render() {
|
881
876
|
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,10 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const DataFetcher = require('./DataFetcher-
|
8
|
-
const ISave = require('./ISave-d68ce3cd.js');
|
7
|
+
const DataFetcher = require('./DataFetcher-39b63a1e.js');
|
9
8
|
const constants = require('./constants-d187e03e.js');
|
10
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
9
|
+
const dataunitFetcher = require('./dataunit-fetcher-15a7cc88.js');
|
11
10
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
12
11
|
require('./_commonjsHelpers-537d719a.js');
|
13
12
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -15,6 +14,13 @@ require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
14
|
require('./index-0e663819.js');
|
16
15
|
require('./index-102ba62d.js');
|
17
16
|
|
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
|
+
|
18
24
|
class AttachFetcher {
|
19
25
|
constructor(entityName, registerKey, dataUnitName) {
|
20
26
|
var _a;
|
@@ -23,9 +29,9 @@ class AttachFetcher {
|
|
23
29
|
this.dataUnitName = dataUnitName;
|
24
30
|
this.validateFields = (fields) => {
|
25
31
|
if (!!fields.LINK && !!fields.NOMEARQUIVO)
|
26
|
-
throw new Error(
|
32
|
+
throw new Error(SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
|
27
33
|
if (!fields.LINK && !fields.NOMEARQUIVO)
|
28
|
-
throw new Error(
|
34
|
+
throw new Error(SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
|
29
35
|
if (!this.registerKey)
|
30
36
|
throw new Error('Register key can not be null');
|
31
37
|
};
|
@@ -194,11 +200,11 @@ class AttachmentDataUnitBuilder {
|
|
194
200
|
savePromise(change).then((records) => {
|
195
201
|
resolve(records);
|
196
202
|
}).catch((error) => {
|
197
|
-
if (error.message ===
|
203
|
+
if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
198
204
|
this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
|
199
205
|
return resolve([]);
|
200
206
|
}
|
201
|
-
if (error.message ===
|
207
|
+
if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
202
208
|
this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
|
203
209
|
return resolve([]);
|
204
210
|
}
|
@@ -20,7 +20,6 @@ const SnkConfigurator = class {
|
|
20
20
|
this._permissions = undefined;
|
21
21
|
this.showActionButtons = false;
|
22
22
|
this.configName = undefined;
|
23
|
-
this.resourceID = undefined;
|
24
23
|
this.viewMode = constants.VIEW_MODE.GRID;
|
25
24
|
this.messagesBuilder = undefined;
|
26
25
|
}
|
@@ -85,7 +84,7 @@ const SnkConfigurator = class {
|
|
85
84
|
componentWillLoad() {
|
86
85
|
this._application = core.ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
87
86
|
if (this._application) {
|
88
|
-
this._application.getAllAccess(
|
87
|
+
this._application.getAllAccess().then(access => (this._permissions = access));
|
89
88
|
}
|
90
89
|
else {
|
91
90
|
this._permissions = {};
|
@@ -5,18 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./DataFetcher-39b63a1e.js');
|
9
|
+
require('./pesquisa-fetcher-96c042aa.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-5d62ab62.js');
|
16
11
|
const constants = require('./constants-d187e03e.js');
|
17
|
-
const authFetcher = require('./auth-fetcher-
|
12
|
+
const authFetcher = require('./auth-fetcher-d407c31c.js');
|
18
13
|
require('./index-102ba62d.js');
|
19
14
|
require('./_commonjsHelpers-537d719a.js');
|
15
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
+
require('./resource-fetcher-64102551.js');
|
20
17
|
|
21
18
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
22
19
|
|
@@ -26,14 +23,12 @@ const SnkCrud = class {
|
|
26
23
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
27
24
|
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
28
25
|
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
29
|
-
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
30
26
|
this._viewHistory = [];
|
31
27
|
this._dataUnit = undefined;
|
32
28
|
this._dataState = undefined;
|
33
29
|
this.attachmentRegisterKey = undefined;
|
34
30
|
this._currentViewMode = constants.VIEW_MODE.GRID;
|
35
31
|
this._canEdit = undefined;
|
36
|
-
this._resourceID = undefined;
|
37
32
|
this.configName = undefined;
|
38
33
|
this.selectionToastConfig = undefined;
|
39
34
|
this.showActionButtons = false;
|
@@ -128,7 +123,7 @@ const SnkCrud = class {
|
|
128
123
|
}
|
129
124
|
componentWillLoad() {
|
130
125
|
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
131
|
-
application.hasAccess(authFetcher.AutorizationType.UPDATE
|
126
|
+
application.hasAccess(authFetcher.AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
132
127
|
let parent = this._element.parentElement;
|
133
128
|
while (parent) {
|
134
129
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -140,11 +135,11 @@ const SnkCrud = class {
|
|
140
135
|
if (!this._dataUnit) {
|
141
136
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
142
137
|
this._dataUnit = evt.detail;
|
143
|
-
this.initDataUnit(
|
138
|
+
this.initDataUnit();
|
144
139
|
});
|
145
140
|
}
|
146
141
|
else {
|
147
|
-
this.initDataUnit(
|
142
|
+
this.initDataUnit();
|
148
143
|
}
|
149
144
|
this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
|
150
145
|
this._dataState = dataState;
|
@@ -160,18 +155,11 @@ const SnkCrud = class {
|
|
160
155
|
this.configName = application.configName;
|
161
156
|
}
|
162
157
|
}
|
163
|
-
|
158
|
+
initDataUnit() {
|
164
159
|
this.addDataElementID();
|
165
160
|
if (!this.messagesBuilder) {
|
166
161
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
167
162
|
}
|
168
|
-
if (this._resourceID == undefined) {
|
169
|
-
//Tenta pegar o resourceID do snkDataUnit;
|
170
|
-
this._resourceID = this._snkDataUnit.resourceID;
|
171
|
-
if (this._resourceID == undefined) {
|
172
|
-
this._resourceID = await application.getResourceID();
|
173
|
-
}
|
174
|
-
}
|
175
163
|
}
|
176
164
|
handleConfiguratorEvent(evt, type) {
|
177
165
|
evt.stopImmediatePropagation();
|
@@ -182,11 +170,8 @@ const SnkCrud = class {
|
|
182
170
|
this.configuratorCancel.emit();
|
183
171
|
}
|
184
172
|
render() {
|
185
|
-
if (this._resourceID == undefined) {
|
186
|
-
return;
|
187
|
-
}
|
188
173
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
|
189
|
-
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
|
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" })))));
|
190
175
|
}
|
191
176
|
get _element() { return index.getElement(this); }
|
192
177
|
static get watchers() { return {
|
@@ -7,8 +7,8 @@ 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-39b63a1e.js');
|
11
|
+
const snkDataUnit = require('./snk-data-unit-e89e07bd.js');
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./SnkMessageBuilder-d0abb63d.js');
|
@@ -72,7 +72,6 @@ const SnkDataUnit = class {
|
|
72
72
|
this.useCancelConfirm = true;
|
73
73
|
this.ignoreSaveMessage = undefined;
|
74
74
|
this.configName = undefined;
|
75
|
-
this.resourceID = undefined;
|
76
75
|
}
|
77
76
|
observePageSize() {
|
78
77
|
if (this.dataUnit) {
|
@@ -336,10 +335,10 @@ const SnkDataUnit = class {
|
|
336
335
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
337
336
|
if (this._parentSnkDataUnit) {
|
338
337
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
339
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName
|
338
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
|
340
339
|
}
|
341
340
|
else {
|
342
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName
|
341
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
|
343
342
|
}
|
344
343
|
}
|
345
344
|
async loadDataUnit() {
|
@@ -398,7 +397,7 @@ const SnkDataUnit = class {
|
|
398
397
|
//---------------------------------------------
|
399
398
|
componentWillLoad() {
|
400
399
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
401
|
-
this._application.getAllAccess(
|
400
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
402
401
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
403
402
|
if (this.messagesBuilder == undefined) {
|
404
403
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
@@ -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-e89e07bd.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
@@ -3,23 +3,23 @@
|
|
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-2f8eccd9.js');
|
7
7
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./DataFetcher-39b63a1e.js');
|
9
|
+
require('./pesquisa-fetcher-96c042aa.js');
|
10
10
|
require('@sankhyalabs/core');
|
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 taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
18
13
|
const constants = require('./constants-d187e03e.js');
|
19
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
14
|
+
const snkGuidesViewer = require('./snk-guides-viewer-8518c61b.js');
|
20
15
|
const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
|
21
|
-
require('./ConfigStorage-
|
16
|
+
require('./ConfigStorage-e9d7fa82.js');
|
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');
|
22
21
|
require('./_commonjsHelpers-537d719a.js');
|
22
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
23
23
|
require('./index-102ba62d.js');
|
24
24
|
require('./taskbar-processor-bce3f499.js');
|
25
25
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -74,13 +74,11 @@ const SnkDetailView = class {
|
|
74
74
|
index.registerInstance(this, hostRef);
|
75
75
|
this.snkDetailGuidesChange = index.createEvent(this, "snkDetailGuidesChange", 7);
|
76
76
|
this.snkSwitchGuide = index.createEvent(this, "snkSwitchGuide", 7);
|
77
|
-
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
78
77
|
this._disabledButtons = undefined;
|
79
78
|
this._currentView = undefined;
|
80
79
|
this.attachmentRegisterKey = undefined;
|
81
80
|
this.formConfigManager = undefined;
|
82
81
|
this.dataUnitName = undefined;
|
83
|
-
this.resourceID = undefined;
|
84
82
|
this.guideItemPath = undefined;
|
85
83
|
this.entityName = undefined;
|
86
84
|
this.label = undefined;
|
@@ -250,7 +248,7 @@ const SnkDetailView = class {
|
|
250
248
|
}
|
251
249
|
componentWillLoad() {
|
252
250
|
this._configName = `dynaform.${this.entityName}`;
|
253
|
-
this.formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this._configName,
|
251
|
+
this.formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
254
252
|
this.formConfigManager.loadConfig();
|
255
253
|
if (this.messagesBuilder == undefined) {
|
256
254
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
@@ -259,7 +257,7 @@ const SnkDetailView = class {
|
|
259
257
|
render() {
|
260
258
|
this.updateLabel();
|
261
259
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
262
|
-
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
|
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) }))))));
|
263
261
|
}
|
264
262
|
static get watchers() { return {
|
265
263
|
"dataState": ["observerDataState"]
|
@@ -11,6 +11,7 @@ const SnkEntityList = class {
|
|
11
11
|
constructor(hostRef) {
|
12
12
|
index.registerInstance(this, hostRef);
|
13
13
|
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
14
|
+
this.saveConfig = index.createEvent(this, "saveConfig", 7);
|
14
15
|
this._searchValue = undefined;
|
15
16
|
this._ezListSource = [];
|
16
17
|
this.config = undefined;
|
@@ -19,6 +20,7 @@ const SnkEntityList = class {
|
|
19
20
|
}
|
20
21
|
async reloadList() {
|
21
22
|
this.loadListSource();
|
23
|
+
this.saveConfig.emit(this.config);
|
22
24
|
}
|
23
25
|
observeConfig() {
|
24
26
|
var _a, _b;
|
@@ -34,6 +36,7 @@ const SnkEntityList = class {
|
|
34
36
|
}
|
35
37
|
});
|
36
38
|
this.config = core.ObjectUtils.copy(configCopy);
|
39
|
+
this.saveConfig.emit(this.config);
|
37
40
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
38
41
|
}
|
39
42
|
loadListSource() {
|
@@ -90,6 +93,7 @@ const SnkEntityList = class {
|
|
90
93
|
}
|
91
94
|
] });
|
92
95
|
this.loadListSource();
|
96
|
+
this.saveConfig.emit(this.config);
|
93
97
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
94
98
|
}
|
95
99
|
}
|
@@ -5,16 +5,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index$1 = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-e9d7fa82.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
11
11
|
const index = require('./index-c5771aba.js');
|
12
12
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
13
13
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-1aeb625d.js');
|
14
|
-
require('./form-config-fetcher-
|
15
|
-
require('./DataFetcher-
|
14
|
+
require('./form-config-fetcher-ab3ce222.js');
|
15
|
+
require('./DataFetcher-39b63a1e.js');
|
16
16
|
require('./_commonjsHelpers-537d719a.js');
|
17
17
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
18
|
+
require('./resource-fetcher-64102551.js');
|
19
|
+
require('./filter-bar-config-fetcher-24548cec.js');
|
18
20
|
|
19
21
|
const buildFilter = (item) => {
|
20
22
|
switch (item.type) {
|
@@ -206,7 +208,6 @@ const SnkFilterBar = class {
|
|
206
208
|
};
|
207
209
|
this.dataUnit = undefined;
|
208
210
|
this.configName = undefined;
|
209
|
-
this.resourceID = undefined;
|
210
211
|
this.filterConfig = undefined;
|
211
212
|
this.messagesBuilder = undefined;
|
212
213
|
this.allowDefault = undefined;
|
@@ -282,11 +283,11 @@ const SnkFilterBar = class {
|
|
282
283
|
return;
|
283
284
|
}
|
284
285
|
this._loadingPending = false;
|
285
|
-
this.dataUnit.loadData(
|
286
|
+
this.dataUnit.loadData();
|
286
287
|
}
|
287
288
|
if (this._configUpdated) {
|
288
289
|
this._configUpdated = false;
|
289
|
-
ConfigStorage.ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName
|
290
|
+
ConfigStorage.ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
|
290
291
|
}
|
291
292
|
}
|
292
293
|
/**
|
@@ -402,13 +403,15 @@ const SnkFilterBar = class {
|
|
402
403
|
}
|
403
404
|
loadConfigFromStorage() {
|
404
405
|
return new Promise(accept => {
|
405
|
-
ConfigStorage.ConfigStorage.
|
406
|
-
.
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
406
|
+
ConfigStorage.ConfigStorage.get().then(instance => {
|
407
|
+
instance.loadFilterBarConfig(this.configName, { contextURI: this.dataUnit.name })
|
408
|
+
.then((filters) => {
|
409
|
+
accept();
|
410
|
+
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
411
|
+
})
|
412
|
+
.catch(reason => {
|
413
|
+
throw new core.ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
414
|
+
});
|
412
415
|
});
|
413
416
|
});
|
414
417
|
}
|
@@ -493,7 +496,7 @@ const SnkFilterBar = class {
|
|
493
496
|
return undefined;
|
494
497
|
}
|
495
498
|
if (this.showPersonalizedFilter) {
|
496
|
-
return index$1.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName
|
499
|
+
return index$1.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
|
497
500
|
}
|
498
501
|
return (index$1.h(index$1.Host, null, index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
499
502
|
}
|