@sankhyalabs/sankhyablocks 10.1.0-dev.12 → 10.1.0-dev.13
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/snk-filter-bar_4.cjs.entry.js +24 -4
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +10 -5
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +11 -6
- 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-item.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +9 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -3
- package/dist/components/snk-filter-bar2.js +12 -3
- package/dist/components/snk-filter-item2.js +4 -0
- package/dist/components/snk-filter-modal2.js +9 -2
- package/dist/components/snk-filter-number.js +1 -1
- package/dist/components/snk-filter-period.js +10 -5
- package/dist/components/snk-filter-text.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +25 -5
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +10 -5
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/sankhyablocks/{p-093f58fa.entry.js → p-99a11017.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4c763b10.entry.js → p-a9b16874.entry.js} +1 -1
- package/dist/sankhyablocks/p-b04db4ac.entry.js +1 -0
- package/dist/sankhyablocks/p-e679c75a.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
- package/dist/sankhyablocks/p-9b67a417.entry.js +0 -1
|
@@ -260,10 +260,19 @@ const SnkFilterBar = class {
|
|
|
260
260
|
this.isFilterModalOpen = false;
|
|
261
261
|
}
|
|
262
262
|
hasValidValue(item) {
|
|
263
|
-
|
|
263
|
+
var _a, _b;
|
|
264
|
+
if (item.value === undefined || item.value === null) {
|
|
264
265
|
return false;
|
|
265
|
-
|
|
266
|
+
}
|
|
267
|
+
if (item.type === filterItemType_enum.FilterItemType.PERIOD) {
|
|
268
|
+
return (!!((_a = item.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = item.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
269
|
+
}
|
|
270
|
+
if (item.groupedItems) {
|
|
266
271
|
return true;
|
|
272
|
+
}
|
|
273
|
+
if (!Array.isArray(item.value)) {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
267
276
|
return item.value.some(filterItem => filterItem.check === true);
|
|
268
277
|
}
|
|
269
278
|
observeFilterConfig(newValue, oldValue) {
|
|
@@ -465,7 +474,7 @@ const SnkFilterBar = class {
|
|
|
465
474
|
if (item.type === filterItemType_enum.FilterItemType.DEFAULT_FILTER) {
|
|
466
475
|
return true;
|
|
467
476
|
}
|
|
468
|
-
return this.filterActiveFilter(item) && (item
|
|
477
|
+
return this.filterActiveFilter(item) && this.hasValidValue(item);
|
|
469
478
|
}
|
|
470
479
|
async registryFilterProvider() {
|
|
471
480
|
this.dataUnit.addFilterProvider(this);
|
|
@@ -950,6 +959,10 @@ const SnkFilterItem = class {
|
|
|
950
959
|
return ((_a = list === null || list === void 0 ? void 0 : list.filter((val) => val === null || val === void 0 ? void 0 : val.check)) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
951
960
|
}
|
|
952
961
|
hasActiveValue(config) {
|
|
962
|
+
var _a, _b;
|
|
963
|
+
if (config.type === filterItemType_enum.FilterItemType.PERIOD) {
|
|
964
|
+
return (!!((_a = config.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = config.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
965
|
+
}
|
|
953
966
|
return (config.type !== filterItemType_enum.FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
|
954
967
|
}
|
|
955
968
|
getEnabledChip() {
|
|
@@ -1236,6 +1249,7 @@ const SnkFilterModal = class {
|
|
|
1236
1249
|
this.handleClearCustomFilters(customFilters);
|
|
1237
1250
|
this.handleClearOthersFilters(otherFilters);
|
|
1238
1251
|
multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
|
|
1252
|
+
index$1.forceUpdate(this);
|
|
1239
1253
|
}
|
|
1240
1254
|
handleClearOthersFilters(otherFilters) {
|
|
1241
1255
|
this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
|
|
@@ -1407,7 +1421,7 @@ const SnkFilterModal = class {
|
|
|
1407
1421
|
getIformedFiltersCount(listItems) {
|
|
1408
1422
|
let countInformedItens = 0;
|
|
1409
1423
|
listItems.forEach(localItem => {
|
|
1410
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1424
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1411
1425
|
const item = this.filterConfig.find(filter => filter.id === localItem.id);
|
|
1412
1426
|
if (filterItemType_enum.FilterItemType.MULTI_LIST === item.type) {
|
|
1413
1427
|
countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
@@ -1419,6 +1433,12 @@ const SnkFilterModal = class {
|
|
|
1419
1433
|
.map(([key, _]) => key).length;
|
|
1420
1434
|
return;
|
|
1421
1435
|
}
|
|
1436
|
+
if (filterItemType_enum.FilterItemType.PERIOD === item.type) {
|
|
1437
|
+
if (!!((_g = item.value) === null || _g === void 0 ? void 0 : _g.start) || !!((_h = item.value) === null || _h === void 0 ? void 0 : _h.end)) {
|
|
1438
|
+
countInformedItens++;
|
|
1439
|
+
}
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1422
1442
|
if (item.groupedItems != undefined) {
|
|
1423
1443
|
countInformedItens = item.groupedItems.filter(item => item.visible).length;
|
|
1424
1444
|
return;
|
|
@@ -108,7 +108,7 @@ const SnkFilterPeriod = class {
|
|
|
108
108
|
if (this.getVariation() === filterNumberVariation.FilterNumberVariation.INTERVAL) {
|
|
109
109
|
return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("div", { class: "ez-col ez-col--nowrap" }, index.h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === presentationMode.EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), enabled: this.config.enabled, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision, errorMessage: this.errorMessage }), this.buildLabel(), index.h("ez-number-input", { id: `${this.config.id}_end`, label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), enabled: this.config.enabled, precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision, errorMessage: this.errorMessage }))));
|
|
110
110
|
}
|
|
111
|
-
return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
111
|
+
return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("ez-number-input", { id: this.config.id, label: this.config.label, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
112
112
|
}
|
|
113
113
|
get _element() { return index.getElement(this); }
|
|
114
114
|
};
|
|
@@ -14,16 +14,17 @@ const SnkFilterPeriod = class {
|
|
|
14
14
|
this._startDateLabel = 'Inicial';
|
|
15
15
|
this._endDateLabel = 'Final';
|
|
16
16
|
this._toLabel = 'até';
|
|
17
|
+
this._defaultEmptyValue = {
|
|
18
|
+
start: null,
|
|
19
|
+
end: null
|
|
20
|
+
};
|
|
17
21
|
this.internalChange = {
|
|
18
22
|
start: false,
|
|
19
23
|
end: false
|
|
20
24
|
};
|
|
21
25
|
this.config = undefined;
|
|
22
26
|
this.getMessage = undefined;
|
|
23
|
-
this.value =
|
|
24
|
-
start: null,
|
|
25
|
-
end: null
|
|
26
|
-
};
|
|
27
|
+
this.value = this._defaultEmptyValue;
|
|
27
28
|
this.presentationMode = presentationMode.EPresentationMode.CHIP;
|
|
28
29
|
this.errorMessage = undefined;
|
|
29
30
|
}
|
|
@@ -36,6 +37,10 @@ const SnkFilterPeriod = class {
|
|
|
36
37
|
this.internalChange.start = false;
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
40
|
+
if ((!newValue && oldValue) || (!(newValue === null || newValue === void 0 ? void 0 : newValue.start) && !(newValue === null || newValue === void 0 ? void 0 : newValue.end))) {
|
|
41
|
+
this.clearValue();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
39
44
|
if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
|
|
40
45
|
this.valueStart = this.parseDate(newValue.start);
|
|
41
46
|
this.valueEnd = this.parseDate(newValue.end);
|
|
@@ -57,7 +62,7 @@ const SnkFilterPeriod = class {
|
|
|
57
62
|
* Limpa o valor do componente restaurando o valor original da configuração.
|
|
58
63
|
*/
|
|
59
64
|
async clearValue() {
|
|
60
|
-
this.value = this.config.value;
|
|
65
|
+
this.value = this.config.value || this._defaultEmptyValue;
|
|
61
66
|
this.valueStart = this.getDate("start");
|
|
62
67
|
this.valueEnd = this.getDate("end");
|
|
63
68
|
}
|
|
@@ -46,7 +46,7 @@ const SnkFilterText = class {
|
|
|
46
46
|
if (!this.config) {
|
|
47
47
|
return undefined;
|
|
48
48
|
}
|
|
49
|
-
return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
49
|
+
return (index.h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, index.h("ez-text-input", { id: this.config.id, label: this.config.label, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
50
50
|
}
|
|
51
51
|
get _element() { return index.getElement(this); }
|
|
52
52
|
};
|
|
@@ -101,7 +101,7 @@ export class SnkFilterPeriod {
|
|
|
101
101
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
102
102
|
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: "ez-col ez-col--nowrap" }, h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), enabled: this.config.enabled, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision, errorMessage: this.errorMessage }), this.buildLabel(), h("ez-number-input", { id: `${this.config.id}_end`, label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), enabled: this.config.enabled, precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision, errorMessage: this.errorMessage }))));
|
|
103
103
|
}
|
|
104
|
-
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
104
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, label: this.config.label, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
105
105
|
}
|
|
106
106
|
static get is() { return "snk-filter-number"; }
|
|
107
107
|
static get properties() {
|
|
@@ -7,16 +7,17 @@ export class SnkFilterPeriod {
|
|
|
7
7
|
this._startDateLabel = 'Inicial';
|
|
8
8
|
this._endDateLabel = 'Final';
|
|
9
9
|
this._toLabel = 'até';
|
|
10
|
+
this._defaultEmptyValue = {
|
|
11
|
+
start: null,
|
|
12
|
+
end: null
|
|
13
|
+
};
|
|
10
14
|
this.internalChange = {
|
|
11
15
|
start: false,
|
|
12
16
|
end: false
|
|
13
17
|
};
|
|
14
18
|
this.config = undefined;
|
|
15
19
|
this.getMessage = undefined;
|
|
16
|
-
this.value =
|
|
17
|
-
start: null,
|
|
18
|
-
end: null
|
|
19
|
-
};
|
|
20
|
+
this.value = this._defaultEmptyValue;
|
|
20
21
|
this.presentationMode = EPresentationMode.CHIP;
|
|
21
22
|
this.errorMessage = undefined;
|
|
22
23
|
}
|
|
@@ -29,6 +30,10 @@ export class SnkFilterPeriod {
|
|
|
29
30
|
this.internalChange.start = false;
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
33
|
+
if ((!newValue && oldValue) || (!(newValue === null || newValue === void 0 ? void 0 : newValue.start) && !(newValue === null || newValue === void 0 ? void 0 : newValue.end))) {
|
|
34
|
+
this.clearValue();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
32
37
|
if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
|
|
33
38
|
this.valueStart = this.parseDate(newValue.start);
|
|
34
39
|
this.valueEnd = this.parseDate(newValue.end);
|
|
@@ -50,7 +55,7 @@ export class SnkFilterPeriod {
|
|
|
50
55
|
* Limpa o valor do componente restaurando o valor original da configuração.
|
|
51
56
|
*/
|
|
52
57
|
async clearValue() {
|
|
53
|
-
this.value = this.config.value;
|
|
58
|
+
this.value = this.config.value || this._defaultEmptyValue;
|
|
54
59
|
this.valueStart = this.getDate("start");
|
|
55
60
|
this.valueEnd = this.getDate("end");
|
|
56
61
|
}
|
|
@@ -160,7 +165,7 @@ export class SnkFilterPeriod {
|
|
|
160
165
|
"tags": [],
|
|
161
166
|
"text": "Define o valor do componente snk-filter-period"
|
|
162
167
|
},
|
|
163
|
-
"defaultValue": "
|
|
168
|
+
"defaultValue": "this._defaultEmptyValue"
|
|
164
169
|
},
|
|
165
170
|
"presentationMode": {
|
|
166
171
|
"type": "number",
|
|
@@ -39,7 +39,7 @@ export class SnkFilterText {
|
|
|
39
39
|
if (!this.config) {
|
|
40
40
|
return undefined;
|
|
41
41
|
}
|
|
42
|
-
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
42
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, label: this.config.label, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
43
43
|
}
|
|
44
44
|
static get is() { return "snk-filter-text"; }
|
|
45
45
|
static get properties() {
|
|
@@ -218,6 +218,10 @@ export class SnkFilterItem {
|
|
|
218
218
|
return ((_a = list === null || list === void 0 ? void 0 : list.filter((val) => val === null || val === void 0 ? void 0 : val.check)) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
219
219
|
}
|
|
220
220
|
hasActiveValue(config) {
|
|
221
|
+
var _a, _b;
|
|
222
|
+
if (config.type === FilterItemType.PERIOD) {
|
|
223
|
+
return (!!((_a = config.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = config.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
224
|
+
}
|
|
221
225
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
|
222
226
|
}
|
|
223
227
|
getEnabledChip() {
|
|
@@ -9,6 +9,7 @@ import FilterItemType from '../filter-item/filter-item-type.enum';
|
|
|
9
9
|
import { ActionDefaultFilter } from '../types/default-filters';
|
|
10
10
|
import FilterType from '../types/filter-type.enum';
|
|
11
11
|
import { getInvalidFilters } from '../utils/filter-validate';
|
|
12
|
+
import { forceUpdate } from '@stencil/core';
|
|
12
13
|
export class SnkFilterModal {
|
|
13
14
|
constructor() {
|
|
14
15
|
this._isUserSup = false;
|
|
@@ -67,6 +68,7 @@ export class SnkFilterModal {
|
|
|
67
68
|
this.handleClearCustomFilters(customFilters);
|
|
68
69
|
this.handleClearOthersFilters(otherFilters);
|
|
69
70
|
multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
|
|
71
|
+
forceUpdate(this);
|
|
70
72
|
}
|
|
71
73
|
handleClearOthersFilters(otherFilters) {
|
|
72
74
|
this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
|
|
@@ -240,7 +242,7 @@ export class SnkFilterModal {
|
|
|
240
242
|
getIformedFiltersCount(listItems) {
|
|
241
243
|
let countInformedItens = 0;
|
|
242
244
|
listItems.forEach(localItem => {
|
|
243
|
-
var _a, _b, _c, _d, _e, _f;
|
|
245
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
244
246
|
const item = this.filterConfig.find(filter => filter.id === localItem.id);
|
|
245
247
|
if (FilterItemType.MULTI_LIST === item.type) {
|
|
246
248
|
countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
@@ -252,6 +254,12 @@ export class SnkFilterModal {
|
|
|
252
254
|
.map(([key, _]) => key).length;
|
|
253
255
|
return;
|
|
254
256
|
}
|
|
257
|
+
if (FilterItemType.PERIOD === item.type) {
|
|
258
|
+
if (!!((_g = item.value) === null || _g === void 0 ? void 0 : _g.start) || !!((_h = item.value) === null || _h === void 0 ? void 0 : _h.end)) {
|
|
259
|
+
countInformedItens++;
|
|
260
|
+
}
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
255
263
|
if (item.groupedItems != undefined) {
|
|
256
264
|
countInformedItens = item.groupedItems.filter(item => item.visible).length;
|
|
257
265
|
return;
|
|
@@ -50,10 +50,19 @@ export class SnkFilterBar {
|
|
|
50
50
|
this.isFilterModalOpen = false;
|
|
51
51
|
}
|
|
52
52
|
hasValidValue(item) {
|
|
53
|
-
|
|
53
|
+
var _a, _b;
|
|
54
|
+
if (item.value === undefined || item.value === null) {
|
|
54
55
|
return false;
|
|
55
|
-
|
|
56
|
+
}
|
|
57
|
+
if (item.type === FilterItemType.PERIOD) {
|
|
58
|
+
return (!!((_a = item.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = item.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
59
|
+
}
|
|
60
|
+
if (item.groupedItems) {
|
|
56
61
|
return true;
|
|
62
|
+
}
|
|
63
|
+
if (!Array.isArray(item.value)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
57
66
|
return item.value.some(filterItem => filterItem.check === true);
|
|
58
67
|
}
|
|
59
68
|
observeFilterConfig(newValue, oldValue) {
|
|
@@ -255,7 +264,7 @@ export class SnkFilterBar {
|
|
|
255
264
|
if (item.type === FilterItemType.DEFAULT_FILTER) {
|
|
256
265
|
return true;
|
|
257
266
|
}
|
|
258
|
-
return this.filterActiveFilter(item) && (item
|
|
267
|
+
return this.filterActiveFilter(item) && this.hasValidValue(item);
|
|
259
268
|
}
|
|
260
269
|
async registryFilterProvider() {
|
|
261
270
|
this.dataUnit.addFilterProvider(this);
|
|
@@ -260,10 +260,19 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
260
260
|
this.isFilterModalOpen = false;
|
|
261
261
|
}
|
|
262
262
|
hasValidValue(item) {
|
|
263
|
-
|
|
263
|
+
var _a, _b;
|
|
264
|
+
if (item.value === undefined || item.value === null) {
|
|
264
265
|
return false;
|
|
265
|
-
|
|
266
|
+
}
|
|
267
|
+
if (item.type === FilterItemType.PERIOD) {
|
|
268
|
+
return (!!((_a = item.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = item.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
269
|
+
}
|
|
270
|
+
if (item.groupedItems) {
|
|
266
271
|
return true;
|
|
272
|
+
}
|
|
273
|
+
if (!Array.isArray(item.value)) {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
267
276
|
return item.value.some(filterItem => filterItem.check === true);
|
|
268
277
|
}
|
|
269
278
|
observeFilterConfig(newValue, oldValue) {
|
|
@@ -465,7 +474,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
465
474
|
if (item.type === FilterItemType.DEFAULT_FILTER) {
|
|
466
475
|
return true;
|
|
467
476
|
}
|
|
468
|
-
return this.filterActiveFilter(item) && (item
|
|
477
|
+
return this.filterActiveFilter(item) && this.hasValidValue(item);
|
|
469
478
|
}
|
|
470
479
|
async registryFilterProvider() {
|
|
471
480
|
this.dataUnit.addFilterProvider(this);
|
|
@@ -226,6 +226,10 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
226
226
|
return ((_a = list === null || list === void 0 ? void 0 : list.filter((val) => val === null || val === void 0 ? void 0 : val.check)) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
227
227
|
}
|
|
228
228
|
hasActiveValue(config) {
|
|
229
|
+
var _a, _b;
|
|
230
|
+
if (config.type === FilterItemType.PERIOD) {
|
|
231
|
+
return (!!((_a = config.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = config.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
232
|
+
}
|
|
229
233
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
|
230
234
|
}
|
|
231
235
|
getEnabledChip() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, forceUpdate, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
@@ -95,6 +95,7 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
95
95
|
this.handleClearCustomFilters(customFilters);
|
|
96
96
|
this.handleClearOthersFilters(otherFilters);
|
|
97
97
|
multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
|
|
98
|
+
forceUpdate(this);
|
|
98
99
|
}
|
|
99
100
|
handleClearOthersFilters(otherFilters) {
|
|
100
101
|
this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
|
|
@@ -266,7 +267,7 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
266
267
|
getIformedFiltersCount(listItems) {
|
|
267
268
|
let countInformedItens = 0;
|
|
268
269
|
listItems.forEach(localItem => {
|
|
269
|
-
var _a, _b, _c, _d, _e, _f;
|
|
270
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
270
271
|
const item = this.filterConfig.find(filter => filter.id === localItem.id);
|
|
271
272
|
if (FilterItemType.MULTI_LIST === item.type) {
|
|
272
273
|
countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
@@ -278,6 +279,12 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
278
279
|
.map(([key, _]) => key).length;
|
|
279
280
|
return;
|
|
280
281
|
}
|
|
282
|
+
if (FilterItemType.PERIOD === item.type) {
|
|
283
|
+
if (!!((_g = item.value) === null || _g === void 0 ? void 0 : _g.start) || !!((_h = item.value) === null || _h === void 0 ? void 0 : _h.end)) {
|
|
284
|
+
countInformedItens++;
|
|
285
|
+
}
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
281
288
|
if (item.groupedItems != undefined) {
|
|
282
289
|
countInformedItens = item.groupedItems.filter(item => item.visible).length;
|
|
283
290
|
return;
|
|
@@ -105,7 +105,7 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
105
105
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
106
106
|
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: "ez-col ez-col--nowrap" }, h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), enabled: this.config.enabled, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision, errorMessage: this.errorMessage }), this.buildLabel(), h("ez-number-input", { id: `${this.config.id}_end`, label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), enabled: this.config.enabled, precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision, errorMessage: this.errorMessage }))));
|
|
107
107
|
}
|
|
108
|
-
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
108
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, label: this.config.label, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
109
109
|
}
|
|
110
110
|
get _element() { return this; }
|
|
111
111
|
}, [0, "snk-filter-number", {
|
|
@@ -11,16 +11,17 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
11
11
|
this._startDateLabel = 'Inicial';
|
|
12
12
|
this._endDateLabel = 'Final';
|
|
13
13
|
this._toLabel = 'até';
|
|
14
|
+
this._defaultEmptyValue = {
|
|
15
|
+
start: null,
|
|
16
|
+
end: null
|
|
17
|
+
};
|
|
14
18
|
this.internalChange = {
|
|
15
19
|
start: false,
|
|
16
20
|
end: false
|
|
17
21
|
};
|
|
18
22
|
this.config = undefined;
|
|
19
23
|
this.getMessage = undefined;
|
|
20
|
-
this.value =
|
|
21
|
-
start: null,
|
|
22
|
-
end: null
|
|
23
|
-
};
|
|
24
|
+
this.value = this._defaultEmptyValue;
|
|
24
25
|
this.presentationMode = EPresentationMode.CHIP;
|
|
25
26
|
this.errorMessage = undefined;
|
|
26
27
|
}
|
|
@@ -33,6 +34,10 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
33
34
|
this.internalChange.start = false;
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
37
|
+
if ((!newValue && oldValue) || (!(newValue === null || newValue === void 0 ? void 0 : newValue.start) && !(newValue === null || newValue === void 0 ? void 0 : newValue.end))) {
|
|
38
|
+
this.clearValue();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
36
41
|
if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
|
|
37
42
|
this.valueStart = this.parseDate(newValue.start);
|
|
38
43
|
this.valueEnd = this.parseDate(newValue.end);
|
|
@@ -54,7 +59,7 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
54
59
|
* Limpa o valor do componente restaurando o valor original da configuração.
|
|
55
60
|
*/
|
|
56
61
|
async clearValue() {
|
|
57
|
-
this.value = this.config.value;
|
|
62
|
+
this.value = this.config.value || this._defaultEmptyValue;
|
|
58
63
|
this.valueStart = this.getDate("start");
|
|
59
64
|
this.valueEnd = this.getDate("end");
|
|
60
65
|
}
|
|
@@ -43,7 +43,7 @@ const SnkFilterText$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
43
43
|
if (!this.config) {
|
|
44
44
|
return undefined;
|
|
45
45
|
}
|
|
46
|
-
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
46
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, label: this.config.label, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
47
47
|
}
|
|
48
48
|
get _element() { return this; }
|
|
49
49
|
}, [0, "snk-filter-text", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-479e1293.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement, f as forceUpdate } from './index-479e1293.js';
|
|
2
2
|
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, LockManager, LockManagerOperation, DateUtils, MaskFormatter, KeyboardManager, FloatingManager, ArrayUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage-bd096633.js';
|
|
@@ -256,10 +256,19 @@ const SnkFilterBar = class {
|
|
|
256
256
|
this.isFilterModalOpen = false;
|
|
257
257
|
}
|
|
258
258
|
hasValidValue(item) {
|
|
259
|
-
|
|
259
|
+
var _a, _b;
|
|
260
|
+
if (item.value === undefined || item.value === null) {
|
|
260
261
|
return false;
|
|
261
|
-
|
|
262
|
+
}
|
|
263
|
+
if (item.type === FilterItemType.PERIOD) {
|
|
264
|
+
return (!!((_a = item.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = item.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
265
|
+
}
|
|
266
|
+
if (item.groupedItems) {
|
|
262
267
|
return true;
|
|
268
|
+
}
|
|
269
|
+
if (!Array.isArray(item.value)) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
263
272
|
return item.value.some(filterItem => filterItem.check === true);
|
|
264
273
|
}
|
|
265
274
|
observeFilterConfig(newValue, oldValue) {
|
|
@@ -461,7 +470,7 @@ const SnkFilterBar = class {
|
|
|
461
470
|
if (item.type === FilterItemType.DEFAULT_FILTER) {
|
|
462
471
|
return true;
|
|
463
472
|
}
|
|
464
|
-
return this.filterActiveFilter(item) && (item
|
|
473
|
+
return this.filterActiveFilter(item) && this.hasValidValue(item);
|
|
465
474
|
}
|
|
466
475
|
async registryFilterProvider() {
|
|
467
476
|
this.dataUnit.addFilterProvider(this);
|
|
@@ -946,6 +955,10 @@ const SnkFilterItem = class {
|
|
|
946
955
|
return ((_a = list === null || list === void 0 ? void 0 : list.filter((val) => val === null || val === void 0 ? void 0 : val.check)) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
947
956
|
}
|
|
948
957
|
hasActiveValue(config) {
|
|
958
|
+
var _a, _b;
|
|
959
|
+
if (config.type === FilterItemType.PERIOD) {
|
|
960
|
+
return (!!((_a = config.value) === null || _a === void 0 ? void 0 : _a.start) || !!((_b = config.value) === null || _b === void 0 ? void 0 : _b.end));
|
|
961
|
+
}
|
|
949
962
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
|
950
963
|
}
|
|
951
964
|
getEnabledChip() {
|
|
@@ -1232,6 +1245,7 @@ const SnkFilterModal = class {
|
|
|
1232
1245
|
this.handleClearCustomFilters(customFilters);
|
|
1233
1246
|
this.handleClearOthersFilters(otherFilters);
|
|
1234
1247
|
multiListFilters.forEach(multiListFilter => this.handleClearSigleFilter(multiListFilter));
|
|
1248
|
+
forceUpdate(this);
|
|
1235
1249
|
}
|
|
1236
1250
|
handleClearOthersFilters(otherFilters) {
|
|
1237
1251
|
this.filters = this.filters.map(filter => otherFilters.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: undefined })) : filter);
|
|
@@ -1403,7 +1417,7 @@ const SnkFilterModal = class {
|
|
|
1403
1417
|
getIformedFiltersCount(listItems) {
|
|
1404
1418
|
let countInformedItens = 0;
|
|
1405
1419
|
listItems.forEach(localItem => {
|
|
1406
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1420
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1407
1421
|
const item = this.filterConfig.find(filter => filter.id === localItem.id);
|
|
1408
1422
|
if (FilterItemType.MULTI_LIST === item.type) {
|
|
1409
1423
|
countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
@@ -1415,6 +1429,12 @@ const SnkFilterModal = class {
|
|
|
1415
1429
|
.map(([key, _]) => key).length;
|
|
1416
1430
|
return;
|
|
1417
1431
|
}
|
|
1432
|
+
if (FilterItemType.PERIOD === item.type) {
|
|
1433
|
+
if (!!((_g = item.value) === null || _g === void 0 ? void 0 : _g.start) || !!((_h = item.value) === null || _h === void 0 ? void 0 : _h.end)) {
|
|
1434
|
+
countInformedItens++;
|
|
1435
|
+
}
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1418
1438
|
if (item.groupedItems != undefined) {
|
|
1419
1439
|
countInformedItens = item.groupedItems.filter(item => item.visible).length;
|
|
1420
1440
|
return;
|
|
@@ -104,7 +104,7 @@ const SnkFilterPeriod = class {
|
|
|
104
104
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
105
105
|
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: "ez-col ez-col--nowrap" }, h("ez-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), enabled: this.config.enabled, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision, errorMessage: this.errorMessage }), this.buildLabel(), h("ez-number-input", { id: `${this.config.id}_end`, label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), enabled: this.config.enabled, precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision, errorMessage: this.errorMessage }))));
|
|
106
106
|
}
|
|
107
|
-
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
107
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, label: this.config.label, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
|
108
108
|
}
|
|
109
109
|
get _element() { return getElement(this); }
|
|
110
110
|
};
|
|
@@ -10,16 +10,17 @@ const SnkFilterPeriod = class {
|
|
|
10
10
|
this._startDateLabel = 'Inicial';
|
|
11
11
|
this._endDateLabel = 'Final';
|
|
12
12
|
this._toLabel = 'até';
|
|
13
|
+
this._defaultEmptyValue = {
|
|
14
|
+
start: null,
|
|
15
|
+
end: null
|
|
16
|
+
};
|
|
13
17
|
this.internalChange = {
|
|
14
18
|
start: false,
|
|
15
19
|
end: false
|
|
16
20
|
};
|
|
17
21
|
this.config = undefined;
|
|
18
22
|
this.getMessage = undefined;
|
|
19
|
-
this.value =
|
|
20
|
-
start: null,
|
|
21
|
-
end: null
|
|
22
|
-
};
|
|
23
|
+
this.value = this._defaultEmptyValue;
|
|
23
24
|
this.presentationMode = EPresentationMode.CHIP;
|
|
24
25
|
this.errorMessage = undefined;
|
|
25
26
|
}
|
|
@@ -32,6 +33,10 @@ const SnkFilterPeriod = class {
|
|
|
32
33
|
this.internalChange.start = false;
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
36
|
+
if ((!newValue && oldValue) || (!(newValue === null || newValue === void 0 ? void 0 : newValue.start) && !(newValue === null || newValue === void 0 ? void 0 : newValue.end))) {
|
|
37
|
+
this.clearValue();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
35
40
|
if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
|
|
36
41
|
this.valueStart = this.parseDate(newValue.start);
|
|
37
42
|
this.valueEnd = this.parseDate(newValue.end);
|
|
@@ -53,7 +58,7 @@ const SnkFilterPeriod = class {
|
|
|
53
58
|
* Limpa o valor do componente restaurando o valor original da configuração.
|
|
54
59
|
*/
|
|
55
60
|
async clearValue() {
|
|
56
|
-
this.value = this.config.value;
|
|
61
|
+
this.value = this.config.value || this._defaultEmptyValue;
|
|
57
62
|
this.valueStart = this.getDate("start");
|
|
58
63
|
this.valueEnd = this.getDate("end");
|
|
59
64
|
}
|
|
@@ -42,7 +42,7 @@ const SnkFilterText = class {
|
|
|
42
42
|
if (!this.config) {
|
|
43
43
|
return undefined;
|
|
44
44
|
}
|
|
45
|
-
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
45
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, label: this.config.label, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
|
46
46
|
}
|
|
47
47
|
get _element() { return getElement(this); }
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{F as
|
|
1
|
+
import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{F as l}from"./p-fa80e546.js";import{E as r}from"./p-1a68fb59.js";const n=class{constructor(s){i(this,s),this.valueChanged=t(this,"valueChanged",7),this._startIntervalLabel="Inicial",this._endIntervalLabel="Final",this._toLabel="até",this.config=void 0,this.getMessage=void 0,this.value=void 0,this.presentationMode=r.CHIP,this.errorMessage=void 0}ezChangeListener(i){if(this.errorMessage=void 0,this.getVariation()===l.INTERVAL){const i=this._startInterval.value,t=this._endInterval.value;return this.value=isNaN(i)&&isNaN(t)?void 0:{start:i,end:t},void this.valueChanged.emit(this.value)}this.value=i.detail,this.valueChanged.emit(this.value)}async show(){this.getVariation()!==l.INTERVAL?this._numberElement.setFocus():this._startInterval.setFocus()}async setFocus(){this.getVariation()!==l.INTERVAL?await this._numberElement.setFocus():await this._startInterval.setFocus()}async clearValue(){var i,t;if(this.value=this.config.value,this.getVariation()===l.INTERVAL){const s=this.config.value;this._startInterval&&(this._startInterval.value=null!==(i=null==s?void 0:s.start)&&void 0!==i?i:null),this._endInterval&&(this._endInterval.value=null!==(t=null==s?void 0:s.end)&&void 0!==t?t:null)}else this._numberElement&&(this._numberElement.value=this.config.value)}getIntervalValue(i){const t=this.value?this.value[i]:null;return null!=t?t:null}buildLabel(){if(this.presentationMode===r.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}getVariation(){var i,t;return null!==(t=null===(i=this.config.props)||void 0===i?void 0:i.variation)&&void 0!==t?t:l.DEFAULT}componentWillLoad(){this.getMessage&&(this._startIntervalLabel=this.getMessage("snkFilterBar.labelStart"),this._endIntervalLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo"))}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}render(){var i,t,e;if(this.config&&this.config.type===a.NUMBER)return this.getVariation()===l.INTERVAL?s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("div",{class:"ez-col ez-col--nowrap"},s("ez-number-input",{id:`${this.config.id}_start`,class:this.presentationMode===r.MODAL?"ez-padding-right--medium":"",label:this._startIntervalLabel,ref:i=>this._startInterval=i,value:this.getIntervalValue("start"),enabled:this.config.enabled,precision:null===(i=this.config.props)||void 0===i?void 0:i.precision,errorMessage:this.errorMessage}),this.buildLabel(),s("ez-number-input",{id:`${this.config.id}_end`,label:this._endIntervalLabel,ref:i=>this._endInterval=i,value:this.getIntervalValue("end"),enabled:this.config.enabled,precision:null===(t=this.config.props)||void 0===t?void 0:t.precision,errorMessage:this.errorMessage}))):s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("ez-number-input",{id:this.config.id,label:this.config.label,ref:i=>this._numberElement=i,value:this.config.value,precision:null===(e=this.config.props)||void 0===e?void 0:e.precision,enabled:this.config.enabled,errorMessage:this.errorMessage}))}get _element(){return e(this)}};export{n as snk_filter_number}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";const a=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this.config=void 0,this.value=void 0,this.errorMessage=void 0}ezChangeListener(t){this.errorMessage=void 0,this.value=t.detail,this.valueChanged.emit(this.value)}async setFocus(){this._textInputElement.setFocus()}async clearValue(){this.value=this.config.value,this._textInputElement&&(this._textInputElement.value=this.config.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}render(){var t;if(this.config)return i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i("ez-text-input",{id:this.config.id,ref:t=>this._textInputElement=t,value:this.config.value,mask:null===(t=this.config)||void 0===t?void 0:t.mask,enabled:this.config.enabled,cleanValueMask:!0,errorMessage:this.errorMessage}))}get _element(){return e(this)}};export{a as snk_filter_text}
|
|
1
|
+
import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";const a=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this.config=void 0,this.value=void 0,this.errorMessage=void 0}ezChangeListener(t){this.errorMessage=void 0,this.value=t.detail,this.valueChanged.emit(this.value)}async setFocus(){this._textInputElement.setFocus()}async clearValue(){this.value=this.config.value,this._textInputElement&&(this._textInputElement.value=this.config.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}render(){var t;if(this.config)return i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i("ez-text-input",{id:this.config.id,label:this.config.label,ref:t=>this._textInputElement=t,value:this.config.value,mask:null===(t=this.config)||void 0===t?void 0:t.mask,enabled:this.config.enabled,cleanValueMask:!0,errorMessage:this.errorMessage}))}get _element(){return e(this)}};export{a as snk_filter_text}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as r,f as l}from"./p-d8d8169b.js";import{DataType as a,StringUtils as n,ObjectUtils as o,ElementIDUtils as h,ErrorException as d,ApplicationContext as c,LockManager as u,LockManagerOperation as f,DateUtils as m,MaskFormatter as p,KeyboardManager as v,FloatingManager as b,ArrayUtils as g}from"@sankhyalabs/core";import{EzScrollDirection as k}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as _}from"./p-0e4f8b86.js";import{P as F}from"./p-988afe78.js";import{toString as y}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as z}from"./p-ff1990ad.js";import{F as x,D as w}from"./p-84345e7a.js";import{F as C}from"./p-fa80e546.js";import{ModalAction as I}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as $}from"@sankhyalabs/ezui/dist/collection/utils";import{A as N}from"./p-6a4b21dd.js";import{F as T}from"./p-b568c1d4.js";import{g as L}from"./p-76e66fd9.js";import"./p-4db9dbf8.js";import"./p-1b1373b6.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";function A(t){let i="";return t.forEach(((t,e)=>{var s;i+=` ${e>0?null!==(s=t.operand)&&void 0!==s?s:"OR":""} ${t.expression}`})),i.trim()}const P=class{constructor(e){t(this,e),this.configUpdated=i(this,"configUpdated",7),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._firstLoad=!0,this._pendingVariables=!1,this._isDefaultFilter=!1,this._customfiltersToBeUpdated=[],this._resolveLoading=void 0,this._calculateSortIndex=t=>{if(!t.visible)return 0;if(t.hardFixed)return 1e6;let i=t.fixed?1e5:0;return i+=this.hasValidValue(t)?1e4:0,i+=this._updateSequence.lastIndexOf(t.id)+1,i},this._filtersComparator=(t,i)=>this._calculateSortIndex(i)-this._calculateSortIndex(t),this.enableLockManagerLoadingComp=!1,this.customFilterBarConfig=void 0,this.dataUnit=void 0,this.title=void 0,this.configName=void 0,this.resourceID=void 0,this.mode="regular",this.filterConfig=void 0,this.messagesBuilder=void 0,this.disablePersonalizedFilter=void 0,this.filterBarLegacyConfigName=void 0,this.autoLoad=void 0,this.afterApplyConfig=void 0,this.filterCustomConfig=void 0,this.filterCustomConfigInterceptor=void 0,this.allowDefault=void 0,this.scrollerLocked=!1,this.showPersonalizedFilter=!1,this.personalizedFilterId=void 0,this.isFilterModalOpen=!1}hasValidValue(t){var i,e;return null!=t.value&&(t.type===z.PERIOD?!!(null===(i=t.value)||void 0===i?void 0:i.start)||!!(null===(e=t.value)||void 0===e?void 0:e.end):!!t.groupedItems||!Array.isArray(t.value)||t.value.some((t=>!0===t.check)))}observeFilterConfig(t,i){o.equals(t,i)||this.handleFilterConfigsChanged(i,t)}handleFilterConfigsChanged(t,i){if(null!=t&&null==i)this._loadingPending=!0,this._configUpdated=!0;else{const e=new Map(t?t.map((t=>[t.id,t])):void 0);0===e.size&&i.length>0?(this._loadingPending=!0,this._configUpdated=!1):i.forEach((t=>{const i=e.get(t.id);if(null!=i){if(this._configUpdated=this._configUpdated||o.objectToString(i)!=o.objectToString(t),this._loadingPending=this._loadingPending||o.objectToString(i.value)!==o.objectToString(t.value),!this._loadingPending){const e=o.objectToString(i.groupedItems)!=o.objectToString(t.groupedItems);this._configUpdated=this._configUpdated||e,this._loadingPending=this._loadingPending||e}}else this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value}))}(this._loadingPending||this._configUpdated)&&this.configUpdated.emit(i),this.processAfterUpdateConfig()}async reload(){this.loadConfigFromStorage(!0)}async getFilterItem(t){const i=this.filterConfig.find((i=>i.id===t));return Promise.resolve(o.copy(i))}async updateFilterItem(t){return-1==this.filterConfig.findIndex((i=>i.id===t.id))?(console.warn("[SnkFilterBar.updateFilterItem] "+this.getMessage("snkFilterBar.filterItem.updateFilterItemNotFound")),Promise.resolve()):(this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async addFilterItem(t){return this.filterConfig.findIndex((i=>i.id===t.id))>-1?(console.warn("[SnkFilterBar.addFilterItem] "+this.getMessage("snkFilterBar.filterItem.addFilterItemExists")),Promise.resolve()):(this.filterConfig.push(t),this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async removeFilterItem(t){const i=this.filterConfig.findIndex((i=>i.id===t));if(-1==i)return console.warn("[SnkFilterBar.removeFilterItem] "+this.getMessage("snkFilterBar.filterItem.removeFilterItemNotFound")),Promise.resolve(void 0);const e=this.filterConfig[i];return this.filterConfig=this.filterConfig.filter((i=>i.id!==t)),Promise.resolve(e)}componentDidLoad(){this._element&&h.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}processPendingFilter(){if(this._pendingVariables){const t=this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");t&&t.showUp(!0).then((()=>{this.processAfterUpdateConfig()}))}else this.processAfterUpdateConfig()}getPersonalizedFilterItem(){return this.filterConfig.find((t=>t.type===z.PERSONALIZED))}async processAfterUpdateConfig(){var t;if(this._loadingPending){if(await this._application.isLoadedByPk()&&!this._configUpdated)return;const t=this.getPersonalizedFilterItem();if(this._pendingVariables=!F.validateVariableValues(t),this._pendingVariables)return;this._loadingPending=!1,this.doLoadData()}this._configUpdated&&(this._configUpdated=!1,_.saveFilterBarConfig(this.filterConfig,this.configName,this.resourceID),null===(t=this.afterApplyConfig)||void 0===t||t.call(this))}async doLoadData(t=!1){try{if(this._firstLoad&&!1===this.autoLoad)return;if(this._firstLoad&&!t&&void 0===this.autoLoad&&!await this._application.getBooleanParam("global.carregar.registros.iniciar.tela"))return;this.dataUnit.loadData(void 0,void 0,!0)}finally{this._firstLoad=!1}}getMessage(t,i,e){var s;return null==this.messagesBuilder&&this._application&&(this.messagesBuilder=this._application.messagesBuilder),(null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(t,i))||e}async getFilters(){return this.getFilter(null)}getFilter(t){var i;const e=[];return null===(i=this.filterConfig)||void 0===i||i.filter((t=>this.isActiveFilter(t))).forEach((t=>{const i=(t=>{switch(t.type){case z.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case z.BINARY_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.options.find((t=>t.name===e)).expression,params:[]}}(t);case z.MULTI_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:e}]}}(t);case z.MULTI_LIST:return function(t){const{id:i,value:e,props:s}=t,r=(null!==(o=null!==(n=null==(l=e)?void 0:l.elements)&&void 0!==n?n:null==l?void 0:l.members)&&void 0!==o?o:l).filter((t=>null==t?void 0:t.check)).map((({id:t})=>Number.isNaN(+t)?String(t):Number(t)));var l,n,o;if(r.length>0)return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:JSON.stringify(r)}]}}(t);case z.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:l}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof l&&(l=new Date(l));const n=[];let o;return r&&l?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:a.DATE,value:y(a.DATE,l)},{name:`${i}.END`,dataType:a.DATE,value:y(a.DATE,r)})):l?(o=s.expression.onlystart,n.push({name:i,dataType:a.DATE,value:y(a.DATE,l)})):(o=s.expression.onlyend,n.push({name:i,dataType:a.DATE,value:y(a.DATE,r)})),{name:i,expression:o,params:n}}(t);case z.SEARCH:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:y(a.TEXT,null==e?void 0:e.value)}]}}(t);case z.TEXT:return function(t){let{id:i,value:e,props:s}=t;const r=s.expression;var l,o;return n.isEmpty(s.likeAs)||(l=e,e="CONTANIS"===(o=s.likeAs)?`%${l}%`:"STARTS_WITH"===o?`${l}%`:"ENDS_WITH"===o?`%${l}`:l),{name:i,expression:r,params:[{name:i,dataType:a.TEXT,value:y(a.TEXT,e)}]}}(t);case z.NUMBER:return function(t){const{id:i,value:e,props:s}=t;if(s.variation===C.INTERVAL){const{start:t,end:r}=null!=e?e:{start:0,end:0};if(!isNaN(t)&&!isNaN(r))return{name:i,expression:s.intervalExpression.fullfill,params:[{name:`${i}.START`,dataType:a.NUMBER,value:y(a.NUMBER,t)},{name:`${i}.END`,dataType:a.NUMBER,value:y(a.NUMBER,r)}]};if(!isNaN(t))return{name:i,expression:s.intervalExpression.onlystart,params:[{name:i,dataType:a.NUMBER,value:y(a.NUMBER,t)}]};if(!isNaN(r))return{name:i,expression:s.intervalExpression.onlyend,params:[{name:i,dataType:a.NUMBER,value:y(a.NUMBER,r)}]}}return{name:i,expression:s.expression,params:[{name:i,dataType:a.NUMBER,value:y(a.NUMBER,e)}]}}(t);case z.PERSONALIZED:return function(t){const{id:i,groupedItems:e=[]}=t,s=e.filter((t=>!!t.visible)).map((t=>{var i;const e=t.props.expression,s=((null===(i=t.props.personalizedFilter)||void 0===i?void 0:i.parameters)||[]).map(((i,e)=>{const s=Array.from(t.value||0),r=i.dataType;let l=e>=0&&e<s.length?s[e]:null;return null!=l&&"object"==typeof l&&"value"in l&&(l=l.value),null==l&&r===a.BOOLEAN&&(l=!1),{name:i.name,dataType:r,value:"string"==typeof l?l:y(r,l)}}));return{expression:e,name:t.id,params:s}}));return{name:i,expression:s.map((t=>`(${t.expression})`)).join(` ${x.AND} `),params:s.flatMap((t=>t.params))}}(t);case z.CHECK_BOX_LIST:return function(t){var i;const{id:e,value:s,props:r}=t,l=Object.entries(null!=s?s:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t));return{name:e,expression:A(null===(i=r.options)||void 0===i?void 0:i.filter((t=>l.includes(t.name)))),params:[]}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.type===z.DEFAULT_FILTER||this.filterActiveFilter(t)&&this.hasValidValue(t)}async registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&await this.doLoadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((i=>{i.id===t?"snk-filter-item"===i.tagName.toLowerCase()&&i.getClientRects()[0].x<0&&i.scrollIntoView({behavior:"auto",inline:"nearest"}):i.hideDetail()}))}filterActiveFilter(t){return t.visible||t.removalBlocked}filterPersonalizedItems(t){return t.type===z.PERSONALIZED}getPersonalizedFilterVariableItems(){return this.filterConfig.filter(this.filterPersonalizedItems).map((t=>{const i=`filter-${t.id}`;return e("snk-filter-item",{key:t.id,id:i,config:Object.assign({},t),onFocusin:()=>this.itemFocused(i),onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),getMessage:(t,i)=>this.getMessage(t,i),showChips:!1})}))}getFilterItems(){const t=[],i=[];this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i))).filter(this.filterActiveFilter).forEach((s=>{const r=`filter-${(s=o.copy(s)).id}`,l=e("snk-filter-item",{onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),onFocusin:()=>this.itemFocused(r),id:r,config:s,class:"ez-margin-horizontal--extra-small",getMessage:(t,i)=>this.getMessage(t,i),key:s.id});return s.fixed||s.hardFixed||s.required?t.push(l):i.push(l),l}));const s=[];return s.push(...t.reverse()),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-margin-horizontal--small ez-margin-vertical--auto ez-divider-vertical ez-divider--dark snk-filter-bar__divider"})),s.push(...i),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((i=>t.id!==i)),this._updateSequence.push(t.id))}normalizeItem(t){const i=Object.assign({},t);return["props","value","hardFixed","fixed"].forEach((t=>{null==i[t]&&delete i[t]})),""===t.value&&delete t.value,i}updateFilter(t){let i=this.filterConfig.map((i=>(t=this.normalizeItem(t),i.id===t.id?(o.objectToString(i)!=o.objectToString(t)&&this.calculateUpdateSequence(t),t):i))).sort(((t,i)=>this._filtersComparator(t,i)));this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}addFilterBarLegacyConfigName(){this.filterBarLegacyConfigName&&_.addFilterBarLegacyConfig(this.configName,this.filterBarLegacyConfigName)}async loadConfigFromStorage(t){try{let i;t&&await _.deleteFilterBarConfigCache(this.configName,this.resourceID),i=this.customFilterBarConfig?await this.customFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}):await _.loadFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}),this.filterCustomConfig&&(i=[...this.filterCustomConfig,...i]),this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i.map((t=>this.normalizeItem(t))),this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i)))}catch(t){throw new d(this.getMessage("snkFilterBar.failToLoadConfig"),t)}}async attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const i=t;this.dataUnit=i.dataUnit,this.dataUnit?await this.registryFilterProvider():i.addEventListener("dataUnitReady",(async t=>{this.dataUnit=t.detail,await this.registryFilterProvider()}));break}t=t.parentElement}else await this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}async showFilterModal(){this.isFilterModalOpen||(this.isFilterModalOpen=!0)}addPersonalizedFilter(t=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=t,this.personalizedFilterId=void 0,this.showPersonalizedFilter=!0,window.requestAnimationFrame((()=>{this._elPersonalizedFilter.createPersonalizedFilter()}))}editPersonalizedFilter(t,i=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=i,this.showPersonalizedFilter=!0,this.personalizedFilterId=t}deletePersonalizedFilter(t,i,e,s=!1){if(s)return _.removeDefaultFilter(t,this.resourceID,e),void(this._isDefaultFilter=!1);i===z.PERSONALIZED&&_.removePersonalizedFilter(t,this.resourceID,e)}closeFilterModal(){this.isFilterModalOpen=!1}applyFiltersFromModal(t){var i;this.filterConfig=t.map(this.normalizeItem).sort(((t,i)=>this._filtersComparator(t,i))),null===(i=this.afterApplyConfig)||void 0===i||i.call(this),this.isFilterModalOpen=!1}handleHidePersonalizedFilter(t){t?this.loadConfigFromStorage().then((()=>{this.hidePersonalizedFilter()})):this.hidePersonalizedFilter()}hidePersonalizedFilter(){this.personalizedFilterId=void 0,this.showPersonalizedFilter=!1,this._isDefaultFilter=!1}async componentWillLoad(){var t;try{if(this._application=c.getContextValue("__SNK__APPLICATION__"),await this.attachDataUnit(),this._application){if(this._application.enableLockManagerLoadingApp&&this.enableLockManagerLoadingComp){const t=u.addLockManagerCtxId(this._element);this._resolveLoading=u.lock(t,f.APP_LOADING)}await Promise.all([this.loadPermitions(),this.addFilterBarLegacyConfigName(),this.loadConfigFromStorage()])}}finally{null===(t=this._resolveLoading)||void 0===t||t.call(this)}}componentDidRender(){this.processPendingFilter()}render(){if(!this.dataUnit||!this.filterConfig||0===this.filterConfig.length)return;if(this.showPersonalizedFilter)return e("snk-personalized-filter",{class:"filter-bar__personalized-filter",filterId:this.personalizedFilterId,ref:t=>this._elPersonalizedFilter=t,isDefaultFilter:this._isDefaultFilter,onEzCancel:()=>this.handleHidePersonalizedFilter(!1),onEzAfterSave:()=>this.handleHidePersonalizedFilter(!0),entityUri:this.dataUnit.name,configName:this.configName,resourceID:this.resourceID});let t=o.copy(this.filterConfig);return t=t.sort(((t,i)=>t.originOrder-i.originOrder)),"regular"!==this.mode?e(s,{"data-mode":this.mode},this.getPersonalizedFilterVariableItems(),"button"===this.mode&&e("ez-button",{class:"ez-margin-left--medium",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)}),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,z.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor})):e(s,null,e("div",null,e("span",{class:"snk-filter-bar__title",title:this.title,"data-tooltip":this.title,"data-flow":"bottom"},this.title)),e("ez-scroller",{class:"snk-filter-bar__scroller",direction:k.HORIZONTAL,activeShadow:!0,locked:this.scrollerLocked},e("section",{class:"snk-filter-bar__filter-item-container"},this.getFilterItems())),e("ez-button",{class:"ez-padding-left--medium ez-margin-top--extra-small",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)},e("ez-icon",{slot:"leftIcon",iconName:"plus",class:"ez-padding-right--small"})),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,z.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor}))}get _element(){return r(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};P.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode="hidden"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode="button"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;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);height:80%}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start;margin:var(--space--2, 2px) 0}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.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:99%;height:100%}';const D=class{constructor(e){t(this,e),this.visibleChanged=i(this,"visibleChanged",7),this.filterChange=i(this,"filterChange",3),this._keyboardManager=void 0,this.detailIsVisible=void 0,this.config=void 0,this.getMessage=void 0,this.showChips=!0}observeDetailIsVisible(t){this.visibleChanged.emit(t)}filterChangeListener(){this.hideDetail()}async showUp(t=!1){var i;this._filterItemElement.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t&&(await(null===(i=this._chipElement)||void 0===i?void 0:i.setBlur()),await this._popover.showUnder(this._chipElement),await this._filterDetail.setFocusField())}async hideDetail(){var t;await(null===(t=this._popover)||void 0===t?void 0:t.hide())}getConfigChanges(){var t;const i=this.config;(null===(t=i.groupedItems)||void 0===t?void 0:t.length)&&(i.visible=!1,i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1}))));const e=i.type===z.MULTI_LIST&&Array.isArray(i.value)?i.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0;return Object.assign(Object.assign({},i),{value:e})}clearFilter(t){if(null==t||t.stopPropagation(),this.canClearFilter()){const t=this.getConfigChanges();this.filterChange.emit(t)}else this.togglePopover(t)}async togglePopover(t){null==t||t.preventDefault(),null==t||t.stopPropagation(),!1!==this.config.enabled&&(this.detailIsVisible?await this.hideDetail():await this.showUp(!0))}getLabel(t=!1){var i,e;const{type:s,value:r,label:l,props:a,groupedItems:n=[]}=this.config;if(r||n.length){if(s===z.BINARY_SELECT){const[i,e]=a.options,s=this.getMessage("snkFilterBar.binarySelectTooltip");if(i.name===r)return t?`${s} ${String(i.label).toLowerCase()}`:i.label;if(e.name===r)return t?`${s} ${String(e.label).toLowerCase()}`:e.label}if(s===z.MULTI_SELECT)return`${l}: ${a.options.find((t=>t.value===r)).label}`;if(s===z.PERIOD){let{end:i,start:e}=r;"string"==typeof i&&(i=new Date(i),i.setMinutes(i.getMinutes()+i.getTimezoneOffset())),"string"==typeof e&&(e=new Date(e),e.setMinutes(e.getMinutes()+e.getTimezoneOffset()));const s=new Intl.DateTimeFormat("pt-BR");if(i&&e){const s=e.getFullYear()===i.getFullYear(),r=Object.assign({day:"2-digit",month:"2-digit"},(!s||t)&&{year:"2-digit"}),a=m.formatDate(e,r),n=m.formatDate(i,r);return t?this.getMessage("snkFilterBar.fullPeriodTooltip",{LABEL:l,START_LABEL:a,END_LABEL:n}):`${l}: ${a} → ${n}`}return e?`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${s.format(e)}`:i?`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${s.format(i)}`:l}if(s===z.SEARCH)return`${l}: ${r.value} - ${r.label}`;if(s===z.PERSONALIZED){const t=this.calculateActiveCount(n);return t<=0?l:`${l}: ${this.getMessage("snkFilterBar.personalizedCount",{activeCount:t})}`}if(s===z.MULTI_LIST){const e=(null!==(i=r.elements)&&void 0!==i?i:r).filter((t=>null==t?void 0:t.check));return this.getLabelFromCheckedOptions(e,l,t)}if(s===z.CHECK_BOX_LIST){const i=Object.entries(null!=r?r:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)),s=(null!==(e=a.options)&&void 0!==e?e:[]).filter((t=>i.includes(t.name)));return this.getLabelFromCheckedOptions(s,l,t)}if(s===z.NUMBER&&a.variation===C.INTERVAL){const{start:t,end:i}=r;if(!isNaN(t)&&!isNaN(i))return this.getMessage("snkFilterBar.fullIntervalTooltip",{LABEL:l,START_LABEL:t,END_LABEL:i});if(!isNaN(t))return`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${Number(t)}`;if(!isNaN(i))return`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${Number(i)}`}return this.config.mask?`${l}: ${new p(this.config.mask).format(r)}`:`${l}: ${r}`}return l}getLabelFromCheckedOptions(t,i,e){const s=t.length;return 0===s?`${i}`:s>1?e?`${i}: ${t.map((t=>t.label)).join(",")}`:`${i}: ${s} ${this.getMessage("snkFilterBar.multiListToltip")}`:`${i}: ${t[0].label}`}calculateActiveCount(t){return t.reduce(((t,i)=>i.visible?t+1:t),0)}componentDidLoad(){this._filterItemElement&&(h.addIDInfo(this._filterItemElement),this._idSnkFilterDetail=`filterDetail_${this.config.id}`)}canClearFilter(){const{value:t,groupedItems:i=[]}=this.config;return null!=t&&this.config.type===z.MULTI_LIST?t.some((t=>t.check)):void 0!==t||i.some((t=>t.visible))}getRightIconName(){return this.canClearFilter()?"close":this.detailIsVisible?"chevron-up":"chevron-down"}getLeftIconName(){switch(this.config.type){case z.PERIOD:return"calendar";case z.PERSONALIZED:return"tune"}}hasActiveElements(t){var i;const e=Array.isArray(t)?t:null==t?void 0:t.elements;return(null===(i=null==e?void 0:e.filter((t=>null==t?void 0:t.check)))||void 0===i?void 0:i.length)>0}hasActiveValue(t){var i,e;return t.type===z.PERIOD?!!(null===(i=t.value)||void 0===i?void 0:i.start)||!!(null===(e=t.value)||void 0===e?void 0:e.end):t.type!==z.MULTI_LIST&&void 0!==t.value||this.hasActiveElements(t.value)}getEnabledChip(){if(this.detailIsVisible)return!0;if(this.config.type===z.PERSONALIZED){const{groupedItems:t=[]}=this.config;return t.some((t=>t.visible))}return this.hasActiveValue(this.config)}async handleVisibilityPopover(t){this.detailIsVisible=t.detail,this.detailIsVisible||await this._filterDetail.clearValue()}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}hasValue(){return this.config.type===z.MULTI_LIST?this.hasActiveElements(this.config.value):null!=this.config.value}getTooltipMessage(){var t,i;return this.config.required&&!this.hasValue()?{message:null!==(t=this.config.requiredMessage)&&void 0!==t?t:this.getCustomMessage("validations.requiredFilter"),type:"error"}:!1===this.config.enabled&&this.config.disabledMessage?{message:this.config.disabledMessage,type:"warning"}:{message:null!==(i=this.config.defaultMessage)&&void 0!==i?i:this.getLabel(!0),type:"default"}}getTypeChip(t){switch(t){case"default":return"secondary";case"warning":return"warning-light";case"error":return"error-light";case"success":return"success-light";default:return t}}initKeyboardManager(){this._keyboardManager=new v({element:this._filterItemElement,propagate:!0}),this._keyboardManager.bind("Escape",(()=>this.hideDetail()))}connectedCallback(){this.initKeyboardManager()}disconnectedCallback(){this._keyboardManager.unbindAllShortcutKeys()}render(){const t=this.getLeftIconName(),{type:i,message:r}=this.getTooltipMessage();return e(s,null,this.showChips&&e("ez-tooltip",{id:this.config.id,message:r,type:i,active:!this.detailIsVisible,strategy:"fixed"},e("ez-chip",{id:this.config.id,ref:t=>this._chipElement=t,label:this.getLabel(),value:this.getEnabledChip(),onClick:t=>this.togglePopover(t),disableAutoUpdateValue:!0,type:this.getTypeChip(i),enabled:this.config.enabled},t&&e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,slot:"leftIcon"}),e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),slot:"rightIcon",id:"removeFilter",onClick:t=>this.clearFilter(t)}))),e("ez-popover-core",{ref:t=>this._popover=t,onEzVisibilityChange:t=>this.handleVisibilityPopover(t)},e("snk-filter-detail",{ref:t=>this._filterDetail=t,key:this.config.id,config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16","data-element-id":this._idSnkFilterDetail,showHardFixed:this.showChips&&!this.config.required,removalBlocked:this.config.required})))}get _filterItemElement(){return r(this)}static get watchers(){return{detailIsVisible:["observeDetailIsVisible"]}}};D.style="ez-popover-core.sc-snk-filter-item{--ez-popover__box--z-index:var(--elevation--20, 20);--ez-popover__box--overlay-z-index:var(--elevation--16, 16)}";const S="__SHOWMORE__",B=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=b.MODAL_ELEMENT_ID||(this._detailIsVisible=!1,!1),this._filterArgument=void 0,this._showAll=void 0,this.label=void 0,this.iconName=void 0,this.items=void 0,this.getMessage=void 0,this.emptyText=void 0,this.findFilterText=void 0,this.buttonClass=void 0}showDetail(){this._preselection=-1,this._floatingID=b.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onListCloseCallback(),useOverlay:!0}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument="",this._filterInput.setFocus()}async hideDetail(){null!=this._floatingID&&b.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&h.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(h.DATA_ELEMENT_ID_ATTRIBUTE_NAME),h.addIDInfoIfNotExists(t,"filterItemList",e)}buildItemElement(t){const i=++this._selectableItemsCount;return e("button",{ref:i=>i&&this.buildIdElement(i,t.label),id:`filter-item${i}`,onFocusin:()=>this._preselection=i,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(t.name),name:t.label,key:i},t.iconName?e("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,e("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 ${t.labelClass||""}`},t.label))}itemSelected(t){t===S?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?g.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("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):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:this.getMessage("snkFilterList.showMore"),iconName:"dots-horizontal",name:S,iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),this._selectableItemsCount=0,e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}keyDownHandler(t){switch(t.key){case"ArrowDown":this.changePreselection(this._preselection+1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();break;case"ArrowUp":this.changePreselection(this._preselection-1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}}changePreselection(t){if(t<0&&(t=this._selectableItemsCount),this._preselection=t>this._selectableItemsCount?0:t,0===this._preselection)this._filterInput.setFocus();else{const t=this._element.querySelector(`#filter-item${this._preselection}`);t&&t.focus()}}render(){return e(s,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--4",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,"data-element-id":"serachFilters",mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return r(this)}},E=class{constructor(i){t(this,i),this._isUserSup=!1,this.filters=[],this.filtersWithError=[],this.getMessage=void 0,this.configName=void 0,this.filterConfig=void 0,this.opened=!1,this.applyFilters=void 0,this.closeModal=void 0,this.addPersonalizedFilter=void 0,this.editPersonalizedFilter=void 0,this.deletePersonalizedFilter=void 0,this.filtersToDelete=[],this.filterDefaultToDelete=void 0,this.disablePersonalizedFilter=void 0,this.filterCustomConfigInterceptor=void 0}filterConfigChangeHandler(t){this.filters=o.copy(t),this.validateFilters()}deletePersonalizedFilterListener(t){this.filtersToDelete.push(t.detail)}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}handleClearAll(){const{customFilters:t,quickFilters:i,otherFilters:e,multiListFilters:s}=this.filters.reduce(((t,i)=>i.type===z.MULTI_LIST?(t.multiListFilters.push(i),t):i.filterType===T.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===T.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===T.OTHER_FILTERS?(t.otherFilters.push(i),t):t),{quickFilters:[],customFilters:[],otherFilters:[],multiListFilters:[]});this.handleClearFilterList(i),this.handleClearCustomFilters(t),this.handleClearOthersFilters(e),s.forEach((t=>this.handleClearSigleFilter(t))),l(this)}handleClearOthersFilters(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearCustomFilters(t){this.filters.forEach(((i,e)=>{i.filterType===T.CUSTOM_FILTER&&(this.filters[e]=this.clearAllCustomFilter(t).shift())}))}clearAllCustomFilter(t){return t.map((t=>{const i=Object.assign({},t);return delete i.value,i.visible=!1,i.groupedItems&&(i.groupedItems=this.clearAllCustomFilter(i.groupedItems)),i}))}hasChangeToSave(){return o.objectToString(this.filters)!=o.objectToString(this.filters)}handleClose(){if(this.hasChangeToSave())return $.confirm(this.getCustomMessage("validations.notSaved.title"),this.getCustomMessage("validations.notSaved.message")).then((t=>{t&&this.closeModal()}));this.closeModal()}handleApplyFilters(){if(!this.validateFilters())return;const t=this.filters.find((t=>t.filterType===T.CUSTOM_FILTER||t.filterType===T.DEFAULT_FILTER));this.isValidCustomFilter(t)&&this.applyFilters(this.filters),this.filtersToDelete.length>0&&(this.filtersToDelete.forEach((t=>{this.deletePersonalizedFilter(t,this.configName)})),this.filtersToDelete=[]),this.filterDefaultToDelete&&(this.deletePersonalizedFilter(this.filterDefaultToDelete,this.configName,!0),this._defaultFilter=void 0,this.filterDefaultToDelete=void 0)}isValidCustomFilter(t){return!!F.validateVariableValues(t)||($.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message")),!1)}modalActionListener(t){switch(t.detail){case I.CANCEL:this.handleClearAll();break;case I.OK:this.handleApplyFilters();break;case I.CLOSE:this.handleClose()}}handleFilterChange(t){t.stopPropagation();const i=t.detail;let e=this.filters.map((t=>t.id===i.id?i:t));this.filterCustomConfigInterceptor&&(e=this.filterCustomConfigInterceptor(e)),this.filters=o.copy(e)}handleClearFilterList(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearSigleFilter(t){if(z.MULTI_LIST===t.type){let i=o.copy(t);this.uncheckFilterValues(i.value);const e=o.copy(this.filters),s=e.findIndex((i=>i.id===t.id));return e.splice(s,1,i),void(this.filters=o.copy(e))}if(z.CHECK_BOX_LIST===t.type){const i=o.copy(this.filters);return i.find((i=>i.id===t.id)).value=void 0,void(this.filters=o.copy(i))}this.filters.find((i=>i.id===t.id)).value=void 0,this.filters=o.copy(this.filters)}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}validateFilters(){const t=L(this.filters);return this.filtersWithError=t.map((t=>t.id)),0===t.length||(t.forEach((t=>{const i=this._element.querySelector(`#filter-item-${t.id}`);i&&(i.errorMessage=t.requiredMessage||this.getCustomMessage("validations.requiredFilter"))})),!1)}renderFilterItem(t,i){return e("snk-filter-modal-item",{key:`modal-item-${t.id}`,class:i?"ez-col ez-col--sd-12":"ez-col ez-col--sd-6 ez-padding--small",filterItem:t,configName:this.configName,onFilterChange:t=>this.handleFilterChange(t),onEditPersonalizedFilter:t=>this.editPersonalizedFilter(t.detail),onAddPersonalizedFilter:()=>this.addPersonalizedFilter()})}isDefaultFilterNumberVariation(t){var i;return t.type===z.NUMBER&&(!t.props.variation||(null===(i=t.props)||void 0===i?void 0:i.variation)===C.DEFAULT)}mountFiltersLines(t){let i=0,e=!1;const s={};for(let r=0;r<t.length;r++){s[i]=s[i]||[];const l=t[r],a=r===t.length-1,n=l.type===z.TEXT||this.isDefaultFilterNumberVariation(l),o=!a&&(t[r+1].type===z.TEXT||this.isDefaultFilterNumberVariation(t[r+1]));n&&o||e?(s[i].push(l),e=s[i].length<2,2===s[i].length&&++i):(s[i]=s[i]||[],s[i].push(l),++i)}return Object.values(s)}renderFilterLine(t){const i=1===t.length;return t.map((t=>this.renderFilterItem(t,i)))}getIformedFiltersCount(t){let i=0;return t.forEach((t=>{var e,s,r,l,a,n,o,h;const d=this.filterConfig.find((i=>i.id===t.id));z.MULTI_LIST!==d.type?z.CHECK_BOX_LIST!==d.type?z.PERIOD!==d.type?null==d.groupedItems?d.value&&i++:i=d.groupedItems.filter((t=>t.visible)).length:((null===(o=d.value)||void 0===o?void 0:o.start)||(null===(h=d.value)||void 0===h?void 0:h.end))&&i++:i+=Object.entries(null!==(n=d.value)&&void 0!==n?n:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)).length:i+=null!==(a=null===(l=null===(r=null!==(s=null===(e=d.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:d.value)||void 0===r?void 0:r.filter((t=>null==t?void 0:t.check)))||void 0===l?void 0:l.length)&&void 0!==a?a:0})),i}renderCollapsibleFilterBox(t,i,s,r=!0){if(!i.length)return null;const l=this.getIformedFiltersCount(i),a=this.mountFiltersLines(i),n=this.filtersWithError.filter((t=>i.some((i=>i.id===t)))).length;return e("ez-collapsible-box",{class:"snk-filter-modal__collapsible-box",headerSize:"medium",value:!0,label:t},e("div",{class:"ez-flex ez-flex--justify-end grow",slot:"rightSlot"},!!l&&e("ez-badge",{class:"ez-badge--primary-subtle",label:null==l?void 0:l.toString()}),!!n&&e("ez-badge",{class:"ez-badge--error-subtle",label:null==n?void 0:n.toString()})),e("div",{class:"ez-row snk-filter-modal__rendered-items"},a.map(this.renderFilterLine.bind(this))),r&&e("div",{class:"ez-flex ez-flex--justify-end grow"},e("ez-button",{class:"ez-button--tertiary",size:"medium",label:this.getCustomMessage("clearModal"),onClick:()=>s?this.handleClearSigleFilter(i[0]):this.handleClearFilterList(i)})))}handleDeleteFilter(){this._application.confirm(this.getMessage("snkPersonalizedFilter.deleteConfirm.title"),this.getMessage("snkPersonalizedFilter.info.deleteDefaultFilterConfirm"),"alert-circle-inverted","critical").then((t=>{t&&(this.filterDefaultToDelete=this._defaultFilter,this.filters=this.filters.filter((t=>t.id!==T.DEFAULT_FILTER)))}))}handleActionSelectedDefaultFilter({detail:t}){switch(t){case N.CREATE:this.addPersonalizedFilter(!0);break;case N.EDIT:this.editPersonalizedFilter(this._defaultFilter.id,!0);break;case N.REMOVE:this.handleDeleteFilter()}}getCustomFilter(t){return t.filter((t=>t.filterType===T.CUSTOM_FILTER))}getDefaultFilter(t){return t.find((t=>t.id===w.id))}async componentWillLoad(){this._application=c.getContextValue("__SNK__APPLICATION__"),this._isUserSup=await this._application.isUserSup(),this.filters=o.copy(this.filterConfig)}componentWillRender(){this._modalTitle=this.getCustomMessage("title"),this._okButtonLabel=this.getCustomMessage("okButtonLabel"),this._cancelButtonLabel=this.getCustomMessage("cancelButtonLabel")}componentDidLoad(){this.validateFilters()}render(){this._defaultFilter=this._isUserSup?this.getDefaultFilter(this.filters):void 0;const t=this.getCustomFilter(this.filters),i=this.filters.filter((t=>t.filterType===T.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===T.OTHER_FILTERS));return e("ez-modal",{opened:this.opened,modalSize:"col--sd-3",align:"right",heightMode:"full",closeEsc:!0},e("ez-modal-container",{class:"snk-filter-modal__container",modalTitle:this._modalTitle,cancelButtonLabel:this._cancelButtonLabel,okButtonLabel:this._okButtonLabel,onEzModalAction:this.modalActionListener.bind(this)},e("div",{class:"snk-filter-modal__content ez-col--sd-12"},this._isUserSup&&e("snk-default-filter",{getMessage:this.getCustomMessage.bind(this),hasDefaultFilter:!!this._defaultFilter,onActionSelected:this.handleActionSelectedDefaultFilter.bind(this)}),!this.disablePersonalizedFilter&&this.renderCollapsibleFilterBox(this.getCustomMessage("customFilters"),t,!1,!1),this.renderCollapsibleFilterBox(this.getCustomMessage("quickFilters"),i,!1),s.map((t=>this.renderCollapsibleFilterBox(t.label,[t],!0))))))}get _element(){return r(this)}static get watchers(){return{filterConfig:["filterConfigChangeHandler"]}}};E.style="ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{P as snk_filter_bar,D as snk_filter_item,B as snk_filter_list,E as snk_filter_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{E as n}from"./p-1a68fb59.js";const r=class{constructor(s){t(this,s),this.valueChanged=i(this,"valueChanged",7),this._startDateLabel="Inicial",this._endDateLabel="Final",this._toLabel="até",this._defaultEmptyValue={start:null,end:null},this.internalChange={start:!1,end:!1},this.config=void 0,this.getMessage=void 0,this.value=this._defaultEmptyValue,this.presentationMode=n.CHIP,this.errorMessage=void 0}configChanged(t,i){this.internalChange.end?this.internalChange.end=!1:this.internalChange.start?this.internalChange.start=!1:!t&&i||!(null==t?void 0:t.start)&&!(null==t?void 0:t.end)?this.clearValue():!t||t.start===(null==i?void 0:i.start)&&t.end===(null==i?void 0:i.end)||(this.valueStart=this.parseDate(t.start),this.valueEnd=this.parseDate(t.end))}ezChangeListener(t,i){this.errorMessage=void 0,this.internalChange[i]=!0,this.value=Object.assign(Object.assign({},this.value||{}),{[i]:t.detail?this.parseDate(t.detail):null}),this.valueChanged.emit(this.value)}async setFocus(){this._startDate.setFocus()}async clearValue(){this.value=this.config.value||this._defaultEmptyValue,this.valueStart=this.getDate("start"),this.valueEnd=this.getDate("end")}componentDidLoad(){this._element&&(h.addIDInfo(this._element,"filterContentEditor"),this._element.querySelectorAll("ez-date-input").forEach((t=>{t.shadowRoot.querySelector("ez-text-input").style.setProperty("--ez-text-input__min-width","120px")})))}parseDate(t){return t instanceof Date?t:"string"==typeof t?((t=new Date(t)).setMinutes(t.getMinutes()+t.getTimezoneOffset()),t):null}getDate(t){return this.parseDate(this.value?this.value[t]:null)}async show(){this._startDate.setFocus()}buildLabel(){if(this.presentationMode===n.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}componentWillLoad(){this.getMessage&&(this._startDateLabel=this.getMessage("snkFilterBar.labelStart"),this._endDateLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo")),this.valueStart=this.getDate("start"),this.valueEnd=this.getDate("end")}render(){if(this.config&&this.config.type===a.PERIOD)return s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("div",{class:"ez-col ez-col--nowrap"},s("ez-date-input",{id:`${this.config.id}_start`,class:this.presentationMode===n.MODAL?"ez-padding-right--medium":"",label:this._startDateLabel,ref:t=>this._startDate=t,enabled:this.config.enabled,value:this.valueStart,errorMessage:this.errorMessage,onEzChange:t=>this.ezChangeListener(t,"start")}),this.buildLabel(),s("ez-date-input",{id:`${this.config.id}_end`,label:this._endDateLabel,ref:t=>this._endDate=t,enabled:this.config.enabled,value:this.valueEnd,errorMessage:this.errorMessage,onEzChange:t=>this.ezChangeListener(t,"end")})))}get _element(){return e(this)}static get watchers(){return{value:["configChanged"]}}};export{r as snk_filter_period}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-d8d8169b.js";export{s as setNonce}from"./p-d8d8169b.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((e=>a(JSON.parse('[["p-7345782c",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-180716b2",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-667cab42",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-987cd79d",[[6,"snk-custom-slot-guide",{"slotName":[1,"slot-name"]},[[8,"snkShowGuide","onGuideChange"],[8,"formConfigVisibilityChanged","onFormConfigVisibilityChange"]]]]],["p-825098c1",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"value":[1040],"errorMessage":[1537,"error-message"],"_ezListSource":[32],"reloadList":[64]}]]],["p-96d45943",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"resetValues":[64],"clearValue":[64],"setFocus":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-7f7fe6c4",[[0,"snk-filter-checkbox-list",{"config":[1040],"errorMessage":[1537,"error-message"],"optionsList":[32],"setFocus":[64],"clearValue":[64]}]]],["p-e258de96",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-093f58fa",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[1026],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"show":[64],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-3ed04f0d",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[1040],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64],"show":[64]}]]],["p-cb4343c4",[[0,"snk-filter-search",{"config":[16],"value":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-4c763b10",[[0,"snk-filter-text",{"config":[16],"value":[1],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-162bddae",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-3d41f5a8",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-82a3d522",[[6,"snk-simple-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"dataState":[1040],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"enableContinuousInsert":[1028,"enable-continuous-insert"],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"enableGridInsert":[4,"enable-grid-insert"],"paginationCounterMode":[1,"pagination-counter-mode"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"layoutFormConfig":[4,"layout-form-config"],"autoLoad":[4,"auto-load"],"outlineMode":[4,"outline-mode"],"_container":[32],"_showPopUpGridConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-01ca59fc",[[2,"pesquisa-grid",{"metadata":[16],"dataSource":[16],"pkField":[1,"pk-field"],"descriptionField":[1,"description-field"],"entityName":[1,"entity-name"],"shouldLoadConfig":[4,"should-load-config"],"_gridConfig":[32],"_inMemoryLoader":[32],"_dataunit":[32]}],[2,"pesquisa-tree",{"treeLoader":[16],"argument":[1025],"allowsNonAnalytic":[4,"allows-non-analytic"],"shouldLoadTree":[4,"should-load-tree"],"messagesBuilder":[1040],"items":[32],"applyFilter":[64]}]]],["p-5d408e7e",[[2,"snk-pesquisa",{"searchLoader":[16],"treeLoader":[16],"selectItem":[16],"entityName":[1,"entity-name"],"argument":[1025],"isHierarchyEntity":[4,"is-hierarchy-entity"],"allowsNonAnalytic":[4,"allows-non-analytic"],"_itemList":[32],"_startLoading":[32],"_presentationMode":[32],"_currentView":[32],"_valideDataSource":[32],"executeSearch":[64]}]]],["p-028fb380",[[2,"snk-application",{"enableLockManagerLoadingApp":[4,"enable-lock-manager-loading-app"],"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"_applicationReady":[32],"_templateSkeleton":[32],"_activeScrimWindow":[32],"getKeyboardManager":[64],"getLayoutFormConfig":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"isFeatureActive":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"preloadMangerRemoveRecord":[64],"executeSearch":[64],"executePreparedSearchPlus":[64],"executePreparedSearch":[64],"executePreparedSearchWithFullResponse":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64],"clearPopUpTitle":[64],"setPopUpTitle":[64],"showScrimApp":[64],"markToReload":[64],"addLoadingLock":[64]}]]],["p-27482793",[[1,"teste-pesquisa"]]],["p-f35f2eb3",[[2,"field-item",{"fieldConfig":[8,"field-config"],"onLayoutConfig":[4,"on-layout-config"],"dataUnit":[16],"messagesBuilder":[1040],"fieldDescriptor":[32]}],[2,"field-config",{"dataUnit":[16],"fieldConfig":[1544,"field-config"],"fieldDescriptor":[16],"messagesBuilder":[1040],"fieldLabel":[32],"fieldLabelErrorMessage":[32],"fieldDefaultValue":[32],"fieldCleanOnCopy":[32],"fieldRequired":[32],"fieldReadOnly":[32],"_defaultType":[32],"show":[64]}]]],["p-f3027bc9",[[2,"fields-layout",{"selectedGuide":[16],"groupsList":[16],"guideNames":[16],"dataUnit":[16],"messagesBuilder":[1040],"isEditGuideNameActive":[32],"addFieldToLayout":[64]},[[16,"fieldConfigChanged","handleFieldConfigChanged"]]]]],["p-4c2e2767",[[2,"fields-selector",{"availableFields":[16],"dataUnit":[16],"messagesBuilder":[1040],"filterTerm":[32]}]]],["p-1037ea7b",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64],"validate":[64]}],[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"messagesBuilder":[1040],"customGuidesConfig":[16],"availableFields":[32],"guidesList":[32],"groupsList":[32],"selectedGuide":[32],"_formConfig":[32],"configOptions":[32],"originalConfigSelected":[32],"configSelected":[32],"hasChanges":[32],"optionConfigChanged":[32]},[[16,"fieldConfigChanged","handleFieldConfigChanged"],[16,"formConfigOptionSelected","handleFormConfigOptionSelected"],[16,"addFieldToGuide","handleAddFieldToGuide"],[16,"setFieldAsAvailable","handleSetFieldAsAvailable"],[16,"removeFieldFromAvailable","handleRemoveFieldFromAvailable"]]]]],["p-2fdac5e6",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-b7e891cc",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"fieldSearch":[16],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"_singleColumn":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64],"showSearchField":[64]}]]],["p-75af335e",[[2,"config-header",{"configOptions":[16],"selectedConfig":[16],"messagesBuilder":[1040],"hasChanges":[4,"has-changes"],"optionConfigChanged":[4,"option-config-changed"],"isEditingGuide":[32],"isEditingGroup":[32]},[[16,"isEditingGuideName","handleIsEditingGuideName"],[16,"isEditingGroupName","handleIsEditingGroupName"]]]]],["p-3b167a03",[[2,"guides-configurator",{"guidesList":[16],"selectedGuide":[16],"messagesBuilder":[1040],"mainGuide":[32],"filterTerm":[32],"visibleGuides":[32],"hiddenGuides":[32]}]]],["p-03f02b12",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"isDefaultFilter":[4,"is-default-filter"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-c4fcf1fb",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"layoutFormConfig":[4,"layout-form-config"],"entityName":[1,"entity-name"],"disableNumberingConfig":[4,"disable-numbering-config"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-7e250432",[[2,"configs-button",{"configOptions":[16],"selectedConfig":[16],"hasChanges":[4,"has-changes"],"messagesBuilder":[1040]}]]],["p-903fa0b4",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]},[[0,"snkMasterFormConfigChange","onMasterFormConfigChange"]]]]],["p-60dd1d27",[[2,"snk-default-filter",{"getMessage":[16],"hasDefaultFilter":[4,"has-default-filter"],"_opened":[32]}]]],["p-49ddc27a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"removalBlocked":[4,"removal-blocked"],"setFocusField":[64],"clearValue":[64]}]]],["p-42272de8",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-91a9abb6",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-9a63f3f7",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-9f16d33e",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-6e5af618",[[0,"snk-simple-form-config",{"dataUnit":[16],"configName":[1,"config-name"],"messagesBuilder":[16],"avaliableFields":[32],"selectedFields":[32],"show":[64]}],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"_collapsibleBoxListOrder":[32],"_collapsibleBoxListSelect":[32]}],[2,"snk-layout-form-config",{"messagesBuilder":[16],"layoutType":[32],"save":[64]}],[2,"snk-numbering-config",{"messagesBuilder":[16],"entityName":[1,"entity-name"],"resourceID":[1,"resource-i-d"],"autoNumbering":[32],"initialNumber":[32],"save":[64]}],[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"],"preventAutoFocus":[4,"prevent-auto-focus"]}],[2,"snk-view-representation",{"mode":[8]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]],[2,"taskbar-split-button",{"iconName":[1,"icon-name"],"action":[16],"name":[1],"className":[1,"class-name"],"dataElementId":[1,"data-element-id"],"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32]}]]],["p-c98c79c3",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"additionalSlotId":[1,"additional-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"actionsSettingsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_overFlowedElements":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32],"_hiddenActionsList":[32],"_lastWidth":[32],"_hasToUpdateOverFlow":[32],"_isWaitingForSave":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"],[8,"taskbarSaveLocker","handleTaskbarSaveLocker"],[8,"taskbarSaveUnlocker","handleTaskbarSaveUnlocker"]]]]],["p-471b34f4",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-c3dbf441",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"isDefaultFilter":[4,"is-default-filter"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"isDefaultFilter":[4,"is-default-filter"],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-21107f0d",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040],"isDefaultFilter":[4,"is-default-filter"]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-9b67a417",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[2,"snk-filter-bar",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"customFilterBarConfig":[16],"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"afterApplyConfig":[16],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"isFilterModalOpen":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"getFilters":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"]]],[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filterConfig":[1040],"opened":[4],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[1040],"filterDefaultToDelete":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterCustomConfigInterceptor":[16],"filtersWithError":[32]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]],[2,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-fd05e31d",[[6,"snk-grid",{"columnFilterDataSource":[1040],"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"gridHeaderDynamicSearchSlotId":[1,"grid-header-dynamic-search-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"outlineMode":[4,"outline-mode"],"suppressHorizontalScroll":[4,"suppress-horizontal-scroll"],"strategyExporter":[1025,"strategy-exporter"],"useSearchColumn":[4,"use-search-column"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"suppressCheckboxColumn":[4,"suppress-checkbox-column"],"suppressFilterColumn":[1028,"suppress-filter-column"],"compact":[4],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"_enableContinuousInsert":[32],"_filterMode":[32],"refreshColumnFilterDataSource":[64],"reloadConfig":[64],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64]},[[2,"click","handleClick"]]]]],["p-2e882241",[[2,"snk-attach",{"gridLegacyConfigName":[1,"grid-legacy-config-name"],"fetcherType":[1025,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32]}]]],["p-78d4b3e3",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"presentationMode":[1,"presentation-mode"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"_fieldToGetFocus":[32],"_hasToCreateFieldSearch":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-30a58e29",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[1040],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"enableGridInsert":[4,"enable-grid-insert"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"getCustomTitle":[16],"customGuidesConfig":[16],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"_mainForm":[32],"showFormConfig":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64],"reloadGuides":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-d2ec9a24",[[6,"snk-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"domainMessagesBuilder":[1,"domain-messages-builder"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"setCustomFormTitle":[16],"strategyExporter":[1025,"strategy-exporter"],"layoutFormConfig":[4,"layout-form-config"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"customGuidesConfig":[16],"showEntitySearch":[4,"show-entity-search"],"disableNumberingConfig":[4,"disable-numbering-config"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"numberingConfig":[32],"_showMoreOnSearch":[32],"_entityPKField":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"getNumberingConfig":[64],"updateNumberingConfig":[64]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as a}from"./p-d8d8169b.js";export{s as setNonce}from"./p-d8d8169b.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((e=>a(JSON.parse('[["p-7345782c",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-180716b2",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-667cab42",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-987cd79d",[[6,"snk-custom-slot-guide",{"slotName":[1,"slot-name"]},[[8,"snkShowGuide","onGuideChange"],[8,"formConfigVisibilityChanged","onFormConfigVisibilityChange"]]]]],["p-825098c1",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"value":[1040],"errorMessage":[1537,"error-message"],"_ezListSource":[32],"reloadList":[64]}]]],["p-96d45943",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"resetValues":[64],"clearValue":[64],"setFocus":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-7f7fe6c4",[[0,"snk-filter-checkbox-list",{"config":[1040],"errorMessage":[1537,"error-message"],"optionsList":[32],"setFocus":[64],"clearValue":[64]}]]],["p-e258de96",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-99a11017",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[1026],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"show":[64],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-e679c75a",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[1040],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64],"show":[64]}]]],["p-cb4343c4",[[0,"snk-filter-search",{"config":[16],"value":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-a9b16874",[[0,"snk-filter-text",{"config":[16],"value":[1],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-162bddae",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-3d41f5a8",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-82a3d522",[[6,"snk-simple-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"dataState":[1040],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"enableContinuousInsert":[1028,"enable-continuous-insert"],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"enableGridInsert":[4,"enable-grid-insert"],"paginationCounterMode":[1,"pagination-counter-mode"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"layoutFormConfig":[4,"layout-form-config"],"autoLoad":[4,"auto-load"],"outlineMode":[4,"outline-mode"],"_container":[32],"_showPopUpGridConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-01ca59fc",[[2,"pesquisa-grid",{"metadata":[16],"dataSource":[16],"pkField":[1,"pk-field"],"descriptionField":[1,"description-field"],"entityName":[1,"entity-name"],"shouldLoadConfig":[4,"should-load-config"],"_gridConfig":[32],"_inMemoryLoader":[32],"_dataunit":[32]}],[2,"pesquisa-tree",{"treeLoader":[16],"argument":[1025],"allowsNonAnalytic":[4,"allows-non-analytic"],"shouldLoadTree":[4,"should-load-tree"],"messagesBuilder":[1040],"items":[32],"applyFilter":[64]}]]],["p-5d408e7e",[[2,"snk-pesquisa",{"searchLoader":[16],"treeLoader":[16],"selectItem":[16],"entityName":[1,"entity-name"],"argument":[1025],"isHierarchyEntity":[4,"is-hierarchy-entity"],"allowsNonAnalytic":[4,"allows-non-analytic"],"_itemList":[32],"_startLoading":[32],"_presentationMode":[32],"_currentView":[32],"_valideDataSource":[32],"executeSearch":[64]}]]],["p-028fb380",[[2,"snk-application",{"enableLockManagerLoadingApp":[4,"enable-lock-manager-loading-app"],"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"_applicationReady":[32],"_templateSkeleton":[32],"_activeScrimWindow":[32],"getKeyboardManager":[64],"getLayoutFormConfig":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"isFeatureActive":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"preloadMangerRemoveRecord":[64],"executeSearch":[64],"executePreparedSearchPlus":[64],"executePreparedSearch":[64],"executePreparedSearchWithFullResponse":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64],"clearPopUpTitle":[64],"setPopUpTitle":[64],"showScrimApp":[64],"markToReload":[64],"addLoadingLock":[64]}]]],["p-27482793",[[1,"teste-pesquisa"]]],["p-f35f2eb3",[[2,"field-item",{"fieldConfig":[8,"field-config"],"onLayoutConfig":[4,"on-layout-config"],"dataUnit":[16],"messagesBuilder":[1040],"fieldDescriptor":[32]}],[2,"field-config",{"dataUnit":[16],"fieldConfig":[1544,"field-config"],"fieldDescriptor":[16],"messagesBuilder":[1040],"fieldLabel":[32],"fieldLabelErrorMessage":[32],"fieldDefaultValue":[32],"fieldCleanOnCopy":[32],"fieldRequired":[32],"fieldReadOnly":[32],"_defaultType":[32],"show":[64]}]]],["p-f3027bc9",[[2,"fields-layout",{"selectedGuide":[16],"groupsList":[16],"guideNames":[16],"dataUnit":[16],"messagesBuilder":[1040],"isEditGuideNameActive":[32],"addFieldToLayout":[64]},[[16,"fieldConfigChanged","handleFieldConfigChanged"]]]]],["p-4c2e2767",[[2,"fields-selector",{"availableFields":[16],"dataUnit":[16],"messagesBuilder":[1040],"filterTerm":[32]}]]],["p-1037ea7b",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64],"validate":[64]}],[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"messagesBuilder":[1040],"customGuidesConfig":[16],"availableFields":[32],"guidesList":[32],"groupsList":[32],"selectedGuide":[32],"_formConfig":[32],"configOptions":[32],"originalConfigSelected":[32],"configSelected":[32],"hasChanges":[32],"optionConfigChanged":[32]},[[16,"fieldConfigChanged","handleFieldConfigChanged"],[16,"formConfigOptionSelected","handleFormConfigOptionSelected"],[16,"addFieldToGuide","handleAddFieldToGuide"],[16,"setFieldAsAvailable","handleSetFieldAsAvailable"],[16,"removeFieldFromAvailable","handleRemoveFieldFromAvailable"]]]]],["p-2fdac5e6",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-b7e891cc",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"fieldSearch":[16],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"_singleColumn":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64],"showSearchField":[64]}]]],["p-75af335e",[[2,"config-header",{"configOptions":[16],"selectedConfig":[16],"messagesBuilder":[1040],"hasChanges":[4,"has-changes"],"optionConfigChanged":[4,"option-config-changed"],"isEditingGuide":[32],"isEditingGroup":[32]},[[16,"isEditingGuideName","handleIsEditingGuideName"],[16,"isEditingGroupName","handleIsEditingGroupName"]]]]],["p-3b167a03",[[2,"guides-configurator",{"guidesList":[16],"selectedGuide":[16],"messagesBuilder":[1040],"mainGuide":[32],"filterTerm":[32],"visibleGuides":[32],"hiddenGuides":[32]}]]],["p-03f02b12",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"isDefaultFilter":[4,"is-default-filter"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-c4fcf1fb",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"layoutFormConfig":[4,"layout-form-config"],"entityName":[1,"entity-name"],"disableNumberingConfig":[4,"disable-numbering-config"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-7e250432",[[2,"configs-button",{"configOptions":[16],"selectedConfig":[16],"hasChanges":[4,"has-changes"],"messagesBuilder":[1040]}]]],["p-903fa0b4",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]},[[0,"snkMasterFormConfigChange","onMasterFormConfigChange"]]]]],["p-60dd1d27",[[2,"snk-default-filter",{"getMessage":[16],"hasDefaultFilter":[4,"has-default-filter"],"_opened":[32]}]]],["p-49ddc27a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"removalBlocked":[4,"removal-blocked"],"setFocusField":[64],"clearValue":[64]}]]],["p-42272de8",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-91a9abb6",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-9a63f3f7",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-9f16d33e",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-6e5af618",[[0,"snk-simple-form-config",{"dataUnit":[16],"configName":[1,"config-name"],"messagesBuilder":[16],"avaliableFields":[32],"selectedFields":[32],"show":[64]}],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"_collapsibleBoxListOrder":[32],"_collapsibleBoxListSelect":[32]}],[2,"snk-layout-form-config",{"messagesBuilder":[16],"layoutType":[32],"save":[64]}],[2,"snk-numbering-config",{"messagesBuilder":[16],"entityName":[1,"entity-name"],"resourceID":[1,"resource-i-d"],"autoNumbering":[32],"initialNumber":[32],"save":[64]}],[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"],"preventAutoFocus":[4,"prevent-auto-focus"]}],[2,"snk-view-representation",{"mode":[8]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]],[2,"taskbar-split-button",{"iconName":[1,"icon-name"],"action":[16],"name":[1],"className":[1,"class-name"],"dataElementId":[1,"data-element-id"],"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32]}]]],["p-c98c79c3",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"additionalSlotId":[1,"additional-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"actionsSettingsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_overFlowedElements":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32],"_hiddenActionsList":[32],"_lastWidth":[32],"_hasToUpdateOverFlow":[32],"_isWaitingForSave":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"],[8,"taskbarSaveLocker","handleTaskbarSaveLocker"],[8,"taskbarSaveUnlocker","handleTaskbarSaveUnlocker"]]]]],["p-471b34f4",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-c3dbf441",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"isDefaultFilter":[4,"is-default-filter"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"isDefaultFilter":[4,"is-default-filter"],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-21107f0d",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040],"isDefaultFilter":[4,"is-default-filter"]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-b04db4ac",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[2,"snk-filter-bar",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"customFilterBarConfig":[16],"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"afterApplyConfig":[16],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"isFilterModalOpen":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"getFilters":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"]]],[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filterConfig":[1040],"opened":[4],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[1040],"filterDefaultToDelete":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterCustomConfigInterceptor":[16],"filtersWithError":[32]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]],[2,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-fd05e31d",[[6,"snk-grid",{"columnFilterDataSource":[1040],"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"gridHeaderDynamicSearchSlotId":[1,"grid-header-dynamic-search-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"outlineMode":[4,"outline-mode"],"suppressHorizontalScroll":[4,"suppress-horizontal-scroll"],"strategyExporter":[1025,"strategy-exporter"],"useSearchColumn":[4,"use-search-column"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"suppressCheckboxColumn":[4,"suppress-checkbox-column"],"suppressFilterColumn":[1028,"suppress-filter-column"],"compact":[4],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"_enableContinuousInsert":[32],"_filterMode":[32],"refreshColumnFilterDataSource":[64],"reloadConfig":[64],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64]},[[2,"click","handleClick"]]]]],["p-2e882241",[[2,"snk-attach",{"gridLegacyConfigName":[1,"grid-legacy-config-name"],"fetcherType":[1025,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32]}]]],["p-78d4b3e3",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"presentationMode":[1,"presentation-mode"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"_fieldToGetFocus":[32],"_hasToCreateFieldSearch":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-30a58e29",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[1040],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"enableGridInsert":[4,"enable-grid-insert"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"getCustomTitle":[16],"customGuidesConfig":[16],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"_mainForm":[32],"showFormConfig":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64],"reloadGuides":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-d2ec9a24",[[6,"snk-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"domainMessagesBuilder":[1,"domain-messages-builder"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"setCustomFormTitle":[16],"strategyExporter":[1025,"strategy-exporter"],"layoutFormConfig":[4,"layout-form-config"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"customGuidesConfig":[16],"showEntitySearch":[4,"show-entity-search"],"disableNumberingConfig":[4,"disable-numbering-config"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"numberingConfig":[32],"_showMoreOnSearch":[32],"_entityPKField":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"getNumberingConfig":[64],"updateNumberingConfig":[64]}]]]]'),e)));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{E as n}from"./p-1a68fb59.js";const r=class{constructor(s){t(this,s),this.valueChanged=i(this,"valueChanged",7),this._startDateLabel="Inicial",this._endDateLabel="Final",this._toLabel="até",this.internalChange={start:!1,end:!1},this.config=void 0,this.getMessage=void 0,this.value={start:null,end:null},this.presentationMode=n.CHIP,this.errorMessage=void 0}configChanged(t,i){this.internalChange.end?this.internalChange.end=!1:this.internalChange.start?this.internalChange.start=!1:!t||t.start===(null==i?void 0:i.start)&&t.end===(null==i?void 0:i.end)||(this.valueStart=this.parseDate(t.start),this.valueEnd=this.parseDate(t.end))}ezChangeListener(t,i){this.errorMessage=void 0,this.internalChange[i]=!0,this.value=Object.assign(Object.assign({},this.value||{}),{[i]:t.detail?this.parseDate(t.detail):null}),this.valueChanged.emit(this.value)}async setFocus(){this._startDate.setFocus()}async clearValue(){this.value=this.config.value,this.valueStart=this.getDate("start"),this.valueEnd=this.getDate("end")}componentDidLoad(){this._element&&(h.addIDInfo(this._element,"filterContentEditor"),this._element.querySelectorAll("ez-date-input").forEach((t=>{t.shadowRoot.querySelector("ez-text-input").style.setProperty("--ez-text-input__min-width","120px")})))}parseDate(t){return t instanceof Date?t:"string"==typeof t?((t=new Date(t)).setMinutes(t.getMinutes()+t.getTimezoneOffset()),t):null}getDate(t){return this.parseDate(this.value?this.value[t]:null)}async show(){this._startDate.setFocus()}buildLabel(){if(this.presentationMode===n.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}componentWillLoad(){this.getMessage&&(this._startDateLabel=this.getMessage("snkFilterBar.labelStart"),this._endDateLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo")),this.valueStart=this.getDate("start"),this.valueEnd=this.getDate("end")}render(){if(this.config&&this.config.type===a.PERIOD)return s("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},s("div",{class:"ez-col ez-col--nowrap"},s("ez-date-input",{id:`${this.config.id}_start`,class:this.presentationMode===n.MODAL?"ez-padding-right--medium":"",label:this._startDateLabel,ref:t=>this._startDate=t,enabled:this.config.enabled,value:this.valueStart,errorMessage:this.errorMessage,onEzChange:t=>this.ezChangeListener(t,"start")}),this.buildLabel(),s("ez-date-input",{id:`${this.config.id}_end`,label:this._endDateLabel,ref:t=>this._endDate=t,enabled:this.config.enabled,value:this.valueEnd,errorMessage:this.errorMessage,onEzChange:t=>this.ezChangeListener(t,"end")})))}get _element(){return e(this)}static get watchers(){return{value:["configChanged"]}}};export{r as snk_filter_period}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as r}from"./p-d8d8169b.js";import{DataType as l,StringUtils as a,ObjectUtils as n,ElementIDUtils as o,ErrorException as h,ApplicationContext as d,LockManager as c,LockManagerOperation as u,DateUtils as f,MaskFormatter as m,KeyboardManager as p,FloatingManager as v,ArrayUtils as b}from"@sankhyalabs/core";import{EzScrollDirection as g}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as k}from"./p-0e4f8b86.js";import{P as _}from"./p-988afe78.js";import{toString as F}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as y}from"./p-ff1990ad.js";import{F as z,D as x}from"./p-84345e7a.js";import{F as w}from"./p-fa80e546.js";import{ModalAction as C}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{ApplicationUtils as I}from"@sankhyalabs/ezui/dist/collection/utils";import{A as $}from"./p-6a4b21dd.js";import{F as N}from"./p-b568c1d4.js";import{g as T}from"./p-76e66fd9.js";import"./p-4db9dbf8.js";import"./p-1b1373b6.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";function L(t){let i="";return t.forEach(((t,e)=>{var s;i+=` ${e>0?null!==(s=t.operand)&&void 0!==s?s:"OR":""} ${t.expression}`})),i.trim()}const A=class{constructor(e){t(this,e),this.configUpdated=i(this,"configUpdated",7),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._firstLoad=!0,this._pendingVariables=!1,this._isDefaultFilter=!1,this._customfiltersToBeUpdated=[],this._resolveLoading=void 0,this._calculateSortIndex=t=>{if(!t.visible)return 0;if(t.hardFixed)return 1e6;let i=t.fixed?1e5:0;return i+=this.hasValidValue(t)?1e4:0,i+=this._updateSequence.lastIndexOf(t.id)+1,i},this._filtersComparator=(t,i)=>this._calculateSortIndex(i)-this._calculateSortIndex(t),this.enableLockManagerLoadingComp=!1,this.customFilterBarConfig=void 0,this.dataUnit=void 0,this.title=void 0,this.configName=void 0,this.resourceID=void 0,this.mode="regular",this.filterConfig=void 0,this.messagesBuilder=void 0,this.disablePersonalizedFilter=void 0,this.filterBarLegacyConfigName=void 0,this.autoLoad=void 0,this.afterApplyConfig=void 0,this.filterCustomConfig=void 0,this.filterCustomConfigInterceptor=void 0,this.allowDefault=void 0,this.scrollerLocked=!1,this.showPersonalizedFilter=!1,this.personalizedFilterId=void 0,this.isFilterModalOpen=!1}hasValidValue(t){return null!=t.value&&(!Array.isArray(t.value)||t.value.some((t=>!0===t.check)))}observeFilterConfig(t,i){n.equals(t,i)||this.handleFilterConfigsChanged(i,t)}handleFilterConfigsChanged(t,i){if(null!=t&&null==i)this._loadingPending=!0,this._configUpdated=!0;else{const e=new Map(t?t.map((t=>[t.id,t])):void 0);0===e.size&&i.length>0?(this._loadingPending=!0,this._configUpdated=!1):i.forEach((t=>{const i=e.get(t.id);if(null!=i){if(this._configUpdated=this._configUpdated||n.objectToString(i)!=n.objectToString(t),this._loadingPending=this._loadingPending||n.objectToString(i.value)!==n.objectToString(t.value),!this._loadingPending){const e=n.objectToString(i.groupedItems)!=n.objectToString(t.groupedItems);this._configUpdated=this._configUpdated||e,this._loadingPending=this._loadingPending||e}}else this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value}))}(this._loadingPending||this._configUpdated)&&this.configUpdated.emit(i),this.processAfterUpdateConfig()}async reload(){this.loadConfigFromStorage(!0)}async getFilterItem(t){const i=this.filterConfig.find((i=>i.id===t));return Promise.resolve(n.copy(i))}async updateFilterItem(t){return-1==this.filterConfig.findIndex((i=>i.id===t.id))?(console.warn("[SnkFilterBar.updateFilterItem] "+this.getMessage("snkFilterBar.filterItem.updateFilterItemNotFound")),Promise.resolve()):(this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async addFilterItem(t){return this.filterConfig.findIndex((i=>i.id===t.id))>-1?(console.warn("[SnkFilterBar.addFilterItem] "+this.getMessage("snkFilterBar.filterItem.addFilterItemExists")),Promise.resolve()):(this.filterConfig.push(t),this._loadingPending=!0,this.updateFilter(t),Promise.resolve())}async removeFilterItem(t){const i=this.filterConfig.findIndex((i=>i.id===t));if(-1==i)return console.warn("[SnkFilterBar.removeFilterItem] "+this.getMessage("snkFilterBar.filterItem.removeFilterItemNotFound")),Promise.resolve(void 0);const e=this.filterConfig[i];return this.filterConfig=this.filterConfig.filter((i=>i.id!==t)),Promise.resolve(e)}componentDidLoad(){this._element&&o.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}processPendingFilter(){if(this._pendingVariables){const t=this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");t&&t.showUp(!0).then((()=>{this.processAfterUpdateConfig()}))}else this.processAfterUpdateConfig()}getPersonalizedFilterItem(){return this.filterConfig.find((t=>t.type===y.PERSONALIZED))}async processAfterUpdateConfig(){var t;if(this._loadingPending){if(await this._application.isLoadedByPk()&&!this._configUpdated)return;const t=this.getPersonalizedFilterItem();if(this._pendingVariables=!_.validateVariableValues(t),this._pendingVariables)return;this._loadingPending=!1,this.doLoadData()}this._configUpdated&&(this._configUpdated=!1,k.saveFilterBarConfig(this.filterConfig,this.configName,this.resourceID),null===(t=this.afterApplyConfig)||void 0===t||t.call(this))}async doLoadData(t=!1){try{if(this._firstLoad&&!1===this.autoLoad)return;if(this._firstLoad&&!t&&void 0===this.autoLoad&&!await this._application.getBooleanParam("global.carregar.registros.iniciar.tela"))return;this.dataUnit.loadData(void 0,void 0,!0)}finally{this._firstLoad=!1}}getMessage(t,i,e){var s;return null==this.messagesBuilder&&this._application&&(this.messagesBuilder=this._application.messagesBuilder),(null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(t,i))||e}async getFilters(){return this.getFilter(null)}getFilter(t){var i;const e=[];return null===(i=this.filterConfig)||void 0===i||i.filter((t=>this.isActiveFilter(t))).forEach((t=>{const i=(t=>{switch(t.type){case y.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case y.BINARY_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.options.find((t=>t.name===e)).expression,params:[]}}(t);case y.MULTI_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:l.TEXT,value:e}]}}(t);case y.MULTI_LIST:return function(t){const{id:i,value:e,props:s}=t,r=(null!==(o=null!==(n=null==(a=e)?void 0:a.elements)&&void 0!==n?n:null==a?void 0:a.members)&&void 0!==o?o:a).filter((t=>null==t?void 0:t.check)).map((({id:t})=>Number.isNaN(+t)?String(t):Number(t)));var a,n,o;if(r.length>0)return{name:i,expression:s.expression,params:[{name:i,dataType:l.TEXT,value:JSON.stringify(r)}]}}(t);case y.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:a}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof a&&(a=new Date(a));const n=[];let o;return r&&a?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:l.DATE,value:F(l.DATE,a)},{name:`${i}.END`,dataType:l.DATE,value:F(l.DATE,r)})):a?(o=s.expression.onlystart,n.push({name:i,dataType:l.DATE,value:F(l.DATE,a)})):(o=s.expression.onlyend,n.push({name:i,dataType:l.DATE,value:F(l.DATE,r)})),{name:i,expression:o,params:n}}(t);case y.SEARCH:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:l.TEXT,value:F(l.TEXT,null==e?void 0:e.value)}]}}(t);case y.TEXT:return function(t){let{id:i,value:e,props:s}=t;const r=s.expression;var n,o;return a.isEmpty(s.likeAs)||(n=e,e="CONTANIS"===(o=s.likeAs)?`%${n}%`:"STARTS_WITH"===o?`${n}%`:"ENDS_WITH"===o?`%${n}`:n),{name:i,expression:r,params:[{name:i,dataType:l.TEXT,value:F(l.TEXT,e)}]}}(t);case y.NUMBER:return function(t){const{id:i,value:e,props:s}=t;if(s.variation===w.INTERVAL){const{start:t,end:r}=null!=e?e:{start:0,end:0};if(!isNaN(t)&&!isNaN(r))return{name:i,expression:s.intervalExpression.fullfill,params:[{name:`${i}.START`,dataType:l.NUMBER,value:F(l.NUMBER,t)},{name:`${i}.END`,dataType:l.NUMBER,value:F(l.NUMBER,r)}]};if(!isNaN(t))return{name:i,expression:s.intervalExpression.onlystart,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,t)}]};if(!isNaN(r))return{name:i,expression:s.intervalExpression.onlyend,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,r)}]}}return{name:i,expression:s.expression,params:[{name:i,dataType:l.NUMBER,value:F(l.NUMBER,e)}]}}(t);case y.PERSONALIZED:return function(t){const{id:i,groupedItems:e=[]}=t,s=e.filter((t=>!!t.visible)).map((t=>{var i;const e=t.props.expression,s=((null===(i=t.props.personalizedFilter)||void 0===i?void 0:i.parameters)||[]).map(((i,e)=>{const s=Array.from(t.value||0),r=i.dataType;let a=e>=0&&e<s.length?s[e]:null;return null!=a&&"object"==typeof a&&"value"in a&&(a=a.value),null==a&&r===l.BOOLEAN&&(a=!1),{name:i.name,dataType:r,value:"string"==typeof a?a:F(r,a)}}));return{expression:e,name:t.id,params:s}}));return{name:i,expression:s.map((t=>`(${t.expression})`)).join(` ${z.AND} `),params:s.flatMap((t=>t.params))}}(t);case y.CHECK_BOX_LIST:return function(t){var i;const{id:e,value:s,props:r}=t,l=Object.entries(null!=s?s:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t));return{name:e,expression:L(null===(i=r.options)||void 0===i?void 0:i.filter((t=>l.includes(t.name)))),params:[]}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.type===y.DEFAULT_FILTER||this.filterActiveFilter(t)&&(t.groupedItems||null!=t.value)}async registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&await this.doLoadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((i=>{i.id===t?"snk-filter-item"===i.tagName.toLowerCase()&&i.getClientRects()[0].x<0&&i.scrollIntoView({behavior:"auto",inline:"nearest"}):i.hideDetail()}))}filterActiveFilter(t){return t.visible||t.removalBlocked}filterPersonalizedItems(t){return t.type===y.PERSONALIZED}getPersonalizedFilterVariableItems(){return this.filterConfig.filter(this.filterPersonalizedItems).map((t=>{const i=`filter-${t.id}`;return e("snk-filter-item",{key:t.id,id:i,config:Object.assign({},t),onFocusin:()=>this.itemFocused(i),onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),getMessage:(t,i)=>this.getMessage(t,i),showChips:!1})}))}getFilterItems(){const t=[],i=[];this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i))).filter(this.filterActiveFilter).forEach((s=>{const r=`filter-${(s=n.copy(s)).id}`,l=e("snk-filter-item",{onVisibleChanged:t=>this.scrollerLocked=t.detail,onFilterChange:t=>this.updateFilter(t.detail),onFocusin:()=>this.itemFocused(r),id:r,config:s,class:"ez-margin-horizontal--extra-small",getMessage:(t,i)=>this.getMessage(t,i),key:s.id});return s.fixed||s.hardFixed||s.required?t.push(l):i.push(l),l}));const s=[];return s.push(...t.reverse()),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-margin-horizontal--small ez-margin-vertical--auto ez-divider-vertical ez-divider--dark snk-filter-bar__divider"})),s.push(...i),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((i=>t.id!==i)),this._updateSequence.push(t.id))}normalizeItem(t){const i=Object.assign({},t);return["props","value","hardFixed","fixed"].forEach((t=>{null==i[t]&&delete i[t]})),""===t.value&&delete t.value,i}updateFilter(t){let i=this.filterConfig.map((i=>(t=this.normalizeItem(t),i.id===t.id?(n.objectToString(i)!=n.objectToString(t)&&this.calculateUpdateSequence(t),t):i))).sort(((t,i)=>this._filtersComparator(t,i)));this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}addFilterBarLegacyConfigName(){this.filterBarLegacyConfigName&&k.addFilterBarLegacyConfig(this.configName,this.filterBarLegacyConfigName)}async loadConfigFromStorage(t){try{let i;t&&await k.deleteFilterBarConfigCache(this.configName,this.resourceID),i=this.customFilterBarConfig?await this.customFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}):await k.loadFilterBarConfig(this.configName,this.resourceID,{contextURI:this.dataUnit.name}),this.filterCustomConfig&&(i=[...this.filterCustomConfig,...i]),this.filterCustomConfigInterceptor&&(i=this.filterCustomConfigInterceptor(i)),this.filterConfig=i.map((t=>this.normalizeItem(t))),this.filterConfig.sort(((t,i)=>this._filtersComparator(t,i)))}catch(t){throw new h(this.getMessage("snkFilterBar.failToLoadConfig"),t)}}async attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const i=t;this.dataUnit=i.dataUnit,this.dataUnit?await this.registryFilterProvider():i.addEventListener("dataUnitReady",(async t=>{this.dataUnit=t.detail,await this.registryFilterProvider()}));break}t=t.parentElement}else await this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}async showFilterModal(){this.isFilterModalOpen||(this.isFilterModalOpen=!0)}addPersonalizedFilter(t=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=t,this.personalizedFilterId=void 0,this.showPersonalizedFilter=!0,window.requestAnimationFrame((()=>{this._elPersonalizedFilter.createPersonalizedFilter()}))}editPersonalizedFilter(t,i=!1){this.isFilterModalOpen=!1,this._isDefaultFilter=i,this.showPersonalizedFilter=!0,this.personalizedFilterId=t}deletePersonalizedFilter(t,i,e,s=!1){if(s)return k.removeDefaultFilter(t,this.resourceID,e),void(this._isDefaultFilter=!1);i===y.PERSONALIZED&&k.removePersonalizedFilter(t,this.resourceID,e)}closeFilterModal(){this.isFilterModalOpen=!1}applyFiltersFromModal(t){var i;this.filterConfig=t.map(this.normalizeItem).sort(((t,i)=>this._filtersComparator(t,i))),null===(i=this.afterApplyConfig)||void 0===i||i.call(this),this.isFilterModalOpen=!1}handleHidePersonalizedFilter(t){t?this.loadConfigFromStorage().then((()=>{this.hidePersonalizedFilter()})):this.hidePersonalizedFilter()}hidePersonalizedFilter(){this.personalizedFilterId=void 0,this.showPersonalizedFilter=!1,this._isDefaultFilter=!1}async componentWillLoad(){var t;try{if(this._application=d.getContextValue("__SNK__APPLICATION__"),await this.attachDataUnit(),this._application){if(this._application.enableLockManagerLoadingApp&&this.enableLockManagerLoadingComp){const t=c.addLockManagerCtxId(this._element);this._resolveLoading=c.lock(t,u.APP_LOADING)}await Promise.all([this.loadPermitions(),this.addFilterBarLegacyConfigName(),this.loadConfigFromStorage()])}}finally{null===(t=this._resolveLoading)||void 0===t||t.call(this)}}componentDidRender(){this.processPendingFilter()}render(){if(!this.dataUnit||!this.filterConfig||0===this.filterConfig.length)return;if(this.showPersonalizedFilter)return e("snk-personalized-filter",{class:"filter-bar__personalized-filter",filterId:this.personalizedFilterId,ref:t=>this._elPersonalizedFilter=t,isDefaultFilter:this._isDefaultFilter,onEzCancel:()=>this.handleHidePersonalizedFilter(!1),onEzAfterSave:()=>this.handleHidePersonalizedFilter(!0),entityUri:this.dataUnit.name,configName:this.configName,resourceID:this.resourceID});let t=n.copy(this.filterConfig);return t=t.sort(((t,i)=>t.originOrder-i.originOrder)),"regular"!==this.mode?e(s,{"data-mode":this.mode},this.getPersonalizedFilterVariableItems(),"button"===this.mode&&e("ez-button",{class:"ez-margin-left--medium",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)}),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,y.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor})):e(s,null,e("div",null,e("span",{class:"snk-filter-bar__title",title:this.title,"data-tooltip":this.title,"data-flow":"bottom"},this.title)),e("ez-scroller",{class:"snk-filter-bar__scroller",direction:g.HORIZONTAL,activeShadow:!0,locked:this.scrollerLocked},e("section",{class:"snk-filter-bar__filter-item-container"},this.getFilterItems())),e("ez-button",{class:"ez-padding-left--medium ez-margin-top--extra-small",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,this.getMessage("snkFilterBar.filters")),onClick:this.showFilterModal.bind(this)},e("ez-icon",{slot:"leftIcon",iconName:"plus",class:"ez-padding-right--small"})),e("snk-filter-modal",{opened:this.isFilterModalOpen,filterConfig:this.filterConfig,configName:this.configName,disablePersonalizedFilter:this.disablePersonalizedFilter,getMessage:(t,i)=>this.getMessage(t,i),applyFilters:t=>this.applyFiltersFromModal(t),closeModal:()=>this.closeFilterModal(),addPersonalizedFilter:t=>this.addPersonalizedFilter(t),editPersonalizedFilter:(t,i)=>this.editPersonalizedFilter(t,i),deletePersonalizedFilter:(t,i,e)=>this.deletePersonalizedFilter(t,y.PERSONALIZED,i,e),filterCustomConfigInterceptor:this.filterCustomConfigInterceptor}))}get _element(){return r(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};A.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode="hidden"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode="button"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;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);height:80%}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start;margin:var(--space--2, 2px) 0}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.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:99%;height:100%}';const P=class{constructor(e){t(this,e),this.visibleChanged=i(this,"visibleChanged",7),this.filterChange=i(this,"filterChange",3),this._keyboardManager=void 0,this.detailIsVisible=void 0,this.config=void 0,this.getMessage=void 0,this.showChips=!0}observeDetailIsVisible(t){this.visibleChanged.emit(t)}filterChangeListener(){this.hideDetail()}async showUp(t=!1){var i;this._filterItemElement.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t&&(await(null===(i=this._chipElement)||void 0===i?void 0:i.setBlur()),await this._popover.showUnder(this._chipElement),await this._filterDetail.setFocusField())}async hideDetail(){var t;await(null===(t=this._popover)||void 0===t?void 0:t.hide())}getConfigChanges(){var t;const i=this.config;(null===(t=i.groupedItems)||void 0===t?void 0:t.length)&&(i.visible=!1,i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1}))));const e=i.type===y.MULTI_LIST&&Array.isArray(i.value)?i.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0;return Object.assign(Object.assign({},i),{value:e})}clearFilter(t){if(null==t||t.stopPropagation(),this.canClearFilter()){const t=this.getConfigChanges();this.filterChange.emit(t)}else this.togglePopover(t)}async togglePopover(t){null==t||t.preventDefault(),null==t||t.stopPropagation(),!1!==this.config.enabled&&(this.detailIsVisible?await this.hideDetail():await this.showUp(!0))}getLabel(t=!1){var i,e;const{type:s,value:r,label:l,props:a,groupedItems:n=[]}=this.config;if(r||n.length){if(s===y.BINARY_SELECT){const[i,e]=a.options,s=this.getMessage("snkFilterBar.binarySelectTooltip");if(i.name===r)return t?`${s} ${String(i.label).toLowerCase()}`:i.label;if(e.name===r)return t?`${s} ${String(e.label).toLowerCase()}`:e.label}if(s===y.MULTI_SELECT)return`${l}: ${a.options.find((t=>t.value===r)).label}`;if(s===y.PERIOD){let{end:i,start:e}=r;"string"==typeof i&&(i=new Date(i),i.setMinutes(i.getMinutes()+i.getTimezoneOffset())),"string"==typeof e&&(e=new Date(e),e.setMinutes(e.getMinutes()+e.getTimezoneOffset()));const s=new Intl.DateTimeFormat("pt-BR");if(i&&e){const s=e.getFullYear()===i.getFullYear(),r=Object.assign({day:"2-digit",month:"2-digit"},(!s||t)&&{year:"2-digit"}),a=f.formatDate(e,r),n=f.formatDate(i,r);return t?this.getMessage("snkFilterBar.fullPeriodTooltip",{LABEL:l,START_LABEL:a,END_LABEL:n}):`${l}: ${a} → ${n}`}return e?`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${s.format(e)}`:i?`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${s.format(i)}`:l}if(s===y.SEARCH)return`${l}: ${r.value} - ${r.label}`;if(s===y.PERSONALIZED){const t=this.calculateActiveCount(n);return t<=0?l:`${l}: ${this.getMessage("snkFilterBar.personalizedCount",{activeCount:t})}`}if(s===y.MULTI_LIST){const e=(null!==(i=r.elements)&&void 0!==i?i:r).filter((t=>null==t?void 0:t.check));return this.getLabelFromCheckedOptions(e,l,t)}if(s===y.CHECK_BOX_LIST){const i=Object.entries(null!=r?r:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)),s=(null!==(e=a.options)&&void 0!==e?e:[]).filter((t=>i.includes(t.name)));return this.getLabelFromCheckedOptions(s,l,t)}if(s===y.NUMBER&&a.variation===w.INTERVAL){const{start:t,end:i}=r;if(!isNaN(t)&&!isNaN(i))return this.getMessage("snkFilterBar.fullIntervalTooltip",{LABEL:l,START_LABEL:t,END_LABEL:i});if(!isNaN(t))return`${l}: ${this.getMessage("snkFilterBar.onlyStartToltip")} ${Number(t)}`;if(!isNaN(i))return`${l}: ${this.getMessage("snkFilterBar.onlyEndToltip")} ${Number(i)}`}return this.config.mask?`${l}: ${new m(this.config.mask).format(r)}`:`${l}: ${r}`}return l}getLabelFromCheckedOptions(t,i,e){const s=t.length;return 0===s?`${i}`:s>1?e?`${i}: ${t.map((t=>t.label)).join(",")}`:`${i}: ${s} ${this.getMessage("snkFilterBar.multiListToltip")}`:`${i}: ${t[0].label}`}calculateActiveCount(t){return t.reduce(((t,i)=>i.visible?t+1:t),0)}componentDidLoad(){this._filterItemElement&&(o.addIDInfo(this._filterItemElement),this._idSnkFilterDetail=`filterDetail_${this.config.id}`)}canClearFilter(){const{value:t,groupedItems:i=[]}=this.config;return null!=t&&this.config.type===y.MULTI_LIST?t.some((t=>t.check)):void 0!==t||i.some((t=>t.visible))}getRightIconName(){return this.canClearFilter()?"close":this.detailIsVisible?"chevron-up":"chevron-down"}getLeftIconName(){switch(this.config.type){case y.PERIOD:return"calendar";case y.PERSONALIZED:return"tune"}}hasActiveElements(t){var i;const e=Array.isArray(t)?t:null==t?void 0:t.elements;return(null===(i=null==e?void 0:e.filter((t=>null==t?void 0:t.check)))||void 0===i?void 0:i.length)>0}hasActiveValue(t){return t.type!==y.MULTI_LIST&&void 0!==t.value||this.hasActiveElements(t.value)}getEnabledChip(){if(this.detailIsVisible)return!0;if(this.config.type===y.PERSONALIZED){const{groupedItems:t=[]}=this.config;return t.some((t=>t.visible))}return this.hasActiveValue(this.config)}async handleVisibilityPopover(t){this.detailIsVisible=t.detail,this.detailIsVisible||await this._filterDetail.clearValue()}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}hasValue(){return this.config.type===y.MULTI_LIST?this.hasActiveElements(this.config.value):null!=this.config.value}getTooltipMessage(){var t,i;return this.config.required&&!this.hasValue()?{message:null!==(t=this.config.requiredMessage)&&void 0!==t?t:this.getCustomMessage("validations.requiredFilter"),type:"error"}:!1===this.config.enabled&&this.config.disabledMessage?{message:this.config.disabledMessage,type:"warning"}:{message:null!==(i=this.config.defaultMessage)&&void 0!==i?i:this.getLabel(!0),type:"default"}}getTypeChip(t){switch(t){case"default":return"secondary";case"warning":return"warning-light";case"error":return"error-light";case"success":return"success-light";default:return t}}initKeyboardManager(){this._keyboardManager=new p({element:this._filterItemElement,propagate:!0}),this._keyboardManager.bind("Escape",(()=>this.hideDetail()))}connectedCallback(){this.initKeyboardManager()}disconnectedCallback(){this._keyboardManager.unbindAllShortcutKeys()}render(){const t=this.getLeftIconName(),{type:i,message:r}=this.getTooltipMessage();return e(s,null,this.showChips&&e("ez-tooltip",{id:this.config.id,message:r,type:i,active:!this.detailIsVisible,strategy:"fixed"},e("ez-chip",{id:this.config.id,ref:t=>this._chipElement=t,label:this.getLabel(),value:this.getEnabledChip(),onClick:t=>this.togglePopover(t),disableAutoUpdateValue:!0,type:this.getTypeChip(i),enabled:this.config.enabled},t&&e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,slot:"leftIcon"}),e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),slot:"rightIcon",id:"removeFilter",onClick:t=>this.clearFilter(t)}))),e("ez-popover-core",{ref:t=>this._popover=t,onEzVisibilityChange:t=>this.handleVisibilityPopover(t)},e("snk-filter-detail",{ref:t=>this._filterDetail=t,key:this.config.id,config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16","data-element-id":this._idSnkFilterDetail,showHardFixed:this.showChips&&!this.config.required,removalBlocked:this.config.required})))}get _filterItemElement(){return r(this)}static get watchers(){return{detailIsVisible:["observeDetailIsVisible"]}}};P.style="ez-popover-core.sc-snk-filter-item{--ez-popover__box--z-index:var(--elevation--20, 20);--ez-popover__box--overlay-z-index:var(--elevation--16, 16)}";const D="__SHOWMORE__",S=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=v.MODAL_ELEMENT_ID||(this._detailIsVisible=!1,!1),this._filterArgument=void 0,this._showAll=void 0,this.label=void 0,this.iconName=void 0,this.items=void 0,this.getMessage=void 0,this.emptyText=void 0,this.findFilterText=void 0,this.buttonClass=void 0}showDetail(){this._preselection=-1,this._floatingID=v.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onListCloseCallback(),useOverlay:!0}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument="",this._filterInput.setFocus()}async hideDetail(){null!=this._floatingID&&v.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&o.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME),o.addIDInfoIfNotExists(t,"filterItemList",e)}buildItemElement(t){const i=++this._selectableItemsCount;return e("button",{ref:i=>i&&this.buildIdElement(i,t.label),id:`filter-item${i}`,onFocusin:()=>this._preselection=i,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(t.name),name:t.label,key:i},t.iconName?e("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,e("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 ${t.labelClass||""}`},t.label))}itemSelected(t){t===D?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?b.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("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):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:this.getMessage("snkFilterList.showMore"),iconName:"dots-horizontal",name:D,iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),this._selectableItemsCount=0,e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}keyDownHandler(t){switch(t.key){case"ArrowDown":this.changePreselection(this._preselection+1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();break;case"ArrowUp":this.changePreselection(this._preselection-1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}}changePreselection(t){if(t<0&&(t=this._selectableItemsCount),this._preselection=t>this._selectableItemsCount?0:t,0===this._preselection)this._filterInput.setFocus();else{const t=this._element.querySelector(`#filter-item${this._preselection}`);t&&t.focus()}}render(){return e(s,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--4",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,"data-element-id":"serachFilters",mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return r(this)}},B=class{constructor(i){t(this,i),this._isUserSup=!1,this.filters=[],this.filtersWithError=[],this.getMessage=void 0,this.configName=void 0,this.filterConfig=void 0,this.opened=!1,this.applyFilters=void 0,this.closeModal=void 0,this.addPersonalizedFilter=void 0,this.editPersonalizedFilter=void 0,this.deletePersonalizedFilter=void 0,this.filtersToDelete=[],this.filterDefaultToDelete=void 0,this.disablePersonalizedFilter=void 0,this.filterCustomConfigInterceptor=void 0}filterConfigChangeHandler(t){this.filters=n.copy(t),this.validateFilters()}deletePersonalizedFilterListener(t){this.filtersToDelete.push(t.detail)}getCustomMessage(t,i){var e;return null===(e=this.getMessage)||void 0===e?void 0:e.call(this,`snkFilterBar.filterModal.${t}`,i)}handleClearAll(){const{customFilters:t,quickFilters:i,otherFilters:e,multiListFilters:s}=this.filters.reduce(((t,i)=>i.type===y.MULTI_LIST?(t.multiListFilters.push(i),t):i.filterType===N.QUICK_FILTER?(t.quickFilters.push(i),t):i.filterType===N.CUSTOM_FILTER?(t.customFilters.push(i),t):i.filterType===N.OTHER_FILTERS?(t.otherFilters.push(i),t):t),{quickFilters:[],customFilters:[],otherFilters:[],multiListFilters:[]});this.handleClearFilterList(i),this.handleClearCustomFilters(t),this.handleClearOthersFilters(e),s.forEach((t=>this.handleClearSigleFilter(t)))}handleClearOthersFilters(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearCustomFilters(t){this.filters.forEach(((i,e)=>{i.filterType===N.CUSTOM_FILTER&&(this.filters[e]=this.clearAllCustomFilter(t).shift())}))}clearAllCustomFilter(t){return t.map((t=>{const i=Object.assign({},t);return delete i.value,i.visible=!1,i.groupedItems&&(i.groupedItems=this.clearAllCustomFilter(i.groupedItems)),i}))}hasChangeToSave(){return n.objectToString(this.filters)!=n.objectToString(this.filters)}handleClose(){if(this.hasChangeToSave())return I.confirm(this.getCustomMessage("validations.notSaved.title"),this.getCustomMessage("validations.notSaved.message")).then((t=>{t&&this.closeModal()}));this.closeModal()}handleApplyFilters(){if(!this.validateFilters())return;const t=this.filters.find((t=>t.filterType===N.CUSTOM_FILTER||t.filterType===N.DEFAULT_FILTER));this.isValidCustomFilter(t)&&this.applyFilters(this.filters),this.filtersToDelete.length>0&&(this.filtersToDelete.forEach((t=>{this.deletePersonalizedFilter(t,this.configName)})),this.filtersToDelete=[]),this.filterDefaultToDelete&&(this.deletePersonalizedFilter(this.filterDefaultToDelete,this.configName,!0),this._defaultFilter=void 0,this.filterDefaultToDelete=void 0)}isValidCustomFilter(t){return!!_.validateVariableValues(t)||(I.alert(this.getCustomMessage("validations.notFullFilled.title"),this.getCustomMessage("validations.notFullFilled.message")),!1)}modalActionListener(t){switch(t.detail){case C.CANCEL:this.handleClearAll();break;case C.OK:this.handleApplyFilters();break;case C.CLOSE:this.handleClose()}}handleFilterChange(t){t.stopPropagation();const i=t.detail;let e=this.filters.map((t=>t.id===i.id?i:t));this.filterCustomConfigInterceptor&&(e=this.filterCustomConfigInterceptor(e)),this.filters=n.copy(e)}handleClearFilterList(t){this.filters=this.filters.map((i=>t.includes(i)?Object.assign(Object.assign({},i),{value:void 0}):i))}handleClearSigleFilter(t){if(y.MULTI_LIST===t.type){let i=n.copy(t);this.uncheckFilterValues(i.value);const e=n.copy(this.filters),s=e.findIndex((i=>i.id===t.id));return e.splice(s,1,i),void(this.filters=n.copy(e))}if(y.CHECK_BOX_LIST===t.type){const i=n.copy(this.filters);return i.find((i=>i.id===t.id)).value=void 0,void(this.filters=n.copy(i))}this.filters.find((i=>i.id===t.id)).value=void 0,this.filters=n.copy(this.filters)}uncheckFilterValues(t){return t.forEach((t=>{t&&(t.check=!1)})),t}validateFilters(){const t=T(this.filters);return this.filtersWithError=t.map((t=>t.id)),0===t.length||(t.forEach((t=>{const i=this._element.querySelector(`#filter-item-${t.id}`);i&&(i.errorMessage=t.requiredMessage||this.getCustomMessage("validations.requiredFilter"))})),!1)}renderFilterItem(t,i){return e("snk-filter-modal-item",{key:`modal-item-${t.id}`,class:i?"ez-col ez-col--sd-12":"ez-col ez-col--sd-6 ez-padding--small",filterItem:t,configName:this.configName,onFilterChange:t=>this.handleFilterChange(t),onEditPersonalizedFilter:t=>this.editPersonalizedFilter(t.detail),onAddPersonalizedFilter:()=>this.addPersonalizedFilter()})}isDefaultFilterNumberVariation(t){var i;return t.type===y.NUMBER&&(!t.props.variation||(null===(i=t.props)||void 0===i?void 0:i.variation)===w.DEFAULT)}mountFiltersLines(t){let i=0,e=!1;const s={};for(let r=0;r<t.length;r++){s[i]=s[i]||[];const l=t[r],a=r===t.length-1,n=l.type===y.TEXT||this.isDefaultFilterNumberVariation(l),o=!a&&(t[r+1].type===y.TEXT||this.isDefaultFilterNumberVariation(t[r+1]));n&&o||e?(s[i].push(l),e=s[i].length<2,2===s[i].length&&++i):(s[i]=s[i]||[],s[i].push(l),++i)}return Object.values(s)}renderFilterLine(t){const i=1===t.length;return t.map((t=>this.renderFilterItem(t,i)))}getIformedFiltersCount(t){let i=0;return t.forEach((t=>{var e,s,r,l,a,n;const o=this.filterConfig.find((i=>i.id===t.id));y.MULTI_LIST!==o.type?y.CHECK_BOX_LIST!==o.type?null==o.groupedItems?o.value&&i++:i=o.groupedItems.filter((t=>t.visible)).length:i+=Object.entries(null!==(n=o.value)&&void 0!==n?n:{}).filter((([t,i])=>!0===i)).map((([t,i])=>t)).length:i+=null!==(a=null===(l=null===(r=null!==(s=null===(e=o.value)||void 0===e?void 0:e.elements)&&void 0!==s?s:o.value)||void 0===r?void 0:r.filter((t=>null==t?void 0:t.check)))||void 0===l?void 0:l.length)&&void 0!==a?a:0})),i}renderCollapsibleFilterBox(t,i,s,r=!0){if(!i.length)return null;const l=this.getIformedFiltersCount(i),a=this.mountFiltersLines(i),n=this.filtersWithError.filter((t=>i.some((i=>i.id===t)))).length;return e("ez-collapsible-box",{class:"snk-filter-modal__collapsible-box",headerSize:"medium",value:!0,label:t},e("div",{class:"ez-flex ez-flex--justify-end grow",slot:"rightSlot"},!!l&&e("ez-badge",{class:"ez-badge--primary-subtle",label:null==l?void 0:l.toString()}),!!n&&e("ez-badge",{class:"ez-badge--error-subtle",label:null==n?void 0:n.toString()})),e("div",{class:"ez-row snk-filter-modal__rendered-items"},a.map(this.renderFilterLine.bind(this))),r&&e("div",{class:"ez-flex ez-flex--justify-end grow"},e("ez-button",{class:"ez-button--tertiary",size:"medium",label:this.getCustomMessage("clearModal"),onClick:()=>s?this.handleClearSigleFilter(i[0]):this.handleClearFilterList(i)})))}handleDeleteFilter(){this._application.confirm(this.getMessage("snkPersonalizedFilter.deleteConfirm.title"),this.getMessage("snkPersonalizedFilter.info.deleteDefaultFilterConfirm"),"alert-circle-inverted","critical").then((t=>{t&&(this.filterDefaultToDelete=this._defaultFilter,this.filters=this.filters.filter((t=>t.id!==N.DEFAULT_FILTER)))}))}handleActionSelectedDefaultFilter({detail:t}){switch(t){case $.CREATE:this.addPersonalizedFilter(!0);break;case $.EDIT:this.editPersonalizedFilter(this._defaultFilter.id,!0);break;case $.REMOVE:this.handleDeleteFilter()}}getCustomFilter(t){return t.filter((t=>t.filterType===N.CUSTOM_FILTER))}getDefaultFilter(t){return t.find((t=>t.id===x.id))}async componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this._isUserSup=await this._application.isUserSup(),this.filters=n.copy(this.filterConfig)}componentWillRender(){this._modalTitle=this.getCustomMessage("title"),this._okButtonLabel=this.getCustomMessage("okButtonLabel"),this._cancelButtonLabel=this.getCustomMessage("cancelButtonLabel")}componentDidLoad(){this.validateFilters()}render(){this._defaultFilter=this._isUserSup?this.getDefaultFilter(this.filters):void 0;const t=this.getCustomFilter(this.filters),i=this.filters.filter((t=>t.filterType===N.QUICK_FILTER)),s=this.filters.filter((t=>t.filterType===N.OTHER_FILTERS));return e("ez-modal",{opened:this.opened,modalSize:"col--sd-3",align:"right",heightMode:"full",closeEsc:!0},e("ez-modal-container",{class:"snk-filter-modal__container",modalTitle:this._modalTitle,cancelButtonLabel:this._cancelButtonLabel,okButtonLabel:this._okButtonLabel,onEzModalAction:this.modalActionListener.bind(this)},e("div",{class:"snk-filter-modal__content ez-col--sd-12"},this._isUserSup&&e("snk-default-filter",{getMessage:this.getCustomMessage.bind(this),hasDefaultFilter:!!this._defaultFilter,onActionSelected:this.handleActionSelectedDefaultFilter.bind(this)}),!this.disablePersonalizedFilter&&this.renderCollapsibleFilterBox(this.getCustomMessage("customFilters"),t,!1,!1),this.renderCollapsibleFilterBox(this.getCustomMessage("quickFilters"),i,!1),s.map((t=>this.renderCollapsibleFilterBox(t.label,[t],!0))))))}get _element(){return r(this)}static get watchers(){return{filterConfig:["filterConfigChangeHandler"]}}};B.style="ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{A as snk_filter_bar,P as snk_filter_item,S as snk_filter_list,B as snk_filter_modal}
|