@sesamehr/react-design-system 2.0.0-beta.4 → 2.0.0-beta.5

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.
@@ -4,6 +4,14 @@ export interface TableSelectCellProps extends Omit<React.ComponentPropsWithoutRe
4
4
  /** Usually fixed to left */
5
5
  fixed?: boolean;
6
6
  fixedOffset?: string;
7
+ /**
8
+ * Whether this row can be selected at all.
9
+ *
10
+ * On the header cell it disables select-all, which is the right thing when
11
+ * nothing in the table can be selected — a checkbox that ticks and then
12
+ * selects nothing is worse than one that says so.
13
+ */
14
+ disabled?: boolean;
7
15
  onChange?: (checked: boolean) => void;
8
16
  }
9
17
  export declare const TableSelectCell: import('react').ForwardRefExoticComponent<TableSelectCellProps & import('react').RefAttributes<HTMLTableCellElement>>;
@@ -7,7 +7,7 @@ import { UseTableVirtualOptions, UseTableVirtualReturn } from './useTableVirtual
7
7
  * the other nine thousand nine hundred and eighty.
8
8
  *
9
9
  * ```tsx
10
- * const virtual = useTableVirtual(employees, { height: '480px' });
10
+ * const virtual = useTableVirtual(employees, { maxHeight: '480px' });
11
11
  *
12
12
  * <TableVirtualized virtualizer={virtual}>
13
13
  * <TableBody>
@@ -1,13 +1,25 @@
1
1
  import { RefObject } from 'react';
2
2
  export interface UseTableVirtualOptions {
3
3
  /**
4
- * How tall the table's scrollport is, as a CSS length.
4
+ * How tall the table's scrollport is allowed to get, as a CSS length.
5
+ *
6
+ * A ceiling rather than a measurement: given fewer rows than it has room
7
+ * for, the table shrinks to them instead of leaving empty space under the
8
+ * last one.
9
+ *
10
+ * Any length the browser understands: `'480px'`, `'30vh'`,
11
+ * `'calc(100vh - 12rem)'`. It is written straight onto the element and the
12
+ * window is worked out from what that element ends up measuring, so nothing
13
+ * here cares which unit you used. `'100%'` works too, as long as whatever
14
+ * contains the table has a height of its own — a percentage of `auto` is
15
+ * `auto`, and a table that grows to fit its rows is the one case this cannot
16
+ * work with.
5
17
  *
6
18
  * Virtualising needs one. A table that grows to fit its rows has no scrollbar
7
19
  * of its own — the page scrolls instead — and with nothing scrolling there is
8
20
  * no position to work a window out from.
9
21
  */
10
- height?: string;
22
+ maxHeight?: string;
11
23
  /**
12
24
  * How tall one row is, in pixels.
13
25
  *
@@ -48,7 +60,7 @@ export interface UseTableVirtualReturn<TData> {
48
60
  * stopped from taking it over.
49
61
  */
50
62
  claim: (element: HTMLElement | null) => void;
51
- height: string | undefined;
63
+ maxHeight: string | undefined;
52
64
  /** The height of everything above the window, and of everything below it. */
53
65
  padStart: number;
54
66
  padEnd: number;