@eqtylab/equality 4.3.1 → 4.3.2
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 +9 -0
- package/dist/index.cjs +27 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to Equality are recorded here, following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
4
4
|
|
|
5
|
+
## 4.3.2 - 2026-09-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `FilterDropdown`'s "Clear all" no longer closes the menu. Focus moves to the search box,
|
|
10
|
+
or to the menu without search, instead of falling out to an enclosing dialog.
|
|
11
|
+
- A searchable `Select` keeps the side it opened on while searching. A query that shrank
|
|
12
|
+
the list flipped it to the other side, where it stayed, capped to that side's space.
|
|
13
|
+
|
|
5
14
|
## 4.3.1 - 2026-09-24
|
|
6
15
|
|
|
7
16
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -2349,9 +2349,15 @@ var FilterDropdown = ({
|
|
|
2349
2349
|
const filteredOptions = options.filter(
|
|
2350
2350
|
(option) => option.value && option.value.trim() !== "" && option.label && option.label.trim() !== ""
|
|
2351
2351
|
);
|
|
2352
|
+
const handleClearAll = (event) => {
|
|
2353
|
+
event.preventDefault();
|
|
2354
|
+
const menu = event.currentTarget.closest('[role="menu"]');
|
|
2355
|
+
(menu?.querySelector("[data-dropdown-search]") ?? menu)?.focus();
|
|
2356
|
+
onClearAll();
|
|
2357
|
+
};
|
|
2352
2358
|
const clearAll = (className) => (
|
|
2353
2359
|
// An empty textValue keeps this out of search results, so Enter can't clear every filter
|
|
2354
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { textValue: "", onSelect:
|
|
2360
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { textValue: "", onSelect: handleClearAll, className, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: buttonVariants({ variant: "link", size: "sm" }), children: "Clear all" }) })
|
|
2355
2361
|
);
|
|
2356
2362
|
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
|
|
2357
2363
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2770,22 +2776,26 @@ var Select = ({
|
|
|
2770
2776
|
interactedRef.current = true;
|
|
2771
2777
|
}, []);
|
|
2772
2778
|
const interactedSinceOpen = React15__namespace.useCallback(() => interactedRef.current, []);
|
|
2779
|
+
const [lockedSide, setLockedSide] = React15__namespace.useState();
|
|
2773
2780
|
React15__namespace.useEffect(() => {
|
|
2774
|
-
if (open)
|
|
2781
|
+
if (!open) return;
|
|
2782
|
+
interactedRef.current = false;
|
|
2783
|
+
setLockedSide(void 0);
|
|
2775
2784
|
}, [open]);
|
|
2776
2785
|
const handleOpenChange = React15__namespace.useCallback(
|
|
2777
2786
|
(nextOpen) => {
|
|
2778
2787
|
if (nextOpen) {
|
|
2779
2788
|
resetForOpen();
|
|
2780
2789
|
interactedRef.current = false;
|
|
2790
|
+
setLockedSide(void 0);
|
|
2781
2791
|
}
|
|
2782
2792
|
onOpenChange?.(nextOpen);
|
|
2783
2793
|
},
|
|
2784
2794
|
[onOpenChange, resetForOpen]
|
|
2785
2795
|
);
|
|
2786
2796
|
const value = React15__namespace.useMemo(
|
|
2787
|
-
() => ({ ...search, markInteracted, interactedSinceOpen }),
|
|
2788
|
-
[search, markInteracted, interactedSinceOpen]
|
|
2797
|
+
() => ({ ...search, markInteracted, interactedSinceOpen, lockedSide, lockSide: setLockedSide }),
|
|
2798
|
+
[search, markInteracted, interactedSinceOpen, lockedSide]
|
|
2789
2799
|
);
|
|
2790
2800
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectSearchContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Root, { open, onOpenChange: handleOpenChange, ...props }) });
|
|
2791
2801
|
};
|
|
@@ -2845,19 +2855,30 @@ var SelectContent = React15__namespace.forwardRef(
|
|
|
2845
2855
|
onKeyDownCapture,
|
|
2846
2856
|
onPointerMoveCapture,
|
|
2847
2857
|
onFocus,
|
|
2858
|
+
side,
|
|
2859
|
+
avoidCollisions,
|
|
2848
2860
|
...props
|
|
2849
2861
|
}, ref) => {
|
|
2850
2862
|
const ctx = useSelectSearch();
|
|
2851
2863
|
const setListId = ctx?.setListId;
|
|
2852
2864
|
const searching = isSearchActive(ctx);
|
|
2853
2865
|
const resultCount = ctx?.matchCount ?? 0;
|
|
2866
|
+
const contentRef = React15__namespace.useRef(null);
|
|
2867
|
+
const lockedSide = ctx?.lockedSide;
|
|
2868
|
+
const lockSide = ctx?.lockSide;
|
|
2854
2869
|
const composedContentRef = React15__namespace.useCallback(
|
|
2855
2870
|
(node) => {
|
|
2856
2871
|
assignRefs(node, ref);
|
|
2872
|
+
contentRef.current = node;
|
|
2857
2873
|
setListId?.(node?.id || void 0);
|
|
2858
2874
|
},
|
|
2859
2875
|
[ref, setListId]
|
|
2860
2876
|
);
|
|
2877
|
+
React15__namespace.useEffect(() => {
|
|
2878
|
+
if (position !== "popper" || !searching || lockedSide) return;
|
|
2879
|
+
const placed = contentRef.current?.dataset.side;
|
|
2880
|
+
if (placed) lockSide?.(placed);
|
|
2881
|
+
}, [position, searching, lockedSide, lockSide]);
|
|
2861
2882
|
const handleFocus = (event) => {
|
|
2862
2883
|
onFocus?.(event);
|
|
2863
2884
|
if (!ctx?.enabled || !ctx.visible || ctx.interactedSinceOpen()) return;
|
|
@@ -2903,6 +2924,8 @@ var SelectContent = React15__namespace.forwardRef(
|
|
|
2903
2924
|
className
|
|
2904
2925
|
),
|
|
2905
2926
|
position,
|
|
2927
|
+
side: lockedSide ?? side,
|
|
2928
|
+
avoidCollisions: lockedSide ? false : avoidCollisions,
|
|
2906
2929
|
onFocus: handleFocus,
|
|
2907
2930
|
onKeyDown: handleKeyDown,
|
|
2908
2931
|
onKeyDownCapture: (event) => {
|