@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.
Files changed (62) hide show
  1. package/app/components/filter-drawer/filter-drawer.component.d.ts +3 -5
  2. package/app/components/filters-item/base-item/base-item.component.d.ts +1 -3
  3. package/app/components/filters-item/filter-item.component.d.ts +1 -3
  4. package/app/helpers/create-filter-item.d.ts +8 -7
  5. package/app/interfaces/items/autocomplete-chips.interface.d.ts +1 -1
  6. package/app/interfaces/items/autocomplete.interface.d.ts +1 -1
  7. package/app/interfaces/items/base.interface.d.ts +3 -2
  8. package/app/models/items/autocomplete-chips-item.d.ts +2 -1
  9. package/app/models/items/autocomplete-item.d.ts +2 -1
  10. package/app/models/items/base-item.d.ts +6 -4
  11. package/app/models/items/checkbox-item.d.ts +2 -1
  12. package/app/models/items/chips-item.d.ts +2 -1
  13. package/app/models/items/date-item.d.ts +2 -1
  14. package/app/models/items/date-range-item.d.ts +2 -1
  15. package/app/models/items/date-time-item.d.ts +2 -1
  16. package/app/models/items/date-time-range-item.d.ts +2 -1
  17. package/app/models/items/range-item.d.ts +2 -1
  18. package/app/models/items/select/multiple-select-item.d.ts +3 -2
  19. package/app/models/items/select/simple-select-item.d.ts +2 -1
  20. package/app/models/items/select-item.d.ts +2 -1
  21. package/app/models/items/text-item.d.ts +2 -1
  22. package/app/models/items/week-item.d.ts +3 -2
  23. package/app/services/external-params-controller.service.d.ts +2 -2
  24. package/app/services/filter-overlay.service.d.ts +0 -2
  25. package/bundles/firestitch-filter.umd.js +572 -575
  26. package/bundles/firestitch-filter.umd.js.map +1 -1
  27. package/esm2015/app/components/filter/filter.component.js +1 -2
  28. package/esm2015/app/components/filter-chip/filter-chip.component.js +2 -2
  29. package/esm2015/app/components/filter-drawer/filter-drawer.component.js +10 -11
  30. package/esm2015/app/components/filter-drawer-actions/filter-drawer-actions.component.js +4 -3
  31. package/esm2015/app/components/filters-item/autocomplete/autocomplete.component.js +2 -2
  32. package/esm2015/app/components/filters-item/autocompletechips/autocompletechips.component.js +2 -2
  33. package/esm2015/app/components/filters-item/base-item/base-item.component.js +2 -4
  34. package/esm2015/app/components/filters-item/filter-item.component.js +2 -4
  35. package/esm2015/app/helpers/create-filter-item.js +22 -22
  36. package/esm2015/app/interfaces/items/autocomplete-chips.interface.js +1 -1
  37. package/esm2015/app/interfaces/items/autocomplete.interface.js +1 -1
  38. package/esm2015/app/interfaces/items/base.interface.js +1 -1
  39. package/esm2015/app/models/filter-config.js +1 -1
  40. package/esm2015/app/models/items/autocomplete-chips-item.js +3 -3
  41. package/esm2015/app/models/items/autocomplete-item.js +6 -4
  42. package/esm2015/app/models/items/base-item.js +14 -8
  43. package/esm2015/app/models/items/checkbox-item.js +7 -5
  44. package/esm2015/app/models/items/chips-item.js +8 -8
  45. package/esm2015/app/models/items/date-item.js +4 -4
  46. package/esm2015/app/models/items/date-range-item.js +3 -3
  47. package/esm2015/app/models/items/date-time-item.js +3 -3
  48. package/esm2015/app/models/items/date-time-range-item.js +3 -3
  49. package/esm2015/app/models/items/range-item.js +5 -10
  50. package/esm2015/app/models/items/select/multiple-select-item.js +4 -4
  51. package/esm2015/app/models/items/select/simple-select-item.js +4 -4
  52. package/esm2015/app/models/items/select-item.js +4 -6
  53. package/esm2015/app/models/items/text-item.js +9 -5
  54. package/esm2015/app/models/items/week-item.js +5 -10
  55. package/esm2015/app/services/external-params-controller.service.js +3 -4
  56. package/esm2015/app/services/filter-overlay.service.js +1 -2
  57. package/esm2015/app/services/items-store.service.js +9 -9
  58. package/fesm2015/firestitch-filter.js +268 -273
  59. package/fesm2015/firestitch-filter.js.map +1 -1
  60. package/package.json +1 -1
  61. package/app/components/filter/index.d.ts +0 -1
  62. package/esm2015/app/components/filter/index.js +0 -2
@@ -444,8 +444,9 @@
444
444
  })(exports.ItemType || (exports.ItemType = {}));
445
445
 
