@firestitch/filter 9.8.4 → 9.8.8

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.
@@ -11,4 +11,6 @@ export declare class TextComponent extends BaseItemComponent<TextItem> implement
11
11
  constructor(_kvDiffers: KeyValueDiffers, _cd: ChangeDetectorRef);
12
12
  ngOnInit(): void;
13
13
  ngOnDestroy(): void;
14
+ private _listenControlValueChanges;
15
+ private _listenModelChanges;
14
16
  }
@@ -1,3 +1,4 @@
1
+ import { IFilterConfigBaseItem } from './items/base.interface';
1
2
  import { IFilterConfigAutocompleteItem } from './items/autocomplete.interface';
2
3
  import { IFilterConfigDateItem } from './items/date.interface';
3
4
  import { IFilterConfigDateRangeItem } from './items/date-range.interface';
@@ -31,7 +32,7 @@ export interface FilterConfig {
31
32
  savedFilters?: IFilterSavedFiltersConfig;
32
33
  actions?: FsFilterAction[];
33
34
  }
34
- export declare type IFilterConfigItem = (IFilterConfigCheckboxItem | IFilterConfigSelectItem | IFilterConfigChipsItem | IFilterConfigTextItem | IFilterConfigDateItem | IFilterConfigAutocompleteItem | IFilterConfigAutocompleteChipsItem | IFilterConfigRangeItem | IFilterConfigDateRangeItem);
35
+ export declare type IFilterConfigItem = (IFilterConfigBaseItem | IFilterConfigCheckboxItem | IFilterConfigSelectItem | IFilterConfigChipsItem | IFilterConfigTextItem | IFilterConfigDateItem | IFilterConfigAutocompleteItem | IFilterConfigAutocompleteChipsItem | IFilterConfigRangeItem | IFilterConfigDateRangeItem);
35
36
  export interface SortItem {
36
37
  name: string;
37
38
  value: string;
@@ -1051,15 +1051,14 @@
1051
1051
  });
