@rpcbase/ui 0.250.0 → 0.252.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/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/index163.js +2 -2
- package/dist/index164.js +7 -7
- package/dist/index167.js +1 -1
- package/dist/index169.js +1 -1
- package/dist/index172.js +3 -3
- package/dist/index175.js +1 -1
- package/dist/index176.js +4 -4
- package/dist/index178.js +1 -1
- package/dist/index182.js +2 -2
- package/dist/index184.js +5 -5
- package/dist/index185.js +13 -13
- package/dist/index186.js +1 -1
- package/dist/index188.js +6 -6
- package/dist/index189.js +3 -3
- package/dist/index192.js +2 -2
- package/dist/index193.js +6 -6
- package/dist/index194.js +59 -20
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +8 -66
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +87 -6
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +19 -5
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +16 -11
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +5 -3
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +4 -49
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +7 -4
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +4 -29
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +6 -16
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +16 -5
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +4 -21
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +4 -53
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +12 -20
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +9 -41
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +13 -39
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +14 -46
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +4 -20
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +5 -70
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +6 -17
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -3
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +54 -11
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +8 -13
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +4 -18
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +4 -36
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +8 -239
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +4 -252
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +4 -68
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -99
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -83
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +9 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +9 -29
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +10 -16
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +11 -35
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +9 -17
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +6 -3
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -26
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +4 -28
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +6 -4
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +6 -78
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -272
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +15 -10
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +7 -10
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -25
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +10 -16
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +21 -125
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +8 -5
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +9 -65
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +10 -14
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +4 -7
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -5
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +16 -3
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +9 -10
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +18 -7
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +19 -132
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +10 -397
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +30 -5
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +12 -52
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +25 -11
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +5 -27
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +153 -10
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +32 -58
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +11 -8
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +43 -81
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +9 -19
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +11 -16
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +42 -4
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +96 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +86 -6
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +105 -4
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +52 -6
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +11 -16
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +4 -4
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +37 -4
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +8 -12
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +135 -9
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +17 -13
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +15 -13
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +3 -4
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +36 -5
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +20 -6
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +9 -5
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +8 -54
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +20 -9
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +66 -4
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +6 -4
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +5 -8
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +11 -4
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +3 -4
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +50 -3
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +4 -11
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +29 -9
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -9
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +5 -10
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +21 -10
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +53 -9
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +20 -6
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +41 -5
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +39 -4
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +46 -6
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +20 -6
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +70 -5
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +17 -16
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +3 -7
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +11 -10
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +13 -10
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +18 -21
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +36 -8
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +239 -9
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +252 -9
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +68 -4
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +99 -5
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +82 -15
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +3 -9
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +28 -17
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +16 -20
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +35 -13
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +17 -29
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +3 -12
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +26 -25
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +28 -5
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -155
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +77 -31
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +272 -11
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +11 -49
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +10 -9
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +25 -11
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +15 -42
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +119 -91
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +5 -86
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +58 -98
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +12 -51
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +7 -11
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +5 -4
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +3 -37
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +10 -8
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +7 -3
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +127 -129
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +399 -17
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +5 -16
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +50 -34
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +11 -20
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +27 -9
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +11 -8
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +2 -2
- package/dist/index341.js +1 -1
- package/dist/index347.js +17 -51
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +51 -5
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +5 -61
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +60 -65
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +65 -16
- package/dist/index351.js.map +1 -1
- package/dist/index357.js +1 -1
- package/dist/index358.js +5 -5
- package/dist/index359.js +1 -1
- package/dist/index362.js +5 -4
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +18 -6
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +13 -3
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +4 -11
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +20 -20
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +4 -45
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +6 -18
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +3 -5
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +10 -199
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +20 -73
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +43 -122
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +18 -5
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +4 -17
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +200 -12
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +73 -4
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +122 -19
- package/dist/index377.js.map +1 -1
- package/dist/index379.js +4 -4
- package/dist/index380.js +3 -3
- package/dist/index382.js +1 -1
- package/dist/index384.js +1 -1
- package/dist/index385.js +2 -2
- package/dist/index388.js +2 -2
- package/dist/index389.js +2 -2
- package/dist/index392.js +5 -3
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +5 -3
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +4 -5
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +15 -4
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +9 -4
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +5 -15
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +4 -8
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +545 -5
- package/dist/index399.js.map +1 -1
- package/dist/index400.js +47 -5
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +15 -543
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +6 -47
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +7 -17
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +6 -5
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +7 -7
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +11 -6
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +8 -7
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +12 -11
- package/dist/index408.js.map +1 -1
- package/dist/index409.js +3 -9
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +3 -13
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +15 -3
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +3 -15
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +1 -1
- package/dist/index414.js +4 -7
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +56 -2
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +67 -43
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +31 -56
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +9 -8
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +153 -2
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +107 -54
- package/dist/index420.js.map +1 -1
- package/dist/index421.js +7 -55
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +2 -33
- package/dist/index422.js.map +1 -1
- package/dist/index423.js +43 -4
- package/dist/index423.js.map +1 -1
- package/dist/index424.js +55 -55
- package/dist/index424.js.map +1 -1
- package/dist/index425.js +8 -68
- package/dist/index425.js.map +1 -1
- package/dist/index426.js +2 -31
- package/dist/index426.js.map +1 -1
- package/dist/index427.js +55 -9
- package/dist/index427.js.map +1 -1
- package/dist/index428.js +55 -152
- package/dist/index428.js.map +1 -1
- package/dist/index429.js +32 -107
- package/dist/index429.js.map +1 -1
- package/dist/index430.js +16 -2
- package/dist/index430.js.map +1 -1
- package/dist/index431.js +29 -2
- package/dist/index431.js.map +1 -1
- package/dist/index432.js +13 -2
- package/dist/index432.js.map +1 -1
- package/dist/index433.js +7 -2
- package/dist/index433.js.map +1 -1
- package/dist/index434.js +2 -16
- package/dist/index434.js.map +1 -1
- package/dist/index435.js +2 -29
- package/dist/index435.js.map +1 -1
- package/dist/index436.js +2 -13
- package/dist/index436.js.map +1 -1
- package/dist/index437.js +2 -7
- package/dist/index437.js.map +1 -1
- package/dist/index49.js +30 -30
- package/dist/index50.js +21 -21
- package/dist/index51.js +1 -1
- package/dist/index52.js +8 -8
- package/dist/index53.js +2 -2
- package/dist/index55.js +16 -16
- package/dist/index56.js +4 -4
- package/dist/index57.js +3 -3
- package/dist/index58.js +7 -7
- package/dist/index59.js +4 -4
- package/dist/index60.js +12 -12
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/package.json +1 -1
package/dist/index219.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index219.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs"],"sourcesContent":["'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(context, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return undefined;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const compositionTimeout = new Timeout();\n const preventedPressSuppressionTimeout = new Timeout();\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // In intentional mode, a press that starts inside and ends outside gets\n // one suppressed outside click. Run this after inside-target checks so\n // inside clicks don't consume the one-shot suppression.\n if (getOutsidePressEvent() === 'intentional' && suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n if (event.type === 'pointerdown') {\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const doc = ownerDocument(floatingElement);\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, true), addEventListener(doc, 'touchmove', handleTouchMoveCapture, true), addEventListener(doc, 'touchend', handleTouchEndCapture, true)));\n return () => {\n unsubscribe();\n compositionTimeout.clear();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]);\n React.useEffect(clearInsideReactTree, [outsidePress, clearInsideReactTree]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}"],"names":["alwaysFalse","normalizeProp","normalizable","useDismiss","context","props","enabled","escapeKey","outsidePressProp","outsidePressEvent","referencePress","bubbles","externalTree","store","open","floatingElement","dataRef","tree","useFloatingTree","outsidePressFn","useStableCallback","outsidePress","outsidePressEnabled","getOutsidePressEventProp","escapeKeyBubbles","outsidePressBubbles","pressStartedInsideRef","React","pressStartPreventedRef","suppressNextOutsideClickRef","isComposingRef","currentPointerTypeRef","touchStateRef","cancelDismissOnEndTimeout","useTimeout","clearInsideReactTreeTimeout","clearInsideReactTree","hasBlockingChild","bubbleKey","nodeId","getNodeChildren","child","isEventWithinOwnElements","event","isEventTargetWithin","closeOnReferencePress","createChangeEventDetails","REASONS.triggerPress","closeOnEscapeKeyDown","native","isReactEvent","eventDetails","REASONS.escapeKey","markInsideReactTree","markPressStartedInsideReactTree","target","getTarget","contains","markInsidePressStartPrevented","compositionTimeout","Timeout","preventedPressSuppressionTimeout","handleCompositionStart","handleCompositionEnd","platform.engine.webkit","suppressImmediateOutsideClickAfterPreventedStart","resetPressStartState","getOutsidePressEvent","type","computedType","outsidePressEventValue","resolved","shouldIgnoreEvent","computedOutsidePressEvent","isEventWithinFloatingTree","targetIsInsideChildren","node","closeOnPressOutside","inertSelector","createAttribute","targetRoot","isElement","markers","isShadowRoot","ownerDocument","triggers","trigger","targetRootAncestor","isLastTraversableNode","nextParent","getParentNode","isRootElement","marker","isHTMLElement","lastTraversableNode","style","getComputedStyle","scrollRe","isScrollableX","isScrollableY","canScrollX","canScrollY","isRTL","pressedVerticalScrollbar","pressedHorizontalScrollbar","REASONS.outsidePress","handlePointerDown","handleTouchStart","touch","addTargetEventListenerOnce","listener","unsubscribe","addEventListener","handleTouchStartCapture","closeOnPressOutsideCapture","targetEvent","handlePressEndCapture","pressStartedInsideDefaultPrevented","handleTouchMove","deltaX","deltaY","distance","handleTouchMoveCapture","handleTouchEnd","handleTouchEndCapture","doc","mergeCleanups","reference","floating"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAASA,KAAc;AACrB,SAAO;AACT;AACO,SAASC,GAAcC,GAAc;AAC1C,SAAO;AAAA,IACL,WAAW,OAAOA,KAAiB,YAAYA,IAAeA,G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B,GACnBC,EAAgCX,CAAK;AAAA,IACvC;AAAA,IACA,qBAAqBA,GAAO;AAC1B,MAAAU,EAAmB,GACnBC,EAAgCX,CAAK;AAAA,IACvC;AAAA,IACA,kBAAkBU;AAAA,IAClB,mBAAmBA;AAAA,IACnB,oBAAoBA;AAAA,EACxB,IAAM,CAACL,GAAsBK,GAAqBC,GAAiCI,CAA6B,CAAC;AAC/G,SAAO/B,EAAM,QAAQ,MAAMrB,IAAU;AAAA,IACnC,WAAAyH;AAAA,IACA,UAAAC;AAAA,IACA,SAASD;AAAA,EACb,IAAM,CAAA,GAAI,CAACzH,GAASyH,GAAWC,EAAQ,CAAC;AACxC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index219.js","sources":["../../../node_modules/date-fns/getWeek.js"],"sourcesContent":["import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n"],"names":["getWeek","date","options","_date","toDate","diff","startOfWeek","startOfWeekYear","millisecondsInWeek"],"mappings":";;;;AA2CO,SAASA,EAAQC,GAAMC,GAAS;AACrC,QAAMC,IAAQC,EAAOH,GAAMC,GAAS,EAAE,GAChCG,IAAO,CAACC,EAAYH,GAAOD,CAAO,IAAI,CAACK,EAAgBJ,GAAOD,CAAO;AAK3E,SAAO,KAAK,MAAMG,IAAOG,CAAkB,IAAI;AACjD;","x_google_ignoreList":[0]}
|
package/dist/index220.js
CHANGED
|
@@ -1,256 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { ownerDocument as be } from "./index224.js";
|
|
5
|
-
import { useStableCallback as S } from "./index202.js";
|
|
6
|
-
import { useValueAsRef as k } from "./index203.js";
|
|
7
|
-
import { isHTMLElement as Pe } from "./index248.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 "./index230.js";
|
|
13
|
-
import { enqueueFocus as He } from "./index384.js";
|
|
14
|
-
import { stopEvent as P, isVirtualClick as Ge, isVirtualPointerEvent as $e } from "./index253.js";
|
|
15
|
-
import { activeElement as ue, contains as se, getTarget as Be } from "./index231.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
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function $(c, d) {
|
|
29
|
-
return U(d, c === Se || c === le, c === B || c === Q);
|
|
30
|
-
}
|
|
31
|
-
function ae(c, d, n) {
|
|
32
|
-
return U(d, c === le, n ? c === B : c === Q) || c === "Enter" || c === " " || c === "";
|
|
33
|
-
}
|
|
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]);
|
|
1
|
+
import { toDate as t } from "./index393.js";
|
|
2
|
+
function f(r, o) {
|
|
3
|
+
return +t(r) > +t(o);
|
|
251
4
|
}
|
|
252
5
|
export {
|
|
253
|
-
|
|
254
|
-
dr as useListNavigation
|
|
6
|
+
f as isAfter
|
|
255
7
|
};
|
|
256
8
|
//# sourceMappingURL=index220.js.map
|
package/dist/index220.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index220.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/D,QAAMZ,IAAWS,IAAMN,MAAQI,IAAcJ,MAAQG,GAC/CL,IAAaE,MAAQC;AAC3B,SAAIL,MAAgB,UAAUA,MAAgB,gBAAgBa,IACrDT,MAAQN,KAEVC,EAASC,GAAaC,GAAUC,CAAU;AACnD;AAMO,SAASY,GAAkBC,GAASC,GAAO;AAChD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AWhB,IAAUI,GAAS1C,EAAI,CAAC;AACvD;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index220.js","sources":["../../../node_modules/date-fns/isAfter.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n"],"names":["isAfter","date","dateToCompare","toDate"],"mappings":";AAoBO,SAASA,EAAQC,GAAMC,GAAe;AAC3C,SAAO,CAACC,EAAOF,CAAI,IAAI,CAACE,EAAOD,CAAa;AAC9C;","x_google_ignoreList":[0]}
|
package/dist/index221.js
CHANGED
|
@@ -1,72 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { useTimeout as N } from "./index225.js";
|
|
5
|
-
import { EMPTY_ARRAY as W } from "./index204.js";
|
|
6
|
-
import { isListIndexDisabled as _, isElementVisible as j } from "./index382.js";
|
|
7
|
-
import { contains as T } from "./index231.js";
|
|
8
|
-
import { stopEvent as K } from "./index253.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]);
|
|
1
|
+
import { toDate as o } from "./index393.js";
|
|
2
|
+
function f(r, t) {
|
|
3
|
+
return +o(r) < +o(t);
|
|
68
4
|
}
|
|
69
5
|
export {
|
|
70
|
-
|
|
6
|
+
f as isBefore
|
|
71
7
|
};
|
|
72
8
|
//# sourceMappingURL=index221.js.map
|
package/dist/index221.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index221.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,GAC3BC,IAAeD,EAAM,OAAON,KAAiBN,KAAe,EAAE,GAC9Dc,IAAgBF,EAAM,OAAO,IAAI,GACjCG,IAAYC,EAAkB,CAAAC,MAAS;AAC3C,aAASC,EAAUC,GAAO;AACxB,YAAMC,IAAUrB,GAAa,QAAQoB,CAAK;AAC1C,aAAO,CAACC,KAAWC,EAAiBD,CAAO;AAAA,IAC7C;AACA,aAASE,EAAgBH,GAAO;AAC9B,aAAKD,EAAUC,CAAK,IAObjB,KAAmB,QAAQ,CAACqB,EAAoBC,GAAaL,GAAOjB,CAAe,IANj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C;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index221.js","sources":["../../../node_modules/date-fns/isBefore.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n"],"names":["isBefore","date","dateToCompare","toDate"],"mappings":";AAoBO,SAASA,EAASC,GAAMC,GAAe;AAC5C,SAAO,CAACC,EAAOF,CAAI,IAAI,CAACE,EAAOD,CAAa;AAC9C;","x_google_ignoreList":[0]}
|