@sankhyalabs/sankhyablocks 1.4.0-beta.5 → 1.4.0-beta.6
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/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_5.cjs.entry.js +122 -36
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-detail.cjs.entry.js +14 -3
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +14 -7
- package/dist/cjs/snk-filter-search.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +34 -7
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +34 -3
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +37 -15
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +82 -8
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +30 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +17 -4
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +18 -8
- package/dist/components/snk-application2.js +1 -1
- package/dist/components/snk-filter-bar2.js +19 -9
- package/dist/components/snk-filter-binary-select.js +5 -1
- package/dist/components/snk-filter-detail2.js +16 -4
- package/dist/components/snk-filter-item2.js +23 -16
- package/dist/components/snk-filter-list2.js +56 -10
- package/dist/components/snk-filter-modal2.js +30 -5
- package/dist/components/snk-filter-multi-select.js +6 -2
- package/dist/components/snk-filter-number.js +6 -2
- package/dist/components/snk-filter-period.js +5 -1
- package/dist/components/snk-filter-personalized.js +16 -8
- package/dist/components/snk-filter-search.js +5 -1
- package/dist/components/snk-filter-text.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-filter-bar_5.entry.js +122 -36
- package/dist/esm/snk-filter-binary-select.entry.js +3 -0
- package/dist/esm/snk-filter-detail.entry.js +14 -3
- package/dist/esm/snk-filter-multi-select.entry.js +4 -1
- package/dist/esm/snk-filter-number.entry.js +4 -1
- package/dist/esm/snk-filter-period.entry.js +3 -0
- package/dist/esm/snk-filter-personalized.entry.js +14 -7
- package/dist/esm/snk-filter-search.entry.js +3 -0
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/sankhyablocks/{p-01823784.entry.js → p-0ea25487.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c564f823.entry.js → p-1a58f45c.entry.js} +2 -2
- package/dist/sankhyablocks/p-21e940aa.entry.js +1 -0
- package/dist/sankhyablocks/p-40b27004.entry.js +1 -0
- package/dist/sankhyablocks/p-4574a955.entry.js +1 -0
- package/dist/sankhyablocks/p-49580cdd.entry.js +1 -0
- package/dist/sankhyablocks/p-5bdb8452.entry.js +1 -0
- package/dist/sankhyablocks/p-6386d720.entry.js +1 -0
- package/dist/sankhyablocks/p-a14c49db.entry.js +1 -0
- package/dist/sankhyablocks/p-ba426ea9.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +7 -2
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -2
- package/dist/types/components.d.ts +9 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-07ebda01.entry.js +0 -1
- package/dist/sankhyablocks/p-46caa101.entry.js +0 -1
- package/dist/sankhyablocks/p-6f8303f3.entry.js +0 -1
- package/dist/sankhyablocks/p-746fc78b.entry.js +0 -1
- package/dist/sankhyablocks/p-c1c3b5d8.entry.js +0 -1
- package/dist/sankhyablocks/p-c9eec639.entry.js +0 -1
- package/dist/sankhyablocks/p-eea6444c.entry.js +0 -1
- package/dist/sankhyablocks/p-fb705f81.entry.js +0 -1
|
@@ -6,6 +6,8 @@ import buildFilter from './filter-item/dataunitfilter/data-unit-filter-builder';
|
|
|
6
6
|
const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
|
|
7
7
|
const DEFAULT_FILTER = "DEFAULT_FILTER";
|
|
8
8
|
const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
|
|
9
|
+
const ADD_FILTER = "ADD_FILTER";
|
|
10
|
+
const APPLIED_FILTERS = "APPLIED_FILTERS";
|
|
9
11
|
export class SnkFilterBar {
|
|
10
12
|
constructor() {
|
|
11
13
|
this._updateSequence = [];
|
|
@@ -103,13 +105,26 @@ export class SnkFilterBar {
|
|
|
103
105
|
this.dataUnit.loadData();
|
|
104
106
|
}
|
|
105
107
|
}
|
|
108
|
+
itemFocused(selectedItem) {
|
|
109
|
+
this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach(item => {
|
|
110
|
+
if (item.id === selectedItem) {
|
|
111
|
+
if (item.tagName.toLowerCase() === "snk-filter-item" && item.getClientRects()[0].x < 0) {
|
|
112
|
+
item.scrollIntoView({ behavior: "auto", inline: 'nearest' });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
item["hideDetail"]();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
106
120
|
getFilterItems() {
|
|
107
121
|
const pinnedItems = [];
|
|
108
122
|
const unpinnedItems = [];
|
|
109
123
|
this.filterConfig
|
|
110
124
|
.filter(item => item.visible)
|
|
111
125
|
.forEach((item, index) => {
|
|
112
|
-
const
|
|
126
|
+
const itemId = `filter-${item.id}`;
|
|
127
|
+
const filterItem = (h("snk-filter-item", { onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
113
128
|
if (item.fixed || item.hardFixed) {
|
|
114
129
|
pinnedItems.push(filterItem);
|
|
115
130
|
}
|
|
@@ -313,13 +328,8 @@ export class SnkFilterBar {
|
|
|
313
328
|
this.openDefaultFilterModal();
|
|
314
329
|
}
|
|
315
330
|
else if (filterItem) {
|
|
331
|
+
this._pendingFilters.push(itemName);
|
|
316
332
|
this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
|
|
317
|
-
window.requestAnimationFrame(() => {
|
|
318
|
-
const filterItemElement = this._element.querySelector("#filter-" + itemName);
|
|
319
|
-
if (filterItemElement) {
|
|
320
|
-
filterItemElement.showUp();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
333
|
}
|
|
324
334
|
}
|
|
325
335
|
appliedFilterHandler(itemName) {
|
|
@@ -350,7 +360,7 @@ export class SnkFilterBar {
|
|
|
350
360
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
351
361
|
return undefined;
|
|
352
362
|
}
|
|
353
|
-
return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), 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) }), 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) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
363
|
+
return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), 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) }), h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), 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) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
354
364
|
}
|
|
355
365
|
static get is() { return "snk-filter-bar"; }
|
|
356
366
|
static get encapsulation() { return "scoped"; }
|
|
@@ -7953,7 +7953,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7953
7953
|
});
|
|
7954
7954
|
}
|
|
7955
7955
|
render() {
|
|
7956
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "col col--sd-3", closeOutsideClick: true })));
|
|
7956
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "col col--sd-3", closeOutsideClick: true, closeEsc: true })));
|
|
7957
7957
|
}
|
|
7958
7958
|
static get style() { return snkApplicationCss; }
|
|
7959
7959
|
}, [2, "snk-application", {
|
|
@@ -105,11 +105,13 @@ function buildPersonalized(item) {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
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;
|
|
108
|
+
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;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.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);border:none;background-color:transparent}.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.sc-snk-filter-bar:focus-visible{outline:none;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%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}";
|
|
109
109
|
|
|
110
110
|
const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
|
|
111
111
|
const DEFAULT_FILTER = "DEFAULT_FILTER";
|
|
112
112
|
const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
|
|
113
|
+
const ADD_FILTER = "ADD_FILTER";
|
|
114
|
+
const APPLIED_FILTERS = "APPLIED_FILTERS";
|
|
113
115
|
const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
114
116
|
constructor() {
|
|
115
117
|
super();
|
|
@@ -209,13 +211,26 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
209
211
|
this.dataUnit.loadData();
|
|
210
212
|
}
|
|
211
213
|
}
|
|
214
|
+
itemFocused(selectedItem) {
|
|
215
|
+
this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach(item => {
|
|
216
|
+
if (item.id === selectedItem) {
|
|
217
|
+
if (item.tagName.toLowerCase() === "snk-filter-item" && item.getClientRects()[0].x < 0) {
|
|
218
|
+
item.scrollIntoView({ behavior: "auto", inline: 'nearest' });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
item["hideDetail"]();
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
212
226
|
getFilterItems() {
|
|
213
227
|
const pinnedItems = [];
|
|
214
228
|
const unpinnedItems = [];
|
|
215
229
|
this.filterConfig
|
|
216
230
|
.filter(item => item.visible)
|
|
217
231
|
.forEach((item, index) => {
|
|
218
|
-
const
|
|
232
|
+
const itemId = `filter-${item.id}`;
|
|
233
|
+
const filterItem = (h("snk-filter-item", { onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
219
234
|
if (item.fixed || item.hardFixed) {
|
|
220
235
|
pinnedItems.push(filterItem);
|
|
221
236
|
}
|
|
@@ -419,13 +434,8 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
419
434
|
this.openDefaultFilterModal();
|
|
420
435
|
}
|
|
421
436
|
else if (filterItem) {
|
|
437
|
+
this._pendingFilters.push(itemName);
|
|
422
438
|
this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
|
|
423
|
-
window.requestAnimationFrame(() => {
|
|
424
|
-
const filterItemElement = this._element.querySelector("#filter-" + itemName);
|
|
425
|
-
if (filterItemElement) {
|
|
426
|
-
filterItemElement.showUp();
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
439
|
}
|
|
430
440
|
}
|
|
431
441
|
appliedFilterHandler(itemName) {
|
|
@@ -456,7 +466,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
456
466
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
457
467
|
return undefined;
|
|
458
468
|
}
|
|
459
|
-
return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), 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) }), 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) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
469
|
+
return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), 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) }), h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), 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) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
460
470
|
}
|
|
461
471
|
get _element() { return this; }
|
|
462
472
|
static get watchers() { return {
|
|
@@ -32,6 +32,9 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
32
32
|
this.value = undefined;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
async show() {
|
|
36
|
+
this._checkOne.setFocus();
|
|
37
|
+
}
|
|
35
38
|
render() {
|
|
36
39
|
if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
|
|
37
40
|
return undefined;
|
|
@@ -41,7 +44,8 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
41
44
|
}
|
|
42
45
|
}, [0, "snk-filter-binary-select", {
|
|
43
46
|
"value": [1544],
|
|
44
|
-
"config": [16]
|
|
47
|
+
"config": [16],
|
|
48
|
+
"show": [64]
|
|
45
49
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
46
50
|
function defineCustomElement$1() {
|
|
47
51
|
if (typeof customElements === "undefined") {
|
|
@@ -8,6 +8,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
this.filterChange = createEvent(this, "filterChange", 7);
|
|
10
10
|
}
|
|
11
|
+
async show() {
|
|
12
|
+
this._editor["show"]();
|
|
13
|
+
}
|
|
11
14
|
changeConfig(newConfig) {
|
|
12
15
|
this.filterChange.emit(newConfig);
|
|
13
16
|
}
|
|
@@ -36,10 +39,13 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
36
39
|
return undefined;
|
|
37
40
|
}
|
|
38
41
|
return ([
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()),
|
|
43
|
+
this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))
|
|
41
44
|
]);
|
|
42
45
|
}
|
|
46
|
+
buildIcon(title, iconName, action) {
|
|
47
|
+
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button" }, h("ez-icon", { title: title, iconName: iconName })));
|
|
48
|
+
}
|
|
43
49
|
apply() {
|
|
44
50
|
var _a;
|
|
45
51
|
let value = this._editor["value"];
|
|
@@ -83,13 +89,19 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
83
89
|
clear() {
|
|
84
90
|
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
|
85
91
|
}
|
|
92
|
+
onKeyDonwListener(event) {
|
|
93
|
+
if (event.key === "Enter") {
|
|
94
|
+
this._applyButton.setFocus().then(() => this.apply());
|
|
95
|
+
}
|
|
96
|
+
}
|
|
86
97
|
render() {
|
|
87
98
|
const ContentEditor = this.getContentEditor();
|
|
88
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
|
99
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt) }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" }), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
|
89
100
|
}
|
|
90
101
|
}, [0, "snk-filter-detail", {
|
|
91
102
|
"config": [1040],
|
|
92
|
-
"getMessage": [16]
|
|
103
|
+
"getMessage": [16],
|
|
104
|
+
"show": [64]
|
|
93
105
|
}]);
|
|
94
106
|
function defineCustomElement() {
|
|
95
107
|
if (typeof customElements === "undefined") {
|
|
@@ -13,7 +13,6 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
this.detailIsVisible = false;
|
|
16
|
-
this.executeCloseCallback();
|
|
17
16
|
return false;
|
|
18
17
|
};
|
|
19
18
|
}
|
|
@@ -21,29 +20,36 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
21
20
|
return new Promise(resolve => {
|
|
22
21
|
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
|
23
22
|
if (open) {
|
|
23
|
+
this._closeCallback = resolve;
|
|
24
24
|
window.requestAnimationFrame(() => {
|
|
25
|
-
this.
|
|
26
|
-
|
|
25
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
|
|
26
|
+
autoClose: true,
|
|
27
|
+
innerClickTest: this.innerClickCheck,
|
|
28
|
+
backClickListener: () => this.onDetailCloseCallback(),
|
|
29
|
+
left: this.getScrollOffset(),
|
|
30
|
+
useOverlay: true
|
|
31
|
+
});
|
|
32
|
+
this._popover.show();
|
|
33
|
+
this.detailIsVisible = true;
|
|
27
34
|
});
|
|
28
35
|
}
|
|
29
36
|
});
|
|
30
37
|
}
|
|
31
|
-
showDetail() {
|
|
32
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, left: this.getScrollOffset(), useOverlay: true });
|
|
33
|
-
this.detailIsVisible = true;
|
|
34
|
-
}
|
|
35
38
|
getScrollOffset() {
|
|
36
|
-
|
|
39
|
+
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
|
40
|
+
const rect = this._filterItemElement.getBoundingClientRect();
|
|
41
|
+
return `calc(${rect.left}px + ${padding})`;
|
|
37
42
|
}
|
|
38
|
-
hideDetail() {
|
|
39
|
-
if (this.
|
|
40
|
-
|
|
43
|
+
async hideDetail() {
|
|
44
|
+
if (this.detailIsVisible) {
|
|
45
|
+
if (this._floatingID != undefined) {
|
|
46
|
+
FloatingManager.close(this._floatingID);
|
|
47
|
+
}
|
|
41
48
|
}
|
|
49
|
+
}
|
|
50
|
+
onDetailCloseCallback() {
|
|
42
51
|
this._floatingID = undefined;
|
|
43
52
|
this.detailIsVisible = false;
|
|
44
|
-
this.executeCloseCallback();
|
|
45
|
-
}
|
|
46
|
-
executeCloseCallback() {
|
|
47
53
|
if (this._closeCallback) {
|
|
48
54
|
this._closeCallback();
|
|
49
55
|
this._closeCallback = undefined;
|
|
@@ -62,7 +68,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
62
68
|
this.hideDetail();
|
|
63
69
|
}
|
|
64
70
|
else {
|
|
65
|
-
this.
|
|
71
|
+
this.showUp(true);
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
evt.preventDefault();
|
|
@@ -163,7 +169,8 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
163
169
|
"config": [1040],
|
|
164
170
|
"getMessage": [16],
|
|
165
171
|
"detailIsVisible": [32],
|
|
166
|
-
"showUp": [64]
|
|
172
|
+
"showUp": [64],
|
|
173
|
+
"hideDetail": [64]
|
|
167
174
|
}, [[2, "click", "clickListener"], [2, "mousedown", "mouseDownListener"], [0, "filterChange", "filterChangeListener"]]]);
|
|
168
175
|
function defineCustomElement() {
|
|
169
176
|
if (typeof customElements === "undefined") {
|
|
@@ -8,6 +8,7 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.snkItemSelected = createEvent(this, "snkItemSelected", 7);
|
|
11
|
+
this._preselection = -1;
|
|
11
12
|
this.innerClickCheck = (_floatingContainer, node) => {
|
|
12
13
|
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
|
13
14
|
return true;
|
|
@@ -16,25 +17,34 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
16
17
|
return false;
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
this.
|
|
20
|
+
showDetail() {
|
|
21
|
+
this._preselection = -1;
|
|
22
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
|
|
23
|
+
autoClose: true,
|
|
24
|
+
innerClickTest: this.innerClickCheck,
|
|
25
|
+
backClickListener: () => this.onListCloseCallback(),
|
|
26
|
+
useOverlay: true
|
|
27
|
+
});
|
|
21
28
|
this._detailIsVisible = true;
|
|
22
29
|
this._showAll = false;
|
|
23
30
|
this._filterArgument = "";
|
|
31
|
+
this._filterInput.setFocus();
|
|
24
32
|
}
|
|
25
|
-
|
|
33
|
+
async hideDetail() {
|
|
26
34
|
if (this._floatingID != undefined) {
|
|
27
35
|
FloatingManager.close(this._floatingID);
|
|
28
36
|
}
|
|
37
|
+
}
|
|
38
|
+
onListCloseCallback() {
|
|
29
39
|
this._floatingID = undefined;
|
|
30
40
|
this._detailIsVisible = false;
|
|
31
41
|
}
|
|
32
42
|
buttonClick() {
|
|
33
43
|
if (this._detailIsVisible) {
|
|
34
|
-
this.
|
|
44
|
+
this.hideDetail();
|
|
35
45
|
}
|
|
36
46
|
else {
|
|
37
|
-
this.
|
|
47
|
+
this.showDetail();
|
|
38
48
|
}
|
|
39
49
|
}
|
|
40
50
|
componentDidRender() {
|
|
@@ -45,14 +55,15 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
57
|
buildItemElement(item) {
|
|
48
|
-
|
|
58
|
+
const itemId = ++this._selectableItemsCount;
|
|
59
|
+
return (h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name) }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
49
60
|
}
|
|
50
61
|
itemSelected(itemName) {
|
|
51
62
|
if (itemName === SHOW_MORE_ITEM_NAME) {
|
|
52
63
|
this._showAll = true;
|
|
53
64
|
}
|
|
54
65
|
else {
|
|
55
|
-
this.
|
|
66
|
+
this.hideDetail();
|
|
56
67
|
this.snkItemSelected.emit(itemName);
|
|
57
68
|
}
|
|
58
69
|
}
|
|
@@ -66,13 +77,47 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
66
77
|
items.splice(MAX_FILTERS);
|
|
67
78
|
items.push({ kind: "INTERNAL", label: "Mostrar mais", iconName: "dots-horizontal", name: SHOW_MORE_ITEM_NAME, iconClass: "snk-filter-bar__filter-list-item__icon--secondary", labelClass: "snk-filter-bar__filter-list-item__label--secondary" });
|
|
68
79
|
}
|
|
80
|
+
this._selectableItemsCount = 0;
|
|
69
81
|
return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
|
|
70
82
|
}
|
|
71
83
|
getFooterItems() {
|
|
72
84
|
return this.items.filter(item => item.kind === "FOOTER");
|
|
73
85
|
}
|
|
86
|
+
keyDownHandler(event) {
|
|
87
|
+
switch (event.key) {
|
|
88
|
+
case "ArrowDown":
|
|
89
|
+
this.changePreselection(this._preselection + 1);
|
|
90
|
+
//Paramos a propagação do evento para evitar scroll indesejado
|
|
91
|
+
event.stopImmediatePropagation();
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
break;
|
|
95
|
+
case "ArrowUp":
|
|
96
|
+
this.changePreselection(this._preselection - 1);
|
|
97
|
+
//Paramos a propagação do evento para evitar scroll indesejado
|
|
98
|
+
event.stopImmediatePropagation();
|
|
99
|
+
event.stopPropagation();
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
changePreselection(newSelection) {
|
|
105
|
+
if (newSelection < 0) {
|
|
106
|
+
newSelection = this._selectableItemsCount;
|
|
107
|
+
}
|
|
108
|
+
this._preselection = newSelection > this._selectableItemsCount ? 0 : newSelection;
|
|
109
|
+
if (this._preselection === 0) {
|
|
110
|
+
this._filterInput.setFocus();
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const item = this._element.querySelector(`#filter-item${this._preselection}`);
|
|
114
|
+
if (item) {
|
|
115
|
+
item.focus();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
74
119
|
render() {
|
|
75
|
-
return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, 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(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
120
|
+
return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
76
121
|
}
|
|
77
122
|
get _element() { return this; }
|
|
78
123
|
}, [4, "snk-filter-list", {
|
|
@@ -84,8 +129,9 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
84
129
|
"findFilterText": [1, "find-filter-text"],
|
|
85
130
|
"buttonClass": [1, "button-class"],
|
|
86
131
|
"_filterArgument": [32],
|
|
87
|
-
"_showAll": [32]
|
|
88
|
-
|
|
132
|
+
"_showAll": [32],
|
|
133
|
+
"hideDetail": [64]
|
|
134
|
+
}, [[2, "keydown", "keyDownHandler"]]]);
|
|
89
135
|
function defineCustomElement() {
|
|
90
136
|
if (typeof customElements === "undefined") {
|
|
91
137
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
2
|
+
import { ModalAction, ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
3
3
|
import { ArrayUtils } from '@sankhyalabs/core';
|
|
4
4
|
|
|
5
5
|
const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -7,9 +7,12 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
}
|
|
10
|
-
updateValue(id, value) {
|
|
10
|
+
updateValue(id, value = undefined) {
|
|
11
11
|
this.items = this.items.map(item => {
|
|
12
12
|
if (item.id === id) {
|
|
13
|
+
if (value == undefined) {
|
|
14
|
+
value = !item.active;
|
|
15
|
+
}
|
|
13
16
|
return Object.assign(Object.assign({}, item), { active: value });
|
|
14
17
|
}
|
|
15
18
|
return item;
|
|
@@ -22,12 +25,34 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
22
25
|
}
|
|
23
26
|
return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
|
|
24
27
|
}
|
|
25
|
-
|
|
26
|
-
return
|
|
28
|
+
buildItems(list) {
|
|
29
|
+
return list.map(item => {
|
|
30
|
+
return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex: "-1", class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: "switch" }), h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
itemKeyBoardSelect(event, item) {
|
|
34
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
35
|
+
this.updateValue(item.id);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
modalActionListener(evt) {
|
|
39
|
+
const modalAction = evt.detail;
|
|
40
|
+
if (modalAction === ModalAction.LOAD) {
|
|
41
|
+
if (this._filterInput) {
|
|
42
|
+
this._filterInput.setFocus();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.processModalAction(modalAction);
|
|
47
|
+
}
|
|
27
48
|
}
|
|
28
49
|
render() {
|
|
29
50
|
const allowCancel = this.items.filter(item => item.active).length > 0;
|
|
30
|
-
|
|
51
|
+
const items = (this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : []);
|
|
52
|
+
return (h("ez-modal-container", { modalTitle: this.modalTitle, modalSubTitle: this.modalSubTitle, cancelButtonLabel: this.cancelButtonLabel, okButtonLabel: this.okButtonLabel, onEzModalAction: evt => this.modalActionListener(evt), cancelButtonStatus: allowCancel ? ModalButtonStatus.ENABLED : ModalButtonStatus.DISABLED }, h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-modal-content" }, h("div", null, this.useSearch ?
|
|
53
|
+
h("ez-filter-input", { ref: ref => this._filterInput = ref, label: this.getMessage("snkFilterBar.modalFindFilter"), onEzChange: (evt) => this._filterArgument = evt.detail })
|
|
54
|
+
:
|
|
55
|
+
undefined), items.length > 0 ? h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding-bottom--small" }, this.getActiveFiltersMsg()) : undefined, h("div", null, this.buildItems(items)), h("div", { class: "ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large" }, this.infoText))));
|
|
31
56
|
}
|
|
32
57
|
}, [0, "snk-filter-modal", {
|
|
33
58
|
"getMessage": [16],
|
|
@@ -9,15 +9,19 @@ const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
9
9
|
ezChangeListener(evt) {
|
|
10
10
|
this.value = evt.detail.value;
|
|
11
11
|
}
|
|
12
|
+
async show() {
|
|
13
|
+
this._comboElement.setFocus();
|
|
14
|
+
}
|
|
12
15
|
render() {
|
|
13
16
|
if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
|
|
14
17
|
return undefined;
|
|
15
18
|
}
|
|
16
|
-
return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
19
|
+
return (h("ez-combo-box", { ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
17
20
|
}
|
|
18
21
|
}, [0, "snk-filter-multi-select", {
|
|
19
22
|
"value": [1544],
|
|
20
|
-
"config": [16]
|
|
23
|
+
"config": [16],
|
|
24
|
+
"show": [64]
|
|
21
25
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
22
26
|
function defineCustomElement$1() {
|
|
23
27
|
if (typeof customElements === "undefined") {
|
|
@@ -9,16 +9,20 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
9
9
|
ezChangeListener(evt) {
|
|
10
10
|
this.value = evt.detail;
|
|
11
11
|
}
|
|
12
|
+
async show() {
|
|
13
|
+
this._numberElement.setFocus();
|
|
14
|
+
}
|
|
12
15
|
render() {
|
|
13
16
|
var _a;
|
|
14
17
|
if (!this.config || this.config.type !== FilterItemType.NUMBER) {
|
|
15
18
|
return undefined;
|
|
16
19
|
}
|
|
17
|
-
return (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
|
+
return (h("ez-number-input", { ref: ref => this._numberElement = ref, label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
18
21
|
}
|
|
19
22
|
}, [0, "snk-filter-number", {
|
|
20
23
|
"config": [16],
|
|
21
|
-
"value": [2]
|
|
24
|
+
"value": [2],
|
|
25
|
+
"show": [64]
|
|
22
26
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
23
27
|
function defineCustomElement$1() {
|
|
24
28
|
if (typeof customElements === "undefined") {
|
|
@@ -23,6 +23,9 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
23
23
|
}
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
+
async show() {
|
|
27
|
+
this._startDate.setFocus();
|
|
28
|
+
}
|
|
26
29
|
render() {
|
|
27
30
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
|
28
31
|
return undefined;
|
|
@@ -31,7 +34,8 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
31
34
|
}
|
|
32
35
|
}, [0, "snk-filter-period", {
|
|
33
36
|
"config": [16],
|
|
34
|
-
"value": [8]
|
|
37
|
+
"value": [8],
|
|
38
|
+
"show": [64]
|
|
35
39
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
36
40
|
function defineCustomElement$1() {
|
|
37
41
|
if (typeof customElements === "undefined") {
|
|
@@ -46,27 +46,34 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
46
46
|
const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
|
|
47
47
|
return params.map((param, index) => {
|
|
48
48
|
var _a;
|
|
49
|
+
const elemId = 'param_' + index;
|
|
49
50
|
switch (param.type) {
|
|
50
51
|
case UserInterface.SEARCH:
|
|
51
|
-
return h("ez-search", { suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
|
52
|
+
return h("ez-search", { id: elemId, suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
|
52
53
|
case UserInterface.SWITCH:
|
|
53
54
|
case UserInterface.CHECKBOX:
|
|
54
55
|
const mode = UserInterface.SWITCH === param.type ? "switch" : "regular";
|
|
55
|
-
return h("ez-check", { class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
56
|
+
return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
56
57
|
case UserInterface.DECIMALNUMBER:
|
|
57
58
|
case UserInterface.INTEGERNUMBER:
|
|
58
|
-
return h("ez-number-input", { label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
59
|
+
return h("ez-number-input", { id: elemId, label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
59
60
|
case UserInterface.OPTIONSELECTOR:
|
|
60
|
-
return h("ez-combo-box", { label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
|
|
61
|
+
return h("ez-combo-box", { id: elemId, label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
|
|
61
62
|
case UserInterface.DATE:
|
|
62
|
-
return h("ez-date-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
63
|
+
return h("ez-date-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
63
64
|
case UserInterface.DATETIME:
|
|
64
|
-
return h("ez-date-time-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
65
|
+
return h("ez-date-time-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
65
66
|
default:
|
|
66
|
-
return h("ez-text-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
67
|
+
return h("ez-text-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
70
|
}
|
|
71
|
+
async show() {
|
|
72
|
+
const elem = document.querySelector("#param_0");
|
|
73
|
+
if (elem) {
|
|
74
|
+
elem["setFocus"]();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
70
77
|
render() {
|
|
71
78
|
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
|
|
72
79
|
return undefined;
|
|
@@ -75,7 +82,8 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
75
82
|
}
|
|
76
83
|
}, [0, "snk-filter-personalized", {
|
|
77
84
|
"config": [16],
|
|
78
|
-
"value": [1040]
|
|
85
|
+
"value": [1040],
|
|
86
|
+
"show": [64]
|
|
79
87
|
}]);
|
|
80
88
|
function defineCustomElement$1() {
|
|
81
89
|
if (typeof customElements === "undefined") {
|
|
@@ -21,6 +21,9 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
async show() {
|
|
25
|
+
this._searchInput.setFocus();
|
|
26
|
+
}
|
|
24
27
|
render() {
|
|
25
28
|
if (!this.config || this.config.type !== FilterItemType.SEARCH) {
|
|
26
29
|
return undefined;
|
|
@@ -29,7 +32,8 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
29
32
|
}
|
|
30
33
|
}, [0, "snk-filter-search", {
|
|
31
34
|
"config": [16],
|
|
32
|
-
"value": [16]
|
|
35
|
+
"value": [16],
|
|
36
|
+
"show": [64]
|
|
33
37
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
34
38
|
function defineCustomElement$1() {
|
|
35
39
|
if (typeof customElements === "undefined") {
|