@sankhyalabs/sankhyablocks 8.1.0-dev.10 → 8.1.0-dev.12
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-e32e1391.js → ConfigStorage-42601579.js} +163 -51
- package/dist/cjs/{DataFetcher-d2c6ae38.js → DataFetcher-370cc8f2.js} +38 -29
- package/dist/cjs/ISave-d68ce3cd.js +8 -0
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
- package/dist/cjs/{SnkFormConfigManager-5e61b0a9.js → SnkFormConfigManager-e5a28b2e.js} +19 -21
- package/dist/cjs/{auth-fetcher-da975ac5.js → auth-fetcher-c42326e9.js} +2 -2
- package/dist/cjs/{dataunit-fetcher-58ad78a7.js → dataunit-fetcher-eab8050e.js} +1 -1
- package/dist/cjs/{form-config-fetcher-761994b9.js → form-config-fetcher-6704319c.js} +66 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-bb0bb679.js → pesquisa-fetcher-84d392c7.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +18 -11
- package/dist/cjs/snk-application.cjs.entry.js +49 -44
- package/dist/cjs/snk-attach.cjs.entry.js +7 -13
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +24 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-80a00ae4.js} +4 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +13 -12
- package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
- package/dist/cjs/snk-filter-bar.cjs.entry.js +13 -16
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -19
- package/dist/cjs/snk-form-config.cjs.entry.js +6 -17
- package/dist/cjs/snk-form.cjs.entry.js +11 -8
- package/dist/cjs/snk-grid-config.cjs.entry.js +5 -6
- package/dist/cjs/snk-grid.cjs.entry.js +13 -17
- package/dist/cjs/{snk-guides-viewer-eb0a79a4.js → snk-guides-viewer-fd785f55.js} +16 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +13 -16
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -3
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
- package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
- package/dist/collection/components/snk-application/snk-application.js +60 -65
- package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
- package/dist/collection/components/snk-crud/snk-crud.js +18 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +20 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +25 -28
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -4
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +27 -11
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
- package/dist/collection/components/snk-form/snk-form.js +24 -2
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
- package/dist/collection/components/snk-grid/snk-grid.js +27 -12
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
- package/dist/collection/lib/configs/ConfigStorage.js +33 -44
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +38 -29
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
- package/dist/collection/lib/index.js +10 -0
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
- package/dist/components/ConfigStorage.js +161 -48
- package/dist/components/DataFetcher.js +38 -29
- package/dist/components/ResourceIDUtils.js +10 -0
- package/dist/components/SnkFormConfigManager.js +17 -19
- package/dist/components/auth-fetcher.js +1 -1
- package/dist/components/form-config-fetcher.js +64 -2
- package/dist/components/snk-actions-button2.js +23 -9
- package/dist/components/snk-application2.js +134 -128
- package/dist/components/snk-attach2.js +1 -8
- package/dist/components/snk-configurator2.js +3 -1
- package/dist/components/snk-crud.js +22 -6
- package/dist/components/snk-data-unit2.js +5 -3
- package/dist/components/snk-detail-view2.js +18 -8
- package/dist/components/snk-entity-list.js +0 -4
- package/dist/components/snk-filter-bar2.js +11 -11
- package/dist/components/snk-filter-detail2.js +2 -12
- package/dist/components/snk-filter-modal-item2.js +5 -16
- package/dist/components/snk-form-config2.js +5 -15
- package/dist/components/snk-form.js +8 -2
- package/dist/components/snk-grid-config2.js +4 -2
- package/dist/components/snk-grid2.js +11 -12
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-simple-crud2.js +5 -1
- package/dist/components/snk-taskbar2.js +3 -1
- package/dist/esm/{ConfigStorage-b6aefe42.js → ConfigStorage-2915a841.js} +162 -49
- package/dist/esm/{DataFetcher-aaaff866.js → DataFetcher-0b121ffb.js} +38 -29
- package/dist/esm/ISave-4412b20c.js +8 -0
- package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
- package/dist/esm/{SnkFormConfigManager-80901f2d.js → SnkFormConfigManager-8005340f.js} +19 -21
- package/dist/esm/{auth-fetcher-7860d777.js → auth-fetcher-643f240e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-9dfcdb1d.js → dataunit-fetcher-6423d6eb.js} +1 -1
- package/dist/esm/{form-config-fetcher-4a34b86a.js → form-config-fetcher-77cdb26c.js} +65 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-01d058e6.js → pesquisa-fetcher-c5a3c564.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +18 -11
- package/dist/esm/snk-application.entry.js +49 -44
- package/dist/esm/snk-attach.entry.js +3 -9
- package/dist/esm/snk-configurator.entry.js +2 -1
- package/dist/esm/snk-crud.entry.js +24 -10
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-3ab57d1a.js} +4 -3
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +13 -12
- package/dist/esm/snk-entity-list.entry.js +0 -4
- package/dist/esm/snk-filter-bar.entry.js +13 -16
- package/dist/esm/snk-filter-detail.entry.js +2 -16
- package/dist/esm/snk-filter-modal-item.entry.js +6 -20
- package/dist/esm/snk-form-config.entry.js +7 -18
- package/dist/esm/snk-form.entry.js +11 -8
- package/dist/esm/snk-grid-config.entry.js +5 -6
- package/dist/esm/snk-grid.entry.js +13 -17
- package/dist/esm/{snk-guides-viewer-ee42eb53.js → snk-guides-viewer-43b550a2.js} +16 -7
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +13 -16
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +7 -3
- package/dist/esm/snk-taskbar.entry.js +2 -1
- package/dist/sankhyablocks/p-1108ed0e.entry.js +1 -0
- package/dist/sankhyablocks/p-18ead46b.entry.js +1 -0
- package/dist/sankhyablocks/p-1986cfa4.js +26 -0
- package/dist/sankhyablocks/p-1c7b4bad.entry.js +1 -0
- package/dist/sankhyablocks/p-48a40939.js +1 -0
- package/dist/sankhyablocks/p-508822c3.entry.js +1 -0
- package/dist/sankhyablocks/{p-85affa29.js → p-53a7ab6c.js} +1 -1
- package/dist/sankhyablocks/{p-77ecc583.entry.js → p-58b84e45.entry.js} +1 -1
- package/dist/sankhyablocks/p-688dcb4c.js +1 -0
- package/dist/sankhyablocks/{p-05bcad8a.entry.js → p-774afde8.entry.js} +1 -1
- package/dist/sankhyablocks/p-84b9208d.entry.js +1 -0
- package/dist/sankhyablocks/p-85dfb90b.entry.js +1 -0
- package/dist/sankhyablocks/p-86dda34d.js +1 -0
- package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
- package/dist/sankhyablocks/{p-bee6b5d7.js → p-9bfc7124.js} +1 -1
- package/dist/sankhyablocks/p-9d81ad53.entry.js +1 -0
- package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
- package/dist/sankhyablocks/p-a107474c.js +56 -0
- package/dist/sankhyablocks/p-a28470ae.entry.js +1 -0
- package/dist/sankhyablocks/p-b9376677.entry.js +1 -0
- package/dist/sankhyablocks/p-c7c035eb.js +1 -0
- package/dist/sankhyablocks/p-caaef934.js +1 -0
- package/dist/sankhyablocks/p-cf65dbb2.entry.js +1 -0
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
- package/dist/sankhyablocks/p-da2422ef.entry.js +11 -0
- package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
- package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
- package/dist/sankhyablocks/p-f1f5232d.entry.js +1 -0
- package/dist/sankhyablocks/{p-60791bb6.js → p-f88bdc84.js} +1 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
- package/dist/sankhyablocks/p-fcdd5761.entry.js +1 -0
- package/dist/sankhyablocks/p-fdf6b377.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
- package/dist/types/components/snk-application/snk-application.d.ts +8 -13
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -2
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
- package/dist/types/components/snk-form/snk-form.d.ts +5 -1
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
- package/dist/types/components.d.ts +99 -21
- package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
- 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 +0 -1
- package/dist/types/lib/index.d.ts +11 -0
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/filter-bar-config-fetcher-80b033ce.js +0 -155
- package/dist/cjs/resource-fetcher-95d24dff.js +0 -68
- package/dist/components/filter-bar-config-fetcher.js +0 -153
- package/dist/components/resource-fetcher.js +0 -66
- package/dist/esm/filter-bar-config-fetcher-317cb6bf.js +0 -153
- package/dist/esm/resource-fetcher-b36ac145.js +0 -66
- package/dist/sankhyablocks/p-0b64f036.entry.js +0 -1
- package/dist/sankhyablocks/p-0e97ec46.entry.js +0 -1
- package/dist/sankhyablocks/p-1b81c379.entry.js +0 -1
- package/dist/sankhyablocks/p-2dd0f891.js +0 -17
- package/dist/sankhyablocks/p-330f584a.entry.js +0 -1
- package/dist/sankhyablocks/p-35ecafcb.entry.js +0 -1
- package/dist/sankhyablocks/p-42843f0e.js +0 -1
- package/dist/sankhyablocks/p-459d4267.entry.js +0 -1
- package/dist/sankhyablocks/p-557affc8.entry.js +0 -1
- package/dist/sankhyablocks/p-564efc43.js +0 -1
- package/dist/sankhyablocks/p-6295424d.entry.js +0 -1
- package/dist/sankhyablocks/p-64c2cec3.js +0 -1
- package/dist/sankhyablocks/p-803b79d6.js +0 -1
- package/dist/sankhyablocks/p-80729c9b.entry.js +0 -11
- package/dist/sankhyablocks/p-95fa8af6.entry.js +0 -1
- package/dist/sankhyablocks/p-96c1ae78.entry.js +0 -1
- package/dist/sankhyablocks/p-b556fadc.entry.js +0 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
- package/dist/sankhyablocks/p-bf3bd954.entry.js +0 -1
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
- package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
- package/dist/sankhyablocks/p-dd1fa35d.js +0 -56
- package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
- package/dist/sankhyablocks/p-e42f1f2a.js +0 -1
- package/dist/sankhyablocks/p-f24c4bc7.entry.js +0 -1
- package/dist/sankhyablocks/p-f737f7e1.js +0 -10
- package/dist/sankhyablocks/p-fd69eab9.entry.js +0 -1
@@ -5,11 +5,15 @@ 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';
|
8
13
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
9
14
|
import { V as VIEW_MODE } from './constants.js';
|
10
15
|
import { T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
11
16
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
12
|
-
import { d as defineCustomElement$t } from './snk-actions-button2.js';
|
13
17
|
import { d as defineCustomElement$s } from './snk-attach2.js';
|
14
18
|
import { d as defineCustomElement$r } from './snk-config-options2.js';
|
15
19
|
import { d as defineCustomElement$q } from './snk-configurator2.js';
|
@@ -61,6 +65,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
61
65
|
this.messagesBuilder = undefined;
|
62
66
|
this.canEdit = true;
|
63
67
|
this.presentationMode = undefined;
|
68
|
+
this.resourceID = undefined;
|
64
69
|
this._breadcrumbItems = [];
|
65
70
|
this._guides = undefined;
|
66
71
|
this._formEditorConfigManager = undefined;
|
@@ -262,7 +267,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
262
267
|
else {
|
263
268
|
detailBranch = this.selectedGuide;
|
264
269
|
}
|
265
|
-
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}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
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}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID }));
|
266
271
|
}
|
267
272
|
else {
|
268
273
|
const cardId = this.selectedGuide.id;
|
@@ -311,7 +316,10 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
311
316
|
return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
312
317
|
}
|
313
318
|
componentWillLoad() {
|
314
|
-
|
319
|
+
if (this.resourceID == undefined) {
|
320
|
+
throw new Error("Erro interno: resourceID não informado");
|
321
|
+
}
|
322
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
|
315
323
|
this._configManager.loadConfig();
|
316
324
|
}
|
317
325
|
componentDidRender() {
|
@@ -330,7 +338,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
330
338
|
}
|
331
339
|
buildTaskBar() {
|
332
340
|
var _a;
|
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 }));
|
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, resourceID: this.resourceID }));
|
334
342
|
}
|
335
343
|
render() {
|
336
344
|
var _a, _b;
|
@@ -349,7 +357,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
349
357
|
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 ?
|
350
358
|
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) })
|
351
359
|
:
|
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) })));
|
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), resourceID: this.resourceID })));
|
353
361
|
}
|
354
362
|
static get watchers() { return {
|
355
363
|
"dataUnit": ["observeDataUnit"],
|
@@ -358,7 +366,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
358
366
|
}; }
|
359
367
|
static get style() { return snkGuidesViewerCss; }
|
360
368
|
}, [2, "snk-guides-viewer", {
|
361
|
-
"_guideBuilders": [16],
|
362
369
|
"dataUnit": [16],
|
363
370
|
"dataState": [16],
|
364
371
|
"configName": [1, "config-name"],
|
@@ -371,6 +378,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
371
378
|
"messagesBuilder": [1040],
|
372
379
|
"canEdit": [4, "can-edit"],
|
373
380
|
"presentationMode": [1, "presentation-mode"],
|
381
|
+
"resourceID": [1, "resource-i-d"],
|
374
382
|
"_breadcrumbItems": [32],
|
375
383
|
"_guides": [32],
|
376
384
|
"_formEditorConfigManager": [32],
|
@@ -593,6 +601,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
593
601
|
this.attachmentRegisterKey = undefined;
|
594
602
|
this.formConfigManager = undefined;
|
595
603
|
this.dataUnitName = undefined;
|
604
|
+
this.resourceID = undefined;
|
596
605
|
this.guideItemPath = undefined;
|
597
606
|
this.entityName = undefined;
|
598
607
|
this.label = undefined;
|
@@ -762,7 +771,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
762
771
|
}
|
763
772
|
componentWillLoad() {
|
764
773
|
this._configName = `dynaform.${this.entityName}`;
|
765
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
774
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
|
766
775
|
this.formConfigManager.loadConfig();
|
767
776
|
if (this.messagesBuilder == undefined) {
|
768
777
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -771,7 +780,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
771
780
|
render() {
|
772
781
|
this.updateLabel();
|
773
782
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
774
|
-
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, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, 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) }))))));
|
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), 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, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, 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, resourceID: this.resourceID }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
775
784
|
}
|
776
785
|
static get watchers() { return {
|
777
786
|
"dataState": ["observerDataState"]
|
@@ -780,6 +789,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
780
789
|
}, [2, "snk-detail-view", {
|
781
790
|
"formConfigManager": [1040],
|
782
791
|
"dataUnitName": [1, "data-unit-name"],
|
792
|
+
"resourceID": [1, "resource-i-d"],
|
783
793
|
"guideItemPath": [16],
|
784
794
|
"entityName": [1, "entity-name"],
|
785
795
|
"label": [1],
|
@@ -8,7 +8,6 @@ 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);
|
12
11
|
this._searchValue = undefined;
|
13
12
|
this._ezListSource = [];
|
14
13
|
this.config = undefined;
|
@@ -17,7 +16,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
17
16
|
}
|
18
17
|
async reloadList() {
|
19
18
|
this.loadListSource();
|
20
|
-
this.saveConfig.emit(this.config);
|
21
19
|
}
|
22
20
|
observeConfig() {
|
23
21
|
var _a, _b;
|
@@ -33,7 +31,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
33
31
|
}
|
34
32
|
});
|
35
33
|
this.config = ObjectUtils.copy(configCopy);
|
36
|
-
this.saveConfig.emit(this.config);
|
37
34
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
38
35
|
}
|
39
36
|
loadListSource() {
|
@@ -90,7 +87,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
90
87
|
}
|
91
88
|
] });
|
92
89
|
this.loadListSource();
|
93
|
-
this.saveConfig.emit(this.config);
|
94
90
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
95
91
|
}
|
96
92
|
}
|
@@ -208,6 +208,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
208
208
|
};
|
209
209
|
this.dataUnit = undefined;
|
210
210
|
this.configName = undefined;
|
211
|
+
this.resourceID = undefined;
|
211
212
|
this.filterConfig = undefined;
|
212
213
|
this.messagesBuilder = undefined;
|
213
214
|
this.allowDefault = undefined;
|
@@ -287,7 +288,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
287
288
|
}
|
288
289
|
if (this._configUpdated) {
|
289
290
|
this._configUpdated = false;
|
290
|
-
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
|
291
|
+
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
291
292
|
}
|
292
293
|
}
|
293
294
|
/**
|
@@ -403,15 +404,13 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
403
404
|
}
|
404
405
|
loadConfigFromStorage() {
|
405
406
|
return new Promise(accept => {
|
406
|
-
ConfigStorage.
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
414
|
-
});
|
407
|
+
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { 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);
|
415
414
|
});
|
416
415
|
});
|
417
416
|
}
|
@@ -496,7 +495,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
496
495
|
return undefined;
|
497
496
|
}
|
498
497
|
if (this.showPersonalizedFilter) {
|
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 });
|
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, resourceID: this.resourceID });
|
500
499
|
}
|
501
500
|
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" }))));
|
502
501
|
}
|
@@ -508,6 +507,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
508
507
|
}, [2, "snk-filter-bar", {
|
509
508
|
"dataUnit": [1040],
|
510
509
|
"configName": [1, "config-name"],
|
510
|
+
"resourceID": [1, "resource-i-d"],
|
511
511
|
"filterConfig": [1040],
|
512
512
|
"messagesBuilder": [1040],
|
513
513
|
"allowDefault": [32],
|
@@ -1,8 +1,7 @@
|
|
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 {
|
5
|
-
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher.js';
|
4
|
+
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
6
5
|
import { E as EPresentationMode } from './presentationMode.js';
|
7
6
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
8
7
|
|
@@ -28,7 +27,6 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
28
27
|
}
|
29
28
|
componentDidLoad() {
|
30
29
|
if (this._element) {
|
31
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
32
30
|
ElementIDUtils.addIDInfo(this._element);
|
33
31
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
34
32
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
@@ -146,20 +144,12 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
146
144
|
this.config = ObjectUtils.copy(configCopy);
|
147
145
|
}
|
148
146
|
}
|
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
|
-
}
|
157
147
|
componentWillLoad() {
|
158
148
|
this.originalConfig = ObjectUtils.copy(this.config);
|
159
149
|
}
|
160
150
|
render() {
|
161
151
|
const { tag: CustomElement, props } = this.getContentEditor();
|
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,
|
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" }))));
|
163
153
|
}
|
164
154
|
get _element() { return this; }
|
165
155
|
static get watchers() { return {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { ElementIDUtils,
|
2
|
+
import { ElementIDUtils, 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,14 +23,13 @@ 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;
|
26
27
|
}
|
27
28
|
observeFilterItem(newValue) {
|
28
29
|
var _a, _b;
|
29
30
|
this._editor && (this._editor["config"] = newValue);
|
30
31
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
31
32
|
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();
|
34
33
|
}
|
35
34
|
getContentEditorConfig() {
|
36
35
|
const props = { presentationMode: EPresentationMode.MODAL };
|
@@ -72,11 +71,10 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
72
71
|
else {
|
73
72
|
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
|
74
73
|
}
|
75
|
-
this.saveConfig();
|
76
74
|
}
|
77
75
|
handleDeleteFilter(filter, filterItemType) {
|
78
76
|
if (filterItemType === FilterItemType.PERSONALIZED) {
|
79
|
-
ConfigStorage.removePersonalizedFilter(filter, this.configName);
|
77
|
+
ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
|
80
78
|
}
|
81
79
|
}
|
82
80
|
componentDidLoad() {
|
@@ -84,7 +82,6 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
84
82
|
ElementIDUtils.addIDInfo(this._element);
|
85
83
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
86
84
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
|
87
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
88
85
|
}
|
89
86
|
}
|
90
87
|
buildRightSlot(item) {
|
@@ -101,15 +98,6 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
101
98
|
const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType$1;
|
102
99
|
return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
103
100
|
}
|
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
|
-
}
|
113
101
|
render() {
|
114
102
|
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
115
103
|
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)))));
|
@@ -121,7 +109,8 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
121
109
|
static get style() { return snkFilterModalItemCss; }
|
122
110
|
}, [0, "snk-filter-modal-item", {
|
123
111
|
"filterItem": [1040],
|
124
|
-
"configName": [1025, "config-name"]
|
112
|
+
"configName": [1025, "config-name"],
|
113
|
+
"resourceID": [1, "resource-i-d"]
|
125
114
|
}]);
|
126
115
|
function defineCustomElement() {
|
127
116
|
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
|
3
|
+
import { ObjectUtils, ElementIDUtils, ArrayUtils } 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,13 +452,10 @@ 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
|
-
}
|
458
455
|
if (this.configManager == undefined) {
|
459
456
|
return;
|
460
457
|
}
|
461
|
-
this.configManager.fetchUserAvailableConfigs(
|
458
|
+
this.configManager.fetchUserAvailableConfigs()
|
462
459
|
.then((userConfig) => {
|
463
460
|
this._formConfigOptions = userConfig;
|
464
461
|
if (this._formConfigOptions == undefined) {
|
@@ -512,9 +509,6 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
512
509
|
}
|
513
510
|
}
|
514
511
|
async loadConfigByUser() {
|
515
|
-
if (this._applicationResourceID == undefined) {
|
516
|
-
return;
|
517
|
-
}
|
518
512
|
if (this.configManager == undefined) {
|
519
513
|
return;
|
520
514
|
}
|
@@ -524,10 +518,10 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
524
518
|
let config;
|
525
519
|
switch (this._optionFormConfigSelected.origin) {
|
526
520
|
case UserConfigType.DEFAULT:
|
527
|
-
config = await this.configManager.fetchDefaultConfig(
|
521
|
+
config = await this.configManager.fetchDefaultConfig();
|
528
522
|
break;
|
529
523
|
case UserConfigType.DEFAULT:
|
530
|
-
config = await this.configManager.fetchDefaultConfig(
|
524
|
+
config = await this.configManager.fetchDefaultConfig();
|
531
525
|
break;
|
532
526
|
}
|
533
527
|
if (config != undefined) {
|
@@ -943,11 +937,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
943
937
|
this.controlSortableGroup();
|
944
938
|
}
|
945
939
|
componentWillLoad() {
|
946
|
-
this.
|
947
|
-
this._application.getResourceID().then(resourceID => {
|
948
|
-
this._applicationResourceID = resourceID;
|
949
|
-
this.loadConfig();
|
950
|
-
});
|
940
|
+
this.loadConfig();
|
951
941
|
}
|
952
942
|
componentDidLoad() {
|
953
943
|
const dataInfo = { dataUnit: this.dataUnit };
|
@@ -1,6 +1,7 @@
|
|
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';
|
4
5
|
import { d as defineCustomElement$5 } from './snk-config-options2.js';
|
5
6
|
import { d as defineCustomElement$4 } from './snk-field-config2.js';
|
6
7
|
import { d as defineCustomElement$3 } from './snk-form-config2.js';
|
@@ -22,6 +23,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
22
23
|
this.configName = undefined;
|
23
24
|
this.recordsValidator = undefined;
|
24
25
|
this.messagesBuilder = undefined;
|
26
|
+
this.resourceID = undefined;
|
25
27
|
}
|
26
28
|
/**
|
27
29
|
* Exibe a janela de configurações do formulário.
|
@@ -42,7 +44,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
42
44
|
const dataInfo = { dataUnit: this._dataUnit };
|
43
45
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
44
46
|
}
|
45
|
-
componentWillLoad() {
|
47
|
+
async componentWillLoad() {
|
46
48
|
let parent = this._element.parentElement;
|
47
49
|
while (parent) {
|
48
50
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -64,7 +66,10 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
64
66
|
}
|
65
67
|
parent = parent.parentElement;
|
66
68
|
}
|
67
|
-
this.
|
69
|
+
if (this.resourceID == undefined) {
|
70
|
+
this.resourceID = await ResourceIDUtils.getResourceID();
|
71
|
+
}
|
72
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
|
68
73
|
this._configManager.loadConfig();
|
69
74
|
}
|
70
75
|
render() {
|
@@ -80,6 +85,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
80
85
|
"configName": [1, "config-name"],
|
81
86
|
"recordsValidator": [16],
|
82
87
|
"messagesBuilder": [1040],
|
88
|
+
"resourceID": [1, "resource-i-d"],
|
83
89
|
"_dataUnit": [32],
|
84
90
|
"_dataState": [32],
|
85
91
|
"_showFormConfig": [32],
|
@@ -25,6 +25,7 @@ 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;
|
28
29
|
}
|
29
30
|
/* Creation Methods */
|
30
31
|
/**
|
@@ -248,7 +249,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
248
249
|
}
|
249
250
|
}
|
250
251
|
_newConfig.columns = _newColumnConfigList;
|
251
|
-
ConfigStorage.saveGridConfig(_newConfig, this.configName)
|
252
|
+
ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
|
252
253
|
.then((savedConfig) => {
|
253
254
|
this.configChange.emit(savedConfig);
|
254
255
|
this._orderList.clearHistory();
|
@@ -475,7 +476,8 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
475
476
|
"application": [16],
|
476
477
|
"columns": [1040],
|
477
478
|
"config": [1040],
|
478
|
-
"configName": [1, "config-name"]
|
479
|
+
"configName": [1, "config-name"],
|
480
|
+
"resourceID": [1, "resource-i-d"]
|
479
481
|
}]);
|
480
482
|
function defineCustomElement() {
|
481
483
|
if (typeof customElements === "undefined") {
|
@@ -50,6 +50,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
50
50
|
this._popUpGridConfig = false;
|
51
51
|
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
52
52
|
this.configName = undefined;
|
53
|
+
this.resourceID = undefined;
|
53
54
|
this.selectionToastConfig = undefined;
|
54
55
|
this.actionsList = undefined;
|
55
56
|
this.isDetail = undefined;
|
@@ -108,20 +109,17 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
108
109
|
this._gridConfig = config;
|
109
110
|
}
|
110
111
|
loadConfig() {
|
111
|
-
ConfigStorage.
|
112
|
-
.then((
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
.catch((error) => {
|
118
|
-
console.warn(error);
|
119
|
-
});
|
112
|
+
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
113
|
+
.then((config) => {
|
114
|
+
this.setGridConfig(config);
|
115
|
+
})
|
116
|
+
.catch((error) => {
|
117
|
+
console.warn(error);
|
120
118
|
});
|
121
119
|
}
|
122
120
|
gridConfigChangeHandler(evt) {
|
123
121
|
const config = evt.detail;
|
124
|
-
ConfigStorage.saveGridConfig(config, this.configName);
|
122
|
+
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
125
123
|
evt.stopPropagation();
|
126
124
|
}
|
127
125
|
modalConfigChangeHandler(evt) {
|
@@ -329,14 +327,15 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
329
327
|
if (!this._dataUnit) {
|
330
328
|
return undefined;
|
331
329
|
}
|
332
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
333
|
-
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
330
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
331
|
+
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList, resourceID: this.resourceID })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
334
332
|
}
|
335
333
|
get _element() { return this; }
|
336
334
|
static get style() { return snkGridCss; }
|
337
335
|
}, [6, "snk-grid", {
|
338
336
|
"columnFilterDataSource": [1040],
|
339
337
|
"configName": [1, "config-name"],
|
338
|
+
"resourceID": [1, "resource-i-d"],
|
340
339
|
"selectionToastConfig": [16],
|
341
340
|
"actionsList": [16],
|
342
341
|
"isDetail": [4, "is-detail"],
|
@@ -41,6 +41,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
41
41
|
this.entityUri = undefined;
|
42
42
|
this.filterId = undefined;
|
43
43
|
this.configName = undefined;
|
44
|
+
this.resourceID = undefined;
|
44
45
|
}
|
45
46
|
/*
|
46
47
|
* Cria um novo filtro se não houver nenhum filtro existente
|
@@ -77,17 +78,15 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
77
78
|
this._filterAssistent = ObjectUtils.copy(newPersonalizedFilter);
|
78
79
|
}
|
79
80
|
loadFilter(newValue, oldValue) {
|
80
|
-
if (newValue == null || oldValue == newValue) {
|
81
|
+
if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
|
81
82
|
return;
|
82
83
|
}
|
83
|
-
ConfigStorage.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
90
|
-
});
|
84
|
+
ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
|
85
|
+
.then((resp) => {
|
86
|
+
const personalizedFilter = this.addLabelToItems(resp);
|
87
|
+
this._filterAssistent = personalizedFilter;
|
88
|
+
this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
|
89
|
+
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
91
90
|
});
|
92
91
|
}
|
93
92
|
componentWillLoad() {
|
@@ -112,7 +111,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
112
111
|
return this._application.messagesBuilder.getMessage(key, params);
|
113
112
|
}
|
114
113
|
saveFilter() {
|
115
|
-
ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.configName).then((personalizedFilter) => {
|
114
|
+
ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName).then((personalizedFilter) => {
|
116
115
|
this._elButtonSave.enabled = false;
|
117
116
|
const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
|
118
117
|
ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
|
@@ -123,7 +122,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
123
122
|
});
|
124
123
|
}
|
125
124
|
removeFilter() {
|
126
|
-
ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.configName);
|
125
|
+
ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
|
127
126
|
}
|
128
127
|
hasChangesToSave() {
|
129
128
|
return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
|
@@ -301,6 +300,7 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
301
300
|
"entityUri": [1025, "entity-uri"],
|
302
301
|
"filterId": [1025, "filter-id"],
|
303
302
|
"configName": [1025, "config-name"],
|
303
|
+
"resourceID": [1, "resource-i-d"],
|
304
304
|
"_filterAssistentMode": [32],
|
305
305
|
"_filterAssistent": [32],
|
306
306
|
"createPersonalizedFilter": [64]
|
@@ -5,8 +5,12 @@ import { T as TaskbarElement, d as defineCustomElement$1 } from './snk-taskbar2.
|
|
5
5
|
import './DataFetcher.js';
|
6
6
|
import './pesquisa-fetcher.js';
|
7
7
|
import { P as PresentationMode } from './index2.js';
|
8
|
-
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
9
8
|
import { d as defineCustomElement$5 } 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
|
+
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
10
14
|
import { d as defineCustomElement$4 } from './snk-data-exporter2.js';
|
11
15
|
import { d as defineCustomElement$3 } from './snk-data-unit2.js';
|
12
16
|
import { d as defineCustomElement$2 } from './snk-exporter-email-sender2.js';
|
@@ -145,6 +145,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
145
145
|
};
|
146
146
|
this._permissions = undefined;
|
147
147
|
this.configName = undefined;
|
148
|
+
this.resourceID = undefined;
|
148
149
|
this.buttons = undefined;
|
149
150
|
this.customButtons = undefined;
|
150
151
|
this.actionsList = undefined;
|
@@ -286,7 +287,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
286
287
|
componentWillLoad() {
|
287
288
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
288
289
|
if (this._application) {
|
289
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
290
|
+
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
290
291
|
}
|
291
292
|
else {
|
292
293
|
this._permissions = {};
|
@@ -330,6 +331,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
330
331
|
static get style() { return snkTaskbarCss; }
|
331
332
|
}, [6, "snk-taskbar", {
|
332
333
|
"configName": [1, "config-name"],
|
334
|
+
"resourceID": [1, "resource-i-d"],
|
333
335
|
"buttons": [1],
|
334
336
|
"customButtons": [16],
|
335
337
|
"actionsList": [16],
|