@sankhyalabs/sankhyablocks 1.3.31-beta.17 → 1.3.31-beta.19
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/{SnkMessageBuilder-cb132e6d.js → SnkMessageBuilder-02c2ca02.js} +7 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +405 -265
- package/dist/cjs/snk-crud.cjs.entry.js +2 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +80 -14
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +7 -2
- package/dist/cjs/snk-filter-item.cjs.entry.js +13 -1
- package/dist/cjs/snk-filter-list.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
- package/dist/cjs/snk-filter-number.cjs.entry.js +2 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +19 -1
- package/dist/cjs/snk-grid.cjs.entry.js +15 -5
- package/dist/cjs/snk-taskbar.cjs.entry.js +14 -11
- package/dist/cjs/{taskbar-elements-efa44ff1.js → taskbar-elements-283c737e.js} +36 -17
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-application/snk-application.js +23 -3
- package/dist/collection/components/snk-crud/snk-crud.js +41 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +7 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +36 -1
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +53 -2
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +15 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +79 -13
- package/dist/collection/components/snk-form/snk-form.js +41 -1
- package/dist/collection/components/snk-grid/snk-grid.js +35 -3
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +35 -17
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +36 -11
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -6
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +375 -255
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +7 -3
- package/dist/components/SnkMessageBuilder.js +7 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +404 -264
- package/dist/components/snk-crud.js +4 -2
- package/dist/components/snk-filter-bar2.js +80 -14
- package/dist/components/snk-filter-binary-select.js +1 -1
- package/dist/components/snk-filter-detail2.js +7 -2
- package/dist/components/snk-filter-item2.js +15 -2
- package/dist/components/snk-filter-list2.js +5 -2
- package/dist/components/snk-filter-multi-select.d.ts +11 -0
- package/dist/components/snk-filter-multi-select.js +39 -0
- package/dist/components/snk-filter-number.js +2 -1
- package/dist/components/snk-filter-search.js +1 -1
- package/dist/components/snk-form2.js +20 -1
- package/dist/components/snk-grid2.js +15 -4
- package/dist/components/snk-taskbar2.js +49 -27
- package/dist/components/taskbar-processor.js +45 -0
- package/dist/{sankhyablocks/SnkMessageBuilder-cff80920.js → esm/SnkMessageBuilder-65d431bd.js} +7 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +405 -265
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +80 -14
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +7 -2
- package/dist/esm/snk-filter-item.entry.js +13 -1
- package/dist/esm/snk-filter-list.entry.js +2 -2
- package/dist/esm/snk-filter-multi-select.entry.js +19 -0
- package/dist/esm/snk-filter-number.entry.js +2 -1
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +19 -1
- package/dist/esm/snk-grid.entry.js +15 -5
- package/dist/esm/snk-taskbar.entry.js +14 -11
- package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/{esm/SnkMessageBuilder-cff80920.js → sankhyablocks/SnkMessageBuilder-65d431bd.js} +7 -3
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/sankhyablocks/snk-application.entry.js +405 -265
- package/dist/sankhyablocks/snk-crud.entry.js +3 -2
- package/dist/sankhyablocks/snk-data-unit.entry.js +1 -1
- package/dist/sankhyablocks/snk-filter-bar.entry.js +80 -14
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +1 -1
- package/dist/sankhyablocks/snk-filter-detail.entry.js +7 -2
- package/dist/sankhyablocks/snk-filter-item.entry.js +13 -1
- package/dist/sankhyablocks/snk-filter-list.entry.js +2 -2
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
- package/dist/sankhyablocks/snk-filter-number.entry.js +2 -1
- package/dist/sankhyablocks/snk-filter-search.entry.js +1 -1
- package/dist/sankhyablocks/snk-form.entry.js +19 -1
- package/dist/sankhyablocks/snk-grid.entry.js +15 -5
- package/dist/sankhyablocks/snk-taskbar.entry.js +14 -11
- package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
- package/dist/types/components/snk-application/snk-application.d.ts +5 -3
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +6 -3
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -2
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +17 -1
- package/dist/types/components.d.ts +78 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/taskbar-elements-c119510a.js +0 -72
- package/dist/sankhyablocks/taskbar-elements-c119510a.js +0 -72
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
2
|
import { h } from '@stencil/core';
|
|
3
3
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
|
4
|
+
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
4
5
|
export class SnkGrid {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
8
|
+
"snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
|
|
9
|
+
});
|
|
10
|
+
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
11
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
12
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
13
|
+
});
|
|
7
14
|
}
|
|
8
15
|
actionClickHandler(evt) {
|
|
9
16
|
if (evt.detail === TaskbarElement.CONFIG_GRID && this._grid) {
|
|
@@ -44,11 +51,16 @@ export class SnkGrid {
|
|
|
44
51
|
parent = parent.parentElement;
|
|
45
52
|
}
|
|
46
53
|
}
|
|
54
|
+
componentWillRender() {
|
|
55
|
+
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
56
|
+
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
57
|
+
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
58
|
+
}
|
|
47
59
|
render() {
|
|
48
60
|
if (!this._configLoaded || !this._dataUnit) {
|
|
49
61
|
return undefined;
|
|
50
62
|
}
|
|
51
|
-
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), 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", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons:
|
|
63
|
+
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), 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", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() }, h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" }))));
|
|
52
64
|
}
|
|
53
65
|
static get is() { return "snk-grid"; }
|
|
54
66
|
static get encapsulation() { return "scoped"; }
|
|
@@ -103,6 +115,26 @@ export class SnkGrid {
|
|
|
103
115
|
"tags": [],
|
|
104
116
|
"text": "Lista de a\u00E7\u00F5es que devem ser usadas no bot\u00E3o \"Mais op\u00E7\u00F5es\""
|
|
105
117
|
}
|
|
118
|
+
},
|
|
119
|
+
"taskbarManager": {
|
|
120
|
+
"type": "unknown",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "TaskbarManager",
|
|
124
|
+
"resolved": "TaskbarManager",
|
|
125
|
+
"references": {
|
|
126
|
+
"TaskbarManager": {
|
|
127
|
+
"location": "import",
|
|
128
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "Gerenciador das barras de tarefas. \u00C9 poss\u00EDvel determinar bot\u00F5es espec\u00EDficos\nou mesmo gerenciar o estado dos bot\u00F5es."
|
|
137
|
+
}
|
|
106
138
|
}
|
|
107
139
|
};
|
|
108
140
|
}
|
|
@@ -28,41 +28,59 @@ export var VisibleWhenForbidden;
|
|
|
28
28
|
(function (VisibleWhenForbidden) {
|
|
29
29
|
VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
|
|
30
30
|
})(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
|
|
31
|
+
export const buildCustomButton = (def, className, action, isEnabled) => {
|
|
32
|
+
const { hint, text, iconName } = def;
|
|
33
|
+
if (iconName) {
|
|
34
|
+
if (text) {
|
|
35
|
+
return iconTextButton(iconName, def.name, className, hint, text, action, isEnabled);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return iconButton(iconName, def.name, className, hint, action, isEnabled);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return textButton(def.name, className, text, hint, action, isEnabled);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
31
45
|
export const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
|
|
46
|
+
const title = getTitle(element);
|
|
32
47
|
switch (element) {
|
|
33
48
|
case TaskbarElement.PREVIOUS:
|
|
34
|
-
return iconButton("chevron-left", element, className,
|
|
49
|
+
return iconButton("chevron-left", element, className, title, action, isEnabled);
|
|
35
50
|
case TaskbarElement.NEXT:
|
|
36
|
-
return iconButton("chevron-right", element, className,
|
|
51
|
+
return iconButton("chevron-right", element, className, title, action, isEnabled);
|
|
37
52
|
case TaskbarElement.REFRESH:
|
|
38
|
-
return iconButton("sync", element, className,
|
|
53
|
+
return iconButton("sync", element, className, title, action, isEnabled);
|
|
39
54
|
case TaskbarElement.UPDATE:
|
|
40
|
-
return iconButton("edit", element, className,
|
|
55
|
+
return iconButton("edit", element, className, title, action, isEnabled);
|
|
41
56
|
case TaskbarElement.CLONE:
|
|
42
|
-
return iconButton("copy", element, className,
|
|
57
|
+
return iconButton("copy", element, className, title, action, isEnabled);
|
|
43
58
|
case TaskbarElement.REMOVE:
|
|
44
|
-
return iconButton("delete", element, className,
|
|
59
|
+
return iconButton("delete", element, className, title, action, isEnabled);
|
|
45
60
|
case TaskbarElement.INSERT:
|
|
46
|
-
return iconTextButton("plus", element, className,
|
|
61
|
+
return iconTextButton("plus", element, className, title, title, action, isEnabled);
|
|
47
62
|
case TaskbarElement.CANCEL:
|
|
48
|
-
return
|
|
63
|
+
return textButton(element, className, title, title, action, isEnabled);
|
|
49
64
|
case TaskbarElement.SAVE:
|
|
50
|
-
return iconTextButton("save", element, className,
|
|
65
|
+
return iconTextButton("save", element, className, title, title, action, isEnabled);
|
|
51
66
|
case TaskbarElement.GRID_MODE:
|
|
52
|
-
return iconButton("table", element, className,
|
|
67
|
+
return iconButton("table", element, className, title, action, isEnabled);
|
|
53
68
|
case TaskbarElement.FORM_MODE:
|
|
54
|
-
return iconButton("list", element, className,
|
|
69
|
+
return iconButton("list", element, className, title, action, isEnabled);
|
|
55
70
|
case TaskbarElement.CONFIG_GRID:
|
|
56
|
-
return iconButton("settings-inverted", element, className,
|
|
71
|
+
return iconButton("settings-inverted", element, className, title, action, isEnabled);
|
|
57
72
|
case TaskbarElement.MORE_OPTIONS:
|
|
58
|
-
return actions && actions.length > 0 ? h("ez-actions-button", { title:
|
|
73
|
+
return actions && actions.length > 0 ? h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
|
|
59
74
|
case TaskbarElement.DIVIDER:
|
|
60
75
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
|
|
61
76
|
}
|
|
62
77
|
};
|
|
63
|
-
function
|
|
64
|
-
return h("ez-button", {
|
|
78
|
+
function textButton(name, className, text, title, action, isEnabled) {
|
|
79
|
+
return h("ez-button", { title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) });
|
|
80
|
+
}
|
|
81
|
+
function iconButton(iconName, name, className, title, action, isEnabled) {
|
|
82
|
+
return h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
|
65
83
|
}
|
|
66
|
-
function iconTextButton(iconName,
|
|
67
|
-
return h("ez-button", {
|
|
84
|
+
function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
|
|
85
|
+
return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
|
68
86
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export default class TaskbarProcessor {
|
|
2
|
+
constructor(defaultButtons) {
|
|
3
|
+
this._defaultButtons = defaultButtons;
|
|
4
|
+
}
|
|
5
|
+
process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
|
|
6
|
+
var _a;
|
|
7
|
+
this.customButtons = new Map();
|
|
8
|
+
this.buttons = "";
|
|
9
|
+
this.disabledButtons = [];
|
|
10
|
+
(_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
|
|
11
|
+
let buttonName;
|
|
12
|
+
if (typeof btnDef === "string") {
|
|
13
|
+
buttonName = btnDef;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
const customBtn = btnDef;
|
|
17
|
+
this.customButtons.set(customBtn.name, customBtn);
|
|
18
|
+
buttonName = customBtn.name;
|
|
19
|
+
}
|
|
20
|
+
if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
21
|
+
this.disabledButtons.push(buttonName);
|
|
22
|
+
}
|
|
23
|
+
if (this.buttons.length > 0) {
|
|
24
|
+
this.buttons += ",";
|
|
25
|
+
}
|
|
26
|
+
this.buttons += buttonName;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
|
30
|
+
const defaults = this._defaultButtons[taskbarId];
|
|
31
|
+
if (taskbarManager) {
|
|
32
|
+
return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
|
|
33
|
+
}
|
|
34
|
+
return defaults;
|
|
35
|
+
}
|
|
36
|
+
isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
|
|
37
|
+
const originalValue = disabled.includes(buttonName) ? false : true;
|
|
38
|
+
if (taskbarManager && taskbarManager.isEnabled) {
|
|
39
|
+
return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
|
|
40
|
+
}
|
|
41
|
+
return originalValue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
|
-
import { TaskbarElement, buildElem, AuthorizationElements, VisibleWhenForbidden } from './elements/taskbar-elements';
|
|
3
|
+
import { TaskbarElement, buildElem, AuthorizationElements, buildCustomButton, VisibleWhenForbidden } from './elements/taskbar-elements';
|
|
4
4
|
export class SnkTaskbar {
|
|
5
5
|
constructor() {
|
|
6
6
|
this._titleKeyByElement = {
|
|
@@ -95,13 +95,16 @@ export class SnkTaskbar {
|
|
|
95
95
|
return !(this.disabledButtons && this.disabledButtons.includes(elem));
|
|
96
96
|
}
|
|
97
97
|
getElement(index, def) {
|
|
98
|
-
let element;
|
|
99
98
|
let className = def === this.primaryButton ? "ez-button--primary " : "";
|
|
100
99
|
if (index > 1) {
|
|
101
100
|
className += "ez-padding-left--medium";
|
|
102
101
|
}
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
if (TaskbarElement[def.toString()]) {
|
|
103
|
+
return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
107
|
+
}
|
|
105
108
|
}
|
|
106
109
|
// Lifecycle
|
|
107
110
|
componentWillLoad() {
|
|
@@ -123,20 +126,20 @@ export class SnkTaskbar {
|
|
|
123
126
|
return undefined;
|
|
124
127
|
}
|
|
125
128
|
let index = 0;
|
|
126
|
-
return (h(Host, null, this._definitions.map((
|
|
127
|
-
if (
|
|
129
|
+
return (h(Host, null, this._definitions.map((elem) => {
|
|
130
|
+
if (elem === TaskbarElement.DIVIDER) {
|
|
128
131
|
index = 0;
|
|
129
132
|
}
|
|
130
133
|
else {
|
|
131
134
|
index++;
|
|
132
135
|
}
|
|
133
|
-
if (TaskbarElement[
|
|
134
|
-
return this.getElement(index, TaskbarElement[
|
|
136
|
+
if (TaskbarElement[elem]) {
|
|
137
|
+
return this.getElement(index, TaskbarElement[elem]);
|
|
135
138
|
}
|
|
136
|
-
|
|
137
|
-
index;
|
|
138
|
-
return h("slot", { name: btn });
|
|
139
|
+
if (this.customButtons.has(elem)) {
|
|
140
|
+
return this.getElement(index, this.customButtons.get(elem));
|
|
139
141
|
}
|
|
142
|
+
return h("slot", { name: elem });
|
|
140
143
|
})));
|
|
141
144
|
}
|
|
142
145
|
static get is() { return "snk-taskbar"; }
|
|
@@ -170,6 +173,28 @@ export class SnkTaskbar {
|
|
|
170
173
|
"attribute": "buttons",
|
|
171
174
|
"reflect": false
|
|
172
175
|
},
|
|
176
|
+
"customButtons": {
|
|
177
|
+
"type": "unknown",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "Map<string, CustomButton>",
|
|
181
|
+
"resolved": "Map<string, CustomButton>",
|
|
182
|
+
"references": {
|
|
183
|
+
"Map": {
|
|
184
|
+
"location": "global"
|
|
185
|
+
},
|
|
186
|
+
"CustomButton": {
|
|
187
|
+
"location": "local"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "Mapa com defini\u00E7\u00E3o de bot\u00F5es personalizados. A chave do mapa deve ser \npassada na lista \"buttons\" no lugar onde o bot\u00E3o ir\u00E1 aparecer."
|
|
196
|
+
}
|
|
197
|
+
},
|
|
173
198
|
"actionsList": {
|
|
174
199
|
"type": "unknown",
|
|
175
200
|
"mutable": false,
|
|
@@ -101,7 +101,7 @@ export class DataFetcher {
|
|
|
101
101
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
102
102
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
103
103
|
const http = new XMLHttpRequest();
|
|
104
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
104
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
105
105
|
http.open("POST", url, true);
|
|
106
106
|
http.withCredentials = true;
|
|
107
107
|
http.send(payload);
|
|
@@ -120,11 +120,11 @@ export class DataFetcher {
|
|
|
120
120
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
121
121
|
reject(this.responseText);
|
|
122
122
|
}
|
|
123
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
123
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
124
124
|
}
|
|
125
125
|
else if (this.readyState == 4 && this.status != 200) {
|
|
126
126
|
reject(this.responseText);
|
|
127
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
127
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
});
|
|
@@ -180,7 +180,7 @@ export class DataFetcher {
|
|
|
180
180
|
if (window['skw_session']) {
|
|
181
181
|
url += `?mgeSession=${window['skw_session']}`;
|
|
182
182
|
}
|
|
183
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
183
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
184
184
|
try {
|
|
185
185
|
res = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
186
186
|
res.forEach((resItem, index) => {
|
|
@@ -211,11 +211,11 @@ export class DataFetcher {
|
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
214
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
215
215
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
218
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
219
219
|
return { data: dataResponse, errors: errorsResponse };
|
|
220
220
|
}
|
|
221
221
|
isHttpError(err) {
|