type: optimization CP props type (#47621)

This commit is contained in:
lijianan 2024-02-28 11:53:01 +08:00 committed by GitHub
parent 271daafa39
commit 5276de61f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 18 deletions

View File

@ -112,10 +112,7 @@ export type NotificationConfig = ComponentStyleConfig & Pick<ArgsProps, 'closeIc
export type TagConfig = ComponentStyleConfig & Pick<TagProps, 'closeIcon'>;
export interface CardConfig extends ComponentStyleConfig {
classNames?: CardProps['classNames'];
styles: CardProps['styles'];
}
export type CardConfig = ComponentStyleConfig & Pick<CardProps, 'classNames' | 'styles'>;
export type DrawerConfig = ComponentStyleConfig &
Pick<DrawerProps, 'classNames' | 'styles' | 'closeIcon'>;
@ -124,6 +121,18 @@ export type FlexConfig = ComponentStyleConfig & Pick<FlexProps, 'vertical'>;
export type TransferConfig = ComponentStyleConfig & Pick<TransferProps, 'selectionsIcon'>;
export type FormConfig = ComponentStyleConfig &
Pick<FormProps, 'requiredMark' | 'colon' | 'scrollToFirstError' | 'validateMessages'>;
export type PaginationConfig = ComponentStyleConfig & Pick<PaginationProps, 'showSizeChanger'>;
export type SelectConfig = ComponentStyleConfig & Pick<SelectProps, 'showSearch'>;
export type SpaceConfig = Pick<
SpaceProps,
'size' | 'className' | 'classNames' | 'style' | 'styles'
>;
export type PopupOverflow = 'viewport' | 'scroll';
export interface WaveConfig {
@ -142,17 +151,16 @@ export interface ConfigConsumerProps {
autoInsertSpaceInButton?: boolean;
input?: InputConfig;
textArea?: TextAreaConfig;
pagination?: ComponentStyleConfig & Pick<PaginationProps, 'showSizeChanger'>;
pagination?: PaginationConfig;
locale?: Locale;
direction?: DirectionType;
space?: Pick<SpaceProps, 'size' | 'className' | 'classNames' | 'style' | 'styles'>;
space?: SpaceConfig;
virtual?: boolean;
popupMatchSelectWidth?: boolean;
popupOverflow?: PopupOverflow;
form?: ComponentStyleConfig &
Pick<FormProps, 'requiredMark' | 'colon' | 'scrollToFirstError' | 'validateMessages'>;
form?: FormConfig;
theme?: ThemeConfig;
select?: ComponentStyleConfig & Pick<SelectProps, 'showSearch'>;
select?: SelectConfig;
alert?: AlertConfig;
anchor?: ComponentStyleConfig;
button?: ButtonConfig;

View File

@ -6,16 +6,12 @@ import { merge } from 'rc-util/lib/utils/set';
import warning, { WarningContext } from '../_util/warning';
import type { WarningContextProps } from '../_util/warning';
import type { FormProps } from '../form/Form';
import ValidateMessagesContext from '../form/validateMessagesContext';
import type { Locale } from '../locale';
import LocaleProvider, { ANT_MARK } from '../locale';
import type { LocaleContextProps } from '../locale/context';
import LocaleContext from '../locale/context';
import defaultLocale from '../locale/en_US';
import type { PaginationProps } from '../pagination';
import type { SelectProps } from '../select';
import type { SpaceProps } from '../space';
import { defaultTheme, DesignTokenContext } from '../theme/context';
import defaultSeedToken from '../theme/themes/seed';
import type {
@ -30,12 +26,16 @@ import type {
DirectionType,
DrawerConfig,
FlexConfig,
FormConfig,
ImageConfig,
InputConfig,
MenuConfig,
ModalConfig,
NotificationConfig,
PaginationConfig,
PopupOverflow,
SelectConfig,
SpaceConfig,
TableConfig,
TabsConfig,
TagConfig,
@ -122,17 +122,16 @@ export interface ConfigProviderProps {
renderEmpty?: RenderEmptyHandler;
csp?: CSPConfig;
autoInsertSpaceInButton?: boolean;
form?: ComponentStyleConfig &
Pick<FormProps, 'requiredMark' | 'colon' | 'scrollToFirstError' | 'validateMessages'>;
form?: FormConfig;
input?: InputConfig;
textArea?: TextAreaConfig;
select?: ComponentStyleConfig & Pick<SelectProps, 'showSearch'>;
pagination?: ComponentStyleConfig & Pick<PaginationProps, 'showSizeChanger'>;
select?: SelectConfig;
pagination?: PaginationConfig;
locale?: Locale;
componentSize?: SizeType;
componentDisabled?: boolean;
direction?: DirectionType;
space?: Pick<SpaceProps, 'size' | 'className' | 'classNames' | 'style' | 'styles'>;
space?: SpaceConfig;
virtual?: boolean;
/** @deprecated Please use `popupMatchSelectWidth` instead */
dropdownMatchSelectWidth?: boolean;