@primer/react 38.46.0 → 38.47.0-rc.200a948c2
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 +12 -0
- package/dist/ActionMenu/ActionMenu.js +400 -161
- 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/dist/Pagination/model.js +1 -1
- package/generated/components.json +12 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
+
## 38.47.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
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
|
+
|
|
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.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#8708](https://github.com/primer/react/pull/8708) [`16c41d3`](https://github.com/primer/react/commit/16c41d3e57bb7358d887c613aaeb22aaea3a0d97) Thanks [@vivanvv](https://github.com/vivanvv)! - Pagination: Disable Next for empty results when page numbers are hidden.
|
|
14
|
+
|
|
3
15
|
## 38.46.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
3
4
|
import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
|
|
@@ -12,7 +13,7 @@ import { ActionListContainerContext } from "../ActionList/ActionListContainerCon
|
|
|
12
13
|
import { Divider } from "../ActionList/Divider.js";
|
|
13
14
|
import { AnchoredOverlay } from "../AnchoredOverlay/AnchoredOverlay.js";
|
|
14
15
|
import ActionMenu_module_css_default from "./ActionMenu.module.css.js";
|
|
15
|
-
import React, {
|
|
16
|
+
import React, { useContext, useState } from "react";
|
|
16
17
|
import { jsx } from "react/jsx-runtime";
|
|
17
18
|
import { clsx } from "clsx";
|
|
18
19
|
import { ChevronRightIcon, TriangleDownIcon } from "@primer/octicons-react";
|
|
@@ -44,206 +45,441 @@ const mergeAnchorHandlers = (anchorProps, buttonProps) => {
|
|
|
44
45
|
if (buttonProps.className) mergedAnchorProps.className = clsx(anchorProps.className, buttonProps.className);
|
|
45
46
|
return mergedAnchorProps;
|
|
46
47
|
};
|
|
47
|
-
const Menu = (
|
|
48
|
+
const Menu = (t0) => {
|
|
49
|
+
const $ = c(25);
|
|
50
|
+
const { anchorRef: externalAnchorRef, open, onOpenChange, children } = t0;
|
|
48
51
|
const parentMenuContext = useContext(MenuContext);
|
|
49
52
|
const [combinedOpenState, setCombinedOpenState] = useProvidedStateOrCreate(open, onOpenChange, false);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
let t1;
|
|
54
|
+
if ($[0] !== setCombinedOpenState) {
|
|
55
|
+
t1 = () => setCombinedOpenState(true);
|
|
56
|
+
$[0] = setCombinedOpenState;
|
|
57
|
+
$[1] = t1;
|
|
58
|
+
} else t1 = $[1];
|
|
59
|
+
const onOpen = t1;
|
|
60
|
+
let t2;
|
|
61
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
|
+
t2 = { narrow: true };
|
|
63
|
+
$[2] = t2;
|
|
64
|
+
} else t2 = $[2];
|
|
65
|
+
const isNarrow = useResponsiveValue(t2, false);
|
|
66
|
+
let t3;
|
|
67
|
+
if ($[3] !== isNarrow || $[4] !== open || $[5] !== parentMenuContext || $[6] !== setCombinedOpenState) {
|
|
68
|
+
t3 = (gesture) => {
|
|
69
|
+
if (isNarrow && open && gesture === "tab") return;
|
|
70
|
+
setCombinedOpenState(false);
|
|
71
|
+
switch (gesture) {
|
|
72
|
+
case "tab":
|
|
73
|
+
case "item-select":
|
|
74
|
+
var _parentMenuContext$on;
|
|
75
|
+
(_parentMenuContext$on = parentMenuContext.onClose) === null || _parentMenuContext$on === void 0 || _parentMenuContext$on.call(parentMenuContext, gesture);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
$[3] = isNarrow;
|
|
79
|
+
$[4] = open;
|
|
80
|
+
$[5] = parentMenuContext;
|
|
81
|
+
$[6] = setCombinedOpenState;
|
|
82
|
+
$[7] = t3;
|
|
83
|
+
} else t3 = $[7];
|
|
84
|
+
const onClose = t3;
|
|
85
|
+
let t4;
|
|
86
|
+
if ($[8] !== children) {
|
|
87
|
+
const menuButtonChild = React.Children.toArray(children).find(_temp);
|
|
88
|
+
t4 = /*#__PURE__*/ React.isValidElement(menuButtonChild) ? menuButtonChild.props.id : void 0;
|
|
89
|
+
$[8] = children;
|
|
90
|
+
$[9] = t4;
|
|
91
|
+
} else t4 = $[9];
|
|
92
|
+
const menuButtonChildId = t4;
|
|
68
93
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
|
69
94
|
const anchorId = useId$1(menuButtonChildId);
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return null;
|
|
82
|
-
} else if (child.type === Anchor || isSlot(child, Anchor)) {
|
|
83
|
-
const anchorChildren = child.props.children;
|
|
84
|
-
if (anchorChildren !== void 0 ? anchorChildren.type === Tooltip || isSlot(anchorChildren, Tooltip) : false) {
|
|
85
|
-
if (anchorChildren.props.children !== null) renderAnchor = (anchorProps) => {
|
|
86
|
-
const tooltipTrigger = anchorChildren.props.children;
|
|
87
|
-
const tooltipTriggerEl = /*#__PURE__*/ React.cloneElement(tooltipTrigger, mergeAnchorHandlers({ ...anchorProps }, tooltipTrigger.props));
|
|
88
|
-
const tooltip = /*#__PURE__*/ React.cloneElement(anchorChildren, { children: tooltipTriggerEl });
|
|
89
|
-
return /*#__PURE__*/ React.cloneElement(child, {
|
|
90
|
-
children: tooltip,
|
|
95
|
+
let anchor;
|
|
96
|
+
let t5;
|
|
97
|
+
if ($[10] !== anchorRef || $[11] !== children) {
|
|
98
|
+
anchor = { renderAnchor: null };
|
|
99
|
+
t5 = React.Children.map(children, (child_0) => {
|
|
100
|
+
if (child_0.type === Tooltip || isSlot(child_0, Tooltip)) {
|
|
101
|
+
const anchorChildren = child_0.props.children;
|
|
102
|
+
if (anchorChildren.type === MenuButton || isSlot(anchorChildren, MenuButton)) anchor.renderAnchor = (anchorProps) => {
|
|
103
|
+
const triggerButton = /*#__PURE__*/ React.cloneElement(anchorChildren, mergeAnchorHandlers({ ...anchorProps }, anchorChildren.props));
|
|
104
|
+
return /*#__PURE__*/ React.cloneElement(child_0, {
|
|
105
|
+
children: triggerButton,
|
|
91
106
|
ref: anchorRef
|
|
92
107
|
});
|
|
93
108
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
return null;
|
|
110
|
+
} else if (child_0.type === Anchor || isSlot(child_0, Anchor)) {
|
|
111
|
+
const anchorChildren_0 = child_0.props.children;
|
|
112
|
+
if (anchorChildren_0 !== void 0 ? anchorChildren_0.type === Tooltip || isSlot(anchorChildren_0, Tooltip) : false) {
|
|
113
|
+
if (anchorChildren_0.props.children !== null) anchor.renderAnchor = (anchorProps_0) => {
|
|
114
|
+
const tooltipTrigger = anchorChildren_0.props.children;
|
|
115
|
+
const tooltipTriggerEl = /*#__PURE__*/ React.cloneElement(tooltipTrigger, mergeAnchorHandlers({ ...anchorProps_0 }, tooltipTrigger.props));
|
|
116
|
+
const tooltip = /*#__PURE__*/ React.cloneElement(anchorChildren_0, { children: tooltipTriggerEl });
|
|
117
|
+
return /*#__PURE__*/ React.cloneElement(child_0, {
|
|
118
|
+
children: tooltip,
|
|
119
|
+
ref: anchorRef
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
} else anchor.renderAnchor = (anchorProps_1) => /*#__PURE__*/ React.cloneElement(child_0, {
|
|
123
|
+
...anchorProps_1,
|
|
124
|
+
className: clsx(anchorProps_1.className, child_0.props.className)
|
|
125
|
+
});
|
|
126
|
+
return null;
|
|
127
|
+
} else if (child_0.type === MenuButton || isSlot(child_0, MenuButton)) {
|
|
128
|
+
anchor.renderAnchor = (anchorProps_2) => /*#__PURE__*/ React.cloneElement(child_0, mergeAnchorHandlers(anchorProps_2, child_0.props));
|
|
129
|
+
return null;
|
|
130
|
+
} else return child_0;
|
|
131
|
+
});
|
|
132
|
+
$[10] = anchorRef;
|
|
133
|
+
$[11] = children;
|
|
134
|
+
$[12] = anchor;
|
|
135
|
+
$[13] = t5;
|
|
136
|
+
} else {
|
|
137
|
+
anchor = $[12];
|
|
138
|
+
t5 = $[13];
|
|
139
|
+
}
|
|
140
|
+
const contents = t5;
|
|
104
141
|
const isSubmenu = parentMenuContext.isSubmenu !== void 0;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
isSubmenu
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
let t6;
|
|
143
|
+
if ($[14] !== anchor.renderAnchor || $[15] !== anchorId || $[16] !== anchorRef || $[17] !== combinedOpenState || $[18] !== isSubmenu || $[19] !== onClose || $[20] !== onOpen) {
|
|
144
|
+
t6 = {
|
|
145
|
+
anchorRef,
|
|
146
|
+
renderAnchor: anchor.renderAnchor,
|
|
147
|
+
anchorId,
|
|
148
|
+
open: combinedOpenState,
|
|
149
|
+
onOpen,
|
|
150
|
+
onClose,
|
|
151
|
+
isSubmenu
|
|
152
|
+
};
|
|
153
|
+
$[14] = anchor.renderAnchor;
|
|
154
|
+
$[15] = anchorId;
|
|
155
|
+
$[16] = anchorRef;
|
|
156
|
+
$[17] = combinedOpenState;
|
|
157
|
+
$[18] = isSubmenu;
|
|
158
|
+
$[19] = onClose;
|
|
159
|
+
$[20] = onOpen;
|
|
160
|
+
$[21] = t6;
|
|
161
|
+
} else t6 = $[21];
|
|
162
|
+
const menuContextValue = t6;
|
|
163
|
+
let t7;
|
|
164
|
+
if ($[22] !== contents || $[23] !== menuContextValue) {
|
|
165
|
+
t7 = /* @__PURE__ */ jsx(MenuContext.Provider, {
|
|
166
|
+
value: menuContextValue,
|
|
167
|
+
children: contents
|
|
168
|
+
});
|
|
169
|
+
$[22] = contents;
|
|
170
|
+
$[23] = menuContextValue;
|
|
171
|
+
$[24] = t7;
|
|
172
|
+
} else t7 = $[24];
|
|
173
|
+
return t7;
|
|
126
174
|
};
|
|
127
|
-
const Anchor = /*#__PURE__*/ React.forwardRef((
|
|
175
|
+
const Anchor = /*#__PURE__*/ React.forwardRef((t0, anchorRef) => {
|
|
176
|
+
const $ = c(17);
|
|
177
|
+
const { children: child, ...anchorProps } = t0;
|
|
128
178
|
const { onOpen, isSubmenu } = React.useContext(MenuContext);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
179
|
+
let t1;
|
|
180
|
+
if ($[0] !== isSubmenu || $[1] !== onOpen) {
|
|
181
|
+
t1 = (event) => {
|
|
182
|
+
if (isSubmenu && event.key === "ArrowRight" && !event.defaultPrevented) onOpen === null || onOpen === void 0 || onOpen("anchor-key-press");
|
|
183
|
+
};
|
|
184
|
+
$[0] = isSubmenu;
|
|
185
|
+
$[1] = onOpen;
|
|
186
|
+
$[2] = t1;
|
|
187
|
+
} else t1 = $[2];
|
|
188
|
+
const openSubmenuOnRightArrow = t1;
|
|
189
|
+
const onButtonClick = (event_0) => {
|
|
133
190
|
var _child$props$onClick, _child$props, _anchorProps$onClick;
|
|
134
|
-
(_child$props$onClick = (_child$props = child.props).onClick) === null || _child$props$onClick === void 0 || _child$props$onClick.call(_child$props,
|
|
135
|
-
(_anchorProps$onClick = anchorProps.onClick) === null || _anchorProps$onClick === void 0 || _anchorProps$onClick.call(anchorProps,
|
|
191
|
+
(_child$props$onClick = (_child$props = child.props).onClick) === null || _child$props$onClick === void 0 || _child$props$onClick.call(_child$props, event_0);
|
|
192
|
+
(_anchorProps$onClick = anchorProps.onClick) === null || _anchorProps$onClick === void 0 || _anchorProps$onClick.call(anchorProps, event_0);
|
|
136
193
|
};
|
|
137
|
-
const onButtonKeyDown = (
|
|
194
|
+
const onButtonKeyDown = (event_1) => {
|
|
138
195
|
var _child$props$onKeyDow, _child$props2, _anchorProps$onKeyDow;
|
|
139
|
-
(_child$props$onKeyDow = (_child$props2 = child.props).onKeyDown) === null || _child$props$onKeyDow === void 0 || _child$props$onKeyDow.call(_child$props2,
|
|
140
|
-
openSubmenuOnRightArrow(
|
|
141
|
-
(_anchorProps$onKeyDow = anchorProps.onKeyDown) === null || _anchorProps$onKeyDow === void 0 || _anchorProps$onKeyDow.call(anchorProps,
|
|
196
|
+
(_child$props$onKeyDow = (_child$props2 = child.props).onKeyDown) === null || _child$props$onKeyDow === void 0 || _child$props$onKeyDow.call(_child$props2, event_1);
|
|
197
|
+
openSubmenuOnRightArrow(event_1);
|
|
198
|
+
(_anchorProps$onKeyDow = anchorProps.onKeyDown) === null || _anchorProps$onKeyDow === void 0 || _anchorProps$onKeyDow.call(anchorProps, event_1);
|
|
142
199
|
};
|
|
143
200
|
const parentActionListContext = useContext(ActionListContainerContext);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
201
|
+
let t2;
|
|
202
|
+
if ($[3] !== isSubmenu || $[4] !== onOpen || $[5] !== parentActionListContext) {
|
|
203
|
+
t2 = isSubmenu ? {
|
|
204
|
+
...parentActionListContext,
|
|
205
|
+
defaultTrailingVisual: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
206
|
+
afterSelect: () => onOpen === null || onOpen === void 0 ? void 0 : onOpen("anchor-click")
|
|
207
|
+
} : parentActionListContext;
|
|
208
|
+
$[3] = isSubmenu;
|
|
209
|
+
$[4] = onOpen;
|
|
210
|
+
$[5] = parentActionListContext;
|
|
211
|
+
$[6] = t2;
|
|
212
|
+
} else t2 = $[6];
|
|
213
|
+
const thisActionListContext = t2;
|
|
214
|
+
const t3 = ActionListContainerContext;
|
|
215
|
+
const t4 = clsx(anchorProps.className, child.props.className);
|
|
216
|
+
let t5;
|
|
217
|
+
if ($[7] !== anchorProps || $[8] !== anchorRef || $[9] !== onButtonClick || $[10] !== onButtonKeyDown || $[11] !== t4) {
|
|
218
|
+
t5 = {
|
|
156
219
|
...anchorProps,
|
|
157
220
|
ref: anchorRef,
|
|
158
|
-
className:
|
|
221
|
+
className: t4,
|
|
159
222
|
onClick: onButtonClick,
|
|
160
223
|
onKeyDown: onButtonKeyDown
|
|
161
|
-
}
|
|
162
|
-
|
|
224
|
+
};
|
|
225
|
+
$[7] = anchorProps;
|
|
226
|
+
$[8] = anchorRef;
|
|
227
|
+
$[9] = onButtonClick;
|
|
228
|
+
$[10] = onButtonKeyDown;
|
|
229
|
+
$[11] = t4;
|
|
230
|
+
$[12] = t5;
|
|
231
|
+
} else t5 = $[12];
|
|
232
|
+
const t6 = /*#__PURE__*/ React.cloneElement(child, t5);
|
|
233
|
+
let t7;
|
|
234
|
+
if ($[13] !== t3.Provider || $[14] !== t6 || $[15] !== thisActionListContext) {
|
|
235
|
+
t7 = /* @__PURE__ */ jsx(t3.Provider, {
|
|
236
|
+
value: thisActionListContext,
|
|
237
|
+
children: t6
|
|
238
|
+
});
|
|
239
|
+
$[13] = t3.Provider;
|
|
240
|
+
$[14] = t6;
|
|
241
|
+
$[15] = thisActionListContext;
|
|
242
|
+
$[16] = t7;
|
|
243
|
+
} else t7 = $[16];
|
|
244
|
+
return t7;
|
|
163
245
|
});
|
|
164
|
-
const MenuButton = /*#__PURE__*/ React.forwardRef((
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
246
|
+
const MenuButton = /*#__PURE__*/ React.forwardRef((t0, anchorRef) => {
|
|
247
|
+
const $ = c(7);
|
|
248
|
+
let props;
|
|
249
|
+
if ($[0] !== t0) {
|
|
250
|
+
({...props} = t0);
|
|
251
|
+
$[0] = t0;
|
|
252
|
+
$[1] = props;
|
|
253
|
+
} else props = $[1];
|
|
254
|
+
let t1;
|
|
255
|
+
if ($[2] !== props) {
|
|
256
|
+
t1 = /* @__PURE__ */ jsx(ButtonComponent, {
|
|
168
257
|
"data-component": "ActionMenu.Button",
|
|
169
258
|
type: "button",
|
|
170
259
|
trailingAction: TriangleDownIcon,
|
|
171
260
|
...props
|
|
172
|
-
})
|
|
173
|
-
|
|
261
|
+
});
|
|
262
|
+
$[2] = props;
|
|
263
|
+
$[3] = t1;
|
|
264
|
+
} else t1 = $[3];
|
|
265
|
+
let t2;
|
|
266
|
+
if ($[4] !== anchorRef || $[5] !== t1) {
|
|
267
|
+
t2 = /* @__PURE__ */ jsx(Anchor, {
|
|
268
|
+
ref: anchorRef,
|
|
269
|
+
children: t1
|
|
270
|
+
});
|
|
271
|
+
$[4] = anchorRef;
|
|
272
|
+
$[5] = t1;
|
|
273
|
+
$[6] = t2;
|
|
274
|
+
} else t2 = $[6];
|
|
275
|
+
return t2;
|
|
174
276
|
});
|
|
175
277
|
const defaultVariant = {
|
|
176
278
|
regular: "anchored",
|
|
177
279
|
narrow: "anchored"
|
|
178
280
|
};
|
|
179
|
-
const Overlay = (
|
|
180
|
-
const
|
|
281
|
+
const Overlay = (t0) => {
|
|
282
|
+
const $ = c(55);
|
|
283
|
+
let ariaLabelledby;
|
|
284
|
+
let children;
|
|
285
|
+
let displayInViewport;
|
|
286
|
+
let onPositionChange;
|
|
287
|
+
let overlayProps;
|
|
288
|
+
let side;
|
|
289
|
+
let t1;
|
|
290
|
+
let t2;
|
|
291
|
+
if ($[0] !== t0) {
|
|
292
|
+
({children, align: t1, side, onPositionChange, displayInViewport, "aria-labelledby": ariaLabelledby, variant: t2, ...overlayProps} = t0);
|
|
293
|
+
$[0] = t0;
|
|
294
|
+
$[1] = ariaLabelledby;
|
|
295
|
+
$[2] = children;
|
|
296
|
+
$[3] = displayInViewport;
|
|
297
|
+
$[4] = onPositionChange;
|
|
298
|
+
$[5] = overlayProps;
|
|
299
|
+
$[6] = side;
|
|
300
|
+
$[7] = t1;
|
|
301
|
+
$[8] = t2;
|
|
302
|
+
} else {
|
|
303
|
+
ariaLabelledby = $[1];
|
|
304
|
+
children = $[2];
|
|
305
|
+
displayInViewport = $[3];
|
|
306
|
+
onPositionChange = $[4];
|
|
307
|
+
overlayProps = $[5];
|
|
308
|
+
side = $[6];
|
|
309
|
+
t1 = $[7];
|
|
310
|
+
t2 = $[8];
|
|
311
|
+
}
|
|
312
|
+
const align = t1 === void 0 ? "start" : t1;
|
|
313
|
+
const variant = t2 === void 0 ? defaultVariant : t2;
|
|
314
|
+
const { anchorRef, renderAnchor, anchorId, open, onOpen, onClose, isSubmenu: t3 } = React.useContext(MenuContext);
|
|
315
|
+
const isSubmenu = t3 === void 0 ? false : t3;
|
|
181
316
|
const containerRef = React.useRef(null);
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
317
|
+
let t4;
|
|
318
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
319
|
+
t4 = { narrow: true };
|
|
320
|
+
$[9] = t4;
|
|
321
|
+
} else t4 = $[9];
|
|
322
|
+
const isNarrowFullscreen = !!useResponsiveValue(t4, false) && variant.narrow === "fullscreen";
|
|
323
|
+
let t5;
|
|
324
|
+
if ($[10] !== isNarrowFullscreen || $[11] !== onClose) {
|
|
325
|
+
t5 = (gesture) => {
|
|
326
|
+
if (isNarrowFullscreen && gesture === "tab") return;
|
|
327
|
+
onClose === null || onClose === void 0 || onClose(gesture);
|
|
328
|
+
};
|
|
329
|
+
$[10] = isNarrowFullscreen;
|
|
330
|
+
$[11] = onClose;
|
|
331
|
+
$[12] = t5;
|
|
332
|
+
} else t5 = $[12];
|
|
333
|
+
const handleClose = t5;
|
|
187
334
|
const [anchorLabelReady, setAnchorLabelReady] = useState(false);
|
|
188
335
|
if (!open && anchorLabelReady) setAnchorLabelReady(false);
|
|
189
336
|
useMenuKeyboardNavigation(open && anchorLabelReady, handleClose, containerRef, anchorRef, isSubmenu);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
337
|
+
let t6;
|
|
338
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
339
|
+
t6 = {
|
|
340
|
+
regular: "anchored",
|
|
341
|
+
narrow: "anchored"
|
|
342
|
+
};
|
|
343
|
+
$[13] = t6;
|
|
344
|
+
} else t6 = $[13];
|
|
345
|
+
const responsiveVariant = useResponsiveValue(variant, t6);
|
|
194
346
|
const [anchorAriaLabelledby, setAnchorAriaLabelledby] = useState(null);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
])
|
|
347
|
+
let t7;
|
|
348
|
+
let t8;
|
|
349
|
+
if ($[14] !== anchorRef || $[15] !== open) {
|
|
350
|
+
t7 = () => {
|
|
351
|
+
if (open) {
|
|
352
|
+
var _anchorRef$current$ge, _anchorRef$current;
|
|
353
|
+
setAnchorAriaLabelledby((_anchorRef$current$ge = (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 ? void 0 : _anchorRef$current.getAttribute("aria-labelledby")) !== null && _anchorRef$current$ge !== void 0 ? _anchorRef$current$ge : null);
|
|
354
|
+
setAnchorLabelReady(true);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
t8 = [anchorRef, open];
|
|
358
|
+
$[14] = anchorRef;
|
|
359
|
+
$[15] = open;
|
|
360
|
+
$[16] = t7;
|
|
361
|
+
$[17] = t8;
|
|
362
|
+
} else {
|
|
363
|
+
t7 = $[16];
|
|
364
|
+
t8 = $[17];
|
|
365
|
+
}
|
|
366
|
+
useIsomorphicLayoutEffect(t7, t8);
|
|
367
|
+
let t9;
|
|
368
|
+
if ($[18] !== onClose) {
|
|
369
|
+
t9 = () => onClose === null || onClose === void 0 ? void 0 : onClose("item-select");
|
|
370
|
+
$[18] = onClose;
|
|
371
|
+
$[19] = t9;
|
|
372
|
+
} else t9 = $[19];
|
|
373
|
+
const afterSelect = t9;
|
|
374
|
+
const t10 = ariaLabelledby || anchorAriaLabelledby || anchorId;
|
|
375
|
+
let t11;
|
|
376
|
+
if ($[20] !== afterSelect || $[21] !== isNarrowFullscreen || $[22] !== t10) {
|
|
377
|
+
t11 = {
|
|
378
|
+
container: "ActionMenu",
|
|
379
|
+
listRole: "menu",
|
|
380
|
+
listLabelledBy: t10,
|
|
381
|
+
selectionAttribute: "aria-checked",
|
|
382
|
+
afterSelect,
|
|
383
|
+
enableFocusZone: isNarrowFullscreen
|
|
384
|
+
};
|
|
385
|
+
$[20] = afterSelect;
|
|
386
|
+
$[21] = isNarrowFullscreen;
|
|
387
|
+
$[22] = t10;
|
|
388
|
+
$[23] = t11;
|
|
389
|
+
} else t11 = $[23];
|
|
390
|
+
const overlayContextValue = t11;
|
|
217
391
|
const isInsideDialog = useContext(DialogContext) !== void 0;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
onOpen,
|
|
224
|
-
onClose: handleClose,
|
|
225
|
-
align,
|
|
226
|
-
side: side !== null && side !== void 0 ? side : isSubmenu ? "outside-right" : "outside-bottom",
|
|
227
|
-
overlayProps: {
|
|
392
|
+
const t12 = open && anchorLabelReady;
|
|
393
|
+
const t13 = side !== null && side !== void 0 ? side : isSubmenu ? "outside-right" : "outside-bottom";
|
|
394
|
+
let t14;
|
|
395
|
+
if ($[24] !== overlayProps) {
|
|
396
|
+
t14 = {
|
|
228
397
|
...overlayProps,
|
|
229
398
|
"data-component": "ActionMenu.Overlay"
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
399
|
+
};
|
|
400
|
+
$[24] = overlayProps;
|
|
401
|
+
$[25] = t14;
|
|
402
|
+
} else t14 = $[25];
|
|
403
|
+
let t15;
|
|
404
|
+
if ($[26] !== isNarrowFullscreen) {
|
|
405
|
+
t15 = isNarrowFullscreen ? { disabled: true } : { focusOutBehavior: "wrap" };
|
|
406
|
+
$[26] = isNarrowFullscreen;
|
|
407
|
+
$[27] = t15;
|
|
408
|
+
} else t15 = $[27];
|
|
409
|
+
const t16 = displayInViewport !== void 0 ? displayInViewport : isInsideDialog;
|
|
410
|
+
let t17;
|
|
411
|
+
if ($[28] !== overlayProps.overflow) {
|
|
412
|
+
t17 = overlayProps.overflow ? { [`data-overflow-${overlayProps.overflow}`]: "" } : {};
|
|
413
|
+
$[28] = overlayProps.overflow;
|
|
414
|
+
$[29] = t17;
|
|
415
|
+
} else t17 = $[29];
|
|
416
|
+
let t18;
|
|
417
|
+
if ($[30] !== overlayProps.maxHeight) {
|
|
418
|
+
t18 = overlayProps.maxHeight ? { [`data-max-height-${overlayProps.maxHeight}`]: "" } : {};
|
|
419
|
+
$[30] = overlayProps.maxHeight;
|
|
420
|
+
$[31] = t18;
|
|
421
|
+
} else t18 = $[31];
|
|
422
|
+
let t19;
|
|
423
|
+
if ($[32] !== children || $[33] !== overlayContextValue) {
|
|
424
|
+
t19 = /* @__PURE__ */ jsx(ActionListContainerContext.Provider, {
|
|
425
|
+
value: overlayContextValue,
|
|
426
|
+
children
|
|
427
|
+
});
|
|
428
|
+
$[32] = children;
|
|
429
|
+
$[33] = overlayContextValue;
|
|
430
|
+
$[34] = t19;
|
|
431
|
+
} else t19 = $[34];
|
|
432
|
+
let t20;
|
|
433
|
+
if ($[35] !== responsiveVariant || $[36] !== t17 || $[37] !== t18 || $[38] !== t19) {
|
|
434
|
+
t20 = /* @__PURE__ */ jsx("div", {
|
|
236
435
|
ref: containerRef,
|
|
237
436
|
className: ActionMenu_module_css_default.ActionMenuContainer,
|
|
238
437
|
"data-variant": responsiveVariant,
|
|
239
|
-
...
|
|
240
|
-
...
|
|
241
|
-
children:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
438
|
+
...t17,
|
|
439
|
+
...t18,
|
|
440
|
+
children: t19
|
|
441
|
+
});
|
|
442
|
+
$[35] = responsiveVariant;
|
|
443
|
+
$[36] = t17;
|
|
444
|
+
$[37] = t18;
|
|
445
|
+
$[38] = t19;
|
|
446
|
+
$[39] = t20;
|
|
447
|
+
} else t20 = $[39];
|
|
448
|
+
let t21;
|
|
449
|
+
if ($[40] !== align || $[41] !== anchorId || $[42] !== anchorRef || $[43] !== handleClose || $[44] !== onOpen || $[45] !== onPositionChange || $[46] !== renderAnchor || $[47] !== t12 || $[48] !== t13 || $[49] !== t14 || $[50] !== t15 || $[51] !== t16 || $[52] !== t20 || $[53] !== variant) {
|
|
450
|
+
t21 = /* @__PURE__ */ jsx(AnchoredOverlay, {
|
|
451
|
+
anchorRef,
|
|
452
|
+
renderAnchor,
|
|
453
|
+
anchorId,
|
|
454
|
+
open: t12,
|
|
455
|
+
onOpen,
|
|
456
|
+
onClose: handleClose,
|
|
457
|
+
align,
|
|
458
|
+
side: t13,
|
|
459
|
+
overlayProps: t14,
|
|
460
|
+
focusZoneSettings: t15,
|
|
461
|
+
onPositionChange,
|
|
462
|
+
variant,
|
|
463
|
+
displayInViewport: t16,
|
|
464
|
+
children: t20
|
|
465
|
+
});
|
|
466
|
+
$[40] = align;
|
|
467
|
+
$[41] = anchorId;
|
|
468
|
+
$[42] = anchorRef;
|
|
469
|
+
$[43] = handleClose;
|
|
470
|
+
$[44] = onOpen;
|
|
471
|
+
$[45] = onPositionChange;
|
|
472
|
+
$[46] = renderAnchor;
|
|
473
|
+
$[47] = t12;
|
|
474
|
+
$[48] = t13;
|
|
475
|
+
$[49] = t14;
|
|
476
|
+
$[50] = t15;
|
|
477
|
+
$[51] = t16;
|
|
478
|
+
$[52] = t20;
|
|
479
|
+
$[53] = variant;
|
|
480
|
+
$[54] = t21;
|
|
481
|
+
} else t21 = $[54];
|
|
482
|
+
return t21;
|
|
247
483
|
};
|
|
248
484
|
Menu.displayName = "ActionMenu";
|
|
249
485
|
MenuButton.__SLOT__ = Symbol("ActionMenu.Button");
|
|
@@ -255,5 +491,8 @@ const ActionMenu = Object.assign(Menu, {
|
|
|
255
491
|
Overlay,
|
|
256
492
|
Divider
|
|
257
493
|
});
|
|
494
|
+
function _temp(child) {
|
|
495
|
+
return /*#__PURE__*/ React.isValidElement(child) && (child.type === MenuButton || child.type === Anchor || isSlot(child, Anchor) || isSlot(child, MenuButton));
|
|
496
|
+
}
|
|
258
497
|
//#endregion
|
|
259
498
|
export { ActionMenu };
|
|
@@ -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 };
|
package/dist/Pagination/model.js
CHANGED
|
@@ -10,11 +10,11 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
10
10
|
num: currentPage + 1,
|
|
11
11
|
disabled: currentPage === pageCount
|
|
12
12
|
};
|
|
13
|
-
if (!showPages) return [prev, next];
|
|
14
13
|
if (pageCount <= 0) return [prev, {
|
|
15
14
|
...next,
|
|
16
15
|
disabled: true
|
|
17
16
|
}];
|
|
17
|
+
if (!showPages) return [prev, next];
|
|
18
18
|
const pages = [];
|
|
19
19
|
const standardGap = surroundingPageCount + marginPageCount;
|
|
20
20
|
if (pageCount <= standardGap + standardGap + 3) {
|
|
@@ -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