@persona/design-system 0.10.12 → 0.10.14
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/CHANGELOG.md +41 -0
- package/dist/{CheckboxGroupField-XSVAmESI.d.mts → CheckboxGroupField-tBvP22Bo.d.mts} +2 -2
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/{Combobox-BNjYEAmv.mjs → Combobox-DmFQ5cAy.mjs} +63 -51
- package/dist/Combobox-DmFQ5cAy.mjs.map +1 -0
- package/dist/{Combobox-DbcSss15.d.mts → Combobox-RX4DfO5L.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-CrFweFGi.d.mts → ComboboxBase-VIGR58Uc.d.mts} +2 -2
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-Cp5GBGQj.d.mts → ComboboxMultiSelect-D5TWGGKZ.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-u7fK3Yvy.d.mts → ComboboxSingleSelect-D9It8t6W.d.mts} +3 -3
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-BLZZWtIE.d.mts → CompactBar-tNtY2EhN.d.mts} +2 -2
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ControlBar-B3Jn8G0k.d.mts → ControlBar-CDb6b1_6.d.mts} +5 -3
- package/dist/ControlBar.d.mts +1 -1
- package/dist/{DataTable-C1mdfmQa.d.mts → DataTable-0nhT5_Fe.d.mts} +31 -7
- package/dist/{DataTable-DdSY9mzT.mjs → DataTable-6t5ryaEq.mjs} +146 -77
- package/dist/DataTable-6t5ryaEq.mjs.map +1 -0
- package/dist/DataTable.d.mts +1 -1
- package/dist/{DatePicker-DiilpYQg.mjs → DatePicker-CHVYVKB-.mjs} +2 -2
- package/dist/{DatePicker-DiilpYQg.mjs.map → DatePicker-CHVYVKB-.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +1 -1
- package/dist/{DropdownMenu-CQR0U-zM.d.mts → DropdownMenu-Db6N6ZNB.d.mts} +2 -2
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{FloatingActionBar-BUgSKimy.d.mts → FloatingActionBar-CfgjHs81.d.mts} +5 -1
- package/dist/FloatingActionBar.d.mts +1 -1
- package/dist/{FormField-yYJFkJ6R.mjs → FormField-BfVrDOY0.mjs} +4 -4
- package/dist/{FormField-yYJFkJ6R.mjs.map → FormField-BfVrDOY0.mjs.map} +1 -1
- package/dist/{HoverCopyableField-X2XfKTTh.mjs → HoverCopyableField-CJ_p3llp.mjs} +2 -2
- package/dist/{HoverCopyableField-X2XfKTTh.mjs.map → HoverCopyableField-CJ_p3llp.mjs.map} +1 -1
- package/dist/IndexTableLayout.d.mts +3 -3
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Link-B29ZMN6m.mjs → Link-Df3zJrj2.mjs} +1 -1
- package/dist/{Link-B29ZMN6m.mjs.map → Link-Df3zJrj2.mjs.map} +1 -1
- package/dist/{ListBox-4rTgr3IJ.mjs → ListBox-BRgjgUSp.mjs} +2 -2
- package/dist/{ListBox-4rTgr3IJ.mjs.map → ListBox-BRgjgUSp.mjs.map} +1 -1
- package/dist/{ListBox-ZDaitaXR.d.mts → ListBox-l47zUDj4.d.mts} +2 -2
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-CGvVWKyL.d.mts → ListBoxField-Di_6uD3S.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LogicRow-Bzp5o1sL.d.mts → LogicRow-7f17CKrW.d.mts} +2 -2
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-DviYNrFd.d.mts → Menu-DvzoR8e7.d.mts} +2 -2
- package/dist/Menu.d.mts +1 -1
- package/dist/{Modal-CiPFqr0L.mjs → Modal-C_vSgqgl.mjs} +20 -16
- package/dist/Modal-C_vSgqgl.mjs.map +1 -0
- package/dist/{Modal-CujB7DuB.d.mts → Modal-IVXc4p8Y.d.mts} +7 -2
- package/dist/Modal.d.mts +1 -1
- package/dist/{Pii-jSYND7Cn.mjs → Pii-BYPkrBuT.mjs} +1 -1
- package/dist/{Pii-jSYND7Cn.mjs.map → Pii-BYPkrBuT.mjs.map} +1 -1
- package/dist/{Popover-CVX-dfYb.mjs → Popover-DP9DXReH.mjs} +1 -1
- package/dist/{Popover-CVX-dfYb.mjs.map → Popover-DP9DXReH.mjs.map} +1 -1
- package/dist/{Select-DsVeAyZy.d.mts → Select-boZ6XP8k.d.mts} +2 -2
- package/dist/Select.d.mts +1 -1
- package/dist/SmartTextInputField.d.mts +2 -2
- package/dist/SmartTextInputListbox.d.mts +8 -3
- package/dist/{TableBox-D9NA-s9l.mjs → TableBox-RxpwflEb.mjs} +3 -3
- package/dist/{TableBox-D9NA-s9l.mjs.map → TableBox-RxpwflEb.mjs.map} +1 -1
- package/dist/TableBox.d.mts +1 -1
- package/dist/{TableBoxCell-CQOL30et.d.mts → TableBoxCell-B6Z23mby.d.mts} +4 -4
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-z0GIFeQw.d.mts → TableBoxField-6qAOW8t9.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-tb9-KMr9.d.mts → TableBoxRow-CpgNWdLS.d.mts} +2 -2
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-BZwulsFP.d.mts → TableBoxRowActions-BDx5naRj.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableControls-DE6eHq8h.d.mts → TableControls-BGKL7_zF.d.mts} +4 -4
- package/dist/{TableControls-BXykbUBf.mjs → TableControls-BwZl4TjJ.mjs} +31 -12
- package/dist/TableControls-BwZl4TjJ.mjs.map +1 -0
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-C2_2EuMh.d.mts → TableControlsContext-DhABbtVY.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-DE9HFXYY.d.mts → TableViewConfigurationDropdown-D76ApJ_-.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/WizardModal.d.mts +1 -1
- package/dist/{clientFilterUtils-2TBUC31K.d.mts → clientFilterUtils-WH_Dqtv4.d.mts} +2 -2
- package/dist/clientFilterUtils.d.mts +1 -1
- package/dist/components/Combobox/index.d.mts +4 -4
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/DataTable/TableControls/index.d.mts +7 -7
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.d.mts +6 -6
- package/dist/components/DataTable/index.mjs +1 -1
- package/dist/components/DataTable/types.d.mts +1 -1
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/FormField/index.d.mts +4 -4
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.mjs +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Modal/index.d.mts +1 -1
- package/dist/components/Modal/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/RichTextEditor/index.mjs +2 -2
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/SmartTextInput/index.mjs +128 -59
- package/dist/components/SmartTextInput/index.mjs.map +1 -1
- package/dist/components/TableBox/index.d.mts +1 -1
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/VersionHistory/index.mjs +1 -1
- package/dist/fieldPickerOptions.d.mts +1 -1
- package/dist/{filters-DW7pqWv3.d.mts → filters-BXtKuft3.d.mts} +2 -2
- package/dist/filters.d.mts +1 -1
- package/dist/{helpers-BTD2kXLs.d.mts → helpers-gpO42h8t.d.mts} +5 -3
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-B4tE0RxY.d.mts → index-bkzLg85W.d.mts} +3 -3
- package/dist/{inputFields-DnBb3NhK.d.mts → inputFields-B7parF2l.d.mts} +4 -4
- package/dist/inputFields.d.mts +1 -1
- package/dist/lib/PDSProvider.d.mts +2 -1
- package/dist/lib/PDSProvider.mjs +8 -3
- package/dist/lib/PDSProvider.mjs.map +1 -1
- package/dist/lib/colorMode.d.mts +18 -7
- package/dist/lib/colorMode.mjs +47 -13
- package/dist/lib/colorMode.mjs.map +1 -1
- package/dist/lib/schemaOptions.mjs +1 -1
- package/dist/lib/schemaOptions.mjs.map +1 -1
- package/dist/patterns/IndexTableLayout/index.mjs +1 -1
- package/dist/patterns/WizardModal/index.mjs +1 -1
- package/dist/{types-NO2GRlM-.d.mts → types-BvaXqjUm.d.mts} +2 -2
- package/dist/{types-Dws2XDz2.d.mts → types-CuH-sUJ2.d.mts} +6 -4
- package/dist/types5.d.mts +1 -1
- package/dist/useColumnConfiguration.d.mts +2 -2
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useTableColumns-tITjHasE.d.mts → useTableColumns-I7StvoRs.d.mts} +17 -2
- package/dist/useTableColumns.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/utils4.d.mts +1 -1
- package/dist/withDisabledReason.d.mts +19 -0
- package/llms.txt +4 -3
- package/package.json +4 -12
- package/skills/ui-authoring/COMPONENTS.md +0 -1
- package/skills/ui-authoring/PATTERNS.md +0 -64
- package/skills/ui-authoring/TOKENS.md +14 -25
- package/dist/ChartFrame.d.mts +0 -61
- package/dist/ChartLegend.d.mts +0 -60
- package/dist/ChartPopover.d.mts +0 -155
- package/dist/Combobox-BNjYEAmv.mjs.map +0 -1
- package/dist/DataTable-DdSY9mzT.mjs.map +0 -1
- package/dist/Modal-CiPFqr0L.mjs.map +0 -1
- package/dist/TableControls-BXykbUBf.mjs.map +0 -1
- package/dist/chartColors.d.mts +0 -92
- package/dist/chartFrameLayout.d.mts +0 -46
- package/dist/components/Chart/index.d.mts +0 -9
- package/dist/components/Chart/index.mjs +0 -680
- package/dist/components/Chart/index.mjs.map +0 -1
- package/dist/useChartColors.d.mts +0 -30
- package/dist/useChartSeriesVisibility.d.mts +0 -22
- package/dist/useChartStyles.d.mts +0 -108
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as Pagination } from "./Pagination-CCKuudiz.mjs";
|
|
2
|
-
import { i as BaseFilterConfig, n as AttributeColumn, s as FilterConfig } from "./types-
|
|
3
|
-
import { r as TableControlsProps, t as TableControls } from "./TableControls-
|
|
4
|
-
import { C as RowAction, O as SortProps, _ as DataTableColumns, l as DataTableColumnFormat, t as BulkAction } from "./types-
|
|
5
|
-
import { t as RenderFormatFn } from "./useTableColumns-
|
|
2
|
+
import { i as BaseFilterConfig, n as AttributeColumn, s as FilterConfig } from "./types-BvaXqjUm.mjs";
|
|
3
|
+
import { r as TableControlsProps, t as TableControls } from "./TableControls-BGKL7_zF.mjs";
|
|
4
|
+
import { C as RowAction, O as SortProps, _ as DataTableColumns, l as DataTableColumnFormat, t as BulkAction } from "./types-CuH-sUJ2.mjs";
|
|
5
|
+
import { t as RenderFormatFn } from "./useTableColumns-I7StvoRs.mjs";
|
|
6
6
|
import { ComponentProps } from "react";
|
|
7
7
|
import * as _$styled_components0 from "styled-components";
|
|
8
8
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -146,9 +146,30 @@ interface DataTableProps<TData extends RowData, TFilter extends BaseFilterConfig
|
|
|
146
146
|
*/
|
|
147
147
|
isLoading?: boolean;
|
|
148
148
|
/**
|
|
149
|
-
* Whether to enable row selection
|
|
149
|
+
* Whether to enable row selection. The select column renders with `showControls`, or on its own
|
|
150
|
+
* when selection is controlled (`selectedRowIds`).
|
|
150
151
|
*/
|
|
151
152
|
enableRowSelection?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Controlled selected row ids. When provided, row selection becomes controlled: use with
|
|
155
|
+
* `onSelectedRowIdsChange` to own the selection outside the table, for example to clear it on a
|
|
156
|
+
* filter change or keep it across server pages. Bulk actions never clear controlled selection
|
|
157
|
+
* automatically; the host decides when to clear its state (or call `clearSelection`).
|
|
158
|
+
*
|
|
159
|
+
* Opting in also renders the select column without `showControls`, names each checkbox with
|
|
160
|
+
* `getRowLabel`, and scopes the select-all header's dash to the rows in `data`. Uncontrolled
|
|
161
|
+
* tables keep their existing behaviour.
|
|
162
|
+
*
|
|
163
|
+
* Ids can belong to rows not in `data` (another page). They count toward the selected count and
|
|
164
|
+
* are passed to bulk actions; `onRowSelectionChange` and `getAvailableBulkActions` still receive
|
|
165
|
+
* only the selected rows present in `data`.
|
|
166
|
+
*/
|
|
167
|
+
selectedRowIds?: Set<string>;
|
|
168
|
+
/**
|
|
169
|
+
* Called when the selection changes (for controlled selection). Only used when `selectedRowIds`
|
|
170
|
+
* is provided. Unselecting the rows on the current page keeps selected ids from other pages.
|
|
171
|
+
*/
|
|
172
|
+
onSelectedRowIdsChange?: (selectedRowIds: Set<string>) => void;
|
|
152
173
|
/**
|
|
153
174
|
* Whether to enable automatic sub row selection when a parent row is selected
|
|
154
175
|
*/
|
|
@@ -158,7 +179,8 @@ interface DataTableProps<TData extends RowData, TFilter extends BaseFilterConfig
|
|
|
158
179
|
*/
|
|
159
180
|
getRowId?: (row: TData) => string;
|
|
160
181
|
/**
|
|
161
|
-
* Define the aria label for the given row.
|
|
182
|
+
* Define the aria label for the given row. With controlled selection (`selectedRowIds`) it also
|
|
183
|
+
* names the row's selection checkbox ("Select row <label>"); otherwise the checkbox uses the row id.
|
|
162
184
|
*/
|
|
163
185
|
getRowLabel?: (row: TData) => string;
|
|
164
186
|
/**
|
|
@@ -411,6 +433,8 @@ declare const DataTable: <TData extends RowData, TFilter extends BaseFilterConfi
|
|
|
411
433
|
showColumnProperties,
|
|
412
434
|
onUpdateColumnProperties,
|
|
413
435
|
enableRowSelection,
|
|
436
|
+
selectedRowIds: controlledSelectedRowIds,
|
|
437
|
+
onSelectedRowIdsChange,
|
|
414
438
|
enableSubRowSelection,
|
|
415
439
|
getRowId,
|
|
416
440
|
getRowLabel,
|
|
@@ -450,4 +474,4 @@ declare const DataTable: <TData extends RowData, TFilter extends BaseFilterConfi
|
|
|
450
474
|
}: DataTableProps<TData, TFilter>) => _$react_jsx_runtime0.JSX.Element;
|
|
451
475
|
//#endregion
|
|
452
476
|
export { FloatingActionBarContainer as a, DataTableProps as i, DataTableContainer as n, DataTableControls as r, DataTable as t };
|
|
453
|
-
//# sourceMappingURL=DataTable-
|
|
477
|
+
//# sourceMappingURL=DataTable-0nhT5_Fe.d.mts.map
|
|
@@ -17,10 +17,10 @@ import { n as DropdownMenu_default } from "./DropdownMenu-Ip75l4Th.mjs";
|
|
|
17
17
|
import { t as Checkbox } from "./Checkbox-BAh-wF_F.mjs";
|
|
18
18
|
import { t as Pagination_default } from "./Pagination-CqFvnlXc.mjs";
|
|
19
19
|
import { a as StickyTH, d as TableTR, f as TableTH, i as StickyTD, o as TableActionTD, p as TableRow, s as TableCell, t as TableLayout, u as TableTD } from "./Table-9mNn8Q-d.mjs";
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import {
|
|
20
|
+
import { L as isFilterActive, W as withDisabledReason, f as TableViewConfigurationDropdown, u as TableControls, v as isEmptyState } from "./TableControls-BwZl4TjJ.mjs";
|
|
21
|
+
import { t as HoverCopyableField } from "./HoverCopyableField-CJ_p3llp.mjs";
|
|
22
|
+
import { t as Link } from "./Link-Df3zJrj2.mjs";
|
|
23
|
+
import { t as Pii_default } from "./Pii-BYPkrBuT.mjs";
|
|
24
24
|
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
25
25
|
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
26
26
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -28,7 +28,7 @@ import { DateTime } from "luxon";
|
|
|
28
28
|
import { ChevronDownIcon, ChevronRightIcon, ImageIcon, MoreIcon, XIcon } from "@persona/icons";
|
|
29
29
|
import { PlusIcon as PlusIcon$1 } from "@persona/icons/12px";
|
|
30
30
|
import { kebabCase, startCase } from "lodash-es";
|
|
31
|
-
import { createColumnHelper, flexRender, getCoreRowModel, getFilteredRowModel, getMemoOptions, getPaginationRowModel, getSortedRowModel, memo as memo$1, useReactTable } from "@tanstack/react-table";
|
|
31
|
+
import { createColumnHelper, flexRender, functionalUpdate, getCoreRowModel, getFilteredRowModel, getMemoOptions, getPaginationRowModel, getSortedRowModel, memo as memo$1, useReactTable } from "@tanstack/react-table";
|
|
32
32
|
//#region src/components/DataTable/clientFilterUtils.ts
|
|
33
33
|
const getFilterFnName = (filterType) => {
|
|
34
34
|
switch (filterType) {
|
|
@@ -128,6 +128,46 @@ const Bar = styled.div`
|
|
|
128
128
|
gap: ${Spacing[8]};
|
|
129
129
|
min-width: 380px;
|
|
130
130
|
`;
|
|
131
|
+
const renderAction = (action, key) => {
|
|
132
|
+
if ("popover" in action) {
|
|
133
|
+
let trigger = null;
|
|
134
|
+
if ("icon" in action && "aria-label" in action) trigger = /* @__PURE__ */ jsx(IconButton, {
|
|
135
|
+
size: "sm",
|
|
136
|
+
"aria-label": action["aria-label"],
|
|
137
|
+
disabled: action.disabled,
|
|
138
|
+
children: action.icon
|
|
139
|
+
}, key);
|
|
140
|
+
else trigger = /* @__PURE__ */ jsx(Button, {
|
|
141
|
+
variant: action.variant || "basic",
|
|
142
|
+
size: "sm",
|
|
143
|
+
disabled: action.disabled,
|
|
144
|
+
children: "label" in action ? action.label : ""
|
|
145
|
+
}, key);
|
|
146
|
+
return /* @__PURE__ */ jsx(DropdownMenu_default, {
|
|
147
|
+
trigger,
|
|
148
|
+
align: "center",
|
|
149
|
+
portal: true,
|
|
150
|
+
children: (action.popover?.options ?? []).map((option) => /* @__PURE__ */ jsx(DropdownMenu_default.Item, {
|
|
151
|
+
id: option.value,
|
|
152
|
+
onClick: () => action.popover.onOptionSelect(option.value),
|
|
153
|
+
children: option.label
|
|
154
|
+
}, option.value))
|
|
155
|
+
}, key);
|
|
156
|
+
} else if ("icon" in action && "aria-label" in action) return /* @__PURE__ */ jsx(IconButton, {
|
|
157
|
+
size: "sm",
|
|
158
|
+
"aria-label": action["aria-label"],
|
|
159
|
+
onClick: action.onClick,
|
|
160
|
+
disabled: action.disabled,
|
|
161
|
+
children: action.icon
|
|
162
|
+
}, key);
|
|
163
|
+
else return /* @__PURE__ */ jsx(Button, {
|
|
164
|
+
onClick: action.onClick,
|
|
165
|
+
variant: action.variant || "basic",
|
|
166
|
+
size: "sm",
|
|
167
|
+
disabled: action.disabled,
|
|
168
|
+
children: "label" in action ? action.label : ""
|
|
169
|
+
}, key);
|
|
170
|
+
};
|
|
131
171
|
const FloatingActionBar = ({ selectedCount, onClearSelection, extraContent, actions }) => {
|
|
132
172
|
const strings = usePDSStrings();
|
|
133
173
|
const theme = useTheme();
|
|
@@ -147,40 +187,11 @@ const FloatingActionBar = ({ selectedCount, onClearSelection, extraContent, acti
|
|
|
147
187
|
spacing: Spacing[2],
|
|
148
188
|
children: [extraContent, actions.map((action, index) => {
|
|
149
189
|
const key = "label" in action ? action.label : `action-${index}`;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
children: action.icon
|
|
156
|
-
}, key);
|
|
157
|
-
else trigger = /* @__PURE__ */ jsx(Button, {
|
|
158
|
-
variant: action.variant || "basic",
|
|
159
|
-
size: "sm",
|
|
160
|
-
children: "label" in action ? action.label : ""
|
|
161
|
-
}, key);
|
|
162
|
-
return /* @__PURE__ */ jsx(DropdownMenu_default, {
|
|
163
|
-
trigger,
|
|
164
|
-
align: "center",
|
|
165
|
-
portal: true,
|
|
166
|
-
children: (action.popover?.options ?? []).map((option) => /* @__PURE__ */ jsx(DropdownMenu_default.Item, {
|
|
167
|
-
id: option.value,
|
|
168
|
-
onClick: () => action.popover.onOptionSelect(option.value),
|
|
169
|
-
children: option.label
|
|
170
|
-
}, option.value))
|
|
171
|
-
}, key);
|
|
172
|
-
} else if ("icon" in action && "aria-label" in action) return /* @__PURE__ */ jsx(IconButton, {
|
|
173
|
-
size: "sm",
|
|
174
|
-
"aria-label": action["aria-label"],
|
|
175
|
-
onClick: action.onClick,
|
|
176
|
-
children: action.icon
|
|
177
|
-
}, key);
|
|
178
|
-
else return /* @__PURE__ */ jsx(Button, {
|
|
179
|
-
onClick: action.onClick,
|
|
180
|
-
variant: action.variant || "basic",
|
|
181
|
-
size: "sm",
|
|
182
|
-
children: "label" in action ? action.label : ""
|
|
183
|
-
}, key);
|
|
190
|
+
return withDisabledReason(renderAction(action, key), {
|
|
191
|
+
key,
|
|
192
|
+
disabled: action.disabled,
|
|
193
|
+
disabledReason: action.disabledReason
|
|
194
|
+
});
|
|
184
195
|
})]
|
|
185
196
|
})] });
|
|
186
197
|
};
|
|
@@ -189,7 +200,7 @@ const FloatingActionBar = ({ selectedCount, onClearSelection, extraContent, acti
|
|
|
189
200
|
const EmptyCellText = styled(Paragraph)`
|
|
190
201
|
${semanticOnly((tokens) => `color: ${tokens.FgSecondaryStatic};`)}
|
|
191
202
|
`;
|
|
192
|
-
const renderAsCheckbox = ({ rowId, isChecked, onChange, onValueChange, columnHeader, disabled, indeterminate, strings = DEFAULT_COMMON_STRINGS }) => {
|
|
203
|
+
const renderAsCheckbox = ({ rowId, rowLabel, isChecked, onChange, onValueChange, columnHeader, disabled, indeterminate, strings = DEFAULT_COMMON_STRINGS }) => {
|
|
193
204
|
return /* @__PURE__ */ jsx(Checkbox, {
|
|
194
205
|
checked: isChecked,
|
|
195
206
|
onChange: (e) => {
|
|
@@ -199,7 +210,7 @@ const renderAsCheckbox = ({ rowId, isChecked, onChange, onValueChange, columnHea
|
|
|
199
210
|
containerProps: { onClick: (e) => {
|
|
200
211
|
e.stopPropagation();
|
|
201
212
|
} },
|
|
202
|
-
"aria-label": columnHeader ? strings.selectRowForColumn(columnHeader, rowId) : strings.selectRow(rowId),
|
|
213
|
+
"aria-label": columnHeader ? strings.selectRowForColumn(columnHeader, rowLabel ?? rowId) : strings.selectRow(rowLabel ?? rowId),
|
|
203
214
|
indeterminate,
|
|
204
215
|
disabled
|
|
205
216
|
});
|
|
@@ -505,11 +516,44 @@ const ExpandColumnPlaceholder = styled.span`
|
|
|
505
516
|
justify-content: center;
|
|
506
517
|
width: 100%;
|
|
507
518
|
`;
|
|
508
|
-
function useTableColumns({ columns, data, compact, sort, clientSearch, clientFiltering, expandColumnVisibility = "auto", showControls, enableRowSelection = false, enableSubRowSelection = true, rowActions, getRowId, expandedRows, toggleRowExpansion, canRowExpand, checkboxColumnStates, handleCheckboxCellChange, handleSelectAllCheckboxCell, getSelfAndNestedRowIds, handleRowSelectionWithShift, renderFormat }) {
|
|
519
|
+
function useTableColumns({ columns, data, compact, sort, clientSearch, clientFiltering, expandColumnVisibility = "auto", showControls, enableRowSelection = false, enableSubRowSelection = true, rowActions, getRowId, getRowLabel, scopeSelectAllToRows = false, stableSelectCells = false, expandedRows, toggleRowExpansion, canRowExpand, checkboxColumnStates, handleCheckboxCellChange, handleSelectAllCheckboxCell, getSelfAndNestedRowIds, handleRowSelectionWithShift, renderFormat }) {
|
|
509
520
|
const { EXPAND_COLUMN_WIDTH, SELECT_COLUMN_WIDTH, ACTION_COLUMN_WIDTH } = getColumnWidths(compact);
|
|
510
521
|
const strings = usePDSStrings();
|
|
511
522
|
const stringsRef = useRef(strings);
|
|
512
523
|
stringsRef.current = strings;
|
|
524
|
+
const getRowLabelRef = useRef(getRowLabel);
|
|
525
|
+
getRowLabelRef.current = getRowLabel;
|
|
526
|
+
const selectColumnRef = useRef({
|
|
527
|
+
enableSubRowSelection,
|
|
528
|
+
handleRowSelectionWithShift,
|
|
529
|
+
scopeSelectAllToRows
|
|
530
|
+
});
|
|
531
|
+
selectColumnRef.current = {
|
|
532
|
+
enableSubRowSelection,
|
|
533
|
+
handleRowSelectionWithShift,
|
|
534
|
+
scopeSelectAllToRows
|
|
535
|
+
};
|
|
536
|
+
const renderSelectHeader = useCallback(({ table }) => {
|
|
537
|
+
const { scopeSelectAllToRows: scoped } = selectColumnRef.current;
|
|
538
|
+
return renderAsCheckboxHeader({
|
|
539
|
+
isChecked: table.getIsAllRowsSelected(),
|
|
540
|
+
isIndeterminate: table.getIsAllRowsSelected() || (scoped ? table.getFilteredRowModel().flatRows.some((row) => row.getIsSelected()) : table.getIsSomeRowsSelected()),
|
|
541
|
+
onChange: table.getToggleAllRowsSelectedHandler(),
|
|
542
|
+
strings: stringsRef.current
|
|
543
|
+
});
|
|
544
|
+
}, []);
|
|
545
|
+
const renderSelectCell = useCallback(({ row, table }) => {
|
|
546
|
+
const { enableSubRowSelection: subRows } = selectColumnRef.current;
|
|
547
|
+
return renderAsCheckbox({
|
|
548
|
+
rowId: row.id,
|
|
549
|
+
rowLabel: getRowLabelRef.current?.(row.original),
|
|
550
|
+
isChecked: row.getIsSelected(),
|
|
551
|
+
onChange: (e) => selectColumnRef.current.handleRowSelectionWithShift(row, table, e.target.checked, e.nativeEvent instanceof MouseEvent && e.nativeEvent.shiftKey),
|
|
552
|
+
indeterminate: subRows && row.getIsSomeSelected(),
|
|
553
|
+
disabled: !row.getCanSelect(),
|
|
554
|
+
strings: stringsRef.current
|
|
555
|
+
});
|
|
556
|
+
}, []);
|
|
513
557
|
const rowActionsRef = useRef(rowActions);
|
|
514
558
|
rowActionsRef.current = rowActions;
|
|
515
559
|
const renderActionCell = useCallback((props) => {
|
|
@@ -621,20 +665,8 @@ function useTableColumns({ columns, data, compact, sort, clientSearch, clientFil
|
|
|
621
665
|
enableResizing: false,
|
|
622
666
|
size: SELECT_COLUMN_WIDTH,
|
|
623
667
|
meta: { width: SELECT_COLUMN_WIDTH },
|
|
624
|
-
header:
|
|
625
|
-
|
|
626
|
-
isIndeterminate: table.getIsSomeRowsSelected() || table.getIsAllRowsSelected(),
|
|
627
|
-
onChange: table.getToggleAllRowsSelectedHandler(),
|
|
628
|
-
strings
|
|
629
|
-
}),
|
|
630
|
-
cell: ({ row, table }) => renderAsCheckbox({
|
|
631
|
-
rowId: row.id,
|
|
632
|
-
isChecked: row.getIsSelected(),
|
|
633
|
-
onChange: (e) => handleRowSelectionWithShift(row, table, e.target.checked, e.nativeEvent instanceof MouseEvent && e.nativeEvent.shiftKey),
|
|
634
|
-
indeterminate: enableSubRowSelection && row.getIsSomeSelected(),
|
|
635
|
-
disabled: !row.getCanSelect(),
|
|
636
|
-
strings
|
|
637
|
-
})
|
|
668
|
+
header: stableSelectCells ? renderSelectHeader : (context) => renderSelectHeader(context),
|
|
669
|
+
cell: stableSelectCells ? renderSelectCell : (context) => renderSelectCell(context)
|
|
638
670
|
}));
|
|
639
671
|
if (expandColumnVisibility === "always" || data.some(canRowExpand)) tableColumns.unshift(columnHelper.display({
|
|
640
672
|
id: "expand-col",
|
|
@@ -692,6 +724,9 @@ function useTableColumns({ columns, data, compact, sort, clientSearch, clientFil
|
|
|
692
724
|
hasRowActions,
|
|
693
725
|
renderActionCell,
|
|
694
726
|
showControls,
|
|
727
|
+
stableSelectCells,
|
|
728
|
+
renderSelectHeader,
|
|
729
|
+
renderSelectCell,
|
|
695
730
|
sort,
|
|
696
731
|
clientSearch,
|
|
697
732
|
clientFiltering,
|
|
@@ -704,7 +739,6 @@ function useTableColumns({ columns, data, compact, sort, clientSearch, clientFil
|
|
|
704
739
|
checkboxColumnStates,
|
|
705
740
|
handleCheckboxCellChange,
|
|
706
741
|
handleSelectAllCheckboxCell,
|
|
707
|
-
handleRowSelectionWithShift,
|
|
708
742
|
renderFormat,
|
|
709
743
|
strings
|
|
710
744
|
]);
|
|
@@ -869,7 +903,7 @@ const DISPLAYED_ROW_IDS_SEPARATOR = "";
|
|
|
869
903
|
* { accessor: 'email', header: 'Email' },
|
|
870
904
|
* ];
|
|
871
905
|
*/
|
|
872
|
-
const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "auto", showControls, controls, emptyState, isLoading, pagination, sort, sortDescFirst, enableSortingRemoval, showColumnProperties = false, onUpdateColumnProperties, enableRowSelection = false, enableSubRowSelection = true, getRowId, getRowLabel, getRowSelectable, getLinkToRow, rowLinkPrefix, rowLinkColumnId, rowLinkComponent, compact, floatingBulkActions = false, disableRowHover, title, clientSearch = false, searchTerm: controlledSearchTerm, onSearchTermChange, manualFiltering, expandedRowIds: controlledExpandedRowIds, onExpandedRowsChange, clientFiltering = false, columnFilters: controlledColumnFilters, hasExternalActiveFilters = false, onColumnFiltersChange, renderFormat, rowActions, bulkActions, getAvailableBulkActions, onRowSelectionChange, onAddRow, stickyHeader = false, canAddAfterRow, onRowClick, activeRowId, onDisplayedRowIdsChange, pinnedColumnLeftOffset = 0, scrollsHorizontally = true, floatingBarContent }) => {
|
|
906
|
+
const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "auto", showControls, controls, emptyState, isLoading, pagination, sort, sortDescFirst, enableSortingRemoval, showColumnProperties = false, onUpdateColumnProperties, enableRowSelection = false, selectedRowIds: controlledSelectedRowIds, onSelectedRowIdsChange, enableSubRowSelection = true, getRowId, getRowLabel, getRowSelectable, getLinkToRow, rowLinkPrefix, rowLinkColumnId, rowLinkComponent, compact, floatingBulkActions = false, disableRowHover, title, clientSearch = false, searchTerm: controlledSearchTerm, onSearchTermChange, manualFiltering, expandedRowIds: controlledExpandedRowIds, onExpandedRowsChange, clientFiltering = false, columnFilters: controlledColumnFilters, hasExternalActiveFilters = false, onColumnFiltersChange, renderFormat, rowActions, bulkActions, getAvailableBulkActions, onRowSelectionChange, onAddRow, stickyHeader = false, canAddAfterRow, onRowClick, activeRowId, onDisplayedRowIdsChange, pinnedColumnLeftOffset = 0, scrollsHorizontally = true, floatingBarContent }) => {
|
|
873
907
|
const DEFAULT_SEARCH_PLACEHOLDER = "Search...";
|
|
874
908
|
const { NEST_SPACING, EXPAND_COLUMN_WIDTH } = getColumnWidths(compact);
|
|
875
909
|
const [columnVisibility, setColumnVisibility] = useState(() => {
|
|
@@ -881,7 +915,27 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
881
915
|
return visibility;
|
|
882
916
|
});
|
|
883
917
|
const [columnOrder, setColumnOrder] = useState([]);
|
|
884
|
-
const
|
|
918
|
+
const isSelectionControlled = controlledSelectedRowIds != null;
|
|
919
|
+
const [internalRowSelection, setInternalRowSelection] = useState({});
|
|
920
|
+
const rowSelection = useMemo(() => isSelectionControlled ? Object.fromEntries([...controlledSelectedRowIds].map((rowId) => [rowId, true])) : internalRowSelection, [
|
|
921
|
+
controlledSelectedRowIds,
|
|
922
|
+
internalRowSelection,
|
|
923
|
+
isSelectionControlled
|
|
924
|
+
]);
|
|
925
|
+
const showSelectColumn = enableRowSelection && (Boolean(showControls) || isSelectionControlled);
|
|
926
|
+
const pendingRowSelectionRef = useRef(rowSelection);
|
|
927
|
+
pendingRowSelectionRef.current = rowSelection;
|
|
928
|
+
const isBatchingRowSelectionRef = useRef(false);
|
|
929
|
+
const setRowSelection = useCallback((updater) => {
|
|
930
|
+
if (!isSelectionControlled) {
|
|
931
|
+
setInternalRowSelection(updater);
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
const next = functionalUpdate(updater, pendingRowSelectionRef.current);
|
|
935
|
+
pendingRowSelectionRef.current = next;
|
|
936
|
+
if (isBatchingRowSelectionRef.current) return;
|
|
937
|
+
onSelectedRowIdsChange?.(new Set(Object.keys(next).filter((rowId) => next[rowId] === true)));
|
|
938
|
+
}, [isSelectionControlled, onSelectedRowIdsChange]);
|
|
885
939
|
const lastSelectedRowIdRef = useRef(null);
|
|
886
940
|
const isSearchControlled = controlledSearchTerm != null;
|
|
887
941
|
const [internalSearchTerm, setInternalSearchTerm] = useState(typeof clientSearch === "object" ? clientSearch.initialValue || "" : "");
|
|
@@ -936,7 +990,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
936
990
|
const pinnedColumns = [];
|
|
937
991
|
if (columns.some((column) => typeof column === "object" && column.pinned)) {
|
|
938
992
|
if (expandColumnVisibility === "always" || data.some(canRowExpand)) pinnedColumns.push("expand-col");
|
|
939
|
-
if (
|
|
993
|
+
if (showSelectColumn) pinnedColumns.push("select-col");
|
|
940
994
|
columns.forEach((column) => {
|
|
941
995
|
if (typeof column === "object" && column.pinned) pinnedColumns.push(column.accessor);
|
|
942
996
|
});
|
|
@@ -947,8 +1001,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
947
1001
|
data,
|
|
948
1002
|
canRowExpand,
|
|
949
1003
|
expandColumnVisibility,
|
|
950
|
-
|
|
951
|
-
enableRowSelection
|
|
1004
|
+
showSelectColumn
|
|
952
1005
|
]);
|
|
953
1006
|
const toggleRowExpansion = useCallback((rowId) => {
|
|
954
1007
|
setExpandedRows((prev) => {
|
|
@@ -1041,7 +1094,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1041
1094
|
sorting: sort.state
|
|
1042
1095
|
};
|
|
1043
1096
|
} else options.enableSorting = false;
|
|
1044
|
-
if (
|
|
1097
|
+
if (showSelectColumn) {
|
|
1045
1098
|
options.enableRowSelection = getRowSelectable ? (row) => getRowSelectable(row.original) : true;
|
|
1046
1099
|
options.onRowSelectionChange = setRowSelection;
|
|
1047
1100
|
}
|
|
@@ -1089,10 +1142,10 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1089
1142
|
pagination,
|
|
1090
1143
|
columnVisibility,
|
|
1091
1144
|
columnOrder,
|
|
1092
|
-
|
|
1145
|
+
showSelectColumn,
|
|
1093
1146
|
enableSubRowSelection,
|
|
1094
1147
|
rowSelection,
|
|
1095
|
-
|
|
1148
|
+
setRowSelection,
|
|
1096
1149
|
sort,
|
|
1097
1150
|
enableSortingRemoval,
|
|
1098
1151
|
sortDescFirst,
|
|
@@ -1112,9 +1165,15 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1112
1165
|
if (isShiftKey && lastIndex !== -1 && currentIndex !== -1) {
|
|
1113
1166
|
const startIndex = Math.min(lastIndex, currentIndex);
|
|
1114
1167
|
const endIndex = Math.max(lastIndex, currentIndex);
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1168
|
+
isBatchingRowSelectionRef.current = true;
|
|
1169
|
+
try {
|
|
1170
|
+
displayedRows.slice(startIndex, endIndex + 1).forEach((rangeRow) => {
|
|
1171
|
+
if (rangeRow.getCanSelect()) rangeRow.toggleSelected(checked);
|
|
1172
|
+
});
|
|
1173
|
+
} finally {
|
|
1174
|
+
isBatchingRowSelectionRef.current = false;
|
|
1175
|
+
}
|
|
1176
|
+
table.setRowSelection((selection) => selection);
|
|
1118
1177
|
} else clickedRow.toggleSelected(checked);
|
|
1119
1178
|
lastSelectedRowIdRef.current = clickedRow.id;
|
|
1120
1179
|
}, []);
|
|
@@ -1148,11 +1207,14 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1148
1207
|
clientSearch,
|
|
1149
1208
|
clientFiltering,
|
|
1150
1209
|
expandColumnVisibility,
|
|
1151
|
-
showControls,
|
|
1210
|
+
showControls: Boolean(showControls) || isSelectionControlled,
|
|
1152
1211
|
enableRowSelection,
|
|
1153
1212
|
enableSubRowSelection,
|
|
1154
1213
|
rowActions,
|
|
1155
1214
|
getRowId,
|
|
1215
|
+
getRowLabel: isSelectionControlled ? getRowLabel : void 0,
|
|
1216
|
+
scopeSelectAllToRows: isSelectionControlled,
|
|
1217
|
+
stableSelectCells: isSelectionControlled,
|
|
1156
1218
|
expandedRows,
|
|
1157
1219
|
toggleRowExpansion,
|
|
1158
1220
|
canRowExpand,
|
|
@@ -1260,6 +1322,11 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1260
1322
|
].includes(columnId);
|
|
1261
1323
|
};
|
|
1262
1324
|
const selectedRows = table.getFilteredSelectedRowModel().flatRows;
|
|
1325
|
+
const selectedRowIds = useMemo(() => isSelectionControlled ? [...controlledSelectedRowIds] : selectedRows.map((row) => row.id), [
|
|
1326
|
+
controlledSelectedRowIds,
|
|
1327
|
+
isSelectionControlled,
|
|
1328
|
+
selectedRows
|
|
1329
|
+
]);
|
|
1263
1330
|
useEffect(() => {
|
|
1264
1331
|
onRowSelectionChange?.(selectedRows.map((row) => row.original));
|
|
1265
1332
|
}, [selectedRows, onRowSelectionChange]);
|
|
@@ -1269,7 +1336,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1269
1336
|
const baseAction = {
|
|
1270
1337
|
...action,
|
|
1271
1338
|
onClick: async () => {
|
|
1272
|
-
await action.onClick(
|
|
1339
|
+
await action.onClick(selectedRowIds, clearSelection);
|
|
1273
1340
|
}
|
|
1274
1341
|
};
|
|
1275
1342
|
if ("popover" in action && action.popover) {
|
|
@@ -1279,8 +1346,8 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1279
1346
|
popover: {
|
|
1280
1347
|
options: popoverConfig.options,
|
|
1281
1348
|
onOptionSelect: async (option) => {
|
|
1282
|
-
await popoverConfig.onOptionSelect(option,
|
|
1283
|
-
table.setRowSelection({});
|
|
1349
|
+
await popoverConfig.onOptionSelect(option, selectedRowIds);
|
|
1350
|
+
if (!isSelectionControlled) table.setRowSelection({});
|
|
1284
1351
|
}
|
|
1285
1352
|
}
|
|
1286
1353
|
};
|
|
@@ -1290,12 +1357,14 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1290
1357
|
}, [
|
|
1291
1358
|
bulkActions,
|
|
1292
1359
|
getAvailableBulkActions,
|
|
1360
|
+
isSelectionControlled,
|
|
1293
1361
|
selectedRows,
|
|
1362
|
+
selectedRowIds,
|
|
1294
1363
|
table,
|
|
1295
1364
|
controls?.bulkActions
|
|
1296
1365
|
]);
|
|
1297
1366
|
const usesFloatingBulkActions = Boolean(compact || floatingBulkActions);
|
|
1298
|
-
const shouldShowFloatingActionBar = usesFloatingBulkActions && actions && actions.length > 0 &&
|
|
1367
|
+
const shouldShowFloatingActionBar = usesFloatingBulkActions && actions && actions.length > 0 && selectedRowIds.length > 0;
|
|
1299
1368
|
const hasGlobalFilter = clientSearch && globalFilter && globalFilter.trim().length > 0;
|
|
1300
1369
|
const hasFilters = columnFilters.length > 0 || controls?.filterPanel == null && (controls?.filtersV2 != null ? controls.filtersV2.initialState != null && !isEmptyState(controls.filtersV2.initialState) : unifiedFilters.some((filter) => filter.enabled !== false && isFilterActive(filter, controls?.filterResolver)));
|
|
1301
1370
|
const hasActiveFilters = hasGlobalFilter || hasFilters || hasExternalActiveFilters;
|
|
@@ -1324,7 +1393,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1324
1393
|
size: compact ? "sm" : void 0,
|
|
1325
1394
|
variant: compact ? "text" : "basic"
|
|
1326
1395
|
}),
|
|
1327
|
-
selectedRows:
|
|
1396
|
+
selectedRows: selectedRowIds,
|
|
1328
1397
|
onClearSelection: () => table.setRowSelection({}),
|
|
1329
1398
|
searchProps: generatedSearchProps,
|
|
1330
1399
|
...controls,
|
|
@@ -1405,7 +1474,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1405
1474
|
const isExpanded = expandedRows.has(rowId);
|
|
1406
1475
|
const canExpand = canRowExpand(rowData);
|
|
1407
1476
|
const rowLinkHref = getLinkToRow ? getLinkToRow(row.original) : rowLinkPrefix ? `${rowLinkPrefix}/${rowId}` : void 0;
|
|
1408
|
-
const dynamicNestSpacing =
|
|
1477
|
+
const dynamicNestSpacing = showSelectColumn ? NEST_SPACING + 8 : NEST_SPACING;
|
|
1409
1478
|
const visibleCells = row.getVisibleCells();
|
|
1410
1479
|
const isLinkableCell = (cell) => !isFeatureCol(cell.column.id) && cell.column.columnDef.meta?.format?.type !== "url";
|
|
1411
1480
|
const rowLinkCellId = rowLinkHref ? visibleCells.find((cell) => cell.column.id === rowLinkColumnId && isLinkableCell(cell))?.column.id ?? visibleCells.find(isLinkableCell)?.column.id : void 0;
|
|
@@ -1532,7 +1601,7 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1532
1601
|
return elements;
|
|
1533
1602
|
})
|
|
1534
1603
|
}), shouldShowFloatingActionBar && actions && /* @__PURE__ */ jsx(FloatingActionBarContainer, { children: /* @__PURE__ */ jsx(FloatingActionBar, {
|
|
1535
|
-
selectedCount:
|
|
1604
|
+
selectedCount: selectedRowIds.length,
|
|
1536
1605
|
onClearSelection: () => table.setRowSelection({}),
|
|
1537
1606
|
actions,
|
|
1538
1607
|
extraContent: floatingBarContent
|
|
@@ -1558,4 +1627,4 @@ const DataTable = ({ data, columns, detailComponent, expandColumnVisibility = "a
|
|
|
1558
1627
|
//#endregion
|
|
1559
1628
|
export { getFilterFnName as S, renderAsString as _, useTableColumns as a, getColumnWidths as b, renderAsCheckboxHeader as c, renderAsDatetime as d, renderAsLightweightImage as f, renderAsSticker as g, renderAsPii as h, FloatingActionBarContainer as i, renderAsCopyableString as l, renderAsPDSFormat as m, DataTableContainer as n, Inserter as o, renderAsNumber as p, DataTableControls as r, renderAsCheckbox as s, DataTable as t, renderAsDate as u, renderAsURL as v, generateClientFilters as x, FloatingActionBar as y };
|
|
1560
1629
|
|
|
1561
|
-
//# sourceMappingURL=DataTable-
|
|
1630
|
+
//# sourceMappingURL=DataTable-6t5ryaEq.mjs.map
|