@sustaina/shared-ui 1.9.0 → 1.9.1

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.
package/dist/index.mjs CHANGED
@@ -8550,7 +8550,7 @@ var useGridSettingsStore = create(
8550
8550
  },
8551
8551
  syncColumnsState: (table, options) => {
8552
8552
  const { availableColumns, currentColumns } = get().extractColumns(table);
8553
- const { excludeColumns = [], labelMap = {} } = options || {};
8553
+ const { excludeColumns = [], labelMap = {}, visibility = {} } = options || {};
8554
8554
  const filteredExcludeColumnFn = (column) => !excludeColumns.includes(column.id);
8555
8555
  const mapLabel = (col) => ({
8556
8556
  id: col.id,
@@ -8558,7 +8558,14 @@ var useGridSettingsStore = create(
8558
8558
  });
8559
8559
  set({
8560
8560
  availableColumns: availableColumns.filter(filteredExcludeColumnFn).map(mapLabel),
8561
- currentColumns: currentColumns.filter(filteredExcludeColumnFn).map(mapLabel)
8561
+ currentColumns: currentColumns.filter(filteredExcludeColumnFn).filter((column) => {
8562
+ for (const [columnId, isVisible] of Object.entries(visibility)) {
8563
+ if (column.id === columnId && !isVisible) {
8564
+ return false;
8565
+ }
8566
+ }
8567
+ return true;
8568
+ }).map(mapLabel)
8562
8569
  });
8563
8570
  }
8564
8571
  })