@allxsmith/bestax-bulma 5.65.0 → 5.66.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/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/components/Card.js +6 -6
- package/dist/esm/components/Card.js.map +1 -1
- package/dist/esm/components/Carousel.js +19 -7
- package/dist/esm/components/Carousel.js.map +1 -1
- package/dist/esm/components/Message.js +1 -1
- package/dist/esm/components/Message.js.map +1 -1
- package/dist/esm/components/Modal.js +1 -1
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/components/Navbar.js.map +1 -1
- package/dist/esm/components/Popover.js +4 -1
- package/dist/esm/components/Popover.js.map +1 -1
- package/dist/esm/components/SegmentedControl.js +4 -4
- package/dist/esm/components/SegmentedControl.js.map +1 -1
- package/dist/esm/components/Sidebar.js +1 -1
- package/dist/esm/components/Sidebar.js.map +1 -1
- package/dist/esm/elements/Figure.js +1 -1
- package/dist/esm/elements/Figure.js.map +1 -1
- package/dist/esm/form/ColorInputBase.js +1 -1
- package/dist/esm/form/ColorInputBase.js.map +1 -1
- package/dist/esm/form/DateInput.js +4 -1
- package/dist/esm/form/DateInput.js.map +1 -1
- package/dist/esm/form/DateInputBase.js +1 -1
- package/dist/esm/form/DateInputBase.js.map +1 -1
- package/dist/esm/form/DateRangeInput.js +4 -1
- package/dist/esm/form/DateRangeInput.js.map +1 -1
- package/dist/esm/form/DateRangeInputBase.js +1 -1
- package/dist/esm/form/DateRangeInputBase.js.map +1 -1
- package/dist/esm/form/DateTimeInput.js +4 -1
- package/dist/esm/form/DateTimeInput.js.map +1 -1
- package/dist/esm/form/DateTimeInputBase.js +1 -1
- package/dist/esm/form/DateTimeInputBase.js.map +1 -1
- package/dist/esm/form/Slider.js +19 -9
- package/dist/esm/form/Slider.js.map +1 -1
- package/dist/esm/form/TimeInput.js +4 -1
- package/dist/esm/form/TimeInput.js.map +1 -1
- package/dist/esm/form/TimeInputBase.js +1 -1
- package/dist/esm/form/TimeInputBase.js.map +1 -1
- package/dist/esm/form/TreeSelect.js.map +1 -1
- package/dist/esm/form/_pickerInternals/PickerPopover.js +4 -1
- package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
- package/dist/esm/form/_pickerInternals/TimeWheels.js +1 -1
- package/dist/esm/form/_pickerInternals/TimeWheels.js.map +1 -1
- package/dist/esm/form/_pickerInternals/useLocaleDefaults.js +15 -1
- package/dist/esm/form/_pickerInternals/useLocaleDefaults.js.map +1 -1
- package/dist/esm/form/_selectInternals/DialogSelect.js +1 -1
- package/dist/esm/form/_selectInternals/DialogSelect.js.map +1 -1
- package/dist/esm/helpers/useAnchoredPosition.js +11 -3
- package/dist/esm/helpers/useAnchoredPosition.js.map +1 -1
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +122 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +6 -6
- package/dist/types/components/Card.d.ts +52 -0
- package/dist/types/components/Carousel.d.ts +12 -3
- package/dist/types/components/Message.d.ts +16 -0
- package/dist/types/components/Modal.d.ts +71 -0
- package/dist/types/components/Navbar.d.ts +10 -0
- package/dist/types/components/Popover.d.ts +5 -1
- package/dist/types/components/SegmentedControl.d.ts +9 -0
- package/dist/types/components/Sidebar.d.ts +45 -5
- package/dist/types/elements/Figure.d.ts +11 -0
- package/dist/types/form/ColorInputBase.d.ts +7 -1
- package/dist/types/form/DateInputBase.d.ts +7 -1
- package/dist/types/form/DateRangeInputBase.d.ts +7 -1
- package/dist/types/form/DateTimeInputBase.d.ts +7 -1
- package/dist/types/form/TimeInputBase.d.ts +7 -1
- package/dist/types/form/TreeSelect.d.ts +4 -1
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +5 -0
- package/dist/types/form/_pickerInternals/useLocaleDefaults.d.ts +12 -0
- package/dist/types/form/_selectInternals/DialogSelect.d.ts +1 -0
- package/dist/types/helpers/useAnchoredPosition.d.ts +9 -2
- package/dist/types-cjs/components/Card.d.ts +52 -0
- package/dist/types-cjs/components/Carousel.d.ts +12 -3
- package/dist/types-cjs/components/Message.d.ts +16 -0
- package/dist/types-cjs/components/Modal.d.ts +71 -0
- package/dist/types-cjs/components/Navbar.d.ts +10 -0
- package/dist/types-cjs/components/Popover.d.ts +5 -1
- package/dist/types-cjs/components/SegmentedControl.d.ts +9 -0
- package/dist/types-cjs/components/Sidebar.d.ts +45 -5
- package/dist/types-cjs/elements/Figure.d.ts +11 -0
- package/dist/types-cjs/form/ColorInputBase.d.ts +7 -1
- package/dist/types-cjs/form/DateInputBase.d.ts +7 -1
- package/dist/types-cjs/form/DateRangeInputBase.d.ts +7 -1
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +7 -1
- package/dist/types-cjs/form/TimeInputBase.d.ts +7 -1
- package/dist/types-cjs/form/TreeSelect.d.ts +4 -1
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +5 -0
- package/dist/types-cjs/form/_pickerInternals/useLocaleDefaults.d.ts +12 -0
- package/dist/types-cjs/form/_selectInternals/DialogSelect.d.ts +1 -0
- package/dist/types-cjs/helpers/useAnchoredPosition.d.ts +9 -2
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +6 -6
- package/src/scss/CLAUDE.md +1 -1
- package/src/scss/_input-trigger.scss +24 -5
- package/src/scss/components/_carousel.scss +22 -4
- package/src/scss/components/_popover.scss +11 -0
- package/src/scss/elements/_button.scss +49 -0
- package/src/scss/elements/_index.scss +1 -0
- package/src/scss/elements/_loader.scss +10 -5
- package/src/scss/form/_dateinput.scss +6 -0
- package/src/scss/form/_passwordinput.scss +6 -5
- package/src/scss/form/_picker-popover.scss +45 -5
- package/src/scss/form/_slider.scss +39 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerPopover.js","sources":["../../../../src/form/_pickerInternals/PickerPopover.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { classNames, usePrefixedClassNames } from '../../helpers/classNames';\nimport { useFocusTrap } from '../../helpers/useFocusTrap';\nimport { usePortalContainer } from '../../helpers/portal';\nimport {\n LocalePortalScope,\n type PortalLocale,\n} from '../../helpers/LocaleProvider';\nimport { isEventInside } from '../../helpers/shadowDom';\nimport { useLatestRef } from '../../helpers/useLatestRef';\nimport {\n marginGap,\n useAnchoredPosition,\n} from '../../helpers/useAnchoredPosition';\nimport { PickerPosition } from './pickerTypes';\n\nexport interface PickerPopoverProps {\n isOpen: boolean;\n onClose: () => void;\n anchorRef: React.RefObject<HTMLElement | null>;\n children: React.ReactNode;\n position?: PickerPosition;\n appendToBody?: boolean;\n className?: string;\n trapFocus?: boolean;\n closeOnClickOutside?: boolean;\n /** Close on Escape and on Alt+ArrowUp. Default `true`. */\n closeOnEscape?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n role?: 'dialog' | 'group';\n id?: string;\n /**\n * Where focus goes when the popover closes. Without it, focus goes back to\n * whatever had it when the focus trap turned on, which is read after the\n * panel's content mounts: a calendar that focuses a cell as it mounts\n * would be recorded instead, and that cell leaves with the panel.\n */\n restoreFocusRef?: React.RefObject<HTMLElement | null>;\n /**\n * Selects the element in the panel that takes focus as it opens, such as a\n * calendar's focused date rather than the first button in its header. When\n * nothing matches, or the match can't take focus, the first tab stop does.\n */\n initialFocusSelector?: string;\n /**\n * The `dir` and `lang` the panel carries when it portals, in place of a\n * `LocaleProvider`'s: the picker's own, from `usePickerLocaleScope`.\n */\n localeScope?: PortalLocale;\n /**\n * At least as wide as the anchor: in place through its partial's\n * `has-anchor-width` rule, which needs the anchor to be the element it's\n * placed against, and portaled through the anchor's width set inline.\n */\n matchWidth?: boolean;\n /** Placed again after each render, for content that changes size while it's open. */\n followContent?: boolean;\n}\n\nconst isBrowser = typeof window !== 'undefined';\n\nexport const PickerPopover: React.FC<PickerPopoverProps> = ({\n isOpen,\n onClose,\n anchorRef,\n children,\n position = 'bottom-left',\n appendToBody = false,\n className,\n trapFocus = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ariaLabel,\n ariaLabelledBy,\n role = 'dialog',\n id,\n restoreFocusRef,\n initialFocusSelector,\n localeScope,\n matchWidth = false,\n followContent = false,\n}) => {\n const panelRef = useRef<HTMLDivElement>(null);\n const resolveContainer = usePortalContainer();\n // Read as the trap turns on, once the panel's content has rendered.\n const initialFocusRef = useMemo(\n () =>\n initialFocusSelector === undefined\n ? undefined\n : {\n get current() {\n return (\n panelRef.current?.querySelector<HTMLElement>(\n initialFocusSelector\n ) ?? null\n );\n },\n },\n [initialFocusSelector]\n );\n const resolved = useAnchoredPosition(anchorRef, panelRef, {\n active: isOpen,\n position,\n fixed: appendToBody,\n // The gap comes from `--bulma-picker-popover-offset` as a margin, in place\n // or portaled, so the coordinates leave it out and `auto` reads it off\n // the panel.\n offset: 0,\n styledGap: marginGap,\n matchWidth,\n followContent,\n });\n\n // Read when a press lands outside or a key arrives, so both listeners stay\n // put while `onClose` changes identity, as an inline one does on every\n // render of the field.\n const onCloseRef = useLatestRef(onClose);\n\n useEffect(() => {\n if (!isOpen || !closeOnClickOutside || !isBrowser) return undefined;\n // Listen on `pointerdown` (rather than `mousedown`) so touch starts\n // outside the popover dismiss it on mobile — including swipe-from-outside\n // gestures, where the synthetic mouse event would otherwise lag a few\n // hundred ms behind the actual touch.\n const handler = (e: PointerEvent) => {\n const path = e.composedPath();\n if (panelRef.current && path.includes(panelRef.current)) return;\n if (anchorRef.current && path.includes(anchorRef.current)) return;\n onCloseRef.current();\n };\n document.addEventListener('pointerdown', handler);\n return () => document.removeEventListener('pointerdown', handler);\n }, [isOpen, closeOnClickOutside, anchorRef, onCloseRef]);\n\n // Escape closes it, and so does Alt+ArrowUp, the combobox's key for it,\n // which the calendar and the time wheels inside leave to it. Escape closes\n // it from anywhere, but the key is only the picker's when it was pressed in\n // the panel or the field: then it's marked used, so a Modal or Sidebar\n // around the picker stays open. From anywhere else, such as a dialog opened\n // over the picker, the key goes on to whatever has focus.\n useEffect(() => {\n if (!isOpen || !closeOnEscape || !isBrowser) return undefined;\n const handler = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n if (\n isEventInside(e, panelRef.current) ||\n isEventInside(e, anchorRef.current)\n ) {\n e.preventDefault();\n }\n onCloseRef.current();\n } else if (e.altKey && e.key === 'ArrowUp') {\n e.preventDefault();\n e.stopPropagation();\n onCloseRef.current();\n }\n };\n document.addEventListener('keydown', handler);\n return () => document.removeEventListener('keydown', handler);\n }, [isOpen, closeOnEscape, anchorRef, onCloseRef]);\n\n useFocusTrap(panelRef, {\n active: isOpen && trapFocus,\n initialFocusRef,\n restoreFocus: restoreFocusRef ?? true,\n });\n\n const panelClass = usePrefixedClassNames('picker-popover', {\n 'is-active': isOpen,\n [`is-${resolved.position}`]: true,\n 'is-portal': appendToBody,\n 'has-anchor-width': matchWidth,\n });\n\n if (!isOpen) return null;\n\n const style: React.CSSProperties = appendToBody\n ? {\n position: 'fixed',\n top: resolved.top,\n left: resolved.left,\n minWidth: resolved.minWidth,\n }\n : {};\n\n const panel = (\n <div\n ref={panelRef}\n id={id}\n role={role}\n aria-modal={role === 'dialog' ? 'false' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n tabIndex={-1}\n className={classNames(panelClass, className)}\n style={style}\n // An Escape pressed in the panel is the picker's, and the listener\n // above claims it. A Dropdown menu around the picker hears Escape in a\n // React handler, which runs before that listener, so the panel claims\n // it here too, where React gets to it first.\n onKeyDown={e => {\n if (closeOnEscape && e.key === 'Escape') e.preventDefault();\n }}\n >\n {children}\n </div>\n );\n\n if (appendToBody && isBrowser) {\n const target = resolveContainer();\n return createPortal(\n <LocalePortalScope target={target} scope={localeScope}>\n {panel}\n </LocalePortalScope>,\n target\n );\n }\n return panel;\n};\n\nPickerPopover.displayName = 'PickerPopover';\n\nexport default PickerPopover;\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AA6DA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW;AAExC,MAAM,aAAa,GAAiC,CAAC,EAC1D,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,aAAa,EACxB,YAAY,GAAG,KAAK,EACpB,SAAS,EACT,SAAS,GAAG,IAAI,EAChB,mBAAmB,GAAG,IAAI,EAC1B,aAAa,GAAG,IAAI,EACpB,SAAS,EACT,cAAc,EACd,IAAI,GAAG,QAAQ,EACf,EAAE,EACF,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,UAAU,GAAG,KAAK,EAClB,aAAa,GAAG,KAAK,GACtB,KAAI;AACH,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC;AAC7C,IAAA,MAAM,gBAAgB,GAAG,kBAAkB,EAAE;;IAE7C,MAAM,eAAe,GAAG,OAAO,CAC7B,MACE,oBAAoB,KAAK;AACvB,UAAE;AACF,UAAE;AACE,YAAA,IAAI,OAAO,GAAA;AACT,gBAAA,QACE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAC7B,oBAAoB,CACrB,IAAI,IAAI;YAEb,CAAC;AACF,SAAA,EACP,CAAC,oBAAoB,CAAC,CACvB;AACD,IAAA,MAAM,QAAQ,GAAG,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE;AACxD,QAAA,MAAM,EAAE,MAAM;QACd,QAAQ;AACR,QAAA,KAAK,EAAE,YAAY;;;;AAInB,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,aAAa;AACd,KAAA,CAAC;;;;AAKF,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AAE,SAAS,CAAC,EAC5C,KAAK,EAAE,KAAK;;;;;QAKZ,SAAS,EAAE,CAAC,IAAG;AACb,YAAA,IAAI,aAAa,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,CAAC,CAAC,cAAc,EAAE;AAC7D,QAAA,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACL,CACP;AAED,IAAA,IAAI,YAAY,IAAI,SAAS,EAAE;AAC7B,QAAA,MAAM,MAAM,GAAG,gBAAgB,EAAE;AACjC,QAAA,OAAO,YAAY,CACjBA,GAAA,CAAC,iBAAiB,EAAA,EAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAA,QAAA,EAClD,KAAK,GACY,EACpB,MAAM,CACP;IACH;AACA,IAAA,OAAO,KAAK;AACd;AAEA,aAAa,CAAC,WAAW,GAAG,eAAe;;"}
|
|
1
|
+
{"version":3,"file":"PickerPopover.js","sources":["../../../../src/form/_pickerInternals/PickerPopover.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { classNames, usePrefixedClassNames } from '../../helpers/classNames';\nimport { useFocusTrap } from '../../helpers/useFocusTrap';\nimport { usePortalContainer } from '../../helpers/portal';\nimport {\n LocalePortalScope,\n type PortalLocale,\n} from '../../helpers/LocaleProvider';\nimport { isEventInside } from '../../helpers/shadowDom';\nimport { useLatestRef } from '../../helpers/useLatestRef';\nimport {\n marginGap,\n useAnchoredPosition,\n} from '../../helpers/useAnchoredPosition';\nimport { PickerPosition } from './pickerTypes';\n\nexport interface PickerPopoverProps {\n isOpen: boolean;\n onClose: () => void;\n anchorRef: React.RefObject<HTMLElement | null>;\n children: React.ReactNode;\n /**\n * The corner it opens from. Left out, it's `bottom-left` lined up with the\n * anchor's start edge: the stylesheet's `is-start-aligned` rule in place,\n * and the anchor's direction when portaled.\n */\n position?: PickerPosition;\n appendToBody?: boolean;\n className?: string;\n trapFocus?: boolean;\n closeOnClickOutside?: boolean;\n /** Close on Escape and on Alt+ArrowUp. Default `true`. */\n closeOnEscape?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n role?: 'dialog' | 'group';\n id?: string;\n /**\n * Where focus goes when the popover closes. Without it, focus goes back to\n * whatever had it when the focus trap turned on, which is read after the\n * panel's content mounts: a calendar that focuses a cell as it mounts\n * would be recorded instead, and that cell leaves with the panel.\n */\n restoreFocusRef?: React.RefObject<HTMLElement | null>;\n /**\n * Selects the element in the panel that takes focus as it opens, such as a\n * calendar's focused date rather than the first button in its header. When\n * nothing matches, or the match can't take focus, the first tab stop does.\n */\n initialFocusSelector?: string;\n /**\n * The `dir` and `lang` the panel carries when it portals, in place of a\n * `LocaleProvider`'s: the picker's own, from `usePickerLocaleScope`.\n */\n localeScope?: PortalLocale;\n /**\n * At least as wide as the anchor: in place through its partial's\n * `has-anchor-width` rule, which needs the anchor to be the element it's\n * placed against, and portaled through the anchor's width set inline.\n */\n matchWidth?: boolean;\n /** Placed again after each render, for content that changes size while it's open. */\n followContent?: boolean;\n}\n\nconst isBrowser = typeof window !== 'undefined';\n\nexport const PickerPopover: React.FC<PickerPopoverProps> = ({\n isOpen,\n onClose,\n anchorRef,\n children,\n position,\n appendToBody = false,\n className,\n trapFocus = true,\n closeOnClickOutside = true,\n closeOnEscape = true,\n ariaLabel,\n ariaLabelledBy,\n role = 'dialog',\n id,\n restoreFocusRef,\n initialFocusSelector,\n localeScope,\n matchWidth = false,\n followContent = false,\n}) => {\n const panelRef = useRef<HTMLDivElement>(null);\n const resolveContainer = usePortalContainer();\n // Read as the trap turns on, once the panel's content has rendered.\n const initialFocusRef = useMemo(\n () =>\n initialFocusSelector === undefined\n ? undefined\n : {\n get current() {\n return (\n panelRef.current?.querySelector<HTMLElement>(\n initialFocusSelector\n ) ?? null\n );\n },\n },\n [initialFocusSelector]\n );\n const resolved = useAnchoredPosition(anchorRef, panelRef, {\n active: isOpen,\n position,\n fixed: appendToBody,\n // The gap comes from `--bulma-picker-popover-offset` as a margin, in place\n // or portaled, so the coordinates leave it out and `auto` reads it off\n // the panel.\n offset: 0,\n styledGap: marginGap,\n matchWidth,\n followContent,\n });\n\n // Read when a press lands outside or a key arrives, so both listeners stay\n // put while `onClose` changes identity, as an inline one does on every\n // render of the field.\n const onCloseRef = useLatestRef(onClose);\n\n useEffect(() => {\n if (!isOpen || !closeOnClickOutside || !isBrowser) return undefined;\n // Listen on `pointerdown` (rather than `mousedown`) so touch starts\n // outside the popover dismiss it on mobile — including swipe-from-outside\n // gestures, where the synthetic mouse event would otherwise lag a few\n // hundred ms behind the actual touch.\n const handler = (e: PointerEvent) => {\n const path = e.composedPath();\n if (panelRef.current && path.includes(panelRef.current)) return;\n if (anchorRef.current && path.includes(anchorRef.current)) return;\n onCloseRef.current();\n };\n document.addEventListener('pointerdown', handler);\n return () => document.removeEventListener('pointerdown', handler);\n }, [isOpen, closeOnClickOutside, anchorRef, onCloseRef]);\n\n // Escape closes it, and so does Alt+ArrowUp, the combobox's key for it,\n // which the calendar and the time wheels inside leave to it. Escape closes\n // it from anywhere, but the key is only the picker's when it was pressed in\n // the panel or the field: then it's marked used, so a Modal or Sidebar\n // around the picker stays open. From anywhere else, such as a dialog opened\n // over the picker, the key goes on to whatever has focus.\n useEffect(() => {\n if (!isOpen || !closeOnEscape || !isBrowser) return undefined;\n const handler = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n if (\n isEventInside(e, panelRef.current) ||\n isEventInside(e, anchorRef.current)\n ) {\n e.preventDefault();\n }\n onCloseRef.current();\n } else if (e.altKey && e.key === 'ArrowUp') {\n e.preventDefault();\n e.stopPropagation();\n onCloseRef.current();\n }\n };\n document.addEventListener('keydown', handler);\n return () => document.removeEventListener('keydown', handler);\n }, [isOpen, closeOnEscape, anchorRef, onCloseRef]);\n\n useFocusTrap(panelRef, {\n active: isOpen && trapFocus,\n initialFocusRef,\n restoreFocus: restoreFocusRef ?? true,\n });\n\n const panelClass = usePrefixedClassNames('picker-popover', {\n 'is-active': isOpen,\n [`is-${resolved.position}`]: true,\n // The default lines up with the field's inline start, so the stylesheet\n // moves it to the right edge on a right-to-left page.\n 'is-start-aligned': position === undefined,\n 'is-portal': appendToBody,\n 'has-anchor-width': matchWidth,\n });\n\n if (!isOpen) return null;\n\n const style: React.CSSProperties = appendToBody\n ? {\n position: 'fixed',\n top: resolved.top,\n left: resolved.left,\n minWidth: resolved.minWidth,\n }\n : {};\n\n const panel = (\n <div\n ref={panelRef}\n id={id}\n role={role}\n aria-modal={role === 'dialog' ? 'false' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n tabIndex={-1}\n className={classNames(panelClass, className)}\n style={style}\n // An Escape pressed in the panel is the picker's, and the listener\n // above claims it. A Dropdown menu around the picker hears Escape in a\n // React handler, which runs before that listener, so the panel claims\n // it here too, where React gets to it first.\n onKeyDown={e => {\n if (closeOnEscape && e.key === 'Escape') e.preventDefault();\n }}\n >\n {children}\n </div>\n );\n\n if (appendToBody && isBrowser) {\n const target = resolveContainer();\n return createPortal(\n <LocalePortalScope target={target} scope={localeScope}>\n {panel}\n </LocalePortalScope>,\n target\n );\n }\n return panel;\n};\n\nPickerPopover.displayName = 'PickerPopover';\n\nexport default PickerPopover;\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AAkEA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW;AAExC,MAAM,aAAa,GAAiC,CAAC,EAC1D,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,SAAS,EACT,SAAS,GAAG,IAAI,EAChB,mBAAmB,GAAG,IAAI,EAC1B,aAAa,GAAG,IAAI,EACpB,SAAS,EACT,cAAc,EACd,IAAI,GAAG,QAAQ,EACf,EAAE,EACF,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,UAAU,GAAG,KAAK,EAClB,aAAa,GAAG,KAAK,GACtB,KAAI;AACH,IAAA,MAAM,QAAQ,GA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|
|
714
714
|
});
|
|
715
715
|
columnOrder[nearestIdx]?.current?.startDrag(e.pointerId, e.clientY);
|
|
716
716
|
};
|
|
717
|
-
return (jsx("div", { id: id, className: classNames(rootClass, className), "aria-disabled": disabled, children: jsxs("div", { className: wheelsClass, ref: wheelsContainerRef, onPointerDown: onWheelsContainerPointerDown, children: [jsx(Wheel, { ref: hoursRef, values: hourValues, index: hourIndex, onChange: onHourIndex, formatLabel: pad2, ariaLabel: t.hours, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, wrap: true, onCommit: onCommit, onFocusPrev: focusPrevOf(hoursRef), onFocusNext: focusNextOf(hoursRef), disabledFor: hourDisabledFor, audioTick: audioTick }), jsx("div", { className: sepClass, "aria-hidden": "true", children: ":" }), jsx(Wheel, { ref: minutesRef, values: minuteValues, index: minuteIndex, onChange: onMinuteIndex, formatLabel: pad2, ariaLabel: t.minutes, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, wrap: true, onCommit: onCommit, onFocusPrev: focusPrevOf(minutesRef), onFocusNext: focusNextOf(minutesRef), disabledFor: minuteDisabledFor, audioTick: audioTick }), enableSeconds && (jsxs(Fragment, { children: [jsx("div", { className: sepClass, "aria-hidden": "true", children: ":" }), jsx(Wheel, { ref: secondsRef, values: secondValues, index: secondIndex, onChange: onSecondIndex, formatLabel: pad2, ariaLabel: t.seconds, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, wrap: true, onCommit: onCommit, onFocusPrev: focusPrevOf(secondsRef), onFocusNext: focusNextOf(secondsRef), disabledFor: secondDisabledFor, audioTick: audioTick })] })), hourFormat === '12' && (jsx(Wheel, { ref: ampmRef, values: ['AM', 'PM'], index: ampmIndex, onChange: onAmpmIndex, formatLabel: v => v, ariaLabel: t.ampm, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, onCommit: onCommit, onFocusPrev: focusPrevOf(ampmRef), onFocusNext: focusNextOf(ampmRef), audioTick: audioTick }))] }) }));
|
|
717
|
+
return (jsx("div", { id: id, className: classNames(rootClass, className), dir: "ltr", "aria-disabled": disabled, children: jsxs("div", { className: wheelsClass, ref: wheelsContainerRef, onPointerDown: onWheelsContainerPointerDown, children: [jsx(Wheel, { ref: hoursRef, values: hourValues, index: hourIndex, onChange: onHourIndex, formatLabel: pad2, ariaLabel: t.hours, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, wrap: true, onCommit: onCommit, onFocusPrev: focusPrevOf(hoursRef), onFocusNext: focusNextOf(hoursRef), disabledFor: hourDisabledFor, audioTick: audioTick }), jsx("div", { className: sepClass, "aria-hidden": "true", children: ":" }), jsx(Wheel, { ref: minutesRef, values: minuteValues, index: minuteIndex, onChange: onMinuteIndex, formatLabel: pad2, ariaLabel: t.minutes, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, wrap: true, onCommit: onCommit, onFocusPrev: focusPrevOf(minutesRef), onFocusNext: focusNextOf(minutesRef), disabledFor: minuteDisabledFor, audioTick: audioTick }), enableSeconds && (jsxs(Fragment, { children: [jsx("div", { className: sepClass, "aria-hidden": "true", children: ":" }), jsx(Wheel, { ref: secondsRef, values: secondValues, index: secondIndex, onChange: onSecondIndex, formatLabel: pad2, ariaLabel: t.seconds, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, wrap: true, onCommit: onCommit, onFocusPrev: focusPrevOf(secondsRef), onFocusNext: focusNextOf(secondsRef), disabledFor: secondDisabledFor, audioTick: audioTick })] })), hourFormat === '12' && (jsx(Wheel, { ref: ampmRef, values: ['AM', 'PM'], index: ampmIndex, onChange: onAmpmIndex, formatLabel: v => v, ariaLabel: t.ampm, visibleCount: visibleCount, itemHeight: itemHeight, disabled: disabled, size: size, color: color, onCommit: onCommit, onFocusPrev: focusPrevOf(ampmRef), onFocusNext: focusNextOf(ampmRef), audioTick: audioTick }))] }) }));
|
|
718
718
|
};
|
|
719
719
|
TimeWheels.displayName = 'TimeWheels';
|
|
720
720
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeWheels.js","sources":["../../../../src/form/_pickerInternals/TimeWheels.tsx"],"sourcesContent":["/* eslint-disable react-hooks/refs --\n * This wheel/momentum picker intentionally accesses refs during render:\n * - state is mirrored into refs (positionRef, audioTickEnabledRef) so the\n * RAF/drag/tick callbacks read the latest values in lockstep with rendering\n * (refactoring to effect-synced refs would desync drag from the frame);\n * - a MediaQueryList is lazily cached in a ref (reducedMotionMqlRef);\n * - per-column Wheel handle refs build the keyboard focus order.\n * These are deliberate, established patterns; behavior is covered by unit tests\n * and certified interactively in-browser (drag, ticks, keyboard focus nav).\n */\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../../helpers/classNames';\nimport { useConfig } from '../../helpers/Config';\nimport {\n HourFormat,\n PickerLabels,\n isPopoverToggleKey,\n mergeLabels,\n} from './pickerTypes';\nimport { setTimeOfDay } from './dateUtils';\nimport { tickHaptic as fireTickHaptic } from './haptics';\nimport { playAudioTick, unlockAudioTick } from './audioTick';\n\nexport interface TimeWheelsValue {\n hours: number;\n minutes: number;\n seconds?: number;\n}\n\nexport interface TimeWheelsProps {\n value: TimeWheelsValue;\n onChange: (v: TimeWheelsValue) => void;\n hourFormat?: HourFormat;\n enableSeconds?: boolean;\n /** Step between visible values in the wheel. Default `1`. */\n incrementHours?: number;\n incrementMinutes?: number;\n incrementSeconds?: number;\n unselectableTimes?: (d: Date) => boolean;\n size?: 'small' | 'medium' | 'large';\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n disabled?: boolean;\n className?: string;\n id?: string;\n labels?: PickerLabels;\n /** Number of items visible at once (must be odd). Default 5. */\n visibleCount?: number;\n /** Item height in px. Default 32. */\n itemHeight?: number;\n /**\n * Play a short audible tick on each item crossing. Useful as a fallback on\n * iOS Safari, where there is no web-accessible haptic API. Off by default\n * to avoid surprising users with sound; flip on for iOS-targeted UIs.\n */\n audioTick?: boolean;\n /**\n * Fired when the user presses Enter on a wheel column. The current value is\n * already committed (each wheel-tick calls onChange), so this typically just\n * needs to close the surrounding popover.\n */\n onCommit?: () => void;\n}\n\nconst wrap = (n: number, max: number): number => ((n % max) + max) % max;\n\n/**\n * Walk forward (or backward) from `start` in `step` steps until `test` returns\n * true or we've cycled all `max` candidates. Used to skip past unselectable\n * values without freezing the wheel.\n */\nfunction nextValid(\n start: number,\n step: number,\n max: number,\n test: (n: number) => boolean\n): number {\n let candidate = wrap(start, max);\n for (let i = 0; i < max; i++) {\n if (test(candidate)) return candidate;\n candidate = wrap(candidate + step, max);\n }\n return start;\n}\n\nconst pad2 = (n: number): string => String(n).padStart(2, '0');\n\ninterface WheelHandle {\n focus: () => void;\n /**\n * Begin a drag externally — used by the parent's empty-space forwarder so\n * the user can grab the wheel by touching anywhere in the wheels row, not\n * just on the column itself (matches iOS native picker behavior).\n *\n * The pointer must already be active (i.e., a real `pointerdown` is in\n * flight). We immediately capture the pointer on the wheel root so the\n * existing `onPointerMove` / `onPointerUp` handlers will fire here.\n */\n startDrag: (pointerId: number, clientY: number) => void;\n}\n\ninterface WheelProps<T> {\n values: T[];\n index: number;\n onChange: (nextIndex: number) => void;\n formatLabel: (v: T) => string;\n formatAriaText?: (v: T) => string;\n ariaLabel: string;\n visibleCount: number;\n itemHeight: number;\n disabled?: boolean;\n size?: 'small' | 'medium' | 'large';\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n onFocusPrev?: () => void;\n onFocusNext?: () => void;\n /** Fired when Enter is pressed (current value is already committed live). */\n onCommit?: () => void;\n /**\n * Whether the wheel wraps at the edges. When true, scrolling past the last\n * value rolls back to the first (and vice versa) and neighbouring values\n * are visible above the first / below the last item.\n */\n wrap?: boolean;\n /**\n * Optional predicate. Items for which it returns `true` are rendered with\n * the `disabled` attribute (and visually dimmed via the `:disabled` SCSS\n * rule), giving users a clear cue that the value is blocked. Keyboard /\n * wheel navigation may still pass over these positions, but `onChange`\n * callers (`TimeWheels`) skip them via `nextValid`.\n */\n disabledFor?: (v: T) => boolean;\n /**\n * Play an audible tick on each item crossing. Used as the iOS substitute\n * for haptic feedback; threaded from `TimeWheels.audioTick`.\n */\n audioTick?: boolean;\n}\n\nconst WheelInner = <T,>(\n {\n values,\n index,\n onChange,\n formatLabel,\n formatAriaText,\n ariaLabel,\n visibleCount,\n itemHeight,\n disabled,\n size,\n color,\n onFocusPrev,\n onFocusNext,\n onCommit,\n wrap = false,\n disabledFor,\n audioTick = false,\n }: WheelProps<T>,\n ref: React.Ref<WheelHandle>\n) => {\n const { classPrefix } = useConfig();\n const N = values.length;\n const half = Math.floor(visibleCount / 2);\n const containerHeight = visibleCount * itemHeight;\n // Buffer around the visible window so adjacent items animate in/out smoothly.\n const BUFFER = half + 2;\n\n // Continuous wheel position in units of items. Math.round(position) is the\n // \"active\" virtual index; the fractional part is the drag/momentum offset\n // within an item slot. Using a single float (rather than virtualIdx +\n // dragOffset) keeps drag and tick-update in lockstep so items move with the\n // finger without a 40px overshoot when crossing item boundaries.\n const [position, setPosition] = useState<number>(index);\n const positionRef = useRef<number>(index);\n positionRef.current = position;\n const [isDragging, setIsDragging] = useState(false);\n const rootRef = useRef<HTMLDivElement>(null);\n // Ref to the stationary selection band — populated by the JSX below. The\n // band briefly scales + brightens on each item tick so users perceive a\n // body-felt \"thunk\" even on iOS where no haptic API exists.\n const bandRef = useRef<HTMLDivElement>(null);\n // Cached MediaQueryList for `prefers-reduced-motion`. We read this on\n // every tick to decide whether to fire the band pulse; caching the MQL\n // saves a `matchMedia` call per tick (which can fire at ~20Hz during a\n // momentum flick).\n const reducedMotionMqlRef = useRef<MediaQueryList | null>(null);\n if (\n reducedMotionMqlRef.current === null &&\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ) {\n reducedMotionMqlRef.current = window.matchMedia(\n '(prefers-reduced-motion: reduce)'\n );\n }\n // In-flight band pulse animation (Web Animations API). Tracked so we can\n // cancel on unmount; the WAI's `composite: 'replace'` semantics handle\n // re-trigger automatically without us needing to cancel between ticks.\n const pulseAnimRef = useRef<Animation | null>(null);\n // True while the external `index` prop sync useEffect runs, so we don't\n // fire a haptic blip when the parent updates the value programmatically.\n const isSyncingRef = useRef<boolean>(false);\n\n // Tiny haptic/audio/visual blip per item tick. Haptic uses\n // `navigator.vibrate` where available (Android Chrome / Firefox Android /\n // Samsung Internet); iOS has no web-accessible haptic path as of May\n // 2026, so the optional `audioTick` plays a low-frequency thunk as the\n // closest UX substitute. The visual band-pulse fires on every tick on\n // every platform (gated only by `prefers-reduced-motion`) so the\n // selection band feels reactive — visual reinforcement of the tactile\n // feedback. We skip all three during programmatic prop sync so a parent\n // re-render doesn't blip.\n const audioTickEnabledRef = useRef<boolean>(audioTick);\n audioTickEnabledRef.current = audioTick;\n const playBandPulse = useCallback(() => {\n const el = bandRef.current;\n if (!el || typeof el.animate !== 'function') return;\n if (reducedMotionMqlRef.current?.matches) return;\n // Compound scale + brightness pulse, peaking at 40% through the 110ms\n // duration. `composite: 'replace'` means a re-trigger mid-pulse cleanly\n // restarts rather than queueing — important at fling rates where ticks\n // can fire every ~50ms.\n pulseAnimRef.current = el.animate(\n [\n { transform: 'scale(1)', filter: 'brightness(1)' },\n {\n transform: 'scale(1.04)',\n filter: 'brightness(1.15)',\n offset: 0.4,\n },\n { transform: 'scale(1)', filter: 'brightness(1)' },\n ],\n { duration: 110, easing: 'ease-out', composite: 'replace' }\n );\n }, []);\n const tickFeedback = useCallback(() => {\n /* istanbul ignore next: the sync flag is only true synchronously inside the prop-sync effect, which sets position directly and never routes through commitPosition */\n if (isSyncingRef.current) return;\n fireTickHaptic();\n if (audioTickEnabledRef.current) playAudioTick();\n playBandPulse();\n }, [playBandPulse]);\n const dragStateRef = useRef<{\n pointerId: number | null;\n startY: number;\n startPosition: number;\n captured: boolean;\n samples: { t: number; y: number }[];\n }>({\n pointerId: null,\n startY: 0,\n startPosition: 0,\n captured: false,\n samples: [],\n });\n // RAF id for the in-flight momentum / snap animation, so we can cancel when\n // the user grabs the wheel again or the component unmounts.\n const rafIdRef = useRef<number | null>(null);\n\n const virtualIdx = Math.round(position);\n\n const cancelRaf = useCallback(() => {\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n }, []);\n\n useEffect(\n () => () => {\n cancelRaf();\n // Cancel any in-flight band pulse so it doesn't keep a reference to\n // a detached DOM node. WAI Animation.cancel() is safe to call even\n // if the animation has already finished.\n pulseAnimRef.current?.cancel();\n pulseAnimRef.current = null;\n },\n [cancelRaf]\n );\n\n React.useImperativeHandle(\n ref,\n () => ({\n focus: () => rootRef.current?.focus(),\n startDrag: (pointerId: number, clientY: number) => {\n /* istanbul ignore next: the empty-space forwarder (sole caller) already returns on the same disabled prop */\n if (disabled) return;\n cancelRaf();\n if (audioTickEnabledRef.current) unlockAudioTick();\n const now =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n dragStateRef.current = {\n pointerId,\n startY: clientY,\n startPosition: positionRef.current,\n // Skip the drag-threshold gate: the parent forwarder has already\n // decided this is a drag (a pointerdown landed on empty space,\n // which has no click target).\n captured: true,\n samples: [{ t: now, y: clientY }],\n };\n try {\n rootRef.current?.setPointerCapture(pointerId);\n } catch {\n // setPointerCapture can throw if the pointer isn't currently\n // active for this element; the existing onPointerMove handler\n // still matches on pointerId so the drag will work either way.\n }\n setIsDragging(true);\n },\n }),\n [disabled, cancelRaf]\n );\n\n // Resolve a virtualIdx into an actual values[] index (modulo wrap if `wrap`).\n const toActual = useCallback(\n (v: number) => {\n if (wrap) return ((v % N) + N) % N;\n return Math.max(0, Math.min(N - 1, v));\n },\n [wrap, N]\n );\n\n const clampPosition = useCallback(\n (p: number) => {\n if (wrap) return p;\n return Math.max(0, Math.min(N - 1, p));\n },\n [wrap, N]\n );\n\n // Update position and fire onChange if the rounded value changed.\n const commitPosition = useCallback(\n (next: number) => {\n const clamped = clampPosition(next);\n const prevRound = Math.round(positionRef.current);\n const nextRound = Math.round(clamped);\n positionRef.current = clamped;\n setPosition(clamped);\n if (nextRound !== prevRound) {\n onChange(toActual(nextRound));\n tickFeedback();\n }\n },\n [clampPosition, onChange, toActual, tickFeedback]\n );\n\n // When the external `index` changes (e.g. from typed input), re-sync\n // position to the closest virtual position that maps to it.\n //\n // Crucial subtlety: this effect re-runs every time the parent value\n // changes — including the round-trip case where the user's own scroll\n // commits a tick → fires onChange → parent re-renders with the new\n // index → here. If we cancelled the in-flight momentum/snap RAF on\n // every such echo, the snap would never get to land on an integer\n // (the user's wheel would stop wherever the last tick fired). So we\n // bail out early when the rounded position already matches the\n // incoming index — the echo case — and only cancel + apply an actual\n // jump when the parent has moved us somewhere we don't already round\n // to.\n useEffect(() => {\n const prev = positionRef.current;\n const wrappedRoundPrev = ((Math.round(prev) % N) + N) % N;\n if (wrappedRoundPrev === index) return;\n cancelRaf();\n isSyncingRef.current = true;\n setPosition(prevPos => {\n if (!wrap) {\n positionRef.current = index;\n return index;\n }\n const wrappedPrev = ((prevPos % N) + N) % N;\n const forward = (index - wrappedPrev + N) % N;\n const backward = forward - N;\n const delta =\n Math.abs(forward) <= Math.abs(backward) ? forward : backward;\n const next = prevPos + delta;\n positionRef.current = next;\n return next;\n });\n isSyncingRef.current = false;\n }, [index, N, wrap, cancelRaf]);\n\n const moveBy = useCallback(\n (delta: number) => {\n if (disabled) return;\n cancelRaf();\n commitPosition(Math.round(positionRef.current) + delta);\n },\n [disabled, cancelRaf, commitPosition]\n );\n\n // The keys are a spinbutton's: up raises the value and down lowers it. The\n // values run down the wheel, so up brings the one below the band into it,\n // the way a drag or a scroll that moves the items up does.\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (isPopoverToggleKey(e)) return;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n moveBy(1);\n break;\n case 'ArrowDown':\n e.preventDefault();\n moveBy(-1);\n break;\n case 'PageUp':\n e.preventDefault();\n moveBy(5);\n break;\n case 'PageDown':\n e.preventDefault();\n moveBy(-5);\n break;\n case 'Home':\n e.preventDefault();\n if (disabled) break;\n cancelRaf();\n commitPosition(0);\n break;\n case 'End':\n e.preventDefault();\n if (disabled) break;\n cancelRaf();\n commitPosition(N - 1);\n break;\n case 'ArrowLeft':\n e.preventDefault();\n onFocusPrev?.();\n break;\n case 'ArrowRight':\n e.preventDefault();\n onFocusNext?.();\n break;\n case 'Enter':\n e.preventDefault();\n onCommit?.();\n break;\n }\n },\n [\n moveBy,\n disabled,\n commitPosition,\n cancelRaf,\n N,\n onFocusPrev,\n onFocusNext,\n onCommit,\n ]\n );\n\n // Animate position to the nearest integer with ease-out cubic. Used after a\n // drag / momentum settles, so the wheel always rests aligned to an item.\n const animateSnap = useCallback(() => {\n cancelRaf();\n const start = positionRef.current;\n const target = Math.round(start);\n if (start === target) return;\n const duration = 180;\n const startTime =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n const tick = (now: number) => {\n const t = Math.min(1, (now - startTime) / duration);\n const eased = 1 - Math.pow(1 - t, 3);\n const next = start + (target - start) * eased;\n commitPosition(next);\n if (t < 1) {\n rafIdRef.current = requestAnimationFrame(tick);\n } else {\n rafIdRef.current = null;\n }\n };\n rafIdRef.current = requestAnimationFrame(tick);\n }, [cancelRaf, commitPosition]);\n\n // Kinetic momentum after a flick. Uses exponential friction so the velocity\n // tapers smoothly. Updates `position` in items/ms; commitPosition handles\n // the onChange ticks as virtualIdx crosses integers.\n const startMomentum = useCallback(\n (initialPxPerMs: number) => {\n cancelRaf();\n // Drag-up (negative dy/dt in screen coords) should INCREASE position\n // (later values come into view), so flip the sign.\n let velocity = -initialPxPerMs / itemHeight; // items / ms\n // Cap initial velocity so a frantic swipe doesn't blast through the\n // whole list. Empirically tuned to match iOS feel.\n const MAX_VEL = 0.05; // items/ms (≈ 50 items/sec)\n if (velocity > MAX_VEL) velocity = MAX_VEL;\n if (velocity < -MAX_VEL) velocity = -MAX_VEL;\n const STOP_VEL = 0.0015; // items/ms (≈ 1.5 items/sec)\n // Friction coefficient per millisecond — chosen so velocity halves\n // every ~120ms.\n const FRICTION_PER_MS = Math.pow(0.5, 1 / 120);\n let lastTime =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n const tick = (now: number) => {\n const dt = Math.max(1, now - lastTime);\n lastTime = now;\n let next = positionRef.current + velocity * dt;\n // Boundary handling for non-wrapping wheels: clamp and zero the\n // velocity so we don't keep ticking against the wall.\n if (!wrap) {\n if (next <= 0) {\n next = 0;\n velocity = 0;\n } else if (next >= N - 1) {\n next = N - 1;\n velocity = 0;\n }\n }\n commitPosition(next);\n velocity *= Math.pow(FRICTION_PER_MS, dt);\n if (Math.abs(velocity) < STOP_VEL) {\n animateSnap();\n return;\n }\n rafIdRef.current = requestAnimationFrame(tick);\n };\n rafIdRef.current = requestAnimationFrame(tick);\n },\n [cancelRaf, commitPosition, itemHeight, wrap, N, animateSnap]\n );\n\n // Mouse wheel: accumulate deltaY across events and step when the\n // accumulator crosses SCROLL_STEP_PX. Trackpads emit dozens of small\n // events per swipe; without accumulation a single gesture flies the wheel.\n useEffect(() => {\n const el = rootRef.current;\n if (!el || disabled) return undefined;\n const SCROLL_STEP_PX = 60;\n const QUIET_MS = 250;\n let accumulated = 0;\n let resetTimer: ReturnType<typeof setTimeout> | null = null;\n const resetAccumulator = () => {\n accumulated = 0;\n };\n const onWheel = (e: WheelEvent) => {\n e.preventDefault();\n // Reset accumulator if scroll direction reversed mid-gesture.\n if (accumulated !== 0 && Math.sign(accumulated) !== Math.sign(e.deltaY)) {\n accumulated = 0;\n }\n accumulated += e.deltaY;\n while (Math.abs(accumulated) >= SCROLL_STEP_PX) {\n if (accumulated > 0) {\n moveBy(1);\n accumulated -= SCROLL_STEP_PX;\n } else {\n moveBy(-1);\n accumulated += SCROLL_STEP_PX;\n }\n }\n if (resetTimer) clearTimeout(resetTimer);\n resetTimer = setTimeout(resetAccumulator, QUIET_MS);\n };\n el.addEventListener('wheel', onWheel, { passive: false });\n return () => {\n el.removeEventListener('wheel', onWheel);\n if (resetTimer) clearTimeout(resetTimer);\n };\n }, [moveBy, disabled]);\n\n // Pointer drag.\n // We DELAY capturing the pointer until the user moves more than\n // DRAG_THRESHOLD_PX. Without this, capturing on pointerdown would redirect\n // mouseup → wheel root, which suppresses the click event on the item button\n // the user pressed (so single-clicks on neighbouring items would no-op).\n const DRAG_THRESHOLD_PX = 4;\n const onPointerDown = (e: React.PointerEvent<HTMLDivElement>) => {\n if (disabled) return;\n cancelRaf();\n if (audioTickEnabledRef.current) {\n // Resume the AudioContext from inside the user gesture so the first\n // tick of this drag can play (iOS Safari requires this; other browsers\n // are forgiving but it's a cheap idempotent call).\n unlockAudioTick();\n }\n const now =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n dragStateRef.current = {\n pointerId: e.pointerId,\n startY: e.clientY,\n startPosition: positionRef.current,\n captured: false,\n samples: [{ t: now, y: e.clientY }],\n };\n };\n const onPointerMove = (e: React.PointerEvent<HTMLDivElement>) => {\n const s = dragStateRef.current;\n if (s.pointerId !== e.pointerId) return;\n const dy = e.clientY - s.startY;\n if (!s.captured) {\n if (Math.abs(dy) < DRAG_THRESHOLD_PX) return;\n rootRef.current?.setPointerCapture(e.pointerId);\n s.captured = true;\n setIsDragging(true);\n }\n const now =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n s.samples.push({ t: now, y: e.clientY });\n // Keep the velocity sample window short so the post-flick velocity\n // reflects the *recent* finger speed, not the whole-drag average.\n const VELOCITY_WINDOW_MS = 100;\n while (s.samples.length > 2 && now - s.samples[0].t > VELOCITY_WINDOW_MS) {\n s.samples.shift();\n }\n // Continuous position: every itemHeight worth of finger drag advances\n // the wheel by 1 unit. Pulling the finger DOWN (positive dy) shows\n // EARLIER values, which means position decreases.\n commitPosition(s.startPosition - dy / itemHeight);\n };\n const onPointerUp = (e: React.PointerEvent<HTMLDivElement>) => {\n const s = dragStateRef.current;\n if (s.pointerId !== e.pointerId) return;\n if (s.captured) {\n rootRef.current?.releasePointerCapture(e.pointerId);\n // Drags don't fire click → focus would be left on whichever child\n // received pointerdown. Pull it back to the wheel root so :focus\n // emphasis still reads correctly after a drag.\n rootRef.current?.focus();\n // Compute fling velocity from the recent sample window.\n const samples = s.samples;\n let pxPerMs = 0;\n if (samples.length >= 2) {\n const first = samples[0];\n const last = samples[samples.length - 1];\n const dt = last.t - first.t;\n if (dt > 0) pxPerMs = (last.y - first.y) / dt;\n }\n // Threshold below which we just snap to the nearest item; above which\n // we kick off momentum.\n const FLING_THRESHOLD = 0.25; // px/ms ≈ 250 px/sec\n if (Math.abs(pxPerMs) > FLING_THRESHOLD) {\n startMomentum(pxPerMs);\n } else {\n animateSnap();\n }\n }\n s.pointerId = null;\n s.captured = false;\n s.samples = [];\n setIsDragging(false);\n };\n\n const rootClass = prefixedClassNames(classPrefix, 'timeinput-wheel', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-disabled': disabled,\n 'is-dragging': isDragging,\n });\n const itemClass = (selected: boolean) =>\n prefixedClassNames(classPrefix, 'timeinput-wheel-item', {\n 'is-selected': selected,\n [`is-${color}`]: selected && !!color,\n });\n const bandClass = prefixedClassNames(classPrefix, 'timeinput-wheel-band', {\n [`is-${color}`]: !!color,\n });\n\n // Build the buffered window of items to render around the current position.\n const items: { vIdx: number; aIdx: number }[] = [];\n for (let off = -BUFFER; off <= BUFFER; off++) {\n const vIdx = virtualIdx + off;\n if (!wrap && (vIdx < 0 || vIdx >= N)) continue;\n const aIdx = toActual(vIdx);\n items.push({ vIdx, aIdx });\n }\n\n const ariaText = formatAriaText\n ? formatAriaText(values[toActual(virtualIdx)])\n : formatLabel(values[toActual(virtualIdx)]);\n\n // Center of the wheel viewport, in px from the top.\n const centreTop = containerHeight / 2 - itemHeight / 2;\n\n return (\n <div\n ref={rootRef}\n role=\"spinbutton\"\n aria-label={ariaLabel}\n aria-valuemin={0}\n aria-valuemax={N - 1}\n aria-valuenow={toActual(virtualIdx)}\n aria-valuetext={ariaText}\n tabIndex={disabled ? -1 : 0}\n className={rootClass}\n style={{ height: containerHeight }}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n >\n {/* Stationary selection band — sits at the centre of the viewport while\n items slide through it, like the iOS native picker. The ref lets\n `playBandPulse` animate scale + brightness on each item tick. */}\n <div\n ref={bandRef}\n className={bandClass}\n aria-hidden=\"true\"\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n top: centreTop,\n height: itemHeight,\n pointerEvents: 'none',\n }}\n />\n {items.map(({ vIdx, aIdx }) => {\n // Continuous offset in items: items at the centre have offset ≈ 0;\n // top of viewport is negative, bottom positive.\n const offCentreItems = vIdx - position;\n const top = centreTop + offCentreItems * itemHeight;\n const selected = vIdx === virtualIdx;\n const itemDisabled =\n disabled || (disabledFor ? disabledFor(values[aIdx]) : false);\n return (\n <button\n key={vIdx}\n type=\"button\"\n // A spinbutton owns no options: it states its value through\n // aria-valuetext, so the items are pointer targets only.\n aria-hidden=\"true\"\n tabIndex={-1}\n className={itemClass(selected)}\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n height: itemHeight,\n top: `${top}px`,\n }}\n disabled={itemDisabled}\n // Keep a press from focusing the item, which assistive technology\n // can't see; the click below hands focus to the wheel instead.\n onMouseDown={e => e.preventDefault()}\n onClick={() => {\n moveBy(vIdx - virtualIdx);\n // Click focuses the <button> child by default; pull focus back\n // to the wheel root so the column emphasis (:focus rules) match.\n rootRef.current?.focus();\n }}\n >\n {formatLabel(values[aIdx])}\n </button>\n );\n })}\n </div>\n );\n};\n\nconst Wheel = React.forwardRef(WheelInner) as <T>(\n props: WheelProps<T> & { ref?: React.Ref<WheelHandle> }\n) => React.ReactElement;\n\nexport const TimeWheels: React.FC<TimeWheelsProps> = ({\n value,\n onChange,\n hourFormat = '24',\n enableSeconds = false,\n incrementHours = 1,\n incrementMinutes = 1,\n incrementSeconds = 1,\n unselectableTimes,\n size,\n color,\n disabled,\n className,\n id,\n labels,\n visibleCount = 5,\n itemHeight = 32,\n audioTick = false,\n onCommit,\n}) => {\n const t = mergeLabels(labels);\n\n const rootClass = usePrefixedClassNames('timeinput', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-disabled': disabled,\n });\n const wheelsClass = usePrefixedClassNames('timeinput-wheels');\n const sepClass = usePrefixedClassNames('timeinput-separator');\n // Use the prefixed class through the same helper the wheels themselves do,\n // so the selector matches the actual rendered class regardless of whether\n // the consumer configured `classPrefix` via ConfigProvider. Building the\n // selector with `${classPrefix}timeinput-wheel` is wrong when classPrefix\n // is undefined (defaults to the empty prefix) — it would stringify to\n // \"undefinedtimeinput-wheel\".\n const wheelSingleClass = usePrefixedClassNames('timeinput-wheel');\n const wheelsContainerRef = useRef<HTMLDivElement>(null);\n\n const isPm = value.hours >= 12;\n\n const isTimeAllowed = useCallback(\n (h: number, m: number, s: number) => {\n if (!unselectableTimes) return true;\n const probe = setTimeOfDay(new Date(), {\n hours: h,\n minutes: m,\n seconds: s,\n milliseconds: 0,\n });\n return !unselectableTimes(probe);\n },\n [unselectableTimes]\n );\n\n // Per-column \"is this value disabled?\" predicates. We compute them against\n // the current value's other parts, so e.g. a predicate that only blocks\n // 12:00–12:59 leaves all minutes selectable when the user moves the hour\n // off 12. Returning `undefined` (rather than a function) when there is no\n // unselectableTimes lets the Wheel skip the disabled-attribute branch.\n const isHourDisabled = useCallback(\n (display: number) => {\n let h24 = display;\n if (hourFormat === '12') {\n const base = display % 12;\n h24 = isPm ? base + 12 : base;\n }\n return !isTimeAllowed(h24, value.minutes, value.seconds ?? 0);\n },\n [hourFormat, isPm, isTimeAllowed, value.minutes, value.seconds]\n );\n const isMinuteDisabled = useCallback(\n (m: number) => !isTimeAllowed(value.hours, m, value.seconds ?? 0),\n [isTimeAllowed, value.hours, value.seconds]\n );\n const isSecondDisabled = useCallback(\n (s: number) => !isTimeAllowed(value.hours, value.minutes, s),\n [isTimeAllowed, value.hours, value.minutes]\n );\n const hourDisabledFor = unselectableTimes ? isHourDisabled : undefined;\n const minuteDisabledFor = unselectableTimes ? isMinuteDisabled : undefined;\n const secondDisabledFor = unselectableTimes ? isSecondDisabled : undefined;\n\n const commit = useCallback(\n (next: Partial<TimeWheelsValue>) => {\n const merged: TimeWheelsValue = {\n hours: next.hours ?? value.hours,\n minutes: next.minutes ?? value.minutes,\n seconds: enableSeconds\n ? (next.seconds ?? value.seconds ?? 0)\n : undefined,\n };\n if (!isTimeAllowed(merged.hours, merged.minutes, merged.seconds ?? 0)) {\n return;\n }\n onChange(merged);\n },\n [value, enableSeconds, isTimeAllowed, onChange]\n );\n\n // Build the value lists per column.\n const hourValues = useMemo<number[]>(() => {\n const step = Math.max(1, incrementHours);\n if (hourFormat === '12') {\n const out: number[] = [];\n for (let h = 1; h <= 12; h += step) out.push(h);\n return out;\n }\n const out: number[] = [];\n for (let h = 0; h < 24; h += step) out.push(h);\n return out;\n }, [hourFormat, incrementHours]);\n\n const minuteValues = useMemo<number[]>(() => {\n const step = Math.max(1, incrementMinutes);\n const out: number[] = [];\n for (let m = 0; m < 60; m += step) out.push(m);\n return out;\n }, [incrementMinutes]);\n\n const secondValues = useMemo<number[]>(() => {\n const step = Math.max(1, incrementSeconds);\n const out: number[] = [];\n for (let s = 0; s < 60; s += step) out.push(s);\n return out;\n }, [incrementSeconds]);\n\n // Map current value → wheel index.\n const displayedHours =\n hourFormat === '12'\n ? value.hours % 12 === 0\n ? 12\n : value.hours % 12\n : value.hours;\n const hourIndex = Math.max(0, hourValues.indexOf(displayedHours));\n const minuteIndex = Math.max(0, minuteValues.indexOf(value.minutes));\n const secondIndex = Math.max(0, secondValues.indexOf(value.seconds ?? 0));\n const ampmIndex = isPm ? 1 : 0;\n\n // Refs for column focus management.\n const hoursRef = useRef<WheelHandle>(null);\n const minutesRef = useRef<WheelHandle>(null);\n const secondsRef = useRef<WheelHandle>(null);\n const ampmRef = useRef<WheelHandle>(null);\n\n // Build the focus order at runtime.\n const columnOrder: React.RefObject<WheelHandle | null>[] = [];\n columnOrder.push(hoursRef);\n columnOrder.push(minutesRef);\n if (enableSeconds) columnOrder.push(secondsRef);\n if (hourFormat === '12') columnOrder.push(ampmRef);\n const focusAt = (i: number) => columnOrder[i]?.current?.focus();\n const indexOf = (r: React.RefObject<WheelHandle | null>): number =>\n columnOrder.indexOf(r);\n const focusPrevOf = (r: React.RefObject<WheelHandle | null>) => () =>\n focusAt(indexOf(r) - 1);\n const focusNextOf = (r: React.RefObject<WheelHandle | null>) => () =>\n focusAt(indexOf(r) + 1);\n\n // Hour change — translate displayed value back into 24h.\n const onHourIndex = (next: number) => {\n const display =\n hourValues[Math.max(0, Math.min(hourValues.length - 1, next))];\n let next24 = display;\n if (hourFormat === '12') {\n const baseHour = display % 12;\n next24 = isPm ? baseHour + 12 : baseHour;\n }\n // Skip past any blocked hour using nextValid.\n const allowed = nextValid(next24, next24 >= value.hours ? 1 : -1, 24, h =>\n isTimeAllowed(h, value.minutes, value.seconds ?? 0)\n );\n commit({ hours: allowed });\n };\n\n const onMinuteIndex = (next: number) => {\n const m =\n minuteValues[Math.max(0, Math.min(minuteValues.length - 1, next))];\n const allowed = nextValid(m, m >= value.minutes ? 1 : -1, 60, mm =>\n isTimeAllowed(value.hours, mm, value.seconds ?? 0)\n );\n commit({ minutes: allowed });\n };\n\n const onSecondIndex = (next: number) => {\n const s =\n secondValues[Math.max(0, Math.min(secondValues.length - 1, next))];\n const allowed = nextValid(s, s >= (value.seconds ?? 0) ? 1 : -1, 60, ss =>\n isTimeAllowed(value.hours, value.minutes, ss)\n );\n commit({ seconds: allowed });\n };\n\n const onAmpmIndex = (next: number) => {\n if (next === ampmIndex) return;\n commit({ hours: (value.hours + 12) % 24 });\n };\n\n // Forward drags that originate on the empty space inside the wheels row\n // (left of the leftmost wheel, right of the rightmost wheel, on the\n // separator) to whichever wheel column is nearest to the pointer X — so\n // the picker behaves like the iOS native one, where the whole picker\n // surface is grabbable, not just the column itself.\n const onWheelsContainerPointerDown = (\n e: React.PointerEvent<HTMLDivElement>\n ) => {\n if (disabled) return;\n // If the pointerdown landed on a real wheel column, the wheel's own\n // handler takes over — don't double-dispatch.\n if ((e.target as HTMLElement).closest(`.${wheelSingleClass}`)) return;\n const container = wheelsContainerRef.current;\n /* istanbul ignore next: the handler is attached to the very element this ref points to, so it can't be null while events fire */\n if (!container) return;\n const wheels = container.querySelectorAll<HTMLElement>(\n `.${wheelSingleClass}`\n );\n if (wheels.length === 0) return;\n let nearestIdx = 0;\n let nearestDist = Infinity;\n const x = e.clientX;\n wheels.forEach((el, i) => {\n const r = el.getBoundingClientRect();\n const cx = (r.left + r.right) / 2;\n const d = Math.abs(x - cx);\n if (d < nearestDist) {\n nearestDist = d;\n nearestIdx = i;\n }\n });\n columnOrder[nearestIdx]?.current?.startDrag(e.pointerId, e.clientY);\n };\n\n return (\n <div\n id={id}\n className={classNames(rootClass, className)}\n aria-disabled={disabled}\n >\n <div\n className={wheelsClass}\n ref={wheelsContainerRef}\n onPointerDown={onWheelsContainerPointerDown}\n >\n <Wheel\n ref={hoursRef}\n values={hourValues}\n index={hourIndex}\n onChange={onHourIndex}\n formatLabel={pad2}\n ariaLabel={t.hours}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n wrap\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(hoursRef)}\n onFocusNext={focusNextOf(hoursRef)}\n disabledFor={hourDisabledFor}\n audioTick={audioTick}\n />\n <div className={sepClass} aria-hidden=\"true\">\n :\n </div>\n <Wheel\n ref={minutesRef}\n values={minuteValues}\n index={minuteIndex}\n onChange={onMinuteIndex}\n formatLabel={pad2}\n ariaLabel={t.minutes}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n wrap\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(minutesRef)}\n onFocusNext={focusNextOf(minutesRef)}\n disabledFor={minuteDisabledFor}\n audioTick={audioTick}\n />\n {enableSeconds && (\n <>\n <div className={sepClass} aria-hidden=\"true\">\n :\n </div>\n <Wheel\n ref={secondsRef}\n values={secondValues}\n index={secondIndex}\n onChange={onSecondIndex}\n formatLabel={pad2}\n ariaLabel={t.seconds}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n wrap\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(secondsRef)}\n onFocusNext={focusNextOf(secondsRef)}\n disabledFor={secondDisabledFor}\n audioTick={audioTick}\n />\n </>\n )}\n {hourFormat === '12' && (\n <Wheel\n ref={ampmRef}\n values={['AM', 'PM']}\n index={ampmIndex}\n onChange={onAmpmIndex}\n formatLabel={v => v}\n ariaLabel={t.ampm}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(ampmRef)}\n onFocusNext={focusNextOf(ampmRef)}\n audioTick={audioTick}\n />\n )}\n </div>\n </div>\n );\n};\n\nTimeWheels.displayName = 'TimeWheels';\n\nexport default TimeWheels;\n"],"names":["fireTickHaptic","_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;AAyEA,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,GAAW,KAAa,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG;AAExE;;;;AAIG;AACH,SAAS,SAAS,CAChB,KAAa,EACb,IAAY,EACZ,GAAW,EACX,IAA4B,EAAA;IAE5B,IAAI,SAAS,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC;AAChC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5B,IAAI,IAAI,CAAC,SAAS,CAAC;AAAE,YAAA,OAAO,SAAS;QACrC,SAAS,GAAG,IAAI,C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AClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAA,IAAA,EACJ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,CAAC,UAAU,CAAC,EACpC,WAAW,EAAE,WAAW,CAAC,UAAU,CAAC,EACpC,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,SAAS,EAAA,CACpB,IACD,CACJ,EACA,UAAU,KAAK,IAAI,KAClBA,GAAA,CAAC,KAAK,EAAA,EACJ,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EACpB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,WAAW,EACrB,WAAW,EAAE,CAAC,IAAI,CAAC,EACnB,SAAS,EAAE,CAAC,CAAC,IAAI,EACjB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,EACjC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,EACjC,SAAS,EAAE,SAAS,EAAA,CACpB,CACH,CAAA,EAAA,CACG,EAAA,CACF;AAEV;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
|
|
1
|
+
{"version":3,"file":"TimeWheels.js","sources":["../../../../src/form/_pickerInternals/TimeWheels.tsx"],"sourcesContent":["/* eslint-disable react-hooks/refs --\n * This wheel/momentum picker intentionally accesses refs during render:\n * - state is mirrored into refs (positionRef, audioTickEnabledRef) so the\n * RAF/drag/tick callbacks read the latest values in lockstep with rendering\n * (refactoring to effect-synced refs would desync drag from the frame);\n * - a MediaQueryList is lazily cached in a ref (reducedMotionMqlRef);\n * - per-column Wheel handle refs build the keyboard focus order.\n * These are deliberate, established patterns; behavior is covered by unit tests\n * and certified interactively in-browser (drag, ticks, keyboard focus nav).\n */\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../../helpers/classNames';\nimport { useConfig } from '../../helpers/Config';\nimport {\n HourFormat,\n PickerLabels,\n isPopoverToggleKey,\n mergeLabels,\n} from './pickerTypes';\nimport { setTimeOfDay } from './dateUtils';\nimport { tickHaptic as fireTickHaptic } from './haptics';\nimport { playAudioTick, unlockAudioTick } from './audioTick';\n\nexport interface TimeWheelsValue {\n hours: number;\n minutes: number;\n seconds?: number;\n}\n\nexport interface TimeWheelsProps {\n value: TimeWheelsValue;\n onChange: (v: TimeWheelsValue) => void;\n hourFormat?: HourFormat;\n enableSeconds?: boolean;\n /** Step between visible values in the wheel. Default `1`. */\n incrementHours?: number;\n incrementMinutes?: number;\n incrementSeconds?: number;\n unselectableTimes?: (d: Date) => boolean;\n size?: 'small' | 'medium' | 'large';\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n disabled?: boolean;\n className?: string;\n id?: string;\n labels?: PickerLabels;\n /** Number of items visible at once (must be odd). Default 5. */\n visibleCount?: number;\n /** Item height in px. Default 32. */\n itemHeight?: number;\n /**\n * Play a short audible tick on each item crossing. Useful as a fallback on\n * iOS Safari, where there is no web-accessible haptic API. Off by default\n * to avoid surprising users with sound; flip on for iOS-targeted UIs.\n */\n audioTick?: boolean;\n /**\n * Fired when the user presses Enter on a wheel column. The current value is\n * already committed (each wheel-tick calls onChange), so this typically just\n * needs to close the surrounding popover.\n */\n onCommit?: () => void;\n}\n\nconst wrap = (n: number, max: number): number => ((n % max) + max) % max;\n\n/**\n * Walk forward (or backward) from `start` in `step` steps until `test` returns\n * true or we've cycled all `max` candidates. Used to skip past unselectable\n * values without freezing the wheel.\n */\nfunction nextValid(\n start: number,\n step: number,\n max: number,\n test: (n: number) => boolean\n): number {\n let candidate = wrap(start, max);\n for (let i = 0; i < max; i++) {\n if (test(candidate)) return candidate;\n candidate = wrap(candidate + step, max);\n }\n return start;\n}\n\nconst pad2 = (n: number): string => String(n).padStart(2, '0');\n\ninterface WheelHandle {\n focus: () => void;\n /**\n * Begin a drag externally — used by the parent's empty-space forwarder so\n * the user can grab the wheel by touching anywhere in the wheels row, not\n * just on the column itself (matches iOS native picker behavior).\n *\n * The pointer must already be active (i.e., a real `pointerdown` is in\n * flight). We immediately capture the pointer on the wheel root so the\n * existing `onPointerMove` / `onPointerUp` handlers will fire here.\n */\n startDrag: (pointerId: number, clientY: number) => void;\n}\n\ninterface WheelProps<T> {\n values: T[];\n index: number;\n onChange: (nextIndex: number) => void;\n formatLabel: (v: T) => string;\n formatAriaText?: (v: T) => string;\n ariaLabel: string;\n visibleCount: number;\n itemHeight: number;\n disabled?: boolean;\n size?: 'small' | 'medium' | 'large';\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n onFocusPrev?: () => void;\n onFocusNext?: () => void;\n /** Fired when Enter is pressed (current value is already committed live). */\n onCommit?: () => void;\n /**\n * Whether the wheel wraps at the edges. When true, scrolling past the last\n * value rolls back to the first (and vice versa) and neighbouring values\n * are visible above the first / below the last item.\n */\n wrap?: boolean;\n /**\n * Optional predicate. Items for which it returns `true` are rendered with\n * the `disabled` attribute (and visually dimmed via the `:disabled` SCSS\n * rule), giving users a clear cue that the value is blocked. Keyboard /\n * wheel navigation may still pass over these positions, but `onChange`\n * callers (`TimeWheels`) skip them via `nextValid`.\n */\n disabledFor?: (v: T) => boolean;\n /**\n * Play an audible tick on each item crossing. Used as the iOS substitute\n * for haptic feedback; threaded from `TimeWheels.audioTick`.\n */\n audioTick?: boolean;\n}\n\nconst WheelInner = <T,>(\n {\n values,\n index,\n onChange,\n formatLabel,\n formatAriaText,\n ariaLabel,\n visibleCount,\n itemHeight,\n disabled,\n size,\n color,\n onFocusPrev,\n onFocusNext,\n onCommit,\n wrap = false,\n disabledFor,\n audioTick = false,\n }: WheelProps<T>,\n ref: React.Ref<WheelHandle>\n) => {\n const { classPrefix } = useConfig();\n const N = values.length;\n const half = Math.floor(visibleCount / 2);\n const containerHeight = visibleCount * itemHeight;\n // Buffer around the visible window so adjacent items animate in/out smoothly.\n const BUFFER = half + 2;\n\n // Continuous wheel position in units of items. Math.round(position) is the\n // \"active\" virtual index; the fractional part is the drag/momentum offset\n // within an item slot. Using a single float (rather than virtualIdx +\n // dragOffset) keeps drag and tick-update in lockstep so items move with the\n // finger without a 40px overshoot when crossing item boundaries.\n const [position, setPosition] = useState<number>(index);\n const positionRef = useRef<number>(index);\n positionRef.current = position;\n const [isDragging, setIsDragging] = useState(false);\n const rootRef = useRef<HTMLDivElement>(null);\n // Ref to the stationary selection band — populated by the JSX below. The\n // band briefly scales + brightens on each item tick so users perceive a\n // body-felt \"thunk\" even on iOS where no haptic API exists.\n const bandRef = useRef<HTMLDivElement>(null);\n // Cached MediaQueryList for `prefers-reduced-motion`. We read this on\n // every tick to decide whether to fire the band pulse; caching the MQL\n // saves a `matchMedia` call per tick (which can fire at ~20Hz during a\n // momentum flick).\n const reducedMotionMqlRef = useRef<MediaQueryList | null>(null);\n if (\n reducedMotionMqlRef.current === null &&\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ) {\n reducedMotionMqlRef.current = window.matchMedia(\n '(prefers-reduced-motion: reduce)'\n );\n }\n // In-flight band pulse animation (Web Animations API). Tracked so we can\n // cancel on unmount; the WAI's `composite: 'replace'` semantics handle\n // re-trigger automatically without us needing to cancel between ticks.\n const pulseAnimRef = useRef<Animation | null>(null);\n // True while the external `index` prop sync useEffect runs, so we don't\n // fire a haptic blip when the parent updates the value programmatically.\n const isSyncingRef = useRef<boolean>(false);\n\n // Tiny haptic/audio/visual blip per item tick. Haptic uses\n // `navigator.vibrate` where available (Android Chrome / Firefox Android /\n // Samsung Internet); iOS has no web-accessible haptic path as of May\n // 2026, so the optional `audioTick` plays a low-frequency thunk as the\n // closest UX substitute. The visual band-pulse fires on every tick on\n // every platform (gated only by `prefers-reduced-motion`) so the\n // selection band feels reactive — visual reinforcement of the tactile\n // feedback. We skip all three during programmatic prop sync so a parent\n // re-render doesn't blip.\n const audioTickEnabledRef = useRef<boolean>(audioTick);\n audioTickEnabledRef.current = audioTick;\n const playBandPulse = useCallback(() => {\n const el = bandRef.current;\n if (!el || typeof el.animate !== 'function') return;\n if (reducedMotionMqlRef.current?.matches) return;\n // Compound scale + brightness pulse, peaking at 40% through the 110ms\n // duration. `composite: 'replace'` means a re-trigger mid-pulse cleanly\n // restarts rather than queueing — important at fling rates where ticks\n // can fire every ~50ms.\n pulseAnimRef.current = el.animate(\n [\n { transform: 'scale(1)', filter: 'brightness(1)' },\n {\n transform: 'scale(1.04)',\n filter: 'brightness(1.15)',\n offset: 0.4,\n },\n { transform: 'scale(1)', filter: 'brightness(1)' },\n ],\n { duration: 110, easing: 'ease-out', composite: 'replace' }\n );\n }, []);\n const tickFeedback = useCallback(() => {\n /* istanbul ignore next: the sync flag is only true synchronously inside the prop-sync effect, which sets position directly and never routes through commitPosition */\n if (isSyncingRef.current) return;\n fireTickHaptic();\n if (audioTickEnabledRef.current) playAudioTick();\n playBandPulse();\n }, [playBandPulse]);\n const dragStateRef = useRef<{\n pointerId: number | null;\n startY: number;\n startPosition: number;\n captured: boolean;\n samples: { t: number; y: number }[];\n }>({\n pointerId: null,\n startY: 0,\n startPosition: 0,\n captured: false,\n samples: [],\n });\n // RAF id for the in-flight momentum / snap animation, so we can cancel when\n // the user grabs the wheel again or the component unmounts.\n const rafIdRef = useRef<number | null>(null);\n\n const virtualIdx = Math.round(position);\n\n const cancelRaf = useCallback(() => {\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n }, []);\n\n useEffect(\n () => () => {\n cancelRaf();\n // Cancel any in-flight band pulse so it doesn't keep a reference to\n // a detached DOM node. WAI Animation.cancel() is safe to call even\n // if the animation has already finished.\n pulseAnimRef.current?.cancel();\n pulseAnimRef.current = null;\n },\n [cancelRaf]\n );\n\n React.useImperativeHandle(\n ref,\n () => ({\n focus: () => rootRef.current?.focus(),\n startDrag: (pointerId: number, clientY: number) => {\n /* istanbul ignore next: the empty-space forwarder (sole caller) already returns on the same disabled prop */\n if (disabled) return;\n cancelRaf();\n if (audioTickEnabledRef.current) unlockAudioTick();\n const now =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n dragStateRef.current = {\n pointerId,\n startY: clientY,\n startPosition: positionRef.current,\n // Skip the drag-threshold gate: the parent forwarder has already\n // decided this is a drag (a pointerdown landed on empty space,\n // which has no click target).\n captured: true,\n samples: [{ t: now, y: clientY }],\n };\n try {\n rootRef.current?.setPointerCapture(pointerId);\n } catch {\n // setPointerCapture can throw if the pointer isn't currently\n // active for this element; the existing onPointerMove handler\n // still matches on pointerId so the drag will work either way.\n }\n setIsDragging(true);\n },\n }),\n [disabled, cancelRaf]\n );\n\n // Resolve a virtualIdx into an actual values[] index (modulo wrap if `wrap`).\n const toActual = useCallback(\n (v: number) => {\n if (wrap) return ((v % N) + N) % N;\n return Math.max(0, Math.min(N - 1, v));\n },\n [wrap, N]\n );\n\n const clampPosition = useCallback(\n (p: number) => {\n if (wrap) return p;\n return Math.max(0, Math.min(N - 1, p));\n },\n [wrap, N]\n );\n\n // Update position and fire onChange if the rounded value changed.\n const commitPosition = useCallback(\n (next: number) => {\n const clamped = clampPosition(next);\n const prevRound = Math.round(positionRef.current);\n const nextRound = Math.round(clamped);\n positionRef.current = clamped;\n setPosition(clamped);\n if (nextRound !== prevRound) {\n onChange(toActual(nextRound));\n tickFeedback();\n }\n },\n [clampPosition, onChange, toActual, tickFeedback]\n );\n\n // When the external `index` changes (e.g. from typed input), re-sync\n // position to the closest virtual position that maps to it.\n //\n // Crucial subtlety: this effect re-runs every time the parent value\n // changes — including the round-trip case where the user's own scroll\n // commits a tick → fires onChange → parent re-renders with the new\n // index → here. If we cancelled the in-flight momentum/snap RAF on\n // every such echo, the snap would never get to land on an integer\n // (the user's wheel would stop wherever the last tick fired). So we\n // bail out early when the rounded position already matches the\n // incoming index — the echo case — and only cancel + apply an actual\n // jump when the parent has moved us somewhere we don't already round\n // to.\n useEffect(() => {\n const prev = positionRef.current;\n const wrappedRoundPrev = ((Math.round(prev) % N) + N) % N;\n if (wrappedRoundPrev === index) return;\n cancelRaf();\n isSyncingRef.current = true;\n setPosition(prevPos => {\n if (!wrap) {\n positionRef.current = index;\n return index;\n }\n const wrappedPrev = ((prevPos % N) + N) % N;\n const forward = (index - wrappedPrev + N) % N;\n const backward = forward - N;\n const delta =\n Math.abs(forward) <= Math.abs(backward) ? forward : backward;\n const next = prevPos + delta;\n positionRef.current = next;\n return next;\n });\n isSyncingRef.current = false;\n }, [index, N, wrap, cancelRaf]);\n\n const moveBy = useCallback(\n (delta: number) => {\n if (disabled) return;\n cancelRaf();\n commitPosition(Math.round(positionRef.current) + delta);\n },\n [disabled, cancelRaf, commitPosition]\n );\n\n // The keys are a spinbutton's: up raises the value and down lowers it. The\n // values run down the wheel, so up brings the one below the band into it,\n // the way a drag or a scroll that moves the items up does.\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (isPopoverToggleKey(e)) return;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n moveBy(1);\n break;\n case 'ArrowDown':\n e.preventDefault();\n moveBy(-1);\n break;\n case 'PageUp':\n e.preventDefault();\n moveBy(5);\n break;\n case 'PageDown':\n e.preventDefault();\n moveBy(-5);\n break;\n case 'Home':\n e.preventDefault();\n if (disabled) break;\n cancelRaf();\n commitPosition(0);\n break;\n case 'End':\n e.preventDefault();\n if (disabled) break;\n cancelRaf();\n commitPosition(N - 1);\n break;\n case 'ArrowLeft':\n e.preventDefault();\n onFocusPrev?.();\n break;\n case 'ArrowRight':\n e.preventDefault();\n onFocusNext?.();\n break;\n case 'Enter':\n e.preventDefault();\n onCommit?.();\n break;\n }\n },\n [\n moveBy,\n disabled,\n commitPosition,\n cancelRaf,\n N,\n onFocusPrev,\n onFocusNext,\n onCommit,\n ]\n );\n\n // Animate position to the nearest integer with ease-out cubic. Used after a\n // drag / momentum settles, so the wheel always rests aligned to an item.\n const animateSnap = useCallback(() => {\n cancelRaf();\n const start = positionRef.current;\n const target = Math.round(start);\n if (start === target) return;\n const duration = 180;\n const startTime =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n const tick = (now: number) => {\n const t = Math.min(1, (now - startTime) / duration);\n const eased = 1 - Math.pow(1 - t, 3);\n const next = start + (target - start) * eased;\n commitPosition(next);\n if (t < 1) {\n rafIdRef.current = requestAnimationFrame(tick);\n } else {\n rafIdRef.current = null;\n }\n };\n rafIdRef.current = requestAnimationFrame(tick);\n }, [cancelRaf, commitPosition]);\n\n // Kinetic momentum after a flick. Uses exponential friction so the velocity\n // tapers smoothly. Updates `position` in items/ms; commitPosition handles\n // the onChange ticks as virtualIdx crosses integers.\n const startMomentum = useCallback(\n (initialPxPerMs: number) => {\n cancelRaf();\n // Drag-up (negative dy/dt in screen coords) should INCREASE position\n // (later values come into view), so flip the sign.\n let velocity = -initialPxPerMs / itemHeight; // items / ms\n // Cap initial velocity so a frantic swipe doesn't blast through the\n // whole list. Empirically tuned to match iOS feel.\n const MAX_VEL = 0.05; // items/ms (≈ 50 items/sec)\n if (velocity > MAX_VEL) velocity = MAX_VEL;\n if (velocity < -MAX_VEL) velocity = -MAX_VEL;\n const STOP_VEL = 0.0015; // items/ms (≈ 1.5 items/sec)\n // Friction coefficient per millisecond — chosen so velocity halves\n // every ~120ms.\n const FRICTION_PER_MS = Math.pow(0.5, 1 / 120);\n let lastTime =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n const tick = (now: number) => {\n const dt = Math.max(1, now - lastTime);\n lastTime = now;\n let next = positionRef.current + velocity * dt;\n // Boundary handling for non-wrapping wheels: clamp and zero the\n // velocity so we don't keep ticking against the wall.\n if (!wrap) {\n if (next <= 0) {\n next = 0;\n velocity = 0;\n } else if (next >= N - 1) {\n next = N - 1;\n velocity = 0;\n }\n }\n commitPosition(next);\n velocity *= Math.pow(FRICTION_PER_MS, dt);\n if (Math.abs(velocity) < STOP_VEL) {\n animateSnap();\n return;\n }\n rafIdRef.current = requestAnimationFrame(tick);\n };\n rafIdRef.current = requestAnimationFrame(tick);\n },\n [cancelRaf, commitPosition, itemHeight, wrap, N, animateSnap]\n );\n\n // Mouse wheel: accumulate deltaY across events and step when the\n // accumulator crosses SCROLL_STEP_PX. Trackpads emit dozens of small\n // events per swipe; without accumulation a single gesture flies the wheel.\n useEffect(() => {\n const el = rootRef.current;\n if (!el || disabled) return undefined;\n const SCROLL_STEP_PX = 60;\n const QUIET_MS = 250;\n let accumulated = 0;\n let resetTimer: ReturnType<typeof setTimeout> | null = null;\n const resetAccumulator = () => {\n accumulated = 0;\n };\n const onWheel = (e: WheelEvent) => {\n e.preventDefault();\n // Reset accumulator if scroll direction reversed mid-gesture.\n if (accumulated !== 0 && Math.sign(accumulated) !== Math.sign(e.deltaY)) {\n accumulated = 0;\n }\n accumulated += e.deltaY;\n while (Math.abs(accumulated) >= SCROLL_STEP_PX) {\n if (accumulated > 0) {\n moveBy(1);\n accumulated -= SCROLL_STEP_PX;\n } else {\n moveBy(-1);\n accumulated += SCROLL_STEP_PX;\n }\n }\n if (resetTimer) clearTimeout(resetTimer);\n resetTimer = setTimeout(resetAccumulator, QUIET_MS);\n };\n el.addEventListener('wheel', onWheel, { passive: false });\n return () => {\n el.removeEventListener('wheel', onWheel);\n if (resetTimer) clearTimeout(resetTimer);\n };\n }, [moveBy, disabled]);\n\n // Pointer drag.\n // We DELAY capturing the pointer until the user moves more than\n // DRAG_THRESHOLD_PX. Without this, capturing on pointerdown would redirect\n // mouseup → wheel root, which suppresses the click event on the item button\n // the user pressed (so single-clicks on neighbouring items would no-op).\n const DRAG_THRESHOLD_PX = 4;\n const onPointerDown = (e: React.PointerEvent<HTMLDivElement>) => {\n if (disabled) return;\n cancelRaf();\n if (audioTickEnabledRef.current) {\n // Resume the AudioContext from inside the user gesture so the first\n // tick of this drag can play (iOS Safari requires this; other browsers\n // are forgiving but it's a cheap idempotent call).\n unlockAudioTick();\n }\n const now =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n dragStateRef.current = {\n pointerId: e.pointerId,\n startY: e.clientY,\n startPosition: positionRef.current,\n captured: false,\n samples: [{ t: now, y: e.clientY }],\n };\n };\n const onPointerMove = (e: React.PointerEvent<HTMLDivElement>) => {\n const s = dragStateRef.current;\n if (s.pointerId !== e.pointerId) return;\n const dy = e.clientY - s.startY;\n if (!s.captured) {\n if (Math.abs(dy) < DRAG_THRESHOLD_PX) return;\n rootRef.current?.setPointerCapture(e.pointerId);\n s.captured = true;\n setIsDragging(true);\n }\n const now =\n typeof performance !== 'undefined' ? performance.now() : Date.now();\n s.samples.push({ t: now, y: e.clientY });\n // Keep the velocity sample window short so the post-flick velocity\n // reflects the *recent* finger speed, not the whole-drag average.\n const VELOCITY_WINDOW_MS = 100;\n while (s.samples.length > 2 && now - s.samples[0].t > VELOCITY_WINDOW_MS) {\n s.samples.shift();\n }\n // Continuous position: every itemHeight worth of finger drag advances\n // the wheel by 1 unit. Pulling the finger DOWN (positive dy) shows\n // EARLIER values, which means position decreases.\n commitPosition(s.startPosition - dy / itemHeight);\n };\n const onPointerUp = (e: React.PointerEvent<HTMLDivElement>) => {\n const s = dragStateRef.current;\n if (s.pointerId !== e.pointerId) return;\n if (s.captured) {\n rootRef.current?.releasePointerCapture(e.pointerId);\n // Drags don't fire click → focus would be left on whichever child\n // received pointerdown. Pull it back to the wheel root so :focus\n // emphasis still reads correctly after a drag.\n rootRef.current?.focus();\n // Compute fling velocity from the recent sample window.\n const samples = s.samples;\n let pxPerMs = 0;\n if (samples.length >= 2) {\n const first = samples[0];\n const last = samples[samples.length - 1];\n const dt = last.t - first.t;\n if (dt > 0) pxPerMs = (last.y - first.y) / dt;\n }\n // Threshold below which we just snap to the nearest item; above which\n // we kick off momentum.\n const FLING_THRESHOLD = 0.25; // px/ms ≈ 250 px/sec\n if (Math.abs(pxPerMs) > FLING_THRESHOLD) {\n startMomentum(pxPerMs);\n } else {\n animateSnap();\n }\n }\n s.pointerId = null;\n s.captured = false;\n s.samples = [];\n setIsDragging(false);\n };\n\n const rootClass = prefixedClassNames(classPrefix, 'timeinput-wheel', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-disabled': disabled,\n 'is-dragging': isDragging,\n });\n const itemClass = (selected: boolean) =>\n prefixedClassNames(classPrefix, 'timeinput-wheel-item', {\n 'is-selected': selected,\n [`is-${color}`]: selected && !!color,\n });\n const bandClass = prefixedClassNames(classPrefix, 'timeinput-wheel-band', {\n [`is-${color}`]: !!color,\n });\n\n // Build the buffered window of items to render around the current position.\n const items: { vIdx: number; aIdx: number }[] = [];\n for (let off = -BUFFER; off <= BUFFER; off++) {\n const vIdx = virtualIdx + off;\n if (!wrap && (vIdx < 0 || vIdx >= N)) continue;\n const aIdx = toActual(vIdx);\n items.push({ vIdx, aIdx });\n }\n\n const ariaText = formatAriaText\n ? formatAriaText(values[toActual(virtualIdx)])\n : formatLabel(values[toActual(virtualIdx)]);\n\n // Center of the wheel viewport, in px from the top.\n const centreTop = containerHeight / 2 - itemHeight / 2;\n\n return (\n <div\n ref={rootRef}\n role=\"spinbutton\"\n aria-label={ariaLabel}\n aria-valuemin={0}\n aria-valuemax={N - 1}\n aria-valuenow={toActual(virtualIdx)}\n aria-valuetext={ariaText}\n tabIndex={disabled ? -1 : 0}\n className={rootClass}\n style={{ height: containerHeight }}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n >\n {/* Stationary selection band — sits at the centre of the viewport while\n items slide through it, like the iOS native picker. The ref lets\n `playBandPulse` animate scale + brightness on each item tick. */}\n <div\n ref={bandRef}\n className={bandClass}\n aria-hidden=\"true\"\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n top: centreTop,\n height: itemHeight,\n pointerEvents: 'none',\n }}\n />\n {items.map(({ vIdx, aIdx }) => {\n // Continuous offset in items: items at the centre have offset ≈ 0;\n // top of viewport is negative, bottom positive.\n const offCentreItems = vIdx - position;\n const top = centreTop + offCentreItems * itemHeight;\n const selected = vIdx === virtualIdx;\n const itemDisabled =\n disabled || (disabledFor ? disabledFor(values[aIdx]) : false);\n return (\n <button\n key={vIdx}\n type=\"button\"\n // A spinbutton owns no options: it states its value through\n // aria-valuetext, so the items are pointer targets only.\n aria-hidden=\"true\"\n tabIndex={-1}\n className={itemClass(selected)}\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n height: itemHeight,\n top: `${top}px`,\n }}\n disabled={itemDisabled}\n // Keep a press from focusing the item, which assistive technology\n // can't see; the click below hands focus to the wheel instead.\n onMouseDown={e => e.preventDefault()}\n onClick={() => {\n moveBy(vIdx - virtualIdx);\n // Click focuses the <button> child by default; pull focus back\n // to the wheel root so the column emphasis (:focus rules) match.\n rootRef.current?.focus();\n }}\n >\n {formatLabel(values[aIdx])}\n </button>\n );\n })}\n </div>\n );\n};\n\nconst Wheel = React.forwardRef(WheelInner) as <T>(\n props: WheelProps<T> & { ref?: React.Ref<WheelHandle> }\n) => React.ReactElement;\n\nexport const TimeWheels: React.FC<TimeWheelsProps> = ({\n value,\n onChange,\n hourFormat = '24',\n enableSeconds = false,\n incrementHours = 1,\n incrementMinutes = 1,\n incrementSeconds = 1,\n unselectableTimes,\n size,\n color,\n disabled,\n className,\n id,\n labels,\n visibleCount = 5,\n itemHeight = 32,\n audioTick = false,\n onCommit,\n}) => {\n const t = mergeLabels(labels);\n\n const rootClass = usePrefixedClassNames('timeinput', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-disabled': disabled,\n });\n const wheelsClass = usePrefixedClassNames('timeinput-wheels');\n const sepClass = usePrefixedClassNames('timeinput-separator');\n // Use the prefixed class through the same helper the wheels themselves do,\n // so the selector matches the actual rendered class regardless of whether\n // the consumer configured `classPrefix` via ConfigProvider. Building the\n // selector with `${classPrefix}timeinput-wheel` is wrong when classPrefix\n // is undefined (defaults to the empty prefix) — it would stringify to\n // \"undefinedtimeinput-wheel\".\n const wheelSingleClass = usePrefixedClassNames('timeinput-wheel');\n const wheelsContainerRef = useRef<HTMLDivElement>(null);\n\n const isPm = value.hours >= 12;\n\n const isTimeAllowed = useCallback(\n (h: number, m: number, s: number) => {\n if (!unselectableTimes) return true;\n const probe = setTimeOfDay(new Date(), {\n hours: h,\n minutes: m,\n seconds: s,\n milliseconds: 0,\n });\n return !unselectableTimes(probe);\n },\n [unselectableTimes]\n );\n\n // Per-column \"is this value disabled?\" predicates. We compute them against\n // the current value's other parts, so e.g. a predicate that only blocks\n // 12:00–12:59 leaves all minutes selectable when the user moves the hour\n // off 12. Returning `undefined` (rather than a function) when there is no\n // unselectableTimes lets the Wheel skip the disabled-attribute branch.\n const isHourDisabled = useCallback(\n (display: number) => {\n let h24 = display;\n if (hourFormat === '12') {\n const base = display % 12;\n h24 = isPm ? base + 12 : base;\n }\n return !isTimeAllowed(h24, value.minutes, value.seconds ?? 0);\n },\n [hourFormat, isPm, isTimeAllowed, value.minutes, value.seconds]\n );\n const isMinuteDisabled = useCallback(\n (m: number) => !isTimeAllowed(value.hours, m, value.seconds ?? 0),\n [isTimeAllowed, value.hours, value.seconds]\n );\n const isSecondDisabled = useCallback(\n (s: number) => !isTimeAllowed(value.hours, value.minutes, s),\n [isTimeAllowed, value.hours, value.minutes]\n );\n const hourDisabledFor = unselectableTimes ? isHourDisabled : undefined;\n const minuteDisabledFor = unselectableTimes ? isMinuteDisabled : undefined;\n const secondDisabledFor = unselectableTimes ? isSecondDisabled : undefined;\n\n const commit = useCallback(\n (next: Partial<TimeWheelsValue>) => {\n const merged: TimeWheelsValue = {\n hours: next.hours ?? value.hours,\n minutes: next.minutes ?? value.minutes,\n seconds: enableSeconds\n ? (next.seconds ?? value.seconds ?? 0)\n : undefined,\n };\n if (!isTimeAllowed(merged.hours, merged.minutes, merged.seconds ?? 0)) {\n return;\n }\n onChange(merged);\n },\n [value, enableSeconds, isTimeAllowed, onChange]\n );\n\n // Build the value lists per column.\n const hourValues = useMemo<number[]>(() => {\n const step = Math.max(1, incrementHours);\n if (hourFormat === '12') {\n const out: number[] = [];\n for (let h = 1; h <= 12; h += step) out.push(h);\n return out;\n }\n const out: number[] = [];\n for (let h = 0; h < 24; h += step) out.push(h);\n return out;\n }, [hourFormat, incrementHours]);\n\n const minuteValues = useMemo<number[]>(() => {\n const step = Math.max(1, incrementMinutes);\n const out: number[] = [];\n for (let m = 0; m < 60; m += step) out.push(m);\n return out;\n }, [incrementMinutes]);\n\n const secondValues = useMemo<number[]>(() => {\n const step = Math.max(1, incrementSeconds);\n const out: number[] = [];\n for (let s = 0; s < 60; s += step) out.push(s);\n return out;\n }, [incrementSeconds]);\n\n // Map current value → wheel index.\n const displayedHours =\n hourFormat === '12'\n ? value.hours % 12 === 0\n ? 12\n : value.hours % 12\n : value.hours;\n const hourIndex = Math.max(0, hourValues.indexOf(displayedHours));\n const minuteIndex = Math.max(0, minuteValues.indexOf(value.minutes));\n const secondIndex = Math.max(0, secondValues.indexOf(value.seconds ?? 0));\n const ampmIndex = isPm ? 1 : 0;\n\n // Refs for column focus management.\n const hoursRef = useRef<WheelHandle>(null);\n const minutesRef = useRef<WheelHandle>(null);\n const secondsRef = useRef<WheelHandle>(null);\n const ampmRef = useRef<WheelHandle>(null);\n\n // Build the focus order at runtime.\n const columnOrder: React.RefObject<WheelHandle | null>[] = [];\n columnOrder.push(hoursRef);\n columnOrder.push(minutesRef);\n if (enableSeconds) columnOrder.push(secondsRef);\n if (hourFormat === '12') columnOrder.push(ampmRef);\n const focusAt = (i: number) => columnOrder[i]?.current?.focus();\n const indexOf = (r: React.RefObject<WheelHandle | null>): number =>\n columnOrder.indexOf(r);\n const focusPrevOf = (r: React.RefObject<WheelHandle | null>) => () =>\n focusAt(indexOf(r) - 1);\n const focusNextOf = (r: React.RefObject<WheelHandle | null>) => () =>\n focusAt(indexOf(r) + 1);\n\n // Hour change — translate displayed value back into 24h.\n const onHourIndex = (next: number) => {\n const display =\n hourValues[Math.max(0, Math.min(hourValues.length - 1, next))];\n let next24 = display;\n if (hourFormat === '12') {\n const baseHour = display % 12;\n next24 = isPm ? baseHour + 12 : baseHour;\n }\n // Skip past any blocked hour using nextValid.\n const allowed = nextValid(next24, next24 >= value.hours ? 1 : -1, 24, h =>\n isTimeAllowed(h, value.minutes, value.seconds ?? 0)\n );\n commit({ hours: allowed });\n };\n\n const onMinuteIndex = (next: number) => {\n const m =\n minuteValues[Math.max(0, Math.min(minuteValues.length - 1, next))];\n const allowed = nextValid(m, m >= value.minutes ? 1 : -1, 60, mm =>\n isTimeAllowed(value.hours, mm, value.seconds ?? 0)\n );\n commit({ minutes: allowed });\n };\n\n const onSecondIndex = (next: number) => {\n const s =\n secondValues[Math.max(0, Math.min(secondValues.length - 1, next))];\n const allowed = nextValid(s, s >= (value.seconds ?? 0) ? 1 : -1, 60, ss =>\n isTimeAllowed(value.hours, value.minutes, ss)\n );\n commit({ seconds: allowed });\n };\n\n const onAmpmIndex = (next: number) => {\n if (next === ampmIndex) return;\n commit({ hours: (value.hours + 12) % 24 });\n };\n\n // Forward drags that originate on the empty space inside the wheels row\n // (left of the leftmost wheel, right of the rightmost wheel, on the\n // separator) to whichever wheel column is nearest to the pointer X — so\n // the picker behaves like the iOS native one, where the whole picker\n // surface is grabbable, not just the column itself.\n const onWheelsContainerPointerDown = (\n e: React.PointerEvent<HTMLDivElement>\n ) => {\n if (disabled) return;\n // If the pointerdown landed on a real wheel column, the wheel's own\n // handler takes over — don't double-dispatch.\n if ((e.target as HTMLElement).closest(`.${wheelSingleClass}`)) return;\n const container = wheelsContainerRef.current;\n /* istanbul ignore next: the handler is attached to the very element this ref points to, so it can't be null while events fire */\n if (!container) return;\n const wheels = container.querySelectorAll<HTMLElement>(\n `.${wheelSingleClass}`\n );\n if (wheels.length === 0) return;\n let nearestIdx = 0;\n let nearestDist = Infinity;\n const x = e.clientX;\n wheels.forEach((el, i) => {\n const r = el.getBoundingClientRect();\n const cx = (r.left + r.right) / 2;\n const d = Math.abs(x - cx);\n if (d < nearestDist) {\n nearestDist = d;\n nearestIdx = i;\n }\n });\n columnOrder[nearestIdx]?.current?.startDrag(e.pointerId, e.clientY);\n };\n\n return (\n // A time reads left to right in the locales that mirror the page, the\n // same as PinInput's boxes. Otherwise the wheels reverse and 10:30\n // reads 30 : 10.\n <div\n id={id}\n className={classNames(rootClass, className)}\n dir=\"ltr\"\n aria-disabled={disabled}\n >\n <div\n className={wheelsClass}\n ref={wheelsContainerRef}\n onPointerDown={onWheelsContainerPointerDown}\n >\n <Wheel\n ref={hoursRef}\n values={hourValues}\n index={hourIndex}\n onChange={onHourIndex}\n formatLabel={pad2}\n ariaLabel={t.hours}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n wrap\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(hoursRef)}\n onFocusNext={focusNextOf(hoursRef)}\n disabledFor={hourDisabledFor}\n audioTick={audioTick}\n />\n <div className={sepClass} aria-hidden=\"true\">\n :\n </div>\n <Wheel\n ref={minutesRef}\n values={minuteValues}\n index={minuteIndex}\n onChange={onMinuteIndex}\n formatLabel={pad2}\n ariaLabel={t.minutes}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n wrap\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(minutesRef)}\n onFocusNext={focusNextOf(minutesRef)}\n disabledFor={minuteDisabledFor}\n audioTick={audioTick}\n />\n {enableSeconds && (\n <>\n <div className={sepClass} aria-hidden=\"true\">\n :\n </div>\n <Wheel\n ref={secondsRef}\n values={secondValues}\n index={secondIndex}\n onChange={onSecondIndex}\n formatLabel={pad2}\n ariaLabel={t.seconds}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n wrap\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(secondsRef)}\n onFocusNext={focusNextOf(secondsRef)}\n disabledFor={secondDisabledFor}\n audioTick={audioTick}\n />\n </>\n )}\n {hourFormat === '12' && (\n <Wheel\n ref={ampmRef}\n values={['AM', 'PM']}\n index={ampmIndex}\n onChange={onAmpmIndex}\n formatLabel={v => v}\n ariaLabel={t.ampm}\n visibleCount={visibleCount}\n itemHeight={itemHeight}\n disabled={disabled}\n size={size}\n color={color}\n onCommit={onCommit}\n onFocusPrev={focusPrevOf(ampmRef)}\n onFocusNext={focusNextOf(ampmRef)}\n audioTick={audioTick}\n />\n )}\n </div>\n </div>\n );\n};\n\nTimeWheels.displayName = 'TimeWheels';\n\nexport default TimeWheels;\n"],"names":["fireTickHaptic","_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;AAyEA,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,GAAW,KAAa,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG;AAExE;;;;AAIG;AACH,SAAS,SAAS,CAChB,KAAa,EACb,IAAY,EACZ,GAAW,EACX,IAA4B,EAAA;IAE5B,IAAI,SAAS,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC;AAChC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5B,IAAI,IAAI,CAAC,SAAS,CAAC;AAAE,YAAA,OAAO,SAAS;QACrC,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,EAAE,GAAG,CAAC;IACzC;AACA,IAAA,OAAO,KAAK;AACd;AAEA,MAAM,IAAI,GAAG,CAAC,CAAS,KAAa,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAqD9D,MAAM,UAAU,GAAG,CACjB,EACE,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAA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,EACJ,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EACpB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,WAAW,EACrB,WAAW,EAAE,CAAC,IAAI,CAAC,EACnB,SAAS,EAAE,CAAC,CAAC,IAAI,EACjB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,EACjC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,EACjC,SAAS,EAAE,SAAS,EAAA,CACpB,CACH,CAAA,EAAA,CACG,EAAA,CACF;AAEV;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
|
|
@@ -40,6 +40,20 @@ function usePickerLocaleScope(ownLocale, ownDir) {
|
|
|
40
40
|
};
|
|
41
41
|
}, [scope, ownLocale, ownDir]);
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The `dir` a picker's root ends up with: the one passed to it, else its own
|
|
45
|
+
* locale's inside a `LocaleProvider`, else none, so it follows the page. A
|
|
46
|
+
* picker that renders its own `Control` puts it there too. Bulma places the
|
|
47
|
+
* Control's icon and loading spinner against the Control's direction, and
|
|
48
|
+
* the launcher sits inside the picker's root, so the two have to agree or a
|
|
49
|
+
* French picker in an Arabic section puts the icon on top of the launcher.
|
|
50
|
+
* Returned as attributes to spread, empty when there's no `dir` to set.
|
|
51
|
+
*/
|
|
52
|
+
function usePickerDirAttrs(ownLocale, ownDir) {
|
|
53
|
+
const { rootAttrs } = usePickerLocaleScope(ownLocale, ownDir);
|
|
54
|
+
const dir = ownDir ?? rootAttrs.dir;
|
|
55
|
+
return dir === undefined ? NO_ROOT_ATTRS : { dir };
|
|
56
|
+
}
|
|
43
57
|
/**
|
|
44
58
|
* Whether a picker's `dayNames` replace the calendar's own, which `Calendar`
|
|
45
59
|
* does only for a full week of seven.
|
|
@@ -77,5 +91,5 @@ function usePickerFirstDayOfWeek(own, locale, hasDayNames) {
|
|
|
77
91
|
}, [own, inProvider, locale, hasDayNames]);
|
|
78
92
|
}
|
|
79
93
|
|
|
80
|
-
export { hasOwnDayNames, usePickerFirstDayOfWeek, usePickerLocale, usePickerLocaleScope };
|
|
94
|
+
export { hasOwnDayNames, usePickerDirAttrs, usePickerFirstDayOfWeek, usePickerLocale, usePickerLocaleScope };
|
|
81
95
|
//# sourceMappingURL=useLocaleDefaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocaleDefaults.js","sources":["../../../../src/form/_pickerInternals/useLocaleDefaults.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n useLocaleScope,\n type PortalLocale,\n} from '../../helpers/LocaleProvider';\nimport {\n canonicalLocale,\n localeDirection,\n localeFirstDay,\n} from '../../helpers/localeInfo';\nimport type { DayOfWeek } from './pickerTypes';\n\n/**\n * A picker's locale: its own `locale`, else the one a `LocaleProvider` around\n * it sets, else `undefined`, which leaves `Intl` to use the runtime's.\n */\nexport function usePickerLocale(own: string | undefined): string | undefined {\n const scope = useLocaleScope();\n return own || scope?.locale;\n}\n\n/** Where a picker's own language and direction go, inside a `LocaleProvider`. */\nexport interface PickerLocaleScope {\n /**\n * The `lang` and `dir` for the picker's root, so what renders inside it,\n * an inline calendar or a popover in place, follows them. Empty unless the\n * picker has a `locale` of its own.\n */\n rootAttrs: { lang?: string; dir?: string };\n /** What its portaled panel carries; unset outside a provider. */\n panel?: PortalLocale;\n}\n\nconst NO_ROOT_ATTRS = {};\n\n/**\n * A picker's language and direction inside a `LocaleProvider`, by the rule a\n * nested provider follows: its `lang` is its own `locale`, else the\n * provider's, and its `dir` is the `dir` passed to it, else its own locale's\n * direction when it has one, else the provider's. Outside a provider it\n * changes nothing. A `locale` `Intl` refuses counts as none here, since the\n * picker's own formatting reports it.\n */\nexport function usePickerLocaleScope(\n ownLocale: string | undefined,\n ownDir: string | undefined\n): PickerLocaleScope {\n const scope = useLocaleScope();\n return useMemo(() => {\n if (!scope) return { rootAttrs: NO_ROOT_ATTRS };\n let own: string | undefined;\n try {\n own = canonicalLocale(ownLocale);\n } catch {\n own = undefined;\n }\n const dir = ownDir || (own ? localeDirection(own) : scope.dir);\n return {\n rootAttrs: own ? { lang: own, dir } : NO_ROOT_ATTRS,\n panel: { locale: own || scope.locale, dir },\n };\n }, [scope, ownLocale, ownDir]);\n}\n\n/**\n * Whether a picker's `dayNames` replace the calendar's own, which `Calendar`\n * does only for a full week of seven.\n */\nexport function hasOwnDayNames(dayNames: string[] | undefined): boolean {\n return dayNames !== undefined && dayNames.length === 7;\n}\n\n/**\n * The day a picker's week starts on: its own `firstDayOfWeek`, else, inside a\n * `LocaleProvider`, the first day of the locale the picker uses, else Sunday.\n * Outside a provider it stays Sunday whatever the locale, as it always has,\n * and so does a picker inside one with no locale from either, since the\n * runtime's own differs between the server and the browser.\n *\n * It also stays Sunday for a picker that brings its own `dayNames`. The\n * calendar shows those exactly as given, in calendar order, and before the\n * provider an unset `firstDayOfWeek` was always Sunday, so names written\n * Sunday first would sit a day or more off their columns if the week moved\n * under them.\n */\nexport function usePickerFirstDayOfWeek(\n own: DayOfWeek | undefined,\n locale: string | undefined,\n hasDayNames: boolean\n): DayOfWeek {\n const inProvider = useLocaleScope() !== null;\n return useMemo(() => {\n if (own !== undefined) return own;\n if (!inProvider || !locale || hasDayNames) return 0;\n try {\n return localeFirstDay(canonicalLocale(locale) as string);\n } catch {\n // A tag Intl refuses: the picker's own formatting says so.\n return 0;\n }\n }, [own, inProvider, locale, hasDayNames]);\n}\n"],"names":[],"mappings":";;;;;;AAYA;;;AAGG;AACG,SAAU,eAAe,CAAC,GAAuB,EAAA;AACrD,IAAA,MAAM,KAAK,GAAG,cAAc,EAAE;AAC9B,IAAA,OAAO,GAAG,IAAI,KAAK,EAAE,MAAM;AAC7B;AAcA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O,cAAc,CAAC,eAAe,CAAC,MAAM,CAAW,CAAC;QAC1D;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAO,CAAC;QACV;IACF,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAC5C;;"}
|
|
1
|
+
{"version":3,"file":"useLocaleDefaults.js","sources":["../../../../src/form/_pickerInternals/useLocaleDefaults.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n useLocaleScope,\n type PortalLocale,\n} from '../../helpers/LocaleProvider';\nimport {\n canonicalLocale,\n localeDirection,\n localeFirstDay,\n} from '../../helpers/localeInfo';\nimport type { DayOfWeek } from './pickerTypes';\n\n/**\n * A picker's locale: its own `locale`, else the one a `LocaleProvider` around\n * it sets, else `undefined`, which leaves `Intl` to use the runtime's.\n */\nexport function usePickerLocale(own: string | undefined): string | undefined {\n const scope = useLocaleScope();\n return own || scope?.locale;\n}\n\n/** Where a picker's own language and direction go, inside a `LocaleProvider`. */\nexport interface PickerLocaleScope {\n /**\n * The `lang` and `dir` for the picker's root, so what renders inside it,\n * an inline calendar or a popover in place, follows them. Empty unless the\n * picker has a `locale` of its own.\n */\n rootAttrs: { lang?: string; dir?: string };\n /** What its portaled panel carries; unset outside a provider. */\n panel?: PortalLocale;\n}\n\nconst NO_ROOT_ATTRS = {};\n\n/**\n * A picker's language and direction inside a `LocaleProvider`, by the rule a\n * nested provider follows: its `lang` is its own `locale`, else the\n * provider's, and its `dir` is the `dir` passed to it, else its own locale's\n * direction when it has one, else the provider's. Outside a provider it\n * changes nothing. A `locale` `Intl` refuses counts as none here, since the\n * picker's own formatting reports it.\n */\nexport function usePickerLocaleScope(\n ownLocale: string | undefined,\n ownDir: string | undefined\n): PickerLocaleScope {\n const scope = useLocaleScope();\n return useMemo(() => {\n if (!scope) return { rootAttrs: NO_ROOT_ATTRS };\n let own: string | undefined;\n try {\n own = canonicalLocale(ownLocale);\n } catch {\n own = undefined;\n }\n const dir = ownDir || (own ? localeDirection(own) : scope.dir);\n return {\n rootAttrs: own ? { lang: own, dir } : NO_ROOT_ATTRS,\n panel: { locale: own || scope.locale, dir },\n };\n }, [scope, ownLocale, ownDir]);\n}\n\n/**\n * The `dir` a picker's root ends up with: the one passed to it, else its own\n * locale's inside a `LocaleProvider`, else none, so it follows the page. A\n * picker that renders its own `Control` puts it there too. Bulma places the\n * Control's icon and loading spinner against the Control's direction, and\n * the launcher sits inside the picker's root, so the two have to agree or a\n * French picker in an Arabic section puts the icon on top of the launcher.\n * Returned as attributes to spread, empty when there's no `dir` to set.\n */\nexport function usePickerDirAttrs(\n ownLocale: string | undefined,\n ownDir: string | undefined\n): { dir?: string } {\n const { rootAttrs } = usePickerLocaleScope(ownLocale, ownDir);\n const dir = ownDir ?? rootAttrs.dir;\n return dir === undefined ? NO_ROOT_ATTRS : { dir };\n}\n\n/**\n * Whether a picker's `dayNames` replace the calendar's own, which `Calendar`\n * does only for a full week of seven.\n */\nexport function hasOwnDayNames(dayNames: string[] | undefined): boolean {\n return dayNames !== undefined && dayNames.length === 7;\n}\n\n/**\n * The day a picker's week starts on: its own `firstDayOfWeek`, else, inside a\n * `LocaleProvider`, the first day of the locale the picker uses, else Sunday.\n * Outside a provider it stays Sunday whatever the locale, as it always has,\n * and so does a picker inside one with no locale from either, since the\n * runtime's own differs between the server and the browser.\n *\n * It also stays Sunday for a picker that brings its own `dayNames`. The\n * calendar shows those exactly as given, in calendar order, and before the\n * provider an unset `firstDayOfWeek` was always Sunday, so names written\n * Sunday first would sit a day or more off their columns if the week moved\n * under them.\n */\nexport function usePickerFirstDayOfWeek(\n own: DayOfWeek | undefined,\n locale: string | undefined,\n hasDayNames: boolean\n): DayOfWeek {\n const inProvider = useLocaleScope() !== null;\n return useMemo(() => {\n if (own !== undefined) return own;\n if (!inProvider || !locale || hasDayNames) return 0;\n try {\n return localeFirstDay(canonicalLocale(locale) as string);\n } catch {\n // A tag Intl refuses: the picker's own formatting says so.\n return 0;\n }\n }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,EAAE,GAAG,EAAE;AACpD;AAEA;;;AAGG;AACG,SAAU,cAAc,CAAC,QAA8B,EAAA;IAC3D,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;AACxD;AAEA;;;;;;;;;;;;AAYG;SACa,uBAAuB,CACrC,GAA0B,EAC1B,MAA0B,EAC1B,WAAoB,EAAA;AAEpB,IAAA,MAAM,UAAU,GAAG,cAAc,EAAE,KAAK,IAAI;IAC5C,OAAO,OAAO,CAAC,MAAK;QAClB,IAAI,GAAG,KAAK,SAAS;AAAE,YAAA,OAAO,GAAG;AACjC,QAAA,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,IAAI,WAAW;AAAE,YAAA,OAAO,CAAC;AACnD,QAAA,IAAI;AACF,YAAA,OAAO,cAAc,CAAC,eAAe,CAAC,MAAM,CAAW,CAAC;QAC1D;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAO,CAAC;QACV;IACF,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAC5C;;"}
|
|
@@ -57,7 +57,7 @@ const ignoreChange = () => { };
|
|
|
57
57
|
* close it and put focus back on the field, and a press outside closes it
|
|
58
58
|
* where the press put focus.
|
|
59
59
|
*/
|
|
60
|
-
function DialogSelect({ component, rootClass, panelClass, text, values, hasValue, open, onOpenChange, onFormReset, onPrintableKey, onClear, clearable, clearLabel, chooseLabel, placeholder, name, form, required = false, disabled, color, size, isRounded, position
|
|
60
|
+
function DialogSelect({ component, rootClass, panelClass, text, values, hasValue, open, onOpenChange, onFormReset, onPrintableKey, onClear, clearable, clearLabel, chooseLabel, placeholder, name, form, required = false, disabled, color, size, isRounded, position, appendToBody = false, inputRef, fieldRef, describedBy, below, initialFocusSelector, children, label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName, className, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...props }) {
|
|
61
61
|
const insideField = useInsideField();
|
|
62
62
|
const insideControl = useInsideControl();
|
|
63
63
|
const ownField = rendersOwnField(component, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogSelect.js","sources":["../../../../src/form/_selectInternals/DialogSelect.tsx"],"sourcesContent":["// INTERNAL: deliberately not exported from src/index.ts. The field a picker\n// of tree data opens its panel from: TreeSelect's, and Cascader's after it.\n\nimport React, { useEffect, useId, useRef, useState } from 'react';\nimport { classNames, usePrefixedClassNames } from '../../helpers/classNames';\nimport {\n useBulmaClasses,\n type BulmaClassesProps,\n} from '../../helpers/useBulmaClasses';\nimport { useLatestRef } from '../../helpers/useLatestRef';\nimport { Delete } from '../../elements/Delete';\nimport { Icon } from '../../elements/Icon';\nimport { Control } from '../Control';\nimport { Field } from '../Field';\nimport type { FormFieldProps } from '../fieldProps';\nimport {\n rendersOwnField,\n useInsideControl,\n useInsideField,\n} from '../FormContext';\nimport { useAutoLabelId } from '../useAutoLabelId';\nimport { PickerPopover } from '../_pickerInternals/PickerPopover';\nimport {\n isPopoverToggleKey,\n type PickerPosition,\n} from '../_pickerInternals/pickerTypes';\nimport { usePickerLocaleScope } from '../_pickerInternals/useLocaleDefaults';\nimport { HiddenValues } from './ValueTags';\n\n/** What names the panel, for what's in it to take as well. */\nexport interface PanelName {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n/** Props for the field a tree picker opens its panel from. */\nexport interface DialogSelectProps\n extends\n Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'color' | 'onChange' | 'defaultValue' | 'children'\n >,\n Omit<BulmaClassesProps, 'color'>,\n FormFieldProps {\n /** The component's name, for development warnings. */\n component: string;\n /** The root's own class, before any prefix, such as `tree-select`. */\n rootClass: string;\n /** The panel's own class, beside `picker-popover`, before any prefix. */\n panelClass: string;\n /** What the field shows. */\n text: string;\n /** What `name` posts, a hidden input each. */\n values: string[];\n /** Something is picked: `required` is met, and the clear button shows. */\n hasValue: boolean;\n /** Whether the panel is open. */\n open: boolean;\n /**\n * Asked to open or close the panel: by a click on the field, its keys,\n * Escape, Alt+Up, a press outside and the clear button.\n */\n onOpenChange: (open: boolean) => void;\n /**\n * Called once a reset of the field's form has gone ahead, so the picker\n * can put its value back.\n */\n onFormReset: () => void;\n /**\n * A printable key on the field. Returns whether it used the key, as a\n * search box opening with it does.\n */\n onPrintableKey?: (key: string) => boolean;\n /** Empties the value, from the clear button. */\n onClear: () => void;\n /** Shows the clear button while something is picked. */\n clearable?: boolean;\n /** Names the clear button. */\n clearLabel: string;\n /** Names the panel in place of the field's label. */\n chooseLabel?: string;\n placeholder?: string;\n name?: string;\n form?: string;\n required?: boolean;\n /** Already including a disabled `Fieldset` around it. */\n disabled: boolean;\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n size?: 'small' | 'medium' | 'large';\n isRounded?: boolean;\n position?: PickerPosition;\n appendToBody?: boolean;\n /** Holds the field, which focus goes back to. */\n inputRef: React.RefObject<HTMLInputElement | null>;\n /**\n * Set on the field: the picker's callback that fills `inputRef` and the\n * ref its caller gave.\n */\n fieldRef: React.RefCallback<HTMLInputElement>;\n /** The ids of the tags that describe the field. */\n describedBy?: string;\n /** Shown under the field, inside its Field: the tags. */\n below?: React.ReactNode;\n /** Selects what takes focus as the panel opens. */\n initialFocusSelector?: string;\n /** The panel's content, handed the panel's name. */\n children: (name: PanelName) => React.ReactNode;\n}\n\n/**\n * A field laid over the real one, unseen and letting presses through, so the\n * browser's `required` check reads it and its message points at the field.\n */\nconst requiredProxyStyle: React.CSSProperties = {\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n margin: 0,\n padding: 0,\n border: 0,\n opacity: 0,\n pointerEvents: 'none',\n // Focused, it opens no on-screen keyboard (`inputMode`), and iOS zooms\n // in on a field set under 16px. It's unseen, so the size shows nowhere.\n fontSize: '16px',\n};\n\n/** Keys pressed on their own that don't act, such as Ctrl to stop speech. */\nconst MODIFIER_KEYS = new Set([\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'Meta',\n 'NumLock',\n 'ScrollLock',\n 'Shift',\n]);\n\nconst ignoreChange = () => {};\n\n/**\n * A read-only `role=\"combobox\"` field, wired as the date pickers' are, that\n * opens a `PickerPopover` dialog panel: in a `Field` of its own unless one is\n * around it, with a chevron at its inline end, a clear button, the hidden\n * inputs for `name` and what the browser's `required` check reads. A click,\n * Enter, Space, Down or Alt+Down opens the panel, which holds focus, as the\n * date pickers' does: Tab and Shift+Tab wrap inside it. Escape and Alt+Up\n * close it and put focus back on the field, and a press outside closes it\n * where the press put focus.\n */\nexport function DialogSelect({\n component,\n rootClass,\n panelClass,\n text,\n values,\n hasValue,\n open,\n onOpenChange,\n onFormReset,\n onPrintableKey,\n onClear,\n clearable,\n clearLabel,\n chooseLabel,\n placeholder,\n name,\n form,\n required = false,\n disabled,\n color,\n size,\n isRounded,\n position = 'bottom-left',\n appendToBody = false,\n inputRef,\n fieldRef,\n describedBy,\n below,\n initialFocusSelector,\n children,\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n className,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: DialogSelectProps) {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField(component, {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { controlId, fieldLabelProps, labelId } = useAutoLabelId({\n label,\n id,\n labelProps,\n rendersLabel: ownField,\n needsLabelId: true,\n });\n const reactId = useId();\n const panelId = `${controlId ?? reactId}-panel`;\n const localeScope = usePickerLocaleScope(undefined, props.dir);\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const rootRef = useRef<HTMLDivElement>(null);\n\n // The field's name, which the panel takes too unless it's given its own.\n const fieldName: PanelName = ariaLabel\n ? { 'aria-label': ariaLabel }\n : ariaLabelledBy\n ? { 'aria-labelledby': ariaLabelledBy }\n : labelId\n ? { 'aria-labelledby': labelId }\n : {};\n const panelName: PanelName = chooseLabel\n ? { 'aria-label': chooseLabel }\n : fieldName;\n\n // Whether the field `required` hangs on has focus, which the browser gives\n // it when it stops a submit. Taking it away or disabling it while it has\n // focus fires no blur, so that clears it too.\n const [proxyFocused, setProxyFocused] = useState(false);\n if (proxyFocused && (!required || disabled)) setProxyFocused(false);\n\n const showClear = !!clearable && hasValue && !disabled;\n const rootClasses = usePrefixedClassNames(rootClass, {\n 'is-disabled': disabled,\n 'has-clear': showClear,\n });\n const inputClass = usePrefixedClassNames('input', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-rounded': !!isRounded,\n 'is-focused': proxyFocused,\n });\n const chevronClass = usePrefixedClassNames(`${rootClass}-chevron`);\n const clearClass = usePrefixedClassNames(`${rootClass}-clear`);\n const panelClasses = usePrefixedClassNames(panelClass, {\n [`is-${size}`]: !!size,\n });\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const isOpen = open && !disabled;\n\n // A reset of the field's form puts the value back, as it does a native\n // field's. The reset event fires before the form resets, and a listener\n // after this one can still cancel it, so the value goes back a task later,\n // and only if the reset went ahead, as File's and Dropzone's do. It's\n // heard on the field's document, or the shadow root it's in, and matched\n // to the field's form as it is then, so a form its `form` names that\n // mounts later, or a `form` that changes, is followed, and a reset\n // already under way still lands.\n const onFormResetRef = useLatestRef(onFormReset);\n useEffect(() => {\n const root = inputRef.current!.getRootNode();\n let timer: ReturnType<typeof setTimeout> | undefined;\n const onReset = (event: Event) => {\n if (event.target !== inputRef.current?.form) return;\n timer = setTimeout(() => {\n if (!event.defaultPrevented) onFormResetRef.current();\n });\n };\n root.addEventListener('reset', onReset, true);\n return () => {\n root.removeEventListener('reset', onReset, true);\n clearTimeout(timer);\n };\n }, [inputRef, onFormResetRef]);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n if (isPopoverToggleKey(event)) {\n event.preventDefault();\n if (event.key === 'ArrowDown') onOpenChange(true);\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n if (\n event.key === 'Enter' ||\n event.key === ' ' ||\n event.key === 'ArrowDown'\n ) {\n event.preventDefault();\n onOpenChange(true);\n } else if (\n event.key.length === 1 &&\n !event.nativeEvent.isComposing &&\n onPrintableKey?.(event.key)\n ) {\n event.preventDefault();\n }\n };\n\n const fieldDescription =\n [ariaDescribedBy, describedBy].filter(Boolean).join(' ') || undefined;\n\n const field = (\n <>\n <input\n ref={fieldRef}\n type=\"text\"\n className={inputClass}\n id={controlId}\n readOnly\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? panelId : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={fieldDescription}\n aria-required={required || undefined}\n autoComplete=\"off\"\n value={text}\n placeholder={placeholder}\n disabled={disabled}\n form={form}\n // A disabled field takes no clicks.\n onClick={() => onOpenChange(!isOpen)}\n onKeyDown={handleKeyDown}\n />\n {showClear && (\n <Delete\n className={clearClass}\n size={size}\n ariaLabel={clearLabel}\n onClick={() => {\n onClear();\n onOpenChange(false);\n inputRef.current?.focus();\n }}\n />\n )}\n <span className={chevronClass} aria-hidden=\"true\">\n <Icon name=\"chevron-down\" size={size} />\n </span>\n </>\n );\n\n const root = (\n <div\n {...localeScope.rootAttrs}\n {...rest}\n ref={rootRef}\n className={classNames(rootClasses, bulmaHelperClasses, className)}\n >\n {insideControl ? field : <Control size={size}>{field}</Control>}\n {required && (\n <input\n // Focus puts it in the accessibility tree, and Chromium won't\n // leave focus hidden, so it's hidden only until it's focused, and\n // then reads as the field, shut.\n {...(proxyFocused\n ? {\n ...fieldName,\n role: 'combobox',\n 'aria-haspopup': 'dialog' as const,\n 'aria-expanded': false,\n 'aria-describedby': fieldDescription,\n }\n : { 'aria-hidden': true })}\n tabIndex={-1}\n inputMode=\"none\"\n required\n value={hasValue ? 'picked' : ''}\n onChange={ignoreChange}\n form={form}\n disabled={disabled}\n // When the browser stops a submit, it focuses this and shows its\n // message beside it, and every browser takes the message down as\n // this loses focus. So focus stays here, over the field, which\n // looks focused, and a press goes where it lands, as from any\n // field. The next key hands focus to the field and does there\n // what it would have. Firefox also stops taking clicks if focus\n // leaves while it's still focusing this.\n onFocus={() => setProxyFocused(true)}\n onBlur={() => setProxyFocused(false)}\n onKeyDown={event => {\n if (MODIFIER_KEYS.has(event.key)) return;\n inputRef.current?.focus();\n handleKeyDown(event);\n }}\n style={requiredProxyStyle}\n />\n )}\n <HiddenValues\n name={name}\n values={values}\n form={form}\n disabled={disabled}\n />\n <PickerPopover\n localeScope={localeScope.panel}\n isOpen={isOpen}\n onClose={() => onOpenChange(false)}\n anchorRef={rootRef}\n position={position}\n appendToBody={appendToBody}\n className={panelClasses}\n ariaLabel={panelName['aria-label']}\n ariaLabelledBy={panelName['aria-labelledby']}\n id={panelId}\n restoreFocusRef={inputRef}\n initialFocusSelector={initialFocusSelector}\n matchWidth\n followContent\n >\n {children(panelName)}\n </PickerPopover>\n </div>\n );\n\n const fieldElement =\n below === undefined ? (\n root\n ) : (\n <div>\n {root}\n {below}\n </div>\n );\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {fieldElement}\n {messageEl}\n </Field>\n );\n }\n return (\n <>\n {fieldElement}\n {messageEl}\n </>\n );\n}\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AA6GA;;;AAGG;AACH,MAAM,kBAAkB,GAAwB;AAC9C,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,MAAM,EAAE,C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AC,iBAAiB,CAAC,EAC5C,EAAE,EAAE,OAAO,EACX,eAAe,EAAE,QAAQ,EACzB,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAA,IAAA,EACV,aAAa,EAAA,IAAA,EAAA,QAAA,EAEZ,QAAQ,CAAC,SAAS,CAAC,EAAA,CACN,CAAA,EAAA,CACZ,CACP;IAED,MAAM,YAAY,GAChB,KAAK,KAAK,SAAS,IACjB,IAAI,KAEJF,IAAA,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,CACG,IAAI,EACJ,KAAK,CAAA,EAAA,CACF,CACP;AACH,IAAA,MAAM,SAAS,GAAG,OAAO,GAAGE,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,SAAS,YAAG,OAAO,EAAA,CAAK,GAAG,IAAI;IAEzE,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEF,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,YAAY,EACZ,SAAS,CAAA,EAAA,CACJ;IAEZ;AACA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,YAAY,EACZ,SAAS,CAAA,EAAA,CACT;AAEP;;"}
|
|
1
|
+
{"version":3,"file":"DialogSelect.js","sources":["../../../../src/form/_selectInternals/DialogSelect.tsx"],"sourcesContent":["// INTERNAL: deliberately not exported from src/index.ts. The field a picker\n// of tree data opens its panel from: TreeSelect's, and Cascader's after it.\n\nimport React, { useEffect, useId, useRef, useState } from 'react';\nimport { classNames, usePrefixedClassNames } from '../../helpers/classNames';\nimport {\n useBulmaClasses,\n type BulmaClassesProps,\n} from '../../helpers/useBulmaClasses';\nimport { useLatestRef } from '../../helpers/useLatestRef';\nimport { Delete } from '../../elements/Delete';\nimport { Icon } from '../../elements/Icon';\nimport { Control } from '../Control';\nimport { Field } from '../Field';\nimport type { FormFieldProps } from '../fieldProps';\nimport {\n rendersOwnField,\n useInsideControl,\n useInsideField,\n} from '../FormContext';\nimport { useAutoLabelId } from '../useAutoLabelId';\nimport { PickerPopover } from '../_pickerInternals/PickerPopover';\nimport {\n isPopoverToggleKey,\n type PickerPosition,\n} from '../_pickerInternals/pickerTypes';\nimport { usePickerLocaleScope } from '../_pickerInternals/useLocaleDefaults';\nimport { HiddenValues } from './ValueTags';\n\n/** What names the panel, for what's in it to take as well. */\nexport interface PanelName {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n/** Props for the field a tree picker opens its panel from. */\nexport interface DialogSelectProps\n extends\n Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'color' | 'onChange' | 'defaultValue' | 'children'\n >,\n Omit<BulmaClassesProps, 'color'>,\n FormFieldProps {\n /** The component's name, for development warnings. */\n component: string;\n /** The root's own class, before any prefix, such as `tree-select`. */\n rootClass: string;\n /** The panel's own class, beside `picker-popover`, before any prefix. */\n panelClass: string;\n /** What the field shows. */\n text: string;\n /** What `name` posts, a hidden input each. */\n values: string[];\n /** Something is picked: `required` is met, and the clear button shows. */\n hasValue: boolean;\n /** Whether the panel is open. */\n open: boolean;\n /**\n * Asked to open or close the panel: by a click on the field, its keys,\n * Escape, Alt+Up, a press outside and the clear button.\n */\n onOpenChange: (open: boolean) => void;\n /**\n * Called once a reset of the field's form has gone ahead, so the picker\n * can put its value back.\n */\n onFormReset: () => void;\n /**\n * A printable key on the field. Returns whether it used the key, as a\n * search box opening with it does.\n */\n onPrintableKey?: (key: string) => boolean;\n /** Empties the value, from the clear button. */\n onClear: () => void;\n /** Shows the clear button while something is picked. */\n clearable?: boolean;\n /** Names the clear button. */\n clearLabel: string;\n /** Names the panel in place of the field's label. */\n chooseLabel?: string;\n placeholder?: string;\n name?: string;\n form?: string;\n required?: boolean;\n /** Already including a disabled `Fieldset` around it. */\n disabled: boolean;\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n size?: 'small' | 'medium' | 'large';\n isRounded?: boolean;\n /** Left out, the panel lines up with the field's start edge. */\n position?: PickerPosition;\n appendToBody?: boolean;\n /** Holds the field, which focus goes back to. */\n inputRef: React.RefObject<HTMLInputElement | null>;\n /**\n * Set on the field: the picker's callback that fills `inputRef` and the\n * ref its caller gave.\n */\n fieldRef: React.RefCallback<HTMLInputElement>;\n /** The ids of the tags that describe the field. */\n describedBy?: string;\n /** Shown under the field, inside its Field: the tags. */\n below?: React.ReactNode;\n /** Selects what takes focus as the panel opens. */\n initialFocusSelector?: string;\n /** The panel's content, handed the panel's name. */\n children: (name: PanelName) => React.ReactNode;\n}\n\n/**\n * A field laid over the real one, unseen and letting presses through, so the\n * browser's `required` check reads it and its message points at the field.\n */\nconst requiredProxyStyle: React.CSSProperties = {\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n margin: 0,\n padding: 0,\n border: 0,\n opacity: 0,\n pointerEvents: 'none',\n // Focused, it opens no on-screen keyboard (`inputMode`), and iOS zooms\n // in on a field set under 16px. It's unseen, so the size shows nowhere.\n fontSize: '16px',\n};\n\n/** Keys pressed on their own that don't act, such as Ctrl to stop speech. */\nconst MODIFIER_KEYS = new Set([\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'Meta',\n 'NumLock',\n 'ScrollLock',\n 'Shift',\n]);\n\nconst ignoreChange = () => {};\n\n/**\n * A read-only `role=\"combobox\"` field, wired as the date pickers' are, that\n * opens a `PickerPopover` dialog panel: in a `Field` of its own unless one is\n * around it, with a chevron at its inline end, a clear button, the hidden\n * inputs for `name` and what the browser's `required` check reads. A click,\n * Enter, Space, Down or Alt+Down opens the panel, which holds focus, as the\n * date pickers' does: Tab and Shift+Tab wrap inside it. Escape and Alt+Up\n * close it and put focus back on the field, and a press outside closes it\n * where the press put focus.\n */\nexport function DialogSelect({\n component,\n rootClass,\n panelClass,\n text,\n values,\n hasValue,\n open,\n onOpenChange,\n onFormReset,\n onPrintableKey,\n onClear,\n clearable,\n clearLabel,\n chooseLabel,\n placeholder,\n name,\n form,\n required = false,\n disabled,\n color,\n size,\n isRounded,\n position,\n appendToBody = false,\n inputRef,\n fieldRef,\n describedBy,\n below,\n initialFocusSelector,\n children,\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n className,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: DialogSelectProps) {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField(component, {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { controlId, fieldLabelProps, labelId } = useAutoLabelId({\n label,\n id,\n labelProps,\n rendersLabel: ownField,\n needsLabelId: true,\n });\n const reactId = useId();\n const panelId = `${controlId ?? reactId}-panel`;\n const localeScope = usePickerLocaleScope(undefined, props.dir);\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const rootRef = useRef<HTMLDivElement>(null);\n\n // The field's name, which the panel takes too unless it's given its own.\n const fieldName: PanelName = ariaLabel\n ? { 'aria-label': ariaLabel }\n : ariaLabelledBy\n ? { 'aria-labelledby': ariaLabelledBy }\n : labelId\n ? { 'aria-labelledby': labelId }\n : {};\n const panelName: PanelName = chooseLabel\n ? { 'aria-label': chooseLabel }\n : fieldName;\n\n // Whether the field `required` hangs on has focus, which the browser gives\n // it when it stops a submit. Taking it away or disabling it while it has\n // focus fires no blur, so that clears it too.\n const [proxyFocused, setProxyFocused] = useState(false);\n if (proxyFocused && (!required || disabled)) setProxyFocused(false);\n\n const showClear = !!clearable && hasValue && !disabled;\n const rootClasses = usePrefixedClassNames(rootClass, {\n 'is-disabled': disabled,\n 'has-clear': showClear,\n });\n const inputClass = usePrefixedClassNames('input', {\n [`is-${color}`]: !!color,\n [`is-${size}`]: !!size,\n 'is-rounded': !!isRounded,\n 'is-focused': proxyFocused,\n });\n const chevronClass = usePrefixedClassNames(`${rootClass}-chevron`);\n const clearClass = usePrefixedClassNames(`${rootClass}-clear`);\n const panelClasses = usePrefixedClassNames(panelClass, {\n [`is-${size}`]: !!size,\n });\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const isOpen = open && !disabled;\n\n // A reset of the field's form puts the value back, as it does a native\n // field's. The reset event fires before the form resets, and a listener\n // after this one can still cancel it, so the value goes back a task later,\n // and only if the reset went ahead, as File's and Dropzone's do. It's\n // heard on the field's document, or the shadow root it's in, and matched\n // to the field's form as it is then, so a form its `form` names that\n // mounts later, or a `form` that changes, is followed, and a reset\n // already under way still lands.\n const onFormResetRef = useLatestRef(onFormReset);\n useEffect(() => {\n const root = inputRef.current!.getRootNode();\n let timer: ReturnType<typeof setTimeout> | undefined;\n const onReset = (event: Event) => {\n if (event.target !== inputRef.current?.form) return;\n timer = setTimeout(() => {\n if (!event.defaultPrevented) onFormResetRef.current();\n });\n };\n root.addEventListener('reset', onReset, true);\n return () => {\n root.removeEventListener('reset', onReset, true);\n clearTimeout(timer);\n };\n }, [inputRef, onFormResetRef]);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n if (isPopoverToggleKey(event)) {\n event.preventDefault();\n if (event.key === 'ArrowDown') onOpenChange(true);\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n if (\n event.key === 'Enter' ||\n event.key === ' ' ||\n event.key === 'ArrowDown'\n ) {\n event.preventDefault();\n onOpenChange(true);\n } else if (\n event.key.length === 1 &&\n !event.nativeEvent.isComposing &&\n onPrintableKey?.(event.key)\n ) {\n event.preventDefault();\n }\n };\n\n const fieldDescription =\n [ariaDescribedBy, describedBy].filter(Boolean).join(' ') || undefined;\n\n const field = (\n <>\n <input\n ref={fieldRef}\n type=\"text\"\n className={inputClass}\n id={controlId}\n readOnly\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? panelId : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={fieldDescription}\n aria-required={required || undefined}\n autoComplete=\"off\"\n value={text}\n placeholder={placeholder}\n disabled={disabled}\n form={form}\n // A disabled field takes no clicks.\n onClick={() => onOpenChange(!isOpen)}\n onKeyDown={handleKeyDown}\n />\n {showClear && (\n <Delete\n className={clearClass}\n size={size}\n ariaLabel={clearLabel}\n onClick={() => {\n onClear();\n onOpenChange(false);\n inputRef.current?.focus();\n }}\n />\n )}\n <span className={chevronClass} aria-hidden=\"true\">\n <Icon name=\"chevron-down\" size={size} />\n </span>\n </>\n );\n\n const root = (\n <div\n {...localeScope.rootAttrs}\n {...rest}\n ref={rootRef}\n className={classNames(rootClasses, bulmaHelperClasses, className)}\n >\n {insideControl ? field : <Control size={size}>{field}</Control>}\n {required && (\n <input\n // Focus puts it in the accessibility tree, and Chromium won't\n // leave focus hidden, so it's hidden only until it's focused, and\n // then reads as the field, shut.\n {...(proxyFocused\n ? {\n ...fieldName,\n role: 'combobox',\n 'aria-haspopup': 'dialog' as const,\n 'aria-expanded': false,\n 'aria-describedby': fieldDescription,\n }\n : { 'aria-hidden': true })}\n tabIndex={-1}\n inputMode=\"none\"\n required\n value={hasValue ? 'picked' : ''}\n onChange={ignoreChange}\n form={form}\n disabled={disabled}\n // When the browser stops a submit, it focuses this and shows its\n // message beside it, and every browser takes the message down as\n // this loses focus. So focus stays here, over the field, which\n // looks focused, and a press goes where it lands, as from any\n // field. The next key hands focus to the field and does there\n // what it would have. Firefox also stops taking clicks if focus\n // leaves while it's still focusing this.\n onFocus={() => setProxyFocused(true)}\n onBlur={() => setProxyFocused(false)}\n onKeyDown={event => {\n if (MODIFIER_KEYS.has(event.key)) return;\n inputRef.current?.focus();\n handleKeyDown(event);\n }}\n style={requiredProxyStyle}\n />\n )}\n <HiddenValues\n name={name}\n values={values}\n form={form}\n disabled={disabled}\n />\n <PickerPopover\n localeScope={localeScope.panel}\n isOpen={isOpen}\n onClose={() => onOpenChange(false)}\n anchorRef={rootRef}\n position={position}\n appendToBody={appendToBody}\n className={panelClasses}\n ariaLabel={panelName['aria-label']}\n ariaLabelledBy={panelName['aria-labelledby']}\n id={panelId}\n restoreFocusRef={inputRef}\n initialFocusSelector={initialFocusSelector}\n matchWidth\n followContent\n >\n {children(panelName)}\n </PickerPopover>\n </div>\n );\n\n const fieldElement =\n below === undefined ? (\n root\n ) : (\n <div>\n {root}\n {below}\n </div>\n );\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {fieldElement}\n {messageEl}\n </Field>\n );\n }\n return (\n <>\n {fieldElement}\n {messageEl}\n </>\n );\n}\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AA8GA;;;AAGG;AACH,MAAM,kBAAkB,GAAwB;AAC9C,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,aAAa,EAAE,MAAM;;;AAGrB,IAAA,QAAQ,EAAE,MAAM;CACjB;AAED;AACA,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,KAAK;IACL,UAAU;IACV,UAAU;IACV,SAAS;IACT,IAAI;IACJ,MAAM;IACN,SAAS;IACT,YAAY;IACZ,OAAO;AACR,CAAA,CAAC;AAEF,MAAM,YAAY,GAAG,MAAK,EAAE,CAAC;AAE7B;;;;;;;;;AASG;AACG,SAAU,YAAY,CAAC,EAC3B,SAAS,EACT,SAAS,EACT,UAAU,EACV,IAAI,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