@firestitch/list 9.9.10 → 9.9.11

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.
@@ -60,4 +60,5 @@ export declare class SortingController {
60
60
  private _setSortingColumn;
61
61
  private _setSortingDirection;
62
62
  private _notifySortChanged;
63
+ private _trySortByDefaultSortableColumn;
63
64
  }
@@ -7,6 +7,7 @@ export declare class FsListColumnDirective {
7
7
  show: boolean;
8
8
  customize: boolean;
9
9
  sortable: boolean;
10
+ sortableDefault: boolean;
10
11
  direction: 'asc' | 'desc';
11
12
  align: string;
12
13
  width: string;
@@ -12,6 +12,7 @@ export declare class Column extends Model {
12
12
  customize: boolean;
13
13
  width: string;
14
14
  sortable: boolean;
15
+ sortableDefault: boolean;
15
16
  headerTemplate: TemplateRef<any>;
16
17
  groupCellTemplate: TemplateRef<any>;
17
18
  cellTemplate: TemplateRef<any>;
@@ -34,6 +35,7 @@ export declare class Column extends Model {
34
35
  get fullNameDirection(): "Ascending" | "Descending";
35
36
  get ordered(): boolean;
36
37
  set ordered(value: boolean);
38
+ _fromJSON(value: any): void;
37
39
  /**
38
40
  * Merge with defaults with existing config
39
41
  * @param defaults
@@ -363,6 +363,12 @@
363
363
  enumerable: true,
364
364
  configurable: true
365
365
  });
366
+ Column.prototype._fromJSON = function (value) {
367
+ _super.prototype._fromJSON.call(this, value);
368
+ if (this.sortableDefault) {
369
+ this.sortable = true;
370
+ }
371
+ };
366
372
  /**
367
373
  * Merge with defaults with existing config
368
374
  * @param defaults
@@ -446,6 +452,10 @@
446
452
  tsmodels.Alias(),
447
453
  __metadata("design:type", Boolean)
448
454
  ], Column.prototype, "sortable", void 0);
455
+ __decorate([
456
+ tsmodels.Alias(),
457
+ __metadata("design:type", Boolean)
458
+ ], Column.prototype, "sortableDefault", void 0);
449
459
  __decorate([
450
460
  tsmodels.Alias(),
451
461
  __metadata("design:type", core.TemplateRef)
@@ -2717,7 +2727,10 @@
2717
2727
  SortingController.prototype.initialSortBy = function (sort) {
2718
2728
  this._initialization = true;
2719
2729
  if (!sort) {
2720
- this.sortByFirstSortbale();
2730
+ this._trySortByDefaultSortableColumn();
2731
+ if (!this.sortingColumn) {
2732
+ this.sortByFirstSortbale();
2733
+ }
2721
2734
  this._initialization = false;
2722
2735
  return;
2723
2736
  }
@@ -2784,6 +2797,13 @@
2784
2797
  sortDirection: this.sortingColumn.direction
2785
2798
  });
2786
2799
  };
2800
+ SortingController.prototype._trySortByDefaultSortableColumn = function () {
2801
+ var sortableDefault = this.sortingColumns
2802
+ .find(function (column) { return column.sortableDefault; });
2803
+ if (sortableDefault) {
2804
+ this.sortByColumnWithName(sortableDefault.name);
2805
+ }
2806
+ };
2787
2807
  return SortingController;
2788
2808
  }());
2789
2809
 
@@ -4044,6 +4064,10 @@
4044
4064
  core.Input(),
4045
4065
  __metadata("design:type", Boolean)
4046
4066
  ], FsListColumnDirective.prototype, "sortable", void 0);
4067
+ __decorate([
4068
+ core.Input(),
4069
+ __metadata("design:type", Boolean)
4070
+ ], FsListColumnDirective.prototype, "sortableDefault", void 0);
4047
4071
  __decorate([
4048
4072
  core.Input(),
4049
4073
  __metadata("design:type", String)