@cognite/aura 1.46426.0 → 1.46447.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.
@@ -1,4 +1,4 @@
1
- import type { Row } from "@tanstack/react-table";
1
+ import type { Row, RowSelectionState } from "@tanstack/react-table";
2
2
  type DataGridCheckboxState = boolean | "indeterminate";
3
3
  type DataGridSelectionRow<TData> = Pick<Row<TData>, "getIsSelected" | "getIsSomeSelected" | "getIsAllSubRowsSelected"> & {
4
4
  subRows: Pick<Row<TData>["subRows"], "length">;
@@ -11,4 +11,5 @@ type DataGridToggleableRow = {
11
11
  subRows: readonly DataGridToggleableRow[];
12
12
  };
13
13
  declare function selectDataGridRowTree(row: DataGridToggleableRow): void;
14
- export { getDataGridCheckboxState, isDataGridRowHighlighted, selectDataGridRowTree, type DataGridCheckboxState, type DataGridSelectionRow };
14
+ declare function countSelectedRowIds(rowSelection: RowSelectionState): number;
15
+ export { countSelectedRowIds, getDataGridCheckboxState, isDataGridRowHighlighted, selectDataGridRowTree, type DataGridCheckboxState, type DataGridSelectionRow };
@@ -24,6 +24,9 @@ function selectDataGridRowTree(row) {
24
24
  selectDataGridRowTree(subRow);
25
25
  }
26
26
  }
27
- export { getDataGridCheckboxState, isDataGridRowHighlighted, selectDataGridRowTree };
27
+ function countSelectedRowIds(rowSelection) {
28
+ return Object.values(rowSelection).filter(Boolean).length;
29
+ }
30
+ export { countSelectedRowIds, getDataGridCheckboxState, isDataGridRowHighlighted, selectDataGridRowTree };
28
31
 
