@sankhyalabs/sankhyablocks 5.6.0 → 5.8.0
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-e64dce7f.js → SnkMessageBuilder-1760d2c9.js} +16 -1
- package/dist/cjs/{filter-item-type.enum-3daf58d3.js → filter-item-type.enum-aa823a00.js} +1 -0
- package/dist/cjs/filter-type.enum-b14ce507.js +11 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/presentationMode-52ec3bdd.js +7 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-85d6565e.js → snk-data-unit-f27603c9.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +52 -140
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +26 -15
- package/dist/cjs/snk-filter-detail.cjs.entry.js +5 -10
- package/dist/cjs/snk-filter-item.cjs.entry.js +36 -8
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +67 -0
- package/dist/cjs/snk-filter-modal.cjs.entry.js +72 -49
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +18 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -0
- package/dist/cjs/snk-grid.cjs.entry.js +8 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js +5 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +60 -29
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +72 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +1 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +5 -10
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +36 -8
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +32 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +116 -156
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css +8 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +116 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +19 -142
- package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js +7 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +36 -0
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +315 -0
- package/dist/collection/components/snk-grid/snk-grid.js +8 -1
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +16 -1
- package/dist/components/SnkMessageBuilder.js +16 -1
- package/dist/components/filter-item-type.enum.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/presentationMode.js +7 -0
- package/dist/components/snk-crud.js +22 -34
- package/dist/components/snk-detail-view2.js +24 -46
- package/dist/components/snk-filter-bar2.js +57 -157
- package/dist/components/snk-filter-binary-select.js +27 -16
- package/dist/components/snk-filter-detail2.js +5 -10
- package/dist/components/snk-filter-item2.js +36 -8
- package/dist/components/snk-filter-list.js +171 -1
- package/dist/components/snk-filter-modal-item.d.ts +11 -0
- package/dist/components/snk-filter-modal-item.js +6 -0
- package/dist/components/snk-filter-modal-item2.js +86 -0
- package/dist/components/snk-filter-modal.js +118 -1
- package/dist/components/snk-filter-multi-select.js +3 -1
- package/dist/components/snk-filter-number.js +3 -1
- package/dist/components/snk-filter-period.js +20 -2
- package/dist/components/snk-filter-personalized.js +3 -1
- package/dist/components/snk-filter-search.js +3 -1
- package/dist/components/snk-filter-text.js +3 -1
- package/dist/components/snk-grid2.js +18 -23
- package/dist/esm/{SnkMessageBuilder-f3590f65.js → SnkMessageBuilder-4caf8b4f.js} +16 -1
- package/dist/esm/{filter-item-type.enum-a79b2fa8.js → filter-item-type.enum-5028ed3f.js} +1 -0
- package/dist/esm/filter-type.enum-a80c1b6b.js +9 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/presentationMode-783bbf9d.js +7 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-50b1660c.js → snk-data-unit-640399b3.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +53 -141
- package/dist/esm/snk-filter-binary-select.entry.js +27 -16
- package/dist/esm/snk-filter-detail.entry.js +6 -11
- package/dist/esm/snk-filter-item.entry.js +37 -9
- package/dist/esm/snk-filter-modal-item.entry.js +63 -0
- package/dist/esm/snk-filter-modal.entry.js +73 -50
- package/dist/esm/snk-filter-multi-select.entry.js +4 -2
- package/dist/esm/snk-filter-number.entry.js +4 -2
- package/dist/esm/snk-filter-period.entry.js +19 -3
- package/dist/esm/snk-filter-personalized.entry.js +4 -2
- package/dist/esm/snk-filter-search.entry.js +4 -2
- package/dist/esm/snk-filter-text.entry.js +3 -1
- package/dist/esm/snk-grid.entry.js +8 -1
- package/dist/sankhyablocks/p-08779202.entry.js +1 -0
- package/dist/sankhyablocks/p-1465f132.entry.js +1 -0
- package/dist/sankhyablocks/p-1a68fb59.js +1 -0
- package/dist/sankhyablocks/{p-f344b811.entry.js → p-21c2b733.entry.js} +1 -1
- package/dist/sankhyablocks/p-29c1889f.js +1 -0
- package/dist/sankhyablocks/p-355e7ab0.entry.js +1 -0
- package/dist/sankhyablocks/p-3794686e.entry.js +1 -0
- package/dist/sankhyablocks/{p-c4417efb.entry.js → p-4181c36d.entry.js} +1 -1
- package/dist/sankhyablocks/p-4ce96831.entry.js +1 -0
- package/dist/sankhyablocks/{p-3fbe2d69.entry.js → p-57b74971.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9dd2b8cb.js → p-584d7212.js} +1 -1
- package/dist/sankhyablocks/p-59705471.entry.js +1 -0
- package/dist/sankhyablocks/{p-3d3263b4.js → p-6981c03e.js} +1 -1
- package/dist/sankhyablocks/p-786ae316.entry.js +1 -0
- package/dist/sankhyablocks/p-80e52e85.entry.js +1 -0
- package/dist/sankhyablocks/p-8efb0f47.entry.js +1 -0
- package/dist/sankhyablocks/p-9af04fc7.entry.js +1 -0
- package/dist/sankhyablocks/{p-df8f13b4.entry.js → p-9c3f0caf.entry.js} +1 -1
- package/dist/sankhyablocks/p-9cbc3925.entry.js +1 -0
- package/dist/sankhyablocks/p-b9fb86fe.entry.js +1 -0
- package/dist/sankhyablocks/p-d9804798.js +1 -0
- package/dist/sankhyablocks/p-e2bb9c9a.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/enum/presentationMode.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +11 -1
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +37 -0
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +17 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -11
- package/dist/types/components/snk-filter-bar/types/filter-type.enum.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +20 -0
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +186 -0
- package/dist/types/components.d.ts +119 -56
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/components/snk-filter-list2.js +0 -173
- package/dist/components/snk-filter-modal2.js +0 -97
- package/dist/sankhyablocks/p-1dcfd32a.entry.js +0 -1
- package/dist/sankhyablocks/p-3a2ce158.entry.js +0 -1
- package/dist/sankhyablocks/p-5e62a17b.entry.js +0 -1
- package/dist/sankhyablocks/p-5fc55684.entry.js +0 -1
- package/dist/sankhyablocks/p-73e830cf.entry.js +0 -1
- package/dist/sankhyablocks/p-86d29b6f.entry.js +0 -1
- package/dist/sankhyablocks/p-ad51bf1c.entry.js +0 -1
- package/dist/sankhyablocks/p-afba9bbe.entry.js +0 -1
- package/dist/sankhyablocks/p-c336170d.entry.js +0 -1
- package/dist/sankhyablocks/p-c9477950.js +0 -1
- package/dist/sankhyablocks/p-d5c9c1f8.entry.js +0 -1
- package/dist/sankhyablocks/p-ee82c157.entry.js +0 -1
- package/dist/sankhyablocks/p-fac37198.entry.js +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
2
|
+
import { FloatingManager, DateUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
|
5
5
|
|
@@ -116,16 +116,17 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
116
116
|
evt.stopPropagation();
|
117
117
|
}
|
118
118
|
}
|
119
|
-
getLabel() {
|
119
|
+
getLabel(isTooltipLabel = false) {
|
120
120
|
const { type, value, label, props } = this.config;
|
121
121
|
if (value) {
|
122
122
|
if (type === FilterItemType.BINARY_SELECT) {
|
123
123
|
const [optOne, optTwo] = props.options;
|
124
|
+
const tooltip = this.getMessage('snkFilterBar.binarySelectTooltip');
|
124
125
|
if (optOne.name === value) {
|
125
|
-
return optOne.label;
|
126
|
+
return isTooltipLabel ? `${tooltip} ${String(optOne.label).toLowerCase()}` : optOne.label;
|
126
127
|
}
|
127
128
|
if (optTwo.name === value) {
|
128
|
-
return optTwo.label;
|
129
|
+
return isTooltipLabel ? `${tooltip} ${String(optTwo.label).toLowerCase()}` : optTwo.label;
|
129
130
|
}
|
130
131
|
}
|
131
132
|
if (type === FilterItemType.MULTI_SELECT) {
|
@@ -144,14 +145,21 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
144
145
|
}
|
145
146
|
const dateFormater = new Intl.DateTimeFormat("pt-BR");
|
146
147
|
if (end && start) {
|
147
|
-
|
148
|
+
const isSameYear = start.getFullYear() === end.getFullYear();
|
149
|
+
const formatOptions = Object.assign({ day: '2-digit', month: '2-digit' }, ((!isSameYear || isTooltipLabel) && { year: '2-digit' }));
|
150
|
+
const startLabel = DateUtils.formatDate(start, formatOptions);
|
151
|
+
const endLabel = DateUtils.formatDate(end, formatOptions);
|
152
|
+
if (isTooltipLabel) {
|
153
|
+
return this.getMessage('snkFilterBar.fullPeriodTooltip', { LABEL: label, START_LABEL: startLabel, END_LABEL: endLabel });
|
154
|
+
}
|
155
|
+
return `${label}: ${startLabel} \u2192 ${endLabel}`;
|
148
156
|
}
|
149
157
|
else {
|
150
158
|
if (start) {
|
151
|
-
return `${label}:
|
159
|
+
return `${label}: ${this.getMessage('snkFilterBar.onlyStartPeriodToltip')} ${dateFormater.format(start)}`;
|
152
160
|
}
|
153
161
|
else if (end) {
|
154
|
-
return `${label}:
|
162
|
+
return `${label}: ${this.getMessage('snkFilterBar.onlyEndPeriodToltip')} ${dateFormater.format(end)}`;
|
155
163
|
}
|
156
164
|
else {
|
157
165
|
return label;
|
@@ -164,10 +172,30 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
164
172
|
if (type === FilterItemType.PERSONALIZED) {
|
165
173
|
return label;
|
166
174
|
}
|
175
|
+
if (type === FilterItemType.MULTI_LIST) {
|
176
|
+
const selectedOptions = value.filter(item => item.check);
|
177
|
+
const checkedAmount = selectedOptions.length;
|
178
|
+
if (checkedAmount > 1) {
|
179
|
+
if (isTooltipLabel) {
|
180
|
+
const selectedOptionsDescrptions = selectedOptions.map(item => item.description);
|
181
|
+
return `${label}: ${selectedOptionsDescrptions.join(',')}`;
|
182
|
+
}
|
183
|
+
return `${label}: ${checkedAmount} ${this.getMessage('snkFilterBar.multiListToltip')}`;
|
184
|
+
}
|
185
|
+
return `${label}: ${value.description}`;
|
186
|
+
}
|
167
187
|
return `${label}: ${value}`;
|
168
188
|
}
|
169
189
|
return label;
|
170
190
|
}
|
191
|
+
applyTooltip() {
|
192
|
+
if (!this.config.value)
|
193
|
+
return undefined;
|
194
|
+
return {
|
195
|
+
'data-tooltip': this.getLabel(true),
|
196
|
+
'data-flow': 'bottom'
|
197
|
+
};
|
198
|
+
}
|
171
199
|
componentDidLoad() {
|
172
200
|
if (this._filterItemElement) {
|
173
201
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
@@ -205,7 +233,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
205
233
|
}
|
206
234
|
render() {
|
207
235
|
const leftIcon = this.getLeftIconName();
|
208
|
-
return (h(Host,
|
236
|
+
return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
209
237
|
}
|
210
238
|
get _filterItemElement() { return this; }
|
211
239
|
static get watchers() { return {
|
@@ -1,4 +1,174 @@
|
|
1
|
-
import {
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
+
import { FloatingManager, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
|
3
|
+
|
4
|
+
const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
|
5
|
+
const MAX_FILTERS = 5;
|
6
|
+
const SnkFilterList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.snkItemSelected = createEvent(this, "snkItemSelected", 7);
|
11
|
+
this._preselection = -1;
|
12
|
+
this.innerClickCheck = (_floatingContainer, node) => {
|
13
|
+
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
14
|
+
return true;
|
15
|
+
}
|
16
|
+
this._detailIsVisible = false;
|
17
|
+
return false;
|
18
|
+
};
|
19
|
+
this._filterArgument = undefined;
|
20
|
+
this._showAll = undefined;
|
21
|
+
this.label = undefined;
|
22
|
+
this.iconName = undefined;
|
23
|
+
this.items = undefined;
|
24
|
+
this.getMessage = undefined;
|
25
|
+
this.emptyText = undefined;
|
26
|
+
this.findFilterText = undefined;
|
27
|
+
this.buttonClass = undefined;
|
28
|
+
}
|
29
|
+
showDetail() {
|
30
|
+
this._preselection = -1;
|
31
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
|
32
|
+
autoClose: true,
|
33
|
+
innerClickTest: this.innerClickCheck,
|
34
|
+
backClickListener: () => this.onListCloseCallback(),
|
35
|
+
useOverlay: true
|
36
|
+
});
|
37
|
+
this._detailIsVisible = true;
|
38
|
+
this._showAll = false;
|
39
|
+
this._filterArgument = "";
|
40
|
+
this._filterInput.setFocus();
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Oculta os detalhes do componente snk-filter-list.
|
44
|
+
*/
|
45
|
+
async hideDetail() {
|
46
|
+
if (this._floatingID != undefined) {
|
47
|
+
FloatingManager.close(this._floatingID);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
onListCloseCallback() {
|
51
|
+
this._floatingID = undefined;
|
52
|
+
this._detailIsVisible = false;
|
53
|
+
}
|
54
|
+
buttonClick() {
|
55
|
+
if (this._detailIsVisible) {
|
56
|
+
this.hideDetail();
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
this.showDetail();
|
60
|
+
}
|
61
|
+
}
|
62
|
+
componentDidLoad() {
|
63
|
+
if (this._element) {
|
64
|
+
ElementIDUtils.addIDInfo(this._element);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
componentDidRender() {
|
68
|
+
if (this._floatingID == undefined) {
|
69
|
+
if (this._popover) {
|
70
|
+
this._popover.remove();
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
buildIdElement(buttonElement, name) {
|
75
|
+
if (!buttonElement)
|
76
|
+
return;
|
77
|
+
const dataElement = { id: name };
|
78
|
+
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
79
|
+
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "filterItemList", dataElement);
|
80
|
+
}
|
81
|
+
buildItemElement(item) {
|
82
|
+
const itemId = ++this._selectableItemsCount;
|
83
|
+
return (h("button", { ref: elem => elem && this.buildIdElement(elem, item.label), 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), name: item.label, key: itemId }, 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)));
|
84
|
+
}
|
85
|
+
itemSelected(itemName) {
|
86
|
+
if (itemName === SHOW_MORE_ITEM_NAME) {
|
87
|
+
this._showAll = true;
|
88
|
+
}
|
89
|
+
else {
|
90
|
+
this.hideDetail();
|
91
|
+
this.snkItemSelected.emit(itemName);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
getFilterItems() {
|
95
|
+
const items = this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
|
96
|
+
if (items.length === 0) {
|
97
|
+
return 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);
|
98
|
+
}
|
99
|
+
const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
|
100
|
+
if (hideItems) {
|
101
|
+
items.splice(MAX_FILTERS);
|
102
|
+
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" });
|
103
|
+
}
|
104
|
+
this._selectableItemsCount = 0;
|
105
|
+
return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
|
106
|
+
}
|
107
|
+
getFooterItems() {
|
108
|
+
return this.items.filter(item => item.kind === "FOOTER");
|
109
|
+
}
|
110
|
+
keyDownHandler(event) {
|
111
|
+
switch (event.key) {
|
112
|
+
case "ArrowDown":
|
113
|
+
this.changePreselection(this._preselection + 1);
|
114
|
+
//Paramos a propagação do evento para evitar scroll indesejado
|
115
|
+
event.stopImmediatePropagation();
|
116
|
+
event.stopPropagation();
|
117
|
+
event.preventDefault();
|
118
|
+
break;
|
119
|
+
case "ArrowUp":
|
120
|
+
this.changePreselection(this._preselection - 1);
|
121
|
+
//Paramos a propagação do evento para evitar scroll indesejado
|
122
|
+
event.stopImmediatePropagation();
|
123
|
+
event.stopPropagation();
|
124
|
+
event.preventDefault();
|
125
|
+
break;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
changePreselection(newSelection) {
|
129
|
+
if (newSelection < 0) {
|
130
|
+
newSelection = this._selectableItemsCount;
|
131
|
+
}
|
132
|
+
this._preselection = newSelection > this._selectableItemsCount ? 0 : newSelection;
|
133
|
+
if (this._preselection === 0) {
|
134
|
+
this._filterInput.setFocus();
|
135
|
+
}
|
136
|
+
else {
|
137
|
+
const item = this._element.querySelector(`#filter-item${this._preselection}`);
|
138
|
+
if (item) {
|
139
|
+
item.focus();
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
render() {
|
144
|
+
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, "data-element-id": "serachFilters", 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))));
|
145
|
+
}
|
146
|
+
get _element() { return this; }
|
147
|
+
}, [4, "snk-filter-list", {
|
148
|
+
"label": [1],
|
149
|
+
"iconName": [1, "icon-name"],
|
150
|
+
"items": [16],
|
151
|
+
"getMessage": [16],
|
152
|
+
"emptyText": [1, "empty-text"],
|
153
|
+
"findFilterText": [1, "find-filter-text"],
|
154
|
+
"buttonClass": [1, "button-class"],
|
155
|
+
"_filterArgument": [32],
|
156
|
+
"_showAll": [32],
|
157
|
+
"hideDetail": [64]
|
158
|
+
}, [[2, "keydown", "keyDownHandler"]]]);
|
159
|
+
function defineCustomElement$1() {
|
160
|
+
if (typeof customElements === "undefined") {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
const components = ["snk-filter-list"];
|
164
|
+
components.forEach(tagName => { switch (tagName) {
|
165
|
+
case "snk-filter-list":
|
166
|
+
if (!customElements.get(tagName)) {
|
167
|
+
customElements.define(tagName, SnkFilterList$1);
|
168
|
+
}
|
169
|
+
break;
|
170
|
+
} });
|
171
|
+
}
|
2
172
|
|
3
173
|
const SnkFilterList = SnkFilterList$1;
|
4
174
|
const defineCustomElement = defineCustomElement$1;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface SnkFilterModalItem extends Components.SnkFilterModalItem, HTMLElement {}
|
4
|
+
export const SnkFilterModalItem: {
|
5
|
+
prototype: SnkFilterModalItem;
|
6
|
+
new (): SnkFilterModalItem;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
|
+
import { E as EPresentationMode } from './presentationMode.js';
|
5
|
+
|
6
|
+
var FilterType;
|
7
|
+
(function (FilterType) {
|
8
|
+
FilterType["QUICK_FILTER"] = "QUICK_FILTER";
|
9
|
+
FilterType["CUSTOM_FILTER"] = "CUSTOM_FILTER";
|
10
|
+
FilterType["OTHER_FILTERS"] = "OTHER_FILTERS";
|
11
|
+
})(FilterType || (FilterType = {}));
|
12
|
+
const FilterType$1 = FilterType;
|
13
|
+
|
14
|
+
const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
|
15
|
+
|
16
|
+
const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
17
|
+
constructor() {
|
18
|
+
super();
|
19
|
+
this.__registerHost();
|
20
|
+
this.filterChange = createEvent(this, "filterChange", 7);
|
21
|
+
this.filterItem = undefined;
|
22
|
+
}
|
23
|
+
observeFilterItem(newValue) {
|
24
|
+
this.filterChange.emit(newValue);
|
25
|
+
}
|
26
|
+
getContentEditorConfig() {
|
27
|
+
const variations = { presentationMode: EPresentationMode.MODAL };
|
28
|
+
switch (this.filterItem.type) {
|
29
|
+
case FilterItemType.BINARY_SELECT:
|
30
|
+
return { tag: "snk-filter-binary-select", variations };
|
31
|
+
case FilterItemType.MULTI_SELECT:
|
32
|
+
return { tag: "snk-filter-multi-select" };
|
33
|
+
case FilterItemType.PERIOD:
|
34
|
+
return { tag: "snk-filter-period", variations };
|
35
|
+
case FilterItemType.SEARCH:
|
36
|
+
return { tag: "snk-filter-search" };
|
37
|
+
case FilterItemType.NUMBER:
|
38
|
+
return { tag: "snk-filter-number" };
|
39
|
+
case FilterItemType.PERSONALIZED:
|
40
|
+
return { tag: "snk-filter-personalized" };
|
41
|
+
case FilterItemType.MULTI_LIST:
|
42
|
+
return { tag: "snk-entity-list" };
|
43
|
+
}
|
44
|
+
return { tag: "snk-filter-text" };
|
45
|
+
}
|
46
|
+
updateFilterValue(newValue) {
|
47
|
+
const isVisble = !this.filterItem.visible ? newValue !== undefined : true;
|
48
|
+
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: isVisble });
|
49
|
+
}
|
50
|
+
canShowDetailModal() {
|
51
|
+
return this.filterItem.filterType !== FilterType$1.OTHER_FILTERS && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
52
|
+
}
|
53
|
+
componentDidLoad() {
|
54
|
+
if (this._element) {
|
55
|
+
ElementIDUtils.addIDInfo(this._element);
|
56
|
+
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
57
|
+
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
render() {
|
61
|
+
const { tag: ContentEditor, variations } = this.getContentEditorConfig();
|
62
|
+
return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, variations)))));
|
63
|
+
}
|
64
|
+
get _element() { return this; }
|
65
|
+
static get watchers() { return {
|
66
|
+
"filterItem": ["observeFilterItem"]
|
67
|
+
}; }
|
68
|
+
static get style() { return snkFilterModalItemCss; }
|
69
|
+
}, [0, "snk-filter-modal-item", {
|
70
|
+
"filterItem": [1040]
|
71
|
+
}]);
|
72
|
+
function defineCustomElement() {
|
73
|
+
if (typeof customElements === "undefined") {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
const components = ["snk-filter-modal-item"];
|
77
|
+
components.forEach(tagName => { switch (tagName) {
|
78
|
+
case "snk-filter-modal-item":
|
79
|
+
if (!customElements.get(tagName)) {
|
80
|
+
customElements.define(tagName, SnkFilterModalItem);
|
81
|
+
}
|
82
|
+
break;
|
83
|
+
} });
|
84
|
+
}
|
85
|
+
|
86
|
+
export { FilterType$1 as F, SnkFilterModalItem as S, defineCustomElement as d };
|
@@ -1,4 +1,121 @@
|
|
1
|
-
import {
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
2
|
+
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
3
|
+
import { F as FilterType, d as defineCustomElement$2 } from './snk-filter-modal-item2.js';
|
4
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
5
|
+
|
6
|
+
const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter__modal-container{width:344px;max-width:344px;overflow:hidden}.snk-filter__modal-content{display:flex;flex-direction:column;gap:12px;max-height:760px;overflow-x:clip;overflow-y:auto;padding-right:4px}.snk-filter__modal-content::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.snk-filter__modal-collapsible-box{border:1px solid #DCE0E8;border-radius:var(--border--radius-medium);padding:12px 6px}";
|
7
|
+
|
8
|
+
const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
9
|
+
constructor() {
|
10
|
+
super();
|
11
|
+
this.__registerHost();
|
12
|
+
this.getMessage = undefined;
|
13
|
+
this.filters = undefined;
|
14
|
+
this.applyFilters = undefined;
|
15
|
+
this.clearAll = undefined;
|
16
|
+
this.closeModal = undefined;
|
17
|
+
}
|
18
|
+
getCustomMessage(key, params) {
|
19
|
+
var _a;
|
20
|
+
return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
|
21
|
+
}
|
22
|
+
handleClearAll() {
|
23
|
+
const cleanedFilters = this.clearAll(this.filters);
|
24
|
+
this.filters = cleanedFilters;
|
25
|
+
}
|
26
|
+
modalActionListener(evt) {
|
27
|
+
const modalAction = evt.detail;
|
28
|
+
switch (modalAction) {
|
29
|
+
case ModalAction.CANCEL:
|
30
|
+
this.handleClearAll();
|
31
|
+
break;
|
32
|
+
case ModalAction.OK:
|
33
|
+
this.applyFilters(this.filters);
|
34
|
+
case ModalAction.CLOSE:
|
35
|
+
this.closeModal();
|
36
|
+
}
|
37
|
+
}
|
38
|
+
handleFilterChange(filterConfig) {
|
39
|
+
this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
|
40
|
+
}
|
41
|
+
handleClearFilters(filterList) {
|
42
|
+
this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
|
43
|
+
}
|
44
|
+
renderFilterItem(filterItem, fullRow) {
|
45
|
+
return (h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, onFilterChange: (event) => this.handleFilterChange(event.detail) }));
|
46
|
+
}
|
47
|
+
mountFiltersLines(filters) {
|
48
|
+
const MAX_LINE_LENGTH = 2;
|
49
|
+
let currentLine = 0;
|
50
|
+
let forceAddCurrent = false;
|
51
|
+
const filtersLines = {};
|
52
|
+
for (let curr = 0; curr < filters.length; curr++) {
|
53
|
+
filtersLines[currentLine] = filtersLines[currentLine] || [];
|
54
|
+
const item = filters[curr];
|
55
|
+
const isLast = curr === filters.length - 1;
|
56
|
+
const currentItemMatch = [FilterItemType.TEXT, FilterItemType.NUMBER].includes(item.type);
|
57
|
+
const nextItemMatch = isLast ? false : [FilterItemType.TEXT, FilterItemType.NUMBER].includes(filters[curr + 1].type);
|
58
|
+
if ((currentItemMatch && nextItemMatch) || forceAddCurrent) {
|
59
|
+
filtersLines[currentLine].push(item);
|
60
|
+
forceAddCurrent = filtersLines[currentLine].length < MAX_LINE_LENGTH;
|
61
|
+
if (filtersLines[currentLine].length === MAX_LINE_LENGTH)
|
62
|
+
++currentLine;
|
63
|
+
continue;
|
64
|
+
}
|
65
|
+
filtersLines[currentLine] = filtersLines[currentLine] || [];
|
66
|
+
filtersLines[currentLine].push(item);
|
67
|
+
++currentLine;
|
68
|
+
}
|
69
|
+
return Object.values(filtersLines);
|
70
|
+
}
|
71
|
+
renderFilterLine(filters) {
|
72
|
+
const fullLine = filters.length === 1;
|
73
|
+
return (h("div", { class: "ez-row" }, filters.map((filter) => this.renderFilterItem(filter, fullLine))));
|
74
|
+
}
|
75
|
+
renderCollapsibleFilterBox(label, listItems) {
|
76
|
+
if (!listItems.length)
|
77
|
+
return null;
|
78
|
+
const appliedFilters = listItems.filter(filterItem => !!filterItem.value).length;
|
79
|
+
const lines = this.mountFiltersLines(listItems);
|
80
|
+
return (h("ez-collapsible-box", { className: "snk-filter__modal-collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters && (h("ez-badge", { className: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters })), lines.map(this.renderFilterLine.bind(this)), h("div", { class: "ez-flex ez-flex--justify-end grow" }, h("ez-button", { className: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => this.handleClearFilters(listItems) }))));
|
81
|
+
}
|
82
|
+
componentWillRender() {
|
83
|
+
this._modalTitle = this.getCustomMessage('title');
|
84
|
+
this._okButtonLabel = this.getCustomMessage('okButtonLabel');
|
85
|
+
this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
|
86
|
+
}
|
87
|
+
render() {
|
88
|
+
const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
89
|
+
const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
|
90
|
+
const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
|
91
|
+
return (h("ez-modal-container", { class: "snk-filter__modal-container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter__modal-content" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter])))));
|
92
|
+
}
|
93
|
+
static get style() { return snkFilterModalCss; }
|
94
|
+
}, [0, "snk-filter-modal", {
|
95
|
+
"getMessage": [16],
|
96
|
+
"filters": [1040],
|
97
|
+
"applyFilters": [16],
|
98
|
+
"clearAll": [16],
|
99
|
+
"closeModal": [16]
|
100
|
+
}]);
|
101
|
+
function defineCustomElement$1() {
|
102
|
+
if (typeof customElements === "undefined") {
|
103
|
+
return;
|
104
|
+
}
|
105
|
+
const components = ["snk-filter-modal", "snk-filter-modal-item"];
|
106
|
+
components.forEach(tagName => { switch (tagName) {
|
107
|
+
case "snk-filter-modal":
|
108
|
+
if (!customElements.get(tagName)) {
|
109
|
+
customElements.define(tagName, SnkFilterModal$1);
|
110
|
+
}
|
111
|
+
break;
|
112
|
+
case "snk-filter-modal-item":
|
113
|
+
if (!customElements.get(tagName)) {
|
114
|
+
defineCustomElement$2();
|
115
|
+
}
|
116
|
+
break;
|
117
|
+
} });
|
118
|
+
}
|
2
119
|
|
3
120
|
const SnkFilterModal = SnkFilterModal$1;
|
4
121
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
|
@@ -6,6 +6,7 @@ const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
6
6
|
constructor() {
|
7
7
|
super();
|
8
8
|
this.__registerHost();
|
9
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
9
10
|
this.value = undefined;
|
10
11
|
this.config = undefined;
|
11
12
|
}
|
@@ -14,6 +15,7 @@ const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
14
15
|
*/
|
15
16
|
ezChangeListener(evt) {
|
16
17
|
this.value = evt.detail.value;
|
18
|
+
this.valueChanged.emit(this.value);
|
17
19
|
}
|
18
20
|
/**
|
19
21
|
* Exibe o componente snk-filter-multi-select
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
|
@@ -6,6 +6,7 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
6
6
|
constructor() {
|
7
7
|
super();
|
8
8
|
this.__registerHost();
|
9
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
9
10
|
this.config = undefined;
|
10
11
|
this.value = undefined;
|
11
12
|
}
|
@@ -14,6 +15,7 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
14
15
|
*/
|
15
16
|
ezChangeListener(evt) {
|
16
17
|
this.value = evt.detail;
|
18
|
+
this.valueChanged.emit(this.value);
|
17
19
|
}
|
18
20
|
/**
|
19
21
|
* Exibe o componente snk-filter-number
|
@@ -1,13 +1,19 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
|
+
import { E as EPresentationMode } from './presentationMode.js';
|
4
5
|
|
5
6
|
const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
6
7
|
constructor() {
|
7
8
|
super();
|
8
9
|
this.__registerHost();
|
10
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
11
|
+
this._startDateLabel = 'Inicial';
|
12
|
+
this._endDateLabel = 'Final';
|
9
13
|
this.config = undefined;
|
14
|
+
this.getMessage = undefined;
|
10
15
|
this.value = undefined;
|
16
|
+
this.presentationMode = EPresentationMode.CHIP;
|
11
17
|
}
|
12
18
|
/**
|
13
19
|
* Emitido quando acontece a alteração de valor do componente snk-filter-period
|
@@ -16,6 +22,7 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
16
22
|
const start = this._startDate.value;
|
17
23
|
const end = this._endDate.value;
|
18
24
|
this.value = (start || end ? { start, end } : undefined);
|
25
|
+
this.valueChanged.emit(this.value);
|
19
26
|
}
|
20
27
|
componentDidLoad() {
|
21
28
|
if (this._element) {
|
@@ -40,16 +47,27 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
40
47
|
async show() {
|
41
48
|
this._startDate.setFocus();
|
42
49
|
}
|
50
|
+
buildLabel() {
|
51
|
+
if (this.presentationMode === EPresentationMode.CHIP) {
|
52
|
+
return h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9");
|
53
|
+
}
|
54
|
+
}
|
55
|
+
componentWillLoad() {
|
56
|
+
this._startDateLabel = this.getMessage('snkFilterBar.labelStartDatePeriod');
|
57
|
+
this._endDateLabel = this.getMessage('snkFilterBar.labelEndDatePeriod');
|
58
|
+
}
|
43
59
|
render() {
|
44
60
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
45
61
|
return undefined;
|
46
62
|
}
|
47
|
-
return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`,
|
63
|
+
return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._startDateLabel, ref: ref => this._startDate = ref, value: this.getDate("start") }), this.buildLabel(), h("ez-date-input", { id: `${this.config.id}_end`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._endDateLabel, ref: ref => this._endDate = ref, value: this.getDate("end") })));
|
48
64
|
}
|
49
65
|
get _element() { return this; }
|
50
66
|
}, [0, "snk-filter-period", {
|
51
67
|
"config": [16],
|
68
|
+
"getMessage": [16],
|
52
69
|
"value": [8],
|
70
|
+
"presentationMode": [2, "presentation-mode"],
|
53
71
|
"show": [64]
|
54
72
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
55
73
|
function defineCustomElement$1() {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils, UserInterface, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
@@ -8,6 +8,7 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
8
8
|
constructor() {
|
9
9
|
super();
|
10
10
|
this.__registerHost();
|
11
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
11
12
|
this.config = undefined;
|
12
13
|
this.value = undefined;
|
13
14
|
this.fix = undefined;
|
@@ -39,6 +40,7 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
39
40
|
if (this.value.filter(item => item != undefined).length == 0) {
|
40
41
|
this.value = null;
|
41
42
|
}
|
43
|
+
this.valueChanged.emit(this.value || []);
|
42
44
|
}
|
43
45
|
doSearch(mode, argument, param) {
|
44
46
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
|
@@ -6,6 +6,7 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
6
6
|
constructor() {
|
7
7
|
super();
|
8
8
|
this.__registerHost();
|
9
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
9
10
|
this.config = undefined;
|
10
11
|
this.value = undefined;
|
11
12
|
}
|
@@ -14,6 +15,7 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
14
15
|
*/
|
15
16
|
ezChangeListener(_evt) {
|
16
17
|
this.value = this._searchInput.value;
|
18
|
+
this.valueChanged.emit(this.value);
|
17
19
|
}
|
18
20
|
componentDidLoad() {
|
19
21
|
if (this._element) {
|