@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-12397f18.js → ConfigStorage-e9d7fa82.js} +51 -163
- package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-39b63a1e.js} +29 -67
- package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-2f8eccd9.js} +21 -19
- package/dist/cjs/{auth-fetcher-319a4cb2.js → auth-fetcher-d407c31c.js} +2 -2
- package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-15a7cc88.js} +1 -1
- package/dist/cjs/filter-bar-config-fetcher-24548cec.js +155 -0
- package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-ab3ce222.js} +3 -66
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-96c042aa.js} +1 -1
- package/dist/cjs/resource-fetcher-64102551.js +68 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +11 -18
- package/dist/cjs/snk-application.cjs.entry.js +44 -49
- package/dist/cjs/snk-attach.cjs.entry.js +13 -7
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -2
- package/dist/cjs/snk-crud.cjs.entry.js +10 -25
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-e89e07bd.js} +3 -4
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +12 -14
- package/dist/cjs/snk-entity-list.cjs.entry.js +4 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -14
- package/dist/cjs/snk-filter-detail.cjs.entry.js +15 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +19 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -6
- package/dist/cjs/snk-form.cjs.entry.js +8 -12
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
- package/dist/cjs/snk-grid.cjs.entry.js +20 -17
- package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8518c61b.js} +7 -17
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +16 -13
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +72 -20
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -2
- package/dist/collection/components/snk-actions-button/actions/index.js +4 -3
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +4 -8
- package/dist/collection/components/snk-application/snk-application.js +65 -60
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -19
- package/dist/collection/components/snk-crud/snk-crud.js +6 -40
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -42
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +28 -47
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +4 -21
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +12 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +16 -21
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -28
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +19 -17
- package/dist/collection/components/snk-form/snk-form.js +2 -46
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +15 -5
- package/dist/collection/components/snk-grid/snk-grid.js +15 -51
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +1 -19
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +12 -28
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +0 -22
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -19
- package/dist/collection/lib/configs/ConfigStorage.js +44 -33
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +59 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -38
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +24 -0
- package/dist/collection/lib/index.js +0 -10
- package/dist/collection/lib/utils/urlutils.js +0 -29
- package/dist/components/ConfigStorage.js +48 -161
- package/dist/components/DataFetcher.js +29 -67
- package/dist/components/SnkFormConfigManager.js +19 -17
- package/dist/components/auth-fetcher.js +1 -1
- package/dist/components/filter-bar-config-fetcher.js +153 -0
- package/dist/components/form-config-fetcher.js +2 -64
- package/dist/components/resource-fetcher.js +66 -0
- package/dist/components/snk-actions-button2.js +9 -23
- package/dist/components/snk-application2.js +128 -134
- package/dist/components/snk-attach2.js +8 -1
- package/dist/components/snk-configurator2.js +1 -3
- package/dist/components/snk-crud.js +6 -23
- package/dist/components/snk-data-unit2.js +3 -5
- package/dist/components/snk-detail-view2.js +8 -20
- package/dist/components/snk-entity-list.js +4 -0
- package/dist/components/snk-filter-bar2.js +12 -12
- package/dist/components/snk-filter-detail2.js +12 -2
- package/dist/components/snk-filter-modal-item2.js +16 -5
- package/dist/components/snk-form-config2.js +15 -5
- package/dist/components/snk-form-view2.js +1 -6
- package/dist/components/snk-form.js +2 -9
- package/dist/components/snk-grid-config2.js +2 -4
- package/dist/components/snk-grid2.js +16 -17
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-simple-crud2.js +60 -8
- package/dist/components/snk-taskbar2.js +1 -3
- package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-1090289a.js} +49 -162
- package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-a4ed43e7.js} +29 -67
- package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-de537eca.js} +21 -19
- package/dist/esm/{auth-fetcher-6d9664b7.js → auth-fetcher-c53e0d6c.js} +1 -1
- package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-8d0bfa4a.js} +1 -1
- package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +153 -0
- package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-4065db9a.js} +3 -65
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-7460b876.js} +1 -1
- package/dist/esm/resource-fetcher-45a70066.js +66 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +11 -18
- package/dist/esm/snk-application.entry.js +44 -49
- package/dist/esm/snk-attach.entry.js +9 -3
- package/dist/esm/snk-configurator.entry.js +1 -2
- package/dist/esm/snk-crud.entry.js +10 -25
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-8c4d944d.js} +3 -4
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +12 -14
- package/dist/esm/snk-entity-list.entry.js +4 -0
- package/dist/esm/snk-filter-bar.entry.js +17 -14
- package/dist/esm/snk-filter-detail.entry.js +16 -2
- package/dist/esm/snk-filter-modal-item.entry.js +20 -6
- package/dist/esm/snk-form-config.entry.js +18 -7
- package/dist/esm/snk-form-view.entry.js +1 -6
- package/dist/esm/snk-form.entry.js +8 -12
- package/dist/esm/snk-grid-config.entry.js +6 -5
- package/dist/esm/snk-grid.entry.js +20 -17
- package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-cdecff6e.js} +7 -17
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +16 -13
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +62 -10
- package/dist/esm/snk-taskbar.entry.js +1 -2
- package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-0848ee4d.entry.js} +1 -1
- package/dist/sankhyablocks/p-0bd9c412.js +1 -0
- package/dist/sankhyablocks/p-0fb83448.js +1 -0
- package/dist/sankhyablocks/p-10b2aedc.entry.js +1 -0
- package/dist/sankhyablocks/p-1f63dcd4.entry.js +1 -0
- package/dist/sankhyablocks/p-216b2102.entry.js +1 -0
- package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
- package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
- package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
- package/dist/sankhyablocks/p-50c13cc8.entry.js +1 -0
- package/dist/sankhyablocks/p-52c6b2e7.js +1 -0
- package/dist/sankhyablocks/p-564efc43.js +1 -0
- package/dist/sankhyablocks/p-5994af77.js +56 -0
- package/dist/sankhyablocks/p-6bb904bb.entry.js +1 -0
- package/dist/sankhyablocks/p-6e06175e.entry.js +1 -0
- package/dist/sankhyablocks/p-6f0795c8.entry.js +1 -0
- package/dist/sankhyablocks/p-7588f006.entry.js +1 -0
- package/dist/sankhyablocks/p-847e6c20.js +17 -0
- package/dist/sankhyablocks/p-8f3652bf.entry.js +11 -0
- package/dist/sankhyablocks/p-9471cbc9.entry.js +1 -0
- package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
- package/dist/sankhyablocks/p-a42dd503.entry.js +1 -0
- package/dist/sankhyablocks/p-b04fb9d4.js +1 -0
- package/dist/sankhyablocks/{p-2d333d22.js → p-b978da60.js} +1 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +1 -0
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +1 -0
- package/dist/sankhyablocks/p-c6380ea2.entry.js +1 -0
- package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
- package/dist/sankhyablocks/p-d7c7a289.entry.js +1 -0
- package/dist/sankhyablocks/p-de69b4b0.entry.js +1 -0
- package/dist/sankhyablocks/p-f3b7b69e.js +10 -0
- package/dist/sankhyablocks/p-f7eded3a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff7383b0.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -2
- package/dist/types/components/snk-application/snk-application.d.ts +13 -8
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +0 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -5
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -8
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +0 -5
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +2 -9
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -4
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +4 -5
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +4 -5
- package/dist/types/components/snk-form/snk-form.d.ts +1 -9
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +2 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -5
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +0 -4
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +1 -5
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -4
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
- package/dist/types/components.d.ts +21 -125
- package/dist/types/lib/configs/ConfigStorage.d.ts +13 -11
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +0 -11
- package/dist/types/lib/utils/urlutils.d.ts +0 -14
- package/package.json +2 -2
- package/dist/cjs/ISave-d68ce3cd.js +0 -8
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +0 -12
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
- package/dist/components/ResourceIDUtils.js +0 -10
- package/dist/esm/ISave-4412b20c.js +0 -8
- package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
- package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
- package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
- package/dist/sankhyablocks/p-41e897f1.js +0 -56
- package/dist/sankhyablocks/p-48a40939.js +0 -1
- package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
- package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
- package/dist/sankhyablocks/p-688dcb4c.js +0 -1
- package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
- package/dist/sankhyablocks/p-787071a8.js +0 -1
- package/dist/sankhyablocks/p-8481bb59.entry.js +0 -1
- package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
- package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
- package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
- package/dist/sankhyablocks/p-9e7d65a4.js +0 -1
- package/dist/sankhyablocks/p-a52a6c9d.js +0 -26
- package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
- package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
- package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
- package/dist/sankhyablocks/p-e086cc2a.entry.js +0 -1
- package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
- package/dist/sankhyablocks/p-ed41b38c.js +0 -1
- package/dist/sankhyablocks/p-ed705cbb.entry.js +0 -1
- package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
- package/dist/sankhyablocks/p-f74fe358.js +0 -1
- package/dist/sankhyablocks/p-f91e0c5d.entry.js +0 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +0 -3
|
@@ -17,7 +17,6 @@ export class SnkCrud {
|
|
|
17
17
|
this.attachmentRegisterKey = undefined;
|
|
18
18
|
this._currentViewMode = VIEW_MODE.GRID;
|
|
19
19
|
this._canEdit = undefined;
|
|
20
|
-
this._resourceID = undefined;
|
|
21
20
|
this.configName = undefined;
|
|
22
21
|
this.selectionToastConfig = undefined;
|
|
23
22
|
this.showActionButtons = false;
|
|
@@ -112,7 +111,7 @@ export class SnkCrud {
|
|
|
112
111
|
}
|
|
113
112
|
componentWillLoad() {
|
|
114
113
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
115
|
-
application.hasAccess(AutorizationType.UPDATE
|
|
114
|
+
application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
|
116
115
|
let parent = this._element.parentElement;
|
|
117
116
|
while (parent) {
|
|
118
117
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
@@ -124,11 +123,11 @@ export class SnkCrud {
|
|
|
124
123
|
if (!this._dataUnit) {
|
|
125
124
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
126
125
|
this._dataUnit = evt.detail;
|
|
127
|
-
this.initDataUnit(
|
|
126
|
+
this.initDataUnit();
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
129
|
else {
|
|
131
|
-
this.initDataUnit(
|
|
130
|
+
this.initDataUnit();
|
|
132
131
|
}
|
|
133
132
|
this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
|
|
134
133
|
this._dataState = dataState;
|
|
@@ -144,18 +143,11 @@ export class SnkCrud {
|
|
|
144
143
|
this.configName = application.configName;
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
|
-
|
|
146
|
+
initDataUnit() {
|
|
148
147
|
this.addDataElementID();
|
|
149
148
|
if (!this.messagesBuilder) {
|
|
150
149
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
|
151
150
|
}
|
|
152
|
-
if (this._resourceID == undefined) {
|
|
153
|
-
//Tenta pegar o resourceID do snkDataUnit;
|
|
154
|
-
this._resourceID = this._snkDataUnit.resourceID;
|
|
155
|
-
if (this._resourceID == undefined) {
|
|
156
|
-
this._resourceID = await application.getResourceID();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
151
|
}
|
|
160
152
|
handleConfiguratorEvent(evt, type) {
|
|
161
153
|
evt.stopImmediatePropagation();
|
|
@@ -166,11 +158,8 @@ export class SnkCrud {
|
|
|
166
158
|
this.configuratorCancel.emit();
|
|
167
159
|
}
|
|
168
160
|
render() {
|
|
169
|
-
if (this._resourceID == undefined) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
161
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
173
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit
|
|
162
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
|
174
163
|
}
|
|
175
164
|
static get is() { return "snk-crud"; }
|
|
176
165
|
static get encapsulation() { return "scoped"; }
|
|
@@ -415,8 +404,7 @@ export class SnkCrud {
|
|
|
415
404
|
"_dataState": {},
|
|
416
405
|
"attachmentRegisterKey": {},
|
|
417
406
|
"_currentViewMode": {},
|
|
418
|
-
"_canEdit": {}
|
|
419
|
-
"_resourceID": {}
|
|
407
|
+
"_canEdit": {}
|
|
420
408
|
};
|
|
421
409
|
}
|
|
422
410
|
static get events() {
|
|
@@ -465,28 +453,6 @@ export class SnkCrud {
|
|
|
465
453
|
"resolved": "any",
|
|
466
454
|
"references": {}
|
|
467
455
|
}
|
|
468
|
-
}, {
|
|
469
|
-
"method": "formItemsReady",
|
|
470
|
-
"name": "formItemsReady",
|
|
471
|
-
"bubbles": true,
|
|
472
|
-
"cancelable": true,
|
|
473
|
-
"composed": true,
|
|
474
|
-
"docs": {
|
|
475
|
-
"tags": [],
|
|
476
|
-
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
|
477
|
-
},
|
|
478
|
-
"complexType": {
|
|
479
|
-
"original": "Array<HTMLElement>",
|
|
480
|
-
"resolved": "HTMLElement[]",
|
|
481
|
-
"references": {
|
|
482
|
-
"Array": {
|
|
483
|
-
"location": "global"
|
|
484
|
-
},
|
|
485
|
-
"HTMLElement": {
|
|
486
|
-
"location": "global"
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
456
|
}];
|
|
491
457
|
}
|
|
492
458
|
static get methods() {
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
|
@@ -14,7 +14,6 @@ export class SnkDetailView {
|
|
|
14
14
|
this.attachmentRegisterKey = undefined;
|
|
15
15
|
this.formConfigManager = undefined;
|
|
16
16
|
this.dataUnitName = undefined;
|
|
17
|
-
this.resourceID = undefined;
|
|
18
17
|
this.guideItemPath = undefined;
|
|
19
18
|
this.entityName = undefined;
|
|
20
19
|
this.label = undefined;
|
|
@@ -184,7 +183,7 @@ export class SnkDetailView {
|
|
|
184
183
|
}
|
|
185
184
|
componentWillLoad() {
|
|
186
185
|
this._configName = `dynaform.${this.entityName}`;
|
|
187
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName,
|
|
186
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
|
188
187
|
this.formConfigManager.loadConfig();
|
|
189
188
|
if (this.messagesBuilder == undefined) {
|
|
190
189
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
@@ -193,7 +192,7 @@ export class SnkDetailView {
|
|
|
193
192
|
render() {
|
|
194
193
|
this.updateLabel();
|
|
195
194
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
|
196
|
-
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
|
|
195
|
+
return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
|
197
196
|
}
|
|
198
197
|
static get is() { return "snk-detail-view"; }
|
|
199
198
|
static get encapsulation() { return "scoped"; }
|
|
@@ -246,23 +245,6 @@ export class SnkDetailView {
|
|
|
246
245
|
"attribute": "data-unit-name",
|
|
247
246
|
"reflect": false
|
|
248
247
|
},
|
|
249
|
-
"resourceID": {
|
|
250
|
-
"type": "string",
|
|
251
|
-
"mutable": false,
|
|
252
|
-
"complexType": {
|
|
253
|
-
"original": "string",
|
|
254
|
-
"resolved": "string",
|
|
255
|
-
"references": {}
|
|
256
|
-
},
|
|
257
|
-
"required": false,
|
|
258
|
-
"optional": false,
|
|
259
|
-
"docs": {
|
|
260
|
-
"tags": [],
|
|
261
|
-
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
|
262
|
-
},
|
|
263
|
-
"attribute": "resource-i-d",
|
|
264
|
-
"reflect": false
|
|
265
|
-
},
|
|
266
248
|
"guideItemPath": {
|
|
267
249
|
"type": "unknown",
|
|
268
250
|
"mutable": false,
|
|
@@ -480,28 +462,6 @@ export class SnkDetailView {
|
|
|
480
462
|
"resolved": "string",
|
|
481
463
|
"references": {}
|
|
482
464
|
}
|
|
483
|
-
}, {
|
|
484
|
-
"method": "formItemsReady",
|
|
485
|
-
"name": "formItemsReady",
|
|
486
|
-
"bubbles": true,
|
|
487
|
-
"cancelable": true,
|
|
488
|
-
"composed": true,
|
|
489
|
-
"docs": {
|
|
490
|
-
"tags": [],
|
|
491
|
-
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
|
492
|
-
},
|
|
493
|
-
"complexType": {
|
|
494
|
-
"original": "Array<HTMLElement>",
|
|
495
|
-
"resolved": "HTMLElement[]",
|
|
496
|
-
"references": {
|
|
497
|
-
"Array": {
|
|
498
|
-
"location": "global"
|
|
499
|
-
},
|
|
500
|
-
"HTMLElement": {
|
|
501
|
-
"location": "global"
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
465
|
}];
|
|
506
466
|
}
|
|
507
467
|
static get methods() {
|
|
@@ -70,10 +70,6 @@ export class SnkFormView {
|
|
|
70
70
|
this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
handleFormItemsReady(event) {
|
|
74
|
-
event.stopPropagation();
|
|
75
|
-
this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
|
|
76
|
-
}
|
|
77
73
|
disconnectedCallback() {
|
|
78
74
|
if (this._dataBinder != undefined) {
|
|
79
75
|
this._dataBinder.onDisconnectedCallback();
|
|
@@ -86,7 +82,7 @@ export class SnkFormView {
|
|
|
86
82
|
?
|
|
87
83
|
h("snk-form-summary", { summary: this.getCardSummary() })
|
|
88
84
|
:
|
|
89
|
-
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail)
|
|
85
|
+
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
|
|
90
86
|
}
|
|
91
87
|
static get is() { return "snk-form-view"; }
|
|
92
88
|
static get encapsulation() { return "scoped"; }
|
|
@@ -355,28 +351,6 @@ export class SnkFormView {
|
|
|
355
351
|
}
|
|
356
352
|
}
|
|
357
353
|
}
|
|
358
|
-
}, {
|
|
359
|
-
"method": "formItemsReady",
|
|
360
|
-
"name": "formItemsReady",
|
|
361
|
-
"bubbles": true,
|
|
362
|
-
"cancelable": true,
|
|
363
|
-
"composed": true,
|
|
364
|
-
"docs": {
|
|
365
|
-
"tags": [],
|
|
366
|
-
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
|
367
|
-
},
|
|
368
|
-
"complexType": {
|
|
369
|
-
"original": "Array<HTMLElement>",
|
|
370
|
-
"resolved": "HTMLElement[]",
|
|
371
|
-
"references": {
|
|
372
|
-
"Array": {
|
|
373
|
-
"location": "global"
|
|
374
|
-
},
|
|
375
|
-
"HTMLElement": {
|
|
376
|
-
"location": "global"
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
354
|
}];
|
|
381
355
|
}
|
|
382
356
|
static get methods() {
|
|
@@ -23,7 +23,6 @@ export class SnkGuidesViewer {
|
|
|
23
23
|
this.messagesBuilder = undefined;
|
|
24
24
|
this.canEdit = true;
|
|
25
25
|
this.presentationMode = undefined;
|
|
26
|
-
this.resourceID = undefined;
|
|
27
26
|
this._breadcrumbItems = [];
|
|
28
27
|
this._guides = undefined;
|
|
29
28
|
this._formEditorConfigManager = undefined;
|
|
@@ -225,7 +224,7 @@ export class SnkGuidesViewer {
|
|
|
225
224
|
else {
|
|
226
225
|
detailBranch = this.selectedGuide;
|
|
227
226
|
}
|
|
228
|
-
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)
|
|
227
|
+
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) }));
|
|
229
228
|
}
|
|
230
229
|
else {
|
|
231
230
|
const cardId = this.selectedGuide.id;
|
|
@@ -274,10 +273,7 @@ export class SnkGuidesViewer {
|
|
|
274
273
|
return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
275
274
|
}
|
|
276
275
|
componentWillLoad() {
|
|
277
|
-
|
|
278
|
-
throw new Error("Erro interno: resourceID não informado");
|
|
279
|
-
}
|
|
280
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
|
|
276
|
+
this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
|
|
281
277
|
this._configManager.loadConfig();
|
|
282
278
|
}
|
|
283
279
|
componentDidRender() {
|
|
@@ -296,7 +292,7 @@ export class SnkGuidesViewer {
|
|
|
296
292
|
}
|
|
297
293
|
buildTaskBar() {
|
|
298
294
|
var _a;
|
|
299
|
-
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
|
|
295
|
+
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 }));
|
|
300
296
|
}
|
|
301
297
|
render() {
|
|
302
298
|
var _a, _b;
|
|
@@ -315,7 +311,7 @@ export class SnkGuidesViewer {
|
|
|
315
311
|
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 ?
|
|
316
312
|
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) })
|
|
317
313
|
:
|
|
318
|
-
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)
|
|
314
|
+
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) })));
|
|
319
315
|
}
|
|
320
316
|
static get is() { return "snk-guides-viewer"; }
|
|
321
317
|
static get encapsulation() { return "scoped"; }
|
|
@@ -331,6 +327,30 @@ export class SnkGuidesViewer {
|
|
|
331
327
|
}
|
|
332
328
|
static get properties() {
|
|
333
329
|
return {
|
|
330
|
+
"_guideBuilders": {
|
|
331
|
+
"type": "unknown",
|
|
332
|
+
"mutable": false,
|
|
333
|
+
"complexType": {
|
|
334
|
+
"original": "Map<string, GuideBuilder>",
|
|
335
|
+
"resolved": "Map<string, GuideBuilder>",
|
|
336
|
+
"references": {
|
|
337
|
+
"Map": {
|
|
338
|
+
"location": "global"
|
|
339
|
+
},
|
|
340
|
+
"GuideBuilder": {
|
|
341
|
+
"location": "import",
|
|
342
|
+
"path": "./GuideBuilder"
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"required": false,
|
|
347
|
+
"optional": false,
|
|
348
|
+
"docs": {
|
|
349
|
+
"tags": [],
|
|
350
|
+
"text": ""
|
|
351
|
+
},
|
|
352
|
+
"defaultValue": "new Map()"
|
|
353
|
+
},
|
|
334
354
|
"dataUnit": {
|
|
335
355
|
"type": "unknown",
|
|
336
356
|
"mutable": false,
|
|
@@ -567,23 +587,6 @@ export class SnkGuidesViewer {
|
|
|
567
587
|
},
|
|
568
588
|
"attribute": "presentation-mode",
|
|
569
589
|
"reflect": false
|
|
570
|
-
},
|
|
571
|
-
"resourceID": {
|
|
572
|
-
"type": "string",
|
|
573
|
-
"mutable": false,
|
|
574
|
-
"complexType": {
|
|
575
|
-
"original": "string",
|
|
576
|
-
"resolved": "string",
|
|
577
|
-
"references": {}
|
|
578
|
-
},
|
|
579
|
-
"required": false,
|
|
580
|
-
"optional": false,
|
|
581
|
-
"docs": {
|
|
582
|
-
"tags": [],
|
|
583
|
-
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
|
584
|
-
},
|
|
585
|
-
"attribute": "resource-i-d",
|
|
586
|
-
"reflect": false
|
|
587
590
|
}
|
|
588
591
|
};
|
|
589
592
|
}
|
|
@@ -626,28 +629,6 @@ export class SnkGuidesViewer {
|
|
|
626
629
|
"resolved": "string",
|
|
627
630
|
"references": {}
|
|
628
631
|
}
|
|
629
|
-
}, {
|
|
630
|
-
"method": "formItemsReady",
|
|
631
|
-
"name": "formItemsReady",
|
|
632
|
-
"bubbles": true,
|
|
633
|
-
"cancelable": true,
|
|
634
|
-
"composed": true,
|
|
635
|
-
"docs": {
|
|
636
|
-
"tags": [],
|
|
637
|
-
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
|
638
|
-
},
|
|
639
|
-
"complexType": {
|
|
640
|
-
"original": "Array<HTMLElement>",
|
|
641
|
-
"resolved": "HTMLElement[]",
|
|
642
|
-
"references": {
|
|
643
|
-
"Array": {
|
|
644
|
-
"location": "global"
|
|
645
|
-
},
|
|
646
|
-
"HTMLElement": {
|
|
647
|
-
"location": "global"
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
632
|
}];
|
|
652
633
|
}
|
|
653
634
|
static get methods() {
|
|
@@ -61,7 +61,6 @@ export class SnkDataUnit {
|
|
|
61
61
|
this.useCancelConfirm = true;
|
|
62
62
|
this.ignoreSaveMessage = undefined;
|
|
63
63
|
this.configName = undefined;
|
|
64
|
-
this.resourceID = undefined;
|
|
65
64
|
}
|
|
66
65
|
observePageSize() {
|
|
67
66
|
if (this.dataUnit) {
|
|
@@ -181,6 +180,7 @@ export class SnkDataUnit {
|
|
|
181
180
|
return resolve(action);
|
|
182
181
|
if (this._openedAlert)
|
|
183
182
|
return this.dataUnit.cancelEdition();
|
|
183
|
+
;
|
|
184
184
|
this._openedAlert = true;
|
|
185
185
|
this.dataUnit.cancelEdition();
|
|
186
186
|
ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate")).then(() => {
|
|
@@ -325,10 +325,10 @@ export class SnkDataUnit {
|
|
|
325
325
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
|
326
326
|
if (this._parentSnkDataUnit) {
|
|
327
327
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
|
328
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName
|
|
328
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
|
|
329
329
|
}
|
|
330
330
|
else {
|
|
331
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName
|
|
331
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
async loadDataUnit() {
|
|
@@ -387,7 +387,7 @@ export class SnkDataUnit {
|
|
|
387
387
|
//---------------------------------------------
|
|
388
388
|
componentWillLoad() {
|
|
389
389
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
390
|
-
this._application.getAllAccess(
|
|
390
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
391
391
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
|
392
392
|
if (this.messagesBuilder == undefined) {
|
|
393
393
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
@@ -624,23 +624,6 @@ export class SnkDataUnit {
|
|
|
624
624
|
},
|
|
625
625
|
"attribute": "config-name",
|
|
626
626
|
"reflect": false
|
|
627
|
-
},
|
|
628
|
-
"resourceID": {
|
|
629
|
-
"type": "string",
|
|
630
|
-
"mutable": false,
|
|
631
|
-
"complexType": {
|
|
632
|
-
"original": "string",
|
|
633
|
-
"resolved": "string",
|
|
634
|
-
"references": {}
|
|
635
|
-
},
|
|
636
|
-
"required": false,
|
|
637
|
-
"optional": false,
|
|
638
|
-
"docs": {
|
|
639
|
-
"tags": [],
|
|
640
|
-
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
|
641
|
-
},
|
|
642
|
-
"attribute": "resource-i-d",
|
|
643
|
-
"reflect": false
|
|
644
627
|
}
|
|
645
628
|
};
|
|
646
629
|
}
|
|
@@ -10,6 +10,7 @@ export class SnkEntityList {
|
|
|
10
10
|
}
|
|
11
11
|
async reloadList() {
|
|
12
12
|
this.loadListSource();
|
|
13
|
+
this.saveConfig.emit(this.config);
|
|
13
14
|
}
|
|
14
15
|
observeConfig() {
|
|
15
16
|
var _a, _b;
|
|
@@ -25,6 +26,7 @@ export class SnkEntityList {
|
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
28
|
this.config = ObjectUtils.copy(configCopy);
|
|
29
|
+
this.saveConfig.emit(this.config);
|
|
28
30
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
|
29
31
|
}
|
|
30
32
|
loadListSource() {
|
|
@@ -81,6 +83,7 @@ export class SnkEntityList {
|
|
|
81
83
|
}
|
|
82
84
|
] });
|
|
83
85
|
this.loadListSource();
|
|
86
|
+
this.saveConfig.emit(this.config);
|
|
84
87
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
@@ -203,6 +206,26 @@ export class SnkEntityList {
|
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
208
|
}
|
|
209
|
+
}, {
|
|
210
|
+
"method": "saveConfig",
|
|
211
|
+
"name": "saveConfig",
|
|
212
|
+
"bubbles": true,
|
|
213
|
+
"cancelable": true,
|
|
214
|
+
"composed": true,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": "Evento emitido ao realizar alguma a\u00E7\u00E3o que altera os dados do config.value permitindo salvar estas informa\u00E7\u00F5es"
|
|
218
|
+
},
|
|
219
|
+
"complexType": {
|
|
220
|
+
"original": "SnkFilterItemConfig",
|
|
221
|
+
"resolved": "SnkFilterItemConfig",
|
|
222
|
+
"references": {
|
|
223
|
+
"SnkFilterItemConfig": {
|
|
224
|
+
"location": "import",
|
|
225
|
+
"path": "../snk-filter-bar/filter-item/snk-filter-item"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
206
229
|
}];
|
|
207
230
|
}
|
|
208
231
|
static get methods() {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { h, Host, Fragment } from '@stencil/core';
|
|
2
2
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
3
3
|
import FilterItemType from './filter-item-type.enum';
|
|
4
|
-
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
4
|
+
import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
|
|
5
|
+
import FilterBarConfigFetcher from '../../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher';
|
|
5
6
|
import { EPresentationMode } from './editors/enum/presentationMode';
|
|
6
7
|
import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
|
|
7
8
|
export class SnkFilterDetail {
|
|
@@ -23,6 +24,7 @@ export class SnkFilterDetail {
|
|
|
23
24
|
}
|
|
24
25
|
componentDidLoad() {
|
|
25
26
|
if (this._element) {
|
|
27
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
26
28
|
ElementIDUtils.addIDInfo(this._element);
|
|
27
29
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
28
30
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
|
@@ -140,12 +142,20 @@ export class SnkFilterDetail {
|
|
|
140
142
|
this.config = ObjectUtils.copy(configCopy);
|
|
141
143
|
}
|
|
142
144
|
}
|
|
145
|
+
saveConfig(newConfig) {
|
|
146
|
+
var _a;
|
|
147
|
+
(_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
|
|
148
|
+
const fetcher = new FilterBarConfigFetcher();
|
|
149
|
+
fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
|
|
150
|
+
this.config = newConfig;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
143
153
|
componentWillLoad() {
|
|
144
154
|
this.originalConfig = ObjectUtils.copy(this.config);
|
|
145
155
|
}
|
|
146
156
|
render() {
|
|
147
157
|
const { tag: CustomElement, props } = this.getContentEditor();
|
|
148
|
-
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" }))));
|
|
158
|
+
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" }))));
|
|
149
159
|
}
|
|
150
160
|
static get is() { return "snk-filter-detail"; }
|
|
151
161
|
static get properties() {
|
|
@@ -244,7 +244,7 @@ export class SnkFilterModal {
|
|
|
244
244
|
"optional": false,
|
|
245
245
|
"docs": {
|
|
246
246
|
"tags": [],
|
|
247
|
-
"text": "Nome da
|
|
247
|
+
"text": "Nome da config para buscar no resourceId"
|
|
248
248
|
},
|
|
249
249
|
"attribute": "config-name",
|
|
250
250
|
"reflect": false
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
-
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
3
3
|
import FilterItemType from '../../filter-item/filter-item-type.enum';
|
|
4
4
|
import { EPresentationMode } from '../../filter-item/editors/enum/presentationMode';
|
|
5
5
|
import { ConfigStorage } from '../../../../lib/configs/ConfigStorage';
|
|
@@ -8,13 +8,14 @@ export class SnkFilterModalItem {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this.filterItem = undefined;
|
|
10
10
|
this.configName = undefined;
|
|
11
|
-
this.resourceID = undefined;
|
|
12
11
|
}
|
|
13
12
|
observeFilterItem(newValue) {
|
|
14
13
|
var _a, _b;
|
|
15
14
|
this._editor && (this._editor["config"] = newValue);
|
|
16
15
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
17
16
|
this.filterChange.emit(newValue);
|
|
17
|
+
//isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
|
|
18
|
+
//this.saveConfig();
|
|
18
19
|
}
|
|
19
20
|
getContentEditorConfig() {
|
|
20
21
|
const props = { presentationMode: EPresentationMode.MODAL };
|
|
@@ -56,10 +57,11 @@ export class SnkFilterModalItem {
|
|
|
56
57
|
else {
|
|
57
58
|
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
|
|
58
59
|
}
|
|
60
|
+
this.saveConfig();
|
|
59
61
|
}
|
|
60
62
|
handleDeleteFilter(filter, filterItemType) {
|
|
61
63
|
if (filterItemType === FilterItemType.PERSONALIZED) {
|
|
62
|
-
ConfigStorage.removePersonalizedFilter(filter, this.
|
|
64
|
+
ConfigStorage.removePersonalizedFilter(filter, this.configName);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
componentDidLoad() {
|
|
@@ -67,6 +69,7 @@ export class SnkFilterModalItem {
|
|
|
67
69
|
ElementIDUtils.addIDInfo(this._element);
|
|
68
70
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
69
71
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
|
|
72
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
buildRightSlot(item) {
|
|
@@ -83,6 +86,15 @@ export class SnkFilterModalItem {
|
|
|
83
86
|
const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
|
|
84
87
|
return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
|
85
88
|
}
|
|
89
|
+
saveConfig() {
|
|
90
|
+
//Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
|
|
91
|
+
/*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
|
|
92
|
+
|
|
93
|
+
this._application?.getResourceID().then(resourceId => {
|
|
94
|
+
const fetcher = new FilterBarConfigFetcher();
|
|
95
|
+
fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
|
|
96
|
+
});*/
|
|
97
|
+
}
|
|
86
98
|
render() {
|
|
87
99
|
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
|
88
100
|
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)))));
|
|
@@ -132,27 +144,10 @@ export class SnkFilterModalItem {
|
|
|
132
144
|
"optional": false,
|
|
133
145
|
"docs": {
|
|
134
146
|
"tags": [],
|
|
135
|
-
"text": "Nome da
|
|
147
|
+
"text": "Nome da config para buscar no resourceId"
|
|
136
148
|
},
|
|
137
149
|
"attribute": "config-name",
|
|
138
150
|
"reflect": false
|
|
139
|
-
},
|
|
140
|
-
"resourceID": {
|
|
141
|
-
"type": "string",
|
|
142
|
-
"mutable": false,
|
|
143
|
-
"complexType": {
|
|
144
|
-
"original": "string",
|
|
145
|
-
"resolved": "string",
|
|
146
|
-
"references": {}
|
|
147
|
-
},
|
|
148
|
-
"required": false,
|
|
149
|
-
"optional": false,
|
|
150
|
-
"docs": {
|
|
151
|
-
"tags": [],
|
|
152
|
-
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
|
153
|
-
},
|
|
154
|
-
"attribute": "resource-i-d",
|
|
155
|
-
"reflect": false
|
|
156
151
|
}
|
|
157
152
|
};
|
|
158
153
|
}
|