@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
@@ -1,15 +1,17 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DateUtils, StringUtils, OnboardingUtils, DependencyType, ElementIDUtils, ApplicationContext, ErrorTracking, DataType } from '@sankhyalabs/core';
|
3
|
-
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-
|
3
|
+
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-a4ed43e7.js';
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
|
-
import { P as PesquisaFetcher } from './pesquisa-fetcher-
|
6
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
7
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-
|
8
|
-
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-
|
5
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-7460b876.js';
|
6
|
+
import { G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-1090289a.js';
|
7
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-8d0bfa4a.js';
|
8
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-c53e0d6c.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
|
10
10
|
import './_commonjsHelpers-9943807e.js';
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-4065db9a.js';
|
13
|
+
import './resource-fetcher-45a70066.js';
|
14
|
+
import './filter-bar-config-fetcher-2417b8cf.js';
|
13
15
|
import './filter-item-type.enum-5028ed3f.js';
|
14
16
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
15
17
|
|
@@ -250,21 +252,16 @@ const SnkApplication = class {
|
|
250
252
|
}
|
251
253
|
return this._parameters;
|
252
254
|
}
|
253
|
-
|
254
|
-
if (
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
this.authFetcher.getData(resourceID).then((authList) => {
|
260
|
-
resolve(authList);
|
261
|
-
}).catch(error => {
|
262
|
-
reject(error);
|
263
|
-
});
|
264
|
-
});
|
255
|
+
get resourceID() {
|
256
|
+
if (!this._resourceID) {
|
257
|
+
this._resourceID = this.urlParams.get("workspaceResourceID") ||
|
258
|
+
this.urlParams.get("resourceID") ||
|
259
|
+
Workspace.resourceID ||
|
260
|
+
"unknown.resource.id";
|
265
261
|
}
|
262
|
+
return this._resourceID;
|
266
263
|
}
|
267
|
-
|
264
|
+
get auth() {
|
268
265
|
if (this._auth) {
|
269
266
|
return Promise.resolve(this._auth);
|
270
267
|
}
|
@@ -273,7 +270,7 @@ const SnkApplication = class {
|
|
273
270
|
const waitingAuth = this._authPromises.length > 0;
|
274
271
|
this._authPromises.push(new PendingPromise(resolve, reject));
|
275
272
|
if (!waitingAuth) {
|
276
|
-
this.authFetcher.getData(this.
|
273
|
+
this.authFetcher.getData(this.resourceID).then((authList) => {
|
277
274
|
this._auth = authList;
|
278
275
|
while (this._authPromises.length > 0) {
|
279
276
|
this._authPromises.pop().resolve(this._auth);
|
@@ -292,7 +289,7 @@ const SnkApplication = class {
|
|
292
289
|
*/
|
293
290
|
async isUserSup() {
|
294
291
|
return new Promise((resolve, reject) => {
|
295
|
-
this.
|
292
|
+
this.auth.then((authorization) => {
|
296
293
|
this.getAuthList(authorization).then((auths) => {
|
297
294
|
resolve(auths.isSup);
|
298
295
|
}).catch(error => reject(error));
|
@@ -306,9 +303,9 @@ const SnkApplication = class {
|
|
306
303
|
/**
|
307
304
|
* Obtém `true` caso o usuário logado tem permissão pra determinada ação.
|
308
305
|
*/
|
309
|
-
async hasAccess(access
|
306
|
+
async hasAccess(access) {
|
310
307
|
return new Promise((resolve, reject) => {
|
311
|
-
this.
|
308
|
+
this.auth.then((authorization) => {
|
312
309
|
this.getAuthList(authorization).then((auths) => {
|
313
310
|
resolve(auths.isSup || auths.actions[access]);
|
314
311
|
}).catch(error => reject(error));
|
@@ -318,9 +315,9 @@ const SnkApplication = class {
|
|
318
315
|
/**
|
319
316
|
* Obtém todos os acessos do usuário logado.
|
320
317
|
*/
|
321
|
-
async getAllAccess(
|
318
|
+
async getAllAccess() {
|
322
319
|
return new Promise((resolve, reject) => {
|
323
|
-
this.
|
320
|
+
this.auth.then((authorization) => {
|
324
321
|
this.getAuthList(authorization).then((auths) => {
|
325
322
|
const allAccess = {};
|
326
323
|
allAccess['isSup'] = auths.isSup;
|
@@ -504,16 +501,13 @@ const SnkApplication = class {
|
|
504
501
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
505
502
|
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
506
503
|
*/
|
507
|
-
async createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
508
|
-
if (resourceID == undefined) {
|
509
|
-
resourceID = this.applicationResourceID;
|
510
|
-
}
|
504
|
+
async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
|
511
505
|
return new Promise((resolve, reject) => {
|
512
506
|
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
513
507
|
const waitingDu = duPromisses.length > 0;
|
514
508
|
duPromisses.push(new PendingPromise(resolve, reject));
|
515
509
|
if (!waitingDu) {
|
516
|
-
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
|
510
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID, parentDataUnit, configName);
|
517
511
|
dataUnit.loadMetadata().then(() => {
|
518
512
|
if (dataUnitName) {
|
519
513
|
this.updateDataunitCache(undefined, dataUnitName, dataUnit);
|
@@ -544,14 +538,14 @@ const SnkApplication = class {
|
|
544
538
|
/**
|
545
539
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
546
540
|
*/
|
547
|
-
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName
|
541
|
+
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
|
548
542
|
return new Promise((resolve, reject) => {
|
549
543
|
const dataUnit = this._duCache.get(dataUnitName);
|
550
544
|
if (dataUnit) {
|
551
545
|
resolve(dataUnit);
|
552
546
|
}
|
553
547
|
else {
|
554
|
-
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
548
|
+
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
|
555
549
|
resolve(dataUnit);
|
556
550
|
}).catch(reason => reject(reason));
|
557
551
|
}
|
@@ -600,20 +594,11 @@ const SnkApplication = class {
|
|
600
594
|
async callServiceBroker(serviceName, payload, options) {
|
601
595
|
return DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
602
596
|
}
|
603
|
-
get applicationResourceID() {
|
604
|
-
if (!this._applicationResourceID) {
|
605
|
-
this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
|
606
|
-
this.urlParams.get("resourceID") ||
|
607
|
-
Workspace.resourceID ||
|
608
|
-
"unknown.resource.id";
|
609
|
-
}
|
610
|
-
return this._applicationResourceID;
|
611
|
-
}
|
612
597
|
/**
|
613
598
|
* Obtém o resourceID da tela em questão.
|
614
599
|
*/
|
615
600
|
async getResourceID() {
|
616
|
-
return Promise.resolve(this.
|
601
|
+
return Promise.resolve(this.resourceID);
|
617
602
|
}
|
618
603
|
/**
|
619
604
|
* Obtém o UserId da tela em questão.
|
@@ -657,14 +642,20 @@ const SnkApplication = class {
|
|
657
642
|
async info(message, options) {
|
658
643
|
return ApplicationUtils.info(message, options);
|
659
644
|
}
|
645
|
+
/**
|
646
|
+
* Obtém a configuração de grade.
|
647
|
+
*/
|
648
|
+
async loadGridConfig(name) {
|
649
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
650
|
+
}
|
660
651
|
/**
|
661
652
|
* Obtém os totalizadores da grade.
|
662
653
|
*/
|
663
654
|
async loadTotals(name, resourceID, filters) {
|
664
655
|
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
665
656
|
}
|
666
|
-
async getAuthList(
|
667
|
-
return await (new MGEAuthorization()).parseFromJSON(
|
657
|
+
async getAuthList(_auth) {
|
658
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
668
659
|
}
|
669
660
|
get urlParams() {
|
670
661
|
if (!this._urlParams) {
|
@@ -678,6 +669,12 @@ const SnkApplication = class {
|
|
678
669
|
}
|
679
670
|
return this._dataUnitFetcher;
|
680
671
|
}
|
672
|
+
get gridConfigFetcher() {
|
673
|
+
if (!this._gridConfigFetcher) {
|
674
|
+
this._gridConfigFetcher = new GridConfigFetcher();
|
675
|
+
}
|
676
|
+
return this._gridConfigFetcher;
|
677
|
+
}
|
681
678
|
get totalsFetcher() {
|
682
679
|
if (!this._totalsFetcher) {
|
683
680
|
this._totalsFetcher = new TotalsFetcher();
|
@@ -775,7 +772,7 @@ const SnkApplication = class {
|
|
775
772
|
* Obtém o nome das telas da aplicação
|
776
773
|
*/
|
777
774
|
async getAppLabel() {
|
778
|
-
return Workspace.getAppLabel(this.
|
775
|
+
return Workspace.getAppLabel(this._resourceID);
|
779
776
|
}
|
780
777
|
/**
|
781
778
|
* Adiciona um listener no fetcher de Pesquisa
|
@@ -847,7 +844,6 @@ const SnkApplication = class {
|
|
847
844
|
this._popUp.ezTitle = title;
|
848
845
|
}
|
849
846
|
componentWillLoad() {
|
850
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
|
851
847
|
this._errorHandler = new SnkErrorHandler(this);
|
852
848
|
this.messagesBuilder = new SnkMessageBuilder();
|
853
849
|
ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
@@ -856,7 +852,7 @@ const SnkApplication = class {
|
|
856
852
|
});
|
857
853
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
858
854
|
ErrorTracking.init();
|
859
|
-
ConfigStorage.
|
855
|
+
ConfigStorage.get();
|
860
856
|
}
|
861
857
|
connectedCallback() {
|
862
858
|
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
@@ -868,10 +864,9 @@ const SnkApplication = class {
|
|
868
864
|
componentDidLoad() {
|
869
865
|
this.applicationLoading.emit(true);
|
870
866
|
window.requestAnimationFrame(() => {
|
871
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
|
872
867
|
this.applicationLoaded.emit(true);
|
873
868
|
});
|
874
|
-
ElementIDUtils.addIDInfo(this._element, `resource_${this.
|
869
|
+
ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
|
875
870
|
}
|
876
871
|
render() {
|
877
872
|
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, DataType, Action } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
4
|
-
import { S as SaveErrorsEnum } from './ISave-4412b20c.js';
|
3
|
+
import { D as DataFetcher } from './DataFetcher-a4ed43e7.js';
|
5
4
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
6
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-
|
5
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-8d0bfa4a.js';
|
7
6
|
import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
|
8
7
|
import './_commonjsHelpers-9943807e.js';
|
9
8
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -11,6 +10,13 @@ import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
11
10
|
import './index-1564817d.js';
|
12
11
|
import './index-bdf75557.js';
|
13
12
|
|
13
|
+
var SaveErrorsEnum;
|
14
|
+
(function (SaveErrorsEnum) {
|
15
|
+
SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
|
16
|
+
SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
|
17
|
+
SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
|
18
|
+
})(SaveErrorsEnum || (SaveErrorsEnum = {}));
|
19
|
+
|
14
20
|
class AttachFetcher {
|
15
21
|
constructor(entityName, registerKey, dataUnitName) {
|
16
22
|
var _a;
|
@@ -16,7 +16,6 @@ const SnkConfigurator = class {
|
|
16
16
|
this._permissions = undefined;
|
17
17
|
this.showActionButtons = false;
|
18
18
|
this.configName = undefined;
|
19
|
-
this.resourceID = undefined;
|
20
19
|
this.viewMode = VIEW_MODE.GRID;
|
21
20
|
this.messagesBuilder = undefined;
|
22
21
|
}
|
@@ -81,7 +80,7 @@ const SnkConfigurator = class {
|
|
81
80
|
componentWillLoad() {
|
82
81
|
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
83
82
|
if (this._application) {
|
84
|
-
this._application.getAllAccess(
|
83
|
+
this._application.getAllAccess().then(access => (this._permissions = access));
|
85
84
|
}
|
86
85
|
else {
|
87
86
|
this._permissions = {};
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-a4ed43e7.js';
|
5
|
+
import './pesquisa-fetcher-7460b876.js';
|
6
6
|
import { P as PresentationMode } from './index-1564817d.js';
|
7
|
-
import './ISave-4412b20c.js';
|
8
|
-
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
|
-
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
|
-
import './filter-item-type.enum-5028ed3f.js';
|
11
|
-
import './form-config-fetcher-aaaa79a6.js';
|
12
7
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
13
|
-
import { A as AutorizationType } from './auth-fetcher-
|
8
|
+
import { A as AutorizationType } from './auth-fetcher-c53e0d6c.js';
|
14
9
|
import './index-bdf75557.js';
|
15
10
|
import './_commonjsHelpers-9943807e.js';
|
11
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
12
|
+
import './resource-fetcher-45a70066.js';
|
16
13
|
|
17
14
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
18
15
|
|
@@ -22,14 +19,12 @@ const SnkCrud = class {
|
|
22
19
|
this.actionClick = createEvent(this, "actionClick", 7);
|
23
20
|
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
24
21
|
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
25
|
-
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
26
22
|
this._viewHistory = [];
|
27
23
|
this._dataUnit = undefined;
|
28
24
|
this._dataState = undefined;
|
29
25
|
this.attachmentRegisterKey = undefined;
|
30
26
|
this._currentViewMode = VIEW_MODE.GRID;
|
31
27
|
this._canEdit = undefined;
|
32
|
-
this._resourceID = undefined;
|
33
28
|
this.configName = undefined;
|
34
29
|
this.selectionToastConfig = undefined;
|
35
30
|
this.showActionButtons = false;
|
@@ -124,7 +119,7 @@ const SnkCrud = class {
|
|
124
119
|
}
|
125
120
|
componentWillLoad() {
|
126
121
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
127
|
-
application.hasAccess(AutorizationType.UPDATE
|
122
|
+
application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
128
123
|
let parent = this._element.parentElement;
|
129
124
|
while (parent) {
|
130
125
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -136,11 +131,11 @@ const SnkCrud = class {
|
|
136
131
|
if (!this._dataUnit) {
|
137
132
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
138
133
|
this._dataUnit = evt.detail;
|
139
|
-
this.initDataUnit(
|
134
|
+
this.initDataUnit();
|
140
135
|
});
|
141
136
|
}
|
142
137
|
else {
|
143
|
-
this.initDataUnit(
|
138
|
+
this.initDataUnit();
|
144
139
|
}
|
145
140
|
this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
|
146
141
|
this._dataState = dataState;
|
@@ -156,18 +151,11 @@ const SnkCrud = class {
|
|
156
151
|
this.configName = application.configName;
|
157
152
|
}
|
158
153
|
}
|
159
|
-
|
154
|
+
initDataUnit() {
|
160
155
|
this.addDataElementID();
|
161
156
|
if (!this.messagesBuilder) {
|
162
157
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
163
158
|
}
|
164
|
-
if (this._resourceID == undefined) {
|
165
|
-
//Tenta pegar o resourceID do snkDataUnit;
|
166
|
-
this._resourceID = this._snkDataUnit.resourceID;
|
167
|
-
if (this._resourceID == undefined) {
|
168
|
-
this._resourceID = await application.getResourceID();
|
169
|
-
}
|
170
|
-
}
|
171
159
|
}
|
172
160
|
handleConfiguratorEvent(evt, type) {
|
173
161
|
evt.stopImmediatePropagation();
|
@@ -178,11 +166,8 @@ const SnkCrud = class {
|
|
178
166
|
this.configuratorCancel.emit();
|
179
167
|
}
|
180
168
|
render() {
|
181
|
-
if (this._resourceID == undefined) {
|
182
|
-
return;
|
183
|
-
}
|
184
169
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
185
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, 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
|
170
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, 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 }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(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 }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
186
171
|
}
|
187
172
|
get _element() { return getElement(this); }
|
188
173
|
static get watchers() { return {
|
@@ -3,8 +3,8 @@ import { ObjectUtils, ApplicationContext, DataType, ElementIDUtils } from '@sank
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-1564817d.js';
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-3644f1b6.js';
|
6
|
-
import { D as DataFetcher } from './DataFetcher-
|
7
|
-
import { S as SnkDataUnit } from './snk-data-unit-
|
6
|
+
import { D as DataFetcher } from './DataFetcher-a4ed43e7.js';
|
7
|
+
import { S as SnkDataUnit } from './snk-data-unit-8c4d944d.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './SnkMessageBuilder-68c1c25a.js';
|
@@ -70,7 +70,6 @@ const SnkDataUnit = class {
|
|
70
70
|
this.useCancelConfirm = true;
|
71
71
|
this.ignoreSaveMessage = undefined;
|
72
72
|
this.configName = undefined;
|
73
|
-
this.resourceID = undefined;
|
74
73
|
}
|
75
74
|
observePageSize() {
|
76
75
|
if (this.dataUnit) {
|
@@ -334,10 +333,10 @@ const SnkDataUnit = class {
|
|
334
333
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
335
334
|
if (this._parentSnkDataUnit) {
|
336
335
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
337
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName
|
336
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
|
338
337
|
}
|
339
338
|
else {
|
340
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName
|
339
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
|
341
340
|
}
|
342
341
|
}
|
343
342
|
async loadDataUnit() {
|
@@ -396,7 +395,7 @@ const SnkDataUnit = class {
|
|
396
395
|
//---------------------------------------------
|
397
396
|
componentWillLoad() {
|
398
397
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
399
|
-
this._application.getAllAccess(
|
398
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
400
399
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
401
400
|
if (this.messagesBuilder == undefined) {
|
402
401
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
|
2
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
2
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-de537eca.js';
|
3
3
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-a4ed43e7.js';
|
5
|
+
import './pesquisa-fetcher-7460b876.js';
|
6
6
|
import '@sankhyalabs/core';
|
7
7
|
import { P as PresentationMode } from './index-1564817d.js';
|
8
|
-
import './ISave-4412b20c.js';
|
9
|
-
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
|
-
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
-
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-aaaa79a6.js';
|
13
8
|
import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
|
14
9
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
15
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
10
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-cdecff6e.js';
|
16
11
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
|
17
|
-
import './ConfigStorage-
|
12
|
+
import './ConfigStorage-1090289a.js';
|
13
|
+
import './form-config-fetcher-4065db9a.js';
|
14
|
+
import './resource-fetcher-45a70066.js';
|
15
|
+
import './filter-bar-config-fetcher-2417b8cf.js';
|
16
|
+
import './filter-item-type.enum-5028ed3f.js';
|
18
17
|
import './_commonjsHelpers-9943807e.js';
|
18
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
19
19
|
import './index-bdf75557.js';
|
20
20
|
import './taskbar-processor-94402e6e.js';
|
21
21
|
import '@sankhyalabs/core/dist/dataunit/DataUnit';
|
@@ -70,13 +70,11 @@ const SnkDetailView = class {
|
|
70
70
|
registerInstance(this, hostRef);
|
71
71
|
this.snkDetailGuidesChange = createEvent(this, "snkDetailGuidesChange", 7);
|
72
72
|
this.snkSwitchGuide = createEvent(this, "snkSwitchGuide", 7);
|
73
|
-
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
74
73
|
this._disabledButtons = undefined;
|
75
74
|
this._currentView = undefined;
|
76
75
|
this.attachmentRegisterKey = undefined;
|
77
76
|
this.formConfigManager = undefined;
|
78
77
|
this.dataUnitName = undefined;
|
79
|
-
this.resourceID = undefined;
|
80
78
|
this.guideItemPath = undefined;
|
81
79
|
this.entityName = undefined;
|
82
80
|
this.label = undefined;
|
@@ -246,7 +244,7 @@ const SnkDetailView = class {
|
|
246
244
|
}
|
247
245
|
componentWillLoad() {
|
248
246
|
this._configName = `dynaform.${this.entityName}`;
|
249
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName,
|
247
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
250
248
|
this.formConfigManager.loadConfig();
|
251
249
|
if (this.messagesBuilder == undefined) {
|
252
250
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -255,7 +253,7 @@ const SnkDetailView = class {
|
|
255
253
|
render() {
|
256
254
|
this.updateLabel();
|
257
255
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
258
|
-
return (h(Host, null, 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 === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), 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(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, 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
|
256
|
+
return (h(Host, null, 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 === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), 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(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, 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 }, 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: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
259
257
|
}
|
260
258
|
static get watchers() { return {
|
261
259
|
"dataState": ["observerDataState"]
|
@@ -7,6 +7,7 @@ const SnkEntityList = class {
|
|
7
7
|
constructor(hostRef) {
|
8
8
|
registerInstance(this, hostRef);
|
9
9
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
10
|
+
this.saveConfig = createEvent(this, "saveConfig", 7);
|
10
11
|
this._searchValue = undefined;
|
11
12
|
this._ezListSource = [];
|
12
13
|
this.config = undefined;
|
@@ -15,6 +16,7 @@ const SnkEntityList = class {
|
|
15
16
|
}
|
16
17
|
async reloadList() {
|
17
18
|
this.loadListSource();
|
19
|
+
this.saveConfig.emit(this.config);
|
18
20
|
}
|
19
21
|
observeConfig() {
|
20
22
|
var _a, _b;
|
@@ -30,6 +32,7 @@ const SnkEntityList = class {
|
|
30
32
|
}
|
31
33
|
});
|
32
34
|
this.config = ObjectUtils.copy(configCopy);
|
35
|
+
this.saveConfig.emit(this.config);
|
33
36
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
34
37
|
}
|
35
38
|
loadListSource() {
|
@@ -86,6 +89,7 @@ const SnkEntityList = class {
|
|
86
89
|
}
|
87
90
|
] });
|
88
91
|
this.loadListSource();
|
92
|
+
this.saveConfig.emit(this.config);
|
89
93
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
90
94
|
}
|
91
95
|
}
|
@@ -1,16 +1,18 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-1090289a.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
7
7
|
import { F as FilterOperand } from './index-ae591a44.js';
|
8
8
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
9
9
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
|
10
|
-
import './form-config-fetcher-
|
11
|
-
import './DataFetcher-
|
10
|
+
import './form-config-fetcher-4065db9a.js';
|
11
|
+
import './DataFetcher-a4ed43e7.js';
|
12
12
|
import './_commonjsHelpers-9943807e.js';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
|
+
import './resource-fetcher-45a70066.js';
|
15
|
+
import './filter-bar-config-fetcher-2417b8cf.js';
|
14
16
|
|
15
17
|
const buildFilter = (item) => {
|
16
18
|
switch (item.type) {
|
@@ -202,7 +204,6 @@ const SnkFilterBar = class {
|
|
202
204
|
};
|
203
205
|
this.dataUnit = undefined;
|
204
206
|
this.configName = undefined;
|
205
|
-
this.resourceID = undefined;
|
206
207
|
this.filterConfig = undefined;
|
207
208
|
this.messagesBuilder = undefined;
|
208
209
|
this.allowDefault = undefined;
|
@@ -278,11 +279,11 @@ const SnkFilterBar = class {
|
|
278
279
|
return;
|
279
280
|
}
|
280
281
|
this._loadingPending = false;
|
281
|
-
this.dataUnit.loadData(
|
282
|
+
this.dataUnit.loadData();
|
282
283
|
}
|
283
284
|
if (this._configUpdated) {
|
284
285
|
this._configUpdated = false;
|
285
|
-
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName
|
286
|
+
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
|
286
287
|
}
|
287
288
|
}
|
288
289
|
/**
|
@@ -398,13 +399,15 @@ const SnkFilterBar = class {
|
|
398
399
|
}
|
399
400
|
loadConfigFromStorage() {
|
400
401
|
return new Promise(accept => {
|
401
|
-
ConfigStorage.
|
402
|
-
.
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
402
|
+
ConfigStorage.get().then(instance => {
|
403
|
+
instance.loadFilterBarConfig(this.configName, { contextURI: this.dataUnit.name })
|
404
|
+
.then((filters) => {
|
405
|
+
accept();
|
406
|
+
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
407
|
+
})
|
408
|
+
.catch(reason => {
|
409
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
410
|
+
});
|
408
411
|
});
|
409
412
|
});
|
410
413
|
}
|
@@ -489,7 +492,7 @@ const SnkFilterBar = class {
|
|
489
492
|
return undefined;
|
490
493
|
}
|
491
494
|
if (this.showPersonalizedFilter) {
|
492
|
-
return 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
|
495
|
+
return 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 });
|
493
496
|
}
|
494
497
|
return (h(Host, null, h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
495
498
|
}
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
|
-
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
4
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
5
|
+
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-2417b8cf.js';
|
5
6
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
6
7
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
|
8
|
+
import './resource-fetcher-45a70066.js';
|
9
|
+
import './DataFetcher-a4ed43e7.js';
|
10
|
+
import './_commonjsHelpers-9943807e.js';
|
11
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
7
12
|
import './index-ae591a44.js';
|
8
13
|
|
9
14
|
const SnkFilterDetail = class {
|
@@ -27,6 +32,7 @@ const SnkFilterDetail = class {
|
|
27
32
|
}
|
28
33
|
componentDidLoad() {
|
29
34
|
if (this._element) {
|
35
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
30
36
|
ElementIDUtils.addIDInfo(this._element);
|
31
37
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
32
38
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
@@ -144,12 +150,20 @@ const SnkFilterDetail = class {
|
|
144
150
|
this.config = ObjectUtils.copy(configCopy);
|
145
151
|
}
|
146
152
|
}
|
153
|
+
saveConfig(newConfig) {
|
154
|
+
var _a;
|
155
|
+
(_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
|
156
|
+
const fetcher = new FilterBarConfigFetcher();
|
157
|
+
fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
|
158
|
+
this.config = newConfig;
|
159
|
+
});
|
160
|
+
}
|
147
161
|
componentWillLoad() {
|
148
162
|
this.originalConfig = ObjectUtils.copy(this.config);
|
149
163
|
}
|
150
164
|
render() {
|
151
165
|
const { tag: CustomElement, props } = this.getContentEditor();
|
152
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
166
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, onSaveConfig: evt => this.saveConfig(evt.detail), rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
153
167
|
}
|
154
168
|
get _element() { return getElement(this); }
|
155
169
|
static get watchers() { return {
|