@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.
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
- import { TanstackTable } from './TanstakTable';
2
+ import { TanstackTable } from './TanstackTable';
3
3
  import { Person } from './mock-data/mock-data';
4
4
  declare const meta: Meta;
5
5
  export default meta;
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
- import { TanstackTable } from '../../TanstakTable';
2
+ import { TanstackTable } from '../../TanstackTable';
3
3
  import { Person } from '../../mock-data/mock-data';
4
4
  declare const meta: Meta;
5
5
  export default meta;
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
- import { TanstackTable } from '../../TanstakTable';
2
+ import { TanstackTable } from '../../TanstackTable';
3
3
  import { Person } from '../../mock-data/mock-data';
4
4
  declare const meta: Meta;
5
5
  export default meta;
@@ -1,2 +1,2 @@
1
1
  export type { ColumnDef, Row, Table } from '@tanstack/react-table';
2
- export { TanstackTable } from './TanstakTable';
2
+ export { TanstackTable } from './TanstackTable';
package/lib/index.esm.js CHANGED
@@ -41318,14 +41318,16 @@ function TanstackTable(_a) {
41318
41318
  defaultColumns,
41319
41319
  });
41320
41320
  const thRefs = useRef({});
41321
- // Sets formattedColumns with correct column widths
41321
+ // Auto-compute column widths based on current table header cell widths for columns without a defined size.
41322
41322
  useEffect(() => {
41323
- const updatedColumns = [];
41324
- formattedColumns.forEach((column) => {
41323
+ setFormattedColumns(formattedColumns.map((column) => {
41324
+ var _a;
41325
+ if ((_a = column.meta) === null || _a === void 0 ? void 0 : _a.styles.definedColumnSize) {
41326
+ return column;
41327
+ }
41325
41328
  const columnWidth = thRefs.current[column.id].offsetWidth;
41326
- updatedColumns.push(Object.assign(Object.assign({}, column), { size: columnWidth }));
41327
- });
41328
- setFormattedColumns(updatedColumns);
41329
+ return Object.assign(Object.assign({}, column), { size: columnWidth });
41330
+ }));
41329
41331
  }, [data, columns, windowWidth]);
41330
41332
  const table = useReactTable(Object.assign(Object.assign({}, rest), { data: data !== null && data !== void 0 ? data : defaultData, columns: formattedColumns, state: {
41331
41333
  rowSelection,