@ascentgl/ads-ui 21.117.0 → 21.118.0
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.
|
@@ -9190,8 +9190,9 @@ class AdsTableComponent {
|
|
|
9190
9190
|
if (this.gridApi) {
|
|
9191
9191
|
this.gridApi.onFilterChanged();
|
|
9192
9192
|
this.updateFilteringState();
|
|
9193
|
+
// Refresh headers immediately to apply active class
|
|
9193
9194
|
if (this.enableCustomSortFilter) {
|
|
9194
|
-
this.
|
|
9195
|
+
this.gridApi.refreshHeader();
|
|
9195
9196
|
}
|
|
9196
9197
|
}
|
|
9197
9198
|
// Emit event for external listeners
|
|
@@ -9208,8 +9209,9 @@ class AdsTableComponent {
|
|
|
9208
9209
|
if (this.gridApi) {
|
|
9209
9210
|
this.gridApi.onFilterChanged();
|
|
9210
9211
|
this.updateFilteringState();
|
|
9212
|
+
// Refresh headers immediately to remove active class
|
|
9211
9213
|
if (this.enableCustomSortFilter) {
|
|
9212
|
-
this.
|
|
9214
|
+
this.gridApi.refreshHeader();
|
|
9213
9215
|
}
|
|
9214
9216
|
}
|
|
9215
9217
|
// Emit event for each removed field
|
|
@@ -9233,6 +9235,14 @@ class AdsTableComponent {
|
|
|
9233
9235
|
onSortMenuSortChanged(event) {
|
|
9234
9236
|
if (!this.gridApi)
|
|
9235
9237
|
return;
|
|
9238
|
+
// Update columnSortStates signal so custom headers reflect the active state
|
|
9239
|
+
const newSortStates = new Map();
|
|
9240
|
+
event.sorts.forEach(s => {
|
|
9241
|
+
if (s.direction) {
|
|
9242
|
+
newSortStates.set(s.field, s.direction);
|
|
9243
|
+
}
|
|
9244
|
+
});
|
|
9245
|
+
this.columnSortStates.set(newSortStates);
|
|
9236
9246
|
// Build column state for AG Grid with sort indexes
|
|
9237
9247
|
const sortState = event.sorts.map((s, index) => ({
|
|
9238
9248
|
colId: s.field,
|
|
@@ -9245,11 +9255,19 @@ class AdsTableComponent {
|
|
|
9245
9255
|
defaultState: { sort: null },
|
|
9246
9256
|
});
|
|
9247
9257
|
this.updateSortingState();
|
|
9258
|
+
// Refresh headers to apply active class
|
|
9259
|
+
if (this.enableCustomSortFilter) {
|
|
9260
|
+
this.gridApi.refreshHeader();
|
|
9261
|
+
}
|
|
9248
9262
|
}
|
|
9249
9263
|
/** @ignore - Handle sort removal from sort menu */
|
|
9250
9264
|
onSortMenuSortsRemoved(fields) {
|
|
9251
9265
|
if (!this.gridApi)
|
|
9252
9266
|
return;
|
|
9267
|
+
// Update columnSortStates signal
|
|
9268
|
+
const newStates = new Map(this.columnSortStates());
|
|
9269
|
+
fields.forEach(field => newStates.delete(field));
|
|
9270
|
+
this.columnSortStates.set(newStates);
|
|
9253
9271
|
// Clear sort for the removed fields
|
|
9254
9272
|
const clearState = fields.map(field => ({
|
|
9255
9273
|
colId: field,
|
|
@@ -9257,6 +9275,10 @@ class AdsTableComponent {
|
|
|
9257
9275
|
}));
|
|
9258
9276
|
this.gridApi.applyColumnState({ state: clearState });
|
|
9259
9277
|
this.updateSortingState();
|
|
9278
|
+
// Refresh headers to remove active class
|
|
9279
|
+
if (this.enableCustomSortFilter) {
|
|
9280
|
+
this.gridApi.refreshHeader();
|
|
9281
|
+
}
|
|
9260
9282
|
}
|
|
9261
9283
|
/** @ignore */
|
|
9262
9284
|
updateFilteringState() {
|