diff --git a/src/components/OptionEditor.tsx b/src/components/OptionEditor.tsx index 9515929..53463d4 100644 --- a/src/components/OptionEditor.tsx +++ b/src/components/OptionEditor.tsx @@ -65,7 +65,7 @@ function OptionLabel({ }) { return (
- + {icon && } {label}
); @@ -198,11 +198,13 @@ function InputField({
- + {input.icon && ( + + )} {inputLabel} {inputDescription && ( @@ -405,6 +407,7 @@ export function OptionEditor({ className="flex-1" value={selectedCaseName} disabled={disabled} + basePath={basePath} options={optionDef.cases.map((caseItem) => { // 对于 MXU 内置选项,使用 t() 翻译;否则使用 resolveI18nText const label = isMxuOption @@ -413,6 +416,7 @@ export function OptionEditor({ return { value: caseItem.name, label, + icon: caseItem.icon, }; })} onChange={(next) => { @@ -451,9 +455,10 @@ export function OptionEditor({ interface OptionSelectDropdownProps { value: string; - options: { value: string; label: string }[]; + options: { value: string; label: string; icon?: string }[]; disabled?: boolean; className?: string; + basePath: string; onChange: (value: string) => void; } @@ -462,6 +467,7 @@ function OptionSelectDropdown({ options, disabled = false, className, + basePath, onChange, }: OptionSelectDropdownProps) { const triggerId = useId(); @@ -580,7 +586,10 @@ function OptionSelectDropdown({ aria-expanded={open} aria-controls={listboxId} > - {selectedOption?.label} + + {selectedOption?.icon && } + {selectedOption?.label} + @@ -620,7 +629,10 @@ function OptionSelectDropdown({ role="option" aria-selected={isSelected} > - {opt.label} + + {opt.icon && } + {opt.label} + {isSelected && } ); @@ -637,6 +649,7 @@ function OptionSelectComboBox({ options, disabled = false, className, + basePath, onChange, }: OptionSelectDropdownProps) { const { t } = useTranslation(); @@ -777,7 +790,10 @@ function OptionSelectComboBox({ aria-expanded={open} aria-controls={listboxId} > - {selectedOption?.label} + + {selectedOption?.icon && } + {selectedOption?.label} + @@ -842,7 +858,10 @@ function OptionSelectComboBox({ role="option" aria-selected={isSelected} > - {opt.label} + + {opt.icon && } + {opt.label} + {isSelected && } );