feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等
This commit is contained in:
@@ -25,13 +25,41 @@ import './module-alignment.css';
|
||||
|
||||
// Labels belong to the module; this wrapper only supplies the shared layout.
|
||||
export function ConsoleFilterField({ label, children }) {
|
||||
const id = useId();
|
||||
const generatedId = useId();
|
||||
const isElement = React.isValidElement(children);
|
||||
const isGroup =
|
||||
!isElement ||
|
||||
children.type === React.Fragment ||
|
||||
(typeof children.type === 'string' &&
|
||||
![
|
||||
'input',
|
||||
'select',
|
||||
'textarea',
|
||||
'button',
|
||||
'meter',
|
||||
'output',
|
||||
'progress',
|
||||
].includes(children.type));
|
||||
const id = (isElement && children.props.id) || generatedId;
|
||||
// Composite filters need a group name, not a label pointing at a container.
|
||||
if (isGroup) {
|
||||
return (
|
||||
<div
|
||||
className='console-module-field'
|
||||
role='group'
|
||||
aria-labelledby={generatedId}
|
||||
>
|
||||
<span className='console-module-field-label' id={generatedId}>
|
||||
{label}
|
||||
</span>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className='console-module-field'>
|
||||
<label htmlFor={id}>{label}</label>
|
||||
{React.isValidElement(children)
|
||||
? React.cloneElement(children, { id })
|
||||
: children}
|
||||
{React.cloneElement(children, { id })}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
theme,
|
||||
} from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TableEmpty from '../common/table/TableEmpty';
|
||||
import {
|
||||
ConsoleSearchContext,
|
||||
useConsolePage,
|
||||
@@ -41,13 +42,17 @@ const classes = (base, extra) => [base, extra].filter(Boolean).join(' ');
|
||||
|
||||
export function ConsoleAlert({ className, style, type = 'info', ...props }) {
|
||||
const { token } = theme.useToken();
|
||||
const semantic = type[0].toUpperCase() + type.slice(1);
|
||||
const isSettings = useConsolePage()?.page.key === 'setting';
|
||||
const semantic = isSettings ? 'Info' : type[0].toUpperCase() + type.slice(1);
|
||||
return (
|
||||
<Alert
|
||||
{...props}
|
||||
type={type}
|
||||
showIcon
|
||||
className={classes('console-alert', className)}
|
||||
className={classes(
|
||||
isSettings ? 'console-alert console-alert--settings' : 'console-alert',
|
||||
className,
|
||||
)}
|
||||
style={{
|
||||
...style,
|
||||
marginBlock: style?.marginBlock ?? '0 16px',
|
||||
@@ -56,6 +61,9 @@ export function ConsoleAlert({ className, style, type = 'info', ...props }) {
|
||||
background: token[`color${semantic}Bg`],
|
||||
borderColor: token[`color${semantic}Border`],
|
||||
color: token.colorText,
|
||||
...(isSettings
|
||||
? { '--settings-alert-icon-color': token.colorInfo }
|
||||
: {}),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
@@ -135,15 +143,17 @@ export const ConsoleTable = forwardRef(function ConsoleTable(
|
||||
{ className, scroll, locale, size = 'middle', ...props },
|
||||
ref,
|
||||
) {
|
||||
const isSettings = useConsolePage()?.page.key === 'setting';
|
||||
return (
|
||||
<Table
|
||||
{...props}
|
||||
ref={ref}
|
||||
size={size}
|
||||
size={isSettings ? 'middle' : size}
|
||||
scroll={{ x: 'max-content', ...scroll }}
|
||||
locale={{
|
||||
emptyText: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />,
|
||||
...locale,
|
||||
...(isSettings ? { emptyText: <TableEmpty /> } : {}),
|
||||
}}
|
||||
className={classes('console-table', className)}
|
||||
/>
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
margin-bottom: var(--console-space-2);
|
||||
}
|
||||
.console-page .ant-tabs-tab .lucide,
|
||||
.console-page .ant-btn .lucide {
|
||||
.console-page .ant-btn :is(.lucide, .app-action-icon) {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
@@ -14,12 +14,14 @@
|
||||
}
|
||||
|
||||
.console-page .console-module-filter-grid .ant-form-item-label > label,
|
||||
.console-module-field > label {
|
||||
.console-module-field > label,
|
||||
.console-module-field-label {
|
||||
color: var(--console-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.console-module-field > label {
|
||||
.console-module-field > label,
|
||||
.console-module-field-label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
line-height: 22px;
|
||||
|
||||
Reference in New Issue
Block a user