@lobehub/ui 4.35.1 → 4.35.3
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/es/Accordion/Accordion.d.mts +2 -2
- package/es/Accordion/AccordionItem.d.mts +2 -2
- package/es/ActionIcon/ActionIcon.d.mts +2 -2
- package/es/Alert/Alert.d.mts +2 -2
- package/es/Alert/type.d.mts +1 -1
- package/es/AutoComplete/Select.d.mts +2 -2
- package/es/Avatar/Avatar.mjs +1 -1
- package/es/Avatar/AvatarGroup/index.d.mts +2 -2
- package/es/Burger/Burger.d.mts +2 -2
- package/es/CodeDiff/CodeDiff.d.mts +2 -2
- package/es/CodeDiff/PatchDiff.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.d.mts +2 -2
- package/es/Collapse/Collapse.d.mts +2 -2
- package/es/ColorSwatches/ColorSwatches.mjs +1 -1
- package/es/ConfigProvider/index.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.mjs +10 -20
- package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
- package/es/CopyButton/CopyButton.d.mts +2 -2
- package/es/DatePicker/DatePicker.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
- package/es/Drawer/Drawer.d.mts +2 -2
- package/es/Dropdown/Dropdown.d.mts +2 -2
- package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/DropdownMenu/atoms.d.mts +18 -18
- package/es/DropdownMenu/atoms.mjs +2 -4
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EditorSlashMenu/atoms.d.mts +14 -20
- package/es/EditorSlashMenu/atoms.mjs +1 -8
- package/es/EditorSlashMenu/atoms.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
- package/es/Flex/FlexBasic.d.mts +2 -2
- package/es/FontLoader/index.d.mts +2 -2
- package/es/Footer/Footer.d.mts +2 -2
- package/es/Form/components/FormGroup.d.mts +2 -2
- package/es/Form/components/FormItem.d.mts +2 -2
- package/es/Form/components/FormSubmitFooter.d.mts +2 -2
- package/es/FormModal/FormModal.d.mts +2 -2
- package/es/Freeze/Freeze.d.mts +2 -2
- package/es/GuideCard/GuideCard.d.mts +2 -2
- package/es/Header/Header.d.mts +2 -2
- package/es/Highlighter/Highlighter.d.mts +2 -2
- package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
- package/es/Hotkey/Hotkey.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Image/PreviewGroup.d.mts +2 -2
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/InputNumber.d.mts +2 -2
- package/es/Input/InputOPT.d.mts +2 -2
- package/es/Input/InputPassword.d.mts +2 -2
- package/es/Input/TextArea.d.mts +2 -2
- package/es/Layout/components/LayoutFooter.d.mts +2 -2
- package/es/Layout/components/LayoutHeader.d.mts +2 -2
- package/es/Layout/components/LayoutMain.d.mts +2 -2
- package/es/Layout/components/LayoutSidebar.d.mts +2 -2
- package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
- package/es/Layout/components/LayoutToc.d.mts +2 -2
- package/es/List/ListItem/index.d.mts +2 -2
- package/es/LobeSelect/LobeSelect.d.mts +2 -2
- package/es/LobeSelect/LobeSelect.mjs +45 -51
- package/es/LobeSelect/LobeSelect.mjs.map +1 -1
- package/es/LobeSelect/atoms.d.mts +19 -19
- package/es/LobeSelect/atoms.mjs +2 -4
- package/es/LobeSelect/atoms.mjs.map +1 -1
- package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
- package/es/LobeSwitch/atoms.d.mts +4 -4
- package/es/Markdown/Markdown.d.mts +2 -2
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/MaskShadow/MaskShadow.d.mts +2 -2
- package/es/Menu/Menu.d.mts +2 -2
- package/es/Menu/sharedStyle.mjs +2 -1
- package/es/Menu/sharedStyle.mjs.map +1 -1
- package/es/Mermaid/Mermaid.d.mts +2 -2
- package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
- package/es/Modal/Modal.d.mts +2 -2
- package/es/Modal/ModalProvider.d.mts +2 -2
- package/es/Modal/imperative.d.mts +2 -2
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/Popover/ArrowIcon.d.mts +2 -2
- package/es/Popover/PopoverPortal.mjs +0 -6
- package/es/Popover/PopoverPortal.mjs.map +1 -1
- package/es/Popover/atoms.d.mts +9 -9
- package/es/Popover/context.d.mts +2 -2
- package/es/ScrollArea/atoms.d.mts +7 -7
- package/es/SearchBar/SearchBar.d.mts +2 -2
- package/es/Segmented/Segmented.d.mts +2 -2
- package/es/Select/Select.d.mts +2 -2
- package/es/SideNav/SideNav.d.mts +2 -2
- package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
- package/es/ThemeProvider/GlobalStyle/global.mjs +10 -17
- package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs +34 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/Toast/imperative.d.mts +3 -3
- package/es/Toast/imperative.mjs +7 -44
- package/es/Toast/imperative.mjs.map +1 -1
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/TooltipPortal.mjs +0 -7
- package/es/Tooltip/TooltipPortal.mjs.map +1 -1
- package/es/Video/index.d.mts +2 -2
- package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
- package/es/awesome/Features/Features.d.mts +2 -2
- package/es/awesome/Giscus/Giscus.d.mts +2 -2
- package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
- package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
- package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
- package/es/awesome/Hero/Hero.d.mts +2 -2
- package/es/awesome/Spline/Spine.d.mts +2 -2
- package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
- package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
- package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
- package/es/brand/LobeChat/index.d.mts +2 -2
- package/es/brand/LobeHub/index.d.mts +2 -2
- package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
- package/es/brand/LogoThree/index.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.d.mts +2 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatItem/ChatItem.d.mts +2 -2
- package/es/chat/ChatList/ChatList.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
- package/es/color/ColorScales/index.d.mts +2 -2
- package/es/color/CssVar/index.d.mts +2 -2
- package/es/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +3 -3
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/index.mjs +5 -5
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
- package/es/mobile/TabBar/TabBar.d.mts +2 -2
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/package.json +1 -1
- package/es/hooks/usePortalContainer.mjs +0 -24
- package/es/hooks/usePortalContainer.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutTocProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react13 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutToc.d.ts
|
|
5
|
-
declare const LayoutToc:
|
|
5
|
+
declare const LayoutToc: react13.NamedExoticComponent<LayoutTocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutToc };
|
|
8
8
|
//# sourceMappingURL=LayoutToc.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ListItemProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react5 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/List/ListItem/index.d.ts
|
|
5
|
-
declare const ListItem:
|
|
5
|
+
declare const ListItem: react5.NamedExoticComponent<ListItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ListItem };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LobeSelectProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react3 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/LobeSelect/LobeSelect.d.ts
|
|
5
|
-
declare const LobeSelect:
|
|
5
|
+
declare const LobeSelect: react3.NamedExoticComponent<LobeSelectProps<any>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LobeSelect };
|
|
8
8
|
//# sourceMappingURL=LobeSelect.d.mts.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import Icon_default from "../Icon/Icon.mjs";
|
|
4
|
-
import { usePortalContainer } from "../hooks/usePortalContainer.mjs";
|
|
5
4
|
import { styles } from "../Menu/sharedStyle.mjs";
|
|
6
|
-
import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
|
|
7
5
|
import { styles as styles$1, triggerVariants } from "./style.mjs";
|
|
8
6
|
import { isValidElement, memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -332,7 +330,6 @@ const LobeSelect = memo(({ allowClear, autoFocus, className, classNames, default
|
|
|
332
330
|
size,
|
|
333
331
|
variant: resolvedVariant
|
|
334
332
|
}), className, classNames?.root, classNames?.trigger);
|
|
335
|
-
const portalContainer = usePortalContainer(LOBE_SELECT_CONTAINER_ATTR);
|
|
336
333
|
const listRef = useRef(null);
|
|
337
334
|
const pointerScrollRef = useRef(false);
|
|
338
335
|
const pointerScrollTimeoutRef = useRef(null);
|
|
@@ -498,56 +495,53 @@ const LobeSelect = memo(({ allowClear, autoFocus, className, classNames, default
|
|
|
498
495
|
})]
|
|
499
496
|
})
|
|
500
497
|
]
|
|
501
|
-
}), /* @__PURE__ */ jsx(Select.Portal, {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
className: cx(styles
|
|
512
|
-
children:
|
|
513
|
-
className:
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
498
|
+
}), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
|
|
499
|
+
align: "start",
|
|
500
|
+
alignItemWithTrigger: isItemAligned,
|
|
501
|
+
className: styles$1.positioner,
|
|
502
|
+
side: "bottom",
|
|
503
|
+
sideOffset: 6,
|
|
504
|
+
children: /* @__PURE__ */ jsxs(Select.Popup, {
|
|
505
|
+
style: popupStyle,
|
|
506
|
+
className: cx(styles.popup, styles$1.popup, popupClassName, classNames?.popup, classNames?.dropdown),
|
|
507
|
+
children: [shouldShowSearch && /* @__PURE__ */ jsx("div", {
|
|
508
|
+
className: cx(styles$1.search, classNames?.search),
|
|
509
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
510
|
+
className: styles$1.searchInput,
|
|
511
|
+
placeholder: typeof placeholder === "string" ? placeholder : void 0,
|
|
512
|
+
value: searchValue,
|
|
513
|
+
onChange: handleSearchChange,
|
|
514
|
+
onKeyDown: handleSearchKeyDown
|
|
515
|
+
})
|
|
516
|
+
}), (() => {
|
|
517
|
+
const content = filteredOptions.length > 0 ? renderOptions(filteredOptions) : /* @__PURE__ */ jsx("div", {
|
|
518
|
+
className: cx(styles.item, styles.empty, styles$1.empty, classNames?.empty),
|
|
519
|
+
children: "No data"
|
|
520
|
+
});
|
|
521
|
+
if (!virtual || filteredOptions.length === 0) return /* @__PURE__ */ jsx(Select.List, {
|
|
522
|
+
className: cx(styles$1.list, classNames?.list),
|
|
523
|
+
"data-virtual": virtual || void 0,
|
|
524
|
+
children: content
|
|
525
|
+
});
|
|
526
|
+
return /* @__PURE__ */ jsx(Select.List, {
|
|
527
|
+
className: cx(styles$1.list, classNames?.list),
|
|
528
|
+
"data-virtual": virtual || void 0,
|
|
529
|
+
ref: listRef,
|
|
530
|
+
style: virtualListStyle,
|
|
531
|
+
tabIndex: virtual ? -1 : void 0,
|
|
532
|
+
onPointerDown: virtual ? markPointerScroll : void 0,
|
|
533
|
+
onScroll: virtual ? handleListScroll : void 0,
|
|
534
|
+
onTouchMove: virtual ? markPointerScroll : void 0,
|
|
535
|
+
onWheel: virtual ? markPointerScroll : void 0,
|
|
536
|
+
children: /* @__PURE__ */ jsx(Virtualizer, {
|
|
537
|
+
itemSize: listItemHeight,
|
|
538
|
+
keepMounted: keepMountedIndices,
|
|
529
539
|
children: content
|
|
530
|
-
})
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
"data-virtual": virtual || void 0,
|
|
534
|
-
ref: listRef,
|
|
535
|
-
style: virtualListStyle,
|
|
536
|
-
tabIndex: virtual ? -1 : void 0,
|
|
537
|
-
onPointerDown: virtual ? markPointerScroll : void 0,
|
|
538
|
-
onScroll: virtual ? handleListScroll : void 0,
|
|
539
|
-
onTouchMove: virtual ? markPointerScroll : void 0,
|
|
540
|
-
onWheel: virtual ? markPointerScroll : void 0,
|
|
541
|
-
children: /* @__PURE__ */ jsx(Virtualizer, {
|
|
542
|
-
itemSize: listItemHeight,
|
|
543
|
-
keepMounted: keepMountedIndices,
|
|
544
|
-
children: content
|
|
545
|
-
})
|
|
546
|
-
});
|
|
547
|
-
})()]
|
|
548
|
-
})
|
|
540
|
+
})
|
|
541
|
+
});
|
|
542
|
+
})()]
|
|
549
543
|
})
|
|
550
|
-
})]
|
|
544
|
+
}) })]
|
|
551
545
|
});
|
|
552
546
|
});
|
|
553
547
|
LobeSelect.displayName = "LobeSelect";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LobeSelect.mjs","names":["mergedOptions: LobeSelectOptions","missingValueOptions: LobeSelectOption<any>[]","styles","option","content","Icon","baseStyle: React.CSSProperties","indices: number[]","menuStyles","currentIndex"],"sources":["../../src/LobeSelect/LobeSelect.tsx"],"sourcesContent":["'use client';\n\nimport { Select } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport { Check, ChevronDown, Loader2, X } from 'lucide-react';\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type MutableRefObject,\n type Ref,\n} from 'react';\nimport { isValidElement, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Virtualizer } from 'virtua';\n\nimport { usePortalContainer } from '@/hooks/usePortalContainer';\nimport Icon from '@/Icon';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\n\nimport { LOBE_SELECT_CONTAINER_ATTR } from './constants';\nimport { styles, triggerVariants } from './style';\nimport {\n type LobeSelectOption,\n type LobeSelectOptionGroup,\n type LobeSelectOptions,\n type LobeSelectProps,\n} from './type';\n\nconst isGroupOption = <Value,>(\n option: LobeSelectOption<Value> | LobeSelectOptionGroup<Value>,\n): option is LobeSelectOptionGroup<Value> =>\n Boolean((option as LobeSelectOptionGroup<Value>).options);\n\nconst getOptionSearchText = <Value,>(option: LobeSelectOption<Value>) => {\n if (typeof option.label === 'string' || typeof option.label === 'number') {\n return String(option.label);\n }\n if (typeof option.value === 'string' || typeof option.value === 'number') {\n return String(option.value);\n }\n if (option.title) return option.title;\n return '';\n};\n\nconst escapeRegExp = (value: string) => value.replaceAll(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n\nconst splitBySeparators = (value: string, separators?: string[]) => {\n if (!separators || separators.length === 0) return [value];\n const pattern = separators.map(escapeRegExp).join('|');\n return value.split(new RegExp(pattern, 'g'));\n};\n\nconst countVirtualItems = (items: LobeSelectOptions) =>\n items.reduce((count, item) => {\n if (isGroupOption(item)) {\n return count + item.options.length + 1;\n }\n return count + 1;\n }, 0);\n\nconst isValueEmpty = (value: unknown) => value === null || value === undefined || value === '';\n\nconst LobeSelect = memo<LobeSelectProps<any>>(\n ({\n allowClear,\n autoFocus,\n className,\n classNames,\n defaultOpen,\n defaultValue,\n disabled,\n id,\n labelRender,\n listHeight = 512,\n listItemHeight,\n loading,\n mode,\n name,\n onChange,\n onOpenChange,\n onSelect,\n open,\n optionRender,\n options,\n placeholder,\n popupClassName,\n popupMatchSelectWidth,\n prefix,\n readOnly,\n required,\n behaviorVariant = 'default',\n selectedIndicatorVariant = 'check',\n shadow,\n showSearch,\n size = 'middle',\n style,\n suffixIcon,\n suffixIconProps,\n tokenSeparators,\n value,\n variant,\n virtual,\n }) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const isMultiple = mode === 'multiple' || mode === 'tags';\n const isItemAligned = behaviorVariant === 'item-aligned';\n\n const [uncontrolledValue, setUncontrolledValue] = useState<any>(() => {\n if (defaultValue !== undefined) return defaultValue;\n return isMultiple ? [] : null;\n });\n\n const normalizeValue = useCallback(\n (nextValue: any) => {\n if (isMultiple) {\n if (Array.isArray(nextValue)) return nextValue;\n if (nextValue === null || nextValue === undefined) return [];\n return [nextValue];\n }\n if (Array.isArray(nextValue)) return nextValue[0] ?? null;\n return nextValue === undefined ? null : nextValue;\n },\n [isMultiple],\n );\n\n const mergedValue = value !== undefined ? value : uncontrolledValue;\n const normalizedValue = useMemo(\n () => normalizeValue(mergedValue),\n [mergedValue, normalizeValue],\n );\n const valueArray = useMemo(\n () =>\n isMultiple\n ? (normalizedValue as any[])\n : isValueEmpty(normalizedValue)\n ? []\n : [normalizedValue],\n [isMultiple, normalizedValue],\n );\n\n const [extraOptions, setExtraOptions] = useState<LobeSelectOption<any>[]>([]);\n\n useEffect(() => {\n if (mode !== 'tags' && extraOptions.length > 0) {\n setExtraOptions([]);\n }\n }, [mode, extraOptions.length]);\n\n const { resolvedOptions, optionMap } = useMemo(() => {\n const baseOptions = options ?? [];\n const optionValueMap = new Map<any, LobeSelectOption<any>>();\n\n const addOption = (item: LobeSelectOption<any>) => {\n if (!optionValueMap.has(item.value)) {\n optionValueMap.set(item.value, item);\n }\n };\n\n const walkOptions = (items: LobeSelectOptions) => {\n items.forEach((item) => {\n if (isGroupOption(item)) {\n item.options.forEach(addOption);\n } else {\n addOption(item);\n }\n });\n };\n\n walkOptions(baseOptions);\n\n const filteredExtraOptions = extraOptions.filter((item) => !optionValueMap.has(item.value));\n filteredExtraOptions.forEach(addOption);\n\n const mergedOptions: LobeSelectOptions = [...baseOptions, ...filteredExtraOptions];\n\n const missingValueOptions: LobeSelectOption<any>[] = valueArray\n .filter((val) => !optionValueMap.has(val))\n .map((val) => ({\n label: String(val),\n value: val,\n }));\n missingValueOptions.forEach(addOption);\n\n return {\n optionMap: optionValueMap,\n resolvedOptions: missingValueOptions.length\n ? [...mergedOptions, ...missingValueOptions]\n : mergedOptions,\n };\n }, [extraOptions, options, valueArray]);\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n\n useEffect(() => {\n if (open !== undefined) {\n setUncontrolledOpen(open);\n }\n }, [open]);\n\n const mergedOpen = open ?? uncontrolledOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [onOpenChange, open],\n );\n\n const [searchValue, setSearchValue] = useState('');\n const shouldShowSearch = Boolean(showSearch || mode === 'tags');\n\n useEffect(() => {\n if (!mergedOpen) setSearchValue('');\n }, [mergedOpen]);\n\n const getOption = useCallback(\n (optionValue: any): LobeSelectOption<any> => {\n const matched = optionMap.get(optionValue);\n if (matched) return matched;\n if (optionValue && typeof optionValue === 'object' && 'label' in optionValue) {\n return {\n label: (optionValue as any).label,\n value: optionValue,\n };\n }\n return {\n label: String(optionValue),\n value: optionValue,\n };\n },\n [optionMap],\n );\n\n const previousValueRef = useRef<any>(normalizedValue);\n\n useEffect(() => {\n previousValueRef.current = normalizedValue;\n }, [normalizedValue]);\n\n const handleValueChange = useCallback(\n (nextValue: any) => {\n const normalizedNextValue = normalizeValue(nextValue);\n const previousValue = previousValueRef.current;\n\n if (isMultiple) {\n const prevValues = Array.isArray(previousValue) ? previousValue : [];\n const nextValues = Array.isArray(normalizedNextValue) ? normalizedNextValue : [];\n const addedValues = nextValues.filter(\n (val) => !prevValues.some((prev) => Object.is(prev, val)),\n );\n\n addedValues.forEach((val) => {\n onSelect?.(val, getOption(val));\n });\n\n if (value === undefined) {\n setUncontrolledValue(nextValues);\n }\n onChange?.(\n nextValues,\n nextValues.map((val) => getOption(val)),\n );\n } else {\n if (\n !isValueEmpty(normalizedNextValue) &&\n !Object.is(previousValue, normalizedNextValue)\n ) {\n onSelect?.(normalizedNextValue, getOption(normalizedNextValue));\n }\n if (value === undefined) {\n setUncontrolledValue(normalizedNextValue);\n }\n onChange?.(\n normalizedNextValue,\n isValueEmpty(normalizedNextValue) ? undefined : getOption(normalizedNextValue),\n );\n }\n\n previousValueRef.current = normalizedNextValue;\n },\n [getOption, isMultiple, normalizeValue, onChange, onSelect, value],\n );\n\n const appendTagValues = useCallback(\n (rawValues: string[]) => {\n const valuesToAdd = rawValues.map((val) => val.trim()).filter(Boolean);\n if (!valuesToAdd.length) return;\n\n const nextValues = [...valueArray];\n const newOptionValues = valuesToAdd.filter((val) => !optionMap.has(val));\n\n if (newOptionValues.length > 0) {\n setExtraOptions((prev) => {\n const existingValues = new Set(prev.map((item) => item.value));\n const merged = [...prev];\n newOptionValues.forEach((val) => {\n if (!existingValues.has(val)) {\n merged.push({ label: val, value: val });\n }\n });\n return merged;\n });\n }\n\n valuesToAdd.forEach((val) => {\n if (!nextValues.some((item) => Object.is(item, val))) {\n nextValues.push(val);\n }\n });\n\n if (nextValues.length !== valueArray.length) {\n handleValueChange(nextValues);\n }\n },\n [handleValueChange, optionMap, valueArray],\n );\n\n const handleSearchChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const nextValue = event.target.value;\n if (mode === 'tags') {\n const parts = splitBySeparators(nextValue, tokenSeparators);\n if (parts.length > 1) {\n const pending = parts.pop() ?? '';\n appendTagValues(parts.filter(Boolean));\n setSearchValue(pending);\n return;\n }\n }\n setSearchValue(nextValue);\n },\n [appendTagValues, mode, tokenSeparators],\n );\n\n const handleSearchKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n event.stopPropagation();\n\n if (event.key === 'Escape') {\n handleOpenChange(false);\n return;\n }\n\n if (mode !== 'tags') return;\n\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n appendTagValues([searchValue]);\n setSearchValue('');\n return;\n }\n\n if (tokenSeparators?.includes(event.key)) {\n event.preventDefault();\n event.stopPropagation();\n appendTagValues([searchValue]);\n setSearchValue('');\n }\n },\n [appendTagValues, handleOpenChange, mode, searchValue, tokenSeparators],\n );\n\n const filteredOptions = useMemo(() => {\n if (!shouldShowSearch || !searchValue.trim()) return resolvedOptions;\n const query = searchValue.trim().toLowerCase();\n\n const filterItems = (items: LobeSelectOptions): LobeSelectOptions => {\n const filtered = items\n .map((item) => {\n if (isGroupOption(item)) {\n const groupItems = item.options.filter((option) =>\n getOptionSearchText(option).toLowerCase().includes(query),\n );\n if (!groupItems.length) return null;\n return { ...item, options: groupItems };\n }\n return getOptionSearchText(item).toLowerCase().includes(query) ? item : null;\n })\n .filter(Boolean) as LobeSelectOptions;\n\n return filtered;\n };\n\n return filterItems(resolvedOptions);\n }, [resolvedOptions, searchValue, shouldShowSearch]);\n\n const renderValue = useCallback(\n (currentValue: any) => {\n const resolved = normalizeValue(currentValue);\n const placeholderNode =\n placeholder === undefined ? null : (\n <span className={styles.valueText}>{placeholder}</span>\n );\n\n if (isMultiple) {\n const values = Array.isArray(resolved) ? resolved : [];\n if (values.length === 0) return placeholderNode;\n return (\n <span className={styles.tags}>\n {values.map((val, index) => {\n const option = getOption(val);\n const content = labelRender ? labelRender(option) : (option.label ?? String(val));\n return (\n <span className={styles.tag} key={`${String(val)}-${index}`}>\n {content}\n </span>\n );\n })}\n </span>\n );\n }\n\n if (isValueEmpty(resolved)) return placeholderNode;\n const option = getOption(resolved);\n const content = labelRender ? labelRender(option) : (option.label ?? String(resolved));\n return <span className={styles.valueText}>{content}</span>;\n },\n [getOption, isMultiple, labelRender, normalizeValue, placeholder],\n );\n\n const hasValue = isMultiple ? valueArray.length > 0 : !isValueEmpty(normalizedValue);\n const showClear = Boolean(allowClear && hasValue && !disabled && !readOnly);\n\n const handleClear = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n handleValueChange(isMultiple ? [] : null);\n },\n [handleValueChange, isMultiple],\n );\n\n const prefixNode = useMemo(() => {\n if (prefix === undefined || prefix === null) return null;\n if (isValidElement(prefix) || typeof prefix === 'string' || typeof prefix === 'number') {\n return prefix;\n }\n return <Icon icon={prefix as any} size={'small'} />;\n }, [prefix]);\n\n const suffixIconNode = useMemo(() => {\n if (loading) {\n return <Icon spin icon={Loader2} size={'small'} />;\n }\n if (suffixIcon === null) return null;\n if (\n isValidElement(suffixIcon) ||\n typeof suffixIcon === 'string' ||\n typeof suffixIcon === 'number'\n ) {\n return suffixIcon;\n }\n return (\n <Icon\n icon={(suffixIcon as any) || ChevronDown}\n size={'small'}\n {...suffixIconProps}\n style={{\n pointerEvents: 'none',\n ...suffixIconProps?.style,\n }}\n />\n );\n }, [loading, suffixIcon, suffixIconProps]);\n\n const popupStyle = useMemo(() => {\n const maxHeight = isItemAligned ? '80vh' : `${listHeight}px`;\n const baseStyle: React.CSSProperties = {\n maxHeight,\n maxWidth: 'var(--available-width)',\n minWidth: 'var(--anchor-width)',\n ['--lobe-select-popup-max-height' as any]: maxHeight,\n };\n\n if (popupMatchSelectWidth === undefined || popupMatchSelectWidth === true) {\n return baseStyle;\n }\n if (typeof popupMatchSelectWidth === 'number') {\n return {\n ...baseStyle,\n minWidth: popupMatchSelectWidth,\n width: popupMatchSelectWidth,\n };\n }\n return {\n ...baseStyle,\n minWidth: 'max-content',\n };\n }, [isItemAligned, listHeight, popupMatchSelectWidth]);\n\n const triggerClassName = cx(\n triggerVariants({ shadow, size, variant: resolvedVariant }),\n className,\n classNames?.root,\n classNames?.trigger,\n );\n\n const portalContainer = usePortalContainer(LOBE_SELECT_CONTAINER_ATTR);\n const listRef = useRef<HTMLDivElement | null>(null);\n const pointerScrollRef = useRef(false);\n const pointerScrollTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const renderVirtualItem = useCallback((props: HTMLAttributes<HTMLDivElement>) => {\n const { ref, ...rest } = props as HTMLAttributes<HTMLDivElement> & {\n ref?: Ref<HTMLDivElement>;\n };\n\n return (\n <div\n {...rest}\n ref={(node) => {\n if (node) {\n node.scrollIntoView = (...args) => {\n if (!pointerScrollRef.current) {\n HTMLElement.prototype.scrollIntoView.call(node, ...args);\n }\n };\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref && 'current' in ref) {\n (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n }\n }}\n />\n );\n }, []);\n\n const markPointerScroll = useCallback(() => {\n pointerScrollRef.current = true;\n if (pointerScrollTimeoutRef.current) {\n clearTimeout(pointerScrollTimeoutRef.current);\n }\n pointerScrollTimeoutRef.current = setTimeout(() => {\n pointerScrollRef.current = false;\n }, 120);\n }, []);\n\n const handleListScroll = useCallback(() => {\n if (!virtual || !pointerScrollRef.current) return;\n const listElement = listRef.current;\n const activeElement = document.activeElement;\n if (listElement && activeElement && listElement.contains(activeElement)) {\n listElement.focus({ preventScroll: true });\n }\n }, [virtual]);\n\n useEffect(() => {\n return () => {\n if (pointerScrollTimeoutRef.current) {\n clearTimeout(pointerScrollTimeoutRef.current);\n }\n };\n }, []);\n const virtualListStyle = useMemo(() => {\n if (!virtual) return undefined;\n const rowCount = countVirtualItems(filteredOptions);\n const maxVisibleRows = 6;\n const estimatedRowHeight =\n listItemHeight ?? (size === 'large' ? 40 : size === 'small' ? 28 : 32);\n const visibleRows = Math.min(Math.max(rowCount, 1), maxVisibleRows);\n const estimatedHeight = visibleRows * estimatedRowHeight + 8;\n\n return {\n height: `min(${estimatedHeight}px, var(--lobe-select-available-height, var(--available-height)))`,\n };\n }, [filteredOptions, listItemHeight, size, virtual]);\n\n const keepMountedIndices = useMemo(() => {\n if (!virtual || valueArray.length === 0) return undefined;\n const selectedSet = new Set(valueArray);\n const indices: number[] = [];\n let index = 0;\n\n filteredOptions.forEach((item) => {\n if (isGroupOption(item)) {\n if (item.options.some((option) => selectedSet.has(option.value))) {\n indices.push(index);\n }\n index += 1;\n return;\n }\n\n if (selectedSet.has(item.value)) {\n indices.push(index);\n }\n index += 1;\n });\n\n return indices.length ? indices : undefined;\n }, [filteredOptions, valueArray, virtual]);\n\n const itemTextClassName = cx(\n optionRender ? menuStyles.itemContent : menuStyles.label,\n styles.itemText,\n classNames?.itemText,\n );\n\n const isBoldIndicator = selectedIndicatorVariant === 'bold';\n let optionIndex = 0;\n const renderOptions = (items: LobeSelectOptions) =>\n items.map((item, index) => {\n if (isGroupOption(item)) {\n return (\n <Select.Group className={cx(styles.group, classNames?.group)} key={`group-${index}`}>\n <Select.GroupLabel\n className={cx(menuStyles.groupLabel, styles.groupLabel, classNames?.groupLabel)}\n >\n {item.label}\n </Select.GroupLabel>\n {item.options.map((option) => {\n const currentIndex = optionIndex++;\n return (\n <Select.Item\n disabled={option.disabled}\n key={`${String(option.value)}-${currentIndex}`}\n label={getOptionSearchText(option)}\n render={virtual ? renderVirtualItem : undefined}\n value={option.value}\n className={cx(\n menuStyles.item,\n styles.item,\n isBoldIndicator && styles.itemBoldSelected,\n classNames?.item,\n classNames?.option,\n option.className,\n )}\n style={{\n minHeight: listItemHeight,\n ...option.style,\n }}\n >\n <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(option, { index: currentIndex }) : option.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator\n className={cx(styles.itemIndicator, classNames?.itemIndicator)}\n >\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n })}\n </Select.Group>\n );\n }\n\n const currentIndex = optionIndex++;\n return (\n <Select.Item\n disabled={item.disabled}\n key={`${String(item.value)}-${currentIndex}`}\n label={getOptionSearchText(item)}\n render={virtual ? renderVirtualItem : undefined}\n value={item.value}\n className={cx(\n menuStyles.item,\n styles.item,\n isBoldIndicator && styles.itemBoldSelected,\n classNames?.item,\n classNames?.option,\n item.className,\n )}\n style={{\n minHeight: listItemHeight,\n ...item.style,\n }}\n >\n <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(item, { index: currentIndex }) : item.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator className={cx(styles.itemIndicator, classNames?.itemIndicator)}>\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n });\n\n return (\n <Select.Root\n disabled={disabled}\n id={id}\n modal={isItemAligned}\n multiple={isMultiple}\n name={name}\n open={mergedOpen}\n readOnly={readOnly}\n required={required}\n value={normalizedValue}\n onOpenChange={handleOpenChange}\n onValueChange={handleValueChange}\n >\n <Select.Trigger\n autoFocus={autoFocus}\n className={triggerClassName}\n disabled={disabled}\n style={style}\n >\n {prefixNode !== null && prefixNode !== undefined && (\n <span className={cx(styles.prefix, classNames?.prefix)}>{prefixNode}</span>\n )}\n <Select.Value className={cx(styles.value, classNames?.value)}>{renderValue}</Select.Value>\n <span className={cx(styles.suffix, classNames?.suffix)}>\n {showClear && (\n <span\n className={cx(styles.clear, classNames?.clear)}\n data-role=\"lobe-select-clear\"\n onClick={handleClear}\n >\n <Icon icon={X} size={'small'} />\n </span>\n )}\n {suffixIconNode !== null && suffixIconNode !== undefined && (\n <Select.Icon className={cx(styles.icon, classNames?.icon)}>\n {suffixIconNode}\n </Select.Icon>\n )}\n </span>\n </Select.Trigger>\n\n <Select.Portal container={portalContainer}>\n <Select.Positioner\n align=\"start\"\n alignItemWithTrigger={isItemAligned}\n className={styles.positioner}\n side=\"bottom\"\n sideOffset={6}\n >\n <Select.Popup\n style={popupStyle}\n className={cx(\n menuStyles.popup,\n styles.popup,\n popupClassName,\n classNames?.popup,\n classNames?.dropdown,\n )}\n >\n {shouldShowSearch && (\n <div className={cx(styles.search, classNames?.search)}>\n <input\n className={styles.searchInput}\n placeholder={typeof placeholder === 'string' ? placeholder : undefined}\n value={searchValue}\n onChange={handleSearchChange}\n onKeyDown={handleSearchKeyDown}\n />\n </div>\n )}\n {(() => {\n const content =\n filteredOptions.length > 0 ? (\n renderOptions(filteredOptions)\n ) : (\n <div\n className={cx(\n menuStyles.item,\n menuStyles.empty,\n styles.empty,\n classNames?.empty,\n )}\n >\n No data\n </div>\n );\n\n if (!virtual || filteredOptions.length === 0) {\n return (\n <Select.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n >\n {content}\n </Select.List>\n );\n }\n\n return (\n <Select.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n ref={listRef}\n style={virtualListStyle}\n tabIndex={virtual ? -1 : undefined}\n onPointerDown={virtual ? markPointerScroll : undefined}\n onScroll={virtual ? handleListScroll : undefined}\n onTouchMove={virtual ? markPointerScroll : undefined}\n onWheel={virtual ? markPointerScroll : undefined}\n >\n <Virtualizer itemSize={listItemHeight} keepMounted={keepMountedIndices}>\n {content}\n </Virtualizer>\n </Select.List>\n );\n })()}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n },\n);\n\nLobeSelect.displayName = 'LobeSelect';\n\nexport default LobeSelect;\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,MAAM,iBACJ,WAEA,QAAS,OAAwC,QAAQ;AAE3D,MAAM,uBAA+B,WAAoC;AACvE,KAAI,OAAO,OAAO,UAAU,YAAY,OAAO,OAAO,UAAU,SAC9D,QAAO,OAAO,OAAO,MAAM;AAE7B,KAAI,OAAO,OAAO,UAAU,YAAY,OAAO,OAAO,UAAU,SAC9D,QAAO,OAAO,OAAO,MAAM;AAE7B,KAAI,OAAO,MAAO,QAAO,OAAO;AAChC,QAAO;;AAGT,MAAM,gBAAgB,UAAkB,MAAM,WAAW,uBAAuB,OAAO;AAEvF,MAAM,qBAAqB,OAAe,eAA0B;AAClE,KAAI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C;MAAI,WAAW,GAAGA,SAAO,QAAQ,YAAY,OAAO;gBACnD,oBAAC;OACC,WAAWA,SAAO;OAClB,aAAa,OAAO,gBAAgB,WAAW,cAAc;OAC7D,OAAO;OACP,UAAU;OACV,WAAW;QACX;OACE,SAEA;MACN,MAAM,UACJ,gBAAgB,SAAS,IACvB,cAAc,gBAAgB,GAE9B,oBAAC;OACC,WAAW,GACTM,OAAW,MACXA,OAAW,OACXN,SAAO,OACP,YAAY,MACb;iBACF;QAEK;AAGV,UAAI,CAAC,WAAW,gBAAgB,WAAW,EACzC,QACE,oBAAC,OAAO;OACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;OAC5C,gBAAc,WAAW;iBAExB;QACW;AAIlB,aACE,oBAAC,OAAO;OACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;OAC5C,gBAAc,WAAW;OACzB,KAAK;OACL,OAAO;OACP,UAAU,UAAU,KAAK;OACzB,eAAe,UAAU,oBAAoB;OAC7C,UAAU,UAAU,mBAAmB;OACvC,aAAa,UAAU,oBAAoB;OAC3C,SAAS,UAAU,oBAAoB;iBAEvC,oBAAC;QAAY,UAAU;QAAgB,aAAa;kBACjD;SACW;QACF;SAEd;MACS;KACG;IACN;GACJ;EAGnB;AAED,WAAW,cAAc;AAEzB,yBAAe"}
|
|
1
|
+
{"version":3,"file":"LobeSelect.mjs","names":["mergedOptions: LobeSelectOptions","missingValueOptions: LobeSelectOption<any>[]","styles","option","content","Icon","baseStyle: React.CSSProperties","indices: number[]","menuStyles","currentIndex"],"sources":["../../src/LobeSelect/LobeSelect.tsx"],"sourcesContent":["'use client';\n\nimport { Select } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport { Check, ChevronDown, Loader2, X } from 'lucide-react';\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type MutableRefObject,\n type Ref,\n} from 'react';\nimport { isValidElement, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Virtualizer } from 'virtua';\n\nimport Icon from '@/Icon';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\n\nimport { styles, triggerVariants } from './style';\nimport {\n type LobeSelectOption,\n type LobeSelectOptionGroup,\n type LobeSelectOptions,\n type LobeSelectProps,\n} from './type';\n\nconst isGroupOption = <Value,>(\n option: LobeSelectOption<Value> | LobeSelectOptionGroup<Value>,\n): option is LobeSelectOptionGroup<Value> =>\n Boolean((option as LobeSelectOptionGroup<Value>).options);\n\nconst getOptionSearchText = <Value,>(option: LobeSelectOption<Value>) => {\n if (typeof option.label === 'string' || typeof option.label === 'number') {\n return String(option.label);\n }\n if (typeof option.value === 'string' || typeof option.value === 'number') {\n return String(option.value);\n }\n if (option.title) return option.title;\n return '';\n};\n\nconst escapeRegExp = (value: string) => value.replaceAll(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n\nconst splitBySeparators = (value: string, separators?: string[]) => {\n if (!separators || separators.length === 0) return [value];\n const pattern = separators.map(escapeRegExp).join('|');\n return value.split(new RegExp(pattern, 'g'));\n};\n\nconst countVirtualItems = (items: LobeSelectOptions) =>\n items.reduce((count, item) => {\n if (isGroupOption(item)) {\n return count + item.options.length + 1;\n }\n return count + 1;\n }, 0);\n\nconst isValueEmpty = (value: unknown) => value === null || value === undefined || value === '';\n\nconst LobeSelect = memo<LobeSelectProps<any>>(\n ({\n allowClear,\n autoFocus,\n className,\n classNames,\n defaultOpen,\n defaultValue,\n disabled,\n id,\n labelRender,\n listHeight = 512,\n listItemHeight,\n loading,\n mode,\n name,\n onChange,\n onOpenChange,\n onSelect,\n open,\n optionRender,\n options,\n placeholder,\n popupClassName,\n popupMatchSelectWidth,\n prefix,\n readOnly,\n required,\n behaviorVariant = 'default',\n selectedIndicatorVariant = 'check',\n shadow,\n showSearch,\n size = 'middle',\n style,\n suffixIcon,\n suffixIconProps,\n tokenSeparators,\n value,\n variant,\n virtual,\n }) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const isMultiple = mode === 'multiple' || mode === 'tags';\n const isItemAligned = behaviorVariant === 'item-aligned';\n\n const [uncontrolledValue, setUncontrolledValue] = useState<any>(() => {\n if (defaultValue !== undefined) return defaultValue;\n return isMultiple ? [] : null;\n });\n\n const normalizeValue = useCallback(\n (nextValue: any) => {\n if (isMultiple) {\n if (Array.isArray(nextValue)) return nextValue;\n if (nextValue === null || nextValue === undefined) return [];\n return [nextValue];\n }\n if (Array.isArray(nextValue)) return nextValue[0] ?? null;\n return nextValue === undefined ? null : nextValue;\n },\n [isMultiple],\n );\n\n const mergedValue = value !== undefined ? value : uncontrolledValue;\n const normalizedValue = useMemo(\n () => normalizeValue(mergedValue),\n [mergedValue, normalizeValue],\n );\n const valueArray = useMemo(\n () =>\n isMultiple\n ? (normalizedValue as any[])\n : isValueEmpty(normalizedValue)\n ? []\n : [normalizedValue],\n [isMultiple, normalizedValue],\n );\n\n const [extraOptions, setExtraOptions] = useState<LobeSelectOption<any>[]>([]);\n\n useEffect(() => {\n if (mode !== 'tags' && extraOptions.length > 0) {\n setExtraOptions([]);\n }\n }, [mode, extraOptions.length]);\n\n const { resolvedOptions, optionMap } = useMemo(() => {\n const baseOptions = options ?? [];\n const optionValueMap = new Map<any, LobeSelectOption<any>>();\n\n const addOption = (item: LobeSelectOption<any>) => {\n if (!optionValueMap.has(item.value)) {\n optionValueMap.set(item.value, item);\n }\n };\n\n const walkOptions = (items: LobeSelectOptions) => {\n items.forEach((item) => {\n if (isGroupOption(item)) {\n item.options.forEach(addOption);\n } else {\n addOption(item);\n }\n });\n };\n\n walkOptions(baseOptions);\n\n const filteredExtraOptions = extraOptions.filter((item) => !optionValueMap.has(item.value));\n filteredExtraOptions.forEach(addOption);\n\n const mergedOptions: LobeSelectOptions = [...baseOptions, ...filteredExtraOptions];\n\n const missingValueOptions: LobeSelectOption<any>[] = valueArray\n .filter((val) => !optionValueMap.has(val))\n .map((val) => ({\n label: String(val),\n value: val,\n }));\n missingValueOptions.forEach(addOption);\n\n return {\n optionMap: optionValueMap,\n resolvedOptions: missingValueOptions.length\n ? [...mergedOptions, ...missingValueOptions]\n : mergedOptions,\n };\n }, [extraOptions, options, valueArray]);\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n\n useEffect(() => {\n if (open !== undefined) {\n setUncontrolledOpen(open);\n }\n }, [open]);\n\n const mergedOpen = open ?? uncontrolledOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [onOpenChange, open],\n );\n\n const [searchValue, setSearchValue] = useState('');\n const shouldShowSearch = Boolean(showSearch || mode === 'tags');\n\n useEffect(() => {\n if (!mergedOpen) setSearchValue('');\n }, [mergedOpen]);\n\n const getOption = useCallback(\n (optionValue: any): LobeSelectOption<any> => {\n const matched = optionMap.get(optionValue);\n if (matched) return matched;\n if (optionValue && typeof optionValue === 'object' && 'label' in optionValue) {\n return {\n label: (optionValue as any).label,\n value: optionValue,\n };\n }\n return {\n label: String(optionValue),\n value: optionValue,\n };\n },\n [optionMap],\n );\n\n const previousValueRef = useRef<any>(normalizedValue);\n\n useEffect(() => {\n previousValueRef.current = normalizedValue;\n }, [normalizedValue]);\n\n const handleValueChange = useCallback(\n (nextValue: any) => {\n const normalizedNextValue = normalizeValue(nextValue);\n const previousValue = previousValueRef.current;\n\n if (isMultiple) {\n const prevValues = Array.isArray(previousValue) ? previousValue : [];\n const nextValues = Array.isArray(normalizedNextValue) ? normalizedNextValue : [];\n const addedValues = nextValues.filter(\n (val) => !prevValues.some((prev) => Object.is(prev, val)),\n );\n\n addedValues.forEach((val) => {\n onSelect?.(val, getOption(val));\n });\n\n if (value === undefined) {\n setUncontrolledValue(nextValues);\n }\n onChange?.(\n nextValues,\n nextValues.map((val) => getOption(val)),\n );\n } else {\n if (\n !isValueEmpty(normalizedNextValue) &&\n !Object.is(previousValue, normalizedNextValue)\n ) {\n onSelect?.(normalizedNextValue, getOption(normalizedNextValue));\n }\n if (value === undefined) {\n setUncontrolledValue(normalizedNextValue);\n }\n onChange?.(\n normalizedNextValue,\n isValueEmpty(normalizedNextValue) ? undefined : getOption(normalizedNextValue),\n );\n }\n\n previousValueRef.current = normalizedNextValue;\n },\n [getOption, isMultiple, normalizeValue, onChange, onSelect, value],\n );\n\n const appendTagValues = useCallback(\n (rawValues: string[]) => {\n const valuesToAdd = rawValues.map((val) => val.trim()).filter(Boolean);\n if (!valuesToAdd.length) return;\n\n const nextValues = [...valueArray];\n const newOptionValues = valuesToAdd.filter((val) => !optionMap.has(val));\n\n if (newOptionValues.length > 0) {\n setExtraOptions((prev) => {\n const existingValues = new Set(prev.map((item) => item.value));\n const merged = [...prev];\n newOptionValues.forEach((val) => {\n if (!existingValues.has(val)) {\n merged.push({ label: val, value: val });\n }\n });\n return merged;\n });\n }\n\n valuesToAdd.forEach((val) => {\n if (!nextValues.some((item) => Object.is(item, val))) {\n nextValues.push(val);\n }\n });\n\n if (nextValues.length !== valueArray.length) {\n handleValueChange(nextValues);\n }\n },\n [handleValueChange, optionMap, valueArray],\n );\n\n const handleSearchChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const nextValue = event.target.value;\n if (mode === 'tags') {\n const parts = splitBySeparators(nextValue, tokenSeparators);\n if (parts.length > 1) {\n const pending = parts.pop() ?? '';\n appendTagValues(parts.filter(Boolean));\n setSearchValue(pending);\n return;\n }\n }\n setSearchValue(nextValue);\n },\n [appendTagValues, mode, tokenSeparators],\n );\n\n const handleSearchKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n event.stopPropagation();\n\n if (event.key === 'Escape') {\n handleOpenChange(false);\n return;\n }\n\n if (mode !== 'tags') return;\n\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n appendTagValues([searchValue]);\n setSearchValue('');\n return;\n }\n\n if (tokenSeparators?.includes(event.key)) {\n event.preventDefault();\n event.stopPropagation();\n appendTagValues([searchValue]);\n setSearchValue('');\n }\n },\n [appendTagValues, handleOpenChange, mode, searchValue, tokenSeparators],\n );\n\n const filteredOptions = useMemo(() => {\n if (!shouldShowSearch || !searchValue.trim()) return resolvedOptions;\n const query = searchValue.trim().toLowerCase();\n\n const filterItems = (items: LobeSelectOptions): LobeSelectOptions => {\n const filtered = items\n .map((item) => {\n if (isGroupOption(item)) {\n const groupItems = item.options.filter((option) =>\n getOptionSearchText(option).toLowerCase().includes(query),\n );\n if (!groupItems.length) return null;\n return { ...item, options: groupItems };\n }\n return getOptionSearchText(item).toLowerCase().includes(query) ? item : null;\n })\n .filter(Boolean) as LobeSelectOptions;\n\n return filtered;\n };\n\n return filterItems(resolvedOptions);\n }, [resolvedOptions, searchValue, shouldShowSearch]);\n\n const renderValue = useCallback(\n (currentValue: any) => {\n const resolved = normalizeValue(currentValue);\n const placeholderNode =\n placeholder === undefined ? null : (\n <span className={styles.valueText}>{placeholder}</span>\n );\n\n if (isMultiple) {\n const values = Array.isArray(resolved) ? resolved : [];\n if (values.length === 0) return placeholderNode;\n return (\n <span className={styles.tags}>\n {values.map((val, index) => {\n const option = getOption(val);\n const content = labelRender ? labelRender(option) : (option.label ?? String(val));\n return (\n <span className={styles.tag} key={`${String(val)}-${index}`}>\n {content}\n </span>\n );\n })}\n </span>\n );\n }\n\n if (isValueEmpty(resolved)) return placeholderNode;\n const option = getOption(resolved);\n const content = labelRender ? labelRender(option) : (option.label ?? String(resolved));\n return <span className={styles.valueText}>{content}</span>;\n },\n [getOption, isMultiple, labelRender, normalizeValue, placeholder],\n );\n\n const hasValue = isMultiple ? valueArray.length > 0 : !isValueEmpty(normalizedValue);\n const showClear = Boolean(allowClear && hasValue && !disabled && !readOnly);\n\n const handleClear = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n handleValueChange(isMultiple ? [] : null);\n },\n [handleValueChange, isMultiple],\n );\n\n const prefixNode = useMemo(() => {\n if (prefix === undefined || prefix === null) return null;\n if (isValidElement(prefix) || typeof prefix === 'string' || typeof prefix === 'number') {\n return prefix;\n }\n return <Icon icon={prefix as any} size={'small'} />;\n }, [prefix]);\n\n const suffixIconNode = useMemo(() => {\n if (loading) {\n return <Icon spin icon={Loader2} size={'small'} />;\n }\n if (suffixIcon === null) return null;\n if (\n isValidElement(suffixIcon) ||\n typeof suffixIcon === 'string' ||\n typeof suffixIcon === 'number'\n ) {\n return suffixIcon;\n }\n return (\n <Icon\n icon={(suffixIcon as any) || ChevronDown}\n size={'small'}\n {...suffixIconProps}\n style={{\n pointerEvents: 'none',\n ...suffixIconProps?.style,\n }}\n />\n );\n }, [loading, suffixIcon, suffixIconProps]);\n\n const popupStyle = useMemo(() => {\n const maxHeight = isItemAligned ? '80vh' : `${listHeight}px`;\n const baseStyle: React.CSSProperties = {\n maxHeight,\n maxWidth: 'var(--available-width)',\n minWidth: 'var(--anchor-width)',\n ['--lobe-select-popup-max-height' as any]: maxHeight,\n };\n\n if (popupMatchSelectWidth === undefined || popupMatchSelectWidth === true) {\n return baseStyle;\n }\n if (typeof popupMatchSelectWidth === 'number') {\n return {\n ...baseStyle,\n minWidth: popupMatchSelectWidth,\n width: popupMatchSelectWidth,\n };\n }\n return {\n ...baseStyle,\n minWidth: 'max-content',\n };\n }, [isItemAligned, listHeight, popupMatchSelectWidth]);\n\n const triggerClassName = cx(\n triggerVariants({ shadow, size, variant: resolvedVariant }),\n className,\n classNames?.root,\n classNames?.trigger,\n );\n\n const listRef = useRef<HTMLDivElement | null>(null);\n const pointerScrollRef = useRef(false);\n const pointerScrollTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const renderVirtualItem = useCallback((props: HTMLAttributes<HTMLDivElement>) => {\n const { ref, ...rest } = props as HTMLAttributes<HTMLDivElement> & {\n ref?: Ref<HTMLDivElement>;\n };\n\n return (\n <div\n {...rest}\n ref={(node) => {\n if (node) {\n node.scrollIntoView = (...args) => {\n if (!pointerScrollRef.current) {\n HTMLElement.prototype.scrollIntoView.call(node, ...args);\n }\n };\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref && 'current' in ref) {\n (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n }\n }}\n />\n );\n }, []);\n\n const markPointerScroll = useCallback(() => {\n pointerScrollRef.current = true;\n if (pointerScrollTimeoutRef.current) {\n clearTimeout(pointerScrollTimeoutRef.current);\n }\n pointerScrollTimeoutRef.current = setTimeout(() => {\n pointerScrollRef.current = false;\n }, 120);\n }, []);\n\n const handleListScroll = useCallback(() => {\n if (!virtual || !pointerScrollRef.current) return;\n const listElement = listRef.current;\n const activeElement = document.activeElement;\n if (listElement && activeElement && listElement.contains(activeElement)) {\n listElement.focus({ preventScroll: true });\n }\n }, [virtual]);\n\n useEffect(() => {\n return () => {\n if (pointerScrollTimeoutRef.current) {\n clearTimeout(pointerScrollTimeoutRef.current);\n }\n };\n }, []);\n const virtualListStyle = useMemo(() => {\n if (!virtual) return undefined;\n const rowCount = countVirtualItems(filteredOptions);\n const maxVisibleRows = 6;\n const estimatedRowHeight =\n listItemHeight ?? (size === 'large' ? 40 : size === 'small' ? 28 : 32);\n const visibleRows = Math.min(Math.max(rowCount, 1), maxVisibleRows);\n const estimatedHeight = visibleRows * estimatedRowHeight + 8;\n\n return {\n height: `min(${estimatedHeight}px, var(--lobe-select-available-height, var(--available-height)))`,\n };\n }, [filteredOptions, listItemHeight, size, virtual]);\n\n const keepMountedIndices = useMemo(() => {\n if (!virtual || valueArray.length === 0) return undefined;\n const selectedSet = new Set(valueArray);\n const indices: number[] = [];\n let index = 0;\n\n filteredOptions.forEach((item) => {\n if (isGroupOption(item)) {\n if (item.options.some((option) => selectedSet.has(option.value))) {\n indices.push(index);\n }\n index += 1;\n return;\n }\n\n if (selectedSet.has(item.value)) {\n indices.push(index);\n }\n index += 1;\n });\n\n return indices.length ? indices : undefined;\n }, [filteredOptions, valueArray, virtual]);\n\n const itemTextClassName = cx(\n optionRender ? menuStyles.itemContent : menuStyles.label,\n styles.itemText,\n classNames?.itemText,\n );\n\n const isBoldIndicator = selectedIndicatorVariant === 'bold';\n let optionIndex = 0;\n const renderOptions = (items: LobeSelectOptions) =>\n items.map((item, index) => {\n if (isGroupOption(item)) {\n return (\n <Select.Group className={cx(styles.group, classNames?.group)} key={`group-${index}`}>\n <Select.GroupLabel\n className={cx(menuStyles.groupLabel, styles.groupLabel, classNames?.groupLabel)}\n >\n {item.label}\n </Select.GroupLabel>\n {item.options.map((option) => {\n const currentIndex = optionIndex++;\n return (\n <Select.Item\n disabled={option.disabled}\n key={`${String(option.value)}-${currentIndex}`}\n label={getOptionSearchText(option)}\n render={virtual ? renderVirtualItem : undefined}\n value={option.value}\n className={cx(\n menuStyles.item,\n styles.item,\n isBoldIndicator && styles.itemBoldSelected,\n classNames?.item,\n classNames?.option,\n option.className,\n )}\n style={{\n minHeight: listItemHeight,\n ...option.style,\n }}\n >\n <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(option, { index: currentIndex }) : option.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator\n className={cx(styles.itemIndicator, classNames?.itemIndicator)}\n >\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n })}\n </Select.Group>\n );\n }\n\n const currentIndex = optionIndex++;\n return (\n <Select.Item\n disabled={item.disabled}\n key={`${String(item.value)}-${currentIndex}`}\n label={getOptionSearchText(item)}\n render={virtual ? renderVirtualItem : undefined}\n value={item.value}\n className={cx(\n menuStyles.item,\n styles.item,\n isBoldIndicator && styles.itemBoldSelected,\n classNames?.item,\n classNames?.option,\n item.className,\n )}\n style={{\n minHeight: listItemHeight,\n ...item.style,\n }}\n >\n <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(item, { index: currentIndex }) : item.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator className={cx(styles.itemIndicator, classNames?.itemIndicator)}>\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n });\n\n return (\n <Select.Root\n disabled={disabled}\n id={id}\n modal={isItemAligned}\n multiple={isMultiple}\n name={name}\n open={mergedOpen}\n readOnly={readOnly}\n required={required}\n value={normalizedValue}\n onOpenChange={handleOpenChange}\n onValueChange={handleValueChange}\n >\n <Select.Trigger\n autoFocus={autoFocus}\n className={triggerClassName}\n disabled={disabled}\n style={style}\n >\n {prefixNode !== null && prefixNode !== undefined && (\n <span className={cx(styles.prefix, classNames?.prefix)}>{prefixNode}</span>\n )}\n <Select.Value className={cx(styles.value, classNames?.value)}>{renderValue}</Select.Value>\n <span className={cx(styles.suffix, classNames?.suffix)}>\n {showClear && (\n <span\n className={cx(styles.clear, classNames?.clear)}\n data-role=\"lobe-select-clear\"\n onClick={handleClear}\n >\n <Icon icon={X} size={'small'} />\n </span>\n )}\n {suffixIconNode !== null && suffixIconNode !== undefined && (\n <Select.Icon className={cx(styles.icon, classNames?.icon)}>\n {suffixIconNode}\n </Select.Icon>\n )}\n </span>\n </Select.Trigger>\n\n <Select.Portal>\n <Select.Positioner\n align=\"start\"\n alignItemWithTrigger={isItemAligned}\n className={styles.positioner}\n side=\"bottom\"\n sideOffset={6}\n >\n <Select.Popup\n style={popupStyle}\n className={cx(\n menuStyles.popup,\n styles.popup,\n popupClassName,\n classNames?.popup,\n classNames?.dropdown,\n )}\n >\n {shouldShowSearch && (\n <div className={cx(styles.search, classNames?.search)}>\n <input\n className={styles.searchInput}\n placeholder={typeof placeholder === 'string' ? placeholder : undefined}\n value={searchValue}\n onChange={handleSearchChange}\n onKeyDown={handleSearchKeyDown}\n />\n </div>\n )}\n {(() => {\n const content =\n filteredOptions.length > 0 ? (\n renderOptions(filteredOptions)\n ) : (\n <div\n className={cx(\n menuStyles.item,\n menuStyles.empty,\n styles.empty,\n classNames?.empty,\n )}\n >\n No data\n </div>\n );\n\n if (!virtual || filteredOptions.length === 0) {\n return (\n <Select.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n >\n {content}\n </Select.List>\n );\n }\n\n return (\n <Select.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n ref={listRef}\n style={virtualListStyle}\n tabIndex={virtual ? -1 : undefined}\n onPointerDown={virtual ? markPointerScroll : undefined}\n onScroll={virtual ? handleListScroll : undefined}\n onTouchMove={virtual ? markPointerScroll : undefined}\n onWheel={virtual ? markPointerScroll : undefined}\n >\n <Virtualizer itemSize={listItemHeight} keepMounted={keepMountedIndices}>\n {content}\n </Virtualizer>\n </Select.List>\n );\n })()}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n },\n);\n\nLobeSelect.displayName = 'LobeSelect';\n\nexport default LobeSelect;\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAM,iBACJ,WAEA,QAAS,OAAwC,QAAQ;AAE3D,MAAM,uBAA+B,WAAoC;AACvE,KAAI,OAAO,OAAO,UAAU,YAAY,OAAO,OAAO,UAAU,SAC9D,QAAO,OAAO,OAAO,MAAM;AAE7B,KAAI,OAAO,OAAO,UAAU,YAAY,OAAO,OAAO,UAAU,SAC9D,QAAO,OAAO,OAAO,MAAM;AAE7B,KAAI,OAAO,MAAO,QAAO,OAAO;AAChC,QAAO;;AAGT,MAAM,gBAAgB,UAAkB,MAAM,WAAW,uBAAuB,OAAO;AAEvF,MAAM,qBAAqB,OAAe,eAA0B;AAClE,KAAI,CAAC,cAAc,WAAW,WAAW,EAAG,QAAO,CAAC,MAAM;CAC1D,MAAM,UAAU,WAAW,IAAI,aAAa,CAAC,KAAK,IAAI;AACtD,QAAO,MAAM,MAAM,IAAI,OAAO,SAAS,IAAI,CAAC;;AAG9C,MAAM,qBAAqB,UACzB,MAAM,QAAQ,OAAO,SAAS;AAC5B,KAAI,cAAc,KAAK,CACrB,QAAO,QAAQ,KAAK,QAAQ,SAAS;AAEvC,QAAO,QAAQ;GACd,EAAE;AAEP,MAAM,gBAAgB,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W,GAAGA,SAAO,MAAM,YAAY,KAAK;MAC5C,gBAAc,WAAW;gBAExB;OACW;AAIlB,YACE,oBAAC,OAAO;MACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;MAC5C,gBAAc,WAAW;MACzB,KAAK;MACL,OAAO;MACP,UAAU,UAAU,KAAK;MACzB,eAAe,UAAU,oBAAoB;MAC7C,UAAU,UAAU,mBAAmB;MACvC,aAAa,UAAU,oBAAoB;MAC3C,SAAS,UAAU,oBAAoB;gBAEvC,oBAAC;OAAY,UAAU;OAAgB,aAAa;iBACjD;QACW;OACF;QAEd;KACS;IACG,GACN;GACJ;EAGnB;AAED,WAAW,cAAc;AAEzB,yBAAe"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { LobeSelectSize, LobeSelectVariant } from "./type.mjs";
|
|
2
2
|
import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react0 from "react";
|
|
4
4
|
import { ComponentProps, ComponentPropsWithRef } from "react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
import * as _base_ui_react_select0 from "@base-ui/react/select";
|
|
7
7
|
import { Select } from "@base-ui/react/select";
|
|
8
8
|
import * as node_modules__base_ui_react_esm_separator_Separator0 from "node_modules/@base-ui/react/esm/separator/Separator";
|
|
9
9
|
|
|
10
10
|
//#region src/LobeSelect/atoms.d.ts
|
|
11
11
|
declare const LobeSelectRoot: typeof Select.Root;
|
|
12
|
-
declare const LobeSelectBackdrop:
|
|
13
|
-
declare const LobeSelectSeparator:
|
|
12
|
+
declare const LobeSelectBackdrop: react0.ForwardRefExoticComponent<_base_ui_react_select0.SelectBackdropProps & react0.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const LobeSelectSeparator: react0.ForwardRefExoticComponent<node_modules__base_ui_react_esm_separator_Separator0.SeparatorProps & react0.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
type LobeSelectTriggerProps = Omit<ComponentPropsWithRef<typeof Select.Trigger>, 'children' | 'render'> & {
|
|
15
15
|
children: ComponentProps<typeof Select.Trigger>['children'];
|
|
16
16
|
shadow?: boolean;
|
|
@@ -27,7 +27,7 @@ declare const LobeSelectTrigger: {
|
|
|
27
27
|
variant,
|
|
28
28
|
ref: refProp,
|
|
29
29
|
...rest
|
|
30
|
-
}: LobeSelectTriggerProps):
|
|
30
|
+
}: LobeSelectTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;
|
|
@@ -35,7 +35,7 @@ declare const LobeSelectIcon: {
|
|
|
35
35
|
({
|
|
36
36
|
className,
|
|
37
37
|
...rest
|
|
38
|
-
}: LobeSelectIconProps):
|
|
38
|
+
}: LobeSelectIconProps): react_jsx_runtime0.JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
};
|
|
41
41
|
type LobeSelectValueProps = ComponentProps<typeof Select.Value>;
|
|
@@ -43,7 +43,7 @@ declare const LobeSelectValue: {
|
|
|
43
43
|
({
|
|
44
44
|
className,
|
|
45
45
|
...rest
|
|
46
|
-
}: LobeSelectValueProps):
|
|
46
|
+
}: LobeSelectValueProps): react_jsx_runtime0.JSX.Element;
|
|
47
47
|
displayName: string;
|
|
48
48
|
};
|
|
49
49
|
type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {
|
|
@@ -56,7 +56,7 @@ declare const LobeSelectPortal: {
|
|
|
56
56
|
({
|
|
57
57
|
container,
|
|
58
58
|
...rest
|
|
59
|
-
}: LobeSelectPortalProps):
|
|
59
|
+
}: LobeSelectPortalProps): react_jsx_runtime0.JSX.Element;
|
|
60
60
|
displayName: string;
|
|
61
61
|
};
|
|
62
62
|
type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;
|
|
@@ -68,7 +68,7 @@ declare const LobeSelectPositioner: {
|
|
|
68
68
|
side,
|
|
69
69
|
sideOffset,
|
|
70
70
|
...rest
|
|
71
|
-
}: LobeSelectPositionerProps):
|
|
71
|
+
}: LobeSelectPositionerProps): react_jsx_runtime0.JSX.Element;
|
|
72
72
|
displayName: string;
|
|
73
73
|
};
|
|
74
74
|
type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;
|
|
@@ -76,7 +76,7 @@ declare const LobeSelectPopup: {
|
|
|
76
76
|
({
|
|
77
77
|
className,
|
|
78
78
|
...rest
|
|
79
|
-
}: LobeSelectPopupProps):
|
|
79
|
+
}: LobeSelectPopupProps): react_jsx_runtime0.JSX.Element;
|
|
80
80
|
displayName: string;
|
|
81
81
|
};
|
|
82
82
|
type LobeSelectListProps = ComponentProps<typeof Select.List>;
|
|
@@ -84,7 +84,7 @@ declare const LobeSelectList: {
|
|
|
84
84
|
({
|
|
85
85
|
className,
|
|
86
86
|
...rest
|
|
87
|
-
}: LobeSelectListProps):
|
|
87
|
+
}: LobeSelectListProps): react_jsx_runtime0.JSX.Element;
|
|
88
88
|
displayName: string;
|
|
89
89
|
};
|
|
90
90
|
type LobeSelectItemProps = ComponentProps<typeof Select.Item>;
|
|
@@ -92,7 +92,7 @@ declare const LobeSelectItem: {
|
|
|
92
92
|
({
|
|
93
93
|
className,
|
|
94
94
|
...rest
|
|
95
|
-
}: LobeSelectItemProps):
|
|
95
|
+
}: LobeSelectItemProps): react_jsx_runtime0.JSX.Element;
|
|
96
96
|
displayName: string;
|
|
97
97
|
};
|
|
98
98
|
type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;
|
|
@@ -100,7 +100,7 @@ declare const LobeSelectItemText: {
|
|
|
100
100
|
({
|
|
101
101
|
className,
|
|
102
102
|
...rest
|
|
103
|
-
}: LobeSelectItemTextProps):
|
|
103
|
+
}: LobeSelectItemTextProps): react_jsx_runtime0.JSX.Element;
|
|
104
104
|
displayName: string;
|
|
105
105
|
};
|
|
106
106
|
type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;
|
|
@@ -108,7 +108,7 @@ declare const LobeSelectItemIndicator: {
|
|
|
108
108
|
({
|
|
109
109
|
className,
|
|
110
110
|
...rest
|
|
111
|
-
}: LobeSelectItemIndicatorProps):
|
|
111
|
+
}: LobeSelectItemIndicatorProps): react_jsx_runtime0.JSX.Element;
|
|
112
112
|
displayName: string;
|
|
113
113
|
};
|
|
114
114
|
type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;
|
|
@@ -116,7 +116,7 @@ declare const LobeSelectGroup: {
|
|
|
116
116
|
({
|
|
117
117
|
className,
|
|
118
118
|
...rest
|
|
119
|
-
}: LobeSelectGroupProps):
|
|
119
|
+
}: LobeSelectGroupProps): react_jsx_runtime0.JSX.Element;
|
|
120
120
|
displayName: string;
|
|
121
121
|
};
|
|
122
122
|
type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;
|
|
@@ -124,7 +124,7 @@ declare const LobeSelectGroupLabel: {
|
|
|
124
124
|
({
|
|
125
125
|
className,
|
|
126
126
|
...rest
|
|
127
|
-
}: LobeSelectGroupLabelProps):
|
|
127
|
+
}: LobeSelectGroupLabelProps): react_jsx_runtime0.JSX.Element;
|
|
128
128
|
displayName: string;
|
|
129
129
|
};
|
|
130
130
|
type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;
|
|
@@ -132,7 +132,7 @@ declare const LobeSelectScrollUpArrow: {
|
|
|
132
132
|
({
|
|
133
133
|
className,
|
|
134
134
|
...rest
|
|
135
|
-
}: LobeSelectScrollUpArrowProps):
|
|
135
|
+
}: LobeSelectScrollUpArrowProps): react_jsx_runtime0.JSX.Element;
|
|
136
136
|
displayName: string;
|
|
137
137
|
};
|
|
138
138
|
type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;
|
|
@@ -140,7 +140,7 @@ declare const LobeSelectScrollDownArrow: {
|
|
|
140
140
|
({
|
|
141
141
|
className,
|
|
142
142
|
...rest
|
|
143
|
-
}: LobeSelectScrollDownArrowProps):
|
|
143
|
+
}: LobeSelectScrollDownArrowProps): react_jsx_runtime0.JSX.Element;
|
|
144
144
|
displayName: string;
|
|
145
145
|
};
|
|
146
146
|
type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;
|
|
@@ -148,7 +148,7 @@ declare const LobeSelectArrow: {
|
|
|
148
148
|
({
|
|
149
149
|
className,
|
|
150
150
|
...rest
|
|
151
|
-
}: LobeSelectArrowProps):
|
|
151
|
+
}: LobeSelectArrowProps): react_jsx_runtime0.JSX.Element;
|
|
152
152
|
displayName: string;
|
|
153
153
|
};
|
|
154
154
|
//#endregion
|
package/es/LobeSelect/atoms.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useNativeButton } from "../hooks/useNativeButton.mjs";
|
|
4
|
-
import { usePortalContainer } from "../hooks/usePortalContainer.mjs";
|
|
5
4
|
import { styles } from "../Menu/sharedStyle.mjs";
|
|
6
|
-
import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
|
|
7
5
|
import { styles as styles$1, triggerVariants } from "./style.mjs";
|
|
6
|
+
import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
|
|
8
7
|
import { cloneElement, isValidElement } from "react";
|
|
9
8
|
import { jsx } from "react/jsx-runtime";
|
|
10
9
|
import { cx, useThemeMode } from "antd-style";
|
|
@@ -78,9 +77,8 @@ const LobeSelectValue = ({ className, ...rest }) => {
|
|
|
78
77
|
};
|
|
79
78
|
LobeSelectValue.displayName = "LobeSelectValue";
|
|
80
79
|
const LobeSelectPortal = ({ container, ...rest }) => {
|
|
81
|
-
const defaultContainer = usePortalContainer(LOBE_SELECT_CONTAINER_ATTR);
|
|
82
80
|
return /* @__PURE__ */ jsx(Select.Portal, {
|
|
83
|
-
container: container ??
|
|
81
|
+
container: container ?? void 0,
|
|
84
82
|
...rest
|
|
85
83
|
});
|
|
86
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":["styles","menuStyles"],"sources":["../../src/LobeSelect/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Select } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport {\n cloneElement,\n type ComponentProps,\n type ComponentPropsWithRef,\n isValidElement,\n} from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { usePortalContainer } from '@/hooks/usePortalContainer';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\n\nimport { LOBE_SELECT_CONTAINER_ATTR } from './constants';\nimport { styles, triggerVariants } from './style';\nimport { type LobeSelectSize, type LobeSelectVariant } from './type';\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => cx(base, className(state));\n return cx(base, className);\n};\n\nexport const LobeSelectRoot = Select.Root;\nexport const LobeSelectBackdrop = Select.Backdrop;\nexport const LobeSelectSeparator = Select.Separator;\n\nexport type LobeSelectTriggerProps = Omit<\n ComponentPropsWithRef<typeof Select.Trigger>,\n 'children' | 'render'\n> & {\n children: ComponentProps<typeof Select.Trigger>['children'];\n shadow?: boolean;\n size?: LobeSelectSize;\n variant?: LobeSelectVariant;\n};\n\nexport const LobeSelectTrigger = ({\n children,\n className,\n nativeButton,\n shadow,\n size = 'middle',\n variant,\n ref: refProp,\n ...rest\n}: LobeSelectTriggerProps) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const baseClassName = triggerVariants({ shadow, size, variant: resolvedVariant });\n\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n if (isValidElement(children)) {\n return (\n <Select.Trigger\n {...rest}\n nativeButton={resolvedNativeButton}\n render={(props, state) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ref: triggerRef, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n const childClassName =\n typeof (mergedProps as any).className === 'function'\n ? (mergedProps as any).className(state)\n : (mergedProps as any).className;\n const extraClassName = typeof className === 'function' ? className(state) : className;\n\n return cloneElement(children as any, {\n ...mergedProps,\n className: cx(baseClassName, childClassName, extraClassName),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n }}\n />\n );\n }\n\n return (\n <Select.Trigger\n {...rest}\n className={mergeStateClassName(baseClassName, className) as any}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Select.Trigger>\n );\n};\n\nLobeSelectTrigger.displayName = 'LobeSelectTrigger';\n\nexport type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;\n\nexport const LobeSelectIcon = ({ className, ...rest }: LobeSelectIconProps) => {\n return <Select.Icon className={mergeStateClassName(styles.icon, className) as any} {...rest} />;\n};\n\nLobeSelectIcon.displayName = 'LobeSelectIcon';\n\nexport type LobeSelectValueProps = ComponentProps<typeof Select.Value>;\n\nexport const LobeSelectValue = ({ className, ...rest }: LobeSelectValueProps) => {\n return <Select.Value className={mergeStateClassName(styles.value, className) as any} {...rest} />;\n};\n\nLobeSelectValue.displayName = 'LobeSelectValue';\n\nexport type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const LobeSelectPortal = ({ container, ...rest }: LobeSelectPortalProps) => {\n const defaultContainer = usePortalContainer(LOBE_SELECT_CONTAINER_ATTR);\n return <Select.Portal container={container ?? defaultContainer} {...rest} />;\n};\n\nLobeSelectPortal.displayName = 'LobeSelectPortal';\n\nexport type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;\n\nexport const LobeSelectPositioner = ({\n align,\n alignItemWithTrigger,\n className,\n side,\n sideOffset,\n ...rest\n}: LobeSelectPositionerProps) => {\n return (\n <Select.Positioner\n align={align ?? 'start'}\n alignItemWithTrigger={alignItemWithTrigger ?? false}\n className={mergeStateClassName(styles.positioner, className) as any}\n side={side ?? 'bottom'}\n sideOffset={sideOffset ?? 6}\n {...rest}\n />\n );\n};\n\nLobeSelectPositioner.displayName = 'LobeSelectPositioner';\n\nexport type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;\n\nexport const LobeSelectPopup = ({ className, ...rest }: LobeSelectPopupProps) => {\n return (\n <Select.Popup\n className={mergeStateClassName(cx(menuStyles.popup, styles.popup), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectPopup.displayName = 'LobeSelectPopup';\n\nexport type LobeSelectListProps = ComponentProps<typeof Select.List>;\n\nexport const LobeSelectList = ({ className, ...rest }: LobeSelectListProps) => {\n return <Select.List className={mergeStateClassName(styles.list, className) as any} {...rest} />;\n};\n\nLobeSelectList.displayName = 'LobeSelectList';\n\nexport type LobeSelectItemProps = ComponentProps<typeof Select.Item>;\n\nexport const LobeSelectItem = ({ className, ...rest }: LobeSelectItemProps) => {\n return (\n <Select.Item\n className={mergeStateClassName(cx(menuStyles.item, styles.item), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItem.displayName = 'LobeSelectItem';\n\nexport type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;\n\nexport const LobeSelectItemText = ({ className, ...rest }: LobeSelectItemTextProps) => {\n return (\n <Select.ItemText\n className={mergeStateClassName(cx(menuStyles.label, styles.itemText), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemText.displayName = 'LobeSelectItemText';\n\nexport type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;\n\nexport const LobeSelectItemIndicator = ({ className, ...rest }: LobeSelectItemIndicatorProps) => {\n return (\n <Select.ItemIndicator\n className={mergeStateClassName(styles.itemIndicator, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemIndicator.displayName = 'LobeSelectItemIndicator';\n\nexport type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;\n\nexport const LobeSelectGroup = ({ className, ...rest }: LobeSelectGroupProps) => {\n return <Select.Group className={mergeStateClassName(styles.group, className) as any} {...rest} />;\n};\n\nLobeSelectGroup.displayName = 'LobeSelectGroup';\n\nexport type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;\n\nexport const LobeSelectGroupLabel = ({ className, ...rest }: LobeSelectGroupLabelProps) => {\n return (\n <Select.GroupLabel\n className={\n mergeStateClassName(cx(menuStyles.groupLabel, styles.groupLabel), className) as any\n }\n {...rest}\n />\n );\n};\n\nLobeSelectGroupLabel.displayName = 'LobeSelectGroupLabel';\n\nexport type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;\n\nexport const LobeSelectScrollUpArrow = ({ className, ...rest }: LobeSelectScrollUpArrowProps) => {\n return (\n <Select.ScrollUpArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollUpArrow.displayName = 'LobeSelectScrollUpArrow';\n\nexport type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;\n\nexport const LobeSelectScrollDownArrow = ({\n className,\n ...rest\n}: LobeSelectScrollDownArrowProps) => {\n return (\n <Select.ScrollDownArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollDownArrow.displayName = 'LobeSelectScrollDownArrow';\n\nexport type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;\n\nexport const LobeSelectArrow = ({ className, ...rest }: LobeSelectArrowProps) => {\n return <Select.Arrow className={mergeStateClassName(styles.arrow, className) as any} {...rest} />;\n};\n\nLobeSelectArrow.displayName = 'LobeSelectArrow';\n\nexport { LOBE_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AAsB,EAAE,WAAW,GAAG,WAAoC;AACrF,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoB,GAAGC,OAAW,OAAOD,SAAO,SAAS,EAAE,UAAU;EAChF,GAAI;GACJ;;AAIN,mBAAmB,cAAc;AAIjC,MAAa,2BAA2B,EAAE,WAAW,GAAG,WAAyC;AAC/F,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,eAAe,UAAU;EAC/D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc;AAI9B,MAAa,wBAAwB,EAAE,WAAW,GAAG,WAAsC;AACzF,QACE,oBAAC,OAAO;EACN,WACE,oBAAoB,GAAGC,OAAW,YAAYD,SAAO,WAAW,EAAE,UAAU;EAE9E,GAAI;GACJ;;AAIN,qBAAqB,cAAc;AAInC,MAAa,2BAA2B,EAAE,WAAW,GAAG,WAAyC;AAC/F,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,6BAA6B,EACxC,WACA,GAAG,WACiC;AACpC,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,0BAA0B,cAAc;AAIxC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc"}
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["styles","menuStyles"],"sources":["../../src/LobeSelect/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Select } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport {\n cloneElement,\n type ComponentProps,\n type ComponentPropsWithRef,\n isValidElement,\n} from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\n\nimport { styles, triggerVariants } from './style';\nimport { type LobeSelectSize, type LobeSelectVariant } from './type';\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => cx(base, className(state));\n return cx(base, className);\n};\n\nexport const LobeSelectRoot = Select.Root;\nexport const LobeSelectBackdrop = Select.Backdrop;\nexport const LobeSelectSeparator = Select.Separator;\n\nexport type LobeSelectTriggerProps = Omit<\n ComponentPropsWithRef<typeof Select.Trigger>,\n 'children' | 'render'\n> & {\n children: ComponentProps<typeof Select.Trigger>['children'];\n shadow?: boolean;\n size?: LobeSelectSize;\n variant?: LobeSelectVariant;\n};\n\nexport const LobeSelectTrigger = ({\n children,\n className,\n nativeButton,\n shadow,\n size = 'middle',\n variant,\n ref: refProp,\n ...rest\n}: LobeSelectTriggerProps) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const baseClassName = triggerVariants({ shadow, size, variant: resolvedVariant });\n\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n if (isValidElement(children)) {\n return (\n <Select.Trigger\n {...rest}\n nativeButton={resolvedNativeButton}\n render={(props, state) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ref: triggerRef, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n const childClassName =\n typeof (mergedProps as any).className === 'function'\n ? (mergedProps as any).className(state)\n : (mergedProps as any).className;\n const extraClassName = typeof className === 'function' ? className(state) : className;\n\n return cloneElement(children as any, {\n ...mergedProps,\n className: cx(baseClassName, childClassName, extraClassName),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n }}\n />\n );\n }\n\n return (\n <Select.Trigger\n {...rest}\n className={mergeStateClassName(baseClassName, className) as any}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Select.Trigger>\n );\n};\n\nLobeSelectTrigger.displayName = 'LobeSelectTrigger';\n\nexport type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;\n\nexport const LobeSelectIcon = ({ className, ...rest }: LobeSelectIconProps) => {\n return <Select.Icon className={mergeStateClassName(styles.icon, className) as any} {...rest} />;\n};\n\nLobeSelectIcon.displayName = 'LobeSelectIcon';\n\nexport type LobeSelectValueProps = ComponentProps<typeof Select.Value>;\n\nexport const LobeSelectValue = ({ className, ...rest }: LobeSelectValueProps) => {\n return <Select.Value className={mergeStateClassName(styles.value, className) as any} {...rest} />;\n};\n\nLobeSelectValue.displayName = 'LobeSelectValue';\n\nexport type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const LobeSelectPortal = ({ container, ...rest }: LobeSelectPortalProps) => {\n return <Select.Portal container={container ?? undefined} {...rest} />;\n};\n\nLobeSelectPortal.displayName = 'LobeSelectPortal';\n\nexport type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;\n\nexport const LobeSelectPositioner = ({\n align,\n alignItemWithTrigger,\n className,\n side,\n sideOffset,\n ...rest\n}: LobeSelectPositionerProps) => {\n return (\n <Select.Positioner\n align={align ?? 'start'}\n alignItemWithTrigger={alignItemWithTrigger ?? false}\n className={mergeStateClassName(styles.positioner, className) as any}\n side={side ?? 'bottom'}\n sideOffset={sideOffset ?? 6}\n {...rest}\n />\n );\n};\n\nLobeSelectPositioner.displayName = 'LobeSelectPositioner';\n\nexport type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;\n\nexport const LobeSelectPopup = ({ className, ...rest }: LobeSelectPopupProps) => {\n return (\n <Select.Popup\n className={mergeStateClassName(cx(menuStyles.popup, styles.popup), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectPopup.displayName = 'LobeSelectPopup';\n\nexport type LobeSelectListProps = ComponentProps<typeof Select.List>;\n\nexport const LobeSelectList = ({ className, ...rest }: LobeSelectListProps) => {\n return <Select.List className={mergeStateClassName(styles.list, className) as any} {...rest} />;\n};\n\nLobeSelectList.displayName = 'LobeSelectList';\n\nexport type LobeSelectItemProps = ComponentProps<typeof Select.Item>;\n\nexport const LobeSelectItem = ({ className, ...rest }: LobeSelectItemProps) => {\n return (\n <Select.Item\n className={mergeStateClassName(cx(menuStyles.item, styles.item), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItem.displayName = 'LobeSelectItem';\n\nexport type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;\n\nexport const LobeSelectItemText = ({ className, ...rest }: LobeSelectItemTextProps) => {\n return (\n <Select.ItemText\n className={mergeStateClassName(cx(menuStyles.label, styles.itemText), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemText.displayName = 'LobeSelectItemText';\n\nexport type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;\n\nexport const LobeSelectItemIndicator = ({ className, ...rest }: LobeSelectItemIndicatorProps) => {\n return (\n <Select.ItemIndicator\n className={mergeStateClassName(styles.itemIndicator, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemIndicator.displayName = 'LobeSelectItemIndicator';\n\nexport type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;\n\nexport const LobeSelectGroup = ({ className, ...rest }: LobeSelectGroupProps) => {\n return <Select.Group className={mergeStateClassName(styles.group, className) as any} {...rest} />;\n};\n\nLobeSelectGroup.displayName = 'LobeSelectGroup';\n\nexport type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;\n\nexport const LobeSelectGroupLabel = ({ className, ...rest }: LobeSelectGroupLabelProps) => {\n return (\n <Select.GroupLabel\n className={\n mergeStateClassName(cx(menuStyles.groupLabel, styles.groupLabel), className) as any\n }\n {...rest}\n />\n );\n};\n\nLobeSelectGroupLabel.displayName = 'LobeSelectGroupLabel';\n\nexport type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;\n\nexport const LobeSelectScrollUpArrow = ({ className, ...rest }: LobeSelectScrollUpArrowProps) => {\n return (\n <Select.ScrollUpArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollUpArrow.displayName = 'LobeSelectScrollUpArrow';\n\nexport type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;\n\nexport const LobeSelectScrollDownArrow = ({\n className,\n ...rest\n}: LobeSelectScrollDownArrowProps) => {\n return (\n <Select.ScrollDownArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollDownArrow.displayName = 'LobeSelectScrollDownArrow';\n\nexport type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;\n\nexport const LobeSelectArrow = ({ className, ...rest }: LobeSelectArrowProps) => {\n return <Select.Arrow className={mergeStateClassName(styles.arrow, className) as any} {...rest} />;\n};\n\nLobeSelectArrow.displayName = 'LobeSelectArrow';\n\nexport { LOBE_SELECT_CONTAINER_ATTR } from './constants';\n"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAM,uBACJ,MACA,cACG;AACH,KAAI,OAAO,cAAc,WAAY,SAAQ,UAAkB,GAAG,MAAM,UAAU,MAAM,CAAC;AACzF,QAAO,GAAG,MAAM,UAAU;;AAG5B,MAAa,iBAAiB,OAAO;AACrC,MAAa,qBAAqB,OAAO;AACzC,MAAa,sBAAsB,OAAO;AAY1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C,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc;AAI9B,MAAa,wBAAwB,EAAE,WAAW,GAAG,WAAsC;AACzF,QACE,oBAAC,OAAO;EACN,WACE,oBAAoB,GAAGC,OAAW,YAAYD,SAAO,WAAW,EAAE,UAAU;EAE9E,GAAI;GACJ;;AAIN,qBAAqB,cAAc;AAInC,MAAa,2BAA2B,EAAE,WAAW,GAAG,WAAyC;AAC/F,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,6BAA6B,EACxC,WACA,GAAG,WACiC;AACpC,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,0BAA0B,cAAc;AAIxC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LobeSwitchProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react7 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/LobeSwitch/LobeSwitch.d.ts
|
|
5
|
-
declare const LobeSwitch:
|
|
5
|
+
declare const LobeSwitch: react7.NamedExoticComponent<LobeSwitchProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LobeSwitch };
|
|
8
8
|
//# sourceMappingURL=LobeSwitch.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LobeSwitchChangeEventHandler, LobeSwitchContextType, LobeSwitchIconProps, LobeSwitchRootProps, LobeSwitchThumbProps } from "./type.mjs";
|
|
2
2
|
import { styles } from "./style.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/LobeSwitch/atoms.d.ts
|
|
6
6
|
declare const useLobeSwitchContext: () => LobeSwitchContextType;
|
|
@@ -24,7 +24,7 @@ declare const LobeSwitchRoot: {
|
|
|
24
24
|
id,
|
|
25
25
|
name,
|
|
26
26
|
...rest
|
|
27
|
-
}: LobeSwitchRootInternalProps):
|
|
27
|
+
}: LobeSwitchRootInternalProps): react_jsx_runtime14.JSX.Element;
|
|
28
28
|
displayName: string;
|
|
29
29
|
};
|
|
30
30
|
declare const LobeSwitchThumb: {
|
|
@@ -35,7 +35,7 @@ declare const LobeSwitchThumb: {
|
|
|
35
35
|
transition,
|
|
36
36
|
children,
|
|
37
37
|
...rest
|
|
38
|
-
}: LobeSwitchThumbProps):
|
|
38
|
+
}: LobeSwitchThumbProps): react_jsx_runtime14.JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
};
|
|
41
41
|
declare const LobeSwitchIcon: {
|
|
@@ -48,7 +48,7 @@ declare const LobeSwitchIcon: {
|
|
|
48
48
|
}: LobeSwitchIconProps & {
|
|
49
49
|
children?: React.ReactNode;
|
|
50
50
|
size?: "default" | "small";
|
|
51
|
-
}):
|
|
51
|
+
}): react_jsx_runtime14.JSX.Element;
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
//#endregion
|