Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(design): add class name as poperty of select list (#2788)

VicKunf78b538f0f78
diff --git a/packages/design/src/components/select-list/SelectList.tsx b/packages/design/src/components/select-list/SelectList.tsx
index be45c53691..07e2bef795 100644
--- a/packages/design/src/components/select-list/SelectList.tsx
+++ b/packages/design/src/components/select-list/SelectList.tsx
@@ -48,10 +48,20 @@ export interface ISelectListProps {
onChange: (value: string | string[] | undefined) => void;
multiple?: boolean;
+
+ /**
+ * The className each option
+ */
+ optionClassName?: string;
+
+ /**
+ * The className of the wrapper
+ */
+ className?: string;
}
export function SelectList(props: ISelectListProps) {
- const { value: _value, options = [], hideCheckMark = false, onChange, multiple } = props;
+ const { value: _value, options = [], hideCheckMark = false, onChange, multiple, className, optionClassName } = props;
const value = Array.isArray(_value) ? _value : [_value];
@@ -74,13 +84,13 @@ export function SelectList(props: ISelectListProps) {
}
return (
- <ul className={styles.selectList}>
+ <ul className={clsx(styles.selectList, className)}>
{options.map((option, index) => {
const checked = value.indexOf(option.value) > -1;
return (
<li
key={index}
- className={clsx(styles.selectListItem, { [styles.selectListItemSelect]: checked })}
+ className={clsx(styles.selectListItem, optionClassName, { [styles.selectListItemSelect]: checked })}
>
<a onClick={() => handleSelect(option.value)}>
{!hideCheckMark && (