@dynamic-labs-sdk/droplet 1.52.3 → 1.52.4
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/ui/data-table/actions-column.d.ts +40 -0
- package/dist/components/ui/data-table/actions-column.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-active-filters.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-column-filter.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-column-visibility.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-column-visibility.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-content.d.ts +22 -6
- package/dist/components/ui/data-table/data-table-content.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-context.d.ts +2 -0
- package/dist/components/ui/data-table/data-table-context.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-labels.d.ts +88 -0
- package/dist/components/ui/data-table/data-table-labels.d.ts.map +1 -0
- package/dist/components/ui/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-placeholder-rows.d.ts +3 -1
- package/dist/components/ui/data-table/data-table-placeholder-rows.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-rows.d.ts +5 -2
- package/dist/components/ui/data-table/data-table-rows.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-search.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-search.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table.d.ts +11 -1
- package/dist/components/ui/data-table/data-table.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table.stories.d.ts +4 -1
- package/dist/components/ui/data-table/data-table.stories.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table.types.d.ts +23 -2
- package/dist/components/ui/data-table/data-table.types.d.ts.map +1 -1
- package/dist/components/ui/data-table/is-row-activation.d.ts +10 -0
- package/dist/components/ui/data-table/is-row-activation.d.ts.map +1 -0
- package/dist/components/ui/data-table/selection-column.d.ts.map +1 -1
- package/dist/components/ui/pagination/index.d.ts +1 -1
- package/dist/components/ui/pagination/index.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts +26 -2
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +6 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/index.cjs +296 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +295 -87
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ColumnDef, Row } from '@tanstack/react-table';
|
|
2
|
+
import type { DataTableRowAction } from './data-table.types';
|
|
3
|
+
/**
|
|
4
|
+
* Column id of `actionsColumn`, for pinning it or checking for it.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const options = { columnPinning: { initial: { right: [ACTIONS_COLUMN_ID] } } };
|
|
9
|
+
* ```
|
|
10
|
+
* @see actionsColumn
|
|
11
|
+
* @see useDataTable
|
|
12
|
+
*/
|
|
13
|
+
declare const ACTIONS_COLUMN_ID = "actions";
|
|
14
|
+
/**
|
|
15
|
+
* A narrow last column with a menu of actions for each row, such as edit or delete. Rows with no actions show no menu.
|
|
16
|
+
* Choosing an action never opens the row, even when `DataTableContent` has `onRowClick`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const columns = [
|
|
21
|
+
* { accessorKey: 'name', header: 'Name' },
|
|
22
|
+
* actionsColumn<User>({
|
|
23
|
+
* getActions: (row) => [
|
|
24
|
+
* { label: 'Edit', onSelect: () => openEditor(row.original) },
|
|
25
|
+
* { label: 'Delete', onSelect: () => remove(row.original.id), variant: 'danger' },
|
|
26
|
+
* ],
|
|
27
|
+
* }),
|
|
28
|
+
* ];
|
|
29
|
+
* ```
|
|
30
|
+
* @returns The column definition to add last to `columns`.
|
|
31
|
+
* @see DataTableRowAction
|
|
32
|
+
* @see selectionColumn
|
|
33
|
+
* @see useDataTable
|
|
34
|
+
*/
|
|
35
|
+
declare const actionsColumn: <TData>({ getActions, }: {
|
|
36
|
+
/** The actions for one row. Return an empty list for a row without actions. */
|
|
37
|
+
getActions: (row: Row<TData>) => DataTableRowAction[];
|
|
38
|
+
}) => ColumnDef<TData>;
|
|
39
|
+
export { ACTIONS_COLUMN_ID, actionsColumn };
|
|
40
|
+
//# sourceMappingURL=actions-column.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-column.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/actions-column.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAMzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;;;;;GASG;AACH,QAAA,MAAM,iBAAiB,YAAY,CAAC;AA0CpC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,aAAa,GAAI,KAAK,mBAEzB;IACD,+EAA+E;IAC/E,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,kBAAkB,EAAE,CAAC;CACvD,KAAG,SAAS,CAAC,KAAK,CASjB,CAAC;AAEH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-active-filters.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-active-filters.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"data-table-active-filters.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-active-filters.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AA0F1C;;;;;;;;;GASG;AACH,KAAK,2BAA2B,GAAG;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,sBAAsB,mBAEzB,2BAA2B,KAAG,YAAY,GAAG,IAkD/C,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-column-filter.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-column-filter.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"data-table-column-filter.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-column-filter.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAmF1C;;;;;;;;;GASG;AACH,KAAK,0BAA0B,CAAC,KAAK,IAAI;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,qBAAqB,GAAI,KAAK,0BAGjC,0BAA0B,CAAC,KAAK,CAAC,KAAG,YA0BtC,CAAC;AAEF,6GAA6G;AAC7G,QAAA,MAAM,4BAA4B,GAAI,KAAK,eAExC;IACD,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;CAChC,KAAG,YA8BH,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,CAAC;AAC/D,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-column-visibility.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-column-visibility.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAa1C;;;;;;;;;GASG;AACH,KAAK,8BAA8B,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"data-table-column-visibility.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-column-visibility.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAa1C;;;;;;;;;GASG;AACH,KAAK,8BAA8B,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,yBAAyB,0BAG5B,8BAA8B,KAAG,YAmDnC,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC,YAAY,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Row } from '@tanstack/react-table';
|
|
2
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
|
|
2
3
|
import type { EmptyStateProps } from '../../empty-state/empty-state';
|
|
3
|
-
import {
|
|
4
|
+
import { TableFrame } from '../table/table';
|
|
4
5
|
/**
|
|
5
6
|
* Props for {@link DataTableContent}: the empty and loading states, plus the props of the underlying table element.
|
|
6
7
|
*
|
|
@@ -11,19 +12,34 @@ import { Table } from '../table/table';
|
|
|
11
12
|
* @see DataTableContent
|
|
12
13
|
* @see DataTable
|
|
13
14
|
*/
|
|
14
|
-
type DataTableContentProps = Omit<ComponentProps<typeof
|
|
15
|
-
/**
|
|
15
|
+
type DataTableContentProps = Omit<ComponentProps<typeof TableFrame>, 'children' | 'fill' | 'stickyFirstColumn' | 'viewportRef'> & {
|
|
16
|
+
/** An action under the empty state, for example a button that creates the first row. Not shown when filters hide every row. */
|
|
17
|
+
emptyAction?: ReactNode;
|
|
18
|
+
/** A line under the empty state title. Not shown when filters hide every row. */
|
|
19
|
+
emptyDescription?: string;
|
|
20
|
+
/** Title for the empty state when filters or search hide every row. It comes with a button that clears them. Defaults to the table's `emptyFilteredTitle` label. */
|
|
16
21
|
emptyFilteredTitle?: string;
|
|
17
22
|
/** Icon for the empty state. Defaults to a table icon. */
|
|
18
23
|
emptyIcon?: EmptyStateProps['icon'];
|
|
19
|
-
/** Title for the empty state. */
|
|
24
|
+
/** Title for the empty state. Defaults to the table's `emptyTitle` label. */
|
|
20
25
|
emptyTitle?: string;
|
|
21
26
|
/** How many skeleton rows to show while loading. */
|
|
22
27
|
loadingRowCount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Opens a row, for example by navigating to it. Rows become clickable and focusable, and Enter opens the focused one.
|
|
30
|
+
* Clicks on controls inside a row, such as its checkbox or row actions, do not open it.
|
|
31
|
+
*/
|
|
32
|
+
onRowClick?: (row: Row<any>) => void;
|
|
23
33
|
};
|
|
24
34
|
/**
|
|
25
35
|
* The table itself: headers, rows, and the loading and empty states.
|
|
26
36
|
*
|
|
37
|
+
* - Always give it an `aria-label` that names the records, such as "Users".
|
|
38
|
+
* - `onRowClick` when a row opens something: rows become focusable, Enter opens, clicks on controls in the row do not.
|
|
39
|
+
* - `emptyTitle` in the records' own words; `emptyDescription` only when it says what to do; `emptyAction` when the
|
|
40
|
+
* first row can be created here. When filters hide every row, `emptyFilteredTitle` and Clear filters show instead.
|
|
41
|
+
* - Never put a placeholder row in the data or a banner inside the table: banners go beside it as siblings.
|
|
42
|
+
*
|
|
27
43
|
* @example
|
|
28
44
|
* ```tsx
|
|
29
45
|
* const dataTable = useDataTable({ columns, data, sorting: { mode: 'client' } });
|
|
@@ -37,7 +53,7 @@ type DataTableContentProps = Omit<ComponentProps<typeof Table>, 'children' | 'fi
|
|
|
37
53
|
* @see useDataTable
|
|
38
54
|
* @see DataTablePagination
|
|
39
55
|
*/
|
|
40
|
-
declare const DataTableContent: ({ className, emptyFilteredTitle, emptyIcon, emptyTitle, loadingRowCount, style, ...props }: DataTableContentProps) => ReactElement;
|
|
56
|
+
declare const DataTableContent: ({ className, emptyAction, emptyDescription, emptyFilteredTitle, emptyIcon, emptyTitle, loadingRowCount, onRowClick, style, ...props }: DataTableContentProps) => ReactElement;
|
|
41
57
|
export { DataTableContent };
|
|
42
58
|
export type { DataTableContentProps };
|
|
43
59
|
//# sourceMappingURL=data-table-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-content.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-table-content.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-content.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,GAAG,EAAc,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAa,UAAU,EAAoC,MAAM,gBAAgB,CAAC;AA0LzF;;;;;;;;;GASG;AACH,KAAK,qBAAqB,GAAG,IAAI,CAC/B,cAAc,CAAC,OAAO,UAAU,CAAC,EACjC,UAAU,GAAG,MAAM,GAAG,mBAAmB,GAAG,aAAa,CAC1D,GAAG;IACF,+HAA+H;IAC/H,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oKAAoK;IACpK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACpC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IAGH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,gBAAgB,0IAWnB,qBAAqB,KAAG,YAqI1B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { DataTableLabels } from './data-table-labels';
|
|
1
2
|
import type { DataTableInstance } from './use-data-table';
|
|
2
3
|
type DataTableContextValue = DataTableInstance<any> & {
|
|
3
4
|
fill: boolean;
|
|
5
|
+
labels: DataTableLabels;
|
|
4
6
|
};
|
|
5
7
|
declare const DataTableContext: import("react").Context<DataTableContextValue | null>;
|
|
6
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-context.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,KAAK,qBAAqB,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"data-table-context.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,KAAK,qBAAqB,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAEjG,QAAA,MAAM,gBAAgB,uDAAoD,CAAC;AAE3E;;;GAGG;AACH,QAAA,MAAM,mBAAmB,QAAO,qBAO/B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC;AACjD,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Every piece of text the data table parts render or announce. Pass any of them to `DataTable` as `labels`
|
|
4
|
+
* to translate or reword them; the rest keep their English defaults. Text that includes a value is a function of it.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const labels: Partial<DataTableLabels> = {
|
|
9
|
+
* clearFilters: t('table.clear_filters'),
|
|
10
|
+
* range: ({ end, start, total }) => t('table.range', { end, start, total }),
|
|
11
|
+
* };
|
|
12
|
+
* ```
|
|
13
|
+
* @see DataTable
|
|
14
|
+
* @see DataTableContent
|
|
15
|
+
*/
|
|
16
|
+
type DataTableLabels = {
|
|
17
|
+
/** Names the group of active filter chips. */
|
|
18
|
+
activeFilters: string;
|
|
19
|
+
/** Names the chip button that reopens a column's filter. */
|
|
20
|
+
changeFilter: (params: {
|
|
21
|
+
column: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}) => string;
|
|
24
|
+
/** The button in a column filter that clears it. */
|
|
25
|
+
clearColumnFilter: string;
|
|
26
|
+
/** The button that clears the search and every column filter. */
|
|
27
|
+
clearFilters: string;
|
|
28
|
+
/** Announces a column's width while it is resized, in pixels. */
|
|
29
|
+
columnWidth: (params: {
|
|
30
|
+
width: number;
|
|
31
|
+
}) => string;
|
|
32
|
+
/** The column picker button. */
|
|
33
|
+
columns: string;
|
|
34
|
+
/** Empty state title when filters or search hide every row. */
|
|
35
|
+
emptyFilteredTitle: string;
|
|
36
|
+
/** Group label for rows with no value in the grouped column. */
|
|
37
|
+
emptyGroup: string;
|
|
38
|
+
/** Empty state title when there are no rows. */
|
|
39
|
+
emptyTitle: string;
|
|
40
|
+
/** Names a column's filter button. */
|
|
41
|
+
filterColumn: (params: {
|
|
42
|
+
column: string;
|
|
43
|
+
isFiltered: boolean;
|
|
44
|
+
}) => string;
|
|
45
|
+
/** Shown in a values filter that has nothing to list. */
|
|
46
|
+
filterNoValues: string;
|
|
47
|
+
/** Placeholder of a text filter. */
|
|
48
|
+
filterPlaceholder: string;
|
|
49
|
+
/** Names the next page button. */
|
|
50
|
+
nextPage: string;
|
|
51
|
+
/** Names the pagination landmark. */
|
|
52
|
+
pagination: string;
|
|
53
|
+
/** Names the previous page button. */
|
|
54
|
+
previousPage: string;
|
|
55
|
+
/** The visible row range beside the pagination buttons. */
|
|
56
|
+
range: (params: {
|
|
57
|
+
end: number;
|
|
58
|
+
start: number;
|
|
59
|
+
total: number;
|
|
60
|
+
}) => ReactNode;
|
|
61
|
+
/** Names the chip button that removes a column filter. */
|
|
62
|
+
removeFilter: (params: {
|
|
63
|
+
column: string;
|
|
64
|
+
}) => string;
|
|
65
|
+
/** Names the chip button that clears the search. */
|
|
66
|
+
removeSearch: string;
|
|
67
|
+
/** Names a column's resize handle. */
|
|
68
|
+
resizeColumn: (params: {
|
|
69
|
+
column: string;
|
|
70
|
+
}) => string;
|
|
71
|
+
/** Names the row actions menu button. */
|
|
72
|
+
rowActions: string;
|
|
73
|
+
/** Search field placeholder and name, and the search chip's label. */
|
|
74
|
+
search: string;
|
|
75
|
+
/** Names the header checkbox that selects every row on the page. */
|
|
76
|
+
selectAllRows: string;
|
|
77
|
+
/** Names a row's checkbox. */
|
|
78
|
+
selectRow: string;
|
|
79
|
+
/** Read after a sorted column's name when the table sorts by several columns; `priority` starts at 1. */
|
|
80
|
+
sortPriority: (params: {
|
|
81
|
+
priority: number;
|
|
82
|
+
}) => string;
|
|
83
|
+
};
|
|
84
|
+
/** The English text the data table parts use unless `DataTable` is given other `labels`. */
|
|
85
|
+
declare const DEFAULT_DATA_TABLE_LABELS: DataTableLabels;
|
|
86
|
+
export { DEFAULT_DATA_TABLE_LABELS };
|
|
87
|
+
export type { DataTableLabels };
|
|
88
|
+
//# sourceMappingURL=data-table-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-labels.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/data-table-labels.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,KAAK,eAAe,GAAG;IACrB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,YAAY,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACpE,oDAAoD;IACpD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,WAAW,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACnD,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,YAAY,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,CAAC;IAC1E,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,KAAK,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAC5E,0DAA0D;IAC1D,YAAY,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACrD,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,YAAY,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACrD,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,yGAAyG;IACzG,YAAY,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CACxD,CAAC;AAEF,4FAA4F;AAC5F,QAAA,MAAM,yBAAyB,EAAE,eAiChC,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +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,
|
|
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,IAuB5C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -12,10 +12,12 @@ type DataTableEmptyRowProps = {
|
|
|
12
12
|
/** An action under the title, for example a button that clears the filters. */
|
|
13
13
|
action?: ReactNode;
|
|
14
14
|
columnCount: number;
|
|
15
|
+
/** A line under the title. */
|
|
16
|
+
description?: string;
|
|
15
17
|
icon: EmptyStateProps['icon'];
|
|
16
18
|
title: string;
|
|
17
19
|
};
|
|
18
20
|
/** Ghost rows keep the table's shape behind an icon and title. */
|
|
19
|
-
declare const DataTableEmptyRow: ({ action, columnCount, icon, title, }: DataTableEmptyRowProps) => ReactElement;
|
|
21
|
+
declare const DataTableEmptyRow: ({ action, columnCount, description, icon, title, }: DataTableEmptyRowProps) => ReactElement;
|
|
20
22
|
export { DataTableEmptyRow, DataTableSkeletonRows, STATIC_ROW };
|
|
21
23
|
//# sourceMappingURL=data-table-placeholder-rows.d.ts.map
|
|
@@ -1 +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,
|
|
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,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,kEAAkE;AAClE,QAAA,MAAM,iBAAiB,uDAMpB,sBAAsB,KAAG,YAqC3B,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -3,20 +3,23 @@ import { type ComponentPropsWithoutRef, type ReactElement, type Ref } from 'reac
|
|
|
3
3
|
/** Fixed layout cells clip and truncate, so a narrowed column cannot spill into its neighbour. The checkbox column never needs it. */
|
|
4
4
|
declare const FIXED_LAYOUT_CELL_CLASS = "overflow-hidden text-ellipsis";
|
|
5
5
|
type AnyRow = Row<any>;
|
|
6
|
-
/** The checkbox
|
|
6
|
+
/** The checkbox and row actions columns hold one control each, so they stay narrow and never clip. */
|
|
7
7
|
declare const isControlColumn: (columnId: string) => boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Lands on the row's `<tr>`, for the virtualizer to measure it. A named prop rather than `ref`, because on React 18
|
|
10
10
|
* a plain function component never receives `ref`.
|
|
11
11
|
*/
|
|
12
12
|
type RowRef = Ref<HTMLTableRowElement> | undefined;
|
|
13
|
+
/** Opens a row: navigate to it or show its details. Makes data rows clickable and focusable. */
|
|
14
|
+
type RowClickHandler = (row: AnyRow) => void;
|
|
13
15
|
type DataTableBodyRowProps = ComponentPropsWithoutRef<'tr'> & {
|
|
14
16
|
columnCount: number;
|
|
15
17
|
hasFixedLayout: boolean;
|
|
18
|
+
onRowClick?: RowClickHandler;
|
|
16
19
|
row: AnyRow;
|
|
17
20
|
rowRef?: RowRef;
|
|
18
21
|
};
|
|
19
22
|
/** 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;
|
|
23
|
+
declare const DataTableBodyRow: ({ columnCount, hasFixedLayout, onRowClick, row, ...props }: DataTableBodyRowProps) => ReactElement;
|
|
21
24
|
export { DataTableBodyRow, FIXED_LAYOUT_CELL_CLASS, isControlColumn };
|
|
22
25
|
//# sourceMappingURL=data-table-rows.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAYnF,sIAAsI;AACtI,QAAA,MAAM,uBAAuB,kCAAkC,CAAC;AAWhE,KAAK,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB,sGAAsG;AACtG,QAAA,MAAM,eAAe,aAAc,MAAM,KAAG,OACwB,CAAC;AAyBrE;;;GAGG;AACH,KAAK,MAAM,GAAG,GAAG,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;AAEnD,gGAAgG;AAChG,KAAK,eAAe,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AA4H7C,KAAK,qBAAqB,GAAG,wBAAwB,CAAC,IAAI,CAAC,GAAG;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,+DAMnB,qBAAqB,KAAG,YAc1B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { type ReactElement } from 'react';
|
|
|
11
11
|
*/
|
|
12
12
|
type DataTableSearchProps = {
|
|
13
13
|
className?: string;
|
|
14
|
-
/** Placeholder text, also the field's accessible name. */
|
|
14
|
+
/** Placeholder text, also the field's accessible name. Defaults to the table's `search` label. */
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
@@ -1 +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,
|
|
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,kGAAkG;IAClG,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactElement } from 'react';
|
|
2
|
+
import { type DataTableLabels } from './data-table-labels';
|
|
2
3
|
import type { DataTableInstance } from './use-data-table';
|
|
3
4
|
/**
|
|
4
5
|
* Props for {@link DataTable}: the `table` from `useDataTable`, an optional `fill` layout mode, and any `div` props.
|
|
@@ -13,12 +14,21 @@ import type { DataTableInstance } from './use-data-table';
|
|
|
13
14
|
type DataTableProps<TData> = ComponentProps<'div'> & {
|
|
14
15
|
/** 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
16
|
fill?: boolean;
|
|
17
|
+
/** Text for the parts to use instead of the English defaults, for translation or rewording. Pass only what changes. */
|
|
18
|
+
labels?: Partial<DataTableLabels>;
|
|
16
19
|
/** The result of `useDataTable`. */
|
|
17
20
|
table: DataTableInstance<TData>;
|
|
18
21
|
};
|
|
19
22
|
/**
|
|
20
23
|
* Root of a data table. Holds the table state for `DataTableContent`, `DataTablePagination` and the other parts.
|
|
21
24
|
*
|
|
25
|
+
* Use it for any list of records people sort, filter, page, select or open. Use the plain `Table` only for a short
|
|
26
|
+
* static list with none of those.
|
|
27
|
+
* - Turn features on per `useDataTable` option; pass `getRowId` when rows have an id, or selection follows the index.
|
|
28
|
+
* - Row actions: `actionsColumn({ getActions })`, last in `columns`. Never a hand-made button column.
|
|
29
|
+
* - Clickable rows: `onRowClick` on `DataTableContent`. Never a link in one cell.
|
|
30
|
+
* - Text: pass only the strings that change through `labels`, for translation.
|
|
31
|
+
*
|
|
22
32
|
* @example
|
|
23
33
|
* ```tsx
|
|
24
34
|
* const dataTable = useDataTable({ columns, data });
|
|
@@ -35,7 +45,7 @@ type DataTableProps<TData> = ComponentProps<'div'> & {
|
|
|
35
45
|
* @see DataTableContent
|
|
36
46
|
* @see DataTableToolbar
|
|
37
47
|
*/
|
|
38
|
-
declare const DataTable: <TData>({ children, className, fill, table, ...props }: DataTableProps<TData>) => ReactElement;
|
|
48
|
+
declare const DataTable: <TData>({ children, className, fill, labels, table, ...props }: DataTableProps<TData>) => ReactElement;
|
|
39
49
|
/**
|
|
40
50
|
* Row above the table for search, filters and actions.
|
|
41
51
|
*
|
|
@@ -1 +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
|
|
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,EAEL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAC7B,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,uHAAuH;IACvH,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC,oCAAoC;IACpC,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,SAAS,GAAI,KAAK,0DAOrB,cAAc,CAAC,KAAK,CAAC,KAAG,YA0B1B,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"}
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { type ReactElement } from 'react';
|
|
3
3
|
import { type DataTableProps } from './data-table';
|
|
4
4
|
declare const meta: {
|
|
5
|
-
component: <TData>({ children, className, fill, table, ...props }: DataTableProps<TData>) => ReactElement;
|
|
5
|
+
component: <TData>({ children, className, fill, labels, table, ...props }: DataTableProps<TData>) => ReactElement;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
@@ -21,6 +21,9 @@ export declare const Pinned: Story;
|
|
|
21
21
|
export declare const Resizable: Story;
|
|
22
22
|
export declare const Loading: Story;
|
|
23
23
|
export declare const Empty: Story;
|
|
24
|
+
export declare const EmptyWithAction: Story;
|
|
25
|
+
export declare const RowActions: Story;
|
|
26
|
+
export declare const Translated: Story;
|
|
24
27
|
export declare const WideScroll: Story;
|
|
25
28
|
export declare const Fill: Story;
|
|
26
29
|
export declare const Filtering: Story;
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"data-table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components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MAAM,WAAW,EAAE,KAoBzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAavB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
2
|
declare module '@tanstack/react-table' {
|
|
3
3
|
/**
|
|
4
|
-
* The column `meta` options data table reads: `filter`, `filterOptions` and `
|
|
4
|
+
* The column `meta` options data table reads: `filter`, `filterOptions`, `label` and `rowActions`.
|
|
5
5
|
* This augmentation merges globally into `@tanstack/react-table`'s `ColumnMeta`, so every TanStack table in an app that
|
|
6
6
|
* imports this package sees these keys too.
|
|
7
7
|
*/
|
|
@@ -12,8 +12,29 @@ declare module '@tanstack/react-table' {
|
|
|
12
12
|
filterOptions?: string[];
|
|
13
13
|
/** Readable name for menus and labels when `header` is not plain text. */
|
|
14
14
|
label?: string;
|
|
15
|
+
/** The actions in a row's menu. Set by `actionsColumn`; read by its cells. */
|
|
16
|
+
rowActions?: (row: TanStackRow<TData>) => DataTableRowAction[];
|
|
15
17
|
}
|
|
16
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* One item in a row's actions menu, built by `actionsColumn`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const action: DataTableRowAction = { label: 'Delete', onSelect: () => remove(user.id), variant: 'danger' };
|
|
25
|
+
* ```
|
|
26
|
+
* @see actionsColumn
|
|
27
|
+
* @see DataTableContent
|
|
28
|
+
*/
|
|
29
|
+
type DataTableRowAction = {
|
|
30
|
+
/** Shows the action but keeps it from being chosen. */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
label: string;
|
|
33
|
+
/** Runs when the action is chosen. The menu closes first. */
|
|
34
|
+
onSelect: () => void;
|
|
35
|
+
/** `danger` marks a destructive action, such as delete, in red. */
|
|
36
|
+
variant?: 'danger' | 'default';
|
|
37
|
+
};
|
|
17
38
|
/**
|
|
18
39
|
* 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
40
|
*
|
|
@@ -185,5 +206,5 @@ type DataTableFilterState = {
|
|
|
185
206
|
* @see SortingState
|
|
186
207
|
*/
|
|
187
208
|
type GroupingState = TanStackGroupingState;
|
|
188
|
-
export type { CellContext, ColumnDef, ColumnFiltersState, ColumnPinningState, ColumnSizingState, DataTableColumnPinningState, DataTableFilterState, GroupingState, PaginationState, Row, RowSelectionState, SortingState, VisibilityState, };
|
|
209
|
+
export type { CellContext, ColumnDef, ColumnFiltersState, ColumnPinningState, ColumnSizingState, DataTableColumnPinningState, DataTableFilterState, DataTableRowAction, GroupingState, PaginationState, Row, RowSelectionState, SortingState, VisibilityState, };
|
|
189
210
|
//# sourceMappingURL=data-table.types.d.ts.map
|
|
@@ -1 +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;
|
|
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;QACf,8EAA8E;QAC9E,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,kBAAkB,EAAE,CAAC;KAChE;CACF;AAED;;;;;;;;;GASG;AACH,KAAK,kBAAkB,GAAG;IACxB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,QAAQ,EAAE,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C;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,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,GAAG,EACH,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAChB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a click or key press on a row should open it: it came from the row itself or plain content inside it,
|
|
3
|
+
* not from a control such as a checkbox, link or row action menu.
|
|
4
|
+
*/
|
|
5
|
+
declare const isRowActivation: ({ currentTarget, target }: {
|
|
6
|
+
currentTarget: Element;
|
|
7
|
+
target: EventTarget;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
export { isRowActivation };
|
|
10
|
+
//# sourceMappingURL=is-row-activation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-row-activation.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/data-table/is-row-activation.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,QAAA,MAAM,eAAe,8BAA+B;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,KAAG,OAMrG,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +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;
|
|
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;AAM1F;;;;;;;;;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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { CursorPagination, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from './pagination';
|
|
2
|
-
export type { CursorPaginationProps, PaginationLinkProps } from './pagination';
|
|
2
|
+
export type { CursorPaginationLabels, CursorPaginationProps, PaginationLinkProps } from './pagination';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -41,6 +41,28 @@ declare const PaginationNext: ({ className, children, ...props }: ComponentProps
|
|
|
41
41
|
* numbers and can infer that pages are omitted.
|
|
42
42
|
*/
|
|
43
43
|
declare const PaginationEllipsis: ({ className, ...props }: ComponentProps<"span">) => ReactElement;
|
|
44
|
+
/**
|
|
45
|
+
* Accessible names {@link CursorPagination} gives its region and buttons. Pass all three as `labels` to translate
|
|
46
|
+
* or reword them; without `labels` they are English.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <CursorPagination
|
|
51
|
+
* hasNext={hasNext}
|
|
52
|
+
* hasPrevious={hasPrevious}
|
|
53
|
+
* labels={{ next: t('pagination.next'), previous: t('pagination.previous'), region: t('pagination.region') }}
|
|
54
|
+
* onNext={fetchNext}
|
|
55
|
+
* onPrevious={fetchPrevious}
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
* @see CursorPagination
|
|
59
|
+
* @see DataTableLabels
|
|
60
|
+
*/
|
|
61
|
+
type CursorPaginationLabels = {
|
|
62
|
+
next: string;
|
|
63
|
+
previous: string;
|
|
64
|
+
region: string;
|
|
65
|
+
};
|
|
44
66
|
type CursorPaginationProps = {
|
|
45
67
|
className?: string;
|
|
46
68
|
/** Whether a next page exists; disables the next button when false. */
|
|
@@ -52,6 +74,8 @@ type CursorPaginationProps = {
|
|
|
52
74
|
* Commonly used for a "Page N of M" or record-range label.
|
|
53
75
|
*/
|
|
54
76
|
label?: ReactNode;
|
|
77
|
+
/** Accessible names for the region and its buttons, for translation. Defaults to English. */
|
|
78
|
+
labels?: CursorPaginationLabels;
|
|
55
79
|
/** Fired when the user requests the next page. */
|
|
56
80
|
onNext: () => void;
|
|
57
81
|
/** Fired when the user requests the previous page. */
|
|
@@ -76,7 +100,7 @@ type CursorPaginationProps = {
|
|
|
76
100
|
* />
|
|
77
101
|
* ```
|
|
78
102
|
*/
|
|
79
|
-
declare const CursorPagination: ({ hasPrevious, hasNext, onPrevious, onNext, label, className, }: CursorPaginationProps) => ReactElement;
|
|
103
|
+
declare const CursorPagination: ({ hasPrevious, hasNext, onPrevious, onNext, label, labels, className, }: CursorPaginationProps) => ReactElement;
|
|
80
104
|
export { CursorPagination, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
|
|
81
|
-
export type { CursorPaginationProps, PaginationLinkProps };
|
|
105
|
+
export type { CursorPaginationLabels, CursorPaginationProps, PaginationLinkProps };
|
|
82
106
|
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/pagination/pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc/E;;;GAGG;AACH,QAAA,MAAM,UAAU,4BAGb,cAAc,CAAC,KAAK,CAAC,KAAG,YAQ1B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,iBAAiB,4BAGpB,cAAc,CAAC,IAAI,CAAC,KAAG,YAMzB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,cAAc,4BAGjB,cAAc,CAAC,IAAI,CAAC,KAAG,YAEzB,CAAC;AAEF,KAAK,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IAC/C,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,cAAc,gDAKjB,mBAAmB,KAAG,YAgBxB,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,sCAIrB,cAAc,CAAC,GAAG,CAAC,KAAG,YAgBxB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,cAAc,sCAIjB,cAAc,CAAC,GAAG,CAAC,KAAG,YAexB,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,4BAGrB,cAAc,CAAC,MAAM,CAAC,KAAG,YAa3B,CAAC;AAMF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,OAAO,EAAE,OAAO,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AACH,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAQF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,kDAAkD;IAClD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,sDAAsD;IACtD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,gBAAgB,4EAQnB,qBAAqB,KAAG,YAqC1B,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,CAAC;AACF,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -9,6 +9,11 @@ type TableProps = ComponentProps<'table'> & {
|
|
|
9
9
|
/** Receives the scroll viewport element, for code that follows its scrolling such as row virtualization. */
|
|
10
10
|
viewportRef?: Ref<HTMLDivElement>;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* The table tray `DataTable` renders. Same as `Table`, without the deprecation that steers apps toward `DataTable`;
|
|
14
|
+
* only `DataTable` should use it, and it is not exported from the package.
|
|
15
|
+
*/
|
|
16
|
+
declare const TableFrame: ({ className, fill, scrollAreaProps, stickyFirstColumn, viewportRef, ...props }: TableProps) => ReactElement;
|
|
12
17
|
/**
|
|
13
18
|
* Render a table in a stable tray with keyboard access only when content overflows.
|
|
14
19
|
* For any list of records, use `DataTable`, which is built on this. Use `Table` directly
|
|
@@ -24,5 +29,5 @@ declare const TableRow: import("react").ForwardRefExoticComponent<Omit<import("r
|
|
|
24
29
|
declare const TableHead: ({ className, scope, ...props }: ComponentProps<"th">) => ReactElement;
|
|
25
30
|
declare const TableCell: ({ className, ...props }: ComponentProps<"td">) => ReactElement;
|
|
26
31
|
declare const TableCaption: ({ className, ...props }: ComponentProps<"caption">) => ReactElement;
|
|
27
|
-
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
32
|
+
export { Table, TableFrame, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
28
33
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,GAAG,EAOT,MAAM,OAAO,CAAC;AAKf,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IAC1C,gJAAgJ;IAChJ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,eAAe,CAAC,EAAE,IAAI,CACpB,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CACzC,CAAC;IACF,2FAA2F;IAC3F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4GAA4G;IAC5G,WAAW,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CACnC,CAAC;AAwEF;;;;;;GAMG;AACH,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,GAAG,EAOT,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