@recursyve/nice-data-filter-kit 13.0.5 → 13.0.6

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.
@@ -282,9 +282,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
282
282
  }] });
283
283
 
284
284
  class TableColumns {
285
- constructor(id, sortable = true) {
285
+ constructor(id, sortable = true, nullLast = false) {
286
286
  this.id = id;
287
287
  this.sortable = sortable;
288
+ this.nullLast = nullLast;
288
289
  }
289
290
  }
290
291
 
@@ -1786,6 +1787,7 @@ class NiceBaseListComponent {
1786
1787
  }));
1787
1788
  }
1788
1789
  onUpdateSort(sort) {
1790
+ const nullLast = this.columns.find((x) => x.id === sort.active)?.nullLast;
1789
1791
  if (!sort.active || !sort.direction) {
1790
1792
  sort = {
1791
1793
  active: "id",
@@ -1793,7 +1795,7 @@ class NiceBaseListComponent {
1793
1795
  };
1794
1796
  }
1795
1797
  this.service.loadData({
1796
- order: sort.active && sort.direction ? { column: sort.active, direction: sort.direction } : null
1798
+ order: sort.active && sort.direction ? { column: sort.active, direction: sort.direction, nullLast } : null
1797
1799
  });
1798
1800
  }
1799
1801
  updateRule(id, newRule) {
@@ -2429,8 +2431,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
2429
2431
 
2430
2432
  class StringUtils {
2431
2433
  }
2432
- String.prototype.toTableColumn = function (sortable) {
2433
- return new TableColumns(this.toString(), sortable);
2434
+ // tslint:disable-next-line:max-line-length
2435
+ String.prototype.toTableColumn = function (sortableOrOptions, nullLast) {
2436
+ const options = typeof sortableOrOptions === "object" ? sortableOrOptions : { sortable: sortableOrOptions, nullLast };
2437
+ return new TableColumns(this.toString(), options.sortable, options.sortable);
2434
2438
  };
2435
2439
 
2436
2440
  /*