@ascentgl/ads-ui 21.60.0 → 21.61.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.
|
@@ -7141,6 +7141,8 @@ class AdsColumnSortFilterMenuComponent {
|
|
|
7141
7141
|
// If selectedFilterValues has some values, use those
|
|
7142
7142
|
const allOptionsSelected = this.selectedFilterValues.length === this.config.filterOptions.length &&
|
|
7143
7143
|
this.config.filterOptions.every(opt => this.selectedFilterValues.includes(opt));
|
|
7144
|
+
// Get the value formatter if provided
|
|
7145
|
+
const formatter = this.config.filterValueFormatter;
|
|
7144
7146
|
const options = this.config.filterOptions.map((value) => {
|
|
7145
7147
|
// If all options match selectedFilterValues, treat as all selected
|
|
7146
7148
|
// Otherwise, check if this specific value is in selectedFilterValues
|
|
@@ -7153,9 +7155,11 @@ class AdsColumnSortFilterMenuComponent {
|
|
|
7153
7155
|
}
|
|
7154
7156
|
});
|
|
7155
7157
|
this.optionSubscriptions.push(subscription);
|
|
7158
|
+
// Use formatter if provided, otherwise use value as-is
|
|
7159
|
+
const label = formatter ? formatter(value) : value;
|
|
7156
7160
|
return {
|
|
7157
7161
|
value,
|
|
7158
|
-
label
|
|
7162
|
+
label,
|
|
7159
7163
|
control,
|
|
7160
7164
|
};
|
|
7161
7165
|
});
|
|
@@ -7574,7 +7578,10 @@ class AdsTableComponent {
|
|
|
7574
7578
|
// For columns without explicit config (like supplier, destination),
|
|
7575
7579
|
// always apply the filter based on selectedValues
|
|
7576
7580
|
const cellValue = node.data[field];
|
|
7577
|
-
|
|
7581
|
+
// For objects, use JSON.stringify to match the format used in filterOptions
|
|
7582
|
+
const cellValueStr = cellValue != null
|
|
7583
|
+
? (typeof cellValue === 'object' ? JSON.stringify(cellValue) : String(cellValue))
|
|
7584
|
+
: '';
|
|
7578
7585
|
if (!selectedValues.includes(cellValueStr)) {
|
|
7579
7586
|
return false;
|
|
7580
7587
|
}
|
|
@@ -7961,7 +7968,10 @@ class AdsTableComponent {
|
|
|
7961
7968
|
this.rowData.forEach(row => {
|
|
7962
7969
|
const value = row[field];
|
|
7963
7970
|
if (value !== null && value !== undefined) {
|
|
7964
|
-
|
|
7971
|
+
// For objects, use JSON.stringify to preserve the full data structure
|
|
7972
|
+
// This allows filterValueFormatter to parse and format it properly
|
|
7973
|
+
const stringValue = typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
7974
|
+
uniqueValues.add(stringValue);
|
|
7965
7975
|
}
|
|
7966
7976
|
});
|
|
7967
7977
|
const result = Array.from(uniqueValues).sort();
|
|
@@ -7999,7 +8009,9 @@ class AdsTableComponent {
|
|
|
7999
8009
|
if (this.doesRowPassFiltersExcluding(row, field)) {
|
|
8000
8010
|
const value = row[field];
|
|
8001
8011
|
if (value !== null && value !== undefined) {
|
|
8002
|
-
|
|
8012
|
+
// For objects, use JSON.stringify to preserve the full data structure
|
|
8013
|
+
const stringValue = typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
8014
|
+
uniqueValues.add(stringValue);
|
|
8003
8015
|
}
|
|
8004
8016
|
}
|
|
8005
8017
|
});
|
|
@@ -8059,7 +8071,10 @@ class AdsTableComponent {
|
|
|
8059
8071
|
return false;
|
|
8060
8072
|
}
|
|
8061
8073
|
const cellValue = row[field];
|
|
8062
|
-
|
|
8074
|
+
// For objects, use JSON.stringify to match the format used in filterOptions
|
|
8075
|
+
const cellValueStr = cellValue != null
|
|
8076
|
+
? (typeof cellValue === 'object' ? JSON.stringify(cellValue) : String(cellValue))
|
|
8077
|
+
: '';
|
|
8063
8078
|
if (!selectedValues.includes(cellValueStr)) {
|
|
8064
8079
|
return false;
|
|
8065
8080
|
}
|