@fuentis/phoenix-ui 0.0.9-alpha.239 → 0.0.9-alpha.241

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.
@@ -1759,7 +1759,9 @@ class TableCaptionComponent {
1759
1759
  this.applyFilters();
1760
1760
  });
1761
1761
  }
1762
- this._selectedColumns = [...this.columns];
1762
+ const filterVisibleColumns = this.columns.filter((c) => !c.hidden);
1763
+ this._selectedColumns = filterVisibleColumns;
1764
+ console.log(filterVisibleColumns);
1763
1765
  if (this._selectedColumns) {
1764
1766
  this.globalFilterFields = this._selectedColumns
1765
1767
  .filter((sc) => sc.columnType === tableColumnType.TEXT && sc.filter === undefined)
@@ -1799,6 +1801,10 @@ class TableCaptionComponent {
1799
1801
  this.selectedColumns = JSON.parse(stored);
1800
1802
  }
1801
1803
  }
1804
+ //if no stored columns in localStorage take user configuration (important becase there are hidden cols by default)
1805
+ const selectedColumnKeys = this._selectedColumns.map((col) => col.field);
1806
+ this.applyColumnsEvent.emit(selectedColumnKeys);
1807
+ this.selectedColumns = this._selectedColumns;
1802
1808
  }
1803
1809
  hasFormValues() {
1804
1810
  const formValues = this.filtersForm.value;
@@ -2054,7 +2060,6 @@ class TableComponent {
2054
2060
  const order = sortMeta.order;
2055
2061
  let valueA = this.getComparableValue(this.getNestedValue(a, field), field);
2056
2062
  let valueB = this.getComparableValue(this.getNestedValue(b, field), field);
2057
- console.log(`[SORT] ${field}:`, valueA, valueB);
2058
2063
  if (valueA < valueB)
2059
2064
  return -1 * order;
2060
2065
  if (valueA > valueB)
@@ -2209,7 +2214,6 @@ class TableComponent {
2209
2214
  }
2210
2215
  }
2211
2216
  applyColumns(selected) {
2212
- console.log('trigg');
2213
2217
  this.selectedColumns = this.columns.filter((col) => selected.includes(col.field));
2214
2218
  }
2215
2219
  onRowClick(event, rowData) {