@sankhyalabs/sankhyablocks 8.2.0-rc.1 → 8.2.0-rc.2
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-e9d7fa82.js → ConfigStorage-349cf0fd.js} +163 -51
- package/dist/cjs/{DataFetcher-39b63a1e.js → DataFetcher-7ba52c1d.js} +79 -235
- package/dist/cjs/ISave-d68ce3cd.js +8 -0
- package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
- package/dist/cjs/{SnkFormConfigManager-2f8eccd9.js → SnkFormConfigManager-9083c12f.js} +19 -21
- package/dist/cjs/{auth-fetcher-d407c31c.js → auth-fetcher-718ca8b4.js} +2 -2
- package/dist/cjs/{dataunit-fetcher-15a7cc88.js → dataunit-fetcher-076fcbf7.js} +1 -1
- package/dist/cjs/{form-config-fetcher-ab3ce222.js → form-config-fetcher-c7ec4ff9.js} +66 -3
- package/dist/cjs/index-f9e81701.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-96c042aa.js → pesquisa-fetcher-a9c5a2f5.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +19 -11
- package/dist/cjs/snk-application.cjs.entry.js +60 -44
- package/dist/cjs/snk-attach.cjs.entry.js +9 -14
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +28 -11
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
- package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-7cc1846d.js} +5 -5
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +17 -13
- package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
- package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -17
- package/dist/cjs/snk-filter-detail.cjs.entry.js +7 -16
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -19
- package/dist/cjs/snk-form-config.cjs.entry.js +7 -17
- package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
- package/dist/cjs/snk-form.cjs.entry.js +13 -8
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -6
- package/dist/cjs/snk-grid.cjs.entry.js +23 -22
- package/dist/cjs/{snk-guides-viewer-8518c61b.js → snk-guides-viewer-18e9666c.js} +19 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -85
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-taskbar.cjs.entry.js +71 -5
- package/dist/cjs/{taskbar-elements-b98dd6e9.js → taskbar-elements-39949c7a.js} +4 -4
- package/dist/collection/collection-manifest.json +1 -0
- 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 +120 -65
- package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
- package/dist/collection/components/snk-crud/snk-crud.js +44 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +60 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +65 -28
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +22 -6
- 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 +8 -13
- 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 +28 -12
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
- package/dist/collection/components/snk-form/snk-form.js +46 -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 +108 -16
- 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-simple-crud/snk-simple-crud.js +23 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +4 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar-custom-elements.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +4 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +126 -5
- package/dist/collection/lib/configs/ConfigStorage.js +33 -44
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +48 -33
- 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/collection/lib/utils/PrintUtils.js +18 -9
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/ConfigStorage.js +161 -48
- package/dist/components/DataFetcher.js +80 -235
- package/dist/components/PrintUtils.js +213 -0
- 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/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-actions-button2.js +23 -9
- package/dist/components/snk-application2.js +145 -129
- package/dist/components/snk-attach2.js +1 -8
- package/dist/components/snk-configurator2.js +3 -1
- package/dist/components/snk-crud.js +27 -8
- package/dist/components/snk-data-unit2.js +6 -5
- package/dist/components/snk-detail-view2.js +26 -10
- package/dist/components/snk-entity-list.js +0 -4
- package/dist/components/snk-filter-bar2.js +12 -12
- package/dist/components/snk-filter-detail2.js +8 -13
- package/dist/components/snk-filter-modal-item2.js +5 -16
- package/dist/components/snk-form-config2.js +5 -15
- package/dist/components/snk-form-view2.js +6 -1
- package/dist/components/snk-form.js +9 -2
- package/dist/components/snk-grid-config2.js +4 -2
- package/dist/components/snk-grid2.js +24 -17
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-crud2.js +30 -73
- package/dist/components/snk-taskbar-custom-elements.d.ts +11 -0
- package/dist/components/snk-taskbar-custom-elements.js +35 -0
- package/dist/components/snk-taskbar2.js +81 -9
- package/dist/esm/{ConfigStorage-1090289a.js → ConfigStorage-8d420626.js} +162 -49
- package/dist/esm/{DataFetcher-a4ed43e7.js → DataFetcher-e97b3942.js} +80 -235
- package/dist/esm/ISave-4412b20c.js +8 -0
- package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
- package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
- package/dist/esm/{SnkFormConfigManager-de537eca.js → SnkFormConfigManager-4c6a5b41.js} +19 -21
- package/dist/esm/{auth-fetcher-c53e0d6c.js → auth-fetcher-55e5cbce.js} +1 -1
- package/dist/esm/{dataunit-fetcher-8d0bfa4a.js → dataunit-fetcher-716a99ca.js} +1 -1
- package/dist/esm/{form-config-fetcher-4065db9a.js → form-config-fetcher-b69da2f1.js} +65 -3
- package/dist/esm/index-a7d3d3f1.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-7460b876.js → pesquisa-fetcher-c9a53822.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +19 -11
- package/dist/esm/snk-application.entry.js +60 -44
- package/dist/esm/snk-attach.entry.js +5 -10
- package/dist/esm/snk-configurator.entry.js +2 -1
- package/dist/esm/snk-crud.entry.js +30 -13
- package/dist/esm/snk-data-exporter.entry.js +3 -2
- package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-1715d2f1.js} +5 -5
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +17 -13
- package/dist/esm/snk-entity-list.entry.js +0 -4
- package/dist/esm/snk-filter-bar.entry.js +15 -17
- package/dist/esm/snk-filter-detail.entry.js +8 -17
- package/dist/esm/snk-filter-modal-item.entry.js +7 -20
- package/dist/esm/snk-form-config.entry.js +8 -18
- package/dist/esm/snk-form-view.entry.js +6 -1
- package/dist/esm/snk-form.entry.js +13 -8
- package/dist/esm/snk-grid-config.entry.js +6 -6
- package/dist/esm/snk-grid.entry.js +23 -22
- package/dist/esm/{snk-guides-viewer-cdecff6e.js → snk-guides-viewer-2e97c0c3.js} +19 -8
- package/dist/esm/snk-guides-viewer.entry.js +10 -9
- package/dist/esm/snk-personalized-filter.entry.js +14 -16
- package/dist/esm/snk-print-selector.entry.js +1 -3
- package/dist/esm/snk-simple-crud.entry.js +34 -76
- package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
- package/dist/esm/snk-taskbar.entry.js +71 -5
- package/dist/esm/{taskbar-elements-2c761819.js → taskbar-elements-0a6b8b95.js} +4 -4
- package/dist/sankhyablocks/p-0b19beb9.entry.js +1 -0
- package/dist/sankhyablocks/p-110136be.entry.js +1 -0
- package/dist/sankhyablocks/p-12e48665.entry.js +1 -0
- package/dist/sankhyablocks/p-236cd346.js +1 -0
- package/dist/sankhyablocks/p-324ce41e.entry.js +1 -0
- package/dist/sankhyablocks/p-34604220.entry.js +1 -0
- package/dist/sankhyablocks/p-41f81c72.js +1 -0
- package/dist/sankhyablocks/{p-b04fb9d4.js → p-4e701fa7.js} +1 -1
- package/dist/sankhyablocks/p-615874db.js +56 -0
- package/dist/sankhyablocks/p-648a7c72.entry.js +1 -0
- package/dist/sankhyablocks/p-688dcb4c.js +1 -0
- package/dist/sankhyablocks/p-72fc257b.entry.js +1 -0
- package/dist/sankhyablocks/p-7453735e.entry.js +1 -0
- package/dist/sankhyablocks/p-776514a8.entry.js +11 -0
- package/dist/sankhyablocks/p-81392ced.js +26 -0
- package/dist/sankhyablocks/p-8d884fab.js +1 -0
- package/dist/sankhyablocks/p-989937ee.entry.js +1 -0
- package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
- package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
- package/dist/sankhyablocks/p-a2854b5a.entry.js +1 -0
- package/dist/sankhyablocks/p-c149dca8.entry.js +1 -0
- package/dist/sankhyablocks/p-c303d74f.entry.js +1 -0
- package/dist/sankhyablocks/p-c51a4f28.entry.js +1 -0
- package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
- package/dist/sankhyablocks/{p-a2493d11.js → p-c9841939.js} +1 -1
- package/dist/sankhyablocks/p-ce6d7e3f.js +1 -0
- package/dist/sankhyablocks/p-cee68227.entry.js +1 -0
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
- package/dist/sankhyablocks/p-e1cb1f0b.js +1 -0
- package/dist/sankhyablocks/{p-b978da60.js → p-e696a8f6.js} +1 -1
- package/dist/sankhyablocks/p-e6c00493.entry.js +1 -0
- package/dist/sankhyablocks/p-ecbb878e.entry.js +1 -0
- package/dist/sankhyablocks/{p-9d18017a.js → p-f390386d.js} +1 -1
- package/dist/sankhyablocks/p-fbb4597a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff2f2152.entry.js +1 -0
- package/dist/sankhyablocks/p-ff8778e6.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 +9 -22
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -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 +9 -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 +17 -1
- 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-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +7 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +27 -0
- package/dist/types/components.d.ts +203 -22
- package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
- 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/dist/types/lib/utils/PrintUtils.d.ts +1 -0
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +2 -2
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/filter-bar-config-fetcher-24548cec.js +0 -155
- package/dist/cjs/resource-fetcher-64102551.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-2417b8cf.js +0 -153
- package/dist/esm/resource-fetcher-45a70066.js +0 -66
- package/dist/sankhyablocks/p-0848ee4d.entry.js +0 -1
- package/dist/sankhyablocks/p-0bd9c412.js +0 -1
- package/dist/sankhyablocks/p-0fb83448.js +0 -1
- package/dist/sankhyablocks/p-10b2aedc.entry.js +0 -1
- package/dist/sankhyablocks/p-1f63dcd4.entry.js +0 -1
- package/dist/sankhyablocks/p-216b2102.entry.js +0 -1
- package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
- package/dist/sankhyablocks/p-44e66c8d.js +0 -1
- package/dist/sankhyablocks/p-4514fc6a.entry.js +0 -1
- package/dist/sankhyablocks/p-50c13cc8.entry.js +0 -1
- package/dist/sankhyablocks/p-52c6b2e7.js +0 -1
- package/dist/sankhyablocks/p-564efc43.js +0 -1
- package/dist/sankhyablocks/p-5994af77.js +0 -56
- package/dist/sankhyablocks/p-6bb904bb.entry.js +0 -1
- package/dist/sankhyablocks/p-6e06175e.entry.js +0 -1
- package/dist/sankhyablocks/p-6f0795c8.entry.js +0 -1
- package/dist/sankhyablocks/p-7588f006.entry.js +0 -1
- package/dist/sankhyablocks/p-847e6c20.js +0 -17
- package/dist/sankhyablocks/p-8f3652bf.entry.js +0 -11
- package/dist/sankhyablocks/p-9471cbc9.entry.js +0 -1
- package/dist/sankhyablocks/p-a42dd503.entry.js +0 -1
- package/dist/sankhyablocks/p-befbc9ee.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-c6feb995.entry.js +0 -1
- package/dist/sankhyablocks/p-d7c7a289.entry.js +0 -1
- package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
- package/dist/sankhyablocks/p-f3b7b69e.js +0 -10
- package/dist/sankhyablocks/p-f7eded3a.entry.js +0 -1
- package/dist/sankhyablocks/p-ff7383b0.entry.js +0 -1
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
@@ -14,6 +14,7 @@ export class SnkDetailView {
|
|
14
14
|
this.attachmentRegisterKey = undefined;
|
15
15
|
this.formConfigManager = undefined;
|
16
16
|
this.dataUnitName = undefined;
|
17
|
+
this.resourceID = undefined;
|
17
18
|
this.guideItemPath = undefined;
|
18
19
|
this.entityName = undefined;
|
19
20
|
this.label = undefined;
|
@@ -23,6 +24,7 @@ export class SnkDetailView {
|
|
23
24
|
this.messagesBuilder = undefined;
|
24
25
|
this.branchGuide = undefined;
|
25
26
|
this.canEdit = true;
|
27
|
+
this.taskbarCustomContainerId = undefined;
|
26
28
|
}
|
27
29
|
observerDataState(newValue, oldValue) {
|
28
30
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
@@ -183,7 +185,7 @@ export class SnkDetailView {
|
|
183
185
|
}
|
184
186
|
componentWillLoad() {
|
185
187
|
this._configName = `dynaform.${this.entityName}`;
|
186
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
188
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
|
187
189
|
this.formConfigManager.loadConfig();
|
188
190
|
if (this.messagesBuilder == undefined) {
|
189
191
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -192,7 +194,7 @@ export class SnkDetailView {
|
|
192
194
|
render() {
|
193
195
|
this.updateLabel();
|
194
196
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
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
|
+
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, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }))), 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, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
196
198
|
}
|
197
199
|
static get is() { return "snk-detail-view"; }
|
198
200
|
static get encapsulation() { return "scoped"; }
|
@@ -245,6 +247,23 @@ export class SnkDetailView {
|
|
245
247
|
"attribute": "data-unit-name",
|
246
248
|
"reflect": false
|
247
249
|
},
|
250
|
+
"resourceID": {
|
251
|
+
"type": "string",
|
252
|
+
"mutable": false,
|
253
|
+
"complexType": {
|
254
|
+
"original": "string",
|
255
|
+
"resolved": "string",
|
256
|
+
"references": {}
|
257
|
+
},
|
258
|
+
"required": false,
|
259
|
+
"optional": false,
|
260
|
+
"docs": {
|
261
|
+
"tags": [],
|
262
|
+
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
263
|
+
},
|
264
|
+
"attribute": "resource-i-d",
|
265
|
+
"reflect": false
|
266
|
+
},
|
248
267
|
"guideItemPath": {
|
249
268
|
"type": "unknown",
|
250
269
|
"mutable": false,
|
@@ -416,6 +435,23 @@ export class SnkDetailView {
|
|
416
435
|
"attribute": "can-edit",
|
417
436
|
"reflect": false,
|
418
437
|
"defaultValue": "true"
|
438
|
+
},
|
439
|
+
"taskbarCustomContainerId": {
|
440
|
+
"type": "string",
|
441
|
+
"mutable": false,
|
442
|
+
"complexType": {
|
443
|
+
"original": "string",
|
444
|
+
"resolved": "string",
|
445
|
+
"references": {}
|
446
|
+
},
|
447
|
+
"required": false,
|
448
|
+
"optional": false,
|
449
|
+
"docs": {
|
450
|
+
"tags": [],
|
451
|
+
"text": "Define o identificador do container de elementos customizados da Taskbar."
|
452
|
+
},
|
453
|
+
"attribute": "taskbar-custom-container-id",
|
454
|
+
"reflect": false
|
419
455
|
}
|
420
456
|
};
|
421
457
|
}
|
@@ -462,6 +498,28 @@ export class SnkDetailView {
|
|
462
498
|
"resolved": "string",
|
463
499
|
"references": {}
|
464
500
|
}
|
501
|
+
}, {
|
502
|
+
"method": "formItemsReady",
|
503
|
+
"name": "formItemsReady",
|
504
|
+
"bubbles": true,
|
505
|
+
"cancelable": true,
|
506
|
+
"composed": true,
|
507
|
+
"docs": {
|
508
|
+
"tags": [],
|
509
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
510
|
+
},
|
511
|
+
"complexType": {
|
512
|
+
"original": "Array<HTMLElement>",
|
513
|
+
"resolved": "HTMLElement[]",
|
514
|
+
"references": {
|
515
|
+
"Array": {
|
516
|
+
"location": "global"
|
517
|
+
},
|
518
|
+
"HTMLElement": {
|
519
|
+
"location": "global"
|
520
|
+
}
|
521
|
+
}
|
522
|
+
}
|
465
523
|
}];
|
466
524
|
}
|
467
525
|
static get methods() {
|
@@ -70,6 +70,10 @@ 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
|
+
}
|
73
77
|
disconnectedCallback() {
|
74
78
|
if (this._dataBinder != undefined) {
|
75
79
|
this._dataBinder.onDisconnectedCallback();
|
@@ -82,7 +86,7 @@ export class SnkFormView {
|
|
82
86
|
?
|
83
87
|
h("snk-form-summary", { summary: this.getCardSummary() })
|
84
88
|
:
|
85
|
-
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
|
89
|
+
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
|
86
90
|
}
|
87
91
|
static get is() { return "snk-form-view"; }
|
88
92
|
static get encapsulation() { return "scoped"; }
|
@@ -351,6 +355,28 @@ export class SnkFormView {
|
|
351
355
|
}
|
352
356
|
}
|
353
357
|
}
|
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
|
+
}
|
354
380
|
}];
|
355
381
|
}
|
356
382
|
static get methods() {
|
@@ -23,6 +23,8 @@ export class SnkGuidesViewer {
|
|
23
23
|
this.messagesBuilder = undefined;
|
24
24
|
this.canEdit = true;
|
25
25
|
this.presentationMode = undefined;
|
26
|
+
this.resourceID = undefined;
|
27
|
+
this.detailTaskbarCustomContainerId = undefined;
|
26
28
|
this._breadcrumbItems = [];
|
27
29
|
this._guides = undefined;
|
28
30
|
this._formEditorConfigManager = undefined;
|
@@ -224,7 +226,7 @@ export class SnkGuidesViewer {
|
|
224
226
|
else {
|
225
227
|
detailBranch = this.selectedGuide;
|
226
228
|
}
|
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
|
+
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, taskbarCustomContainerId: this.detailTaskbarCustomContainerId }));
|
228
230
|
}
|
229
231
|
else {
|
230
232
|
const cardId = this.selectedGuide.id;
|
@@ -273,7 +275,10 @@ export class SnkGuidesViewer {
|
|
273
275
|
return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
274
276
|
}
|
275
277
|
componentWillLoad() {
|
276
|
-
|
278
|
+
if (this.resourceID == undefined) {
|
279
|
+
throw new Error("Erro interno: resourceID não informado");
|
280
|
+
}
|
281
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
|
277
282
|
this._configManager.loadConfig();
|
278
283
|
}
|
279
284
|
componentDidRender() {
|
@@ -292,7 +297,7 @@ export class SnkGuidesViewer {
|
|
292
297
|
}
|
293
298
|
buildTaskBar() {
|
294
299
|
var _a;
|
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
|
+
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, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
296
301
|
}
|
297
302
|
render() {
|
298
303
|
var _a, _b;
|
@@ -311,7 +316,7 @@ export class SnkGuidesViewer {
|
|
311
316
|
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 ?
|
312
317
|
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) })
|
313
318
|
:
|
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
|
+
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 })));
|
315
320
|
}
|
316
321
|
static get is() { return "snk-guides-viewer"; }
|
317
322
|
static get encapsulation() { return "scoped"; }
|
@@ -327,30 +332,6 @@ export class SnkGuidesViewer {
|
|
327
332
|
}
|
328
333
|
static get properties() {
|
329
334
|
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
|
-
},
|
354
335
|
"dataUnit": {
|
355
336
|
"type": "unknown",
|
356
337
|
"mutable": false,
|
@@ -587,6 +568,40 @@ export class SnkGuidesViewer {
|
|
587
568
|
},
|
588
569
|
"attribute": "presentation-mode",
|
589
570
|
"reflect": false
|
571
|
+
},
|
572
|
+
"resourceID": {
|
573
|
+
"type": "string",
|
574
|
+
"mutable": false,
|
575
|
+
"complexType": {
|
576
|
+
"original": "string",
|
577
|
+
"resolved": "string",
|
578
|
+
"references": {}
|
579
|
+
},
|
580
|
+
"required": false,
|
581
|
+
"optional": false,
|
582
|
+
"docs": {
|
583
|
+
"tags": [],
|
584
|
+
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
585
|
+
},
|
586
|
+
"attribute": "resource-i-d",
|
587
|
+
"reflect": false
|
588
|
+
},
|
589
|
+
"detailTaskbarCustomContainerId": {
|
590
|
+
"type": "string",
|
591
|
+
"mutable": false,
|
592
|
+
"complexType": {
|
593
|
+
"original": "string",
|
594
|
+
"resolved": "string",
|
595
|
+
"references": {}
|
596
|
+
},
|
597
|
+
"required": false,
|
598
|
+
"optional": false,
|
599
|
+
"docs": {
|
600
|
+
"tags": [],
|
601
|
+
"text": "Define o identificador do container de elementos customizados da Taskbar da aba de detalhes."
|
602
|
+
},
|
603
|
+
"attribute": "detail-taskbar-custom-container-id",
|
604
|
+
"reflect": false
|
590
605
|
}
|
591
606
|
};
|
592
607
|
}
|
@@ -629,6 +644,28 @@ export class SnkGuidesViewer {
|
|
629
644
|
"resolved": "string",
|
630
645
|
"references": {}
|
631
646
|
}
|
647
|
+
}, {
|
648
|
+
"method": "formItemsReady",
|
649
|
+
"name": "formItemsReady",
|
650
|
+
"bubbles": true,
|
651
|
+
"cancelable": true,
|
652
|
+
"composed": true,
|
653
|
+
"docs": {
|
654
|
+
"tags": [],
|
655
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
656
|
+
},
|
657
|
+
"complexType": {
|
658
|
+
"original": "Array<HTMLElement>",
|
659
|
+
"resolved": "HTMLElement[]",
|
660
|
+
"references": {
|
661
|
+
"Array": {
|
662
|
+
"location": "global"
|
663
|
+
},
|
664
|
+
"HTMLElement": {
|
665
|
+
"location": "global"
|
666
|
+
}
|
667
|
+
}
|
668
|
+
}
|
632
669
|
}];
|
633
670
|
}
|
634
671
|
static get methods() {
|
@@ -61,6 +61,7 @@ export class SnkDataUnit {
|
|
61
61
|
this.useCancelConfirm = true;
|
62
62
|
this.ignoreSaveMessage = undefined;
|
63
63
|
this.configName = undefined;
|
64
|
+
this.resourceID = undefined;
|
64
65
|
}
|
65
66
|
observePageSize() {
|
66
67
|
if (this.dataUnit) {
|
@@ -180,7 +181,6 @@ export class SnkDataUnit {
|
|
180
181
|
return resolve(action);
|
181
182
|
if (this._openedAlert)
|
182
183
|
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, this.resourceID);
|
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, this.resourceID);
|
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().then(access => this._permissions = access);
|
390
|
+
this._application.getAllAccess(this.resourceID).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);
|
@@ -395,8 +395,7 @@ export class SnkDataUnit {
|
|
395
395
|
}
|
396
396
|
disconnectedCallback() {
|
397
397
|
if (this.dataUnit) {
|
398
|
-
this.dataUnit.
|
399
|
-
this.dataUnit.removeInterceptor(this);
|
398
|
+
this.dataUnit.releaseCallbacks();
|
400
399
|
}
|
401
400
|
}
|
402
401
|
componentDidLoad() {
|
@@ -624,6 +623,23 @@ export class SnkDataUnit {
|
|
624
623
|
},
|
625
624
|
"attribute": "config-name",
|
626
625
|
"reflect": false
|
626
|
+
},
|
627
|
+
"resourceID": {
|
628
|
+
"type": "string",
|
629
|
+
"mutable": false,
|
630
|
+
"complexType": {
|
631
|
+
"original": "string",
|
632
|
+
"resolved": "string",
|
633
|
+
"references": {}
|
634
|
+
},
|
635
|
+
"required": false,
|
636
|
+
"optional": false,
|
637
|
+
"docs": {
|
638
|
+
"tags": [],
|
639
|
+
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
640
|
+
},
|
641
|
+
"attribute": "resource-i-d",
|
642
|
+
"reflect": false
|
627
643
|
}
|
628
644
|
};
|
629
645
|
}
|
@@ -10,7 +10,6 @@ export class SnkEntityList {
|
|
10
10
|
}
|
11
11
|
async reloadList() {
|
12
12
|
this.loadListSource();
|
13
|
-
this.saveConfig.emit(this.config);
|
14
13
|
}
|
15
14
|
observeConfig() {
|
16
15
|
var _a, _b;
|
@@ -26,7 +25,6 @@ export class SnkEntityList {
|
|
26
25
|
}
|
27
26
|
});
|
28
27
|
this.config = ObjectUtils.copy(configCopy);
|
29
|
-
this.saveConfig.emit(this.config);
|
30
28
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
31
29
|
}
|
32
30
|
loadListSource() {
|
@@ -83,7 +81,6 @@ export class SnkEntityList {
|
|
83
81
|
}
|
84
82
|
] });
|
85
83
|
this.loadListSource();
|
86
|
-
this.saveConfig.emit(this.config);
|
87
84
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
88
85
|
}
|
89
86
|
}
|
@@ -206,26 +203,6 @@ export class SnkEntityList {
|
|
206
203
|
}
|
207
204
|
}
|
208
205
|
}
|
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
|
-
}
|
229
206
|
}];
|
230
207
|
}
|
231
208
|
static get methods() {
|
@@ -1,8 +1,7 @@
|
|
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,
|
5
|
-
import FilterBarConfigFetcher from '../../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher';
|
4
|
+
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
6
5
|
import { EPresentationMode } from './editors/enum/presentationMode';
|
7
6
|
import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
|
8
7
|
export class SnkFilterDetail {
|
@@ -24,7 +23,6 @@ export class SnkFilterDetail {
|
|
24
23
|
}
|
25
24
|
componentDidLoad() {
|
26
25
|
if (this._element) {
|
27
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
28
26
|
ElementIDUtils.addIDInfo(this._element);
|
29
27
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
30
28
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
@@ -54,7 +52,12 @@ export class SnkFilterDetail {
|
|
54
52
|
};
|
55
53
|
return snkFilterPersonalizedProps;
|
56
54
|
case FilterItemType.MULTI_LIST:
|
57
|
-
return {
|
55
|
+
return {
|
56
|
+
tag: "snk-entity-list",
|
57
|
+
props: {
|
58
|
+
onValueChanged: evt => this.config = Object.assign(Object.assign({}, this.config), { value: evt.detail })
|
59
|
+
}
|
60
|
+
};
|
58
61
|
}
|
59
62
|
return { tag: "snk-filter-text" };
|
60
63
|
}
|
@@ -142,20 +145,12 @@ export class SnkFilterDetail {
|
|
142
145
|
this.config = ObjectUtils.copy(configCopy);
|
143
146
|
}
|
144
147
|
}
|
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
|
-
}
|
153
148
|
componentWillLoad() {
|
154
149
|
this.originalConfig = ObjectUtils.copy(this.config);
|
155
150
|
}
|
156
151
|
render() {
|
157
152
|
const { tag: CustomElement, props } = this.getContentEditor();
|
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,
|
153
|
+
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" }))));
|
159
154
|
}
|
160
155
|
static get is() { return "snk-filter-detail"; }
|
161
156
|
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 configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
|
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 {
|
2
|
+
import { 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,14 +8,13 @@ export class SnkFilterModalItem {
|
|
8
8
|
constructor() {
|
9
9
|
this.filterItem = undefined;
|
10
10
|
this.configName = undefined;
|
11
|
+
this.resourceID = undefined;
|
11
12
|
}
|
12
13
|
observeFilterItem(newValue) {
|
13
14
|
var _a, _b;
|
14
15
|
this._editor && (this._editor["config"] = newValue);
|
15
16
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
16
17
|
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();
|
19
18
|
}
|
20
19
|
getContentEditorConfig() {
|
21
20
|
const props = { presentationMode: EPresentationMode.MODAL };
|
@@ -57,11 +56,10 @@ export class SnkFilterModalItem {
|
|
57
56
|
else {
|
58
57
|
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
|
59
58
|
}
|
60
|
-
this.saveConfig();
|
61
59
|
}
|
62
60
|
handleDeleteFilter(filter, filterItemType) {
|
63
61
|
if (filterItemType === FilterItemType.PERSONALIZED) {
|
64
|
-
ConfigStorage.removePersonalizedFilter(filter, this.configName);
|
62
|
+
ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
|
65
63
|
}
|
66
64
|
}
|
67
65
|
componentDidLoad() {
|
@@ -69,7 +67,6 @@ export class SnkFilterModalItem {
|
|
69
67
|
ElementIDUtils.addIDInfo(this._element);
|
70
68
|
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
71
69
|
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
|
72
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
73
70
|
}
|
74
71
|
}
|
75
72
|
buildRightSlot(item) {
|
@@ -86,15 +83,6 @@ export class SnkFilterModalItem {
|
|
86
83
|
const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
|
87
84
|
return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
88
85
|
}
|
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
|
-
}
|
98
86
|
render() {
|
99
87
|
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
100
88
|
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)))));
|
@@ -144,10 +132,27 @@ export class SnkFilterModalItem {
|
|
144
132
|
"optional": false,
|
145
133
|
"docs": {
|
146
134
|
"tags": [],
|
147
|
-
"text": "Nome da
|
135
|
+
"text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
|
148
136
|
},
|
149
137
|
"attribute": "config-name",
|
150
138
|
"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
|
151
156
|
}
|
152
157
|
};
|
153
158
|
}
|