se-design 1.0.82 → 1.0.83-dev.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/assets/style.css +1 -1
- package/dist/components/NLSearch/ClearAiFiltersBar.d.ts +21 -0
- package/dist/components/NLSearch/NLDynamicChip.d.ts +18 -0
- package/dist/components/NLSearch/NLSearchInput.d.ts +21 -0
- package/dist/components/NLSearch/index.d.ts +6 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +131 -124
- package/dist/index.js.map +1 -1
- package/dist/index100.js +1 -1
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -1
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +1 -1
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -1
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +1 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +1 -1
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +1 -1
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +2 -2
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.js +2 -2
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +1 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +2 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +2 -2
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +3 -3
- package/dist/index120.js +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +2 -2
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +2 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +2 -2
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +1 -1
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +2 -2
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +2 -2
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +1 -1
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +1 -1
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +1 -1
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +1 -1
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +2 -2
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +1 -1
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +2 -2
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +1 -1
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -2
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +2 -2
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +2 -2
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +2 -2
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +1 -1
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +2 -2
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +2 -2
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +3 -3
- package/dist/index160.js +1 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -1
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +1 -1
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +1 -1
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +1 -1
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +1 -1
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +1 -1
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +1 -1
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +1 -1
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +1 -1
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +2 -2
- package/dist/index180.js +1 -1
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +2 -2
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +1 -1
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +1 -1
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +1 -1
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +2 -2
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +1 -1
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +1 -1
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +1 -1
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +2 -2
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +5 -5
- package/dist/index190.js +1 -1
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +1 -1
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +1 -1
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +1 -1
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +1 -1
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +1 -1
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +2 -2
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +1 -1
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +2 -2
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +2 -149
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -9
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -6
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +149 -42
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -20
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +9 -0
- package/dist/index205.js.map +1 -0
- package/dist/index206.js +8 -0
- package/dist/index206.js.map +1 -0
- package/dist/index207.js +45 -0
- package/dist/index207.js.map +1 -0
- package/dist/index208.js +24 -0
- package/dist/index208.js.map +1 -0
- package/dist/{index211.js → index215.js} +1 -1
- package/dist/{index211.js.map → index215.js.map} +1 -1
- package/dist/{index212.js → index216.js} +3 -3
- package/dist/{index212.js.map → index216.js.map} +1 -1
- package/dist/{index220.js → index224.js} +1 -1
- package/dist/{index220.js.map → index224.js.map} +1 -1
- package/dist/index23.js +4 -4
- package/dist/{index228.js → index232.js} +1 -1
- package/dist/{index228.js.map → index232.js.map} +1 -1
- package/dist/{index231.js → index235.js} +1 -1
- package/dist/{index231.js.map → index235.js.map} +1 -1
- package/dist/index244.js +168 -8
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +3 -9
- package/dist/index245.js.map +1 -1
- package/dist/index247.js +18 -169
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +10 -11
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +8 -4
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +3 -3
- package/dist/index250.js +4 -5
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +168 -36
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +11 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +5 -7
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +5 -326
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +36 -48
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +2 -2
- package/dist/index257.js +7 -75
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +308 -74
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +45 -47
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +2 -8
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +75 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +89 -48
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +52 -2
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +8 -2
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +8 -0
- package/dist/index265.js.map +1 -0
- package/dist/index266.js +55 -0
- package/dist/index266.js.map +1 -0
- package/dist/index267.js +5 -0
- package/dist/index267.js.map +1 -0
- package/dist/index268.js +5 -0
- package/dist/index268.js.map +1 -0
- package/dist/index27.js +1 -1
- package/dist/index28.js +4 -4
- package/dist/index29.js +3 -3
- package/dist/index3.js +3 -3
- package/dist/index30.js +4 -4
- package/dist/index32.js +10 -11
- package/dist/index33.js +1 -1
- package/dist/index35.js +4 -4
- package/dist/index36.js +5 -5
- package/dist/index38.js +3 -3
- package/dist/index39.js +4 -4
- package/dist/index4.js +3 -3
- package/dist/index40.js +1 -1
- package/dist/index42.js +7 -8
- package/dist/index43.js +9 -10
- package/dist/index45.js +4 -4
- package/dist/index46.js +142 -193
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +21 -38
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +36 -33
- package/dist/index48.js.map +1 -1
- package/dist/index50.js +189 -78
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +36 -459
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +33 -98
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +151 -36
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +84 -36
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +456 -88
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +96 -161
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +35 -146
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +38 -33
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +89 -83
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +123 -123
- package/dist/index60.js +157 -113
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +143 -61
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +33 -152
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +80 -312
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +118 -45
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +62 -140
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +152 -12
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +316 -44
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +44 -82
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +143 -18
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +9 -10
- package/dist/index70.js +9 -63
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +45 -26
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +78 -102
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +18 -61
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +63 -18
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +27 -5
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +102 -48
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +58 -20
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +19 -7
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +8 -0
- package/dist/index79.js.map +1 -0
- package/dist/index80.js +54 -2
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +24 -2
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +9 -2
- package/dist/index82.js.map +1 -1
- package/dist/index84.js +2 -2
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +2 -2
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +2 -2
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +5 -5
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -1
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +1 -1
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +1 -1
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +1 -1
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +1 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +1 -1
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index240.js +0 -173
- package/dist/index240.js.map +0 -1
- package/dist/index241.js +0 -7
- package/dist/index241.js.map +0 -1
- package/dist/index243.js +0 -22
- package/dist/index243.js.map +0 -1
- package/dist/index246.js +0 -8
- package/dist/index246.js.map +0 -1
- package/dist/index49.js +0 -152
- package/dist/index49.js.map +0 -1
- package/dist/index83.js +0 -5
- package/dist/index83.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as a, useLayoutEffect as m, useEffect as g } from "react";
|
|
2
|
-
import { getFirstFocusableElement as f, getLastFocusableElement as F } from "./
|
|
3
|
-
import { consumeFocusAnchor as I, consumeLastInteractedElement as E } from "./
|
|
2
|
+
import { getFirstFocusableElement as f, getLastFocusableElement as F } from "./index75.js";
|
|
3
|
+
import { consumeFocusAnchor as I, consumeLastInteractedElement as E } from "./index76.js";
|
|
4
4
|
const l = {
|
|
5
5
|
position: "absolute",
|
|
6
6
|
opacity: 0,
|
|
@@ -68,4 +68,4 @@ function T({
|
|
|
68
68
|
export {
|
|
69
69
|
T as useFocusSentinel
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=index216.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index216.js","sources":["../src/utils/a11y/useFocusSentinel.ts"],"sourcesContent":["import { useRef, useEffect, useLayoutEffect } from 'react';\n\nimport { getFirstFocusableElement, getLastFocusableElement } from './focusableElements';\nimport { consumeLastInteractedElement, consumeFocusAnchor } from './useFocusTrap';\n\nconst SENTINEL_STYLE: React.CSSProperties = {\n position: 'absolute',\n opacity: 0,\n pointerEvents: 'none',\n width: 0,\n height: 0,\n};\n\nexport interface UseFocusSentinelOptions {\n /** Whether the panel is currently open. */\n isOpen: boolean | undefined;\n /**\n * When true the hook is a no-op — dialog mode (focus trap) handles focus management instead.\n */\n isModal: boolean;\n /** Ref to the panel container element. */\n containerRef: React.RefObject<HTMLElement | null>;\n /**\n * Explicit element to restore focus to on close.\n * Overrides the automatic trigger capture.\n */\n returnFocusRef?: React.RefObject<HTMLElement | null>;\n}\n\nexport interface SentinelProps {\n ref: React.RefObject<HTMLDivElement | null>;\n tabIndex: number;\n style: React.CSSProperties;\n onFocus: (e: React.FocusEvent) => void;\n}\n\nexport interface UseFocusSentinelReturn {\n /** Spread onto an invisible div placed before the panel content. */\n startSentinelProps: SentinelProps;\n /** Spread onto an invisible div placed after the panel content. */\n endSentinelProps: SentinelProps;\n}\n\n/**\n * Focus management for complementary (non-modal) side panels.\n *\n * Moves focus into the panel on open, restores it to the trigger on close,\n * and wraps Tab / Shift+Tab back to the trigger when focus reaches either end.\n *\n * Sentinel tabIndex values are mutated imperatively (no state) to avoid\n * re-renders. React does not touch a DOM attribute unless the JSX prop value\n * changes, so the initial tabIndex={-1} in the returned props is safe.\n */\nexport function useFocusSentinel({\n isOpen,\n isModal,\n containerRef,\n returnFocusRef,\n}: UseFocusSentinelOptions): UseFocusSentinelReturn {\n const triggerRef = useRef<HTMLElement | null>(null);\n const startSentinelRef = useRef<HTMLDivElement>(null);\n const endSentinelRef = useRef<HTMLDivElement>(null);\n\n // Capture trigger before React commits (document.activeElement is still the opener).\n // Body focus = page-load open → skip so sentinels stay inert.\n useLayoutEffect(() => {\n if (isModal || !isOpen) return;\n const trigger =\n returnFocusRef?.current ??\n consumeFocusAnchor() ??\n consumeLastInteractedElement() ??\n (document.activeElement as HTMLElement);\n if (!trigger || trigger === document.body) return;\n // iframes manage their own internal focus. The parent doc only sees the\n // <iframe> element. Calling .focus() on any parent-doc element while the\n // user is inside an iframe forcibly blurs the iframe content (kills caret\n // on textareas, cancels native <select> dropdowns). Skip capture so the\n // auto-focus on open and focus-restore on close don't run.\n if (trigger.tagName === 'IFRAME') return;\n triggerRef.current = trigger;\n if (endSentinelRef.current) endSentinelRef.current.tabIndex = 0;\n return () => {\n if (endSentinelRef.current) endSentinelRef.current.tabIndex = -1;\n };\n }, [isOpen, isModal]);\n\n // Move focus into panel on open; restore to trigger on close.\n useEffect(() => {\n if (isModal || !isOpen || !triggerRef.current) return;\n\n const rafId = requestAnimationFrame(() => {\n const first = getFirstFocusableElement({ container: containerRef.current });\n (first ?? containerRef.current)?.focus();\n // Activate start sentinel so Shift+Tab from first content returns to trigger.\n if (startSentinelRef.current) startSentinelRef.current.tabIndex = 0;\n });\n\n return () => {\n cancelAnimationFrame(rafId);\n if (startSentinelRef.current) startSentinelRef.current.tabIndex = -1;\n const trigger = triggerRef.current;\n triggerRef.current = null;\n if (trigger?.isConnected) {\n requestAnimationFrame(() => trigger.focus());\n }\n };\n }, [isOpen, isModal]);\n\n const handleStartFocus = (e: React.FocusEvent) => {\n const fromInside =\n containerRef.current?.contains(e.relatedTarget as Node) &&\n e.relatedTarget !== containerRef.current;\n if (fromInside) {\n // Shift+Tab from first content → restore trigger\n const trigger = triggerRef.current;\n if (trigger?.isConnected) trigger.focus();\n } else {\n // Natural Tab entry from outside → forward to first content,\n // deactivate so next Shift+Tab exits naturally.\n if (startSentinelRef.current) startSentinelRef.current.tabIndex = -1;\n const first = getFirstFocusableElement({ container: containerRef.current });\n (first ?? containerRef.current)?.focus();\n }\n };\n\n const handleEndFocus = (e: React.FocusEvent) => {\n const fromInside =\n containerRef.current?.contains(e.relatedTarget as Node) &&\n e.relatedTarget !== containerRef.current;\n if (fromInside) {\n // Tab from last content → restore trigger\n const trigger = triggerRef.current;\n if (trigger?.isConnected) trigger.focus();\n } else {\n // Shift+Tab entry from outside → back to last content\n const last = getLastFocusableElement({ container: containerRef.current });\n (last ?? containerRef.current)?.focus();\n }\n };\n\n return {\n startSentinelProps: {\n ref: startSentinelRef,\n tabIndex: -1,\n style: SENTINEL_STYLE,\n onFocus: handleStartFocus,\n },\n endSentinelProps: {\n ref: endSentinelRef,\n tabIndex: -1,\n style: SENTINEL_STYLE,\n onFocus: handleEndFocus,\n },\n };\n}\n"],"names":["useRef","useLayoutEffect","useEffect","getFirstFocusableElement","getLastFocusableElement","consumeFocusAnchor","consumeLastInteractedElement","SENTINEL_STYLE","position","opacity","pointerEvents","width","height","useFocusSentinel","isOpen","isModal","containerRef","returnFocusRef","triggerRef","startSentinelRef","endSentinelRef","trigger","current","document","activeElement","body","tagName","tabIndex","rafId","requestAnimationFrame","container","focus","cancelAnimationFrame","isConnected","startSentinelProps","ref","style","onFocus","handleStartFocus","e","contains","relatedTarget","endSentinelProps","handleEndFocus"],"mappings":"AAKA,SAAA,UAAAA,GAAA,mBAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,4BAAAC,GAAA,2BAAAC,SAAA;AAAA,SAAA,sBAAAC,GAAA,gCAAAC,SAAA;AAAA,MAAMC,IAAsC;AAAA,EAC1CC,UAAU;AAAA,EACVC,SAAS;AAAA,EACTC,eAAe;AAAA,EACfC,OAAO;AAAA,EACPC,QAAQ;AACV;AA0CO,SAASC,EAAiB;AAAA,EAC/BC,QAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,gBAAAA;AACuB,GAA2B;AAClD,QAAMC,IAAalB,EAA2B,IAAI,GAC5CmB,IAAmBnB,EAAuB,IAAI,GAC9CoB,IAAiBpB,EAAuB,IAAI;AAIlDC,SAAAA,EAAgB,MAAM;AACpB,QAAIc,KAAW,CAACD,EAAQ;AACxB,UAAMO,IACJJ,GAAgBK,WAChBjB,OACAC,EAAAA,KACCiB,SAASC;AACZ,QAAI,GAACH,KAAWA,MAAYE,SAASE,SAMjCJ,EAAQK,YAAY;AACxBR,aAAAA,EAAWI,UAAUD,GACjBD,EAAeE,YAASF,EAAeE,QAAQK,WAAW,IACvD,MAAM;AACX,QAAIP,EAAeE,YAASF,EAAeE,QAAQK,WAAW;AAAA,MAChE;AAAA,EACF,GAAG,CAACb,GAAQC,CAAO,CAAC,GAGp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AID,GAASY,eAAaZ,EAAQU,MAAAA;AAAAA,QACpC;AAGE,WADa3B,EAAwB;AAAA,YAAE0B,WAAWd,EAAaM;AAAAA,UAAAA,CAAS,KAC/DN,EAAaM,UAAUS,MAAAA;AAAAA,MAEpC;AAAA,IAaaY;AAAAA,EACX;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index224.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\n let timeout: ReturnType<typeof setTimeout> | null;\n const debounced = (...args: Parameters<T>) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n func(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = null;\n };\n return debounced as T & { cancel: () => void };\n }"],"names":["debounce","func","wait","timeout","debounced","args","setTimeout","cancel"],"mappings":"AAAO,SAASA,EAA6CC,GAASC,GAAc;AAChF,MAAIC;AACJ,QAAMC,IAAYA,IAAIC,MAAwB;AAC5C,IAAIF,kBAAsBA,CAAO,GACjCA,IAAUG,WAAW,MAAM;AACzBL,MAAAA,EAAK,GAAGI,CAAI;AAAA,IACd,GAAGH,CAAI;AAAA,EACT;AACAE,SAAAA,EAAUG,SAAS,MAAM;AACvB,IAAIJ,kBAAsBA,CAAO,GACjCA,IAAU;AAAA,EACZ,GACOC;AACT;"}
|
package/dist/index23.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import s, { useState as j, useEffect as B } from "react";
|
|
2
|
-
import { useStableId as K } from "./
|
|
3
|
-
import { getA11yNameAttributes as L } from "./
|
|
4
|
-
import "./
|
|
5
|
-
import { mergeIds as q } from "./
|
|
2
|
+
import { useStableId as K } from "./index205.js";
|
|
3
|
+
import { getA11yNameAttributes as L } from "./index82.js";
|
|
4
|
+
import "./index76.js";
|
|
5
|
+
import { mergeIds as q } from "./index206.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
function h() {
|
|
8
8
|
return h = Object.assign ? Object.assign.bind() : function(l) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index232.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index235.js","sources":["../src/components/NavigationBar/TabButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button } from '../Button';\n\nexport interface TabButtonProps {\n id: string;\n label: string;\n isSelected: boolean;\n isDisabled?: boolean;\n panelId?: string;\n tabIndex: number;\n className?: string;\n automationId?: string;\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;\n onFocus: () => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Internal TabButton component for NavigationBar.\n * Uses Button (unstyled) internally for consistent activation handling.\n * Supports forwardRef for focus management (roving tabindex).\n */\nexport const TabButton = forwardRef<HTMLButtonElement, TabButtonProps>(\n (\n {\n id,\n label,\n isSelected,\n isDisabled = false,\n panelId,\n tabIndex,\n className = '',\n automationId,\n onClick,\n onFocus,\n onKeyDown\n },\n ref\n ) => {\n return (\n <Button\n ref={ref}\n type=\"unstyled\"\n label={label}\n disabled={isDisabled}\n onClick={onClick}\n className={className}\n automationId={automationId}\n role=\"tab\"\n id={id}\n aria-selected={isSelected}\n {...(panelId ? { 'aria-controls': panelId } : {})}\n tabIndex={tabIndex}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n />\n );\n }\n);\n\nTabButton.displayName = 'TabButton';\n"],"names":["TabButton","id","label","isSelected","isDisabled","panelId","tabIndex","className","automationId","onClick","onFocus","onKeyDown","ref","React","createElement","Button","_extends","type","disabled","role","displayName"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,sBACX,CACE;AAAA,EACEC,IAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,cAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AACF,GACAC,MAGEC,gBAAAA,EAAAC,cAACC,GAAMC,EAAA;AAAA,EACLJ,KAAAA;AAAAA,EACAK,MAAK;AAAA,EACLf,OAAAA;AAAAA,EACAgB,UAAUd;AAAAA,EACVK,SAAAA;AAAAA,EACAF,WAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAW,MAAK;AAAA,EACLlB,IAAAA;AAAAA,EACA,iBAAeE;AAAAA,GACVE,IAAU;AAAA,EAAE,iBAAiBA;AAAAA,IAAY,IAAE;AAAA,EAChDC,UAAAA;AAAAA,EACAI,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,CAAqB,CACtB,CAGP;AAEAX,EAAUoB,cAAc;"}
|
package/dist/index244.js
CHANGED
|
@@ -1,13 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useState as W, useMemo as F, useEffect as N, useCallback as S } from "react";
|
|
2
|
+
import { useRovingFocus as C } from "./index74.js";
|
|
3
|
+
const z = (e, n, s, g, m, D = !1) => {
|
|
4
|
+
const i = e.toLocaleDateString("en-US", {
|
|
5
|
+
weekday: "long",
|
|
6
|
+
month: "long",
|
|
7
|
+
day: "numeric",
|
|
8
|
+
year: "numeric"
|
|
9
|
+
});
|
|
10
|
+
return m ? i : g ? `${i}, start and end of range` : n ? `${i}, start of range` : s ? `${i}, end of range` : D ? `${i}, in range` : i;
|
|
11
|
+
}, y = (e) => {
|
|
12
|
+
const n = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), g = String(e.getDate()).padStart(2, "0");
|
|
13
|
+
return `date-${n}-${s}-${g}`;
|
|
14
|
+
}, k = (e, n) => new Date(e, n + 1, 0).getDate(), L = (e) => {
|
|
15
|
+
const n = e.getFullYear(), s = e.getMonth();
|
|
16
|
+
return Array.from({
|
|
17
|
+
length: k(n, s)
|
|
18
|
+
}, (g, m) => y(new Date(n, s, m + 1)));
|
|
19
|
+
}, x = (e, n, s) => {
|
|
20
|
+
const g = e.getFullYear(), m = e.getMonth(), D = (a) => a.getFullYear() === g && a.getMonth() === m;
|
|
21
|
+
if (s.startDate && D(s.startDate)) {
|
|
22
|
+
const a = new Date(s.startDate);
|
|
23
|
+
a.setHours(0, 0, 0, 0);
|
|
24
|
+
const l = y(a);
|
|
25
|
+
if (n.includes(l)) return l;
|
|
7
26
|
}
|
|
8
|
-
|
|
27
|
+
if (s.endDate && D(s.endDate)) {
|
|
28
|
+
const a = new Date(s.endDate);
|
|
29
|
+
a.setHours(0, 0, 0, 0);
|
|
30
|
+
const l = y(a);
|
|
31
|
+
if (n.includes(l)) return l;
|
|
32
|
+
}
|
|
33
|
+
const i = /* @__PURE__ */ new Date();
|
|
34
|
+
if (D(i)) {
|
|
35
|
+
const a = y(i);
|
|
36
|
+
if (n.includes(a)) return a;
|
|
37
|
+
}
|
|
38
|
+
return n[0] || "";
|
|
39
|
+
};
|
|
40
|
+
function B({
|
|
41
|
+
leftMonth: e,
|
|
42
|
+
rightMonth: n,
|
|
43
|
+
showSingleMonth: s,
|
|
44
|
+
selectedRange: g,
|
|
45
|
+
onMonthChange: m
|
|
46
|
+
}) {
|
|
47
|
+
const [D, i] = W(null), a = F(() => L(e), [e]), l = F(() => L(n), [n]), E = F(() => x(e, a, g), [e, a, g]), H = F(() => x(n, l, g), [n, l, g]), {
|
|
48
|
+
getRovingItemProps: Y,
|
|
49
|
+
focusItem: I,
|
|
50
|
+
getContainerProps: U
|
|
51
|
+
} = C({
|
|
52
|
+
itemIds: a,
|
|
53
|
+
defaultFocusedId: E,
|
|
54
|
+
orientation: "grid",
|
|
55
|
+
cols: 7,
|
|
56
|
+
loop: !1,
|
|
57
|
+
role: "grid"
|
|
58
|
+
}), {
|
|
59
|
+
getRovingItemProps: M,
|
|
60
|
+
focusItem: h,
|
|
61
|
+
getContainerProps: G
|
|
62
|
+
} = C({
|
|
63
|
+
itemIds: l,
|
|
64
|
+
defaultFocusedId: H,
|
|
65
|
+
orientation: "grid",
|
|
66
|
+
cols: 7,
|
|
67
|
+
loop: !1,
|
|
68
|
+
role: "grid"
|
|
69
|
+
});
|
|
70
|
+
N(() => {
|
|
71
|
+
if (!D) return;
|
|
72
|
+
const f = y(D);
|
|
73
|
+
a.includes(f) ? (I(f), i(null)) : l.includes(f) && (h(f), i(null));
|
|
74
|
+
}, [D, a, l, I, h]);
|
|
75
|
+
const b = S((f, K) => {
|
|
76
|
+
const v = s || K === "left";
|
|
77
|
+
m(new Date(f.getFullYear(), f.getMonth(), 1), v), i(new Date(f));
|
|
78
|
+
}, [s, m]);
|
|
79
|
+
return {
|
|
80
|
+
getGridCellProps: S(({
|
|
81
|
+
isLeftCalendar: f,
|
|
82
|
+
isDateDisabled: K,
|
|
83
|
+
handleDateClick: v
|
|
84
|
+
}) => {
|
|
85
|
+
const A = f ? "left" : "right", $ = f ? I : h, O = f ? Y : M, R = (t, p) => {
|
|
86
|
+
const c = p.getFullYear(), o = p.getMonth(), d = p.getDate(), w = (r) => {
|
|
87
|
+
if (r.getFullYear() !== c || r.getMonth() !== o) {
|
|
88
|
+
b(r, A);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
$(y(r));
|
|
92
|
+
};
|
|
93
|
+
switch (t.key) {
|
|
94
|
+
case "ArrowLeft":
|
|
95
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d - 1));
|
|
96
|
+
break;
|
|
97
|
+
case "ArrowRight":
|
|
98
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d + 1));
|
|
99
|
+
break;
|
|
100
|
+
case "ArrowUp":
|
|
101
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d - 7));
|
|
102
|
+
break;
|
|
103
|
+
case "ArrowDown":
|
|
104
|
+
t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d + 7));
|
|
105
|
+
break;
|
|
106
|
+
case "Home": {
|
|
107
|
+
t.preventDefault(), t.stopPropagation();
|
|
108
|
+
const r = p.getDay(), u = new Date(c, o, d - r), P = u.getMonth() !== o ? new Date(c, o, 1) : u;
|
|
109
|
+
$(y(P));
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
case "End": {
|
|
113
|
+
t.preventDefault(), t.stopPropagation();
|
|
114
|
+
const r = p.getDay(), u = new Date(c, o, d + (6 - r)), P = k(c, o), T = u.getMonth() !== o ? new Date(c, o, P) : u;
|
|
115
|
+
$(y(T));
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case "PageUp": {
|
|
119
|
+
t.preventDefault(), t.stopPropagation();
|
|
120
|
+
const r = t.shiftKey ? c - 1 : c, u = t.shiftKey ? o : o - 1, P = Math.min(d, k(r, u));
|
|
121
|
+
b(new Date(r, u, P), A);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case "PageDown": {
|
|
125
|
+
t.preventDefault(), t.stopPropagation();
|
|
126
|
+
const r = t.shiftKey ? c + 1 : c, u = t.shiftKey ? o : o + 1, P = Math.min(d, k(r, u));
|
|
127
|
+
b(new Date(r, u, P), A);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case "Enter":
|
|
131
|
+
case " ":
|
|
132
|
+
t.preventDefault(), K(p) || v(p);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return ({
|
|
137
|
+
cellId: t,
|
|
138
|
+
cellDate: p,
|
|
139
|
+
disabled: c,
|
|
140
|
+
ariaLabel: o,
|
|
141
|
+
ariaCurrent: d,
|
|
142
|
+
ariaDisabled: w
|
|
143
|
+
}) => {
|
|
144
|
+
const r = O(t);
|
|
145
|
+
return {
|
|
146
|
+
id: t,
|
|
147
|
+
ref: r.ref,
|
|
148
|
+
tabIndex: r.tabIndex,
|
|
149
|
+
onFocus: r.onFocus,
|
|
150
|
+
"aria-label": o,
|
|
151
|
+
"aria-current": d,
|
|
152
|
+
"aria-disabled": w,
|
|
153
|
+
onKeyDown: (u) => R(u, p),
|
|
154
|
+
onClick: () => {
|
|
155
|
+
c || v(p);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
}, [b, I, h, Y, M]),
|
|
160
|
+
getLeftRovingItemProps: Y,
|
|
161
|
+
getRightRovingItemProps: M,
|
|
162
|
+
getLeftContainerProps: U,
|
|
163
|
+
getRightContainerProps: G,
|
|
164
|
+
focusLeftItem: I,
|
|
165
|
+
focusRightItem: h
|
|
166
|
+
};
|
|
9
167
|
}
|
|
10
168
|
export {
|
|
11
|
-
|
|
169
|
+
y as formatDateId,
|
|
170
|
+
z as getCellAriaLabel,
|
|
171
|
+
B as useDatePickerA11y
|
|
12
172
|
};
|
|
13
173
|
//# sourceMappingURL=index244.js.map
|
package/dist/index244.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index244.js","sources":["../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n"],"mappings":"AAAA,SAASA,EAA8BC,GAAGC,GAAG;AAC3C,MAAYD,KAAR,KAAW,QAAO,CAAA;AACtB,MAAIE,IAAI,CAAA;AACR,WAASC,KAAKH,EAAG,KAAI,CAAA,EAAG,eAAe,KAAKA,GAAGG,CAAC,GAAG;AACjD,QAAWF,EAAE,QAAQE,CAAC,MAAlB,GAAqB;AACzB,IAAAD,EAAEC,CAAC,IAAIH,EAAEG,CAAC;AAAA,EACZ;AACA,SAAOD;AACT;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index244.js","sources":["../src/components/DatePicker/useDatePickerA11y.ts"],"sourcesContent":["import React, { useState, useCallback, useEffect, useMemo } from 'react';\n\nimport { useRovingFocus, RovingItemProps, RovingContainerProps, AccessibleNameInput } from '../../utils/a11y/useRovingFocus';\nimport type { DateRange } from './index';\n\nexport const getCellAriaLabel = (\n date: Date,\n isStart: boolean,\n isEnd: boolean,\n isSameStartEnd: boolean,\n singleDateSelection: boolean,\n inRange: boolean = false\n): string => {\n const base = date.toLocaleDateString('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric'\n });\n if (singleDateSelection) return base;\n if (isSameStartEnd) return `${base}, start and end of range`;\n if (isStart) return `${base}, start of range`;\n if (isEnd) return `${base}, end of range`;\n if (inRange) return `${base}, in range`;\n return base;\n};\n\nexport const formatDateId = (d: Date) => {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const dd = String(d.getDate()).padStart(2, '0');\n return `date-${y}-${m}-${dd}`;\n};\n\nconst getDaysInMonth = (year: number, month: number) => new Date(year, month + 1, 0).getDate();\n\nconst getPanelItemIds = (panelDate: Date): string[] => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n return Array.from({ length: getDaysInMonth(year, month) }, (_, i) =>\n formatDateId(new Date(year, month, i + 1))\n );\n};\n\nconst getPanelDefaultFocusId = (panelDate: Date, itemIds: string[], selectedRange: DateRange): string => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n const isInPanel = (d: Date) => d.getFullYear() === year && d.getMonth() === month;\n\n // Prefer startDate if it falls in this panel\n if (selectedRange.startDate && isInPanel(selectedRange.startDate)) {\n const d = new Date(selectedRange.startDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n // Fall back to endDate if it falls in this panel (e.g. right panel when start is in left panel)\n if (selectedRange.endDate && isInPanel(selectedRange.endDate)) {\n const d = new Date(selectedRange.endDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n const today = new Date();\n if (isInPanel(today)) {\n const id = formatDateId(today);\n if (itemIds.includes(id)) return id;\n }\n return itemIds[0] || '';\n};\n\ninterface UseDatePickerA11yOptions {\n leftMonth: Date;\n rightMonth: Date;\n showSingleMonth: boolean;\n selectedRange: DateRange;\n onMonthChange: (date: Date, isLeft: boolean) => void;\n}\n\ninterface CellKeyDownOptions {\n isLeftCalendar: boolean;\n isDateDisabled: (date: Date) => boolean;\n handleDateClick: (date: Date) => void;\n}\n\ninterface GridCellItemInput {\n cellId: string;\n cellDate: Date;\n disabled: boolean;\n ariaLabel: string;\n ariaCurrent: 'date' | undefined;\n ariaDisabled: true | undefined;\n}\n\nexport interface GridCellElementProps {\n id: string;\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n 'aria-label': string;\n 'aria-current': 'date' | undefined;\n 'aria-disabled': true | undefined;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onClick: () => void;\n}\n\ninterface UseDatePickerA11yReturn {\n getGridCellProps: (options: CellKeyDownOptions) => (item: GridCellItemInput) => GridCellElementProps;\n getLeftRovingItemProps: (id: string) => RovingItemProps;\n getRightRovingItemProps: (id: string) => RovingItemProps;\n getLeftContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n getRightContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n focusLeftItem: (id: string) => void;\n focusRightItem: (id: string) => void;\n}\n\nexport function useDatePickerA11y({\n leftMonth,\n rightMonth,\n showSingleMonth,\n selectedRange,\n onMonthChange\n}: UseDatePickerA11yOptions): UseDatePickerA11yReturn {\n const [keyboardFocusDate, setKeyboardFocusDate] = useState<Date | null>(null);\n\n const leftItemIds = useMemo(() => getPanelItemIds(leftMonth), [leftMonth]);\n const rightItemIds = useMemo(() => getPanelItemIds(rightMonth), [rightMonth]);\n\n const leftDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(leftMonth, leftItemIds, selectedRange),\n [leftMonth, leftItemIds, selectedRange]\n );\n const rightDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(rightMonth, rightItemIds, selectedRange),\n [rightMonth, rightItemIds, selectedRange]\n );\n\n const { getRovingItemProps: getLeftRovingItemProps, focusItem: focusLeftItem, getContainerProps: getLeftContainerProps } = useRovingFocus({\n itemIds: leftItemIds,\n defaultFocusedId: leftDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n const { getRovingItemProps: getRightRovingItemProps, focusItem: focusRightItem, getContainerProps: getRightContainerProps } = useRovingFocus({\n itemIds: rightItemIds,\n defaultFocusedId: rightDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n // After keyboard navigation shifts a panel to a new month, focus the target cell via roving focus refs\n useEffect(() => {\n if (!keyboardFocusDate) return;\n const id = formatDateId(keyboardFocusDate);\n if (leftItemIds.includes(id)) {\n focusLeftItem(id);\n setKeyboardFocusDate(null);\n } else if (rightItemIds.includes(id)) {\n focusRightItem(id);\n setKeyboardFocusDate(null);\n }\n }, [keyboardFocusDate, leftItemIds, rightItemIds, focusLeftItem, focusRightItem]);\n\n // Navigate the keyboard focus to a date that may be in a different month.\n // Each panel advances completely independently — never touches the other panel.\n const handleKeyboardNavigate = useCallback(\n (targetDate: Date, sourcePanel: 'left' | 'right') => {\n const isLeft = showSingleMonth || sourcePanel === 'left';\n onMonthChange(new Date(targetDate.getFullYear(), targetDate.getMonth(), 1), isLeft);\n setKeyboardFocusDate(new Date(targetDate));\n },\n [showSingleMonth, onMonthChange]\n );\n\n const getGridCellProps = useCallback(\n ({ isLeftCalendar, isDateDisabled, handleDateClick }: CellKeyDownOptions) => {\n const panel: 'left' | 'right' = isLeftCalendar ? 'left' : 'right';\n const focusPanelItem = isLeftCalendar ? focusLeftItem : focusRightItem;\n const getRovingItemProps = isLeftCalendar ? getLeftRovingItemProps : getRightRovingItemProps;\n\n const handleKeyDown = (e: React.KeyboardEvent, cellDate: Date) => {\n const cellYear = cellDate.getFullYear();\n const cellMonth = cellDate.getMonth();\n const cellDay = cellDate.getDate();\n\n const navigateTo = (targetDate: Date) => {\n if (targetDate.getFullYear() !== cellYear || targetDate.getMonth() !== cellMonth) {\n handleKeyboardNavigate(targetDate, panel);\n return;\n }\n focusPanelItem(formatDateId(targetDate));\n };\n\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 1));\n break;\n case 'ArrowRight':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 1));\n break;\n case 'ArrowUp':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 7));\n break;\n case 'ArrowDown':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 7));\n break;\n case 'Home': {\n // First day of the current week row (Sunday), clamped to month start\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const homeDate = new Date(cellYear, cellMonth, cellDay - dayOfWeek);\n const clamped = homeDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, 1) : homeDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'End': {\n // Last day of the current week row (Saturday), clamped to month end\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const endDate = new Date(cellYear, cellMonth, cellDay + (6 - dayOfWeek));\n const daysInThisMonth = getDaysInMonth(cellYear, cellMonth);\n const clamped =\n endDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, daysInThisMonth) : endDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'PageUp': {\n // Shift+PageUp = previous year, PageUp = previous month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear - 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth - 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'PageDown': {\n // Shift+PageDown = next year, PageDown = next month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear + 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth + 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'Enter':\n case ' ':\n e.preventDefault();\n if (!isDateDisabled(cellDate)) {\n handleDateClick(cellDate);\n }\n break;\n }\n };\n\n return ({ cellId, cellDate, disabled, ariaLabel, ariaCurrent, ariaDisabled }: GridCellItemInput): GridCellElementProps => {\n const rovingProps = getRovingItemProps(cellId);\n return {\n id: cellId,\n ref: rovingProps.ref,\n tabIndex: rovingProps.tabIndex,\n onFocus: rovingProps.onFocus,\n 'aria-label': ariaLabel,\n 'aria-current': ariaCurrent,\n 'aria-disabled': ariaDisabled,\n onKeyDown: (e: React.KeyboardEvent) => handleKeyDown(e, cellDate),\n onClick: () => { if (!disabled) handleDateClick(cellDate); }\n };\n };\n },\n [handleKeyboardNavigate, focusLeftItem, focusRightItem, getLeftRovingItemProps, getRightRovingItemProps]\n );\n\n return {\n getGridCellProps,\n getLeftRovingItemProps,\n getRightRovingItemProps,\n getLeftContainerProps,\n getRightContainerProps,\n focusLeftItem,\n focusRightItem\n };\n}\n"],"names":["useState","useMemo","useEffect","useCallback","useRovingFocus","getCellAriaLabel","date","isStart","isEnd","isSameStartEnd","singleDateSelection","inRange","base","toLocaleDateString","weekday","month","day","year","formatDateId","d","y","getFullYear","m","String","getMonth","padStart","dd","getDate","getDaysInMonth","Date","getPanelItemIds","panelDate","Array","from","length","_","i","getPanelDefaultFocusId","itemIds","selectedRange","isInPanel","startDate","setHours","id","includes","endDate","today","useDatePickerA11y","leftMonth","rightMonth","showSingleMonth","onMonthChange","keyboardFocusDate","setKeyboardFocusDate","leftItemIds","rightItemIds","leftDefaultFocusId","rightDefaultFocusId","getRovingItemProps","getLeftRovingItemProps","focusItem","focusLeftItem","getContainerProps","getLeftContainerProps","defaultFocusedId","orientation","cols","loop","role","getRightRovingItemProps","focusRightItem","getRightContainerProps","handleKeyboardNavigate","targetDate","sourcePanel","isLeft","getGridCellProps","isLeftCalendar","isDateDisabled","handleDateClick","panel","focusPanelItem","handleKeyDown","e","cellDate","cellYear","cellMonth","cellDay","navigateTo","key","preventDefault","stopPropagation","dayOfWeek","getDay","homeDate","clamped","daysInThisMonth","tYear","shiftKey","tMonth","tDay","Math","min","cellId","disabled","ariaLabel","ariaCurrent","ariaDisabled","rovingProps","ref","tabIndex","onFocus","onKeyDown","onClick"],"mappings":"AAKO,SAAA,YAAAA,GAAA,WAAAC,GAAA,aAAAC,GAAA,eAAAC,SAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,MAAMC,IAAmBA,CAC9BC,GACAC,GACAC,GACAC,GACAC,GACAC,IAAmB,OACR;AACX,QAAMC,IAAON,EAAKO,mBAAmB,SAAS;AAAA,IAC5CC,SAAS;AAAA,IACTC,OAAO;AAAA,IACPC,KAAK;AAAA,IACLC,MAAM;AAAA,EAAA,CACP;AACD,SAAIP,IAA4BE,IAC5BH,IAAuB,GAAGG,CAAI,6BAC9BL,IAAgB,GAAGK,CAAI,qBACvBJ,IAAc,GAAGI,CAAI,mBACrBD,IAAgB,GAAGC,CAAI,eACpBA;AACT,GAEaM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;AAAAA,UAChB,iBAAiBC;AAAAA,UACjBK,WAAWA,CAAC7B,MAA2BD,EAAcC,GAAGC,CAAQ;AAAA,UAChE6B,SAASA,MAAM;AAAE,YAAKT,KAAUzB,EAAgBK,CAAQ;AAAA,UAAG;AAAA,QAAA;AAAA,MAE/D;AAAA,IACF,GACA,CAACZ,GAAwBX,GAAeS,GAAgBX,GAAwBU,CAAuB,CACzG;AAAA,IAIEV,wBAAAA;AAAAA,IACAU,yBAAAA;AAAAA,IACAN,uBAAAA;AAAAA,IACAQ,wBAAAA;AAAAA,IACAV,eAAAA;AAAAA,IACAS,gBAAAA;AAAAA,EAAAA;AAEJ;"}
|
package/dist/index245.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
function e
|
|
2
|
-
return
|
|
3
|
-
for (var n = 1; n < arguments.length; n++) {
|
|
4
|
-
var a = arguments[n];
|
|
5
|
-
for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
}, e.apply(null, arguments);
|
|
1
|
+
function n(e) {
|
|
2
|
+
return new Promise((t) => setTimeout(t, e));
|
|
9
3
|
}
|
|
10
4
|
export {
|
|
11
|
-
|
|
5
|
+
n as delay
|
|
12
6
|
};
|
|
13
7
|
//# sourceMappingURL=index245.js.map
|
package/dist/index245.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index245.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index245.js","sources":["../src/utils/delay.ts"],"sourcesContent":["/**\n * Delays execution by the specified number of milliseconds\n * @param ms - The number of milliseconds to delay\n * @returns A Promise that resolves after the specified delay\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n} "],"names":["delay","ms","Promise","resolve","setTimeout"],"mappings":"AAKO,SAASA,EAAMC,GAA2B;AAC7C,SAAO,IAAIC,QAAQC,CAAAA,MAAWC,WAAWD,GAASF,CAAE,CAAC;AACzD;"}
|
package/dist/index247.js
CHANGED
|
@@ -1,173 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return t.cloneNode(!0);
|
|
5
|
-
}, z = function() {
|
|
6
|
-
return window.location.protocol === "file:";
|
|
7
|
-
}, Z = function(t, o, n) {
|
|
8
|
-
var e = new XMLHttpRequest();
|
|
9
|
-
e.onreadystatechange = function() {
|
|
10
|
-
try {
|
|
11
|
-
if (!/\.svg/i.test(t) && e.readyState === 2) {
|
|
12
|
-
var s = e.getResponseHeader("Content-Type");
|
|
13
|
-
if (!s)
|
|
14
|
-
throw new Error("Content type not found");
|
|
15
|
-
var i = ut(s).type;
|
|
16
|
-
if (!(i === "image/svg+xml" || i === "text/plain"))
|
|
17
|
-
throw new Error("Invalid content type: ".concat(i));
|
|
18
|
-
}
|
|
19
|
-
if (e.readyState === 4) {
|
|
20
|
-
if (e.status === 404 || e.responseXML === null)
|
|
21
|
-
throw new Error(z() ? "Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver." : "Unable to load SVG file: " + t);
|
|
22
|
-
if (e.status === 200 || z() && e.status === 0)
|
|
23
|
-
n(null, e);
|
|
24
|
-
else
|
|
25
|
-
throw new Error("There was a problem injecting the SVG: " + e.status + " " + e.statusText);
|
|
26
|
-
}
|
|
27
|
-
} catch (a) {
|
|
28
|
-
if (e.abort(), a instanceof Error)
|
|
29
|
-
n(a, e);
|
|
30
|
-
else
|
|
31
|
-
throw a;
|
|
32
|
-
}
|
|
33
|
-
}, e.open("GET", t), e.withCredentials = o, e.overrideMimeType && e.overrideMimeType("text/xml"), e.send();
|
|
34
|
-
}, v = {}, B = function(t, o) {
|
|
35
|
-
v[t] = v[t] || [], v[t].push(o);
|
|
36
|
-
}, ft = function(t) {
|
|
37
|
-
for (var o = function(i, a) {
|
|
38
|
-
setTimeout(function() {
|
|
39
|
-
if (Array.isArray(v[t])) {
|
|
40
|
-
var u = g.get(t), p = v[t][i];
|
|
41
|
-
u instanceof SVGSVGElement && p(null, Y(u)), u instanceof Error && p(u), i === v[t].length - 1 && delete v[t];
|
|
42
|
-
}
|
|
43
|
-
}, 0);
|
|
44
|
-
}, n = 0, e = v[t].length; n < e; n++)
|
|
45
|
-
o(n);
|
|
46
|
-
}, lt = function(t, o, n) {
|
|
47
|
-
if (g.has(t)) {
|
|
48
|
-
var e = g.get(t);
|
|
49
|
-
if (e === void 0) {
|
|
50
|
-
B(t, n);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (e instanceof SVGSVGElement) {
|
|
54
|
-
n(null, Y(e));
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
g.set(t, void 0), B(t, n), Z(t, o, function(s, i) {
|
|
59
|
-
var a;
|
|
60
|
-
s ? g.set(t, s) : ((a = i.responseXML) === null || a === void 0 ? void 0 : a.documentElement) instanceof SVGSVGElement && g.set(t, i.responseXML.documentElement), ft(t);
|
|
61
|
-
});
|
|
62
|
-
}, ct = function(t, o, n) {
|
|
63
|
-
Z(t, o, function(e, s) {
|
|
64
|
-
var i;
|
|
65
|
-
e ? n(e) : ((i = s.responseXML) === null || i === void 0 ? void 0 : i.documentElement) instanceof SVGSVGElement && n(null, s.responseXML.documentElement);
|
|
66
|
-
});
|
|
67
|
-
}, dt = 0, vt = function() {
|
|
68
|
-
return ++dt;
|
|
69
|
-
}, l = [], J = {}, pt = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xlink", K = function(t, o, n, e, s, i, a) {
|
|
70
|
-
var u = t.getAttribute("data-src") || t.getAttribute("src");
|
|
71
|
-
if (!u) {
|
|
72
|
-
a(new Error("Invalid data-src or src attribute"));
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (l.indexOf(t) !== -1) {
|
|
76
|
-
l.splice(l.indexOf(t), 1), t = null;
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
l.push(t), t.setAttribute("src", "");
|
|
80
|
-
var p = e ? lt : ct;
|
|
81
|
-
p(u, s, function(j, r) {
|
|
82
|
-
if (!r) {
|
|
83
|
-
l.splice(l.indexOf(t), 1), t = null, a(j);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
var w = t.getAttribute("id");
|
|
87
|
-
w && r.setAttribute("id", w);
|
|
88
|
-
var S = t.getAttribute("title");
|
|
89
|
-
S && r.setAttribute("title", S);
|
|
90
|
-
var E = t.getAttribute("width");
|
|
91
|
-
E && r.setAttribute("width", E);
|
|
92
|
-
var y = t.getAttribute("height");
|
|
93
|
-
y && r.setAttribute("height", y);
|
|
94
|
-
var G = Array.from(new Set(D(D(D([], (r.getAttribute("class") || "").split(" "), !0), ["injected-svg"], !1), (t.getAttribute("class") || "").split(" "), !0))).join(" ").trim();
|
|
95
|
-
r.setAttribute("class", G);
|
|
96
|
-
var b = t.getAttribute("style");
|
|
97
|
-
b && r.setAttribute("style", b), r.setAttribute("data-src", u);
|
|
98
|
-
var R = [].filter.call(t.attributes, function(f) {
|
|
99
|
-
return /^data-\w[\w-]*$/.test(f.name);
|
|
100
|
-
});
|
|
101
|
-
if (Array.prototype.forEach.call(R, function(f) {
|
|
102
|
-
f.name && f.value && r.setAttribute(f.name, f.value);
|
|
103
|
-
}), n) {
|
|
104
|
-
var h = {
|
|
105
|
-
clipPath: ["clip-path"],
|
|
106
|
-
"color-profile": ["color-profile"],
|
|
107
|
-
cursor: ["cursor"],
|
|
108
|
-
filter: ["filter"],
|
|
109
|
-
linearGradient: ["fill", "stroke"],
|
|
110
|
-
marker: ["marker", "marker-start", "marker-mid", "marker-end"],
|
|
111
|
-
mask: ["mask"],
|
|
112
|
-
path: [],
|
|
113
|
-
pattern: ["fill", "stroke"],
|
|
114
|
-
radialGradient: ["fill", "stroke"]
|
|
115
|
-
}, C, d, m, T, k;
|
|
116
|
-
Object.keys(h).forEach(function(f) {
|
|
117
|
-
C = f, m = h[f], d = r.querySelectorAll(C + "[id]");
|
|
118
|
-
for (var nt = function(I, mt) {
|
|
119
|
-
T = d[I].id, k = T + "-" + vt();
|
|
120
|
-
var M;
|
|
121
|
-
Array.prototype.forEach.call(m, function(W) {
|
|
122
|
-
M = r.querySelectorAll("[" + W + '*="' + T + '"]');
|
|
123
|
-
for (var O = 0, st = M.length; O < st; O++) {
|
|
124
|
-
var $ = M[O].getAttribute(W);
|
|
125
|
-
$ && !$.match(new RegExp('url\\("?#' + T + '"?\\)')) || M[O].setAttribute(W, "url(#" + k + ")");
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
for (var U = r.querySelectorAll("[*|href]"), H = [], N = 0, at = U.length; N < at; N++) {
|
|
129
|
-
var P = U[N].getAttributeNS(F, "href");
|
|
130
|
-
P && P.toString() === "#" + d[I].id && H.push(U[N]);
|
|
131
|
-
}
|
|
132
|
-
for (var Q = 0, ot = H.length; Q < ot; Q++)
|
|
133
|
-
H[Q].setAttributeNS(F, "href", "#" + k);
|
|
134
|
-
d[I].id = k;
|
|
135
|
-
}, _ = 0, it = d.length; _ < it; _++)
|
|
136
|
-
nt(_);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
r.removeAttribute("xmlns:a");
|
|
140
|
-
for (var x = r.querySelectorAll("script"), L = [], V, q, A = 0, tt = x.length; A < tt; A++)
|
|
141
|
-
q = x[A].getAttribute("type"), (!q || q === "application/ecmascript" || q === "application/javascript" || q === "text/javascript") && (V = x[A].innerText || x[A].textContent, V && L.push(V), r.removeChild(x[A]));
|
|
142
|
-
if (L.length > 0 && (o === "always" || o === "once" && !J[u])) {
|
|
143
|
-
for (var X = 0, et = L.length; X < et; X++)
|
|
144
|
-
new Function(L[X])(window);
|
|
145
|
-
J[u] = !0;
|
|
146
|
-
}
|
|
147
|
-
var rt = r.querySelectorAll("style");
|
|
148
|
-
if (Array.prototype.forEach.call(rt, function(f) {
|
|
149
|
-
f.textContent += "";
|
|
150
|
-
}), r.setAttribute("xmlns", pt), r.setAttribute("xmlns:xlink", F), i(r), !t.parentNode) {
|
|
151
|
-
l.splice(l.indexOf(t), 1), t = null, a(new Error("Parent node is null"));
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
t.parentNode.replaceChild(r, t), l.splice(l.indexOf(t), 1), t = null, a(null, r);
|
|
155
|
-
});
|
|
156
|
-
}, wt = function(t, o) {
|
|
157
|
-
var n = o === void 0 ? {} : o, e = n.afterAll, s = e === void 0 ? function() {
|
|
158
|
-
} : e, i = n.afterEach, a = i === void 0 ? function() {
|
|
159
|
-
} : i, u = n.beforeEach, p = u === void 0 ? function() {
|
|
160
|
-
} : u, j = n.cacheRequests, r = j === void 0 ? !0 : j, w = n.evalScripts, S = w === void 0 ? "never" : w, E = n.httpRequestWithCredentials, y = E === void 0 ? !1 : E, G = n.renumerateIRIElements, b = G === void 0 ? !0 : G;
|
|
161
|
-
if (t && "length" in t)
|
|
162
|
-
for (var R = 0, h = 0, C = t.length; h < C; h++)
|
|
163
|
-
K(t[h], S, b, r, y, p, function(d, m) {
|
|
164
|
-
a(d, m), t && "length" in t && t.length === ++R && s(R);
|
|
165
|
-
});
|
|
166
|
-
else t ? K(t, S, b, r, y, p, function(d, m) {
|
|
167
|
-
a(d, m), s(1), t = null;
|
|
168
|
-
}) : s(0);
|
|
1
|
+
import { useEffect as s } from "react";
|
|
2
|
+
const u = {
|
|
3
|
+
block: "nearest"
|
|
169
4
|
};
|
|
5
|
+
function m({
|
|
6
|
+
containerRef: t,
|
|
7
|
+
activeIndex: o,
|
|
8
|
+
itemSelector: r = '[role="option"]',
|
|
9
|
+
enabled: c = !0,
|
|
10
|
+
scrollOptions: e = u
|
|
11
|
+
}) {
|
|
12
|
+
s(() => {
|
|
13
|
+
if (!c || o < 0 || !t?.current)
|
|
14
|
+
return;
|
|
15
|
+
const n = t.current.querySelectorAll(r)[o];
|
|
16
|
+
n && n.scrollIntoView(e);
|
|
17
|
+
}, [o, t, r, c, e]);
|
|
18
|
+
}
|
|
170
19
|
export {
|
|
171
|
-
|
|
20
|
+
m as useScrollActiveIntoView
|
|
172
21
|
};
|
|
173
22
|
//# sourceMappingURL=index247.js.map
|