@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
|
@@ -6,10 +6,11 @@ const index = require('./index-b0b676c5.js');
|
|
|
6
6
|
const index$1 = require('./index-02201bc9.js');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
|
|
8
8
|
|
|
9
|
-
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px)}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.preselected.sc-snk-filter-bar{background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}";
|
|
9
|
+
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px)}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.preselected.sc-snk-filter-bar{background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}";
|
|
10
10
|
|
|
11
11
|
const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
|
|
12
12
|
const DEFAULT_FILTER = "DEFAULT_FILTER";
|
|
13
|
+
const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
|
|
13
14
|
const SnkFilterBar = class {
|
|
14
15
|
constructor(hostRef) {
|
|
15
16
|
index.registerInstance(this, hostRef);
|
|
@@ -56,6 +57,9 @@ const SnkFilterBar = class {
|
|
|
56
57
|
//FIXME: ajustar o backend para não exigir parametros
|
|
57
58
|
return { name: id, expression: selectedOption.expression, params: [] };
|
|
58
59
|
}
|
|
60
|
+
if (type === filterItemType_enum.FilterItemType.MULTI_SELECT) {
|
|
61
|
+
return { name: id, expression: props.expression, params: [{ name: id, dataType: index$1.DataType.TEXT, value }] };
|
|
62
|
+
}
|
|
59
63
|
if (type === filterItemType_enum.FilterItemType.PERIOD) {
|
|
60
64
|
const { end, start } = value;
|
|
61
65
|
const params = [];
|
|
@@ -127,11 +131,11 @@ const SnkFilterBar = class {
|
|
|
127
131
|
getFilterItems() {
|
|
128
132
|
const pinnedItems = [];
|
|
129
133
|
const unpinnedItems = [];
|
|
130
|
-
this.
|
|
134
|
+
this.filterConfig
|
|
131
135
|
.filter(item => item.visible)
|
|
132
136
|
.sort((a, b) => this._filtersComparator(a, b))
|
|
133
|
-
.
|
|
134
|
-
const filterItem = (index.h("snk-filter-item", { config: item, class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
137
|
+
.forEach((item, index$1) => {
|
|
138
|
+
const filterItem = (index.h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
135
139
|
if (item.fixed || item.hardFixed) {
|
|
136
140
|
pinnedItems.push(filterItem);
|
|
137
141
|
}
|
|
@@ -149,25 +153,36 @@ const SnkFilterBar = class {
|
|
|
149
153
|
return elements;
|
|
150
154
|
}
|
|
151
155
|
calculateUpdateSequence(item) {
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
if (item) {
|
|
157
|
+
this._updateSequence = this._updateSequence.filter(itemId => item.id !== itemId);
|
|
158
|
+
this._updateSequence.push(item.id);
|
|
159
|
+
}
|
|
154
160
|
}
|
|
155
161
|
filterChangeListener(evt) {
|
|
156
162
|
this.updateFilter(evt.detail);
|
|
157
163
|
}
|
|
158
|
-
updateFilter(newItem) {
|
|
164
|
+
updateFilter(newItem, clear = false) {
|
|
159
165
|
this.calculateUpdateSequence(newItem);
|
|
160
|
-
let
|
|
166
|
+
let upToDate = false;
|
|
161
167
|
this.filterConfig = this.filterConfig.map(item => {
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
if (clear) {
|
|
169
|
+
if (item.value != undefined) {
|
|
170
|
+
upToDate = true;
|
|
171
|
+
}
|
|
172
|
+
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
if (item.id === newItem.id) {
|
|
176
|
+
upToDate = index$1.ObjectUtils.objectToString(item.value) !== index$1.ObjectUtils.objectToString(newItem.value);
|
|
177
|
+
return newItem;
|
|
178
|
+
}
|
|
165
179
|
}
|
|
166
180
|
return item;
|
|
167
181
|
});
|
|
168
|
-
if (
|
|
182
|
+
if (upToDate) {
|
|
169
183
|
this.dataUnit.loadData();
|
|
170
184
|
}
|
|
185
|
+
return upToDate;
|
|
171
186
|
}
|
|
172
187
|
getAddListItems() {
|
|
173
188
|
const hiddenItems = this.filterConfig
|
|
@@ -180,17 +195,50 @@ const SnkFilterBar = class {
|
|
|
180
195
|
{ name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" }
|
|
181
196
|
]);
|
|
182
197
|
}
|
|
198
|
+
getActiveClass() {
|
|
199
|
+
const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
|
|
200
|
+
return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
|
|
201
|
+
}
|
|
202
|
+
getAppliedListItems() {
|
|
203
|
+
const appliedItems = this.filterConfig
|
|
204
|
+
.filter(item => item.value != undefined)
|
|
205
|
+
.sort(this._filtersComparator);
|
|
206
|
+
return appliedItems.map(filter => {
|
|
207
|
+
return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
|
|
208
|
+
}).concat([
|
|
209
|
+
{ name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
|
|
210
|
+
]);
|
|
211
|
+
}
|
|
183
212
|
addFilterHandler(itemName) {
|
|
184
213
|
const filterItem = this.filterConfig.find(currentFilter => currentFilter.id === itemName);
|
|
185
214
|
if (filterItem) {
|
|
186
215
|
this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
|
|
216
|
+
window.requestAnimationFrame(() => {
|
|
217
|
+
const itemElement = this._element.querySelector("#filter-" + itemName);
|
|
218
|
+
if (itemElement) {
|
|
219
|
+
itemElement.showUp();
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
appliedFilterHandler(itemName) {
|
|
225
|
+
if (itemName === CLEAR_ALL_FILTERS) {
|
|
226
|
+
if (this.updateFilter(null, true)) {
|
|
227
|
+
this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
const itemElement = this._element.querySelector("#filter-" + itemName);
|
|
232
|
+
if (itemElement) {
|
|
233
|
+
itemElement.showUp(true);
|
|
234
|
+
}
|
|
187
235
|
}
|
|
188
236
|
}
|
|
189
237
|
render() {
|
|
190
238
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
191
239
|
return undefined;
|
|
192
240
|
}
|
|
193
|
-
return (index.h(index.Host, null, index.h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), index.h("
|
|
241
|
+
return (index.h(index.Host, null, index.h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), index.h("snk-filter-list", { items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), index.h("snk-filter-list", { items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, index.h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
194
242
|
}
|
|
195
243
|
get _element() { return index.getElement(this); }
|
|
196
244
|
};
|
|
@@ -17,6 +17,8 @@ const SnkFilterDetail = class {
|
|
|
17
17
|
switch (this.config.type) {
|
|
18
18
|
case filterItemType_enum.FilterItemType.BINARY_SELECT:
|
|
19
19
|
return "snk-filter-binary-select";
|
|
20
|
+
case filterItemType_enum.FilterItemType.MULTI_SELECT:
|
|
21
|
+
return "snk-filter-multi-select";
|
|
20
22
|
case filterItemType_enum.FilterItemType.PERIOD:
|
|
21
23
|
return "snk-filter-period";
|
|
22
24
|
case filterItemType_enum.FilterItemType.SEARCH:
|
|
@@ -26,12 +28,15 @@ const SnkFilterDetail = class {
|
|
|
26
28
|
}
|
|
27
29
|
return "snk-filter-text";
|
|
28
30
|
}
|
|
31
|
+
removeItem() {
|
|
32
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined }));
|
|
33
|
+
}
|
|
29
34
|
getPopUpHeaderButtons() {
|
|
30
35
|
if (this.config.hardFixed) {
|
|
31
36
|
return undefined;
|
|
32
37
|
}
|
|
33
38
|
return ([
|
|
34
|
-
index.h("ez-icon", { title: this.getMessage("snkFilterBar.removeFilter"), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: "delete", onClick: () => this.
|
|
39
|
+
index.h("ez-icon", { title: this.getMessage("snkFilterBar.removeFilter"), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: "delete", onClick: () => this.removeItem() }),
|
|
35
40
|
index.h("ez-icon", { title: this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), class: "ez-margin-left--small sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: this.config.fixed ? "un-pin" : "push-pin", onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })) })
|
|
36
41
|
]);
|
|
37
42
|
}
|
|
@@ -29,6 +29,14 @@ const SnkFilterItem = class {
|
|
|
29
29
|
return false;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
async showUp(open = false) {
|
|
33
|
+
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
|
34
|
+
if (open) {
|
|
35
|
+
window.requestAnimationFrame(() => {
|
|
36
|
+
this.showDetail();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
32
40
|
showDetail() {
|
|
33
41
|
this._floatingID = index$1.FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, left: this.getScrollOffset() });
|
|
34
42
|
this.detailIsVisible = true;
|
|
@@ -83,6 +91,10 @@ const SnkFilterItem = class {
|
|
|
83
91
|
return optTwo.label;
|
|
84
92
|
}
|
|
85
93
|
}
|
|
94
|
+
if (type === filterItemType_enum.FilterItemType.MULTI_SELECT) {
|
|
95
|
+
const opt = props.options.find(opt => opt.value === value);
|
|
96
|
+
return `${label}: ${opt.label}`;
|
|
97
|
+
}
|
|
86
98
|
if (type === filterItemType_enum.FilterItemType.PERIOD) {
|
|
87
99
|
const period = value;
|
|
88
100
|
const dateFormater = new Intl.DateTimeFormat("pt-BR");
|
|
@@ -70,7 +70,7 @@ const SnkFilterList = class {
|
|
|
70
70
|
getFilterItems() {
|
|
71
71
|
const items = this.items ? index$1.ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
|
|
72
72
|
if (items.length === 0) {
|
|
73
|
-
return index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.
|
|
73
|
+
return index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.emptyText);
|
|
74
74
|
}
|
|
75
75
|
const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
|
|
76
76
|
if (hideItems) {
|
|
@@ -83,7 +83,7 @@ const SnkFilterList = class {
|
|
|
83
83
|
return this.items.filter(item => item.kind === "FOOTER");
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return (index.h(index.Host, { class: "ez-flex ez-flex--column" }, index.h("ez-button", { label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, index.h("slot", { name: "leftIcon" })), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, index.h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.
|
|
86
|
+
return (index.h(index.Host, { class: "ez-flex ez-flex--column" }, index.h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, index.h("slot", { name: "leftIcon" })), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, index.h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail }), this.getFilterItems(), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
87
87
|
}
|
|
88
88
|
get _element() { return index.getElement(this); }
|
|
89
89
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b0b676c5.js');
|
|
6
|
+
const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
|
|
7
|
+
|
|
8
|
+
const SnkFilterMultiSelect = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
}
|
|
12
|
+
ezChangeListener(evt) {
|
|
13
|
+
this.value = evt.detail.value;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.MULTI_SELECT) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return (index.h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.snk_filter_multi_select = SnkFilterMultiSelect;
|
|
@@ -13,10 +13,11 @@ const SnkFilterPeriod = class {
|
|
|
13
13
|
this.value = evt.detail;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
+
var _a;
|
|
16
17
|
if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.NUMBER) {
|
|
17
18
|
return undefined;
|
|
18
19
|
}
|
|
19
|
-
return (index.h("ez-number-input", { label: this.config.label, value: this.config.value }));
|
|
20
|
+
return (index.h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -37,7 +37,7 @@ const SnkFilterSearch = class {
|
|
|
37
37
|
if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.SEARCH) {
|
|
38
38
|
return undefined;
|
|
39
39
|
}
|
|
40
|
-
return (index.h("ez-search", { value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
|
|
40
|
+
return (index.h("ez-search", { suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b0b676c5.js');
|
|
6
6
|
const index$1 = require('./index-02201bc9.js');
|
|
7
|
+
const taskbarProcessor = require('./taskbar-processor-6bd0d35c.js');
|
|
7
8
|
|
|
8
9
|
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
|
|
9
10
|
|
|
@@ -12,6 +13,10 @@ const SnkForm = class {
|
|
|
12
13
|
index.registerInstance(this, hostRef);
|
|
13
14
|
this.exit = index.createEvent(this, "exit", 7);
|
|
14
15
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
16
|
+
this._taskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
|
17
|
+
"snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
|
|
18
|
+
"snkForm.finish_edition": ["CANCEL", "SAVE"]
|
|
19
|
+
});
|
|
15
20
|
}
|
|
16
21
|
getFormConfig() {
|
|
17
22
|
return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
|
|
@@ -102,11 +107,24 @@ const SnkForm = class {
|
|
|
102
107
|
parent = parent.parentElement;
|
|
103
108
|
}
|
|
104
109
|
}
|
|
110
|
+
componentWillRender() {
|
|
111
|
+
var _a;
|
|
112
|
+
const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
|
|
113
|
+
const disabledButtons = [];
|
|
114
|
+
if (!this._dataState || !this._dataState.hasPrevious) {
|
|
115
|
+
disabledButtons.push("PREVIOUS");
|
|
116
|
+
}
|
|
117
|
+
if (!this._dataState || !this._dataState.hasNext) {
|
|
118
|
+
disabledButtons.push("NEXT");
|
|
119
|
+
}
|
|
120
|
+
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
|
|
121
|
+
}
|
|
105
122
|
render() {
|
|
123
|
+
var _a;
|
|
106
124
|
if (!this._configLoaded || !this._dataUnit || !this._dataState) {
|
|
107
125
|
return undefined;
|
|
108
126
|
}
|
|
109
|
-
return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.h("snk-taskbar", { key: "formTaskbar", buttons: this.
|
|
127
|
+
return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.h("snk-taskbar", { key: "formTaskbar", buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit }))), index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
|
|
110
128
|
}
|
|
111
129
|
get _element() { return index.getElement(this); }
|
|
112
130
|
};
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b0b676c5.js');
|
|
6
6
|
const index$1 = require('./index-02201bc9.js');
|
|
7
|
-
const taskbarElements = require('./taskbar-elements-
|
|
7
|
+
const taskbarElements = require('./taskbar-elements-283c737e.js');
|
|
8
|
+
const taskbarProcessor = require('./taskbar-processor-6bd0d35c.js');
|
|
8
9
|
|
|
9
10
|
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--small)}";
|
|
10
11
|
|
|
@@ -13,9 +14,13 @@ const SnkGrid = class {
|
|
|
13
14
|
index.registerInstance(this, hostRef);
|
|
14
15
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
15
16
|
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
this._topTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
|
18
|
+
"snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
|
|
19
|
+
});
|
|
20
|
+
this._headerTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
|
21
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
22
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
23
|
+
});
|
|
19
24
|
}
|
|
20
25
|
actionClickHandler(evt) {
|
|
21
26
|
if (evt.detail === taskbarElements.TaskbarElement.CONFIG_GRID && this._grid) {
|
|
@@ -56,11 +61,16 @@ const SnkGrid = class {
|
|
|
56
61
|
parent = parent.parentElement;
|
|
57
62
|
}
|
|
58
63
|
}
|
|
64
|
+
componentWillRender() {
|
|
65
|
+
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
66
|
+
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
67
|
+
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
68
|
+
}
|
|
59
69
|
render() {
|
|
60
70
|
if (!this._configLoaded || !this._dataUnit) {
|
|
61
71
|
return undefined;
|
|
62
72
|
}
|
|
63
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, index.h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons:
|
|
73
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, index.h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.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" })), index.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() }, index.h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" }))));
|
|
64
74
|
}
|
|
65
75
|
get _element() { return index.getElement(this); }
|
|
66
76
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b0b676c5.js');
|
|
6
6
|
const index$1 = require('./index-02201bc9.js');
|
|
7
|
-
const taskbarElements = require('./taskbar-elements-
|
|
7
|
+
const taskbarElements = require('./taskbar-elements-283c737e.js');
|
|
8
8
|
|
|
9
9
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
|
10
10
|
|
|
@@ -104,13 +104,16 @@ const SnkTaskbar = class {
|
|
|
104
104
|
return !(this.disabledButtons && this.disabledButtons.includes(elem));
|
|
105
105
|
}
|
|
106
106
|
getElement(index, def) {
|
|
107
|
-
let element;
|
|
108
107
|
let className = def === this.primaryButton ? "ez-button--primary " : "";
|
|
109
108
|
if (index > 1) {
|
|
110
109
|
className += "ez-padding-left--medium";
|
|
111
110
|
}
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
if (taskbarElements.TaskbarElement[def.toString()]) {
|
|
112
|
+
return taskbarElements.buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return taskbarElements.buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
116
|
+
}
|
|
114
117
|
}
|
|
115
118
|
// Lifecycle
|
|
116
119
|
componentWillLoad() {
|
|
@@ -132,20 +135,20 @@ const SnkTaskbar = class {
|
|
|
132
135
|
return undefined;
|
|
133
136
|
}
|
|
134
137
|
let index$1 = 0;
|
|
135
|
-
return (index.h(index.Host, null, this._definitions.map((
|
|
136
|
-
if (
|
|
138
|
+
return (index.h(index.Host, null, this._definitions.map((elem) => {
|
|
139
|
+
if (elem === taskbarElements.TaskbarElement.DIVIDER) {
|
|
137
140
|
index$1 = 0;
|
|
138
141
|
}
|
|
139
142
|
else {
|
|
140
143
|
index$1++;
|
|
141
144
|
}
|
|
142
|
-
if (taskbarElements.TaskbarElement[
|
|
143
|
-
return this.getElement(index$1, taskbarElements.TaskbarElement[
|
|
145
|
+
if (taskbarElements.TaskbarElement[elem]) {
|
|
146
|
+
return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
|
|
144
147
|
}
|
|
145
|
-
|
|
146
|
-
index$1;
|
|
147
|
-
return index.h("slot", { name: btn });
|
|
148
|
+
if (this.customButtons.has(elem)) {
|
|
149
|
+
return this.getElement(index$1, this.customButtons.get(elem));
|
|
148
150
|
}
|
|
151
|
+
return index.h("slot", { name: elem });
|
|
149
152
|
})));
|
|
150
153
|
}
|
|
151
154
|
static get watchers() { return {
|
|
@@ -31,44 +31,63 @@ exports.VisibleWhenForbidden = void 0;
|
|
|
31
31
|
(function (VisibleWhenForbidden) {
|
|
32
32
|
VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
|
|
33
33
|
})(exports.VisibleWhenForbidden || (exports.VisibleWhenForbidden = {}));
|
|
34
|
+
const buildCustomButton = (def, className, action, isEnabled) => {
|
|
35
|
+
const { hint, text, iconName } = def;
|
|
36
|
+
if (iconName) {
|
|
37
|
+
if (text) {
|
|
38
|
+
return iconTextButton(iconName, def.name, className, hint, text, action, isEnabled);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return iconButton(iconName, def.name, className, hint, action, isEnabled);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return textButton(def.name, className, text, hint, action, isEnabled);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
34
48
|
const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
|
|
49
|
+
const title = getTitle(element);
|
|
35
50
|
switch (element) {
|
|
36
51
|
case exports.TaskbarElement.PREVIOUS:
|
|
37
|
-
return iconButton("chevron-left", element, className,
|
|
52
|
+
return iconButton("chevron-left", element, className, title, action, isEnabled);
|
|
38
53
|
case exports.TaskbarElement.NEXT:
|
|
39
|
-
return iconButton("chevron-right", element, className,
|
|
54
|
+
return iconButton("chevron-right", element, className, title, action, isEnabled);
|
|
40
55
|
case exports.TaskbarElement.REFRESH:
|
|
41
|
-
return iconButton("sync", element, className,
|
|
56
|
+
return iconButton("sync", element, className, title, action, isEnabled);
|
|
42
57
|
case exports.TaskbarElement.UPDATE:
|
|
43
|
-
return iconButton("edit", element, className,
|
|
58
|
+
return iconButton("edit", element, className, title, action, isEnabled);
|
|
44
59
|
case exports.TaskbarElement.CLONE:
|
|
45
|
-
return iconButton("copy", element, className,
|
|
60
|
+
return iconButton("copy", element, className, title, action, isEnabled);
|
|
46
61
|
case exports.TaskbarElement.REMOVE:
|
|
47
|
-
return iconButton("delete", element, className,
|
|
62
|
+
return iconButton("delete", element, className, title, action, isEnabled);
|
|
48
63
|
case exports.TaskbarElement.INSERT:
|
|
49
|
-
return iconTextButton("plus", element, className,
|
|
64
|
+
return iconTextButton("plus", element, className, title, title, action, isEnabled);
|
|
50
65
|
case exports.TaskbarElement.CANCEL:
|
|
51
|
-
return
|
|
66
|
+
return textButton(element, className, title, title, action, isEnabled);
|
|
52
67
|
case exports.TaskbarElement.SAVE:
|
|
53
|
-
return iconTextButton("save", element, className,
|
|
68
|
+
return iconTextButton("save", element, className, title, title, action, isEnabled);
|
|
54
69
|
case exports.TaskbarElement.GRID_MODE:
|
|
55
|
-
return iconButton("table", element, className,
|
|
70
|
+
return iconButton("table", element, className, title, action, isEnabled);
|
|
56
71
|
case exports.TaskbarElement.FORM_MODE:
|
|
57
|
-
return iconButton("list", element, className,
|
|
72
|
+
return iconButton("list", element, className, title, action, isEnabled);
|
|
58
73
|
case exports.TaskbarElement.CONFIG_GRID:
|
|
59
|
-
return iconButton("settings-inverted", element, className,
|
|
74
|
+
return iconButton("settings-inverted", element, className, title, action, isEnabled);
|
|
60
75
|
case exports.TaskbarElement.MORE_OPTIONS:
|
|
61
|
-
return actions && actions.length > 0 ? index.h("ez-actions-button", { title:
|
|
76
|
+
return actions && actions.length > 0 ? index.h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
|
|
62
77
|
case exports.TaskbarElement.DIVIDER:
|
|
63
78
|
return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
|
|
64
79
|
}
|
|
65
80
|
};
|
|
66
|
-
function
|
|
67
|
-
return index.h("ez-button", {
|
|
81
|
+
function textButton(name, className, text, title, action, isEnabled) {
|
|
82
|
+
return index.h("ez-button", { title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) });
|
|
83
|
+
}
|
|
84
|
+
function iconButton(iconName, name, className, title, action, isEnabled) {
|
|
85
|
+
return index.h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
|
68
86
|
}
|
|
69
|
-
function iconTextButton(iconName,
|
|
70
|
-
return index.h("ez-button", {
|
|
87
|
+
function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
|
|
88
|
+
return index.h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) },
|
|
71
89
|
index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
|
72
90
|
}
|
|
73
91
|
|
|
92
|
+
exports.buildCustomButton = buildCustomButton;
|
|
74
93
|
exports.buildElem = buildElem;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class TaskbarProcessor {
|
|
4
|
+
constructor(defaultButtons) {
|
|
5
|
+
this._defaultButtons = defaultButtons;
|
|
6
|
+
}
|
|
7
|
+
process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
|
|
8
|
+
var _a;
|
|
9
|
+
this.customButtons = new Map();
|
|
10
|
+
this.buttons = "";
|
|
11
|
+
this.disabledButtons = [];
|
|
12
|
+
(_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
|
|
13
|
+
let buttonName;
|
|
14
|
+
if (typeof btnDef === "string") {
|
|
15
|
+
buttonName = btnDef;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const customBtn = btnDef;
|
|
19
|
+
this.customButtons.set(customBtn.name, customBtn);
|
|
20
|
+
buttonName = customBtn.name;
|
|
21
|
+
}
|
|
22
|
+
if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
23
|
+
this.disabledButtons.push(buttonName);
|
|
24
|
+
}
|
|
25
|
+
if (this.buttons.length > 0) {
|
|
26
|
+
this.buttons += ",";
|
|
27
|
+
}
|
|
28
|
+
this.buttons += buttonName;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
|
32
|
+
const defaults = this._defaultButtons[taskbarId];
|
|
33
|
+
if (taskbarManager) {
|
|
34
|
+
return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
|
|
35
|
+
}
|
|
36
|
+
return defaults;
|
|
37
|
+
}
|
|
38
|
+
isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
|
|
39
|
+
const originalValue = disabled.includes(buttonName) ? false : true;
|
|
40
|
+
if (taskbarManager && taskbarManager.isEnabled) {
|
|
41
|
+
return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
|
|
42
|
+
}
|
|
43
|
+
return originalValue;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.TaskbarProcessor = TaskbarProcessor;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"./components/snk-filter-bar/snk-filter-bar.js",
|
|
11
11
|
"./components/snk-filter-bar/filter-item/snk-filter-detail.js",
|
|
12
12
|
"./components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js",
|
|
13
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js",
|
|
13
14
|
"./components/snk-filter-bar/filter-item/editors/snk-filter-number.js",
|
|
14
15
|
"./components/snk-filter-bar/filter-item/editors/snk-filter-search.js",
|
|
15
16
|
"./components/snk-filter-bar/filter-item/editors/snk-filter-text.js",
|
|
@@ -50,7 +50,7 @@ export class SnkCrud {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, onActionClick: evt => this.executeAction(evt.detail) }))));
|
|
53
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" })))));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "snk-crud"; }
|
|
56
56
|
static get encapsulation() { return "scoped"; }
|
|
@@ -78,7 +78,7 @@ export class SnkCrud {
|
|
|
78
78
|
"optional": false,
|
|
79
79
|
"docs": {
|
|
80
80
|
"tags": [],
|
|
81
|
-
"text": ""
|
|
81
|
+
"text": "Usado para salvar as configura\u00E7\u00F5es dos blocos de constru\u00E7\u00E3o."
|
|
82
82
|
},
|
|
83
83
|
"attribute": "config-name",
|
|
84
84
|
"reflect": false
|
|
@@ -103,7 +103,27 @@ export class SnkCrud {
|
|
|
103
103
|
"optional": false,
|
|
104
104
|
"docs": {
|
|
105
105
|
"tags": [],
|
|
106
|
-
"text": ""
|
|
106
|
+
"text": "A\u00E7\u00F5es a serem colocadas no bot\u00E3o \"Mais op\u00E7\u00F5es\"."
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"taskbarManager": {
|
|
110
|
+
"type": "unknown",
|
|
111
|
+
"mutable": false,
|
|
112
|
+
"complexType": {
|
|
113
|
+
"original": "TaskbarManager",
|
|
114
|
+
"resolved": "TaskbarManager",
|
|
115
|
+
"references": {
|
|
116
|
+
"TaskbarManager": {
|
|
117
|
+
"location": "import",
|
|
118
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": "Gerenciador das barras de tarefas. \u00C9 poss\u00EDvel determinar bot\u00F5es espec\u00EDficos\nou mesmo gerenciar o estado dos bot\u00F5es."
|
|
107
127
|
}
|
|
108
128
|
},
|
|
109
129
|
"recordsValidator": {
|
|
@@ -134,5 +154,23 @@ export class SnkCrud {
|
|
|
134
154
|
"_dataState": {}
|
|
135
155
|
};
|
|
136
156
|
}
|
|
157
|
+
static get events() {
|
|
158
|
+
return [{
|
|
159
|
+
"method": "actionClick",
|
|
160
|
+
"name": "actionClick",
|
|
161
|
+
"bubbles": true,
|
|
162
|
+
"cancelable": true,
|
|
163
|
+
"composed": true,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": "Emitido pela taskbar sempre que houver click de bot\u00E3o ou a\u00E7\u00E3o"
|
|
167
|
+
},
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "string",
|
|
170
|
+
"resolved": "string",
|
|
171
|
+
"references": {}
|
|
172
|
+
}
|
|
173
|
+
}];
|
|
174
|
+
}
|
|
137
175
|
static get elementRef() { return "_element"; }
|
|
138
176
|
}
|