@rpcbase/ui 0.247.0 → 0.248.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/components/Notifications/NotificationsDrawer.d.ts.map +1 -1
- package/dist/index105.js +36 -36
- package/dist/index117.js +6 -6
- package/dist/index120.js +10 -10
- package/dist/index122.js +2 -2
- package/dist/index123.js +3 -3
- package/dist/index124.js +1 -1
- package/dist/index126.js +2 -2
- package/dist/index128.js +2 -2
- package/dist/index150.js +3 -3
- package/dist/index156.js +1 -1
- package/dist/index16.js +157 -157
- package/dist/index16.js.map +1 -1
- package/dist/index163.js +2 -2
- package/dist/index164.js +7 -7
- package/dist/index167.js +4 -4
- package/dist/index169.js +1 -1
- package/dist/index171.js +14 -58
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +68 -8
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +37 -87
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +13 -19
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +23 -16
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +111 -5
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +13 -6
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +4 -6
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -5
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +5 -7
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +11 -16
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +19 -4
- 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 -12
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +279 -9
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +4 -13
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +28 -14
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +126 -4
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +63 -5
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +8 -6
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +16 -6
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +29 -53
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +69 -8
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +58 -4
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +8 -4
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +87 -8
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +19 -4
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +16 -4
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +5 -3
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +5 -10
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +6 -9
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +4 -9
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +6 -10
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +16 -10
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +4 -9
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +4 -6
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +12 -5
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +9 -4
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +13 -5
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +13 -6
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +4 -5
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +5 -16
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +6 -7
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -10
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +54 -10
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +8 -21
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +4 -8
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +4 -9
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +8 -9
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +4 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +4 -5
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -16
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +9 -18
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +9 -20
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +10 -12
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +10 -29
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +9 -12
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +6 -25
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -5
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +4 -14
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +5 -68
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +7 -38
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +6 -14
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +16 -23
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +7 -111
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +11 -13
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +10 -4
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +22 -4
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +9 -5
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +9 -11
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +9 -19
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +5 -11
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -176
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +15 -278
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +9 -4
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +19 -28
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +18 -124
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +12 -63
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +29 -8
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +12 -15
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +25 -30
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +5 -69
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +20 -155
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +65 -31
- 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 -49
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +11 -9
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +3 -11
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +48 -41
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +4 -98
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +27 -84
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +14 -103
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +5 -52
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +21 -11
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +53 -4
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +20 -37
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +41 -8
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +39 -3
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +46 -10
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +18 -133
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +69 -16
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +17 -15
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +3 -36
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +11 -20
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +13 -8
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +18 -24
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +35 -27
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +239 -16
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +253 -20
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +66 -64
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +99 -6
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +83 -5
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +3 -11
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +29 -3
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -50
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +35 -4
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +16 -28
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +3 -16
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +26 -5
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +27 -20
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -54
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +76 -18
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +268 -37
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +11 -39
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +10 -45
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +25 -20
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +15 -69
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +122 -14
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +5 -3
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +65 -11
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -14
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7 -18
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -36
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +3 -239
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -252
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +7 -68
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +128 -94
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +391 -75
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +5 -4
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +51 -28
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +10 -15
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +28 -35
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +11 -17
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +154 -3
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +31 -25
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +11 -28
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +50 -4
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +9 -78
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +10 -271
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +43 -11
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +97 -10
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +86 -25
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +104 -15
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +50 -123
- 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 -65
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +37 -13
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +8 -7
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +135 -5
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +17 -3
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +15 -10
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +3 -7
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +32 -129
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +18 -397
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +10 -5
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +8 -52
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +8 -11
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +11 -27
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +2 -2
- package/dist/index340.js +8 -11
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +13 -4
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +4 -18
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +3 -12
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +16 -7
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +22 -9
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +27 -7
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +14 -11
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +51 -3
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +61 -3
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +5 -5
- package/dist/index350.js +65 -16
- package/dist/index350.js.map +1 -1
- package/dist/index352.js +8 -51
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +5 -62
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +11 -66
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +21 -8
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +17 -5
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +8 -12
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +144 -21
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +77 -14
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +11 -11
- package/dist/index360.js +62 -8
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +15 -145
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +4 -79
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +17 -61
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +13 -15
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +4 -5
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +10 -19
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +6 -4
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +3 -6
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +21 -3
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +3 -3
- package/dist/index370.js +44 -11
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +17 -20
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +5 -45
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +198 -15
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +74 -5
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +115 -192
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +4 -73
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +19 -122
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +8 -4
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +27 -5
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +4 -4
- package/dist/index380.js +138 -4
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +12 -15
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +46 -8
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +3 -5
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +21 -4
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +72 -542
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +11 -46
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +3 -17
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +71 -5
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +35 -7
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +5 -5
- package/dist/index390.js +7 -7
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +15 -7
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +4 -11
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +4 -8
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +4 -13
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +15 -8
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +9 -27
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +5 -137
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +4 -12
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +543 -44
- package/dist/index399.js.map +1 -1
- package/dist/index40.js +3 -3
- package/dist/index400.js +47 -4
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +17 -21
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +5 -75
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +8 -12
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +6 -3
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +7 -71
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +11 -35
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +9 -7
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +12 -15
- package/dist/index408.js.map +1 -1
- package/dist/index41.js +10 -10
- package/dist/index411.js +14 -4
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +3 -56
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +490 -66
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +5 -31
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +56 -9
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +61 -146
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +26 -103
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +9 -15
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +153 -3
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +106 -490
- package/dist/index420.js.map +1 -1
- package/dist/index49.js +36 -36
- package/dist/index50.js +29 -29
- package/dist/index51.js +2 -2
- package/dist/index52.js +12 -12
- package/dist/index53.js +4 -4
- package/dist/index54.js +1 -1
- package/dist/index55.js +21 -21
- package/dist/index56.js +5 -5
- package/dist/index57.js +5 -5
- package/dist/index58.js +8 -8
- package/dist/index59.js +5 -5
- package/dist/index60.js +17 -17
- package/dist/index61.js +5 -5
- package/dist/index62.js +3 -3
- package/package.json +1 -1
package/dist/index244.js
CHANGED
|
@@ -1,180 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useStableCallback as p } from "./index288.js";
|
|
6
|
-
import { useIsoLayoutEffect as s } from "./index287.js";
|
|
7
|
-
import { FOCUSABLE_ATTRIBUTE as v } from "./index407.js";
|
|
8
|
-
import { useFloatingParentNodeId as C } from "./index403.js";
|
|
9
|
-
import { useSyncedFloatingRootContext as E } from "./index406.js";
|
|
10
|
-
import { useTransitionStatus as I } from "./index295.js";
|
|
11
|
-
import { useOpenChangeComplete as O } from "./index242.js";
|
|
12
|
-
import { createChangeEventDetails as S } from "./index235.js";
|
|
13
|
-
import { none as P } from "./index237.js";
|
|
14
|
-
const L = {
|
|
15
|
-
tabIndex: -1,
|
|
16
|
-
[v]: ""
|
|
17
|
-
};
|
|
18
|
-
function z(e) {
|
|
19
|
-
return (t) => t === "touch" ? e.current : !0;
|
|
20
|
-
}
|
|
21
|
-
function V(e, t, i = !1) {
|
|
22
|
-
const r = T(), u = C() != null, o = a.useRef(null);
|
|
23
|
-
e === void 0 && o.current === null && (o.current = t(r, u));
|
|
24
|
-
const n = e ?? o.current;
|
|
25
|
-
return E({
|
|
26
|
-
popupStore: n,
|
|
27
|
-
treatPopupAsFloatingElement: i,
|
|
28
|
-
floatingRootContext: n.state.floatingRootContext,
|
|
29
|
-
floatingId: r,
|
|
30
|
-
nested: u,
|
|
31
|
-
onOpenChange: n.setOpen
|
|
32
|
-
}), {
|
|
33
|
-
store: n,
|
|
34
|
-
internalStore: o.current
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function R(e, t) {
|
|
38
|
-
const i = a.useRef(null), r = a.useRef(null);
|
|
39
|
-
return a.useCallback((u) => {
|
|
40
|
-
if (e === void 0)
|
|
41
|
-
return;
|
|
42
|
-
let o = !1;
|
|
43
|
-
if (i.current !== null) {
|
|
44
|
-
const n = i.current, g = r.current, l = t.context.triggerElements.getById(n);
|
|
45
|
-
g && l === g && (t.context.triggerElements.delete(n), o = !0), i.current = null, r.current = null;
|
|
46
|
-
}
|
|
47
|
-
if (u !== null && (i.current = e, r.current = u, t.context.triggerElements.add(e, u), o = !0), o) {
|
|
48
|
-
const n = t.context.triggerElements.size;
|
|
49
|
-
t.select("open") && t.state.triggerCount !== n && t.set("triggerCount", n);
|
|
50
|
-
}
|
|
51
|
-
}, [t, e]);
|
|
52
|
-
}
|
|
53
|
-
function j(e, t, i, r = !1) {
|
|
54
|
-
t ? e.preventUnmountingOnClose = !1 : r && (e.preventUnmountingOnClose = !0);
|
|
55
|
-
const u = i?.id ?? null;
|
|
56
|
-
(u || t) && (e.activeTriggerId = u, e.activeTriggerElement = i ?? null);
|
|
57
|
-
}
|
|
58
|
-
function q(e, t, i, r) {
|
|
59
|
-
const u = i.useState("isMountedByTrigger", e), o = R(e, i), n = p((g) => {
|
|
60
|
-
if (o(g), !g)
|
|
61
|
-
return;
|
|
62
|
-
const l = i.select("open"), c = i.select("activeTriggerId");
|
|
63
|
-
if (c === e) {
|
|
64
|
-
i.update({
|
|
65
|
-
activeTriggerElement: g,
|
|
66
|
-
...l ? r : null
|
|
67
|
-
});
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
c == null && l && i.update({
|
|
71
|
-
activeTriggerId: e,
|
|
72
|
-
activeTriggerElement: g,
|
|
73
|
-
...r
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return s(() => {
|
|
77
|
-
u && i.update({
|
|
78
|
-
activeTriggerElement: t.current,
|
|
79
|
-
...r
|
|
80
|
-
});
|
|
81
|
-
}, [u, i, t, ...Object.values(r)]), {
|
|
82
|
-
registerTrigger: n,
|
|
83
|
-
isMountedByThisTrigger: u
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function w(e, t = {}) {
|
|
87
|
-
const {
|
|
88
|
-
closeOnActiveTriggerUnmount: i = !1
|
|
89
|
-
} = t, r = e.useState("open"), u = e.useState("triggerCount");
|
|
90
|
-
s(() => {
|
|
91
|
-
if (!r) {
|
|
92
|
-
e.state.triggerCount !== 0 && e.set("triggerCount", 0);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const o = e.context.triggerElements.size, n = {};
|
|
96
|
-
e.state.triggerCount !== o && (n.triggerCount = o);
|
|
97
|
-
const g = e.select("activeTriggerId");
|
|
98
|
-
let l = null;
|
|
99
|
-
if (g) {
|
|
100
|
-
const c = e.context.triggerElements.getById(g);
|
|
101
|
-
c ? c !== e.state.activeTriggerElement && (n.activeTriggerElement = c) : l = g;
|
|
102
|
-
}
|
|
103
|
-
if (!l && !g && o === 1) {
|
|
104
|
-
const c = e.context.triggerElements.entries().next();
|
|
105
|
-
if (!c.done) {
|
|
106
|
-
const [m, d] = c.value;
|
|
107
|
-
n.activeTriggerId = m, n.activeTriggerElement = d;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
(n.triggerCount !== void 0 || n.activeTriggerId !== void 0 || n.activeTriggerElement !== void 0) && e.update(n), l && i && queueMicrotask(() => {
|
|
111
|
-
if (e.select("open") && e.select("activeTriggerId") === l && !e.context.triggerElements.getById(l)) {
|
|
112
|
-
const c = S(P);
|
|
113
|
-
e.setOpen(!1, c), c.isCanceled || e.update({
|
|
114
|
-
activeTriggerId: null,
|
|
115
|
-
activeTriggerElement: null
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}, [r, e, u, i]);
|
|
120
|
-
}
|
|
121
|
-
function J(e, t, i) {
|
|
122
|
-
const {
|
|
123
|
-
mounted: r,
|
|
124
|
-
setMounted: u,
|
|
125
|
-
transitionStatus: o
|
|
126
|
-
} = I(e), n = t.useState("preventUnmountingOnClose"), g = e ? !1 : n;
|
|
127
|
-
t.useSyncedValues({
|
|
128
|
-
mounted: r,
|
|
129
|
-
transitionStatus: o,
|
|
130
|
-
preventUnmountingOnClose: g
|
|
131
|
-
});
|
|
132
|
-
const l = p(() => {
|
|
133
|
-
u(!1), t.update({
|
|
134
|
-
activeTriggerId: null,
|
|
135
|
-
activeTriggerElement: null,
|
|
136
|
-
mounted: !1,
|
|
137
|
-
preventUnmountingOnClose: !1
|
|
138
|
-
}), t.context.onOpenChangeComplete?.(!1);
|
|
139
|
-
});
|
|
140
|
-
return O({
|
|
141
|
-
enabled: r && !e && !g,
|
|
142
|
-
open: e,
|
|
143
|
-
ref: t.context.popupRef,
|
|
144
|
-
onComplete() {
|
|
145
|
-
e || l();
|
|
146
|
-
}
|
|
147
|
-
}), {
|
|
148
|
-
forceUnmount: l,
|
|
149
|
-
transitionStatus: o
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function N(e, t) {
|
|
153
|
-
e.useSyncedValues(t), s(() => () => {
|
|
154
|
-
e.update({
|
|
155
|
-
activeTriggerProps: f,
|
|
156
|
-
inactiveTriggerProps: f,
|
|
157
|
-
popupProps: f
|
|
158
|
-
});
|
|
159
|
-
}, [e]);
|
|
160
|
-
}
|
|
161
|
-
function Y(e, t) {
|
|
162
|
-
s(() => {
|
|
163
|
-
!t && e.state.openMethod !== null && e.set("openMethod", null);
|
|
164
|
-
}, [t, e]), s(() => () => {
|
|
165
|
-
e.state.openMethod !== null && e.set("openMethod", null);
|
|
166
|
-
}, [e]);
|
|
1
|
+
import { useState as o } from "react";
|
|
2
|
+
function a(t, e) {
|
|
3
|
+
const [u, n] = o(t);
|
|
4
|
+
return [e === void 0 ? u : e, n];
|
|
167
5
|
}
|
|
168
6
|
export {
|
|
169
|
-
|
|
170
|
-
z as createDefaultInitialFocus,
|
|
171
|
-
j as setPopupOpenState,
|
|
172
|
-
w as useImplicitActiveTrigger,
|
|
173
|
-
J as useOpenStateTransitions,
|
|
174
|
-
N as usePopupInteractionProps,
|
|
175
|
-
Y as usePopupRootSync,
|
|
176
|
-
V as usePopupStore,
|
|
177
|
-
q as useTriggerDataForwarding,
|
|
178
|
-
R as useTriggerRegistration
|
|
7
|
+
a as useControlledValue
|
|
179
8
|
};
|
|
180
9
|
//# sourceMappingURL=index244.js.map
|
package/dist/index244.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index244.js","sources":["../../../node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\nexport function usePopupStore(externalStore, createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const internalStoreRef = React.useRef(null);\n if (externalStore === undefined && internalStoreRef.current === null) {\n internalStoreRef.current = createStore(floatingId, nested);\n }\n const store = externalStore ?? internalStoreRef.current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return {\n store,\n internalStore: internalStoreRef.current\n };\n}\n\n/**\n * Returns a callback ref that registers/unregisters the trigger element in the store.\n *\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n // Keep track of the currently registered element to unregister it on unmount or id change.\n const registeredElementIdRef = React.useRef(null);\n const registeredElementRef = React.useRef(null);\n return React.useCallback(element => {\n if (id === undefined) {\n return;\n }\n let shouldSyncTriggerCount = false;\n if (registeredElementIdRef.current !== null) {\n const registeredId = registeredElementIdRef.current;\n const registeredElement = registeredElementRef.current;\n const currentElement = store.context.triggerElements.getById(registeredId);\n if (registeredElement && currentElement === registeredElement) {\n store.context.triggerElements.delete(registeredId);\n shouldSyncTriggerCount = true;\n }\n registeredElementIdRef.current = null;\n registeredElementRef.current = null;\n }\n if (element !== null) {\n registeredElementIdRef.current = id;\n registeredElementRef.current = element;\n store.context.triggerElements.add(id, element);\n shouldSyncTriggerCount = true;\n }\n if (shouldSyncTriggerCount) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n }\n }, [store, id]);\n}\nexport function setPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n state.preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n state.preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n state.activeTriggerId = triggerId;\n state.activeTriggerElement = trigger ?? null;\n }\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n // Spread `extraState` first so `open` always reflects `nextOpen`, keeping it in\n // sync with the value already passed to `dispatchOpenChange`/`setPopupOpenState`.\n const updatedState = {\n ...options.extraState,\n open: nextOpen\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\nexport function useInitialOpenSync(store, openProp, defaultOpen, defaultTriggerId) {\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen) {\n // Avoid notifying detached trigger subscribers while the Root is rendering.\n store.state = {\n ...store.state,\n open: true,\n activeTriggerId: defaultTriggerId,\n preventUnmountingOnClose: false\n };\n }\n });\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (!element) {\n return;\n }\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n store.update({\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n });\n return;\n }\n if (activeTriggerId == null && open) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work.\n store.update({\n activeTriggerId: triggerId,\n activeTriggerElement: element,\n ...stateUpdates\n });\n }\n });\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n store.update({\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger. When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger unregisters, the\n * default path preserves existing ownership so non-closing popup families do not silently claim a\n * different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering the active trigger requests a close\n * after a microtask so a same-tick replacement trigger with the same id can register first.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n useIsoLayoutEffect(() => {\n if (!open) {\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const activeTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (activeTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(activeTriggerId);\n if (!activeTriggerElement) {\n lostActiveTriggerId = activeTriggerId;\n } else if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n if (!lostActiveTriggerId && !activeTriggerId && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n *\n * @returns A function to forcibly unmount the popup.\n */\nexport function useOpenStateTransitions(open, store, onUnmount) {\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');\n // Opening starts a new close cycle. Clear during render so the close-completion hook below\n // reads the synchronized value on the same pass.\n const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose;\n store.useSyncedValues({\n mounted,\n transitionStatus,\n preventUnmountingOnClose: syncedPreventUnmountingOnClose\n });\n const forceUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !syncedPreventUnmountingOnClose,\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}"],"names":["FOCUSABLE_POPUP_PROPS","FOCUSABLE_ATTRIBUTE","createDefaultInitialFocus","popupRef","interactionType","usePopupStore","externalStore","createStore","treatPopupAsFloatingElement","floatingId","useId","nested","useFloatingParentNodeId","internalStoreRef","React","store","useSyncedFloatingRootContext","useTriggerRegistration","id","registeredElementIdRef","registeredElementRef","element","shouldSyncTriggerCount","registeredId","registeredElement","currentElement","triggerCount","setPopupOpenState","state","open","trigger","preventUnmountOnClose","triggerId","useTriggerDataForwarding","triggerElementRef","stateUpdates","isMountedByThisTrigger","baseRegisterTrigger","registerTrigger","useStableCallback","activeTriggerId","useIsoLayoutEffect","useImplicitActiveTrigger","options","closeOnActiveTriggerUnmount","reactiveTriggerCount","lostActiveTriggerId","activeTriggerElement","iteratorResult","implicitTriggerId","implicitTriggerElement","eventDetails","createChangeEventDetails","REASONS.none","useOpenStateTransitions","onUnmount","mounted","setMounted","transitionStatus","useTransitionStatus","preventUnmountingOnClose","syncedPreventUnmountingOnClose","forceUnmount","useOpenChangeComplete","usePopupInteractionProps","statePart","EMPTY_OBJECT","usePopupRootSync"],"mappings":"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","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index244.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js"],"sourcesContent":["import { useState } from \"react\";\n/**\n * A custom hook for managing both controlled and uncontrolled component states.\n *\n * This hook allows a component to support both controlled and uncontrolled\n * states by determining whether the `controlledValue` is provided. If it is\n * undefined, the hook falls back to using the internal state.\n *\n * @example\n * // Uncontrolled usage\n * const [value, setValue] = useControlledValue(0, undefined);\n *\n * // Controlled usage\n * const [value, setValue] = useControlledValue(0, props.value);\n *\n * @template T - The type of the value.\n * @param defaultValue The initial value for the uncontrolled state.\n * @param controlledValue The value for the controlled state. If undefined, the\n * component will use the uncontrolled state.\n * @returns A tuple where the first element is the current value (either\n * controlled or uncontrolled) and the second element is a setter function to\n * update the value.\n */\nexport function useControlledValue(defaultValue, controlledValue) {\n const [uncontrolledValue, setValue] = useState(defaultValue);\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n return [value, setValue];\n}\n"],"names":["useControlledValue","defaultValue","controlledValue","uncontrolledValue","setValue","useState"],"mappings":";AAuBO,SAASA,EAAmBC,GAAcC,GAAiB;AAC9D,QAAM,CAACC,GAAmBC,CAAQ,IAAIC,EAASJ,CAAY;AAE3D,SAAO,CADOC,MAAoB,SAAYC,IAAoBD,GACnDE,CAAQ;AAC3B;","x_google_ignoreList":[0]}
|
package/dist/index245.js
CHANGED
|
@@ -1,283 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { useIsoLayoutEffect as W } from "./index287.js";
|
|
9
|
-
import { useTimeout as Fe } from "./index311.js";
|
|
10
|
-
import { useAnimationFrame as Ue } from "./index327.js";
|
|
11
|
-
import { ownerDocument as O } from "./index310.js";
|
|
12
|
-
import { FocusGuard as Te } from "./index396.js";
|
|
13
|
-
import { isTypeableCombobox as xe, getFloatingFocusElement as ye, isTypeableElement as $e } from "./index316.js";
|
|
14
|
-
import { isVirtualClick as ze, isVirtualPointerEvent as Je, stopEvent as Qe } from "./index339.js";
|
|
15
|
-
import { isOutsideEvent as Ie, getNextTabbable as Xe, getPreviousTabbable as Ye, tabbable as De, isTabbable as ie, focusable as Ze } from "./index397.js";
|
|
16
|
-
import { getNodeAncestors as ve, getNodeChildren as he } from "./index398.js";
|
|
17
|
-
import { isElementVisible as et } from "./index399.js";
|
|
18
|
-
import { createChangeEventDetails as tt } from "./index235.js";
|
|
19
|
-
import { createAttribute as Ae } from "./index400.js";
|
|
20
|
-
import { enqueueFocus as se } from "./index401.js";
|
|
21
|
-
import { markOthers as Ce } from "./index402.js";
|
|
22
|
-
import { usePortalContext as nt } from "./index248.js";
|
|
23
|
-
import { useFloatingTree as rt } from "./index403.js";
|
|
24
|
-
import { CLICK_TRIGGER_IDENTIFIER as ot } from "./index251.js";
|
|
25
|
-
import { resolveRef as w } from "./index404.js";
|
|
26
|
-
import { j as ue } from "./index30.js";
|
|
27
|
-
import { activeElement as N, contains as c, getTarget as z } from "./index317.js";
|
|
28
|
-
import { triggerHover as st, outsidePress as ut, focusOut as it } from "./index237.js";
|
|
29
|
-
import { webkit as ct } from "./index336.js";
|
|
30
|
-
function ft(n, D) {
|
|
31
|
-
const M = Be(z(n));
|
|
32
|
-
return n instanceof M.KeyboardEvent ? "keyboard" : n instanceof M.FocusEvent ? D || "keyboard" : "pointerType" in n ? n.pointerType || "keyboard" : "touches" in n ? "touch" : n instanceof M.MouseEvent ? D || (n.detail === 0 ? "keyboard" : "mouse") : "";
|
|
1
|
+
import { DayFlag as s } from "./index118.js";
|
|
2
|
+
var d;
|
|
3
|
+
(function(e) {
|
|
4
|
+
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
5
|
+
})(d || (d = {}));
|
|
6
|
+
function l(e) {
|
|
7
|
+
return !e[s.disabled] && !e[s.hidden] && !e[s.outside];
|
|
33
8
|
}
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
function we() {
|
|
43
|
-
return ce(), S[S.length - 1]?.deref();
|
|
44
|
-
}
|
|
45
|
-
function at(n) {
|
|
46
|
-
return n ? ie(n) ? n : De(n)[0] || n : null;
|
|
47
|
-
}
|
|
48
|
-
function Ne(n) {
|
|
49
|
-
if (n.hasAttribute("tabindex") && !n.hasAttribute("data-tabindex") || !n.getAttribute("role")?.includes("dialog"))
|
|
50
|
-
return;
|
|
51
|
-
const M = Ze(n).filter((P) => {
|
|
52
|
-
const J = P.getAttribute("data-tabindex") || "";
|
|
53
|
-
return ie(P) || P.hasAttribute("data-tabindex") && !J.startsWith("-");
|
|
54
|
-
}), f = n.getAttribute("tabindex");
|
|
55
|
-
M.length === 0 ? f !== "0" && (n.setAttribute("tabindex", "0"), n.setAttribute("data-tabindex", "0")) : (f !== "-1" || n.hasAttribute("data-tabindex") && n.getAttribute("data-tabindex") !== "-1") && (n.setAttribute("tabindex", "-1"), n.setAttribute("data-tabindex", "-1"));
|
|
56
|
-
}
|
|
57
|
-
function Lt(n) {
|
|
58
|
-
const {
|
|
59
|
-
context: D,
|
|
60
|
-
children: M,
|
|
61
|
-
disabled: f = !1,
|
|
62
|
-
initialFocus: P = !0,
|
|
63
|
-
returnFocus: J = !0,
|
|
64
|
-
restoreFocus: Q = !1,
|
|
65
|
-
modal: g = !0,
|
|
66
|
-
closeOnFocusOut: L = !0,
|
|
67
|
-
openInteractionType: Me = "",
|
|
68
|
-
nextFocusableElement: j,
|
|
69
|
-
previousFocusableElement: H,
|
|
70
|
-
beforeContentFocusGuardRef: Pe,
|
|
71
|
-
externalTree: Ge,
|
|
72
|
-
getInsideElements: Ve
|
|
73
|
-
} = n, v = "rootStore" in D ? D.rootStore : D, T = v.useState("open"), d = v.useState("domReferenceElement"), i = v.useState("floatingElement"), {
|
|
74
|
-
events: X,
|
|
75
|
-
dataRef: G
|
|
76
|
-
} = v.context, V = oe(() => G.current.floatingContext?.nodeId), qe = P === !1, h = xe(d) && qe, fe = $(P), Y = $(J), _ = $(Me), ae = $(T), x = rt(Ge), s = nt(), y = E.useRef(!1), K = E.useRef(!1), Z = E.useRef(!1), le = E.useRef(null), de = E.useRef(""), ee = E.useRef(""), te = E.useRef(null), ne = E.useRef(null), Le = Ee(te, Pe, s?.beforeInsideRef), je = Ee(ne, s?.afterInsideRef), me = Fe(), B = Fe(), be = Ue(), He = s != null, o = ye(i), C = oe((r = o) => r ? De(r) : []), k = oe(() => Ve?.().filter((r) => r != null) ?? []);
|
|
77
|
-
E.useEffect(() => {
|
|
78
|
-
if (f || !g)
|
|
79
|
-
return;
|
|
80
|
-
function r(b) {
|
|
81
|
-
b.key === "Tab" && c(o, N(O(o))) && C().length === 0 && !h && Qe(b);
|
|
82
|
-
}
|
|
83
|
-
const a = O(o);
|
|
84
|
-
return I(a, "keydown", r);
|
|
85
|
-
}, [f, o, g, h, C]), E.useEffect(() => {
|
|
86
|
-
if (f || !T)
|
|
87
|
-
return;
|
|
88
|
-
const r = O(o);
|
|
89
|
-
function a() {
|
|
90
|
-
Z.current = !1;
|
|
91
|
-
}
|
|
92
|
-
function b(A) {
|
|
93
|
-
const e = z(A), u = k(), t = c(i, e) || c(d, e) || c(s?.portalNode, e) || u.some((l) => l === e || c(l, e));
|
|
94
|
-
Z.current = !t, ee.current = A.pointerType || "keyboard", e?.closest(`[${ot}]`) && (K.current = !0, B.start(0, () => {
|
|
95
|
-
K.current = !1;
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
function p() {
|
|
99
|
-
ee.current = "keyboard";
|
|
100
|
-
}
|
|
101
|
-
return ge(
|
|
102
|
-
I(r, "pointerdown", b, !0),
|
|
103
|
-
I(r, "pointerup", a, !0),
|
|
104
|
-
I(r, "pointercancel", a, !0),
|
|
105
|
-
I(r, "keydown", p, !0),
|
|
106
|
-
// Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)
|
|
107
|
-
// if the popup dismissed between pointerdown and pointerup.
|
|
108
|
-
a
|
|
109
|
-
);
|
|
110
|
-
}, [f, i, d, o, T, s, B, k]), E.useEffect(() => {
|
|
111
|
-
if (f || !L)
|
|
112
|
-
return;
|
|
113
|
-
const r = O(o);
|
|
114
|
-
function a() {
|
|
115
|
-
K.current = !0, B.start(0, () => {
|
|
116
|
-
K.current = !1;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function b(u) {
|
|
120
|
-
const t = z(u);
|
|
121
|
-
ie(t) && (le.current = t);
|
|
122
|
-
}
|
|
123
|
-
function p(u) {
|
|
124
|
-
const t = u.relatedTarget, l = u.currentTarget, R = z(u);
|
|
125
|
-
g && t == null && R != null && c(i, R) && Oe(R), queueMicrotask(() => {
|
|
126
|
-
const F = V(), U = v.context.triggerElements, Ke = k(), We = t?.hasAttribute(Ae("focus-guard")) && [te.current, ne.current, s?.beforeInsideRef.current, s?.afterInsideRef.current, s?.beforeOutsideRef.current, s?.afterOutsideRef.current, w(H), w(j)].includes(t), _e = !(c(d, t) || c(i, t) || c(t, i) || c(s?.portalNode, t) || Ke.some((m) => m === t || c(m, t)) || t != null && U.hasElement(t) || U.hasMatchingElement((m) => c(m, t)) || We || x && (he(x.nodesRef.current, F).find((m) => c(m.context?.elements.floating, t) || c(m.context?.elements.domReference, t)) || ve(x.nodesRef.current, F).find((m) => [m.context?.elements.floating, ye(m.context?.elements.floating)].includes(t) || m.context?.elements.domReference === t)));
|
|
127
|
-
if (l === d && o && Ne(o), Q && l !== d && !et(R) && N(r) === r.body) {
|
|
128
|
-
if (q(o) && (o.focus(), Q === "popup")) {
|
|
129
|
-
be.request(() => {
|
|
130
|
-
o.focus();
|
|
131
|
-
});
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const m = C(), re = le.current, Re = (re && m.includes(re) ? re : null) || m[m.length - 1] || o;
|
|
135
|
-
q(Re) && Re.focus();
|
|
136
|
-
}
|
|
137
|
-
if (G.current.insideReactTree) {
|
|
138
|
-
G.current.insideReactTree = !1;
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
(h || !g) && t && _e && !K.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
142
|
-
// For an "untrapped" typeable combobox (input role=combobox with
|
|
143
|
-
// initialFocus=false), re-opening the popup and tabbing out should still close it even
|
|
144
|
-
// when the previously focused element (e.g. the next tabbable outside the popup) is
|
|
145
|
-
// focused again. Otherwise, the popup remains open on the second Tab sequence:
|
|
146
|
-
// click input -> Tab (closes) -> click input -> Tab.
|
|
147
|
-
// Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
|
|
148
|
-
(h || t !== we()) && (y.current = !0, v.setOpen(!1, tt(it, u)));
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function A() {
|
|
152
|
-
Z.current || (G.current.insideReactTree = !0, me.start(0, () => {
|
|
153
|
-
G.current.insideReactTree = !1;
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
156
|
-
const e = q(d) ? d : null;
|
|
157
|
-
if (!(!i && !e))
|
|
158
|
-
return ge(e && I(e, "focusout", p), e && I(e, "pointerdown", a), i && I(i, "focusin", b), i && I(i, "focusout", p), i && s && I(i, "focusout", A, !0));
|
|
159
|
-
}, [f, d, i, o, g, x, s, v, L, Q, C, h, V, G, me, B, be, j, H, k]), E.useEffect(() => {
|
|
160
|
-
if (f || !i || !T)
|
|
161
|
-
return;
|
|
162
|
-
const r = Array.from(s?.portalNode?.querySelectorAll(`[${Ae("portal")}]`) || []), b = (x ? ve(x.nodesRef.current, V()) : []).find((l) => xe(l.context?.elements.domReference || null))?.context?.elements.domReference, A = [...[i, ...r, te.current, ne.current, s?.beforeOutsideRef.current, s?.afterOutsideRef.current, ...k()], b, w(H), w(j), h ? d : null].filter((l) => l != null), e = Ce(A, {
|
|
163
|
-
ariaHidden: g || h,
|
|
164
|
-
mark: !1
|
|
165
|
-
}), u = [i, ...r].filter((l) => l != null), t = Ce(u);
|
|
166
|
-
return () => {
|
|
167
|
-
t(), e();
|
|
168
|
-
};
|
|
169
|
-
}, [T, f, d, i, g, s, h, x, V, j, H, k]), W(() => {
|
|
170
|
-
if (!T || f || !q(o))
|
|
171
|
-
return;
|
|
172
|
-
const r = O(o), a = N(r);
|
|
173
|
-
queueMicrotask(() => {
|
|
174
|
-
const b = fe.current, p = typeof b == "function" ? b(_.current || "") : b;
|
|
175
|
-
if (p === void 0 || p === !1 || c(o, a))
|
|
176
|
-
return;
|
|
177
|
-
let e = null;
|
|
178
|
-
const u = () => (e == null && (e = C(o)), e[0] || o);
|
|
179
|
-
let t;
|
|
180
|
-
p === !0 || p === null ? t = u() : t = w(p), t = t || u();
|
|
181
|
-
const l = c(o, N(r));
|
|
182
|
-
se(t, {
|
|
183
|
-
preventScroll: t === o,
|
|
184
|
-
shouldFocus() {
|
|
185
|
-
if (!ae.current)
|
|
186
|
-
return !1;
|
|
187
|
-
if (l)
|
|
188
|
-
return !0;
|
|
189
|
-
const R = N(r);
|
|
190
|
-
return !(R !== t && c(o, R));
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
}, [f, T, o, C, fe, _, ae]), W(() => {
|
|
195
|
-
if (f || !o)
|
|
196
|
-
return;
|
|
197
|
-
const r = O(o), a = N(r), b = _.current == null;
|
|
198
|
-
Oe(a);
|
|
199
|
-
function p(e) {
|
|
200
|
-
if (e.open || (de.current = ft(e.nativeEvent, ee.current)), e.reason === st && e.nativeEvent.type === "mouseleave" && (y.current = !0), e.reason === ut)
|
|
201
|
-
if (e.nested)
|
|
202
|
-
y.current = !1;
|
|
203
|
-
else if (ze(e.nativeEvent) || Je(e.nativeEvent))
|
|
204
|
-
y.current = !1;
|
|
205
|
-
else {
|
|
206
|
-
let u = !1;
|
|
207
|
-
O(o).createElement("div").focus({
|
|
208
|
-
get preventScroll() {
|
|
209
|
-
return u = !0, !1;
|
|
210
|
-
}
|
|
211
|
-
}), u ? y.current = !1 : y.current = !0;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
X.on("openchange", p);
|
|
215
|
-
function A() {
|
|
216
|
-
const e = Y.current;
|
|
217
|
-
let u = typeof e == "function" ? e(de.current) : e;
|
|
218
|
-
if (u === void 0 || u === !1)
|
|
219
|
-
return null;
|
|
220
|
-
u === null && (u = !0);
|
|
221
|
-
const t = d?.isConnected ? d : null, l = a?.isConnected && Se(a) !== "body" ? a : null;
|
|
222
|
-
let R = b ? l || t : t || l;
|
|
223
|
-
return R || (R = we() || null), typeof u == "boolean" ? R : w(u) || R || null;
|
|
224
|
-
}
|
|
225
|
-
return () => {
|
|
226
|
-
X.off("openchange", p);
|
|
227
|
-
const e = N(r), u = k(), t = c(i, e) || u.some((F) => F === e || c(F, e)) || x && he(x.nodesRef.current, V(), !1).some((F) => c(F.context?.elements.floating, e)), l = Y.current, R = A();
|
|
228
|
-
queueMicrotask(() => {
|
|
229
|
-
const F = at(R), U = typeof l != "boolean";
|
|
230
|
-
l && !y.current && q(F) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
231
|
-
// since it likely entered a different element which should be
|
|
232
|
-
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
233
|
-
(!(!U && F !== e && e !== r.body) || t) && F.focus({
|
|
234
|
-
preventScroll: !0
|
|
235
|
-
}), y.current = !1;
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
}, [f, i, o, Y, _, X, x, d, V, k]), W(() => {
|
|
239
|
-
if (!ct || T || !i)
|
|
240
|
-
return;
|
|
241
|
-
const r = N(O(i));
|
|
242
|
-
!q(r) || !$e(r) || c(i, r) && r.blur();
|
|
243
|
-
}, [T, i]), W(() => {
|
|
244
|
-
if (!(f || !s))
|
|
245
|
-
return s.setFocusManagerState({
|
|
246
|
-
modal: g,
|
|
247
|
-
closeOnFocusOut: L,
|
|
248
|
-
open: T,
|
|
249
|
-
onOpenChange: v.setOpen,
|
|
250
|
-
domReference: d
|
|
251
|
-
}), () => {
|
|
252
|
-
s.setFocusManagerState(null);
|
|
253
|
-
};
|
|
254
|
-
}, [f, s, g, T, v, L, d]), W(() => {
|
|
255
|
-
if (!(f || !o))
|
|
256
|
-
return Ne(o), () => {
|
|
257
|
-
queueMicrotask(ce);
|
|
258
|
-
};
|
|
259
|
-
}, [f, o]);
|
|
260
|
-
const pe = !f && (g ? !h : !0) && (He || g);
|
|
261
|
-
return /* @__PURE__ */ ue.jsxs(E.Fragment, {
|
|
262
|
-
children: [pe && /* @__PURE__ */ ue.jsx(Te, {
|
|
263
|
-
"data-type": "inside",
|
|
264
|
-
ref: Le,
|
|
265
|
-
onFocus: (r) => {
|
|
266
|
-
if (g) {
|
|
267
|
-
const a = C();
|
|
268
|
-
se(a[a.length - 1]);
|
|
269
|
-
} else s?.portalNode && (y.current = !1, Ie(r, s.portalNode) ? Xe(d)?.focus() : w(H ?? s.beforeOutsideRef)?.focus());
|
|
270
|
-
}
|
|
271
|
-
}), M, pe && /* @__PURE__ */ ue.jsx(Te, {
|
|
272
|
-
"data-type": "inside",
|
|
273
|
-
ref: je,
|
|
274
|
-
onFocus: (r) => {
|
|
275
|
-
g ? se(C()[0]) : s?.portalNode && (L && (y.current = !0), Ie(r, s.portalNode) ? Ye(d)?.focus() : w(j ?? s.afterOutsideRef)?.focus());
|
|
276
|
-
}
|
|
277
|
-
})]
|
|
278
|
-
});
|
|
9
|
+
function F(e, u, t, n) {
|
|
10
|
+
let f, c = -1;
|
|
11
|
+
for (const o of e) {
|
|
12
|
+
const a = u(o);
|
|
13
|
+
l(a) && (a[s.focused] && c < d.FocusedModifier ? (f = o, c = d.FocusedModifier) : n?.isEqualTo(o) && c < d.LastFocused ? (f = o, c = d.LastFocused) : t(o.date) && c < d.Selected ? (f = o, c = d.Selected) : a[s.today] && c < d.Today && (f = o, c = d.Today));
|
|
14
|
+
}
|
|
15
|
+
return f || (f = e.find((o) => l(u(o)))), f;
|
|
279
16
|
}
|
|
280
17
|
export {
|
|
281
|
-
|
|
18
|
+
F as calculateFocusTarget
|
|
282
19
|
};
|
|
283
20
|
//# sourceMappingURL=index245.js.map
|