@sankhyalabs/sankhyablocks 5.6.0 → 5.7.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-056d1c24.js} +9 -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-289081c4.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 +8 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +66 -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 +11 -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/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 +47 -0
- 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 +50 -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-modal/snk-filter-modal.css +31 -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 +4 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +115 -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/lib/message/resources/snk-filter-bar.msg.js +9 -1
- package/dist/components/SnkMessageBuilder.js +9 -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 +9 -1
- 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 +85 -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 +12 -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 +10 -22
- package/dist/esm/{SnkMessageBuilder-f3590f65.js → SnkMessageBuilder-23272e07.js} +9 -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-34dc5371.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 +9 -2
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-item.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +62 -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 +12 -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/sankhyablocks/{p-f344b811.entry.js → p-0110b7da.entry.js} +1 -1
- package/dist/sankhyablocks/p-1a68fb59.js +1 -0
- package/dist/sankhyablocks/{p-3d3263b4.js → p-3db1d3de.js} +1 -1
- package/dist/sankhyablocks/p-45ee8b22.entry.js +1 -0
- package/dist/sankhyablocks/p-4ce96831.entry.js +1 -0
- package/dist/sankhyablocks/{p-9dd2b8cb.js → p-584d7212.js} +1 -1
- package/dist/sankhyablocks/{p-c4417efb.entry.js → p-64b03506.entry.js} +1 -1
- package/dist/sankhyablocks/p-7695c404.entry.js +1 -0
- package/dist/sankhyablocks/p-786ae316.entry.js +1 -0
- package/dist/sankhyablocks/p-82bc97da.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-3a2ce158.entry.js → p-a1c58536.entry.js} +1 -1
- package/dist/sankhyablocks/{p-afba9bbe.entry.js → p-bdbb2672.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3fbe2d69.entry.js → p-c1ab16d0.entry.js} +2 -2
- package/dist/sankhyablocks/p-d9804798.js +1 -0
- package/dist/sankhyablocks/p-e2bb9c9a.entry.js +1 -0
- package/dist/sankhyablocks/p-ed3d6ab4.entry.js +1 -0
- package/dist/sankhyablocks/p-ee1381f4.entry.js +1 -0
- package/dist/sankhyablocks/p-f5f36fbb.js +1 -0
- package/dist/sankhyablocks/p-ffac37d5.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 +3 -0
- 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 +113 -54
- 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-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-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
@@ -8,5 +8,6 @@ var FilterItemType;
|
|
8
8
|
FilterItemType["NUMBER"] = "NUMBER";
|
9
9
|
FilterItemType["DEFAULT_FILTER"] = "DEFAULT_FILTER";
|
10
10
|
FilterItemType["PERSONALIZED"] = "PERSONALIZED";
|
11
|
+
FilterItemType["MULTI_LIST"] = "MULTI_LIST";
|
11
12
|
})(FilterItemType || (FilterItemType = {}));
|
12
13
|
export default FilterItemType;
|
@@ -1,5 +1,34 @@
|
|
1
1
|
|
2
|
+
ez-modal {
|
3
|
+
--ez-modal-content-padding: 24px 12px;
|
4
|
+
}
|
5
|
+
|
2
6
|
.snk-filter__modal-container{
|
3
|
-
width:
|
4
|
-
max-width:
|
7
|
+
width: 344px;
|
8
|
+
max-width: 344px;
|
9
|
+
overflow: hidden;
|
10
|
+
}
|
11
|
+
|
12
|
+
.snk-filter__modal-content{
|
13
|
+
display: flex;
|
14
|
+
flex-direction: column;
|
15
|
+
gap: 12px;
|
16
|
+
max-height: 760px;
|
17
|
+
overflow-x: clip;
|
18
|
+
overflow-y: auto;
|
19
|
+
padding-right: 4px;
|
20
|
+
}
|
21
|
+
|
22
|
+
.snk-filter__modal-content::-webkit-scrollbar {
|
23
|
+
width: var(--space--small);
|
24
|
+
min-width: var(--space--small);
|
25
|
+
max-width: var(--space--small);
|
5
26
|
}
|
27
|
+
|
28
|
+
|
29
|
+
.snk-filter__modal-collapsible-box{
|
30
|
+
border: 1px solid #DCE0E8;
|
31
|
+
border-radius: var(--border--radius-medium);
|
32
|
+
}
|
33
|
+
|
34
|
+
|
@@ -1,66 +1,91 @@
|
|
1
1
|
import { h } from '@stencil/core';
|
2
|
-
import { ModalAction
|
3
|
-
import
|
4
|
-
import
|
2
|
+
import { ModalAction } from "@sankhyalabs/ezui/dist/collection/components/ez-modal-container";
|
3
|
+
import FilterType from '../types/filter-type.enum';
|
4
|
+
import FilterItemType from '../filter-item/filter-item-type.enum';
|
5
5
|
export class SnkFilterModal {
|
6
6
|
constructor() {
|
7
|
-
this._filterArgument = undefined;
|
8
7
|
this.getMessage = undefined;
|
9
|
-
this.
|
10
|
-
this.
|
11
|
-
this.
|
12
|
-
this.
|
13
|
-
this.okButtonLabel = undefined;
|
14
|
-
this.infoText = undefined;
|
15
|
-
this.useSearch = undefined;
|
16
|
-
this.processModalAction = undefined;
|
8
|
+
this.filters = undefined;
|
9
|
+
this.applyFilters = undefined;
|
10
|
+
this.clearAll = undefined;
|
11
|
+
this.closeModal = undefined;
|
17
12
|
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
return item;
|
27
|
-
});
|
13
|
+
getCustomMessage(key, params) {
|
14
|
+
var _a;
|
15
|
+
return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
|
16
|
+
}
|
17
|
+
handleClearAll() {
|
18
|
+
const cleanedFilters = this.clearAll(this.filters);
|
19
|
+
this.filters = cleanedFilters;
|
28
20
|
}
|
29
|
-
|
30
|
-
const
|
31
|
-
|
32
|
-
|
21
|
+
modalActionListener(evt) {
|
22
|
+
const modalAction = evt.detail;
|
23
|
+
switch (modalAction) {
|
24
|
+
case ModalAction.CANCEL:
|
25
|
+
this.handleClearAll();
|
26
|
+
break;
|
27
|
+
case ModalAction.OK:
|
28
|
+
this.applyFilters(this.filters);
|
29
|
+
case ModalAction.CLOSE:
|
30
|
+
this.closeModal();
|
31
|
+
default:
|
32
|
+
break;
|
33
33
|
}
|
34
|
-
return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
|
35
34
|
}
|
36
|
-
|
37
|
-
|
38
|
-
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: CheckMode.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)));
|
39
|
-
});
|
35
|
+
handleFilterChange(filterConfig) {
|
36
|
+
this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
|
40
37
|
}
|
41
|
-
|
42
|
-
|
43
|
-
this.updateValue(item.id);
|
44
|
-
}
|
38
|
+
handleClearFilters(filterList) {
|
39
|
+
this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
|
45
40
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
41
|
+
renderFilterItem(filterItem, fullRow) {
|
42
|
+
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) }));
|
43
|
+
}
|
44
|
+
mountFiltersLines(filters) {
|
45
|
+
const MAX_LINE_LENGTH = 2;
|
46
|
+
let currentLine = 0;
|
47
|
+
let forceAddCurrent = false;
|
48
|
+
const filtersLines = {};
|
49
|
+
for (let curr = 0; curr < filters.length; curr++) {
|
50
|
+
filtersLines[currentLine] = filtersLines[currentLine] || [];
|
51
|
+
const item = filters[curr];
|
52
|
+
const isLast = curr === filters.length - 1;
|
53
|
+
const currentItemMatch = [FilterItemType.TEXT, FilterItemType.NUMBER].includes(item.type);
|
54
|
+
const nextItemMatch = isLast ? false : [FilterItemType.TEXT, FilterItemType.NUMBER].includes(filters[curr + 1].type);
|
55
|
+
if ((currentItemMatch && nextItemMatch) || forceAddCurrent) {
|
56
|
+
filtersLines[currentLine].push(item);
|
57
|
+
forceAddCurrent = filtersLines[currentLine].length < MAX_LINE_LENGTH;
|
58
|
+
if (filtersLines[currentLine].length === MAX_LINE_LENGTH)
|
59
|
+
++currentLine;
|
60
|
+
continue;
|
51
61
|
}
|
62
|
+
filtersLines[currentLine] = filtersLines[currentLine] || [];
|
63
|
+
filtersLines[currentLine].push(item);
|
64
|
+
++currentLine;
|
52
65
|
}
|
53
|
-
|
54
|
-
|
55
|
-
|
66
|
+
return Object.values(filtersLines);
|
67
|
+
}
|
68
|
+
renderFilterLine(filters) {
|
69
|
+
const fullLine = filters.length === 1;
|
70
|
+
return (h("div", { class: "ez-row" }, filters.map((filter) => this.renderFilterItem(filter, fullLine))));
|
71
|
+
}
|
72
|
+
renderCollapsibleFilterBox(label, listItems) {
|
73
|
+
if (!listItems.length)
|
74
|
+
return null;
|
75
|
+
const appliedFilters = listItems.filter(filterItem => !!filterItem.value).length;
|
76
|
+
const lines = this.mountFiltersLines(listItems);
|
77
|
+
return (h("ez-collapsible-box", { className: "snk-filter__modal-collapsible-box ez-padding--medium", 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) }))));
|
78
|
+
}
|
79
|
+
componentWillRender() {
|
80
|
+
this._modalTitle = this.getCustomMessage('title');
|
81
|
+
this._okButtonLabel = this.getCustomMessage('okButtonLabel');
|
82
|
+
this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
|
56
83
|
}
|
57
84
|
render() {
|
58
|
-
const
|
59
|
-
const
|
60
|
-
|
61
|
-
|
62
|
-
:
|
63
|
-
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))));
|
85
|
+
const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
86
|
+
const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
|
87
|
+
const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
|
88
|
+
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])))));
|
64
89
|
}
|
65
90
|
static get is() { return "snk-filter-modal"; }
|
66
91
|
static get originalStyleUrls() {
|
@@ -90,18 +115,19 @@ export class SnkFilterModal {
|
|
90
115
|
"text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
|
91
116
|
}
|
92
117
|
},
|
93
|
-
"
|
118
|
+
"filters": {
|
94
119
|
"type": "unknown",
|
95
120
|
"mutable": true,
|
96
121
|
"complexType": {
|
97
|
-
"original": "Array<
|
98
|
-
"resolved": "
|
122
|
+
"original": "Array<SnkFilterItemConfig>",
|
123
|
+
"resolved": "SnkFilterItemConfig[]",
|
99
124
|
"references": {
|
100
125
|
"Array": {
|
101
126
|
"location": "global"
|
102
127
|
},
|
103
|
-
"
|
104
|
-
"location": "
|
128
|
+
"SnkFilterItemConfig": {
|
129
|
+
"location": "import",
|
130
|
+
"path": "../filter-item/snk-filter-item"
|
105
131
|
}
|
106
132
|
}
|
107
133
|
},
|
@@ -109,136 +135,70 @@ export class SnkFilterModal {
|
|
109
135
|
"optional": false,
|
110
136
|
"docs": {
|
111
137
|
"tags": [],
|
112
|
-
"text": "
|
138
|
+
"text": "Filtros a serem apresentados"
|
113
139
|
}
|
114
140
|
},
|
115
|
-
"
|
116
|
-
"type": "
|
117
|
-
"mutable": false,
|
118
|
-
"complexType": {
|
119
|
-
"original": "string",
|
120
|
-
"resolved": "string",
|
121
|
-
"references": {}
|
122
|
-
},
|
123
|
-
"required": false,
|
124
|
-
"optional": false,
|
125
|
-
"docs": {
|
126
|
-
"tags": [],
|
127
|
-
"text": "Define o t\u00EDtulo do filtro."
|
128
|
-
},
|
129
|
-
"attribute": "modal-title",
|
130
|
-
"reflect": false
|
131
|
-
},
|
132
|
-
"modalSubTitle": {
|
133
|
-
"type": "string",
|
134
|
-
"mutable": false,
|
135
|
-
"complexType": {
|
136
|
-
"original": "string",
|
137
|
-
"resolved": "string",
|
138
|
-
"references": {}
|
139
|
-
},
|
140
|
-
"required": false,
|
141
|
-
"optional": false,
|
142
|
-
"docs": {
|
143
|
-
"tags": [],
|
144
|
-
"text": "Define o subt\u00EDtulo do filtro."
|
145
|
-
},
|
146
|
-
"attribute": "modal-sub-title",
|
147
|
-
"reflect": false
|
148
|
-
},
|
149
|
-
"cancelButtonLabel": {
|
150
|
-
"type": "string",
|
151
|
-
"mutable": false,
|
152
|
-
"complexType": {
|
153
|
-
"original": "string",
|
154
|
-
"resolved": "string",
|
155
|
-
"references": {}
|
156
|
-
},
|
157
|
-
"required": false,
|
158
|
-
"optional": false,
|
159
|
-
"docs": {
|
160
|
-
"tags": [],
|
161
|
-
"text": "Define o label do bot\u00E3o de cancelar."
|
162
|
-
},
|
163
|
-
"attribute": "cancel-button-label",
|
164
|
-
"reflect": false
|
165
|
-
},
|
166
|
-
"okButtonLabel": {
|
167
|
-
"type": "string",
|
168
|
-
"mutable": false,
|
169
|
-
"complexType": {
|
170
|
-
"original": "string",
|
171
|
-
"resolved": "string",
|
172
|
-
"references": {}
|
173
|
-
},
|
174
|
-
"required": false,
|
175
|
-
"optional": false,
|
176
|
-
"docs": {
|
177
|
-
"tags": [],
|
178
|
-
"text": "Define o label do bot\u00E3o de confirmar."
|
179
|
-
},
|
180
|
-
"attribute": "ok-button-label",
|
181
|
-
"reflect": false
|
182
|
-
},
|
183
|
-
"infoText": {
|
184
|
-
"type": "string",
|
141
|
+
"applyFilters": {
|
142
|
+
"type": "unknown",
|
185
143
|
"mutable": false,
|
186
144
|
"complexType": {
|
187
|
-
"original": "
|
188
|
-
"resolved": "
|
189
|
-
"references": {
|
145
|
+
"original": "(updatedFilterConfig: Array<SnkFilterItemConfig>) => void",
|
146
|
+
"resolved": "(updatedFilterConfig: SnkFilterItemConfig[]) => void",
|
147
|
+
"references": {
|
148
|
+
"Array": {
|
149
|
+
"location": "global"
|
150
|
+
},
|
151
|
+
"SnkFilterItemConfig": {
|
152
|
+
"location": "import",
|
153
|
+
"path": "../filter-item/snk-filter-item"
|
154
|
+
}
|
155
|
+
}
|
190
156
|
},
|
191
157
|
"required": false,
|
192
158
|
"optional": false,
|
193
159
|
"docs": {
|
194
160
|
"tags": [],
|
195
|
-
"text": "
|
196
|
-
}
|
197
|
-
"attribute": "info-text",
|
198
|
-
"reflect": false
|
161
|
+
"text": "A\u00E7\u00E3o executada ao aplicar os filtros"
|
162
|
+
}
|
199
163
|
},
|
200
|
-
"
|
201
|
-
"type": "
|
164
|
+
"clearAll": {
|
165
|
+
"type": "unknown",
|
202
166
|
"mutable": false,
|
203
167
|
"complexType": {
|
204
|
-
"original": "
|
205
|
-
"resolved": "
|
206
|
-
"references": {
|
168
|
+
"original": "(configSnapshot: SnkFilterItemConfig[]) => Array<SnkFilterItemConfig>",
|
169
|
+
"resolved": "(configSnapshot: SnkFilterItemConfig[]) => SnkFilterItemConfig[]",
|
170
|
+
"references": {
|
171
|
+
"SnkFilterItemConfig": {
|
172
|
+
"location": "import",
|
173
|
+
"path": "../filter-item/snk-filter-item"
|
174
|
+
},
|
175
|
+
"Array": {
|
176
|
+
"location": "global"
|
177
|
+
}
|
178
|
+
}
|
207
179
|
},
|
208
180
|
"required": false,
|
209
181
|
"optional": false,
|
210
182
|
"docs": {
|
211
183
|
"tags": [],
|
212
|
-
"text": "
|
213
|
-
}
|
214
|
-
"attribute": "use-search",
|
215
|
-
"reflect": false
|
184
|
+
"text": "A\u00E7\u00E3o executada ao limpar os filtros"
|
185
|
+
}
|
216
186
|
},
|
217
|
-
"
|
187
|
+
"closeModal": {
|
218
188
|
"type": "unknown",
|
219
189
|
"mutable": false,
|
220
190
|
"complexType": {
|
221
|
-
"original": "(
|
222
|
-
"resolved": "(
|
223
|
-
"references": {
|
224
|
-
"ModalAction": {
|
225
|
-
"location": "import",
|
226
|
-
"path": "@sankhyalabs/ezui/dist/collection/components/ez-modal-container"
|
227
|
-
}
|
228
|
-
}
|
191
|
+
"original": "() => void",
|
192
|
+
"resolved": "() => void",
|
193
|
+
"references": {}
|
229
194
|
},
|
230
195
|
"required": false,
|
231
196
|
"optional": false,
|
232
197
|
"docs": {
|
233
198
|
"tags": [],
|
234
|
-
"text": "\
|
199
|
+
"text": "A\u00E7\u00E3o disparada ao fechar o modal"
|
235
200
|
}
|
236
201
|
}
|
237
202
|
};
|
238
203
|
}
|
239
|
-
static get states() {
|
240
|
-
return {
|
241
|
-
"_filterArgument": {}
|
242
|
-
};
|
243
|
-
}
|
244
204
|
}
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
2
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
+
import FilterItemType from "../../filter-item/filter-item-type.enum";
|
4
|
+
import FilterType from '../../types/filter-type.enum';
|
5
|
+
import { EPresentationMode } from '../../filter-item/editors/enum/presentationMode';
|
6
|
+
export class SnkFilterModalItem {
|
7
|
+
constructor() {
|
8
|
+
this.filterItem = undefined;
|
9
|
+
}
|
10
|
+
observeFilterItem(newValue) {
|
11
|
+
this.filterChange.emit(newValue);
|
12
|
+
}
|
13
|
+
getContentEditorConfig() {
|
14
|
+
const variations = { presentationMode: EPresentationMode.MODAL };
|
15
|
+
switch (this.filterItem.type) {
|
16
|
+
case FilterItemType.BINARY_SELECT:
|
17
|
+
return { tag: "snk-filter-binary-select", variations };
|
18
|
+
case FilterItemType.MULTI_SELECT:
|
19
|
+
return { tag: "snk-filter-multi-select" };
|
20
|
+
case FilterItemType.PERIOD:
|
21
|
+
return { tag: "snk-filter-period", variations };
|
22
|
+
case FilterItemType.SEARCH:
|
23
|
+
return { tag: "snk-filter-search" };
|
24
|
+
case FilterItemType.NUMBER:
|
25
|
+
return { tag: "snk-filter-number" };
|
26
|
+
case FilterItemType.PERSONALIZED:
|
27
|
+
return { tag: "snk-filter-personalized" };
|
28
|
+
case FilterItemType.MULTI_LIST:
|
29
|
+
return { tag: "snk-entity-list" };
|
30
|
+
}
|
31
|
+
return { tag: "snk-filter-text" };
|
32
|
+
}
|
33
|
+
updateFilterValue(newValue) {
|
34
|
+
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue });
|
35
|
+
}
|
36
|
+
canShowDetailModal() {
|
37
|
+
return this.filterItem.filterType !== FilterType.OTHER_FILTERS && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
38
|
+
}
|
39
|
+
componentDidLoad() {
|
40
|
+
if (this._element) {
|
41
|
+
ElementIDUtils.addIDInfo(this._element);
|
42
|
+
const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
43
|
+
this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
render() {
|
47
|
+
const { tag: ContentEditor, variations } = this.getContentEditorConfig();
|
48
|
+
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-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, 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)))));
|
49
|
+
}
|
50
|
+
static get is() { return "snk-filter-modal-item"; }
|
51
|
+
static get originalStyleUrls() {
|
52
|
+
return {
|
53
|
+
"$": ["snk-filter-modal-item.css"]
|
54
|
+
};
|
55
|
+
}
|
56
|
+
static get styleUrls() {
|
57
|
+
return {
|
58
|
+
"$": ["snk-filter-modal-item.css"]
|
59
|
+
};
|
60
|
+
}
|
61
|
+
static get properties() {
|
62
|
+
return {
|
63
|
+
"filterItem": {
|
64
|
+
"type": "unknown",
|
65
|
+
"mutable": true,
|
66
|
+
"complexType": {
|
67
|
+
"original": "SnkFilterItemConfig",
|
68
|
+
"resolved": "SnkFilterItemConfig",
|
69
|
+
"references": {
|
70
|
+
"SnkFilterItemConfig": {
|
71
|
+
"location": "import",
|
72
|
+
"path": "../../filter-item/snk-filter-item"
|
73
|
+
}
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"required": false,
|
77
|
+
"optional": false,
|
78
|
+
"docs": {
|
79
|
+
"tags": [],
|
80
|
+
"text": ""
|
81
|
+
}
|
82
|
+
}
|
83
|
+
};
|
84
|
+
}
|
85
|
+
static get events() {
|
86
|
+
return [{
|
87
|
+
"method": "filterChange",
|
88
|
+
"name": "filterChange",
|
89
|
+
"bubbles": true,
|
90
|
+
"cancelable": true,
|
91
|
+
"composed": true,
|
92
|
+
"docs": {
|
93
|
+
"tags": [],
|
94
|
+
"text": ""
|
95
|
+
},
|
96
|
+
"complexType": {
|
97
|
+
"original": "SnkFilterItemConfig",
|
98
|
+
"resolved": "SnkFilterItemConfig",
|
99
|
+
"references": {
|
100
|
+
"SnkFilterItemConfig": {
|
101
|
+
"location": "import",
|
102
|
+
"path": "../../filter-item/snk-filter-item"
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}];
|
107
|
+
}
|
108
|
+
static get elementRef() { return "_element"; }
|
109
|
+
static get watchers() {
|
110
|
+
return [{
|
111
|
+
"propName": "filterItem",
|
112
|
+
"methodName": "observeFilterItem"
|
113
|
+
}];
|
114
|
+
}
|
115
|
+
}
|