@firestitch/list 9.11.1 → 9.11.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.
@@ -2850,6 +2850,7 @@ var List = /** @class */ (function (_super) {
2850
2850
  // Empty state
2851
2851
  _this.emptyStateEnabled = false;
2852
2852
  _this.onDestroy$ = new Subject();
2853
+ _this._filtersQuery = new BehaviorSubject(null);
2853
2854
  _this._fromJSON(config);
2854
2855
  _this.initialize(config);
2855
2856
  _this._headerConfig = new StyleConfig(config.header);
@@ -2871,6 +2872,20 @@ var List = /** @class */ (function (_super) {
2871
2872
  enumerable: true,
2872
2873
  configurable: true
2873
2874
  });
2875
+ Object.defineProperty(List.prototype, "filtersQuery", {
2876
+ get: function () {
2877
+ return this._filtersQuery.getValue();
2878
+ },
2879
+ enumerable: true,
2880
+ configurable: true
2881
+ });
2882
+ Object.defineProperty(List.prototype, "filtersQuery$", {
2883
+ get: function () {
2884
+ return this._filtersQuery.asObservable();
2885
+ },
2886
+ enumerable: true,
2887
+ configurable: true
2888
+ });
2874
2889
  List.prototype.fetchRemote = function (query) {
2875
2890
  var options = {
2876
2891
  state: this.dataController.operation,
@@ -3334,7 +3349,7 @@ var List = /** @class */ (function (_super) {
3334
3349
  if (this.filterInitCb) {
3335
3350
  this.filterInitCb(filters);
3336
3351
  }
3337
- this.filtersQuery = filters;
3352
+ this._filtersQuery.next(filters);
3338
3353
  this.checkRestoreFilter();
3339
3354
  };
3340
3355
  /**
@@ -3346,7 +3361,7 @@ var List = /** @class */ (function (_super) {
3346
3361
  if (this.filterChangeCb) {
3347
3362
  this.filterChangeCb(filterQuery, filterSort);
3348
3363
  }
3349
- this.filtersQuery = filterQuery;
3364
+ this._filtersQuery.next(filterQuery);
3350
3365
  this.restoreMode = false;
3351
3366
  // Restore option
3352
3367
  this.checkRestoreFilter();
@@ -3566,6 +3581,7 @@ var ReorderController = /** @class */ (function () {
3566
3581
  this._enabled$ = new BehaviorSubject(false);
3567
3582
  this._manualReorderActivated$ = new BehaviorSubject(false);
3568
3583
  this._reorderDisabled$ = new BehaviorSubject(false);
3584
+ this._numberOfActiveFilters = 0;
3569
3585
  this._destroy$ = new Subject();
3570
3586
  }
3571
3587
  Object.defineProperty(ReorderController.prototype, "enabled", {
@@ -3599,7 +3615,9 @@ var ReorderController = /** @class */ (function () {
3599
3615
  return this._enabled$
3600
3616
  .pipe(map(function (enabled) {
3601
3617
  return enabled && _this.position === ReorderPosition.Left;
3602
- }), distinctUntilChanged(), shareReplay(), takeUntil(this._destroy$));
3618
+ }), map(function () {
3619
+ return _this._numberOfActiveFilters === 0;
3620
+ }), distinctUntilChanged(), shareReplay());
3603
3621
  },
3604
3622
  enumerable: true,
3605
3623
  configurable: true
@@ -3610,7 +3628,9 @@ var ReorderController = /** @class */ (function () {
3610
3628
  return this._enabled$
3611
3629
  .pipe(map(function (enabled) {
3612
3630
  return enabled && _this.position === ReorderPosition.Right;
3613
- }), distinctUntilChanged(), shareReplay(), takeUntil(this._destroy$));
3631
+ }), map(function () {
3632
+ return _this._numberOfActiveFilters === 0;
3633
+ }), distinctUntilChanged(), shareReplay());
3614
3634
  },
3615
3635
  enumerable: true,
3616
3636
  configurable: true
@@ -3733,6 +3753,10 @@ var ReorderController = /** @class */ (function () {
3733
3753
  this._reorderDisabled$.next(true);
3734
3754
  this._actionsController.updateDisabledState();
3735
3755
  };
3756
+ ReorderController.prototype.setNunberOfActiveFilters = function (activeFilters) {
3757
+ this._numberOfActiveFilters = activeFilters;
3758
+ this.enabled = this.enabled;
3759
+ };
3736
3760
  ReorderController = __decorate([
3737
3761
  Injectable(),
3738
3762
  __metadata("design:paramtypes", [])
@@ -4259,6 +4283,7 @@ var FsListComponent = /** @class */ (function () {
4259
4283
  this._updateCustomizeAction(listConfig.actions);
4260
4284
  this.list = new List(this._el, listConfig, this.fsScroll, this.selectionDialog, this._router, this._route, this._persistance, this._inDialog);
4261
4285
  this._waitFirstLoad();
4286
+ this._listenFiltersQueryChange();
4262
4287
  this.reorderController.initWithConfig(config.reorder, this.list.dataController, this.list.actions);
4263
4288
  if (this.listColumnDirectives) {
4264
4289
  this.list.tranformTemplatesToColumns(this.listColumnDirectives);
@@ -4336,6 +4361,17 @@ var FsListComponent = /** @class */ (function () {
4336
4361
  _this.cdRef.markForCheck();
4337
4362
  });
4338
4363
  };
4364
+ FsListComponent.prototype._listenFiltersQueryChange = function () {
4365
+ var _this = this;
4366
+ this.list.filtersQuery$
4367
+ .pipe(takeUntil(this.list.onDestroy$), takeUntil(this._destroy))
4368
+ .subscribe(function (value) {
4369
+ if (value) {
4370
+ var activeFilters = Object.keys(value).length;
4371
+ _this.reorderController.setNunberOfActiveFilters(activeFilters);
4372
+ }
4373
+ });
4374
+ };
4339
4375
  FsListComponent.prototype._configMergeCustomizer = function (objValue, srcValue) {
4340
4376
  if (Array.isArray(objValue)) {
4341
4377
  return objValue;