@indico-data/design-system 2.59.0 → 2.59.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/lib/index.js CHANGED
@@ -41343,14 +41343,16 @@ function TanstackTable(_a) {
41343
41343
  defaultColumns,
41344
41344
  });
41345
41345
  const thRefs = React.useRef({});
41346
- // Sets formattedColumns with correct column widths
41346
+ // Auto-compute column widths based on current table header cell widths for columns without a defined size.
41347
41347
  React.useEffect(() => {
41348
- const updatedColumns = [];
41349
- formattedColumns.forEach((column) => {
41348
+ setFormattedColumns(formattedColumns.map((column) => {
41349
+ var _a;
41350
+ if ((_a = column.meta) === null || _a === void 0 ? void 0 : _a.styles.definedColumnSize) {
41351
+ return column;
41352
+ }
41350
41353
  const columnWidth = thRefs.current[column.id].offsetWidth;
41351
- updatedColumns.push(Object.assign(Object.assign({}, column), { size: columnWidth }));
41352
- });
41353
- setFormattedColumns(updatedColumns);
41354
+ return Object.assign(Object.assign({}, column), { size: columnWidth });
41355
+ }));
41354
41356
  }, [data, columns, windowWidth]);
41355
41357
  const table = useReactTable(Object.assign(Object.assign({}, rest), { data: data !== null && data !== void 0 ? data : defaultData, columns: formattedColumns, state: {
41356
41358
  rowSelection,