@firestitch/list 18.0.27 → 18.0.29

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.
@@ -2374,9 +2374,11 @@ class PersistanceController {
2374
2374
  columnsEnabled = false;
2375
2375
  pagingEnabled = false;
2376
2376
  sortingEnabled = false;
2377
+ queryEnabled = false;
2378
+ name;
2377
2379
  _store = inject(FsStore);
2378
- _name;
2379
2380
  _data = {};
2381
+ _storeKey = 'fs-list-persist';
2380
2382
  _location = inject(Location);
2381
2383
  init(listConfig, inDialog) {
2382
2384
  const config = this._initConfig(listConfig, inDialog);
@@ -2385,7 +2387,8 @@ class PersistanceController {
2385
2387
  this.columnsEnabled = config.persistColumn;
2386
2388
  this.pagingEnabled = config.persistPaging;
2387
2389
  this.sortingEnabled = config.persistSorting;
2388
- this._name = config.name;
2390
+ this.queryEnabled = config.persistQuery;
2391
+ this.name = config.name;
2389
2392
  this._data = this._get() || {};
2390
2393
  }
2391
2394
  }
@@ -2409,32 +2412,34 @@ class PersistanceController {
2409
2412
  }
2410
2413
  _set(key, value) {
2411
2414
  this._data[key] = value;
2412
- const storeData = this._store.get('fs-list-persist') || {};
2413
- storeData[this._name] = this._data;
2414
- this._store.set('fs-list-persist', storeData);
2415
+ const storeData = this._store.get(this._storeKey) || {};
2416
+ storeData[this.name] = this._data;
2417
+ this._store.set(this._storeKey, storeData);
2415
2418
  }
2416
2419
  _get() {
2417
- const storeData = this._store.get('fs-list-persist');
2420
+ const storeData = this._store.get(this._storeKey);
2418
2421
  if (storeData) {
2419
- return storeData[this._name];
2422
+ return storeData[this.name];
2420
2423
  }
2421
2424
  return {};
2422
2425
  }
2423
2426
  _initConfig(config, inDialog) {
2424
- let persistanceConfig = this._getDefaultConfig(config);
2427
+ let persistanceConfig = this._getConfig(config);
2425
2428
  if (persistanceConfig) {
2429
+ const persist = !inDialog || !!persistanceConfig.name;
2426
2430
  persistanceConfig = {
2427
2431
  name: persistanceConfig.name || getNormalizedPath(this._location),
2428
- persistFilter: !inDialog || !!persistanceConfig.name,
2429
- persistPaging: !inDialog || !!persistanceConfig.name,
2430
- persistSorting: !inDialog || !!persistanceConfig.name,
2431
- persistColumn: !inDialog || !!persistanceConfig.name,
2432
+ persistFilter: persist,
2433
+ persistPaging: persist,
2434
+ persistSorting: persist,
2435
+ persistColumn: persist,
2436
+ persistQuery: persist,
2432
2437
  ...persistanceConfig,
2433
2438
  };
2434
2439
  }
2435
2440
  return persistanceConfig;
2436
2441
  }
2437
- _getDefaultConfig(config) {
2442
+ _getConfig(config) {
2438
2443
  if (config) {
2439
2444
  return {
2440
2445
  ...(config === true ? {} : config),
@@ -4882,7 +4887,6 @@ class List {
4882
4887
  : null;
4883
4888
  // Config
4884
4889
  this.filterConfig = {
4885
- persist: this.persist,
4886
4890
  items: this.filters || [],
4887
4891
  savedFilters: this.savedFilters,
4888
4892
  actions: this.actions.actions,
@@ -4897,6 +4901,12 @@ class List {
4897
4901
  reload: (this._config.reload ?? true) ? this.reload.bind(this) : null,
4898
4902
  sortChange: this._filterSort.bind(this),
4899
4903
  };
4904
+ if (this._persistance.queryEnabled) {
4905
+ this.filterConfig.persist = {
4906
+ name: this._persistance.name,
4907
+ persistQuery: true,
4908
+ };
4909
+ }
4900
4910
  }
4901
4911
  /**
4902
4912
  * Callback when Filter has been initialized
@@ -5099,6 +5109,9 @@ class FsListCellDirective {
5099
5109
  colspan;
5100
5110
  align;
5101
5111
  className;
5112
+ static ngTemplateContextGuard(directive, context) {
5113
+ return true;
5114
+ }
5102
5115
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsListCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5103
5116
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: FsListCellDirective, selector: "[fs-list-cell]", inputs: { colspan: "colspan", align: "align", className: ["class", "className"] }, ngImport: i0 });
5104
5117
  }