Feat: Add NextLLMSelect with shadcn-ui. #3221 (#5542)

### What problem does this PR solve?
Feat: Add NextLLMSelect with shadcn-ui. #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-03-03 13:54:06 +08:00
committed by GitHub
parent 7a81fa00e9
commit 5d89a8010b
3 changed files with 42 additions and 8 deletions

View File

@ -186,11 +186,12 @@ export type RAGFlowSelectGroupOptionType = {
options: RAGFlowSelectOptionType[];
};
type RAGFlowSelectProps = Partial<ControllerRenderProps> & {
export type RAGFlowSelectProps = Partial<ControllerRenderProps> & {
FormControlComponent?: typeof FormControl;
options?: (RAGFlowSelectOptionType | RAGFlowSelectGroupOptionType)[];
allowClear?: boolean;
placeholder?: React.ReactNode;
contentProps?: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
} & SelectPrimitive.SelectProps;
/**
@ -220,6 +221,7 @@ export const RAGFlowSelect = forwardRef<
options = [],
allowClear,
placeholder,
contentProps = {},
},
ref,
) {
@ -265,7 +267,7 @@ export const RAGFlowSelect = forwardRef<
<SelectValue placeholder={placeholder} />
</SelectTrigger>
</FormControlWidget>
<SelectContent>
<SelectContent {...contentProps}>
{options.map((o, idx) => {
if ('value' in o) {
return (