@firestitch/filter 12.8.1 → 12.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/firestitch-filter.umd.js +35 -34
- package/bundles/firestitch-filter.umd.js.map +1 -1
- package/esm2015/app/components/filter/filter.component.js +2 -1
- package/esm2015/app/components/filter-chips/filter-chips.component.js +2 -2
- package/esm2015/app/models/items/autocomplete-chips-item.js +2 -2
- package/esm2015/app/models/items/autocomplete-item.js +4 -5
- package/esm2015/app/models/items/base-item.js +2 -2
- package/esm2015/app/models/items/checkbox-item.js +3 -3
- package/esm2015/app/models/items/chips-item.js +3 -3
- package/esm2015/app/models/items/date/base-date-item.js +3 -3
- package/esm2015/app/models/items/date-item.js +2 -2
- package/esm2015/app/models/items/date-range/base-date-range-item.js +5 -5
- package/esm2015/app/models/items/date-time-item.js +2 -2
- package/esm2015/app/models/items/range-item.js +6 -6
- package/esm2015/app/models/items/select/multiple-select-item.js +2 -2
- package/esm2015/app/models/items/select/simple-select-item.js +3 -3
- package/esm2015/app/models/items/text-item.js +2 -2
- package/esm2015/app/models/items/week-item.js +7 -7
- package/esm2015/app/services/items-store.service.js +2 -2
- package/fesm2015/firestitch-filter.js +35 -34
- package/fesm2015/firestitch-filter.js.map +1 -1
- package/package.json +1 -1
|
@@ -316,7 +316,7 @@ class BaseItem {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
_clearValue(defaultValue = undefined) {
|
|
319
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue :
|
|
319
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -360,7 +360,7 @@ class SimpleSelectItem extends BaseSelectItem {
|
|
|
360
360
|
get value() {
|
|
361
361
|
let value = this.model;
|
|
362
362
|
if (value == '__all' || value === undefined) {
|
|
363
|
-
value =
|
|
363
|
+
value = undefined;
|
|
364
364
|
}
|
|
365
365
|
return value;
|
|
366
366
|
}
|
|
@@ -409,7 +409,7 @@ class SimpleSelectItem extends BaseSelectItem {
|
|
|
409
409
|
super._clearValue(defaultValue);
|
|
410
410
|
const value = Array.isArray(this.values) && this.values.some((val) => val.value === '__all')
|
|
411
411
|
? '__all'
|
|
412
|
-
:
|
|
412
|
+
: undefined;
|
|
413
413
|
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
@@ -528,7 +528,7 @@ class MultipleSelectItem extends BaseSelectItem {
|
|
|
528
528
|
value = (_a = this.values) === null || _a === void 0 ? void 0 : _a.map((v) => v.value);
|
|
529
529
|
}
|
|
530
530
|
else if (!Array.isArray(value) || value.length === 0 || value.indexOf('__all') > -1) {
|
|
531
|
-
value =
|
|
531
|
+
value = undefined;
|
|
532
532
|
}
|
|
533
533
|
return value;
|
|
534
534
|
}
|
|
@@ -625,7 +625,7 @@ class ChipsItem extends BaseItem {
|
|
|
625
625
|
get value() {
|
|
626
626
|
const value = clone(this.model);
|
|
627
627
|
if (Array.isArray(value) && value.length === 0) {
|
|
628
|
-
return
|
|
628
|
+
return undefined;
|
|
629
629
|
}
|
|
630
630
|
return value;
|
|
631
631
|
}
|
|
@@ -647,7 +647,7 @@ class ChipsItem extends BaseItem {
|
|
|
647
647
|
params[name] = value.join(',');
|
|
648
648
|
}
|
|
649
649
|
else {
|
|
650
|
-
params[name] =
|
|
650
|
+
params[name] = undefined;
|
|
651
651
|
}
|
|
652
652
|
return params;
|
|
653
653
|
}
|
|
@@ -714,7 +714,7 @@ class RangeItem extends BaseItem {
|
|
|
714
714
|
let value = clone(this.model);
|
|
715
715
|
if (!isObject(this.model) ||
|
|
716
716
|
(isEmpty(this.model.max, { zero: true }) && isEmpty(this.model.min, { zero: true }))) {
|
|
717
|
-
value =
|
|
717
|
+
value = undefined;
|
|
718
718
|
}
|
|
719
719
|
return value;
|
|
720
720
|
}
|
|
@@ -725,12 +725,12 @@ class RangeItem extends BaseItem {
|
|
|
725
725
|
const paramMinName = getRangeName(this.case, name, 'min');
|
|
726
726
|
const paramMaxName = getRangeName(this.case, name, 'max');
|
|
727
727
|
if (isObject(value)) {
|
|
728
|
-
params[paramMinName] = value.min ||
|
|
729
|
-
params[paramMaxName] = value.max ||
|
|
728
|
+
params[paramMinName] = value.min || undefined;
|
|
729
|
+
params[paramMaxName] = value.max || undefined;
|
|
730
730
|
}
|
|
731
731
|
else {
|
|
732
|
-
params[paramMinName] =
|
|
733
|
-
params[paramMaxName] =
|
|
732
|
+
params[paramMinName] = undefined;
|
|
733
|
+
params[paramMaxName] = undefined;
|
|
734
734
|
}
|
|
735
735
|
return params;
|
|
736
736
|
}
|
|
@@ -805,10 +805,10 @@ class BaseDateRangeItem extends BaseItem {
|
|
|
805
805
|
let value = clone(this.model);
|
|
806
806
|
if (!isObject(this.model) ||
|
|
807
807
|
(isEmpty(this.model.from, { zero: true }) && isEmpty(this.model.to, { zero: true }))) {
|
|
808
|
-
value =
|
|
808
|
+
value = undefined;
|
|
809
809
|
}
|
|
810
810
|
if (isEmpty(value, { zero: true })) {
|
|
811
|
-
return
|
|
811
|
+
return undefined;
|
|
812
812
|
}
|
|
813
813
|
let from = value.from;
|
|
814
814
|
let to = value.to;
|
|
@@ -837,8 +837,8 @@ class BaseDateRangeItem extends BaseItem {
|
|
|
837
837
|
const paramFromName = getRangeName(this.case, name, 'from');
|
|
838
838
|
const paramToName = getRangeName(this.case, name, 'to');
|
|
839
839
|
return {
|
|
840
|
-
[paramFromName]: value.from ||
|
|
841
|
-
[paramToName]: value.to ||
|
|
840
|
+
[paramFromName]: value.from || undefined,
|
|
841
|
+
[paramToName]: value.to || undefined,
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
844
|
get persistanceObject() {
|
|
@@ -944,7 +944,7 @@ class BaseDateItem extends BaseItem {
|
|
|
944
944
|
get value() {
|
|
945
945
|
const value = clone(this.model);
|
|
946
946
|
if (!value || !isValid(value) || !isDate(value)) {
|
|
947
|
-
return
|
|
947
|
+
return undefined;
|
|
948
948
|
}
|
|
949
949
|
return value;
|
|
950
950
|
}
|
|
@@ -958,7 +958,7 @@ class BaseDateItem extends BaseItem {
|
|
|
958
958
|
get persistanceObject() {
|
|
959
959
|
const value = this.queryObject[this.name];
|
|
960
960
|
return {
|
|
961
|
-
[this.name]: value ? simpleFormat(value) :
|
|
961
|
+
[this.name]: value ? simpleFormat(value) : undefined,
|
|
962
962
|
};
|
|
963
963
|
}
|
|
964
964
|
_validateModel() {
|
|
@@ -995,7 +995,7 @@ class DateItem extends BaseDateItem {
|
|
|
995
995
|
return format(this.model, dateFormat);
|
|
996
996
|
}
|
|
997
997
|
_clearValue(defaultValue = undefined) {
|
|
998
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue :
|
|
998
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
@@ -1004,7 +1004,7 @@ class DateTimeItem extends BaseDateItem {
|
|
|
1004
1004
|
return new DateTimeItem(config, null);
|
|
1005
1005
|
}
|
|
1006
1006
|
_clearValue(defaultValue = undefined) {
|
|
1007
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue :
|
|
1007
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
@@ -1027,8 +1027,8 @@ class AutocompleteItem extends BaseAutocompleteItem {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
get value() {
|
|
1029
1029
|
let value = clone(this.model);
|
|
1030
|
-
if (!this.model ||
|
|
1031
|
-
return
|
|
1030
|
+
if (!this.model || this.model.value === undefined) {
|
|
1031
|
+
return undefined;
|
|
1032
1032
|
}
|
|
1033
1033
|
value = this.model.value;
|
|
1034
1034
|
return value;
|
|
@@ -1045,7 +1045,7 @@ class AutocompleteItem extends BaseAutocompleteItem {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
_init() { }
|
|
1047
1047
|
_clearValue(defaultValue = undefined) {
|
|
1048
|
-
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue :
|
|
1048
|
+
this.model = defaultValue !== null && defaultValue !== void 0 ? defaultValue : undefined;
|
|
1049
1049
|
this.search = '';
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
@@ -1056,7 +1056,7 @@ class AutocompleteChipsItem extends BaseAutocompleteItem {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
get value() {
|
|
1058
1058
|
if (Array.isArray(this.model) && this.model.length === 0) {
|
|
1059
|
-
return
|
|
1059
|
+
return undefined;
|
|
1060
1060
|
}
|
|
1061
1061
|
return clone(this.model);
|
|
1062
1062
|
}
|
|
@@ -1123,7 +1123,7 @@ class CheckboxItem extends BaseItem {
|
|
|
1123
1123
|
get value() {
|
|
1124
1124
|
const value = this.model ? this.checked : this.unchecked;
|
|
1125
1125
|
if (!value) {
|
|
1126
|
-
return
|
|
1126
|
+
return undefined;
|
|
1127
1127
|
}
|
|
1128
1128
|
return value;
|
|
1129
1129
|
}
|
|
@@ -1131,7 +1131,7 @@ class CheckboxItem extends BaseItem {
|
|
|
1131
1131
|
const value = this.value;
|
|
1132
1132
|
const name = this.name;
|
|
1133
1133
|
const params = {};
|
|
1134
|
-
params[name] = this.model ? value :
|
|
1134
|
+
params[name] = this.model ? value : undefined;
|
|
1135
1135
|
return params;
|
|
1136
1136
|
}
|
|
1137
1137
|
getChipsContent(type = null) {
|
|
@@ -1161,7 +1161,7 @@ class TextItem extends BaseItem {
|
|
|
1161
1161
|
return new TextItem(config, null);
|
|
1162
1162
|
}
|
|
1163
1163
|
get value() {
|
|
1164
|
-
return !!this.model ? this.model :
|
|
1164
|
+
return !!this.model ? this.model : undefined;
|
|
1165
1165
|
}
|
|
1166
1166
|
get queryObject() {
|
|
1167
1167
|
const value = this.value;
|
|
@@ -1200,10 +1200,10 @@ class WeekItem extends BaseItem {
|
|
|
1200
1200
|
let value = clone(this.model);
|
|
1201
1201
|
if (!isObject(this.model) ||
|
|
1202
1202
|
(isEmpty(this.model.from, { zero: true }) && isEmpty(this.model.to, { zero: true }))) {
|
|
1203
|
-
value =
|
|
1203
|
+
value = undefined;
|
|
1204
1204
|
}
|
|
1205
1205
|
if (isEmpty(value, { zero: true })) {
|
|
1206
|
-
return
|
|
1206
|
+
return undefined;
|
|
1207
1207
|
}
|
|
1208
1208
|
let from = value.from;
|
|
1209
1209
|
let to = value.to;
|
|
@@ -1242,9 +1242,9 @@ class WeekItem extends BaseItem {
|
|
|
1242
1242
|
const paramToName = getRangeName('camel', name, 'to');
|
|
1243
1243
|
const paramPeriodName = `${name}Period`;
|
|
1244
1244
|
return {
|
|
1245
|
-
[paramFromName]: (value === null || value === void 0 ? void 0 : value.from) ||
|
|
1246
|
-
[paramToName]: (value === null || value === void 0 ? void 0 : value.to) ||
|
|
1247
|
-
[paramPeriodName]: (value === null || value === void 0 ? void 0 : value.period) ||
|
|
1245
|
+
[paramFromName]: (value === null || value === void 0 ? void 0 : value.from) || undefined,
|
|
1246
|
+
[paramToName]: (value === null || value === void 0 ? void 0 : value.to) || undefined,
|
|
1247
|
+
[paramPeriodName]: (value === null || value === void 0 ? void 0 : value.period) || undefined,
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
1250
|
get persistanceObject() {
|
|
@@ -1269,7 +1269,7 @@ class WeekItem extends BaseItem {
|
|
|
1269
1269
|
if (value) {
|
|
1270
1270
|
value.from = parseDate(value.from);
|
|
1271
1271
|
value.to = parseDate(value.to);
|
|
1272
|
-
value.period = parseInt(value.period, 10) ||
|
|
1272
|
+
value.period = parseInt(value.period, 10) || undefined;
|
|
1273
1273
|
}
|
|
1274
1274
|
super._setModel(value);
|
|
1275
1275
|
}
|
|
@@ -1493,7 +1493,7 @@ class FsFilterItemsStore {
|
|
|
1493
1493
|
});
|
|
1494
1494
|
if (onlyPresented) {
|
|
1495
1495
|
return pickBy(params, (val) => {
|
|
1496
|
-
return val !==
|
|
1496
|
+
return val !== void 0;
|
|
1497
1497
|
});
|
|
1498
1498
|
}
|
|
1499
1499
|
return params;
|
|
@@ -3669,7 +3669,7 @@ class FsFilterChipsComponent {
|
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
3671
|
FsFilterChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3672
|
-
FsFilterChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: { filters: "filters" }, ngImport: i0, template: "<fs-chips [(ngModel)]=\"chips\">\n <ng-container *ngFor=\"let item of filters\">\n <ng-container *ngIf=\"(item.value$ | async) !==
|
|
3672
|
+
FsFilterChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: { filters: "filters" }, ngImport: i0, template: "<fs-chips [(ngModel)]=\"chips\">\n <ng-container *ngFor=\"let item of filters\">\n <ng-container *ngIf=\"(item.value$ | async) !== undefined\">\n <fs-filter-chip [item]=\"item\"></fs-filter-chip>\n </ng-container>\n </ng-container>\n</fs-chips>\n", styles: [""], components: [{ type: i2$1.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: FsFilterChipComponent, selector: "fs-filter-chip", inputs: ["item"] }], directives: [{ type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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 });
|
|
3673
3673
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipsComponent, decorators: [{
|
|
3674
3674
|
type: Component,
|
|
3675
3675
|
args: [{
|
|
@@ -4005,6 +4005,7 @@ class FilterComponent {
|
|
|
4005
4005
|
* Call change callback and apply new filter values
|
|
4006
4006
|
*/
|
|
4007
4007
|
change() {
|
|
4008
|
+
debugger;
|
|
4008
4009
|
const data = this._filterItems.valuesAsQuery();
|
|
4009
4010
|
const sort = this._filterItems.getSort();
|
|
4010
4011
|
const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
|