@chayns-components/core 5.0.0-beta.1245 → 5.0.0-beta.1247

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.
Files changed (58) hide show
  1. package/lib/cjs/components/combobox/ComboBox.js +7 -3
  2. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  3. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js +17 -37
  4. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  5. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +1 -44
  6. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  7. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +42 -0
  8. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -0
  9. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.styles.js +15 -0
  10. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.styles.js.map +1 -0
  11. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +40 -0
  12. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -0
  13. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.styles.js +40 -0
  14. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.styles.js.map +1 -0
  15. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +53 -0
  16. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -0
  17. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.styles.js +60 -0
  18. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.styles.js.map +1 -0
  19. package/lib/cjs/index.js.map +1 -1
  20. package/lib/esm/components/combobox/ComboBox.js +8 -4
  21. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  22. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +19 -39
  23. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  24. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +0 -43
  25. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  26. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +35 -0
  27. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -0
  28. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.styles.js +8 -0
  29. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.styles.js.map +1 -0
  30. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +33 -0
  31. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -0
  32. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.styles.js +33 -0
  33. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.styles.js.map +1 -0
  34. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +46 -0
  35. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -0
  36. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.styles.js +53 -0
  37. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.styles.js.map +1 -0
  38. package/lib/esm/index.js.map +1 -1
  39. package/lib/types/components/combobox/ComboBox.d.ts +6 -2
  40. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +0 -10
  41. package/lib/types/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.d.ts +7 -0
  42. package/lib/types/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.styles.d.ts +1 -0
  43. package/lib/types/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.d.ts +9 -0
  44. package/lib/types/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.styles.d.ts +8 -0
  45. package/lib/types/components/list/list-item/list-item-head/list-item-title/ListItemTitle.d.ts +12 -0
  46. package/lib/types/components/list/list-item/list-item-head/list-item-title/ListItemTitle.styles.d.ts +11 -0
  47. package/lib/types/index.d.ts +1 -1
  48. package/package.json +2 -2
  49. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.js +0 -64
  50. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.js.map +0 -1
  51. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.styles.js +0 -58
  52. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.styles.js.map +0 -1
  53. package/lib/esm/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.js +0 -57
  54. package/lib/esm/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.js.map +0 -1
  55. package/lib/esm/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.styles.js +0 -51
  56. package/lib/esm/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.styles.js.map +0 -1
  57. package/lib/types/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.d.ts +0 -8
  58. package/lib/types/components/list/list-item/list-item-head/list-item-right-elements/ListItemRightElements.styles.d.ts +0 -14
@@ -17,7 +17,7 @@ var _dropdown = require("../../types/dropdown");
17
17
  var _element = require("../../hooks/element");
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
- const ComboBox = ({
20
+ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
21
21
  bodyWidth,
22
22
  direction = _dropdown.DropdownDirection.RIGHT,
23
23
  isDisabled = false,
@@ -39,7 +39,7 @@ const ComboBox = ({
39
39
  shouldShowTransparentBackground = false,
40
40
  inputValue,
41
41
  shouldDropDownUseMaxItemWidth = false
42
- }) => {
42
+ }, ref) => {
43
43
  const [internalSelectedItem, setInternalSelectedItem] = (0, _react.useState)();
44
44
  const [isAnimating, setIsAnimating] = (0, _react.useState)(false);
45
45
  const [minWidth, setMinWidth] = (0, _react.useState)(undefined);
@@ -288,6 +288,10 @@ const ComboBox = ({
288
288
  }
289
289
  }
290
290
  }, [handleClose, handleOpen, isAnimating, isDisabled]);
291
+ (0, _react.useImperativeHandle)(ref, () => ({
292
+ hide: handleClose,
293
+ show: handleOpen
294
+ }), [handleClose, handleOpen]);
291
295
  const comboBoxGroups = (0, _react.useMemo)(() => lists.map(list => /*#__PURE__*/_react.default.createElement(_react.Fragment, {
292
296
  key: list.groupName ?? 'default-group'
293
297
  }, list.groupName && lists.length > 1 && /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxTopic, {
@@ -354,7 +358,7 @@ const ComboBox = ({
354
358
  ref: contentRef,
355
359
  tabIndex: 0
356
360
  }, comboBoxGroups))), [minWidth, shouldUseFullWidth, shouldUseCurrentItemWidth, direction, handleHeaderClick, isAnimating, isTouch, shouldShowTransparentBackground, isDisabled, shouldChangeColor, shouldShowBigImage, prefix, selectedItem, internalSelectedItem, placeholderImageUrl, shouldShowRoundPlaceholderImage, placeholderIcon, inputValue, onInputChange, handleInputBlur, handleInputFocus, placeholderText, shouldShowClearIcon, handleClear, shouldDisableActions, bodyWidth, contentHeight, handleClose, container, bodyMinWidth, maxHeight, browser === null || browser === void 0 ? void 0 : browser.name, comboBoxGroups]);
357
- };
361
+ });
358
362
  ComboBox.displayName = 'ComboBox';
359
363
  var _default = exports.default = ComboBox;
