@firestitch/filter 9.9.0 → 9.9.5

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.
@@ -68,7 +68,7 @@ function findValue(values, value, children) {
68
68
  var BaseItem = /** @class */ (function () {
69
69
  function BaseItem(itemConfig, _additionalConfig) {
70
70
  this._additionalConfig = _additionalConfig;
71
- this._initialized = false;
71
+ // protected _initialized = false;
72
72
  this._pendingValues = false;
73
73
  this._pendingDefaultValue = false;
74
74
  this._loading$ = new BehaviorSubject(false);
@@ -267,6 +267,13 @@ var BaseItem = /** @class */ (function () {
267
267
  enumerable: true,
268
268
  configurable: true
269
269
  });
270
+ Object.defineProperty(BaseItem.prototype, "_initialized", {
271
+ get: function () {
272
+ return !this._pendingDefaultValue && !this._pendingValues;
273
+ },
274
+ enumerable: true,
275
+ configurable: true
276
+ });
270
277
  BaseItem.prototype.valueChanged = function () {
271
278
  this._value$.next(this.value);
272
279
  if (this.change) {
@@ -301,15 +308,17 @@ var BaseItem = /** @class */ (function () {
301
308
  });
302
309
  BaseItem.prototype.loadDefaultValue = function () {
303
310
  var _this = this;
311
+ this._pendingDefaultValue = true;
304
312
  return this.defaultValueFn()
305
313
  .pipe(tap(function (value) {
306
314
  _this.defaultValue = value;
315
+ _this._initDefaultModel();
307
316
  }), finalize(function () {
308
317
  _this._pendingDefaultValue = false;
309
318
  }));
310
319
  };
311
320
  BaseItem.prototype.initValues = function (persistedValue) {
312
- this._initialized = false;
321
+ // this._initialized = false;
313
322
  this.persistedValue = persistedValue;
314
323
  this._initDefaultModel();
315
324
  var isAutocomplete = this.type === ItemType.AutoComplete || this.type === ItemType.AutoCompleteChips;
@@ -322,12 +331,12 @@ var BaseItem = /** @class */ (function () {
322
331
  this.values = valuesResult;
323
332
  // Move to some other place
324
333
  this._init();
325
- this._initialized = true;
334
+ // this._initialized = true;
326
335
  }
327
336
  }
328
337
  else {
329
338
  this._init();
330
- this._initialized = true;
339
+ // this._initialized = true;
331
340
  }
332
341
  };
333
342
  BaseItem.prototype.loadAsyncValues = function (reload) {
@@ -343,7 +352,7 @@ var BaseItem = /** @class */ (function () {
343
352
  _this.loading = false;
344
353
  _this._init();
345
354
  _this._validateModel();
346
- _this._initialized = true;
355
+ // this._initialized = true;
347
356
  });
348
357
  }
349
358
  };
@@ -372,7 +381,6 @@ var BaseItem = /** @class */ (function () {
372
381
  this.label = item.label;
373
382
  this.chipLabel = item.chipLabel;
374
383
  if (typeof item.default === 'function') {
375
- this._pendingDefaultValue = true;
376
384
  this.defaultValueFn = item.default;
377
385
  }
378
386
  else {
@@ -1675,7 +1683,7 @@ var FsFilterItemsStore = /** @class */ (function () {
1675
1683
  var _this = this;
1676
1684
  var pendingItems = this.items
1677
1685
  .filter(function (item) {
1678
- return item.hasPendingDefaultValue
1686
+ return item.defaultValueFn
1679
1687
  && (item.persistedValue === null || item.persistedValue === undefined);
1680
1688
  });
1681
1689
  if (pendingItems.length > 0) {
@@ -2498,6 +2506,12 @@ var ExternalParamsController = /** @class */ (function () {
2498
2506
  };
2499
2507
  ExternalParamsController.prototype._listenItemsChange = function () {
2500
2508
  var _this = this;
2509
+ this._itemsStore.ready$
2510
+ .pipe(filter$1(function (v) { return v; }), take(1), takeUntil(this._destroy$))
2511
+ .subscribe(function () {
2512
+ _this._saveQueryParams();
2513
+ _this._savePersistedParams();
2514
+ });
2501
2515
  this._itemsStore
2502
2516
  .itemsChange$
2503
2517
  .pipe(takeUntil(this._destroy$))
@@ -4973,7 +4987,7 @@ var FsFilterActionKebabActionsComponent = /** @class */ (function () {
4973
4987
  FsFilterActionKebabActionsComponent = __decorate([
4974
4988
  Component({
4975
4989
  selector: 'fs-filter-action-kebab-actions',
4976
- template: "<button type=\"button\"\n mat-icon-button\n class=\"menu-button\"\n [fsMenuTriggerFor]=\"kebabActionsMenu\">\n <mat-icon>more_vert</mat-icon>\n</button>\n<fs-menu #kebabActionsMenu>\n <ng-container *ngFor=\"let action of kebabActions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <!-- Case when actions was collapsed from action with mode = 'menu'-->\n <ng-container *ngSwitchCase=\"'menu'\">\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group>\n <ng-template fs-group-menu-item-template>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon> {{childAction.label}}\n </ng-template>\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon>{{ childAction.label }}\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template fs-menu-item\n (click)=\"action.click($event)\"\n [fsClass]=\"action.classArray\"\n >\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </ng-template>\n </ng-container>\n\n </ng-container>\n </ng-container>\n</fs-menu>\n",
4990
+ template: "<button type=\"button\"\n mat-icon-button\n class=\"menu-button\"\n [fsMenuTriggerFor]=\"kebabActionsMenu\">\n <mat-icon>more_vert</mat-icon>\n</button>\n<fs-menu #kebabActionsMenu>\n <ng-container *ngFor=\"let action of kebabActions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <!-- Case when actions was collapsed from action with mode = 'menu'-->\n <ng-container *ngSwitchCase=\"'menu'\">\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group>\n <ng-template fs-group-menu-item-template>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon> {{childAction.label}}\n </ng-template>\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon>{{ childAction.label }}\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <ng-template fs-menu-item\n [fsClass]=\"action.classArray\"\n >\n <fs-file\n class=\"action-button\"\n [multiple]=\"action.multiple\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </fs-file>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template fs-menu-item\n (click)=\"action.click($event)\"\n [fsClass]=\"action.classArray\"\n >\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </ng-template>\n </ng-container>\n\n </ng-container>\n </ng-container>\n</fs-menu>\n",
4977
4991
  changeDetection: ChangeDetectionStrategy.OnPush,
4978
4992
  styles: [".menu-button{width:36px;height:36px;line-height:36px}"]
4979
4993
  })