@ascentgl/ads-ui 21.50.0 → 21.51.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.
@@ -7909,9 +7909,34 @@ class AdsTableComponent {
7909
7909
  }
7910
7910
  }
7911
7911
  // ============ Custom Sort/Filter Menu Methods ============
7912
+ /** @ignore - Extract unique values from a column in rowData */
7913
+ getUniqueColumnValues(field) {
7914
+ if (!this.rowData || this.rowData.length === 0) {
7915
+ return [];
7916
+ }
7917
+ const uniqueValues = new Set();
7918
+ this.rowData.forEach(row => {
7919
+ const value = row[field];
7920
+ if (value !== null && value !== undefined) {
7921
+ uniqueValues.add(String(value));
7922
+ }
7923
+ });
7924
+ return Array.from(uniqueValues).sort();
7925
+ }
7912
7926
  /** @ignore */
7913
7927
  getColumnSortFilterConfig(field) {
7914
- return this.columnSortFilterConfigs.find(config => config.field === field);
7928
+ const config = this.columnSortFilterConfigs.find(config => config.field === field);
7929
+ if (!config) {
7930
+ return undefined;
7931
+ }
7932
+ // Auto-populate filterOptions from rowData if not provided
7933
+ if (!config.filterOptions || config.filterOptions.length === 0) {
7934
+ return {
7935
+ ...config,
7936
+ filterOptions: this.getUniqueColumnValues(field),
7937
+ };
7938
+ }
7939
+ return config;
7915
7940
  }
7916
7941
  /** @ignore */
7917
7942
  getColumnSortDirection(field) {