diff --git a/web/src/components/llm-select/index.tsx b/web/src/components/llm-select/index.tsx index 6804f1bd1..04e805f79 100644 --- a/web/src/components/llm-select/index.tsx +++ b/web/src/components/llm-select/index.tsx @@ -1,7 +1,10 @@ import { LlmModelType } from '@/constants/knowledge'; import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks'; -import { Popover, Select } from 'antd'; +import { Popover as AntPopover, Select as AntSelect } from 'antd'; +import { useState } from 'react'; import LlmSettingItems from '../llm-setting-items'; +import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'; +import { Select, SelectTrigger, SelectValue } from '../ui/select'; interface IProps { id?: string; @@ -25,14 +28,14 @@ const LLMSelect = ({ id, value, onChange, disabled }: IProps) => { ); return ( - - + + + { + e.preventDefault(); + setIsPopoverOpen(true); + }} + > + + + + + + + + + ); +} diff --git a/web/src/components/ui/select.tsx b/web/src/components/ui/select.tsx index e0b1c361e..fe2b71d73 100644 --- a/web/src/components/ui/select.tsx +++ b/web/src/components/ui/select.tsx @@ -186,11 +186,12 @@ export type RAGFlowSelectGroupOptionType = { options: RAGFlowSelectOptionType[]; }; -type RAGFlowSelectProps = Partial & { +export type RAGFlowSelectProps = Partial & { FormControlComponent?: typeof FormControl; options?: (RAGFlowSelectOptionType | RAGFlowSelectGroupOptionType)[]; allowClear?: boolean; placeholder?: React.ReactNode; + contentProps?: React.ComponentPropsWithoutRef; } & SelectPrimitive.SelectProps; /** @@ -220,6 +221,7 @@ export const RAGFlowSelect = forwardRef< options = [], allowClear, placeholder, + contentProps = {}, }, ref, ) { @@ -265,7 +267,7 @@ export const RAGFlowSelect = forwardRef< - + {options.map((o, idx) => { if ('value' in o) { return ( diff --git a/web/src/pages/agent/form/generate-form/index.tsx b/web/src/pages/agent/form/generate-form/index.tsx index 3ad9e7a68..882443135 100644 --- a/web/src/pages/agent/form/generate-form/index.tsx +++ b/web/src/pages/agent/form/generate-form/index.tsx @@ -1,4 +1,4 @@ -import LLMSelect from '@/components/llm-select'; +import { NextLLMSelect } from '@/components/llm-select'; import { MessageHistoryWindowSizeFormField } from '@/components/message-history-window-size-item'; import { PromptEditor } from '@/components/prompt-editor'; import { @@ -33,7 +33,7 @@ const GenerateForm = ({ form }: INextOperatorForm) => { {t('chat.model')} - +