446
446
  var BaseItem = /** @class */ (function () {
447
- function BaseItem(itemConfig, _additionalConfig) {
447
+ function BaseItem(itemConfig, _additionalConfig, _filter) {
448
448
  this._additionalConfig = _additionalConfig;
449
+ this._filter = _filter;
449
450
  this._pendingValues = false;
450
451
  this._pendingDefaultValue = false;
451
452
  this._loading$ = new rxjs.BehaviorSubject(false);
@@ -457,6 +458,13 @@
457
458
  this._type = itemConfig.type;
458
459
  this._parseConfig(itemConfig);
459
460
  }
461
+ Object.defineProperty(BaseItem.prototype, "filter", {
462
+ get: function () {
463
+ return this._filter;
464
+ },
465
+ enumerable: false,
466
+ configurable: true
467
+ });
460
468
  Object.defineProperty(BaseItem.prototype, "isTypeAutocomplete", {
461
469
  ///
462
470
  get: function () {
@@ -654,7 +662,7 @@
654
662
  BaseItem.prototype.valueChanged = function () {
655
663
  this._value$.next(this.value);
656
664
  if (this.change) {
657
- this.change(this);
665
+ this.change(this, this._filter);
658
666
  }
659
667
  if (this.initialized) {
660
668
  this._valueChange$.next();
@@ -694,13 +702,13 @@
694
702
  _this._pendingDefaultValue = false;
695
703
  }));
696
704
  };
697
- BaseItem.prototype.initValues = function (filter, persistedValue) {
705
+ BaseItem.prototype.initValues = function (persistedValue) {
698
706
  // this._initialized = false;
699
707
  this.persistedValue = persistedValue;
700
708
  this._initDefaultModel();
701
709
  var isAutocomplete = this.type === exports.ItemType.AutoComplete || this.type === exports.ItemType.AutoCompleteChips;
702
710
  if (this._valuesFn && !isAutocomplete) {
703
- var valuesResult = this._valuesFn(null, filter);
711
+ var valuesResult = this._valuesFn(null, this._filter);
704
712
  if (rxjs.isObservable(valuesResult)) {
705
713
  this._pendingValues = true;
706
714
  }
@@ -716,12 +724,12 @@
716
724
  // this._initialized = true;
717
725
  }
718
726
  };
719
- BaseItem.prototype.loadAsyncValues = function (filter, reload) {
727
+ BaseItem.prototype.loadAsyncValues = function (reload) {
720
728
  var _this = this;
721
729
  if (reload === void 0) { reload = true; }
722
730
  if (reload || (!this.loading && this.hasPendingValues)) {
723
731
  this.loading = true;
724
- this._valuesFn(null, filter)
732
+ this._valuesFn(null, this._filter)
725
733
  .pipe(operators.take(1), operators.takeUntil(this._destroy$))
726
734
  .subscribe(function (values) {
727
735
  _this.values = values;
@@ -763,7 +771,9 @@
763
771
  this.defaultValue = item.default;
764
772
  }
765
773
  this.change = item.change;
766
- this.init = item.init || (function (item) { });
774
+ this.init = item.init || (function (_) {
775
+ //
776
+ });
767
777
  this.hide = item.hide;
768
778
  this.showClear = (_a = item.clear) !== null && _a !== void 0 ? _a : true;
769
779
  this.persistanceDisabled = (_b = item.disablePersist) !== null && _b !== void 0 ? _b : false;
@@ -831,8 +841,8 @@
831
841
 
832
842
  var MultipleSelectItem = /** @class */ (function (_super) {
833
843
  __extends(MultipleSelectItem, _super);
834
- function MultipleSelectItem(itemConfig, _persistedValues) {
835
- return _super.call(this, itemConfig, _persistedValues) || this;
844
+ function MultipleSelectItem(itemConfig, _persistedValues, _filter) {
845
+ return _super.call(this, itemConfig, _persistedValues, _filter) || this;
836
846
  }
837
847
  Object.defineProperty(MultipleSelectItem.prototype, "value", {
838
848
  get: function () {
@@ -917,7 +927,7 @@
917
927
  var _this = this;
918
928
  var possibleValues = common.filter(this.model || [], function (item) {
919
929
  return _this.values.find(function (value) {
920
- return value.value == item;
930
+ return value.value === item;
921
931
  });
922
932
  });
923
933
  if (!common.isArrayEqual(this.model, possibleValues)) {
@@ -959,177 +969,74 @@
959
969
  return flattenedParams;
960
970
  }
961
971
 
962
- function findValue(values, value, children) {
963
- for (var i = 0; i < values.length; i++) {
964
- var val = values[i];
965
- if (val[children]) {
966
- return findValue(val[children], value, children);
967
- }
968
- if (val.value === value) {
969
- return val;
970
- }
971
- }
972
- return undefined;
973
- }
974
-
975
- var SimpleSelectItem = /** @class */ (function (_super) {
976
- __extends(SimpleSelectItem, _super);
977
- function SimpleSelectItem(itemConfig, _persistedValues) {
978
- return _super.call(this, itemConfig, _persistedValues) || this;
972
+ var BaseAutocompleteItem = /** @class */ (function (_super) {
973
+ __extends(BaseAutocompleteItem, _super);
974
+ function BaseAutocompleteItem() {
975
+ return _super !== null && _super.apply(this, arguments) || this;
979
976
  }
980
- Object.defineProperty(SimpleSelectItem.prototype, "value", {
981
- get: function () {
982
- var value = this.model;
983
- if (value == '__all' || value === undefined) {
984
- value = undefined;
985
- }
986
- return value;
987
- },
988
- enumerable: false,
989
- configurable: true
990
- });
991
- SimpleSelectItem.prototype.getChipsContent = function (type) {
992
- var _this = this;
993
- if (type === void 0) { type = null; }
994
- if (this.children) {
995
- var itemValue_1 = findValue(this.values, this.model, this.children);
996
- return itemValue_1 && itemValue_1.name;
997
- }
998
- var itemValue = this.values.find(function (val) { return val.value === _this.model; });
999
- if (itemValue) {
1000
- return itemValue.name;
1001
- }
1002
- else if (this.isolate) {
1003
- return this.isolate.label;
1004
- }
1005
- };
1006
- Object.defineProperty(SimpleSelectItem.prototype, "isChipVisible", {
1007
- get: function () {
1008
- return this.model !== '__all' && this.model !== undefined;
1009
- },
1010
- enumerable: false,
1011
- configurable: true
1012
- });
1013
- SimpleSelectItem.prototype._init = function () {
1014
- _super.prototype._init.call(this);
1015
- if (this.model === undefined && this.defaultValue === undefined) {
1016
- this._model = '__all';
1017
- }
1018
- };
1019
- Object.defineProperty(SimpleSelectItem.prototype, "isolateOptionNotSelected", {
977
+ Object.defineProperty(BaseAutocompleteItem.prototype, "valuesFn", {
1020
978
  get: function () {
1021
- var modelValue = this.model;
1022
- var isolate = this.isolate;
1023
- return isolate && !isolate.enabled && (modelValue === null || modelValue === void 0 ? void 0 : modelValue.length) === 0;
979
+ return this._valuesFn;
1024
980
  },
1025
981
  enumerable: false,
1026
982
  configurable: true
1027
983
  });
1028
- SimpleSelectItem.prototype._setModel = function (value) {
1029
- if (value) {
1030
- if (!isNaN(value)) {
1031
- value = +value;
1032
- }
1033
- }
1034
- _super.prototype._setModel.call(this, value);
1035
- };
1036
- SimpleSelectItem.prototype._validateModel = function () {
1037
- var _this = this;
1038
- var item = this.values.find(function (value) {
1039
- return value.value == _this.model;
1040
- });
1041
- var value = item ? item.value : '__all';
1042
- if (this._model !== value) {
1043
- this.model = value;
1044
- }
1045
- };
1046
- SimpleSelectItem.prototype._clearValue = function (defaultValue) {
1047
- if (defaultValue === void 0) { defaultValue = undefined; }
1048
- _super.prototype._clearValue.call(this, defaultValue);
1049
- var value = Array.isArray(this.values) && this.values.some(function (val) { return val.value === '__all'; })
1050
- ? '__all'
1051
- : undefined;
1052
- this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
984
+ BaseAutocompleteItem.prototype._validateModel = function () {
985
+ //
1053
986
  };
1054
- return SimpleSelectItem;
1055
- }(BaseSelectItem));
1056
-
1057
- var SelectItem = /** @class */ (function () {
1058
- function SelectItem() {
1059
- }
1060
- SelectItem.create = function (config) {
1061
- if (config.multiple) {
1062
- return new MultipleSelectItem(config, null);
1063
- }
1064
- else {
1065
- return new SimpleSelectItem(config, null);
1066
- }
987
+ BaseAutocompleteItem.prototype._parseConfig = function (item) {
988
+ var _a;
989
+ this.fetchOnFocus = (_a = item.fetchOnFocus) !== null && _a !== void 0 ? _a : true;
990
+ _super.prototype._parseConfig.call(this, item);
1067
991
  };
1068
- return SelectItem;
1069
- }());
992
+ return BaseAutocompleteItem;
993
+ }(BaseItem));
1070
994
 
1071
- var ChipsItem = /** @class */ (function (_super) {
1072
- __extends(ChipsItem, _super);
1073
- function ChipsItem() {
995
+ var AutocompleteChipsItem = /** @class */ (function (_super) {
996
+ __extends(AutocompleteChipsItem, _super);
997
+ function AutocompleteChipsItem() {
1074
998
  return _super !== null && _super.apply(this, arguments) || this;
1075
999
  }
1076
- ChipsItem.create = function (config) {
1077
- return new ChipsItem(config, null);
1000
+ AutocompleteChipsItem.create = function (config, filter) {
1001
+ return new AutocompleteChipsItem(config, null, filter);
1078
1002
  };
1079
- Object.defineProperty(ChipsItem.prototype, "isTypeChips", {
1080
- get: function () {
1081
- return true;
1082
- },
1083
- enumerable: false,
1084
- configurable: true
1085
- });
1086
- Object.defineProperty(ChipsItem.prototype, "value", {
1003
+ Object.defineProperty(AutocompleteChipsItem.prototype, "value", {
1087
1004
  get: function () {
1088
- var value = lodashEs.clone(this.model);
1089
- if (Array.isArray(value) && value.length === 0) {
1005
+ if (Array.isArray(this.model) && this.model.length === 0) {
1090
1006
  return undefined;
1091
1007
  }
1092
- return value;
1093
- },
1094
- enumerable: false,
1095
- configurable: true
1096
- });
1097
- Object.defineProperty(ChipsItem.prototype, "isChipVisible", {
1098
- get: function () {
1099
- return !!this.value;
1100
- },
1101
- enumerable: false,
1102
- configurable: true
1103
- });
1104
- Object.defineProperty(ChipsItem.prototype, "queryObject", {
1105
- get: function () {
1106
- var _a;
1107
- var value = this.value;
1108
- var name = this.name;
1109
- return _a = {},
1110
- _a[name] = value,
1111
- _a;
1008
+ return lodashEs.clone(this.model);
1112
1009
  },
1113
1010
  enumerable: false,
1114
1011
  configurable: true
1115
1012
  });
1116
- Object.defineProperty(ChipsItem.prototype, "persistanceObject", {
1013
+ Object.defineProperty(AutocompleteChipsItem.prototype, "queryObject", {
1117
1014
  get: function () {
1118
1015
  var value = this.value;
1119
1016
  var name = this.name;
1120
1017
  var params = {};
1121
1018
  if (Array.isArray(value)) {
1122
- params[name] = value.join(',');
1019
+ params[this.name] = value
1020
+ .filter(function (item) { return !!item.value; })
1021
+ .map(function (item) { return item.value; })
1022
+ .join(',');
1123
1023
  }
1124
1024
  else {
1125
- params[name] = undefined;
1025
+ params[name] = value;
1126
1026
  }
1127
1027
  return params;
1128
1028
  },
1129
1029
  enumerable: false,
1130
1030
  configurable: true
1131
1031
  });
1132
- ChipsItem.prototype.getChipsContent = function () {
1032
+ Object.defineProperty(AutocompleteChipsItem.prototype, "isChipVisible", {
1033
+ get: function () {
1034
+ return Array.isArray(this.model) && this.model.length > 0;
1035
+ },
1036
+ enumerable: false,
1037
+ configurable: true
1038
+ });
1039
+ AutocompleteChipsItem.prototype.getChipsContent = function () {
1133
1040
  return this.model
1134
1041
  .reduce(function (acc, i) {
1135
1042
  acc.push(i.name);
@@ -1137,160 +1044,358 @@
1137
1044
  }, [])
1138
1045
  .join(', ');
1139
1046
  };
1140
- ChipsItem.prototype._validateModel = function () { };
1141
- ChipsItem.prototype._setModel = function (value) {
1142
- if (Array.isArray(value)) {
1143
- value = value.map(function (val) {
1144
- if (isNaN(val)) {
1145
- return val;
1146
- }
1147
- else {
1148
- return +val;
1149
- }
1150
- });
1151
- }
1152
- this._model = value;
1153
- };
1154
- ChipsItem.prototype._parseConfig = function (item) {
1155
- this.multiple = item.multiple;
1156
- _super.prototype._parseConfig.call(this, item);
1157
- };
1158
- ChipsItem.prototype._init = function () {
1159
- var _this = this;
1160
- if (!Array.isArray(this.values)) {
1161
- this.values = [];
1162
- }
1163
- if (this.model && Array.isArray(this.model) && this.values.length) {
1164
- if (Number.isInteger(this.model[0])) {
1165
- this._model = this.model.map(function (id) {
1166
- return _this.values.find(function (value) { return value.value === id; });
1167
- });
1168
- }
1169
- }
1047
+ AutocompleteChipsItem.prototype._init = function () {
1170
1048
  if (this.model === undefined) {
1171
1049
  this._model = [];
1172
1050
  }
1173
1051
  };
1174
- ChipsItem.prototype._clearValue = function (defaultValue) {
1052
+ AutocompleteChipsItem.prototype._parseConfig = function (item) {
1053
+ var _a;
1054
+ this.chipImage = (_a = item.chipImage) !== null && _a !== void 0 ? _a : 'image';
1055
+ this.chipIcon = item.chipIcon;
1056
+ this.chipIconColor = item.chipIconColor;
1057
+ this.chipColor = item.chipColor;
1058
+ this.chipBackground = item.chipBackground;
1059
+ this.chipClass = item.chipClass;
1060
+ _super.prototype._parseConfig.call(this, item);
1061
+ };
1062
+ AutocompleteChipsItem.prototype._clearValue = function (defaultValue) {
1175
1063
  if (defaultValue === void 0) { defaultValue = undefined; }
1176
1064
  this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : [];
1065
+ this.search = '';
1177
1066
  };
1178
- return ChipsItem;
1179
- }(BaseItem));
1180
-
1181
- function getRangeName(configCase, name, range) {
1182
- if (configCase === 'snake') {
1183
- return name.concat('_').concat(range);
1184
- }
1185
- if (configCase === 'camel') {
1186
- return name.concat(range.charAt(0).toUpperCase()).concat(range.slice(1));
1187
- }
1188
- }
1067
+ AutocompleteChipsItem.prototype._setModel = function (value) {
1068
+ _super.prototype._setModel.call(this, value || []);
1069
+ };
1070
+ return AutocompleteChipsItem;
1071
+ }(BaseAutocompleteItem));
1189
1072
 
1190
- var RangeItem = /** @class */ (function (_super) {
1191
- __extends(RangeItem, _super);
1192
- function RangeItem() {
1073
+ var AutocompleteItem = /** @class */ (function (_super) {
1074
+ __extends(AutocompleteItem, _super);
1075
+ function AutocompleteItem() {
1193
1076
  return _super !== null && _super.apply(this, arguments) || this;
1194
1077
  }
1195
- RangeItem.create = function (config, additionalConfig) {
1196
- return new RangeItem(config, additionalConfig);
1078
+ AutocompleteItem.create = function (config, filter) {
1079
+ return new AutocompleteItem(config, null, filter);
1197
1080
  };
1198
- Object.defineProperty(RangeItem.prototype, "value", {
1081
+ Object.defineProperty(AutocompleteItem.prototype, "value", {
1199
1082
  get: function () {
1200
1083
  var value = lodashEs.clone(this.model);
1201
- if (!lodashEs.isObject(this.model) ||
1202
- (common.isEmpty(this.model.max, { zero: true }) && common.isEmpty(this.model.min, { zero: true }))) {
1203
- value = undefined;
1084
+ if (!this.model || this.model.value === undefined) {
1085
+ return undefined;
1204
1086
  }
1087
+ value = this.model.value;
1205
1088
  return value;
1206
1089
  },
1207
1090
  enumerable: false,
1208
1091
  configurable: true
1209
1092
  });
1210
- Object.defineProperty(RangeItem.prototype, "queryObject", {
1093
+ Object.defineProperty(AutocompleteItem.prototype, "queryObject", {
1211
1094
  get: function () {
1212
1095
  var value = this.value;
1213
1096
  var name = this.name;
1214
1097
  var params = {};
1215
- var paramMinName = getRangeName(this.case, name, 'min');
1216
- var paramMaxName = getRangeName(this.case, name, 'max');
1217
- if (lodashEs.isObject(value)) {
1218
- params[paramMinName] = value.min || undefined;
1219
- params[paramMaxName] = value.max || undefined;
1220
- }
1221
- else {
1222
- params[paramMinName] = undefined;
1223
- params[paramMaxName] = undefined;
1224
- }
1098
+ params[name] = value;
1225
1099
  return params;
1226
1100
  },
1227
1101
  enumerable: false,
1228
1102
  configurable: true
1229
1103
  });
1230
- Object.defineProperty(RangeItem.prototype, "isChipVisible", {
1104
+ AutocompleteItem.prototype.getChipsContent = function () {
1105
+ return this.model ? this.model.name : '';
1106
+ };
1107
+ AutocompleteItem.prototype._init = function () {
1108
+ //
1109
+ };
1110
+ AutocompleteItem.prototype._clearValue = function (defaultValue) {
1111
+ if (defaultValue === void 0) { defaultValue = undefined; }
1112
+ this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
1113
+ this.search = '';
1114
+ };
1115
+ return AutocompleteItem;
1116
+ }(BaseAutocompleteItem));
1117
+
1118
+ var CheckboxItem = /** @class */ (function (_super) {
1119
+ __extends(CheckboxItem, _super);
1120
+ function CheckboxItem() {
1121
+ return _super !== null && _super.apply(this, arguments) || this;
1122
+ }
1123
+ CheckboxItem.create = function (config, filter) {
1124
+ return new CheckboxItem(config, null, filter);
1125
+ };
1126
+ Object.defineProperty(CheckboxItem.prototype, "isTypeCheckbox", {
1231
1127
  get: function () {
1232
- return this.model && (this.model.min !== undefined || this.model.max !== undefined);
1128
+ return true;
1233
1129
  },
1234
1130
  enumerable: false,
1235
1131
  configurable: true
1236
1132
  });
1237
- RangeItem.prototype.getChipsContent = function (type) {
1238
- if (type === 'from') {
1239
- var min = this.model.min;
1240
- return "" + min;
1241
- }
1242
- else if (type === 'to') {
1243
- var max = this.model.max;
1244
- return "" + max;
1133
+ Object.defineProperty(CheckboxItem.prototype, "isChipVisible", {
1134
+ get: function () {
1135
+ return this.value === this.checked;
1136
+ },
1137
+ enumerable: false,
1138
+ configurable: true
1139
+ });
1140
+ Object.defineProperty(CheckboxItem.prototype, "value", {
1141
+ get: function () {
1142
+ var value = this.model ? this.checked : this.unchecked;
1143
+ if (!value) {
1144
+ return undefined;
1145
+ }
1146
+ return value;
1147
+ },
1148
+ enumerable: false,
1149
+ configurable: true
1150
+ });
1151
+ Object.defineProperty(CheckboxItem.prototype, "queryObject", {
1152
+ get: function () {
1153
+ var value = this.value;
1154
+ var name = this.name;
1155
+ var params = {};
1156
+ params[name] = this.model ? value : undefined;
1157
+ return params;
1158
+ },
1159
+ enumerable: false,
1160
+ configurable: true
1161
+ });
1162
+ CheckboxItem.prototype.getChipsContent = function (type) {
1163
+ if (type === void 0) { type = null; }
1164
+ return this.label;
1165
+ };
1166
+ CheckboxItem.prototype._validateModel = function () {
1167
+ //
1168
+ };
1169
+ CheckboxItem.prototype._parseConfig = function (item) {
1170
+ this.checked = item.checked;
1171
+ this.unchecked = item.unchecked;
1172
+ this.checked = item.checked ? lodashEs.toString(item.checked) : true;
1173
+ this.unchecked = item.unchecked ? lodashEs.toString(item.unchecked) : false;
1174
+ this.defaultValue = item.default === undefined ? this.unchecked : lodashEs.toString(this.defaultValue);
1175
+ _super.prototype._parseConfig.call(this, item);
1176
+ };
1177
+ CheckboxItem.prototype._init = function () {
1178
+ if (this.model === undefined) {
1179
+ this._model = this.checked === this.defaultValue;
1245
1180
  }
1246
1181
  };
1247
- RangeItem.prototype.clearRange = function (type, defaultValue) {
1248
- if (type === void 0) { type = null; }
1182
+ CheckboxItem.prototype._clearValue = function (defaultValue) {
1249
1183
  if (defaultValue === void 0) { defaultValue = undefined; }
1250
- if (type === 'from') {
1251
- delete this.model.min;
1252
- if (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.min) {
1253
- this.model.min = defaultValue.min;
1184
+ this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : false;
1185
+ };
1186
+ return CheckboxItem;
1187
+ }(BaseItem));
1188
+
1189
+ var ChipsItem = /** @class */ (function (_super) {
1190
+ __extends(ChipsItem, _super);
1191
+ function ChipsItem() {
1192
+ return _super !== null && _super.apply(this, arguments) || this;
1193
+ }
1194
+ ChipsItem.create = function (config, filter) {
1195
+ return new ChipsItem(config, null, filter);
1196
+ };
1197
+ Object.defineProperty(ChipsItem.prototype, "isTypeChips", {
1198
+ get: function () {
1199
+ return true;
1200
+ },
1201
+ enumerable: false,
1202
+ configurable: true
1203
+ });
1204
+ Object.defineProperty(ChipsItem.prototype, "value", {
1205
+ get: function () {
1206
+ var value = lodashEs.clone(this.model);
1207
+ if (Array.isArray(value) && value.length === 0) {
1208
+ return undefined;
1254
1209
  }
1255
- this.model = Object.assign({}, this.model);
1210
+ return value;
1211
+ },
1212
+ enumerable: false,
1213
+ configurable: true
1214
+ });
1215
+ Object.defineProperty(ChipsItem.prototype, "isChipVisible", {
1216
+ get: function () {
1217
+ return !!this.value;
1218
+ },
1219
+ enumerable: false,
1220
+ configurable: true
1221
+ });
1222
+ Object.defineProperty(ChipsItem.prototype, "queryObject", {
1223
+ get: function () {
1224
+ var _a;
1225
+ var value = this.value;
1226
+ var name = this.name;
1227
+ return _a = {},
1228
+ _a[name] = value,
1229
+ _a;
1230
+ },
1231
+ enumerable: false,
1232
+ configurable: true
1233
+ });
1234
+ Object.defineProperty(ChipsItem.prototype, "persistanceObject", {
1235
+ get: function () {
1236
+ var value = this.value;
1237
+ var name = this.name;
1238
+ var params = {};
1239
+ if (Array.isArray(value)) {
1240
+ params[name] = value.join(',');
1241
+ }
1242
+ else {
1243
+ params[name] = undefined;
1244
+ }
1245
+ return params;
1246
+ },
1247
+ enumerable: false,
1248
+ configurable: true
1249
+ });
1250
+ ChipsItem.prototype.getChipsContent = function () {
1251
+ return this.model
1252
+ .reduce(function (acc, i) {
1253
+ acc.push(i.name);
1254
+ return acc;
1255
+ }, [])
1256
+ .join(', ');
1257
+ };
1258
+ ChipsItem.prototype._validateModel = function () {
1259
+ //
1260
+ };
1261
+ ChipsItem.prototype._setModel = function (value) {
1262
+ if (Array.isArray(value)) {
1263
+ value = value.map(function (val) {
1264
+ if (isNaN(val)) {
1265
+ return val;
1266
+ }
1267
+ return +val;
1268
+ });
1256
1269
  }
1257
- else if (type === 'to') {
1258
- delete this.model.max;
1259
- if (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.max) {
1260
- this.model.max = defaultValue.max;
1270
+ this._model = value;
1271
+ };
1272
+ ChipsItem.prototype._parseConfig = function (item) {
1273
+ this.multiple = item.multiple;
1274
+ _super.prototype._parseConfig.call(this, item);
1275
+ };
1276
+ ChipsItem.prototype._init = function () {
1277
+ var _this = this;
1278
+ if (!Array.isArray(this.values)) {
1279
+ this.values = [];
1280
+ }
1281
+ if (this.model && Array.isArray(this.model) && this.values.length) {
1282
+ if (Number.isInteger(this.model[0])) {
1283
+ this._model = this.model.map(function (id) {
1284
+ return _this.values.find(function (value) { return value.value === id; });
1285
+ });
1261
1286
  }
1262
- this.model = Object.assign({}, this.model);
1263
1287
  }
1264
- else {
1265
- if (defaultValue) {
1266
- this.model = Object.assign({}, defaultValue);
1288
+ if (this.model === undefined) {
1289
+ this._model = [];
1290
+ }
1291
+ };
1292
+ ChipsItem.prototype._clearValue = function (defaultValue) {
1293
+ if (defaultValue === void 0) { defaultValue = undefined; }
1294
+ this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : [];
1295
+ };
1296
+ return ChipsItem;
1297
+ }(BaseItem));
1298
+
1299
+ exports.ItemDateMode = void 0;
1300
+ (function (ItemDateMode) {
1301
+ ItemDateMode["Calendar"] = "calendar";
1302
+ ItemDateMode["ScrollMonthYear"] = "monthyear";
1303
+ ItemDateMode["ScrollMonthDayYear"] = "monthdayyear";
1304
+ })(exports.ItemDateMode || (exports.ItemDateMode = {}));
1305
+
1306
+ var BaseDateItem = /** @class */ (function (_super) {
1307
+ __extends(BaseDateItem, _super);
1308
+ function BaseDateItem() {
1309
+ return _super !== null && _super.apply(this, arguments) || this;
1310
+ }
1311
+ Object.defineProperty(BaseDateItem.prototype, "value", {
1312
+ get: function () {
1313
+ var value = lodashEs.clone(this.model);
1314
+ if (!value || !dateFns.isValid(value) || !dateFns.isDate(value)) {
1315
+ return undefined;
1267
1316
  }
1268
- else {
1269
- this.model = {};
1317
+ return value;
1318
+ },
1319
+ enumerable: false,
1320
+ configurable: true
1321
+ });
1322
+ Object.defineProperty(BaseDateItem.prototype, "queryObject", {
1323
+ get: function () {
1324
+ var value = this.value;
1325
+ var name = this.name;
1326
+ var params = {};
1327
+ params[name] = value;
1328
+ return params;
1329
+ },
1330
+ enumerable: false,
1331
+ configurable: true
1332
+ });
1333
+ Object.defineProperty(BaseDateItem.prototype, "persistanceObject", {
1334
+ get: function () {
1335
+ var _a;
1336
+ var value = this.queryObject[this.name];
1337
+ return _a = {},
1338
+ _a[this.name] = value ? date.simpleFormat(value) : undefined,
1339
+ _a;
1340
+ },
1341
+ enumerable: false,
1342
+ configurable: true
1343
+ });
1344
+ BaseDateItem.prototype._validateModel = function () {
1345
+ };
1346
+ BaseDateItem.prototype._setModel = function (value) {
1347
+ if (value) {
1348
+ if (!dateFns.isDate(value) || !dateFns.isValid(value)) {
1349
+ value = dateFns.parseISO(value);
1270
1350
  }
1271
1351
  }
1352
+ _super.prototype._setModel.call(this, value);
1272
1353
  };
1273
- RangeItem.prototype._validateModel = function () {
1274
- };
1275
- RangeItem.prototype._parseConfig = function (item) {
1276
- var _a, _b;
1277
- this.options = item.options;
1278
- this.prefix = item.prefix;
1279
- this.suffix = item.suffix;
1280
- this.case = (_b = (_a = this._additionalConfig) === null || _a === void 0 ? void 0 : _a.case) !== null && _b !== void 0 ? _b : 'camel';
1354
+ BaseDateItem.prototype._parseConfig = function (item) {
1355
+ this.maxYear = item.maxYear;
1356
+ this.mode = item.mode || exports.ItemDateMode.Calendar;
1281
1357
  _super.prototype._parseConfig.call(this, item);
1282
1358
  };
1283
- RangeItem.prototype._init = function () {
1359
+ BaseDateItem.prototype._init = function () {
1284
1360
  if (!this.label) {
1285
1361
  this.label = ['Min', 'Max'];
1286
1362
  }
1287
- if (!this.model) {
1288
- this.model = this.defaultValue || {};
1289
- }
1290
1363
  };
1291
- return RangeItem;
1364
+ return BaseDateItem;
1292
1365
  }(BaseItem));
1293
1366
 
1367
+ var DateItem = /** @class */ (function (_super) {
1368
+ __extends(DateItem, _super);
1369
+ function DateItem() {
1370
+ return _super !== null && _super.apply(this, arguments) || this;
1371
+ }
1372
+ DateItem.create = function (config, filter) {
1373
+ return new DateItem(config, null, filter);
1374
+ };
1375
+ DateItem.prototype.getChipsContent = function (type) {
1376
+ if (type === void 0) { type = null; }
1377
+ var dateFormat = 'date';
1378
+ if (this.mode === exports.ItemDateMode.ScrollMonthYear) {
1379
+ dateFormat = 'full-date-dayless';
1380
+ }
1381
+ return date.format(this.model, dateFormat);
1382
+ };
1383
+ DateItem.prototype._clearValue = function (defaultValue) {
1384
+ if (defaultValue === void 0) { defaultValue = undefined; }
1385
+ this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
1386
+ };
1387
+ return DateItem;
1388
+ }(BaseDateItem));
1389
+
1390
+ function getRangeName(configCase, name, range) {
1391
+ if (configCase === 'snake') {
1392
+ return name.concat('_').concat(range);
1393
+ }
1394
+ if (configCase === 'camel') {
1395
+ return name.concat(range.charAt(0).toUpperCase()).concat(range.slice(1));
1396
+ }
1397
+ }
1398
+
1294
1399
  var BaseDateRangeItem = /** @class */ (function (_super) {
1295
1400
  __extends(BaseDateRangeItem, _super);
1296
1401
  function BaseDateRangeItem() {
@@ -1460,349 +1565,251 @@
1460
1565
  function DateRangeItem() {
1461
1566
  return _super !== null && _super.apply(this, arguments) || this;
1462
1567
  }
1463
- DateRangeItem.create = function (config) {
1464
- return new DateRangeItem(config, null);
1568
+ DateRangeItem.create = function (config, filter) {
1569
+ return new DateRangeItem(config, null, filter);
1465
1570
  };
1466
1571
  return DateRangeItem;
1467
1572
  }(BaseDateRangeItem));
1468
1573
 
1469
- var DateTimeRangeItem = /** @class */ (function (_super) {
1470
- __extends(DateTimeRangeItem, _super);
1471
- function DateTimeRangeItem() {
1472
- return _super !== null && _super.apply(this, arguments) || this;
1473
- }
1474
- DateTimeRangeItem.create = function (config) {
1475
- return new DateTimeRangeItem(config, null);
1476
- };
1477
- return DateTimeRangeItem;
1478
- }(BaseDateRangeItem));
1479
-
1480
- exports.ItemDateMode = void 0;
1481
- (function (ItemDateMode) {
1482
- ItemDateMode["Calendar"] = "calendar";
1483
- ItemDateMode["ScrollMonthYear"] = "monthyear";
1484
- ItemDateMode["ScrollMonthDayYear"] = "monthdayyear";
1485
- })(exports.ItemDateMode || (exports.ItemDateMode = {}));
1486
-
1487
- var BaseDateItem = /** @class */ (function (_super) {
1488
- __extends(BaseDateItem, _super);
1489
- function BaseDateItem() {
1490
- return _super !== null && _super.apply(this, arguments) || this;
1491
- }
1492
- Object.defineProperty(BaseDateItem.prototype, "value", {
1493
- get: function () {
1494
- var value = lodashEs.clone(this.model);
1495
- if (!value || !dateFns.isValid(value) || !dateFns.isDate(value)) {
1496
- return undefined;
1497
- }
1498
- return value;
1499
- },
1500
- enumerable: false,
1501
- configurable: true
1502
- });
1503
- Object.defineProperty(BaseDateItem.prototype, "queryObject", {
1504
- get: function () {
1505
- var value = this.value;
1506
- var name = this.name;
1507
- var params = {};
1508
- params[name] = value;
1509
- return params;
1510
- },
1511
- enumerable: false,
1512
- configurable: true
1513
- });
1514
- Object.defineProperty(BaseDateItem.prototype, "persistanceObject", {
1515
- get: function () {
1516
- var _a;
1517
- var value = this.queryObject[this.name];
1518
- return _a = {},
1519
- _a[this.name] = value ? date.simpleFormat(value) : undefined,
1520
- _a;
1521
- },
1522
- enumerable: false,
1523
- configurable: true
1524
- });
1525
- BaseDateItem.prototype._validateModel = function () {
1526
- };
1527
- BaseDateItem.prototype._setModel = function (value) {
1528
- if (value) {
1529
- if (!dateFns.isDate(value) || !dateFns.isValid(value)) {
1530
- value = dateFns.parseISO(value);
1531
- }
1532
- }
1533
- _super.prototype._setModel.call(this, value);
1534
- };
1535
- BaseDateItem.prototype._parseConfig = function (item) {
1536
- this.maxYear = item.maxYear;
1537
- this.mode = item.mode || exports.ItemDateMode.Calendar;
1538
- _super.prototype._parseConfig.call(this, item);
1539
- };
1540
- BaseDateItem.prototype._init = function () {
1541
- if (!this.label) {
1542
- this.label = ['Min', 'Max'];
1543
- }
1544
- };
1545
- return BaseDateItem;
1546
- }(BaseItem));
1547
-
1548
- var DateItem = /** @class */ (function (_super) {
1549
- __extends(DateItem, _super);
1550
- function DateItem() {
1551
- return _super !== null && _super.apply(this, arguments) || this;
1552
- }
1553
- DateItem.create = function (config) {
1554
- return new DateItem(config, null);
1555
- };
1556
- DateItem.prototype.getChipsContent = function (type) {
1557
- if (type === void 0) { type = null; }
1558
- var dateFormat = 'date';
1559
- if (this.mode == exports.ItemDateMode.ScrollMonthYear) {
1560
- dateFormat = 'full-date-dayless';
1561
- }
1562
- return date.format(this.model, dateFormat);
1563
- };
1564
- DateItem.prototype._clearValue = function (defaultValue) {
1565
- if (defaultValue === void 0) { defaultValue = undefined; }
1566
- this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
1567
- };
1568
- return DateItem;
1569
- }(BaseDateItem));
1570
-
1571
1574
  var DateTimeItem = /** @class */ (function (_super) {
1572
1575
  __extends(DateTimeItem, _super);
1573
1576
  function DateTimeItem() {
1574
1577
  return _super !== null && _super.apply(this, arguments) || this;
1575
1578
  }
1576
- DateTimeItem.create = function (config) {
1577
- return new DateTimeItem(config, null);
1579
+ DateTimeItem.create = function (config, filter) {
1580
+ return new DateTimeItem(config, null, filter);
1578
1581
  };
1579
1582
  DateTimeItem.prototype._clearValue = function (defaultValue) {
1580
1583
  if (defaultValue === void 0) { defaultValue = undefined; }
1581
1584
  this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
1582
1585
  };
1583
1586
  return DateTimeItem;
1584
- }(BaseDateItem));
1585
-
1586
- var BaseAutocompleteItem = /** @class */ (function (_super) {
1587
- __extends(BaseAutocompleteItem, _super);
1588
- function BaseAutocompleteItem() {
1589
- return _super !== null && _super.apply(this, arguments) || this;
1590
- }
1591
- Object.defineProperty(BaseAutocompleteItem.prototype, "valuesFn", {
1592
- get: function () {
1593
- return this._valuesFn;
1594
- },
1595
- enumerable: false,
1596
- configurable: true
1597
- });
1598
- BaseAutocompleteItem.prototype._validateModel = function () {
1599
- //
1600
- };
1601
- BaseAutocompleteItem.prototype._parseConfig = function (item) {
1602
- var _a;
1603
- this.fetchOnFocus = (_a = item.fetchOnFocus) !== null && _a !== void 0 ? _a : true;
1604
- _super.prototype._parseConfig.call(this, item);
1605
- };
1606
- return BaseAutocompleteItem;
1607
- }(BaseItem));
1608
-
1609
- var AutocompleteItem = /** @class */ (function (_super) {
1610
- __extends(AutocompleteItem, _super);
1611
- function AutocompleteItem() {
1612
- return _super !== null && _super.apply(this, arguments) || this;
1613
- }
1614
- AutocompleteItem.create = function (config) {
1615
- return new AutocompleteItem(config, null);
1616
- };
1617
- Object.defineProperty(AutocompleteItem.prototype, "value", {
1618
- get: function () {
1619
- var value = lodashEs.clone(this.model);
1620
- if (!this.model || this.model.value === undefined) {
1621
- return undefined;
1622
- }
1623
- value = this.model.value;
1624
- return value;
1625
- },
1626
- enumerable: false,
1627
- configurable: true
1628
- });
1629
- Object.defineProperty(AutocompleteItem.prototype, "queryObject", {
1630
- get: function () {
1631
- var value = this.value;
1632
- var name = this.name;
1633
- var params = {};
1634
- params[name] = value;
1635
- return params;
1636
- },
1637
- enumerable: false,
1638
- configurable: true
1639
- });
1640
- AutocompleteItem.prototype.getChipsContent = function () {
1641
- return this.model ? this.model.name : '';
1642
- };
1643
- AutocompleteItem.prototype._init = function () { };
1644
- AutocompleteItem.prototype._clearValue = function (defaultValue) {
1645
- if (defaultValue === void 0) { defaultValue = undefined; }
1646
- this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
1647
- this.search = '';
1587
+ }(BaseDateItem));
1588
+
1589
+ var DateTimeRangeItem = /** @class */ (function (_super) {
1590
+ __extends(DateTimeRangeItem, _super);
1591
+ function DateTimeRangeItem() {
1592
+ return _super !== null && _super.apply(this, arguments) || this;
1593
+ }
1594
+ DateTimeRangeItem.create = function (config, filter) {
1595
+ return new DateTimeRangeItem(config, null, filter);
1648
1596
  };
1649
- return AutocompleteItem;
1650
- }(BaseAutocompleteItem));
1597
+ return DateTimeRangeItem;
1598
+ }(BaseDateRangeItem));
1651
1599
 
1652
- var AutocompleteChipsItem = /** @class */ (function (_super) {
1653
- __extends(AutocompleteChipsItem, _super);
1654
- function AutocompleteChipsItem() {
1600
+ var RangeItem = /** @class */ (function (_super) {
1601
+ __extends(RangeItem, _super);
1602
+ function RangeItem() {
1655
1603
  return _super !== null && _super.apply(this, arguments) || this;
1656
1604
  }
1657
- AutocompleteChipsItem.create = function (config) {
1658
- return new AutocompleteChipsItem(config, null);
1605
+ RangeItem.create = function (config, additionalConfig, filter) {
1606
+ return new RangeItem(config, additionalConfig, filter);
1659
1607
  };
1660
- Object.defineProperty(AutocompleteChipsItem.prototype, "value", {
1608
+ Object.defineProperty(RangeItem.prototype, "value", {
1661
1609
  get: function () {
1662
- if (Array.isArray(this.model) && this.model.length === 0) {
1663
- return undefined;
1610
+ var value = lodashEs.clone(this.model);
1611
+ if (!lodashEs.isObject(this.model) ||
1612
+ (common.isEmpty(this.model.max, { zero: true }) && common.isEmpty(this.model.min, { zero: true }))) {
1613
+ value = undefined;
1664
1614
  }
1665
- return lodashEs.clone(this.model);
1615
+ return value;
1666
1616
  },
1667
1617
  enumerable: false,
1668
1618
  configurable: true
1669
1619
  });
1670
- Object.defineProperty(AutocompleteChipsItem.prototype, "queryObject", {
1620
+ Object.defineProperty(RangeItem.prototype, "queryObject", {
1671
1621
  get: function () {
1672
1622
  var value = this.value;
1673
1623
  var name = this.name;
1674
1624
  var params = {};
1675
- if (Array.isArray(value)) {
1676
- params[this.name] = value
1677
- .filter(function (item) { return !!item.value; })
1678
- .map(function (item) { return item.value; })
1679
- .join(',');
1625
+ var paramMinName = getRangeName(this.case, name, 'min');
1626
+ var paramMaxName = getRangeName(this.case, name, 'max');
1627
+ if (lodashEs.isObject(value)) {
1628
+ params[paramMinName] = value.min || undefined;
1629
+ params[paramMaxName] = value.max || undefined;
1680
1630
  }
1681
1631
  else {
1682
- params[name] = value;
1632
+ params[paramMinName] = undefined;
1633
+ params[paramMaxName] = undefined;
1683
1634
  }
1684
1635
  return params;
1685
1636
  },
1686
1637
  enumerable: false,
1687
1638
  configurable: true
1688
1639
  });
1689
- Object.defineProperty(AutocompleteChipsItem.prototype, "isChipVisible", {
1640
+ Object.defineProperty(RangeItem.prototype, "isChipVisible", {
1690
1641
  get: function () {
1691
- return Array.isArray(this.model) && this.model.length > 0;
1642
+ return this.model && (this.model.min !== undefined || this.model.max !== undefined);
1692
1643
  },
1693
1644
  enumerable: false,
1694
1645
  configurable: true
1695
1646
  });
1696
- AutocompleteChipsItem.prototype.getChipsContent = function () {
1697
- return this.model
1698
- .reduce(function (acc, i) {
1699
- acc.push(i.name);
1700
- return acc;
1701
- }, [])
1702
- .join(', ');
1647
+ RangeItem.prototype.getChipsContent = function (type) {
1648
+ if (type === 'from') {
1649
+ var min = this.model.min;
1650
+ return "" + min;
1651
+ }
1652
+ else if (type === 'to') {
1653
+ var max = this.model.max;
1654
+ return "" + max;
1655
+ }
1703
1656
  };
1704
- AutocompleteChipsItem.prototype._init = function () {
1705
- if (this.model === undefined) {
1706
- this._model = [];
1657
+ RangeItem.prototype.clearRange = function (type, defaultValue) {
1658
+ if (type === void 0) { type = null; }
1659
+ if (defaultValue === void 0) { defaultValue = undefined; }
1660
+ if (type === 'from') {
1661
+ delete this.model.min;
1662
+ if (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.min) {
1663
+ this.model.min = defaultValue.min;
1664
+ }
1665
+ this.model = Object.assign({}, this.model);
1666
+ }
1667
+ else if (type === 'to') {
1668
+ delete this.model.max;
1669
+ if (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.max) {
1670
+ this.model.max = defaultValue.max;
1671
+ }
1672
+ this.model = Object.assign({}, this.model);
1673
+ }
1674
+ else {
1675
+ this.model = defaultValue ? Object.assign({}, defaultValue) : {};
1707
1676
  }
1708
1677
  };
1709
- AutocompleteChipsItem.prototype._parseConfig = function (item) {
1710
- var _a;
1711
- this.chipImage = (_a = item.chipImage) !== null && _a !== void 0 ? _a : 'image';
1712
- this.chipIcon = item.chipIcon;
1713
- this.chipIconColor = item.chipIconColor;
1714
- this.chipColor = item.chipColor;
1715
- this.chipBackground = item.chipBackground;
1716
- this.chipClass = item.chipClass;
1717
- _super.prototype._parseConfig.call(this, item);
1678
+ RangeItem.prototype._validateModel = function () {
1718
1679
  };
1719
- AutocompleteChipsItem.prototype._clearValue = function (defaultValue) {
1720
- if (defaultValue === void 0) { defaultValue = undefined; }
1721
- this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : [];
1722
- this.search = '';
1680
+ RangeItem.prototype._parseConfig = function (item) {
1681
+ var _a, _b;
1682
+ this.options = item.options;
1683
+ this.prefix = item.prefix;
1684
+ this.suffix = item.suffix;
1685
+ this.case = (_b = (_a = this._additionalConfig) === null || _a === void 0 ? void 0 : _a.case) !== null && _b !== void 0 ? _b : 'camel';
1686
+ _super.prototype._parseConfig.call(this, item);
1723
1687
  };
1724
- AutocompleteChipsItem.prototype._setModel = function (value) {
1725
- _super.prototype._setModel.call(this, value || []);
1688
+ RangeItem.prototype._init = function () {
1689
+ if (!this.label) {
1690
+ this.label = ['Min', 'Max'];
1691
+ }
1692
+ if (!this.model) {
1693
+ this.model = this.defaultValue || {};
1694
+ }
1726
1695
  };
1727
- return AutocompleteChipsItem;
1728
- }(BaseAutocompleteItem));
1696
+ return RangeItem;
1697
+ }(BaseItem));
1729
1698
 
1730
- var CheckboxItem = /** @class */ (function (_super) {
1731
- __extends(CheckboxItem, _super);
1732
- function CheckboxItem() {
1733
- return _super !== null && _super.apply(this, arguments) || this;
1699
+ function findValue(values, value, children) {
1700
+ for (var i = 0; i < values.length; i++) {
1701
+ var val = values[i];
1702
+ if (val[children]) {
1703
+ return findValue(val[children], value, children);
1704
+ }
1705
+ if (val.value === value) {
1706
+ return val;
1707
+ }
1734
1708
  }
1735
- CheckboxItem.create = function (config) {
1736
- return new CheckboxItem(config, null);
1737
- };
1738
- Object.defineProperty(CheckboxItem.prototype, "isTypeCheckbox", {
1739
- get: function () {
1740
- return true;
1741
- },
1742
- enumerable: false,
1743
- configurable: true
1744
- });
1745
- Object.defineProperty(CheckboxItem.prototype, "isChipVisible", {
1709
+ return undefined;
1710
+ }
1711
+
1712
+ var SimpleSelectItem = /** @class */ (function (_super) {
1713
+ __extends(SimpleSelectItem, _super);
1714
+ function SimpleSelectItem(itemConfig, _persistedValues, _filter) {
1715
+ return _super.call(this, itemConfig, _persistedValues, _filter) || this;
1716
+ }
1717
+ Object.defineProperty(SimpleSelectItem.prototype, "value", {
1746
1718
  get: function () {
1747
- return this.value === this.checked;
1719
+ var value = this.model;
1720
+ if (value === '__all' || value === undefined) {
1721
+ value = undefined;
1722
+ }
1723
+ return value;
1748
1724
  },
1749
1725
  enumerable: false,
1750
1726
  configurable: true
1751
1727
  });
1752
- Object.defineProperty(CheckboxItem.prototype, "value", {
1728
+ SimpleSelectItem.prototype.getChipsContent = function (type) {
1729
+ var _this = this;
1730
+ if (type === void 0) { type = null; }
1731
+ if (this.children) {
1732
+ var itemValue_1 = findValue(this.values, this.model, this.children);
1733
+ return itemValue_1 && itemValue_1.name;
1734
+ }
1735
+ var itemValue = this.values.find(function (val) { return val.value === _this.model; });
1736
+ if (itemValue) {
1737
+ return itemValue.name;
1738
+ }
1739
+ else if (this.isolate) {
1740
+ return this.isolate.label;
1741
+ }
1742
+ };
1743
+ Object.defineProperty(SimpleSelectItem.prototype, "isChipVisible", {
1753
1744
  get: function () {
1754
- var value = this.model ? this.checked : this.unchecked;
1755
- if (!value) {
1756
- return undefined;
1757
- }
1758
- return value;
1745
+ return this.model !== '__all' && this.model !== undefined;
1759
1746
  },
1760
1747
  enumerable: false,
1761
1748
  configurable: true
1762
1749
  });
1763
- Object.defineProperty(CheckboxItem.prototype, "queryObject", {
1750
+ SimpleSelectItem.prototype._init = function () {
1751
+ _super.prototype._init.call(this);
1752
+ if (this.model === undefined && this.defaultValue === undefined) {
1753
+ this._model = '__all';
1754
+ }
1755
+ };
1756
+ Object.defineProperty(SimpleSelectItem.prototype, "isolateOptionNotSelected", {
1764
1757
  get: function () {
1765
- var value = this.value;
1766
- var name = this.name;
1767
- var params = {};
1768
- params[name] = this.model ? value : undefined;
1769
- return params;
1758
+ var modelValue = this.model;
1759
+ var isolate = this.isolate;
1760
+ return isolate && !isolate.enabled && (modelValue === null || modelValue === void 0 ? void 0 : modelValue.length) === 0;
1770
1761
  },
1771
1762
  enumerable: false,
1772
1763
  configurable: true
1773
1764
  });
1774
- CheckboxItem.prototype.getChipsContent = function (type) {
1775
- if (type === void 0) { type = null; }
1776
- return this.label;
1777
- };
1778
- CheckboxItem.prototype._validateModel = function () { };
1779
- CheckboxItem.prototype._parseConfig = function (item) {
1780
- this.checked = item.checked;
1781
- this.unchecked = item.unchecked;
1782
- this.checked = item.checked ? lodashEs.toString(item.checked) : true;
1783
- this.unchecked = item.unchecked ? lodashEs.toString(item.unchecked) : false;
1784
- this.defaultValue = item.default === undefined ? this.unchecked : lodashEs.toString(this.defaultValue);
1785
- _super.prototype._parseConfig.call(this, item);
1765
+ SimpleSelectItem.prototype._setModel = function (value) {
1766
+ if (value) {
1767
+ if (!isNaN(value)) {
1768
+ value = +value;
1769
+ }
1770
+ }
1771
+ _super.prototype._setModel.call(this, value);
1786
1772
  };
1787
- CheckboxItem.prototype._init = function () {
1788
- if (this.model === undefined) {
1789
- this._model = this.checked == this.defaultValue;
1773
+ SimpleSelectItem.prototype._validateModel = function () {
1774
+ var _this = this;
1775
+ var item = this.values.find(function (value) {
1776
+ return value.value == _this.model;
1777
+ });
1778
+ var value = item ? item.value : '__all';
1779
+ if (this._model !== value) {
1780
+ this.model = value;
1790
1781
  }
1791
1782
  };
1792
- CheckboxItem.prototype._clearValue = function (defaultValue) {
1783
+ SimpleSelectItem.prototype._clearValue = function (defaultValue) {
1793
1784
  if (defaultValue === void 0) { defaultValue = undefined; }
1794
- this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : false;
1785
+ _super.prototype._clearValue.call(this, defaultValue);
1786
+ var value = Array.isArray(this.values) && this.values.some(function (val) { return val.value === '__all'; })
1787
+ ? '__all'
1788
+ : undefined;
1789
+ this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
1795
1790
  };
1796
- return CheckboxItem;
1797
- }(BaseItem));
1791
+ return SimpleSelectItem;
1792
+ }(BaseSelectItem));
1793
+
1794
+ var SelectItem = /** @class */ (function () {
1795
+ function SelectItem() {
1796
+ }
1797
+ SelectItem.create = function (config, filter) {
1798
+ if (config.multiple) {
1799
+ return new MultipleSelectItem(config, null, filter);
1800
+ }
1801
+ return new SimpleSelectItem(config, null, filter);
1802
+ };
1803
+ return SelectItem;
1804
+ }());
1798
1805
 
1799
1806
  var TextItem = /** @class */ (function (_super) {
1800
1807
  __extends(TextItem, _super);
1801
1808
  function TextItem() {
1802
1809
  return _super !== null && _super.apply(this, arguments) || this;
1803
1810
  }
1804
- TextItem.create = function (config) {
1805
- return new TextItem(config, null);
1811
+ TextItem.create = function (config, filter) {
1812
+ return new TextItem(config, null, filter);
1806
1813
  };
1807
1814
  Object.defineProperty(TextItem.prototype, "value", {
1808
1815
  get: function () {
@@ -1825,13 +1832,17 @@
1825
1832
  TextItem.prototype.getChipsContent = function () {
1826
1833
  return this.model;
1827
1834
  };
1828
- TextItem.prototype._validateModel = function () { };
1835
+ TextItem.prototype._validateModel = function () {
1836
+ //
1837
+ };
1829
1838
  TextItem.prototype._parseConfig = function (item) {
1830
1839
  this.prefix = item.prefix;
1831
1840
  this.suffix = item.suffix;
1832
1841
  _super.prototype._parseConfig.call(this, item);
1833
1842
  };
1834
- TextItem.prototype._init = function () { };
1843
+ TextItem.prototype._init = function () {
1844
+ //
1845
+ };
1835
1846
  TextItem.prototype._clearValue = function (defaultValue) {
1836
1847
  if (defaultValue === void 0) { defaultValue = undefined; }
1837
1848
  this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : '';
@@ -1851,8 +1862,8 @@
1851
1862
  function WeekItem() {
1852
1863
  return _super !== null && _super.apply(this, arguments) || this;
1853
1864
  }
1854
- WeekItem.create = function (config) {
1855
- return new WeekItem(config, null);
1865
+ WeekItem.create = function (config, filter) {
1866
+ return new WeekItem(config, null, filter);
1856
1867
  };
1857
1868
  Object.defineProperty(WeekItem.prototype, "value", {
1858
1869
  get: function () {
@@ -1885,12 +1896,7 @@
1885
1896
  }
1886
1897
  }
1887
1898
  if (period) {
1888
- if (lodashEs.isString(period)) {
1889
- value.period = parseInt(period, 10);
1890
- }
1891
- else {
1892
- value.period = period;
1893
- }
1899
+ value.period = lodashEs.isString(period) ? parseInt(period, 10) : period;
1894
1900
  }
1895
1901
  return value;
1896
1902
  },
@@ -1958,44 +1964,44 @@
1958
1964
  return WeekItem;
1959
1965
  }(BaseItem));
1960
1966
 
1961
- function createFilterItem(item, config) {
1967
+ function createFilterItem(item, config, filter) {
1962
1968
  switch (item.type) {
1963
1969
  case exports.ItemType.Select: {
1964
- return SelectItem.create(item);
1970
+ return SelectItem.create(item, filter);
1965
1971
  }
1966
1972
  case exports.ItemType.Chips: {
1967
- return ChipsItem.create(item);
1973
+ return ChipsItem.create(item, filter);
1968
1974
  }
1969
1975
  case exports.ItemType.Range: {
1970
- return RangeItem.create(item, config);
1976
+ return RangeItem.create(item, config, filter);
1971
1977
  }
1972
1978
  case exports.ItemType.DateRange: {
1973
- return DateRangeItem.create(item);
1979
+ return DateRangeItem.create(item, filter);
1974
1980
  }
1975
1981
  case exports.ItemType.DateTimeRange: {
1976
- return DateTimeRangeItem.create(item);
1982
+ return DateTimeRangeItem.create(item, filter);
1977
1983
  }
1978
1984
  case exports.ItemType.Date: {
1979
- return DateItem.create(item);
1985
+ return DateItem.create(item, filter);
1980
1986
  }
1981
1987
  case exports.ItemType.Week: {
1982
- return WeekItem.create(item);
1988
+ return WeekItem.create(item, filter);
1983
1989
  }
1984
1990
  case exports.ItemType.DateTime: {
1985
- return DateTimeItem.create(item);
1991
+ return DateTimeItem.create(item, filter);
1986
1992
  }
1987
1993
  case exports.ItemType.AutoComplete: {
1988
- return AutocompleteItem.create(item);
1994
+ return AutocompleteItem.create(item, filter);
1989
1995
  }
1990
1996
  case exports.ItemType.AutoCompleteChips: {
1991
- return AutocompleteChipsItem.create(item);
1997
+ return AutocompleteChipsItem.create(item, filter);
1992
1998
  }
1993
1999
  case exports.ItemType.Checkbox: {
1994
- return CheckboxItem.create(item);
2000
+ return CheckboxItem.create(item, filter);
1995
2001
  }
1996
2002
  case exports.ItemType.Keyword:
1997
2003
  case exports.ItemType.Text: {
1998
- return TextItem.create(item);
2004
+ return TextItem.create(item, filter);
1999
2005
  }
2000
2006
  }
2001
2007
  }
@@ -2218,10 +2224,9 @@
2218
2224
  (_a = this.keywordItem) === null || _a === void 0 ? void 0 : _a.clear();
2219
2225
  };
2220
2226
  FsFilterItemsStore.prototype.loadAsyncValues = function () {
2221
- var _this = this;
2222
2227
  this.items
2223
2228
  .filter(function (item) { return item.hasPendingValues; })
2224
- .forEach(function (item) { return item.loadAsyncValues(_this.filter); });
2229
+ .forEach(function (item) { return item.loadAsyncValues(); });
2225
2230
  };
2226
2231
  FsFilterItemsStore.prototype.loadAsyncDefaults = function () {
2227
2232
  var _this = this;
@@ -2242,7 +2247,7 @@
2242
2247
  rxjs.forkJoin(__spreadArray(__spreadArray([], __read(defaultValuesToBeLoaded
2243
2248
  .map(function (item) { return item.loadDefaultValue(); }))), __read(valuesToBeLoaded
2244
2249
  .map(function (item) {
2245
- item.loadAsyncValues(_this.filter);
2250
+ item.loadAsyncValues();
2246
2251
  return item.loading$
2247
2252
  .pipe();
2248
2253
  }))))
@@ -2306,10 +2311,9 @@
2306
2311
  return params;
2307
2312
  };
2308
2313
  FsFilterItemsStore.prototype.init = function (p) {
2309
- var _this = this;
2310
2314
  this.items
2311
2315
  .forEach(function (item) {
2312
- item.initValues(_this.filter, p[item.name]);
2316
+ item.initValues(p[item.name]);
2313
2317
  });
2314
2318
  this._initSortingItems(p);
2315
2319
  this.loadAsyncDefaults();
@@ -2377,7 +2381,7 @@
2377
2381
  }
2378
2382
  })
2379
2383
  .map(function (item) {
2380
- var filterItem = createFilterItem(item, { case: _this._config.case });
2384
+ var filterItem = createFilterItem(item, { case: _this._config.case }, _this.filter);
2381
2385
  if (filterItem.type === exports.ItemType.Keyword) {
2382
2386
  _this._hasKeyword = true;
2383
2387
  }
@@ -2421,8 +2425,8 @@
2421
2425
  };
2422
2426
  FsFilterItemsStore.prototype._initSortingItems = function (p) {
2423
2427
  if (this.sortByItem && this.sortDirectionItem) {
2424
- this.sortByItem.initValues(this.filter, p[this.sortByItem.name]);
2425
- this.sortDirectionItem.initValues(this.filter, p[this.sortDirectionItem.name]);
2428
+ this.sortByItem.initValues(p[this.sortByItem.name]);
2429
+ this.sortDirectionItem.initValues(p[this.sortDirectionItem.name]);
2426
2430
  }
2427
2431
  };
2428
2432
  FsFilterItemsStore.prototype._createSortingItems = function () {
@@ -2437,7 +2441,7 @@
2437
2441
  if (this._config.sort && this._config.sort.value) {
2438
2442
  sortByItem.default = this._config.sort.value;
2439
2443
  }
2440
- this.sortByItem = new SimpleSelectItem(sortByItem, null);
2444
+ this.sortByItem = new SimpleSelectItem(sortByItem, null, this.filter);
2441
2445
  var sortDirectionItem = {
2442
2446
  name: SORT_DIRECTION_FIELD,
2443
2447
  type: exports.ItemType.Select,
@@ -2450,7 +2454,7 @@
2450
2454
  if (this._config.sort && this._config.sort.direction) {
2451
2455
  sortDirectionItem.default = this._config.sort.direction;
2452
2456
  }
2453
- this.sortDirectionItem = new SimpleSelectItem(sortDirectionItem, null);
2457
+ this.sortDirectionItem = new SimpleSelectItem(sortDirectionItem, null, this.filter);
2454
2458
  }
2455
2459
  };
2456
2460
  FsFilterItemsStore.prototype._setKeywordItem = function () {
@@ -3016,7 +3020,6 @@
3016
3020
  };
3017
3021
  ExternalParamsController.prototype.initItems = function () {
3018
3022
  var _this = this;
3019
- this._itemsStore.ready$;
3020
3023
  this._pending$.next(true);
3021
3024
  if (this._savedFilters.enabled) {
3022
3025
  this._savedFilters
@@ -3088,7 +3091,7 @@
3088
3091
  var params = buildQueryParams(this._itemsStore.valuesAsQuery({
3089
3092
  onlyPresented: false,
3090
3093
  items: targetItems,
3091
- persisted: true
3094
+ persisted: true,
3092
3095
  }), targetItems);
3093
3096
  this._queryParams.writeStateToQueryParams(params);
3094
3097
  };
@@ -3098,7 +3101,7 @@
3098
3101
  var params = buildQueryParams(this._itemsStore.valuesAsQuery({
3099
3102
  onlyPresented: false,
3100
3103
  items: targetItems,
3101
- persisted: true
3104
+ persisted: true,
3102
3105
  }), targetItems);
3103
3106
  this._persistanceStore.save(params);
3104
3107
  };
@@ -3306,7 +3309,7 @@
3306
3309
  this.listenValueChangesForRanges();
3307
3310
  this._updateVisibility();
3308
3311
  if (this.item.hasPendingValues) {
3309
- this.item.loadAsyncValues(null, false);
3312
+ this.item.loadAsyncValues(false);
3310
3313
  this.item.values$
3311
3314
  .pipe(operators.take(2), operators.takeUntil(this._destroy$))
3312
3315
  .subscribe(function () {
@@ -3422,12 +3425,13 @@
3422
3425
  return FsFilterDrawerActionsComponent;
3423
3426
  }());
3424
3427
  FsFilterDrawerActionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterDrawerActionsComponent, deps: [{ token: ExternalParamsController }], target: i0__namespace.ɵɵFactoryTarget.Component });
3425
- FsFilterDrawerActionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0__namespace, 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__namespace$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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe } });
3428
+ FsFilterDrawerActionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0__namespace, 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__namespace$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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3426
3429
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterDrawerActionsComponent, decorators: [{
3427
3430
  type: i0.Component,
3428
3431
  args: [{
3429
3432
  selector: 'fs-filter-drawer-actions',
3430
3433
  templateUrl: './filter-drawer-actions.component.html',
3434
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3431
3435
  }]
3432
3436
  }], ctorParameters: function () { return [{ type: ExternalParamsController }]; }, propDecorators: { _clear: [{
3433
3437
  type: i0.Output,
@@ -3492,7 +3496,7 @@
3492
3496
  return BaseItemComponent;
3493
3497
  }());
3494
3498
  BaseItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BaseItemComponent, deps: [{ token: i0__namespace.KeyValueDiffers }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
3495
- BaseItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline", filter: "filter" }, usesOnChanges: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3499
+ BaseItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, usesOnChanges: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3496
3500
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BaseItemComponent, decorators: [{
3497
3501
  type: i0.Component,
3498
3502
  args: [{
@@ -3504,8 +3508,6 @@
3504
3508
  type: i0.Input
3505
3509
  }], inline: [{
3506
3510
  type: i0.Input
3507
- }], filter: [{
3508
- type: i0.Input
3509
3511
  }] } });
3510
3512
 
3511
3513
  var FocusToItemDirective = /** @class */ (function () {
@@ -3944,7 +3946,7 @@
3944
3946
  return data ? data.name : data;
3945
3947
  };
3946
3948
  _this.fetch = function (keyword) {
3947
- return _this.item.valuesFn(keyword, _this.filter);
3949
+ return _this.item.valuesFn(keyword, _this.item.filter);
3948
3950
  };
3949
3951
  return _this;
3950
3952
  }
@@ -3968,7 +3970,7 @@
3968
3970
  _this._kvDiffers = _kvDiffers;
3969
3971
  _this._cd = _cd;
3970
3972
  _this.fetch = function (keyword) {
3971
- return _this.item.valuesFn(keyword, _this.filter);
3973
+ return _this.item.valuesFn(keyword, _this.item.filter);
3972
3974
  };
3973
3975
  return _this;
3974
3976
  }
@@ -4225,7 +4227,7 @@
4225
4227
  return FilterItemComponent;
4226
4228
  }());
4227
4229
  FilterItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterItemComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
4228
- FilterItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item", filter: "filter" }, ngImport: i0__namespace, 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]=\"filter\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"autocompleteChipsItem\"\n [filter]=\"filter\">\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__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4230
+ FilterItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item" }, ngImport: i0__namespace, 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__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4229
4231
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterItemComponent, decorators: [{
4230
4232
  type: i0.Component,
4231
4233
  args: [{
@@ -4235,23 +4237,20 @@
4235
4237
  }]
4236
4238
  }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { item: [{
4237
4239
  type: i0.Input
4238
- }], filter: [{
4239
- type: i0.Input
4240
4240
  }] } });
4241
4241
 
4242
4242
  var FilterDrawerComponent = /** @class */ (function () {
4243
- function FilterDrawerComponent(externalParams, _cd, _itemsStore, _overlayRef, _data) {
4243
+ function FilterDrawerComponent(_overlayRef, _data, externalParams, _cd, _itemsStore) {
4244
+ this._overlayRef = _overlayRef;
4245
+ this._data = _data;
4244
4246
  this.externalParams = externalParams;
4245
4247
  this._cd = _cd;
4246
4248
  this._itemsStore = _itemsStore;
4247
- this._overlayRef = _overlayRef;
4248
- this._data = _data;
4249
4249
  this.inline = false;
4250
4250
  this.windowDesktop = false;
4251
4251
  this._itemsStore.prepareItems();
4252
- this._clear = _data.clear;
4253
- this._done = _data.done;
4254
- this.filter = _data.filter;
4252
+ this._clear = this._data.clear;
4253
+ this._done = this._data.done;
4255
4254
  this.updateWindowWidth();
4256
4255
  }
4257
4256
  FilterDrawerComponent.prototype.updateWindowWidth = function () {
@@ -4291,8 +4290,8 @@
4291
4290
  };
4292
4291
  return FilterDrawerComponent;
4293
4292
  }());
4294
- FilterDrawerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterDrawerComponent, deps: [{ token: ExternalParamsController }, { token: i0__namespace.ChangeDetectorRef }, { token: FsFilterItemsStore }, { token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }], target: i0__namespace.ɵɵFactoryTarget.Component });
4295
- FilterDrawerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0__namespace, 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]=\"filter\">\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]=\"filter\">\n </filter-item>\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortDirectionItem\"\n [filter]=\"filter\">\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__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FilterItemComponent, selector: "filter-item", inputs: ["item", "filter"] }, { type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: ["clear", "done"] }], directives: [{ type: i6__namespace$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4293
+ FilterDrawerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterDrawerComponent, deps: [{ token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }, { token: ExternalParamsController }, { token: i0__namespace.ChangeDetectorRef }, { token: FsFilterItemsStore }], target: i0__namespace.ɵɵFactoryTarget.Component });
4294
+ FilterDrawerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0__namespace, 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__namespace$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__namespace$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4296
4295
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterDrawerComponent, decorators: [{
4297
4296
  type: i0.Component,
4298
4297
  args: [{
@@ -4302,13 +4301,13 @@
4302
4301
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
4303
4302
  }]
4304
4303
  }], ctorParameters: function () {
4305
- return [{ type: ExternalParamsController }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFilterItemsStore }, { type: i1__namespace$6.OverlayRef, decorators: [{
4304
+ return [{ type: i1__namespace$6.OverlayRef, decorators: [{
4306
4305
  type: i0.Inject,
4307
4306
  args: [FILTER_DRAWER_OVERLAY]
4308
4307
  }] }, { type: undefined, decorators: [{
4309
4308
  type: i0.Inject,
4310
4309
  args: [FILTER_DRAWER_DATA]
4311
- }] }];
4310
+ }] }, { type: ExternalParamsController }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFilterItemsStore }];
4312
4311
  }, propDecorators: { inline: [{
4313
4312
  type: i0.Input
4314
4313
  }], updateWindowWidth: [{
@@ -4752,7 +4751,6 @@
4752
4751
  var data = {
4753
4752
  done: this._doneFn,
4754
4753
  clear: this._clearFn,
4755
- filter: this.filter,
4756
4754
  };
4757
4755
  var injector = this._createInjector(this._injector, data, this._overlayRef);
4758
4756
  var containerPortal = new portal.ComponentPortal(FilterDrawerComponent, undefined, injector);
@@ -4844,7 +4842,6 @@
4844
4842
  this._keyword$ = new rxjs.Subject();
4845
4843
  this._destroy$ = new rxjs.Subject();
4846
4844
  this._filterItems.filter = this;
4847
- this._filterOverlay.filter = this;
4848
4845
  this._listenWhenFilterReady();
4849
4846
  this._updateWindowWidth();
4850
4847
  this._filterOverlay.attach$