360
364
  //# sourceMappingURL=ComboBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_calculate","_environment","_AreaContextProvider","_Icon","_interopRequireDefault","_ComboBoxItem","_ComboBox","_DropdownBodyWrapper","_dropdown","_element","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ComboBox","bodyWidth","direction","DropdownDirection","RIGHT","isDisabled","lists","maxHeight","onSelect","placeholder","prefix","container","selectedItem","shouldShowBigImage","shouldShowClearIcon","shouldShowRoundImage","onInputFocus","shouldUseFullWidth","onInputChange","shouldUseCurrentItemWidth","onInputBlur","shouldShowTransparentBackground","inputValue","shouldDropDownUseMaxItemWidth","internalSelectedItem","setInternalSelectedItem","useState","isAnimating","setIsAnimating","minWidth","setMinWidth","undefined","bodyMinWidth","setBodyMinWidth","focusedIndex","setFocusedIndex","isInputFocused","useRef","styledComboBoxElementRef","contentRef","parentSize","useElementSize","shouldUseParentElement","functions","useFunctions","values","useValues","isTouch","getIsTouch","browser","useDevice","areaProvider","useContext","AreaContext","useEffect","width","shouldChangeColor","useMemo","shouldDisableActions","combinedLists","flatMap","list","length","some","item","value","contentHeight","flatItems","result","handleInputFocus","useCallback","event","current","handleInputBlur","handleOpen","handleClose","handleSetSelectedItem","itemToSelect","onSelectResult","Promise","then","shouldPreventSelection","handleClear","preventDefault","stopPropagation","handleKeyDown","key","_contentRef$current","children","stepDirection","newIndex","attempts","newElement","shouldSkip","id","startsWith","endsWith","prevElement","tabIndex","focusedElement","focus","_contentRef$current2","element","newSelectedItem","find","String","replace","document","addEventListener","removeEventListener","_styledComboBoxElemen","allItems","baseWidth","calculateContentWidth","text","hasImage","imageUrl","hasIcon","icons","parentWidth","parentElement","getBoundingClientRect","paddingWidth","imageWidth","iconWidth","prefixWidth","prefixTextWidth","Math","max","calculatedWidth","tmpMinWidth","tmpBodyMinWidth","itemWidth","placeholderImageUrl","placeholderIcon","placeholderText","shouldShowRoundPlaceholderImage","selectedItemList","handleHeaderClick","comboBoxGroups","map","createElement","Fragment","groupName","StyledComboBoxTopic","isSelected","StyledComboBox","ref","$minWidth","$shouldUseFullWidth","$shouldUseCurrentItemWidth","StyledComboBoxHeader","$direction","onClick","$isOpen","$isTouch","$shouldShowTransparentBackground","$isDisabled","$shouldChangeColor","$shouldShowBigImage","StyledComboBoxPrefixAndPlaceholderWrapper","StyledComboBoxPrefix","StyledComboBoxPlaceholder","$shouldReduceOpacity","StyledComboBoxPlaceholderImage","src","$shouldShowRoundImage","StyledComboBoxInput","disabled","onChange","onBlur","onFocus","StyledComboBoxPlaceholderText","suffixElement","StyledComboBoxClearIconWrapper","StyledComboBoxIconWrapper","$shouldShowBorderLeft","anchorElement","onClose","shouldShowDropdown","minBodyWidth","StyledComboBoxBody","$maxHeight","$browser","name","displayName","_default","exports"],"sources":["../../../../src/components/combobox/ComboBox.tsx"],"sourcesContent":["import { useDevice, useFunctions, useValues } from 'chayns-api';\nimport React, {\n ChangeEventHandler,\n type CSSProperties,\n FC,\n FocusEventHandler,\n Fragment,\n ReactHTML,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { BrowserName } from '../../types/chayns';\nimport { calculateContentWidth } from '../../utils/calculate';\nimport { getIsTouch } from '../../utils/environment';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport Icon from '../icon/Icon';\nimport ComboBoxItem from './combobox-item/ComboBoxItem';\nimport {\n StyledComboBox,\n StyledComboBoxBody,\n StyledComboBoxClearIconWrapper,\n StyledComboBoxHeader,\n StyledComboBoxIconWrapper,\n StyledComboBoxInput,\n StyledComboBoxPlaceholder,\n StyledComboBoxPlaceholderImage,\n StyledComboBoxPlaceholderText,\n StyledComboBoxPrefix,\n StyledComboBoxPrefixAndPlaceholderWrapper,\n StyledComboBoxTopic,\n} from './ComboBox.styles';\nimport DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';\nimport { DropdownDirection } from '../../types/dropdown';\nimport { useElementSize } from '../../hooks/element';\n\nexport interface IComboBoxItems {\n groupName?: string;\n list: Array<IComboBoxItem>;\n shouldShowRoundImage?: boolean;\n}\n\nexport interface ComboBoxTextStyles {\n tagName?: keyof ReactHTML;\n styles?: CSSProperties;\n}\n\nexport interface IComboBoxItem {\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n imageUrl?: string;\n isDisabled?: boolean;\n rightElement?: ReactNode;\n subtext?: string;\n suffixElement?: ReactNode;\n text: string;\n value: string | number;\n textStyles?: ComboBoxTextStyles;\n}\n\nexport type ComboBoxProps = {\n /**\n * The width of the body.\n */\n bodyWidth?: number;\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n */\n container?: Element;\n /**\n * The direction in which the combobox should open.\n */\n direction?: DropdownDirection;\n /**\n * The value of the optional input.\n */\n inputValue?: string;\n /**\n * Whether the combobox should be disabled.\n */\n isDisabled?: boolean;\n /**\n * The list of the items that should be displayed.\n */\n lists: IComboBoxItems[];\n /**\n * The maximum height of the combobox content.\n */\n maxHeight?: number;\n /**\n * Function to be executed when the value of the optional input is changed.\n */\n onInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input lost its focus.\n */\n onInputBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input gets its focus.\n */\n onInputFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.\n */\n onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;\n /**\n * A text that should be displayed when no item is selected.\n */\n placeholder: string;\n /**\n * A prefix that should be displayed before the placeholder.\n */\n prefix?: string;\n /**\n * An item that should be preselected.\n */\n selectedItem?: IComboBoxItem;\n /**\n * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.\n */\n shouldShowBigImage?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the combo box if an item is selected.\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether the background should be transparent.\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the width of the ComboBox should be the width of the current item.\n */\n shouldUseCurrentItemWidth?: boolean;\n /**\n * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.\n */\n shouldUseFullWidth?: boolean;\n /**\n * If true, the dropdown will use the maximum width of the items.\n */\n shouldDropDownUseMaxItemWidth?: boolean;\n};\n\nconst ComboBox: FC<ComboBoxProps> = ({\n bodyWidth,\n direction = DropdownDirection.RIGHT,\n isDisabled = false,\n lists,\n maxHeight = 280,\n onSelect,\n placeholder,\n prefix,\n container,\n selectedItem,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldShowRoundImage,\n onInputFocus,\n shouldUseFullWidth = false,\n onInputChange,\n shouldUseCurrentItemWidth = false,\n onInputBlur,\n shouldShowTransparentBackground = false,\n inputValue,\n shouldDropDownUseMaxItemWidth = false,\n}) => {\n const [internalSelectedItem, setInternalSelectedItem] = useState<IComboBoxItem>();\n const [isAnimating, setIsAnimating] = useState(false);\n const [minWidth, setMinWidth] = useState<number | undefined>(undefined);\n const [bodyMinWidth, setBodyMinWidth] = useState(0);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n\n const isInputFocused = useRef(false);\n\n const styledComboBoxElementRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const parentSize = useElementSize(styledComboBoxElementRef, { shouldUseParentElement: true });\n\n const functions = useFunctions();\n const values = useValues();\n\n const isTouch = getIsTouch();\n\n const { browser } = useDevice();\n\n const areaProvider = useContext(AreaContext);\n\n useEffect(() => {\n if (shouldUseFullWidth && parentSize) {\n setMinWidth(parentSize.width);\n }\n }, [parentSize, shouldUseFullWidth]);\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n const shouldDisableActions = useMemo(() => {\n if (!selectedItem) {\n return false;\n }\n\n const combinedLists = lists.flatMap((list) => list.list);\n\n return (\n combinedLists.length === 1 &&\n combinedLists.some((item) => item.value === selectedItem.value)\n );\n }, [lists, selectedItem]);\n\n const contentHeight = useMemo(() => {\n const flatItems = lists.flatMap((list) => list.list);\n\n let result = flatItems.length * 36;\n\n if (lists.length > 1) {\n result += lists.length * 36;\n }\n\n if (maxHeight < result) {\n result = maxHeight;\n }\n\n return result;\n }, [lists, maxHeight]);\n\n const handleInputFocus: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = true;\n onInputFocus?.(event);\n },\n [onInputFocus],\n );\n\n const handleInputBlur: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = false;\n onInputBlur?.(event);\n },\n [onInputBlur],\n );\n\n const handleOpen = useCallback(() => {\n setIsAnimating(true);\n }, []);\n\n const handleClose = useCallback(() => {\n setIsAnimating(false);\n }, []);\n\n /**\n * This function sets the selected item\n */\n const handleSetSelectedItem = useCallback(\n (itemToSelect?: IComboBoxItem) => {\n if (typeof onSelect === 'function') {\n const onSelectResult = onSelect(itemToSelect);\n\n if (onSelectResult === false) {\n return;\n }\n\n if (onSelectResult instanceof Promise) {\n void onSelectResult.then((shouldPreventSelection) => {\n if (shouldPreventSelection) return;\n\n setInternalSelectedItem(itemToSelect);\n setIsAnimating(false);\n });\n\n return;\n }\n }\n\n setInternalSelectedItem(itemToSelect);\n setIsAnimating(false);\n },\n [onSelect],\n );\n\n const handleClear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n handleSetSelectedItem(undefined);\n },\n [handleSetSelectedItem],\n );\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!isAnimating) return;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n\n const children = contentRef.current?.children;\n\n if (!children || children.length === 0) return;\n\n const stepDirection = e.key === 'ArrowUp' ? -1 : 1;\n\n let newIndex = focusedIndex ?? -1;\n\n let attempts = 0;\n\n do {\n newIndex = (newIndex + stepDirection + children.length) % children.length;\n\n const newElement = children[newIndex] as HTMLDivElement;\n\n let shouldSkip = false;\n\n if (\n newElement.id.startsWith('combobox-group--') ||\n newElement.id.endsWith('--disabled-item')\n ) {\n shouldSkip = true;\n }\n\n if (!shouldSkip) break;\n\n attempts++;\n } while (attempts < children.length);\n\n if (focusedIndex !== null) {\n const prevElement = children[focusedIndex] as HTMLDivElement;\n\n prevElement.tabIndex = -1;\n }\n\n setFocusedIndex(newIndex);\n\n const focusedElement = children[newIndex] as HTMLDivElement;\n\n focusedElement.tabIndex = 0;\n\n focusedElement.focus();\n } else if (e.key === 'Enter' && focusedIndex !== null) {\n const element = contentRef.current?.children[focusedIndex];\n\n if (!element) return;\n\n const { id } = element;\n\n let newSelectedItem: IComboBoxItem | undefined;\n\n lists.some((list) => {\n newSelectedItem = list.list.find(\n ({ value }) => String(value) === id.replace('combobox-item__', ''),\n );\n\n return !!newSelectedItem;\n });\n\n if (newSelectedItem) {\n handleSetSelectedItem(newSelectedItem);\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [focusedIndex, handleSetSelectedItem, isAnimating, lists]);\n\n /**\n * This function calculates the greatest width\n */\n useEffect(() => {\n const allItems = lists.flatMap((list) => list.list);\n\n let baseWidth = calculateContentWidth(\n [\n ...allItems,\n { text: placeholder, value: 'placeholder' },\n ...(selectedItem ? [selectedItem] : []),\n ],\n functions,\n values,\n );\n\n if (shouldDropDownUseMaxItemWidth) {\n baseWidth += 20 + 2; // 20px padding left and right and 2px border\n setBodyMinWidth(baseWidth);\n setMinWidth(baseWidth);\n return;\n }\n\n const hasImage = [selectedItem, ...allItems].some((item) => item?.imageUrl);\n const hasIcon = [selectedItem, ...allItems].some((item) => item?.icons);\n\n const parentWidth =\n styledComboBoxElementRef.current?.parentElement?.getBoundingClientRect().width ?? 0;\n\n const paddingWidth = 20 + 2 + 40 + 40; // padding + border + arrow icon + optional clear icon\n const imageWidth = hasImage ? 32 : 0; // image width + gap if images present\n const iconWidth = hasIcon ? 40 : 0; // icon width + gap if icons present\n\n let prefixWidth = 0;\n\n if (prefix) {\n const prefixTextWidth =\n calculateContentWidth([{ text: prefix, value: 'prefix' }], functions, values) + 5;\n\n prefixWidth = Math.max(prefixTextWidth, 32);\n }\n\n const calculatedWidth = baseWidth + paddingWidth + imageWidth + iconWidth + prefixWidth;\n\n let tmpMinWidth = calculatedWidth;\n let tmpBodyMinWidth = calculatedWidth;\n\n // Full width settings\n if (shouldUseFullWidth) {\n tmpMinWidth = parentWidth;\n\n tmpBodyMinWidth =\n parentWidth < calculatedWidth - 20 ? calculatedWidth - 20 : parentWidth;\n }\n // Current item width settings\n else if (shouldUseCurrentItemWidth && internalSelectedItem) {\n const itemWidth =\n calculateContentWidth([internalSelectedItem], functions, values) +\n paddingWidth +\n imageWidth +\n iconWidth +\n prefixWidth;\n\n tmpMinWidth = itemWidth;\n\n tmpBodyMinWidth = itemWidth < calculatedWidth - 20 ? calculatedWidth - 20 : itemWidth;\n }\n\n if (tmpMinWidth > parentWidth) {\n tmpMinWidth = parentWidth;\n }\n\n if (tmpBodyMinWidth > parentWidth) {\n tmpBodyMinWidth = parentWidth;\n }\n\n setMinWidth(tmpMinWidth);\n setBodyMinWidth(shouldUseCurrentItemWidth ? tmpMinWidth : tmpBodyMinWidth);\n }, [\n lists,\n placeholder,\n shouldUseFullWidth,\n shouldUseCurrentItemWidth,\n internalSelectedItem,\n prefix,\n selectedItem,\n functions,\n values,\n shouldDropDownUseMaxItemWidth,\n ]);\n\n /**\n * This function sets the external selected item\n */\n useEffect(() => {\n setIsAnimating(false);\n setInternalSelectedItem(selectedItem);\n }, [selectedItem]);\n\n const placeholderImageUrl = useMemo(() => {\n if (selectedItem) {\n return selectedItem.imageUrl;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.imageUrl;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n const placeholderIcon = useMemo(() => {\n if (selectedItem) {\n return selectedItem.icons;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.icons;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n /**\n * This function resets the placeholder\n */\n const placeholderText = useMemo(() => {\n let text = placeholder;\n\n if (selectedItem) {\n text = selectedItem.text;\n } else if (internalSelectedItem) {\n text = internalSelectedItem.text;\n }\n\n return text;\n }, [internalSelectedItem, placeholder, selectedItem]);\n\n const shouldShowRoundPlaceholderImage = useMemo(() => {\n const selectedItemList = lists.find((list) =>\n list.list.some(\n ({ value }) => value === (selectedItem?.value ?? internalSelectedItem?.value),\n ),\n );\n\n return selectedItemList?.shouldShowRoundImage ?? shouldShowRoundImage;\n }, [internalSelectedItem?.value, lists, selectedItem?.value, shouldShowRoundImage]);\n\n /**\n * This function opens the content of the combobox\n */\n const handleHeaderClick = useCallback(() => {\n if (!isDisabled && !isInputFocused.current) {\n if (isAnimating) {\n handleClose();\n } else {\n handleOpen();\n }\n }\n }, [handleClose, handleOpen, isAnimating, isDisabled]);\n\n const comboBoxGroups = useMemo(\n () =>\n lists.map((list) => (\n <Fragment key={list.groupName ?? 'default-group'}>\n {list.groupName && lists.length > 1 && (\n <StyledComboBoxTopic id={`combobox-group--${list.groupName}`}>\n {list.groupName}\n </StyledComboBoxTopic>\n )}\n {list.list.map((item) => (\n <ComboBoxItem\n item={item}\n isSelected={selectedItem ? item.value === selectedItem.value : false}\n onSelect={handleSetSelectedItem}\n shouldShowBigImage={shouldShowBigImage}\n shouldShowRoundImage={list.shouldShowRoundImage ?? shouldShowRoundImage}\n />\n ))}\n </Fragment>\n )),\n [handleSetSelectedItem, lists, selectedItem, shouldShowBigImage, shouldShowRoundImage],\n );\n\n return useMemo(\n () => (\n <StyledComboBox\n ref={styledComboBoxElementRef}\n $minWidth={minWidth}\n $shouldUseFullWidth={shouldUseFullWidth}\n $shouldUseCurrentItemWidth={shouldUseCurrentItemWidth}\n >\n <StyledComboBoxHeader\n $direction={direction}\n onClick={handleHeaderClick}\n $isOpen={isAnimating}\n $isTouch={isTouch}\n $shouldShowTransparentBackground={shouldShowTransparentBackground}\n $isDisabled={isDisabled}\n $shouldChangeColor={shouldChangeColor}\n $shouldShowBigImage={shouldShowBigImage}\n >\n <StyledComboBoxPrefixAndPlaceholderWrapper>\n {prefix && <StyledComboBoxPrefix>{prefix}</StyledComboBoxPrefix>}\n <StyledComboBoxPlaceholder\n $shouldReduceOpacity={!selectedItem && !internalSelectedItem}\n >\n {placeholderImageUrl && (\n <StyledComboBoxPlaceholderImage\n src={placeholderImageUrl}\n $shouldShowBigImage={shouldShowBigImage}\n $shouldShowRoundImage={shouldShowRoundPlaceholderImage}\n />\n )}\n {placeholderIcon && <Icon icons={placeholderIcon} />}\n {typeof inputValue === 'string' ? (\n <StyledComboBoxInput\n disabled={isDisabled}\n value={inputValue}\n onChange={onInputChange}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n placeholder={placeholderText}\n />\n ) : (\n <StyledComboBoxPlaceholderText>\n {placeholderText}\n </StyledComboBoxPlaceholderText>\n )}\n {internalSelectedItem &&\n internalSelectedItem.suffixElement &&\n internalSelectedItem.suffixElement}\n </StyledComboBoxPlaceholder>\n </StyledComboBoxPrefixAndPlaceholderWrapper>\n {shouldShowClearIcon && internalSelectedItem && (\n <StyledComboBoxClearIconWrapper onClick={handleClear}>\n <Icon icons={['fa fa-times']} />\n </StyledComboBoxClearIconWrapper>\n )}\n {!shouldDisableActions && (\n <StyledComboBoxIconWrapper\n $shouldShowBorderLeft={\n shouldShowClearIcon === true && internalSelectedItem !== undefined\n }\n >\n <Icon icons={['fa fa-chevron-down']} />\n </StyledComboBoxIconWrapper>\n )}\n </StyledComboBoxHeader>\n {styledComboBoxElementRef.current && (\n <DropdownBodyWrapper\n anchorElement={styledComboBoxElementRef.current}\n bodyWidth={bodyWidth}\n contentHeight={contentHeight}\n onClose={handleClose}\n direction={direction}\n container={container}\n shouldShowDropdown={isAnimating}\n minBodyWidth={bodyWidth ?? bodyMinWidth}\n maxHeight={maxHeight}\n >\n <StyledComboBoxBody\n $shouldUseCurrentItemWidth={shouldUseCurrentItemWidth}\n $maxHeight={maxHeight}\n $minWidth={bodyWidth ?? bodyMinWidth}\n $browser={browser?.name as BrowserName}\n ref={contentRef}\n tabIndex={0}\n >\n {comboBoxGroups}\n </StyledComboBoxBody>\n </DropdownBodyWrapper>\n )}\n </StyledComboBox>\n ),\n [\n minWidth,\n shouldUseFullWidth,\n shouldUseCurrentItemWidth,\n direction,\n handleHeaderClick,\n isAnimating,\n isTouch,\n shouldShowTransparentBackground,\n isDisabled,\n shouldChangeColor,\n shouldShowBigImage,\n prefix,\n selectedItem,\n internalSelectedItem,\n placeholderImageUrl,\n shouldShowRoundPlaceholderImage,\n placeholderIcon,\n inputValue,\n onInputChange,\n handleInputBlur,\n handleInputFocus,\n placeholderText,\n shouldShowClearIcon,\n handleClear,\n shouldDisableActions,\n bodyWidth,\n contentHeight,\n handleClose,\n container,\n bodyMinWidth,\n maxHeight,\n browser?.name,\n comboBoxGroups,\n ],\n );\n};\n\nComboBox.displayName = 'ComboBox';\n\nexport default ComboBox;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAgBA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAA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,IAAI+B,YAAa;IACrCuJ,QAAQ,EAAEtI,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEuI,IAAoB;IACvCrC,GAAG,EAAE5G,UAAW;IAChB2D,QAAQ,EAAE;EAAE,GAEXyC,cACe,CACH,CAEb,CACnB,EACD,CACI9G,QAAQ,EACRZ,kBAAkB,EAClBE,yBAAyB,EACzBjB,SAAS,EACTwI,iBAAiB,EACjB/G,WAAW,EACXoB,OAAO,EACP1B,+BAA+B,EAC/BhB,UAAU,EACVmD,iBAAiB,EACjB3C,kBAAkB,EAClBH,MAAM,EACNE,YAAY,EACZY,oBAAoB,EACpB6G,mBAAmB,EACnBG,+BAA+B,EAC/BF,eAAe,EACfhH,UAAU,EACVJ,aAAa,EACbuD,eAAe,EACfJ,gBAAgB,EAChBkE,eAAe,EACfzH,mBAAmB,EACnBoE,WAAW,EACXxB,oBAAoB,EACpBzD,SAAS,EACTiE,aAAa,EACbS,WAAW,EACXhE,SAAS,EACTqB,YAAY,EACZzB,SAAS,EACT0C,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEuI,IAAI,EACb7C,cAAc,CAEtB,CAAC;AACL,CAAC;AAED3I,QAAQ,CAACyL,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA5M,OAAA,GAEnBiB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"ComboBox.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_calculate","_environment","_AreaContextProvider","_Icon","_interopRequireDefault","_ComboBoxItem","_ComboBox","_DropdownBodyWrapper","_dropdown","_element","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ComboBox","forwardRef","bodyWidth","direction","DropdownDirection","RIGHT","isDisabled","lists","maxHeight","onSelect","placeholder","prefix","container","selectedItem","shouldShowBigImage","shouldShowClearIcon","shouldShowRoundImage","onInputFocus","shouldUseFullWidth","onInputChange","shouldUseCurrentItemWidth","onInputBlur","shouldShowTransparentBackground","inputValue","shouldDropDownUseMaxItemWidth","ref","internalSelectedItem","setInternalSelectedItem","useState","isAnimating","setIsAnimating","minWidth","setMinWidth","undefined","bodyMinWidth","setBodyMinWidth","focusedIndex","setFocusedIndex","isInputFocused","useRef","styledComboBoxElementRef","contentRef","parentSize","useElementSize","shouldUseParentElement","functions","useFunctions","values","useValues","isTouch","getIsTouch","browser","useDevice","areaProvider","useContext","AreaContext","useEffect","width","shouldChangeColor","useMemo","shouldDisableActions","combinedLists","flatMap","list","length","some","item","value","contentHeight","flatItems","result","handleInputFocus","useCallback","event","current","handleInputBlur","handleOpen","handleClose","handleSetSelectedItem","itemToSelect","onSelectResult","Promise","then","shouldPreventSelection","handleClear","preventDefault","stopPropagation","handleKeyDown","key","_contentRef$current","children","stepDirection","newIndex","attempts","newElement","shouldSkip","id","startsWith","endsWith","prevElement","tabIndex","focusedElement","focus","_contentRef$current2","element","newSelectedItem","find","String","replace","document","addEventListener","removeEventListener","_styledComboBoxElemen","allItems","baseWidth","calculateContentWidth","text","hasImage","imageUrl","hasIcon","icons","parentWidth","parentElement","getBoundingClientRect","paddingWidth","imageWidth","iconWidth","prefixWidth","prefixTextWidth","Math","max","calculatedWidth","tmpMinWidth","tmpBodyMinWidth","itemWidth","placeholderImageUrl","placeholderIcon","placeholderText","shouldShowRoundPlaceholderImage","selectedItemList","handleHeaderClick","useImperativeHandle","hide","show","comboBoxGroups","map","createElement","Fragment","groupName","StyledComboBoxTopic","isSelected","StyledComboBox","$minWidth","$shouldUseFullWidth","$shouldUseCurrentItemWidth","StyledComboBoxHeader","$direction","onClick","$isOpen","$isTouch","$shouldShowTransparentBackground","$isDisabled","$shouldChangeColor","$shouldShowBigImage","StyledComboBoxPrefixAndPlaceholderWrapper","StyledComboBoxPrefix","StyledComboBoxPlaceholder","$shouldReduceOpacity","StyledComboBoxPlaceholderImage","src","$shouldShowRoundImage","StyledComboBoxInput","disabled","onChange","onBlur","onFocus","StyledComboBoxPlaceholderText","suffixElement","StyledComboBoxClearIconWrapper","StyledComboBoxIconWrapper","$shouldShowBorderLeft","anchorElement","onClose","shouldShowDropdown","minBodyWidth","StyledComboBoxBody","$maxHeight","$browser","name","displayName","_default","exports"],"sources":["../../../../src/components/combobox/ComboBox.tsx"],"sourcesContent":["import { useDevice, useFunctions, useValues } from 'chayns-api';\nimport React, {\n ChangeEventHandler,\n type CSSProperties,\n FC,\n FocusEventHandler,\n forwardRef,\n Fragment,\n ReactHTML,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { BrowserName } from '../../types/chayns';\nimport { calculateContentWidth } from '../../utils/calculate';\nimport { getIsTouch } from '../../utils/environment';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport Icon from '../icon/Icon';\nimport ComboBoxItem from './combobox-item/ComboBoxItem';\nimport {\n StyledComboBox,\n StyledComboBoxBody,\n StyledComboBoxClearIconWrapper,\n StyledComboBoxHeader,\n StyledComboBoxIconWrapper,\n StyledComboBoxInput,\n StyledComboBoxPlaceholder,\n StyledComboBoxPlaceholderImage,\n StyledComboBoxPlaceholderText,\n StyledComboBoxPrefix,\n StyledComboBoxPrefixAndPlaceholderWrapper,\n StyledComboBoxTopic,\n} from './ComboBox.styles';\nimport DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';\nimport { DropdownDirection } from '../../types/dropdown';\nimport { useElementSize } from '../../hooks/element';\n\nexport interface ComboBoxRef {\n hide: VoidFunction;\n show: VoidFunction;\n}\n\nexport interface IComboBoxItems {\n groupName?: string;\n list: Array<IComboBoxItem>;\n shouldShowRoundImage?: boolean;\n}\n\nexport interface ComboBoxTextStyles {\n tagName?: keyof ReactHTML;\n styles?: CSSProperties;\n}\n\nexport interface IComboBoxItem {\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n imageUrl?: string;\n isDisabled?: boolean;\n rightElement?: ReactNode;\n subtext?: string;\n suffixElement?: ReactNode;\n text: string;\n value: string | number;\n textStyles?: ComboBoxTextStyles;\n}\n\nexport type ComboBoxProps = {\n /**\n * The width of the body.\n */\n bodyWidth?: number;\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n */\n container?: Element;\n /**\n * The direction in which the combobox should open.\n */\n direction?: DropdownDirection;\n /**\n * The value of the optional input.\n */\n inputValue?: string;\n /**\n * Whether the combobox should be disabled.\n */\n isDisabled?: boolean;\n /**\n * The list of the items that should be displayed.\n */\n lists: IComboBoxItems[];\n /**\n * The maximum height of the combobox content.\n */\n maxHeight?: number;\n /**\n * Function to be executed when the value of the optional input is changed.\n */\n onInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input lost its focus.\n */\n onInputBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input gets its focus.\n */\n onInputFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.\n */\n onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;\n /**\n * A text that should be displayed when no item is selected.\n */\n placeholder: string;\n /**\n * A prefix that should be displayed before the placeholder.\n */\n prefix?: string;\n /**\n * An item that should be preselected.\n */\n selectedItem?: IComboBoxItem;\n /**\n * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.\n */\n shouldShowBigImage?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the combo box if an item is selected.\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether the background should be transparent.\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the width of the ComboBox should be the width of the current item.\n */\n shouldUseCurrentItemWidth?: boolean;\n /**\n * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.\n */\n shouldUseFullWidth?: boolean;\n /**\n * If true, the dropdown will use the maximum width of the items.\n */\n shouldDropDownUseMaxItemWidth?: boolean;\n};\n\nconst ComboBox = forwardRef<ComboBoxRef, ComboBoxProps>(\n (\n {\n bodyWidth,\n direction = DropdownDirection.RIGHT,\n isDisabled = false,\n lists,\n maxHeight = 280,\n onSelect,\n placeholder,\n prefix,\n container,\n selectedItem,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldShowRoundImage,\n onInputFocus,\n shouldUseFullWidth = false,\n onInputChange,\n shouldUseCurrentItemWidth = false,\n onInputBlur,\n shouldShowTransparentBackground = false,\n inputValue,\n shouldDropDownUseMaxItemWidth = false,\n },\n ref,\n ) => {\n const [internalSelectedItem, setInternalSelectedItem] = useState<IComboBoxItem>();\n const [isAnimating, setIsAnimating] = useState(false);\n const [minWidth, setMinWidth] = useState<number | undefined>(undefined);\n const [bodyMinWidth, setBodyMinWidth] = useState(0);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n\n const isInputFocused = useRef(false);\n\n const styledComboBoxElementRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const parentSize = useElementSize(styledComboBoxElementRef, {\n shouldUseParentElement: true,\n });\n\n const functions = useFunctions();\n const values = useValues();\n\n const isTouch = getIsTouch();\n\n const { browser } = useDevice();\n\n const areaProvider = useContext(AreaContext);\n\n useEffect(() => {\n if (shouldUseFullWidth && parentSize) {\n setMinWidth(parentSize.width);\n }\n }, [parentSize, shouldUseFullWidth]);\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n const shouldDisableActions = useMemo(() => {\n if (!selectedItem) {\n return false;\n }\n\n const combinedLists = lists.flatMap((list) => list.list);\n\n return (\n combinedLists.length === 1 &&\n combinedLists.some((item) => item.value === selectedItem.value)\n );\n }, [lists, selectedItem]);\n\n const contentHeight = useMemo(() => {\n const flatItems = lists.flatMap((list) => list.list);\n\n let result = flatItems.length * 36;\n\n if (lists.length > 1) {\n result += lists.length * 36;\n }\n\n if (maxHeight < result) {\n result = maxHeight;\n }\n\n return result;\n }, [lists, maxHeight]);\n\n const handleInputFocus: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = true;\n onInputFocus?.(event);\n },\n [onInputFocus],\n );\n\n const handleInputBlur: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = false;\n onInputBlur?.(event);\n },\n [onInputBlur],\n );\n\n const handleOpen = useCallback(() => {\n setIsAnimating(true);\n }, []);\n\n const handleClose = useCallback(() => {\n setIsAnimating(false);\n }, []);\n\n /**\n * This function sets the selected item\n */\n const handleSetSelectedItem = useCallback(\n (itemToSelect?: IComboBoxItem) => {\n if (typeof onSelect === 'function') {\n const onSelectResult = onSelect(itemToSelect);\n\n if (onSelectResult === false) {\n return;\n }\n\n if (onSelectResult instanceof Promise) {\n void onSelectResult.then((shouldPreventSelection) => {\n if (shouldPreventSelection) return;\n\n setInternalSelectedItem(itemToSelect);\n setIsAnimating(false);\n });\n\n return;\n }\n }\n\n setInternalSelectedItem(itemToSelect);\n setIsAnimating(false);\n },\n [onSelect],\n );\n\n const handleClear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n handleSetSelectedItem(undefined);\n },\n [handleSetSelectedItem],\n );\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!isAnimating) return;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n\n const children = contentRef.current?.children;\n\n if (!children || children.length === 0) return;\n\n const stepDirection = e.key === 'ArrowUp' ? -1 : 1;\n\n let newIndex = focusedIndex ?? -1;\n\n let attempts = 0;\n\n do {\n newIndex = (newIndex + stepDirection + children.length) % children.length;\n\n const newElement = children[newIndex] as HTMLDivElement;\n\n let shouldSkip = false;\n\n if (\n newElement.id.startsWith('combobox-group--') ||\n newElement.id.endsWith('--disabled-item')\n ) {\n shouldSkip = true;\n }\n\n if (!shouldSkip) break;\n\n attempts++;\n } while (attempts < children.length);\n\n if (focusedIndex !== null) {\n const prevElement = children[focusedIndex] as HTMLDivElement;\n\n prevElement.tabIndex = -1;\n }\n\n setFocusedIndex(newIndex);\n\n const focusedElement = children[newIndex] as HTMLDivElement;\n\n focusedElement.tabIndex = 0;\n\n focusedElement.focus();\n } else if (e.key === 'Enter' && focusedIndex !== null) {\n const element = contentRef.current?.children[focusedIndex];\n\n if (!element) return;\n\n const { id } = element;\n\n let newSelectedItem: IComboBoxItem | undefined;\n\n lists.some((list) => {\n newSelectedItem = list.list.find(\n ({ value }) => String(value) === id.replace('combobox-item__', ''),\n );\n\n return !!newSelectedItem;\n });\n\n if (newSelectedItem) {\n handleSetSelectedItem(newSelectedItem);\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [focusedIndex, handleSetSelectedItem, isAnimating, lists]);\n\n /**\n * This function calculates the greatest width\n */\n useEffect(() => {\n const allItems = lists.flatMap((list) => list.list);\n\n let baseWidth = calculateContentWidth(\n [\n ...allItems,\n { text: placeholder, value: 'placeholder' },\n ...(selectedItem ? [selectedItem] : []),\n ],\n functions,\n values,\n );\n\n if (shouldDropDownUseMaxItemWidth) {\n baseWidth += 20 + 2; // 20px padding left and right and 2px border\n setBodyMinWidth(baseWidth);\n setMinWidth(baseWidth);\n return;\n }\n\n const hasImage = [selectedItem, ...allItems].some((item) => item?.imageUrl);\n const hasIcon = [selectedItem, ...allItems].some((item) => item?.icons);\n\n const parentWidth =\n styledComboBoxElementRef.current?.parentElement?.getBoundingClientRect().width ?? 0;\n\n const paddingWidth = 20 + 2 + 40 + 40; // padding + border + arrow icon + optional clear icon\n const imageWidth = hasImage ? 32 : 0; // image width + gap if images present\n const iconWidth = hasIcon ? 40 : 0; // icon width + gap if icons present\n\n let prefixWidth = 0;\n\n if (prefix) {\n const prefixTextWidth =\n calculateContentWidth([{ text: prefix, value: 'prefix' }], functions, values) +\n 5;\n\n prefixWidth = Math.max(prefixTextWidth, 32);\n }\n\n const calculatedWidth = baseWidth + paddingWidth + imageWidth + iconWidth + prefixWidth;\n\n let tmpMinWidth = calculatedWidth;\n let tmpBodyMinWidth = calculatedWidth;\n\n // Full width settings\n if (shouldUseFullWidth) {\n tmpMinWidth = parentWidth;\n\n tmpBodyMinWidth =\n parentWidth < calculatedWidth - 20 ? calculatedWidth - 20 : parentWidth;\n }\n // Current item width settings\n else if (shouldUseCurrentItemWidth && internalSelectedItem) {\n const itemWidth =\n calculateContentWidth([internalSelectedItem], functions, values) +\n paddingWidth +\n imageWidth +\n iconWidth +\n prefixWidth;\n\n tmpMinWidth = itemWidth;\n\n tmpBodyMinWidth =\n itemWidth < calculatedWidth - 20 ? calculatedWidth - 20 : itemWidth;\n }\n\n if (tmpMinWidth > parentWidth) {\n tmpMinWidth = parentWidth;\n }\n\n if (tmpBodyMinWidth > parentWidth) {\n tmpBodyMinWidth = parentWidth;\n }\n\n setMinWidth(tmpMinWidth);\n setBodyMinWidth(shouldUseCurrentItemWidth ? tmpMinWidth : tmpBodyMinWidth);\n }, [\n lists,\n placeholder,\n shouldUseFullWidth,\n shouldUseCurrentItemWidth,\n internalSelectedItem,\n prefix,\n selectedItem,\n functions,\n values,\n shouldDropDownUseMaxItemWidth,\n ]);\n\n /**\n * This function sets the external selected item\n */\n useEffect(() => {\n setIsAnimating(false);\n setInternalSelectedItem(selectedItem);\n }, [selectedItem]);\n\n const placeholderImageUrl = useMemo(() => {\n if (selectedItem) {\n return selectedItem.imageUrl;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.imageUrl;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n const placeholderIcon = useMemo(() => {\n if (selectedItem) {\n return selectedItem.icons;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.icons;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n /**\n * This function resets the placeholder\n */\n const placeholderText = useMemo(() => {\n let text = placeholder;\n\n if (selectedItem) {\n text = selectedItem.text;\n } else if (internalSelectedItem) {\n text = internalSelectedItem.text;\n }\n\n return text;\n }, [internalSelectedItem, placeholder, selectedItem]);\n\n const shouldShowRoundPlaceholderImage = useMemo(() => {\n const selectedItemList = lists.find((list) =>\n list.list.some(\n ({ value }) => value === (selectedItem?.value ?? internalSelectedItem?.value),\n ),\n );\n\n return selectedItemList?.shouldShowRoundImage ?? shouldShowRoundImage;\n }, [internalSelectedItem?.value, lists, selectedItem?.value, shouldShowRoundImage]);\n\n /**\n * This function opens the content of the combobox\n */\n const handleHeaderClick = useCallback(() => {\n if (!isDisabled && !isInputFocused.current) {\n if (isAnimating) {\n handleClose();\n } else {\n handleOpen();\n }\n }\n }, [handleClose, handleOpen, isAnimating, isDisabled]);\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleClose,\n show: handleOpen,\n }),\n [handleClose, handleOpen],\n );\n\n const comboBoxGroups = useMemo(\n () =>\n lists.map((list) => (\n <Fragment key={list.groupName ?? 'default-group'}>\n {list.groupName && lists.length > 1 && (\n <StyledComboBoxTopic id={`combobox-group--${list.groupName}`}>\n {list.groupName}\n </StyledComboBoxTopic>\n )}\n {list.list.map((item) => (\n <ComboBoxItem\n item={item}\n isSelected={\n selectedItem ? item.value === selectedItem.value : false\n }\n onSelect={handleSetSelectedItem}\n shouldShowBigImage={shouldShowBigImage}\n shouldShowRoundImage={\n list.shouldShowRoundImage ?? shouldShowRoundImage\n }\n />\n ))}\n </Fragment>\n )),\n [handleSetSelectedItem, lists, selectedItem, shouldShowBigImage, shouldShowRoundImage],\n );\n\n return useMemo(\n () => (\n <StyledComboBox\n ref={styledComboBoxElementRef}\n $minWidth={minWidth}\n $shouldUseFullWidth={shouldUseFullWidth}\n $shouldUseCurrentItemWidth={shouldUseCurrentItemWidth}\n >\n <StyledComboBoxHeader\n $direction={direction}\n onClick={handleHeaderClick}\n $isOpen={isAnimating}\n $isTouch={isTouch}\n $shouldShowTransparentBackground={shouldShowTransparentBackground}\n $isDisabled={isDisabled}\n $shouldChangeColor={shouldChangeColor}\n $shouldShowBigImage={shouldShowBigImage}\n >\n <StyledComboBoxPrefixAndPlaceholderWrapper>\n {prefix && <StyledComboBoxPrefix>{prefix}</StyledComboBoxPrefix>}\n <StyledComboBoxPlaceholder\n $shouldReduceOpacity={!selectedItem && !internalSelectedItem}\n >\n {placeholderImageUrl && (\n <StyledComboBoxPlaceholderImage\n src={placeholderImageUrl}\n $shouldShowBigImage={shouldShowBigImage}\n $shouldShowRoundImage={shouldShowRoundPlaceholderImage}\n />\n )}\n {placeholderIcon && <Icon icons={placeholderIcon} />}\n {typeof inputValue === 'string' ? (\n <StyledComboBoxInput\n disabled={isDisabled}\n value={inputValue}\n onChange={onInputChange}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n placeholder={placeholderText}\n />\n ) : (\n <StyledComboBoxPlaceholderText>\n {placeholderText}\n </StyledComboBoxPlaceholderText>\n )}\n {internalSelectedItem &&\n internalSelectedItem.suffixElement &&\n internalSelectedItem.suffixElement}\n </StyledComboBoxPlaceholder>\n </StyledComboBoxPrefixAndPlaceholderWrapper>\n {shouldShowClearIcon && internalSelectedItem && (\n <StyledComboBoxClearIconWrapper onClick={handleClear}>\n <Icon icons={['fa fa-times']} />\n </StyledComboBoxClearIconWrapper>\n )}\n {!shouldDisableActions && (\n <StyledComboBoxIconWrapper\n $shouldShowBorderLeft={\n shouldShowClearIcon === true &&\n internalSelectedItem !== undefined\n }\n >\n <Icon icons={['fa fa-chevron-down']} />\n </StyledComboBoxIconWrapper>\n )}\n </StyledComboBoxHeader>\n {styledComboBoxElementRef.current && (\n <DropdownBodyWrapper\n anchorElement={styledComboBoxElementRef.current}\n bodyWidth={bodyWidth}\n contentHeight={contentHeight}\n onClose={handleClose}\n direction={direction}\n container={container}\n shouldShowDropdown={isAnimating}\n minBodyWidth={bodyWidth ?? bodyMinWidth}\n maxHeight={maxHeight}\n >\n <StyledComboBoxBody\n $shouldUseCurrentItemWidth={shouldUseCurrentItemWidth}\n $maxHeight={maxHeight}\n $minWidth={bodyWidth ?? bodyMinWidth}\n $browser={browser?.name as BrowserName}\n ref={contentRef}\n tabIndex={0}\n >\n {comboBoxGroups}\n </StyledComboBoxBody>\n </DropdownBodyWrapper>\n )}\n </StyledComboBox>\n ),\n [\n minWidth,\n shouldUseFullWidth,\n shouldUseCurrentItemWidth,\n direction,\n handleHeaderClick,\n isAnimating,\n isTouch,\n shouldShowTransparentBackground,\n isDisabled,\n shouldChangeColor,\n shouldShowBigImage,\n prefix,\n selectedItem,\n internalSelectedItem,\n placeholderImageUrl,\n shouldShowRoundPlaceholderImage,\n placeholderIcon,\n inputValue,\n onInputChange,\n handleInputBlur,\n handleInputFocus,\n placeholderText,\n shouldShowClearIcon,\n handleClear,\n shouldDisableActions,\n bodyWidth,\n contentHeight,\n handleClose,\n container,\n bodyMinWidth,\n maxHeight,\n browser?.name,\n comboBoxGroups,\n ],\n );\n },\n);\n\nComboBox.displayName = 'ComboBox';\n\nexport default ComboBox;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAkBA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAcA,IAAAU,oBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AAAqD,SAAAO,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,C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,EACD,CACIjH,QAAQ,EACRb,kBAAkB,EAClBE,yBAAyB,EACzBjB,SAAS,EACTyI,iBAAiB,EACjB/G,WAAW,EACXoB,OAAO,EACP3B,+BAA+B,EAC/BhB,UAAU,EACVoD,iBAAiB,EACjB5C,kBAAkB,EAClBH,MAAM,EACNE,YAAY,EACZa,oBAAoB,EACpB6G,mBAAmB,EACnBG,+BAA+B,EAC/BF,eAAe,EACfjH,UAAU,EACVJ,aAAa,EACbwD,eAAe,EACfJ,gBAAgB,EAChBkE,eAAe,EACf1H,mBAAmB,EACnBqE,WAAW,EACXxB,oBAAoB,EACpB1D,SAAS,EACTkE,aAAa,EACbS,WAAW,EACXjE,SAAS,EACTsB,YAAY,EACZ1B,SAAS,EACT2C,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEyI,IAAI,EACb5C,cAAc,CAEtB,CAAC;AACL,CACJ,CAAC;AAEDhJ,QAAQ,CAAC6L,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhN,OAAA,GAEnBiB,QAAQ","ignoreList":[]}
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = require("motion/react");
8
8
  var _react2 = _interopRequireWildcard(require("react"));
