This commit is contained in:
lyf 2024-09-25 14:41:41 +08:00
parent a6b920d9af
commit 10d472e79e
3 changed files with 11 additions and 18 deletions

View File

@ -0,0 +1,7 @@
.select-compress-model {
width: 60%;
select {
max-width: 100%;
white-space: normal;
}
}

View File

@ -6,6 +6,7 @@ import { InputRange } from "./input-range";
import { ListItem, Select } from "./ui-lib";
import { useAllModels } from "../utils/hooks";
import { groupBy } from "lodash-es";
import styles from "./model-config.module.scss";
export function ModelConfigList(props: {
modelConfig: ModelConfig;
@ -242,8 +243,7 @@ export function ModelConfigList(props: {
subTitle={Locale.Settings.CompressModel.SubTitle}
>
<Select
withiconstyle={{ width: "60%" }}
iconselectstyles={{ maxWidth: "100%", whiteSpace: "normal" }}
className={styles["select-compress-model"]}
aria-label={Locale.Settings.CompressModel.Title}
value={compressModelValue}
onChange={(e) => {

View File

@ -294,32 +294,18 @@ export function Select(
props: React.DetailedHTMLProps<
React.SelectHTMLAttributes<HTMLSelectElement> & {
align?: "left" | "center";
withiconstyle?: CSSProperties;
iconselectstyles?: CSSProperties;
},
HTMLSelectElement
>,
) {
const {
className,
children,
align,
withiconstyle,
iconselectstyles,
...otherProps
} = props;
const { className, children, align, ...otherProps } = props;
return (
<div
className={`${styles["select-with-icon"]} ${
align === "left" ? styles["left-align-option"] : ""
} ${className}`}
style={withiconstyle}
>
<select
className={styles["select-with-icon-select"]}
style={iconselectstyles}
{...otherProps}
>
<select className={styles["select-with-icon-select"]} {...otherProps}>
{children}
</select>
<DownIcon className={styles["select-with-icon-icon"]} />