@ascentgl/ads-ui 21.77.0 → 21.78.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.
|
@@ -8116,13 +8116,19 @@ class AdsTableComponent {
|
|
|
8116
8116
|
if (!this.rowData || this.rowData.length === 0) {
|
|
8117
8117
|
return [];
|
|
8118
8118
|
}
|
|
8119
|
-
// Check cache first
|
|
8120
|
-
const cacheKey = `${field}_v${this.dataVersion}`;
|
|
8121
|
-
const cached = this.uniqueColumnValuesCache.get(cacheKey);
|
|
8122
|
-
if (cached) {
|
|
8123
|
-
return cached;
|
|
8124
|
-
}
|
|
8125
8119
|
const formatter = this.getFilterValueFormatterForField(field);
|
|
8120
|
+
// Don't cache results when a filterValueFormatter is configured,
|
|
8121
|
+
// because the formatter output may change over time (e.g., timezone service
|
|
8122
|
+
// becoming ready, user changing timezone). Caching could cause stale values
|
|
8123
|
+
// that mismatch with doesExternalFilterPass comparisons.
|
|
8124
|
+
if (!formatter) {
|
|
8125
|
+
// Check cache first (only for fields without formatter)
|
|
8126
|
+
const cacheKey = `${field}_v${this.dataVersion}`;
|
|
8127
|
+
const cached = this.uniqueColumnValuesCache.get(cacheKey);
|
|
8128
|
+
if (cached) {
|
|
8129
|
+
return cached;
|
|
8130
|
+
}
|
|
8131
|
+
}
|
|
8126
8132
|
// Use a Map to dedupe by serialized key while preserving raw values
|
|
8127
8133
|
const byKey = new Map();
|
|
8128
8134
|
this.rowData.forEach(row => {
|
|
@@ -8140,8 +8146,11 @@ class AdsTableComponent {
|
|
|
8140
8146
|
const result = Array.from(byKey.entries())
|
|
8141
8147
|
.sort(([a], [b]) => a.localeCompare(b))
|
|
8142
8148
|
.map(([, v]) => v);
|
|
8143
|
-
// Cache the result
|
|
8144
|
-
|
|
8149
|
+
// Cache the result only for fields without formatter
|
|
8150
|
+
if (!formatter) {
|
|
8151
|
+
const cacheKey = `${field}_v${this.dataVersion}`;
|
|
8152
|
+
this.uniqueColumnValuesCache.set(cacheKey, result);
|
|
8153
|
+
}
|
|
8145
8154
|
return result;
|
|
8146
8155
|
}
|
|
8147
8156
|
/**
|
|
@@ -8154,21 +8163,27 @@ class AdsTableComponent {
|
|
|
8154
8163
|
if (!this.rowData || this.rowData.length === 0) {
|
|
8155
8164
|
return [];
|
|
8156
8165
|
}
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8166
|
+
const formatter = this.getFilterValueFormatterForField(field);
|
|
8167
|
+
// Don't cache results when a filterValueFormatter is configured (same reason as getUniqueColumnValues)
|
|
8168
|
+
if (!formatter) {
|
|
8169
|
+
// Check cache first (only for fields without formatter)
|
|
8170
|
+
const cacheKey = `${field}_v${this.filterCacheVersion}`;
|
|
8171
|
+
const cached = this.filteredColumnValuesCache.get(cacheKey);
|
|
8172
|
+
if (cached) {
|
|
8173
|
+
return cached;
|
|
8174
|
+
}
|
|
8162
8175
|
}
|
|
8163
8176
|
// Check if any filter is active (excluding the current field)
|
|
8164
8177
|
const hasOtherActiveFilters = this.hasActiveFiltersExcluding(field);
|
|
8165
8178
|
// If no other filters are active, return all unique values
|
|
8166
8179
|
if (!hasOtherActiveFilters) {
|
|
8167
8180
|
const values = this.getUniqueColumnValues(field);
|
|
8168
|
-
|
|
8181
|
+
if (!formatter) {
|
|
8182
|
+
const cacheKey = `${field}_v${this.filterCacheVersion}`;
|
|
8183
|
+
this.filteredColumnValuesCache.set(cacheKey, values);
|
|
8184
|
+
}
|
|
8169
8185
|
return values;
|
|
8170
8186
|
}
|
|
8171
|
-
const formatter = this.getFilterValueFormatterForField(field);
|
|
8172
8187
|
// Use a Map to dedupe by serialized key while preserving raw values
|
|
8173
8188
|
const byKey = new Map();
|
|
8174
8189
|
// Iterate through all rows and check if they pass filters from OTHER columns
|
|
@@ -8194,8 +8209,11 @@ class AdsTableComponent {
|
|
|
8194
8209
|
.sort(([a], [b]) => a.localeCompare(b))
|
|
8195
8210
|
.map(([, v]) => v);
|
|
8196
8211
|
}
|
|
8197
|
-
// Cache the result
|
|
8198
|
-
|
|
8212
|
+
// Cache the result only for fields without formatter
|
|
8213
|
+
if (!formatter) {
|
|
8214
|
+
const cacheKey = `${field}_v${this.filterCacheVersion}`;
|
|
8215
|
+
this.filteredColumnValuesCache.set(cacheKey, result);
|
|
8216
|
+
}
|
|
8199
8217
|
return result;
|
|
8200
8218
|
}
|
|
8201
8219
|
/** @ignore - Invalidate the filtered column values cache */
|