1052
1052
  Object.defineProperty(RangeItem.prototype, "queryObject", {
1053
1053
  get: function () {
1054
- var _a, _b;
1055
1054
  var value = this.value;
1056
1055
  var name = this.name;
1057
1056
  var params = {};
1058
1057
  var paramMinName = getRangeName(this.case, name, 'min');
1059
1058
  var paramMaxName = getRangeName(this.case, name, 'max');
1060
1059
  if (lodashEs.isObject(value)) {
1061
- params[paramMinName] = (_a = value.min) !== null && _a !== void 0 ? _a : null;
1062
- params[paramMaxName] = (_b = value.max) !== null && _b !== void 0 ? _b : null;
1060
+ params[paramMinName] = value.min || null;
1061
+ params[paramMaxName] = value.max || null;
1063
1062
  }
1064
1063
  else {
1065
1064
  params[paramMinName] = null;
@@ -1197,14 +1196,13 @@
1197
1196
  Object.defineProperty(BaseDateRangeItem.prototype, "queryObject", {
1198
1197
  get: function () {
1199
1198
  var _a;
1200
- var _b, _c;
1201
1199
  var value = this.value || {};
1202
1200
  var name = this.name;
1203
1201
  var paramFromName = getRangeName(this.case, name, 'from');
1204
1202
  var paramToName = getRangeName(this.case, name, 'to');
1205
1203
  return _a = {},
1206
- _a[paramFromName] = (_b = value.from) !== null && _b !== void 0 ? _b : null,
1207
- _a[paramToName] = (_c = value.to) !== null && _c !== void 0 ? _c : null,
1204
+ _a[paramFromName] = value.from || null,
1205
+ _a[paramToName] = value.to || null,
1208
1206
  _a;
1209
1207
  },
1210
1208
  enumerable: true,
@@ -3985,7 +3983,7 @@
3985
3983
  FilterComponent = __decorate([
3986
3984
  core.Component({
3987
3985
  selector: 'fs-filter',
3988
- template: "<ng-container *ngIf=\"hasKeyword; else noKeywordFilter\">\n <div class=\"filter-search-container\">\n <div class=\"filter-input-field\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field floatLabel=\"never\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n\n <input\n matInput\n [formControl]=\"searchText\"\n [placeholder]=\"searchPlaceholder\"\n name=\"filter-input\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <a matSuffix\n *ngIf=\"searchText.value && showFilterInput && config.clear\"\n (click)=\"clearSearchText($event)\"\n href=\"javascript:void(0)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n\n <a matSuffix\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </mat-form-field>\n </form>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n <div class=\"status-actions\" *ngIf=\"keywordVisible$ | async\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #noKeywordFilter>\n <div class=\"filter-searchless-container\">\n <div class=\"status-actions\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n</ng-template>\n\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting && filtersBtnVisible$ | async \">\n <button\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style == 'raised',\n 'mat-button': config.button.style == 'basic',\n 'mat-icon-button': config.button.style == 'icon'\n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n type=\"button\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </button>\n </ng-container>\n\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterChips>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n</ng-template>\n\n<ng-template #statusBarContainer>\n <div class=\"status-bar\" *ngIf=\"statusBar\">\n <small><ng-container *ngTemplateOutlet=\"statusBar\"></ng-container></small>\n </div>\n</ng-template>\n",
3986
+ template: "<ng-container *ngIf=\"hasKeyword; else noKeywordFilter\">\n <div class=\"filter-search-container\">\n <div class=\"filter-input-field\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field floatLabel=\"never\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n\n <input\n #searchTextInput\n matInput\n [formControl]=\"searchText\"\n [placeholder]=\"searchPlaceholder\"\n name=\"filter-input\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <a matSuffix\n *ngIf=\"searchText.value && showFilterInput && config.clear\"\n (click)=\"clearSearchText($event)\"\n href=\"javascript:void(0)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n\n <a matSuffix\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </mat-form-field>\n </form>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n <div class=\"status-actions\" *ngIf=\"keywordVisible$ | async\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #noKeywordFilter>\n <div class=\"filter-searchless-container\">\n <div class=\"status-actions\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n</ng-template>\n\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting && filtersBtnVisible$ | async \">\n <button\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style == 'raised',\n 'mat-button': config.button.style == 'basic',\n 'mat-icon-button': config.button.style == 'icon'\n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n type=\"button\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </button>\n </ng-container>\n\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterChips>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n</ng-template>\n\n<ng-template #statusBarContainer>\n <div class=\"status-bar\" *ngIf=\"statusBar\">\n <small><ng-container *ngTemplateOutlet=\"statusBar\"></ng-container></small>\n </div>\n</ng-template>\n",
3989
3987
  encapsulation: core.ViewEncapsulation.None,
3990
3988
  providers: [
3991
3989
  FsFilterOverlayService,
@@ -4323,17 +4321,28 @@
4323
4321
  return _this;
4324
4322
  }
4325
4323
  TextComponent.prototype.ngOnInit = function () {
4324
+ this._listenControlValueChanges();
4325
+ this._listenModelChanges();
4326
+ };
4327
+ TextComponent.prototype.ngOnDestroy = function () {
4328
+ this.destroy$.next();
4329
+ this.destroy$.complete();
4330
+ };
4331
+ TextComponent.prototype._listenControlValueChanges = function () {
4326
4332
  var _this = this;
4327
- this.textControl.setValue(this.item.model);
4328
4333
  this.textControl.valueChanges
4329
4334
  .pipe(operators.distinctUntilChanged(), operators.debounceTime(200), operators.takeUntil(this.destroy$))
4330
4335
  .subscribe(function (value) {
4331
4336
  _this.item.model = value;
4332
4337
  });
4333
4338
  };
4334
- TextComponent.prototype.ngOnDestroy = function () {
4335
- this.destroy$.next();
4336
- this.destroy$.complete();
4339
+ TextComponent.prototype._listenModelChanges = function () {
4340
+ var _this = this;
4341
+ this._item.value$
4342
+ .pipe(operators.takeUntil(this.destroy$))
4343
+ .subscribe(function () {
4344
+ _this.textControl.setValue(_this.item.model, { emitEvent: false });
4345
+ });
4337
4346
  };
4338
4347
  TextComponent.ctorParameters = function () { return [
4339
4348
  { type: core.KeyValueDiffers },