@chayns-components/core 5.5.65 → 5.5.67
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/AGENTS.md +32 -0
- package/lib/cjs/components/context-menu/ContextMenu.js +13 -5
- package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.test.js +234 -0
- package/lib/cjs/components/context-menu/ContextMenu.test.js.map +1 -0
- package/lib/cjs/components/context-menu/ContextMenu.types.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.utils.js +4 -1
- package/lib/cjs/components/context-menu/ContextMenu.utils.js.map +1 -1
- package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js +11 -33
- package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
- package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.styles.js +11 -3
- package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
- package/lib/cjs/components/context-menu/context-menu-content/context-menu-content-item/ContextMenuContentItem.js +74 -0
- package/lib/cjs/components/context-menu/context-menu-content/context-menu-content-item/ContextMenuContentItem.js.map +1 -0
- package/lib/cjs/components/slider/Slider.js +77 -36
- package/lib/cjs/components/slider/Slider.js.map +1 -1
- package/lib/cjs/components/slider/Slider.styles.js +2 -2
- package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.js +13 -4
- package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.test.js +223 -0
- package/lib/esm/components/context-menu/ContextMenu.test.js.map +1 -0
- package/lib/esm/components/context-menu/ContextMenu.types.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.utils.js +4 -1
- package/lib/esm/components/context-menu/ContextMenu.utils.js.map +1 -1
- package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js +13 -35
- package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
- package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.styles.js +11 -3
- package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
- package/lib/esm/components/context-menu/context-menu-content/context-menu-content-item/ContextMenuContentItem.js +66 -0
- package/lib/esm/components/context-menu/context-menu-content/context-menu-content-item/ContextMenuContentItem.js.map +1 -0
- package/lib/esm/components/slider/Slider.js +74 -31
- package/lib/esm/components/slider/Slider.js.map +1 -1
- package/lib/esm/components/slider/Slider.styles.js +2 -2
- package/lib/esm/components/slider/Slider.styles.js.map +1 -1
- package/lib/types/components/context-menu/ContextMenu.types.d.ts +9 -0
- package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +4 -2
- package/lib/types/components/context-menu/context-menu-content/context-menu-content-item/ContextMenuContentItem.d.ts +11 -0
- package/lib/types/components/slider/Slider.styles.d.ts +6 -6
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_styledComponents","_element","_useFocusRingPortal","_useKeyboardFocusHighlighting","_slider","_Slider","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Slider","interval","isDisabled","maxEnabledValue","maxValue","minEnabledValue","minValue","onChange","onSelect","shouldHighlightSteps","shouldEnableKeyboardHighlighting","shouldShowThumbLabel","step","thumbLabelFormatter","value","fromValue","setFromValue","useState","toValue","setToValue","thumbWidth","setThumbWidth","isBigSlider","setIsBigSlider","isFromThumbFocused","setIsFromThumbFocused","isToThumbFocused","setIsToThumbFocused","previousFromValueRef","useRef","previousToValueRef","fromSliderRef","toSliderRef","fromSliderThumbRef","toSliderThumbRef","fromSliderThumbContentRef","toSliderThumbContentRef","sliderWrapperRef","sliderWrapperSize","useElementSize","theme","useTheme","shouldShowKeyboardHighlighting","useKeyboardFocusHighlighting","useFocusRingPortal","isEnabled","overlayRef","shape","updateFromValue","useCallback","nextValue","current","updateToValue","normalizeIntervalValue","newValue","Number","Math","round","applyIntervalThumbChange","thumb","rawValue","isFromThumb","previousValue","hasChanged","from","to","undefined","fillSlider","toSlider","fromSlider","String","useEffect","getThumbMaxWidth","maxNumber","handleMouseUp","_fromSliderRef$curren","_toSliderRef$current","handleControlFromSlider","event","target","handleControlToSlider","handleInputChange","effectiveMin","max","effectiveMax","min","isNaN","fromSliderThumbPosition","useMemo","_fromSliderRef$curren2","offsetWidth","width","calculateGradientOffset","sliderWidth","wrapperWidth","toSliderThumbPosition","_toSliderRef$current2","toSliderThumbContentPosition","calculatePopupPosition","sliderValue","popupWidth","fromSliderThumbContentPosition","handleTouchStart","setRefreshScrollEnabled","handleTouchEnd","_fromSliderRef$curren3","_toSliderRef$current3","highlightedStepElements","_fromSliderRef$curren4","elements","isStepDisabled","offset","stepWidth","push","createElement","StyledHighlightedStep","key","$isDisabled","$isFilled","$leftPosition","fromInputBackground","gradientPoints","getPercentage","x","join","StyledSlider","ref","StyledSliderInput","animate","height","initial","exit","$thumbWidth","$isInterval","type","onTouchStart","onTouchEnd","onMouseUp","$background","onFocus","onBlur","StyledSliderThumb","$position","$isBigSlider","StyledSliderThumbLabel","$width","displayName","_default","exports"],"sources":["../../../../src/components/slider/Slider.tsx"],"sourcesContent":["import { setRefreshScrollEnabled } from 'chayns-api';\nimport React, {\n ChangeEvent,\n FC,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { useElementSize } from '../../hooks/element';\nimport { useFocusRingPortal } from '../../hooks/useFocusRingPortal';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport {\n calculateGradientOffset,\n calculatePopupPosition,\n fillSlider,\n getThumbMaxWidth,\n} from '../../utils/slider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport {\n StyledHighlightedStep,\n StyledSlider,\n StyledSliderInput,\n StyledSliderThumb,\n StyledSliderThumbLabel,\n} from './Slider.styles';\n\nexport interface SliderInterval {\n maxValue: number;\n minValue: number;\n}\n\nexport type SliderProps = {\n /**\n * The current interval of the slider.\n * @description\n * The `interval` prop is used to define a range for the slider, allowing users to select a minimum and maximum value.\n * This is particularly useful for scenarios where you want to allow users to select a range of values, such as price ranges or date ranges.\n * When provided, the slider will display two thumbs, one for the minimum value and one for the maximum value.\n * @example\n * <Slider interval={{ minValue: 10, maxValue: 50 }} />\n * @optional\n */\n interval?: SliderInterval;\n /**\n * Disables the slider, preventing user interaction.\n * @description\n * The `isDisabled` prop is used to disable the slider, making it unresponsive to user input.\n * When set to `true`, the slider cannot be moved, and its appearance may change to indicate that it is disabled.\n * This is useful for scenarios where the slider should not be interacted with, such as when the data it controls is not available or when the user does not have permission to change the value.\n * @default false\n * @example\n * <Slider isDisabled={true} />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * The maximum enabled value of the slider.\n * @description\n * The `maxEnabledValue` prop is used to define the maximum value that can be selected on the slider.\n * It is particularly useful when you want to set an upper limit for the slider's range, ensuring that users cannot select values above this threshold.\n * This prop is optional and can be used in conjunction with the `maxValue` prop to create a more flexible slider.\n * @example\n * <Slider maxEnabledValue={75} />\n * @optional\n */\n maxEnabledValue?: number;\n /**\n * The maximum value of the slider.\n * @description\n * The `maxValue` prop defines the upper limit of the slider's range. It is used to set the maximum value that can be selected by the user.\n * This value should be greater than or equal to `minValue`.\n * @example\n * <Slider maxValue={200} />\n */\n maxValue: number;\n /**\n * The minimum enabled value of the slider.\n * @description\n * The `minEnabledValue` prop is used to define the minimum value that can be selected on the slider.\n * It is particularly useful when you want to set a lower limit for the slider's range, ensuring that users cannot select values below this threshold.\n * This prop is optional and can be used in conjunction with the `minValue` prop to create a more flexible slider.\n * @example\n * <Slider minEnabledValue={25} />\n * @optional\n */\n minEnabledValue?: number;\n /**\n * The minimum value of the slider.\n * @description\n * The `minValue` prop defines the lower limit of the slider's range. It is used to set the minimum value that can be selected by the user.\n * This value should be less than or equal to `maxValue`.\n * @example\n * <Slider minValue={0} />\n */\n minValue: number;\n /**\n * Callback function that is called when the slider value changes.\n * @description\n * The `onChange` prop is a callback function that is triggered whenever the slider value changes.\n * It receives the new value or interval of the slider as an argument, allowing you to update your application state or perform other actions based on the new value.\n * If the slider is configured as an interval, it will receive an object with `minValue` and `maxValue`.\n * @example\n * <Slider onChange={(value, interval) => console.log('Slider changed', { value, interval })} />\n */\n onChange?: (value?: number, interval?: SliderInterval) => void;\n /**\n * Callback function that is called when the slider selection is finalized.\n * @description\n * The `onSelect` prop is a callback function that is triggered when the user finishes interacting with the slider, such as releasing the mouse or touch after dragging the thumb.\n * It receives the selected value or interval as arguments, allowing you to perform actions based on the final selection.\n * If the slider is configured as an interval, it will receive an object with `minValue` and `maxValue`.\n * @example\n * <Slider onSelect={(value, interval) => console.log('Slider selected', { value, interval })} />\n */\n onSelect?: (value?: number, interval?: SliderInterval) => void;\n /**\n * Indicates whether the slider should highlight steps.\n * @description\n * The `shouldHighlightSteps` prop determines whether the slider should visually indicate the steps between values.\n * When set to `true`, the slider will show visual markers for each step, making it easier for users to see the increments.\n * @default false\n * @example\n * <Slider shouldHighlightSteps={true} />\n * @optional\n */\n shouldHighlightSteps?: boolean;\n /**\n * Enables keyboard-only focus highlighting.\n * @description\n * Focus styles are shown only during keyboard navigation and reset on mouse interaction.\n * @default false\n * @optional\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * Indicates whether the slider should show a label on the thumb.\n * @description\n * The `shouldShowThumbLabel` prop determines whether the slider should display a label on the thumb that shows the current value.\n * When set to `true`, a label will be shown above the thumb, providing users with immediate feedback on the selected value.\n * @default false\n * @example\n * <Slider shouldShowThumbLabel={true} />\n * @optional\n */\n shouldShowThumbLabel?: boolean;\n /**\n * The step size for the slider.\n * @description\n * The `step` prop defines the increment by which the slider value changes when the user interacts with it.\n * It is used to control the granularity of the slider's movement. For example, if `step` is set to 1, the slider will move in increments of 1.\n * @default 1\n * @example\n * <Slider step={5} />\n * @optional\n */\n step?: number;\n /**\n * A function to format the thumb label.\n * @description\n * The `thumbLabelFormatter` prop is a function that formats the value displayed on the thumb label.\n * It receives the current value as an argument and should return a string that will be displayed on the thumb label.\n * This is useful for customizing the appearance of the label, such as adding currency symbols or units.\n * @example\n * <Slider thumbLabelFormatter={(value) => `${value} €`} />\n * @optional\n */\n thumbLabelFormatter?: (value: number, isMeasuring?: boolean) => string;\n /**\n * The current value of the slider.\n * @description\n * The `value` prop is used to set the current value of the slider when it is not configured as an interval.\n * It should be a number between `minValue` and `maxValue`. If the slider is configured as an interval, this prop will be ignored.\n * @example\n * <Slider value={50} />\n * @optional\n */\n value?: number;\n};\n\nconst Slider: FC<SliderProps> = ({\n interval,\n isDisabled,\n maxEnabledValue,\n maxValue,\n minEnabledValue,\n minValue,\n onChange,\n onSelect,\n shouldHighlightSteps = false,\n shouldEnableKeyboardHighlighting,\n shouldShowThumbLabel = false,\n step = 1,\n thumbLabelFormatter,\n value,\n}) => {\n const [fromValue, setFromValue] = useState(minEnabledValue ?? minValue);\n const [toValue, setToValue] = useState(maxEnabledValue ?? maxValue);\n const [thumbWidth, setThumbWidth] = useState(20);\n const [isBigSlider, setIsBigSlider] = useState(false);\n const [isFromThumbFocused, setIsFromThumbFocused] = useState(false);\n const [isToThumbFocused, setIsToThumbFocused] = useState(false);\n\n const previousFromValueRef = useRef(fromValue);\n const previousToValueRef = useRef(toValue);\n const fromSliderRef = useRef<HTMLInputElement>(null);\n const toSliderRef = useRef<HTMLInputElement>(null);\n const fromSliderThumbRef = useRef<HTMLDivElement>(null);\n const toSliderThumbRef = useRef<HTMLDivElement>(null);\n const fromSliderThumbContentRef = useRef<HTMLDivElement>(null);\n const toSliderThumbContentRef = useRef<HTMLDivElement>(null);\n const sliderWrapperRef = useRef<HTMLDivElement>(null);\n\n const sliderWrapperSize = useElementSize(sliderWrapperRef);\n\n const theme = useTheme() as Theme;\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !isDisabled,\n );\n useFocusRingPortal(fromSliderRef, {\n isEnabled: shouldShowKeyboardHighlighting && isFromThumbFocused,\n overlayRef: fromSliderThumbRef,\n shape: 'circle',\n });\n useFocusRingPortal(toSliderRef, {\n isEnabled: shouldShowKeyboardHighlighting && isToThumbFocused,\n overlayRef: toSliderThumbRef,\n shape: 'circle',\n });\n\n const updateFromValue = useCallback((nextValue: number) => {\n previousFromValueRef.current = nextValue;\n setFromValue(nextValue);\n }, []);\n\n const updateToValue = useCallback((nextValue: number) => {\n previousToValueRef.current = nextValue;\n setToValue(nextValue);\n }, []);\n\n const normalizeIntervalValue = useCallback(\n (nextValue: number) => {\n let newValue = Number(nextValue);\n\n if (newValue > maxValue || newValue > maxValue - (maxValue % step)) {\n newValue = maxValue;\n } else if (newValue < minValue) {\n newValue = minValue;\n } else {\n newValue = Math.round(newValue / step) * step;\n }\n\n return newValue;\n },\n [maxValue, minValue, step],\n );\n\n const applyIntervalThumbChange = useCallback(\n (thumb: 'from' | 'to', rawValue: number) => {\n if (!fromSliderRef.current || !toSliderRef.current) {\n return;\n }\n\n const newValue = normalizeIntervalValue(rawValue);\n const isFromThumb = thumb === 'from';\n const previousValue = isFromThumb\n ? previousFromValueRef.current\n : previousToValueRef.current;\n const hasChanged = newValue !== previousValue;\n\n if (isFromThumb) {\n updateFromValue(newValue);\n } else {\n updateToValue(newValue);\n }\n\n const from = Number(fromSliderRef.current.value);\n const to = Number(toSliderRef.current.value);\n\n if (hasChanged && typeof onChange === 'function') {\n onChange(undefined, {\n minValue: isFromThumb ? newValue : from,\n maxValue: isFromThumb ? to : newValue,\n });\n }\n\n fillSlider({\n toSlider: toSliderRef.current,\n fromSlider: fromSliderRef.current,\n ...(isFromThumb ? { fromValue: newValue } : { toValue: newValue }),\n theme,\n });\n\n if (isFromThumb) {\n fromSliderRef.current.value = String(newValue > to ? to : newValue);\n } else {\n toSliderRef.current.value = String(from <= newValue ? newValue : from);\n }\n },\n [normalizeIntervalValue, onChange, theme, updateFromValue, updateToValue],\n );\n\n useEffect(() => {\n if (shouldShowThumbLabel) {\n setThumbWidth(getThumbMaxWidth({ maxNumber: maxValue, thumbLabelFormatter }));\n }\n }, [maxValue, shouldShowThumbLabel, thumbLabelFormatter]);\n\n /**\n * This function sets the value\n */\n useEffect(() => {\n if (\n typeof value === 'number' &&\n value >= minValue &&\n value <= maxValue &&\n (typeof minEnabledValue !== 'number' || value >= minEnabledValue) &&\n (typeof maxEnabledValue !== 'number' || value <= maxEnabledValue)\n ) {\n updateFromValue(value);\n }\n }, [maxEnabledValue, maxValue, minEnabledValue, minValue, updateFromValue, value]);\n\n useEffect(() => {\n if (fromValue > toValue) {\n updateFromValue(toValue);\n }\n\n if (toValue < fromValue) {\n updateToValue(fromValue);\n }\n }, [fromValue, toValue, updateFromValue, updateToValue]);\n\n const handleMouseUp = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n const from = Number(fromSliderRef.current?.value);\n const to = Number(toSliderRef.current?.value);\n\n if (typeof onSelect === 'function') {\n onSelect(\n interval ? undefined : from,\n interval ? { maxValue: to, minValue: from } : undefined,\n );\n }\n }, [interval, isDisabled, onSelect]);\n\n const handleControlFromSlider = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n applyIntervalThumbChange('from', Number(event.target.value));\n },\n [applyIntervalThumbChange],\n );\n\n const handleControlToSlider = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n\n applyIntervalThumbChange('to', Number(event.target.value));\n },\n [applyIntervalThumbChange, isDisabled],\n );\n\n useEffect(() => {\n if (!fromSliderRef.current || !toSliderRef.current || !interval) {\n return;\n }\n\n updateFromValue(interval.minValue);\n updateToValue(interval.maxValue);\n\n fromSliderRef.current.value = String(interval.minValue);\n toSliderRef.current.value = String(interval.maxValue);\n\n fillSlider({\n fromSlider: fromSliderRef.current,\n toSlider: toSliderRef.current,\n theme,\n });\n // Note: An interval can't be in the deps because of rerender\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme]);\n\n /**\n * This function updates the value\n */\n const handleInputChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n\n // If interval mode is active, delegate to the \"from\" handler and return early\n if (interval) {\n handleControlFromSlider(event);\n\n return;\n }\n\n // Respect optionally enabled bounds in addition to absolute min/max\n const effectiveMin =\n typeof minEnabledValue === 'number'\n ? Math.max(minValue, minEnabledValue)\n : minValue;\n\n const effectiveMax =\n typeof maxEnabledValue === 'number'\n ? Math.min(maxValue, maxEnabledValue)\n : maxValue;\n\n let newValue = Number(event.target.value);\n\n // Clamp to effective range first\n if (Number.isNaN(newValue)) {\n newValue = effectiveMin;\n }\n\n if (newValue < effectiveMin) newValue = effectiveMin;\n else if (newValue > effectiveMax - (effectiveMax % step)) newValue = effectiveMax;\n else newValue = Math.round(newValue / step) * step;\n\n if (typeof onChange === 'function' && newValue !== previousFromValueRef.current) {\n onChange(newValue);\n }\n\n updateFromValue(newValue);\n },\n [\n handleControlFromSlider,\n interval,\n isDisabled,\n maxEnabledValue,\n maxValue,\n minEnabledValue,\n minValue,\n onChange,\n step,\n updateFromValue,\n ],\n );\n\n const fromSliderThumbPosition = useMemo(() => {\n if (\n typeof fromSliderRef.current?.offsetWidth === 'number' &&\n typeof sliderWrapperSize?.width === 'number'\n ) {\n return calculateGradientOffset({\n maxValue,\n minValue,\n sliderWidth: fromSliderRef.current.offsetWidth,\n thumbWidth: 20,\n value: fromValue,\n wrapperWidth: sliderWrapperSize.width,\n });\n }\n\n return 0;\n }, [fromValue, maxValue, minValue, sliderWrapperSize?.width]);\n\n const toSliderThumbPosition = useMemo(() => {\n if (\n typeof toSliderRef.current?.offsetWidth === 'number' &&\n typeof sliderWrapperSize?.width === 'number'\n ) {\n return calculateGradientOffset({\n maxValue,\n minValue,\n sliderWidth: toSliderRef.current.offsetWidth,\n thumbWidth: 20,\n value: toValue,\n wrapperWidth: sliderWrapperSize.width,\n });\n }\n\n return 0;\n }, [maxValue, minValue, sliderWrapperSize?.width, toValue]);\n\n const toSliderThumbContentPosition = useMemo(\n () =>\n calculatePopupPosition({\n min: minValue,\n max: maxValue,\n sliderValue: toValue,\n popupWidth: thumbWidth,\n }),\n [maxValue, minValue, thumbWidth, toValue],\n );\n\n const fromSliderThumbContentPosition = useMemo(\n () =>\n calculatePopupPosition({\n min: minValue,\n max: maxValue,\n sliderValue: fromValue,\n popupWidth: thumbWidth,\n }),\n [fromValue, maxValue, minValue, thumbWidth],\n );\n\n const handleTouchStart = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n void setRefreshScrollEnabled(false);\n\n if (shouldShowThumbLabel) {\n setIsBigSlider(true);\n }\n }, [isDisabled, shouldShowThumbLabel]);\n\n const handleTouchEnd = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n void setRefreshScrollEnabled(true);\n\n const from = Number(fromSliderRef.current?.value);\n const to = Number(toSliderRef.current?.value);\n\n if (typeof onSelect === 'function') {\n onSelect(\n interval ? undefined : from,\n interval ? { maxValue: to, minValue: from } : undefined,\n );\n }\n\n if (shouldShowThumbLabel) {\n setIsBigSlider(false);\n }\n }, [interval, isDisabled, onSelect, shouldShowThumbLabel]);\n\n const highlightedStepElements = useMemo(() => {\n const sliderWidth = fromSliderRef.current?.offsetWidth ?? 0;\n const wrapperWidth = sliderWrapperSize?.width ?? 0;\n\n if (!shouldHighlightSteps || interval || sliderWidth === 0 || wrapperWidth === 0) {\n return null;\n }\n\n const elements: ReactNode[] = [];\n\n for (let i = minValue; i <= maxValue; i += step) {\n const isStepDisabled =\n (typeof minEnabledValue === 'number' && i < minEnabledValue) ||\n (typeof maxEnabledValue === 'number' && i > maxEnabledValue);\n\n const offset = (wrapperWidth - sliderWidth) / 2;\n const stepWidth = (sliderWidth / (maxValue - minValue)) * step;\n\n elements.push(\n <StyledHighlightedStep\n key={`step--${i}`}\n $isDisabled={isStepDisabled}\n $isFilled={i < fromValue}\n $leftPosition={offset + stepWidth * i}\n />,\n );\n }\n\n return elements;\n }, [\n fromValue,\n interval,\n maxEnabledValue,\n maxValue,\n minEnabledValue,\n minValue,\n shouldHighlightSteps,\n sliderWrapperSize?.width,\n step,\n ]);\n\n const fromInputBackground = useMemo(() => {\n if (interval) return undefined;\n\n const gradientPoints: string[] = [];\n\n const getPercentage = (x: number) => ((x - minValue) / (maxValue - minValue)) * 100;\n\n if (typeof minEnabledValue === 'number') {\n gradientPoints.push('rgb(215, 215, 215) 0%');\n gradientPoints.push(`rgb(215, 215, 215) ${getPercentage(minEnabledValue)}%`);\n gradientPoints.push(`${theme['409'] ?? ''} ${getPercentage(minEnabledValue)}%`);\n } else {\n gradientPoints.push(`${theme['409'] ?? ''} 0%`);\n }\n\n gradientPoints.push(`${theme['409'] ?? ''} ${getPercentage(fromValue)}%`);\n gradientPoints.push(`${theme['403'] ?? ''} ${getPercentage(fromValue)}%`);\n\n if (typeof maxEnabledValue === 'number') {\n gradientPoints.push(`${theme['403'] ?? ''} ${getPercentage(maxEnabledValue)}%`);\n gradientPoints.push(`rgb(215, 215, 215) ${getPercentage(maxEnabledValue)}%`);\n gradientPoints.push('rgb(215, 215, 215) 100%');\n } else {\n gradientPoints.push(`${theme['403'] ?? ''} 100%`);\n }\n\n return `linear-gradient(to right, ${gradientPoints.join(', ')})`;\n }, [fromValue, interval, maxEnabledValue, maxValue, minEnabledValue, minValue, theme]);\n\n return useMemo(\n () => (\n <StyledSlider ref={sliderWrapperRef} $isDisabled={isDisabled}>\n {highlightedStepElements}\n <StyledSliderInput\n animate={{ height: isBigSlider ? 30 : 10 }}\n initial={{ height: 10 }}\n exit={{ height: 10 }}\n $thumbWidth={40}\n ref={fromSliderRef}\n $isInterval={!!interval}\n type=\"range\"\n value={fromValue}\n step={step}\n max={maxValue}\n min={minValue}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onChange={handleInputChange}\n onMouseUp={handleMouseUp}\n $background={fromInputBackground}\n onFocus={() => {\n setIsFromThumbFocused(true);\n setIsToThumbFocused(false);\n }}\n onBlur={() => {\n setIsFromThumbFocused(false);\n }}\n />\n <StyledSliderThumb\n ref={fromSliderThumbRef}\n $position={fromSliderThumbPosition}\n $isBigSlider={isBigSlider}\n >\n {shouldShowThumbLabel && (\n <StyledSliderThumbLabel\n $width={thumbWidth}\n $isBigSlider={isBigSlider}\n $position={fromSliderThumbContentPosition}\n ref={fromSliderThumbContentRef}\n >\n {typeof thumbLabelFormatter === 'function'\n ? thumbLabelFormatter(fromValue)\n : fromValue}\n </StyledSliderThumbLabel>\n )}\n </StyledSliderThumb>\n {interval && (\n <StyledSliderThumb\n ref={toSliderThumbRef}\n $position={toSliderThumbPosition}\n $isBigSlider={isBigSlider}\n >\n {shouldShowThumbLabel && (\n <StyledSliderThumbLabel\n $width={thumbWidth}\n $isBigSlider={isBigSlider}\n $position={toSliderThumbContentPosition}\n ref={toSliderThumbContentRef}\n >\n {typeof thumbLabelFormatter === 'function'\n ? thumbLabelFormatter(toValue)\n : toValue}\n </StyledSliderThumbLabel>\n )}\n </StyledSliderThumb>\n )}\n {interval && (\n <StyledSliderInput\n animate={{ height: isBigSlider ? 30 : 10 }}\n initial={{ height: 10 }}\n exit={{ height: 10 }}\n $thumbWidth={40}\n ref={toSliderRef}\n $isInterval={!!interval}\n type=\"range\"\n value={toValue}\n step={step}\n max={maxValue}\n min={minValue}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onChange={handleControlToSlider}\n onMouseUp={handleMouseUp}\n onFocus={() => {\n setIsToThumbFocused(true);\n setIsFromThumbFocused(false);\n }}\n onBlur={() => {\n setIsToThumbFocused(false);\n }}\n />\n )}\n </StyledSlider>\n ),\n [\n fromInputBackground,\n fromSliderThumbContentPosition,\n fromSliderThumbPosition,\n fromValue,\n handleControlToSlider,\n handleInputChange,\n handleMouseUp,\n handleTouchEnd,\n handleTouchStart,\n highlightedStepElements,\n interval,\n isBigSlider,\n isDisabled,\n isFromThumbFocused,\n isToThumbFocused,\n maxValue,\n minValue,\n shouldShowThumbLabel,\n shouldShowKeyboardHighlighting,\n thumbLabelFormatter,\n thumbWidth,\n toSliderThumbContentPosition,\n toSliderThumbPosition,\n toValue,\n ],\n );\n};\n\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAUA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,6BAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AAMyB,SAAAE,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,C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,EACRqB,WAAW,EACXpB,UAAU,EACVsB,kBAAkB,EAClBE,gBAAgB,EAChBtB,QAAQ,EACRE,QAAQ,EACRK,oBAAoB,EACpB+B,8BAA8B,EAC9B7B,mBAAmB,EACnBO,UAAU,EACV6E,4BAA4B,EAC5BF,qBAAqB,EACrB7E,OAAO,CAEf,CAAC;AACL,CAAC;AAEDlB,MAAM,CAACkJ,WAAW,GAAG,QAAQ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7J,OAAA,GAEfS,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Slider.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_styledComponents","_element","_useFocusRingPortal","_useKeyboardFocusHighlighting","_slider","_Slider","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SLIDER_TRACK_INSET","Slider","interval","isDisabled","maxEnabledValue","maxValue","minEnabledValue","minValue","onChange","onSelect","shouldHighlightSteps","shouldEnableKeyboardHighlighting","shouldShowThumbLabel","step","thumbLabelFormatter","value","fromValue","setFromValue","useState","toValue","setToValue","thumbWidth","setThumbWidth","isBigSlider","setIsBigSlider","isFromThumbFocused","setIsFromThumbFocused","isToThumbFocused","setIsToThumbFocused","previousFromValueRef","useRef","previousToValueRef","fromSliderRef","toSliderRef","fromSliderThumbRef","toSliderThumbRef","fromSliderThumbContentRef","toSliderThumbContentRef","sliderWrapperRef","activePointerIdRef","sliderWrapperSize","useElementSize","sliderTrackWidth","Math","max","width","theme","useTheme","shouldShowKeyboardHighlighting","useKeyboardFocusHighlighting","useFocusRingPortal","isEnabled","overlayRef","shape","updateFromValue","useCallback","nextValue","current","updateToValue","normalizeIntervalValue","newValue","Number","round","applyIntervalThumbChange","thumb","rawValue","isFromThumb","previousValue","hasChanged","from","to","undefined","fillSlider","toSlider","fromSlider","String","useEffect","getThumbMaxWidth","maxNumber","handleMouseUp","_fromSliderRef$curren","_toSliderRef$current","handleControlFromSlider","event","target","handleControlToSlider","normalizeSingleValue","effectiveMin","effectiveMax","min","isNaN","handleInputChange","updateValueFromPointer","bounds","currentTarget","getBoundingClientRect","relativePosition","clientX","left","handlePointerDown","_fromSliderRef$curren2","button","preventDefault","pointerId","setPointerCapture","focus","handlePointerMove","handlePointerUp","releasePointerCapture","fromSliderThumbPosition","useMemo","calculateGradientOffset","sliderWidth","wrapperWidth","toSliderThumbPosition","toSliderThumbContentPosition","calculatePopupPosition","sliderValue","popupWidth","fromSliderThumbContentPosition","handleTouchStart","setRefreshScrollEnabled","handleTouchEnd","_fromSliderRef$curren3","_toSliderRef$current2","highlightedStepElements","elements","isStepDisabled","offset","push","createElement","StyledHighlightedStep","key","$isDisabled","$isFilled","$leftPosition","fromInputBackground","gradientPoints","getPercentage","x","join","StyledSlider","ref","onPointerDown","onPointerMove","onPointerUp","StyledSliderInput","animate","height","initial","exit","$trackInset","$isInterval","type","onTouchStart","onTouchEnd","onMouseUp","$background","onFocus","onBlur","StyledSliderThumb","$position","$isBigSlider","StyledSliderThumbLabel","$width","displayName","_default","exports"],"sources":["../../../../src/components/slider/Slider.tsx"],"sourcesContent":["import { setRefreshScrollEnabled } from 'chayns-api';\nimport React, {\n ChangeEvent,\n FC,\n PointerEvent as ReactPointerEvent,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { useElementSize } from '../../hooks/element';\nimport { useFocusRingPortal } from '../../hooks/useFocusRingPortal';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport {\n calculateGradientOffset,\n calculatePopupPosition,\n fillSlider,\n getThumbMaxWidth,\n} from '../../utils/slider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport {\n StyledHighlightedStep,\n StyledSlider,\n StyledSliderInput,\n StyledSliderThumb,\n StyledSliderThumbLabel,\n} from './Slider.styles';\n\nconst SLIDER_TRACK_INSET = 40;\n\nexport interface SliderInterval {\n maxValue: number;\n minValue: number;\n}\n\nexport type SliderProps = {\n /**\n * The current interval of the slider.\n * @description\n * The `interval` prop is used to define a range for the slider, allowing users to select a minimum and maximum value.\n * This is particularly useful for scenarios where you want to allow users to select a range of values, such as price ranges or date ranges.\n * When provided, the slider will display two thumbs, one for the minimum value and one for the maximum value.\n * @example\n * <Slider interval={{ minValue: 10, maxValue: 50 }} />\n * @optional\n */\n interval?: SliderInterval;\n /**\n * Disables the slider, preventing user interaction.\n * @description\n * The `isDisabled` prop is used to disable the slider, making it unresponsive to user input.\n * When set to `true`, the slider cannot be moved, and its appearance may change to indicate that it is disabled.\n * This is useful for scenarios where the slider should not be interacted with, such as when the data it controls is not available or when the user does not have permission to change the value.\n * @default false\n * @example\n * <Slider isDisabled={true} />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * The maximum enabled value of the slider.\n * @description\n * The `maxEnabledValue` prop is used to define the maximum value that can be selected on the slider.\n * It is particularly useful when you want to set an upper limit for the slider's range, ensuring that users cannot select values above this threshold.\n * This prop is optional and can be used in conjunction with the `maxValue` prop to create a more flexible slider.\n * @example\n * <Slider maxEnabledValue={75} />\n * @optional\n */\n maxEnabledValue?: number;\n /**\n * The maximum value of the slider.\n * @description\n * The `maxValue` prop defines the upper limit of the slider's range. It is used to set the maximum value that can be selected by the user.\n * This value should be greater than or equal to `minValue`.\n * @example\n * <Slider maxValue={200} />\n */\n maxValue: number;\n /**\n * The minimum enabled value of the slider.\n * @description\n * The `minEnabledValue` prop is used to define the minimum value that can be selected on the slider.\n * It is particularly useful when you want to set a lower limit for the slider's range, ensuring that users cannot select values below this threshold.\n * This prop is optional and can be used in conjunction with the `minValue` prop to create a more flexible slider.\n * @example\n * <Slider minEnabledValue={25} />\n * @optional\n */\n minEnabledValue?: number;\n /**\n * The minimum value of the slider.\n * @description\n * The `minValue` prop defines the lower limit of the slider's range. It is used to set the minimum value that can be selected by the user.\n * This value should be less than or equal to `maxValue`.\n * @example\n * <Slider minValue={0} />\n */\n minValue: number;\n /**\n * Callback function that is called when the slider value changes.\n * @description\n * The `onChange` prop is a callback function that is triggered whenever the slider value changes.\n * It receives the new value or interval of the slider as an argument, allowing you to update your application state or perform other actions based on the new value.\n * If the slider is configured as an interval, it will receive an object with `minValue` and `maxValue`.\n * @example\n * <Slider onChange={(value, interval) => console.log('Slider changed', { value, interval })} />\n */\n onChange?: (value?: number, interval?: SliderInterval) => void;\n /**\n * Callback function that is called when the slider selection is finalized.\n * @description\n * The `onSelect` prop is a callback function that is triggered when the user finishes interacting with the slider, such as releasing the mouse or touch after dragging the thumb.\n * It receives the selected value or interval as arguments, allowing you to perform actions based on the final selection.\n * If the slider is configured as an interval, it will receive an object with `minValue` and `maxValue`.\n * @example\n * <Slider onSelect={(value, interval) => console.log('Slider selected', { value, interval })} />\n */\n onSelect?: (value?: number, interval?: SliderInterval) => void;\n /**\n * Indicates whether the slider should highlight steps.\n * @description\n * The `shouldHighlightSteps` prop determines whether the slider should visually indicate the steps between values.\n * When set to `true`, the slider will show visual markers for each step, making it easier for users to see the increments.\n * @default false\n * @example\n * <Slider shouldHighlightSteps={true} />\n * @optional\n */\n shouldHighlightSteps?: boolean;\n /**\n * Enables keyboard-only focus highlighting.\n * @description\n * Focus styles are shown only during keyboard navigation and reset on mouse interaction.\n * @default false\n * @optional\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * Indicates whether the slider should show a label on the thumb.\n * @description\n * The `shouldShowThumbLabel` prop determines whether the slider should display a label on the thumb that shows the current value.\n * When set to `true`, a label will be shown above the thumb, providing users with immediate feedback on the selected value.\n * @default false\n * @example\n * <Slider shouldShowThumbLabel={true} />\n * @optional\n */\n shouldShowThumbLabel?: boolean;\n /**\n * The step size for the slider.\n * @description\n * The `step` prop defines the increment by which the slider value changes when the user interacts with it.\n * It is used to control the granularity of the slider's movement. For example, if `step` is set to 1, the slider will move in increments of 1.\n * @default 1\n * @example\n * <Slider step={5} />\n * @optional\n */\n step?: number;\n /**\n * A function to format the thumb label.\n * @description\n * The `thumbLabelFormatter` prop is a function that formats the value displayed on the thumb label.\n * It receives the current value as an argument and should return a string that will be displayed on the thumb label.\n * This is useful for customizing the appearance of the label, such as adding currency symbols or units.\n * @example\n * <Slider thumbLabelFormatter={(value) => `${value} €`} />\n * @optional\n */\n thumbLabelFormatter?: (value: number, isMeasuring?: boolean) => string;\n /**\n * The current value of the slider.\n * @description\n * The `value` prop is used to set the current value of the slider when it is not configured as an interval.\n * It should be a number between `minValue` and `maxValue`. If the slider is configured as an interval, this prop will be ignored.\n * @example\n * <Slider value={50} />\n * @optional\n */\n value?: number;\n};\n\nconst Slider: FC<SliderProps> = ({\n interval,\n isDisabled,\n maxEnabledValue,\n maxValue,\n minEnabledValue,\n minValue,\n onChange,\n onSelect,\n shouldHighlightSteps = false,\n shouldEnableKeyboardHighlighting,\n shouldShowThumbLabel = false,\n step = 1,\n thumbLabelFormatter,\n value,\n}) => {\n const [fromValue, setFromValue] = useState(minEnabledValue ?? minValue);\n const [toValue, setToValue] = useState(maxEnabledValue ?? maxValue);\n const [thumbWidth, setThumbWidth] = useState(20);\n const [isBigSlider, setIsBigSlider] = useState(false);\n const [isFromThumbFocused, setIsFromThumbFocused] = useState(false);\n const [isToThumbFocused, setIsToThumbFocused] = useState(false);\n\n const previousFromValueRef = useRef(fromValue);\n const previousToValueRef = useRef(toValue);\n const fromSliderRef = useRef<HTMLInputElement>(null);\n const toSliderRef = useRef<HTMLInputElement>(null);\n const fromSliderThumbRef = useRef<HTMLDivElement>(null);\n const toSliderThumbRef = useRef<HTMLDivElement>(null);\n const fromSliderThumbContentRef = useRef<HTMLDivElement>(null);\n const toSliderThumbContentRef = useRef<HTMLDivElement>(null);\n const sliderWrapperRef = useRef<HTMLDivElement>(null);\n const activePointerIdRef = useRef<number | null>(null);\n\n const sliderWrapperSize = useElementSize(sliderWrapperRef);\n const sliderTrackWidth = Math.max((sliderWrapperSize?.width ?? 0) - SLIDER_TRACK_INSET, 0);\n\n const theme = useTheme() as Theme;\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !isDisabled,\n );\n useFocusRingPortal(fromSliderRef, {\n isEnabled: shouldShowKeyboardHighlighting && isFromThumbFocused,\n overlayRef: fromSliderThumbRef,\n shape: 'circle',\n });\n useFocusRingPortal(toSliderRef, {\n isEnabled: shouldShowKeyboardHighlighting && isToThumbFocused,\n overlayRef: toSliderThumbRef,\n shape: 'circle',\n });\n\n const updateFromValue = useCallback((nextValue: number) => {\n previousFromValueRef.current = nextValue;\n setFromValue(nextValue);\n }, []);\n\n const updateToValue = useCallback((nextValue: number) => {\n previousToValueRef.current = nextValue;\n setToValue(nextValue);\n }, []);\n\n const normalizeIntervalValue = useCallback(\n (nextValue: number) => {\n let newValue = Number(nextValue);\n\n if (newValue > maxValue || newValue > maxValue - (maxValue % step)) {\n newValue = maxValue;\n } else if (newValue < minValue) {\n newValue = minValue;\n } else {\n newValue = Math.round(newValue / step) * step;\n }\n\n return newValue;\n },\n [maxValue, minValue, step],\n );\n\n const applyIntervalThumbChange = useCallback(\n (thumb: 'from' | 'to', rawValue: number) => {\n if (!fromSliderRef.current || !toSliderRef.current) {\n return;\n }\n\n const newValue = normalizeIntervalValue(rawValue);\n const isFromThumb = thumb === 'from';\n const previousValue = isFromThumb\n ? previousFromValueRef.current\n : previousToValueRef.current;\n const hasChanged = newValue !== previousValue;\n\n if (isFromThumb) {\n updateFromValue(newValue);\n } else {\n updateToValue(newValue);\n }\n\n const from = Number(fromSliderRef.current.value);\n const to = Number(toSliderRef.current.value);\n\n if (hasChanged && typeof onChange === 'function') {\n onChange(undefined, {\n minValue: isFromThumb ? newValue : from,\n maxValue: isFromThumb ? to : newValue,\n });\n }\n\n fillSlider({\n toSlider: toSliderRef.current,\n fromSlider: fromSliderRef.current,\n ...(isFromThumb ? { fromValue: newValue } : { toValue: newValue }),\n theme,\n });\n\n if (isFromThumb) {\n fromSliderRef.current.value = String(newValue > to ? to : newValue);\n } else {\n toSliderRef.current.value = String(from <= newValue ? newValue : from);\n }\n },\n [normalizeIntervalValue, onChange, theme, updateFromValue, updateToValue],\n );\n\n useEffect(() => {\n if (shouldShowThumbLabel) {\n setThumbWidth(getThumbMaxWidth({ maxNumber: maxValue, thumbLabelFormatter }));\n }\n }, [maxValue, shouldShowThumbLabel, thumbLabelFormatter]);\n\n /**\n * This function sets the value\n */\n useEffect(() => {\n if (\n typeof value === 'number' &&\n value >= minValue &&\n value <= maxValue &&\n (typeof minEnabledValue !== 'number' || value >= minEnabledValue) &&\n (typeof maxEnabledValue !== 'number' || value <= maxEnabledValue)\n ) {\n updateFromValue(value);\n }\n }, [maxEnabledValue, maxValue, minEnabledValue, minValue, updateFromValue, value]);\n\n useEffect(() => {\n if (fromValue > toValue) {\n updateFromValue(toValue);\n }\n\n if (toValue < fromValue) {\n updateToValue(fromValue);\n }\n }, [fromValue, toValue, updateFromValue, updateToValue]);\n\n const handleMouseUp = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n const from = Number(fromSliderRef.current?.value);\n const to = Number(toSliderRef.current?.value);\n\n if (typeof onSelect === 'function') {\n onSelect(\n interval ? undefined : from,\n interval ? { maxValue: to, minValue: from } : undefined,\n );\n }\n }, [interval, isDisabled, onSelect]);\n\n const handleControlFromSlider = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n applyIntervalThumbChange('from', Number(event.target.value));\n },\n [applyIntervalThumbChange],\n );\n\n const handleControlToSlider = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n\n applyIntervalThumbChange('to', Number(event.target.value));\n },\n [applyIntervalThumbChange, isDisabled],\n );\n\n useEffect(() => {\n if (!fromSliderRef.current || !toSliderRef.current || !interval) {\n return;\n }\n\n updateFromValue(interval.minValue);\n updateToValue(interval.maxValue);\n\n fromSliderRef.current.value = String(interval.minValue);\n toSliderRef.current.value = String(interval.maxValue);\n\n fillSlider({\n fromSlider: fromSliderRef.current,\n toSlider: toSliderRef.current,\n theme,\n });\n // Note: An interval can't be in the deps because of rerender\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme]);\n\n const normalizeSingleValue = useCallback(\n (rawValue: number) => {\n const effectiveMin =\n typeof minEnabledValue === 'number'\n ? Math.max(minValue, minEnabledValue)\n : minValue;\n\n const effectiveMax =\n typeof maxEnabledValue === 'number'\n ? Math.min(maxValue, maxEnabledValue)\n : maxValue;\n\n let newValue = rawValue;\n\n if (Number.isNaN(newValue)) {\n newValue = effectiveMin;\n }\n\n if (newValue < effectiveMin) newValue = effectiveMin;\n else if (newValue > effectiveMax - (effectiveMax % step)) newValue = effectiveMax;\n else newValue = Math.round(newValue / step) * step;\n\n return newValue;\n },\n [maxEnabledValue, maxValue, minEnabledValue, minValue, step],\n );\n\n /**\n * This function updates the value\n */\n const handleInputChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled) {\n return;\n }\n\n // If interval mode is active, delegate to the \"from\" handler and return early\n if (interval) {\n handleControlFromSlider(event);\n\n return;\n }\n\n const newValue = normalizeSingleValue(Number(event.target.value));\n\n if (typeof onChange === 'function' && newValue !== previousFromValueRef.current) {\n onChange(newValue);\n }\n\n updateFromValue(newValue);\n },\n [\n handleControlFromSlider,\n interval,\n isDisabled,\n maxEnabledValue,\n normalizeSingleValue,\n onChange,\n updateFromValue,\n ],\n );\n\n const updateValueFromPointer = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n const bounds = event.currentTarget.getBoundingClientRect();\n const relativePosition =\n (event.clientX - bounds.left - SLIDER_TRACK_INSET / 2) / sliderTrackWidth;\n const rawValue =\n minValue + Math.min(Math.max(relativePosition, 0), 1) * (maxValue - minValue);\n const newValue = normalizeSingleValue(rawValue);\n\n if (typeof onChange === 'function' && newValue !== previousFromValueRef.current) {\n onChange(newValue);\n }\n\n updateFromValue(newValue);\n\n return newValue;\n },\n [maxValue, minValue, normalizeSingleValue, onChange, sliderTrackWidth, updateFromValue],\n );\n\n const handlePointerDown = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (isDisabled || interval || event.button !== 0) {\n return;\n }\n\n event.preventDefault();\n activePointerIdRef.current = event.pointerId;\n event.currentTarget.setPointerCapture(event.pointerId);\n fromSliderRef.current?.focus();\n updateValueFromPointer(event);\n },\n [interval, isDisabled, updateValueFromPointer],\n );\n\n const handlePointerMove = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (activePointerIdRef.current !== event.pointerId) {\n return;\n }\n\n event.preventDefault();\n updateValueFromPointer(event);\n },\n [updateValueFromPointer],\n );\n\n const handlePointerUp = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (activePointerIdRef.current !== event.pointerId) {\n return;\n }\n\n event.preventDefault();\n activePointerIdRef.current = null;\n event.currentTarget.releasePointerCapture(event.pointerId);\n\n if (typeof onSelect === 'function') {\n onSelect(updateValueFromPointer(event));\n }\n },\n [onSelect, updateValueFromPointer],\n );\n\n const fromSliderThumbPosition = useMemo(() => {\n if (typeof sliderWrapperSize?.width === 'number') {\n return calculateGradientOffset({\n maxValue,\n minValue,\n sliderWidth: sliderTrackWidth,\n thumbWidth: 20,\n value: fromValue,\n wrapperWidth: sliderWrapperSize.width,\n });\n }\n\n return 0;\n }, [fromValue, maxValue, minValue, sliderTrackWidth, sliderWrapperSize?.width]);\n\n const toSliderThumbPosition = useMemo(() => {\n if (typeof sliderWrapperSize?.width === 'number') {\n return calculateGradientOffset({\n maxValue,\n minValue,\n sliderWidth: sliderTrackWidth,\n thumbWidth: 20,\n value: toValue,\n wrapperWidth: sliderWrapperSize.width,\n });\n }\n\n return 0;\n }, [maxValue, minValue, sliderTrackWidth, sliderWrapperSize?.width, toValue]);\n\n const toSliderThumbContentPosition = useMemo(\n () =>\n calculatePopupPosition({\n min: minValue,\n max: maxValue,\n sliderValue: toValue,\n popupWidth: thumbWidth,\n }),\n [maxValue, minValue, thumbWidth, toValue],\n );\n\n const fromSliderThumbContentPosition = useMemo(\n () =>\n calculatePopupPosition({\n min: minValue,\n max: maxValue,\n sliderValue: fromValue,\n popupWidth: thumbWidth,\n }),\n [fromValue, maxValue, minValue, thumbWidth],\n );\n\n const handleTouchStart = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n void setRefreshScrollEnabled(false);\n\n if (shouldShowThumbLabel) {\n setIsBigSlider(true);\n }\n }, [isDisabled, shouldShowThumbLabel]);\n\n const handleTouchEnd = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n void setRefreshScrollEnabled(true);\n\n const from = Number(fromSliderRef.current?.value);\n const to = Number(toSliderRef.current?.value);\n\n if (interval && typeof onSelect === 'function') {\n onSelect(undefined, { maxValue: to, minValue: from });\n }\n\n if (shouldShowThumbLabel) {\n setIsBigSlider(false);\n }\n }, [interval, isDisabled, onSelect, shouldShowThumbLabel]);\n\n const highlightedStepElements = useMemo(() => {\n const wrapperWidth = sliderWrapperSize?.width ?? 0;\n\n if (!shouldHighlightSteps || interval || sliderTrackWidth === 0 || wrapperWidth === 0) {\n return null;\n }\n\n const elements: ReactNode[] = [];\n\n for (let i = minValue; i <= maxValue; i += step) {\n const isStepDisabled =\n (typeof minEnabledValue === 'number' && i < minEnabledValue) ||\n (typeof maxEnabledValue === 'number' && i > maxEnabledValue);\n\n const offset = (wrapperWidth - sliderTrackWidth) / 2;\n\n elements.push(\n <StyledHighlightedStep\n key={`step--${i}`}\n $isDisabled={isStepDisabled}\n $isFilled={i < fromValue}\n $leftPosition={\n offset + ((i - minValue) / (maxValue - minValue)) * sliderTrackWidth\n }\n />,\n );\n }\n\n return elements;\n }, [\n fromValue,\n interval,\n maxEnabledValue,\n maxValue,\n minEnabledValue,\n minValue,\n shouldHighlightSteps,\n sliderTrackWidth,\n sliderWrapperSize?.width,\n step,\n ]);\n\n const fromInputBackground = useMemo(() => {\n if (interval) return undefined;\n\n const gradientPoints: string[] = [];\n\n const getPercentage = (x: number) => ((x - minValue) / (maxValue - minValue)) * 100;\n\n if (typeof minEnabledValue === 'number') {\n gradientPoints.push('rgb(215, 215, 215) 0%');\n gradientPoints.push(`rgb(215, 215, 215) ${getPercentage(minEnabledValue)}%`);\n gradientPoints.push(`${theme['409'] ?? ''} ${getPercentage(minEnabledValue)}%`);\n } else {\n gradientPoints.push(`${theme['409'] ?? ''} 0%`);\n }\n\n gradientPoints.push(`${theme['409'] ?? ''} ${getPercentage(fromValue)}%`);\n gradientPoints.push(`${theme['403'] ?? ''} ${getPercentage(fromValue)}%`);\n\n if (typeof maxEnabledValue === 'number') {\n gradientPoints.push(`${theme['403'] ?? ''} ${getPercentage(maxEnabledValue)}%`);\n gradientPoints.push(`rgb(215, 215, 215) ${getPercentage(maxEnabledValue)}%`);\n gradientPoints.push('rgb(215, 215, 215) 100%');\n } else {\n gradientPoints.push(`${theme['403'] ?? ''} 100%`);\n }\n\n return `linear-gradient(to right, ${gradientPoints.join(', ')})`;\n }, [fromValue, interval, maxEnabledValue, maxValue, minEnabledValue, minValue, theme]);\n\n return useMemo(\n () => (\n <StyledSlider\n ref={sliderWrapperRef}\n $isDisabled={isDisabled}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n >\n {highlightedStepElements}\n <StyledSliderInput\n animate={{ height: isBigSlider ? 30 : 10 }}\n initial={{ height: 10 }}\n exit={{ height: 10 }}\n $trackInset={SLIDER_TRACK_INSET}\n ref={fromSliderRef}\n $isInterval={!!interval}\n type=\"range\"\n value={fromValue}\n step={step}\n max={maxValue}\n min={minValue}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onChange={handleInputChange}\n onMouseUp={interval ? handleMouseUp : undefined}\n $background={fromInputBackground}\n onFocus={() => {\n setIsFromThumbFocused(true);\n setIsToThumbFocused(false);\n }}\n onBlur={() => {\n setIsFromThumbFocused(false);\n }}\n />\n <StyledSliderThumb\n ref={fromSliderThumbRef}\n $position={fromSliderThumbPosition}\n $isBigSlider={isBigSlider}\n >\n {shouldShowThumbLabel && (\n <StyledSliderThumbLabel\n $width={thumbWidth}\n $isBigSlider={isBigSlider}\n $position={fromSliderThumbContentPosition}\n ref={fromSliderThumbContentRef}\n >\n {typeof thumbLabelFormatter === 'function'\n ? thumbLabelFormatter(fromValue)\n : fromValue}\n </StyledSliderThumbLabel>\n )}\n </StyledSliderThumb>\n {interval && (\n <StyledSliderThumb\n ref={toSliderThumbRef}\n $position={toSliderThumbPosition}\n $isBigSlider={isBigSlider}\n >\n {shouldShowThumbLabel && (\n <StyledSliderThumbLabel\n $width={thumbWidth}\n $isBigSlider={isBigSlider}\n $position={toSliderThumbContentPosition}\n ref={toSliderThumbContentRef}\n >\n {typeof thumbLabelFormatter === 'function'\n ? thumbLabelFormatter(toValue)\n : toValue}\n </StyledSliderThumbLabel>\n )}\n </StyledSliderThumb>\n )}\n {interval && (\n <StyledSliderInput\n animate={{ height: isBigSlider ? 30 : 10 }}\n initial={{ height: 10 }}\n exit={{ height: 10 }}\n $trackInset={SLIDER_TRACK_INSET}\n ref={toSliderRef}\n $isInterval={!!interval}\n type=\"range\"\n value={toValue}\n step={step}\n max={maxValue}\n min={minValue}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onChange={handleControlToSlider}\n onMouseUp={handleMouseUp}\n onFocus={() => {\n setIsToThumbFocused(true);\n setIsFromThumbFocused(false);\n }}\n onBlur={() => {\n setIsToThumbFocused(false);\n }}\n />\n )}\n </StyledSlider>\n ),\n [\n fromInputBackground,\n fromSliderThumbContentPosition,\n fromSliderThumbPosition,\n fromValue,\n handleControlToSlider,\n handleInputChange,\n handleMouseUp,\n handlePointerDown,\n handlePointerMove,\n handlePointerUp,\n handleTouchEnd,\n handleTouchStart,\n highlightedStepElements,\n interval,\n isBigSlider,\n isDisabled,\n isFromThumbFocused,\n isToThumbFocused,\n maxValue,\n minValue,\n shouldShowThumbLabel,\n shouldShowKeyboardHighlighting,\n thumbLabelFormatter,\n thumbWidth,\n toSliderThumbContentPosition,\n toSliderTh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OAAA,CAAAhL,OAAA,GAEfU,MAAM","ignoreList":[]}
|
|
@@ -26,11 +26,11 @@ const StyledSlider = exports.StyledSlider = _styledComponents.default.div`
|
|
|
26
26
|
const StyledSliderInput = exports.StyledSliderInput = (0, _styledComponents.default)(_react.motion.input).attrs(({
|
|
27
27
|
$background,
|
|
28
28
|
$isInterval,
|
|
29
|
-
$
|
|
29
|
+
$trackInset
|
|
30
30
|
}) => ({
|
|
31
31
|
style: {
|
|
32
32
|
pointerEvents: $isInterval ? 'none' : 'all',
|
|
33
|
-
width: `calc(100% - ${$
|
|
33
|
+
width: `calc(100% - ${$trackInset}px)`,
|
|
34
34
|
background: $background
|
|
35
35
|
}
|
|
36
36
|
}))`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSlider","exports","styled","div","$isDisabled","StyledSliderInput","motion","input","attrs","$background","$isInterval","$
|
|
1
|
+
{"version":3,"file":"Slider.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSlider","exports","styled","div","$isDisabled","StyledSliderInput","motion","input","attrs","$background","$isInterval","$trackInset","style","pointerEvents","width","background","StyledSliderThumb","$position","$isBigSlider","left","height","StyledSliderThumbLabel","span","$width","minWidth","top","StyledHighlightedStep","$isFilled","theme","$leftPosition"],"sources":["../../../../src/components/slider/Slider.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSliderProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledSlider = styled.div<StyledSliderProps>`\n width: 100%;\n height: 30px;\n cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')} !important;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n touch-action: none;\n user-select: none;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n`;\n\ntype StyledSliderInputProps = WithTheme<{\n $background?: string;\n $isInterval: boolean;\n $trackInset: number;\n}>;\n\nexport const StyledSliderInput = styled(motion.input).attrs<StyledSliderInputProps>(\n ({ $background, $isInterval, $trackInset }) => ({\n style: {\n pointerEvents: $isInterval ? 'none' : 'all',\n width: `calc(100% - ${$trackInset}px)`,\n background: $background,\n },\n }),\n)`\n position: absolute;\n border-radius: 100px;\n -webkit-appearance: none;\n\n outline: none;\n cursor: pointer !important;\n z-index: 2;\n appearance: none;\n\n // Slider thumb for chrome\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 50px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n\n // slider thumb for firefox\n\n &::-moz-range-thumb {\n width: 50px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n`;\n\ntype StyledSliderThumbProps = WithTheme<{\n $position: number;\n $isBigSlider: boolean;\n}>;\n\nexport const StyledSliderThumb = styled.div.attrs<StyledSliderThumbProps>(\n ({ $position, $isBigSlider }) => ({\n style: {\n left: `${$position}px`,\n height: `${$isBigSlider ? 0 : 20}px`,\n },\n }),\n)`\n width: 20px;\n height: 20px;\n cursor: pointer;\n border-radius: 100px;\n background-color: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n pointer-events: none;\n z-index: 5;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 8px;\n white-space: nowrap;\n top: 5px;\n\n transition: top 0.2s ease 0s;\n`;\n\ntype StyledSliderThumbLabelProps = WithTheme<{\n $position: number;\n $width: number;\n $isBigSlider: boolean;\n}>;\n\nexport const StyledSliderThumbLabel = styled.span.attrs<StyledSliderThumbLabelProps>(\n ({ $position, $isBigSlider, $width }) => ({\n style: {\n minWidth: `${$width}px`,\n top: `-${$isBigSlider ? 56 : 48}px`,\n left: `${$position}px`,\n },\n }),\n)`\n pointer-events: none;\n color: #222;\n\n height: 20px;\n cursor: pointer;\n border-radius: 3px;\n background-color: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n z-index: 3;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n white-space: nowrap;\n\n transition: top 0.2s ease 0s;\n\n &::after {\n background-color: inherit;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.4);\n content: '';\n height: 14px;\n position: absolute;\n width: 14px;\n z-index: -2;\n left: ${({ $position }) => $position * -1}px;\n transform: rotate(225deg);\n bottom: -7px;\n }\n\n &::before {\n background-color: inherit;\n bottom: 0;\n content: '';\n left: 0;\n position: absolute;\n right: 0;\n border-radius: 3px;\n top: 0;\n z-index: -1;\n }\n`;\n\ntype StyledHighlightedStepProps = WithTheme<{\n $isDisabled: boolean;\n $isFilled: boolean;\n $leftPosition: number;\n}>;\n\nexport const StyledHighlightedStep = styled.div<StyledHighlightedStepProps>`\n background-color: ${({ $isDisabled, $isFilled, theme }) => {\n if ($isDisabled) return 'rgb(215, 215, 215)';\n if ($isFilled) return theme['409'];\n return theme['403'];\n }};\n border-radius: 50%;\n height: 18px;\n left: ${({ $leftPosition }) => $leftPosition}px;\n pointer-events: none;\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 18px;\n z-index: 3;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAgD,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKzC,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,yBAAM,CAACC,GAAsB;AACzD;AACA;AACA,cAAc,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,SA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,IAAIP,YAAY,GAAG,EAAE,GAAG,EAAE,IAAI;IACnCC,IAAI,EAAE,GAAGF,SAAS;EACtB;AACJ,CAAC,CACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,CAAC;EAAEA;AAAU,CAAC,KAAKA,SAAS,GAAG,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAQM,MAAMS,qBAAqB,GAAAzB,OAAA,CAAAyB,qBAAA,GAAGxB,yBAAM,CAACC,GAA+B;AAC3E,wBAAwB,CAAC;EAAEC,WAAW;EAAEuB,SAAS;EAAEC;AAAM,CAAC,KAAK;EACvD,IAAIxB,WAAW,EAAE,OAAO,oBAAoB;EAC5C,IAAIuB,SAAS,EAAE,OAAOC,KAAK,CAAC,KAAK,CAAC;EAClC,OAAOA,KAAK,CAAC,KAAK,CAAC;AACvB,CAAC;AACL;AACA;AACA,YAAY,CAAC;EAAEC;AAAc,CAAC,KAAKA,aAAa;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -103,16 +103,23 @@ const ContextMenu = /*#__PURE__*/forwardRef(({
|
|
|
103
103
|
list: items.map(({
|
|
104
104
|
icons,
|
|
105
105
|
text,
|
|
106
|
-
isSelected
|
|
106
|
+
isSelected,
|
|
107
|
+
isDisabled,
|
|
108
|
+
disabledReason
|
|
107
109
|
}, index) => ({
|
|
108
110
|
name: text,
|
|
109
111
|
id: index,
|
|
110
112
|
isSelected,
|
|
113
|
+
disabled: isDisabled,
|
|
114
|
+
subtitle: isDisabled ? disabledReason : undefined,
|
|
111
115
|
icon: /*#__PURE__*/isValidElement(icons) ? undefined : icons?.[0]
|
|
112
116
|
}))
|
|
113
117
|
}).open();
|
|
114
118
|
if (result && typeof result[0] === 'number') {
|
|
115
|
-
|
|
119
|
+
const item = items[result[0]];
|
|
120
|
+
if (item && !item.isDisabled) {
|
|
121
|
+
void item.onClick();
|
|
122
|
+
}
|
|
116
123
|
}
|
|
117
124
|
} else if (contextMenuRef.current) {
|
|
118
125
|
if (!newContainer) {
|
|
@@ -214,7 +221,7 @@ const ContextMenu = /*#__PURE__*/forwardRef(({
|
|
|
214
221
|
event.stopPropagation();
|
|
215
222
|
void handleShow();
|
|
216
223
|
}
|
|
217
|
-
}, [focusedIndex, handleHide, handleShow, isHovered, isContentShown, items,
|
|
224
|
+
}, [focusedIndex, handleHide, handleShow, isHovered, isContentShown, items, shouldCloseOnPopupClick, shouldDisableClick, shouldUseFocusableWrapper]);
|
|
218
225
|
const handleContextMenu = useCallback(event => {
|
|
219
226
|
event.preventDefault();
|
|
220
227
|
event.stopPropagation();
|
|
@@ -272,7 +279,9 @@ const ContextMenu = /*#__PURE__*/forwardRef(({
|
|
|
272
279
|
}), [handleHide, handleShow]);
|
|
273
280
|
useEffect(() => {
|
|
274
281
|
const handleDocumentClick = event => {
|
|
275
|
-
|
|
282
|
+
const target = event.target;
|
|
283
|
+
const isInsideMenu = contextMenuContentRef.current?.contains(target);
|
|
284
|
+
if (isInsideMenu && (!shouldCloseOnPopupClick || target.closest('[aria-disabled="true"]'))) {
|
|
276
285
|
return;
|
|
277
286
|
}
|
|
278
287
|
handleHide();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.js","names":["createDialog","DialogType","AnimatePresence","React","forwardRef","isValidElement","useCallback","useEffect","useImperativeHandle","useRef","useState","createPortal","useUuid","useIsTouch","Icon","ContextMenuContent","StyledContextMenu","ContextMenuAlignment","getActiveItemIndex","getDefaultFocusedIndex","selectItem","useKeyboardFocusHighlighting","useFocusRingPortal","ContextMenu","alignment","className","children","createElement","icons","size","container","coordinates","headline","items","onHide","onShow","shouldCloseOnPopupClick","shouldDisableClick","shouldHidePopupArrow","shouldShowHoverEffect","shouldEnableKeyboardHighlighting","shouldUseDefaultTriggerStyles","style","yOffset","zIndex","dialogText","ref","internalCoordinates","setInternalCoordinates","x","y","internalAlignment","setInternalAlignment","TopLeft","newContainer","setNewContainer","focusedIndex","setFocusedIndex","isContentShown","setIsContentShown","portal","setPortal","isHovered","setIsHovered","shouldUseFocusableWrapper","setShouldUseFocusableWrapper","uuid","contextMenuContentRef","contextMenuRef","contextMenuFocusRingRef","shouldSkipNextContextMenuOpenRef","shouldPreventNextNativeContextMenuRef","isTouch","shouldShowKeyboardHighlighting","shouldShowWrapperKeyboardHighlighting","shouldUseKeyboardFocusableWrapper","isEnabled","overlayRef","shape","padding","current","firstElementChild","HTMLElement","el","element","closest","Element","handleHide","handleContainerBlur","event","nextFocusedElement","relatedTarget","currentContainer","currentTarget","contains","handleShow","result","type","SELECT","text","buttons","list","map","isSelected","index","name","id","icon","undefined","open","onClick","height","childrenHeight","left","childrenLeft","top","childrenTop","width","childrenWidth","getBoundingClientRect","zoomX","offsetWidth","zoomY","offsetHeight","scrollLeft","scrollTop","BottomRight","TopRight","BottomLeft","handleClick","preventDefault","stopPropagation","handleKeyDown","isActivationKey","key","prev","length","contextMenuContentElement","onClose","target","isContextMenuShortcut","shiftKey","handleContextMenu","handleGlobalKeyDown","activeElement","document","body","documentElement","shouldOpenFromFocusedParent","handleNativeContextMenuCapture","addEventListener","removeEventListener","hide","show","handleDocumentClick","window","initial","onItemFocus","onMouseEnter","onMouseLeave","focusableChildSelector","hasFocusableChild","Boolean","querySelector","Fragment","$isActive","$shouldAddHoverEffect","$shouldShowWrapperKeyboardHighlighting","$shouldUseDefaultTriggerStyles","onContextMenuCapture","onContextMenu","onKeyDown","onBlur","tabIndex","role","displayName"],"sources":["../../../../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["import { createDialog, DialogType } from 'chayns-api';\nimport { AnimatePresence } from 'motion/react';\nimport React, {\n forwardRef,\n isValidElement,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactPortal,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useUuid } from '../../hooks/uuid';\nimport { useIsTouch } from '../../utils/environment';\nimport Icon from '../icon/Icon';\nimport ContextMenuContent from './context-menu-content/ContextMenuContent';\nimport { StyledContextMenu } from './ContextMenu.styles';\nimport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './ContextMenu.types';\nimport { SelectDialogResult } from '../../types/general';\nimport { getActiveItemIndex, getDefaultFocusedIndex, selectItem } from './ContextMenu.utils';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { useFocusRingPortal } from '../../hooks/useFocusRingPortal';\n\nconst ContextMenu = forwardRef<ContextMenuRef, ContextMenuProps>(\n (\n {\n alignment,\n className,\n children = <Icon icons={['ts-ellipsis_v']} size={18} />,\n container,\n coordinates,\n headline,\n items,\n onHide,\n onShow,\n shouldCloseOnPopupClick = true,\n shouldDisableClick = false,\n shouldHidePopupArrow = false,\n shouldShowHoverEffect = false,\n shouldEnableKeyboardHighlighting,\n shouldUseDefaultTriggerStyles = true,\n style,\n yOffset = 0,\n zIndex = 20,\n dialogText,\n },\n ref,\n ) => {\n const [internalCoordinates, setInternalCoordinates] = useState<ContextMenuCoordinates>({\n x: 0,\n y: 0,\n });\n\n const [internalAlignment, setInternalAlignment] = useState<ContextMenuAlignment>(\n ContextMenuAlignment.TopLeft,\n );\n\n const [newContainer, setNewContainer] = useState(container ?? null);\n const [focusedIndex, setFocusedIndex] = useState(getDefaultFocusedIndex(items));\n const [isContentShown, setIsContentShown] = useState(false);\n const [portal, setPortal] = useState<ReactPortal>();\n const [isHovered, setIsHovered] = useState(false);\n const [shouldUseFocusableWrapper, setShouldUseFocusableWrapper] = useState(false);\n\n const uuid = useUuid();\n\n const contextMenuContentRef = useRef<HTMLDivElement>(null);\n const contextMenuRef = useRef<HTMLSpanElement>(null);\n const contextMenuFocusRingRef = useRef<HTMLElement | null>(null);\n const shouldSkipNextContextMenuOpenRef = useRef(false);\n const shouldPreventNextNativeContextMenuRef = useRef(false);\n\n const isTouch = useIsTouch();\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !shouldDisableClick,\n );\n const shouldShowWrapperKeyboardHighlighting =\n shouldShowKeyboardHighlighting && shouldUseFocusableWrapper;\n const shouldUseKeyboardFocusableWrapper = shouldUseFocusableWrapper && !shouldDisableClick;\n useFocusRingPortal(contextMenuRef, {\n isEnabled: shouldShowWrapperKeyboardHighlighting,\n overlayRef: contextMenuFocusRingRef,\n shape: shouldUseDefaultTriggerStyles ? 'circle' : 'rectangle',\n padding: shouldUseDefaultTriggerStyles ? 4 : 0,\n });\n\n useEffect(() => {\n contextMenuFocusRingRef.current =\n contextMenuRef.current?.firstElementChild instanceof HTMLElement\n ? contextMenuRef.current.firstElementChild\n : contextMenuRef.current;\n }, [children]);\n\n useEffect(() => {\n if (isContentShown) {\n setFocusedIndex(getDefaultFocusedIndex(items));\n }\n }, [isContentShown, items]);\n\n useEffect(() => {\n if (contextMenuRef.current && !container) {\n const el = contextMenuRef.current as HTMLElement;\n\n const element = el.closest('.dialog-inner, .page-provider, .tapp, body');\n\n setNewContainer(element);\n }\n }, [container]);\n\n useEffect(() => {\n if (container instanceof Element) {\n setNewContainer(container);\n }\n }, [container]);\n\n const handleHide = useCallback(() => {\n setIsContentShown(false);\n }, []);\n\n const handleContainerBlur = useCallback(\n (event: React.FocusEvent<HTMLSpanElement>) => {\n const nextFocusedElement = event.relatedTarget as Node | null;\n const currentContainer = event.currentTarget as HTMLElement;\n\n if (\n !nextFocusedElement ||\n (!currentContainer.contains(nextFocusedElement) &&\n !contextMenuContentRef.current?.contains(nextFocusedElement))\n ) {\n handleHide();\n }\n },\n [handleHide],\n );\n\n const handleShow = useCallback(async () => {\n if (isTouch) {\n const { result } = (await createDialog({\n type: DialogType.SELECT,\n text: dialogText,\n buttons: [],\n list: items.map(({ icons, text, isSelected }, index) => ({\n name: text,\n id: index,\n isSelected,\n icon: isValidElement(icons)\n ? undefined\n : (icons as string[] | undefined)?.[0],\n })),\n }).open()) as SelectDialogResult;\n\n if (result && typeof result[0] === 'number') {\n void items[result[0]]?.onClick();\n }\n } else if (contextMenuRef.current) {\n if (!newContainer) {\n return;\n }\n\n const {\n height: childrenHeight,\n left: childrenLeft,\n top: childrenTop,\n width: childrenWidth,\n } = contextMenuRef.current.getBoundingClientRect();\n\n const { height, width, top, left } = newContainer.getBoundingClientRect();\n\n const zoomX = width / (newContainer as HTMLElement).offsetWidth;\n const zoomY = height / (newContainer as HTMLElement).offsetHeight;\n\n const x =\n (childrenLeft + childrenWidth / 2 - left) / zoomX + newContainer.scrollLeft;\n const y =\n (childrenTop + childrenHeight / 2 - top) / zoomY +\n newContainer.scrollTop -\n yOffset;\n\n setInternalCoordinates({ x, y });\n\n if (x < width / 2) {\n if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomRight);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopRight);\n }\n } else if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomLeft);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopLeft);\n }\n\n setIsContentShown(true);\n }\n }, [isTouch, items, newContainer, yOffset, dialogText]);\n\n const handleClick = useCallback<MouseEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n const isActivationKey =\n event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';\n\n if (isContentShown && event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n handleHide();\n return;\n }\n\n if (isContentShown && !isHovered && event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n setFocusedIndex((prev) => (prev >= items.length - 1 ? 0 : prev + 1));\n return;\n }\n\n if (isContentShown && !isHovered && event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n setFocusedIndex((prev) => (prev <= 0 ? items.length - 1 : prev - 1));\n return;\n }\n\n if (isContentShown && isActivationKey) {\n if (\n selectItem({\n index: getActiveItemIndex({\n contextMenuContentElement: contextMenuContentRef.current,\n focusedIndex,\n }),\n items,\n onClose: handleHide,\n shouldCloseOnPopupClick,\n })\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n return;\n }\n\n if (event.currentTarget !== event.target) {\n return;\n }\n\n const isContextMenuShortcut =\n event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n\n if (isContextMenuShortcut) {\n event.preventDefault();\n event.stopPropagation();\n shouldSkipNextContextMenuOpenRef.current = true;\n void handleShow();\n return;\n }\n\n if (shouldUseFocusableWrapper && isActivationKey) {\n event.preventDefault();\n event.stopPropagation();\n void handleShow();\n }\n },\n [\n focusedIndex,\n handleHide,\n handleShow,\n isHovered,\n isContentShown,\n items,\n items.length,\n shouldCloseOnPopupClick,\n shouldDisableClick,\n shouldUseFocusableWrapper,\n ],\n );\n\n const handleContextMenu = useCallback(\n (event: MouseEvent<HTMLSpanElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (shouldDisableClick) {\n return;\n }\n\n if (shouldSkipNextContextMenuOpenRef.current) {\n shouldSkipNextContextMenuOpenRef.current = false;\n return;\n }\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n useEffect(() => {\n const handleGlobalKeyDown = (event: KeyboardEvent) => {\n if (shouldDisableClick || !contextMenuRef.current) {\n return;\n }\n\n const isContextMenuShortcut =\n event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n\n if (!isContextMenuShortcut) {\n return;\n }\n\n const { activeElement } = document;\n\n if (\n !(activeElement instanceof HTMLElement) ||\n activeElement === document.body ||\n activeElement === document.documentElement\n ) {\n return;\n }\n\n const shouldOpenFromFocusedParent =\n activeElement.contains(contextMenuRef.current) &&\n !contextMenuRef.current.contains(activeElement);\n\n if (!shouldOpenFromFocusedParent) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n shouldPreventNextNativeContextMenuRef.current = true;\n void handleShow();\n };\n\n const handleNativeContextMenuCapture = (event: Event) => {\n if (!shouldPreventNextNativeContextMenuRef.current) {\n return;\n }\n\n shouldPreventNextNativeContextMenuRef.current = false;\n event.preventDefault();\n event.stopPropagation();\n };\n\n document.addEventListener('keydown', handleGlobalKeyDown, true);\n document.addEventListener('contextmenu', handleNativeContextMenuCapture, true);\n\n return () => {\n document.removeEventListener('keydown', handleGlobalKeyDown, true);\n document.removeEventListener('contextmenu', handleNativeContextMenuCapture, true);\n };\n }, [handleShow, shouldDisableClick]);\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleHide,\n show: handleShow,\n }),\n [handleHide, handleShow],\n );\n\n useEffect(() => {\n const handleDocumentClick = (event: PointerEvent) => {\n if (\n !shouldCloseOnPopupClick &&\n contextMenuContentRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n handleHide();\n };\n\n if (isContentShown) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n\n if (typeof onShow === 'function') {\n onShow();\n }\n } else if (typeof onHide === 'function') {\n onHide();\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleHide, isContentShown, onHide, onShow, shouldCloseOnPopupClick]);\n\n useEffect(() => {\n if (!newContainer) {\n return;\n }\n\n setPortal(() =>\n createPortal(\n <AnimatePresence initial={false}>\n {isContentShown && (\n <ContextMenuContent\n coordinates={coordinates ?? internalCoordinates}\n items={items}\n zIndex={zIndex}\n headline={headline}\n shouldHidePopupArrow={shouldHidePopupArrow}\n key={`contextMenu_${uuid}`}\n alignment={alignment ?? internalAlignment}\n ref={contextMenuContentRef}\n focusedIndex={focusedIndex}\n onItemFocus={setFocusedIndex}\n onMouseEnter={() => {\n setIsHovered(true);\n setFocusedIndex(-1);\n }}\n onMouseLeave={() => {\n setIsHovered(false);\n }}\n />\n )}\n </AnimatePresence>,\n newContainer,\n ),\n );\n }, [\n alignment,\n newContainer,\n coordinates,\n internalAlignment,\n internalCoordinates,\n isContentShown,\n items,\n uuid,\n zIndex,\n shouldHidePopupArrow,\n headline,\n focusedIndex,\n handleHide,\n ]);\n\n useEffect(() => {\n if (!contextMenuRef.current) {\n return;\n }\n\n const focusableChildSelector =\n 'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\n const hasFocusableChild = Boolean(\n contextMenuRef.current.querySelector(focusableChildSelector),\n );\n\n setShouldUseFocusableWrapper(!hasFocusableChild);\n }, [children]);\n\n return (\n <>\n <StyledContextMenu\n className={\n className\n ? `beta-chayns-context-menu ${className}`\n : 'beta-chayns-context-menu'\n }\n $isActive={isContentShown && shouldShowHoverEffect}\n $shouldAddHoverEffect={!isTouch && shouldShowHoverEffect}\n $shouldShowWrapperKeyboardHighlighting={shouldShowWrapperKeyboardHighlighting}\n $shouldUseDefaultTriggerStyles={shouldUseDefaultTriggerStyles}\n onClick={handleClick}\n onContextMenuCapture={handleContextMenu}\n onContextMenu={handleContextMenu}\n onKeyDown={handleKeyDown}\n onBlur={handleContainerBlur}\n ref={contextMenuRef}\n tabIndex={shouldUseKeyboardFocusableWrapper ? 0 : undefined}\n role={shouldUseKeyboardFocusableWrapper ? 'button' : undefined}\n aria-haspopup={shouldUseKeyboardFocusableWrapper ? 'menu' : undefined}\n aria-expanded={shouldUseKeyboardFocusableWrapper ? isContentShown : undefined}\n style={style}\n >\n {children}\n </StyledContextMenu>\n {portal}\n </>\n );\n },\n);\n\nContextMenu.displayName = 'ContextMenu';\n\nexport default ContextMenu;\n"],"mappings":"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,"file":"ContextMenu.js","names":["createDialog","DialogType","AnimatePresence","React","forwardRef","isValidElement","useCallback","useEffect","useImperativeHandle","useRef","useState","createPortal","useUuid","useIsTouch","Icon","ContextMenuContent","StyledContextMenu","ContextMenuAlignment","getActiveItemIndex","getDefaultFocusedIndex","selectItem","useKeyboardFocusHighlighting","useFocusRingPortal","ContextMenu","alignment","className","children","createElement","icons","size","container","coordinates","headline","items","onHide","onShow","shouldCloseOnPopupClick","shouldDisableClick","shouldHidePopupArrow","shouldShowHoverEffect","shouldEnableKeyboardHighlighting","shouldUseDefaultTriggerStyles","style","yOffset","zIndex","dialogText","ref","internalCoordinates","setInternalCoordinates","x","y","internalAlignment","setInternalAlignment","TopLeft","newContainer","setNewContainer","focusedIndex","setFocusedIndex","isContentShown","setIsContentShown","portal","setPortal","isHovered","setIsHovered","shouldUseFocusableWrapper","setShouldUseFocusableWrapper","uuid","contextMenuContentRef","contextMenuRef","contextMenuFocusRingRef","shouldSkipNextContextMenuOpenRef","shouldPreventNextNativeContextMenuRef","isTouch","shouldShowKeyboardHighlighting","shouldShowWrapperKeyboardHighlighting","shouldUseKeyboardFocusableWrapper","isEnabled","overlayRef","shape","padding","current","firstElementChild","HTMLElement","el","element","closest","Element","handleHide","handleContainerBlur","event","nextFocusedElement","relatedTarget","currentContainer","currentTarget","contains","handleShow","result","type","SELECT","text","buttons","list","map","isSelected","isDisabled","disabledReason","index","name","id","disabled","subtitle","undefined","icon","open","item","onClick","height","childrenHeight","left","childrenLeft","top","childrenTop","width","childrenWidth","getBoundingClientRect","zoomX","offsetWidth","zoomY","offsetHeight","scrollLeft","scrollTop","BottomRight","TopRight","BottomLeft","handleClick","preventDefault","stopPropagation","handleKeyDown","isActivationKey","key","prev","length","contextMenuContentElement","onClose","target","isContextMenuShortcut","shiftKey","handleContextMenu","handleGlobalKeyDown","activeElement","document","body","documentElement","shouldOpenFromFocusedParent","handleNativeContextMenuCapture","addEventListener","removeEventListener","hide","show","handleDocumentClick","isInsideMenu","window","initial","onItemFocus","onMouseEnter","onMouseLeave","focusableChildSelector","hasFocusableChild","Boolean","querySelector","Fragment","$isActive","$shouldAddHoverEffect","$shouldShowWrapperKeyboardHighlighting","$shouldUseDefaultTriggerStyles","onContextMenuCapture","onContextMenu","onKeyDown","onBlur","tabIndex","role","displayName"],"sources":["../../../../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["import { createDialog, DialogType } from 'chayns-api';\nimport { AnimatePresence } from 'motion/react';\nimport React, {\n forwardRef,\n isValidElement,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactPortal,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useUuid } from '../../hooks/uuid';\nimport { useIsTouch } from '../../utils/environment';\nimport Icon from '../icon/Icon';\nimport ContextMenuContent from './context-menu-content/ContextMenuContent';\nimport { StyledContextMenu } from './ContextMenu.styles';\nimport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './ContextMenu.types';\nimport { SelectDialogResult } from '../../types/general';\nimport { getActiveItemIndex, getDefaultFocusedIndex, selectItem } from './ContextMenu.utils';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { useFocusRingPortal } from '../../hooks/useFocusRingPortal';\n\nconst ContextMenu = forwardRef<ContextMenuRef, ContextMenuProps>(\n (\n {\n alignment,\n className,\n children = <Icon icons={['ts-ellipsis_v']} size={18} />,\n container,\n coordinates,\n headline,\n items,\n onHide,\n onShow,\n shouldCloseOnPopupClick = true,\n shouldDisableClick = false,\n shouldHidePopupArrow = false,\n shouldShowHoverEffect = false,\n shouldEnableKeyboardHighlighting,\n shouldUseDefaultTriggerStyles = true,\n style,\n yOffset = 0,\n zIndex = 20,\n dialogText,\n },\n ref,\n ) => {\n const [internalCoordinates, setInternalCoordinates] = useState<ContextMenuCoordinates>({\n x: 0,\n y: 0,\n });\n\n const [internalAlignment, setInternalAlignment] = useState<ContextMenuAlignment>(\n ContextMenuAlignment.TopLeft,\n );\n\n const [newContainer, setNewContainer] = useState(container ?? null);\n const [focusedIndex, setFocusedIndex] = useState(getDefaultFocusedIndex(items));\n const [isContentShown, setIsContentShown] = useState(false);\n const [portal, setPortal] = useState<ReactPortal>();\n const [isHovered, setIsHovered] = useState(false);\n const [shouldUseFocusableWrapper, setShouldUseFocusableWrapper] = useState(false);\n\n const uuid = useUuid();\n\n const contextMenuContentRef = useRef<HTMLDivElement>(null);\n const contextMenuRef = useRef<HTMLSpanElement>(null);\n const contextMenuFocusRingRef = useRef<HTMLElement | null>(null);\n const shouldSkipNextContextMenuOpenRef = useRef(false);\n const shouldPreventNextNativeContextMenuRef = useRef(false);\n\n const isTouch = useIsTouch();\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !shouldDisableClick,\n );\n const shouldShowWrapperKeyboardHighlighting =\n shouldShowKeyboardHighlighting && shouldUseFocusableWrapper;\n const shouldUseKeyboardFocusableWrapper = shouldUseFocusableWrapper && !shouldDisableClick;\n useFocusRingPortal(contextMenuRef, {\n isEnabled: shouldShowWrapperKeyboardHighlighting,\n overlayRef: contextMenuFocusRingRef,\n shape: shouldUseDefaultTriggerStyles ? 'circle' : 'rectangle',\n padding: shouldUseDefaultTriggerStyles ? 4 : 0,\n });\n\n useEffect(() => {\n contextMenuFocusRingRef.current =\n contextMenuRef.current?.firstElementChild instanceof HTMLElement\n ? contextMenuRef.current.firstElementChild\n : contextMenuRef.current;\n }, [children]);\n\n useEffect(() => {\n if (isContentShown) {\n setFocusedIndex(getDefaultFocusedIndex(items));\n }\n }, [isContentShown, items]);\n\n useEffect(() => {\n if (contextMenuRef.current && !container) {\n const el = contextMenuRef.current as HTMLElement;\n\n const element = el.closest('.dialog-inner, .page-provider, .tapp, body');\n\n setNewContainer(element);\n }\n }, [container]);\n\n useEffect(() => {\n if (container instanceof Element) {\n setNewContainer(container);\n }\n }, [container]);\n\n const handleHide = useCallback(() => {\n setIsContentShown(false);\n }, []);\n\n const handleContainerBlur = useCallback(\n (event: React.FocusEvent<HTMLSpanElement>) => {\n const nextFocusedElement = event.relatedTarget as Node | null;\n const currentContainer = event.currentTarget as HTMLElement;\n\n if (\n !nextFocusedElement ||\n (!currentContainer.contains(nextFocusedElement) &&\n !contextMenuContentRef.current?.contains(nextFocusedElement))\n ) {\n handleHide();\n }\n },\n [handleHide],\n );\n\n const handleShow = useCallback(async () => {\n if (isTouch) {\n const { result } = (await createDialog({\n type: DialogType.SELECT,\n text: dialogText,\n buttons: [],\n list: items.map(\n ({ icons, text, isSelected, isDisabled, disabledReason }, index) => ({\n name: text,\n id: index,\n isSelected,\n disabled: isDisabled,\n subtitle: isDisabled ? disabledReason : undefined,\n icon: isValidElement(icons)\n ? undefined\n : (icons as string[] | undefined)?.[0],\n }),\n ),\n }).open()) as SelectDialogResult;\n\n if (result && typeof result[0] === 'number') {\n const item = items[result[0]];\n\n if (item && !item.isDisabled) {\n void item.onClick();\n }\n }\n } else if (contextMenuRef.current) {\n if (!newContainer) {\n return;\n }\n\n const {\n height: childrenHeight,\n left: childrenLeft,\n top: childrenTop,\n width: childrenWidth,\n } = contextMenuRef.current.getBoundingClientRect();\n\n const { height, width, top, left } = newContainer.getBoundingClientRect();\n\n const zoomX = width / (newContainer as HTMLElement).offsetWidth;\n const zoomY = height / (newContainer as HTMLElement).offsetHeight;\n\n const x =\n (childrenLeft + childrenWidth / 2 - left) / zoomX + newContainer.scrollLeft;\n const y =\n (childrenTop + childrenHeight / 2 - top) / zoomY +\n newContainer.scrollTop -\n yOffset;\n\n setInternalCoordinates({ x, y });\n\n if (x < width / 2) {\n if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomRight);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopRight);\n }\n } else if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomLeft);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopLeft);\n }\n\n setIsContentShown(true);\n }\n }, [isTouch, items, newContainer, yOffset, dialogText]);\n\n const handleClick = useCallback<MouseEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n const isActivationKey =\n event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';\n\n if (isContentShown && event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n handleHide();\n return;\n }\n\n if (isContentShown && !isHovered && event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n setFocusedIndex((prev) => (prev >= items.length - 1 ? 0 : prev + 1));\n return;\n }\n\n if (isContentShown && !isHovered && event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n setFocusedIndex((prev) => (prev <= 0 ? items.length - 1 : prev - 1));\n return;\n }\n\n if (isContentShown && isActivationKey) {\n if (\n selectItem({\n index: getActiveItemIndex({\n contextMenuContentElement: contextMenuContentRef.current,\n focusedIndex,\n }),\n items,\n onClose: handleHide,\n shouldCloseOnPopupClick,\n })\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n return;\n }\n\n if (event.currentTarget !== event.target) {\n return;\n }\n\n const isContextMenuShortcut =\n event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n\n if (isContextMenuShortcut) {\n event.preventDefault();\n event.stopPropagation();\n shouldSkipNextContextMenuOpenRef.current = true;\n void handleShow();\n return;\n }\n\n if (shouldUseFocusableWrapper && isActivationKey) {\n event.preventDefault();\n event.stopPropagation();\n void handleShow();\n }\n },\n [\n focusedIndex,\n handleHide,\n handleShow,\n isHovered,\n isContentShown,\n items,\n shouldCloseOnPopupClick,\n shouldDisableClick,\n shouldUseFocusableWrapper,\n ],\n );\n\n const handleContextMenu = useCallback(\n (event: MouseEvent<HTMLSpanElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (shouldDisableClick) {\n return;\n }\n\n if (shouldSkipNextContextMenuOpenRef.current) {\n shouldSkipNextContextMenuOpenRef.current = false;\n return;\n }\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n useEffect(() => {\n const handleGlobalKeyDown = (event: KeyboardEvent) => {\n if (shouldDisableClick || !contextMenuRef.current) {\n return;\n }\n\n const isContextMenuShortcut =\n event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n\n if (!isContextMenuShortcut) {\n return;\n }\n\n const { activeElement } = document;\n\n if (\n !(activeElement instanceof HTMLElement) ||\n activeElement === document.body ||\n activeElement === document.documentElement\n ) {\n return;\n }\n\n const shouldOpenFromFocusedParent =\n activeElement.contains(contextMenuRef.current) &&\n !contextMenuRef.current.contains(activeElement);\n\n if (!shouldOpenFromFocusedParent) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n shouldPreventNextNativeContextMenuRef.current = true;\n void handleShow();\n };\n\n const handleNativeContextMenuCapture = (event: Event) => {\n if (!shouldPreventNextNativeContextMenuRef.current) {\n return;\n }\n\n shouldPreventNextNativeContextMenuRef.current = false;\n event.preventDefault();\n event.stopPropagation();\n };\n\n document.addEventListener('keydown', handleGlobalKeyDown, true);\n document.addEventListener('contextmenu', handleNativeContextMenuCapture, true);\n\n return () => {\n document.removeEventListener('keydown', handleGlobalKeyDown, true);\n document.removeEventListener('contextmenu', handleNativeContextMenuCapture, true);\n };\n }, [handleShow, shouldDisableClick]);\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleHide,\n show: handleShow,\n }),\n [handleHide, handleShow],\n );\n\n useEffect(() => {\n const handleDocumentClick = (event: PointerEvent) => {\n const target = event.target as Element;\n const isInsideMenu = contextMenuContentRef.current?.contains(target);\n\n if (\n isInsideMenu &&\n (!shouldCloseOnPopupClick || target.closest('[aria-disabled=\"true\"]'))\n ) {\n return;\n }\n\n handleHide();\n };\n\n if (isContentShown) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n\n if (typeof onShow === 'function') {\n onShow();\n }\n } else if (typeof onHide === 'function') {\n onHide();\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleHide, isContentShown, onHide, onShow, shouldCloseOnPopupClick]);\n\n useEffect(() => {\n if (!newContainer) {\n return;\n }\n\n setPortal(() =>\n createPortal(\n <AnimatePresence initial={false}>\n {isContentShown && (\n <ContextMenuContent\n coordinates={coordinates ?? internalCoordinates}\n items={items}\n zIndex={zIndex}\n headline={headline}\n shouldHidePopupArrow={shouldHidePopupArrow}\n key={`contextMenu_${uuid}`}\n alignment={alignment ?? internalAlignment}\n ref={contextMenuContentRef}\n focusedIndex={focusedIndex}\n onItemFocus={setFocusedIndex}\n onMouseEnter={() => {\n setIsHovered(true);\n setFocusedIndex(-1);\n }}\n onMouseLeave={() => {\n setIsHovered(false);\n }}\n />\n )}\n </AnimatePresence>,\n newContainer,\n ),\n );\n }, [\n alignment,\n newContainer,\n coordinates,\n internalAlignment,\n internalCoordinates,\n isContentShown,\n items,\n uuid,\n zIndex,\n shouldHidePopupArrow,\n headline,\n focusedIndex,\n handleHide,\n ]);\n\n useEffect(() => {\n if (!contextMenuRef.current) {\n return;\n }\n\n const focusableChildSelector =\n 'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\n const hasFocusableChild = Boolean(\n contextMenuRef.current.querySelector(focusableChildSelector),\n );\n\n setShouldUseFocusableWrapper(!hasFocusableChild);\n }, [children]);\n\n return (\n <>\n <StyledContextMenu\n className={\n className\n ? `beta-chayns-context-menu ${className}`\n : 'beta-chayns-context-menu'\n }\n $isActive={isContentShown && shouldShowHoverEffect}\n $shouldAddHoverEffect={!isTouch && shouldShowHoverEffect}\n $shouldShowWrapperKeyboardHighlighting={shouldShowWrapperKeyboardHighlighting}\n $shouldUseDefaultTriggerStyles={shouldUseDefaultTriggerStyles}\n onClick={handleClick}\n onContextMenuCapture={handleContextMenu}\n onContextMenu={handleContextMenu}\n onKeyDown={handleKeyDown}\n onBlur={handleContainerBlur}\n ref={contextMenuRef}\n tabIndex={shouldUseKeyboardFocusableWrapper ? 0 : undefined}\n role={shouldUseKeyboardFocusableWrapper ? 'button' : undefined}\n aria-haspopup={shouldUseKeyboardFocusableWrapper ? 'menu' : undefined}\n aria-expanded={shouldUseKeyboardFocusableWrapper ? isContentShown : undefined}\n style={style}\n >\n {children}\n </StyledContextMenu>\n {portal}\n </>\n );\n },\n);\n\nContextMenu.displayName = 'ContextMenu';\n\nexport default ContextMenu;\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,UAAU,QAAQ,YAAY;AACrD,SAASC,eAAe,QAAQ,cAAc;AAC9C,OAAOC,KAAK,IACRC,UAAU,EACVC,cAAc,EAKdC,WAAW,EACXC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,UAAU,QAAQ,yBAAyB;AACpD,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,kBAAkB,MAAM,2CAA2C;AAC1E,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SACIC,oBAAoB,QAIjB,qBAAqB;AAE5B,SAASC,kBAAkB,EAAEC,sBAAsB,EAAEC,UAAU,QAAQ,qBAAqB;AAC5F,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SAASC,kBAAkB,QAAQ,gCAAgC;AAEnE,MAAMC,WAAW,gBAAGnB,UAAU,CAC1B,CACI;EACIoB,SAAS;EACTC,SAAS;EACTC,QAAQ,gBAAGvB,KAAA,CAAAwB,aAAA,CAACb,IAAI;IAACc,KAAK,EAAE,CAAC,eAAe,CAAE;I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