@one-paragon/angular-utilities 2.4.1 → 2.4.3
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.
|
@@ -3163,12 +3163,12 @@ class TableStore extends ComponentStore {
|
|
|
3163
3163
|
let nextSort;
|
|
3164
3164
|
switch (currentGroupBy.sort) {
|
|
3165
3165
|
case '':
|
|
3166
|
-
nextSort = 'asc';
|
|
3167
|
-
break;
|
|
3168
|
-
case 'asc':
|
|
3169
3166
|
nextSort = 'desc';
|
|
3170
3167
|
break;
|
|
3171
3168
|
case 'desc':
|
|
3169
|
+
nextSort = 'asc';
|
|
3170
|
+
break;
|
|
3171
|
+
case 'asc':
|
|
3172
3172
|
nextSort = '';
|
|
3173
3173
|
break;
|
|
3174
3174
|
}
|
|
@@ -4509,7 +4509,11 @@ class GenericTableComponent {
|
|
|
4509
4509
|
const trackBy = this.$trackBy();
|
|
4510
4510
|
if (!trackBy)
|
|
4511
4511
|
return (index, item) => isGroupHeader(item) ? `${item.level}-${item[initIndexSymbol]}` : item[initIndexSymbol];
|
|
4512
|
-
return ((index, item) =>
|
|
4512
|
+
return ((index, item) => {
|
|
4513
|
+
if (isGroupHeader(item))
|
|
4514
|
+
return `${item.level}-${item[initIndexSymbol]}`;
|
|
4515
|
+
return typeof trackBy === 'function' ? trackBy(item) : item[trackBy];
|
|
4516
|
+
});
|
|
4513
4517
|
});
|
|
4514
4518
|
this.$hasFooterMeta = computed(() => this.state.$metaDataArray().some(md => !!md.additional?.footer));
|
|
4515
4519
|
this.$hasCustomFooter = computed(() => this.$columnInfos()?.some(ci => !!ci.customCell?.columnDef?.footerCell));
|
|
@@ -4603,7 +4607,8 @@ class GenericTableComponent {
|
|
|
4603
4607
|
this.$selection = computed(() => {
|
|
4604
4608
|
const trackBy = this.$trackBy();
|
|
4605
4609
|
if (trackBy) {
|
|
4606
|
-
|
|
4610
|
+
const trackByFn = typeof trackBy === 'function' ? trackBy : (item) => item[trackBy];
|
|
4611
|
+
return new SelectionModel(true, [], true, (a, b) => trackByFn(a) === trackByFn(b));
|
|
4607
4612
|
}
|
|
4608
4613
|
return new SelectionModel(true, []);
|
|
4609
4614
|
});
|
|
@@ -4662,7 +4667,12 @@ class GenericTableComponent {
|
|
|
4662
4667
|
if (!selected.length)
|
|
4663
4668
|
return;
|
|
4664
4669
|
const trackBy = this.$trackBy();
|
|
4665
|
-
const trackByFunc = trackBy ?
|
|
4670
|
+
const trackByFunc = trackBy ?
|
|
4671
|
+
(s) => {
|
|
4672
|
+
const trackByFn = typeof trackBy === 'function' ? trackBy : (item) => item[trackBy];
|
|
4673
|
+
return selectableData.every(d => trackByFn(d) !== trackByFn(s));
|
|
4674
|
+
}
|
|
4675
|
+
: s => !selectableData.includes(s);
|
|
4666
4676
|
const removed = selected.filter(trackByFunc);
|
|
4667
4677
|
this.$selection().deselect(...removed);
|
|
4668
4678
|
});
|