canny-ui-react 6.2.1 → 6.3.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/components/DataTable/DataTable.d.ts +18 -2
- package/dist/components/Input/Input.types.d.ts +6 -0
- package/dist/index.cjs +46 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5965 -6519
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -5,8 +5,8 @@ export type RowId = string | number;
|
|
|
5
5
|
export interface DataTableColumn<R = Record<string, unknown>> {
|
|
6
6
|
/** Key into the row (and the sort field). Use `renderCell` for non-primitive values. */
|
|
7
7
|
field: string;
|
|
8
|
-
/** Column header
|
|
9
|
-
headerName?:
|
|
8
|
+
/** Column header content. Defaults to `field`. */
|
|
9
|
+
headerName?: ReactNode;
|
|
10
10
|
/** Fixed width in px. */
|
|
11
11
|
width?: number;
|
|
12
12
|
/** Proportional width (flex-grow). Ignored when `width` is set. */
|
|
@@ -31,6 +31,8 @@ export interface DataTableColumn<R = Record<string, unknown>> {
|
|
|
31
31
|
field: string;
|
|
32
32
|
}) => unknown;
|
|
33
33
|
}
|
|
34
|
+
export type DataTableDensity = 'standard' | 'compact';
|
|
35
|
+
export type DataTableLayout = 'auto' | 'fixed';
|
|
34
36
|
export interface DataTableSort {
|
|
35
37
|
field: string;
|
|
36
38
|
sort: 'asc' | 'desc';
|
|
@@ -63,6 +65,20 @@ export interface DataTableProps<R = Record<string, unknown>> {
|
|
|
63
65
|
noRowsLabel?: ReactNode;
|
|
64
66
|
/** Turn off column resizing for every column. */
|
|
65
67
|
disableColumnResize?: boolean;
|
|
68
|
+
/** Row height. `'compact'` halves the vertical cell padding. */
|
|
69
|
+
density?: DataTableDensity;
|
|
70
|
+
/**
|
|
71
|
+
* Column sizing model. `'auto'` (default) lets the browser size columns to
|
|
72
|
+
* their content. `'fixed'` uses `table-layout: fixed` and a colgroup built
|
|
73
|
+
* from each column's `width` / `flex`, which is what makes a `width` actually
|
|
74
|
+
* bind and lets long cell content truncate instead of widening the table.
|
|
75
|
+
*
|
|
76
|
+
* Note `flex` has no effect under `'auto'`: it is emitted as a CSS `flex` on
|
|
77
|
+
* `<th>`/`<td>`, and flex does nothing on table cells.
|
|
78
|
+
*/
|
|
79
|
+
tableLayout?: DataTableLayout;
|
|
80
|
+
/** Extra class for a row's `<tr>` — for per-row state the table cannot know. */
|
|
81
|
+
getRowClassName?: (row: R) => string | undefined;
|
|
66
82
|
className?: string;
|
|
67
83
|
/** Inline style applied to the outer table container. */
|
|
68
84
|
style?: CSSProperties;
|
|
@@ -16,6 +16,12 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
16
16
|
onClear?: () => void;
|
|
17
17
|
/** Show a password-visibility toggle. Forces `type="password"` when hidden. */
|
|
18
18
|
showPasswordToggle?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Drop the resting border and sit the field on a tinted surface. For
|
|
21
|
+
* search-style inputs that need to read as a target against a plain
|
|
22
|
+
* background (an app header, a toolbar) rather than as a form control.
|
|
23
|
+
*/
|
|
24
|
+
filled?: boolean;
|
|
19
25
|
/**
|
|
20
26
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
21
27
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|