@rpcbase/ui 0.245.0 → 0.246.0
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/dist/index149.js +5 -14
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +63 -63
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -38
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +385 -13
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +261 -23
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +58 -109
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +47 -13
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +169 -4
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +110 -4
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +25 -5
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +8 -12
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +4 -19
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +6 -11
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -176
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +476 -268
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +189 -4
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +14 -28
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +105 -124
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +262 -63
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +6 -8
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +40 -15
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +4 -30
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +14 -69
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +68 -5
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +35 -66
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +14 -2
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +22 -384
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +108 -258
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +13 -61
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +4 -46
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -170
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +5 -110
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +11 -24
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +20 -8
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +11 -5
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +176 -5
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +279 -4
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +4 -487
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +27 -189
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +126 -13
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +63 -107
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +8 -262
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +16 -7
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +29 -39
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +69 -4
- package/dist/index193.js.map +1 -1
- package/dist/index254.js +20 -67
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +66 -8
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +6 -11
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -8
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +11 -5
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +3 -13
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +50 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +4 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +27 -97
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +15 -16
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +5 -29
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +21 -51
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +53 -5
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +20 -5
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +39 -59
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +36 -63
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +46 -134
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +19 -7
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +71 -5
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +18 -4
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +3 -11
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +11 -21
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +13 -16
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +17 -10
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +37 -8
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +237 -142
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +1 -1
- package/dist/index280.js +249 -76
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +68 -61
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +100 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +84 -20
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +3 -6
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +29 -11
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -3
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +34 -50
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +16 -15
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +3 -21
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +1 -1
- package/dist/index290.js +26 -53
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +28 -20
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -42
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +73 -34
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +273 -46
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +11 -20
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +11 -71
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +25 -17
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +16 -3
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +124 -12
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +5 -18
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +64 -35
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -240
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7 -252
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -68
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +3 -83
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +7 -29
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +133 -16
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +397 -32
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +5 -18
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +52 -3
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +11 -26
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +25 -26
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +12 -4
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +151 -75
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +30 -270
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +11 -11
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +50 -11
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +8 -24
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +11 -16
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +42 -124
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +97 -5
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +82 -61
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +104 -12
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +52 -7
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +11 -5
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +4 -3
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +37 -10
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +8 -7
- package/dist/index329.js.map +1 -1
- package/dist/index33.js +2 -2
- package/dist/index330.js +121 -385
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +18 -5
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +14 -51
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +3 -11
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +34 -25
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +20 -11
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +9 -154
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +8 -32
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +24 -11
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +25 -46
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +5 -5
- package/dist/index340.js +16 -9
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +8 -11
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +11 -43
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +7 -96
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +11 -84
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +3 -105
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +3 -52
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +16 -10
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +51 -4
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +5 -37
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +11 -11
- package/dist/index350.js +61 -8
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +61 -130
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +8 -17
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +5 -16
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +11 -3
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +19 -34
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +16 -20
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +8 -10
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +144 -8
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +77 -22
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +3 -3
- package/dist/index360.js +61 -28
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +15 -17
- package/dist/index361.js.map +1 -1
- package/dist/index365.js +11 -8
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +4 -27
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +5 -137
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +3 -13
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +20 -46
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +4 -4
- package/dist/index370.js +45 -4
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +17 -21
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +4 -75
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +200 -11
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +73 -3
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +122 -72
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +4 -200
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +20 -71
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +8 -35
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +27 -7
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +5 -5
- package/dist/index380.js +136 -14
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +10 -121
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +47 -4
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +3 -11
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +21 -5
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +76 -3
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +12 -21
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +4 -45
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +70 -16
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +36 -5
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +3 -3
- package/dist/index390.js +7 -5
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +15 -20
- package/dist/index391.js.map +1 -1
- package/dist/index40.js +10 -10
- package/dist/index409.js +3 -3
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +3 -15
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +3 -492
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +15 -3
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +492 -3
- package/dist/index413.js.map +1 -1
- package/dist/index417.js +1 -1
- package/dist/index419.js +1 -1
- package/dist/index420.js +2 -2
- package/dist/index421.js +7 -32
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +2 -8
- package/dist/index422.js.map +1 -1
- package/dist/index423.js +44 -2
- package/dist/index423.js.map +1 -1
- package/dist/index424.js +52 -40
- package/dist/index424.js.map +1 -1
- package/dist/index425.js +7 -55
- package/dist/index425.js.map +1 -1
- package/dist/index426.js +2 -8
- package/dist/index426.js.map +1 -1
- package/dist/index427.js +55 -2
- package/dist/index427.js.map +1 -1
- package/dist/index428.js +53 -52
- package/dist/index428.js.map +1 -1
- package/dist/index429.js +32 -55
- package/dist/index429.js.map +1 -1
- package/dist/index430.js +2 -16
- package/dist/index430.js.map +1 -1
- package/dist/index431.js +2 -29
- package/dist/index431.js.map +1 -1
- package/dist/index432.js +2 -13
- package/dist/index432.js.map +1 -1
- package/dist/index433.js +2 -7
- package/dist/index433.js.map +1 -1
- package/dist/index434.js +16 -2
- package/dist/index434.js.map +1 -1
- package/dist/index435.js +29 -2
- package/dist/index435.js.map +1 -1
- package/dist/index436.js +13 -2
- package/dist/index436.js.map +1 -1
- package/dist/index437.js +7 -2
- package/dist/index437.js.map +1 -1
- package/dist/index47.js +2 -2
- package/dist/index48.js +36 -36
- package/dist/index49.js +29 -29
- package/dist/index50.js +2 -2
- package/dist/index51.js +12 -12
- package/dist/index52.js +4 -4
- package/dist/index53.js +1 -1
- package/dist/index54.js +21 -21
- package/dist/index55.js +5 -5
- package/dist/index56.js +5 -5
- package/dist/index57.js +8 -8
- package/dist/index58.js +5 -5
- package/dist/index59.js +17 -17
- package/dist/index60.js +5 -5
- package/dist/index61.js +3 -3
- package/dist/index64.js +5 -5
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +10 -22
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +17 -232
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +5 -5
- package/dist/index68.js.map +1 -1
- package/dist/index70.js +22 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +232 -17
- package/dist/index71.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index77.js +2 -2
- package/dist/index78.js +2 -2
- package/package.json +1 -1
package/dist/index280.js
CHANGED
|
@@ -1,83 +1,256 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import { useAnimationFrame as Me } from "./index301.js";
|
|
3
|
+
import { useIsoLayoutEffect as T } from "./index261.js";
|
|
4
|
+
import { ownerDocument as be } from "./index284.js";
|
|
5
|
+
import { useStableCallback as S } from "./index262.js";
|
|
6
|
+
import { useValueAsRef as k } from "./index263.js";
|
|
7
|
+
import { isHTMLElement as Pe } from "./index308.js";
|
|
8
|
+
import { createChangeEventDetails as ce } from "./index175.js";
|
|
9
|
+
import { useFloatingParentNodeId as ze, useFloatingTree as We } from "./index386.js";
|
|
10
|
+
import { isIndexOutOfListBounds as Fe, getMinListIndex as ie, getMaxListIndex as ve, findNonDisabledListIndex as G } from "./index382.js";
|
|
11
|
+
import { ARROW_LEFT as B, ARROW_RIGHT as Q, ARROW_UP as Se, ARROW_DOWN as le } from "./index390.js";
|
|
12
|
+
import { getFloatingFocusElement as _e, isTypeableCombobox as qe } from "./index290.js";
|
|
13
|
+
import { enqueueFocus as He } from "./index384.js";
|
|
14
|
+
import { stopEvent as P, isVirtualClick as Ge, isVirtualPointerEvent as $e } from "./index313.js";
|
|
15
|
+
import { activeElement as ue, contains as se, getTarget as Be } from "./index291.js";
|
|
16
|
+
import { listNavigation as Te, focusOut as Qe } from "./index177.js";
|
|
17
|
+
const Ue = "Escape";
|
|
18
|
+
function U(c, d, n) {
|
|
19
|
+
switch (c) {
|
|
20
|
+
case "vertical":
|
|
21
|
+
return d;
|
|
22
|
+
case "horizontal":
|
|
23
|
+
return n;
|
|
24
|
+
default:
|
|
25
|
+
return d || n;
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
28
|
-
open: !1,
|
|
29
|
-
transitionStatus: void 0,
|
|
30
|
-
floatingElement: null,
|
|
31
|
-
referenceElement: null,
|
|
32
|
-
triggerElements: e,
|
|
33
|
-
floatingId: n,
|
|
34
|
-
syncOnly: !0,
|
|
35
|
-
nested: g,
|
|
36
|
-
onOpenChange: void 0
|
|
37
|
-
});
|
|
28
|
+
function $(c, d) {
|
|
29
|
+
return U(d, c === Se || c === le, c === B || c === Q);
|
|
38
30
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return n !== void 0 && i(e) && t(e) === n;
|
|
31
|
+
function ae(c, d, n) {
|
|
32
|
+
return U(d, c === le, n ? c === B : c === Q) || c === "Enter" || c === " " || c === "";
|
|
42
33
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
34
|
+
function je(c, d, n) {
|
|
35
|
+
return U(d, n ? c === B : c === Q, c === le);
|
|
36
|
+
}
|
|
37
|
+
function Je(c, d, n, p) {
|
|
38
|
+
const K = n ? c === Q : c === B, R = c === Se;
|
|
39
|
+
return d === "both" || d === "horizontal" && p ? c === Ue : U(d, K, R);
|
|
40
|
+
}
|
|
41
|
+
function dr(c, d) {
|
|
42
|
+
const {
|
|
43
|
+
listRef: n,
|
|
44
|
+
activeIndex: p,
|
|
45
|
+
onNavigate: K = () => {
|
|
46
|
+
},
|
|
47
|
+
enabled: R = !0,
|
|
48
|
+
selectedIndex: L = null,
|
|
49
|
+
allowEscape: j = !1,
|
|
50
|
+
loopFocus: V = !1,
|
|
51
|
+
nested: w = !1,
|
|
52
|
+
rtl: O = !1,
|
|
53
|
+
virtual: s = !1,
|
|
54
|
+
focusItemOnOpen: y = "auto",
|
|
55
|
+
focusItemOnHover: J = !0,
|
|
56
|
+
openOnArrowKeyDown: X = !0,
|
|
57
|
+
disabledIndices: x = void 0,
|
|
58
|
+
orientation: a = "vertical",
|
|
59
|
+
parentOrientation: Ke,
|
|
60
|
+
id: fe,
|
|
61
|
+
resetOnPointerLeave: Le = !0,
|
|
62
|
+
externalTree: Ce,
|
|
63
|
+
grid: Y
|
|
64
|
+
} = d, de = Y != null;
|
|
65
|
+
process.env.NODE_ENV !== "production" && (j && (V || console.warn("`useListNavigation` looping must be enabled to allow escaping."), s || console.warn("`useListNavigation` must be virtual to allow escaping.")), a === "vertical" && de && console.warn("In grid list navigation mode, the `orientation` should", 'be either "horizontal" or "both".'));
|
|
66
|
+
const g = "rootStore" in c ? c.rootStore : c, m = g.useState("open"), E = g.useState("floatingElement"), I = g.useState("domReferenceElement"), me = g.context.dataRef, De = _e(E), Z = qe(I), C = k(De), ee = ze(), F = We(Ce), M = f.useRef(y), o = f.useRef(L ?? -1), b = f.useRef(null), v = f.useRef(!0), u = S((e) => {
|
|
67
|
+
K(o.current === -1 ? null : o.current, e);
|
|
68
|
+
}), D = f.useRef(!!E), pe = f.useRef(m), h = f.useRef(!1), z = f.useRef(!1), re = f.useRef(null), Ne = k(x), W = k(m), N = k(L), ge = k(Le), Ae = Me(), Re = Me(), te = S(() => {
|
|
69
|
+
function e(i) {
|
|
70
|
+
s ? F?.events.emit("virtualfocus", i) : re.current = He(i, {
|
|
71
|
+
sync: h.current,
|
|
72
|
+
preventScroll: !0
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const r = n.current[o.current], l = z.current;
|
|
76
|
+
r && e(r), (h.current ? (i) => i() : (i) => Ae.request(i))(() => {
|
|
77
|
+
const i = n.current[o.current] || r;
|
|
78
|
+
if (!i)
|
|
79
|
+
return;
|
|
80
|
+
r || e(i), // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
81
|
+
oe && (l || !v.current) && i.scrollIntoView?.({
|
|
82
|
+
block: "nearest",
|
|
83
|
+
inline: "nearest"
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
T(() => {
|
|
88
|
+
me.current.orientation = a;
|
|
89
|
+
}, [me, a]), T(() => {
|
|
90
|
+
R && (m && E ? (o.current = L ?? -1, M.current && L != null && (z.current = !0, u())) : D.current && (o.current = -1, u()));
|
|
91
|
+
}, [R, m, E, L, u]), T(() => {
|
|
92
|
+
if (R) {
|
|
93
|
+
if (!m) {
|
|
94
|
+
h.current = !1;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (E)
|
|
98
|
+
if (p == null) {
|
|
99
|
+
if (h.current = !1, N.current != null)
|
|
100
|
+
return;
|
|
101
|
+
if (D.current && (o.current = -1, te()), (!pe.current || !D.current) && M.current && (b.current != null || M.current === !0 && b.current == null)) {
|
|
102
|
+
let e = 0;
|
|
103
|
+
const r = () => {
|
|
104
|
+
n.current[0] == null ? (e < 2 && (e ? (t) => Re.request(t) : queueMicrotask)(r), e += 1) : (o.current = b.current == null || ae(b.current, a, O) || w ? ie(n) : ve(n), b.current = null, u());
|
|
105
|
+
};
|
|
106
|
+
r();
|
|
107
|
+
}
|
|
108
|
+
} else Fe(n.current, p) || (o.current = p, te(), z.current = !1);
|
|
109
|
+
}
|
|
110
|
+
}, [R, m, E, p, N, w, n, a, O, u, te, Re]), T(() => {
|
|
111
|
+
if (!R || E || !F || s || !D.current)
|
|
112
|
+
return;
|
|
113
|
+
const e = F.nodesRef.current, r = e.find((i) => i.id === ee)?.context?.elements.floating, l = ue(be(I ?? r ?? null)), t = e.some((i) => i.context && se(i.context.elements.floating, l));
|
|
114
|
+
r && !t && v.current && r.focus({
|
|
115
|
+
preventScroll: !0
|
|
116
|
+
});
|
|
117
|
+
}, [R, E, I, F, ee, s]), T(() => {
|
|
118
|
+
pe.current = m, D.current = !!E;
|
|
119
|
+
}), T(() => {
|
|
120
|
+
m || (b.current = null, M.current = y);
|
|
121
|
+
}, [m, y]);
|
|
122
|
+
const he = p != null, ne = S((e) => {
|
|
123
|
+
if (!W.current)
|
|
124
|
+
return;
|
|
125
|
+
const r = n.current.indexOf(e.currentTarget);
|
|
126
|
+
r !== -1 && (o.current !== r || p !== r) && (o.current = r, u(e));
|
|
127
|
+
}), _ = S(() => Ke ?? F?.nodesRef.current.find((e) => e.id === ee)?.context?.dataRef?.current.orientation), Ee = S(() => ie(n, Ne.current)), A = S((e) => {
|
|
128
|
+
if (v.current = !1, h.current = !0, e.which === 229 || !W.current && e.currentTarget === C.current)
|
|
129
|
+
return;
|
|
130
|
+
if (w && Je(e.key, a, O, de)) {
|
|
131
|
+
$(e.key, _()) || P(e), g.setOpen(!1, ce(Te, e.nativeEvent)), Pe(I) && (s ? F?.events.emit("virtualfocus", I) : I.focus());
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const r = o.current, l = ie(n, x), t = ve(n, x);
|
|
135
|
+
if (Z || (e.key === "Home" && (P(e), o.current = l, u(e)), e.key === "End" && (P(e), o.current = t, u(e))), Y != null) {
|
|
136
|
+
const i = Y(e, o.current, n, a, V, O, x, l, t);
|
|
137
|
+
if (i != null && (o.current = i, u(e)), a === "both")
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if ($(e.key, a)) {
|
|
141
|
+
if (P(e), m && !s && ue(e.currentTarget.ownerDocument) === e.currentTarget) {
|
|
142
|
+
o.current = ae(e.key, a, O) ? l : t, u(e);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
ae(e.key, a, O) ? V ? r >= t ? j && r !== n.current.length ? o.current = -1 : (h.current = !1, o.current = l) : o.current = G(n.current, {
|
|
146
|
+
startingIndex: r,
|
|
147
|
+
disabledIndices: x
|
|
148
|
+
}) : o.current = Math.min(t, G(n.current, {
|
|
149
|
+
startingIndex: r,
|
|
150
|
+
disabledIndices: x
|
|
151
|
+
})) : V ? r <= l ? j && r !== -1 ? o.current = n.current.length : (h.current = !1, o.current = t) : o.current = G(n.current, {
|
|
152
|
+
startingIndex: r,
|
|
153
|
+
decrement: !0,
|
|
154
|
+
disabledIndices: x
|
|
155
|
+
}) : o.current = Math.max(l, G(n.current, {
|
|
156
|
+
startingIndex: r,
|
|
157
|
+
decrement: !0,
|
|
158
|
+
disabledIndices: x
|
|
159
|
+
})), Fe(n.current, o.current) && (o.current = -1), u(e);
|
|
160
|
+
}
|
|
161
|
+
}), oe = f.useMemo(() => ({
|
|
162
|
+
onFocus(r) {
|
|
163
|
+
h.current = !0, ne(r);
|
|
164
|
+
},
|
|
165
|
+
onClick: ({
|
|
166
|
+
currentTarget: r
|
|
167
|
+
}) => r.focus({
|
|
168
|
+
preventScroll: !0
|
|
169
|
+
}),
|
|
170
|
+
// Safari
|
|
171
|
+
onMouseMove(r) {
|
|
172
|
+
h.current = !0, z.current = !1, J && ne(r);
|
|
173
|
+
},
|
|
174
|
+
onPointerLeave(r) {
|
|
175
|
+
if (!W.current || !v.current || r.pointerType === "touch")
|
|
176
|
+
return;
|
|
177
|
+
h.current = !0;
|
|
178
|
+
const l = r.relatedTarget;
|
|
179
|
+
if (!(!J || n.current.includes(l)) && ge.current && (re.current?.(), re.current = null, o.current = -1, u(r), !s)) {
|
|
180
|
+
const t = C.current, i = ue(be(t));
|
|
181
|
+
t && se(t, i) && t.focus({
|
|
182
|
+
preventScroll: !0
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}), [ne, W, C, J, n, u, ge, s]), q = f.useMemo(() => s && m && he && {
|
|
187
|
+
"aria-activedescendant": `${fe}-${p}`
|
|
188
|
+
}, [s, m, he, fe, p]), Ie = f.useMemo(() => ({
|
|
189
|
+
"aria-orientation": a === "both" ? void 0 : a,
|
|
190
|
+
...Z ? {} : q,
|
|
191
|
+
onKeyDown(e) {
|
|
192
|
+
if (e.key === "Tab" && e.shiftKey && m && !s) {
|
|
193
|
+
const r = Be(e.nativeEvent);
|
|
194
|
+
if (r && !se(C.current, r))
|
|
195
|
+
return;
|
|
196
|
+
P(e), g.setOpen(!1, ce(Qe, e.nativeEvent)), Pe(I) && I.focus();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
A(e);
|
|
200
|
+
},
|
|
201
|
+
onPointerMove() {
|
|
202
|
+
v.current = !0;
|
|
203
|
+
}
|
|
204
|
+
}), [q, A, C, a, Z, g, m, s, I]), H = f.useMemo(() => {
|
|
205
|
+
function e(t) {
|
|
206
|
+
g.setOpen(!0, ce(Te, t.nativeEvent, t.currentTarget));
|
|
207
|
+
}
|
|
208
|
+
function r(t) {
|
|
209
|
+
y === "auto" && Ge(t.nativeEvent) && (M.current = !s);
|
|
210
|
+
}
|
|
211
|
+
function l(t) {
|
|
212
|
+
M.current = y, y === "auto" && $e(t.nativeEvent) && (M.current = !0);
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
onKeyDown(t) {
|
|
216
|
+
const i = g.select("open");
|
|
217
|
+
v.current = !1;
|
|
218
|
+
const xe = t.key.startsWith("Arrow"), we = je(t.key, _(), O), ye = $(t.key, a), ke = (w ? we : ye) || t.key === "Enter" || t.key.trim() === "";
|
|
219
|
+
if (s && i)
|
|
220
|
+
return A(t);
|
|
221
|
+
if (!(!i && !X && xe)) {
|
|
222
|
+
if (ke) {
|
|
223
|
+
const Ve = $(t.key, _());
|
|
224
|
+
b.current = w && Ve ? null : t.key;
|
|
225
|
+
}
|
|
226
|
+
if (w) {
|
|
227
|
+
we && (P(t), i ? (o.current = Ee(), u(t)) : e(t));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
ye && (N.current != null && (o.current = N.current), P(t), !i && X ? e(t) : A(t), i && u(t));
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
onFocus(t) {
|
|
234
|
+
g.select("open") && !s && (o.current = -1, u(t));
|
|
235
|
+
},
|
|
236
|
+
onPointerDown: l,
|
|
237
|
+
onPointerEnter: l,
|
|
238
|
+
onMouseDown: r,
|
|
239
|
+
onClick: r
|
|
240
|
+
};
|
|
241
|
+
}, [A, y, Ee, w, u, g, X, a, _, O, N, s]), Oe = f.useMemo(() => ({
|
|
242
|
+
...q,
|
|
243
|
+
...H
|
|
244
|
+
}), [q, H]);
|
|
245
|
+
return f.useMemo(() => R ? {
|
|
246
|
+
reference: Oe,
|
|
247
|
+
floating: Ie,
|
|
248
|
+
item: oe,
|
|
249
|
+
trigger: H
|
|
250
|
+
} : {}, [R, Oe, Ie, H, oe]);
|
|
45
251
|
}
|
|
46
|
-
const v = {
|
|
47
|
-
open: i,
|
|
48
|
-
mounted: o((e) => e.mounted),
|
|
49
|
-
transitionStatus: o((e) => e.transitionStatus),
|
|
50
|
-
floatingRootContext: o((e) => e.floatingRootContext),
|
|
51
|
-
triggerCount: o((e) => e.triggerCount),
|
|
52
|
-
preventUnmountingOnClose: o((e) => e.preventUnmountingOnClose),
|
|
53
|
-
payload: o((e) => e.payload),
|
|
54
|
-
activeTriggerId: t,
|
|
55
|
-
activeTriggerElement: o((e) => e.mounted ? e.activeTriggerElement : null),
|
|
56
|
-
popupId: p,
|
|
57
|
-
/**
|
|
58
|
-
* Whether the trigger with the given ID was used to open the popup.
|
|
59
|
-
*/
|
|
60
|
-
isTriggerActive: o((e, n) => n !== void 0 && t(e) === n),
|
|
61
|
-
/**
|
|
62
|
-
* Whether the popup is open and was activated by a trigger with the given ID.
|
|
63
|
-
*/
|
|
64
|
-
isOpenedByTrigger: o((e, n) => u(e, n)),
|
|
65
|
-
/**
|
|
66
|
-
* Whether the popup is mounted and was activated by a trigger with the given ID.
|
|
67
|
-
*/
|
|
68
|
-
isMountedByTrigger: o((e, n) => n !== void 0 && t(e) === n && e.mounted),
|
|
69
|
-
triggerProps: o((e, n) => n ? e.activeTriggerProps : e.inactiveTriggerProps),
|
|
70
|
-
/**
|
|
71
|
-
* Popup id for the trigger that currently owns the open popup.
|
|
72
|
-
*/
|
|
73
|
-
triggerPopupId: o((e, n) => f(e, n) ? p(e) : void 0),
|
|
74
|
-
popupProps: o((e) => e.popupProps),
|
|
75
|
-
popupElement: o((e) => e.popupElement),
|
|
76
|
-
positionerElement: o((e) => e.positionerElement)
|
|
77
|
-
};
|
|
78
252
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
v as popupStoreSelectors
|
|
253
|
+
Ue as ESCAPE,
|
|
254
|
+
dr as useListNavigation
|
|
82
255
|
};
|
|
83
256
|
//# sourceMappingURL=index280.js.map
|
package/dist/index280.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index280.js","sources":["../../../node_modules/@base-ui/react/utils/popups/store.mjs"],"sourcesContent":["import { createSelector } from '@base-ui/utils/store';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingRootStore } from \"../../floating-ui-react/components/FloatingRootStore.mjs\";\nimport { getEmptyRootContext } from \"../../floating-ui-react/utils/getEmptyRootContext.mjs\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState() {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: getEmptyRootContext(),\n floatingId: undefined,\n triggerCount: 0,\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nexport function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) {\n return new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements,\n floatingId,\n syncOnly: true,\n nested,\n onOpenChange: undefined\n });\n}\nconst activeTriggerIdSelector = createSelector(state => state.triggerIdProp ?? state.activeTriggerId);\nconst openSelector = createSelector(state => state.openProp ?? state.open);\nconst popupIdSelector = createSelector(state => {\n const popupId = state.popupElement?.id ?? state.floatingId;\n return popupId || undefined;\n});\nfunction triggerOwnsOpenPopup(state, triggerId) {\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) === triggerId;\n}\nfunction triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {\n if (triggerOwnsOpenPopup(state, triggerId)) {\n return true;\n }\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;\n}\nexport const popupStoreSelectors = {\n open: openSelector,\n mounted: createSelector(state => state.mounted),\n transitionStatus: createSelector(state => state.transitionStatus),\n floatingRootContext: createSelector(state => state.floatingRootContext),\n triggerCount: createSelector(state => state.triggerCount),\n preventUnmountingOnClose: createSelector(state => state.preventUnmountingOnClose),\n payload: createSelector(state => state.payload),\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: createSelector(state => state.mounted ? state.activeTriggerElement : null),\n popupId: popupIdSelector,\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId),\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: createSelector((state, triggerId) => triggerOwnsOpenPopup(state, triggerId)),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted),\n triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps),\n /**\n * Popup id for the trigger that currently owns the open popup.\n */\n triggerPopupId: createSelector((state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : undefined),\n popupProps: createSelector(state => state.popupProps),\n popupElement: createSelector(state => state.popupElement),\n positionerElement: createSelector(state => state.positionerElement)\n};"],"names":["createInitialPopupStoreState","getEmptyRootContext","EMPTY_OBJECT","createPopupFloatingRootContext","triggerElements","floatingId","nested","FloatingRootStore","activeTriggerIdSelector","createSelector","state","openSelector","popupIdSelector","triggerOwnsOpenPopup","triggerId","triggerOwnsOpenPopupOrIsOnlyTrigger","popupStoreSelectors","isActive"],"mappings":";;;;AASO,SAASA,IAA+B;AAC7C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,IACT,kBAAkB;AAAA,IAClB,qBAAqBC,EAAmB;AAAA,IACxC,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,0BAA0B;AAAA,IAC1B,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,eAAe;AAAA,IACf,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,oBAAoBC;AAAA,IACpB,sBAAsBA;AAAA,IACtB,YAAYA;AAAA,EAChB;AACA;AACO,SAASC,EAA+BC,GAAiBC,GAAYC,IAAS,IAAO;AAC1F,SAAO,IAAIC,EAAkB;AAAA,IAC3B,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,iBAAAH;AAAA,IACA,YAAAC;AAAA,IACA,UAAU;AAAA,IACV,QAAAC;AAAA,IACA,cAA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AcA,MAAc,UAAaN,EAAwBE,CAAK,MAAMI,KAAaJ,EAAM,OAAO;AAAA,EACjJ,cAAcD,EAAe,CAACC,GAAOO,MAAaA,IAAWP,EAAM,qBAAqBA,EAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIlH,gBAAgBD,EAAe,CAACC,GAAOI,MAAcC,EAAoCL,GAAOI,CAAS,IAAIF,EAAgBF,CAAK,IAAI,MAAS;AAAA,EAC/I,YAAYD,EAAe,CAAAC,MAASA,EAAM,UAAU;AAAA,EACpD,cAAcD,EAAe,CAAAC,MAASA,EAAM,YAAY;AAAA,EACxD,mBAAmBD,EAAe,CAAAC,MAASA,EAAM,iBAAiB;AACpE;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index280.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"../utils/constants.mjs\";\nimport { activeElement, contains, getFloatingFocusElement, getTarget, isTypeableCombobox } from \"../utils/element.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nexport const ESCAPE = 'Escape';\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl, grid) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && grid) {\n return key === ESCAPE;\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nexport function useListNavigation(context, props) {\n const {\n listRef,\n activeIndex,\n onNavigate: onNavigateProp = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loopFocus = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n parentOrientation,\n id,\n resetOnPointerLeave = true,\n externalTree,\n grid: navigateGrid\n } = props;\n const isGrid = navigateGrid != null;\n if (process.env.NODE_ENV !== 'production') {\n if (allowEscape) {\n if (!loopFocus) {\n console.warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n console.warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && isGrid) {\n console.warn('In grid list navigation mode, the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const floatingFocusElement = getFloatingFocusElement(floatingElement);\n const typeableComboboxReference = isTypeableCombobox(domReferenceElement);\n const floatingFocusElementRef = useValueAsRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree(externalTree);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex ?? -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const onNavigate = useStableCallback(event => {\n onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);\n });\n const previousMountedRef = React.useRef(!!floatingElement);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const cancelQueuedFocusRef = React.useRef(null);\n const disabledIndicesRef = useValueAsRef(disabledIndices);\n const latestOpenRef = useValueAsRef(open);\n const selectedIndexRef = useValueAsRef(selectedIndex);\n const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);\n const focusFrame = useAnimationFrame();\n const waitForListPopulatedFrame = useAnimationFrame();\n const focusItem = useStableCallback(() => {\n function runFocus(item) {\n if (virtual) {\n tree?.events.emit('virtualfocus', item);\n } else {\n cancelQueuedFocusRef.current = enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? callback => callback() : callback => focusFrame.request(callback);\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) {\n return;\n }\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const shouldScrollIntoView =\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView?.({\n block: 'nearest',\n inline: 'nearest'\n });\n }\n });\n });\n useIsoLayoutEffect(() => {\n dataRef.current.orientation = orientation;\n }, [dataRef, orientation]);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (open && floatingElement) {\n indexRef.current = selectedIndex ?? -1;\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Reset the active index when the list is no longer open and mounted (closing or\n // unmounting). `onNavigate` is a stable callback that always forwards to the latest\n // `onNavigate` prop.\n indexRef.current = -1;\n onNavigate();\n }\n }, [enabled, open, floatingElement, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (!open) {\n forceSyncFocusRef.current = false;\n return;\n }\n if (!floatingElement) {\n return;\n }\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? callback => waitForListPopulatedFrame.request(callback) : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs += 1;\n } else {\n // Initially focus the first non-disabled item. `disabledIndices` is deliberately\n // omitted here so attribute-disabled items (`disabled`/`aria-disabled`) are skipped\n // on open even when the consumer passes an empty `disabledIndices` array. Passing it\n // would regress that behavior (see mui/base-ui#2604).\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, floatingElement, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useIsoLayoutEffect(() => {\n if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = nodes.find(node => node.id === parentId)?.context?.elements.floating;\n // `floatingElement` is null here (see the guard above), so resolve the owner document from an\n // in-DOM element for realm-safety (shadow DOM/iframes): the reference element, falling back to\n // the parent floating element when the reference is virtual (`domReferenceElement` is null).\n const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);\n useIsoLayoutEffect(() => {\n previousOpenRef.current = open;\n previousMountedRef.current = !!floatingElement;\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n const hasActiveIndex = activeIndex != null;\n const syncCurrentTarget = useStableCallback(event => {\n if (!latestOpenRef.current) {\n return;\n }\n const index = listRef.current.indexOf(event.currentTarget);\n if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const getParentOrientation = useStableCallback(() => {\n return parentOrientation ?? tree?.nodesRef.current.find(node => node.id === parentId)?.context?.dataRef?.current.orientation;\n });\n const getMinEnabledIndex = useStableCallback(() => {\n return getMinListIndex(listRef, disabledIndicesRef.current);\n });\n const commonOnKeyDown = useStableCallback(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n store.setOpen(false, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n if (virtual) {\n tree?.events.emit('virtualfocus', domReferenceElement);\n } else {\n domReferenceElement.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(event);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(event);\n }\n }\n\n // Grid navigation is injected by grid-capable consumers so non-grid\n // consumers (menu, select) tree-shake the grid helpers out.\n if (navigateGrid != null) {\n const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);\n if (index != null) {\n indexRef.current = index;\n onNavigate(event);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(event);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loopFocus) {\n if (currentIndex >= maxIndex) {\n if (allowEscape && currentIndex !== listRef.current.length) {\n indexRef.current = -1;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = minIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else if (loopFocus) {\n if (currentIndex <= minIndex) {\n if (allowEscape && currentIndex !== -1) {\n indexRef.current = listRef.current.length;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = maxIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n if (isIndexOutOfListBounds(listRef.current, indexRef.current)) {\n indexRef.current = -1;\n }\n onNavigate(event);\n }\n });\n const item = React.useMemo(() => {\n const itemProps = {\n onFocus(event) {\n forceSyncFocusRef.current = true;\n syncCurrentTarget(event);\n },\n onClick: ({\n currentTarget\n }) => currentTarget.focus({\n preventScroll: true\n }),\n // Safari\n onMouseMove(event) {\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(event);\n }\n },\n onPointerLeave(event) {\n if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n const relatedTarget = event.relatedTarget;\n if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {\n return;\n }\n if (!resetOnPointerLeaveRef.current) {\n return;\n }\n cancelQueuedFocusRef.current?.();\n cancelQueuedFocusRef.current = null;\n indexRef.current = -1;\n onNavigate(event);\n if (!virtual) {\n const floatingFocusEl = floatingFocusElementRef.current;\n const activeEl = activeElement(ownerDocument(floatingFocusEl));\n if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {\n floatingFocusEl.focus({\n preventScroll: true\n });\n }\n }\n }\n };\n return itemProps;\n }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': `${id}-${activeIndex}`\n };\n }, [virtual, open, hasActiveIndex, id, activeIndex]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown(event) {\n // Close submenu on Shift+Tab\n if (event.key === 'Tab' && event.shiftKey && open && !virtual) {\n // If the event originated from within a nested element (e.g., a Dialog opened from\n // within the menu), don't close the menu. The nested element has its own focus\n // management and should handle the Tab key.\n const target = getTarget(event.nativeEvent);\n if (target && !contains(floatingFocusElementRef.current, target)) {\n return;\n }\n stopEvent(event);\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n domReferenceElement.focus();\n }\n return;\n }\n commonOnKeyDown(event);\n },\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, orientation, typeableComboboxReference, store, open, virtual, domReferenceElement]);\n const trigger = React.useMemo(() => {\n function openOnNavigationKeyDown(event) {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = !virtual;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n onKeyDown(event) {\n // non-reactive open state (to prevent re-creation of the handler)\n const currentOpen = store.select('open');\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && currentOpen) {\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {\n return undefined;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (currentOpen) {\n indexRef.current = getMinEnabledIndex();\n onNavigate(event);\n } else {\n openOnNavigationKeyDown(event);\n }\n }\n return undefined;\n }\n if (isMainKey) {\n if (selectedIndexRef.current != null) {\n indexRef.current = selectedIndexRef.current;\n }\n stopEvent(event);\n if (!currentOpen && openOnArrowKeyDown) {\n openOnNavigationKeyDown(event);\n } else {\n commonOnKeyDown(event);\n }\n if (currentOpen) {\n onNavigate(event);\n }\n }\n return undefined;\n },\n onFocus(event) {\n if (store.select('open') && !virtual) {\n indexRef.current = -1;\n onNavigate(event);\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndexRef, virtual]);\n const reference = React.useMemo(() => {\n return {\n ...ariaActiveDescendantProp,\n ...trigger\n };\n }, [ariaActiveDescendantProp, trigger]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item,\n trigger\n } : {}, [enabled, reference, floating, trigger, item]);\n}"],"names":["ESCAPE","doSwitch","orientation","vertical","horizontal","isMainOrientationKey","key","ARROW_UP","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","isMainOrientationToEndKey","rtl","isCrossOrientationOpenKey","isCrossOrientationCloseKey","grid","useListNavigation","context","props","listRef","activeIndex","onNavigateProp","enabled","selectedIndex","allowEscape","loopFocus","nested","virtual","focusItemOnOpen","focusItemOnHover","openOnArrowKeyDown","disabledIndices","parentOrientation","id","resetOnPointerLeave","externalTree","navigateGrid","isGrid","store","open","floatingElement","domReferenceElement","dataRef","floatingFocusElement","getFloatingFocusElement","typeableComboboxReference","isTypeableCombobox","floatingFocusElementRef","useValueAsRef","parentId","useFloatingParentNodeId","tree","useFloatingTree","focusItemOnOpenRef","React","indexRef","keyRef","isPointerModalityRef","onNavigate","useStableCallback","event","previousMountedRef","previousOpenRef","forceSyncFocusRef","forceScrollIntoViewRef","cancelQueuedFocusRef","disabledIndicesRef","latestOpenRef","selectedIndexRef","resetOnPointerLeaveRef","focusFrame","useAnimationFrame","waitForListPopulatedFrame","focusItem","runFocus","item","enqueueFocus","initialItem","forceScrollIntoView","callback","waitedItem","useIsoLayoutEffect","runs","waitForListPopulated","getMinListIndex","getMaxListIndex","isIndexOutOfListBounds","nodes","parent","node","activeEl","activeElement","ownerDocument","treeContainsActiveEl","contains","hasActiveIndex","syncCurrentTarget","index","getParentOrientation","getMinEnabledIndex","commonOnKeyDown","stopEvent","createChangeEventDetails","REASONS.listNavigation","isHTMLElement","currentIndex","minIndex","maxIndex","findNonDisabledListIndex","currentTarget","relatedTarget","floatingFocusEl","ariaActiveDescendantProp","floating","target","getTarget","REASONS.focusOut","trigger","openOnNavigationKeyDown","checkVirtualMouse","isVirtualClick","checkVirtualPointer","isVirtualPointerEvent","currentOpen","isArrowKey","isParentCrossOpenKey","isMainKey","isNavigationKey","isParentMainKey","reference"],"mappings":";;;;;;;;;;;;;;;;AAiBY,MAACA,KAAS;AACtB,SAASC,EAASC,GAAaC,GAAUC,GAAY;AACnD,UAAQF,GAAW;AAAA,IACjB,KAAK;AACH,aAAOC;AAAA,IACT,KAAK;AACH,aAAOC;AAAA,IACT;AACE,aAAOD,KAAYC;AAAA,EACzB;AACA;AACA,SAASC,EAAqBC,GAAKJ,GAAa;AAG9C,SAAOD,EAASC,GAFCI,MAAQC,MAAYD,MAAQE,IAC1BF,MAAQG,KAAcH,MAAQI,CACA;AACnD;AACA,SAASC,GAA0BL,GAAKJ,GAAaU,GAAK;AAGxD,SAAOX,EAASC,GAFCI,MAAQE,IACNI,IAAMN,MAAQG,IAAaH,MAAQI,CACL,KAAKJ,MAAQ,WAAWA,MAAQ,OAAOA,MAAQ;AAClG;AACA,SAASO,GAA0BP,GAAKJ,GAAaU,GAAK;AAGxD,SAAOX,EAASC,GAFCU,IAAMN,MAAQG,IAAaH,MAAQI,GACjCJ,MAAQE,EACsB;AACnD;AACA,SAASM,GAA2BR,GAAKJ,GAAaU,GAAKG,GAAM;AAC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AA,EACT,IACK,CAACL,GAA0BK,CAAO,CAAC;AACtC,SAAO/D,EAAM,QAAQ,MAAMhC,IAAU;AAAA,IACnC,WAAA2G;AAAA,IACA,UAAAhB;AAAA,IACA,MAAAtC;AAAA,IACA,SAAA0C;AAAA,EACJ,IAAM,CAAA,GAAI,CAAC/F,GAAS2G,IAAWhB,IAAUI,GAAS1C,EAAI,CAAC;AACvD;","x_google_ignoreList":[0]}
|
package/dist/index281.js
CHANGED
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
import * as a from "react";
|
|
2
|
+
import { useIsoLayoutEffect as L } from "./index261.js";
|
|
3
|
+
import { useStableCallback as M } from "./index262.js";
|
|
4
|
+
import { useTimeout as N } from "./index285.js";
|
|
5
|
+
import { EMPTY_ARRAY as W } from "./index264.js";
|
|
6
|
+
import { isListIndexDisabled as _, isElementVisible as j } from "./index382.js";
|
|
7
|
+
import { contains as T } from "./index291.js";
|
|
8
|
+
import { stopEvent as K } from "./index313.js";
|
|
9
|
+
function ee(h, A) {
|
|
10
|
+
const {
|
|
11
|
+
listRef: D,
|
|
12
|
+
elementsRef: F,
|
|
13
|
+
activeIndex: u,
|
|
14
|
+
onMatch: P,
|
|
15
|
+
disabledIndices: S,
|
|
16
|
+
onTyping: o,
|
|
17
|
+
enabled: b = !0,
|
|
18
|
+
resetMs: O = 750,
|
|
19
|
+
selectedIndex: n = null
|
|
20
|
+
} = A, y = "rootStore" in h ? h.rootStore : h, i = y.useState("open"), m = N(), t = a.useRef(""), c = a.useRef(n ?? u ?? -1), l = a.useRef(null), k = M((r) => {
|
|
21
|
+
function d(e) {
|
|
22
|
+
const s = F?.current[e];
|
|
23
|
+
return !s || j(s);
|
|
24
|
+
}
|
|
25
|
+
function p(e) {
|
|
26
|
+
return d(e) ? S == null || !_(W, e, S) : !1;
|
|
27
|
+
}
|
|
28
|
+
function g(e, s, Y = 0) {
|
|
29
|
+
if (e.length === 0)
|
|
30
|
+
return -1;
|
|
31
|
+
const z = (Y % e.length + e.length) % e.length, B = s.toLowerCase();
|
|
32
|
+
for (let w = 0; w < e.length; w += 1) {
|
|
33
|
+
const x = (z + w) % e.length;
|
|
34
|
+
if (!(!e[x]?.toLowerCase().startsWith(B) || !p(x)))
|
|
35
|
+
return x;
|
|
36
|
+
}
|
|
37
|
+
return -1;
|
|
38
|
+
}
|
|
39
|
+
const f = D.current;
|
|
40
|
+
if (t.current.length > 0 && r.key === " " && (K(r), o?.(!0)), t.current.length > 0 && t.current[0] !== " " && g(f, t.current) === -1 && r.key !== " " && o?.(!1), f == null || // Character key.
|
|
41
|
+
r.key.length !== 1 || // Modifier key.
|
|
42
|
+
r.ctrlKey || r.metaKey || r.altKey)
|
|
43
|
+
return;
|
|
44
|
+
i && r.key !== " " && (K(r), o?.(!0));
|
|
45
|
+
const E = t.current === "";
|
|
46
|
+
E && (c.current = n ?? u ?? -1), f.every((e, s) => e && p(s) ? e[0]?.toLowerCase() !== e[1]?.toLowerCase() : !0) && t.current === r.key && (t.current = "", c.current = l.current), t.current += r.key, m.start(O, () => {
|
|
47
|
+
t.current = "", c.current = l.current, o?.(!1);
|
|
48
|
+
});
|
|
49
|
+
const V = ((E ? n ?? u ?? -1 : c.current) ?? 0) + 1, I = g(f, t.current, V);
|
|
50
|
+
I !== -1 ? (P?.(I), l.current = I) : r.key !== " " && (t.current = "", o?.(!1));
|
|
51
|
+
}), C = M((r) => {
|
|
52
|
+
const d = r.relatedTarget, p = y.select("domReferenceElement"), g = y.select("floatingElement");
|
|
53
|
+
T(p, d) || T(g, d) || (m.clear(), t.current = "", c.current = l.current, o?.(!1));
|
|
54
|
+
});
|
|
55
|
+
L(() => {
|
|
56
|
+
!i && n !== null || (m.clear(), l.current = null, t.current !== "" && (t.current = ""));
|
|
57
|
+
}, [i, n, m]), L(() => {
|
|
58
|
+
i && t.current === "" && (c.current = n ?? u ?? -1);
|
|
59
|
+
}, [i, n, u]);
|
|
60
|
+
const R = a.useMemo(() => ({
|
|
61
|
+
onKeyDown: k,
|
|
62
|
+
onBlur: C
|
|
63
|
+
}), [k, C]);
|
|
64
|
+
return a.useMemo(() => b ? {
|
|
65
|
+
reference: R,
|
|
66
|
+
floating: R
|
|
67
|
+
} : {}, [b, R]);
|
|
61
68
|
}
|
|
62
69
|
export {
|
|
63
|
-
|
|
70
|
+
ee as useTypeahead
|
|
64
71
|
};
|
|
65
72
|
//# sourceMappingURL=index281.js.map
|
package/dist/index281.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index281.js","sources":["../../../node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs"],"sourcesContent":["/**\n * Data structure to keep track of popup trigger elements by their IDs.\n * Uses both a set of Elements and a map of IDs to Elements for efficient lookups.\n */\nexport class PopupTriggerMap {\n constructor() {\n this.elementsSet = new Set();\n this.idMap = new Map();\n }\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n const existingElement = this.idMap.get(id);\n if (existingElement === element) {\n return;\n }\n if (existingElement !== undefined) {\n // We assume that the same element won't be registered under multiple ids.\n // This is safe considering how useTriggerRegistration is implemented.\n this.elementsSet.delete(existingElement);\n }\n this.elementsSet.add(element);\n this.idMap.set(id, element);\n if (process.env.NODE_ENV !== 'production') {\n if (this.elementsSet.size !== this.idMap.size) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n }\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n const element = this.idMap.get(id);\n if (element) {\n this.elementsSet.delete(element);\n this.idMap.delete(id);\n }\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n return this.elementsSet.has(element);\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.elementsSet) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.elementsSet.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}"],"names":["PopupTriggerMap","id","element","existingElement","predicate"],"mappings":"AAIO,MAAMA,EAAgB;AAAA,EAC3B,cAAc;AACZ,SAAK,cAAc,oBAAI,IAAG,GAC1B,KAAK,QAAQ,oBAAI,IAAG;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAIC,GAAIC,GAAS;AACf,UAAMC,IAAkB,KAAK,MAAM,IAAIF,CAAE;AACzC,QAAIE,MAAoBD,MAGpBC,MAAoB,UAGtB,KAAK,YAAY,OAAOA,CAAe,GAEzC,KAAK,YAAY,IAAID,CAAO,GAC5B,KAAK,MAAM,IAAID,GAAIC,CAAO,GACtB,QAAQ,IAAI,aAAa,gBACvB,KAAK,YAAY,SAAS,KAAK,MAAM;AAGvC,YAAM,IAAI,MAAM,wFAAwF;AAAA,EAG9G;AAAA;AAAA;AAAA;AAAA,EAKA,OAAOD,GAAI;AACT,UAAMC,IAAU,KAAK,MAAM,IAAID,CAAE;AACjC,IAAIC,MACF,KAAK,YAAY,OAAOA,CAAO,GAC/B,KAAK,MAAM,OAAOD,CAAE;AAAA,EAExB;AAAA;AAAA;AAAA;AAAA,EAKA,WAAWC,GAAS;AAClB,WAAO,KAAK,YAAY,IAAIA,CAAO;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAmBE,GAAW;AAC5B,eAAWF,KAAW,KAAK;AACzB,UAAIE,EAAUF,CAAO;AACnB,eAAO;AAGX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,QAAQD,GAAI;AACV,WAAO,KAAK,MAAM,IAAIA,CAAE;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,WAAO,KAAK,MAAM,QAAO;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW;AACT,WAAO,KAAK,YAAY,OAAM;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,OAAO;AACT,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index281.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { isElementVisible, isListIndexDisabled } from \"../utils/composite.mjs\";\nimport { contains } from \"../utils/element.mjs\";\nimport { stopEvent } from \"../utils/event.mjs\";\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nexport function useTypeahead(context, props) {\n const {\n listRef,\n elementsRef,\n activeIndex,\n onMatch: onMatchProp,\n disabledIndices,\n onTyping,\n enabled = true,\n resetMs = 750,\n selectedIndex = null\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const timeout = useTimeout();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef(selectedIndex ?? activeIndex ?? -1);\n const matchIndexRef = React.useRef(null);\n const onKeyDown = useStableCallback(event => {\n function isVisible(index) {\n const element = elementsRef?.current[index];\n return !element || isElementVisible(element);\n }\n function isItemAvailable(index) {\n if (!isVisible(index)) {\n return false;\n }\n // Visibility is handled above; pass an empty element list so `isListIndexDisabled`\n // resolves only the explicit `disabledIndices` (array/predicate) and skips its own\n // visibility/attribute fallbacks. Consumers that don't opt in keep matching every\n // visible item.\n return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index, disabledIndices);\n }\n function getMatchingIndex(list, string, startIndex = 0) {\n if (list.length === 0) {\n return -1;\n }\n const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;\n const lowerString = string.toLowerCase();\n for (let offset = 0; offset < list.length; offset += 1) {\n const index = (normalizedStartIndex + offset) % list.length;\n const text = list[index];\n if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index)) {\n continue;\n }\n return index;\n }\n return -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && event.key === ' ') {\n // Space should continue the in-progress typeahead session.\n stopEvent(event);\n onTyping?.(true);\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== ' ') {\n onTyping?.(false);\n }\n }\n if (listContent == null ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n onTyping?.(true);\n }\n\n // Capture whether this is a new typing session before mutating the string.\n const isNewSession = stringRef.current === '';\n if (isNewSession) {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too. Unavailable items are skipped while matching, so\n // they must be ignored here as well — otherwise a hidden or disabled double-letter\n // label would block rapid cycling through the available items.\n const allowRapidSuccessionOfFirstLetter = listContent.every((text, index) => text && isItemAvailable(index) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n timeout.start(resetMs, () => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n\n // Compute the starting index for this search.\n // If this is a new typing session (string is empty), base it on the current\n // selection/active item; otherwise continue from the last matched index.\n const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;\n const startIndex = (prevIndex ?? 0) + 1;\n const index = getMatchingIndex(listContent, stringRef.current, startIndex);\n if (index !== -1) {\n onMatchProp?.(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n onTyping?.(false);\n }\n });\n const onBlur = useStableCallback(event => {\n const next = event.relatedTarget;\n const currentDomReferenceElement = store.select('domReferenceElement');\n const currentFloatingElement = store.select('floatingElement');\n const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);\n\n // Keep the session if focus moves within the composite (reference <-> floating).\n if (withinComposite) {\n return;\n }\n\n // End the current typing session when focus leaves the composite entirely.\n timeout.clear();\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n useIsoLayoutEffect(() => {\n if (!open && selectedIndex !== null) {\n return;\n }\n timeout.clear();\n matchIndexRef.current = null;\n if (stringRef.current !== '') {\n stringRef.current = '';\n }\n }, [open, selectedIndex, timeout]);\n useIsoLayoutEffect(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n }, [open, selectedIndex, activeIndex]);\n const sharedProps = React.useMemo(() => ({\n onKeyDown,\n onBlur\n }), [onKeyDown, onBlur]);\n return React.useMemo(() => enabled ? {\n reference: sharedProps,\n floating: sharedProps\n } : {}, [enabled, sharedProps]);\n}"],"names":["useTypeahead","context","props","listRef","elementsRef","activeIndex","onMatchProp","disabledIndices","onTyping","enabled","resetMs","selectedIndex","store","open","timeout","useTimeout","stringRef","React","prevIndexRef","matchIndexRef","onKeyDown","useStableCallback","event","isVisible","index","element","isElementVisible","isItemAvailable","isListIndexDisabled","EMPTY_ARRAY","getMatchingIndex","list","string","startIndex","normalizedStartIndex","lowerString","offset","listContent","stopEvent","isNewSession","text","onBlur","next","currentDomReferenceElement","currentFloatingElement","contains","useIsoLayoutEffect","sharedProps"],"mappings":";;;;;;;;AAeO,SAASA,GAAaC,GAASC,GAAO;AAC3C,QAAM;AAAA,IACJ,SAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAASC;AAAA,IACT,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,eAAAC,IAAgB;AAAA,EACpB,IAAMT,GACEU,IAAQ,eAAeX,IAAUA,EAAQ,YAAYA,GACrDY,IAAOD,EAAM,SAAS,MAAM,GAC5BE,IAAUC,EAAU,GACpBC,IAAYC,EAAM,OAAO,EAAE,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