@firestitch/filter 12.13.1 → 12.13.2
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/app/components/filter-drawer/filter-drawer.component.d.ts +3 -5
- package/app/components/filters-item/base-item/base-item.component.d.ts +1 -3
- package/app/components/filters-item/filter-item.component.d.ts +1 -3
- package/app/helpers/create-filter-item.d.ts +8 -7
- package/app/interfaces/items/autocomplete-chips.interface.d.ts +1 -1
- package/app/interfaces/items/autocomplete.interface.d.ts +1 -1
- package/app/interfaces/items/base.interface.d.ts +3 -2
- package/app/models/items/autocomplete-chips-item.d.ts +2 -1
- package/app/models/items/autocomplete-item.d.ts +2 -1
- package/app/models/items/base-item.d.ts +6 -4
- package/app/models/items/checkbox-item.d.ts +2 -1
- package/app/models/items/chips-item.d.ts +2 -1
- package/app/models/items/date-item.d.ts +2 -1
- package/app/models/items/date-range-item.d.ts +2 -1
- package/app/models/items/date-time-item.d.ts +2 -1
- package/app/models/items/date-time-range-item.d.ts +2 -1
- package/app/models/items/range-item.d.ts +2 -1
- package/app/models/items/select/multiple-select-item.d.ts +3 -2
- package/app/models/items/select/simple-select-item.d.ts +2 -1
- package/app/models/items/select-item.d.ts +2 -1
- package/app/models/items/text-item.d.ts +2 -1
- package/app/models/items/week-item.d.ts +3 -2
- package/app/services/external-params-controller.service.d.ts +2 -2
- package/app/services/filter-overlay.service.d.ts +0 -2
- package/bundles/firestitch-filter.umd.js +572 -575
- package/bundles/firestitch-filter.umd.js.map +1 -1
- package/esm2015/app/components/filter/filter.component.js +1 -2
- package/esm2015/app/components/filter-chip/filter-chip.component.js +2 -2
- package/esm2015/app/components/filter-drawer/filter-drawer.component.js +10 -11
- package/esm2015/app/components/filter-drawer-actions/filter-drawer-actions.component.js +4 -3
- package/esm2015/app/components/filters-item/autocomplete/autocomplete.component.js +2 -2
- package/esm2015/app/components/filters-item/autocompletechips/autocompletechips.component.js +2 -2
- package/esm2015/app/components/filters-item/base-item/base-item.component.js +2 -4
- package/esm2015/app/components/filters-item/filter-item.component.js +2 -4
- package/esm2015/app/helpers/create-filter-item.js +22 -22
- package/esm2015/app/interfaces/items/autocomplete-chips.interface.js +1 -1
- package/esm2015/app/interfaces/items/autocomplete.interface.js +1 -1
- package/esm2015/app/interfaces/items/base.interface.js +1 -1
- package/esm2015/app/models/filter-config.js +1 -1
- package/esm2015/app/models/items/autocomplete-chips-item.js +3 -3
- package/esm2015/app/models/items/autocomplete-item.js +6 -4
- package/esm2015/app/models/items/base-item.js +14 -8
- package/esm2015/app/models/items/checkbox-item.js +7 -5
- package/esm2015/app/models/items/chips-item.js +8 -8
- package/esm2015/app/models/items/date-item.js +4 -4
- package/esm2015/app/models/items/date-range-item.js +3 -3
- package/esm2015/app/models/items/date-time-item.js +3 -3
- package/esm2015/app/models/items/date-time-range-item.js +3 -3
- package/esm2015/app/models/items/range-item.js +5 -10
- package/esm2015/app/models/items/select/multiple-select-item.js +4 -4
- package/esm2015/app/models/items/select/simple-select-item.js +4 -4
- package/esm2015/app/models/items/select-item.js +4 -6
- package/esm2015/app/models/items/text-item.js +9 -5
- package/esm2015/app/models/items/week-item.js +5 -10
- package/esm2015/app/services/external-params-controller.service.js +3 -4
- package/esm2015/app/services/filter-overlay.service.js +1 -2
- package/esm2015/app/services/items-store.service.js +9 -9
- package/fesm2015/firestitch-filter.js +268 -273
- package/fesm2015/firestitch-filter.js.map +1 -1
- package/package.json +1 -1
- package/app/components/filter/index.d.ts +0 -1
- package/esm2015/app/components/filter/index.js +0 -2
|
@@ -124,8 +124,9 @@ var ItemType;
|
|
|
124
124
|
})(ItemType || (ItemType = {}));
|
|
125
125
|
|
|
126
126
|
class BaseItem {
|
|
127
|
-
constructor(itemConfig, _additionalConfig) {
|
|
127
|
+
constructor(itemConfig, _additionalConfig, _filter) {
|
|
128
128
|
this._additionalConfig = _additionalConfig;
|
|
129
|
+
this._filter = _filter;
|
|
129
130
|
this._pendingValues = false;
|
|
130
131
|
this._pendingDefaultValue = false;
|
|
131
132
|
this._loading$ = new BehaviorSubject(false);
|
|
@@ -137,6 +138,9 @@ class BaseItem {
|
|
|
137
138
|
this._type = itemConfig.type;
|
|
138
139
|
this._parseConfig(itemConfig);
|
|
139
140
|
}
|
|
141
|
+
get filter() {
|
|
142
|
+
return this._filter;
|
|
143
|
+
}
|
|
140
144
|
///
|
|
141
145
|
get isTypeAutocomplete() {
|
|
142
146
|
return this.type === ItemType.AutoComplete;
|
|
@@ -230,7 +234,7 @@ class BaseItem {
|
|
|
230
234
|
valueChanged() {
|
|
231
235
|
this._value$.next(this.value);
|
|
232
236
|
if (this.change) {
|
|
233
|
-
this.change(this);
|
|
237
|
+
this.change(this, this._filter);
|
|
234
238
|
}
|
|
235
239
|
if (this.initialized) {
|
|
236
240
|
this._valueChange$.next();
|
|
@@ -261,13 +265,13 @@ class BaseItem {
|
|
|
261
265
|
this._pendingDefaultValue = false;
|
|
262
266
|
}));
|
|
263
267
|
}
|
|
264
|
-
initValues(
|
|
268
|
+
initValues(persistedValue) {
|
|
265
269
|
// this._initialized = false;
|
|
266
270
|
this.persistedValue = persistedValue;
|
|
267
271
|
this._initDefaultModel();
|
|
268
272
|
const isAutocomplete = this.type === ItemType.AutoComplete || this.type === ItemType.AutoCompleteChips;
|
|
269
273
|
if (this._valuesFn && !isAutocomplete) {
|
|
270
|
-
const valuesResult = this._valuesFn(null,
|
|
274
|
+
const valuesResult = this._valuesFn(null, this._filter);
|
|
271
275
|
if (isObservable(valuesResult)) {
|
|
272
276
|
this._pendingValues = true;
|
|
273
277
|
}
|
|
@@ -283,10 +287,10 @@ class BaseItem {
|
|
|
283
287
|
// this._initialized = true;
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
|
-
loadAsyncValues(
|
|
290
|
+
loadAsyncValues(reload = true) {
|
|
287
291
|
if (reload || (!this.loading && this.hasPendingValues)) {
|
|
288
292
|
this.loading = true;
|
|
289
|
-
this._valuesFn(null,
|
|
293
|
+
this._valuesFn(null, this._filter)
|
|
290
294
|
.pipe(take(1), takeUntil(this._destroy$))
|
|
291
295
|
.subscribe((values) => {
|
|
292
296
|
this.values = values;
|
|
@@ -330,7 +334,9 @@ class BaseItem {
|
|
|
330
334
|
this.defaultValue = item.default;
|
|
331
335
|
}
|
|
332
336
|
this.change = item.change;
|
|
333
|
-
this.init = item.init || ((
|
|
337
|
+
this.init = item.init || ((_) => {
|
|
338
|
+
//
|
|
339
|
+
});
|
|
334
340
|
this.hide = item.hide;
|
|
335
341
|
this.showClear = (_a = item.clear) !== null && _a !== void 0 ? _a : true;
|
|
336
342
|
this.persistanceDisabled = (_b = item.disablePersist) !== null && _b !== void 0 ? _b : false;
|
|
@@ -388,8 +394,8 @@ class BaseSelectItem extends BaseItem {
|
|
|
388
394
|
}
|
|
389
395
|
|
|
390
396
|
class MultipleSelectItem extends BaseSelectItem {
|
|
391
|
-
constructor(itemConfig, _persistedValues) {
|
|
392
|
-
super(itemConfig, _persistedValues);
|
|
397
|
+
constructor(itemConfig, _persistedValues, _filter) {
|
|
398
|
+
super(itemConfig, _persistedValues, _filter);
|
|
393
399
|
}
|
|
394
400
|
get value() {
|
|
395
401
|
var _a;
|
|
@@ -459,7 +465,7 @@ class MultipleSelectItem extends BaseSelectItem {
|
|
|
459
465
|
_validateModel() {
|
|
460
466
|
const possibleValues = filter(this.model || [], (item) => {
|
|
461
467
|
return this.values.find((value) => {
|
|
462
|
-
return value.value
|
|
468
|
+
return value.value === item;
|
|
463
469
|
});
|
|
464
470
|
});
|
|
465
471
|
if (!isArrayEqual(this.model, possibleValues)) {
|
|
@@ -509,8 +515,8 @@ function getRangeName(configCase, name, range) {
|
|
|
509
515
|
}
|
|
510
516
|
|
|
511
517
|
class RangeItem extends BaseItem {
|
|
512
|
-
static create(config, additionalConfig) {
|
|
513
|
-
return new RangeItem(config, additionalConfig);
|
|
518
|
+
static create(config, additionalConfig, filter) {
|
|
519
|
+
return new RangeItem(config, additionalConfig, filter);
|
|
514
520
|
}
|
|
515
521
|
get value() {
|
|
516
522
|
let value = clone(this.model);
|
|
@@ -565,12 +571,7 @@ class RangeItem extends BaseItem {
|
|
|
565
571
|
this.model = Object.assign({}, this.model);
|
|
566
572
|
}
|
|
567
573
|
else {
|
|
568
|
-
|
|
569
|
-
this.model = Object.assign({}, defaultValue);
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
572
|
-
this.model = {};
|
|
573
|
-
}
|
|
574
|
+
this.model = defaultValue ? Object.assign({}, defaultValue) : {};
|
|
574
575
|
}
|
|
575
576
|
}
|
|
576
577
|
_validateModel() {
|
|
@@ -724,14 +725,14 @@ class BaseDateRangeItem extends BaseItem {
|
|
|
724
725
|
}
|
|
725
726
|
|
|
726
727
|
class DateRangeItem extends BaseDateRangeItem {
|
|
727
|
-
static create(config) {
|
|
728
|
-
return new DateRangeItem(config, null);
|
|
728
|
+
static create(config, filter) {
|
|
729
|
+
return new DateRangeItem(config, null, filter);
|
|
729
730
|
}
|
|
730
731
|
}
|
|
731
732
|
|
|
732
733
|
class DateTimeRangeItem extends BaseDateRangeItem {
|
|
733
|
-
static create(config) {
|
|
734
|
-
return new DateTimeRangeItem(config, null);
|
|
734
|
+
static create(config, filter) {
|
|
735
|
+
return new DateTimeRangeItem(config, null, filter);
|
|
735
736
|
}
|
|
736
737
|
}
|
|
737
738
|
|
|
@@ -827,8 +828,8 @@ function parseDate(value) {
|
|
|
827
828
|
}
|
|
828
829
|
|
|
829
830
|
class WeekItem extends BaseItem {
|
|
830
|
-
static create(config) {
|
|
831
|
-
return new WeekItem(config, null);
|
|
831
|
+
static create(config, filter) {
|
|
832
|
+
return new WeekItem(config, null, filter);
|
|
832
833
|
}
|
|
833
834
|
get value() {
|
|
834
835
|
let value = clone(this.model);
|
|
@@ -860,12 +861,7 @@ class WeekItem extends BaseItem {
|
|
|
860
861
|
}
|
|
861
862
|
}
|
|
862
863
|
if (period) {
|
|
863
|
-
|
|
864
|
-
value.period = parseInt(period, 10);
|
|
865
|
-
}
|
|
866
|
-
else {
|
|
867
|
-
value.period = period;
|
|
868
|
-
}
|
|
864
|
+
value.period = isString(period) ? parseInt(period, 10) : period;
|
|
869
865
|
}
|
|
870
866
|
return value;
|
|
871
867
|
}
|
|
@@ -960,97 +956,162 @@ function findItemWidthName(items, name) {
|
|
|
960
956
|
});
|
|
961
957
|
}
|
|
962
958
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
959
|
+
class BaseAutocompleteItem extends BaseItem {
|
|
960
|
+
get valuesFn() {
|
|
961
|
+
return this._valuesFn;
|
|
962
|
+
}
|
|
963
|
+
_validateModel() {
|
|
964
|
+
//
|
|
965
|
+
}
|
|
966
|
+
_parseConfig(item) {
|
|
967
|
+
var _a;
|
|
968
|
+
this.fetchOnFocus = (_a = item.fetchOnFocus) !== null && _a !== void 0 ? _a : true;
|
|
969
|
+
super._parseConfig(item);
|
|
972
970
|
}
|
|
973
|
-
return undefined;
|
|
974
971
|
}
|
|
975
972
|
|
|
976
|
-
class
|
|
977
|
-
|
|
978
|
-
|
|
973
|
+
class AutocompleteChipsItem extends BaseAutocompleteItem {
|
|
974
|
+
static create(config, filter) {
|
|
975
|
+
return new AutocompleteChipsItem(config, null, filter);
|
|
979
976
|
}
|
|
980
977
|
get value() {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
value = undefined;
|
|
978
|
+
if (Array.isArray(this.model) && this.model.length === 0) {
|
|
979
|
+
return undefined;
|
|
984
980
|
}
|
|
985
|
-
return
|
|
981
|
+
return clone(this.model);
|
|
986
982
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
983
|
+
get queryObject() {
|
|
984
|
+
const value = this.value;
|
|
985
|
+
const name = this.name;
|
|
986
|
+
const params = {};
|
|
987
|
+
if (Array.isArray(value)) {
|
|
988
|
+
params[this.name] = value
|
|
989
|
+
.filter((item) => !!item.value)
|
|
990
|
+
.map((item) => item.value)
|
|
991
|
+
.join(',');
|
|
995
992
|
}
|
|
996
|
-
else
|
|
997
|
-
|
|
993
|
+
else {
|
|
994
|
+
params[name] = value;
|
|
998
995
|
}
|
|
996
|
+
return params;
|
|
999
997
|
}
|
|
1000
998
|
get isChipVisible() {
|
|
1001
|
-
return this.model
|
|
999
|
+
return Array.isArray(this.model) && this.model.length > 0;
|
|
1000
|
+
}
|
|
1001
|
+
getChipsContent() {
|
|
1002
|
+
return this.model
|
|
1003
|
+
.reduce((acc, i) => {
|
|
1004
|
+
acc.push(i.name);
|
|
1005
|
+
return acc;
|
|
1006
|
+
}, [])
|
|
1007
|
+
.join(', ');
|
|
1002
1008
|
}
|
|
1003
1009
|
_init() {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
this._model = '__all';
|
|
1010
|
+
if (this.model === undefined) {
|
|
1011
|
+
this._model = [];
|
|
1007
1012
|
}
|
|
1008
1013
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1014
|
+
_parseConfig(item) {
|
|
1015
|
+
var _a;
|
|
1016
|
+
this.chipImage = (_a = item.chipImage) !== null && _a !== void 0 ? _a : 'image';
|
|
1017
|
+
this.chipIcon = item.chipIcon;
|
|
1018
|
+
this.chipIconColor = item.chipIconColor;
|
|
1019
|
+
this.chipColor = item.chipColor;
|
|
1020
|
+
this.chipBackground = item.chipBackground;
|
|
1021
|
+
this.chipClass = item.chipClass;
|
|
1022
|
+
super._parseConfig(item);
|
|
1023
|
+
}
|
|
1024
|
+
_clearValue(defaultValue = undefined) {
|
|
1025
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : [];
|
|
1026
|
+
this.search = '';
|
|
1013
1027
|
}
|
|
1014
1028
|
_setModel(value) {
|
|
1015
|
-
|
|
1016
|
-
if (!isNaN(value)) {
|
|
1017
|
-
value = +value;
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
super._setModel(value);
|
|
1029
|
+
super._setModel(value || []);
|
|
1021
1030
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
class AutocompleteItem extends BaseAutocompleteItem {
|
|
1034
|
+
static create(config, filter) {
|
|
1035
|
+
return new AutocompleteItem(config, null, filter);
|
|
1036
|
+
}
|
|
1037
|
+
get value() {
|
|
1038
|
+
let value = clone(this.model);
|
|
1039
|
+
if (!this.model || this.model.value === undefined) {
|
|
1040
|
+
return undefined;
|
|
1029
1041
|
}
|
|
1042
|
+
value = this.model.value;
|
|
1043
|
+
return value;
|
|
1044
|
+
}
|
|
1045
|
+
get queryObject() {
|
|
1046
|
+
const value = this.value;
|
|
1047
|
+
const name = this.name;
|
|
1048
|
+
const params = {};
|
|
1049
|
+
params[name] = value;
|
|
1050
|
+
return params;
|
|
1051
|
+
}
|
|
1052
|
+
getChipsContent() {
|
|
1053
|
+
return this.model ? this.model.name : '';
|
|
1054
|
+
}
|
|
1055
|
+
_init() {
|
|
1056
|
+
//
|
|
1030
1057
|
}
|
|
1031
1058
|
_clearValue(defaultValue = undefined) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
? '__all'
|
|
1035
|
-
: undefined;
|
|
1036
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
|
|
1059
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
1060
|
+
this.search = '';
|
|
1037
1061
|
}
|
|
1038
1062
|
}
|
|
1039
1063
|
|
|
1040
|
-
class
|
|
1041
|
-
static create(config) {
|
|
1042
|
-
|
|
1043
|
-
|
|
1064
|
+
class CheckboxItem extends BaseItem {
|
|
1065
|
+
static create(config, filter) {
|
|
1066
|
+
return new CheckboxItem(config, null, filter);
|
|
1067
|
+
}
|
|
1068
|
+
get isTypeCheckbox() {
|
|
1069
|
+
return true;
|
|
1070
|
+
}
|
|
1071
|
+
get isChipVisible() {
|
|
1072
|
+
return this.value === this.checked;
|
|
1073
|
+
}
|
|
1074
|
+
get value() {
|
|
1075
|
+
const value = this.model ? this.checked : this.unchecked;
|
|
1076
|
+
if (!value) {
|
|
1077
|
+
return undefined;
|
|
1044
1078
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1079
|
+
return value;
|
|
1080
|
+
}
|
|
1081
|
+
get queryObject() {
|
|
1082
|
+
const value = this.value;
|
|
1083
|
+
const name = this.name;
|
|
1084
|
+
const params = {};
|
|
1085
|
+
params[name] = this.model ? value : undefined;
|
|
1086
|
+
return params;
|
|
1087
|
+
}
|
|
1088
|
+
getChipsContent(type = null) {
|
|
1089
|
+
return this.label;
|
|
1090
|
+
}
|
|
1091
|
+
_validateModel() {
|
|
1092
|
+
//
|
|
1093
|
+
}
|
|
1094
|
+
_parseConfig(item) {
|
|
1095
|
+
this.checked = item.checked;
|
|
1096
|
+
this.unchecked = item.unchecked;
|
|
1097
|
+
this.checked = item.checked ? toString(item.checked) : true;
|
|
1098
|
+
this.unchecked = item.unchecked ? toString(item.unchecked) : false;
|
|
1099
|
+
this.defaultValue = item.default === undefined ? this.unchecked : toString(this.defaultValue);
|
|
1100
|
+
super._parseConfig(item);
|
|
1101
|
+
}
|
|
1102
|
+
_init() {
|
|
1103
|
+
if (this.model === undefined) {
|
|
1104
|
+
this._model = this.checked === this.defaultValue;
|
|
1047
1105
|
}
|
|
1048
1106
|
}
|
|
1107
|
+
_clearValue(defaultValue = undefined) {
|
|
1108
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : false;
|
|
1109
|
+
}
|
|
1049
1110
|
}
|
|
1050
1111
|
|
|
1051
1112
|
class ChipsItem extends BaseItem {
|
|
1052
|
-
static create(config) {
|
|
1053
|
-
return new ChipsItem(config, null);
|
|
1113
|
+
static create(config, filter) {
|
|
1114
|
+
return new ChipsItem(config, null, filter);
|
|
1054
1115
|
}
|
|
1055
1116
|
get isTypeChips() {
|
|
1056
1117
|
return true;
|
|
@@ -1069,7 +1130,7 @@ class ChipsItem extends BaseItem {
|
|
|
1069
1130
|
const value = this.value;
|
|
1070
1131
|
const name = this.name;
|
|
1071
1132
|
return {
|
|
1072
|
-
[name]: value
|
|
1133
|
+
[name]: value,
|
|
1073
1134
|
};
|
|
1074
1135
|
}
|
|
1075
1136
|
get persistanceObject() {
|
|
@@ -1092,16 +1153,16 @@ class ChipsItem extends BaseItem {
|
|
|
1092
1153
|
}, [])
|
|
1093
1154
|
.join(', ');
|
|
1094
1155
|
}
|
|
1095
|
-
_validateModel() {
|
|
1156
|
+
_validateModel() {
|
|
1157
|
+
//
|
|
1158
|
+
}
|
|
1096
1159
|
_setModel(value) {
|
|
1097
1160
|
if (Array.isArray(value)) {
|
|
1098
1161
|
value = value.map((val) => {
|
|
1099
1162
|
if (isNaN(val)) {
|
|
1100
1163
|
return val;
|
|
1101
1164
|
}
|
|
1102
|
-
|
|
1103
|
-
return +val;
|
|
1104
|
-
}
|
|
1165
|
+
return +val;
|
|
1105
1166
|
});
|
|
1106
1167
|
}
|
|
1107
1168
|
this._model = value;
|
|
@@ -1181,12 +1242,12 @@ class BaseDateItem extends BaseItem {
|
|
|
1181
1242
|
}
|
|
1182
1243
|
|
|
1183
1244
|
class DateItem extends BaseDateItem {
|
|
1184
|
-
static create(config) {
|
|
1185
|
-
return new DateItem(config, null);
|
|
1245
|
+
static create(config, filter) {
|
|
1246
|
+
return new DateItem(config, null, filter);
|
|
1186
1247
|
}
|
|
1187
1248
|
getChipsContent(type = null) {
|
|
1188
1249
|
let dateFormat = 'date';
|
|
1189
|
-
if (this.mode
|
|
1250
|
+
if (this.mode === ItemDateMode.ScrollMonthYear) {
|
|
1190
1251
|
dateFormat = 'full-date-dayless';
|
|
1191
1252
|
}
|
|
1192
1253
|
return format(this.model, dateFormat);
|
|
@@ -1197,166 +1258,103 @@ class DateItem extends BaseDateItem {
|
|
|
1197
1258
|
}
|
|
1198
1259
|
|
|
1199
1260
|
class DateTimeItem extends BaseDateItem {
|
|
1200
|
-
static create(config) {
|
|
1201
|
-
return new DateTimeItem(config, null);
|
|
1261
|
+
static create(config, filter) {
|
|
1262
|
+
return new DateTimeItem(config, null, filter);
|
|
1202
1263
|
}
|
|
1203
1264
|
_clearValue(defaultValue = undefined) {
|
|
1204
1265
|
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
1205
1266
|
}
|
|
1206
1267
|
}
|
|
1207
1268
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
this.fetchOnFocus = (_a = item.fetchOnFocus) !== null && _a !== void 0 ? _a : true;
|
|
1218
|
-
super._parseConfig(item);
|
|
1269
|
+
function findValue(values, value, children) {
|
|
1270
|
+
for (let i = 0; i < values.length; i++) {
|
|
1271
|
+
const val = values[i];
|
|
1272
|
+
if (val[children]) {
|
|
1273
|
+
return findValue(val[children], value, children);
|
|
1274
|
+
}
|
|
1275
|
+
if (val.value === value) {
|
|
1276
|
+
return val;
|
|
1277
|
+
}
|
|
1219
1278
|
}
|
|
1279
|
+
return undefined;
|
|
1220
1280
|
}
|
|
1221
1281
|
|
|
1222
|
-
class
|
|
1223
|
-
|
|
1224
|
-
|
|
1282
|
+
class SimpleSelectItem extends BaseSelectItem {
|
|
1283
|
+
constructor(itemConfig, _persistedValues, _filter) {
|
|
1284
|
+
super(itemConfig, _persistedValues, _filter);
|
|
1225
1285
|
}
|
|
1226
1286
|
get value() {
|
|
1227
|
-
let value =
|
|
1228
|
-
if (
|
|
1229
|
-
|
|
1287
|
+
let value = this.model;
|
|
1288
|
+
if (value === '__all' || value === undefined) {
|
|
1289
|
+
value = undefined;
|
|
1230
1290
|
}
|
|
1231
|
-
value = this.model.value;
|
|
1232
1291
|
return value;
|
|
1233
1292
|
}
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
params[name] = value;
|
|
1239
|
-
return params;
|
|
1240
|
-
}
|
|
1241
|
-
getChipsContent() {
|
|
1242
|
-
return this.model ? this.model.name : '';
|
|
1243
|
-
}
|
|
1244
|
-
_init() { }
|
|
1245
|
-
_clearValue(defaultValue = undefined) {
|
|
1246
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
1247
|
-
this.search = '';
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
class AutocompleteChipsItem extends BaseAutocompleteItem {
|
|
1252
|
-
static create(config) {
|
|
1253
|
-
return new AutocompleteChipsItem(config, null);
|
|
1254
|
-
}
|
|
1255
|
-
get value() {
|
|
1256
|
-
if (Array.isArray(this.model) && this.model.length === 0) {
|
|
1257
|
-
return undefined;
|
|
1293
|
+
getChipsContent(type = null) {
|
|
1294
|
+
if (this.children) {
|
|
1295
|
+
const itemValue = findValue(this.values, this.model, this.children);
|
|
1296
|
+
return itemValue && itemValue.name;
|
|
1258
1297
|
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
const value = this.value;
|
|
1263
|
-
const name = this.name;
|
|
1264
|
-
const params = {};
|
|
1265
|
-
if (Array.isArray(value)) {
|
|
1266
|
-
params[this.name] = value
|
|
1267
|
-
.filter((item) => !!item.value)
|
|
1268
|
-
.map((item) => item.value)
|
|
1269
|
-
.join(',');
|
|
1298
|
+
const itemValue = this.values.find((val) => val.value === this.model);
|
|
1299
|
+
if (itemValue) {
|
|
1300
|
+
return itemValue.name;
|
|
1270
1301
|
}
|
|
1271
|
-
else {
|
|
1272
|
-
|
|
1302
|
+
else if (this.isolate) {
|
|
1303
|
+
return this.isolate.label;
|
|
1273
1304
|
}
|
|
1274
|
-
return params;
|
|
1275
1305
|
}
|
|
1276
1306
|
get isChipVisible() {
|
|
1277
|
-
return
|
|
1278
|
-
}
|
|
1279
|
-
getChipsContent() {
|
|
1280
|
-
return this.model
|
|
1281
|
-
.reduce((acc, i) => {
|
|
1282
|
-
acc.push(i.name);
|
|
1283
|
-
return acc;
|
|
1284
|
-
}, [])
|
|
1285
|
-
.join(', ');
|
|
1307
|
+
return this.model !== '__all' && this.model !== undefined;
|
|
1286
1308
|
}
|
|
1287
1309
|
_init() {
|
|
1288
|
-
|
|
1289
|
-
|
|
1310
|
+
super._init();
|
|
1311
|
+
if (this.model === undefined && this.defaultValue === undefined) {
|
|
1312
|
+
this._model = '__all';
|
|
1290
1313
|
}
|
|
1291
1314
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
this.chipIconColor = item.chipIconColor;
|
|
1297
|
-
this.chipColor = item.chipColor;
|
|
1298
|
-
this.chipBackground = item.chipBackground;
|
|
1299
|
-
this.chipClass = item.chipClass;
|
|
1300
|
-
super._parseConfig(item);
|
|
1301
|
-
}
|
|
1302
|
-
_clearValue(defaultValue = undefined) {
|
|
1303
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : [];
|
|
1304
|
-
this.search = '';
|
|
1315
|
+
get isolateOptionNotSelected() {
|
|
1316
|
+
const modelValue = this.model;
|
|
1317
|
+
const isolate = this.isolate;
|
|
1318
|
+
return isolate && !isolate.enabled && (modelValue === null || modelValue === void 0 ? void 0 : modelValue.length) === 0;
|
|
1305
1319
|
}
|
|
1306
1320
|
_setModel(value) {
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
class CheckboxItem extends BaseItem {
|
|
1312
|
-
static create(config) {
|
|
1313
|
-
return new CheckboxItem(config, null);
|
|
1314
|
-
}
|
|
1315
|
-
get isTypeCheckbox() {
|
|
1316
|
-
return true;
|
|
1317
|
-
}
|
|
1318
|
-
get isChipVisible() {
|
|
1319
|
-
return this.value === this.checked;
|
|
1320
|
-
}
|
|
1321
|
-
get value() {
|
|
1322
|
-
const value = this.model ? this.checked : this.unchecked;
|
|
1323
|
-
if (!value) {
|
|
1324
|
-
return undefined;
|
|
1321
|
+
if (value) {
|
|
1322
|
+
if (!isNaN(value)) {
|
|
1323
|
+
value = +value;
|
|
1324
|
+
}
|
|
1325
1325
|
}
|
|
1326
|
-
|
|
1327
|
-
}
|
|
1328
|
-
get queryObject() {
|
|
1329
|
-
const value = this.value;
|
|
1330
|
-
const name = this.name;
|
|
1331
|
-
const params = {};
|
|
1332
|
-
params[name] = this.model ? value : undefined;
|
|
1333
|
-
return params;
|
|
1334
|
-
}
|
|
1335
|
-
getChipsContent(type = null) {
|
|
1336
|
-
return this.label;
|
|
1337
|
-
}
|
|
1338
|
-
_validateModel() { }
|
|
1339
|
-
_parseConfig(item) {
|
|
1340
|
-
this.checked = item.checked;
|
|
1341
|
-
this.unchecked = item.unchecked;
|
|
1342
|
-
this.checked = item.checked ? toString(item.checked) : true;
|
|
1343
|
-
this.unchecked = item.unchecked ? toString(item.unchecked) : false;
|
|
1344
|
-
this.defaultValue = item.default === undefined ? this.unchecked : toString(this.defaultValue);
|
|
1345
|
-
super._parseConfig(item);
|
|
1326
|
+
super._setModel(value);
|
|
1346
1327
|
}
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1328
|
+
_validateModel() {
|
|
1329
|
+
const item = this.values.find((value) => {
|
|
1330
|
+
return value.value == this.model;
|
|
1331
|
+
});
|
|
1332
|
+
const value = item ? item.value : '__all';
|
|
1333
|
+
if (this._model !== value) {
|
|
1334
|
+
this.model = value;
|
|
1350
1335
|
}
|
|
1351
1336
|
}
|
|
1352
1337
|
_clearValue(defaultValue = undefined) {
|
|
1353
|
-
|
|
1338
|
+
super._clearValue(defaultValue);
|
|
1339
|
+
const value = Array.isArray(this.values) && this.values.some((val) => val.value === '__all')
|
|
1340
|
+
? '__all'
|
|
1341
|
+
: undefined;
|
|
1342
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
class SelectItem {
|
|
1347
|
+
static create(config, filter) {
|
|
1348
|
+
if (config.multiple) {
|
|
1349
|
+
return new MultipleSelectItem(config, null, filter);
|
|
1350
|
+
}
|
|
1351
|
+
return new SimpleSelectItem(config, null, filter);
|
|
1354
1352
|
}
|
|
1355
1353
|
}
|
|
1356
1354
|
|
|
1357
1355
|
class TextItem extends BaseItem {
|
|
1358
|
-
static create(config) {
|
|
1359
|
-
return new TextItem(config, null);
|
|
1356
|
+
static create(config, filter) {
|
|
1357
|
+
return new TextItem(config, null, filter);
|
|
1360
1358
|
}
|
|
1361
1359
|
get value() {
|
|
1362
1360
|
return !!this.model ? this.model : undefined;
|
|
@@ -1371,56 +1369,60 @@ class TextItem extends BaseItem {
|
|
|
1371
1369
|
getChipsContent() {
|
|
1372
1370
|
return this.model;
|
|
1373
1371
|
}
|
|
1374
|
-
_validateModel() {
|
|
1372
|
+
_validateModel() {
|
|
1373
|
+
//
|
|
1374
|
+
}
|
|
1375
1375
|
_parseConfig(item) {
|
|
1376
1376
|
this.prefix = item.prefix;
|
|
1377
1377
|
this.suffix = item.suffix;
|
|
1378
1378
|
super._parseConfig(item);
|
|
1379
1379
|
}
|
|
1380
|
-
_init() {
|
|
1380
|
+
_init() {
|
|
1381
|
+
//
|
|
1382
|
+
}
|
|
1381
1383
|
_clearValue(defaultValue = undefined) {
|
|
1382
1384
|
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : '';
|
|
1383
1385
|
}
|
|
1384
1386
|
}
|
|
1385
1387
|
|
|
1386
|
-
function createFilterItem(item, config) {
|
|
1388
|
+
function createFilterItem(item, config, filter) {
|
|
1387
1389
|
switch (item.type) {
|
|
1388
1390
|
case ItemType.Select: {
|
|
1389
|
-
return SelectItem.create(item);
|
|
1391
|
+
return SelectItem.create(item, filter);
|
|
1390
1392
|
}
|
|
1391
1393
|
case ItemType.Chips: {
|
|
1392
|
-
return ChipsItem.create(item);
|
|
1394
|
+
return ChipsItem.create(item, filter);
|
|
1393
1395
|
}
|
|
1394
1396
|
case ItemType.Range: {
|
|
1395
|
-
return RangeItem.create(item, config);
|
|
1397
|
+
return RangeItem.create(item, config, filter);
|
|
1396
1398
|
}
|
|
1397
1399
|
case ItemType.DateRange: {
|
|
1398
|
-
return DateRangeItem.create(item);
|
|
1400
|
+
return DateRangeItem.create(item, filter);
|
|
1399
1401
|
}
|
|
1400
1402
|
case ItemType.DateTimeRange: {
|
|
1401
|
-
return DateTimeRangeItem.create(item);
|
|
1403
|
+
return DateTimeRangeItem.create(item, filter);
|
|
1402
1404
|
}
|
|
1403
1405
|
case ItemType.Date: {
|
|
1404
|
-
return DateItem.create(item);
|
|
1406
|
+
return DateItem.create(item, filter);
|
|
1405
1407
|
}
|
|
1406
1408
|
case ItemType.Week: {
|
|
1407
|
-
return WeekItem.create(item);
|
|
1409
|
+
return WeekItem.create(item, filter);
|
|
1408
1410
|
}
|
|
1409
1411
|
case ItemType.DateTime: {
|
|
1410
|
-
return DateTimeItem.create(item);
|
|
1412
|
+
return DateTimeItem.create(item, filter);
|
|
1411
1413
|
}
|
|
1412
1414
|
case ItemType.AutoComplete: {
|
|
1413
|
-
return AutocompleteItem.create(item);
|
|
1415
|
+
return AutocompleteItem.create(item, filter);
|
|
1414
1416
|
}
|
|
1415
1417
|
case ItemType.AutoCompleteChips: {
|
|
1416
|
-
return AutocompleteChipsItem.create(item);
|
|
1418
|
+
return AutocompleteChipsItem.create(item, filter);
|
|
1417
1419
|
}
|
|
1418
1420
|
case ItemType.Checkbox: {
|
|
1419
|
-
return CheckboxItem.create(item);
|
|
1421
|
+
return CheckboxItem.create(item, filter);
|
|
1420
1422
|
}
|
|
1421
1423
|
case ItemType.Keyword:
|
|
1422
1424
|
case ItemType.Text: {
|
|
1423
|
-
return TextItem.create(item);
|
|
1425
|
+
return TextItem.create(item, filter);
|
|
1424
1426
|
}
|
|
1425
1427
|
}
|
|
1426
1428
|
}
|
|
@@ -1618,7 +1620,7 @@ class FsFilterItemsStore {
|
|
|
1618
1620
|
loadAsyncValues() {
|
|
1619
1621
|
this.items
|
|
1620
1622
|
.filter((item) => item.hasPendingValues)
|
|
1621
|
-
.forEach((item) => item.loadAsyncValues(
|
|
1623
|
+
.forEach((item) => item.loadAsyncValues());
|
|
1622
1624
|
}
|
|
1623
1625
|
loadAsyncDefaults() {
|
|
1624
1626
|
// default values can be asynchronous, and we must load them if there is no persisted value instead
|
|
@@ -1640,7 +1642,7 @@ class FsFilterItemsStore {
|
|
|
1640
1642
|
.map((item) => item.loadDefaultValue()),
|
|
1641
1643
|
...valuesToBeLoaded
|
|
1642
1644
|
.map((item) => {
|
|
1643
|
-
item.loadAsyncValues(
|
|
1645
|
+
item.loadAsyncValues();
|
|
1644
1646
|
return item.loading$
|
|
1645
1647
|
.pipe();
|
|
1646
1648
|
}),
|
|
@@ -1705,7 +1707,7 @@ class FsFilterItemsStore {
|
|
|
1705
1707
|
init(p) {
|
|
1706
1708
|
this.items
|
|
1707
1709
|
.forEach((item) => {
|
|
1708
|
-
item.initValues(
|
|
1710
|
+
item.initValues(p[item.name]);
|
|
1709
1711
|
});
|
|
1710
1712
|
this._initSortingItems(p);
|
|
1711
1713
|
this.loadAsyncDefaults();
|
|
@@ -1772,7 +1774,7 @@ class FsFilterItemsStore {
|
|
|
1772
1774
|
}
|
|
1773
1775
|
})
|
|
1774
1776
|
.map((item) => {
|
|
1775
|
-
const filterItem = createFilterItem(item, { case: this._config.case });
|
|
1777
|
+
const filterItem = createFilterItem(item, { case: this._config.case }, this.filter);
|
|
1776
1778
|
if (filterItem.type === ItemType.Keyword) {
|
|
1777
1779
|
this._hasKeyword = true;
|
|
1778
1780
|
}
|
|
@@ -1814,8 +1816,8 @@ class FsFilterItemsStore {
|
|
|
1814
1816
|
}
|
|
1815
1817
|
_initSortingItems(p) {
|
|
1816
1818
|
if (this.sortByItem && this.sortDirectionItem) {
|
|
1817
|
-
this.sortByItem.initValues(
|
|
1818
|
-
this.sortDirectionItem.initValues(
|
|
1819
|
+
this.sortByItem.initValues(p[this.sortByItem.name]);
|
|
1820
|
+
this.sortDirectionItem.initValues(p[this.sortDirectionItem.name]);
|
|
1819
1821
|
}
|
|
1820
1822
|
}
|
|
1821
1823
|
_createSortingItems() {
|
|
@@ -1830,7 +1832,7 @@ class FsFilterItemsStore {
|
|
|
1830
1832
|
if (this._config.sort && this._config.sort.value) {
|
|
1831
1833
|
sortByItem.default = this._config.sort.value;
|
|
1832
1834
|
}
|
|
1833
|
-
this.sortByItem = new SimpleSelectItem(sortByItem, null);
|
|
1835
|
+
this.sortByItem = new SimpleSelectItem(sortByItem, null, this.filter);
|
|
1834
1836
|
const sortDirectionItem = {
|
|
1835
1837
|
name: SORT_DIRECTION_FIELD,
|
|
1836
1838
|
type: ItemType.Select,
|
|
@@ -1843,7 +1845,7 @@ class FsFilterItemsStore {
|
|
|
1843
1845
|
if (this._config.sort && this._config.sort.direction) {
|
|
1844
1846
|
sortDirectionItem.default = this._config.sort.direction;
|
|
1845
1847
|
}
|
|
1846
|
-
this.sortDirectionItem = new SimpleSelectItem(sortDirectionItem, null);
|
|
1848
|
+
this.sortDirectionItem = new SimpleSelectItem(sortDirectionItem, null, this.filter);
|
|
1847
1849
|
}
|
|
1848
1850
|
}
|
|
1849
1851
|
_setKeywordItem() {
|
|
@@ -2212,7 +2214,6 @@ class ExternalParamsController {
|
|
|
2212
2214
|
this._savePersistedParams();
|
|
2213
2215
|
}
|
|
2214
2216
|
initItems() {
|
|
2215
|
-
this._itemsStore.ready$;
|
|
2216
2217
|
this._pending$.next(true);
|
|
2217
2218
|
if (this._savedFilters.enabled) {
|
|
2218
2219
|
this._savedFilters
|
|
@@ -2282,7 +2283,7 @@ class ExternalParamsController {
|
|
|
2282
2283
|
const params = buildQueryParams(this._itemsStore.valuesAsQuery({
|
|
2283
2284
|
onlyPresented: false,
|
|
2284
2285
|
items: targetItems,
|
|
2285
|
-
persisted: true
|
|
2286
|
+
persisted: true,
|
|
2286
2287
|
}), targetItems);
|
|
2287
2288
|
this._queryParams.writeStateToQueryParams(params);
|
|
2288
2289
|
}
|
|
@@ -2292,7 +2293,7 @@ class ExternalParamsController {
|
|
|
2292
2293
|
const params = buildQueryParams(this._itemsStore.valuesAsQuery({
|
|
2293
2294
|
onlyPresented: false,
|
|
2294
2295
|
items: targetItems,
|
|
2295
|
-
persisted: true
|
|
2296
|
+
persisted: true,
|
|
2296
2297
|
}), targetItems);
|
|
2297
2298
|
this._persistanceStore.save(params);
|
|
2298
2299
|
}
|
|
@@ -2653,7 +2654,7 @@ class FsFilterChipComponent {
|
|
|
2653
2654
|
this.listenValueChangesForRanges();
|
|
2654
2655
|
this._updateVisibility();
|
|
2655
2656
|
if (this.item.hasPendingValues) {
|
|
2656
|
-
this.item.loadAsyncValues(
|
|
2657
|
+
this.item.loadAsyncValues(false);
|
|
2657
2658
|
this.item.values$
|
|
2658
2659
|
.pipe(take(2), takeUntil(this._destroy$))
|
|
2659
2660
|
.subscribe(() => {
|
|
@@ -2758,12 +2759,13 @@ class FsFilterDrawerActionsComponent {
|
|
|
2758
2759
|
}
|
|
2759
2760
|
}
|
|
2760
2761
|
FsFilterDrawerActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, deps: [{ token: ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
|
|
2761
|
-
FsFilterDrawerActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0, template: "<button type=\"button\" mat-button color=\"primary\" (click)=\"done()\">Done</button>\n<button type=\"button\" mat-button (click)=\"clear()\">Clear</button>\n<ng-container *ngIf=\"savedFilters.enabled$ | async\">\n <button type=\"button\" mat-button (click)=\"saveFilters()\">Save</button>\n</ng-container>\n\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe } });
|
|
2762
|
+
FsFilterDrawerActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0, template: "<button type=\"button\" mat-button color=\"primary\" (click)=\"done()\">Done</button>\n<button type=\"button\" mat-button (click)=\"clear()\">Clear</button>\n<ng-container *ngIf=\"savedFilters.enabled$ | async\">\n <button type=\"button\" mat-button (click)=\"saveFilters()\">Save</button>\n</ng-container>\n\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2762
2763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, decorators: [{
|
|
2763
2764
|
type: Component,
|
|
2764
2765
|
args: [{
|
|
2765
2766
|
selector: 'fs-filter-drawer-actions',
|
|
2766
2767
|
templateUrl: './filter-drawer-actions.component.html',
|
|
2768
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2767
2769
|
}]
|
|
2768
2770
|
}], ctorParameters: function () { return [{ type: ExternalParamsController }]; }, propDecorators: { _clear: [{
|
|
2769
2771
|
type: Output,
|
|
@@ -2822,7 +2824,7 @@ class BaseItemComponent {
|
|
|
2822
2824
|
}
|
|
2823
2825
|
}
|
|
2824
2826
|
BaseItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2825
|
-
BaseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline"
|
|
2827
|
+
BaseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2826
2828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, decorators: [{
|
|
2827
2829
|
type: Component,
|
|
2828
2830
|
args: [{
|
|
@@ -2834,8 +2836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2834
2836
|
type: Input
|
|
2835
2837
|
}], inline: [{
|
|
2836
2838
|
type: Input
|
|
2837
|
-
}], filter: [{
|
|
2838
|
-
type: Input
|
|
2839
2839
|
}] } });
|
|
2840
2840
|
|
|
2841
2841
|
class FocusToItemDirective {
|
|
@@ -3240,7 +3240,7 @@ class AutocompleteComponent extends BaseItemComponent {
|
|
|
3240
3240
|
return data ? data.name : data;
|
|
3241
3241
|
};
|
|
3242
3242
|
this.fetch = (keyword) => {
|
|
3243
|
-
return this.item.valuesFn(keyword, this.filter);
|
|
3243
|
+
return this.item.valuesFn(keyword, this.item.filter);
|
|
3244
3244
|
};
|
|
3245
3245
|
}
|
|
3246
3246
|
}
|
|
@@ -3261,7 +3261,7 @@ class AutocompletechipsComponent extends BaseItemComponent {
|
|
|
3261
3261
|
this._kvDiffers = _kvDiffers;
|
|
3262
3262
|
this._cd = _cd;
|
|
3263
3263
|
this.fetch = (keyword) => {
|
|
3264
|
-
return this.item.valuesFn(keyword, this.filter);
|
|
3264
|
+
return this.item.valuesFn(keyword, this.item.filter);
|
|
3265
3265
|
};
|
|
3266
3266
|
}
|
|
3267
3267
|
// SP-T1747
|
|
@@ -3454,7 +3454,7 @@ class FilterItemComponent {
|
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
3456
|
FilterItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3457
|
-
FilterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item"
|
|
3457
|
+
FilterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item" }, ngImport: i0, template: "<div class=\"filter filter-{{ item.type }}\">\n\n <ng-container [ngSwitch]=\"item.type\">\n <filter-item-text \n class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"textItem\">\n </filter-item-text>\n\n <filter-item-select \n class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"baseSelectItem\">\n </filter-item-select>\n\n <filter-item-chips \n class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"chipsItem\">\n </filter-item-chips>\n\n <filter-item-range \n class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"rangeItem\">\n </filter-item-range>\n\n <filter-item-autocomplete \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"autocompleteItem\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"autocompleteChipsItem\">\n </filter-item-autocompletechips>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"dateItem\">\n </filter-item-date>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"dateTimeItem\">\n </filter-item-date>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"dateRangeItem\">\n </filter-item-date-range>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"dateTimeRangeItem\">\n </filter-item-date-range>\n\n <filter-item-week \n class=\"interface\"\n *ngSwitchCase=\"itemType.Week\"\n [item]=\"weekItem\">\n </filter-item-week>\n\n <filter-item-checkbox \n class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"checkboxItem\">\n </filter-item-checkbox>\n </ng-container>\n\n</div>\n", components: [{ type: TextComponent, selector: "filter-item-text" }, { type: SelectComponent, selector: "filter-item-select" }, { type: ChipsComponent, selector: "filter-item-chips" }, { type: RangeComponent, selector: "filter-item-range" }, { type: AutocompleteComponent, selector: "filter-item-autocomplete" }, { type: AutocompletechipsComponent, selector: "filter-item-autocompletechips" }, { type: DateComponent, selector: "filter-item-date" }, { type: DateRangeComponent, selector: "filter-item-date-range" }, { type: WeekComponent, selector: "filter-item-week" }, { type: CheckboxComponent, selector: "filter-item-checkbox" }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3458
3458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, decorators: [{
|
|
3459
3459
|
type: Component,
|
|
3460
3460
|
args: [{
|
|
@@ -3464,23 +3464,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
3464
3464
|
}]
|
|
3465
3465
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
|
|
3466
3466
|
type: Input
|
|
3467
|
-
}], filter: [{
|
|
3468
|
-
type: Input
|
|
3469
3467
|
}] } });
|
|
3470
3468
|
|
|
3471
3469
|
class FilterDrawerComponent {
|
|
3472
|
-
constructor(
|
|
3470
|
+
constructor(_overlayRef, _data, externalParams, _cd, _itemsStore) {
|
|
3471
|
+
this._overlayRef = _overlayRef;
|
|
3472
|
+
this._data = _data;
|
|
3473
3473
|
this.externalParams = externalParams;
|
|
3474
3474
|
this._cd = _cd;
|
|
3475
3475
|
this._itemsStore = _itemsStore;
|
|
3476
|
-
this._overlayRef = _overlayRef;
|
|
3477
|
-
this._data = _data;
|
|
3478
3476
|
this.inline = false;
|
|
3479
3477
|
this.windowDesktop = false;
|
|
3480
3478
|
this._itemsStore.prepareItems();
|
|
3481
|
-
this._clear = _data.clear;
|
|
3482
|
-
this._done = _data.done;
|
|
3483
|
-
this.filter = _data.filter;
|
|
3479
|
+
this._clear = this._data.clear;
|
|
3480
|
+
this._done = this._data.done;
|
|
3484
3481
|
this.updateWindowWidth();
|
|
3485
3482
|
}
|
|
3486
3483
|
updateWindowWidth() {
|
|
@@ -3507,8 +3504,8 @@ class FilterDrawerComponent {
|
|
|
3507
3504
|
this.done();
|
|
3508
3505
|
}
|
|
3509
3506
|
}
|
|
3510
|
-
FilterDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, deps: [{ token:
|
|
3511
|
-
FilterDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0, template: "<div class=\"filters\">\n <div class=\"filters-wrap\">\n\n <div class=\"filter-by\">\n <mat-icon>tune</mat-icon>\n <span class=\"text\">Filters</span>\n </div>\n\n <div class=\"overflow-shadow filter-items\">\n <div class=\"overflow-shadow-content\">\n <ng-container *fsSkeleton=\"(externalParams.pending$ | async) !== true\">\n <filter-item \n *ngFor=\"let filterItem of items$ | async\"\n class=\"filter-group\"\n [item]=\"filterItem\"
|
|
3507
|
+
FilterDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, deps: [{ token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }, { token: ExternalParamsController }, { token: i0.ChangeDetectorRef }, { token: FsFilterItemsStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
3508
|
+
FilterDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0, template: "<div class=\"filters\">\n <div class=\"filters-wrap\">\n\n <div class=\"filter-by\">\n <mat-icon>tune</mat-icon>\n <span class=\"text\">Filters</span>\n </div>\n\n <div class=\"overflow-shadow filter-items\">\n <div class=\"overflow-shadow-content\">\n <ng-container *fsSkeleton=\"(externalParams.pending$ | async) !== true\">\n <filter-item \n *ngFor=\"let filterItem of items$ | async\"\n class=\"filter-group\"\n [item]=\"filterItem\">\n </filter-item>\n\n <ng-container *ngIf=\"sortItem && sortItem.values && sortItem.values.length > 0\">\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortDirectionItem\">\n </filter-item>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <fs-filter-drawer-actions \n class=\"filter-actions\"\n *ngIf=\"(externalParams.pending$ | async) !== true\"\n (clear)=\"clear()\"\n (done)=\"done()\">\n </fs-filter-drawer-actions>\n </div>\n</div>\n<div class=\"backdrop\" *ngIf=\"!windowDesktop\" (click)=\"backdropClick()\"></div>\n", styles: [":host ::ng-deep mat-form-field{width:100%}.filter-by{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:20px 25px}.filter-by mat-icon{margin-right:8px}.filter-by .text{font-weight:400;font-size:19px}.filter-actions{display:block;box-sizing:border-box;padding:13px}.filter-actions button{margin-right:6px}.filter-actions button:last-child{margin-right:0}.filters{position:fixed;display:block;top:0;right:0;z-index:1002;bottom:0}.filters .filters-wrap{background:#fff;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;width:85vw;max-width:350px;display:flex;flex-direction:column;height:100%;padding-top:calc(env(safe-area-inset-top))}.filters .filters-wrap .filter-items{overflow-y:auto}.filters .filters-wrap .filter-items .overflow-shadow-content{padding:0 25px;box-sizing:border-box}.filters .filter-group{margin:10px 0 0}.filters .filter-group:first-child{margin:0}.filters .filter label{white-space:nowrap;color:#0000008a}.filters .filter .interface.interface-range input,.filters .filter .interface.interface-range .mat-input-wrapper{text-align:center}.filters .filter .interface.interface-range{text-align:center}.filters .filter .interface.interface-datetime fs-datetime.has-time .md-input{width:100%}.filters .filter .interface fs-datetime-range input{text-align:center}.filters .filter .filter-label{width:1%;white-space:nowrap;vertical-align:middle;padding-right:15px}.filters md-autocomplete-container md-input-container{margin:0}.filters .isolate{margin-top:-12px}.filters .isolate .interface{line-height:20px;padding-bottom:1.25em}.filters .isolate md-checkbox{margin:0 0 0 2px}.backdrop{position:fixed;top:0;bottom:0;left:0;right:0;z-index:900;outline:none}\n"], components: [{ type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FilterItemComponent, selector: "filter-item", inputs: ["item"] }, { type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: ["clear", "done"] }], directives: [{ type: i6$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3512
3509
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, decorators: [{
|
|
3513
3510
|
type: Component,
|
|
3514
3511
|
args: [{
|
|
@@ -3517,13 +3514,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
3517
3514
|
// Commented out because filter items are not updating with a delayed observable. Need to figure this out.
|
|
3518
3515
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3519
3516
|
}]
|
|
3520
|
-
}], ctorParameters: function () { return [{ type:
|
|
3517
|
+
}], ctorParameters: function () { return [{ type: i1$6.OverlayRef, decorators: [{
|
|
3521
3518
|
type: Inject,
|
|
3522
3519
|
args: [FILTER_DRAWER_OVERLAY]
|
|
3523
3520
|
}] }, { type: undefined, decorators: [{
|
|
3524
3521
|
type: Inject,
|
|
3525
3522
|
args: [FILTER_DRAWER_DATA]
|
|
3526
|
-
}] }]; }, propDecorators: { inline: [{
|
|
3523
|
+
}] }, { type: ExternalParamsController }, { type: i0.ChangeDetectorRef }, { type: FsFilterItemsStore }]; }, propDecorators: { inline: [{
|
|
3527
3524
|
type: Input
|
|
3528
3525
|
}], updateWindowWidth: [{
|
|
3529
3526
|
type: HostListener,
|
|
@@ -3721,7 +3718,6 @@ class FsFilterOverlayService {
|
|
|
3721
3718
|
const data = {
|
|
3722
3719
|
done: this._doneFn,
|
|
3723
3720
|
clear: this._clearFn,
|
|
3724
|
-
filter: this.filter,
|
|
3725
3721
|
};
|
|
3726
3722
|
const injector = this._createInjector(this._injector, data, this._overlayRef);
|
|
3727
3723
|
const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
|
|
@@ -3807,7 +3803,6 @@ class FilterComponent {
|
|
|
3807
3803
|
this._keyword$ = new Subject();
|
|
3808
3804
|
this._destroy$ = new Subject();
|
|
3809
3805
|
this._filterItems.filter = this;
|
|
3810
|
-
this._filterOverlay.filter = this;
|
|
3811
3806
|
this._listenWhenFilterReady();
|
|
3812
3807
|
this._updateWindowWidth();
|
|
3813
3808
|
this._filterOverlay.attach$
|