@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.0
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/{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 +73 -51
- 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 +9 -28
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-d5109a08.js} +6 -8
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +25 -18
- 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 -20
- package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8c9693aa.js} +9 -18
- 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 +80 -22
- 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 +8 -63
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +15 -65
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +30 -66
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -42
- 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 +16 -110
- 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 +9 -43
- 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/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 +154 -132
- package/dist/components/snk-attach2.js +8 -1
- package/dist/components/snk-configurator2.js +1 -3
- package/dist/components/snk-crud.js +7 -29
- package/dist/components/snk-data-unit2.js +6 -10
- package/dist/components/snk-detail-view2.js +23 -28
- 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 -23
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-simple-crud2.js +69 -12
- 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/{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 +71 -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 +9 -28
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-3a0bbfcb.js} +6 -8
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +25 -18
- 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 -20
- package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-a6d39c18.js} +9 -18
- 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 +71 -13
- package/dist/esm/snk-taskbar.entry.js +1 -2
- package/dist/sankhyablocks/p-0fb83448.js +1 -0
- package/dist/sankhyablocks/p-15aba6fb.entry.js +11 -0
- package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
- package/dist/sankhyablocks/p-21e7c08e.entry.js +1 -0
- package/dist/sankhyablocks/p-2861d44f.entry.js +1 -0
- package/dist/sankhyablocks/p-2d883fe9.entry.js +1 -0
- package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-3d6f91c2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
- package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
- package/dist/sankhyablocks/p-4f4cd005.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-5994af77.js +56 -0
- package/dist/sankhyablocks/p-5df17074.js +1 -0
- package/dist/sankhyablocks/p-6bb904bb.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-9471cbc9.entry.js +1 -0
- package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
- package/dist/sankhyablocks/p-9edad923.js +1 -0
- package/dist/sankhyablocks/p-a42dd503.entry.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-c6380ea2.entry.js +1 -0
- package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
- package/dist/sankhyablocks/p-c945318c.entry.js +1 -0
- package/dist/sankhyablocks/p-ccbfb1cf.entry.js +1 -0
- 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/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 -10
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -13
- 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 -13
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -8
- 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 -18
- 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 -8
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
- package/dist/types/components.d.ts +21 -189
- 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/cjs/auth-fetcher-319a4cb2.js +0 -34
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
- package/dist/components/ResourceIDUtils.js +0 -10
- package/dist/components/auth-fetcher.js +0 -32
- package/dist/esm/ISave-4412b20c.js +0 -8
- package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
- package/dist/esm/auth-fetcher-6d9664b7.js +0 -32
- 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
@@ -21,9 +21,9 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
21
21
|
const duState = this.buildDataState();
|
22
22
|
this.dataState = duState;
|
23
23
|
if (action.type === Action.DATA_SAVED) {
|
24
|
-
if
|
25
|
-
|
26
|
-
}
|
24
|
+
// if(this.ignoreSaveMessage){
|
25
|
+
// return
|
26
|
+
// }
|
27
27
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
28
28
|
if (msg != undefined) {
|
29
29
|
this.showSuccessMessage(msg);
|
@@ -69,9 +69,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
69
69
|
this.beforeSave = undefined;
|
70
70
|
this.afterSave = undefined;
|
71
71
|
this.useCancelConfirm = true;
|
72
|
-
this.ignoreSaveMessage = undefined;
|
73
72
|
this.configName = undefined;
|
74
|
-
this.resourceID = undefined;
|
75
73
|
}
|
76
74
|
observePageSize() {
|
77
75
|
if (this.dataUnit) {
|
@@ -335,10 +333,10 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
335
333
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
336
334
|
if (this._parentSnkDataUnit) {
|
337
335
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
338
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName
|
336
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
|
339
337
|
}
|
340
338
|
else {
|
341
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName
|
339
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
|
342
340
|
}
|
343
341
|
}
|
344
342
|
async loadDataUnit() {
|
@@ -397,7 +395,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
397
395
|
//---------------------------------------------
|
398
396
|
componentWillLoad() {
|
399
397
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
400
|
-
this._application.getAllAccess(
|
398
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
401
399
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
402
400
|
if (this.messagesBuilder == undefined) {
|
403
401
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -435,9 +433,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
435
433
|
"beforeSave": [16],
|
436
434
|
"afterSave": [16],
|
437
435
|
"useCancelConfirm": [4, "use-cancel-confirm"],
|
438
|
-
"ignoreSaveMessage": [4, "ignore-save-message"],
|
439
436
|
"configName": [1, "config-name"],
|
440
|
-
"resourceID": [1, "resource-i-d"],
|
441
437
|
"getDataUnit": [64],
|
442
438
|
"getSelectedRecordsIDsInfo": [64]
|
443
439
|
}]);
|
@@ -5,15 +5,11 @@ import './DataFetcher.js';
|
|
5
5
|
import './pesquisa-fetcher.js';
|
6
6
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
7
7
|
import { P as PresentationMode } from './index2.js';
|
8
|
-
import { d as defineCustomElement$t } from './snk-actions-button2.js';
|
9
|
-
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
|
-
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
-
import './filter-item-type.enum.js';
|
12
|
-
import './form-config-fetcher.js';
|
13
8
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
14
9
|
import { V as VIEW_MODE } from './constants.js';
|
15
10
|
import { T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
16
11
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
12
|
+
import { d as defineCustomElement$t } from './snk-actions-button2.js';
|
17
13
|
import { d as defineCustomElement$s } from './snk-attach2.js';
|
18
14
|
import { d as defineCustomElement$r } from './snk-config-options2.js';
|
19
15
|
import { d as defineCustomElement$q } from './snk-configurator2.js';
|
@@ -51,7 +47,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
51
47
|
this.__registerHost();
|
52
48
|
this.exit = createEvent(this, "exit", 7);
|
53
49
|
this.actionClick = createEvent(this, "actionClick", 7);
|
54
|
-
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
55
50
|
this._guideBuilders = new Map();
|
56
51
|
this.dataUnit = undefined;
|
57
52
|
this.dataState = undefined;
|
@@ -63,9 +58,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
63
58
|
this.selectedGuide = undefined;
|
64
59
|
this.taskbarManager = undefined;
|
65
60
|
this.messagesBuilder = undefined;
|
66
|
-
this.canEdit = true;
|
67
61
|
this.presentationMode = undefined;
|
68
|
-
this.resourceID = undefined;
|
69
62
|
this._breadcrumbItems = [];
|
70
63
|
this._guides = undefined;
|
71
64
|
this._formEditorConfigManager = undefined;
|
@@ -267,7 +260,9 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
267
260
|
else {
|
268
261
|
detailBranch = this.selectedGuide;
|
269
262
|
}
|
270
|
-
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`,
|
263
|
+
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`,
|
264
|
+
// canEdit={this.canEdit}
|
265
|
+
onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
271
266
|
}
|
272
267
|
else {
|
273
268
|
const cardId = this.selectedGuide.id;
|
@@ -316,10 +311,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
316
311
|
return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
317
312
|
}
|
318
313
|
componentWillLoad() {
|
319
|
-
|
320
|
-
throw new Error("Erro interno: resourceID não informado");
|
321
|
-
}
|
322
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
|
314
|
+
this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
|
323
315
|
this._configManager.loadConfig();
|
324
316
|
}
|
325
317
|
componentDidRender() {
|
@@ -338,7 +330,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
338
330
|
}
|
339
331
|
buildTaskBar() {
|
340
332
|
var _a;
|
341
|
-
return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit
|
333
|
+
return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit }));
|
342
334
|
}
|
343
335
|
render() {
|
344
336
|
var _a, _b;
|
@@ -357,7 +349,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
357
349
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
358
350
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
359
351
|
:
|
360
|
-
h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail)
|
352
|
+
h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
361
353
|
}
|
362
354
|
static get watchers() { return {
|
363
355
|
"dataUnit": ["observeDataUnit"],
|
@@ -366,6 +358,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
366
358
|
}; }
|
367
359
|
static get style() { return snkGuidesViewerCss; }
|
368
360
|
}, [2, "snk-guides-viewer", {
|
361
|
+
"_guideBuilders": [16],
|
369
362
|
"dataUnit": [16],
|
370
363
|
"dataState": [16],
|
371
364
|
"configName": [1, "config-name"],
|
@@ -376,9 +369,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
376
369
|
"selectedGuide": [16],
|
377
370
|
"taskbarManager": [16],
|
378
371
|
"messagesBuilder": [1040],
|
379
|
-
"canEdit": [4, "can-edit"],
|
380
372
|
"presentationMode": [1, "presentation-mode"],
|
381
|
-
"resourceID": [1, "resource-i-d"],
|
382
373
|
"_breadcrumbItems": [32],
|
383
374
|
"_guides": [32],
|
384
375
|
"_formEditorConfigManager": [32],
|
@@ -595,13 +586,10 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
595
586
|
this.__registerHost();
|
596
587
|
this.snkDetailGuidesChange = createEvent(this, "snkDetailGuidesChange", 7);
|
597
588
|
this.snkSwitchGuide = createEvent(this, "snkSwitchGuide", 7);
|
598
|
-
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
599
589
|
this._disabledButtons = undefined;
|
600
|
-
this._currentView = undefined;
|
601
590
|
this.attachmentRegisterKey = undefined;
|
602
591
|
this.formConfigManager = undefined;
|
603
592
|
this.dataUnitName = undefined;
|
604
|
-
this.resourceID = undefined;
|
605
593
|
this.guideItemPath = undefined;
|
606
594
|
this.entityName = undefined;
|
607
595
|
this.label = undefined;
|
@@ -610,8 +598,12 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
610
598
|
this.dataState = undefined;
|
611
599
|
this.messagesBuilder = undefined;
|
612
600
|
this.branchGuide = undefined;
|
613
|
-
this.canEdit = true;
|
614
601
|
}
|
602
|
+
// /**
|
603
|
+
// * Define se a edição está habilitada na grid.
|
604
|
+
// */
|
605
|
+
// @Prop()
|
606
|
+
// canEdit: boolean = true;
|
615
607
|
observerDataState(newValue, oldValue) {
|
616
608
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
617
609
|
const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
@@ -724,8 +716,10 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
724
716
|
updateViewStack(viewStack) {
|
725
717
|
var _a, _b;
|
726
718
|
this._viewStack = viewStack;
|
727
|
-
|
728
|
-
(_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.
|
719
|
+
// TODO: remove to gridEditor
|
720
|
+
(_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedForm ? 1 : 0);
|
721
|
+
// this._currentView = this.selectedForm ? 1 : 0;
|
722
|
+
// this._viewStack?.show?.(this._currentView);
|
729
723
|
}
|
730
724
|
getFormFields() {
|
731
725
|
if (this.selectedForm && this._formMetadata) {
|
@@ -771,7 +765,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
771
765
|
}
|
772
766
|
componentWillLoad() {
|
773
767
|
this._configName = `dynaform.${this.entityName}`;
|
774
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName,
|
768
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
775
769
|
this.formConfigManager.loadConfig();
|
776
770
|
if (this.messagesBuilder == undefined) {
|
777
771
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -780,7 +774,11 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
780
774
|
render() {
|
781
775
|
this.updateLabel();
|
782
776
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
783
|
-
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),
|
777
|
+
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),
|
778
|
+
// ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
|
779
|
+
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,
|
780
|
+
// canEdit={this.canEdit}
|
781
|
+
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) }))))));
|
784
782
|
}
|
785
783
|
static get watchers() { return {
|
786
784
|
"dataState": ["observerDataState"]
|
@@ -789,7 +787,6 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
789
787
|
}, [2, "snk-detail-view", {
|
790
788
|
"formConfigManager": [1040],
|
791
789
|
"dataUnitName": [1, "data-unit-name"],
|
792
|
-
"resourceID": [1, "resource-i-d"],
|
793
790
|
"guideItemPath": [16],
|
794
791
|
"entityName": [1, "entity-name"],
|
795
792
|
"label": [1],
|
@@ -798,9 +795,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
798
795
|
"dataState": [1040],
|
799
796
|
"messagesBuilder": [1040],
|
800
797
|
"branchGuide": [16],
|
801
|
-
"canEdit": [4, "can-edit"],
|
802
798
|
"_disabledButtons": [32],
|
803
|
-
"_currentView": [32],
|
804
799
|
"attachmentRegisterKey": [32],
|
805
800
|
"changeViewMode": [64],
|
806
801
|
"configGrid": [64],
|
@@ -8,6 +8,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
8
8
|
super();
|
9
9
|
this.__registerHost();
|
10
10
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
11
|
+
this.saveConfig = createEvent(this, "saveConfig", 7);
|
11
12
|
this._searchValue = undefined;
|
12
13
|
this._ezListSource = [];
|
13
14
|
this.config = undefined;
|
@@ -16,6 +17,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
16
17
|
}
|
17
18
|
async reloadList() {
|
18
19
|
this.loadListSource();
|
20
|
+
this.saveConfig.emit(this.config);
|
19
21
|
}
|
20
22
|
observeConfig() {
|
21
23
|
var _a, _b;
|
@@ -31,6 +33,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
31
33
|
}
|
32
34
|
});
|
33
35
|
this.config = ObjectUtils.copy(configCopy);
|
36
|
+
this.saveConfig.emit(this.config);
|
34
37
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
35
38
|
}
|
36
39
|
loadListSource() {
|
@@ -87,6 +90,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
87
90
|
}
|
88
91
|
] });
|
89
92
|
this.loadListSource();
|
93
|
+
this.saveConfig.emit(this.config);
|
90
94
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
91
95
|
}
|
92
96
|
}
|
@@ -208,7 +208,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
208
208
|
};
|
209
209
|
this.dataUnit = undefined;
|
210
210
|
this.configName = undefined;
|
211
|
-
this.resourceID = undefined;
|
212
211
|
this.filterConfig = undefined;
|
213
212
|
this.messagesBuilder = undefined;
|
214
213
|
this.allowDefault = undefined;
|
@@ -284,11 +283,11 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
284
283
|
return;
|
285
284
|
}
|
286
285
|
this._loadingPending = false;
|
287
|
-
this.dataUnit.loadData(
|
286
|
+
this.dataUnit.loadData();
|
288
287
|
}
|
289
288
|
if (this._configUpdated) {
|
290
289
|
this._configUpdated = false;
|
291
|
-
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName
|
290
|
+
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
|
292
291
|
}
|
293
292
|
}
|
294
293
|
/**
|
@@ -404,13 +403,15 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
404
403
|
}
|
405
404
|
loadConfigFromStorage() {
|
406
405
|
return new Promise(accept => {
|
407
|
-
ConfigStorage.
|
408
|
-
.
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
406
|
+
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 ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
414
|
+
});
|
414
415
|
});
|
415
416
|
});
|
416
417
|
}
|
@@ -495,7 +496,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
495
496
|
return undefined;
|
496
497
|
}
|
497
498
|
if (this.showPersonalizedFilter) {
|
498
|
-
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
|
499
|
+
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 });
|
499
500
|
}
|
500
501
|
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" }))));
|
501
502
|
}
|
@@ -507,7 +508,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
507
508
|
}, [2, "snk-filter-bar", {
|
508
509
|
"dataUnit": [1040],
|
509
510
|
"configName": [1, "config-name"],
|
510
|
-
"resourceID": [1, "resource-i-d"],
|
511
511
|
"filterConfig": [1040],
|
512
512
|
"messagesBuilder": [1040],
|
513
513
|
"allowDefault": [32],
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
2
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.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.js';
|
5
6
|
import { E as EPresentationMode } from './presentationMode.js';
|
6
7
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
7
8
|
|
@@ -27,6 +28,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
27
28
|
}
|
28
29
|
componentDidLoad() {
|
29
30
|
if (this._element) {
|
31
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
30
32
|
ElementIDUtils.addIDInfo(this._element);
|
31
33
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
32
34
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
@@ -144,12 +146,20 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
144
146
|
this.config = ObjectUtils.copy(configCopy);
|
145
147
|
}
|
146
148
|
}
|
149
|
+
saveConfig(newConfig) {
|
150
|
+
var _a;
|
151
|
+
(_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
|
152
|
+
const fetcher = new FilterBarConfigFetcher();
|
153
|
+
fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
|
154
|
+
this.config = newConfig;
|
155
|
+
});
|
156
|
+
}
|
147
157
|
componentWillLoad() {
|
148
158
|
this.originalConfig = ObjectUtils.copy(this.config);
|
149
159
|
}
|
150
160
|
render() {
|
151
161
|
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" }))));
|
162
|
+
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
163
|
}
|
154
164
|
get _element() { return this; }
|
155
165
|
static get watchers() { return {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
2
|
+
import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode.js';
|
5
5
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
@@ -23,13 +23,14 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
23
23
|
this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
|
24
24
|
this.filterItem = undefined;
|
25
25
|
this.configName = undefined;
|
26
|
-
this.resourceID = undefined;
|
27
26
|
}
|
28
27
|
observeFilterItem(newValue) {
|
29
28
|
var _a, _b;
|
30
29
|
this._editor && (this._editor["config"] = newValue);
|
31
30
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
32
31
|
this.filterChange.emit(newValue);
|
32
|
+
//isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
|
33
|
+
//this.saveConfig();
|
33
34
|
}
|
34
35
|
getContentEditorConfig() {
|
35
36
|
const props = { presentationMode: EPresentationMode.MODAL };
|
@@ -71,10 +72,11 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
71
72
|
else {
|
72
73
|
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
|
73
74
|
}
|
75
|
+
this.saveConfig();
|
74
76
|
}
|
75
77
|
handleDeleteFilter(filter, filterItemType) {
|
76
78
|
if (filterItemType === FilterItemType.PERSONALIZED) {
|
77
|
-
ConfigStorage.removePersonalizedFilter(filter, this.
|
79
|
+
ConfigStorage.removePersonalizedFilter(filter, this.configName);
|
78
80
|
}
|
79
81
|
}
|
80
82
|
componentDidLoad() {
|
@@ -82,6 +84,7 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
82
84
|
ElementIDUtils.addIDInfo(this._element);
|
83
85
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
84
86
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
|
87
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
85
88
|
}
|
86
89
|
}
|
87
90
|
buildRightSlot(item) {
|
@@ -98,6 +101,15 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
98
101
|
const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType$1;
|
99
102
|
return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
100
103
|
}
|
104
|
+
saveConfig() {
|
105
|
+
//Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
|
106
|
+
/*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
|
107
|
+
|
108
|
+
this._application?.getResourceID().then(resourceId => {
|
109
|
+
const fetcher = new FilterBarConfigFetcher();
|
110
|
+
fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
|
111
|
+
});*/
|
112
|
+
}
|
101
113
|
render() {
|
102
114
|
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
103
115
|
return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
|
@@ -109,8 +121,7 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
109
121
|
static get style() { return snkFilterModalItemCss; }
|
110
122
|
}, [0, "snk-filter-modal-item", {
|
111
123
|
"filterItem": [1040],
|
112
|
-
"configName": [1025, "config-name"]
|
113
|
-
"resourceID": [1, "resource-i-d"]
|
124
|
+
"configName": [1025, "config-name"]
|
114
125
|
}]);
|
115
126
|
function defineCustomElement() {
|
116
127
|
if (typeof customElements === "undefined") {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
2
|
import { a as draggable_bundle, d as defineCustomElement$1 } from './snk-tab-config2.js';
|
3
|
-
import { ObjectUtils, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
|
3
|
+
import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
5
|
import { C as CONFIG_EVENTS, b as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants.js';
|
6
6
|
import { U as UserConfigType } from './form-config-fetcher.js';
|
@@ -452,10 +452,13 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
452
452
|
this._sortableGroup.on(CONFIG_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
|
453
453
|
}
|
454
454
|
loadUserConfig() {
|
455
|
+
if (this._applicationResourceID == undefined) {
|
456
|
+
return;
|
457
|
+
}
|
455
458
|
if (this.configManager == undefined) {
|
456
459
|
return;
|
457
460
|
}
|
458
|
-
this.configManager.fetchUserAvailableConfigs()
|
461
|
+
this.configManager.fetchUserAvailableConfigs(this._applicationResourceID)
|
459
462
|
.then((userConfig) => {
|
460
463
|
this._formConfigOptions = userConfig;
|
461
464
|
if (this._formConfigOptions == undefined) {
|
@@ -509,6 +512,9 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
509
512
|
}
|
510
513
|
}
|
511
514
|
async loadConfigByUser() {
|
515
|
+
if (this._applicationResourceID == undefined) {
|
516
|
+
return;
|
517
|
+
}
|
512
518
|
if (this.configManager == undefined) {
|
513
519
|
return;
|
514
520
|
}
|
@@ -518,10 +524,10 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
518
524
|
let config;
|
519
525
|
switch (this._optionFormConfigSelected.origin) {
|
520
526
|
case UserConfigType.DEFAULT:
|
521
|
-
config = await this.configManager.fetchDefaultConfig();
|
527
|
+
config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
|
522
528
|
break;
|
523
529
|
case UserConfigType.DEFAULT:
|
524
|
-
config = await this.configManager.fetchDefaultConfig();
|
530
|
+
config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
|
525
531
|
break;
|
526
532
|
}
|
527
533
|
if (config != undefined) {
|
@@ -937,7 +943,11 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
937
943
|
this.controlSortableGroup();
|
938
944
|
}
|
939
945
|
componentWillLoad() {
|
940
|
-
this.
|
946
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
947
|
+
this._application.getResourceID().then(resourceID => {
|
948
|
+
this._applicationResourceID = resourceID;
|
949
|
+
this.loadConfig();
|
950
|
+
});
|
941
951
|
}
|
942
952
|
componentDidLoad() {
|
943
953
|
const dataInfo = { dataUnit: this.dataUnit };
|
@@ -10,7 +10,6 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
10
|
super();
|
11
11
|
this.__registerHost();
|
12
12
|
this.snkContentCardChanged = createEvent(this, "snkContentCardChanged", 7);
|
13
|
-
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
14
13
|
this.levelPath = undefined;
|
15
14
|
this.label = undefined;
|
16
15
|
this.name = undefined;
|
@@ -78,10 +77,6 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
78
77
|
this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
|
79
78
|
}
|
80
79
|
}
|
81
|
-
handleFormItemsReady(event) {
|
82
|
-
event.stopPropagation();
|
83
|
-
this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
|
84
|
-
}
|
85
80
|
disconnectedCallback() {
|
86
81
|
if (this._dataBinder != undefined) {
|
87
82
|
this._dataBinder.onDisconnectedCallback();
|
@@ -94,7 +89,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
94
89
|
?
|
95
90
|
h("snk-form-summary", { summary: this.getCardSummary() })
|
96
91
|
:
|
97
|
-
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail)
|
92
|
+
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
|
98
93
|
}
|
99
94
|
static get style() { return snkFormViewCss; }
|
100
95
|
}, [6, "snk-form-view", {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
|
4
|
-
import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
5
4
|
import { d as defineCustomElement$5 } from './snk-config-options2.js';
|
6
5
|
import { d as defineCustomElement$4 } from './snk-field-config2.js';
|
7
6
|
import { d as defineCustomElement$3 } from './snk-form-config2.js';
|
@@ -15,7 +14,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
15
14
|
this.__registerHost();
|
16
15
|
this.exit = createEvent(this, "exit", 7);
|
17
16
|
this.actionClick = createEvent(this, "actionClick", 7);
|
18
|
-
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
19
17
|
this._dataUnit = undefined;
|
20
18
|
this._dataState = undefined;
|
21
19
|
this._showFormConfig = false;
|
@@ -23,7 +21,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
23
21
|
this.configName = undefined;
|
24
22
|
this.recordsValidator = undefined;
|
25
23
|
this.messagesBuilder = undefined;
|
26
|
-
this.resourceID = undefined;
|
27
24
|
}
|
28
25
|
/**
|
29
26
|
* Exibe a janela de configurações do formulário.
|
@@ -44,7 +41,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
44
41
|
const dataInfo = { dataUnit: this._dataUnit };
|
45
42
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
46
43
|
}
|
47
|
-
|
44
|
+
componentWillLoad() {
|
48
45
|
let parent = this._element.parentElement;
|
49
46
|
while (parent) {
|
50
47
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -66,10 +63,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
66
63
|
}
|
67
64
|
parent = parent.parentElement;
|
68
65
|
}
|
69
|
-
|
70
|
-
this.resourceID = await ResourceIDUtils.getResourceID();
|
71
|
-
}
|
72
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
|
66
|
+
this._configManager = new SnkFormConfigManager(this.configName);
|
73
67
|
this._configManager.loadConfig();
|
74
68
|
}
|
75
69
|
render() {
|
@@ -85,7 +79,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
85
79
|
"configName": [1, "config-name"],
|
86
80
|
"recordsValidator": [16],
|
87
81
|
"messagesBuilder": [1040],
|
88
|
-
"resourceID": [1, "resource-i-d"],
|
89
82
|
"_dataUnit": [32],
|
90
83
|
"_dataState": [32],
|
91
84
|
"_showFormConfig": [32],
|
@@ -25,7 +25,6 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
25
25
|
this.columns = undefined;
|
26
26
|
this.config = undefined;
|
27
27
|
this.configName = undefined;
|
28
|
-
this.resourceID = undefined;
|
29
28
|
}
|
30
29
|
/* Creation Methods */
|
31
30
|
/**
|
@@ -249,7 +248,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
249
248
|
}
|
250
249
|
}
|
251
250
|
_newConfig.columns = _newColumnConfigList;
|
252
|
-
ConfigStorage.saveGridConfig(_newConfig, this.configName
|
251
|
+
ConfigStorage.saveGridConfig(_newConfig, this.configName)
|
253
252
|
.then((savedConfig) => {
|
254
253
|
this.configChange.emit(savedConfig);
|
255
254
|
this._orderList.clearHistory();
|
@@ -476,8 +475,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
476
475
|
"application": [16],
|
477
476
|
"columns": [1040],
|
478
477
|
"config": [1040],
|
479
|
-
"configName": [1, "config-name"]
|
480
|
-
"resourceID": [1, "resource-i-d"]
|
478
|
+
"configName": [1, "config-name"]
|
481
479
|
}]);
|
482
480
|
function defineCustomElement() {
|
483
481
|
if (typeof customElements === "undefined") {
|