9
- var _accordion = require("../../../../utils/accordion");
10
9
  var _Icon = _interopRequireDefault(require("../../../icon/Icon"));
11
10
  var _ListItemIcon = _interopRequireDefault(require("./list-item-icon/ListItemIcon"));
12
11
  var _ListItemImage = _interopRequireDefault(require("./list-item-image/ListItemImage"));
13
- var _ListItemRightElements = _interopRequireDefault(require("./list-item-right-elements/ListItemRightElements"));
14
12
  var _ListItemHead = require("./ListItemHead.styles");
15
13
  var _list = require("../../../../constants/list");
14
+ var _ListItemTitle = _interopRequireDefault(require("./list-item-title/ListItemTitle"));
15
+ var _ListItemSubtitle = _interopRequireDefault(require("./list-item-subtitle/ListItemSubtitle"));
16
+ var _ListItemRightElement = _interopRequireDefault(require("./list-item-right-element/ListItemRightElement"));
16
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
19
  const ListItemHead = ({
@@ -44,9 +45,8 @@ const ListItemHead = ({
44
45
  onImageError
45
46
  }) => {
46
47
  const [shouldShowHoverItem, setShouldShowHoverItem] = (0, _react2.useState)(false);
47
- const titleWrapperRef = (0, _react2.useRef)(null);
48
48
  const longPressTimeoutRef = (0, _react2.useRef)();
49
- const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';
49
+ const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string' || typeof rightElements === 'object' && rightElements && 'bottom' in rightElements;
50
50
  const shouldShowMultilineTitle = (0, _react2.useMemo)(() => !subtitle, [subtitle]);
51
51
  const handleShowTooltipResize = (0, _react2.useCallback)(entries => {
52
52
  var _entries$;
@@ -54,13 +54,6 @@ const ListItemHead = ({
54
54
  if (!el) return;
55
55
  setShouldEnableTooltip(el.scrollWidth > el.clientWidth);
56
56
  }, [setShouldEnableTooltip]);
57
- (0, _react2.useEffect)(() => {
58
- const element = titleWrapperRef === null || titleWrapperRef === void 0 ? void 0 : titleWrapperRef.current;
59
- if (!element) return undefined;
60
- const resizeObserver = new ResizeObserver(handleShowTooltipResize);
61
- resizeObserver.observe(element);
62
- return () => resizeObserver.disconnect();
63
- }, [handleShowTooltipResize]);
64
57
  const handleMouseEnter = (0, _react2.useCallback)(() => setShouldShowHoverItem(true), []);
65
58
  const handleMouseLeave = (0, _react2.useCallback)(() => setShouldShowHoverItem(false), []);
66
59
  const handleTouchStart = (0, _react2.useCallback)(event => {
@@ -73,23 +66,6 @@ const ListItemHead = ({
73
66
  const handleTouchEnd = (0, _react2.useCallback)(() => {
74
67
  clearTimeout(longPressTimeoutRef.current);
75
68
  }, []);
76
- const shouldPreventRightElementClick = (0, _react2.useMemo)(() => {
77
- if (!rightElements) return false;
78
- if (typeof rightElements === 'object' && ('bottom' in rightElements || 'center' in rightElements || 'top' in rightElements)) {
79
- if (rightElements.bottom && (0, _accordion.getElementClickEvent)(rightElements.bottom)) {
80
- return true;
81
- }
82
- if (rightElements.center && (0, _accordion.getElementClickEvent)(rightElements.center)) {
83
- return true;
84
- }
85
- if (rightElements.top && (0, _accordion.getElementClickEvent)(rightElements.top)) {
86
- return true;
87
- }
88
- } else {
89
- return (0, _accordion.getElementClickEvent)(rightElements);
90
- }
91
- return false;
92
- }, [rightElements]);
93
69
  const iconOrImageElement = (0, _react2.useMemo)(() => {
94
70
  if (icons) {
95
71
  return /*#__PURE__*/_react2.default.createElement(_ListItemIcon.default, {
@@ -112,7 +88,7 @@ const ListItemHead = ({
112
88
  });
113
89
  }
114
90
  return undefined;
115
- }, [careOfLocationId, cornerElement, cornerImage, icons, imageBackground, images, shouldHideImageOrIconBackground, shouldOpenImageOnClick, shouldShowRoundImageOrIcon]);
91
+ }, [careOfLocationId, cornerElement, cornerImage, icons, imageBackground, images, onImageError, shouldHideImageOrIconBackground, shouldOpenImageOnClick, shouldShowRoundImageOrIcon]);
116
92
  return /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHead, {
117
93
  as: shouldDisableAnimation ? undefined : _react.motion[_list.LIST_ITEM_HEAD_HTML_TAG],
118
94
  animate: shouldDisableAnimation ? undefined : {
@@ -148,15 +124,19 @@ const ListItemHead = ({
148
124
  }, /*#__PURE__*/_react2.default.createElement(_react.LayoutGroup, null, /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadTitle, {
149
125
  as: shouldDisableAnimation ? undefined : _react.motion[_list.LIST_ITEM_HEAD_TITLE_HTML_TAG],
150
126
  layout: "position"
151
- }, /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadTitleContent, null, /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadTitleText, {
152
- $isEllipsis: !isOpen,
153
- ref: titleWrapperRef,
154
- $shouldShowMultilineTitle: shouldShowMultilineTitle
155
- }, title), /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadTitleElement, null, titleElement))), shouldShowSubtitleRow && /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadSubtitle, null, /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadSubtitleText, {
156
- $isOpen: isOpen
157
- }, subtitle)))), rightElements && /*#__PURE__*/_react2.default.createElement(_ListItemRightElements.default, {
127
+ }, /*#__PURE__*/_react2.default.createElement(_ListItemTitle.default, {
128
+ title: title,
129
+ titleElement: titleElement,
130
+ isOpen: isOpen,
131
+ shouldShowMultilineTitle: shouldShowMultilineTitle,
158
132
  rightElements: rightElements,
159
- shouldPreventRightElementClick: shouldPreventRightElementClick
133
+ onResize: handleShowTooltipResize
134
+ })), shouldShowSubtitleRow && /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledListItemHeadSubtitle, null, /*#__PURE__*/_react2.default.createElement(_ListItemSubtitle.default, {
135
+ subtitle: subtitle,
136
+ isOpen: isOpen,
137
+ rightElements: rightElements
138
+ })))), /*#__PURE__*/_react2.default.createElement(_ListItemRightElement.default, {
139
+ rightElements: rightElements
160
140
  }), hoverItem && /*#__PURE__*/_react2.default.createElement(_ListItemHead.StyledMotionListItemHeadHoverItemWrapper, {
161
141
  className: "beta-chayns-list-item-hover-item",
162
142
  animate: {
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemHead.js","names":["_react","require","_react2","_interopRequireWildcard","_accordion","_Icon","_interopRequireDefault","_ListItemIcon","_ListItemImage","_ListItemRightElements","_ListItemHead","_list","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ListItemHead","careOfLocationId","cornerImage","hoverItem","icons","imageBackground","images","isAnyItemExpandable","isExpandable","isOpen","isTitleGreyed","leftElements","onClick","onLongPress","rightElements","shouldHideImageOrIconBackground","shouldHideIndicator","shouldOpenImageOnClick","shouldShowRoundImageOrIcon","subtitle","shouldForceHover","title","titleElement","setShouldEnableTooltip","shouldDisableAnimation","cornerElement","onImageError","shouldShowHoverItem","setShouldShowHoverItem","useState","titleWrapperRef","useRef","longPressTimeoutRef","shouldShowSubtitleRow","shouldShowMultilineTitle","useMemo","handleShowTooltipResize","useCallback","entries","_entries$","el","target","scrollWidth","clientWidth","useEffect","element","current","undefined","resizeObserver","ResizeObserver","observe","disconnect","handleMouseEnter","handleMouseLeave","handleTouchStart","event","window","setTimeout","handleTouchEnd","clearTimeout","shouldPreventRightElementClick","bottom","getElementClickEvent","center","top","iconOrImageElement","createElement","shouldHideBackground","shouldShowRoundIcon","shouldShowRoundImage","StyledListItemHead","as","motion","LIST_ITEM_HEAD_HTML_TAG","animate","opacity","initial","transition","duration","type","className","$isClickable","$isAnyItemExpandable","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","StyledListItemHeadLeftWrapper","StyledListItemHeadIndicator","LIST_ITEM_HEAD_INDICATOR_HTML_TAG","rotate","StyledListItemHeadContent","$isIconOrImageGiven","$isOpen","LayoutGroup","StyledListItemHeadTitle","LIST_ITEM_HEAD_TITLE_HTML_TAG","layout","StyledListItemHeadTitleContent","StyledListItemHeadTitleText","$isEllipsis","ref","$shouldShowMultilineTitle","StyledListItemHeadTitleElement","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledMotionListItemHeadHoverItemWrapper","marginLeft","width","StyledMotionListItemHeadHoverItem","displayName","_default","exports"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.tsx"],"sourcesContent":["import { LayoutGroup, motion } from 'motion/react';\nimport React, {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactNode,\n SyntheticEvent,\n TouchEventHandler,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { IListItemRightElements } from '../../../../types/list';\nimport { getElementClickEvent } from '../../../../utils/accordion';\nimport Icon from '../../../icon/Icon';\nimport ListItemIcon from './list-item-icon/ListItemIcon';\nimport ListItemImage from './list-item-image/ListItemImage';\nimport ListItemRightElements from './list-item-right-elements/ListItemRightElements';\nimport {\n StyledListItemHeadContent,\n StyledListItemHeadLeftWrapper,\n StyledListItemHeadSubtitle,\n StyledListItemHeadSubtitleText,\n StyledListItemHeadTitleContent,\n StyledListItemHeadTitleElement,\n StyledListItemHeadTitleText,\n StyledMotionListItemHeadHoverItem,\n StyledMotionListItemHeadHoverItemWrapper,\n StyledListItemHead,\n StyledListItemHeadIndicator,\n StyledListItemHeadTitle,\n} from './ListItemHead.styles';\nimport {\n LIST_ITEM_HEAD_HTML_TAG,\n LIST_ITEM_HEAD_INDICATOR_HTML_TAG,\n LIST_ITEM_HEAD_TITLE_HTML_TAG,\n} from '../../../../constants/list';\n\ntype ListItemHeadProps = {\n careOfLocationId?: number;\n cornerImage?: string;\n hoverItem?: ReactNode;\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n images?: string[];\n isAnyItemExpandable: boolean;\n isExpandable: boolean;\n isOpen: boolean;\n isTitleGreyed?: boolean;\n leftElements?: ReactNode;\n onClick?: MouseEventHandler<HTMLDivElement>;\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n rightElements?: IListItemRightElements;\n shouldHideImageOrIconBackground?: boolean;\n shouldHideIndicator?: boolean;\n shouldOpenImageOnClick: boolean;\n shouldShowRoundImageOrIcon?: boolean;\n subtitle?: ReactNode;\n title: ReactNode;\n titleElement?: ReactNode;\n shouldForceHover?: boolean;\n setShouldEnableTooltip: (value: boolean) => void;\n shouldDisableAnimation?: boolean;\n cornerElement?: ReactNode;\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n};\n\nconst ListItemHead: FC<ListItemHeadProps> = ({\n careOfLocationId,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isAnyItemExpandable,\n isExpandable,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onLongPress,\n rightElements,\n shouldHideImageOrIconBackground,\n shouldHideIndicator,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n subtitle,\n shouldForceHover,\n title,\n titleElement,\n setShouldEnableTooltip,\n shouldDisableAnimation = false,\n cornerElement,\n onImageError,\n}) => {\n const [shouldShowHoverItem, setShouldShowHoverItem] = useState(false);\n\n const titleWrapperRef = useRef<HTMLDivElement>(null);\n\n const longPressTimeoutRef = useRef<number>();\n\n const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';\n\n const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);\n\n const handleShowTooltipResize = useCallback(\n (entries: ResizeObserverEntry[]) => {\n const el = entries[0]?.target;\n if (!el) return;\n setShouldEnableTooltip(el.scrollWidth > el.clientWidth);\n },\n [setShouldEnableTooltip],\n );\n\n useEffect(() => {\n const element = titleWrapperRef?.current;\n if (!element) return undefined;\n\n const resizeObserver = new ResizeObserver(handleShowTooltipResize);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [handleShowTooltipResize]);\n\n const handleMouseEnter = useCallback(() => setShouldShowHoverItem(true), []);\n\n const handleMouseLeave = useCallback(() => setShouldShowHoverItem(false), []);\n\n const handleTouchStart = useCallback<TouchEventHandler<HTMLDivElement>>(\n (event) => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n if (typeof onLongPress === 'function') {\n onLongPress(event);\n }\n }, 400);\n },\n [onLongPress],\n );\n\n const handleTouchEnd = useCallback(() => {\n clearTimeout(longPressTimeoutRef.current);\n }, []);\n\n const shouldPreventRightElementClick = useMemo(() => {\n if (!rightElements) return false;\n\n if (\n typeof rightElements === 'object' &&\n ('bottom' in rightElements || 'center' in rightElements || 'top' in rightElements)\n ) {\n if (rightElements.bottom && getElementClickEvent(rightElements.bottom)) {\n return true;\n }\n\n if (rightElements.center && getElementClickEvent(rightElements.center)) {\n return true;\n }\n\n if (rightElements.top && getElementClickEvent(rightElements.top)) {\n return true;\n }\n } else {\n return getElementClickEvent(rightElements as ReactNode);\n }\n\n return false;\n }, [rightElements]);\n\n const iconOrImageElement = useMemo(() => {\n if (icons) {\n return (\n <ListItemIcon\n icons={icons}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundIcon={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n if (images) {\n return (\n <ListItemImage\n cornerElement={cornerElement}\n imageBackground={imageBackground}\n careOfLocationId={careOfLocationId}\n cornerImage={cornerImage}\n images={images}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundImage={!!shouldShowRoundImageOrIcon}\n onImageError={onImageError}\n />\n );\n }\n\n return undefined;\n }, [\n careOfLocationId,\n cornerElement,\n cornerImage,\n icons,\n imageBackground,\n images,\n shouldHideImageOrIconBackground,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n ]);\n\n return (\n <StyledListItemHead\n as={shouldDisableAnimation ? undefined : motion[LIST_ITEM_HEAD_HTML_TAG]}\n animate={\n shouldDisableAnimation\n ? undefined\n : {\n opacity: isTitleGreyed ? 0.5 : 1,\n }\n }\n initial={shouldDisableAnimation ? undefined : false}\n transition={shouldDisableAnimation ? undefined : { duration: 0.2, type: 'tween' }}\n className=\"beta-chayns-list-item-head\"\n $isClickable={typeof onClick === 'function' || isExpandable}\n $isAnyItemExpandable={isAnyItemExpandable}\n onClick={onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={typeof onLongPress === 'function' ? handleTouchStart : undefined}\n onTouchEnd={typeof onLongPress === 'function' ? handleTouchEnd : undefined}\n >\n <StyledListItemHeadLeftWrapper>\n {isAnyItemExpandable && (\n <StyledListItemHeadIndicator\n as={\n shouldDisableAnimation\n ? undefined\n : motion[LIST_ITEM_HEAD_INDICATOR_HTML_TAG]\n }\n animate={shouldDisableAnimation ? undefined : { rotate: isOpen ? 90 : 0 }}\n initial={shouldDisableAnimation ? undefined : false}\n transition={shouldDisableAnimation ? undefined : { type: 'tween' }}\n >\n {isExpandable && !shouldHideIndicator && (\n <Icon icons={['fa fa-chevron-right']} />\n )}\n </StyledListItemHeadIndicator>\n )}\n {leftElements}\n {iconOrImageElement}\n </StyledListItemHeadLeftWrapper>\n <StyledListItemHeadContent\n $isIconOrImageGiven={iconOrImageElement !== undefined}\n $isOpen={isOpen}\n >\n <LayoutGroup>\n <StyledListItemHeadTitle\n as={\n shouldDisableAnimation\n ? undefined\n : motion[LIST_ITEM_HEAD_TITLE_HTML_TAG]\n }\n layout=\"position\"\n >\n <StyledListItemHeadTitleContent>\n <StyledListItemHeadTitleText\n $isEllipsis={!isOpen}\n ref={titleWrapperRef}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n >\n {title}\n </StyledListItemHeadTitleText>\n <StyledListItemHeadTitleElement>\n {titleElement}\n </StyledListItemHeadTitleElement>\n </StyledListItemHeadTitleContent>\n </StyledListItemHeadTitle>\n {shouldShowSubtitleRow && (\n <StyledListItemHeadSubtitle>\n <StyledListItemHeadSubtitleText $isOpen={isOpen}>\n {subtitle}\n </StyledListItemHeadSubtitleText>\n </StyledListItemHeadSubtitle>\n )}\n </LayoutGroup>\n </StyledListItemHeadContent>\n {rightElements && (\n <ListItemRightElements\n rightElements={rightElements}\n shouldPreventRightElementClick={shouldPreventRightElementClick}\n />\n )}\n {hoverItem && (\n <StyledMotionListItemHeadHoverItemWrapper\n className=\"beta-chayns-list-item-hover-item\"\n animate={{\n marginLeft: shouldForceHover || shouldShowHoverItem ? 8 : 0,\n opacity: shouldForceHover || shouldShowHoverItem ? 1 : 0,\n width: shouldForceHover || shouldShowHoverItem ? 'auto' : 0,\n }}\n initial={false}\n transition={{ duration: 0.15, type: 'tween' }}\n >\n <StyledMotionListItemHeadHoverItem>\n {hoverItem}\n </StyledMotionListItemHeadHoverItem>\n </StyledMotionListItemHeadHoverItemWrapper>\n )}\n </StyledListItemHead>\n );\n};\n\nListItemHead.displayName = 'ListItemHead';\n\nexport default ListItemHead;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AAcA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,aAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,cAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,sBAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAcA,IAAAU,KAAA,GAAAV,OAAA;AAIoC,SAAAK,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAA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GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjI,OAAA,GAE3BiB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"ListItemHead.js","names":["_react","require","_react2","_interopRequireWildcard","_Icon","_interopRequireDefault","_ListItemIcon","_ListItemImage","_ListItemHead","_list","_ListItemTitle","_ListItemSubtitle","_ListItemRightElement","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ListItemHead","careOfLocationId","cornerImage","hoverItem","icons","imageBackground","images","isAnyItemExpandable","isExpandable","isOpen","isTitleGreyed","leftElements","onClick","onLongPress","rightElements","shouldHideImageOrIconBackground","shouldHideIndicator","shouldOpenImageOnClick","shouldShowRoundImageOrIcon","subtitle","shouldForceHover","title","titleElement","setShouldEnableTooltip","shouldDisableAnimation","cornerElement","onImageError","shouldShowHoverItem","setShouldShowHoverItem","useState","longPressTimeoutRef","useRef","shouldShowSubtitleRow","shouldShowMultilineTitle","useMemo","handleShowTooltipResize","useCallback","entries","_entries$","el","target","scrollWidth","clientWidth","handleMouseEnter","handleMouseLeave","handleTouchStart","event","current","window","setTimeout","handleTouchEnd","clearTimeout","iconOrImageElement","createElement","shouldHideBackground","shouldShowRoundIcon","shouldShowRoundImage","undefined","StyledListItemHead","as","motion","LIST_ITEM_HEAD_HTML_TAG","animate","opacity","initial","transition","duration","type","className","$isClickable","$isAnyItemExpandable","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","StyledListItemHeadLeftWrapper","StyledListItemHeadIndicator","LIST_ITEM_HEAD_INDICATOR_HTML_TAG","rotate","StyledListItemHeadContent","$isIconOrImageGiven","$isOpen","LayoutGroup","StyledListItemHeadTitle","LIST_ITEM_HEAD_TITLE_HTML_TAG","layout","onResize","StyledListItemHeadSubtitle","StyledMotionListItemHeadHoverItemWrapper","marginLeft","width","StyledMotionListItemHeadHoverItem","displayName","_default","exports"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.tsx"],"sourcesContent":["import { LayoutGroup, motion } from 'motion/react';\nimport React, {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactNode,\n SyntheticEvent,\n TouchEventHandler,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { IListItemRightElements } from '../../../../types/list';\nimport Icon from '../../../icon/Icon';\nimport ListItemIcon from './list-item-icon/ListItemIcon';\nimport ListItemImage from './list-item-image/ListItemImage';\nimport {\n StyledListItemHeadContent,\n StyledListItemHeadLeftWrapper,\n StyledListItemHeadSubtitle,\n StyledMotionListItemHeadHoverItem,\n StyledMotionListItemHeadHoverItemWrapper,\n StyledListItemHead,\n StyledListItemHeadIndicator,\n StyledListItemHeadTitle,\n} from './ListItemHead.styles';\nimport {\n LIST_ITEM_HEAD_HTML_TAG,\n LIST_ITEM_HEAD_INDICATOR_HTML_TAG,\n LIST_ITEM_HEAD_TITLE_HTML_TAG,\n} from '../../../../constants/list';\nimport ListItemTitle from './list-item-title/ListItemTitle';\nimport ListItemSubtitle from './list-item-subtitle/ListItemSubtitle';\nimport ListItemRightElement from './list-item-right-element/ListItemRightElement';\n\ntype ListItemHeadProps = {\n careOfLocationId?: number;\n cornerImage?: string;\n hoverItem?: ReactNode;\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n images?: string[];\n isAnyItemExpandable: boolean;\n isExpandable: boolean;\n isOpen: boolean;\n isTitleGreyed?: boolean;\n leftElements?: ReactNode;\n onClick?: MouseEventHandler<HTMLDivElement>;\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n rightElements?: IListItemRightElements;\n shouldHideImageOrIconBackground?: boolean;\n shouldHideIndicator?: boolean;\n shouldOpenImageOnClick: boolean;\n shouldShowRoundImageOrIcon?: boolean;\n subtitle?: ReactNode;\n title: ReactNode;\n titleElement?: ReactNode;\n shouldForceHover?: boolean;\n setShouldEnableTooltip: (value: boolean) => void;\n shouldDisableAnimation?: boolean;\n cornerElement?: ReactNode;\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n};\n\nconst ListItemHead: FC<ListItemHeadProps> = ({\n careOfLocationId,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isAnyItemExpandable,\n isExpandable,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onLongPress,\n rightElements,\n shouldHideImageOrIconBackground,\n shouldHideIndicator,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n subtitle,\n shouldForceHover,\n title,\n titleElement,\n setShouldEnableTooltip,\n shouldDisableAnimation = false,\n cornerElement,\n onImageError,\n}) => {\n const [shouldShowHoverItem, setShouldShowHoverItem] = useState(false);\n\n const longPressTimeoutRef = useRef<number>();\n\n const shouldShowSubtitleRow =\n subtitle ||\n typeof subtitle === 'string' ||\n (typeof rightElements === 'object' && rightElements && 'bottom' in rightElements);\n\n const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);\n\n const handleShowTooltipResize = useCallback(\n (entries: ResizeObserverEntry[]) => {\n const el = entries[0]?.target;\n if (!el) return;\n setShouldEnableTooltip(el.scrollWidth > el.clientWidth);\n },\n [setShouldEnableTooltip],\n );\n\n const handleMouseEnter = useCallback(() => setShouldShowHoverItem(true), []);\n\n const handleMouseLeave = useCallback(() => setShouldShowHoverItem(false), []);\n\n const handleTouchStart = useCallback<TouchEventHandler<HTMLDivElement>>(\n (event) => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n if (typeof onLongPress === 'function') {\n onLongPress(event);\n }\n }, 400);\n },\n [onLongPress],\n );\n\n const handleTouchEnd = useCallback(() => {\n clearTimeout(longPressTimeoutRef.current);\n }, []);\n\n const iconOrImageElement = useMemo(() => {\n if (icons) {\n return (\n <ListItemIcon\n icons={icons}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundIcon={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n if (images) {\n return (\n <ListItemImage\n cornerElement={cornerElement}\n imageBackground={imageBackground}\n careOfLocationId={careOfLocationId}\n cornerImage={cornerImage}\n images={images}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundImage={!!shouldShowRoundImageOrIcon}\n onImageError={onImageError}\n />\n );\n }\n\n return undefined;\n }, [\n careOfLocationId,\n cornerElement,\n cornerImage,\n icons,\n imageBackground,\n images,\n onImageError,\n shouldHideImageOrIconBackground,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n ]);\n\n return (\n <StyledListItemHead\n as={shouldDisableAnimation ? undefined : motion[LIST_ITEM_HEAD_HTML_TAG]}\n animate={\n shouldDisableAnimation\n ? undefined\n : {\n opacity: isTitleGreyed ? 0.5 : 1,\n }\n }\n initial={shouldDisableAnimation ? undefined : false}\n transition={shouldDisableAnimation ? undefined : { duration: 0.2, type: 'tween' }}\n className=\"beta-chayns-list-item-head\"\n $isClickable={typeof onClick === 'function' || isExpandable}\n $isAnyItemExpandable={isAnyItemExpandable}\n onClick={onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={typeof onLongPress === 'function' ? handleTouchStart : undefined}\n onTouchEnd={typeof onLongPress === 'function' ? handleTouchEnd : undefined}\n >\n <StyledListItemHeadLeftWrapper>\n {isAnyItemExpandable && (\n <StyledListItemHeadIndicator\n as={\n shouldDisableAnimation\n ? undefined\n : motion[LIST_ITEM_HEAD_INDICATOR_HTML_TAG]\n }\n animate={shouldDisableAnimation ? undefined : { rotate: isOpen ? 90 : 0 }}\n initial={shouldDisableAnimation ? undefined : false}\n transition={shouldDisableAnimation ? undefined : { type: 'tween' }}\n >\n {isExpandable && !shouldHideIndicator && (\n <Icon icons={['fa fa-chevron-right']} />\n )}\n </StyledListItemHeadIndicator>\n )}\n {leftElements}\n {iconOrImageElement}\n </StyledListItemHeadLeftWrapper>\n <StyledListItemHeadContent\n $isIconOrImageGiven={iconOrImageElement !== undefined}\n $isOpen={isOpen}\n >\n <LayoutGroup>\n <StyledListItemHeadTitle\n as={\n shouldDisableAnimation\n ? undefined\n : motion[LIST_ITEM_HEAD_TITLE_HTML_TAG]\n }\n layout=\"position\"\n >\n <ListItemTitle\n title={title}\n titleElement={titleElement}\n isOpen={isOpen}\n shouldShowMultilineTitle={shouldShowMultilineTitle}\n rightElements={rightElements}\n onResize={handleShowTooltipResize}\n />\n </StyledListItemHeadTitle>\n {shouldShowSubtitleRow && (\n <StyledListItemHeadSubtitle>\n <ListItemSubtitle\n subtitle={subtitle}\n isOpen={isOpen}\n rightElements={rightElements}\n />\n </StyledListItemHeadSubtitle>\n )}\n </LayoutGroup>\n </StyledListItemHeadContent>\n <ListItemRightElement rightElements={rightElements} />\n {hoverItem && (\n <StyledMotionListItemHeadHoverItemWrapper\n className=\"beta-chayns-list-item-hover-item\"\n animate={{\n marginLeft: shouldForceHover || shouldShowHoverItem ? 8 : 0,\n opacity: shouldForceHover || shouldShowHoverItem ? 1 : 0,\n width: shouldForceHover || shouldShowHoverItem ? 'auto' : 0,\n }}\n initial={false}\n transition={{ duration: 0.15, type: 'tween' }}\n >\n <StyledMotionListItemHeadHoverItem>\n {hoverItem}\n </StyledMotionListItemHeadHoverItem>\n </StyledMotionListItemHeadHoverItemWrapper>\n )}\n </StyledListItemHead>\n );\n};\n\nListItemHead.displayName = 'ListItemHead';\n\nexport default ListItemHead;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AAaA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,cAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAUA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,cAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,iBAAA,GAAAN,sBAAA,CAAA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U,CAAC,eAC5B5C,OAAA,CAAAa,OAAA,CAAAsE,aAAA,CAACzE,qBAAA,CAAAG,OAAoB;IAAC+B,aAAa,EAAEA;EAAc,CAAE,CAAC,EACrDX,SAAS,iBACNjC,OAAA,CAAAa,OAAA,CAAAsE,aAAA,CAAC7E,aAAA,CAAAgH,wCAAwC;IACrCpB,SAAS,EAAC,kCAAkC;IAC5CN,OAAO,EAAE;MACL2B,UAAU,EAAErE,gBAAgB,IAAIO,mBAAmB,GAAG,CAAC,GAAG,CAAC;MAC3DoC,OAAO,EAAE3C,gBAAgB,IAAIO,mBAAmB,GAAG,CAAC,GAAG,CAAC;MACxD+D,KAAK,EAAEtE,gBAAgB,IAAIO,mBAAmB,GAAG,MAAM,GAAG;IAC9D,CAAE;IACFqC,OAAO,EAAE,KAAM;IACfC,UAAU,EAAE;MAAEC,QAAQ,EAAE,IAAI;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9CjG,OAAA,CAAAa,OAAA,CAAAsE,aAAA,CAAC7E,aAAA,CAAAmH,iCAAiC,QAC7BxF,SAC8B,CACG,CAE9B,CAAC;AAE7B,CAAC;AAEDH,YAAY,CAAC4F,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/G,OAAA,GAE3BiB,YAAY","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyledMotionListItemHeadHoverItemWrapper = exports.StyledMotionListItemHeadHoverItem = exports.StyledListItemHeadTitleText = exports.StyledListItemHeadTitleElement = exports.StyledListItemHeadTitleContent = exports.StyledListItemHeadTitle = exports.StyledListItemHeadSubtitleText = exports.StyledListItemHeadSubtitle = exports.StyledListItemHeadLeftWrapper = exports.StyledListItemHeadIndicator = exports.StyledListItemHeadContent = exports.StyledListItemHead = void 0;
6
+ exports.StyledMotionListItemHeadHoverItemWrapper = exports.StyledMotionListItemHeadHoverItem = exports.StyledListItemHeadTitleContent = exports.StyledListItemHeadTitle = exports.StyledListItemHeadSubtitle = exports.StyledListItemHeadLeftWrapper = exports.StyledListItemHeadIndicator = exports.StyledListItemHeadContent = exports.StyledListItemHead = void 0;
7
7
  var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  var _list = require("../../../../constants/list");
@@ -70,55 +70,12 @@ const StyledListItemHeadTitleContent = exports.StyledListItemHeadTitleContent =
70
70
  min-width: 0;
71
71
  position: relative;
72
72
  `;
73
- const StyledListItemHeadTitleElement = exports.StyledListItemHeadTitleElement = _styledComponents.default.div`
74
- align-items: center;
75
- display: flex;
76
- flex: 0 0 auto;
77
- margin-left: 8px;
78
- `;
79
- const StyledListItemHeadTitleText = exports.StyledListItemHeadTitleText = _styledComponents.default.span`
80
- font-weight: ${({
81
- $isEllipsis
82
- }) => $isEllipsis ? 'normal' : 'bold'};
83
- white-space: ${({
84
- $isEllipsis
85
- }) => $isEllipsis ? 'nowrap' : 'normal'};
86
- min-width: 0;
87
- overflow: hidden;
88
- text-overflow: ellipsis;
89
-
90
- ${({
91
- $shouldShowMultilineTitle,
92
- $isEllipsis
93
- }) => $shouldShowMultilineTitle && $isEllipsis && (0, _styledComponents.css)`
94
- display: -webkit-box;
95
- -webkit-box-orient: vertical;
96
- -webkit-line-clamp: 2;
97
- text-overflow: ellipsis;
98
- white-space: normal;
99
- `}
100
- `;
101
73
  const StyledListItemHeadSubtitle = exports.StyledListItemHeadSubtitle = _styledComponents.default.div`
102
74
  align-items: center;
103
75
  display: flex;
104
76
  justify-content: space-between;
105
77
  margin-top: 2px;
106
78
  `;
107
- const StyledListItemHeadSubtitleText = exports.StyledListItemHeadSubtitleText = _styledComponents.default.span`
108
- font-weight: ${({
109
- $isOpen
110
- }) => $isOpen ? 'bold' : 'normal'};
111
- white-space: ${({
112
- $isOpen
113
- }) => $isOpen ? 'normal' : 'nowrap'};
114
- overflow: hidden;
115
- text-overflow: ellipsis;
116
-
117
- flex: 1 1 auto;
118
- font-size: 85%;
119
- min-width: 0;
120
- opacity: 0.75;
121
- `;
122
79
  const StyledMotionListItemHeadHoverItemWrapper = exports.StyledMotionListItemHeadHoverItemWrapper = (0, _styledComponents.default)(_react.motion.div)`
123
80
  overflow: hidden;
124
81
  flex-shrink: 0;
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemHead.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_list","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledListItemHead","exports","styled","LIST_ITEM_HEAD_HTML_TAG","theme","text","$isClickable","$isAnyItemExpandable","css","StyledListItemHeadLeftWrapper","div","StyledListItemHeadIndicator","LIST_ITEM_HEAD_INDICATOR_HTML_TAG","StyledListItemHeadContent","$isOpen","$isIconOrImageGiven","undefined","StyledListItemHeadTitle","LIST_ITEM_HEAD_TITLE_HTML_TAG","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","span","$isEllipsis","$shouldShowMultilineTitle","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledMotionListItemHeadHoverItemWrapper","motion","StyledMotionListItemHeadHoverItem"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../../color-scheme-provider/ColorSchemeProvider';\nimport {\n LIST_ITEM_HEAD_HTML_TAG,\n LIST_ITEM_HEAD_INDICATOR_HTML_TAG,\n LIST_ITEM_HEAD_TITLE_HTML_TAG,\n} from '../../../../constants/list';\n\ntype StyledListItemHeadProps = WithTheme<{\n $isClickable: boolean;\n $isAnyItemExpandable: boolean;\n}>;\n\nexport const StyledListItemHead = styled[LIST_ITEM_HEAD_HTML_TAG]<StyledListItemHeadProps>`\n //align-items: center;\n overflow: hidden;\n color: ${({ theme }: StyledListItemHeadProps) => theme.text};\n display: flex;\n min-height: 64px;\n padding: 12px 9px;\n position: relative;\n width: 100%;\n justify-content: center;\n cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};\n\n ${({ $isAnyItemExpandable }) =>\n !$isAnyItemExpandable &&\n css`\n padding-left: 12px;\n `}\n`;\n\nexport const StyledListItemHeadLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: auto 0;\n`;\n\nexport const StyledListItemHeadIndicator = styled[LIST_ITEM_HEAD_INDICATOR_HTML_TAG]`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n height: 26px;\n justify-content: center;\n width: 26px;\n`;\n\ntype StyledListItemHeadContentProps = {\n $isIconOrImageGiven: boolean;\n $isOpen: boolean;\n};\n\nexport const StyledListItemHeadContent = styled.div<StyledListItemHeadContentProps>`\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n justify-content: center;\n line-height: normal;\n margin-left: ${({ $isIconOrImageGiven }) => ($isIconOrImageGiven ? '10px' : undefined)};\n min-width: 0;\n`;\n\nexport const StyledListItemHeadTitle = styled[LIST_ITEM_HEAD_TITLE_HTML_TAG]`\n align-items: center;\n display: flex;\n justify-content: space-between;\n`;\n\nexport const StyledListItemHeadTitleContent = styled.div`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n max-width: 100%;\n min-width: 0;\n position: relative;\n`;\n\nexport const StyledListItemHeadTitleElement = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n margin-left: 8px;\n`;\n\ntype StyledListItemHeadTitleTextProps = WithTheme<{\n $shouldShowMultilineTitle: boolean;\n $isEllipsis?: boolean;\n}>;\n\nexport const StyledListItemHeadTitleText = styled.span<StyledListItemHeadTitleTextProps>`\n font-weight: ${({ $isEllipsis }) => ($isEllipsis ? 'normal' : 'bold')};\n white-space: ${({ $isEllipsis }) => ($isEllipsis ? 'nowrap' : 'normal')};\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n ${({ $shouldShowMultilineTitle, $isEllipsis }) =>\n $shouldShowMultilineTitle &&\n $isEllipsis &&\n css`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n white-space: normal;\n `}\n`;\n\nexport const StyledListItemHeadSubtitle = styled.div`\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-top: 2px;\n`;\n\ntype StyledListItemHeadSubtitleTextProps = WithTheme<{ $isOpen: boolean }>;\n\nexport const StyledListItemHeadSubtitleText = styled.span<StyledListItemHeadSubtitleTextProps>`\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n white-space: ${({ $isOpen }) => ($isOpen ? 'normal' : 'nowrap')};\n overflow: hidden;\n text-overflow: ellipsis;\n\n flex: 1 1 auto;\n font-size: 85%;\n min-width: 0;\n opacity: 0.75;\n`;\n\ntype StyledMotionListItemHeadHoverItemWrapperProps = WithTheme<unknown>;\n\nexport const StyledMotionListItemHeadHoverItemWrapper = styled(\n motion.div,\n)<StyledMotionListItemHeadHoverItemWrapperProps>`\n overflow: hidden;\n flex-shrink: 0;\n margin: auto 0;\n position: absolute;\n right: 0;\n\n background: ${({ theme }: StyledMotionListItemHeadHoverItemWrapperProps) =>\n `linear-gradient(to right, transparent 0px, rgb(${theme['000-rgb'] ?? ''}) 40px)`};\n`;\n\nexport const StyledMotionListItemHeadHoverItem = styled.div`\n padding-left: 40px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AAIoC,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,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GAAG;AACpD;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMgB,8BAA8B,GAAAzB,OAAA,CAAAyB,8BAAA,GAAGxB,yBAAM,CAACoB,IAAyC;AAC9F,mBAAmB,CAAC;EAAER;AAAQ,CAAC,KAAMA,OAAO,GAAG,MAAM,GAAG,QAAS;AACjE,mBAAmB,CAAC;EAAEA;AAAQ,CAAC,KAAMA,OAAO,GAAG,QAAQ,GAAG,QAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMa,wCAAwC,GAAA1B,OAAA,CAAA0B,wCAAA,GAAG,IAAAzB,yBAAM,EAC1D0B,aAAM,CAAClB,GACX,CAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEN;AAAqD,CAAC,KACnE,kDAAkDA,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS;AACzF,CAAC;AAEM,MAAMyB,iCAAiC,GAAA5B,OAAA,CAAA4B,iCAAA,GAAG3B,yBAAM,CAACQ,GAAG;AAC3D;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ListItemHead.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_list","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledListItemHead","exports","styled","LIST_ITEM_HEAD_HTML_TAG","theme","text","$isClickable","$isAnyItemExpandable","css","StyledListItemHeadLeftWrapper","div","StyledListItemHeadIndicator","LIST_ITEM_HEAD_INDICATOR_HTML_TAG","StyledListItemHeadContent","$isOpen","$isIconOrImageGiven","undefined","StyledListItemHeadTitle","LIST_ITEM_HEAD_TITLE_HTML_TAG","StyledListItemHeadTitleContent","StyledListItemHeadSubtitle","StyledMotionListItemHeadHoverItemWrapper","motion","StyledMotionListItemHeadHoverItem"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../../color-scheme-provider/ColorSchemeProvider';\nimport {\n LIST_ITEM_HEAD_HTML_TAG,\n LIST_ITEM_HEAD_INDICATOR_HTML_TAG,\n LIST_ITEM_HEAD_TITLE_HTML_TAG,\n} from '../../../../constants/list';\n\ntype StyledListItemHeadProps = WithTheme<{\n $isClickable: boolean;\n $isAnyItemExpandable: boolean;\n}>;\n\nexport const StyledListItemHead = styled[LIST_ITEM_HEAD_HTML_TAG]<StyledListItemHeadProps>`\n //align-items: center;\n overflow: hidden;\n color: ${({ theme }: StyledListItemHeadProps) => theme.text};\n display: flex;\n min-height: 64px;\n padding: 12px 9px;\n position: relative;\n width: 100%;\n justify-content: center;\n cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};\n\n ${({ $isAnyItemExpandable }) =>\n !$isAnyItemExpandable &&\n css`\n padding-left: 12px;\n `}\n`;\n\nexport const StyledListItemHeadLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: auto 0;\n`;\n\nexport const StyledListItemHeadIndicator = styled[LIST_ITEM_HEAD_INDICATOR_HTML_TAG]`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n height: 26px;\n justify-content: center;\n width: 26px;\n`;\n\ntype StyledListItemHeadContentProps = {\n $isIconOrImageGiven: boolean;\n $isOpen: boolean;\n};\n\nexport const StyledListItemHeadContent = styled.div<StyledListItemHeadContentProps>`\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n justify-content: center;\n line-height: normal;\n margin-left: ${({ $isIconOrImageGiven }) => ($isIconOrImageGiven ? '10px' : undefined)};\n min-width: 0;\n`;\n\nexport const StyledListItemHeadTitle = styled[LIST_ITEM_HEAD_TITLE_HTML_TAG]`\n align-items: center;\n display: flex;\n justify-content: space-between;\n`;\n\nexport const StyledListItemHeadTitleContent = styled.div`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n max-width: 100%;\n min-width: 0;\n position: relative;\n`;\n\nexport const StyledListItemHeadSubtitle = styled.div`\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-top: 2px;\n`;\n\ntype StyledMotionListItemHeadHoverItemWrapperProps = WithTheme<unknown>;\n\nexport const StyledMotionListItemHeadHoverItemWrapper = styled(\n motion.div,\n)<StyledMotionListItemHeadHoverItemWrapperProps>`\n overflow: hidden;\n flex-shrink: 0;\n margin: auto 0;\n position: absolute;\n right: 0;\n\n background: ${({ theme }: StyledMotionListItemHeadHoverItemWrapperProps) =>\n `linear-gradient(to right, transparent 0px, rgb(${theme['000-rgb'] ?? ''}) 40px)`};\n`;\n\nexport const StyledMotionListItemHeadHoverItem = styled.div`\n padding-left: 40px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AAIoC,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,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,C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AuB,GAAAhB,OAAA,CAAAgB,uBAAA,GAAGf,yBAAM,CAACgB,mCAA6B,CAAC;AAC5E;AACA;AACA;AACA,CAAC;AAEM,MAAMC,8BAA8B,GAAAlB,OAAA,CAAAkB,8BAAA,GAAGjB,yBAAM,CAACQ,GAAG;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMU,0BAA0B,GAAAnB,OAAA,CAAAmB,0BAAA,GAAGlB,yBAAM,CAACQ,GAAG;AACpD;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMW,wCAAwC,GAAApB,OAAA,CAAAoB,wCAAA,GAAG,IAAAnB,yBAAM,EAC1DoB,aAAM,CAACZ,GACX,CAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEN;AAAqD,CAAC,KACnE,kDAAkDA,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS;AACzF,CAAC;AAEM,MAAMmB,iCAAiC,GAAAtB,OAAA,CAAAsB,iCAAA,GAAGrB,yBAAM,CAACQ,GAAG;AAC3D;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _ListItemRightElement = require("./ListItemRightElement.styles");
9
+ var _accordion = require("../../../../../utils/accordion");
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
+ const ListItemRightElement = ({
12
+ rightElements
13
+ }) => {
14
+ const handlePreventClick = event => {
15
+ event.stopPropagation();
16
+ event.preventDefault();
17
+ };
18
+ const centerElement = (0, _react.useMemo)(() => {
19
+ if (typeof rightElements === 'string' || /*#__PURE__*/(0, _react.isValidElement)(rightElements)) {
20
+ return rightElements;
21
+ }
22
+ if (typeof rightElements === 'object' && rightElements && 'center' in rightElements) {
23
+ return rightElements.center;
24
+ }
25
+ return undefined;
26
+ }, [rightElements]);
27
+ const shouldPreventRightElementClick = (0, _react.useMemo)(() => {
28
+ if (centerElement) {
29
+ return (0, _accordion.getElementClickEvent)(centerElement);
30
+ }
31
+ return false;
32
+ }, [centerElement]);
33
+ if (!centerElement) {
34
+ return null;
35
+ }
36
+ return /*#__PURE__*/_react.default.createElement(_ListItemRightElement.StyledListItemRightElement, {
37
+ onClick: shouldPreventRightElementClick ? handlePreventClick : undefined
38
+ }, centerElement);
39
+ };
40
+ ListItemRightElement.displayName = 'ListItemRightElement';
41
+ var _default = exports.default = ListItemRightElement;
42
+ //# sourceMappingURL=ListItemRightElement.js.map