@mantine/core 9.4.3-alpha.0 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Accordion/Accordion.cjs +5 -2
- package/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/cjs/components/AngleSlider/AngleSlider.cjs +4 -1
- package/cjs/components/AngleSlider/AngleSlider.cjs.map +1 -1
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.cjs +15 -14
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/cjs/components/Cascader/Cascader.cjs +371 -0
- package/cjs/components/Cascader/Cascader.cjs.map +1 -0
- package/cjs/components/Cascader/Cascader.module.cjs +18 -0
- package/cjs/components/Cascader/Cascader.module.cjs.map +1 -0
- package/cjs/components/Cascader/CascaderColumns.cjs +136 -0
- package/cjs/components/Cascader/CascaderColumns.cjs.map +1 -0
- package/cjs/components/Cascader/flatten-cascader-paths.cjs +26 -0
- package/cjs/components/Cascader/flatten-cascader-paths.cjs.map +1 -0
- package/cjs/components/Cascader/get-cascader-columns.cjs +30 -0
- package/cjs/components/Cascader/get-cascader-columns.cjs.map +1 -0
- package/cjs/components/Cascader/get-cascader-path-options.cjs +19 -0
- package/cjs/components/Cascader/get-cascader-path-options.cjs.map +1 -0
- package/cjs/components/Cascader/use-cascader.cjs +135 -0
- package/cjs/components/Cascader/use-cascader.cjs.map +1 -0
- package/cjs/components/ColorPicker/converters/converters.cjs +5 -0
- package/cjs/components/ColorPicker/converters/parsers.cjs +5 -0
- package/cjs/components/Combobox/use-combobox/use-combobox.cjs +6 -2
- package/cjs/components/Combobox/use-combobox/use-combobox.cjs.map +1 -1
- package/cjs/components/ComboboxPopover/ComboboxPopover.cjs +2 -1
- package/cjs/components/ComboboxPopover/ComboboxPopover.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerStack.cjs +1 -1
- package/cjs/components/Drawer/DrawerStack.cjs.map +1 -1
- package/cjs/components/FloatingIndicator/FloatingIndicator.cjs +2 -1
- package/cjs/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindow.cjs +31 -10
- package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindow.context.cjs +8 -0
- package/cjs/components/FloatingWindow/FloatingWindow.context.cjs.map +1 -0
- package/cjs/components/FloatingWindow/FloatingWindow.module.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindowResizeHandle.cjs +161 -0
- package/cjs/components/FloatingWindow/FloatingWindowResizeHandle.cjs.map +1 -0
- package/cjs/components/Modal/ModalStack.cjs +1 -1
- package/cjs/components/Modal/ModalStack.cjs.map +1 -1
- package/cjs/components/OverflowList/OverflowList.cjs +2 -1
- package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationEdges/PaginationEdges.cjs +1 -0
- package/cjs/components/ScrollArea/ScrollArea.cjs +7 -2
- package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.module.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.cjs +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs +8 -4
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.cjs +3 -1
- package/cjs/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs +1 -1
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs.map +1 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.cjs +18 -11
- package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
- package/cjs/components/Table/Table.components.cjs +1 -0
- package/cjs/components/TagsInput/TagsInput.cjs +2 -1
- package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.cjs +5 -1
- package/cjs/components/Timeline/Timeline.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.module.cjs +2 -1
- package/cjs/components/Timeline/Timeline.module.cjs.map +1 -1
- package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs +31 -20
- package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs.map +1 -1
- package/cjs/components/Tree/TreeNode.cjs.map +1 -1
- package/cjs/components/Tree/use-tree.cjs +1 -1
- package/cjs/components/Tree/use-tree.cjs.map +1 -1
- package/cjs/components/TreeSelect/TreeSelect.cjs +3 -2
- package/cjs/components/TreeSelect/TreeSelect.cjs.map +1 -1
- package/cjs/core/Box/get-box-mod/get-box-mod.cjs +1 -0
- package/cjs/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs +6 -5
- package/cjs/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs.map +1 -1
- package/cjs/core/MantineProvider/merge-mantine-theme/merge-mantine-theme.cjs +2 -0
- package/cjs/core/MantineProvider/use-matches/use-matches.cjs +3 -2
- package/cjs/core/MantineProvider/use-matches/use-matches.cjs.map +1 -1
- package/cjs/index.cjs +7 -1
- package/esm/components/Accordion/Accordion.mjs +5 -2
- package/esm/components/Accordion/Accordion.mjs.map +1 -1
- package/esm/components/AngleSlider/AngleSlider.mjs +4 -1
- package/esm/components/AngleSlider/AngleSlider.mjs.map +1 -1
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.mjs +15 -14
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/esm/components/Cascader/Cascader.mjs +371 -0
- package/esm/components/Cascader/Cascader.mjs.map +1 -0
- package/esm/components/Cascader/Cascader.module.mjs +18 -0
- package/esm/components/Cascader/Cascader.module.mjs.map +1 -0
- package/esm/components/Cascader/CascaderColumns.mjs +135 -0
- package/esm/components/Cascader/CascaderColumns.mjs.map +1 -0
- package/esm/components/Cascader/flatten-cascader-paths.mjs +26 -0
- package/esm/components/Cascader/flatten-cascader-paths.mjs.map +1 -0
- package/esm/components/Cascader/get-cascader-columns.mjs +28 -0
- package/esm/components/Cascader/get-cascader-columns.mjs.map +1 -0
- package/esm/components/Cascader/get-cascader-path-options.mjs +19 -0
- package/esm/components/Cascader/get-cascader-path-options.mjs.map +1 -0
- package/esm/components/Cascader/use-cascader.mjs +135 -0
- package/esm/components/Cascader/use-cascader.mjs.map +1 -0
- package/esm/components/ColorPicker/converters/converters.mjs +1 -1
- package/esm/components/ColorPicker/converters/parsers.mjs +1 -1
- package/esm/components/Combobox/use-combobox/use-combobox.mjs +6 -2
- package/esm/components/Combobox/use-combobox/use-combobox.mjs.map +1 -1
- package/esm/components/ComboboxPopover/ComboboxPopover.mjs +2 -1
- package/esm/components/ComboboxPopover/ComboboxPopover.mjs.map +1 -1
- package/esm/components/Drawer/DrawerStack.mjs +1 -1
- package/esm/components/Drawer/DrawerStack.mjs.map +1 -1
- package/esm/components/FloatingIndicator/FloatingIndicator.mjs +2 -1
- package/esm/components/FloatingIndicator/FloatingIndicator.mjs.map +1 -1
- package/esm/components/FloatingWindow/FloatingWindow.context.mjs +8 -0
- package/esm/components/FloatingWindow/FloatingWindow.context.mjs.map +1 -0
- package/esm/components/FloatingWindow/FloatingWindow.mjs +32 -11
- package/esm/components/FloatingWindow/FloatingWindow.mjs.map +1 -1
- package/esm/components/FloatingWindow/FloatingWindow.module.mjs.map +1 -1
- package/esm/components/FloatingWindow/FloatingWindowResizeHandle.mjs +161 -0
- package/esm/components/FloatingWindow/FloatingWindowResizeHandle.mjs.map +1 -0
- package/esm/components/Modal/ModalStack.mjs +1 -1
- package/esm/components/Modal/ModalStack.mjs.map +1 -1
- package/esm/components/OverflowList/OverflowList.mjs +2 -1
- package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
- package/esm/components/Pagination/PaginationEdges/PaginationEdges.mjs +1 -1
- package/esm/components/ScrollArea/ScrollArea.mjs +7 -2
- package/esm/components/ScrollArea/ScrollArea.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.module.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.mjs +1 -1
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.mjs +8 -4
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.mjs +3 -2
- package/esm/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs +1 -1
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs.map +1 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.mjs +18 -11
- package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
- package/esm/components/Table/Table.components.mjs +1 -1
- package/esm/components/TagsInput/TagsInput.mjs +2 -1
- package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
- package/esm/components/Timeline/Timeline.mjs +5 -1
- package/esm/components/Timeline/Timeline.mjs.map +1 -1
- package/esm/components/Timeline/Timeline.module.mjs +2 -1
- package/esm/components/Timeline/Timeline.module.mjs.map +1 -1
- package/esm/components/Timeline/TimelineItem/TimelineItem.mjs +31 -20
- package/esm/components/Timeline/TimelineItem/TimelineItem.mjs.map +1 -1
- package/esm/components/Tree/TreeNode.mjs.map +1 -1
- package/esm/components/Tree/use-tree.mjs +1 -1
- package/esm/components/Tree/use-tree.mjs.map +1 -1
- package/esm/components/TreeSelect/TreeSelect.mjs +3 -2
- package/esm/components/TreeSelect/TreeSelect.mjs.map +1 -1
- package/esm/core/Box/get-box-mod/get-box-mod.mjs +1 -1
- package/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs +6 -5
- package/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs.map +1 -1
- package/esm/core/MantineProvider/merge-mantine-theme/merge-mantine-theme.mjs +1 -1
- package/esm/core/MantineProvider/use-matches/use-matches.mjs +3 -2
- package/esm/core/MantineProvider/use-matches/use-matches.mjs.map +1 -1
- package/esm/index.mjs +5 -2
- package/lib/components/Accordion/Accordion.d.ts +2 -0
- package/lib/components/Cascader/Cascader.d.ts +114 -0
- package/lib/components/Cascader/CascaderColumns.d.ts +36 -0
- package/lib/components/Cascader/flatten-cascader-paths.d.ts +12 -0
- package/lib/components/Cascader/get-cascader-columns.d.ts +4 -0
- package/lib/components/Cascader/get-cascader-path-options.d.ts +2 -0
- package/lib/components/Cascader/index.d.ts +12 -0
- package/lib/components/Cascader/use-cascader.d.ts +25 -0
- package/lib/components/FloatingWindow/FloatingWindow.context.d.ts +21 -0
- package/lib/components/FloatingWindow/FloatingWindow.d.ts +10 -5
- package/lib/components/FloatingWindow/FloatingWindowResizeHandle.d.ts +11 -0
- package/lib/components/FloatingWindow/index.d.ts +2 -0
- package/lib/components/ScrollArea/ScrollArea.d.ts +5 -0
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts +5 -1
- package/lib/components/index.d.ts +1 -0
- package/package.json +3 -3
- package/styles/Cascader.css +215 -0
- package/styles/Cascader.layer.css +216 -0
- package/styles/FloatingWindow.css +2 -0
- package/styles/FloatingWindow.layer.css +2 -0
- package/styles/ScrollArea.css +58 -0
- package/styles/ScrollArea.layer.css +58 -0
- package/styles/Timeline.css +88 -14
- package/styles/Timeline.layer.css +88 -14
- package/styles.css +364 -14
- package/styles.layer.css +364 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.mjs","names":["useId","classes"],"sources":["../../../src/components/TreeSelect/TreeSelect.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n extractStyleProps,\n Factory,\n genericFactory,\n MantineColor,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport { Combobox, ComboboxLikeStylesNames, useCombobox } from '../Combobox';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n InputClearButtonProps,\n InputVariant,\n} from '../Input';\nimport { InputBase } from '../InputBase';\nimport { Pill } from '../Pill';\nimport { PillsInput } from '../PillsInput';\nimport { ScrollArea, ScrollAreaProps } from '../ScrollArea';\nimport type { TreeNodeData } from '../Tree';\nimport { filterTreeData } from '../Tree/filter-tree-data/filter-tree-data';\nimport {\n findTreeNode,\n getChildrenNodesValues,\n} from '../Tree/get-children-nodes-values/get-children-nodes-values';\nimport { isNodeChecked } from '../Tree/is-node-checked/is-node-checked';\nimport { isNodeIndeterminate } from '../Tree/is-node-indeterminate/is-node-indeterminate';\nimport { getTreeExpandedState, TreeExpandedState } from '../Tree/use-tree';\nimport { flattenTreeSelectData } from './flatten-tree-select-data';\nimport {\n CheckedStrategy,\n checkedToValue,\n expandToLeafChecked,\n} from './get-checked-values-by-strategy';\nimport {\n TreeSelectChevronAriaLabels,\n TreeSelectOption,\n TreeSelectRenderNodePayload,\n} from './TreeSelectOption';\nimport classes from './TreeSelect.module.css';\n\nexport type TreeSelectStylesNames =\n | __InputStylesNames\n | ComboboxLikeStylesNames\n | 'pill'\n | 'pillsList'\n | 'inputField';\n\nexport type TreeSelectMode = 'single' | 'multiple' | 'checkbox';\n\nexport type TreeSelectValue<Mode extends TreeSelectMode> = Mode extends 'single'\n ? string | null\n : string[];\n\nexport interface TreeSelectProps<Mode extends TreeSelectMode = 'single'>\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<TreeSelectFactory>,\n ElementProps<'input', 'size' | 'value' | 'defaultValue' | 'onChange'> {\n /** Tree data */\n data: TreeNodeData[];\n\n /** Selection mode: 'single', 'multiple', or 'checkbox' (with cascade) @default 'single' */\n mode?: Mode;\n\n /** Controlled value */\n value?: TreeSelectValue<Mode>;\n\n /** Default value */\n defaultValue?: TreeSelectValue<Mode>;\n\n /** Called when value changes */\n onChange?: (value: TreeSelectValue<Mode>) => void;\n\n /** Disables parent-child cascade in checkbox mode @default false */\n checkStrictly?: boolean;\n\n /** Controls which checked nodes appear in value/pills in checkbox mode @default 'child' */\n checkedStrategy?: CheckedStrategy;\n\n /** Default expanded node values */\n defaultExpandedValues?: string[];\n\n /** Expand all nodes by default @default false */\n defaultExpandAll?: boolean;\n\n /** Controlled expanded state */\n expandedValues?: string[];\n\n /** Called when expanded state changes */\n onExpandedChange?: (values: string[]) => void;\n\n /** Also toggle expand when clicking a parent node (not just the chevron). In `single` and `multiple` modes, parent clicks only expand; only leaves can be selected. In `checkbox` mode, parent clicks both check and expand. @default false */\n expandOnClick?: boolean;\n\n /** Enables search filtering @default false */\n searchable?: boolean;\n\n /** Controlled search value */\n searchValue?: string;\n\n /** Default search value */\n defaultSearchValue?: string;\n\n /** Called when search changes */\n onSearchChange?: (value: string) => void;\n\n /** Custom filter function */\n filter?: (query: string, node: TreeNodeData) => boolean;\n\n /** Message when no nodes match search */\n nothingFoundMessage?: React.ReactNode;\n\n /** Allows deselecting in single mode @default true */\n allowDeselect?: boolean;\n\n /** Shows clear button @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** Props for the clear button */\n clearButtonProps?: InputClearButtonProps;\n\n /** Maximum selectable values (multiple/checkbox mode) */\n maxValues?: number;\n\n /** Maximum displayed pills before \"+N more\" */\n maxDisplayedValues?: number;\n\n /** Content shown when values overflow maxDisplayedValues */\n maxDisplayedValuesContent?: React.ReactNode | ((overflow: number) => React.ReactNode);\n\n /** Called with removed value in multiple/checkbox mode */\n onRemove?: (value: string) => void;\n\n /** Called when clear button is clicked */\n onClear?: () => void;\n\n /** Custom node rendering in the dropdown */\n renderNode?: (payload: TreeSelectRenderNodePayload) => React.ReactNode;\n\n /** Show tree connection lines between parent and child nodes @default true */\n withLines?: boolean;\n\n /** Props for the hidden input */\n hiddenInputProps?: Omit<React.ComponentProps<'input'>, 'value'>;\n\n /** Divider for hidden input values @default ',' */\n hiddenInputValuesDivider?: string;\n\n /** Props for the ScrollArea in the dropdown */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Controls the default chevron color */\n chevronColor?: MantineColor;\n\n /** Max dropdown height @default 220 */\n maxDropdownHeight?: number | string;\n\n /** Controlled dropdown state */\n dropdownOpened?: boolean;\n\n /** Default dropdown state */\n defaultDropdownOpened?: boolean;\n\n /** Called when dropdown opens */\n onDropdownOpen?: () => void;\n\n /** Called when dropdown closes */\n onDropdownClose?: () => void;\n\n /** Props passed to the underlying Combobox */\n comboboxProps?: Record<string, any>;\n\n /** Clear search on selection change @default true */\n clearSearchOnChange?: boolean;\n\n /** Opens dropdown on focus (searchable mode) @default true */\n openOnFocus?: boolean;\n\n /** aria-label values for the expand/collapse chevron button */\n chevronAriaLabels?: TreeSelectChevronAriaLabels;\n}\n\nexport type TreeSelectFactory = Factory<{\n props: TreeSelectProps;\n ref: HTMLInputElement;\n stylesNames: TreeSelectStylesNames;\n variant: InputVariant;\n signature: <Mode extends TreeSelectMode = 'single'>(\n props: TreeSelectProps<Mode>\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n mode: 'single',\n allowDeselect: true,\n checkedStrategy: 'child',\n maxValues: Infinity,\n hiddenInputValuesDivider: ',',\n clearSearchOnChange: true,\n openOnFocus: true,\n size: 'sm',\n withLines: true,\n} satisfies Partial<TreeSelectProps<TreeSelectMode>>;\n\nconst clearSectionOffset: Record<string, number> = {\n xs: 41,\n sm: 50,\n md: 60,\n lg: 72,\n xl: 89,\n};\n\nfunction getAncestorsToNode(value: string, nodes: TreeNodeData[]): string[] | null {\n for (const node of nodes) {\n if (node.value === value) {\n return [];\n }\n if (Array.isArray(node.children)) {\n const path = getAncestorsToNode(value, node.children);\n if (path !== null) {\n return [node.value, ...path];\n }\n }\n }\n return null;\n}\n\nexport const TreeSelect = genericFactory<TreeSelectFactory>((_props) => {\n const props = useProps(['Input', 'InputWrapper', 'TreeSelect'], defaultProps as any, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n data,\n mode,\n value,\n defaultValue,\n onChange,\n checkStrictly,\n checkedStrategy,\n defaultExpandedValues,\n defaultExpandAll,\n expandedValues,\n onExpandedChange,\n expandOnClick,\n searchable,\n searchValue,\n defaultSearchValue,\n onSearchChange,\n filter,\n nothingFoundMessage,\n allowDeselect,\n clearable,\n clearSectionMode,\n clearButtonProps,\n maxValues,\n maxDisplayedValues,\n maxDisplayedValuesContent,\n onRemove,\n onClear,\n renderNode,\n withLines,\n hiddenInputProps,\n hiddenInputValuesDivider,\n scrollAreaProps,\n chevronColor,\n maxDropdownHeight,\n dropdownOpened,\n defaultDropdownOpened,\n onDropdownOpen,\n onDropdownClose,\n comboboxProps,\n clearSearchOnChange,\n openOnFocus,\n chevronAriaLabels,\n variant,\n onKeyDown,\n onFocus,\n onBlur,\n onClick,\n readOnly,\n disabled,\n radius,\n rightSection,\n rightSectionWidth,\n rightSectionPointerEvents,\n rightSectionProps,\n leftSection,\n leftSectionWidth,\n leftSectionPointerEvents,\n leftSectionProps,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n labelProps,\n descriptionProps,\n errorProps,\n successProps,\n wrapperProps,\n description,\n label,\n error,\n success,\n withErrorStyles,\n withSuccessStyles,\n name,\n form,\n id,\n placeholder,\n required,\n mod,\n attributes,\n ...others\n } = props;\n\n const isMulti = mode === 'multiple' || mode === 'checkbox';\n const isCheckbox = mode === 'checkbox';\n const _id = useId(id);\n\n const combobox = useCombobox({\n opened: dropdownOpened,\n defaultOpened: defaultDropdownOpened,\n onDropdownOpen: () => {\n onDropdownOpen?.();\n combobox.updateSelectedOptionIndex('active', { scrollIntoView: true });\n },\n onDropdownClose: () => {\n onDropdownClose?.();\n combobox.resetSelectedOption();\n },\n });\n\n const initialExpanded = useMemo(() => {\n if (defaultExpandAll) {\n return getTreeExpandedState(data, '*');\n }\n if (defaultExpandedValues) {\n return getTreeExpandedState(data, defaultExpandedValues);\n }\n return getTreeExpandedState(data, []);\n }, []);\n\n const expandedToRecord = useCallback(\n (values: string[] | undefined): TreeExpandedState | undefined => {\n if (!values) {\n return undefined;\n }\n return getTreeExpandedState(data, values);\n },\n [data]\n );\n\n const [_expandedState, setExpandedState] = useUncontrolled<TreeExpandedState>({\n value: expandedToRecord(expandedValues),\n defaultValue: initialExpanded,\n finalValue: {},\n onChange: (val) => {\n if (onExpandedChange) {\n onExpandedChange(\n Object.entries(val)\n .filter(([, v]) => v)\n .map(([k]) => k)\n );\n }\n },\n });\n\n const toggleExpand = useCallback(\n (nodeValue: string) => {\n setExpandedState({ ..._expandedState, [nodeValue]: !_expandedState[nodeValue] });\n },\n [_expandedState]\n );\n\n const initialSearchValue = useMemo(() => {\n if (mode !== 'single' || !defaultValue) {\n return '';\n }\n const node = findTreeNode(defaultValue as string, data);\n return node ? (typeof node.label === 'string' ? node.label : '') : '';\n }, []);\n\n const [_searchValue, setSearchValue] = useUncontrolled({\n value: searchValue,\n defaultValue: defaultSearchValue,\n finalValue: initialSearchValue,\n onChange: onSearchChange,\n });\n\n const handleSearchChange = (val: string) => {\n setSearchValue(val);\n combobox.resetSelectedOption();\n };\n\n const [_value, setValue] = useUncontrolled({\n value: value as any,\n defaultValue: defaultValue as any,\n finalValue: isMulti ? [] : null,\n onChange,\n });\n\n const internalChecked = useMemo(() => {\n if (!isCheckbox || !_value || !Array.isArray(_value)) {\n return [];\n }\n if (checkStrictly) {\n return _value;\n }\n return expandToLeafChecked(_value, data);\n }, [isCheckbox, _value, data, checkStrictly]);\n\n const filteredData = useMemo(() => {\n if (!searchable || !_searchValue) {\n return data;\n }\n if (mode === 'single' && _value) {\n const node = findTreeNode(_value as string, data);\n if (node && _searchValue === (typeof node.label === 'string' ? node.label : '')) {\n return data;\n }\n }\n return filterTreeData(data, _searchValue, filter);\n }, [data, _searchValue, filter, searchable, mode, _value]);\n\n const expandedForRender = useMemo(() => {\n if (_searchValue && filteredData !== data) {\n const expanded = { ..._expandedState };\n const expandFilteredParents = (nodes: TreeNodeData[]) => {\n for (const node of nodes) {\n if (Array.isArray(node.children) && node.children.length > 0) {\n expanded[node.value] = true;\n expandFilteredParents(node.children);\n }\n }\n };\n expandFilteredParents(filteredData);\n return expanded;\n }\n return _expandedState;\n }, [filteredData, _expandedState, _searchValue, data]);\n\n const flatNodes = useMemo(\n () => flattenTreeSelectData(filteredData, expandedForRender),\n [filteredData, expandedForRender]\n );\n\n const flatNodesRef = useRef(flatNodes);\n flatNodesRef.current = flatNodes;\n\n const nodeLookup = useMemo(() => {\n const lookup: Record<string, TreeNodeData> = {};\n const walk = (nodes: TreeNodeData[]) => {\n for (const node of nodes) {\n lookup[node.value] = node;\n if (Array.isArray(node.children)) {\n walk(node.children);\n }\n }\n };\n walk(data);\n return lookup;\n }, [data]);\n\n const getNodeLabel = (nodeValue: string): string => {\n const node = nodeLookup[nodeValue];\n if (!node) {\n return nodeValue;\n }\n return typeof node.label === 'string' ? node.label : nodeValue;\n };\n\n const getStyles = useStyles<TreeSelectFactory>({\n name: 'TreeSelect',\n classes: {} as any,\n props: props as any,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<TreeSelectFactory>({\n props,\n styles,\n classNames,\n });\n\n const {\n styleProps,\n rest: { type, autoComplete, ...rest },\n } = extractStyleProps(others);\n\n const handleOptionSubmit = (val: string) => {\n if (mode === 'single') {\n if (expandOnClick) {\n const node = findTreeNode(val, data);\n if (node && Array.isArray(node.children) && node.children.length > 0) {\n toggleExpand(val);\n return;\n }\n }\n const nextValue = allowDeselect && val === _value ? null : val;\n setValue(nextValue);\n combobox.closeDropdown();\n if (clearSearchOnChange) {\n handleSearchChange(nextValue ? getNodeLabel(nextValue) : '');\n }\n } else if (mode === 'multiple') {\n if (expandOnClick) {\n const node = findTreeNode(val, data);\n if (node && Array.isArray(node.children) && node.children.length > 0) {\n toggleExpand(val);\n return;\n }\n }\n const arr = (_value as string[]) || [];\n if (arr.includes(val)) {\n setValue(arr.filter((v: string) => v !== val));\n onRemove?.(val);\n } else if (arr.length < (maxValues ?? Infinity)) {\n setValue([...arr, val]);\n } else {\n return;\n }\n if (clearSearchOnChange) {\n setSearchValue('');\n }\n } else if (mode === 'checkbox') {\n const nodeChecked = checkStrictly\n ? internalChecked.includes(val)\n : isNodeChecked(val, data, internalChecked);\n\n let newInternalChecked: string[];\n if (checkStrictly) {\n newInternalChecked = nodeChecked\n ? internalChecked.filter((v) => v !== val)\n : [...internalChecked, val];\n } else {\n const childLeaves = getChildrenNodesValues(val, data);\n if (nodeChecked) {\n newInternalChecked = internalChecked.filter((v) => !childLeaves.includes(v));\n } else {\n newInternalChecked = [...new Set([...internalChecked, ...childLeaves])];\n }\n }\n\n const newValue = checkedToValue(newInternalChecked, data, checkedStrategy!);\n if (!nodeChecked && newValue.length > (maxValues ?? Infinity)) {\n return;\n }\n setValue(newValue);\n if (clearSearchOnChange) {\n setSearchValue('');\n }\n\n if (expandOnClick) {\n const node = findTreeNode(val, data);\n if (node && Array.isArray(node.children) && node.children.length > 0) {\n if (!_expandedState[val]) {\n toggleExpand(val);\n }\n }\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (event.key === ' ' && !searchable && isMulti) {\n event.preventDefault();\n combobox.toggleDropdown();\n }\n\n if (event.key === 'Backspace' && _searchValue.length === 0 && isMulti) {\n const arr = (_value as string[]) || [];\n if (arr.length > 0) {\n const removed = arr[arr.length - 1];\n onRemove?.(removed);\n setValue(arr.slice(0, -1));\n }\n }\n\n if (!combobox.dropdownOpened) {\n return;\n }\n\n const index = combobox.getSelectedOptionIndex();\n if (index < 0 || index >= flatNodesRef.current.length) {\n return;\n }\n\n const currentNode = flatNodesRef.current[index];\n\n if (event.key === 'ArrowRight') {\n if (currentNode.hasChildren && !currentNode.expanded) {\n event.preventDefault();\n toggleExpand(currentNode.node.value);\n }\n }\n\n if (event.key === 'ArrowLeft') {\n if (currentNode.hasChildren && currentNode.expanded) {\n event.preventDefault();\n toggleExpand(currentNode.node.value);\n } else if (currentNode.parent) {\n event.preventDefault();\n const parentIndex = flatNodesRef.current.findIndex(\n (n) => n.node.value === currentNode.parent\n );\n if (parentIndex >= 0) {\n combobox.selectOption(parentIndex);\n }\n }\n }\n };\n\n useEffect(() => {\n if (mode !== 'single' || !searchable) {\n return;\n }\n if (value === null) {\n handleSearchChange('');\n } else if (typeof value === 'string') {\n handleSearchChange(getNodeLabel(value));\n }\n }, [value]);\n\n const prevDropdownOpenedRef = useRef(false);\n useEffect(() => {\n if (combobox.dropdownOpened && !prevDropdownOpenedRef.current && searchable && _value) {\n const targets = Array.isArray(_value) ? _value : [_value];\n const newExpanded = { ..._expandedState };\n let changed = false;\n for (const target of targets) {\n const ancestors = getAncestorsToNode(target as string, data);\n if (ancestors) {\n for (const a of ancestors) {\n if (!newExpanded[a]) {\n newExpanded[a] = true;\n changed = true;\n }\n }\n }\n }\n if (changed) {\n setExpandedState(newExpanded);\n requestAnimationFrame(() => {\n combobox.updateSelectedOptionIndex('active', { scrollIntoView: true });\n });\n }\n }\n prevDropdownOpenedRef.current = combobox.dropdownOpened;\n });\n\n const clearButton = (\n <Combobox.ClearButton\n {...clearButtonProps}\n onClear={() => {\n onClear?.();\n setValue(isMulti ? [] : null);\n handleSearchChange('');\n combobox.focusTarget();\n }}\n />\n );\n\n const hasValue = isMulti\n ? Array.isArray(_value) && _value.length > 0\n : _value != null && _value !== '';\n const _clearable = clearable && hasValue && !disabled && !readOnly;\n\n const singleDisplayLabel = useMemo(() => {\n if (mode !== 'single' || !_value) {\n return '';\n }\n return getNodeLabel(_value as string);\n }, [mode, _value, nodeLookup]);\n\n const displayValues = useMemo(() => {\n if (!isMulti || !Array.isArray(_value)) {\n return [];\n }\n return _value as string[];\n }, [isMulti, _value]);\n\n const pillsListStyle =\n _clearable && isMulti\n ? { paddingInlineEnd: clearSectionOffset[size as string] ?? clearSectionOffset.sm }\n : undefined;\n\n const visiblePills =\n maxDisplayedValues != null ? displayValues.slice(0, maxDisplayedValues) : displayValues;\n\n const overflowCount =\n maxDisplayedValues != null ? Math.max(0, displayValues.length - maxDisplayedValues) : 0;\n\n const pills = visiblePills.map((item, index) => (\n <Pill\n key={`${item}-${index}`}\n withRemoveButton={!readOnly}\n onRemove={() => {\n if (isCheckbox) {\n const childLeaves = checkStrictly ? [item] : getChildrenNodesValues(item, data);\n const newInternal = internalChecked.filter((v) => !childLeaves.includes(v));\n setValue(checkedToValue(newInternal, data, checkedStrategy!));\n } else {\n setValue((_value as string[]).filter((v: string) => v !== item));\n }\n onRemove?.(item);\n }}\n unstyled={unstyled}\n disabled={disabled}\n {...getStyles('pill')}\n >\n {getNodeLabel(item)}\n </Pill>\n ));\n\n if (overflowCount > 0) {\n const overflowContent =\n typeof maxDisplayedValuesContent === 'function'\n ? maxDisplayedValuesContent(overflowCount)\n : maxDisplayedValuesContent || `+${overflowCount} more`;\n pills.push(\n <Pill key=\"__overflow\" unstyled={unstyled} disabled={disabled} {...getStyles('pill')}>\n {overflowContent}\n </Pill>\n );\n }\n\n const isEmpty = flatNodes.length === 0;\n\n const options = flatNodes.map((flatNode) => {\n const isSelected =\n mode === 'single'\n ? _value === flatNode.node.value\n : mode === 'multiple'\n ? ((_value as string[]) || []).includes(flatNode.node.value)\n : false;\n\n const nodeChecked = isCheckbox\n ? checkStrictly\n ? internalChecked.includes(flatNode.node.value)\n : isNodeChecked(flatNode.node.value, data, internalChecked)\n : false;\n\n const nodeIndeterminate =\n isCheckbox && !checkStrictly\n ? isNodeIndeterminate(flatNode.node.value, data, internalChecked)\n : false;\n\n return (\n <TreeSelectOption\n key={flatNode.node.value}\n node={flatNode.node}\n level={flatNode.level}\n expanded={flatNode.expanded}\n hasChildren={flatNode.hasChildren}\n selected={isSelected}\n checked={nodeChecked}\n indeterminate={nodeIndeterminate}\n showCheckbox={isCheckbox}\n isLastChild={flatNode.isLastChild}\n lineGuides={flatNode.lineGuides}\n withLines={!!withLines}\n onToggleExpand={toggleExpand}\n renderNode={renderNode}\n chevronAriaLabels={chevronAriaLabels}\n />\n );\n });\n\n const dropdown = (\n <Combobox.Dropdown hidden={readOnly || disabled}>\n <Combobox.Options\n className={classes.optionsWrapper}\n aria-multiselectable={isMulti || undefined}\n >\n <ScrollArea.Autosize\n mah={maxDropdownHeight ?? 220}\n type=\"scroll\"\n scrollbarSize=\"var(--combobox-padding)\"\n offsetScrollbars=\"y\"\n {...scrollAreaProps}\n >\n {options}\n </ScrollArea.Autosize>\n {isEmpty && nothingFoundMessage && <Combobox.Empty>{nothingFoundMessage}</Combobox.Empty>}\n </Combobox.Options>\n </Combobox.Dropdown>\n );\n\n if (isMulti) {\n return (\n <>\n <Combobox\n store={combobox}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n readOnly={readOnly}\n __staticSelector=\"TreeSelect\"\n attributes={attributes}\n onOptionSubmit={handleOptionSubmit}\n {...comboboxProps}\n >\n <Combobox.DropdownTarget>\n <PillsInput\n {...styleProps}\n __staticSelector=\"TreeSelect\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n className={className}\n style={style}\n variant={variant}\n disabled={disabled}\n radius={radius}\n __defaultRightSection={\n <Combobox.Chevron\n size={size}\n error={error}\n unstyled={unstyled}\n color={chevronColor}\n />\n }\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n rightSectionPointerEvents={rightSectionPointerEvents || 'none'}\n rightSectionWidth={rightSectionWidth}\n rightSectionProps={rightSectionProps}\n leftSection={leftSection}\n leftSectionWidth={leftSectionWidth}\n leftSectionPointerEvents={leftSectionPointerEvents}\n leftSectionProps={leftSectionProps}\n inputContainer={inputContainer}\n inputWrapperOrder={inputWrapperOrder}\n withAsterisk={withAsterisk}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n successProps={successProps}\n wrapperProps={wrapperProps}\n description={description}\n label={label}\n error={error}\n success={success}\n withErrorStyles={withErrorStyles}\n withSuccessStyles={withSuccessStyles}\n __stylesApiProps={{\n ...props,\n rightSectionPointerEvents: rightSectionPointerEvents || 'none',\n multiline: true,\n }}\n pointer={!searchable}\n onClick={() => (searchable ? combobox.openDropdown() : combobox.toggleDropdown())}\n data-expanded={combobox.dropdownOpened || undefined}\n id={_id}\n required={required}\n mod={mod}\n attributes={attributes}\n >\n <Pill.Group\n attributes={attributes}\n disabled={disabled}\n unstyled={unstyled}\n {...getStyles('pillsList', { style: pillsListStyle })}\n >\n {pills}\n <Combobox.EventsTarget autoComplete={autoComplete}>\n <PillsInput.Field\n {...rest}\n id={_id}\n placeholder={placeholder}\n type={!searchable && !placeholder ? 'hidden' : 'visible'}\n {...getStyles('inputField')}\n unstyled={unstyled}\n onFocus={(event) => {\n onFocus?.(event);\n if (openOnFocus && searchable) {\n combobox.openDropdown();\n }\n }}\n onBlur={(event) => {\n onBlur?.(event);\n combobox.closeDropdown();\n handleSearchChange('');\n }}\n onKeyDown={handleKeyDown}\n value={_searchValue}\n onChange={(event) => {\n handleSearchChange(event.currentTarget.value);\n if (searchable) {\n combobox.openDropdown();\n }\n }}\n disabled={disabled}\n readOnly={readOnly || !searchable}\n pointer={!searchable}\n />\n </Combobox.EventsTarget>\n </Pill.Group>\n </PillsInput>\n </Combobox.DropdownTarget>\n {dropdown}\n </Combobox>\n <Combobox.HiddenInput\n name={name}\n valuesDivider={hiddenInputValuesDivider}\n value={_value}\n form={form}\n disabled={disabled}\n {...hiddenInputProps}\n />\n </>\n );\n }\n\n return (\n <>\n <Combobox\n store={combobox}\n __staticSelector=\"TreeSelect\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n readOnly={readOnly}\n size={size}\n attributes={attributes}\n onOptionSubmit={handleOptionSubmit}\n {...comboboxProps}\n >\n <Combobox.Target targetType={searchable ? 'input' : 'button'} autoComplete={autoComplete}>\n <InputBase\n id={_id}\n __defaultRightSection={\n <Combobox.Chevron\n size={size}\n error={error}\n unstyled={unstyled}\n color={chevronColor}\n />\n }\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n rightSectionPointerEvents={rightSectionPointerEvents || 'none'}\n {...rest}\n {...styleProps}\n size={size}\n __staticSelector=\"TreeSelect\"\n disabled={disabled}\n readOnly={readOnly || !searchable}\n value={searchable ? _searchValue : singleDisplayLabel}\n onChange={(event) => {\n handleSearchChange(event.currentTarget.value);\n combobox.openDropdown();\n }}\n onFocus={(event) => {\n if (openOnFocus && searchable) {\n combobox.openDropdown();\n }\n onFocus?.(event);\n }}\n onBlur={(event) => {\n if (searchable) {\n combobox.closeDropdown();\n }\n handleSearchChange(_value ? getNodeLabel(_value as string) : '');\n onBlur?.(event);\n }}\n onClick={(event) => {\n searchable ? combobox.openDropdown() : combobox.toggleDropdown();\n onClick?.(event);\n }}\n onKeyDown={handleKeyDown}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n pointer={!searchable}\n error={error}\n success={success}\n attributes={attributes}\n className={className}\n style={style}\n variant={variant}\n radius={radius}\n leftSection={leftSection}\n leftSectionWidth={leftSectionWidth}\n leftSectionPointerEvents={leftSectionPointerEvents}\n leftSectionProps={leftSectionProps}\n rightSectionWidth={rightSectionWidth}\n rightSectionProps={rightSectionProps}\n inputContainer={inputContainer}\n inputWrapperOrder={inputWrapperOrder}\n withAsterisk={withAsterisk}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n successProps={successProps}\n wrapperProps={wrapperProps}\n description={description}\n label={label}\n withErrorStyles={withErrorStyles}\n withSuccessStyles={withSuccessStyles}\n placeholder={placeholder}\n required={required}\n mod={mod}\n />\n </Combobox.Target>\n {dropdown}\n </Combobox>\n <Combobox.HiddenInput\n value={_value}\n name={name}\n form={form}\n disabled={disabled}\n {...hiddenInputProps}\n />\n </>\n );\n});\n\nTreeSelect.classes = { ...InputBase.classes, ...Combobox.classes };\nTreeSelect.displayName = '@mantine/core/TreeSelect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4MA,MAAM,eAAe;CACnB,MAAM;CACN,eAAe;CACf,iBAAiB;CACjB,WAAW;CACX,0BAA0B;CAC1B,qBAAqB;CACrB,aAAa;CACb,MAAM;CACN,WAAW;AACb;AAEA,MAAM,qBAA6C;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAS,mBAAmB,OAAe,OAAwC;CACjF,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,UAAU,OACjB,OAAO,CAAC;EAEV,IAAI,MAAM,QAAQ,KAAK,QAAQ,GAAG;GAChC,MAAM,OAAO,mBAAmB,OAAO,KAAK,QAAQ;GACpD,IAAI,SAAS,MACX,OAAO,CAAC,KAAK,OAAO,GAAG,IAAI;EAE/B;CACF;CACA,OAAO;AACT;AAEA,MAAa,aAAa,gBAAmC,WAAW;CACtE,MAAM,QAAQ,SAAS;EAAC;EAAS;EAAgB;CAAY,GAAG,cAAqB,MAAM;CAC3F,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,MACA,MACA,OACA,cACA,UACA,eACA,iBACA,uBACA,kBACA,gBACA,kBACA,eACA,YACA,aACA,oBACA,gBACA,QACA,qBACA,eACA,WACA,kBACA,kBACA,WACA,oBACA,2BACA,UACA,SACA,YACA,WACA,kBACA,0BACA,iBACA,cACA,mBACA,gBACA,uBACA,gBACA,iBACA,eACA,qBACA,aACA,mBACA,SACA,WACA,SACA,QACA,SACA,UACA,UACA,QACA,cACA,mBACA,2BACA,mBACA,aACA,kBACA,0BACA,kBACA,gBACA,mBACA,cACA,YACA,kBACA,YACA,cACA,cACA,aACA,OACA,OACA,SACA,iBACA,mBACA,MACA,MACA,IACA,aACA,UACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,UAAU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;IACE;IACD;IACK;IACK;IACQ;IACR;IACC;IACA;IACH;IACG;IACL;IACF;IACM;IACN;IACE;IACA;IACD;IACN;IACU;IACE;IACN;IACH;IACL;GACN,CAAA;EACc,CAAA,GAChB,QACO;KACV,oBAAC,SAAS,aAAV;EACE,OAAO;EACD;EACA;EACI;EACV,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CAAC;AAED,WAAW,UAAU;CAAE,GAAG,UAAU;CAAS,GAAG,SAAS;AAAQ;AACjE,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"TreeSelect.mjs","names":["useId","classes"],"sources":["../../../src/components/TreeSelect/TreeSelect.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n extractStyleProps,\n Factory,\n genericFactory,\n MantineColor,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport { Combobox, ComboboxLikeStylesNames, useCombobox } from '../Combobox';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n InputClearButtonProps,\n InputVariant,\n} from '../Input';\nimport { InputBase } from '../InputBase';\nimport { Pill } from '../Pill';\nimport { PillsInput } from '../PillsInput';\nimport { ScrollArea, ScrollAreaProps } from '../ScrollArea';\nimport type { TreeNodeData } from '../Tree';\nimport { filterTreeData } from '../Tree/filter-tree-data/filter-tree-data';\nimport {\n findTreeNode,\n getChildrenNodesValues,\n} from '../Tree/get-children-nodes-values/get-children-nodes-values';\nimport { isNodeChecked } from '../Tree/is-node-checked/is-node-checked';\nimport { isNodeIndeterminate } from '../Tree/is-node-indeterminate/is-node-indeterminate';\nimport { getTreeExpandedState, TreeExpandedState } from '../Tree/use-tree';\nimport { flattenTreeSelectData } from './flatten-tree-select-data';\nimport {\n CheckedStrategy,\n checkedToValue,\n expandToLeafChecked,\n} from './get-checked-values-by-strategy';\nimport {\n TreeSelectChevronAriaLabels,\n TreeSelectOption,\n TreeSelectRenderNodePayload,\n} from './TreeSelectOption';\nimport classes from './TreeSelect.module.css';\n\nexport type TreeSelectStylesNames =\n | __InputStylesNames\n | ComboboxLikeStylesNames\n | 'pill'\n | 'pillsList'\n | 'inputField';\n\nexport type TreeSelectMode = 'single' | 'multiple' | 'checkbox';\n\nexport type TreeSelectValue<Mode extends TreeSelectMode> = Mode extends 'single'\n ? string | null\n : string[];\n\nexport interface TreeSelectProps<Mode extends TreeSelectMode = 'single'>\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<TreeSelectFactory>,\n ElementProps<'input', 'size' | 'value' | 'defaultValue' | 'onChange'> {\n /** Tree data */\n data: TreeNodeData[];\n\n /** Selection mode: 'single', 'multiple', or 'checkbox' (with cascade) @default 'single' */\n mode?: Mode;\n\n /** Controlled value */\n value?: TreeSelectValue<Mode>;\n\n /** Default value */\n defaultValue?: TreeSelectValue<Mode>;\n\n /** Called when value changes */\n onChange?: (value: TreeSelectValue<Mode>) => void;\n\n /** Disables parent-child cascade in checkbox mode @default false */\n checkStrictly?: boolean;\n\n /** Controls which checked nodes appear in value/pills in checkbox mode @default 'child' */\n checkedStrategy?: CheckedStrategy;\n\n /** Default expanded node values */\n defaultExpandedValues?: string[];\n\n /** Expand all nodes by default @default false */\n defaultExpandAll?: boolean;\n\n /** Controlled expanded state */\n expandedValues?: string[];\n\n /** Called when expanded state changes */\n onExpandedChange?: (values: string[]) => void;\n\n /** Also toggle expand when clicking a parent node (not just the chevron). In `single` and `multiple` modes, parent clicks only expand; only leaves can be selected. In `checkbox` mode, parent clicks both check and expand. @default false */\n expandOnClick?: boolean;\n\n /** Enables search filtering @default false */\n searchable?: boolean;\n\n /** Controlled search value */\n searchValue?: string;\n\n /** Default search value */\n defaultSearchValue?: string;\n\n /** Called when search changes */\n onSearchChange?: (value: string) => void;\n\n /** Custom filter function */\n filter?: (query: string, node: TreeNodeData) => boolean;\n\n /** Message when no nodes match search */\n nothingFoundMessage?: React.ReactNode;\n\n /** Allows deselecting in single mode @default true */\n allowDeselect?: boolean;\n\n /** Shows clear button @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** Props for the clear button */\n clearButtonProps?: InputClearButtonProps;\n\n /** Maximum selectable values (multiple/checkbox mode) */\n maxValues?: number;\n\n /** Maximum displayed pills before \"+N more\" */\n maxDisplayedValues?: number;\n\n /** Content shown when values overflow maxDisplayedValues */\n maxDisplayedValuesContent?: React.ReactNode | ((overflow: number) => React.ReactNode);\n\n /** Called with removed value in multiple/checkbox mode */\n onRemove?: (value: string) => void;\n\n /** Called when clear button is clicked */\n onClear?: () => void;\n\n /** Custom node rendering in the dropdown */\n renderNode?: (payload: TreeSelectRenderNodePayload) => React.ReactNode;\n\n /** Show tree connection lines between parent and child nodes @default true */\n withLines?: boolean;\n\n /** Props for the hidden input */\n hiddenInputProps?: Omit<React.ComponentProps<'input'>, 'value'>;\n\n /** Divider for hidden input values @default ',' */\n hiddenInputValuesDivider?: string;\n\n /** Props for the ScrollArea in the dropdown */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Controls the default chevron color */\n chevronColor?: MantineColor;\n\n /** Max dropdown height @default 220 */\n maxDropdownHeight?: number | string;\n\n /** Controlled dropdown state */\n dropdownOpened?: boolean;\n\n /** Default dropdown state */\n defaultDropdownOpened?: boolean;\n\n /** Called when dropdown opens */\n onDropdownOpen?: () => void;\n\n /** Called when dropdown closes */\n onDropdownClose?: () => void;\n\n /** Props passed to the underlying Combobox */\n comboboxProps?: Record<string, any>;\n\n /** Clear search on selection change @default true */\n clearSearchOnChange?: boolean;\n\n /** Opens dropdown on focus (searchable mode) @default true */\n openOnFocus?: boolean;\n\n /** aria-label values for the expand/collapse chevron button */\n chevronAriaLabels?: TreeSelectChevronAriaLabels;\n}\n\nexport type TreeSelectFactory = Factory<{\n props: TreeSelectProps;\n ref: HTMLInputElement;\n stylesNames: TreeSelectStylesNames;\n variant: InputVariant;\n signature: <Mode extends TreeSelectMode = 'single'>(\n props: TreeSelectProps<Mode>\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n mode: 'single',\n allowDeselect: true,\n checkedStrategy: 'child',\n maxValues: Infinity,\n hiddenInputValuesDivider: ',',\n clearSearchOnChange: true,\n openOnFocus: true,\n size: 'sm',\n withLines: true,\n} satisfies Partial<TreeSelectProps<TreeSelectMode>>;\n\nconst clearSectionOffset: Record<string, number> = {\n xs: 41,\n sm: 50,\n md: 60,\n lg: 72,\n xl: 89,\n};\n\nfunction getAncestorsToNode(value: string, nodes: TreeNodeData[]): string[] | null {\n for (const node of nodes) {\n if (node.value === value) {\n return [];\n }\n if (Array.isArray(node.children)) {\n const path = getAncestorsToNode(value, node.children);\n if (path !== null) {\n return [node.value, ...path];\n }\n }\n }\n return null;\n}\n\nexport const TreeSelect = genericFactory<TreeSelectFactory>((_props) => {\n const props = useProps(['Input', 'InputWrapper', 'TreeSelect'], defaultProps as any, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n data,\n mode,\n value,\n defaultValue,\n onChange,\n checkStrictly,\n checkedStrategy,\n defaultExpandedValues,\n defaultExpandAll,\n expandedValues,\n onExpandedChange,\n expandOnClick,\n searchable,\n searchValue,\n defaultSearchValue,\n onSearchChange,\n filter,\n nothingFoundMessage,\n allowDeselect,\n clearable,\n clearSectionMode,\n clearButtonProps,\n maxValues,\n maxDisplayedValues,\n maxDisplayedValuesContent,\n onRemove,\n onClear,\n renderNode,\n withLines,\n hiddenInputProps,\n hiddenInputValuesDivider,\n scrollAreaProps,\n chevronColor,\n maxDropdownHeight,\n dropdownOpened,\n defaultDropdownOpened,\n onDropdownOpen,\n onDropdownClose,\n comboboxProps,\n clearSearchOnChange,\n openOnFocus,\n chevronAriaLabels,\n variant,\n onKeyDown,\n onFocus,\n onBlur,\n onClick,\n readOnly,\n disabled,\n radius,\n rightSection,\n rightSectionWidth,\n rightSectionPointerEvents,\n rightSectionProps,\n leftSection,\n leftSectionWidth,\n leftSectionPointerEvents,\n leftSectionProps,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n labelProps,\n descriptionProps,\n errorProps,\n successProps,\n wrapperProps,\n description,\n label,\n error,\n success,\n withErrorStyles,\n withSuccessStyles,\n name,\n form,\n id,\n placeholder,\n required,\n mod,\n attributes,\n ...others\n } = props;\n\n const isMulti = mode === 'multiple' || mode === 'checkbox';\n const isCheckbox = mode === 'checkbox';\n const _id = useId(id);\n\n const combobox = useCombobox({\n opened: dropdownOpened,\n defaultOpened: defaultDropdownOpened,\n onDropdownOpen: () => {\n onDropdownOpen?.();\n combobox.updateSelectedOptionIndex('active', { scrollIntoView: true });\n },\n onDropdownClose: () => {\n onDropdownClose?.();\n combobox.resetSelectedOption();\n },\n });\n\n const initialExpanded = useMemo(() => {\n if (defaultExpandAll) {\n return getTreeExpandedState(data, '*');\n }\n if (defaultExpandedValues) {\n return getTreeExpandedState(data, defaultExpandedValues);\n }\n return getTreeExpandedState(data, []);\n }, []);\n\n const expandedToRecord = useCallback(\n (values: string[] | undefined): TreeExpandedState | undefined => {\n if (!values) {\n return undefined;\n }\n return getTreeExpandedState(data, values);\n },\n [data]\n );\n\n const [_expandedState, setExpandedState] = useUncontrolled<TreeExpandedState>({\n value: expandedToRecord(expandedValues),\n defaultValue: initialExpanded,\n finalValue: {},\n onChange: (val) => {\n if (onExpandedChange) {\n onExpandedChange(\n Object.entries(val)\n .filter(([, v]) => v)\n .map(([k]) => k)\n );\n }\n },\n });\n\n const toggleExpand = useCallback(\n (nodeValue: string) => {\n setExpandedState({ ..._expandedState, [nodeValue]: !_expandedState[nodeValue] });\n },\n [_expandedState]\n );\n\n const initialSearchValue = useMemo(() => {\n if (mode !== 'single' || !defaultValue) {\n return '';\n }\n const node = findTreeNode(defaultValue as string, data);\n return node ? (typeof node.label === 'string' ? node.label : '') : '';\n }, []);\n\n const [_searchValue, setSearchValue] = useUncontrolled({\n value: searchValue,\n defaultValue: defaultSearchValue,\n finalValue: initialSearchValue,\n onChange: onSearchChange,\n });\n\n const handleSearchChange = (val: string) => {\n setSearchValue(val);\n combobox.resetSelectedOption();\n };\n\n const [_value, setValue] = useUncontrolled({\n value: value as any,\n defaultValue: defaultValue as any,\n finalValue: isMulti ? [] : null,\n onChange,\n });\n\n const internalChecked = useMemo(() => {\n if (!isCheckbox || !_value || !Array.isArray(_value)) {\n return [];\n }\n if (checkStrictly) {\n return _value;\n }\n return expandToLeafChecked(_value, data);\n }, [isCheckbox, _value, data, checkStrictly]);\n\n const filteredData = useMemo(() => {\n if (!searchable || !_searchValue) {\n return data;\n }\n if (mode === 'single' && _value) {\n const node = findTreeNode(_value as string, data);\n if (node && _searchValue === (typeof node.label === 'string' ? node.label : '')) {\n return data;\n }\n }\n return filterTreeData(data, _searchValue, filter);\n }, [data, _searchValue, filter, searchable, mode, _value]);\n\n const expandedForRender = useMemo(() => {\n if (_searchValue && filteredData !== data) {\n const expanded = { ..._expandedState };\n const expandFilteredParents = (nodes: TreeNodeData[]) => {\n for (const node of nodes) {\n if (Array.isArray(node.children) && node.children.length > 0) {\n expanded[node.value] = true;\n expandFilteredParents(node.children);\n }\n }\n };\n expandFilteredParents(filteredData);\n return expanded;\n }\n return _expandedState;\n }, [filteredData, _expandedState, _searchValue, data]);\n\n const flatNodes = useMemo(\n () => flattenTreeSelectData(filteredData, expandedForRender),\n [filteredData, expandedForRender]\n );\n\n const flatNodesRef = useRef(flatNodes);\n flatNodesRef.current = flatNodes;\n\n const nodeLookup = useMemo(() => {\n const lookup: Record<string, TreeNodeData> = {};\n const walk = (nodes: TreeNodeData[]) => {\n for (const node of nodes) {\n lookup[node.value] = node;\n if (Array.isArray(node.children)) {\n walk(node.children);\n }\n }\n };\n walk(data);\n return lookup;\n }, [data]);\n\n const getNodeLabel = (nodeValue: string): string => {\n const node = nodeLookup[nodeValue];\n if (!node) {\n return nodeValue;\n }\n return typeof node.label === 'string' ? node.label : nodeValue;\n };\n\n const getStyles = useStyles<TreeSelectFactory>({\n name: 'TreeSelect',\n classes: {} as any,\n props: props as any,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<TreeSelectFactory>({\n props,\n styles,\n classNames,\n });\n\n const {\n styleProps,\n rest: { type, autoComplete, ...rest },\n } = extractStyleProps(others);\n\n const handleOptionSubmit = (val: string) => {\n if (mode === 'single') {\n if (expandOnClick) {\n const node = findTreeNode(val, data);\n if (node && Array.isArray(node.children) && node.children.length > 0) {\n toggleExpand(val);\n return;\n }\n }\n const nextValue = allowDeselect && val === _value ? null : val;\n setValue(nextValue);\n combobox.closeDropdown();\n if (clearSearchOnChange) {\n handleSearchChange(nextValue ? getNodeLabel(nextValue) : '');\n }\n } else if (mode === 'multiple') {\n if (expandOnClick) {\n const node = findTreeNode(val, data);\n if (node && Array.isArray(node.children) && node.children.length > 0) {\n toggleExpand(val);\n return;\n }\n }\n const arr = (_value as string[]) || [];\n if (arr.includes(val)) {\n setValue(arr.filter((v: string) => v !== val));\n onRemove?.(val);\n } else if (arr.length < (maxValues ?? Infinity)) {\n setValue([...arr, val]);\n } else {\n return;\n }\n if (clearSearchOnChange) {\n setSearchValue('');\n }\n } else if (mode === 'checkbox') {\n const nodeChecked = checkStrictly\n ? internalChecked.includes(val)\n : isNodeChecked(val, data, internalChecked);\n\n let newInternalChecked: string[];\n if (checkStrictly) {\n newInternalChecked = nodeChecked\n ? internalChecked.filter((v) => v !== val)\n : [...internalChecked, val];\n } else {\n const childLeaves = getChildrenNodesValues(val, data);\n if (nodeChecked) {\n newInternalChecked = internalChecked.filter((v) => !childLeaves.includes(v));\n } else {\n newInternalChecked = [...new Set([...internalChecked, ...childLeaves])];\n }\n }\n\n const newValue = checkedToValue(newInternalChecked, data, checkedStrategy!);\n if (!nodeChecked && newValue.length > (maxValues ?? Infinity)) {\n return;\n }\n setValue(newValue);\n if (clearSearchOnChange) {\n setSearchValue('');\n }\n\n if (expandOnClick) {\n const node = findTreeNode(val, data);\n if (node && Array.isArray(node.children) && node.children.length > 0) {\n if (!_expandedState[val]) {\n toggleExpand(val);\n }\n }\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (event.key === ' ' && !searchable && isMulti) {\n event.preventDefault();\n combobox.toggleDropdown();\n }\n\n if (event.key === 'Backspace' && _searchValue.length === 0 && isMulti) {\n const arr = (_value as string[]) || [];\n if (arr.length > 0) {\n const removed = arr[arr.length - 1];\n onRemove?.(removed);\n setValue(arr.slice(0, -1));\n }\n }\n\n if (!combobox.dropdownOpened) {\n return;\n }\n\n const index = combobox.getSelectedOptionIndex();\n if (index < 0 || index >= flatNodesRef.current.length) {\n return;\n }\n\n const currentNode = flatNodesRef.current[index];\n\n if (event.key === 'ArrowRight') {\n if (currentNode.hasChildren && !currentNode.expanded) {\n event.preventDefault();\n toggleExpand(currentNode.node.value);\n }\n }\n\n if (event.key === 'ArrowLeft') {\n if (currentNode.hasChildren && currentNode.expanded) {\n event.preventDefault();\n toggleExpand(currentNode.node.value);\n } else if (currentNode.parent) {\n event.preventDefault();\n const parentIndex = flatNodesRef.current.findIndex(\n (n) => n.node.value === currentNode.parent\n );\n if (parentIndex >= 0) {\n combobox.selectOption(parentIndex);\n }\n }\n }\n };\n\n useEffect(() => {\n if (mode !== 'single' || !searchable) {\n return;\n }\n if (value === null) {\n handleSearchChange('');\n } else if (typeof value === 'string') {\n handleSearchChange(getNodeLabel(value));\n }\n }, [value]);\n\n const prevDropdownOpenedRef = useRef(false);\n useEffect(() => {\n if (combobox.dropdownOpened && !prevDropdownOpenedRef.current && searchable && _value) {\n const targets = Array.isArray(_value) ? _value : [_value];\n const newExpanded = { ..._expandedState };\n let changed = false;\n for (const target of targets) {\n const ancestors = getAncestorsToNode(target as string, data);\n if (ancestors) {\n for (const a of ancestors) {\n if (!newExpanded[a]) {\n newExpanded[a] = true;\n changed = true;\n }\n }\n }\n }\n if (changed) {\n setExpandedState(newExpanded);\n requestAnimationFrame(() => {\n combobox.updateSelectedOptionIndex('active', { scrollIntoView: true });\n });\n }\n }\n prevDropdownOpenedRef.current = combobox.dropdownOpened;\n });\n\n const clearButton = (\n <Combobox.ClearButton\n {...clearButtonProps}\n onClear={() => {\n onClear?.();\n setValue(isMulti ? [] : null);\n handleSearchChange('');\n combobox.focusTarget();\n }}\n />\n );\n\n const hasValue = isMulti\n ? Array.isArray(_value) && _value.length > 0\n : _value != null && _value !== '';\n const _clearable = clearable && hasValue && !disabled && !readOnly;\n\n const singleDisplayLabel = useMemo(() => {\n if (mode !== 'single' || !_value) {\n return '';\n }\n return getNodeLabel(_value as string);\n }, [mode, _value, nodeLookup]);\n\n const displayValues = useMemo(() => {\n if (!isMulti || !Array.isArray(_value)) {\n return [];\n }\n return _value as string[];\n }, [isMulti, _value]);\n\n const pillsListStyle =\n _clearable && isMulti\n ? { paddingInlineEnd: clearSectionOffset[size as string] ?? clearSectionOffset.sm }\n : undefined;\n\n const visiblePills =\n maxDisplayedValues != null ? displayValues.slice(0, maxDisplayedValues) : displayValues;\n\n const overflowCount =\n maxDisplayedValues != null ? Math.max(0, displayValues.length - maxDisplayedValues) : 0;\n\n const pills = visiblePills.map((item, index) => (\n <Pill\n key={`${item}-${index}`}\n withRemoveButton={!readOnly}\n onRemove={() => {\n if (isCheckbox) {\n const childLeaves = checkStrictly ? [item] : getChildrenNodesValues(item, data);\n const newInternal = internalChecked.filter((v) => !childLeaves.includes(v));\n setValue(checkedToValue(newInternal, data, checkedStrategy!));\n } else {\n setValue((_value as string[]).filter((v: string) => v !== item));\n }\n onRemove?.(item);\n }}\n unstyled={unstyled}\n disabled={disabled}\n {...getStyles('pill')}\n >\n {getNodeLabel(item)}\n </Pill>\n ));\n\n if (overflowCount > 0) {\n const overflowContent =\n typeof maxDisplayedValuesContent === 'function'\n ? maxDisplayedValuesContent(overflowCount)\n : maxDisplayedValuesContent || `+${overflowCount} more`;\n pills.push(\n <Pill key=\"__overflow\" unstyled={unstyled} disabled={disabled} {...getStyles('pill')}>\n {overflowContent}\n </Pill>\n );\n }\n\n const isEmpty = flatNodes.length === 0;\n\n const options = flatNodes.map((flatNode) => {\n const isSelected =\n mode === 'single'\n ? _value === flatNode.node.value\n : mode === 'multiple'\n ? ((_value as string[]) || []).includes(flatNode.node.value)\n : false;\n\n const nodeChecked = isCheckbox\n ? checkStrictly\n ? internalChecked.includes(flatNode.node.value)\n : isNodeChecked(flatNode.node.value, data, internalChecked)\n : false;\n\n const nodeIndeterminate =\n isCheckbox && !checkStrictly\n ? isNodeIndeterminate(flatNode.node.value, data, internalChecked)\n : false;\n\n return (\n <TreeSelectOption\n key={flatNode.node.value}\n node={flatNode.node}\n level={flatNode.level}\n expanded={flatNode.expanded}\n hasChildren={flatNode.hasChildren}\n selected={isSelected}\n checked={nodeChecked}\n indeterminate={nodeIndeterminate}\n showCheckbox={isCheckbox}\n isLastChild={flatNode.isLastChild}\n lineGuides={flatNode.lineGuides}\n withLines={!!withLines}\n onToggleExpand={toggleExpand}\n renderNode={renderNode}\n chevronAriaLabels={chevronAriaLabels}\n />\n );\n });\n\n const dropdown = (\n <Combobox.Dropdown hidden={readOnly || disabled}>\n <Combobox.Options\n className={classes.optionsWrapper}\n aria-multiselectable={isMulti || undefined}\n >\n <ScrollArea.Autosize\n mah={maxDropdownHeight ?? 220}\n type=\"scroll\"\n scrollbarSize=\"var(--combobox-padding)\"\n offsetScrollbars=\"y\"\n {...scrollAreaProps}\n >\n {options}\n </ScrollArea.Autosize>\n {isEmpty && nothingFoundMessage && <Combobox.Empty>{nothingFoundMessage}</Combobox.Empty>}\n </Combobox.Options>\n </Combobox.Dropdown>\n );\n\n if (isMulti) {\n return (\n <>\n <Combobox\n store={combobox}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n readOnly={readOnly}\n __staticSelector=\"TreeSelect\"\n attributes={attributes}\n onOptionSubmit={handleOptionSubmit}\n {...comboboxProps}\n >\n <Combobox.DropdownTarget>\n <PillsInput\n {...styleProps}\n __staticSelector=\"TreeSelect\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n className={className}\n style={style}\n variant={variant}\n disabled={disabled}\n radius={radius}\n __defaultRightSection={\n <Combobox.Chevron\n size={size}\n error={error}\n unstyled={unstyled}\n color={chevronColor}\n />\n }\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n rightSectionPointerEvents={rightSectionPointerEvents || 'none'}\n rightSectionWidth={rightSectionWidth}\n rightSectionProps={rightSectionProps}\n leftSection={leftSection}\n leftSectionWidth={leftSectionWidth}\n leftSectionPointerEvents={leftSectionPointerEvents}\n leftSectionProps={leftSectionProps}\n inputContainer={inputContainer}\n inputWrapperOrder={inputWrapperOrder}\n withAsterisk={withAsterisk}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n successProps={successProps}\n wrapperProps={wrapperProps}\n description={description}\n label={label}\n error={error}\n success={success}\n withErrorStyles={withErrorStyles}\n withSuccessStyles={withSuccessStyles}\n __stylesApiProps={{\n ...props,\n rightSectionPointerEvents: rightSectionPointerEvents || 'none',\n multiline: true,\n }}\n pointer={!searchable}\n onClick={() => (searchable ? combobox.openDropdown() : combobox.toggleDropdown())}\n data-expanded={combobox.dropdownOpened || undefined}\n id={_id}\n required={required}\n mod={mod}\n attributes={attributes}\n >\n <Pill.Group\n attributes={attributes}\n disabled={disabled}\n unstyled={unstyled}\n {...getStyles('pillsList', { style: pillsListStyle })}\n >\n {pills}\n <Combobox.EventsTarget autoComplete={autoComplete}>\n <PillsInput.Field\n {...rest}\n id={_id}\n placeholder={placeholder}\n type={!searchable && !placeholder ? 'hidden' : 'visible'}\n {...getStyles('inputField')}\n unstyled={unstyled}\n onFocus={(event) => {\n onFocus?.(event);\n if (openOnFocus && searchable) {\n combobox.openDropdown();\n }\n }}\n onBlur={(event) => {\n onBlur?.(event);\n combobox.closeDropdown();\n handleSearchChange('');\n }}\n onKeyDown={handleKeyDown}\n value={_searchValue}\n onChange={(event) => {\n handleSearchChange(event.currentTarget.value);\n if (searchable) {\n combobox.openDropdown();\n }\n }}\n disabled={disabled}\n readOnly={readOnly || !searchable}\n pointer={!searchable}\n />\n </Combobox.EventsTarget>\n </Pill.Group>\n </PillsInput>\n </Combobox.DropdownTarget>\n {dropdown}\n </Combobox>\n <Combobox.HiddenInput\n name={name}\n valuesDivider={hiddenInputValuesDivider}\n value={_value}\n form={form}\n disabled={disabled}\n {...hiddenInputProps}\n />\n </>\n );\n }\n\n return (\n <>\n <Combobox\n store={combobox}\n __staticSelector=\"TreeSelect\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n readOnly={readOnly}\n size={size}\n attributes={attributes}\n onOptionSubmit={handleOptionSubmit}\n {...comboboxProps}\n >\n <Combobox.Target targetType={searchable ? 'input' : 'button'} autoComplete={autoComplete}>\n <InputBase\n id={_id}\n __defaultRightSection={\n <Combobox.Chevron\n size={size}\n error={error}\n unstyled={unstyled}\n color={chevronColor}\n />\n }\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n rightSectionPointerEvents={rightSectionPointerEvents || 'none'}\n {...rest}\n {...styleProps}\n size={size}\n __staticSelector=\"TreeSelect\"\n disabled={disabled}\n readOnly={readOnly || !searchable}\n value={searchable ? _searchValue : singleDisplayLabel}\n onChange={(event) => {\n handleSearchChange(event.currentTarget.value);\n combobox.openDropdown();\n }}\n onFocus={(event) => {\n if (openOnFocus && searchable) {\n combobox.openDropdown();\n }\n onFocus?.(event);\n }}\n onBlur={(event) => {\n if (searchable) {\n combobox.closeDropdown();\n }\n handleSearchChange(_value ? getNodeLabel(_value as string) : '');\n onBlur?.(event);\n }}\n onClick={(event) => {\n searchable ? combobox.openDropdown() : combobox.toggleDropdown();\n onClick?.(event);\n }}\n onKeyDown={handleKeyDown}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n pointer={!searchable}\n error={error}\n success={success}\n attributes={attributes}\n className={className}\n style={style}\n variant={variant}\n radius={radius}\n leftSection={leftSection}\n leftSectionWidth={leftSectionWidth}\n leftSectionPointerEvents={leftSectionPointerEvents}\n leftSectionProps={leftSectionProps}\n rightSectionWidth={rightSectionWidth}\n rightSectionProps={rightSectionProps}\n inputContainer={inputContainer}\n inputWrapperOrder={inputWrapperOrder}\n withAsterisk={withAsterisk}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n successProps={successProps}\n wrapperProps={wrapperProps}\n description={description}\n label={label}\n withErrorStyles={withErrorStyles}\n withSuccessStyles={withSuccessStyles}\n placeholder={placeholder}\n required={required}\n mod={mod}\n />\n </Combobox.Target>\n {dropdown}\n </Combobox>\n <Combobox.HiddenInput\n value={_value}\n name={name}\n form={form}\n disabled={disabled}\n {...hiddenInputProps}\n />\n </>\n );\n});\n\nTreeSelect.classes = { ...InputBase.classes, ...Combobox.classes };\nTreeSelect.displayName = '@mantine/core/TreeSelect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4MA,MAAM,eAAe;CACnB,MAAM;CACN,eAAe;CACf,iBAAiB;CACjB,WAAW;CACX,0BAA0B;CAC1B,qBAAqB;CACrB,aAAa;CACb,MAAM;CACN,WAAW;AACb;AAEA,MAAM,qBAA6C;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAS,mBAAmB,OAAe,OAAwC;CACjF,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,UAAU,OACjB,OAAO,CAAC;EAEV,IAAI,MAAM,QAAQ,KAAK,QAAQ,GAAG;GAChC,MAAM,OAAO,mBAAmB,OAAO,KAAK,QAAQ;GACpD,IAAI,SAAS,MACX,OAAO,CAAC,KAAK,OAAO,GAAG,IAAI;EAE/B;CACF;CACA,OAAO;AACT;AAEA,MAAa,aAAa,gBAAmC,WAAW;CACtE,MAAM,QAAQ,SAAS;EAAC;EAAS;EAAgB;CAAY,GAAG,cAAqB,MAAM;CAC3F,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,MACA,MACA,OACA,cACA,UACA,eACA,iBACA,uBACA,kBACA,gBACA,kBACA,eACA,YACA,aACA,oBACA,gBACA,QACA,qBACA,eACA,WACA,kBACA,kBACA,WACA,oBACA,2BACA,UACA,SACA,YACA,WACA,kBACA,0BACA,iBACA,cACA,mBACA,gBACA,uBACA,gBACA,iBACA,eACA,qBACA,aACA,mBACA,SACA,WACA,SACA,QACA,SACA,UACA,UACA,QACA,cACA,mBACA,2BACA,mBACA,aACA,kBACA,0BACA,kBACA,gBACA,mBACA,cACA,YACA,kBACA,YACA,cACA,cACA,aACA,OACA,OACA,SACA,iBACA,mBACA,MACA,MACA,IACA,aACA,UACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,UAAU,SAAS,cAAc,SAAS;CAChD,MAAM,aAAa,SAAS;CAC5B,MAAM,MAAMA,QAAM,EAAE;CAEpB,MAAM,WAAW,YAAY;EAC3B,QAAQ;EACR,eAAe;EACf,sBAAsB;GACpB,iBAAiB;GACjB,SAAS,0BAA0B,UAAU,EAAE,gBAAgB,KAAK,CAAC;EACvE;EACA,uBAAuB;GACrB,kBAAkB;GAClB,SAAS,oBAAoB;EAC/B;CACF,CAAC;CAED,MAAM,kBAAkB,cAAc;EACpC,IAAI,kBACF,OAAO,qBAAqB,MAAM,GAAG;EAEvC,IAAI,uBACF,OAAO,qBAAqB,MAAM,qBAAqB;EAEzD,OAAO,qBAAqB,MAAM,CAAC,CAAC;CACtC,GAAG,CAAC,CAAC;CAYL,MAAM,CAAC,gBAAgB,oBAAoB,gBAAmC;EAC5E,OAXuB,aACtB,WAAgE;GAC/D,IAAI,CAAC,QACH;GAEF,OAAO,qBAAqB,MAAM,MAAM;EAC1C,GACA,CAAC,IAAI,CAIiB,CAAC,CAAC,c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ACG;KACV,OAAO;IACR,CAAA;IAEH,gBAAgB;IAChB,aAAa;IACb,oBAAoB;IACN;IACd,2BAA2B,6BAA6B;IACxD,GAAI;IACJ,GAAI;IACE;IACN,kBAAiB;IACP;IACV,UAAU,YAAY,CAAC;IACvB,OAAO,aAAa,eAAe;IACnC,WAAW,UAAU;KACnB,mBAAmB,MAAM,cAAc,KAAK;KAC5C,SAAS,aAAa;IACxB;IACA,UAAU,UAAU;KAClB,IAAI,eAAe,YACjB,SAAS,aAAa;KAExB,UAAU,KAAK;IACjB;IACA,SAAS,UAAU;KACjB,IAAI,YACF,SAAS,cAAc;KAEzB,mBAAmB,SAAS,aAAa,MAAgB,IAAI,EAAE;KAC/D,SAAS,KAAK;IAChB;IACA,UAAU,UAAU;KAClB,aAAa,SAAS,aAAa,IAAI,SAAS,eAAe;KAC/D,UAAU,KAAK;IACjB;IACA,WAAW;IACX,YAAY;IACZ,QAAQ;IACE;IACV,SAAS,CAAC;IACH;IACE;IACG;IACD;IACJ;IACE;IACD;IACK;IACK;IACQ;IACR;IACC;IACA;IACH;IACG;IACL;IACF;IACM;IACN;IACE;IACA;IACD;IACN;IACU;IACE;IACN;IACH;IACL;GACN,CAAA;EACc,CAAA,GAChB,QACO;KACV,oBAAC,SAAS,aAAV;EACE,OAAO;EACD;EACA;EACI;EACV,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CAAC;AAED,WAAW,UAAU;CAAE,GAAG,UAAU;CAAS,GAAG,SAAS;AAAQ;AACjE,WAAW,cAAc"}
|
|
@@ -13,12 +13,13 @@ function useMantineTheme() {
|
|
|
13
13
|
}
|
|
14
14
|
function MantineThemeProvider({ theme, children, inherit = true }) {
|
|
15
15
|
const parentTheme = useSafeMantineTheme();
|
|
16
|
+
const mergedTheme = useMemo(() => mergeMantineTheme(inherit ? parentTheme : DEFAULT_THEME, theme), [
|
|
17
|
+
theme,
|
|
18
|
+
parentTheme,
|
|
19
|
+
inherit
|
|
20
|
+
]);
|
|
16
21
|
return /* @__PURE__ */ jsx(MantineThemeContext, {
|
|
17
|
-
value:
|
|
18
|
-
theme,
|
|
19
|
-
parentTheme,
|
|
20
|
-
inherit
|
|
21
|
-
]),
|
|
22
|
+
value: mergedTheme,
|
|
22
23
|
children
|
|
23
24
|
});
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MantineThemeProvider.mjs","names":[],"sources":["../../../../src/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.tsx"],"sourcesContent":["import { createContext, use, useMemo } from 'react';\nimport { DEFAULT_THEME } from '../default-theme';\nimport { mergeMantineTheme } from '../merge-mantine-theme';\nimport { MantineTheme, MantineThemeOverride } from '../theme.types';\n\nexport const MantineThemeContext = createContext<MantineTheme | null>(null);\n\nexport const useSafeMantineTheme = () => use(MantineThemeContext) || DEFAULT_THEME;\n\nexport function useMantineTheme() {\n const ctx = use(MantineThemeContext);\n if (!ctx) {\n throw new Error(\n '@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app'\n );\n }\n\n return ctx;\n}\n\nexport interface MantineThemeProviderProps {\n /** Determines whether theme should be inherited from parent MantineProvider @default true */\n inherit?: boolean;\n\n /** Theme override object */\n theme?: MantineThemeOverride;\n\n /** Your application or part of the application that requires different theme */\n children?: React.ReactNode;\n}\n\nexport function MantineThemeProvider({\n theme,\n children,\n inherit = true,\n}: MantineThemeProviderProps) {\n const parentTheme = useSafeMantineTheme();\n const mergedTheme = useMemo(\n () => mergeMantineTheme(inherit ? parentTheme : DEFAULT_THEME, theme),\n [theme, parentTheme, inherit]\n );\n\n return <MantineThemeContext value={mergedTheme}>{children}</MantineThemeContext>;\n}\n\nMantineThemeProvider.displayName = '@mantine/core/MantineThemeProvider';\n"],"mappings":";;;;;;AAKA,MAAa,sBAAsB,cAAmC,IAAI;AAE1E,MAAa,4BAA4B,IAAI,mBAAmB,KAAK;AAErE,SAAgB,kBAAkB;CAChC,MAAM,MAAM,IAAI,mBAAmB;CACnC,IAAI,CAAC,KACH,MAAM,IAAI,MACR,mGACF;CAGF,OAAO;AACT;AAaA,SAAgB,qBAAqB,EACnC,OACA,UACA,UAAU,QACkB;CAC5B,MAAM,cAAc,oBAAoB;
|
|
1
|
+
{"version":3,"file":"MantineThemeProvider.mjs","names":[],"sources":["../../../../src/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.tsx"],"sourcesContent":["import { createContext, use, useMemo } from 'react';\nimport { DEFAULT_THEME } from '../default-theme';\nimport { mergeMantineTheme } from '../merge-mantine-theme';\nimport { MantineTheme, MantineThemeOverride } from '../theme.types';\n\nexport const MantineThemeContext = createContext<MantineTheme | null>(null);\n\nexport const useSafeMantineTheme = () => use(MantineThemeContext) || DEFAULT_THEME;\n\nexport function useMantineTheme() {\n const ctx = use(MantineThemeContext);\n if (!ctx) {\n throw new Error(\n '@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app'\n );\n }\n\n return ctx;\n}\n\nexport interface MantineThemeProviderProps {\n /** Determines whether theme should be inherited from parent MantineProvider @default true */\n inherit?: boolean;\n\n /** Theme override object */\n theme?: MantineThemeOverride;\n\n /** Your application or part of the application that requires different theme */\n children?: React.ReactNode;\n}\n\nexport function MantineThemeProvider({\n theme,\n children,\n inherit = true,\n}: MantineThemeProviderProps) {\n const parentTheme = useSafeMantineTheme();\n const mergedTheme = useMemo(\n () => mergeMantineTheme(inherit ? parentTheme : DEFAULT_THEME, theme),\n [theme, parentTheme, inherit]\n );\n\n return <MantineThemeContext value={mergedTheme}>{children}</MantineThemeContext>;\n}\n\nMantineThemeProvider.displayName = '@mantine/core/MantineThemeProvider';\n"],"mappings":";;;;;;AAKA,MAAa,sBAAsB,cAAmC,IAAI;AAE1E,MAAa,4BAA4B,IAAI,mBAAmB,KAAK;AAErE,SAAgB,kBAAkB;CAChC,MAAM,MAAM,IAAI,mBAAmB;CACnC,IAAI,CAAC,KACH,MAAM,IAAI,MACR,mGACF;CAGF,OAAO;AACT;AAaA,SAAgB,qBAAqB,EACnC,OACA,UACA,UAAU,QACkB;CAC5B,MAAM,cAAc,oBAAoB;CACxC,MAAM,cAAc,cACZ,kBAAkB,UAAU,cAAc,eAAe,KAAK,GACpE;EAAC;EAAO;EAAa;CAAO,CAC9B;CAEA,OAAO,oBAAC,qBAAD;EAAqB,OAAO;EAAc;CAA8B,CAAA;AACjF;AAEA,qBAAqB,cAAc"}
|
|
@@ -27,6 +27,6 @@ function mergeMantineTheme(currentTheme, themeOverride) {
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
export { mergeMantineTheme, validateMantineTheme };
|
|
30
|
+
export { INVALID_PRIMARY_COLOR_ERROR, INVALID_PRIMARY_SHADE_ERROR, mergeMantineTheme, validateMantineTheme };
|
|
31
31
|
|
|
32
32
|
//# sourceMappingURL=merge-mantine-theme.mjs.map
|
|
@@ -23,13 +23,14 @@ function getFirstMatchingBreakpoint(matches) {
|
|
|
23
23
|
}
|
|
24
24
|
function useMatches(payload, options) {
|
|
25
25
|
const theme = useMantineTheme();
|
|
26
|
-
|
|
26
|
+
const firstMatchingBreakpointIndex = getFirstMatchingBreakpoint([
|
|
27
27
|
useMediaQuery(`(min-width: ${theme.breakpoints.xs})`, false, options),
|
|
28
28
|
useMediaQuery(`(min-width: ${theme.breakpoints.sm})`, false, options),
|
|
29
29
|
useMediaQuery(`(min-width: ${theme.breakpoints.md})`, false, options),
|
|
30
30
|
useMediaQuery(`(min-width: ${theme.breakpoints.lg})`, false, options),
|
|
31
31
|
useMediaQuery(`(min-width: ${theme.breakpoints.xl})`, false, options)
|
|
32
|
-
])
|
|
32
|
+
]);
|
|
33
|
+
return getFirstMatchingValue(payload, BREAKPOINTS[firstMatchingBreakpointIndex]);
|
|
33
34
|
}
|
|
34
35
|
//#endregion
|
|
35
36
|
export { useMatches };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-matches.mjs","names":[],"sources":["../../../../src/core/MantineProvider/use-matches/use-matches.ts"],"sourcesContent":["import { useMediaQuery, UseMediaQueryOptions } from '@mantine/hooks';\nimport { useMantineTheme } from '../MantineThemeProvider';\nimport { MantineBreakpoint } from '../theme.types';\n\ntype UseMatchesInput<T> = Partial<Record<MantineBreakpoint, T>>;\n\nconst BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nfunction getFirstMatchingValue<T>(\n value: UseMatchesInput<T>,\n biggestMatch: MantineBreakpoint | undefined\n): T {\n if (!biggestMatch) {\n return value.base!;\n }\n\n let index = BREAKPOINTS.indexOf(biggestMatch);\n\n while (index >= 0) {\n if (BREAKPOINTS[index] in value) {\n return value[BREAKPOINTS[index]]!;\n }\n index -= 1;\n }\n\n return value.base!;\n}\n\nfunction getFirstMatchingBreakpoint(matches: (boolean | undefined)[]) {\n return matches.findLastIndex((v) => v);\n}\n\nexport function useMatches<T>(payload: UseMatchesInput<T>, options?: UseMediaQueryOptions) {\n const theme = useMantineTheme();\n const xsMatches = useMediaQuery(`(min-width: ${theme.breakpoints.xs})`, false, options);\n const smMatches = useMediaQuery(`(min-width: ${theme.breakpoints.sm})`, false, options);\n const mdMatches = useMediaQuery(`(min-width: ${theme.breakpoints.md})`, false, options);\n const lgMatches = useMediaQuery(`(min-width: ${theme.breakpoints.lg})`, false, options);\n const xlMatches = useMediaQuery(`(min-width: ${theme.breakpoints.xl})`, false, options);\n\n const breakpoints = [xsMatches, smMatches, mdMatches, lgMatches, xlMatches];\n const firstMatchingBreakpointIndex = getFirstMatchingBreakpoint(breakpoints);\n return getFirstMatchingValue(payload, BREAKPOINTS[firstMatchingBreakpointIndex]);\n}\n"],"mappings":";;;;AAMA,MAAM,cAAc;CAAC;CAAM;CAAM;CAAM;CAAM;AAAI;AAEjD,SAAS,sBACP,OACA,cACG;CACH,IAAI,CAAC,cACH,OAAO,MAAM;CAGf,IAAI,QAAQ,YAAY,QAAQ,YAAY;CAE5C,OAAO,SAAS,GAAG;EACjB,IAAI,YAAY,UAAU,OACxB,OAAO,MAAM,YAAY;EAE3B,SAAS;CACX;CAEA,OAAO,MAAM;AACf;AAEA,SAAS,2BAA2B,SAAkC;CACpE,OAAO,QAAQ,eAAe,MAAM,CAAC;AACvC;AAEA,SAAgB,WAAc,SAA6B,SAAgC;CACzF,MAAM,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"file":"use-matches.mjs","names":[],"sources":["../../../../src/core/MantineProvider/use-matches/use-matches.ts"],"sourcesContent":["import { useMediaQuery, UseMediaQueryOptions } from '@mantine/hooks';\nimport { useMantineTheme } from '../MantineThemeProvider';\nimport { MantineBreakpoint } from '../theme.types';\n\ntype UseMatchesInput<T> = Partial<Record<MantineBreakpoint, T>>;\n\nconst BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nfunction getFirstMatchingValue<T>(\n value: UseMatchesInput<T>,\n biggestMatch: MantineBreakpoint | undefined\n): T {\n if (!biggestMatch) {\n return value.base!;\n }\n\n let index = BREAKPOINTS.indexOf(biggestMatch);\n\n while (index >= 0) {\n if (BREAKPOINTS[index] in value) {\n return value[BREAKPOINTS[index]]!;\n }\n index -= 1;\n }\n\n return value.base!;\n}\n\nfunction getFirstMatchingBreakpoint(matches: (boolean | undefined)[]) {\n return matches.findLastIndex((v) => v);\n}\n\nexport function useMatches<T>(payload: UseMatchesInput<T>, options?: UseMediaQueryOptions) {\n const theme = useMantineTheme();\n const xsMatches = useMediaQuery(`(min-width: ${theme.breakpoints.xs})`, false, options);\n const smMatches = useMediaQuery(`(min-width: ${theme.breakpoints.sm})`, false, options);\n const mdMatches = useMediaQuery(`(min-width: ${theme.breakpoints.md})`, false, options);\n const lgMatches = useMediaQuery(`(min-width: ${theme.breakpoints.lg})`, false, options);\n const xlMatches = useMediaQuery(`(min-width: ${theme.breakpoints.xl})`, false, options);\n\n const breakpoints = [xsMatches, smMatches, mdMatches, lgMatches, xlMatches];\n const firstMatchingBreakpointIndex = getFirstMatchingBreakpoint(breakpoints);\n return getFirstMatchingValue(payload, BREAKPOINTS[firstMatchingBreakpointIndex]);\n}\n"],"mappings":";;;;AAMA,MAAM,cAAc;CAAC;CAAM;CAAM;CAAM;CAAM;AAAI;AAEjD,SAAS,sBACP,OACA,cACG;CACH,IAAI,CAAC,cACH,OAAO,MAAM;CAGf,IAAI,QAAQ,YAAY,QAAQ,YAAY;CAE5C,OAAO,SAAS,GAAG;EACjB,IAAI,YAAY,UAAU,OACxB,OAAO,MAAM,YAAY;EAE3B,SAAS;CACX;CAEA,OAAO,MAAM;AACf;AAEA,SAAS,2BAA2B,SAAkC;CACpE,OAAO,QAAQ,eAAe,MAAM,CAAC;AACvC;AAEA,SAAgB,WAAc,SAA6B,SAAgC;CACzF,MAAM,QAAQ,gBAAgB;CAQ9B,MAAM,+BAA+B,2BAA2B;EAP9C,cAAc,eAAe,MAAM,YAAY,GAAG,IAAI,OAAO,OAMlD;EALX,cAAc,eAAe,MAAM,YAAY,GAAG,IAAI,OAAO,OAKvC;EAJtB,cAAc,eAAe,MAAM,YAAY,GAAG,IAAI,OAAO,OAI5B;EAHjC,cAAc,eAAe,MAAM,YAAY,GAAG,IAAI,OAAO,OAGjB;EAF5C,cAAc,eAAe,MAAM,YAAY,GAAG,IAAI,OAAO,OAEN;CACC,CAAC;CAC3E,OAAO,sBAAsB,SAAS,YAAY,6BAA6B;AACjF"}
|
package/esm/index.mjs
CHANGED
|
@@ -58,11 +58,11 @@ import { MantineThemeContext, MantineThemeProvider, useMantineTheme, useSafeMant
|
|
|
58
58
|
import { convertCssVariables } from "./core/MantineProvider/convert-css-variables/convert-css-variables.mjs";
|
|
59
59
|
import { getCSSColorVariables } from "./core/MantineProvider/MantineCssVariables/get-css-color-variables.mjs";
|
|
60
60
|
import { defaultCssVariablesResolver } from "./core/MantineProvider/MantineCssVariables/default-css-variables-resolver.mjs";
|
|
61
|
+
import { v8CssVariablesResolver } from "./core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.mjs";
|
|
61
62
|
import { HeadlessMantineProvider, MantineProvider } from "./core/MantineProvider/MantineProvider.mjs";
|
|
62
63
|
import { useProps } from "./core/MantineProvider/use-props/use-props.mjs";
|
|
63
64
|
import { createTheme } from "./core/MantineProvider/create-theme/create-theme.mjs";
|
|
64
65
|
import { mergeThemeOverrides } from "./core/MantineProvider/merge-theme-overrides/merge-theme-overrides.mjs";
|
|
65
|
-
import { v8CssVariablesResolver } from "./core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.mjs";
|
|
66
66
|
import { useMatches } from "./core/MantineProvider/use-matches/use-matches.mjs";
|
|
67
67
|
import { mantineHtmlProps } from "./core/MantineProvider/mantine-html-props.mjs";
|
|
68
68
|
import { useResolvedStylesApi } from "./core/styles-api/use-resolved-styles-api/use-resolved-styles-api.mjs";
|
|
@@ -197,6 +197,9 @@ import { ButtonGroupSection } from "./components/Button/ButtonGroupSection/Butto
|
|
|
197
197
|
import { Button } from "./components/Button/Button.mjs";
|
|
198
198
|
import { CardSection } from "./components/Card/CardSection/CardSection.mjs";
|
|
199
199
|
import { Card } from "./components/Card/Card.mjs";
|
|
200
|
+
import { flattenCascaderPaths } from "./components/Cascader/flatten-cascader-paths.mjs";
|
|
201
|
+
import { getCascaderPathOptions } from "./components/Cascader/get-cascader-path-options.mjs";
|
|
202
|
+
import { Cascader } from "./components/Cascader/Cascader.mjs";
|
|
200
203
|
import { Center } from "./components/Center/Center.mjs";
|
|
201
204
|
import { ChipGroup, ChipGroupContext } from "./components/Chip/ChipGroup/ChipGroup.mjs";
|
|
202
205
|
import { Chip } from "./components/Chip/Chip.mjs";
|
|
@@ -378,4 +381,4 @@ import { TreeSelectOption } from "./components/TreeSelect/TreeSelectOption.mjs";
|
|
|
378
381
|
import { TreeSelect } from "./components/TreeSelect/TreeSelect.mjs";
|
|
379
382
|
import { Typography } from "./components/Typography/Typography.mjs";
|
|
380
383
|
import { RemoveScroll } from "react-remove-scroll";
|
|
381
|
-
export { Accordion, AccordionChevron, AccordionControl, AccordionItem, AccordionPanel, ActionIcon, ActionIconGroup, ActionIconGroupSection, Affix, Alert, AlphaSlider, Anchor, AngleSlider, AppShell, AppShellAside, AppShellFooter, AppShellHeader, AppShellMain, AppShellNavbar, AppShellSection, AspectRatio, Autocomplete, Avatar, AvatarGroup, AvatarGroupContext, BackgroundImage, Badge, Blockquote, Box, Breadcrumbs, Burger, Button, ButtonGroup, ButtonGroupSection, Card, CardSection, Center, CheckIcon, Checkbox, CheckboxCard, CheckboxCardContext, CheckboxGroup, CheckboxGroupContext, CheckboxIndicator, Chip, ChipGroup, ChipGroupContext, CloseButton, CloseIcon, Code, Collapse, ColorInput, ColorPicker, ColorSchemeScript, ColorSwatch, Combobox, ComboboxChevron, ComboboxClearButton, ComboboxDropdown, ComboboxDropdownTarget, ComboboxEmpty, ComboboxEventsTarget, ComboboxFooter, ComboboxGroup, ComboboxHeader, ComboboxHiddenInput, ComboboxOption, ComboboxOptions, ComboboxPopover, ComboboxPopoverTarget, ComboboxSearch, ComboboxTarget, Container, CopyButton, DEFAULT_THEME, DataList, DataListItem, DataListItemLabel, DataListItemValue, Dialog, DirectionContext, DirectionProvider, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerHeader, DrawerOverlay, DrawerRoot, DrawerStack, DrawerStackContext, DrawerTitle, EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIndicator, EmptyStateTitle, FLEX_STYLE_PROPS_DATA, FOCUS_CLASS_NAMES, Fieldset, FileButton, FileInput, FlatTreeNode, Flex, FloatingArrow, FloatingIndicator, FloatingWindow, FocusTrap, FocusTrapInitialFocus, Grid, GridCol, Group, HeadlessMantineProvider, Highlight, HoverCard, HoverCardDropdown, HoverCardGroup, HoverCardGroupContext, HoverCardTarget, HueSlider, Image, Indicator, InlineStyles, Input, InputBase, InputClearButton, InputClearSection, InputDescription, InputError, InputLabel, InputPlaceholder, InputSuccess, InputWrapper, InputWrapperContext, JsonInput, Kbd, List, ListItem, Loader, LoadingOverlay, transitions as MANTINE_TRANSITIONS, MantineContext, MantineProvider, MantineThemeContext, MantineThemeProvider, Mark, Marquee, MaskInput, Menu, MenuCheckboxGroup, MenuCheckboxItem, MenuContextMenu, MenuDivider, MenuDropdown, MenuItem, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSearch, MenuSub, MenuSubDropdown, MenuSubItem, MenuSubTarget, MenuTarget, Menubar, MenubarDropdown, MenubarMenu, MenubarTarget, Modal, ModalBase, ModalBaseBody, ModalBaseCloseButton, ModalBaseContent, ModalBaseHeader, ModalBaseOverlay, ModalBaseTitle, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay, ModalRoot, ModalStack, ModalStackContext, ModalTitle, MultiSelect, NativeScrollArea, NativeSelect, NavLink, Notification, NumberFormatter, NumberInput, OptionalPortal, OptionsDropdown, OverflowList, Overlay, Pagination, PaginationControl, PaginationDots, PaginationFirst, PaginationItems, PaginationLabel, PaginationLast, PaginationNext, PaginationPrevious, PaginationRoot, Paper, PasswordInput, Pill, PillGroup, PillsInput, PillsInputContext, PillsInputField, PinInput, Popover, PopoverContextMenu, PopoverDropdown, PopoverTarget, Portal, Progress, ProgressLabel, ProgressRoot, ProgressSection, Radio, RadioCard, RadioCardContext, RadioGroup, RadioGroupContext, RadioIcon, RadioIndicator, RangeSlider, Rating, RemoveScroll, RingProgress, RollingNumber, STYlE_PROPS_DATA, ScrollArea, ScrollAreaAutosize, Scroller, SegmentedControl, Select, SemiCircleProgress, SimpleGrid, Skeleton, Slider, Space, Splitter, SplitterPane, Spoiler, Stack, Stepper, StepperCompleted, StepperStep, Switch, SwitchGroup, SwitchGroupContext, Table, TableCaption, TableOfContents, TableScrollContainer, TableTbody, TableTd, TableTfoot, TableTh, TableThead, TableTr, Tabs, TabsList, TabsPanel, TabsTab, TagsInput, Text, TextInput, Textarea, ThemeIcon, Timeline, TimelineItem, Title, Tooltip, TooltipFloating, TooltipGroup, TooltipGroupContext, Transition, Tree, TreeSelect, TreeSelectOption, Typography, UnstyledButton, VisuallyHidden, alpha, camelToKebabCase, closeOnEscape, colorsTuple, convertCssVariables, convertHsvaTo, createEventHandler, createPolymorphicComponent, createSafeContext, createScopedKeydownHandler, createTheme, createUseExternalEvents, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultLoaders, defaultOptionsFilter, defaultTreeNodeFilter, defaultVariantColorsResolver, em, extractStyleProps, factory, filterProps, filterTreeData, findClosestNumber, findElementAncestor, findElementBySelector, findElementsBySelector, flattenTreeData, genericFactory, getArrowMergeDropdownStyles, getAutoContrastValue, getBaseValue, getBreakpointValue, getCSSColorVariables, getContextItemIndex, getContrastColor, getDefaultZIndex, getEnv, getFloatingPosition, getFontSize, getGradient, getLineHeight, getOptionsLockup, getParsedComboboxData, getPrimaryContrastColor, getPrimaryShade, getRadius, getRefProp, getRootElement, getSafeId, getShadow, getSingleElementChild, getSize, getSortedBreakpoints, getSpacing, getStyleObject, getThemeColor, getTransitionProps, getTreeExpandedState, getVirtualColorContrast, hashStyleProps, isColorValid, isElement, isLightColor, isMantineColorScheme, isNumberLike, isOptionsGroup, isPrimitive, isVirtualColor, keys, lighten, localStorageColorSchemeManager, luminance, mantineHtmlProps, memoize, mergeAsyncChildren, mergeMantineTheme, mergeThemeOverrides, moveTreeNode, noop, parseColor, parseStyleProps, parseThemeColor, polymorphic, polymorphicFactory, px, rem, resolveClassNames, resolveStyles, rgba, stylesToString, toRgba, useAccordionContext, useAccordionItemContext, useAppShellContext, useCombobox, useComboboxContext, useComboboxTargetProps, useComputedColorScheme, useDataListContext, useDelayedHover, useDirection, useDrawerContext, useDrawersStack, useEmptyStateContext, useGridContext, useHoverCardContext, useHovered, useInputProps, useListContext, useMantineClassNamesPrefix, useMantineColorScheme, useMantineContext, useMantineCssVariablesResolver, useMantineDeduplicateInlineStyles, useMantineEnv, useMantineIsHeadless, useMantineStyleNonce, useMantineStylesTransform, useMantineSxTransform, useMantineTheme, useMantineWithStaticClasses, useMatches, useMenuContext, useMenubarContext, useMenubarMenuContext, useModalContext, useModalsStack, usePaginationContext, usePillsReorder, usePopoverContext, useProgressContext, useProps, useProviderColorScheme, useRandomClassName, useResolvedStylesApi, useSafeMantineTheme, useScrollAreaContext, useSplitterContext, useStepperContext, useStyles, useTableContext, useTabsContext, useTree, useVirtualizedCombobox, v8CssVariablesResolver, validateMantineTheme, virtualColor };
|
|
384
|
+
export { Accordion, AccordionChevron, AccordionControl, AccordionItem, AccordionPanel, ActionIcon, ActionIconGroup, ActionIconGroupSection, Affix, Alert, AlphaSlider, Anchor, AngleSlider, AppShell, AppShellAside, AppShellFooter, AppShellHeader, AppShellMain, AppShellNavbar, AppShellSection, AspectRatio, Autocomplete, Avatar, AvatarGroup, AvatarGroupContext, BackgroundImage, Badge, Blockquote, Box, Breadcrumbs, Burger, Button, ButtonGroup, ButtonGroupSection, Card, CardSection, Cascader, Center, CheckIcon, Checkbox, CheckboxCard, CheckboxCardContext, CheckboxGroup, CheckboxGroupContext, CheckboxIndicator, Chip, ChipGroup, ChipGroupContext, CloseButton, CloseIcon, Code, Collapse, ColorInput, ColorPicker, ColorSchemeScript, ColorSwatch, Combobox, ComboboxChevron, ComboboxClearButton, ComboboxDropdown, ComboboxDropdownTarget, ComboboxEmpty, ComboboxEventsTarget, ComboboxFooter, ComboboxGroup, ComboboxHeader, ComboboxHiddenInput, ComboboxOption, ComboboxOptions, ComboboxPopover, ComboboxPopoverTarget, ComboboxSearch, ComboboxTarget, Container, CopyButton, DEFAULT_THEME, DataList, DataListItem, DataListItemLabel, DataListItemValue, Dialog, DirectionContext, DirectionProvider, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerHeader, DrawerOverlay, DrawerRoot, DrawerStack, DrawerStackContext, DrawerTitle, EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIndicator, EmptyStateTitle, FLEX_STYLE_PROPS_DATA, FOCUS_CLASS_NAMES, Fieldset, FileButton, FileInput, FlatTreeNode, Flex, FloatingArrow, FloatingIndicator, FloatingWindow, FocusTrap, FocusTrapInitialFocus, Grid, GridCol, Group, HeadlessMantineProvider, Highlight, HoverCard, HoverCardDropdown, HoverCardGroup, HoverCardGroupContext, HoverCardTarget, HueSlider, Image, Indicator, InlineStyles, Input, InputBase, InputClearButton, InputClearSection, InputDescription, InputError, InputLabel, InputPlaceholder, InputSuccess, InputWrapper, InputWrapperContext, JsonInput, Kbd, List, ListItem, Loader, LoadingOverlay, transitions as MANTINE_TRANSITIONS, MantineContext, MantineProvider, MantineThemeContext, MantineThemeProvider, Mark, Marquee, MaskInput, Menu, MenuCheckboxGroup, MenuCheckboxItem, MenuContextMenu, MenuDivider, MenuDropdown, MenuItem, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSearch, MenuSub, MenuSubDropdown, MenuSubItem, MenuSubTarget, MenuTarget, Menubar, MenubarDropdown, MenubarMenu, MenubarTarget, Modal, ModalBase, ModalBaseBody, ModalBaseCloseButton, ModalBaseContent, ModalBaseHeader, ModalBaseOverlay, ModalBaseTitle, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay, ModalRoot, ModalStack, ModalStackContext, ModalTitle, MultiSelect, NativeScrollArea, NativeSelect, NavLink, Notification, NumberFormatter, NumberInput, OptionalPortal, OptionsDropdown, OverflowList, Overlay, Pagination, PaginationControl, PaginationDots, PaginationFirst, PaginationItems, PaginationLabel, PaginationLast, PaginationNext, PaginationPrevious, PaginationRoot, Paper, PasswordInput, Pill, PillGroup, PillsInput, PillsInputContext, PillsInputField, PinInput, Popover, PopoverContextMenu, PopoverDropdown, PopoverTarget, Portal, Progress, ProgressLabel, ProgressRoot, ProgressSection, Radio, RadioCard, RadioCardContext, RadioGroup, RadioGroupContext, RadioIcon, RadioIndicator, RangeSlider, Rating, RemoveScroll, RingProgress, RollingNumber, STYlE_PROPS_DATA, ScrollArea, ScrollAreaAutosize, Scroller, SegmentedControl, Select, SemiCircleProgress, SimpleGrid, Skeleton, Slider, Space, Splitter, SplitterPane, Spoiler, Stack, Stepper, StepperCompleted, StepperStep, Switch, SwitchGroup, SwitchGroupContext, Table, TableCaption, TableOfContents, TableScrollContainer, TableTbody, TableTd, TableTfoot, TableTh, TableThead, TableTr, Tabs, TabsList, TabsPanel, TabsTab, TagsInput, Text, TextInput, Textarea, ThemeIcon, Timeline, TimelineItem, Title, Tooltip, TooltipFloating, TooltipGroup, TooltipGroupContext, Transition, Tree, TreeSelect, TreeSelectOption, Typography, UnstyledButton, VisuallyHidden, alpha, camelToKebabCase, closeOnEscape, colorsTuple, convertCssVariables, convertHsvaTo, createEventHandler, createPolymorphicComponent, createSafeContext, createScopedKeydownHandler, createTheme, createUseExternalEvents, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultLoaders, defaultOptionsFilter, defaultTreeNodeFilter, defaultVariantColorsResolver, em, extractStyleProps, factory, filterProps, filterTreeData, findClosestNumber, findElementAncestor, findElementBySelector, findElementsBySelector, flattenCascaderPaths, flattenTreeData, genericFactory, getArrowMergeDropdownStyles, getAutoContrastValue, getBaseValue, getBreakpointValue, getCSSColorVariables, getCascaderPathOptions, getContextItemIndex, getContrastColor, getDefaultZIndex, getEnv, getFloatingPosition, getFontSize, getGradient, getLineHeight, getOptionsLockup, getParsedComboboxData, getPrimaryContrastColor, getPrimaryShade, getRadius, getRefProp, getRootElement, getSafeId, getShadow, getSingleElementChild, getSize, getSortedBreakpoints, getSpacing, getStyleObject, getThemeColor, getTransitionProps, getTreeExpandedState, getVirtualColorContrast, hashStyleProps, isColorValid, isElement, isLightColor, isMantineColorScheme, isNumberLike, isOptionsGroup, isPrimitive, isVirtualColor, keys, lighten, localStorageColorSchemeManager, luminance, mantineHtmlProps, memoize, mergeAsyncChildren, mergeMantineTheme, mergeThemeOverrides, moveTreeNode, noop, parseColor, parseStyleProps, parseThemeColor, polymorphic, polymorphicFactory, px, rem, resolveClassNames, resolveStyles, rgba, stylesToString, toRgba, useAccordionContext, useAccordionItemContext, useAppShellContext, useCombobox, useComboboxContext, useComboboxTargetProps, useComputedColorScheme, useDataListContext, useDelayedHover, useDirection, useDrawerContext, useDrawersStack, useEmptyStateContext, useGridContext, useHoverCardContext, useHovered, useInputProps, useListContext, useMantineClassNamesPrefix, useMantineColorScheme, useMantineContext, useMantineCssVariablesResolver, useMantineDeduplicateInlineStyles, useMantineEnv, useMantineIsHeadless, useMantineStyleNonce, useMantineStylesTransform, useMantineSxTransform, useMantineTheme, useMantineWithStaticClasses, useMatches, useMenuContext, useMenubarContext, useMenubarMenuContext, useModalContext, useModalsStack, usePaginationContext, usePillsReorder, usePopoverContext, useProgressContext, useProps, useProviderColorScheme, useRandomClassName, useResolvedStylesApi, useSafeMantineTheme, useScrollAreaContext, useSplitterContext, useStepperContext, useStyles, useTableContext, useTabsContext, useTree, useVirtualizedCombobox, v8CssVariablesResolver, validateMantineTheme, virtualColor };
|
|
@@ -25,6 +25,8 @@ export interface AccordionProps<Multiple extends boolean = false> extends BoxPro
|
|
|
25
25
|
transitionDuration?: number;
|
|
26
26
|
/** If set, chevron rotation is disabled @default false */
|
|
27
27
|
disableChevronRotation?: boolean;
|
|
28
|
+
/** If set, the open item cannot be collapsed by clicking it again, so one item always stays open. Only applies when `multiple` is `false`. @default false */
|
|
29
|
+
disableCollapse?: boolean;
|
|
28
30
|
/** Position of the chevron relative to the item label @default right */
|
|
29
31
|
chevronPosition?: AccordionChevronPosition;
|
|
30
32
|
/** Size of the chevron icon container @default auto */
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '../../core';
|
|
2
|
+
import { ComboboxLikeStylesNames } from '../Combobox';
|
|
3
|
+
import { __BaseInputProps, __InputStylesNames, ClearSectionMode, InputClearButtonProps, InputVariant } from '../Input';
|
|
4
|
+
import { ScrollAreaProps } from '../ScrollArea';
|
|
5
|
+
export interface CascaderOption {
|
|
6
|
+
/** Option value, must be unique across the whole data tree */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Option label, if not set `value` is used instead */
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
/** Nested options */
|
|
11
|
+
children?: CascaderOption[];
|
|
12
|
+
/** If set, the option cannot be selected or expanded */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface CascaderFormatValueInput {
|
|
16
|
+
/** Selected path from root to node */
|
|
17
|
+
value: string[];
|
|
18
|
+
/** Option chain resolved from the selected path */
|
|
19
|
+
options: CascaderOption[];
|
|
20
|
+
}
|
|
21
|
+
export type CascaderFormatValue = (input: CascaderFormatValueInput) => React.ReactNode;
|
|
22
|
+
export type CascaderStylesNames = __InputStylesNames | ComboboxLikeStylesNames | 'columnsList' | 'columnsOverflow' | 'column' | 'columnScroll' | 'columnOption' | 'columnOptionLabel' | 'columnOptionIcon' | 'columnOptionCheck' | 'columnEmpty' | 'flatOption';
|
|
23
|
+
export interface CascaderProps extends BoxProps, __BaseInputProps, StylesApiProps<CascaderFactory>, ElementProps<'input', 'size' | 'value' | 'defaultValue' | 'onChange'> {
|
|
24
|
+
/** Hierarchical options data */
|
|
25
|
+
data: CascaderOption[];
|
|
26
|
+
/** Controlled selected path from root to node */
|
|
27
|
+
value?: string[] | null;
|
|
28
|
+
/** Uncontrolled selected path from root to node */
|
|
29
|
+
defaultValue?: string[] | null;
|
|
30
|
+
/** Called when the selected path changes with the path and the resolved option chain */
|
|
31
|
+
onChange?: (value: string[] | null, options: CascaderOption[]) => void;
|
|
32
|
+
/** If set, any intermediate option can be selected, not only leaf options @default false */
|
|
33
|
+
changeOnSelect?: boolean;
|
|
34
|
+
/** Determines whether the dropdown should be closed when a value is selected, defaults to `!allowDeselect` */
|
|
35
|
+
closeOnSelect?: boolean;
|
|
36
|
+
/** If set, the selected value can be deselected by selecting it again @default true */
|
|
37
|
+
allowDeselect?: boolean;
|
|
38
|
+
/** If set, the check icon is displayed on the selected option @default true */
|
|
39
|
+
withCheckIcon?: boolean;
|
|
40
|
+
/** Position of the check icon relative to the option label @default 'right' */
|
|
41
|
+
checkIconPosition?: 'left' | 'right';
|
|
42
|
+
/** Renders the dropdown as cascading columns. When `false`, options are rendered as a flat list of paths, the same way as search results (useful for narrow/mobile layouts) @default true */
|
|
43
|
+
withColumns?: boolean;
|
|
44
|
+
/** Determines how the next column is opened @default 'click' */
|
|
45
|
+
expandTrigger?: 'click' | 'hover';
|
|
46
|
+
/** If set, options can be searched by their flattened paths @default false */
|
|
47
|
+
searchable?: boolean;
|
|
48
|
+
/** Controlled search value */
|
|
49
|
+
searchValue?: string;
|
|
50
|
+
/** Uncontrolled search value */
|
|
51
|
+
defaultSearchValue?: string;
|
|
52
|
+
/** Called when the search value changes */
|
|
53
|
+
onSearchChange?: (value: string) => void;
|
|
54
|
+
/** Custom search filter, matched against the full option path */
|
|
55
|
+
filter?: (query: string, options: CascaderOption[]) => boolean;
|
|
56
|
+
/** Custom rendering of a search result row */
|
|
57
|
+
renderSearchOption?: (query: string, options: CascaderOption[]) => React.ReactNode;
|
|
58
|
+
/** A function to format the selected path displayed in the input, should return a string */
|
|
59
|
+
formatValue?: CascaderFormatValue;
|
|
60
|
+
/** Custom rendering of an option in columns */
|
|
61
|
+
renderOption?: (option: CascaderOption, level: number) => React.ReactNode;
|
|
62
|
+
/** Path separator displayed in the input and search results @default '/' */
|
|
63
|
+
separator?: React.ReactNode;
|
|
64
|
+
/** Width of each column */
|
|
65
|
+
columnWidth?: number | string;
|
|
66
|
+
/** Maximum number of columns (levels) displayed next to each other, deeper levels replace earlier ones @default 3 */
|
|
67
|
+
maxDisplayedLevels?: number;
|
|
68
|
+
/** `aria-label` and `title` of the control that reveals levels hidden before the visible ones by `maxDisplayedLevels` @default 'Show previous levels' */
|
|
69
|
+
previousLevelsControlLabel?: string;
|
|
70
|
+
/** `aria-label` and `title` of the control that reveals levels hidden after the visible ones by `maxDisplayedLevels` @default 'Show next levels' */
|
|
71
|
+
nextLevelsControlLabel?: string;
|
|
72
|
+
/** Max height of a column before it becomes scrollable @default 260 */
|
|
73
|
+
maxDropdownHeight?: number | string;
|
|
74
|
+
/** Message displayed when there are no options or search results */
|
|
75
|
+
nothingFoundMessage?: React.ReactNode;
|
|
76
|
+
/** If set, the clear button is displayed when a value is selected @default false */
|
|
77
|
+
clearable?: boolean;
|
|
78
|
+
/** Determines how the clear button and `rightSection` are rendered @default 'both' */
|
|
79
|
+
clearSectionMode?: ClearSectionMode;
|
|
80
|
+
/** Props passed down to the clear button */
|
|
81
|
+
clearButtonProps?: InputClearButtonProps;
|
|
82
|
+
/** Called when the clear button is clicked */
|
|
83
|
+
onClear?: () => void;
|
|
84
|
+
/** Controlled dropdown opened state */
|
|
85
|
+
dropdownOpened?: boolean;
|
|
86
|
+
/** Uncontrolled dropdown opened state */
|
|
87
|
+
defaultDropdownOpened?: boolean;
|
|
88
|
+
/** Called when the dropdown opens */
|
|
89
|
+
onDropdownOpen?: () => void;
|
|
90
|
+
/** Called when the dropdown closes */
|
|
91
|
+
onDropdownClose?: () => void;
|
|
92
|
+
/** Props passed down to the underlying `Combobox` component */
|
|
93
|
+
comboboxProps?: Record<string, any>;
|
|
94
|
+
/** Props passed down to the dropdown `ScrollArea` */
|
|
95
|
+
scrollAreaProps?: ScrollAreaProps;
|
|
96
|
+
/** Controls the default chevron color */
|
|
97
|
+
chevronColor?: MantineColor;
|
|
98
|
+
/** Props passed down to the hidden input */
|
|
99
|
+
hiddenInputProps?: Omit<React.ComponentProps<'input'>, 'value'>;
|
|
100
|
+
/** Opens the dropdown when the input is focused in `searchable` mode @default true */
|
|
101
|
+
openOnFocus?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export type CascaderFactory = Factory<{
|
|
104
|
+
props: CascaderProps;
|
|
105
|
+
ref: HTMLInputElement;
|
|
106
|
+
stylesNames: CascaderStylesNames;
|
|
107
|
+
variant: InputVariant;
|
|
108
|
+
}>;
|
|
109
|
+
export declare const Cascader: import("../..").MantineComponent<{
|
|
110
|
+
props: CascaderProps;
|
|
111
|
+
ref: HTMLInputElement;
|
|
112
|
+
stylesNames: CascaderStylesNames;
|
|
113
|
+
variant: InputVariant;
|
|
114
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { GetStylesApi } from '../../core';
|
|
2
|
+
import { ScrollAreaProps } from '../ScrollArea';
|
|
3
|
+
import type { CascaderOption, CascaderStylesNames } from './Cascader';
|
|
4
|
+
type CascaderColumnsGetStyles = GetStylesApi<{
|
|
5
|
+
props: any;
|
|
6
|
+
stylesNames: CascaderStylesNames;
|
|
7
|
+
}>;
|
|
8
|
+
export interface CascaderColumnsProps {
|
|
9
|
+
data: CascaderOption[];
|
|
10
|
+
activePath: string[];
|
|
11
|
+
value: string[] | null;
|
|
12
|
+
keyboardNav: boolean;
|
|
13
|
+
withCheckIcon: boolean | undefined;
|
|
14
|
+
checkIconPosition: 'left' | 'right' | undefined;
|
|
15
|
+
renderOption: ((option: CascaderOption, level: number) => React.ReactNode) | undefined;
|
|
16
|
+
columnWidth: number | string | undefined;
|
|
17
|
+
maxDisplayedLevels: number | undefined;
|
|
18
|
+
previousLevelsControlLabel: string | undefined;
|
|
19
|
+
nextLevelsControlLabel: string | undefined;
|
|
20
|
+
maxDropdownHeight: number | string | undefined;
|
|
21
|
+
nothingFoundMessage: React.ReactNode;
|
|
22
|
+
getStyles: CascaderColumnsGetStyles;
|
|
23
|
+
unstyled: boolean | undefined;
|
|
24
|
+
scrollAreaProps: ScrollAreaProps | undefined;
|
|
25
|
+
onOptionClick: (level: number, option: CascaderOption) => void;
|
|
26
|
+
onOptionMouseEnter: (level: number, option: CascaderOption) => void;
|
|
27
|
+
onColumnsMouseLeave: (() => void) | undefined;
|
|
28
|
+
onPointerActivity: (() => void) | undefined;
|
|
29
|
+
listId: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export declare function getCascaderOptionId(listId: string | undefined, level: number, value: string): string | undefined;
|
|
32
|
+
export declare function CascaderColumns({ data, activePath, value, keyboardNav, withCheckIcon, checkIconPosition, renderOption, columnWidth, maxDisplayedLevels, previousLevelsControlLabel, nextLevelsControlLabel, maxDropdownHeight, nothingFoundMessage, getStyles, unstyled, scrollAreaProps, onOptionClick, onOptionMouseEnter, onColumnsMouseLeave, onPointerActivity, listId, }: CascaderColumnsProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace CascaderColumns {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CascaderOption } from './Cascader';
|
|
2
|
+
export interface CascaderFlatPath {
|
|
3
|
+
/** Values from root to node */
|
|
4
|
+
path: string[];
|
|
5
|
+
/** Option chain from root to node */
|
|
6
|
+
options: CascaderOption[];
|
|
7
|
+
/** `true` if the node has no children */
|
|
8
|
+
leaf: boolean;
|
|
9
|
+
/** `true` if the node or any of its ancestors is disabled */
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function flattenCascaderPaths(data: CascaderOption[]): CascaderFlatPath[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CascaderOption } from './Cascader';
|
|
2
|
+
export declare function cascaderOptionHasChildren(option: CascaderOption): boolean;
|
|
3
|
+
export declare function findCascaderOption(options: CascaderOption[], value: string): CascaderOption | undefined;
|
|
4
|
+
export declare function getCascaderColumns(data: CascaderOption[], activePath: string[]): CascaderOption[][];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CascaderFactory, CascaderFormatValue, CascaderFormatValueInput, CascaderOption, CascaderProps, CascaderStylesNames } from './Cascader';
|
|
2
|
+
export { Cascader } from './Cascader';
|
|
3
|
+
export type { CascaderFlatPath } from './flatten-cascader-paths';
|
|
4
|
+
export { flattenCascaderPaths } from './flatten-cascader-paths';
|
|
5
|
+
export { getCascaderPathOptions } from './get-cascader-path-options';
|
|
6
|
+
export type { CascaderProps, CascaderStylesNames, CascaderFactory, CascaderOption, CascaderFormatValue, CascaderFormatValueInput, };
|
|
7
|
+
export declare namespace Cascader {
|
|
8
|
+
type Props = CascaderProps;
|
|
9
|
+
type StylesNames = CascaderStylesNames;
|
|
10
|
+
type Factory = CascaderFactory;
|
|
11
|
+
type Option = CascaderOption;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CascaderOption } from './Cascader';
|
|
2
|
+
export interface UseCascaderInput {
|
|
3
|
+
data: CascaderOption[];
|
|
4
|
+
value: string[] | null | undefined;
|
|
5
|
+
defaultValue: string[] | null | undefined;
|
|
6
|
+
onChange: ((value: string[] | null, options: CascaderOption[]) => void) | undefined;
|
|
7
|
+
changeOnSelect: boolean | undefined;
|
|
8
|
+
allowDeselect: boolean | undefined;
|
|
9
|
+
expandTrigger: 'click' | 'hover' | undefined;
|
|
10
|
+
onLeafSelect?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useCascader({ data, value, defaultValue, onChange, changeOnSelect, allowDeselect, expandTrigger, onLeafSelect, }: UseCascaderInput): {
|
|
13
|
+
value: string[] | null;
|
|
14
|
+
setValue: (value: string[] | null, ...payload: any[]) => void;
|
|
15
|
+
selectPath: (path: string[]) => void;
|
|
16
|
+
activePath: string[];
|
|
17
|
+
setActivePath: import("react").Dispatch<import("react").SetStateAction<string[]>>;
|
|
18
|
+
resetActivePath: () => void;
|
|
19
|
+
keyboardNav: boolean;
|
|
20
|
+
setKeyboardNav: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
21
|
+
handleOptionClick: (level: number, option: CascaderOption) => void;
|
|
22
|
+
handleOptionMouseEnter: (level: number, option: CascaderOption) => void;
|
|
23
|
+
handleColumnsKeyDown: (event: React.KeyboardEvent) => boolean;
|
|
24
|
+
pathOptions: CascaderOption[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface FloatingWindowDimensions {
|
|
2
|
+
/** Initial width of the floating window in px */
|
|
3
|
+
initialWidth?: number;
|
|
4
|
+
/** Minimum width of the floating window in px */
|
|
5
|
+
minWidth?: number;
|
|
6
|
+
/** Maximum width of the floating window in px */
|
|
7
|
+
maxWidth?: number;
|
|
8
|
+
/** Initial height of the floating window in px */
|
|
9
|
+
initialHeight?: number;
|
|
10
|
+
/** Minimum height of the floating window in px */
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
/** Maximum height of the floating window in px */
|
|
13
|
+
maxHeight?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface FloatingWindowContextValue {
|
|
16
|
+
rootRef: React.RefObject<HTMLDivElement | null>;
|
|
17
|
+
dimensions: FloatingWindowDimensions | undefined;
|
|
18
|
+
constrainToViewport: boolean | undefined;
|
|
19
|
+
constrainOffset: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare const FloatingWindowProvider: import("react").Context<FloatingWindowContextValue | null>, useFloatingWindowContext: () => FloatingWindowContextValue;
|