@sankhyalabs/sankhyablocks 1.3.31-beta.17 → 1.3.31-beta.18
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 +376 -256
- 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 +61 -13
- package/dist/cjs/snk-filter-detail.cjs.entry.js +6 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +12 -0
- 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-crud/snk-crud.js +41 -3
- 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 +6 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +35 -0
- 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 +60 -12
- 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/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 +375 -255
- package/dist/components/snk-crud.js +4 -2
- package/dist/components/snk-filter-bar2.js +61 -13
- package/dist/components/snk-filter-detail2.js +6 -1
- package/dist/components/snk-filter-item2.js +14 -1
- 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 +376 -256
- 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 +61 -13
- package/dist/esm/snk-filter-detail.entry.js +6 -1
- package/dist/esm/snk-filter-item.entry.js +12 -0
- 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 +376 -256
- 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 +61 -13
- package/dist/sankhyablocks/snk-filter-detail.entry.js +6 -1
- package/dist/sankhyablocks/snk-filter-item.entry.js +12 -0
- 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-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 +5 -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/package.json +1 -1
- package/dist/esm/taskbar-elements-c119510a.js +0 -72
- package/dist/sankhyablocks/taskbar-elements-c119510a.js +0 -72
|
@@ -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,
|