@bikdotai/bik-component-library 0.0.876-beta.0 → 0.0.876-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.js +2 -2
- package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.js.map +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +4 -4
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js.map +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +2 -2
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js.map +1 -1
- package/dist/cjs/components/accordion/Accordion.style.js +1 -1
- package/dist/cjs/components/accordion/Accordion.style.js.map +1 -1
- package/dist/cjs/components/action-button/ActionButton.styled.js +1 -1
- package/dist/cjs/components/action-button/ActionButton.styled.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/CommonStyles.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/CommonStyles.js.map +1 -1
- package/dist/cjs/components/bik-layout/SidebarStyles.js +1 -1
- package/dist/cjs/components/bik-layout/SidebarStyles.js.map +1 -1
- package/dist/cjs/components/button/Button.styled.js +3 -3
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/buttonGroup/ButtonGroupStyle.js +1 -1
- package/dist/cjs/components/buttonGroup/ButtonGroupStyle.js.map +1 -1
- package/dist/cjs/components/card-selector/CardSelector.styled.js +1 -1
- package/dist/cjs/components/card-selector/CardSelector.styled.js.map +1 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.js +2 -2
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.js.map +1 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
- package/dist/cjs/components/dropdown/MenuItem/MenuItem.js +1 -1
- package/dist/cjs/components/dropdown/MenuItem/MenuItem.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +10 -27
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js +2 -2
- package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js.map +1 -1
- package/dist/cjs/components/floating-action-button/FloatingActionButton.styles.js +1 -1
- package/dist/cjs/components/floating-action-button/FloatingActionButton.styles.js.map +1 -1
- package/dist/cjs/components/icon-button/IconButton.styled.js +4 -4
- package/dist/cjs/components/icon-button/IconButton.styled.js.map +1 -1
- package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
- package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js +11 -14
- package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
- package/dist/cjs/components/plans/SubscriptionPlanSelector.js +1 -1
- package/dist/cjs/components/plans/SubscriptionPlanSelector.js.map +1 -1
- package/dist/cjs/components/product-picker-v2/style.js +2 -2
- package/dist/cjs/components/product-picker-v2/style.js.map +1 -1
- package/dist/cjs/components/switch/Switch.js +2 -2
- package/dist/cjs/components/switch/Switch.js.map +1 -1
- package/dist/cjs/components/template-preview/RCS/RCSPreview.styled.js +1 -1
- package/dist/cjs/components/template-preview/RCS/RCSPreview.styled.js.map +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js.map +1 -1
- package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js +2 -2
- package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js.map +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +4 -4
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js.map +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +2 -2
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js.map +1 -1
- package/dist/esm/components/accordion/Accordion.style.js +1 -1
- package/dist/esm/components/accordion/Accordion.style.js.map +1 -1
- package/dist/esm/components/action-button/ActionButton.styled.js +1 -1
- package/dist/esm/components/action-button/ActionButton.styled.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.js.map +1 -1
- package/dist/esm/components/bik-layout/SidebarStyles.js +1 -1
- package/dist/esm/components/bik-layout/SidebarStyles.js.map +1 -1
- package/dist/esm/components/button/Button.styled.js +3 -3
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.js +1 -1
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.js.map +1 -1
- package/dist/esm/components/card-selector/CardSelector.styled.js +1 -1
- package/dist/esm/components/card-selector/CardSelector.styled.js.map +1 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.style.js +2 -2
- package/dist/esm/components/carousel-preview/CarouselPreview.style.js.map +1 -1
- package/dist/esm/components/checkBox/CheckBox.styled.js +1 -1
- package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
- package/dist/esm/components/dropdown/MenuItem/MenuItem.js +1 -1
- package/dist/esm/components/dropdown/MenuItem/MenuItem.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +278 -300
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +0 -8
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +126 -170
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +0 -4
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +112 -144
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +31 -32
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +0 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +39 -54
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +16 -18
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +27 -73
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
- package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +17 -4
- package/dist/esm/components/dropdown/hooks/useDropdown.js +163 -176
- package/dist/esm/components/dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/type.d.ts +0 -22
- package/dist/esm/components/dual-icon-button/DualIconButton.styled.js +2 -2
- package/dist/esm/components/dual-icon-button/DualIconButton.styled.js.map +1 -1
- package/dist/esm/components/floating-action-button/FloatingActionButton.styles.js +1 -1
- package/dist/esm/components/floating-action-button/FloatingActionButton.styles.js.map +1 -1
- package/dist/esm/components/icon-button/IconButton.styled.js +4 -4
- package/dist/esm/components/icon-button/IconButton.styled.js.map +1 -1
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +44 -46
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +0 -3
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js +25 -29
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
- package/dist/esm/components/multi-level-dropdown/type.d.ts +0 -5
- package/dist/esm/components/plans/SubscriptionPlanSelector.js +1 -1
- package/dist/esm/components/plans/SubscriptionPlanSelector.js.map +1 -1
- package/dist/esm/components/product-picker-v2/style.js +2 -2
- package/dist/esm/components/product-picker-v2/style.js.map +1 -1
- package/dist/esm/components/switch/Switch.js +2 -2
- package/dist/esm/components/switch/Switch.js.map +1 -1
- package/dist/esm/components/template-preview/RCS/RCSPreview.styled.js +1 -1
- package/dist/esm/components/template-preview/RCS/RCSPreview.styled.js.map +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpennedDropdown.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/components/OpennedDropdown.tsx"],"sourcesContent":["import ErrorInfoIcon from '@src/assets/icons/errorInfo.svg';\nimport RetryIcon from '@src/assets/icons/refresh-purple.svg';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { useOutside } from '@src/hooks/useOutside';\nimport { COLORS } from '@src/constants/Theme';\nimport { useDropdown } from '../../hooks/useDropdown';\nimport {\n\tDropdownOption,\n\tGroupedOption,\n\tMultiSelectOption,\n\tOpenDropdownProps,\n\tSingleOption,\n} from '../../type';\nimport {\n\tflattenSelectableOptions,\n\tgetNestedParentValues,\n} from '../utils/iterationOnOptions';\nimport { Description } from './description/Description';\nimport { FreeFormMenu } from './menu/FreeFormMenu';\nimport { MenuList } from './menu/MenuList';\nimport { SelectAllMenu } from './menu/SelectAllMenu';\nimport MultiSelectDropdownBottomBar from './multiSelect/MultiSelectDropdownBottomBar';\nimport {\n\tMenuListContainer,\n\tOpennedDropdownContainer,\n} from './OpennedDropdown.styled';\nimport { SearchBox } from './searchbox/SearchBox';\nimport { SearchZeroState } from './searchbox/SearchZeroState';\n\n/** CONSTANTS */\nconst defaults = {\n\theight: 304,\n\twidth: 290,\n};\n\nexport const OpenedDropdown: React.FC<OpenDropdownProps> = ({\n\toptions,\n\tisSearchable,\n\tsearchPlaceholder,\n\tstaticMenuHeight,\n\tisMultiSelect,\n\tmaxSelections,\n\twidth,\n\tallowFreeForm,\n\theight,\n\tonClose,\n\tonSelect,\n\tonSearch,\n\tversion,\n\tskipSorting,\n\theaderRef,\n\thideSelectAll,\n\tprimaryButtonText,\n\tonInfiniteScroll,\n\tonMultiSelectClear: onMultiSelectClearProp,\n\tonDropdownItemClick,\n\tbuttonOptions,\n\tisSearchLoading,\n\tisOptionsLoading,\n\toptionsErrorState,\n\tdisableSearchOptions,\n\tdisableSearchedOptionExcept,\n\tuseDefaultCursor,\n\tcontainerStyle = {},\n\tzeroState = undefined,\n\tisDraggable = false,\n\tonOptionsReorder,\n\thideClearButton = false,\n\tshowCheckboxForCustomElement = false,\n\tcheckboxActiveColor,\n\tbrandSelectedRow,\n\tchildrenLayout,\n\tcollapsibleChildren,\n\tdefaultCollapsed,\n\thideSelectedCount,\n}) => {\n\t// Sort options with selected at top, unselected at bottom, maintaining order within groups\n\tconst sortOptionsWithSelectedOnTop = useCallback(\n\t\t(opts: DropdownOption[]): DropdownOption[] => {\n\t\t\tif (!isDraggable || !isMultiSelect) return opts;\n\n\t\t\tconst selected: DropdownOption[] = [];\n\t\t\tconst unselected: DropdownOption[] = [];\n\n\t\t\topts.forEach((option) => {\n\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t// Handle grouped options - maintain grouping\n\t\t\t\t\tunselected.push(option);\n\t\t\t\t} else {\n\t\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\t\tif (singleOption.selected) {\n\t\t\t\t\t\tselected.push(option);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunselected.push(option);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn [...selected, ...unselected];\n\t\t},\n\t\t[isDraggable, isMultiSelect],\n\t);\n\n\tconst [localOptions, setLocalOptions] = useState<DropdownOption[]>(() =>\n\t\tsortOptionsWithSelectedOnTop(options),\n\t);\n\tconst localOptionsRef = useRef<DropdownOption[]>(localOptions);\n\tconst hasReorderedRef = useRef(false);\n\tconst onOptionsReorderRef = useRef(onOptionsReorder);\n\n\tuseEffect(() => {\n\t\tsetLocalOptions(sortOptionsWithSelectedOnTop(options));\n\t}, [options, sortOptionsWithSelectedOnTop]);\n\n\tuseEffect(() => {\n\t\tlocalOptionsRef.current = localOptions;\n\t}, [localOptions]);\n\n\tuseEffect(() => {\n\t\tonOptionsReorderRef.current = onOptionsReorder;\n\t}, [onOptionsReorder]);\n\n\t// Fire onOptionsReorder on unmount (dropdown close from Apply or click-outside)\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (hasReorderedRef.current && onOptionsReorderRef.current) {\n\t\t\t\tonOptionsReorderRef.current(localOptionsRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst handleOptionsReorder = useCallback(\n\t\t(reorderedOptions: DropdownOption[]) => {\n\t\t\tsetLocalOptions(reorderedOptions);\n\t\t\t// For version 2.0 (no Apply button), apply reorder immediately\n\t\t\tif (version === '2.0') {\n\t\t\t\tonOptionsReorder?.(reorderedOptions);\n\t\t\t} else {\n\t\t\t\t// For version 1.0, defer until Apply/close (handled by unmount cleanup)\n\t\t\t\thasReorderedRef.current = true;\n\t\t\t}\n\t\t},\n\t\t[onOptionsReorder, version],\n\t);\n\n\tconst optionsToUse = isDraggable ? localOptions : options;\n\tconst {\n\t\tdropdownOptions,\n\t\tsearch,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tsearchError,\n\t\tretrySearch,\n\t\tonApplyHandler,\n\t\tselectAllHandler,\n\t\tonMultiSelectClear,\n\t\tonFreeFormSelect,\n\t\tonMultiSelectApply,\n\t\tlatestDropdownOptionsRef,\n\t\tgetSelectedOptions,\n\t\tgetCurrentSelectionCount,\n\t} = useDropdown(\n\t\tversion,\n\t\toptionsToUse,\n\t\tonSelect,\n\t\tskipSorting || isDraggable,\n\t\tisMultiSelect,\n\t\tonSearch,\n\t\tdisableSearchOptions,\n\t\tdisableSearchedOptionExcept,\n\t\tmaxSelections,\n\t\tchildrenLayout,\n\t);\n\tconst [widthState, setWidthState] = useState(width ?? defaults.width);\n\tconst [descriptionInfo, setDescription] = useState<{\n\t\ttitle: string;\n\t\tdescription: string;\n\t} | null>(null);\n\tconst [focusedIndex, setFocusedIndex] = useState<number>(-1);\n\tconst [collapsedParents, setCollapsedParents] = useState<string[]>(() =>\n\t\tcollapsibleChildren && defaultCollapsed\n\t\t\t? getNestedParentValues(options)\n\t\t\t: [],\n\t);\n\n\t// Options can arrive after mount, so parents seen later start collapsed too -\n\t// without re-collapsing groups the user has since expanded.\n\tconst seededCollapsedParents = useRef<string[]>(collapsedParents);\n\tuseEffect(() => {\n\t\tif (!collapsibleChildren || !defaultCollapsed) return;\n\t\tconst unseen = getNestedParentValues(options).filter(\n\t\t\t(value) => !seededCollapsedParents.current.includes(value),\n\t\t);\n\t\tif (!unseen.length) return;\n\t\tseededCollapsedParents.current = [\n\t\t\t...seededCollapsedParents.current,\n\t\t\t...unseen,\n\t\t];\n\t\tsetCollapsedParents((previous) => [...previous, ...unseen]);\n\t}, [options, collapsibleChildren, defaultCollapsed]);\n\n\tconst handleToggleCollapsed = (value: string) => {\n\t\tsetCollapsedParents((previous) =>\n\t\t\tprevious.includes(value)\n\t\t\t\t? previous.filter((entry) => entry !== value)\n\t\t\t\t: [...previous, value],\n\t\t);\n\t\tsetFocusedIndex(-1);\n\t};\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst childRefs = useRef([]);\n\tconst menuListRef = useRef<HTMLDivElement>(null);\n\tuseOutside(\n\t\tref,\n\t\t() => {\n\t\t\tsetDescription(null);\n\t\t\tif (isMultiSelect && version === '2.0') {\n\t\t\t\tconst optionsToSend = getSelectedOptions(\n\t\t\t\t\tlatestDropdownOptionsRef.current,\n\t\t\t\t);\n\t\t\t\tonClose?.(optionsToSend);\n\t\t\t} else {\n\t\t\t\tonClose?.(dropdownOptions);\n\t\t\t}\n\t\t},\n\t\t[headerRef, childRefs],\n\t);\n\n\t// Auto-focus dropdown when it opens for keyboard navigation while preventing scroll to maintain popper positioning\n\tuseEffect(() => {\n\t\tconst timer = setTimeout(() => {\n\t\t\tif (ref.current) {\n\t\t\t\tref.current.focus({ preventScroll: true });\n\t\t\t}\n\t\t}, 0);\n\t\treturn () => clearTimeout(timer);\n\t}, []);\n\n\t/** Keyboard navigation handler */\n\tuseEffect(() => {\n\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\tconst currentOptions =\n\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions;\n\t\t\tconst flattenedOptions = flattenSelectableOptions(\n\t\t\t\tcurrentOptions,\n\t\t\t\tchildrenLayout === 'nested' ? { collapsedParents } : undefined,\n\t\t\t);\n\n\t\t\tif (flattenedOptions.length === 0) return;\n\n\t\t\tif (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev < flattenedOptions.length - 1 ? prev + 1 : 0;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'ArrowUp') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev > 0 ? prev - 1 : flattenedOptions.length - 1;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'Enter' && focusedIndex >= 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst focusedOption = flattenedOptions[focusedIndex];\n\t\t\t\tif (focusedOption) {\n\t\t\t\t\t// onApplyHandler handles the selection state and calls onSelect internally\n\t\t\t\t\tonApplyHandler({\n\t\t\t\t\t\t...focusedOption,\n\t\t\t\t\t\tselected: !focusedOption.selected,\n\t\t\t\t\t});\n\t\t\t\t\t// Also trigger onDropdownItemClick if provided\n\t\t\t\t\tif (onDropdownItemClick) {\n\t\t\t\t\t\tonDropdownItemClick(focusedOption);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst dropdownElement = ref.current;\n\t\tif (dropdownElement) {\n\t\t\tdropdownElement.addEventListener('keydown', handleKeyDown);\n\t\t\treturn () => {\n\t\t\t\tdropdownElement.removeEventListener('keydown', handleKeyDown);\n\t\t\t};\n\t\t}\n\t}, [\n\t\tfocusedIndex,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tdropdownOptions,\n\t\tonSearch,\n\t\tonApplyHandler,\n\t\tonDropdownItemClick,\n\t\tchildrenLayout,\n\t\tcollapsedParents,\n\t]);\n\n\t// LOCAL CONSTANTS\n\tconst heightToUse = height ?? defaults.height;\n\tconst menuListMaxHeight =\n\t\ttypeof heightToUse === 'number'\n\t\t\t? isSearchable && isMultiSelect\n\t\t\t\t? heightToUse - 96\n\t\t\t\t: (isSearchable && !isMultiSelect) || (!isSearchable && isMultiSelect)\n\t\t\t\t? heightToUse - 48\n\t\t\t\t: heightToUse\n\t\t\t: heightToUse;\n\n\tfunction showDescription(title?: string, description?: string) {\n\t\tif (title && description) {\n\t\t\tsetDescription({\n\t\t\t\ttitle,\n\t\t\t\tdescription,\n\t\t\t});\n\t\t} else {\n\t\t\tsetDescription(null);\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tconst widthToUse = width ?? defaults.width;\n\t\tif (descriptionInfo === null) {\n\t\t\tsetWidthState(widthToUse);\n\t\t} else if (typeof widthToUse === 'number') {\n\t\t\tsetWidthState(widthToUse * 2);\n\t\t} else if (typeof widthToUse === 'string') {\n\t\t\tif (widthToUse.endsWith('px')) {\n\t\t\t\tconst newWidth = parseInt(widthToUse.replace('px', '')) * 2;\n\t\t\t\tsetWidthState(newWidth);\n\t\t\t}\n\t\t}\n\t}, [descriptionInfo]);\n\n\t/**\n\t * This is to show the search result in a stateless way\n\t */\n\n\tconst exactMatchFound: boolean[] = [];\n\n\tconst processOptionsWithMaxSelections = (\n\t\toptionsToProcess: DropdownOption[],\n\t) => {\n\t\tif (!isMultiSelect || (!maxSelections && maxSelections !== 0)) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Count from the full options list (not the filtered subset) so selections\n\t\t// hidden by a search query are still included in the limit check.\n\t\tconst currentSelectionCount = getCurrentSelectionCount(dropdownOptions);\n\t\tconst maxSelectionsReached = currentSelectionCount >= maxSelections;\n\n\t\tif (!maxSelectionsReached) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Disable unselected options when max selections is reached\n\t\treturn optionsToProcess.map((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\treturn {\n\t\t\t\t\t...option,\n\t\t\t\t\toptions: (option as GroupedOption).options.map((nestedOption) => ({\n\t\t\t\t\t\t...nestedOption,\n\t\t\t\t\t\tdisabled:\n\t\t\t\t\t\t\tnestedOption.disabled ||\n\t\t\t\t\t\t\t(!nestedOption.selected && maxSelectionsReached),\n\t\t\t\t\t})),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst disableUnselected = (row: SingleOption) => ({\n\t\t\t\t...row,\n\t\t\t\tdisabled: row.disabled || !row.selected,\n\t\t\t});\n\t\t\tconst singleOption = disableUnselected(option as SingleOption);\n\n\t\t\treturn childrenLayout === 'nested' && singleOption.children?.length\n\t\t\t\t? {\n\t\t\t\t\t\t...singleOption,\n\t\t\t\t\t\tchildren: singleOption.children.map(disableUnselected),\n\t\t\t\t }\n\t\t\t\t: singleOption;\n\t\t});\n\t};\n\n\tconst optionsToShow = processOptionsWithMaxSelections(\n\t\t(searchedString && onSearch ? searchedOptions : dropdownOptions)\n\t\t\t.map((option) => {\n\t\t\t\tif (searchedString && !onSearch) {\n\t\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t\tconst groupedOption = { ...option } as GroupedOption;\n\t\t\t\t\t\tgroupedOption.options = groupedOption.options.filter((op) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\top.label?.toLowerCase().includes(searchedString.toLowerCase())\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t\t!searchedString || op.label === searchedString,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn groupedOption.options.length > 0 ? groupedOption : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\toption.label\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase()) ||\n\t\t\t\t\t\t\t(option as SingleOption | MultiSelectOption).searchKey\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase())\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t!searchedString || option.label === searchedString,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn option;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn option;\n\t\t\t})\n\t\t\t.filter((option) => option !== null) as DropdownOption[],\n\t);\n\n\tconst noResultForSearch =\n\t\t!!isSearchable && searchedString && optionsToShow.length === 0;\n\tconst showLoadingState = !searchedString && !!isOptionsLoading;\n\tconst showErrorState =\n\t\t!searchedString && !!optionsErrorState && !showLoadingState;\n\tconst showEmptyState =\n\t\t!searchedString &&\n\t\t!optionsToShow.length &&\n\t\t!showLoadingState &&\n\t\t!showErrorState;\n\tconst showTopLevelZeroState =\n\t\tshowLoadingState || showErrorState || showEmptyState;\n\n\tconst emptyStateTitle = zeroState?.title || 'No results found';\n\tconst emptyStateSubTitle =\n\t\tzeroState?.subTitle ||\n\t\t`Please try again later or contact us at support@bik.ai if you require further assistance.`;\n\tconst errorStateTitle = optionsErrorState?.title || 'Failed to load options';\n\tconst errorStateSubTitle =\n\t\toptionsErrorState?.subTitle ||\n\t\t'Something went wrong while fetching the list. Please try again';\n\tconst defaultErrorActionButton = {\n\t\tbuttonText: 'Try again',\n\t\tbuttonType: 'text' as const,\n\t\tsize: 'small' as const,\n\t\tbuttonTextColor: COLORS.background.inverseLight,\n\t\tcustomIconColor: COLORS.background.inverseLight,\n\t\tLeadingIcon: RetryIcon,\n\t};\n\n\tconst mergedErrorState = {\n\t\tIconHolderStyle: {\n\t\t\tbackground: COLORS.background.negative.light,\n\t\t},\n\t\tIcon: (\n\t\t\t<ErrorInfoIcon color={COLORS.content.negative} width={24} height={24} />\n\t\t),\n\t\t...optionsErrorState,\n\t};\n\tmergedErrorState.actionButton = {\n\t\t...defaultErrorActionButton,\n\t\t...(optionsErrorState?.actionButton ?? {}),\n\t};\n\tconst zeroStateProps = showLoadingState\n\t\t? undefined\n\t\t: showErrorState\n\t\t? mergedErrorState\n\t\t: zeroState;\n\n\treturn (\n\t\t<OpennedDropdownContainer\n\t\t\tversion={version}\n\t\t\tref={ref}\n\t\t\ttabIndex={-1}\n\t\t\tstyle={{\n\t\t\t\t// maxWidth: descriptionInfo ? 800 : 400,\n\t\t\t\twidth: widthState,\n\t\t\t\t...containerStyle,\n\t\t\t\toutline: 'none',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: descriptionInfo ? '50%' : '100%',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tbackground: 'white',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!!isSearchable && (\n\t\t\t\t\t<SearchBox\n\t\t\t\t\t\tonSearch={search}\n\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{showTopLevelZeroState ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-testid=\"dropdown-options-zero-state\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: staticMenuHeight ? menuListMaxHeight : heightToUse,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tbackground: COLORS.background.base,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZeroState\n\t\t\t\t\t\t\t{...(zeroStateProps ?? {})}\n\t\t\t\t\t\t\tisLoading={showLoadingState}\n\t\t\t\t\t\t\ttitle={showErrorState ? errorStateTitle : emptyStateTitle}\n\t\t\t\t\t\t\tsubTitle={\n\t\t\t\t\t\t\t\tshowErrorState ? errorStateSubTitle : emptyStateSubTitle\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<MenuListContainer\n\t\t\t\t\t\tdata-testid=\"dropdown-menu-list\"\n\t\t\t\t\t\tminHeight={staticMenuHeight ? menuListMaxHeight : undefined}\n\t\t\t\t\t\tmaxHeight={menuListMaxHeight}\n\t\t\t\t\t\tref={menuListRef}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!isMultiSelect && !noResultForSearch && !hideSelectAll && (\n\t\t\t\t\t\t\t<SelectAllMenu\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\toptions={\n\t\t\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSelect={selectAllHandler}\n\t\t\t\t\t\t\t\tcheckboxActiveColor={checkboxActiveColor}\n\t\t\t\t\t\t\t\tbrandSelectedRow={brandSelectedRow}\n\t\t\t\t\t\t\t\tchildrenLayout={childrenLayout}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!allowFreeForm && noResultForSearch && (\n\t\t\t\t\t\t\t<SearchZeroState\n\t\t\t\t\t\t\t\tisLoading={isSearchLoading}\n\t\t\t\t\t\t\t\terrorMessage={searchError}\n\t\t\t\t\t\t\t\tonRetry={retrySearch}\n\t\t\t\t\t\t\t\theight={menuListMaxHeight as number}\n\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\tcontainerWidth={width}\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{allowFreeForm &&\n\t\t\t\t\t\t\t(noResultForSearch ||\n\t\t\t\t\t\t\t\t(!!exactMatchFound.length &&\n\t\t\t\t\t\t\t\t\texactMatchFound.every((val) => val === false))) && (\n\t\t\t\t\t\t\t\t<FreeFormMenu\n\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\t\tonSelect={onFreeFormSelect}\n\t\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\t\tcheckboxActiveColor={checkboxActiveColor}\n\t\t\t\t\t\t\t\t\tbrandSelectedRow={brandSelectedRow}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<MenuList\n\t\t\t\t\t\t\tonInfiniteScroll={onInfiniteScroll}\n\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\tonSelect={onApplyHandler}\n\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\toptions={optionsToShow}\n\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\tref={childRefs}\n\t\t\t\t\t\t\tfocusedIndex={focusedIndex}\n\t\t\t\t\t\t\tisDraggable={isDraggable}\n\t\t\t\t\t\t\tonOptionsReorder={handleOptionsReorder}\n\t\t\t\t\t\t\tshowCheckboxForCustomElement={showCheckboxForCustomElement}\n\t\t\t\t\t\t\tcheckboxActiveColor={checkboxActiveColor}\n\t\t\t\t\t\t\tbrandSelectedRow={brandSelectedRow}\n\t\t\t\t\t\t\tchildrenLayout={childrenLayout}\n\t\t\t\t\t\t\tcollapsibleChildren={collapsibleChildren}\n\t\t\t\t\t\t\tcollapsedParents={collapsedParents}\n\t\t\t\t\t\t\tonToggleCollapsed={handleToggleCollapsed}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuListContainer>\n\t\t\t\t)}\n\t\t\t\t{!!isMultiSelect && !showTopLevelZeroState && version !== '2.0' && (\n\t\t\t\t\t<MultiSelectDropdownBottomBar\n\t\t\t\t\t\tonClear={() => {\n\t\t\t\t\t\t\tonMultiSelectClear();\n\t\t\t\t\t\t\tonMultiSelectClearProp?.();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonApply={onMultiSelectApply}\n\t\t\t\t\t\tlist={\n\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuttonText={primaryButtonText}\n\t\t\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t\t\t\thideClearButton={hideClearButton}\n\t\t\t\t\t\thideSelectedCount={hideSelectedCount}\n\t\t\t\t\t\tchildrenLayout={childrenLayout}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!!descriptionInfo && (\n\t\t\t\t<Description\n\t\t\t\t\ttitle={descriptionInfo.title}\n\t\t\t\t\tdescription={descriptionInfo.description}\n\t\t\t\t\tversion={version}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</OpennedDropdownContainer>\n\t);\n};\n"],"names":["defaults","OpenedDropdown","options","isSearchable","searchPlaceholder","staticMenuHeight","isMultiSelect","maxSelections","width","allowFreeForm","height","onClose","onSelect","onSearch","version","skipSorting","headerRef","hideSelectAll","primaryButtonText","onInfiniteScroll","onMultiSelectClearProp","onDropdownItemClick","buttonOptions","isSearchLoading","isOptionsLoading","optionsErrorState","disableSearchOptions","disableSearchedOptionExcept","useDefaultCursor","containerStyle","zeroState","isDraggable","onOptionsReorder","hideClearButton","showCheckboxForCustomElement","checkboxActiveColor","brandSelectedRow","childrenLayout","collapsibleChildren","defaultCollapsed","hideSelectedCount","sortOptionsWithSelectedOnTop","useCallback","opts","selected","unselected","option","localOptions","setLocalOptions","useState","localOptionsRef","useRef","hasReorderedRef","onOptionsReorderRef","useEffect","handleOptionsReorder","reorderedOptions","optionsToUse","dropdownOptions","search","searchedString","searchedOptions","searchError","retrySearch","onApplyHandler","selectAllHandler","onMultiSelectClear","onFreeFormSelect","onMultiSelectApply","latestDropdownOptionsRef","getSelectedOptions","getCurrentSelectionCount","useDropdown","widthState","setWidthState","descriptionInfo","setDescription","focusedIndex","setFocusedIndex","collapsedParents","setCollapsedParents","getNestedParentValues","seededCollapsedParents","unseen","value","previous","handleToggleCollapsed","entry","ref","childRefs","menuListRef","useOutside","optionsToSend","timer","handleKeyDown","e","flattenedOptions","flattenSelectableOptions","prev","newIndex","focusedElement","focusedOption","dropdownElement","heightToUse","menuListMaxHeight","showDescription","title","description","widthToUse","newWidth","exactMatchFound","optionsToShow","optionsToProcess","maxSelectionsReached","nestedOption","disableUnselected","row","singleOption","groupedOption","op","noResultForSearch","showLoadingState","showErrorState","showEmptyState","showTopLevelZeroState","emptyStateTitle","emptyStateSubTitle","errorStateTitle","errorStateSubTitle","defaultErrorActionButton","COLORS","RetryIcon","mergedErrorState","jsx","ErrorInfoIcon","zeroStateProps","jsxs","OpennedDropdownContainer","SearchBox","ZeroState","MenuListContainer","SelectAllMenu","SearchZeroState","val","FreeFormMenu","MenuList","MultiSelectDropdownBottomBar","Description"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,MAAMA,KAAW;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AACR,GAEaC,KAA8C,CAAC;AAAA,EAC3D,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAoBC;AAAA,EACpB,qBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,gBAAAC,KAAiB,CAAA;AAAA,EACjB,WAAAC,IAAY;AAAA,EACZ,aAAAC,IAAc;AAAA,EACd,kBAAAC;AAAA,EACA,iBAAAC,KAAkB;AAAA,EAClB,8BAAAC,KAA+B;AAAA,EAC/B,qBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AACD,MAAM;AAEL,QAAMC,IAA+BC;AAAA,IACpC,CAACC,MAA6C;AAC7C,UAAI,CAACZ,KAAe,CAACzB,EAAe,QAAOqC;AAE3C,YAAMC,IAA6B,CAAA,GAC7BC,IAA+B,CAAA;AAErC,aAAAF,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gBAAAC;AAAA,wBACA,qBAAAC;AAAA,wBACA,kBAAAyC;AAAA,wBACA,mBAAmBO;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACpB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGD,CAAC,CAAChF,KAAiB,CAACsH,MAAyB9G,MAAY,SACzD,gBAAAuH;AAAA,gBAACa;AAAA,gBAAA;AAAA,kBACA,SAAS,MAAM;AACd,oBAAAhF,GAAA,GACA9C,KAAA;AAAA,kBACD;AAAA,kBACA,SAASgD;AAAA,kBACT,MACCR,KAAkB/C,IAAWgD,IAAkBH;AAAA,kBAEhD,YAAYxC;AAAA,kBACZ,eAAAI;AAAA,kBACA,iBAAAW;AAAA,kBACA,mBAAAO;AAAA,kBACA,gBAAAH;AAAA,gBAAA;AAAA,cAAA;AAAA,YACD;AAAA,UAAA;AAAA,QAAA;AAAA,QAGD,CAAC,CAACsC,KACF,gBAAA0D;AAAA,UAACc;AAAA,UAAA;AAAA,YACA,OAAOxE,EAAgB;AAAA,YACvB,aAAaA,EAAgB;AAAA,YAC7B,SAAA7D;AAAA,UAAA;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAIJ;"}
|
|
1
|
+
{"version":3,"file":"OpennedDropdown.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/components/OpennedDropdown.tsx"],"sourcesContent":["import ErrorInfoIcon from '@src/assets/icons/errorInfo.svg';\nimport RetryIcon from '@src/assets/icons/refresh-purple.svg';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { useOutside } from '@src/hooks/useOutside';\nimport { COLORS } from '@src/constants/Theme';\nimport { useDropdown } from '../../hooks/useDropdown';\nimport {\n\tDropdownOption,\n\tGroupedOption,\n\tMultiSelectOption,\n\tOpenDropdownProps,\n\tSingleOption,\n} from '../../type';\nimport { Description } from './description/Description';\nimport { FreeFormMenu } from './menu/FreeFormMenu';\nimport { MenuList } from './menu/MenuList';\nimport { SelectAllMenu } from './menu/SelectAllMenu';\nimport MultiSelectDropdownBottomBar from './multiSelect/MultiSelectDropdownBottomBar';\nimport {\n\tMenuListContainer,\n\tOpennedDropdownContainer,\n} from './OpennedDropdown.styled';\nimport { SearchBox } from './searchbox/SearchBox';\nimport { SearchZeroState } from './searchbox/SearchZeroState';\n\n/** CONSTANTS */\nconst defaults = {\n\theight: 304,\n\twidth: 290,\n};\n\nexport const OpenedDropdown: React.FC<OpenDropdownProps> = ({\n\toptions,\n\tisSearchable,\n\tsearchPlaceholder,\n\tstaticMenuHeight,\n\tisMultiSelect,\n\tmaxSelections,\n\twidth,\n\tallowFreeForm,\n\theight,\n\tonClose,\n\tonSelect,\n\tonSearch,\n\tversion,\n\tskipSorting,\n\theaderRef,\n\thideSelectAll,\n\tprimaryButtonText,\n\tonInfiniteScroll,\n\tonMultiSelectClear: onMultiSelectClearProp,\n\tonDropdownItemClick,\n\tbuttonOptions,\n\tisSearchLoading,\n\tisOptionsLoading,\n\toptionsErrorState,\n\tdisableSearchOptions,\n\tdisableSearchedOptionExcept,\n\tuseDefaultCursor,\n\tcontainerStyle = {},\n\tzeroState = undefined,\n\tisDraggable = false,\n\tonOptionsReorder,\n\thideClearButton = false,\n\tshowCheckboxForCustomElement = false,\n\tcheckboxActiveColor,\n\tbrandSelectedRow,\n}) => {\n\t// Sort options with selected at top, unselected at bottom, maintaining order within groups\n\tconst sortOptionsWithSelectedOnTop = useCallback(\n\t\t(opts: DropdownOption[]): DropdownOption[] => {\n\t\t\tif (!isDraggable || !isMultiSelect) return opts;\n\n\t\t\tconst selected: DropdownOption[] = [];\n\t\t\tconst unselected: DropdownOption[] = [];\n\n\t\t\topts.forEach((option) => {\n\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t// Handle grouped options - maintain grouping\n\t\t\t\t\tunselected.push(option);\n\t\t\t\t} else {\n\t\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\t\tif (singleOption.selected) {\n\t\t\t\t\t\tselected.push(option);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunselected.push(option);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn [...selected, ...unselected];\n\t\t},\n\t\t[isDraggable, isMultiSelect],\n\t);\n\n\tconst [localOptions, setLocalOptions] = useState<DropdownOption[]>(() =>\n\t\tsortOptionsWithSelectedOnTop(options),\n\t);\n\tconst localOptionsRef = useRef<DropdownOption[]>(localOptions);\n\tconst hasReorderedRef = useRef(false);\n\tconst onOptionsReorderRef = useRef(onOptionsReorder);\n\n\tuseEffect(() => {\n\t\tsetLocalOptions(sortOptionsWithSelectedOnTop(options));\n\t}, [options, sortOptionsWithSelectedOnTop]);\n\n\tuseEffect(() => {\n\t\tlocalOptionsRef.current = localOptions;\n\t}, [localOptions]);\n\n\tuseEffect(() => {\n\t\tonOptionsReorderRef.current = onOptionsReorder;\n\t}, [onOptionsReorder]);\n\n\t// Fire onOptionsReorder on unmount (dropdown close from Apply or click-outside)\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (hasReorderedRef.current && onOptionsReorderRef.current) {\n\t\t\t\tonOptionsReorderRef.current(localOptionsRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst handleOptionsReorder = useCallback(\n\t\t(reorderedOptions: DropdownOption[]) => {\n\t\t\tsetLocalOptions(reorderedOptions);\n\t\t\t// For version 2.0 (no Apply button), apply reorder immediately\n\t\t\tif (version === '2.0') {\n\t\t\t\tonOptionsReorder?.(reorderedOptions);\n\t\t\t} else {\n\t\t\t\t// For version 1.0, defer until Apply/close (handled by unmount cleanup)\n\t\t\t\thasReorderedRef.current = true;\n\t\t\t}\n\t\t},\n\t\t[onOptionsReorder, version],\n\t);\n\n\tconst optionsToUse = isDraggable ? localOptions : options;\n\tconst {\n\t\tdropdownOptions,\n\t\tsearch,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tsearchError,\n\t\tretrySearch,\n\t\tonApplyHandler,\n\t\tselectAllHandler,\n\t\tonMultiSelectClear,\n\t\tonFreeFormSelect,\n\t\tonMultiSelectApply,\n\t\tlatestDropdownOptionsRef,\n\t\tgetSelectedOptions,\n\t\tgetCurrentSelectionCount,\n\t} = useDropdown(\n\t\tversion,\n\t\toptionsToUse,\n\t\tonSelect,\n\t\tskipSorting || isDraggable,\n\t\tisMultiSelect,\n\t\tonSearch,\n\t\tdisableSearchOptions,\n\t\tdisableSearchedOptionExcept,\n\t\tmaxSelections,\n\t);\n\tconst [widthState, setWidthState] = useState(width ?? defaults.width);\n\tconst [descriptionInfo, setDescription] = useState<{\n\t\ttitle: string;\n\t\tdescription: string;\n\t} | null>(null);\n\tconst [focusedIndex, setFocusedIndex] = useState<number>(-1);\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst childRefs = useRef([]);\n\tconst menuListRef = useRef<HTMLDivElement>(null);\n\tuseOutside(\n\t\tref,\n\t\t() => {\n\t\t\tsetDescription(null);\n\t\t\tif (isMultiSelect && version === '2.0') {\n\t\t\t\tconst optionsToSend = getSelectedOptions(\n\t\t\t\t\tlatestDropdownOptionsRef.current,\n\t\t\t\t);\n\t\t\t\tonClose?.(optionsToSend);\n\t\t\t} else {\n\t\t\t\tonClose?.(dropdownOptions);\n\t\t\t}\n\t\t},\n\t\t[headerRef, childRefs],\n\t);\n\n\t// Auto-focus dropdown when it opens for keyboard navigation while preventing scroll to maintain popper positioning\n\tuseEffect(() => {\n\t\tconst timer = setTimeout(() => {\n\t\t\tif (ref.current) {\n\t\t\t\tref.current.focus({ preventScroll: true });\n\t\t\t}\n\t\t}, 0);\n\t\treturn () => clearTimeout(timer);\n\t}, []);\n\n\t// Get flattened selectable options\n\tconst getFlattenedOptions = (opts: DropdownOption[]): SingleOption[] => {\n\t\tconst flattened: SingleOption[] = [];\n\t\topts.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\tconst groupedOption = option as GroupedOption;\n\t\t\t\tgroupedOption.options.forEach((nestedOption) => {\n\t\t\t\t\tif (!nestedOption.disabled) {\n\t\t\t\t\t\tflattened.push(nestedOption);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\tif (!singleOption.disabled) {\n\t\t\t\t\tflattened.push(singleOption);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn flattened;\n\t};\n\n\t/** Keyboard navigation handler */\n\tuseEffect(() => {\n\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\tconst currentOptions =\n\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions;\n\t\t\tconst flattenedOptions = getFlattenedOptions(currentOptions);\n\n\t\t\tif (flattenedOptions.length === 0) return;\n\n\t\t\tif (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev < flattenedOptions.length - 1 ? prev + 1 : 0;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'ArrowUp') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex((prev) => {\n\t\t\t\t\tconst newIndex = prev > 0 ? prev - 1 : flattenedOptions.length - 1;\n\t\t\t\t\t// Scroll to the focused item\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tconst focusedElement = menuListRef.current?.querySelector(\n\t\t\t\t\t\t\t`[data-option-index=\"${newIndex}\"]`,\n\t\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\tfocusedElement.scrollIntoView({\n\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t\treturn newIndex;\n\t\t\t\t});\n\t\t\t} else if (e.key === 'Enter' && focusedIndex >= 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst focusedOption = flattenedOptions[focusedIndex];\n\t\t\t\tif (focusedOption) {\n\t\t\t\t\t// onApplyHandler handles the selection state and calls onSelect internally\n\t\t\t\t\tonApplyHandler({\n\t\t\t\t\t\t...focusedOption,\n\t\t\t\t\t\tselected: !focusedOption.selected,\n\t\t\t\t\t});\n\t\t\t\t\t// Also trigger onDropdownItemClick if provided\n\t\t\t\t\tif (onDropdownItemClick) {\n\t\t\t\t\t\tonDropdownItemClick(focusedOption);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst dropdownElement = ref.current;\n\t\tif (dropdownElement) {\n\t\t\tdropdownElement.addEventListener('keydown', handleKeyDown);\n\t\t\treturn () => {\n\t\t\t\tdropdownElement.removeEventListener('keydown', handleKeyDown);\n\t\t\t};\n\t\t}\n\t}, [\n\t\tfocusedIndex,\n\t\tsearchedString,\n\t\tsearchedOptions,\n\t\tdropdownOptions,\n\t\tonSearch,\n\t\tonApplyHandler,\n\t\tonDropdownItemClick,\n\t]);\n\n\t// LOCAL CONSTANTS\n\tconst heightToUse = height ?? defaults.height;\n\tconst menuListMaxHeight =\n\t\ttypeof heightToUse === 'number'\n\t\t\t? isSearchable && isMultiSelect\n\t\t\t\t? heightToUse - 96\n\t\t\t\t: (isSearchable && !isMultiSelect) || (!isSearchable && isMultiSelect)\n\t\t\t\t? heightToUse - 48\n\t\t\t\t: heightToUse\n\t\t\t: heightToUse;\n\n\tfunction showDescription(title?: string, description?: string) {\n\t\tif (title && description) {\n\t\t\tsetDescription({\n\t\t\t\ttitle,\n\t\t\t\tdescription,\n\t\t\t});\n\t\t} else {\n\t\t\tsetDescription(null);\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tconst widthToUse = width ?? defaults.width;\n\t\tif (descriptionInfo === null) {\n\t\t\tsetWidthState(widthToUse);\n\t\t} else if (typeof widthToUse === 'number') {\n\t\t\tsetWidthState(widthToUse * 2);\n\t\t} else if (typeof widthToUse === 'string') {\n\t\t\tif (widthToUse.endsWith('px')) {\n\t\t\t\tconst newWidth = parseInt(widthToUse.replace('px', '')) * 2;\n\t\t\t\tsetWidthState(newWidth);\n\t\t\t}\n\t\t}\n\t}, [descriptionInfo]);\n\n\t/**\n\t * This is to show the search result in a stateless way\n\t */\n\n\tconst exactMatchFound: boolean[] = [];\n\n\tconst processOptionsWithMaxSelections = (\n\t\toptionsToProcess: DropdownOption[],\n\t) => {\n\t\tif (!isMultiSelect || (!maxSelections && maxSelections !== 0)) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Count from the full options list (not the filtered subset) so selections\n\t\t// hidden by a search query are still included in the limit check.\n\t\tconst currentSelectionCount = getCurrentSelectionCount(dropdownOptions);\n\t\tconst maxSelectionsReached = currentSelectionCount >= maxSelections;\n\n\t\tif (!maxSelectionsReached) {\n\t\t\treturn optionsToProcess;\n\t\t}\n\n\t\t// Disable unselected options when max selections is reached\n\t\treturn optionsToProcess.map((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\treturn {\n\t\t\t\t\t...option,\n\t\t\t\t\toptions: (option as GroupedOption).options.map((nestedOption) => ({\n\t\t\t\t\t\t...nestedOption,\n\t\t\t\t\t\tdisabled:\n\t\t\t\t\t\t\tnestedOption.disabled ||\n\t\t\t\t\t\t\t(!nestedOption.selected && maxSelectionsReached),\n\t\t\t\t\t})),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst singleOption = option as SingleOption;\n\t\t\t\treturn {\n\t\t\t\t\t...singleOption,\n\t\t\t\t\tdisabled:\n\t\t\t\t\t\tsingleOption.disabled ||\n\t\t\t\t\t\t(!singleOption.selected && maxSelectionsReached),\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t};\n\n\tconst optionsToShow = processOptionsWithMaxSelections(\n\t\t(searchedString && onSearch ? searchedOptions : dropdownOptions)\n\t\t\t.map((option) => {\n\t\t\t\tif (searchedString && !onSearch) {\n\t\t\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t\t\tconst groupedOption = { ...option } as GroupedOption;\n\t\t\t\t\t\tgroupedOption.options = groupedOption.options.filter((op) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\top.label?.toLowerCase().includes(searchedString.toLowerCase())\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t\t!searchedString || op.label === searchedString,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn groupedOption.options.length > 0 ? groupedOption : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\toption.label\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase()) ||\n\t\t\t\t\t\t\t(option as SingleOption | MultiSelectOption).searchKey\n\t\t\t\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(searchedString.toLowerCase())\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\texactMatchFound.push(\n\t\t\t\t\t\t\t\t!searchedString || option.label === searchedString,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn option;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn option;\n\t\t\t})\n\t\t\t.filter((option) => option !== null) as DropdownOption[],\n\t);\n\n\tconst noResultForSearch =\n\t\t!!isSearchable && searchedString && optionsToShow.length === 0;\n\tconst showLoadingState = !searchedString && !!isOptionsLoading;\n\tconst showErrorState =\n\t\t!searchedString && !!optionsErrorState && !showLoadingState;\n\tconst showEmptyState =\n\t\t!searchedString &&\n\t\t!optionsToShow.length &&\n\t\t!showLoadingState &&\n\t\t!showErrorState;\n\tconst showTopLevelZeroState =\n\t\tshowLoadingState || showErrorState || showEmptyState;\n\n\tconst emptyStateTitle = zeroState?.title || 'No results found';\n\tconst emptyStateSubTitle =\n\t\tzeroState?.subTitle ||\n\t\t`Please try again later or contact us at support@bik.ai if you require further assistance.`;\n\tconst errorStateTitle = optionsErrorState?.title || 'Failed to load options';\n\tconst errorStateSubTitle =\n\t\toptionsErrorState?.subTitle ||\n\t\t'Something went wrong while fetching the list. Please try again';\n\tconst defaultErrorActionButton = {\n\t\tbuttonText: 'Try again',\n\t\tbuttonType: 'text' as const,\n\t\tsize: 'small' as const,\n\t\tbuttonTextColor: COLORS.background.inverseLight,\n\t\tcustomIconColor: COLORS.background.inverseLight,\n\t\tLeadingIcon: RetryIcon,\n\t};\n\n\tconst mergedErrorState = {\n\t\tIconHolderStyle: {\n\t\t\tbackground: COLORS.background.negative.light,\n\t\t},\n\t\tIcon: (\n\t\t\t<ErrorInfoIcon color={COLORS.content.negative} width={24} height={24} />\n\t\t),\n\t\t...optionsErrorState,\n\t};\n\tmergedErrorState.actionButton = {\n\t\t...defaultErrorActionButton,\n\t\t...(optionsErrorState?.actionButton ?? {}),\n\t};\n\tconst zeroStateProps = showLoadingState\n\t\t? undefined\n\t\t: showErrorState\n\t\t? mergedErrorState\n\t\t: zeroState;\n\n\treturn (\n\t\t<OpennedDropdownContainer\n\t\t\tversion={version}\n\t\t\tref={ref}\n\t\t\ttabIndex={-1}\n\t\t\tstyle={{\n\t\t\t\t// maxWidth: descriptionInfo ? 800 : 400,\n\t\t\t\twidth: widthState,\n\t\t\t\t...containerStyle,\n\t\t\t\toutline: 'none',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: descriptionInfo ? '50%' : '100%',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tbackground: 'white',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!!isSearchable && (\n\t\t\t\t\t<SearchBox\n\t\t\t\t\t\tonSearch={search}\n\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{showTopLevelZeroState ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-testid=\"dropdown-options-zero-state\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: staticMenuHeight ? menuListMaxHeight : heightToUse,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tbackground: COLORS.background.base,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZeroState\n\t\t\t\t\t\t\t{...(zeroStateProps ?? {})}\n\t\t\t\t\t\t\tisLoading={showLoadingState}\n\t\t\t\t\t\t\ttitle={showErrorState ? errorStateTitle : emptyStateTitle}\n\t\t\t\t\t\t\tsubTitle={\n\t\t\t\t\t\t\t\tshowErrorState ? errorStateSubTitle : emptyStateSubTitle\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<MenuListContainer\n\t\t\t\t\t\tdata-testid=\"dropdown-menu-list\"\n\t\t\t\t\t\tminHeight={staticMenuHeight ? menuListMaxHeight : undefined}\n\t\t\t\t\t\tmaxHeight={menuListMaxHeight}\n\t\t\t\t\t\tref={menuListRef}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!isMultiSelect && !noResultForSearch && !hideSelectAll && (\n\t\t\t\t\t\t\t<SelectAllMenu\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\toptions={\n\t\t\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSelect={selectAllHandler}\n\t\t\t\t\t\t\t\tcheckboxActiveColor={checkboxActiveColor}\n\t\t\t\t\t\t\t\tbrandSelectedRow={brandSelectedRow}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!allowFreeForm && noResultForSearch && (\n\t\t\t\t\t\t\t<SearchZeroState\n\t\t\t\t\t\t\t\tisLoading={isSearchLoading}\n\t\t\t\t\t\t\t\terrorMessage={searchError}\n\t\t\t\t\t\t\t\tonRetry={retrySearch}\n\t\t\t\t\t\t\t\theight={menuListMaxHeight as number}\n\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\tcontainerWidth={width}\n\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{allowFreeForm &&\n\t\t\t\t\t\t\t(noResultForSearch ||\n\t\t\t\t\t\t\t\t(!!exactMatchFound.length &&\n\t\t\t\t\t\t\t\t\texactMatchFound.every((val) => val === false))) && (\n\t\t\t\t\t\t\t\t<FreeFormMenu\n\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\t\t\tonSelect={onFreeFormSelect}\n\t\t\t\t\t\t\t\t\tsearchedString={searchedString}\n\t\t\t\t\t\t\t\t\tcheckboxActiveColor={checkboxActiveColor}\n\t\t\t\t\t\t\t\t\tbrandSelectedRow={brandSelectedRow}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<MenuList\n\t\t\t\t\t\t\tonInfiniteScroll={onInfiniteScroll}\n\t\t\t\t\t\t\tonDropdownItemClick={onDropdownItemClick}\n\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\tonSelect={onApplyHandler}\n\t\t\t\t\t\t\tshowDescription={showDescription}\n\t\t\t\t\t\t\tisMultiSelect={isMultiSelect}\n\t\t\t\t\t\t\toptions={optionsToShow}\n\t\t\t\t\t\t\tuseDefaultCursor={useDefaultCursor}\n\t\t\t\t\t\t\tref={childRefs}\n\t\t\t\t\t\t\tfocusedIndex={focusedIndex}\n\t\t\t\t\t\t\tisDraggable={isDraggable}\n\t\t\t\t\t\t\tonOptionsReorder={handleOptionsReorder}\n\t\t\t\t\t\t\tshowCheckboxForCustomElement={showCheckboxForCustomElement}\n\t\t\t\t\t\t\tcheckboxActiveColor={checkboxActiveColor}\n\t\t\t\t\t\t\tbrandSelectedRow={brandSelectedRow}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuListContainer>\n\t\t\t\t)}\n\t\t\t\t{!!isMultiSelect && !showTopLevelZeroState && version !== '2.0' && (\n\t\t\t\t\t<MultiSelectDropdownBottomBar\n\t\t\t\t\t\tonClear={() => {\n\t\t\t\t\t\t\tonMultiSelectClear();\n\t\t\t\t\t\t\tonMultiSelectClearProp?.();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonApply={onMultiSelectApply}\n\t\t\t\t\t\tlist={\n\t\t\t\t\t\t\tsearchedString && onSearch ? searchedOptions : dropdownOptions\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuttonText={primaryButtonText}\n\t\t\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t\t\t\thideClearButton={hideClearButton}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!!descriptionInfo && (\n\t\t\t\t<Description\n\t\t\t\t\ttitle={descriptionInfo.title}\n\t\t\t\t\tdescription={descriptionInfo.description}\n\t\t\t\t\tversion={version}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</OpennedDropdownContainer>\n\t);\n};\n"],"names":["defaults","OpenedDropdown","options","isSearchable","searchPlaceholder","staticMenuHeight","isMultiSelect","maxSelections","width","allowFreeForm","height","onClose","onSelect","onSearch","version","skipSorting","headerRef","hideSelectAll","primaryButtonText","onInfiniteScroll","onMultiSelectClearProp","onDropdownItemClick","buttonOptions","isSearchLoading","isOptionsLoading","optionsErrorState","disableSearchOptions","disableSearchedOptionExcept","useDefaultCursor","containerStyle","zeroState","isDraggable","onOptionsReorder","hideClearButton","showCheckboxForCustomElement","checkboxActiveColor","brandSelectedRow","sortOptionsWithSelectedOnTop","useCallback","opts","selected","unselected","option","localOptions","setLocalOptions","useState","localOptionsRef","useRef","hasReorderedRef","onOptionsReorderRef","useEffect","handleOptionsReorder","reorderedOptions","optionsToUse","dropdownOptions","search","searchedString","searchedOptions","searchError","retrySearch","onApplyHandler","selectAllHandler","onMultiSelectClear","onFreeFormSelect","onMultiSelectApply","latestDropdownOptionsRef","getSelectedOptions","getCurrentSelectionCount","useDropdown","widthState","setWidthState","descriptionInfo","setDescription","focusedIndex","setFocusedIndex","ref","childRefs","menuListRef","useOutside","optionsToSend","timer","getFlattenedOptions","flattened","nestedOption","singleOption","handleKeyDown","e","flattenedOptions","prev","newIndex","focusedElement","focusedOption","dropdownElement","heightToUse","menuListMaxHeight","showDescription","title","description","widthToUse","newWidth","exactMatchFound","optionsToShow","optionsToProcess","maxSelectionsReached","groupedOption","op","noResultForSearch","showLoadingState","showErrorState","showEmptyState","showTopLevelZeroState","emptyStateTitle","emptyStateSubTitle","errorStateTitle","errorStateSubTitle","defaultErrorActionButton","COLORS","RetryIcon","mergedErrorState","jsx","ErrorInfoIcon","zeroStateProps","jsxs","OpennedDropdownContainer","SearchBox","ZeroState","MenuListContainer","SelectAllMenu","SearchZeroState","val","FreeFormMenu","MenuList","MultiSelectDropdownBottomBar","Description"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAW;AAAA,EAChB,QAAQ;A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,wBACV,iBAAAmC;AAAA,wBACA,eAAAzF;AAAA,wBACA,SAAS+F;AAAA,wBACT,kBAAAzE;AAAA,wBACA,KAAKgD;AAAA,wBACL,cAAAH;AAAA,wBACA,aAAA1C;AAAA,wBACA,kBAAkBoB;AAAA,wBAClB,8BAAAjB;AAAA,wBACA,qBAAAC;AAAA,wBACA,kBAAAC;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACD;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGD,CAAC,CAAC9B,KAAiB,CAACwG,MAAyBhG,MAAY,SACzD,gBAAAyG;AAAA,gBAACa;AAAA,gBAAA;AAAA,kBACA,SAAS,MAAM;AACd,oBAAAtE,GAAA,GACA1C,KAAA;AAAA,kBACD;AAAA,kBACA,SAAS4C;AAAA,kBACT,MACCR,KAAkB3C,IAAW4C,IAAkBH;AAAA,kBAEhD,YAAYpC;AAAA,kBACZ,eAAAI;AAAA,kBACA,iBAAAW;AAAA,gBAAA;AAAA,cAAA;AAAA,YACD;AAAA,UAAA;AAAA,QAAA;AAAA,QAGD,CAAC,CAACsC,KACF,gBAAAgD;AAAA,UAACc;AAAA,UAAA;AAAA,YACA,OAAO9D,EAAgB;AAAA,YACvB,aAAaA,EAAgB;AAAA,YAC7B,SAAAzD;AAAA,UAAA;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAIJ;"}
|
|
@@ -19,14 +19,6 @@ interface MenuItemProps {
|
|
|
19
19
|
showCheckboxForCustomElement?: boolean;
|
|
20
20
|
checkboxActiveColor?: string;
|
|
21
21
|
brandSelectedRow?: boolean;
|
|
22
|
-
childrenLayout?: 'flyout' | 'nested';
|
|
23
|
-
/** Indents the row under its parent and draws the elbow connector. */
|
|
24
|
-
isChildRow?: boolean;
|
|
25
|
-
/** Renders the parent checkbox in its indeterminate state. */
|
|
26
|
-
isPartiallyChecked?: boolean;
|
|
27
|
-
isCollapsible?: boolean;
|
|
28
|
-
isCollapsed?: boolean;
|
|
29
|
-
onToggleCollapse?: () => void;
|
|
30
22
|
}
|
|
31
23
|
export declare const MenuItem: import('react').ForwardRefExoticComponent<MenuItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
32
24
|
export {};
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { ListItem as ne } from "../../../../list-item/ListItem.js";
|
|
13
|
-
const b = n(ne)`
|
|
1
|
+
import { jsx as r, Fragment as c, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import U from "../../../../../assets/icons/chevronRight.svg.js";
|
|
3
|
+
import { forwardRef as z, useState as W } from "react";
|
|
4
|
+
import t from "styled-components";
|
|
5
|
+
import { BodyCaption as _ } from "../../../../TypographyStyle.js";
|
|
6
|
+
import { COLORS as m, DEFAULT_THEME as F } from "../../../../../constants/Theme.js";
|
|
7
|
+
import { FreeFormContainer as q } from "./FreeFormMenu.styled.js";
|
|
8
|
+
import { Tooltip as G } from "../../../../tooltips/Tooltip.js";
|
|
9
|
+
import { CheckBox as k } from "../../../../checkBox/CheckBox.js";
|
|
10
|
+
import { ListItem as J } from "../../../../list-item/ListItem.js";
|
|
11
|
+
const $ = t(J)`
|
|
14
12
|
padding: ${(e) => e.version === "3.0" ? "8px" : e.version === "2.0" ? "8px 12px" : "14px 16px"} !important;
|
|
15
13
|
cursor: pointer;
|
|
16
14
|
margin-top: ${(e) => e.brandSelectedRow ? "0" : e.version === "2.0" ? "2px" : "0"};
|
|
17
|
-
`,
|
|
18
|
-
padding: 8px !important;
|
|
19
|
-
margin-top: 0;
|
|
20
|
-
border-radius: 0;
|
|
21
|
-
`, de = n.div`
|
|
15
|
+
`, K = t.div`
|
|
22
16
|
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
|
|
23
17
|
border-radius: ${({ version: e }) => e === "1.0" ? "0" : "8px"};
|
|
24
18
|
padding: ${({ version: e }) => e === "1.0" ? "0" : "4px"};
|
|
25
19
|
min-width: 148px;
|
|
26
|
-
border: ${({ version: e }) => e === "1.0" ? `1px solid ${
|
|
20
|
+
border: ${({ version: e }) => e === "1.0" ? `1px solid ${F.colorsV2.stroke.primary}` : "none"};
|
|
27
21
|
max-height: 248px;
|
|
28
22
|
overflow-y: auto;
|
|
29
|
-
`,
|
|
23
|
+
`, N = t.div`
|
|
30
24
|
display: grid;
|
|
31
25
|
grid-template-columns: repeat(2, 2.86px);
|
|
32
26
|
grid-template-rows: repeat(3, 2.86px);
|
|
@@ -38,229 +32,191 @@ const b = n(ne)`
|
|
|
38
32
|
align-self: center;
|
|
39
33
|
height: fit-content;
|
|
40
34
|
min-height: 18px;
|
|
41
|
-
`,
|
|
35
|
+
`, l = t.div`
|
|
42
36
|
width: 2.86px;
|
|
43
37
|
height: 2.86px;
|
|
44
38
|
border-radius: 50%;
|
|
45
|
-
background-color: ${
|
|
39
|
+
background-color: ${m.content.inactive};
|
|
46
40
|
flex-shrink: 0;
|
|
47
|
-
`,
|
|
41
|
+
`, w = t.div`
|
|
48
42
|
display: flex;
|
|
49
43
|
align-content: center;
|
|
50
44
|
justify-content: center;
|
|
51
45
|
gap: 8px;
|
|
52
|
-
`,
|
|
53
|
-
align-self: flex-start;
|
|
54
|
-
flex-shrink: 0;
|
|
55
|
-
width: 11px;
|
|
56
|
-
height: 9px;
|
|
57
|
-
margin-left: 4px;
|
|
58
|
-
border-left: 1px solid ${i.content.placeholder};
|
|
59
|
-
border-bottom: 1px solid ${i.content.placeholder};
|
|
60
|
-
border-bottom-left-radius: 4px;
|
|
61
|
-
`, ie = n.span`
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
`, ae = n.div`
|
|
46
|
+
`, P = t.div`
|
|
66
47
|
margin-right: -4px;
|
|
67
|
-
`,
|
|
48
|
+
`, Q = t.div`
|
|
68
49
|
display: flex;
|
|
69
50
|
align-items: center;
|
|
70
51
|
flex-direction: column;
|
|
71
52
|
flex: 1;
|
|
72
|
-
`,
|
|
73
|
-
|
|
53
|
+
`, g = ({ onDragStart: e, onDragEnd: i }) => /* @__PURE__ */ s(
|
|
54
|
+
N,
|
|
74
55
|
{
|
|
75
56
|
draggable: !0,
|
|
76
57
|
onDragStart: e,
|
|
77
|
-
onDragEnd:
|
|
58
|
+
onDragEnd: i,
|
|
78
59
|
children: [
|
|
79
|
-
/* @__PURE__ */ r(
|
|
80
|
-
/* @__PURE__ */ r(
|
|
81
|
-
/* @__PURE__ */ r(
|
|
82
|
-
/* @__PURE__ */ r(
|
|
83
|
-
/* @__PURE__ */ r(
|
|
84
|
-
/* @__PURE__ */ r(
|
|
60
|
+
/* @__PURE__ */ r(l, {}),
|
|
61
|
+
/* @__PURE__ */ r(l, {}),
|
|
62
|
+
/* @__PURE__ */ r(l, {}),
|
|
63
|
+
/* @__PURE__ */ r(l, {}),
|
|
64
|
+
/* @__PURE__ */ r(l, {}),
|
|
65
|
+
/* @__PURE__ */ r(l, {})
|
|
85
66
|
]
|
|
86
67
|
}
|
|
87
|
-
),
|
|
68
|
+
), oe = z(
|
|
88
69
|
({
|
|
89
70
|
option: e,
|
|
90
|
-
isMultiSelect:
|
|
91
|
-
showDescription:
|
|
92
|
-
onSelect:
|
|
93
|
-
last:
|
|
94
|
-
version:
|
|
95
|
-
onDropdownItemClick:
|
|
96
|
-
useDefaultCursor:
|
|
97
|
-
isFocused:
|
|
98
|
-
dataIndex:
|
|
99
|
-
isDraggable:
|
|
100
|
-
onDragStart:
|
|
101
|
-
onDragOver:
|
|
102
|
-
onDrop:
|
|
103
|
-
onDragEnd:
|
|
104
|
-
isDraggedOver:
|
|
105
|
-
showCheckboxForCustomElement:
|
|
106
|
-
checkboxActiveColor:
|
|
107
|
-
brandSelectedRow:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
isPartiallyChecked: k = !1,
|
|
111
|
-
isCollapsible: N = !1,
|
|
112
|
-
isCollapsed: h = !1,
|
|
113
|
-
onToggleCollapse: W
|
|
114
|
-
}, _) => {
|
|
115
|
-
const [q, O] = Z(
|
|
71
|
+
isMultiSelect: i,
|
|
72
|
+
showDescription: x,
|
|
73
|
+
onSelect: H,
|
|
74
|
+
last: O,
|
|
75
|
+
version: d,
|
|
76
|
+
onDropdownItemClick: M,
|
|
77
|
+
useDefaultCursor: S,
|
|
78
|
+
isFocused: A = !1,
|
|
79
|
+
dataIndex: h = -1,
|
|
80
|
+
isDraggable: o = !1,
|
|
81
|
+
onDragStart: u,
|
|
82
|
+
onDragOver: D,
|
|
83
|
+
onDrop: B,
|
|
84
|
+
onDragEnd: p,
|
|
85
|
+
isDraggedOver: v = !1,
|
|
86
|
+
showCheckboxForCustomElement: C = !1,
|
|
87
|
+
checkboxActiveColor: b,
|
|
88
|
+
brandSelectedRow: I
|
|
89
|
+
}, V) => {
|
|
90
|
+
const [j, y] = W(
|
|
116
91
|
e.selected
|
|
117
|
-
),
|
|
118
|
-
if (!
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
92
|
+
), L = (n, a) => {
|
|
93
|
+
if (!n.children) {
|
|
94
|
+
f(!n.selected);
|
|
95
|
+
const R = a ? { ...n, parent: a } : n;
|
|
96
|
+
M?.(R);
|
|
122
97
|
}
|
|
123
|
-
},
|
|
124
|
-
e.disabled ||
|
|
125
|
-
},
|
|
126
|
-
e.description ?
|
|
127
|
-
},
|
|
128
|
-
return /* @__PURE__ */ r(
|
|
129
|
-
|
|
98
|
+
}, f = (n) => {
|
|
99
|
+
e.disabled || H({ ...e, selected: n });
|
|
100
|
+
}, E = () => {
|
|
101
|
+
e.description ? x(e.label, e.description) : x();
|
|
102
|
+
}, T = S ? { cursor: "default" } : {};
|
|
103
|
+
return /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(
|
|
104
|
+
G,
|
|
130
105
|
{
|
|
131
106
|
body: "",
|
|
132
|
-
tooltipContent: e.children
|
|
107
|
+
tooltipContent: e.children ? /* @__PURE__ */ r(
|
|
133
108
|
"div",
|
|
134
109
|
{
|
|
135
110
|
style: {
|
|
136
|
-
backgroundColor:
|
|
111
|
+
backgroundColor: F.colorsV2.surface.standard
|
|
137
112
|
},
|
|
138
|
-
ref:
|
|
139
|
-
onMouseEnter: () =>
|
|
140
|
-
onMouseLeave: () =>
|
|
141
|
-
children: /* @__PURE__ */ r(
|
|
142
|
-
|
|
113
|
+
ref: V,
|
|
114
|
+
onMouseEnter: () => y(!0),
|
|
115
|
+
onMouseLeave: () => y(!1),
|
|
116
|
+
children: /* @__PURE__ */ r(K, { version: d ?? "2.0", children: e.children.map((n) => /* @__PURE__ */ r(
|
|
117
|
+
$,
|
|
143
118
|
{
|
|
144
|
-
version:
|
|
145
|
-
brandSelectedRow:
|
|
146
|
-
style:
|
|
147
|
-
onClick: (
|
|
148
|
-
|
|
119
|
+
version: d,
|
|
120
|
+
brandSelectedRow: I,
|
|
121
|
+
style: d !== "1.0" && (e?.children ?? []).length - 1 ? { borderBottom: 0 } : {},
|
|
122
|
+
onClick: (a) => {
|
|
123
|
+
a.preventDefault(), L(n, e);
|
|
149
124
|
},
|
|
150
|
-
listItem: { value:
|
|
151
|
-
subText:
|
|
152
|
-
leadingIcon:
|
|
153
|
-
customComponent:
|
|
154
|
-
trailingIcon:
|
|
155
|
-
variant: e.disabled ? "inactive" :
|
|
125
|
+
listItem: { value: n.value, label: n.label },
|
|
126
|
+
subText: n.subText,
|
|
127
|
+
leadingIcon: n.leadingIcon || void 0,
|
|
128
|
+
customComponent: n.customComponent,
|
|
129
|
+
trailingIcon: n.trailingIcon || void 0,
|
|
130
|
+
variant: e.disabled ? "inactive" : n.selected ? "selected" : "default"
|
|
156
131
|
},
|
|
157
|
-
|
|
132
|
+
n.value
|
|
158
133
|
)) })
|
|
159
134
|
}
|
|
160
|
-
) : /* @__PURE__ */ r(
|
|
135
|
+
) : /* @__PURE__ */ r(c, {}),
|
|
161
136
|
placement: "right-start",
|
|
162
137
|
hideArrow: !0,
|
|
163
138
|
children: /* @__PURE__ */ r(
|
|
164
|
-
|
|
139
|
+
$,
|
|
165
140
|
{
|
|
166
|
-
version:
|
|
167
|
-
brandSelectedRow:
|
|
168
|
-
style:
|
|
141
|
+
version: d,
|
|
142
|
+
brandSelectedRow: I,
|
|
143
|
+
style: O ? {
|
|
169
144
|
borderBottom: 0,
|
|
170
|
-
...
|
|
171
|
-
...
|
|
172
|
-
borderTop: `2px solid ${
|
|
145
|
+
...T,
|
|
146
|
+
...v ? {
|
|
147
|
+
borderTop: `2px solid ${m.content.brand}`,
|
|
173
148
|
opacity: 0.5
|
|
174
149
|
} : {}
|
|
175
150
|
} : {
|
|
176
|
-
...
|
|
177
|
-
...
|
|
178
|
-
borderTop: `2px solid ${
|
|
151
|
+
...T,
|
|
152
|
+
...v ? {
|
|
153
|
+
borderTop: `2px solid ${m.content.brand}`,
|
|
179
154
|
opacity: 0.5
|
|
180
155
|
} : {}
|
|
181
156
|
},
|
|
182
|
-
onClick: (
|
|
183
|
-
|
|
157
|
+
onClick: (n) => {
|
|
158
|
+
n.preventDefault(), L(e);
|
|
184
159
|
},
|
|
185
|
-
onMouseOver:
|
|
160
|
+
onMouseOver: E,
|
|
186
161
|
listItem: { value: e.value, label: e.label },
|
|
187
162
|
subText: e.subText,
|
|
188
|
-
"data-option-index":
|
|
163
|
+
"data-option-index": h,
|
|
189
164
|
role: "option",
|
|
190
|
-
id: `dropdown-option-${
|
|
165
|
+
id: `dropdown-option-${h}`,
|
|
191
166
|
"aria-selected": !!e.selected,
|
|
192
|
-
onDragOver:
|
|
193
|
-
onDrop:
|
|
194
|
-
leadingIcon:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
v,
|
|
167
|
+
onDragOver: o ? D : void 0,
|
|
168
|
+
onDrop: o ? B : void 0,
|
|
169
|
+
leadingIcon: i && !(C && e.customComponent) ? /* @__PURE__ */ s(w, { children: [
|
|
170
|
+
o && /* @__PURE__ */ r(
|
|
171
|
+
g,
|
|
198
172
|
{
|
|
199
|
-
onDragStart:
|
|
200
|
-
onDragEnd:
|
|
173
|
+
onDragStart: u,
|
|
174
|
+
onDragEnd: p
|
|
201
175
|
}
|
|
202
176
|
),
|
|
203
177
|
/* @__PURE__ */ r(
|
|
204
|
-
|
|
178
|
+
k,
|
|
205
179
|
{
|
|
206
|
-
size:
|
|
180
|
+
size: d === "2.0" ? "SMALL" : "DEFAULT",
|
|
207
181
|
isDisabled: e.disabled ?? !1,
|
|
208
|
-
isChecked: !!e.selected
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
activeColor: w
|
|
182
|
+
isChecked: !!e.selected,
|
|
183
|
+
onValueChange: f,
|
|
184
|
+
activeColor: b
|
|
212
185
|
}
|
|
213
186
|
),
|
|
214
|
-
/* @__PURE__ */ r(
|
|
215
|
-
] }) :
|
|
216
|
-
/* @__PURE__ */ r(H, {}),
|
|
217
|
-
e.leadingIcon
|
|
218
|
-
] }) : s ? /* @__PURE__ */ o(se, { children: [
|
|
187
|
+
/* @__PURE__ */ r(P, { children: e.leadingIcon })
|
|
188
|
+
] }) : o ? /* @__PURE__ */ s(Q, { children: [
|
|
219
189
|
/* @__PURE__ */ r(
|
|
220
|
-
|
|
190
|
+
g,
|
|
221
191
|
{
|
|
222
|
-
onDragStart:
|
|
223
|
-
onDragEnd:
|
|
192
|
+
onDragStart: u,
|
|
193
|
+
onDragEnd: p
|
|
224
194
|
}
|
|
225
195
|
),
|
|
226
196
|
e.leadingIcon && /* @__PURE__ */ r("div", { children: e.leadingIcon })
|
|
227
|
-
] }) : e.leadingIcon ? /* @__PURE__ */ r(
|
|
228
|
-
customComponent:
|
|
229
|
-
|
|
230
|
-
|
|
197
|
+
] }) : e.leadingIcon ? /* @__PURE__ */ r(c, { children: e.leadingIcon }) : void 0,
|
|
198
|
+
customComponent: i && C && e.customComponent ? /* @__PURE__ */ s(w, { children: [
|
|
199
|
+
o && /* @__PURE__ */ r(
|
|
200
|
+
g,
|
|
231
201
|
{
|
|
232
|
-
onDragStart:
|
|
233
|
-
onDragEnd:
|
|
202
|
+
onDragStart: u,
|
|
203
|
+
onDragEnd: p
|
|
234
204
|
}
|
|
235
205
|
),
|
|
236
206
|
/* @__PURE__ */ r(
|
|
237
|
-
|
|
207
|
+
k,
|
|
238
208
|
{
|
|
239
|
-
size:
|
|
209
|
+
size: d === "2.0" ? "SMALL" : "DEFAULT",
|
|
240
210
|
isDisabled: e.disabled ?? !1,
|
|
241
211
|
isChecked: !!e.selected,
|
|
242
|
-
onValueChange:
|
|
243
|
-
activeColor:
|
|
212
|
+
onValueChange: f,
|
|
213
|
+
activeColor: b
|
|
244
214
|
}
|
|
245
215
|
),
|
|
246
216
|
e.customComponent
|
|
247
217
|
] }) : e.customComponent,
|
|
248
|
-
trailingIcon: e.isFreeForm ? /* @__PURE__ */ r(
|
|
249
|
-
|
|
250
|
-
/* @__PURE__ */ r(
|
|
251
|
-
ie,
|
|
252
|
-
{
|
|
253
|
-
role: "button",
|
|
254
|
-
"aria-expanded": !h,
|
|
255
|
-
"aria-label": `${h ? "Expand" : "Collapse"} ${e.label}`,
|
|
256
|
-
onClick: (t) => {
|
|
257
|
-
t.preventDefault(), t.stopPropagation(), W?.();
|
|
258
|
-
},
|
|
259
|
-
children: h ? /* @__PURE__ */ r(P, { width: 16, height: 16 }) : /* @__PURE__ */ r(X, { width: 16, height: 16 })
|
|
260
|
-
}
|
|
261
|
-
)
|
|
262
|
-
] }) : e.children && !c ? /* @__PURE__ */ r(Q, { width: 12, height: 12 }) : e.trailingIcon ? /* @__PURE__ */ r(m, { children: e.trailingIcon }) : void 0,
|
|
263
|
-
variant: e.disabled ? "inactive" : e.selected || !a && q ? "selected" : U ? "focused" : "default"
|
|
218
|
+
trailingIcon: e.isFreeForm ? /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(_, { style: { color: m.content.secondary }, children: "Freeform" }) }) : e.children ? /* @__PURE__ */ r(U, { width: 12, height: 12 }) : e.trailingIcon ? /* @__PURE__ */ r(c, { children: e.trailingIcon }) : void 0,
|
|
219
|
+
variant: e.disabled ? "inactive" : e.selected || !i && j ? "selected" : A ? "focused" : "default"
|
|
264
220
|
}
|
|
265
221
|
)
|
|
266
222
|
}
|
|
@@ -268,6 +224,6 @@ const b = n(ne)`
|
|
|
268
224
|
}
|
|
269
225
|
);
|
|
270
226
|
export {
|
|
271
|
-
|
|
227
|
+
oe as MenuItem
|
|
272
228
|
};
|
|
273
229
|
//# sourceMappingURL=MenuItem.js.map
|