@primer/react 38.45.0-rc.3d36dffa3 → 38.45.0-rc.72a855661
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
CHANGED
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
- [#8612](https://github.com/primer/react/pull/8612) [`9cd1f8a`](https://github.com/primer/react/commit/9cd1f8ae897b8db44434474b937fda39f57f15f9) Thanks [@alexus37](https://github.com/alexus37)! - ActionBar, UnderlineNav: Batch descendant registry updates to reduce cascading renders during rapid item changes
|
|
12
12
|
|
|
13
|
-
- [#8634](https://github.com/primer/react/pull/8634) [`62d32c9`](https://github.com/primer/react/commit/62d32c94ac730847a4557441b65a6a48334201a3) Thanks [@HadrielWonda](https://github.com/HadrielWonda)! - FilteredActionList: Only reference the list from the filter input while the list is rendered, so `aria-controls` never points at a missing element during body loading or when a message is shown
|
|
14
|
-
|
|
15
13
|
- [#8638](https://github.com/primer/react/pull/8638) [`4b1cc1d`](https://github.com/primer/react/commit/4b1cc1d863209aa9aaf9f6ab47ae25b86de5c1e1) Thanks [@joshblack](https://github.com/joshblack)! - Polymorphic components: Fix TypeScript inference for component-specific props while preserving `as` support.
|
|
16
14
|
|
|
17
15
|
- [#8611](https://github.com/primer/react/pull/8611) [`68a5c0b`](https://github.com/primer/react/commit/68a5c0b18c800b8f6f6555f9d4d327c48389ae06) Thanks [@alexus37](https://github.com/alexus37)! - ActionMenu: Avoid an extra render when closed menus mount while preserving accessible trigger labeling
|
|
@@ -26,7 +26,6 @@ const menuScrollMargins = {
|
|
|
26
26
|
endMargin: 8
|
|
27
27
|
};
|
|
28
28
|
function FilteredActionList({ loading = false, placeholderText, filterValue: externalFilterValue, loadingType = FilteredActionListLoadingTypes.bodySpinner, onFilterChange, onListContainerRefChanged, onInputRefChanged, items, textInputProps, inputRef: providedInputRef, scrollContainerRef: providedScrollContainerRef, groupMetadata, showItemDividers, message, messageText, className, selectionVariant, announcementsEnabled = true, fullScreenOnNarrow, onSelectAllChange, actionListProps, focusOutBehavior = "wrap", _PrivateFocusManagement = "active-descendant", onActiveDescendantChanged, disableSelectOnHover = false, setInitialFocus = false, focusPrependedElements, scrollBehavior, virtualized = false, ...listProps }) {
|
|
29
|
-
var _readScrollContainerR;
|
|
30
29
|
if (virtualized && groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) console.warn("FilteredActionList: `virtualized` has no effect when `groupMetadata` is provided. Grouped lists are rendered without virtualization.");
|
|
31
30
|
const isVirtualized = virtualized && !(groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length);
|
|
32
31
|
const [filterValue, setInternalFilterValue] = useProvidedStateOrCreate(externalFilterValue, void 0, "");
|
|
@@ -208,13 +207,10 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
208
207
|
const handleSelectAllChange = useCallback((e) => {
|
|
209
208
|
if (onSelectAllChange) onSelectAllChange(e.target.checked);
|
|
210
209
|
}, [onSelectAllChange]);
|
|
211
|
-
const bodyLoaderHeight = loading && loadingType.appearsInBody ? (_readScrollContainerR = readScrollContainerRef.current) === null || _readScrollContainerR === void 0 ? void 0 : _readScrollContainerR.clientHeight : void 0;
|
|
212
|
-
const showBodyLoader = bodyLoaderHeight !== void 0;
|
|
213
|
-
const isListRendered = !showBodyLoader && !message;
|
|
214
210
|
function getBodyContent() {
|
|
215
|
-
if (
|
|
211
|
+
if (loading && readScrollContainerRef.current && loadingType.appearsInBody) return /* @__PURE__ */ jsx(FilteredActionListBodyLoader, {
|
|
216
212
|
loadingType,
|
|
217
|
-
height:
|
|
213
|
+
height: readScrollContainerRef.current.clientHeight
|
|
218
214
|
});
|
|
219
215
|
if (message) return message;
|
|
220
216
|
let firstGroupIndex = 0;
|
|
@@ -313,7 +309,7 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
313
309
|
onInputKeyPress,
|
|
314
310
|
onInputKeyDown: usingRovingTabindex ? onInputKeyDown : void 0,
|
|
315
311
|
placeholderText,
|
|
316
|
-
listId
|
|
312
|
+
listId,
|
|
317
313
|
inputDescriptionTextId,
|
|
318
314
|
loading: loading && !loadingType.appearsInBody,
|
|
319
315
|
fullScreenOnNarrow,
|
|
@@ -9,8 +9,7 @@ interface FilteredActionListInputProps extends Partial<Omit<TextInputProps, 'onC
|
|
|
9
9
|
onInputKeyPress?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
10
10
|
onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
11
11
|
placeholderText?: string;
|
|
12
|
-
|
|
13
|
-
listId?: string;
|
|
12
|
+
listId: string;
|
|
14
13
|
inputDescriptionTextId: string;
|
|
15
14
|
loading: boolean;
|
|
16
15
|
fullScreenOnNarrow?: boolean;
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
//#region src/FilteredActionList/FilteredActionListInput.tsx
|
|
7
7
|
function FilteredActionListInput(t0) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(34);
|
|
9
9
|
let className;
|
|
10
10
|
let fullScreenOnNarrow;
|
|
11
11
|
let inputDescriptionTextId;
|
|
@@ -64,17 +64,16 @@ function FilteredActionListInput(t0) {
|
|
|
64
64
|
$[16] = onInputFocus;
|
|
65
65
|
$[17] = t1;
|
|
66
66
|
} else t1 = $[17];
|
|
67
|
-
|
|
68
|
-
let t3;
|
|
67
|
+
let t2;
|
|
69
68
|
if ($[18] !== className || $[19] !== fullScreenOnNarrow) {
|
|
70
|
-
|
|
69
|
+
t2 = clsx(className, { [FilteredActionList_module_css_default.FullScreenTextInput]: fullScreenOnNarrow });
|
|
71
70
|
$[18] = className;
|
|
72
71
|
$[19] = fullScreenOnNarrow;
|
|
73
|
-
$[20] =
|
|
74
|
-
} else
|
|
75
|
-
let
|
|
76
|
-
if ($[21] !== inputDescriptionTextId || $[22] !== inputRef || $[23] !== listId || $[24] !== loading || $[25] !== onInputChange || $[26] !== onInputKeyDown || $[27] !== onInputKeyPress || $[28] !== placeholderText || $[29] !== restTextInputProps || $[30] !== t1 || $[31] !== t2 || $[32] !==
|
|
77
|
-
|
|
72
|
+
$[20] = t2;
|
|
73
|
+
} else t2 = $[20];
|
|
74
|
+
let t3;
|
|
75
|
+
if ($[21] !== inputDescriptionTextId || $[22] !== inputRef || $[23] !== listId || $[24] !== loading || $[25] !== onInputChange || $[26] !== onInputKeyDown || $[27] !== onInputKeyPress || $[28] !== placeholderText || $[29] !== restTextInputProps || $[30] !== t1 || $[31] !== t2 || $[32] !== value) {
|
|
76
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
78
77
|
className: FilteredActionList_module_css_default.Header,
|
|
79
78
|
"data-component": "FilteredActionList.Header",
|
|
80
79
|
children: /* @__PURE__ */ jsx(TextInput_default, {
|
|
@@ -89,14 +88,14 @@ function FilteredActionListInput(t0) {
|
|
|
89
88
|
onKeyDown: onInputKeyDown,
|
|
90
89
|
placeholder: placeholderText,
|
|
91
90
|
role: "combobox",
|
|
92
|
-
"aria-expanded":
|
|
91
|
+
"aria-expanded": "true",
|
|
93
92
|
"aria-autocomplete": "list",
|
|
94
93
|
"aria-controls": listId,
|
|
95
94
|
"aria-label": placeholderText,
|
|
96
95
|
"aria-describedby": inputDescriptionTextId,
|
|
97
96
|
loaderPosition: "leading",
|
|
98
97
|
loading,
|
|
99
|
-
className:
|
|
98
|
+
className: t2,
|
|
100
99
|
...restTextInputProps
|
|
101
100
|
})
|
|
102
101
|
});
|
|
@@ -111,11 +110,10 @@ function FilteredActionListInput(t0) {
|
|
|
111
110
|
$[29] = restTextInputProps;
|
|
112
111
|
$[30] = t1;
|
|
113
112
|
$[31] = t2;
|
|
114
|
-
$[32] =
|
|
115
|
-
$[33] =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return t4;
|
|
113
|
+
$[32] = value;
|
|
114
|
+
$[33] = t3;
|
|
115
|
+
} else t3 = $[33];
|
|
116
|
+
return t3;
|
|
119
117
|
}
|
|
120
118
|
//#endregion
|
|
121
119
|
export { FilteredActionListInput };
|
package/package.json
CHANGED