@sankhyalabs/sankhyablocks 1.4.0-beta.4 → 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/{SnkMessageBuilder-d8215915.js → SnkMessageBuilder-b54dfb89.js} +6 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +9 -3
- package/dist/cjs/snk-data-unit.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 +12 -3
- 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/collection/lib/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/crud-utils.msg.js +4 -0
- package/dist/collection/lib/utils/CrudUtils.js +73 -0
- package/dist/components/SnkMessageBuilder.js +6 -1
- package/dist/components/snk-application2.js +8 -2
- 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/{SnkMessageBuilder-35a20271.js → SnkMessageBuilder-d440381c.js} +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +9 -3
- package/dist/esm/snk-data-unit.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-8bbc0cbb.entry.js → p-1a58f45c.entry.js} +2 -2
- package/dist/sankhyablocks/p-21e940aa.entry.js +1 -0
- package/dist/sankhyablocks/{p-8f3c5709.entry.js → p-2e49afef.entry.js} +1 -1
- package/dist/sankhyablocks/{p-586e2522.js → p-2eea7eea.js} +1 -1
- 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-application/snk-application.d.ts +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 +10 -1
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/message/resources/crud-utils.msg.d.ts +2 -0
- package/dist/types/lib/utils/CrudUtils.d.ts +6 -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
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
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
|
export class SnkFilterModal {
|
|
5
|
-
updateValue(id, value) {
|
|
5
|
+
updateValue(id, value = undefined) {
|
|
6
6
|
this.items = this.items.map(item => {
|
|
7
7
|
if (item.id === id) {
|
|
8
|
+
if (value == undefined) {
|
|
9
|
+
value = !item.active;
|
|
10
|
+
}
|
|
8
11
|
return Object.assign(Object.assign({}, item), { active: value });
|
|
9
12
|
}
|
|
10
13
|
return item;
|
|
@@ -17,12 +20,34 @@ export class SnkFilterModal {
|
|
|
17
20
|
}
|
|
18
21
|
return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
return
|
|
23
|
+
buildItems(list) {
|
|
24
|
+
return list.map(item => {
|
|
25
|
+
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)));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
itemKeyBoardSelect(event, item) {
|
|
29
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
30
|
+
this.updateValue(item.id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
modalActionListener(evt) {
|
|
34
|
+
const modalAction = evt.detail;
|
|
35
|
+
if (modalAction === ModalAction.LOAD) {
|
|
36
|
+
if (this._filterInput) {
|
|
37
|
+
this._filterInput.setFocus();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.processModalAction(modalAction);
|
|
42
|
+
}
|
|
22
43
|
}
|
|
23
44
|
render() {
|
|
24
45
|
const allowCancel = this.items.filter(item => item.active).length > 0;
|
|
25
|
-
|
|
46
|
+
const items = (this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : []);
|
|
47
|
+
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 ?
|
|
48
|
+
h("ez-filter-input", { ref: ref => this._filterInput = ref, label: this.getMessage("snkFilterBar.modalFindFilter"), onEzChange: (evt) => this._filterArgument = evt.detail })
|
|
49
|
+
:
|
|
50
|
+
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))));
|
|
26
51
|
}
|
|
27
52
|
static get is() { return "snk-filter-modal"; }
|
|
28
53
|
static get properties() {
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
|
|
47
47
|
.snk-filter-item__editor-header-button{
|
|
48
48
|
cursor: pointer;
|
|
49
|
-
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
border: none;
|
|
51
|
+
padding: 3px;
|
|
52
|
+
outline-color: var(--color--primary);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
.snk-filter-bar__divider{
|
|
@@ -62,6 +65,8 @@
|
|
|
62
65
|
.snk-filter-bar__filter-list-item{
|
|
63
66
|
cursor: pointer;
|
|
64
67
|
border-radius: var(--border--radius-small, 6px);
|
|
68
|
+
border: none;
|
|
69
|
+
background-color: transparent;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
.snk-filter-bar__filter-list-item__label{
|
|
@@ -80,8 +85,8 @@
|
|
|
80
85
|
--ez-icon--color: var(--text--secondary);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
.snk-filter-bar__filter-list-item
|
|
84
|
-
|
|
88
|
+
.snk-filter-bar__filter-list-item:focus-visible {
|
|
89
|
+
outline: none;
|
|
85
90
|
background-color: var(--background--medium);
|
|
86
91
|
}
|
|
87
92
|
|
|
@@ -114,10 +119,19 @@
|
|
|
114
119
|
}
|
|
115
120
|
|
|
116
121
|
.snk-filter-bar__filter-modal-item{
|
|
122
|
+
--modal-item-border-width: 2px;
|
|
117
123
|
display: flex;
|
|
118
124
|
flex-direction: row;
|
|
125
|
+
margin-left: var(--modal-item-border-width);
|
|
119
126
|
border-radius: var(--border--radius-medium, 12px);
|
|
120
127
|
background-color: var(--background--medium, #f0f3f7);
|
|
128
|
+
border: none;
|
|
129
|
+
width: 100%;
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.snk-filter-bar__filter-modal-item:focus-visible{
|
|
134
|
+
outline: var(--color--primary) solid var(--modal-item-border-width);
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
.snk-filter-bar__filter-modal-item__check{
|
|
@@ -125,7 +139,6 @@
|
|
|
125
139
|
}
|
|
126
140
|
.snk-filter-bar__filter-modal-item__label{
|
|
127
141
|
font-weight: var(--text-weight--medium);
|
|
128
|
-
width: 100%;
|
|
129
142
|
}
|
|
130
143
|
|
|
131
144
|
.snk-filter-bar__filter-modal-content{
|
|
@@ -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"; }
|
|
@@ -2,13 +2,15 @@ import snkDataUnitMessages from "./resources/snk-data-unit.msg.js";
|
|
|
2
2
|
import snkFilterBarMessages from "./resources/snk-filter-bar.msg.js";
|
|
3
3
|
import snkFormMessages from "./resources/snk-form.msg.js";
|
|
4
4
|
import snkTaskbarMessages from "./resources/snk-taskbar.msg.js";
|
|
5
|
+
import crudUtilsMessages from "./resources/crud-utils.msg.js";
|
|
5
6
|
export class SnkMessageBuilder {
|
|
6
7
|
constructor() {
|
|
7
8
|
this._defaults = {
|
|
8
9
|
snkDataUnit: snkDataUnitMessages,
|
|
9
10
|
snkForm: snkFormMessages,
|
|
10
11
|
snkTaskbar: snkTaskbarMessages,
|
|
11
|
-
snkFilterBar: snkFilterBarMessages
|
|
12
|
+
snkFilterBar: snkFilterBarMessages,
|
|
13
|
+
crudUtils: crudUtilsMessages
|
|
12
14
|
};
|
|
13
15
|
this._currentOperation = OperationMap.CLEAN;
|
|
14
16
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { DataFetcher } from '../';
|
|
2
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
export class CrudUtils {
|
|
4
|
+
static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
|
|
5
|
+
const SERVICE_CRUD_FIND = "mge@crud.find";
|
|
6
|
+
let parsedFields = [];
|
|
7
|
+
let parsedCriteria = [];
|
|
8
|
+
let literalCriteria = {};
|
|
9
|
+
let application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
10
|
+
if (fields) {
|
|
11
|
+
if (!Array.isArray(fields)) {
|
|
12
|
+
throw new Error(application.messagesBuilder.getMessage("crudUtils.errorArray", null));
|
|
13
|
+
}
|
|
14
|
+
fields.forEach((fieldName) => {
|
|
15
|
+
parsedFields.push({
|
|
16
|
+
name: fieldName
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (criteria) {
|
|
21
|
+
for (const key in criteria) {
|
|
22
|
+
if (criteria.hasOwnProperty(key)) {
|
|
23
|
+
parsedCriteria.push({ nome: key, valor: criteria[key] });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
if (criteriaExpression) {
|
|
29
|
+
literalCriteria = {
|
|
30
|
+
expression: {
|
|
31
|
+
$: criteriaExpression
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
let request = {
|
|
36
|
+
requestBody: {
|
|
37
|
+
entity: {
|
|
38
|
+
name: entityName,
|
|
39
|
+
criterio: parsedCriteria,
|
|
40
|
+
fields: {
|
|
41
|
+
field: parsedFields
|
|
42
|
+
},
|
|
43
|
+
literalCriteria: literalCriteria,
|
|
44
|
+
orderby: orderBy
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
|
|
50
|
+
var _a;
|
|
51
|
+
let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
|
|
52
|
+
if (entities != undefined) {
|
|
53
|
+
let crudFindResult = {
|
|
54
|
+
fields: new Map()
|
|
55
|
+
};
|
|
56
|
+
for (let key in entities) {
|
|
57
|
+
let fieldValue = entities[key];
|
|
58
|
+
if (fieldValue.hasOwnProperty('$')) {
|
|
59
|
+
crudFindResult.fields.set(key, fieldValue.$);
|
|
60
|
+
}
|
|
61
|
+
if (onlyFirst) {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
resolve(crudFindResult);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
resolve(null);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -78,13 +78,18 @@ const snkTaskbarMessages = {
|
|
|
78
78
|
forbidden: "Permissão não liberada"
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
const crudUtilsMessages = {
|
|
82
|
+
errorArray: "CrudUtils.find deve receber um array de fields, ou uma lista separada por virgula.",
|
|
83
|
+
};
|
|
84
|
+
|
|
81
85
|
class SnkMessageBuilder {
|
|
82
86
|
constructor() {
|
|
83
87
|
this._defaults = {
|
|
84
88
|
snkDataUnit: snkDataUnitMessages,
|
|
85
89
|
snkForm: snkFormMessages,
|
|
86
90
|
snkTaskbar: snkTaskbarMessages,
|
|
87
|
-
snkFilterBar: snkFilterBarMessages
|
|
91
|
+
snkFilterBar: snkFilterBarMessages,
|
|
92
|
+
crudUtils: crudUtilsMessages
|
|
88
93
|
};
|
|
89
94
|
this._currentOperation = OperationMap.CLEAN;
|
|
90
95
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -7541,10 +7541,14 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7541
7541
|
/**
|
|
7542
7542
|
* Mostra o conteúdo passado em um Popup
|
|
7543
7543
|
*/
|
|
7544
|
-
async showPopUp(content) {
|
|
7544
|
+
async showPopUp(content, size = "full") {
|
|
7545
7545
|
this.clearContent(this._popUp);
|
|
7546
|
+
if (content.tagName === 'EZ-MODAL-CONTAINER') {
|
|
7547
|
+
this._popUp.useHeader = false;
|
|
7548
|
+
}
|
|
7546
7549
|
this._popUp.appendChild(content);
|
|
7547
7550
|
this._popUp.opened = true;
|
|
7551
|
+
this._popUp.heightMode = size;
|
|
7548
7552
|
}
|
|
7549
7553
|
async showModal(content) {
|
|
7550
7554
|
this.clearContent(this._rightModal);
|
|
@@ -7561,6 +7565,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7561
7565
|
async closePopUp() {
|
|
7562
7566
|
this.clearContent(this._popUp);
|
|
7563
7567
|
this._popUp.opened = false;
|
|
7568
|
+
this._popUp.useHeader = true;
|
|
7569
|
+
this._popUp.heightMode = "full";
|
|
7564
7570
|
}
|
|
7565
7571
|
/**
|
|
7566
7572
|
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
@@ -7947,7 +7953,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7947
7953
|
});
|
|
7948
7954
|
}
|
|
7949
7955
|
render() {
|
|
7950
|
-
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 })));
|
|
7951
7957
|
}
|
|
7952
7958
|
static get style() { return snkApplicationCss; }
|
|
7953
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") {
|