29
32
  //# sourceMappingURL=data-grid-selection-state.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/ui/core/data-grid/data-grid-selection-state.ts"],"sourcesContent":["import type { Row } from '@tanstack/react-table';\n\ntype DataGridCheckboxState = boolean | 'indeterminate';\n\n// This is the slice of `Row<TData>` that selection reads.\ntype DataGridSelectionRow<TData> = Pick<\n Row<TData>,\n 'getIsSelected' | 'getIsSomeSelected' | 'getIsAllSubRowsSelected'\n> & {\n subRows: Pick<Row<TData>['subRows'], 'length'>;\n};\n\nfunction getDataGridCheckboxState<TData>(\n row: DataGridSelectionRow<TData>\n): DataGridCheckboxState {\n if (row.subRows.length === 0) {\n return row.getIsSelected();\n }\n\n if (row.getIsAllSubRowsSelected()) {\n return true;\n }\n\n if (row.getIsSomeSelected()) {\n return 'indeterminate';\n }\n\n return false;\n}\n\nfunction isDataGridRowHighlighted<TData>(\n row: DataGridSelectionRow<TData>\n): boolean {\n return row.getIsSelected() || row.getIsSomeSelected();\n}\n\ntype DataGridToggleableRow = {\n getIsSelected: () => boolean;\n toggleSelected: (value?: boolean) => void;\n subRows: readonly DataGridToggleableRow[];\n};\n\n// TanStack ignores toggleSelected(true) when the row id is already selected.\n// A partial parent is in that state, so its missing descendants must be selected directly.\nfunction selectDataGridRowTree(row: DataGridToggleableRow): void {\n if (!row.getIsSelected()) {\n row.toggleSelected(true);\n return;\n }\n\n for (const subRow of row.subRows) {\n selectDataGridRowTree(subRow);\n }\n}\n\nexport {\n getDataGridCheckboxState,\n isDataGridRowHighlighted,\n selectDataGridRowTree,\n type DataGridCheckboxState,\n type DataGridSelectionRow,\n};\n"],"names":["getDataGridCheckboxState","row","subRows","length","getIsSelected","getIsAllSubRowsSelected","getIsSomeSelected","isDataGridRowHighlighted","selectDataGridRowTree","toggleSelected","subRow"],"mappings":"AAYA,SAASA,yBACPC,GAAgC;IAEhC,IAAIA,IAAIC,OAAO,CAACC,MAAM,KAAK,GAAG;QAC5B,OAAOF,IAAIG,aAAa;IAC1B;IAEA,IAAIH,IAAII,uBAAuB,IAAI;QACjC,OAAO;IACT;IAEA,IAAIJ,IAAIK,iBAAiB,IAAI;QAC3B,OAAO;IACT;IAEA,OAAO;AACT;AAEA,SAASC,yBACPN,GAAgC;IAEhC,OAAOA,IAAIG,aAAa,MAAMH,IAAIK,iBAAiB;AACrD;AAQA,6EAA6E;AAC7E,2FAA2F;AAC3F,SAASE,sBAAsBP,GAA0B;IACvD,IAAI,CAACA,IAAIG,aAAa,IAAI;QACxBH,IAAIQ,cAAc,CAAC;QACnB;IACF;IAEA,KAAK,MAAMC,UAAUT,IAAIC,OAAO,CAAE;QAChCM,sBAAsBE;IACxB;AACF;AAEA,SACEV,wBAAwB,EACxBO,wBAAwB,EACxBC,qBAAqB,GAGrB"}
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/data-grid/data-grid-selection-state.ts"],"sourcesContent":["import type { Row, RowSelectionState } from '@tanstack/react-table';\n\ntype DataGridCheckboxState = boolean | 'indeterminate';\n\n// This is the slice of `Row<TData>` that selection reads.\ntype DataGridSelectionRow<TData> = Pick<\n Row<TData>,\n 'getIsSelected' | 'getIsSomeSelected' | 'getIsAllSubRowsSelected'\n> & {\n subRows: Pick<Row<TData>['subRows'], 'length'>;\n};\n\nfunction getDataGridCheckboxState<TData>(\n row: DataGridSelectionRow<TData>\n): DataGridCheckboxState {\n if (row.subRows.length === 0) {\n return row.getIsSelected();\n }\n\n if (row.getIsAllSubRowsSelected()) {\n return true;\n }\n\n if (row.getIsSomeSelected()) {\n return 'indeterminate';\n }\n\n return false;\n}\n\nfunction isDataGridRowHighlighted<TData>(\n row: DataGridSelectionRow<TData>\n): boolean {\n return row.getIsSelected() || row.getIsSomeSelected();\n}\n\ntype DataGridToggleableRow = {\n getIsSelected: () => boolean;\n toggleSelected: (value?: boolean) => void;\n subRows: readonly DataGridToggleableRow[];\n};\n\n// TanStack ignores toggleSelected(true) when the row id is already selected.\n// A partial parent is in that state, so its missing descendants must be selected directly.\nfunction selectDataGridRowTree(row: DataGridToggleableRow): void {\n if (!row.getIsSelected()) {\n row.toggleSelected(true);\n return;\n }\n\n for (const subRow of row.subRows) {\n selectDataGridRowTree(subRow);\n }\n}\n\nfunction countSelectedRowIds(rowSelection: RowSelectionState): number {\n return Object.values(rowSelection).filter(Boolean).length;\n}\n\nexport {\n countSelectedRowIds,\n getDataGridCheckboxState,\n isDataGridRowHighlighted,\n selectDataGridRowTree,\n type DataGridCheckboxState,\n type DataGridSelectionRow,\n};\n"],"names":["getDataGridCheckboxState","row","subRows","length","getIsSelected","getIsAllSubRowsSelected","getIsSomeSelected","isDataGridRowHighlighted","selectDataGridRowTree","toggleSelected","subRow","countSelectedRowIds","rowSelection","Object","values","filter","Boolean"],"mappings":"AAYA,SAASA,yBACPC,GAAgC;IAEhC,IAAIA,IAAIC,OAAO,CAACC,MAAM,KAAK,GAAG;QAC5B,OAAOF,IAAIG,aAAa;IAC1B;IAEA,IAAIH,IAAII,uBAAuB,IAAI;QACjC,OAAO;IACT;IAEA,IAAIJ,IAAIK,iBAAiB,IAAI;QAC3B,OAAO;IACT;IAEA,OAAO;AACT;AAEA,SAASC,yBACPN,GAAgC;IAEhC,OAAOA,IAAIG,aAAa,MAAMH,IAAIK,iBAAiB;AACrD;AAQA,6EAA6E;AAC7E,2FAA2F;AAC3F,SAASE,sBAAsBP,GAA0B;IACvD,IAAI,CAACA,IAAIG,aAAa,IAAI;QACxBH,IAAIQ,cAAc,CAAC;QACnB;IACF;IAEA,KAAK,MAAMC,UAAUT,IAAIC,OAAO,CAAE;QAChCM,sBAAsBE;IACxB;AACF;AAEA,SAASC,oBAAoBC,YAA+B;IAC1D,OAAOC,OAAOC,MAAM,CAACF,cAAcG,MAAM,CAACC,SAASb,MAAM;AAC3D;AAEA,SACEQ,mBAAmB,EACnBX,wBAAwB,EACxBO,wBAAwB,EACxBC,qBAAqB,GAGrB"}
@@ -0,0 +1,11 @@
1
+ import { type ReactElement } from "react";
2
+ import type { RowSelectionState } from "@tanstack/react-table";
3
+ import type { DataGridSelectionActions } from "./data-grid-selection.types";
4
+ type DataGridSelectionToolbarProps = {
5
+ selectedCount: number;
6
+ rowSelection: RowSelectionState;
7
+ selectionActions?: DataGridSelectionActions;
8
+ onClear: () => void;
9
+ };
10
+ declare function DataGridSelectionToolbar({ selectedCount, rowSelection, selectionActions, onClear }: DataGridSelectionToolbarProps): ReactElement;
11
+ export { DataGridSelectionToolbar };
@@ -0,0 +1,128 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { IconDotsVertical } from "@tabler/icons-react";
4
+ import { ActionToolbar, ActionToolbarAction, ActionToolbarActionClear, ActionToolbarActions, ActionToolbarPrimaryAction, ActionToolbarSelection, ActionToolbarSelectionSummary } from "../action-toolbar/action-toolbar.js";
5
+ import { Button } from "../button/button.js";
6
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu/dropdown-menu.js";
7
+ const MAX_SECONDARY_ACTIONS = 5;
8
+ function DataGridSelectionToolbar({ selectedCount, rowSelection, selectionActions, onClear }) {
9
+ const primaryAction = selectionActions?.primaryAction;
10
+ const requestedSecondaryActions = selectionActions?.secondaryActions ?? [];
11
+ const secondaryActions = limitSecondaryActions(requestedSecondaryActions);
12
+ const menuActions = selectionActions?.menuActions ?? [];
13
+ const secondaryActionCount = requestedSecondaryActions.length;
14
+ useEffect(()=>{
15
+ if (secondaryActionCount <= MAX_SECONDARY_ACTIONS) return;
16
+ console.warn(`[Aura DataGrid] The selection toolbar shows at most ${MAX_SECONDARY_ACTIONS} secondary actions. ` + 'Move the rest to menuActions.');
17
+ }, [
18
+ secondaryActionCount
19
+ ]);
20
+ return /*#__PURE__*/ _jsx("div", {
21
+ className: "pointer-events-none sticky bottom-4 z-20 flex justify-center px-4",
22
+ children: /*#__PURE__*/ _jsxs(ActionToolbar, {
23
+ selectedCount: selectedCount,
24
+ width: "full",
25
+ "aria-label": "Selection actions",
26
+ className: "pointer-events-auto",
27
+ children: [
28
+ /*#__PURE__*/ _jsxs(ActionToolbarSelection, {
29
+ "aria-label": "Selected rows",
30
+ children: [
31
+ /*#__PURE__*/ _jsx(ActionToolbarSelectionSummary, {}),
32
+ /*#__PURE__*/ _jsx(ActionToolbarActionClear, {
33
+ onClick: onClear
34
+ })
35
+ ]
36
+ }),
37
+ /*#__PURE__*/ _jsxs(ActionToolbarActions, {
38
+ "aria-label": "Actions",
39
+ children: [
40
+ menuActions.length > 0 ? /*#__PURE__*/ _jsx(DataGridSelectionMenu, {
41
+ actions: menuActions,
42
+ rowSelection: rowSelection
43
+ }) : null,
44
+ secondaryActions.map((action)=>/*#__PURE__*/ _jsx(DataGridSecondaryToolbarAction, {
45
+ action: action,
46
+ rowSelection: rowSelection
47
+ }, actionListKey(secondaryActions, action))),
48
+ primaryAction ? /*#__PURE__*/ _jsxs(ActionToolbarPrimaryAction, {
49
+ onClick: ()=>primaryAction.onClick(rowSelection),
50
+ children: [
51
+ primaryAction.icon ? /*#__PURE__*/ _jsx("span", {
52
+ "aria-hidden": "true",
53
+ children: primaryAction.icon
54
+ }) : null,
55
+ primaryAction.label
56
+ ]
57
+ }) : null
58
+ ]
59
+ })
60
+ ]
61
+ })
62
+ });
63
+ }
64
+ function DataGridSecondaryToolbarAction({ action, rowSelection }) {
65
+ if (action.label != null) {
66
+ return /*#__PURE__*/ _jsxs(ActionToolbarAction, {
67
+ onClick: ()=>action.onClick(rowSelection),
68
+ children: [
69
+ action.icon ? /*#__PURE__*/ _jsx("span", {
70
+ "aria-hidden": "true",
71
+ children: action.icon
72
+ }) : null,
73
+ action.label
74
+ ]
75
+ });
76
+ }
77
+ return /*#__PURE__*/ _jsx(ActionToolbarAction, {
78
+ iconOnly: true,
79
+ "aria-label": action['aria-label'],
80
+ onClick: ()=>action.onClick(rowSelection),
81
+ children: /*#__PURE__*/ _jsx("span", {
82
+ "aria-hidden": "true",
83
+ children: action.icon
84
+ })
85
+ });
86
+ }
87
+ function DataGridSelectionMenu({ actions, rowSelection }) {
88
+ return /*#__PURE__*/ _jsxs(DropdownMenu, {
89
+ children: [
90
+ /*#__PURE__*/ _jsx(DropdownMenuTrigger, {
91
+ render: /*#__PURE__*/ _jsx(Button, {
92
+ variant: "ghostOnDark",
93
+ size: "icon",
94
+ "aria-label": "More actions",
95
+ children: /*#__PURE__*/ _jsx(IconDotsVertical, {
96
+ "aria-hidden": "true"
97
+ })
98
+ })
99
+ }),
100
+ /*#__PURE__*/ _jsx(DropdownMenuContent, {
101
+ side: "top",
102
+ align: "end",
103
+ children: actions.map((action)=>/*#__PURE__*/ _jsxs(DropdownMenuItem, {
104
+ onClick: ()=>action.onClick(rowSelection),
105
+ children: [
106
+ action.icon ? /*#__PURE__*/ _jsx("span", {
107
+ "aria-hidden": "true",
108
+ children: action.icon
109
+ }) : null,
110
+ action.label
111
+ ]
112
+ }, actionListKey(actions, action)))
113
+ })
114
+ ]
115
+ });
116
+ }
117
+ function actionListKey(actions, action) {
118
+ const name = action.label ?? action['aria-label'] ?? '';
119
+ const earlierDuplicates = actions.slice(0, actions.indexOf(action)).filter((candidate)=>(candidate.label ?? candidate['aria-label']) === name).length;
120
+ if (earlierDuplicates === 0) return name;
121
+ return `${name}-${earlierDuplicates + 1}`;
122
+ }
123
+ function limitSecondaryActions(actions) {
124
+ return actions.slice(0, MAX_SECONDARY_ACTIONS);
125
+ }
126
+ export { DataGridSelectionToolbar };
127
+
128
+ //# sourceMappingURL=data-grid-selection-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/data-grid/data-grid-selection-toolbar.tsx"],"sourcesContent":["import { useEffect, type ReactElement } from 'react';\n\nimport { IconDotsVertical } from '@tabler/icons-react';\nimport type { RowSelectionState } from '@tanstack/react-table';\n\nimport {\n ActionToolbar,\n ActionToolbarAction,\n ActionToolbarActionClear,\n ActionToolbarActions,\n ActionToolbarPrimaryAction,\n ActionToolbarSelection,\n ActionToolbarSelectionSummary,\n} from '../action-toolbar/action-toolbar';\nimport { Button } from '../button/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '../dropdown-menu/dropdown-menu';\n\nimport type {\n DataGridSecondaryAction,\n DataGridSelectionAction,\n DataGridSelectionActions,\n} from './data-grid-selection.types';\n\ntype DataGridSelectionToolbarProps = {\n selectedCount: number;\n rowSelection: RowSelectionState;\n selectionActions?: DataGridSelectionActions;\n onClear: () => void;\n};\n\nconst MAX_SECONDARY_ACTIONS = 5;\n\nfunction DataGridSelectionToolbar({\n selectedCount,\n rowSelection,\n selectionActions,\n onClear,\n}: DataGridSelectionToolbarProps): ReactElement {\n const primaryAction = selectionActions?.primaryAction;\n const requestedSecondaryActions = selectionActions?.secondaryActions ?? [];\n const secondaryActions = limitSecondaryActions(requestedSecondaryActions);\n const menuActions = selectionActions?.menuActions ?? [];\n\n const secondaryActionCount = requestedSecondaryActions.length;\n\n useEffect(() => {\n if (secondaryActionCount <= MAX_SECONDARY_ACTIONS) return;\n console.warn(\n `[Aura DataGrid] The selection toolbar shows at most ${MAX_SECONDARY_ACTIONS} secondary actions. ` +\n 'Move the rest to menuActions.'\n );\n }, [secondaryActionCount]);\n\n return (\n <div className=\"pointer-events-none sticky bottom-4 z-20 flex justify-center px-4\">\n <ActionToolbar\n selectedCount={selectedCount}\n width=\"full\"\n aria-label=\"Selection actions\"\n className=\"pointer-events-auto\"\n >\n <ActionToolbarSelection aria-label=\"Selected rows\">\n <ActionToolbarSelectionSummary />\n <ActionToolbarActionClear onClick={onClear} />\n </ActionToolbarSelection>\n <ActionToolbarActions aria-label=\"Actions\">\n {menuActions.length > 0 ? (\n <DataGridSelectionMenu\n actions={menuActions}\n rowSelection={rowSelection}\n />\n ) : null}\n {secondaryActions.map((action: DataGridSecondaryAction) => (\n <DataGridSecondaryToolbarAction\n key={actionListKey(secondaryActions, action)}\n action={action}\n rowSelection={rowSelection}\n />\n ))}\n {primaryAction ? (\n <ActionToolbarPrimaryAction\n onClick={() => primaryAction.onClick(rowSelection)}\n >\n {primaryAction.icon ? (\n <span aria-hidden=\"true\">{primaryAction.icon}</span>\n ) : null}\n {primaryAction.label}\n </ActionToolbarPrimaryAction>\n ) : null}\n </ActionToolbarActions>\n </ActionToolbar>\n </div>\n );\n}\n\nfunction DataGridSecondaryToolbarAction({\n action,\n rowSelection,\n}: {\n action: DataGridSecondaryAction;\n rowSelection: RowSelectionState;\n}): ReactElement {\n if (action.label != null) {\n return (\n <ActionToolbarAction onClick={() => action.onClick(rowSelection)}>\n {action.icon ? <span aria-hidden=\"true\">{action.icon}</span> : null}\n {action.label}\n </ActionToolbarAction>\n );\n }\n\n return (\n <ActionToolbarAction\n iconOnly\n aria-label={action['aria-label']}\n onClick={() => action.onClick(rowSelection)}\n >\n <span aria-hidden=\"true\">{action.icon}</span>\n </ActionToolbarAction>\n );\n}\n\nfunction DataGridSelectionMenu({\n actions,\n rowSelection,\n}: {\n actions: readonly DataGridSelectionAction[];\n rowSelection: RowSelectionState;\n}): ReactElement {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button variant=\"ghostOnDark\" size=\"icon\" aria-label=\"More actions\">\n <IconDotsVertical aria-hidden=\"true\" />\n </Button>\n }\n />\n <DropdownMenuContent side=\"top\" align=\"end\">\n {actions.map((action: DataGridSelectionAction) => (\n <DropdownMenuItem\n key={actionListKey(actions, action)}\n onClick={() => action.onClick(rowSelection)}\n >\n {action.icon ? <span aria-hidden=\"true\">{action.icon}</span> : null}\n {action.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction actionListKey<T extends { label?: string; 'aria-label'?: string }>(\n actions: readonly T[],\n action: T\n): string {\n const name = action.label ?? action['aria-label'] ?? '';\n const earlierDuplicates = actions\n .slice(0, actions.indexOf(action))\n .filter(\n (candidate) => (candidate.label ?? candidate['aria-label']) === name\n ).length;\n if (earlierDuplicates === 0) return name;\n return `${name}-${earlierDuplicates + 1}`;\n}\n\nfunction limitSecondaryActions(\n actions: readonly DataGridSecondaryAction[]\n): readonly DataGridSecondaryAction[] {\n return actions.slice(0, MAX_SECONDARY_ACTIONS);\n}\n\nexport { DataGridSelectionToolbar };\n"],"names":["useEffect","IconDotsVertical","ActionToolbar","ActionToolbarAction","ActionToolbarActionClear","ActionToolbarActions","ActionToolbarPrimaryAction","ActionToolbarSelection","ActionToolbarSelectionSummary","Button","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuTrigger","MAX_SECONDARY_ACTIONS","DataGridSelectionToolbar","selectedCount","rowSelection","selectionActions","onClear","primaryAction","requestedSecondaryActions","secondaryActions","limitSecondaryActions","menuActions","secondaryActionCount","length","console","warn","div","className","width","aria-label","onClick","DataGridSelectionMenu","actions","map","action","DataGridSecondaryToolbarAction","actionListKey","icon","span","aria-hidden","label","iconOnly","render","variant","size","side","align","name","earlierDuplicates","slice","indexOf","filter","candidate"],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from "react";
2
+ import type { RowSelectionState } from "@tanstack/react-table";
3
+ type DataGridSelectionActionClick = (rowSelection: RowSelectionState) => void;
4
+ type DataGridSelectionAction = {
5
+ label: string;
6
+ icon?: ReactNode;
7
+ onClick: DataGridSelectionActionClick;
8
+ };
9
+ type DataGridSecondaryAction = {
10
+ onClick: DataGridSelectionActionClick;
11
+ } & ({
12
+ label: string;
13
+ icon?: ReactNode;
14
+ } | {
15
+ icon: ReactNode;
16
+ label?: undefined;
17
+ "aria-label": string;
18
+ });
19
+ type DataGridSelectionActions = {
20
+ primaryAction?: DataGridSelectionAction;
21
+ secondaryActions?: readonly DataGridSecondaryAction[];
22
+ menuActions?: readonly DataGridSelectionAction[];
23
+ };
24
+ export type { DataGridSecondaryAction, DataGridSelectionAction, DataGridSelectionActions };
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=data-grid-selection.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/data-grid/data-grid-selection.types.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { RowSelectionState } from '@tanstack/react-table';\n\n// The grid passes the current selection.\ntype DataGridSelectionActionClick = (rowSelection: RowSelectionState) => void;\n\ntype DataGridSelectionAction = {\n label: string;\n icon?: ReactNode;\n onClick: DataGridSelectionActionClick;\n};\n\ntype DataGridSecondaryAction = {\n onClick: DataGridSelectionActionClick;\n} & (\n | { label: string; icon?: ReactNode }\n | { icon: ReactNode; label?: undefined; 'aria-label': string }\n);\n\ntype DataGridSelectionActions = {\n primaryAction?: DataGridSelectionAction;\n secondaryActions?: readonly DataGridSecondaryAction[];\n menuActions?: readonly DataGridSelectionAction[];\n};\n\nexport type {\n DataGridSecondaryAction,\n DataGridSelectionAction,\n DataGridSelectionActions,\n};\n"],"names":[],"mappings":"AA0BA,WAIE"}
@@ -2,6 +2,7 @@ import { type ComponentProps, type ComponentRef, type ForwardRefExoticComponent,
2
2
  import { type ColumnDef, type ColumnSizingState, type ExpandedState, type FilterFnOption, type PaginationState, type Row, type RowSelectionState, type Table, type SortingState } from "@tanstack/react-table";
3
3
  import { Button } from "../button/button";
4
4
  import { Search } from "../search/search";
5
+ import type { DataGridSelectionActions } from "./data-grid-selection.types";
5
6
  type DataGridContextValue = {
6
7
  searchValue: string;
7
8
  setSearchValue: (value: string) => void;
@@ -55,6 +56,7 @@ type DataGridBaseProps<TData> = {
55
56
  rowSelection?: RowSelectionState;
56
57
  defaultRowSelection?: RowSelectionState;
57
58
  onRowSelectionChange?: (value: RowSelectionState) => void;
59
+ selectionActions?: DataGridSelectionActions;
58
60
  sorting?: SortingState;
59
61
  defaultSorting?: SortingState;
60
62
  onSortingChange?: (value: SortingState) => void;
@@ -99,7 +101,7 @@ type DataGridAccessibleNameProps = {
99
101
  "aria-label"?: string;
100
102
  };
101
103
  type DataGridProps<TData> = DataGridBaseProps<TData> & DataGridAccessibleNameProps;
102
- declare function DataGrid<TData>({ data, columns, getRowId, rowCount, globalFilterFn, enableRowSelection, enableSorting, enableColumnResizing, columnGrow, columnSizing, defaultColumnSizing, onColumnSizingChange, manualPagination, manualSorting, rowSelection, defaultRowSelection, onRowSelectionChange, sorting, defaultSorting, onSortingChange, pagination, defaultPagination, onPaginationChange, getSubRows, expanded, defaultExpanded, onExpandedChange, getRowCanExpand, maxDepth, pinnedColumns, gridRef, size, children, className, onRowClick, searchValue, defaultSearchValue, onSearchValueChange, queryMode, loading, loadingVariant, loadingRowCount, renderLoadingCell, emptyState, noResultsState, filteredResultCount, totalResultCount, onClearSearch, onClearFilters, labels: labelOverrides, rowHeight, headerHeight, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }: DataGridProps<TData>): ReactElement;
104
+ declare function DataGrid<TData>({ data, columns, getRowId, rowCount, globalFilterFn, enableRowSelection, enableSorting, enableColumnResizing, columnGrow, columnSizing, defaultColumnSizing, onColumnSizingChange, manualPagination, manualSorting, rowSelection, defaultRowSelection, onRowSelectionChange, selectionActions, sorting, defaultSorting, onSortingChange, pagination, defaultPagination, onPaginationChange, getSubRows, expanded, defaultExpanded, onExpandedChange, getRowCanExpand, maxDepth, pinnedColumns, gridRef, size, children, className, onRowClick, searchValue, defaultSearchValue, onSearchValueChange, queryMode, loading, loadingVariant, loadingRowCount, renderLoadingCell, emptyState, noResultsState, filteredResultCount, totalResultCount, onClearSearch, onClearFilters, labels: labelOverrides, rowHeight, headerHeight, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }: DataGridProps<TData>): ReactElement;
103
105
  declare function DataGridCheckboxHeader<TData>({ table }: {
104
106
  table: Table<TData>;
105
107
  }): ReactElement;
@@ -13,7 +13,8 @@ import { Skeleton } from "../skeleton/skeleton.js";
13
13
  import { DataGridCell } from "./data-grid-cell.js";
14
14
  import { DataGridHeaderRow } from "./data-grid-header-row.js";
15
15
  import { DataGridRow } from "./data-grid-row.js";
16
- import { getDataGridCheckboxState, selectDataGridRowTree } from "./data-grid-selection-state.js";
16
+ import { countSelectedRowIds, getDataGridCheckboxState, selectDataGridRowTree } from "./data-grid-selection-state.js";
17
+ import { DataGridSelectionToolbar } from "./data-grid-selection-toolbar.js";
17
18
  import { PINNED_COLUMN_Z_INDEX, getTextValue } from "./data-grid.utils.js";
18
19
  const EMPTY_PINNED_COLUMNS = [];
19
20
  function defaultDataGridCell({ renderValue }) {
@@ -42,7 +43,7 @@ const HEADER_HEIGHT_MAP = {
42
43
  default: 36,
43
44
  compact: 32
44
45
  };
45
- function DataGrid({ data, columns, getRowId, rowCount, globalFilterFn = 'auto', enableRowSelection = false, enableSorting = false, enableColumnResizing = false, columnGrow = false, columnSizing, defaultColumnSizing, onColumnSizingChange, manualPagination = false, manualSorting = false, rowSelection, defaultRowSelection, onRowSelectionChange, sorting, defaultSorting, onSortingChange, pagination, defaultPagination, onPaginationChange, getSubRows, expanded, defaultExpanded, onExpandedChange, getRowCanExpand, maxDepth = 5, pinnedColumns = EMPTY_PINNED_COLUMNS, gridRef, size = 'default', children, className, onRowClick, searchValue, defaultSearchValue, onSearchValueChange, queryMode = 'client', loading = false, loadingVariant = 'skeleton', loadingRowCount, renderLoadingCell, emptyState, noResultsState, filteredResultCount, totalResultCount, onClearSearch, onClearFilters, labels: labelOverrides, rowHeight, headerHeight, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy }) {
46
+ function DataGrid({ data, columns, getRowId, rowCount, globalFilterFn = 'auto', enableRowSelection = false, enableSorting = false, enableColumnResizing = false, columnGrow = false, columnSizing, defaultColumnSizing, onColumnSizingChange, manualPagination = false, manualSorting = false, rowSelection, defaultRowSelection, onRowSelectionChange, selectionActions, sorting, defaultSorting, onSortingChange, pagination, defaultPagination, onPaginationChange, getSubRows, expanded, defaultExpanded, onExpandedChange, getRowCanExpand, maxDepth = 5, pinnedColumns = EMPTY_PINNED_COLUMNS, gridRef, size = 'default', children, className, onRowClick, searchValue, defaultSearchValue, onSearchValueChange, queryMode = 'client', loading = false, loadingVariant = 'skeleton', loadingRowCount, renderLoadingCell, emptyState, noResultsState, filteredResultCount, totalResultCount, onClearSearch, onClearFilters, labels: labelOverrides, rowHeight, headerHeight, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy }) {
46
47
  const scrollContainerRef = useRef(null);
47
48
  const labels = {
48
49
  ...defaultDataGridLabels,
@@ -220,6 +221,7 @@ function DataGrid({ data, columns, getRowId, rowCount, globalFilterFn = 'auto',
220
221
  clientTotalCount,
221
222
  totalResultCount
222
223
  ]);
224
+ const selectedRowCount = countSelectedRowIds(resolvedRowSelection);
223
225
  return /*#__PURE__*/ _jsx(DataGridContext.Provider, {
224
226
  value: contextValue,
225
227
  children: /*#__PURE__*/ _jsxs("div", {
@@ -230,7 +232,7 @@ function DataGrid({ data, columns, getRowId, rowCount, globalFilterFn = 'auto',
230
232
  className: cn('relative flex min-h-0 w-full flex-col overflow-clip rounded-xl text-sm', className),
231
233
  children: [
232
234
  children,
233
- /*#__PURE__*/ _jsx("div", {
235
+ /*#__PURE__*/ _jsxs("div", {
234
236
  ref: scrollContainerRef,
235
237
  "data-slot": "data-grid-scroll-container",
236
238
  className: "relative order-2 min-h-0 w-full flex-1 overflow-auto",
@@ -240,117 +242,127 @@ function DataGrid({ data, columns, getRowId, rowCount, globalFilterFn = 'auto',
240
242
  "aria-colcount": visibleColumns.length,
241
243
  "aria-label": ariaLabel,
242
244
  "aria-labelledby": ariaLabelledBy,
243
- children: /*#__PURE__*/ _jsxs("div", {
244
- className: "min-w-fit w-full",
245
- children: [
246
- /*#__PURE__*/ _jsx("div", {
247
- role: "rowgroup",
248
- "data-slot": "data-grid-header-group",
249
- className: "contents",
250
- children: headerGroups.map((headerGroup, headerRowIndex)=>/*#__PURE__*/ _jsx(DataGridHeaderRow, {
251
- headerGroup: headerGroup,
252
- headerRowIndex: headerRowIndex,
253
- resolvedHeaderHeight: resolvedHeaderHeight,
254
- pinnedColumnIds: pinnedColumnIds,
255
- lastPinnedColumnId: lastPinnedColumnId,
256
- isResizingColumn: isResizingColumn
257
- }, headerGroup.id))
258
- }),
259
- /*#__PURE__*/ _jsxs("div", {
260
- role: "rowgroup",
261
- "data-slot": "data-grid-body",
262
- className: cn('relative min-h-(--data-grid-body-min-height)', !hasNoRows && !hasNoResults && 'h-(--data-grid-body-height)'),
263
- style: bodyStyle,
264
- children: [
265
- shouldRenderSkeleton && Array.from({
266
- length: resolvedLoadingRowCount
267
- }, (_, rowIndex)=>/*#__PURE__*/ _jsx("div", {
268
- "data-slot": "data-grid-row-loading",
269
- "aria-hidden": "true",
270
- className: "absolute left-0 right-0 grid border-b bg-background",
271
- style: {
272
- gridTemplateColumns: 'var(--data-grid-template-columns)',
273
- height: resolvedRowHeight,
274
- transform: `translateY(${rowIndex * resolvedRowHeight}px)`
275
- },
276
- children: visibleColumns.map((column, colIndex)=>{
277
- const isPinned = pinnedColumnIds.has(column.id);
278
- const isLastPinned = isPinned && lastPinnedColumnId === column.id;
279
- return /*#__PURE__*/ _jsx(DataGridCell, {
280
- isPinned: isPinned,
281
- isLastPinned: isLastPinned,
282
- colIndex: colIndex + 1,
283
- style: isPinned ? {
284
- position: 'sticky',
285
- left: column.getStart('left'),
286
- zIndex: PINNED_COLUMN_Z_INDEX
287
- } : undefined,
288
- children: renderLoadingCell?.({
289
- rowIndex,
290
- columnId: column.id,
291
- columnIndex: colIndex,
292
- size
293
- }) ?? (column.id === 'select' ? /*#__PURE__*/ _jsx(Skeleton, {
294
- className: "h-4 w-4 rounded"
295
- }) : /*#__PURE__*/ _jsx(Skeleton, {
296
- className: cn('h-4 max-w-full', colIndex === 0 ? 'w-3/4' : 'w-2/3')
297
- }))
298
- }, column.id);
299
- })
300
- }, `skeleton-row-${rowIndex}`)),
301
- !hideRowsForLoading && !hasNoRows && !hasNoResults && virtualizer.getVirtualItems().map((virtualRow)=>/*#__PURE__*/ _jsx(DataGridRow, {
302
- row: rows[virtualRow.index],
303
- virtualRow: virtualRow,
304
- headerGroupCount: headerGroups.length,
245
+ children: [
246
+ /*#__PURE__*/ _jsxs("div", {
247
+ className: cn('min-w-fit w-full', enableRowSelection !== false && selectedRowCount > 0 && 'pb-24'),
248
+ children: [
249
+ /*#__PURE__*/ _jsx("div", {
250
+ role: "rowgroup",
251
+ "data-slot": "data-grid-header-group",
252
+ className: "contents",
253
+ children: headerGroups.map((headerGroup, headerRowIndex)=>/*#__PURE__*/ _jsx(DataGridHeaderRow, {
254
+ headerGroup: headerGroup,
255
+ headerRowIndex: headerRowIndex,
256
+ resolvedHeaderHeight: resolvedHeaderHeight,
305
257
  pinnedColumnIds: pinnedColumnIds,
306
258
  lastPinnedColumnId: lastPinnedColumnId,
307
- maxDepth: maxDepth,
308
- hasExpanding: hasExpanding,
309
- onRowClick: onRowClick
310
- }, rows[virtualRow.index].id)),
311
- !loading && hasNoRows && emptyState != null && /*#__PURE__*/ _jsx("div", {
312
- className: "pt-2",
313
- children: /*#__PURE__*/ _jsx("div", {
314
- className: "flex items-center justify-center rounded-lg bg-medium-background",
315
- children: renderDataGridState(emptyState, {
316
- type: 'new-object',
317
- title: 'No rows yet',
318
- description: 'Add data to populate this table.'
259
+ isResizingColumn: isResizingColumn
260
+ }, headerGroup.id))
261
+ }),
262
+ /*#__PURE__*/ _jsxs("div", {
263
+ role: "rowgroup",
264
+ "data-slot": "data-grid-body",
265
+ className: cn('relative min-h-(--data-grid-body-min-height)', !hasNoRows && !hasNoResults && 'h-(--data-grid-body-height)'),
266
+ style: bodyStyle,
267
+ children: [
268
+ shouldRenderSkeleton && Array.from({
269
+ length: resolvedLoadingRowCount
270
+ }, (_, rowIndex)=>/*#__PURE__*/ _jsx("div", {
271
+ "data-slot": "data-grid-row-loading",
272
+ "aria-hidden": "true",
273
+ className: "absolute left-0 right-0 grid border-b bg-background",
274
+ style: {
275
+ gridTemplateColumns: 'var(--data-grid-template-columns)',
276
+ height: resolvedRowHeight,
277
+ transform: `translateY(${rowIndex * resolvedRowHeight}px)`
278
+ },
279
+ children: visibleColumns.map((column, colIndex)=>{
280
+ const isPinned = pinnedColumnIds.has(column.id);
281
+ const isLastPinned = isPinned && lastPinnedColumnId === column.id;
282
+ return /*#__PURE__*/ _jsx(DataGridCell, {
283
+ isPinned: isPinned,
284
+ isLastPinned: isLastPinned,
285
+ colIndex: colIndex + 1,
286
+ style: isPinned ? {
287
+ position: 'sticky',
288
+ left: column.getStart('left'),
289
+ zIndex: PINNED_COLUMN_Z_INDEX
290
+ } : undefined,
291
+ children: renderLoadingCell?.({
292
+ rowIndex,
293
+ columnId: column.id,
294
+ columnIndex: colIndex,
295
+ size
296
+ }) ?? (column.id === 'select' ? /*#__PURE__*/ _jsx(Skeleton, {
297
+ className: "h-4 w-4 rounded"
298
+ }) : /*#__PURE__*/ _jsx(Skeleton, {
299
+ className: cn('h-4 max-w-full', colIndex === 0 ? 'w-3/4' : 'w-2/3')
300
+ }))
301
+ }, column.id);
302
+ })
303
+ }, `skeleton-row-${rowIndex}`)),
304
+ !hideRowsForLoading && !hasNoRows && !hasNoResults && virtualizer.getVirtualItems().map((virtualRow)=>/*#__PURE__*/ _jsx(DataGridRow, {
305
+ row: rows[virtualRow.index],
306
+ virtualRow: virtualRow,
307
+ headerGroupCount: headerGroups.length,
308
+ pinnedColumnIds: pinnedColumnIds,
309
+ lastPinnedColumnId: lastPinnedColumnId,
310
+ maxDepth: maxDepth,
311
+ hasExpanding: hasExpanding,
312
+ onRowClick: onRowClick
313
+ }, rows[virtualRow.index].id)),
314
+ !loading && hasNoRows && emptyState != null && /*#__PURE__*/ _jsx("div", {
315
+ className: "pt-2",
316
+ children: /*#__PURE__*/ _jsx("div", {
317
+ className: "flex items-center justify-center rounded-lg bg-medium-background",
318
+ children: renderDataGridState(emptyState, {
319
+ type: 'new-object',
320
+ title: 'No rows yet',
321
+ description: 'Add data to populate this table.'
322
+ })
319
323
  })
320
- })
321
- }),
322
- !loading && hasNoResults && /*#__PURE__*/ _jsx("div", {
323
- className: "pt-2",
324
- children: /*#__PURE__*/ _jsx("div", {
325
- className: "flex items-center justify-center bg-background",
326
- children: renderDataGridState(noResultsState, {
327
- type: 'no-results',
328
- title: 'No results found',
329
- description: queryMode === 'server' ? 'Apply a different query or clear filters.' : 'Try a different search term or clear filters.',
330
- action: onClearSearch || onClearFilters ? /*#__PURE__*/ _jsxs("div", {
331
- className: "mt-2 flex items-center justify-center gap-2",
332
- children: [
333
- onClearSearch ? /*#__PURE__*/ _jsx(Button, {
334
- size: "sm",
335
- variant: "secondary",
336
- onClick: onClearSearch,
337
- children: labels.clearSearch
338
- }) : null,
339
- onClearFilters ? /*#__PURE__*/ _jsx(Button, {
340
- size: "sm",
341
- variant: "secondary",
342
- onClick: onClearFilters,
343
- children: labels.clearFilters
344
- }) : null
345
- ]
346
- }) : undefined
324
+ }),
325
+ !loading && hasNoResults && /*#__PURE__*/ _jsx("div", {
326
+ className: "pt-2",
327
+ children: /*#__PURE__*/ _jsx("div", {
328
+ className: "flex items-center justify-center bg-background",
329
+ children: renderDataGridState(noResultsState, {
330
+ type: 'no-results',
331
+ title: 'No results found',
332
+ description: queryMode === 'server' ? 'Apply a different query or clear filters.' : 'Try a different search term or clear filters.',
333
+ action: onClearSearch || onClearFilters ? /*#__PURE__*/ _jsxs("div", {
334
+ className: "mt-2 flex items-center justify-center gap-2",
335
+ children: [
336
+ onClearSearch ? /*#__PURE__*/ _jsx(Button, {
337
+ size: "sm",
338
+ variant: "secondary",
339
+ onClick: onClearSearch,
340
+ children: labels.clearSearch
341
+ }) : null,
342
+ onClearFilters ? /*#__PURE__*/ _jsx(Button, {
343
+ size: "sm",
344
+ variant: "secondary",
345
+ onClick: onClearFilters,
346
+ children: labels.clearFilters
347
+ }) : null
348
+ ]
349
+ }) : undefined
350
+ })
347
351
  })
348
352
  })
349
- })
350
- ]
351
- })
352
- ]
353
- })
353
+ ]
354
+ })
355
+ ]
356
+ }),
357
+ enableRowSelection !== false ? /*#__PURE__*/ _jsx(DataGridSelectionToolbar, {
358
+ // The count includes every selected id.
359
+ // That covers parents and their children, rows on other pages, and rows hidden by search.
360
+ selectedCount: selectedRowCount,
361
+ rowSelection: resolvedRowSelection,
362
+ selectionActions: selectionActions,
363
+ onClear: ()=>setResolvedRowSelection({})
364
+ }) : null
365
+ ]
354
366
  })
355
367
  ]
356
368
  })