@sankhyalabs/sankhyablocks 8.2.0-dev.5 → 8.2.0-dev.7
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-349cf0fd.js} +2 -2
- package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-7ba52c1d.js} +12 -206
- package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
- package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-9083c12f.js} +2 -2
- package/dist/cjs/{auth-fetcher-319a4cb2.js → auth-fetcher-718ca8b4.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-076fcbf7.js} +1 -1
- package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-c7ec4ff9.js} +1 -1
- package/dist/cjs/index-f9e81701.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-a9c5a2f5.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/snk-application.cjs.entry.js +17 -6
- package/dist/cjs/snk-attach.cjs.entry.js +4 -3
- package/dist/cjs/snk-crud.cjs.entry.js +8 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +4 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -2
- package/dist/cjs/snk-form.cjs.entry.js +5 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +4 -3
- package/dist/cjs/snk-grid.cjs.entry.js +9 -5
- package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-18e9666c.js} +8 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +4 -3
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -5
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-taskbar.cjs.entry.js +69 -4
- 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-application/snk-application.js +60 -0
- package/dist/collection/components/snk-crud/snk-crud.js +6 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +19 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +20 -2
- package/dist/collection/components/snk-grid/snk-grid.js +57 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -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 +107 -4
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +10 -4
- package/dist/collection/lib/utils/PrintUtils.js +18 -9
- package/dist/components/DataFetcher.js +13 -206
- package/dist/components/PrintUtils.js +213 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +11 -1
- package/dist/components/snk-crud.js +5 -3
- package/dist/components/snk-detail-view2.js +9 -5
- package/dist/components/snk-grid2.js +7 -1
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-crud2.js +1 -1
- 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 +78 -8
- package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-8d420626.js} +2 -2
- package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-e97b3942.js} +13 -206
- package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
- package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-4c6a5b41.js} +2 -2
- package/dist/esm/{auth-fetcher-6d9664b7.js → auth-fetcher-55e5cbce.js} +1 -1
- package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-716a99ca.js} +1 -1
- package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-b69da2f1.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-c9a53822.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -3
- package/dist/esm/snk-application.entry.js +17 -6
- package/dist/esm/snk-attach.entry.js +4 -3
- package/dist/esm/snk-crud.entry.js +10 -8
- package/dist/esm/snk-data-exporter.entry.js +2 -1
- package/dist/esm/snk-detail-view.entry.js +10 -8
- package/dist/esm/snk-filter-bar.entry.js +4 -3
- package/dist/esm/snk-filter-modal-item.entry.js +4 -3
- package/dist/esm/snk-form-config.entry.js +3 -2
- package/dist/esm/snk-form.entry.js +5 -4
- package/dist/esm/snk-grid-config.entry.js +4 -3
- package/dist/esm/snk-grid.entry.js +9 -5
- package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-2e97c0c3.js} +8 -7
- package/dist/esm/snk-guides-viewer.entry.js +8 -7
- package/dist/esm/snk-personalized-filter.entry.js +4 -3
- package/dist/esm/snk-print-selector.entry.js +1 -3
- package/dist/esm/snk-simple-crud.entry.js +6 -5
- package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
- package/dist/esm/snk-taskbar.entry.js +69 -4
- 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-34604220.entry.js +1 -0
- package/dist/sankhyablocks/{p-ed41b38c.js → p-41f81c72.js} +1 -1
- package/dist/sankhyablocks/p-4e701fa7.js +1 -0
- package/dist/sankhyablocks/{p-41e897f1.js → p-615874db.js} +1 -1
- package/dist/sankhyablocks/p-648a7c72.entry.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-a52a6c9d.js → p-81392ced.js} +1 -1
- package/dist/sankhyablocks/p-8d884fab.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-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-2d333d22.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-14eac6fe.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-application/snk-application.d.ts +1 -9
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +12 -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 +23 -0
- package/dist/types/components.d.ts +78 -1
- package/dist/types/lib/utils/PrintUtils.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
- package/dist/sankhyablocks/p-02b89228.entry.js +0 -1
- package/dist/sankhyablocks/p-03bb1aea.entry.js +0 -1
- package/dist/sankhyablocks/p-05dbc70e.entry.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-6f154396.entry.js +0 -1
- package/dist/sankhyablocks/p-787071a8.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-951e98c9.entry.js +0 -1
- package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
- package/dist/sankhyablocks/p-cfb33a4a.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-e64f3e17.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-f8e6b97e.js +0 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
@@ -3,12 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const
|
6
|
+
const PrintUtils = require('./PrintUtils-bcaeb82f.js');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const core = require('@sankhyalabs/core');
|
9
9
|
const ModalButtonStatus = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status');
|
10
|
-
require('./_commonjsHelpers-537d719a.js');
|
11
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
12
10
|
|
13
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
14
12
|
|
@@ -117,7 +115,7 @@ const SnkPrintSelector = class {
|
|
117
115
|
buildLocalPrinters() {
|
118
116
|
if (this._localPrintersDataSource.length > 0)
|
119
117
|
return;
|
120
|
-
this._localPrinters =
|
118
|
+
this._localPrinters = PrintUtils.PrintUtils.getInstance().getLocalPrinters();
|
121
119
|
this._localPrintersDataSource = this._localPrinters.map((printer) => ({
|
122
120
|
label: printer.nome
|
123
121
|
}));
|
@@ -5,19 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const constants = require('./constants-d187e03e.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
8
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
9
|
+
require('./DataFetcher-7ba52c1d.js');
|
10
|
+
require('./pesquisa-fetcher-a9c5a2f5.js');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
12
|
require('./ISave-d68ce3cd.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
require('./filter-item-type.enum-aa823a00.js');
|
16
|
-
require('./form-config-fetcher-
|
16
|
+
require('./form-config-fetcher-c7ec4ff9.js');
|
17
17
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
18
18
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
|
19
19
|
require('./index-102ba62d.js');
|
20
20
|
require('./_commonjsHelpers-537d719a.js');
|
21
|
+
require('./PrintUtils-bcaeb82f.js');
|
21
22
|
|
22
23
|
class InMemoryLoader {
|
23
24
|
constructor(metadata, records) {
|
@@ -280,7 +281,7 @@ const SnkSimpleCrud = class {
|
|
280
281
|
}
|
281
282
|
render() {
|
282
283
|
var _a;
|
283
|
-
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
284
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
284
285
|
? undefined
|
285
286
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
286
287
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-f9e81701.js');
|
6
|
+
|
7
|
+
const snkTaskbarCss = ".sc-snk-taskbar-custom-elements-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar-custom-elements{display:none}";
|
8
|
+
|
9
|
+
const SnkTaskbarCustomElements = class {
|
10
|
+
constructor(hostRef) {
|
11
|
+
index.registerInstance(this, hostRef);
|
12
|
+
this.slot = 'TASKBAR_CUSTOM_ELEMENTS';
|
13
|
+
}
|
14
|
+
render() {
|
15
|
+
return (index.h(index.Host, { slot: this.slot }, index.h("div", { id: this.slot, class: "taskbar-custom-elements-container" }, index.h("slot", null))));
|
16
|
+
}
|
17
|
+
};
|
18
|
+
SnkTaskbarCustomElements.style = snkTaskbarCss;
|
19
|
+
|
20
|
+
exports.snk_taskbar_custom_elements = SnkTaskbarCustomElements;
|
@@ -5,16 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
9
9
|
const index$1 = require('./index-0e663819.js');
|
10
10
|
require('./index-102ba62d.js');
|
11
11
|
|
12
|
-
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
12
|
+
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar{display:none}";
|
13
13
|
|
14
14
|
const SnkTaskbar = class {
|
15
15
|
constructor(hostRef) {
|
16
16
|
index.registerInstance(this, hostRef);
|
17
17
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
18
|
+
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
18
19
|
this._titleKeyByElement = {
|
19
20
|
[taskbarElements.TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
20
21
|
[taskbarElements.TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
@@ -32,6 +33,11 @@ const SnkTaskbar = class {
|
|
32
33
|
[taskbarElements.TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
33
34
|
};
|
34
35
|
this._permissions = undefined;
|
36
|
+
this._customElements = undefined;
|
37
|
+
this._customElementsId = undefined;
|
38
|
+
this._slotContainer = undefined;
|
39
|
+
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
40
|
+
this.customContainerId = undefined;
|
35
41
|
this.configName = undefined;
|
36
42
|
this.resourceID = undefined;
|
37
43
|
this.buttons = undefined;
|
@@ -172,6 +178,43 @@ const SnkTaskbar = class {
|
|
172
178
|
return true;
|
173
179
|
});
|
174
180
|
}
|
181
|
+
appendCustomElementsInTaskbar() {
|
182
|
+
this._customElementsId.forEach(id => {
|
183
|
+
const elementId = id.replace(this.TASKBAR_ITEM_ID_PREFIX, '');
|
184
|
+
const customElement = this._customElements.get(elementId);
|
185
|
+
const container = this._element.querySelector(`#${id}`);
|
186
|
+
if (container) {
|
187
|
+
container === null || container === void 0 ? void 0 : container.appendChild(customElement);
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
this.unlinkCustomElementFromTaskbar(customElement);
|
191
|
+
}
|
192
|
+
});
|
193
|
+
}
|
194
|
+
addCustomElementContainer(elem) {
|
195
|
+
const elementId = `${this.TASKBAR_ITEM_ID_PREFIX}${elem}`;
|
196
|
+
if (!this._customElementsId.includes(elementId)) {
|
197
|
+
this._customElementsId.push(elementId);
|
198
|
+
}
|
199
|
+
return index.h("span", { key: elementId, id: elementId });
|
200
|
+
}
|
201
|
+
getCustomElements() {
|
202
|
+
var _a, _b;
|
203
|
+
this._customElementsId = [];
|
204
|
+
this._customElements = new Map();
|
205
|
+
this._slotContainer = this.buildSlotContainer();
|
206
|
+
const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
|
207
|
+
customElementsArray.forEach(item => this._customElements.set(item.id, item));
|
208
|
+
}
|
209
|
+
buildSlotContainer() {
|
210
|
+
if (this.customContainerId) {
|
211
|
+
const container = document.querySelector(`#${this.customContainerId}`);
|
212
|
+
return container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
|
213
|
+
}
|
214
|
+
else {
|
215
|
+
return this._element.querySelector(`#${this.customSlotId}`);
|
216
|
+
}
|
217
|
+
}
|
175
218
|
componentWillLoad() {
|
176
219
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
177
220
|
if (this._application) {
|
@@ -180,6 +223,7 @@ const SnkTaskbar = class {
|
|
180
223
|
else {
|
181
224
|
this._permissions = {};
|
182
225
|
}
|
226
|
+
this.getCustomElements();
|
183
227
|
}
|
184
228
|
componentWillRender() {
|
185
229
|
if (this._definitions == undefined && this._permissions) {
|
@@ -191,12 +235,30 @@ const SnkTaskbar = class {
|
|
191
235
|
const dataInfo = { dataUnit: this.dataUnit };
|
192
236
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
193
237
|
}
|
238
|
+
componentDidRender() {
|
239
|
+
this.appendCustomElementsInTaskbar();
|
240
|
+
}
|
241
|
+
disconnectedCallback() {
|
242
|
+
this.unlinkAllCustomElements();
|
243
|
+
}
|
244
|
+
unlinkAllCustomElements() {
|
245
|
+
var _a;
|
246
|
+
(_a = this._customElementsId) === null || _a === void 0 ? void 0 : _a.forEach(id => {
|
247
|
+
const elementId = id.replace(this.TASKBAR_ITEM_ID_PREFIX, '');
|
248
|
+
const customElement = this._customElements.get(elementId);
|
249
|
+
this.unlinkCustomElementFromTaskbar(customElement);
|
250
|
+
});
|
251
|
+
}
|
252
|
+
unlinkCustomElementFromTaskbar(customElement) {
|
253
|
+
this._slotContainer.appendChild(customElement);
|
254
|
+
}
|
194
255
|
render() {
|
195
256
|
if (this._definitions === undefined) {
|
196
257
|
return undefined;
|
197
258
|
}
|
198
259
|
let index$1 = 0;
|
199
260
|
return (index.h(index.Host, null, this.removeEmpty(this._definitions.map((elem) => {
|
261
|
+
var _a;
|
200
262
|
if (elem === taskbarElements.TaskbarElement.DIVIDER) {
|
201
263
|
index$1 = 0;
|
202
264
|
}
|
@@ -206,11 +268,14 @@ const SnkTaskbar = class {
|
|
206
268
|
if (taskbarElements.TaskbarElement[elem]) {
|
207
269
|
return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
|
208
270
|
}
|
209
|
-
if (this.customButtons.has(elem)) {
|
271
|
+
if ((_a = this.customButtons) === null || _a === void 0 ? void 0 : _a.has(elem)) {
|
210
272
|
return this.getElement(index$1, this.customButtons.get(elem));
|
211
273
|
}
|
274
|
+
if (this._customElements.has(elem)) {
|
275
|
+
return this.addCustomElementContainer(elem);
|
276
|
+
}
|
212
277
|
return index.h("slot", { name: elem });
|
213
|
-
}))));
|
278
|
+
})), index.h("div", { class: "taskbar-custom-elements-container" }, index.h("slot", { name: this.customSlotId }))));
|
214
279
|
}
|
215
280
|
get _element() { return index.getElement(this); }
|
216
281
|
static get watchers() { return {
|
@@ -102,18 +102,18 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
102
102
|
}
|
103
103
|
};
|
104
104
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
105
|
-
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
105
|
+
return index.h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
106
106
|
}
|
107
107
|
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
108
|
-
return index.h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
108
|
+
return index.h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
109
109
|
}
|
110
110
|
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
111
|
-
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
111
|
+
return index.h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
112
112
|
index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
113
113
|
}
|
114
114
|
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
115
115
|
return actions && actions.length > 0
|
116
|
-
? index.h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
116
|
+
? index.h("ez-actions-button", { key: dataElementId, title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
117
117
|
: undefined;
|
118
118
|
}
|
119
119
|
|
@@ -48,6 +48,7 @@
|
|
48
48
|
"./components/snk-print-selector/snk-print-selector.js",
|
49
49
|
"./components/snk-simple-bar/snk-simple-bar.js",
|
50
50
|
"./components/snk-simple-crud/snk-simple-crud.js",
|
51
|
+
"./components/snk-taskbar/snk-taskbar-custom-elements.js",
|
51
52
|
"./components/teste-pesquisa/teste-pesquisa.js"
|
52
53
|
],
|
53
54
|
"compiler": {
|
@@ -84,6 +84,16 @@ export class SnkApplication {
|
|
84
84
|
});
|
85
85
|
});
|
86
86
|
}
|
87
|
+
/**
|
88
|
+
* Realiza a chamada ao Service Broker conforme o nome do serviço.
|
89
|
+
*
|
90
|
+
* @param serviceName - Nome do serviço
|
91
|
+
* @param payload - Dados que serão processados na ação
|
92
|
+
* @param options - Parâmetros de URL
|
93
|
+
*/
|
94
|
+
async callServiceBroker(serviceName, payload, options) {
|
95
|
+
return DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
96
|
+
}
|
87
97
|
initOnboarding(onboardingKey) {
|
88
98
|
OnboardingUtils.getInstance().init(onboardingKey, window.envContext);
|
89
99
|
return Promise.resolve();
|
@@ -767,6 +777,56 @@ export class SnkApplication {
|
|
767
777
|
"tags": []
|
768
778
|
}
|
769
779
|
},
|
780
|
+
"callServiceBroker": {
|
781
|
+
"complexType": {
|
782
|
+
"signature": "(serviceName: string, payload: string | Object, options?: Options) => Promise<any>",
|
783
|
+
"parameters": [{
|
784
|
+
"tags": [{
|
785
|
+
"name": "param",
|
786
|
+
"text": "serviceName - Nome do servi\u00E7o"
|
787
|
+
}],
|
788
|
+
"text": "- Nome do servi\u00E7o"
|
789
|
+
}, {
|
790
|
+
"tags": [{
|
791
|
+
"name": "param",
|
792
|
+
"text": "payload - Dados que ser\u00E3o processados na a\u00E7\u00E3o"
|
793
|
+
}],
|
794
|
+
"text": "- Dados que ser\u00E3o processados na a\u00E7\u00E3o"
|
795
|
+
}, {
|
796
|
+
"tags": [{
|
797
|
+
"name": "param",
|
798
|
+
"text": "options - Par\u00E2metros de URL"
|
799
|
+
}],
|
800
|
+
"text": "- Par\u00E2metros de URL"
|
801
|
+
}],
|
802
|
+
"references": {
|
803
|
+
"Promise": {
|
804
|
+
"location": "global"
|
805
|
+
},
|
806
|
+
"Object": {
|
807
|
+
"location": "global"
|
808
|
+
},
|
809
|
+
"Options": {
|
810
|
+
"location": "import",
|
811
|
+
"path": "../../lib/http/data-fetcher/DataFetcher"
|
812
|
+
}
|
813
|
+
},
|
814
|
+
"return": "Promise<any>"
|
815
|
+
},
|
816
|
+
"docs": {
|
817
|
+
"text": "Realiza a chamada ao Service Broker conforme o nome do servi\u00E7o.",
|
818
|
+
"tags": [{
|
819
|
+
"name": "param",
|
820
|
+
"text": "serviceName - Nome do servi\u00E7o"
|
821
|
+
}, {
|
822
|
+
"name": "param",
|
823
|
+
"text": "payload - Dados que ser\u00E3o processados na a\u00E7\u00E3o"
|
824
|
+
}, {
|
825
|
+
"name": "param",
|
826
|
+
"text": "options - Par\u00E2metros de URL"
|
827
|
+
}]
|
828
|
+
}
|
829
|
+
},
|
770
830
|
"initOnboarding": {
|
771
831
|
"complexType": {
|
772
832
|
"signature": "(onboardingKey: string) => Promise<void>",
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { h } from '@stencil/core';
|
2
|
-
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
1
|
+
import { h, Host } from '@stencil/core';
|
2
|
+
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
4
4
|
import { PresentationMode } from '../../lib';
|
5
5
|
import { VIEW_MODE } from '../../lib/utils/constants';
|
@@ -29,6 +29,7 @@ export class SnkCrud {
|
|
29
29
|
this.presentationMode = PresentationMode.PRIMARY;
|
30
30
|
this.messagesBuilder = undefined;
|
31
31
|
this.useEnterLikeTab = false;
|
32
|
+
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
32
33
|
}
|
33
34
|
/**
|
34
35
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
@@ -170,7 +171,7 @@ export class SnkCrud {
|
|
170
171
|
return;
|
171
172
|
}
|
172
173
|
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, resourceID: this._resourceID }, 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, resourceID: this._resourceID }, 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'), resourceID: this._resourceID }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
174
|
+
return (h(Host, null, 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, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), 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, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), 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'), resourceID: this._resourceID }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
174
175
|
}
|
175
176
|
static get is() { return "snk-crud"; }
|
176
177
|
static get encapsulation() { return "scoped"; }
|
@@ -416,7 +417,8 @@ export class SnkCrud {
|
|
416
417
|
"attachmentRegisterKey": {},
|
417
418
|
"_currentViewMode": {},
|
418
419
|
"_canEdit": {},
|
419
|
-
"_resourceID": {}
|
420
|
+
"_resourceID": {},
|
421
|
+
"customContainerId": {}
|
420
422
|
};
|
421
423
|
}
|
422
424
|
static get events() {
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
@@ -24,6 +24,7 @@ export class SnkDetailView {
|
|
24
24
|
this.messagesBuilder = undefined;
|
25
25
|
this.branchGuide = undefined;
|
26
26
|
this.canEdit = true;
|
27
|
+
this.taskbarCustomContainerId = undefined;
|
27
28
|
}
|
28
29
|
observerDataState(newValue, oldValue) {
|
29
30
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
@@ -193,7 +194,7 @@ export class SnkDetailView {
|
|
193
194
|
render() {
|
194
195
|
this.updateLabel();
|
195
196
|
//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, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
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) }))))));
|
197
198
|
}
|
198
199
|
static get is() { return "snk-detail-view"; }
|
199
200
|
static get encapsulation() { return "scoped"; }
|
@@ -434,6 +435,23 @@ export class SnkDetailView {
|
|
434
435
|
"attribute": "can-edit",
|
435
436
|
"reflect": false,
|
436
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
|
437
455
|
}
|
438
456
|
};
|
439
457
|
}
|
@@ -24,6 +24,7 @@ export class SnkGuidesViewer {
|
|
24
24
|
this.canEdit = true;
|
25
25
|
this.presentationMode = undefined;
|
26
26
|
this.resourceID = undefined;
|
27
|
+
this.detailTaskbarCustomContainerId = undefined;
|
27
28
|
this._breadcrumbItems = [];
|
28
29
|
this._guides = undefined;
|
29
30
|
this._formEditorConfigManager = undefined;
|
@@ -225,7 +226,7 @@ export class SnkGuidesViewer {
|
|
225
226
|
else {
|
226
227
|
detailBranch = this.selectedGuide;
|
227
228
|
}
|
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), resourceID: this.resourceID }));
|
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 }));
|
229
230
|
}
|
230
231
|
else {
|
231
232
|
const cardId = this.selectedGuide.id;
|
@@ -296,7 +297,7 @@ export class SnkGuidesViewer {
|
|
296
297
|
}
|
297
298
|
buildTaskBar() {
|
298
299
|
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, resourceID: this.resourceID }));
|
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" })));
|
300
301
|
}
|
301
302
|
render() {
|
302
303
|
var _a, _b;
|
@@ -584,6 +585,23 @@ export class SnkGuidesViewer {
|
|
584
585
|
},
|
585
586
|
"attribute": "resource-i-d",
|
586
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
|
587
605
|
}
|
588
606
|
};
|
589
607
|
}
|
@@ -40,6 +40,9 @@ export class SnkGrid {
|
|
40
40
|
this.useEnterLikeTab = false;
|
41
41
|
this.recordsValidator = undefined;
|
42
42
|
this.canEdit = true;
|
43
|
+
this.taskbarCustomContainerId = undefined;
|
44
|
+
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
45
|
+
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
43
46
|
}
|
44
47
|
/**
|
45
48
|
* Exibe a janela de configurações da grade.
|
@@ -306,7 +309,7 @@ export class SnkGrid {
|
|
306
309
|
return undefined;
|
307
310
|
}
|
308
311
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
309
|
-
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList, resourceID: this.resourceID })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
312
|
+
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
310
313
|
}
|
311
314
|
static get is() { return "snk-grid"; }
|
312
315
|
static get encapsulation() { return "scoped"; }
|
@@ -595,6 +598,59 @@ export class SnkGrid {
|
|
595
598
|
"attribute": "can-edit",
|
596
599
|
"reflect": false,
|
597
600
|
"defaultValue": "true"
|
601
|
+
},
|
602
|
+
"taskbarCustomContainerId": {
|
603
|
+
"type": "string",
|
604
|
+
"mutable": false,
|
605
|
+
"complexType": {
|
606
|
+
"original": "string",
|
607
|
+
"resolved": "string",
|
608
|
+
"references": {}
|
609
|
+
},
|
610
|
+
"required": false,
|
611
|
+
"optional": false,
|
612
|
+
"docs": {
|
613
|
+
"tags": [],
|
614
|
+
"text": "Define o identificador do container de elementos customizados da Taskbar."
|
615
|
+
},
|
616
|
+
"attribute": "taskbar-custom-container-id",
|
617
|
+
"reflect": false
|
618
|
+
},
|
619
|
+
"gridHeaderCustomSlotId": {
|
620
|
+
"type": "string",
|
621
|
+
"mutable": false,
|
622
|
+
"complexType": {
|
623
|
+
"original": "string",
|
624
|
+
"resolved": "string",
|
625
|
+
"references": {}
|
626
|
+
},
|
627
|
+
"required": false,
|
628
|
+
"optional": false,
|
629
|
+
"docs": {
|
630
|
+
"tags": [],
|
631
|
+
"text": "Nome do slot de elementos customizados da Taskbar do cabe\u00E7alho da grade."
|
632
|
+
},
|
633
|
+
"attribute": "grid-header-custom-slot-id",
|
634
|
+
"reflect": false,
|
635
|
+
"defaultValue": "'GRID_HEADER_CUSTOM_ELEMENTS'"
|
636
|
+
},
|
637
|
+
"topTaskbarCustomSlotId": {
|
638
|
+
"type": "string",
|
639
|
+
"mutable": false,
|
640
|
+
"complexType": {
|
641
|
+
"original": "string",
|
642
|
+
"resolved": "string",
|
643
|
+
"references": {}
|
644
|
+
},
|
645
|
+
"required": false,
|
646
|
+
"optional": false,
|
647
|
+
"docs": {
|
648
|
+
"tags": [],
|
649
|
+
"text": "Nome do slot de elementos customizados da Taskbar principal do componente."
|
650
|
+
},
|
651
|
+
"attribute": "top-taskbar-custom-slot-id",
|
652
|
+
"reflect": false,
|
653
|
+
"defaultValue": "'GRID_TASKBAR_CUSTOM_ELEMENTS'"
|
598
654
|
}
|
599
655
|
};
|
600
656
|
}
|
@@ -174,7 +174,7 @@ export class SnkSimpleCrud {
|
|
174
174
|
}
|
175
175
|
render() {
|
176
176
|
var _a;
|
177
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
177
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
178
178
|
? undefined
|
179
179
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
180
180
|
}
|
@@ -99,16 +99,16 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
|
|
99
99
|
}
|
100
100
|
};
|
101
101
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
102
|
-
return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
102
|
+
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
103
103
|
}
|
104
104
|
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
105
|
-
return h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
105
|
+
return h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
106
106
|
}
|
107
107
|
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
108
|
-
return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
108
|
+
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
109
109
|
}
|
110
110
|
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
111
111
|
return actions && actions.length > 0
|
112
|
-
? h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
112
|
+
? h("ez-actions-button", { key: dataElementId, title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
113
113
|
: undefined;
|
114
114
|
}
|