@primer/react 38.47.0-rc.6f1dd6463 → 38.47.0-rc.bc5d8a965
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 +2 -0
- package/dist/DataTable/DataTable.d.ts +1 -0
- package/dist/DataTable/DataTable.js +29 -26
- package/dist/DataTable/TableGroup.d.ts +2 -0
- package/dist/DataTable/TableGroup.js +191 -166
- package/generated/components.json +12 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- [#8688](https://github.com/primer/react/pull/8688) [`92a1fca`](https://github.com/primer/react/commit/92a1fca80cd63c2b729141a38a4a93ec27c47a43) Thanks [@rickyzhangca](https://github.com/rickyzhangca)! - DataTable: Describe group selection checkboxes with the member count. Add count-label formatters for localizing checkbox and disclosure descriptions in DataTable and Table.Group.
|
|
8
|
+
|
|
7
9
|
- [#8563](https://github.com/primer/react/pull/8563) [`998b471`](https://github.com/primer/react/commit/998b471a4ad78c7c23426038ef0c4a5261fc41cf) Thanks [@joshblack](https://github.com/joshblack)! - ActionMenu: Improve rendering performance with React Compiler support.
|
|
8
10
|
|
|
9
11
|
### Patch Changes
|
|
@@ -90,6 +90,7 @@ type DataTableBaseProps<Data extends UniqueRow> = {
|
|
|
90
90
|
* Whether groups have disclosure controls. Groups are expanded by default.
|
|
91
91
|
*/
|
|
92
92
|
collapsibleGroups?: boolean;
|
|
93
|
+
getGroupRowCountLabel?: (rowCount: number) => string;
|
|
93
94
|
/**
|
|
94
95
|
* Controls the expanded group IDs.
|
|
95
96
|
*/
|
|
@@ -12,8 +12,8 @@ function defaultGetRowId(row) {
|
|
|
12
12
|
return row.id;
|
|
13
13
|
}
|
|
14
14
|
function DataTableImplementation(t0) {
|
|
15
|
-
const $ = c(
|
|
16
|
-
const { "aria-labelledby": labelledby, "aria-describedby": describedby, cellPadding, columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId: t1, onToggleSort, rowSelection: t2, selectedRows, defaultSelectedRows, onSelectionChange, isRowSelectable, collapsibleGroups: t3, expandedGroups, defaultExpandedGroups, onExpandedGroupsChange, renderBulkActions, bulkActionsProps, bulkActionsReturnFocusRef } = t0;
|
|
15
|
+
const $ = c(74);
|
|
16
|
+
const { "aria-labelledby": labelledby, "aria-describedby": describedby, cellPadding, columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId: t1, onToggleSort, rowSelection: t2, selectedRows, defaultSelectedRows, onSelectionChange, isRowSelectable, collapsibleGroups: t3, getGroupRowCountLabel, expandedGroups, defaultExpandedGroups, onExpandedGroupsChange, renderBulkActions, bulkActionsProps, bulkActionsReturnFocusRef } = t0;
|
|
17
17
|
const getRowId = t1 === void 0 ? defaultGetRowId : t1;
|
|
18
18
|
const rowSelection = t2 === void 0 ? false : t2;
|
|
19
19
|
const collapsibleGroups = t3 === void 0 ? false : t3;
|
|
@@ -215,13 +215,14 @@ function DataTableImplementation(t0) {
|
|
|
215
215
|
$[50] = t12;
|
|
216
216
|
} else t12 = $[50];
|
|
217
217
|
let t13;
|
|
218
|
-
if ($[51] !== actions || $[52] !== bodies || $[53] !== collapsibleGroups || $[54] !== headers.length || $[
|
|
218
|
+
if ($[51] !== actions || $[52] !== bodies || $[53] !== collapsibleGroups || $[54] !== getGroupRowCountLabel || $[55] !== headers.length || $[56] !== renderRow || $[57] !== rowSelection) {
|
|
219
219
|
let t14;
|
|
220
|
-
if ($[
|
|
220
|
+
if ($[59] !== actions || $[60] !== collapsibleGroups || $[61] !== getGroupRowCountLabel || $[62] !== headers.length || $[63] !== renderRow || $[64] !== rowSelection) {
|
|
221
221
|
t14 = (body) => body.type === "row-group" ? /* @__PURE__ */ jsx(TableGroup, {
|
|
222
222
|
id: body.id,
|
|
223
223
|
label: body.label,
|
|
224
224
|
rowCount: body.rows.length,
|
|
225
|
+
getRowCountLabel: getGroupRowCountLabel,
|
|
225
226
|
colSpan: headers.length + (rowSelection ? 1 : 0),
|
|
226
227
|
"aria-label": body["aria-label"],
|
|
227
228
|
collapsible: collapsibleGroups,
|
|
@@ -236,24 +237,26 @@ function DataTableImplementation(t0) {
|
|
|
236
237
|
},
|
|
237
238
|
children: body.rows.map(renderRow)
|
|
238
239
|
}, body.key) : /* @__PURE__ */ jsx(TableBody, { children: body.rows.map(renderRow) }, body.key);
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
|
|
240
|
+
$[59] = actions;
|
|
241
|
+
$[60] = collapsibleGroups;
|
|
242
|
+
$[61] = getGroupRowCountLabel;
|
|
243
|
+
$[62] = headers.length;
|
|
244
|
+
$[63] = renderRow;
|
|
245
|
+
$[64] = rowSelection;
|
|
246
|
+
$[65] = t14;
|
|
247
|
+
} else t14 = $[65];
|
|
246
248
|
t13 = bodies.map(t14);
|
|
247
249
|
$[51] = actions;
|
|
248
250
|
$[52] = bodies;
|
|
249
251
|
$[53] = collapsibleGroups;
|
|
250
|
-
$[54] =
|
|
251
|
-
$[55] =
|
|
252
|
-
$[56] =
|
|
253
|
-
$[57] =
|
|
254
|
-
|
|
252
|
+
$[54] = getGroupRowCountLabel;
|
|
253
|
+
$[55] = headers.length;
|
|
254
|
+
$[56] = renderRow;
|
|
255
|
+
$[57] = rowSelection;
|
|
256
|
+
$[58] = t13;
|
|
257
|
+
} else t13 = $[58];
|
|
255
258
|
let t14;
|
|
256
|
-
if ($[
|
|
259
|
+
if ($[66] !== cellPadding || $[67] !== describedby || $[68] !== gridTemplateColumns || $[69] !== labelledby || $[70] !== t12 || $[71] !== t13 || $[72] !== t6) {
|
|
257
260
|
t14 = /* @__PURE__ */ jsxs(Table, {
|
|
258
261
|
ref: tableRef,
|
|
259
262
|
tabIndex: t6,
|
|
@@ -263,15 +266,15 @@ function DataTableImplementation(t0) {
|
|
|
263
266
|
gridTemplateColumns,
|
|
264
267
|
children: [t12, t13]
|
|
265
268
|
});
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
} else t14 = $[
|
|
269
|
+
$[66] = cellPadding;
|
|
270
|
+
$[67] = describedby;
|
|
271
|
+
$[68] = gridTemplateColumns;
|
|
272
|
+
$[69] = labelledby;
|
|
273
|
+
$[70] = t12;
|
|
274
|
+
$[71] = t13;
|
|
275
|
+
$[72] = t6;
|
|
276
|
+
$[73] = t14;
|
|
277
|
+
} else t14 = $[73];
|
|
275
278
|
return t14;
|
|
276
279
|
}
|
|
277
280
|
const DataTable = DataTableImplementation;
|
|
@@ -18,6 +18,7 @@ type TableGroupProps = {
|
|
|
18
18
|
* Specify the number of member rows in the group
|
|
19
19
|
*/
|
|
20
20
|
rowCount: number;
|
|
21
|
+
getRowCountLabel?: (rowCount: number) => string;
|
|
21
22
|
/**
|
|
22
23
|
* Provide an accessible name for the group header
|
|
23
24
|
*/
|
|
@@ -56,6 +57,7 @@ declare function TableGroup({
|
|
|
56
57
|
id,
|
|
57
58
|
label,
|
|
58
59
|
rowCount,
|
|
60
|
+
getRowCountLabel,
|
|
59
61
|
colSpan,
|
|
60
62
|
children,
|
|
61
63
|
'aria-label': ariaLabel,
|
|
@@ -11,90 +11,97 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import { clsx } from "clsx";
|
|
12
12
|
import { ChevronRightIcon } from "@primer/octicons-react";
|
|
13
13
|
//#region src/DataTable/TableGroup.tsx
|
|
14
|
+
function defaultRowCountLabel(rowCount) {
|
|
15
|
+
return `${rowCount} ${rowCount === 1 ? "row" : "rows"}`;
|
|
16
|
+
}
|
|
14
17
|
function TableGroup(t0) {
|
|
15
|
-
const $ = c(
|
|
16
|
-
const { className, id, label, rowCount, colSpan, children, "aria-label": ariaLabel, collapsible:
|
|
17
|
-
const
|
|
18
|
-
const
|
|
18
|
+
const $ = c(79);
|
|
19
|
+
const { className, id, label, rowCount, getRowCountLabel: t1, colSpan, children, "aria-label": ariaLabel, collapsible: t2, expanded: controlledExpanded, defaultExpanded: t3, onExpandedChange, selection, selectionDisabled, onToggleSelect } = t0;
|
|
20
|
+
const getRowCountLabel = t1 === void 0 ? defaultRowCountLabel : t1;
|
|
21
|
+
const collapsible = t2 === void 0 ? false : t2;
|
|
22
|
+
const defaultExpanded = t3 === void 0 ? true : t3;
|
|
19
23
|
const headerId = useId();
|
|
20
24
|
const bodyId = useId();
|
|
25
|
+
const countId = useId();
|
|
21
26
|
const headerRef = useRef(null);
|
|
22
|
-
let
|
|
27
|
+
let t4;
|
|
23
28
|
if ($[0] !== onExpandedChange) {
|
|
24
|
-
|
|
29
|
+
t4 = (value) => onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange({ expanded: value });
|
|
25
30
|
$[0] = onExpandedChange;
|
|
26
|
-
$[1] =
|
|
27
|
-
} else
|
|
28
|
-
let
|
|
29
|
-
if ($[2] !== controlledExpanded || $[3] !== defaultExpanded || $[4] !==
|
|
30
|
-
|
|
31
|
+
$[1] = t4;
|
|
32
|
+
} else t4 = $[1];
|
|
33
|
+
let t5;
|
|
34
|
+
if ($[2] !== controlledExpanded || $[3] !== defaultExpanded || $[4] !== t4) {
|
|
35
|
+
t5 = {
|
|
31
36
|
name: "Table.Group expanded",
|
|
32
37
|
value: controlledExpanded,
|
|
33
38
|
defaultValue: defaultExpanded,
|
|
34
|
-
onChange:
|
|
39
|
+
onChange: t4
|
|
35
40
|
};
|
|
36
41
|
$[2] = controlledExpanded;
|
|
37
42
|
$[3] = defaultExpanded;
|
|
38
|
-
$[4] =
|
|
39
|
-
$[5] =
|
|
40
|
-
} else
|
|
41
|
-
const [expanded, setExpanded] = useControllableState(
|
|
43
|
+
$[4] = t4;
|
|
44
|
+
$[5] = t5;
|
|
45
|
+
} else t5 = $[5];
|
|
46
|
+
const [expanded, setExpanded] = useControllableState(t5);
|
|
42
47
|
const isExpanded = !collapsible || expanded;
|
|
43
|
-
let
|
|
48
|
+
let t6;
|
|
44
49
|
if ($[6] !== headerId) {
|
|
45
|
-
|
|
50
|
+
t6 = { headerId };
|
|
46
51
|
$[6] = headerId;
|
|
47
|
-
$[7] =
|
|
48
|
-
} else
|
|
49
|
-
const contextValue =
|
|
50
|
-
let
|
|
52
|
+
$[7] = t6;
|
|
53
|
+
} else t6 = $[7];
|
|
54
|
+
const contextValue = t6;
|
|
55
|
+
let t7;
|
|
51
56
|
if ($[8] !== isExpanded) {
|
|
52
|
-
|
|
57
|
+
t7 = (body) => {
|
|
53
58
|
if (!isExpanded && body !== null && body !== void 0 && body.contains(body.ownerDocument.activeElement)) {
|
|
54
59
|
var _headerRef$current;
|
|
55
60
|
(_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 || (_headerRef$current = _headerRef$current.querySelector("button")) === null || _headerRef$current === void 0 || _headerRef$current.focus();
|
|
56
61
|
}
|
|
57
62
|
};
|
|
58
63
|
$[8] = isExpanded;
|
|
59
|
-
$[9] =
|
|
60
|
-
} else
|
|
61
|
-
const bodyRef =
|
|
62
|
-
let
|
|
64
|
+
$[9] = t7;
|
|
65
|
+
} else t7 = $[9];
|
|
66
|
+
const bodyRef = t7;
|
|
67
|
+
let t8;
|
|
63
68
|
if ($[10] !== className) {
|
|
64
|
-
|
|
69
|
+
t8 = clsx("TableGroupHeaderBody", Table_module_css_default.TableGroupHeaderBody, className);
|
|
65
70
|
$[10] = className;
|
|
66
|
-
$[11] =
|
|
67
|
-
} else
|
|
68
|
-
let
|
|
71
|
+
$[11] = t8;
|
|
72
|
+
} else t8 = $[11];
|
|
73
|
+
let t9;
|
|
69
74
|
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
70
|
-
|
|
71
|
-
$[12] =
|
|
72
|
-
} else
|
|
73
|
-
const
|
|
74
|
-
let
|
|
75
|
-
if ($[13] !== ariaLabel || $[14] !==
|
|
76
|
-
|
|
75
|
+
t9 = clsx("TableGroupHeaderCell", Table_module_css_default.TableGroupHeaderCell);
|
|
76
|
+
$[12] = t9;
|
|
77
|
+
} else t9 = $[12];
|
|
78
|
+
const t10 = collapsible || selection !== void 0 ? ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label : ariaLabel;
|
|
79
|
+
let t11;
|
|
80
|
+
if ($[13] !== ariaLabel || $[14] !== countId || $[15] !== label || $[16] !== onToggleSelect || $[17] !== selection || $[18] !== selectionDisabled) {
|
|
81
|
+
t11 = selection !== void 0 ? /* @__PURE__ */ jsx(Checkbox, {
|
|
77
82
|
className: Table_module_css_default.TableGroupSelection,
|
|
78
83
|
checked: selection === "all",
|
|
79
84
|
indeterminate: selection === "some",
|
|
80
85
|
disabled: selectionDisabled || !onToggleSelect,
|
|
81
86
|
"aria-label": `Select ${ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label}`,
|
|
87
|
+
"aria-describedby": countId,
|
|
82
88
|
onChange: () => onToggleSelect === null || onToggleSelect === void 0 ? void 0 : onToggleSelect()
|
|
83
89
|
}) : null;
|
|
84
90
|
$[13] = ariaLabel;
|
|
85
|
-
$[14] =
|
|
86
|
-
$[15] =
|
|
87
|
-
$[16] =
|
|
88
|
-
$[17] =
|
|
89
|
-
$[18] =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
$[14] = countId;
|
|
92
|
+
$[15] = label;
|
|
93
|
+
$[16] = onToggleSelect;
|
|
94
|
+
$[17] = selection;
|
|
95
|
+
$[18] = selectionDisabled;
|
|
96
|
+
$[19] = t11;
|
|
97
|
+
} else t11 = $[19];
|
|
98
|
+
let t12;
|
|
99
|
+
if ($[20] !== ariaLabel || $[21] !== bodyId || $[22] !== collapsible || $[23] !== countId || $[24] !== expanded || $[25] !== isExpanded || $[26] !== label || $[27] !== setExpanded) {
|
|
100
|
+
t12 = collapsible ? /* @__PURE__ */ jsx(Button, {
|
|
94
101
|
className: Table_module_css_default.TableGroupToggle,
|
|
95
102
|
"data-component": "Table.Group.Toggle",
|
|
96
103
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label,
|
|
97
|
-
"aria-
|
|
104
|
+
"aria-describedby": countId,
|
|
98
105
|
"aria-expanded": isExpanded,
|
|
99
106
|
"aria-controls": bodyId,
|
|
100
107
|
onClick: () => {
|
|
@@ -102,167 +109,185 @@ function TableGroup(t0) {
|
|
|
102
109
|
},
|
|
103
110
|
children: /* @__PURE__ */ jsx(ChevronRightIcon, { "aria-hidden": "true" })
|
|
104
111
|
}) : null;
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[27] = t11;
|
|
114
|
-
} else t11 = $[27];
|
|
115
|
-
let t12;
|
|
116
|
-
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
117
|
-
t12 = clsx("TableGroupHeaderContent", Table_module_css_default.TableGroupHeaderContent);
|
|
112
|
+
$[20] = ariaLabel;
|
|
113
|
+
$[21] = bodyId;
|
|
114
|
+
$[22] = collapsible;
|
|
115
|
+
$[23] = countId;
|
|
116
|
+
$[24] = expanded;
|
|
117
|
+
$[25] = isExpanded;
|
|
118
|
+
$[26] = label;
|
|
119
|
+
$[27] = setExpanded;
|
|
118
120
|
$[28] = t12;
|
|
119
121
|
} else t12 = $[28];
|
|
120
|
-
|
|
121
|
-
let t14;
|
|
122
|
+
let t13;
|
|
122
123
|
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
123
|
-
|
|
124
|
-
$[29] =
|
|
125
|
-
} else
|
|
124
|
+
t13 = clsx("TableGroupHeaderContent", Table_module_css_default.TableGroupHeaderContent);
|
|
125
|
+
$[29] = t13;
|
|
126
|
+
} else t13 = $[29];
|
|
127
|
+
const t14 = collapsible || void 0;
|
|
126
128
|
let t15;
|
|
127
129
|
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
128
|
-
t15 =
|
|
130
|
+
t15 = clsx("TableGroupHeaderLabel", Table_module_css_default.TableGroupHeaderLabel);
|
|
129
131
|
$[30] = t15;
|
|
130
132
|
} else t15 = $[30];
|
|
131
133
|
let t16;
|
|
132
|
-
if ($[31]
|
|
133
|
-
t16 = /* @__PURE__ */
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
137
|
-
$[31] = label;
|
|
138
|
-
$[32] = t16;
|
|
139
|
-
} else t16 = $[32];
|
|
134
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
135
|
+
t16 = /* @__PURE__ */ jsx(VisuallyHidden, { children: "," });
|
|
136
|
+
$[31] = t16;
|
|
137
|
+
} else t16 = $[31];
|
|
140
138
|
let t17;
|
|
141
|
-
if ($[
|
|
142
|
-
t17 =
|
|
139
|
+
if ($[32] !== label) {
|
|
140
|
+
t17 = /* @__PURE__ */ jsxs("span", {
|
|
141
|
+
className: t15,
|
|
142
|
+
children: [label, t16]
|
|
143
|
+
});
|
|
144
|
+
$[32] = label;
|
|
143
145
|
$[33] = t17;
|
|
144
146
|
} else t17 = $[33];
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
t19 = /* @__PURE__ */ jsx(VisuallyHidden, { children: t18 });
|
|
147
|
+
let t18;
|
|
148
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
149
|
+
t18 = clsx("TableGroupHeaderCount", Table_module_css_default.TableGroupHeaderCount);
|
|
149
150
|
$[34] = t18;
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
} else t18 = $[34];
|
|
152
|
+
const t19 = rowCount === 1 ? " row" : " rows";
|
|
152
153
|
let t20;
|
|
153
|
-
if ($[
|
|
154
|
-
t20 = /* @__PURE__ */
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
$[36] = rowCount;
|
|
159
|
-
$[37] = t19;
|
|
160
|
-
$[38] = t20;
|
|
161
|
-
} else t20 = $[38];
|
|
154
|
+
if ($[35] !== t19) {
|
|
155
|
+
t20 = /* @__PURE__ */ jsx(VisuallyHidden, { children: t19 });
|
|
156
|
+
$[35] = t19;
|
|
157
|
+
$[36] = t20;
|
|
158
|
+
} else t20 = $[36];
|
|
162
159
|
let t21;
|
|
163
|
-
if ($[
|
|
160
|
+
if ($[37] !== rowCount || $[38] !== t20) {
|
|
164
161
|
t21 = /* @__PURE__ */ jsxs("span", {
|
|
165
|
-
className:
|
|
166
|
-
|
|
167
|
-
children: [t16, t20]
|
|
162
|
+
className: t18,
|
|
163
|
+
children: [rowCount, t20]
|
|
168
164
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
|
|
173
|
-
} else t21 = $[42];
|
|
165
|
+
$[37] = rowCount;
|
|
166
|
+
$[38] = t20;
|
|
167
|
+
$[39] = t21;
|
|
168
|
+
} else t21 = $[39];
|
|
174
169
|
let t22;
|
|
175
|
-
if ($[
|
|
170
|
+
if ($[40] !== t14 || $[41] !== t17 || $[42] !== t21) {
|
|
176
171
|
t22 = /* @__PURE__ */ jsxs("span", {
|
|
172
|
+
className: t13,
|
|
173
|
+
"aria-hidden": t14,
|
|
174
|
+
children: [t17, t21]
|
|
175
|
+
});
|
|
176
|
+
$[40] = t14;
|
|
177
|
+
$[41] = t17;
|
|
178
|
+
$[42] = t21;
|
|
179
|
+
$[43] = t22;
|
|
180
|
+
} else t22 = $[43];
|
|
181
|
+
let t23;
|
|
182
|
+
if ($[44] !== selection || $[45] !== t12 || $[46] !== t22) {
|
|
183
|
+
t23 = /* @__PURE__ */ jsxs("span", {
|
|
177
184
|
className: Table_module_css_default.TableGroupHeaderTitle,
|
|
178
185
|
"data-selection": selection,
|
|
179
|
-
children: [
|
|
186
|
+
children: [t12, t22]
|
|
180
187
|
});
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[45] = t21;
|
|
188
|
+
$[44] = selection;
|
|
189
|
+
$[45] = t12;
|
|
184
190
|
$[46] = t22;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
$[47] = t23;
|
|
192
|
+
} else t23 = $[47];
|
|
193
|
+
let t24;
|
|
194
|
+
if ($[48] !== collapsible || $[49] !== countId || $[50] !== getRowCountLabel || $[51] !== rowCount || $[52] !== selection) {
|
|
195
|
+
t24 = collapsible || selection !== void 0 ? /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
196
|
+
id: countId,
|
|
197
|
+
children: getRowCountLabel(rowCount)
|
|
198
|
+
}) : null;
|
|
199
|
+
$[48] = collapsible;
|
|
200
|
+
$[49] = countId;
|
|
201
|
+
$[50] = getRowCountLabel;
|
|
202
|
+
$[51] = rowCount;
|
|
203
|
+
$[52] = selection;
|
|
204
|
+
$[53] = t24;
|
|
205
|
+
} else t24 = $[53];
|
|
206
|
+
let t25;
|
|
207
|
+
if ($[54] !== colSpan || $[55] !== headerId || $[56] !== t10 || $[57] !== t11 || $[58] !== t23 || $[59] !== t24) {
|
|
208
|
+
t25 = /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsxs("th", {
|
|
189
209
|
id: headerId,
|
|
190
210
|
ref: headerRef,
|
|
191
|
-
className:
|
|
211
|
+
className: t9,
|
|
192
212
|
scope: "colgroup",
|
|
193
213
|
colSpan,
|
|
194
214
|
role: "columnheader",
|
|
195
|
-
"aria-label":
|
|
215
|
+
"aria-label": t10,
|
|
196
216
|
"data-component": "Table.Group.Header",
|
|
197
|
-
children: [
|
|
217
|
+
children: [
|
|
218
|
+
t11,
|
|
219
|
+
t23,
|
|
220
|
+
t24
|
|
221
|
+
]
|
|
198
222
|
}) });
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
223
|
+
$[54] = colSpan;
|
|
224
|
+
$[55] = headerId;
|
|
225
|
+
$[56] = t10;
|
|
226
|
+
$[57] = t11;
|
|
227
|
+
$[58] = t23;
|
|
228
|
+
$[59] = t24;
|
|
229
|
+
$[60] = t25;
|
|
230
|
+
} else t25 = $[60];
|
|
231
|
+
let t26;
|
|
232
|
+
if ($[61] !== id || $[62] !== t25 || $[63] !== t8) {
|
|
233
|
+
t26 = /* @__PURE__ */ jsx("tbody", {
|
|
234
|
+
className: t8,
|
|
210
235
|
role: "rowgroup",
|
|
211
236
|
"data-component": "Table.Group",
|
|
212
237
|
"data-group-id": id,
|
|
213
|
-
children:
|
|
238
|
+
children: t25
|
|
214
239
|
});
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
} else
|
|
220
|
-
const
|
|
221
|
-
let t26;
|
|
222
|
-
if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
|
|
223
|
-
t26 = clsx("TableBody", Table_module_css_default.TableBody);
|
|
224
|
-
$[57] = t26;
|
|
225
|
-
} else t26 = $[57];
|
|
226
|
-
const t27 = collapsible ? selection : void 0;
|
|
240
|
+
$[61] = id;
|
|
241
|
+
$[62] = t25;
|
|
242
|
+
$[63] = t8;
|
|
243
|
+
$[64] = t26;
|
|
244
|
+
} else t26 = $[64];
|
|
245
|
+
const t27 = !isExpanded;
|
|
227
246
|
let t28;
|
|
228
|
-
if ($[
|
|
229
|
-
t28 =
|
|
247
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
|
248
|
+
t28 = clsx("TableBody", Table_module_css_default.TableBody);
|
|
249
|
+
$[65] = t28;
|
|
250
|
+
} else t28 = $[65];
|
|
251
|
+
const t29 = collapsible ? selection : void 0;
|
|
252
|
+
let t30;
|
|
253
|
+
if ($[66] !== children || $[67] !== contextValue) {
|
|
254
|
+
t30 = /* @__PURE__ */ jsx(TableGroupContext.Provider, {
|
|
230
255
|
value: contextValue,
|
|
231
256
|
children
|
|
232
257
|
});
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
} else
|
|
237
|
-
let
|
|
238
|
-
if ($[
|
|
239
|
-
|
|
258
|
+
$[66] = children;
|
|
259
|
+
$[67] = contextValue;
|
|
260
|
+
$[68] = t30;
|
|
261
|
+
} else t30 = $[68];
|
|
262
|
+
let t31;
|
|
263
|
+
if ($[69] !== bodyId || $[70] !== bodyRef || $[71] !== id || $[72] !== t27 || $[73] !== t29 || $[74] !== t30) {
|
|
264
|
+
t31 = /* @__PURE__ */ jsx("tbody", {
|
|
240
265
|
id: bodyId,
|
|
241
266
|
ref: bodyRef,
|
|
242
|
-
hidden:
|
|
243
|
-
className:
|
|
267
|
+
hidden: t27,
|
|
268
|
+
className: t28,
|
|
244
269
|
role: "rowgroup",
|
|
245
270
|
"data-component": "Table.Group.Body",
|
|
246
271
|
"data-group-id": id,
|
|
247
|
-
"data-selection":
|
|
248
|
-
children:
|
|
272
|
+
"data-selection": t29,
|
|
273
|
+
children: t30
|
|
249
274
|
});
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
} else
|
|
258
|
-
let
|
|
259
|
-
if ($[
|
|
260
|
-
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
} else
|
|
265
|
-
return
|
|
275
|
+
$[69] = bodyId;
|
|
276
|
+
$[70] = bodyRef;
|
|
277
|
+
$[71] = id;
|
|
278
|
+
$[72] = t27;
|
|
279
|
+
$[73] = t29;
|
|
280
|
+
$[74] = t30;
|
|
281
|
+
$[75] = t31;
|
|
282
|
+
} else t31 = $[75];
|
|
283
|
+
let t32;
|
|
284
|
+
if ($[76] !== t26 || $[77] !== t31) {
|
|
285
|
+
t32 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t26, t31] });
|
|
286
|
+
$[76] = t26;
|
|
287
|
+
$[77] = t31;
|
|
288
|
+
$[78] = t32;
|
|
289
|
+
} else t32 = $[78];
|
|
290
|
+
return t32;
|
|
266
291
|
}
|
|
267
292
|
//#endregion
|
|
268
293
|
export { TableGroup };
|
|
@@ -2941,6 +2941,11 @@
|
|
|
2941
2941
|
"defaultValue": "false",
|
|
2942
2942
|
"description": "Enable group disclosures. Collapsing only hides members; selection and select-all still include them."
|
|
2943
2943
|
},
|
|
2944
|
+
{
|
|
2945
|
+
"name": "getGroupRowCountLabel",
|
|
2946
|
+
"type": "(rowCount: number) => string",
|
|
2947
|
+
"description": "Localize the description shared by each group checkbox and disclosure. The count includes all members, including non-selectable rows, and defaults to 1 row or N rows."
|
|
2948
|
+
},
|
|
2944
2949
|
{
|
|
2945
2950
|
"name": "expandedGroups",
|
|
2946
2951
|
"type": "ReadonlySet<DataTableRowId>",
|
|
@@ -3156,12 +3161,17 @@
|
|
|
3156
3161
|
{
|
|
3157
3162
|
"name": "rowCount",
|
|
3158
3163
|
"type": "number",
|
|
3159
|
-
"description": "The number of member rows
|
|
3164
|
+
"description": "The total number of member rows, including non-selectable rows. Shown in the header and described separately on the checkbox and disclosure."
|
|
3165
|
+
},
|
|
3166
|
+
{
|
|
3167
|
+
"name": "getRowCountLabel",
|
|
3168
|
+
"type": "(rowCount: number) => string",
|
|
3169
|
+
"description": "Localize the count description shared by the checkbox and disclosure. Defaults to 1 row or N rows."
|
|
3160
3170
|
},
|
|
3161
3171
|
{
|
|
3162
3172
|
"name": "aria-label",
|
|
3163
3173
|
"type": "string",
|
|
3164
|
-
"description": "Override the group
|
|
3174
|
+
"description": "Override the group name used by the header, checkbox, and disclosure. Use getRowCountLabel to localize the controls' separate count description."
|
|
3165
3175
|
},
|
|
3166
3176
|
{
|
|
3167
3177
|
"name": "colSpan",
|
package/package.json
CHANGED