@firestitch/list 18.0.17 → 18.0.19

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.
@@ -3209,7 +3209,7 @@ class DataController {
3209
3209
  return this._operation;
3210
3210
  }
3211
3211
  get visibleRows$() {
3212
- return this._visibleRows$;
3212
+ return this._visibleRows$.asObservable();
3213
3213
  }
3214
3214
  set visibleRows(value) {
3215
3215
  this._visibleRows$.next(value);
@@ -3296,14 +3296,14 @@ class DataController {
3296
3296
  if (Array.isArray(rows)) {
3297
3297
  let updateSuccess = false;
3298
3298
  rows.forEach((item) => {
3299
- if (this.updateRow(item, trackBy)) {
3299
+ if (this._updateRow(item, trackBy)) {
3300
3300
  updateSuccess = true;
3301
3301
  }
3302
3302
  });
3303
3303
  this._updateVisibleRows();
3304
3304
  return updateSuccess;
3305
3305
  }
3306
- const updated = this.updateRow(rows, trackBy);
3306
+ const updated = this._updateRow(rows, trackBy);
3307
3307
  this._updateVisibleRows();
3308
3308
  return updated;
3309
3309
  }
@@ -3319,14 +3319,14 @@ class DataController {
3319
3319
  if (Array.isArray(data)) {
3320
3320
  //
3321
3321
  data.forEach((item) => {
3322
- removedRows.push(...this.removeRow(item, defaultTrackBy));
3322
+ removedRows.push(...this._removeRow(item, defaultTrackBy));
3323
3323
  });
3324
3324
  }
3325
3325
  else if (isFunction(data)) {
3326
- removedRows.push(...this.removeRow(null, data));
3326
+ removedRows.push(...this._removeRow(null, data));
3327
3327
  }
3328
3328
  else if (isObject(data)) {
3329
- removedRows.push(...this.removeRow(data, defaultTrackBy));
3329
+ removedRows.push(...this._removeRow(data, defaultTrackBy));
3330
3330
  }
3331
3331
  if (removedRows.length > 0) {
3332
3332
  this._updateVisibleRows();
@@ -3335,11 +3335,10 @@ class DataController {
3335
3335
  return !!removedRows.length;
3336
3336
  }
3337
3337
  swapRows(row1, row2, selectedRows, isMultipleDrag = false) {
3338
- let tmpEl;
3339
3338
  const rowsStack = this._rowsStack;
3340
3339
  const row1GlobalIndex = rowsStack.indexOf(row1);
3341
3340
  const row2GlobalIndex = rowsStack.indexOf(row2);
3342
- tmpEl = rowsStack[row1GlobalIndex];
3341
+ const tmpEl = rowsStack[row1GlobalIndex];
3343
3342
  rowsStack[row1GlobalIndex] = rowsStack[row2GlobalIndex];
3344
3343
  rowsStack[row2GlobalIndex] = tmpEl;
3345
3344
  if (isMultipleDrag && Array.isArray(selectedRows)) {
@@ -3393,7 +3392,7 @@ class DataController {
3393
3392
  this._destroyRowsStack();
3394
3393
  if (this.groupEnabled) {
3395
3394
  this._store.clear();
3396
- this._rowsStack = [...this.groupRowsBy(rows)];
3395
+ this._rowsStack = [...this._groupRowsBy(rows)];
3397
3396
  }
3398
3397
  else {
3399
3398
  rows = rows.map((row) => {
@@ -3404,7 +3403,7 @@ class DataController {
3404
3403
  }
3405
3404
  _extendRowsStack(rows) {
3406
3405
  if (this.groupEnabled) {
3407
- this._rowsStack = [...this.groupRowsBy(rows)];
3406
+ this._rowsStack = [...this._groupRowsBy(rows)];
3408
3407
  }
3409
3408
  else {
3410
3409
  rows = rows.map((row) => {
@@ -3418,12 +3417,12 @@ class DataController {
3418
3417
  }
3419
3418
  _updateVisibleRows() {
3420
3419
  this.visibleRows = this._rowsStack
3421
- .filter((row, index) => {
3420
+ .filter((row) => {
3422
3421
  return (!row.isChild && !row.isGroupFooter) || row.visible;
3423
3422
  });
3424
3423
  }
3425
- updateRow(targetRow, trackBy) {
3426
- if (trackBy === void 0) {
3424
+ _updateRow(targetRow, trackBy) {
3425
+ if (trackBy === undefined) {
3427
3426
  trackBy = (row, target) => {
3428
3427
  return row === target;
3429
3428
  };
@@ -3445,7 +3444,7 @@ class DataController {
3445
3444
  * @param targetRow
3446
3445
  * @param trackBy
3447
3446
  */
3448
- removeRow(targetRow, trackBy) {
3447
+ _removeRow(targetRow, trackBy) {
3449
3448
  const rows = this._rowsStack;
3450
3449
  const removedRows = [];
3451
3450
  rows.forEach((listRow, index) => {
@@ -3459,12 +3458,11 @@ class DataController {
3459
3458
  /**
3460
3459
  * Split existing rows by groups and store them for future use
3461
3460
  */
3462
- groupRowsBy(rows) {
3461
+ _groupRowsBy(rows) {
3463
3462
  if (!this._groupByFn || !this._compareByFn) {
3464
3463
  return rows;
3465
3464
  }
3466
3465
  const groupRows = [];
3467
- const footerRows = new Map();
3468
3466
  rows.forEach((row) => {
3469
3467
  const mainGroup = this._groupByFn(row);
3470
3468
  const mainGroupKey = this._compareByFn(mainGroup);
@@ -3724,12 +3722,11 @@ var PaginationStrategy;
3724
3722
  })(PaginationStrategy || (PaginationStrategy = {}));
3725
3723
 
3726
3724
  class PaginationController {
3727
- limit = 25;
3728
- records;
3729
- manual = false;
3730
- page = 1; // Active page
3731
- offset = 0;
3732
- displayed = 0;
3725
+ _limit = 25;
3726
+ _records;
3727
+ _page = 1; // Active page
3728
+ _pageRecords = 0;
3729
+ _offset = 0;
3733
3730
  _pages$ = new BehaviorSubject(0); // Total pages
3734
3731
  _strategy = PaginationStrategy.None;
3735
3732
  _removedRows = 0;
@@ -3738,13 +3735,30 @@ class PaginationController {
3738
3735
  _onDestroy$ = new Subject();
3739
3736
  _loadMoreConfig;
3740
3737
  _limits = [10, 25, 50, 100, 200];
3741
- // Total pages
3742
3738
  set pages(value) {
3743
3739
  this._pages$.next(value);
3744
3740
  }
3745
3741
  get pages() {
3746
3742
  return this._pages$.getValue();
3747
3743
  }
3744
+ get page() {
3745
+ return this._page;
3746
+ }
3747
+ set page(value) {
3748
+ this._page = value;
3749
+ }
3750
+ get pageRecords() {
3751
+ return this._pageRecords;
3752
+ }
3753
+ get offset() {
3754
+ return this._offset;
3755
+ }
3756
+ get records() {
3757
+ return this._records;
3758
+ }
3759
+ set records(value) {
3760
+ this._records = value;
3761
+ }
3748
3762
  get pages$() {
3749
3763
  return this._pages$
3750
3764
  .pipe(distinctUntilChanged());
@@ -3777,11 +3791,11 @@ class PaginationController {
3777
3791
  */
3778
3792
  set limits(value) {
3779
3793
  this._limits = value;
3780
- if (this.limits.length > 0 && this.limits.indexOf(this.limit) === -1) {
3781
- this.limit = this.limits[0];
3794
+ if (this._limits.length > 0 && this._limits.indexOf(this._limit) === -1) {
3795
+ this._limit = this._limits[0];
3782
3796
  }
3783
- else if (this.limits.length === 0) {
3784
- this.limit = this.records;
3797
+ else if (this._limits.length === 0) {
3798
+ this._limit = this._records;
3785
3799
  }
3786
3800
  }
3787
3801
  /**
@@ -3819,8 +3833,8 @@ class PaginationController {
3819
3833
  return this.hasNoneStrategy
3820
3834
  ? {}
3821
3835
  : {
3822
- page: this.page || 1,
3823
- limit: this.limit || 10,
3836
+ page: this._page || 1,
3837
+ limit: this._limit || 10,
3824
3838
  recordCount: true,
3825
3839
  };
3826
3840
  }
@@ -3828,8 +3842,8 @@ class PaginationController {
3828
3842
  * Query for Offset Strategy
3829
3843
  */
3830
3844
  get queryOffsetStrategy() {
3831
- const page = this.page - 1 || 0;
3832
- const limit = this.limit || 5;
3845
+ const page = this._page - 1 || 0;
3846
+ const limit = this._limit || 5;
3833
3847
  return {
3834
3848
  offset: page * limit,
3835
3849
  limit,
@@ -3846,8 +3860,8 @@ class PaginationController {
3846
3860
  * Get query for load only count of deleted rows
3847
3861
  */
3848
3862
  get loadDeletedOffsetQuery() {
3849
- const paginationOffset = this.limit * this.page;
3850
- const actualOffset = Math.min(this.records, paginationOffset);
3863
+ const paginationOffset = this._limit * this._page;
3864
+ const actualOffset = Math.min(this._records, paginationOffset);
3851
3865
  const offset = Math.max(0, actualOffset - this._removedRows);
3852
3866
  return {
3853
3867
  offset,
@@ -3912,7 +3926,7 @@ class PaginationController {
3912
3926
  case PaginationStrategy.Offset:
3913
3927
  return this._hasNextPageOffsetStrategy;
3914
3928
  case PaginationStrategy.Many:
3915
- return true;
3929
+ return !!this._pageRecords && this._limit === this._pageRecords;
3916
3930
  }
3917
3931
  return false;
3918
3932
  }
@@ -3940,31 +3954,47 @@ class PaginationController {
3940
3954
  * Showing 0 results sorted by Name, Ascending
3941
3955
  */
3942
3956
  get statusLabel() {
3943
- const current = (this.page - 1) * this.limit;
3957
+ const status = this.hasManyStrategy ?
3958
+ this.manyStatus :
3959
+ this.defaultStatus;
3960
+ return Object.values(status)
3961
+ .filter((value) => !!value)
3962
+ .join('-');
3963
+ }
3964
+ get manyStatus() {
3965
+ const current = (this._page - 1) * this._limit;
3966
+ const from = current + 1;
3967
+ if (this._pageRecords === 0) {
3968
+ return { from: current, to: 0 };
3969
+ }
3970
+ return this._pageRecords < this._limit ?
3971
+ { from, to: current + this._pageRecords } :
3972
+ { from, to: current + this._limit };
3973
+ }
3974
+ get defaultStatus() {
3975
+ const current = (this._page - 1) * this._limit;
3944
3976
  const from = current + 1;
3945
- const to = this.hasManyStrategy ?
3946
- current + this.limit :
3947
- Math.min(this.records, current + this.limit);
3948
- return `${from}-${to}`;
3977
+ const to = Math.min(this._records, current + this._limit);
3978
+ return { from, to };
3949
3979
  }
3950
3980
  get state() {
3951
3981
  return {
3952
3982
  enabled: this.enabled,
3953
3983
  strategy: this.strategy,
3954
- page: this.page,
3955
- offset: this.offset,
3956
- limit: this.limit,
3957
- records: this.records,
3958
- displayed: this.displayed,
3984
+ page: this._page,
3985
+ offset: this._offset,
3986
+ limit: this._limit,
3987
+ records: this._records,
3988
+ pageRecords: this._pageRecords,
3959
3989
  };
3960
3990
  }
3961
3991
  initWithConfig(config, loadMore) {
3962
3992
  if (config) {
3963
3993
  if (config.limits) {
3964
- this.limits = config.limits;
3994
+ this._limits = config.limits;
3965
3995
  }
3966
3996
  if (config.limit) {
3967
- this.limit = config.limit;
3997
+ this._limit = config.limit;
3968
3998
  }
3969
3999
  this.strategy = config.strategy;
3970
4000
  }
@@ -3974,48 +4004,44 @@ class PaginationController {
3974
4004
  * If pagination has prev page when Page Strategy
3975
4005
  */
3976
4006
  get _hasPrevPagePageStrategy() {
3977
- return this.page > 1 && this.pages > 1;
4007
+ return this._page > 1 && this.pages > 1;
3978
4008
  }
3979
4009
  /**
3980
4010
  * If pagination has prev page when Offset Strategy
3981
4011
  */
3982
4012
  get _hasPrevPageOffsetStrategy() {
3983
- return this.offset >= this.limit && this.records > 1;
4013
+ return this._offset >= this._limit && this._records > 1;
3984
4014
  }
3985
4015
  /**
3986
4016
  * If pagination has prev page when Offset Strategy
3987
4017
  */
3988
4018
  get _hasPrevPageManyStrategy() {
3989
- return this.offset >= this.limit;
4019
+ return this._offset > 0;
3990
4020
  }
3991
4021
  /**
3992
4022
  * If pagination has next page when Page Strategy
3993
4023
  */
3994
4024
  get _hasNextPagePageStrategy() {
3995
- return this.page < this.pages && this.pages > 1;
4025
+ return this._page < this.pages && this.pages > 1;
3996
4026
  }
3997
4027
  /**
3998
4028
  * If pagination has next page when Offset Strategy
3999
4029
  */
4000
4030
  get _hasNextPageOffsetStrategy() {
4001
- return (this.offset + this.limit) < this.records && this.records > 1;
4031
+ return (this._offset + this._limit) < this._records && this._records > 1;
4002
4032
  }
4003
4033
  /**
4004
4034
  * Update paging config and all related fields
4005
- *
4006
- * @param config
4007
- * @param displayedRecords
4008
- * @param loadMoreOperation
4009
4035
  */
4010
- updatePaging(config, displayedRecords = 0, loadMoreOperation = false) {
4036
+ updatePaging(config, pageRecords = 0, loadMoreOperation = false) {
4011
4037
  if (!loadMoreOperation) {
4012
4038
  this._fromParams(config);
4013
- this.displayed = displayedRecords;
4039
+ this._pageRecords = pageRecords;
4014
4040
  }
4015
4041
  else {
4016
- this.records = config.records;
4017
- if (this.records < this.displayed) {
4018
- this.displayed = this.records;
4042
+ this._records = config.records;
4043
+ if (this._records < this._pageRecords) {
4044
+ this._pageRecords = this._records;
4019
4045
  }
4020
4046
  this._removedRows = 0;
4021
4047
  }
@@ -4027,8 +4053,8 @@ class PaginationController {
4027
4053
  // */
4028
4054
  /*public updatePagingManual(rows: any[]) {
4029
4055
  if (Array.isArray(rows) && rows.length > 0) {
4030
- this.records = rows.length;
4031
- this.pages = Math.ceil(rows.length / this.limit);
4056
+ this._records = rows.length;
4057
+ this.pages = Math.ceil(rows.length / this._limit);
4032
4058
  }
4033
4059
 
4034
4060
  this.updatePagesArray();
@@ -4042,13 +4068,13 @@ class PaginationController {
4042
4068
  // const pagesArr = [];
4043
4069
  // let from = 0;
4044
4070
  // let to = 0;
4045
- // if (this.page < MIDDLE) {
4071
+ // if (this._page < MIDDLE) {
4046
4072
  // from = MIDDLE - 1;
4047
4073
  // to = MIDDLE + 1;
4048
- // } else if (this.page >= MIDDLE && this.page <= this.pages - MIDDLE + 1) {
4049
- // from = this.page - 1;
4050
- // to = this.page + 1;
4051
- // } else if (this.page > this.pages - MIDDLE + 1) {
4074
+ // } else if (this._page >= MIDDLE && this._page <= this.pages - MIDDLE + 1) {
4075
+ // from = this._page - 1;
4076
+ // to = this._page + 1;
4077
+ // } else if (this._page > this.pages - MIDDLE + 1) {
4052
4078
  // from = this.pages - MIDDLE - 1;
4053
4079
  // to = this.pages;
4054
4080
  // }
@@ -4077,26 +4103,8 @@ class PaginationController {
4077
4103
  ...loadMoreConfig,
4078
4104
  };
4079
4105
  }
4080
- /**
4081
- * Update dispayed records counter
4082
- */
4083
- // public updateDisplayed() {
4084
- // this.displayed = this.getVisibleRecords();
4085
- // }
4086
- /**
4087
- * Return count of records that could be shown on page
4088
- */
4089
- // public getVisibleRecords() {
4090
- // const diff = this.hasOffsetStrategy
4091
- // ? this.records - this.offset
4092
- // : this.limit;
4093
- //
4094
- // return diff < this.limit
4095
- // ? diff
4096
- // : this.displayed;
4097
- // }
4098
- getVisibleRecords() {
4099
- return this.displayed;
4106
+ getPageRecords() {
4107
+ return this._pageRecords;
4100
4108
  }
4101
4109
  /**
4102
4110
  * Set new limit
@@ -4104,7 +4112,7 @@ class PaginationController {
4104
4112
  * @param limit
4105
4113
  */
4106
4114
  setLimit(limit) {
4107
- this.limit = limit;
4115
+ this._limit = limit;
4108
4116
  this.resetPaging();
4109
4117
  this._pageChanged$
4110
4118
  .next({
@@ -4118,7 +4126,7 @@ class PaginationController {
4118
4126
  * @param page
4119
4127
  */
4120
4128
  isActive(page) {
4121
- return page === this.page;
4129
+ return page === this._page;
4122
4130
  }
4123
4131
  /**
4124
4132
  * Go to page
@@ -4126,8 +4134,8 @@ class PaginationController {
4126
4134
  * @param page
4127
4135
  */
4128
4136
  goToPage(page) {
4129
- if (page >= 1 && this.page !== page) {
4130
- this.page = page;
4137
+ if (page >= 1 && this._page !== page) {
4138
+ this._page = page;
4131
4139
  this._updateOffset();
4132
4140
  this._pageChanged$.next({
4133
4141
  type: PageChangeType.Default,
@@ -4139,19 +4147,19 @@ class PaginationController {
4139
4147
  * Reset paging like it was just initialized
4140
4148
  */
4141
4149
  resetPaging() {
4142
- this.page = 1;
4143
- this.offset = 0;
4150
+ this._page = 1;
4151
+ this._offset = 0;
4144
4152
  }
4145
4153
  /**
4146
4154
  * Go to next page
4147
4155
  */
4148
4156
  goNext() {
4149
4157
  if (this.hasNextPage) {
4150
- this.page++;
4158
+ this._page++;
4151
4159
  this._updateOffset();
4152
4160
  this._pageChanged$.next({
4153
4161
  type: PageChangeType.Default,
4154
- payload: this.page,
4162
+ payload: this._page,
4155
4163
  });
4156
4164
  }
4157
4165
  }
@@ -4159,12 +4167,12 @@ class PaginationController {
4159
4167
  * Go to first page
4160
4168
  */
4161
4169
  goFirst() {
4162
- if (this.page > 1) {
4163
- this.page = 1;
4170
+ if (this._page > 1) {
4171
+ this._page = 1;
4164
4172
  this._updateOffset();
4165
4173
  this._pageChanged$.next({
4166
4174
  type: PageChangeType.Default,
4167
- payload: this.page,
4175
+ payload: this._page,
4168
4176
  });
4169
4177
  }
4170
4178
  }
@@ -4172,12 +4180,12 @@ class PaginationController {
4172
4180
  * Go to prev page
4173
4181
  */
4174
4182
  goPrev() {
4175
- if (this.page > 1) {
4176
- this.page--;
4183
+ if (this._page > 1) {
4184
+ this._page--;
4177
4185
  this._updateOffset();
4178
4186
  this._pageChanged$.next({
4179
4187
  type: PageChangeType.Default,
4180
- payload: this.page,
4188
+ payload: this._page,
4181
4189
  });
4182
4190
  }
4183
4191
  }
@@ -4185,12 +4193,12 @@ class PaginationController {
4185
4193
  * Go to last page
4186
4194
  */
4187
4195
  goLast() {
4188
- if (this.page !== this.pages) {
4189
- this.page = this.pages;
4196
+ if (this._page !== this.pages) {
4197
+ this._page = this.pages;
4190
4198
  this._updateOffset();
4191
4199
  this._pageChanged$.next({
4192
4200
  type: PageChangeType.Default,
4193
- payload: this.page,
4201
+ payload: this._page,
4194
4202
  });
4195
4203
  }
4196
4204
  }
@@ -4219,23 +4227,22 @@ class PaginationController {
4219
4227
  */
4220
4228
  _fromParams(params) {
4221
4229
  if (!this.loadMoreEnabled) {
4222
- this.limit = params.limit ?? 25;
4230
+ this._limit = params.limit ?? 25;
4223
4231
  }
4224
- this.records = params.records;
4225
- this.manual = params.manual;
4232
+ this._records = params.records;
4226
4233
  this.pages = params.pages || 0;
4227
4234
  }
4228
4235
  /**
4229
4236
  * Calc and update offset
4230
4237
  */
4231
4238
  _updateOffset() {
4232
- this.offset = this.limit * (this.page - 1);
4239
+ this._offset = this._limit * (this._page - 1);
4233
4240
  }
4234
4241
  /**
4235
4242
  * Calc and update total count of pages
4236
4243
  */
4237
4244
  _updateTotalPages() {
4238
- this.pages = Math.ceil(this.records / this.limit);
4245
+ this.pages = Math.ceil(this._records / this._limit);
4239
4246
  }
4240
4247
  }
4241
4248
 
@@ -4281,9 +4288,6 @@ class List {
4281
4288
  externalParams;
4282
4289
  selection;
4283
4290
  filterConfig = null;
4284
- loading$ = new BehaviorSubject(false);
4285
- fetchComplete$ = new Subject();
4286
- filtersReady$ = new Subject();
4287
4291
  status = true;
4288
4292
  chips = false;
4289
4293
  filterInput = true;
@@ -4291,9 +4295,11 @@ class List {
4291
4295
  restoreMode = false;
4292
4296
  autoReload;
4293
4297
  initialFetch = true;
4294
- // Empty state
4295
4298
  emptyStateEnabled = false;
4296
4299
  emptyStateTemplate;
4300
+ _loading$ = new BehaviorSubject(false);
4301
+ _fetchComplete$ = new Subject();
4302
+ _filtersReady$ = new Subject();
4297
4303
  _destroy$ = new Subject();
4298
4304
  _initialized$ = new BehaviorSubject(false);
4299
4305
  _fetch$ = new Subject();
@@ -4324,6 +4330,15 @@ class List {
4324
4330
  this._fetch$.next(null);
4325
4331
  }
4326
4332
  }
4333
+ get loading$() {
4334
+ return this._loading$.asObservable();
4335
+ }
4336
+ filtersReady() {
4337
+ this._filtersReady$.next(null);
4338
+ }
4339
+ get filtersReady$() {
4340
+ return this._filtersReady$.asObservable();
4341
+ }
4327
4342
  get fetch$() {
4328
4343
  return this._fetch$.asObservable();
4329
4344
  }
@@ -4386,10 +4401,10 @@ class List {
4386
4401
  this._initFilters();
4387
4402
  }
4388
4403
  reload() {
4389
- this.loading$.next(true);
4404
+ this._loading$.next(true);
4390
4405
  this.dataController.setOperation(FsListState.Reload);
4391
4406
  this._fetch$.next(null);
4392
- return this.fetchComplete$
4407
+ return this._fetchComplete$
4393
4408
  .asObservable()
4394
4409
  .pipe(take(1), delay(0));
4395
4410
  }
@@ -4407,7 +4422,7 @@ class List {
4407
4422
  if (this.paging.hasOffsetStrategy) {
4408
4423
  this.paging.updatePagination();
4409
4424
  if (this.selection) {
4410
- this.selection.updateVisibleRecordsCount(this.paging.getVisibleRecords());
4425
+ this.selection.updateVisibleRecordsCount(this.paging.getPageRecords());
4411
4426
  this.selection.updateTotalRecordsCount(this.paging.records);
4412
4427
  this.selection.pageChanged();
4413
4428
  }
@@ -4426,7 +4441,7 @@ class List {
4426
4441
  el = document.body;
4427
4442
  }
4428
4443
  }
4429
- return this.fetchComplete$
4444
+ return this._fetchComplete$
4430
4445
  .asObservable()
4431
4446
  .pipe(take(1), tap(() => {
4432
4447
  if (event?.scrollIntoView ?? true) {
@@ -4513,6 +4528,7 @@ class List {
4513
4528
  this._initExternalParamsController();
4514
4529
  this._initializeData();
4515
4530
  }
4531
+ // eslint-disable-next-line max-statements
4516
4532
  _initVariables(config) {
4517
4533
  this.autoFocus = config.autoFocus;
4518
4534
  this.rowHoverHighlight = config.rowHoverHighlight ?? true;
@@ -4654,12 +4670,12 @@ class List {
4654
4670
  let fetch$ = this.fetch$;
4655
4671
  // Should wait until saved filters not loaded
4656
4672
  if (this.filters) {
4657
- fetch$ = combineLatest([fetch$, this.filtersReady$])
4673
+ fetch$ = combineLatest([fetch$, this._filtersReady$])
4658
4674
  .pipe(map(([params]) => params));
4659
4675
  }
4660
4676
  fetch$
4661
4677
  .pipe(debounceTime(50), tap(() => {
4662
- this.loading$.next(true);
4678
+ this._loading$.next(true);
4663
4679
  }), tap(() => {
4664
4680
  this.selection?.closeSelectionDialog();
4665
4681
  }), map((params) => {
@@ -4823,7 +4839,15 @@ class List {
4823
4839
  _checkRestoreFilter() {
4824
4840
  // Restore option
4825
4841
  if (this.restore && this.filtersQuery[showDeletedFilterKey]) {
4826
- delete this.filtersQuery[showDeletedFilterKey];
4842
+ const filtersQuery = Object.keys(this.filtersQuery)
4843
+ .filter((key) => key !== showDeletedFilterKey)
4844
+ .reduce((acc, key) => {
4845
+ return {
4846
+ ...acc,
4847
+ [key]: this.filtersQuery[key],
4848
+ };
4849
+ }, {});
4850
+ this._filtersQuery.next(filtersQuery);
4827
4851
  Object.assign(this.filtersQuery, this.restore.query);
4828
4852
  this.restoreMode = true;
4829
4853
  }
@@ -4846,8 +4870,8 @@ class List {
4846
4870
  this.paging.page = 1;
4847
4871
  }
4848
4872
  if (response.paging) {
4849
- const displayed = (Array.isArray(response.data) && response.data.length) || 0;
4850
- this.paging.updatePaging(response.paging, displayed, this.dataController.operation === FsListState.LoadMore);
4873
+ const pageRecords = (Array.isArray(response.data) && response.data.length) || 0;
4874
+ this.paging.updatePaging(response.paging, pageRecords, this.dataController.operation === FsListState.LoadMore);
4851
4875
  }
4852
4876
  else if (this.paging.enabled) {
4853
4877
  console.log('%c FsList Warning ', 'color: white; background-color: #ffcc0b', 'Pagination does not configured properly. ' +
@@ -4870,15 +4894,15 @@ class List {
4870
4894
  && this.paging.page > this.paging.pages) {
4871
4895
  this.paging.goLast();
4872
4896
  }
4873
- this.fetchComplete$.next({ scrollIntoView: params?.scrollIntoView });
4874
- this.loading$.next(false);
4897
+ this._fetchComplete$.next({ scrollIntoView: params?.scrollIntoView });
4898
+ this._loading$.next(false);
4875
4899
  }
4876
4900
  _completeFetchUpdateSelecton(response) {
4877
4901
  // Update selection params
4878
4902
  if (this.selection) {
4879
4903
  if (this.paging.enabled) {
4880
4904
  this.selection.pageChanged();
4881
- this.selection.updateVisibleRecordsCount(this.paging.getVisibleRecords());
4905
+ this.selection.updateVisibleRecordsCount(this.paging.getPageRecords());
4882
4906
  this.selection.updateTotalRecordsCount(this.paging.records);
4883
4907
  }
4884
4908
  else {
@@ -5346,11 +5370,11 @@ class FsStatusComponent {
5346
5370
  this.paging.setLimit(limit);
5347
5371
  }
5348
5372
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5349
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsStatusComponent, selector: "fs-list-status", inputs: { list: "list", rows: "rows", firstLoad: "firstLoad" }, host: { properties: { "class.first-load": "this.firstLoad", "class.fs-skeleton-placeholder": "this.firstLoad" } }, ngImport: i0, template: "<div class=\"status\">\n <small>\n <ng-container *ngIf=\"paging.enabled\">\n Showing\n <a [fsMenuTriggerFor]=\"limitsMenu\">\n {{ paging.statusLabel }}\n </a>\n of\n @if (paging.hasManyStrategy) {\n @if (many.status === 'many') {\n <a\n (click)=\"manyClick()\"\n [matTooltip]=\"'Calculate number of records'\">\n many\n </a>\n } @else {\n @if (many.status === 'loading') {\n <mat-spinner\n [diameter]=\"15\"\n [strokeWidth]=\"2\">\n </mat-spinner>\n } @else {\n {{ many.count | number:'1.0':'en-US' }}\n }\n }\n } @else {\n {{ paging.records | number:'1.0':'en-US' }} results\n }\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"(!paging.enabled) && paging.displayed > 0\">\n Showing\n <span *ngIf=\"paging.displayed === 1\">\n {{ paging.displayed }} result\n </span>\n <span *ngIf=\"paging.displayed > 1\">\n {{ paging.displayed | number:'1.0':'en-US' }} results\n </span>\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <fs-list-saved-filters class=\"saved-filters\"></fs-list-saved-filters>\n <fs-menu\n [hidden]=\"!paging.enabled\"\n #limitsMenu>\n <ng-template\n ngFor\n let-limit\n [ngForOf]=\"paging.limits\">\n <ng-template\n fs-menu-item\n (click)=\"setLimit(limit)\">\n {{ limit }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <fs-menu\n [hidden]=\"!sorting.sortingColumn || paging.displayed === 0\"\n #orderColumnsMenu>\n <!-- Real sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.sortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n <ng-container *ngIf=\"column.title; else sortByTemplate\">\n {{ column.title }}\n </ng-container>\n <ng-template #sortByTemplate>\n <ng-template [ngTemplateOutlet]=\"column.headerTemplate\"></ng-template>\n </ng-template>\n </ng-template>\n </ng-template>\n <!-- Fake sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.fakeSortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n {{ column.title }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <ng-template #sortedBy>\n <ng-container *ngIf=\"sorting.sortingColumn\">\n sorted by\n <ng-container *ngIf=\"sorting.sortingColumn.title; else sortByTemplate\">\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n {{ sorting.sortingColumn.title }}\n </a>\n ,\n </ng-container>\n <ng-template #sortByTemplate>\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n <ng-template [ngTemplateOutlet]=\"sorting.sortingColumn.headerTemplate\"></ng-template>\n </a>\n ,\n </ng-template>\n <a\n class=\"order-toggle\"\n (click)=\"toggleDirection()\">\n {{ sorting.sortingColumn.fullNameDirection }}\n </a>\n </ng-container>\n </ng-template>\n </small>\n</div>", styles: [":host.hidden-mobile{display:none!important}:host.first-load .status{visibility:hidden}.order-toggle{white-space:nowrap}a{cursor:pointer}mat-spinner{display:inline-block;margin:0 2px;vertical-align:middle}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i3$2.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { kind: "directive", type: i3$2.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { kind: "directive", type: i3$2.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: FsListSavedFiltersComponent, selector: "fs-list-saved-filters" }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
5373
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsStatusComponent, selector: "fs-list-status", inputs: { list: "list", rows: "rows", firstLoad: "firstLoad" }, host: { properties: { "class.first-load": "this.firstLoad", "class.fs-skeleton-placeholder": "this.firstLoad" } }, ngImport: i0, template: "<div class=\"status\">\n <small>\n <ng-container *ngIf=\"paging.enabled\">\n Showing\n <a [fsMenuTriggerFor]=\"limitsMenu\">\n {{ paging.statusLabel }}\n </a>\n of\n @if (paging.hasManyStrategy) {\n @if (many.status === 'many') {\n <a\n (click)=\"manyClick()\"\n [matTooltip]=\"'Calculate number of records'\">\n many\n </a>\n } @else {\n @if (many.status === 'loading') {\n <mat-spinner\n [diameter]=\"15\"\n [strokeWidth]=\"2\">\n </mat-spinner>\n } @else {\n {{ many.count | number:'1.0':'en-US' }}\n }\n }\n } @else {\n {{ paging.records | number:'1.0':'en-US' }} results\n }\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"(!paging.enabled) && paging.pageRecords > 0\">\n Showing\n <span *ngIf=\"paging.pageRecords === 1\">\n {{ paging.pageRecords }} result\n </span>\n <span *ngIf=\"paging.pageRecords > 1\">\n {{ paging.pageRecords | number:'1.0':'en-US' }} results\n </span>\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <fs-list-saved-filters class=\"saved-filters\"></fs-list-saved-filters>\n <fs-menu\n [hidden]=\"!paging.enabled\"\n #limitsMenu>\n <ng-template\n ngFor\n let-limit\n [ngForOf]=\"paging.limits\">\n <ng-template\n fs-menu-item\n (click)=\"setLimit(limit)\">\n {{ limit }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <fs-menu\n [hidden]=\"!sorting.sortingColumn || paging.pageRecords === 0\"\n #orderColumnsMenu>\n <!-- Real sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.sortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n <ng-container *ngIf=\"column.title; else sortByTemplate\">\n {{ column.title }}\n </ng-container>\n <ng-template #sortByTemplate>\n <ng-template [ngTemplateOutlet]=\"column.headerTemplate\"></ng-template>\n </ng-template>\n </ng-template>\n </ng-template>\n <!-- Fake sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.fakeSortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n {{ column.title }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <ng-template #sortedBy>\n <ng-container *ngIf=\"sorting.sortingColumn\">\n sorted by\n <ng-container *ngIf=\"sorting.sortingColumn.title; else sortByTemplate\">\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n {{ sorting.sortingColumn.title }}\n </a>\n ,\n </ng-container>\n <ng-template #sortByTemplate>\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n <ng-template [ngTemplateOutlet]=\"sorting.sortingColumn.headerTemplate\"></ng-template>\n </a>\n ,\n </ng-template>\n <a\n class=\"order-toggle\"\n (click)=\"toggleDirection()\">\n {{ sorting.sortingColumn.fullNameDirection }}\n </a>\n </ng-container>\n </ng-template>\n </small>\n</div>", styles: [":host.hidden-mobile{display:none!important}:host.first-load .status{visibility:hidden}.order-toggle{white-space:nowrap}a{cursor:pointer}mat-spinner{display:inline-block;margin:0 2px;vertical-align:middle}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i3$2.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { kind: "directive", type: i3$2.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { kind: "directive", type: i3$2.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: FsListSavedFiltersComponent, selector: "fs-list-saved-filters" }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
5350
5374
  }
5351
5375
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsStatusComponent, decorators: [{
5352
5376
  type: Component,
5353
- args: [{ selector: 'fs-list-status', changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: true, template: "<div class=\"status\">\n <small>\n <ng-container *ngIf=\"paging.enabled\">\n Showing\n <a [fsMenuTriggerFor]=\"limitsMenu\">\n {{ paging.statusLabel }}\n </a>\n of\n @if (paging.hasManyStrategy) {\n @if (many.status === 'many') {\n <a\n (click)=\"manyClick()\"\n [matTooltip]=\"'Calculate number of records'\">\n many\n </a>\n } @else {\n @if (many.status === 'loading') {\n <mat-spinner\n [diameter]=\"15\"\n [strokeWidth]=\"2\">\n </mat-spinner>\n } @else {\n {{ many.count | number:'1.0':'en-US' }}\n }\n }\n } @else {\n {{ paging.records | number:'1.0':'en-US' }} results\n }\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"(!paging.enabled) && paging.displayed > 0\">\n Showing\n <span *ngIf=\"paging.displayed === 1\">\n {{ paging.displayed }} result\n </span>\n <span *ngIf=\"paging.displayed > 1\">\n {{ paging.displayed | number:'1.0':'en-US' }} results\n </span>\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <fs-list-saved-filters class=\"saved-filters\"></fs-list-saved-filters>\n <fs-menu\n [hidden]=\"!paging.enabled\"\n #limitsMenu>\n <ng-template\n ngFor\n let-limit\n [ngForOf]=\"paging.limits\">\n <ng-template\n fs-menu-item\n (click)=\"setLimit(limit)\">\n {{ limit }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <fs-menu\n [hidden]=\"!sorting.sortingColumn || paging.displayed === 0\"\n #orderColumnsMenu>\n <!-- Real sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.sortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n <ng-container *ngIf=\"column.title; else sortByTemplate\">\n {{ column.title }}\n </ng-container>\n <ng-template #sortByTemplate>\n <ng-template [ngTemplateOutlet]=\"column.headerTemplate\"></ng-template>\n </ng-template>\n </ng-template>\n </ng-template>\n <!-- Fake sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.fakeSortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n {{ column.title }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <ng-template #sortedBy>\n <ng-container *ngIf=\"sorting.sortingColumn\">\n sorted by\n <ng-container *ngIf=\"sorting.sortingColumn.title; else sortByTemplate\">\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n {{ sorting.sortingColumn.title }}\n </a>\n ,\n </ng-container>\n <ng-template #sortByTemplate>\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n <ng-template [ngTemplateOutlet]=\"sorting.sortingColumn.headerTemplate\"></ng-template>\n </a>\n ,\n </ng-template>\n <a\n class=\"order-toggle\"\n (click)=\"toggleDirection()\">\n {{ sorting.sortingColumn.fullNameDirection }}\n </a>\n </ng-container>\n </ng-template>\n </small>\n</div>", styles: [":host.hidden-mobile{display:none!important}:host.first-load .status{visibility:hidden}.order-toggle{white-space:nowrap}a{cursor:pointer}mat-spinner{display:inline-block;margin:0 2px;vertical-align:middle}\n"] }]
5377
+ args: [{ selector: 'fs-list-status', changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: true, template: "<div class=\"status\">\n <small>\n <ng-container *ngIf=\"paging.enabled\">\n Showing\n <a [fsMenuTriggerFor]=\"limitsMenu\">\n {{ paging.statusLabel }}\n </a>\n of\n @if (paging.hasManyStrategy) {\n @if (many.status === 'many') {\n <a\n (click)=\"manyClick()\"\n [matTooltip]=\"'Calculate number of records'\">\n many\n </a>\n } @else {\n @if (many.status === 'loading') {\n <mat-spinner\n [diameter]=\"15\"\n [strokeWidth]=\"2\">\n </mat-spinner>\n } @else {\n {{ many.count | number:'1.0':'en-US' }}\n }\n }\n } @else {\n {{ paging.records | number:'1.0':'en-US' }} results\n }\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"(!paging.enabled) && paging.pageRecords > 0\">\n Showing\n <span *ngIf=\"paging.pageRecords === 1\">\n {{ paging.pageRecords }} result\n </span>\n <span *ngIf=\"paging.pageRecords > 1\">\n {{ paging.pageRecords | number:'1.0':'en-US' }} results\n </span>\n <ng-container *ngTemplateOutlet=\"sortedBy\"></ng-container>\n </ng-container>\n <fs-list-saved-filters class=\"saved-filters\"></fs-list-saved-filters>\n <fs-menu\n [hidden]=\"!paging.enabled\"\n #limitsMenu>\n <ng-template\n ngFor\n let-limit\n [ngForOf]=\"paging.limits\">\n <ng-template\n fs-menu-item\n (click)=\"setLimit(limit)\">\n {{ limit }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <fs-menu\n [hidden]=\"!sorting.sortingColumn || paging.pageRecords === 0\"\n #orderColumnsMenu>\n <!-- Real sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.sortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n <ng-container *ngIf=\"column.title; else sortByTemplate\">\n {{ column.title }}\n </ng-container>\n <ng-template #sortByTemplate>\n <ng-template [ngTemplateOutlet]=\"column.headerTemplate\"></ng-template>\n </ng-template>\n </ng-template>\n </ng-template>\n <!-- Fake sorting columns -->\n <ng-template\n ngFor\n let-column\n [ngForOf]=\"sorting.fakeSortingColumns\">\n <ng-template\n fs-menu-item\n (click)=\"setSortableColumn(column)\">\n {{ column.title }}\n </ng-template>\n </ng-template>\n </fs-menu>\n <ng-template #sortedBy>\n <ng-container *ngIf=\"sorting.sortingColumn\">\n sorted by\n <ng-container *ngIf=\"sorting.sortingColumn.title; else sortByTemplate\">\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n {{ sorting.sortingColumn.title }}\n </a>\n ,\n </ng-container>\n <ng-template #sortByTemplate>\n <a\n class=\"order-toggle\"\n [fsMenuTriggerFor]=\"orderColumnsMenu\">\n <ng-template [ngTemplateOutlet]=\"sorting.sortingColumn.headerTemplate\"></ng-template>\n </a>\n ,\n </ng-template>\n <a\n class=\"order-toggle\"\n (click)=\"toggleDirection()\">\n {{ sorting.sortingColumn.fullNameDirection }}\n </a>\n </ng-container>\n </ng-template>\n </small>\n</div>", styles: [":host.hidden-mobile{display:none!important}:host.first-load .status{visibility:hidden}.order-toggle{white-space:nowrap}a{cursor:pointer}mat-spinner{display:inline-block;margin:0 2px;vertical-align:middle}\n"] }]
5354
5378
  }], propDecorators: { list: [{
5355
5379
  type: Input
5356
5380
  }], rows: [{
@@ -5402,31 +5426,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
5402
5426
  }] } });
5403
5427
 
5404
5428
  class FsPaginationComponent {
5405
- _cdRef;
5406
5429
  pagination;
5407
5430
  rows;
5408
- _destroy$ = new Subject();
5409
- constructor(_cdRef) {
5410
- this._cdRef = _cdRef;
5431
+ first() {
5432
+ this.pagination.goFirst();
5411
5433
  }
5412
- ngOnInit() {
5413
- merge(this.pagination.pageChanged$, this.pagination.pages$)
5414
- .pipe(takeUntil(this._destroy$))
5415
- .subscribe(() => {
5416
- this._cdRef.markForCheck();
5417
- });
5434
+ prev() {
5435
+ this.pagination.goPrev();
5418
5436
  }
5419
- ngOnDestroy() {
5420
- this._destroy$.next(null);
5421
- this._destroy$.complete();
5437
+ next() {
5438
+ this.pagination.goNext();
5439
+ }
5440
+ last() {
5441
+ this.pagination.goLast();
5422
5442
  }
5423
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPaginationComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
5424
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsPaginationComponent, selector: "fs-list-pagination", inputs: { pagination: "pagination", rows: "rows" }, ngImport: i0, template: "@if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"firstPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n {{ pagination.statusLabel }}\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n} @else if (pagination.loadMoreEnabled) {\n@if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n mat-button\n type=\"button\"\n [class]=\"pagination.loadMoreButtonClass\"\n [color]=\"pagination.loadMoreButtonColor\"\n (click)=\"pagination.goNext()\">\n {{ pagination.loadMoreLabel }}\n </button>\n </div>\n}\n} @else {\n <ng-container *ngIf=\"pagination?.pages\"></ng-container>\n <ng-container *ngTemplateOutlet=\"firstPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <div class=\"number\">\n {{ pagination.page | fsFormatNumber }} of {{ pagination.pages | fsFormatNumber }}\n </div>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"last\"\n [class.disabled]=\"!pagination.hasNextPage\"\n (click)=\"pagination.goLast()\">\n <mat-icon>\n last_page\n </mat-icon>\n </a>\n}\n<ng-template #firstPageButton>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"first\"\n [class.disabled]=\"!pagination.hasPrevPage\"\n (click)=\"pagination.goFirst()\">\n <mat-icon>\n first_page\n </mat-icon>\n </a>\n</ng-template>\n<ng-template #prevPageButton>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"previous\"\n [class.disabled]=\"!pagination.hasPrevPage\"\n (click)=\"pagination.goPrev()\">\n <mat-icon>\n keyboard_arrow_left\n </mat-icon>\n </a>\n</ng-template>\n<ng-template #nextPageButton>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"next\"\n [class.disabled]=\"!pagination.hasNextPage\"\n (click)=\"pagination.goNext()\">\n <mat-icon>\n keyboard_arrow_right\n </mat-icon>\n </a>\n</ng-template>", styles: [":host{display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;width:100%}a{text-align:center;color:#000000de;text-decoration:none;font-size:15px;cursor:pointer;display:flex}a:not(.page){padding:10px}a.disabled{pointer-events:none;cursor:default;color:#d8d8d8}.number{font-size:90%}.fs-list-load-more button{width:100%;margin-top:10px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "pipe", type: i5$1.FsFormatNumberPipe, name: "fsFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5443
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5444
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsPaginationComponent, selector: "fs-list-pagination", inputs: { pagination: "pagination", rows: "rows" }, ngImport: i0, template: "<div class=\"pagination-container\">\n @if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"strategyMany\"></ng-container>\n } @else if (pagination.loadMoreEnabled) {\n <ng-container *ngTemplateOutlet=\"strategyLoadMore\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"strategyOffsetPage\"></ng-container>\n }\n</div>\n<ng-template #strategyLoadMore>\n @if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n mat-button\n type=\"button\"\n [class]=\"pagination.loadMoreButtonClass\"\n [color]=\"pagination.loadMoreButtonColor\"\n (click)=\"next()\">\n {{ pagination.loadMoreLabel }}\n </button>\n </div>\n }\n</ng-template>\n<ng-template #strategyOffsetPage>\n @if (pagination.pageRecords > 0) {\n <ng-container *ngIf=\"pagination?.pages\"></ng-container>\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page | fsFormatNumber }} of {{ pagination.pages | fsFormatNumber }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n }\n</ng-template>\n<ng-template #strategyMany>\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: true }\">\n </ng-container>\n</ng-template>\n<ng-template\n #firstPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"first\"\n [class.disabled]=\"disabled\"\n (click)=\"first()\">\n <mat-icon>\n first_page\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #prevPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"previous\"\n [class.disabled]=\"disabled\"\n (click)=\"prev()\">\n <mat-icon>\n keyboard_arrow_left\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #nextPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"next\"\n [class.disabled]=\"disabled\"\n (click)=\"next()\">\n <mat-icon>\n keyboard_arrow_right\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #lastPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"last\"\n [class.disabled]=\"disabled\"\n (click)=\"last()\">\n <mat-icon>\n last_page\n </mat-icon>\n </a>\n</ng-template>", styles: [".pagination-container{display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;width:100%}a{text-align:center;color:#000000de;text-decoration:none;font-size:15px;cursor:pointer;display:flex}a:not(.page){padding:10px}a.disabled{pointer-events:none;cursor:default;color:#d8d8d8}.number{font-size:90%}.fs-list-load-more button{width:100%;margin-top:10px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "pipe", type: i5$1.FsFormatNumberPipe, name: "fsFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5425
5445
  }
5426
5446
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPaginationComponent, decorators: [{
5427
5447
  type: Component,
5428
- args: [{ selector: 'fs-list-pagination', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"firstPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n {{ pagination.statusLabel }}\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n} @else if (pagination.loadMoreEnabled) {\n@if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n mat-button\n type=\"button\"\n [class]=\"pagination.loadMoreButtonClass\"\n [color]=\"pagination.loadMoreButtonColor\"\n (click)=\"pagination.goNext()\">\n {{ pagination.loadMoreLabel }}\n </button>\n </div>\n}\n} @else {\n <ng-container *ngIf=\"pagination?.pages\"></ng-container>\n <ng-container *ngTemplateOutlet=\"firstPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <div class=\"number\">\n {{ pagination.page | fsFormatNumber }} of {{ pagination.pages | fsFormatNumber }}\n </div>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"last\"\n [class.disabled]=\"!pagination.hasNextPage\"\n (click)=\"pagination.goLast()\">\n <mat-icon>\n last_page\n </mat-icon>\n </a>\n}\n<ng-template #firstPageButton>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"first\"\n [class.disabled]=\"!pagination.hasPrevPage\"\n (click)=\"pagination.goFirst()\">\n <mat-icon>\n first_page\n </mat-icon>\n </a>\n</ng-template>\n<ng-template #prevPageButton>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"previous\"\n [class.disabled]=\"!pagination.hasPrevPage\"\n (click)=\"pagination.goPrev()\">\n <mat-icon>\n keyboard_arrow_left\n </mat-icon>\n </a>\n</ng-template>\n<ng-template #nextPageButton>\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"next\"\n [class.disabled]=\"!pagination.hasNextPage\"\n (click)=\"pagination.goNext()\">\n <mat-icon>\n keyboard_arrow_right\n </mat-icon>\n </a>\n</ng-template>", styles: [":host{display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;width:100%}a{text-align:center;color:#000000de;text-decoration:none;font-size:15px;cursor:pointer;display:flex}a:not(.page){padding:10px}a.disabled{pointer-events:none;cursor:default;color:#d8d8d8}.number{font-size:90%}.fs-list-load-more button{width:100%;margin-top:10px}\n"] }]
5429
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { pagination: [{
5448
+ args: [{ selector: 'fs-list-pagination', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"pagination-container\">\n @if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"strategyMany\"></ng-container>\n } @else if (pagination.loadMoreEnabled) {\n <ng-container *ngTemplateOutlet=\"strategyLoadMore\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"strategyOffsetPage\"></ng-container>\n }\n</div>\n<ng-template #strategyLoadMore>\n @if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n mat-button\n type=\"button\"\n [class]=\"pagination.loadMoreButtonClass\"\n [color]=\"pagination.loadMoreButtonColor\"\n (click)=\"next()\">\n {{ pagination.loadMoreLabel }}\n </button>\n </div>\n }\n</ng-template>\n<ng-template #strategyOffsetPage>\n @if (pagination.pageRecords > 0) {\n <ng-container *ngIf=\"pagination?.pages\"></ng-container>\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page | fsFormatNumber }} of {{ pagination.pages | fsFormatNumber }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n }\n</ng-template>\n<ng-template #strategyMany>\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: true }\">\n </ng-container>\n</ng-template>\n<ng-template\n #firstPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"first\"\n [class.disabled]=\"disabled\"\n (click)=\"first()\">\n <mat-icon>\n first_page\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #prevPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"previous\"\n [class.disabled]=\"disabled\"\n (click)=\"prev()\">\n <mat-icon>\n keyboard_arrow_left\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #nextPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"next\"\n [class.disabled]=\"disabled\"\n (click)=\"next()\">\n <mat-icon>\n keyboard_arrow_right\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #lastPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"last\"\n [class.disabled]=\"disabled\"\n (click)=\"last()\">\n <mat-icon>\n last_page\n </mat-icon>\n </a>\n</ng-template>", styles: [".pagination-container{display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;width:100%}a{text-align:center;color:#000000de;text-decoration:none;font-size:15px;cursor:pointer;display:flex}a:not(.page){padding:10px}a.disabled{pointer-events:none;cursor:default;color:#d8d8d8}.number{font-size:90%}.fs-list-load-more button{width:100%;margin-top:10px}\n"] }]
5449
+ }], propDecorators: { pagination: [{
5430
5450
  type: Input
5431
5451
  }], rows: [{
5432
5452
  type: Input
@@ -5635,7 +5655,7 @@ class FsListComponent {
5635
5655
  }
5636
5656
  }
5637
5657
  filterReady() {
5638
- this.list.filtersReady$.next(null);
5658
+ this.list.filtersReady();
5639
5659
  this._filterParamsReady = true;
5640
5660
  this._emitFiltersReadyEvent();
5641
5661
  }