chore(web): 前端格式 - 统一十个文件的 Prettier 格式 (#561)
Original-Commit: ade0049c0b80733dfea563bac2aae9260e373cf0 style(web): 前端格式 - 补 Prettier 格式(10 个文件) 这 10 个文件(3 个组件/样式与设置页、4 个 admin 主题与控件、1 个 lib、2 个测试) 用仓库自带 Prettier 检查会 warn,`bun scripts/check-changed-formatting.mjs` 在改动到它们时 会直接判红。本次只做格式化,不改任何行为:合并的 CSS 声明、去掉多余换行与括号、 统一链式调用换行。 验证:prettier --write 后 `check-changed-formatting.mjs` 通过、typecheck 通过、 1940 条前端测试全过、eslint 通过。
This commit is contained in:
@@ -22,14 +22,7 @@ export function AdminSwitch({
|
||||
className?: string;
|
||||
"aria-label"?: string;
|
||||
}) {
|
||||
return (
|
||||
<AntSwitch
|
||||
{...props}
|
||||
size={size === "sm" ? "small" : "default"}
|
||||
className={cn("admin-switch", className)}
|
||||
onChange={(checked) => props.onChange?.(checked)}
|
||||
/>
|
||||
);
|
||||
return <AntSwitch {...props} size={size === "sm" ? "small" : "default"} className={cn("admin-switch", className)} onChange={(checked) => props.onChange?.(checked)} />;
|
||||
}
|
||||
|
||||
export function Switch(props: Parameters<typeof AdminSwitch>[0]) {
|
||||
@@ -53,15 +46,7 @@ export function AdminSelect<V extends string = string>({
|
||||
ariaLabel?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<AntSelect
|
||||
{...props}
|
||||
size={size === "sm" ? "small" : "middle"}
|
||||
className={cn("admin-select", className)}
|
||||
aria-label={ariaLabel}
|
||||
onChange={(value) => onChange?.(value as V)}
|
||||
/>
|
||||
);
|
||||
return <AntSelect {...props} size={size === "sm" ? "small" : "middle"} className={cn("admin-select", className)} aria-label={ariaLabel} onChange={(value) => onChange?.(value as V)} />;
|
||||
}
|
||||
|
||||
export function Select<V extends string = string>(props: Parameters<typeof AdminSelect<V>>[0]) {
|
||||
@@ -143,15 +128,7 @@ export function AdminSegmented<V extends string = string>({
|
||||
ariaLabel?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<Segmented
|
||||
className={cn("admin-segmented", className)}
|
||||
value={value}
|
||||
options={options.map((option) => ({ ...option, label: option.label ?? option.value }))}
|
||||
onChange={(next) => onChange?.(String(next) as V)}
|
||||
aria-label={ariaLabel}
|
||||
/>
|
||||
);
|
||||
return <Segmented className={cn("admin-segmented", className)} value={value} options={options.map((option) => ({ ...option, label: option.label ?? option.value }))} onChange={(next) => onChange?.(String(next) as V)} aria-label={ariaLabel} />;
|
||||
}
|
||||
|
||||
export function SegmentedControl<V extends string = string>(props: Parameters<typeof AdminSegmented<V>>[0]) {
|
||||
|
||||
Reference in New Issue
Block a user