@dynamic-labs-sdk/droplet 1.49.1 → 1.51.0
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/copy-button/copy-button.d.ts +3 -1
- package/dist/components/copy-button/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button/copy-button.stories.d.ts +1 -1
- package/dist/components/empty-state/empty-state.d.ts +3 -3
- package/dist/components/empty-state/empty-state.d.ts.map +1 -1
- package/dist/components/migration/field/field.d.ts.map +1 -1
- package/dist/components/status-badge/status-badge.d.ts.map +1 -1
- package/dist/components/tab-navigation/tab-navigation.d.ts.map +1 -1
- package/dist/components/toggle-card/toggle-card.d.ts +10 -0
- package/dist/components/toggle-card/toggle-card.d.ts.map +1 -1
- package/dist/components/toggle-card/toggle-card.stories.d.ts +5 -0
- package/dist/components/toggle-card/toggle-card.stories.d.ts.map +1 -1
- package/dist/components/toggle-row/toggle-row.d.ts +22 -1
- package/dist/components/toggle-row/toggle-row.d.ts.map +1 -1
- package/dist/components/toggle-row/toggle-row.stories.d.ts +10 -6
- package/dist/components/toggle-row/toggle-row.stories.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +54 -12
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.stories.d.ts +12 -1
- package/dist/components/ui/combobox/combobox.stories.d.ts.map +1 -1
- package/dist/components/ui/data-table/create-column-helper.d.ts +20 -0
- package/dist/components/ui/data-table/create-column-helper.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-active-filters.d.ts +37 -0
- package/dist/components/ui/data-table/data-table-active-filters.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-column-filter.d.ts +48 -0
- package/dist/components/ui/data-table/data-table-column-filter.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-column-visibility.d.ts +37 -0
- package/dist/components/ui/data-table/data-table-column-visibility.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-content.d.ts +43 -0
- package/dist/components/ui/data-table/data-table-content.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-context.d.ts +13 -0
- package/dist/components/ui/data-table/data-table-context.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-pagination.d.ts +38 -0
- package/dist/components/ui/data-table/data-table-pagination.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-placeholder-rows.d.ts +21 -0
- package/dist/components/ui/data-table/data-table-placeholder-rows.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-rows.d.ts +22 -0
- package/dist/components/ui/data-table/data-table-rows.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-search.d.ts +40 -0
- package/dist/components/ui/data-table/data-table-search.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table.d.ts +56 -0
- package/dist/components/ui/data-table/data-table.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table.stories.d.ts +32 -0
- package/dist/components/ui/data-table/data-table.stories.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table.types.d.ts +189 -0
- package/dist/components/ui/data-table/data-table.types.d.ts.map +1 -0
- package/dist/components/ui/data-table/expand-chevron.d.ts +7 -0
- package/dist/components/ui/data-table/expand-chevron.d.ts.map +1 -0
- package/dist/components/ui/data-table/get-column-label.d.ts +7 -0
- package/dist/components/ui/data-table/get-column-label.d.ts.map +1 -0
- package/dist/components/ui/data-table/get-pinned-cell-props.d.ts +15 -0
- package/dist/components/ui/data-table/get-pinned-cell-props.d.ts.map +1 -0
- package/dist/components/ui/data-table/selection-column.d.ts +24 -0
- package/dist/components/ui/data-table/selection-column.d.ts.map +1 -0
- package/dist/components/ui/data-table/use-data-table.d.ts +157 -0
- package/dist/components/ui/data-table/use-data-table.d.ts.map +1 -0
- package/dist/components/ui/field/field-control-context.d.ts +20 -0
- package/dist/components/ui/field/field-control-context.d.ts.map +1 -0
- package/dist/components/ui/field/field.d.ts +20 -4
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.stories.d.ts +18 -6
- package/dist/components/ui/field/field.stories.d.ts.map +1 -1
- package/dist/components/ui/label/label.d.ts +15 -0
- package/dist/components/ui/label/label.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts +2 -2
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.stories.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +7 -3
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/table/table.stories.d.ts +3 -1
- package/dist/components/ui/table/table.stories.d.ts.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +3 -1
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/index.cjs +1722 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1714 -251
- package/dist/index.esm.js.map +1 -1
- package/dist/migration.cjs +1 -1
- package/dist/migration.cjs.map +1 -1
- package/dist/migration.esm.js +1 -1
- package/dist/migration.esm.js.map +1 -1
- package/dist/{toggle-row-PqelNVXI.esm.js → toggle-row-CeiCy3Aa.esm.js} +33 -8
- package/dist/toggle-row-CeiCy3Aa.esm.js.map +1 -0
- package/dist/{toggle-row-BBTk7_bT.cjs → toggle-row-DcV81G3w.cjs} +33 -8
- package/dist/toggle-row-DcV81G3w.cjs.map +1 -0
- package/package.json +3 -1
- package/src/styles/globals.css +54 -15
- package/dist/toggle-row-BBTk7_bT.cjs.map +0 -1
- package/dist/toggle-row-PqelNVXI.esm.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link DataTablePagination}.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const props: DataTablePaginationProps = { className: 'justify-start' };
|
|
8
|
+
* ```
|
|
9
|
+
* @see DataTablePagination
|
|
10
|
+
* @see useDataTable
|
|
11
|
+
*/
|
|
12
|
+
type DataTablePaginationProps = {
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Previous and next buttons beside the visible row range, for client or server pagination. Renders nothing when pagination is off.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const dataTable = useDataTable({
|
|
21
|
+
* columns,
|
|
22
|
+
* data,
|
|
23
|
+
* pagination: { mode: 'client', pageSize: 25 },
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* <DataTable table={dataTable}>
|
|
27
|
+
* <DataTableContent />
|
|
28
|
+
* <DataTablePagination />
|
|
29
|
+
* </DataTable>
|
|
30
|
+
* ```
|
|
31
|
+
* @returns The rendered pagination controls, or `null` when pagination is off.
|
|
32
|
+
* @see useDataTable
|
|
33
|
+
* @see DataTable
|
|
34
|
+
*/
|
|
35
|
+
declare const DataTablePagination: ({ className, }: DataTablePaginationProps) => ReactElement | null;
|
|
36
|
+
export { DataTablePagination };
|
|
37
|
+
export type { DataTablePaginationProps };
|
|
38
|
+
//# sourceMappingURL=data-table-pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C;;;;;;;;;GASG;AACH,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,mBAAmB,mBAEtB,wBAAwB,KAAG,YAAY,GAAG,IA+B5C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import type { EmptyStateProps } from '../../empty-state/empty-state';
|
|
3
|
+
/** Placeholder, group and detail rows are not interactive, so they must not take the row hover fill. */
|
|
4
|
+
declare const STATIC_ROW = "hover:bg-transparent hover:[--table-row-overlay:transparent]";
|
|
5
|
+
type DataTableSkeletonRowsProps = {
|
|
6
|
+
columnCount: number;
|
|
7
|
+
rowCount: number;
|
|
8
|
+
};
|
|
9
|
+
/** Skeleton rows shown while data loads. Only the first bar is announced, so screen readers hear "Loading" once. */
|
|
10
|
+
declare const DataTableSkeletonRows: ({ columnCount, rowCount, }: DataTableSkeletonRowsProps) => ReactElement;
|
|
11
|
+
type DataTableEmptyRowProps = {
|
|
12
|
+
/** An action under the title, for example a button that clears the filters. */
|
|
13
|
+
action?: ReactNode;
|
|
14
|
+
columnCount: number;
|
|
15
|
+
icon: EmptyStateProps['icon'];
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
/** Ghost rows keep the table's shape behind an icon and title. */
|
|
19
|
+
declare const DataTableEmptyRow: ({ action, columnCount, icon, title, }: DataTableEmptyRowProps) => ReactElement;
|
|
20
|
+
export { DataTableEmptyRow, DataTableSkeletonRows, STATIC_ROW };
|
|
21
|
+
//# sourceMappingURL=data-table-placeholder-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-placeholder-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-placeholder-rows.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOrE,wGAAwG;AACxG,QAAA,MAAM,UAAU,iEAAiE,CAAC;AAKlF,KAAK,0BAA0B,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oHAAoH;AACpH,QAAA,MAAM,qBAAqB,+BAGxB,0BAA0B,KAAG,YAmB/B,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,kEAAkE;AAClE,QAAA,MAAM,iBAAiB,0CAKpB,sBAAsB,KAAG,YAqC3B,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Row } from '@tanstack/react-table';
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactElement, type Ref } from 'react';
|
|
3
|
+
/** Fixed layout cells clip and truncate, so a narrowed column cannot spill into its neighbour. The checkbox column never needs it. */
|
|
4
|
+
declare const FIXED_LAYOUT_CELL_CLASS = "overflow-hidden text-ellipsis";
|
|
5
|
+
type AnyRow = Row<any>;
|
|
6
|
+
/** The checkbox column holds one control, so it stays narrow and never clips. */
|
|
7
|
+
declare const isControlColumn: (columnId: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Lands on the row's `<tr>`, for the virtualizer to measure it. A named prop rather than `ref`, because on React 18
|
|
10
|
+
* a plain function component never receives `ref`.
|
|
11
|
+
*/
|
|
12
|
+
type RowRef = Ref<HTMLTableRowElement> | undefined;
|
|
13
|
+
type DataTableBodyRowProps = ComponentPropsWithoutRef<'tr'> & {
|
|
14
|
+
columnCount: number;
|
|
15
|
+
hasFixedLayout: boolean;
|
|
16
|
+
row: AnyRow;
|
|
17
|
+
rowRef?: RowRef;
|
|
18
|
+
};
|
|
19
|
+
/** One table row, as a group header or a data row. Row props and `rowRef` land on its `<tr>`. */
|
|
20
|
+
declare const DataTableBodyRow: ({ columnCount, hasFixedLayout, row, ...props }: DataTableBodyRowProps) => ReactElement;
|
|
21
|
+
export { DataTableBodyRow, FIXED_LAYOUT_CELL_CLASS, isControlColumn };
|
|
22
|
+
//# sourceMappingURL=data-table-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-rows.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAc,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AASnF,sIAAsI;AACtI,QAAA,MAAM,uBAAuB,kCAAkC,CAAC;AAahE,KAAK,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB,iFAAiF;AACjF,QAAA,MAAM,eAAe,aAAc,MAAM,KAAG,OAA2C,CAAC;AAsBxF;;;GAGG;AACH,KAAK,MAAM,GAAG,GAAG,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;AAmGnD,KAAK,qBAAqB,GAAG,wBAAwB,CAAC,IAAI,CAAC,GAAG;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,mDAKnB,qBAAqB,KAAG,YAc1B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link DataTableSearch}.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const props: DataTableSearchProps = { placeholder: 'Search users' };
|
|
8
|
+
* ```
|
|
9
|
+
* @see DataTableSearch
|
|
10
|
+
* @see DataTableActiveFilters
|
|
11
|
+
*/
|
|
12
|
+
type DataTableSearchProps = {
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Placeholder text, also the field's accessible name. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A search field that matches its text across the table's columns. Needs `filtering` in `useDataTable`, and renders nothing without it.
|
|
19
|
+
* With manual filtering the app receives the text as `globalFilter` and filters the data itself.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const dataTable = useDataTable({ columns, data, filtering: { mode: 'client' } });
|
|
24
|
+
*
|
|
25
|
+
* <DataTable table={dataTable}>
|
|
26
|
+
* <DataTableToolbar>
|
|
27
|
+
* <DataTableSearch placeholder="Search users" />
|
|
28
|
+
* </DataTableToolbar>
|
|
29
|
+
* <DataTableContent />
|
|
30
|
+
* </DataTable>
|
|
31
|
+
* ```
|
|
32
|
+
* @returns The rendered search field, or nothing when filtering is off.
|
|
33
|
+
* @see DataTableToolbar
|
|
34
|
+
* @see DataTableActiveFilters
|
|
35
|
+
* @see useDataTable
|
|
36
|
+
*/
|
|
37
|
+
declare const DataTableSearch: ({ className, placeholder, }: DataTableSearchProps) => ReactElement | null;
|
|
38
|
+
export { DataTableSearch };
|
|
39
|
+
export type { DataTableSearchProps };
|
|
40
|
+
//# sourceMappingURL=data-table-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-search.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-search.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C;;;;;;;;;GASG;AACH,KAAK,oBAAoB,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,eAAe,gCAGlB,oBAAoB,KAAG,YAAY,GAAG,IAwBxC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactElement } from 'react';
|
|
2
|
+
import type { DataTableInstance } from './use-data-table';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link DataTable}: the `table` from `useDataTable`, an optional `fill` layout mode, and any `div` props.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const props: DataTableProps<User> = { table: dataTable, fill: true };
|
|
9
|
+
* ```
|
|
10
|
+
* @see DataTable
|
|
11
|
+
* @see useDataTable
|
|
12
|
+
*/
|
|
13
|
+
type DataTableProps<TData> = ComponentProps<'div'> & {
|
|
14
|
+
/** Stretch to the height the parent gives it, with a pinned header and one scrollbar. The parent must be a flex column with a bounded height. */
|
|
15
|
+
fill?: boolean;
|
|
16
|
+
/** The result of `useDataTable`. */
|
|
17
|
+
table: DataTableInstance<TData>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Root of a data table. Holds the table state for `DataTableContent`, `DataTablePagination` and the other parts.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const dataTable = useDataTable({ columns, data });
|
|
25
|
+
*
|
|
26
|
+
* <DataTable table={dataTable}>
|
|
27
|
+
* <DataTableToolbar>
|
|
28
|
+
* <DataTableColumnVisibility />
|
|
29
|
+
* </DataTableToolbar>
|
|
30
|
+
* <DataTableContent />
|
|
31
|
+
* </DataTable>
|
|
32
|
+
* ```
|
|
33
|
+
* @returns The rendered data table root element.
|
|
34
|
+
* @see useDataTable
|
|
35
|
+
* @see DataTableContent
|
|
36
|
+
* @see DataTableToolbar
|
|
37
|
+
*/
|
|
38
|
+
declare const DataTable: <TData>({ children, className, fill, table, ...props }: DataTableProps<TData>) => ReactElement;
|
|
39
|
+
/**
|
|
40
|
+
* Row above the table for search, filters and actions.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <DataTableToolbar>
|
|
45
|
+
* <Input placeholder="Search users" />
|
|
46
|
+
* <DataTableColumnVisibility />
|
|
47
|
+
* </DataTableToolbar>
|
|
48
|
+
* ```
|
|
49
|
+
* @returns The rendered toolbar element.
|
|
50
|
+
* @see DataTable
|
|
51
|
+
* @see DataTableColumnVisibility
|
|
52
|
+
*/
|
|
53
|
+
declare const DataTableToolbar: ({ className, ...props }: ComponentProps<"div">) => ReactElement;
|
|
54
|
+
export { DataTable, DataTableToolbar };
|
|
55
|
+
export type { DataTableProps };
|
|
56
|
+
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAW,MAAM,OAAO,CAAC;AAIxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;;;;;GASG;AACH,KAAK,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG;IACnD,iJAAiJ;IACjJ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oCAAoC;IACpC,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,SAAS,GAAI,KAAK,kDAMrB,cAAc,CAAC,KAAK,CAAC,KAAG,YAmB1B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,gBAAgB,4BAGnB,cAAc,CAAC,KAAK,CAAC,KAAG,YAM1B,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import { type DataTableProps } from './data-table';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
component: <TData>({ children, className, fill, table, ...props }: DataTableProps<TData>) => ReactElement;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<Partial<DataTableProps<unknown>>>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const Sortable: Story;
|
|
16
|
+
export declare const Paginated: Story;
|
|
17
|
+
export declare const Manual: Story;
|
|
18
|
+
export declare const Selection: Story;
|
|
19
|
+
export declare const ColumnVisibility: Story;
|
|
20
|
+
export declare const Pinned: Story;
|
|
21
|
+
export declare const Resizable: Story;
|
|
22
|
+
export declare const Loading: Story;
|
|
23
|
+
export declare const Empty: Story;
|
|
24
|
+
export declare const WideScroll: Story;
|
|
25
|
+
export declare const Fill: Story;
|
|
26
|
+
export declare const Filtering: Story;
|
|
27
|
+
export declare const Everything: Story;
|
|
28
|
+
export declare const FilteringManual: Story;
|
|
29
|
+
export declare const Grouped: Story;
|
|
30
|
+
export declare const Virtualized: Story;
|
|
31
|
+
export declare const MultiSort: Story;
|
|
32
|
+
//# sourceMappingURL=data-table.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;AAGpD,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAUtB,QAAA,MAAM,IAAI;;;;;;;CAKwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AA2OxD,eAAO,MAAM,OAAO,EAAE,KAAqC,CAAC;AAE5D,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAC;AA4CF,eAAO,MAAM,MAAM,EAAE,KAA0C,CAAC;AAEhE,eAAO,MAAM,SAAS,EAAE,KAmBvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAiB9B,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAA6C,CAAC;AAEpE,eAAO,MAAM,KAAK,EAAE,KAA+C,CAAC;AAEpE,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAiBlB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAuBvB,CAAC;AAyCF,eAAO,MAAM,UAAU,EAAE,KA6BxB,CAAC;AAgEF,eAAO,MAAM,eAAe,EAAE,KAA4C,CAAC;AAE3E,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAoBzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAavB,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { RowData, CellContext as TanStackCellContext, ColumnDef as TanStackColumnDef, ColumnFiltersState as TanStackColumnFiltersState, ColumnPinningState as TanStackColumnPinningState, ColumnSizingState as TanStackColumnSizingState, GroupingState as TanStackGroupingState, PaginationState as TanStackPaginationState, Row as TanStackRow, RowSelectionState as TanStackRowSelectionState, SortingState as TanStackSortingState, VisibilityState as TanStackVisibilityState } from '@tanstack/react-table';
|
|
2
|
+
declare module '@tanstack/react-table' {
|
|
3
|
+
/**
|
|
4
|
+
* The column `meta` options data table reads: `filter`, `filterOptions` and `label`.
|
|
5
|
+
* This augmentation merges globally into `@tanstack/react-table`'s `ColumnMeta`, so every TanStack table in an app that
|
|
6
|
+
* imports this package sees these keys too.
|
|
7
|
+
*/
|
|
8
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
9
|
+
/** Column filter shown in the header: free text, or a checklist of values. */
|
|
10
|
+
filter?: 'text' | 'values';
|
|
11
|
+
/** Values for a `values` filter when the server filters; defaults to the values in the data. */
|
|
12
|
+
filterOptions?: string[];
|
|
13
|
+
/** Readable name for menus and labels when `header` is not plain text. */
|
|
14
|
+
label?: string;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Describes one column of a data table: how to read its value from a row, its header, how its cells render, and options such as `size` or `enableSorting`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const columns: ColumnDef<User>[] = [
|
|
23
|
+
* { accessorKey: 'name', header: 'Name' },
|
|
24
|
+
* { accessorKey: 'email', header: 'Email', size: 240 },
|
|
25
|
+
* ];
|
|
26
|
+
* ```
|
|
27
|
+
* @see useDataTable
|
|
28
|
+
* @see createColumnHelper
|
|
29
|
+
* @see selectionColumn
|
|
30
|
+
*/
|
|
31
|
+
type ColumnDef<TData extends RowData, TValue = unknown> = TanStackColumnDef<TData, TValue>;
|
|
32
|
+
/**
|
|
33
|
+
* What a column's `cell` and `header` renderers receive: the row, the column and the cell's current value.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* const renderEmail = ({ getValue }: CellContext<User, string>) => (
|
|
38
|
+
* <a href={`mailto:${getValue()}`}>{getValue()}</a>
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
* @see ColumnDef
|
|
42
|
+
* @see Row
|
|
43
|
+
*/
|
|
44
|
+
type CellContext<TData extends RowData, TValue> = TanStackCellContext<TData, TValue>;
|
|
45
|
+
/**
|
|
46
|
+
* One row of a data table. Gives access to the row's original data, its cells, and its selection state.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* const getUserId = (row: Row<User>) => row.original.id;
|
|
51
|
+
* ```
|
|
52
|
+
* @see ColumnDef
|
|
53
|
+
* @see RowSelectionState
|
|
54
|
+
*/
|
|
55
|
+
type Row<TData extends RowData> = TanStackRow<TData>;
|
|
56
|
+
/**
|
|
57
|
+
* The sort order of a table: a list of `{ id, desc }` rules, where `id` is a column id.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* const sorting: SortingState = [{ id: 'createdAt', desc: true }];
|
|
62
|
+
* ```
|
|
63
|
+
* @see useDataTable
|
|
64
|
+
* @see PaginationState
|
|
65
|
+
*/
|
|
66
|
+
type SortingState = TanStackSortingState;
|
|
67
|
+
/**
|
|
68
|
+
* The current page of a table: the zero-based `pageIndex` and the number of rows per page, `pageSize`.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const pagination: PaginationState = { pageIndex: 0, pageSize: 25 };
|
|
73
|
+
* ```
|
|
74
|
+
* @see useDataTable
|
|
75
|
+
* @see DataTablePagination
|
|
76
|
+
*/
|
|
77
|
+
type PaginationState = TanStackPaginationState;
|
|
78
|
+
/**
|
|
79
|
+
* The selected rows of a table, keyed by row id. A row is selected when its id maps to `true`.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```tsx
|
|
83
|
+
* const selection: RowSelectionState = { 'user_1': true, 'user_7': true };
|
|
84
|
+
* ```
|
|
85
|
+
* @see useDataTable
|
|
86
|
+
* @see selectionColumn
|
|
87
|
+
*/
|
|
88
|
+
type RowSelectionState = TanStackRowSelectionState;
|
|
89
|
+
/**
|
|
90
|
+
* Which columns are shown, keyed by column id. A column is hidden when its id maps to `false`.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* const visibility: VisibilityState = { email: false };
|
|
95
|
+
* ```
|
|
96
|
+
* @see useDataTable
|
|
97
|
+
* @see DataTableColumnVisibility
|
|
98
|
+
*/
|
|
99
|
+
type VisibilityState = TanStackVisibilityState;
|
|
100
|
+
/**
|
|
101
|
+
* The columns pinned to each edge of a table: `left` pins to the start edge and `right` to the end edge. Lists hold column ids.
|
|
102
|
+
* `useDataTable` pins to one edge only; see `DataTableColumnPinningState`.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* const pinning: ColumnPinningState = { left: ['select', 'name'] };
|
|
107
|
+
* ```
|
|
108
|
+
* @see DataTableColumnPinningState
|
|
109
|
+
* @see useDataTable
|
|
110
|
+
* @see ColumnSizingState
|
|
111
|
+
*/
|
|
112
|
+
type ColumnPinningState = TanStackColumnPinningState;
|
|
113
|
+
/**
|
|
114
|
+
* The columns pinned to one edge of a data table, as a list of column ids. A table pins to the start edge or the end edge, never both:
|
|
115
|
+
* `left` pins to the start edge and `right` to the end edge (the edges swap in right-to-left layouts).
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```tsx
|
|
119
|
+
* const pinning: DataTableColumnPinningState = { left: ['select', 'name'] };
|
|
120
|
+
*
|
|
121
|
+
* const dataTable = useDataTable({ columnPinning: { initial: pinning }, columns, data });
|
|
122
|
+
* ```
|
|
123
|
+
* @see useDataTable
|
|
124
|
+
* @see ColumnPinningState
|
|
125
|
+
*/
|
|
126
|
+
type DataTableColumnPinningState = {
|
|
127
|
+
left: string[];
|
|
128
|
+
right?: never;
|
|
129
|
+
} | {
|
|
130
|
+
left?: never;
|
|
131
|
+
right: string[];
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Column widths in pixels, keyed by column id.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```tsx
|
|
138
|
+
* const sizing: ColumnSizingState = { name: 280, email: 220 };
|
|
139
|
+
* ```
|
|
140
|
+
* @see useDataTable
|
|
141
|
+
* @see ColumnPinningState
|
|
142
|
+
*/
|
|
143
|
+
type ColumnSizingState = TanStackColumnSizingState;
|
|
144
|
+
/**
|
|
145
|
+
* The active column filters of a table: a list of `{ id, value }` entries, where `id` is a column id.
|
|
146
|
+
* A `text` filter holds a string and a `values` filter holds the list of checked values.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```tsx
|
|
150
|
+
* const columnFilters: ColumnFiltersState = [
|
|
151
|
+
* { id: 'role', value: ['Admin'] },
|
|
152
|
+
* { id: 'name', value: 'ali' },
|
|
153
|
+
* ];
|
|
154
|
+
* ```
|
|
155
|
+
* @see DataTableFilterState
|
|
156
|
+
* @see useDataTable
|
|
157
|
+
*/
|
|
158
|
+
type ColumnFiltersState = TanStackColumnFiltersState;
|
|
159
|
+
/**
|
|
160
|
+
* The filters of a table: the column filters and the search text that matches across columns.
|
|
161
|
+
* With manual filtering, the app receives this state and filters the data itself, usually on the server.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```tsx
|
|
165
|
+
* const filters: DataTableFilterState = {
|
|
166
|
+
* columnFilters: [{ id: 'role', value: ['Admin'] }],
|
|
167
|
+
* globalFilter: 'ali',
|
|
168
|
+
* };
|
|
169
|
+
* ```
|
|
170
|
+
* @see ColumnFiltersState
|
|
171
|
+
* @see useDataTable
|
|
172
|
+
*/
|
|
173
|
+
type DataTableFilterState = {
|
|
174
|
+
columnFilters: ColumnFiltersState;
|
|
175
|
+
globalFilter: string;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* The column ids a table groups its rows by, outermost group first.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* const grouping: GroupingState = ['status'];
|
|
183
|
+
* ```
|
|
184
|
+
* @see useDataTable
|
|
185
|
+
* @see SortingState
|
|
186
|
+
*/
|
|
187
|
+
type GroupingState = TanStackGroupingState;
|
|
188
|
+
export type { CellContext, ColumnDef, ColumnFiltersState, ColumnPinningState, ColumnSizingState, DataTableColumnPinningState, DataTableFilterState, GroupingState, PaginationState, Row, RowSelectionState, SortingState, VisibilityState, };
|
|
189
|
+
//# sourceMappingURL=data-table.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,IAAI,mBAAmB,EAClC,SAAS,IAAI,iBAAiB,EAC9B,kBAAkB,IAAI,0BAA0B,EAChD,kBAAkB,IAAI,0BAA0B,EAChD,iBAAiB,IAAI,yBAAyB,EAC9C,aAAa,IAAI,qBAAqB,EACtC,eAAe,IAAI,uBAAuB,EAC1C,GAAG,IAAI,WAAW,EAClB,iBAAiB,IAAI,yBAAyB,EAC9C,YAAY,IAAI,oBAAoB,EACpC,eAAe,IAAI,uBAAuB,EAC3C,MAAM,uBAAuB,CAAC;AAE/B,OAAO,QAAQ,uBAAuB,CAAC;IACrC;;;;OAIG;IAGH,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM;QAChD,8EAA8E;QAC9E,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAC3B,gGAAgG;QAChG,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,0EAA0E;QAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,KAAK,SAAS,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,iBAAiB,CACzE,KAAK,EACL,MAAM,CACP,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,KAAK,WAAW,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM,IAAI,mBAAmB,CACnE,KAAK,EACL,MAAM,CACP,CAAC;AAEF;;;;;;;;;GASG;AACH,KAAK,GAAG,CAAC,KAAK,SAAS,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,KAAK,YAAY,GAAG,oBAAoB,CAAC;AAEzC;;;;;;;;;GASG;AACH,KAAK,eAAe,GAAG,uBAAuB,CAAC;AAE/C;;;;;;;;;GASG;AACH,KAAK,iBAAiB,GAAG,yBAAyB,CAAC;AAEnD;;;;;;;;;GASG;AACH,KAAK,eAAe,GAAG,uBAAuB,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,KAAK,kBAAkB,GAAG,0BAA0B,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,KAAK,2BAA2B,GAC5B;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GACjC;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEtC;;;;;;;;;GASG;AACH,KAAK,iBAAiB,GAAG,yBAAyB,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,KAAK,kBAAkB,GAAG,0BAA0B,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,KAAK,oBAAoB,GAAG;IAC1B,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;GASG;AACH,KAAK,aAAa,GAAG,qBAAqB,CAAC;AAE3C,YAAY,EACV,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,GAAG,EACH,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
/** A right-pointing chevron that turns to point down while its group is open. */
|
|
3
|
+
declare const ExpandChevron: ({ isOpen }: {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
}) => ReactElement;
|
|
6
|
+
export { ExpandChevron };
|
|
7
|
+
//# sourceMappingURL=expand-chevron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expand-chevron.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/expand-chevron.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,iFAAiF;AACjF,QAAA,MAAM,aAAa,eAAgB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,KAAG,YASxD,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Column } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Read a column the way users see it, so menus and handles name it: its `meta.label`, then a plain-text header, then its id.
|
|
4
|
+
*/
|
|
5
|
+
declare const getColumnLabel: <TData>(column: Column<TData, unknown>) => string;
|
|
6
|
+
export { getColumnLabel };
|
|
7
|
+
//# sourceMappingURL=get-column-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-column-label.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/get-column-label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;GAEG;AACH,QAAA,MAAM,cAAc,GAAI,KAAK,UAAU,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,KAAG,MAK/D,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Column } from '@tanstack/react-table';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
type PinnedCellProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
'data-pinned'?: 'left' | 'right';
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
/** Sticky position, background and edge divider for a cell in a pinned column. */
|
|
9
|
+
declare const getPinnedCellProps: <TData>({ column, section, }: {
|
|
10
|
+
column: Column<TData, unknown>;
|
|
11
|
+
section: "body" | "header";
|
|
12
|
+
}) => PinnedCellProps;
|
|
13
|
+
export { getPinnedCellProps };
|
|
14
|
+
export type { PinnedCellProps };
|
|
15
|
+
//# sourceMappingURL=get-pinned-cell-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pinned-cell-props.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/get-pinned-cell-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAcF,kFAAkF;AAClF,QAAA,MAAM,kBAAkB,GAAI,KAAK,wBAG9B;IACD,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC5B,KAAG,eAqBH,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Id of the checkbox column added by `selectionColumn`. Use it to find that column, for example when pinning it to the start edge.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const columnPinning = { initial: { left: [SELECTION_COLUMN_ID] } };
|
|
8
|
+
* ```
|
|
9
|
+
* @see selectionColumn
|
|
10
|
+
* @see useDataTable
|
|
11
|
+
*/
|
|
12
|
+
declare const SELECTION_COLUMN_ID = "select";
|
|
13
|
+
/**
|
|
14
|
+
* A checkbox column for row selection. Put it first in `columns` and pass `selection` to `useDataTable`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const columns = [selectionColumn<User>(), { accessorKey: 'name', header: 'Name' }];
|
|
18
|
+
* @returns A column definition that renders a checkbox for each row and a select-all checkbox in the header.
|
|
19
|
+
* @see SELECTION_COLUMN_ID
|
|
20
|
+
* @see useDataTable
|
|
21
|
+
*/
|
|
22
|
+
declare const selectionColumn: <TData>() => ColumnDef<TData>;
|
|
23
|
+
export { SELECTION_COLUMN_ID, selectionColumn };
|
|
24
|
+
//# sourceMappingURL=selection-column.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-column.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/selection-column.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,SAAS,EAAwB,MAAM,uBAAuB,CAAC;AAK1F;;;;;;;;;GASG;AACH,QAAA,MAAM,mBAAmB,WAAW,CAAC;AA8BrC;;;;;;;;GAQG;AACH,QAAA,MAAM,eAAe,GAAI,KAAK,OAAM,SAAS,CAAC,KAAK,CAQjD,CAAC;AAEH,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}
|