@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.
@@ -16,7 +16,6 @@ export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
16
16
  change: (item: BaseItem<T>) => void;
17
17
  protected readonly _type: T['type'];
18
18
  protected _model: any;
19
- protected _initialized: boolean;
20
19
  protected _pendingValues: boolean;
21
20
  protected _pendingDefaultValue: boolean;
22
21
  protected _loading$: BehaviorSubject<boolean>;
@@ -56,6 +55,7 @@ export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
56
55
  get loading$(): Observable<boolean>;
57
56
  get loading(): boolean;
58
57
  set loading(value: boolean);
58
+ protected get _initialized(): boolean;
59
59
  valueChanged(): void;
60
60
  get queryObject(): Record<string, unknown>;
61
61
  get persistanceObject(): Record<string, unknown>;
@@ -254,7 +254,7 @@
254
254
  var BaseItem = /** @class */ (function () {
255
255
  function BaseItem(itemConfig, _additionalConfig) {
256
256
  this._additionalConfig = _additionalConfig;
257
- this._initialized = false;
257
+ // protected _initialized = false;
258
258
  this._pendingValues = false;
259
259
  this._pendingDefaultValue = false;
260
260
  this._loading$ = new rxjs.BehaviorSubject(false);
@@ -453,6 +453,13 @@
453
453
  enumerable: true,
454
454
  configurable: true
455
455
  });
456
+ Object.defineProperty(BaseItem.prototype, "_initialized", {
457
+ get: function () {
458
+ return !this._pendingDefaultValue && !this._pendingValues;
459
+ },
460
+ enumerable: true,
461
+ configurable: true
462
+ });
456
463
  BaseItem.prototype.valueChanged = function () {
457
464
  this._value$.next(this.value);
458
465
  if (this.change) {
@@ -487,15 +494,17 @@
487
494
  });
488
495
  BaseItem.prototype.loadDefaultValue = function () {
489
496
  var _this = this;
497
+ this._pendingDefaultValue = true;
490
498
  return this.defaultValueFn()
491
499
  .pipe(operators.tap(function (value) {
492
500
  _this.defaultValue = value;
501
+ _this._initDefaultModel();
493
502
  }), operators.finalize(function () {
494
503
  _this._pendingDefaultValue = false;
495
504
  }));
496
505
  };
497
506
  BaseItem.prototype.initValues = function (persistedValue) {
498
- this._initialized = false;
507
+ // this._initialized = false;
499
508
  this.persistedValue = persistedValue;
500
509
  this._initDefaultModel();
501
510
  var isAutocomplete = this.type === exports.ItemType.AutoComplete || this.type === exports.ItemType.AutoCompleteChips;
@@ -508,12 +517,12 @@
508
517
  this.values = valuesResult;
509
518
  // Move to some other place
510
519
  this._init();
511
- this._initialized = true;
520
+ // this._initialized = true;
512
521
  }
513
522
  }
514
523
  else {
515
524
  this._init();
516
- this._initialized = true;
525
+ // this._initialized = true;
517
526
  }
518
527
  };
519
528
  BaseItem.prototype.loadAsyncValues = function (reload) {
@@ -529,7 +538,7 @@
529
538
  _this.loading = false;
530
539
  _this._init();
531
540
  _this._validateModel();
532
- _this._initialized = true;
541
+ // this._initialized = true;
533
542
  });
534
543
  }
535
544
  };
@@ -558,7 +567,6 @@
558
567
  this.label = item.label;
559
568
  this.chipLabel = item.chipLabel;
560
569
  if (typeof item.default === 'function') {
561
- this._pendingDefaultValue = true;
562
570
  this.defaultValueFn = item.default;
563
571
  }
564
572
  else {
@@ -1861,7 +1869,7 @@
1861
1869
  var _this = this;
1862
1870
  var pendingItems = this.items
1863
1871
  .filter(function (item) {
1864
- return item.hasPendingDefaultValue
1872
+ return item.defaultValueFn
1865
1873
  && (item.persistedValue === null || item.persistedValue === undefined);
1866
1874
  });
1867
1875
  if (pendingItems.length > 0) {
@@ -2684,6 +2692,12 @@
2684
2692
  };
2685
2693
  ExternalParamsController.prototype._listenItemsChange = function () {
2686
2694
  var _this = this;
2695
+ this._itemsStore.ready$
2696
+ .pipe(operators.filter(function (v) { return v; }), operators.take(1), operators.takeUntil(this._destroy$))
2697
+ .subscribe(function () {
2698
+ _this._saveQueryParams();
2699
+ _this._savePersistedParams();
2700
+ });
2687
2701
  this._itemsStore
2688
2702
  .itemsChange$
2689
2703
  .pipe(operators.takeUntil(this._destroy$))
@@ -5159,7 +5173,7 @@
5159
5173
  FsFilterActionKebabActionsComponent = __decorate([
5160
5174
  core.Component({
5161
5175
  selector: 'fs-filter-action-kebab-actions',
5162
- 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",
5176
+ 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",
5163
5177
  changeDetection: core.ChangeDetectionStrategy.OnPush,
5164
5178
  styles: [".menu-button{width:36px;height:36px;line-height:36px}"]
5165
5179
  })