mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
fix: deps and TypeScript types (#31519)
* fix tsc errors * fix tsc errors
This commit is contained in:
parent
c7e0cda393
commit
a9a329d37c
@ -62,11 +62,13 @@ const Collapse: CollapseInterface = props => {
|
||||
|
||||
const renderExpandIcon = (panelProps: PanelProps = {}) => {
|
||||
const { expandIcon } = props;
|
||||
const icon = (expandIcon ? (
|
||||
expandIcon(panelProps)
|
||||
) : (
|
||||
<RightOutlined rotate={panelProps.isActive ? 90 : undefined} />
|
||||
)) as React.ReactNode;
|
||||
const icon = (
|
||||
expandIcon ? (
|
||||
expandIcon(panelProps)
|
||||
) : (
|
||||
<RightOutlined rotate={panelProps.isActive ? 90 : undefined} />
|
||||
)
|
||||
) as React.ReactNode;
|
||||
|
||||
return cloneElement(icon, () => ({
|
||||
className: classNames((icon as any).props.className, `${prefixCls}-arrow`),
|
||||
@ -110,7 +112,6 @@ const Collapse: CollapseInterface = props => {
|
||||
<RcCollapse
|
||||
openMotion={openMotion}
|
||||
{...props}
|
||||
bordered={bordered}
|
||||
expandIcon={renderExpandIcon}
|
||||
prefixCls={prefixCls}
|
||||
className={collapseClassName}
|
||||
|
@ -72,7 +72,7 @@ export interface ModalProps {
|
||||
maskTransitionName?: string;
|
||||
transitionName?: string;
|
||||
className?: string;
|
||||
getContainer?: string | HTMLElement | getContainerFunc | false | null;
|
||||
getContainer?: string | HTMLElement | getContainerFunc | false;
|
||||
zIndex?: number;
|
||||
bodyStyle?: React.CSSProperties;
|
||||
maskStyle?: React.CSSProperties;
|
||||
@ -114,7 +114,7 @@ export interface ModalFuncProps {
|
||||
maskStyle?: React.CSSProperties;
|
||||
type?: 'info' | 'success' | 'error' | 'warn' | 'warning' | 'confirm';
|
||||
keyboard?: boolean;
|
||||
getContainer?: string | HTMLElement | getContainerFunc | false | null;
|
||||
getContainer?: string | HTMLElement | getContainerFunc | false;
|
||||
autoFocusButton?: null | 'ok' | 'cancel';
|
||||
transitionName?: string;
|
||||
maskTransitionName?: string;
|
||||
@ -136,9 +136,11 @@ interface ModalInterface extends React.FC<ModalProps> {
|
||||
}
|
||||
|
||||
const Modal: ModalInterface = props => {
|
||||
const { getPopupContainer: getContextPopupContainer, getPrefixCls, direction } = React.useContext(
|
||||
ConfigContext,
|
||||
);
|
||||
const {
|
||||
getPopupContainer: getContextPopupContainer,
|
||||
getPrefixCls,
|
||||
direction,
|
||||
} = React.useContext(ConfigContext);
|
||||
|
||||
const handleCancel = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
const { onCancel } = props;
|
||||
@ -203,7 +205,9 @@ const Modal: ModalInterface = props => {
|
||||
return (
|
||||
<Dialog
|
||||
{...restProps}
|
||||
getContainer={getContainer === undefined ? getContextPopupContainer : getContainer}
|
||||
getContainer={
|
||||
getContainer === undefined ? (getContextPopupContainer as getContainerFunc) : getContainer
|
||||
}
|
||||
prefixCls={prefixCls}
|
||||
wrapClassName={wrapClassNameExtended}
|
||||
footer={footer === undefined ? defaultFooter : footer}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import RcSteps from 'rc-steps';
|
||||
import type { ProgressDotRender } from 'rc-steps/lib/Steps';
|
||||
import CheckOutlined from '@ant-design/icons/CheckOutlined';
|
||||
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
||||
import classNames from 'classnames';
|
||||
@ -17,7 +18,7 @@ export interface StepsProps {
|
||||
initial?: number;
|
||||
labelPlacement?: 'horizontal' | 'vertical';
|
||||
prefixCls?: string;
|
||||
progressDot?: boolean | Function;
|
||||
progressDot?: boolean | ProgressDotRender;
|
||||
responsive?: boolean;
|
||||
size?: 'default' | 'small';
|
||||
status?: 'wait' | 'process' | 'finish' | 'error';
|
||||
@ -39,7 +40,7 @@ export interface StepProps {
|
||||
}
|
||||
|
||||
interface StepsType extends React.FC<StepsProps> {
|
||||
Step: React.ClassicComponentClass<StepProps>;
|
||||
Step: typeof RcSteps.Step;
|
||||
}
|
||||
|
||||
const Steps: StepsType = props => {
|
||||
@ -47,10 +48,10 @@ const Steps: StepsType = props => {
|
||||
const { xs } = useBreakpoint();
|
||||
const { getPrefixCls, direction: rtlDirection } = React.useContext(ConfigContext);
|
||||
|
||||
const getDirection = React.useCallback(() => (responsive && xs ? 'vertical' : direction), [
|
||||
xs,
|
||||
direction,
|
||||
]);
|
||||
const getDirection = React.useCallback(
|
||||
() => (responsive && xs ? 'vertical' : direction),
|
||||
[xs, direction],
|
||||
);
|
||||
|
||||
const prefixCls = getPrefixCls('steps', props.prefixCls);
|
||||
const iconPrefix = getPrefixCls('', props.iconPrefix);
|
||||
|
@ -59,7 +59,7 @@ const DirectoryTree: React.ForwardRefRenderFunction<RcTree, DirectoryTreeProps>
|
||||
initExpandedKeys = Object.keys(keyEntities);
|
||||
} else if (defaultExpandParent) {
|
||||
initExpandedKeys = conductExpandParent(
|
||||
props.expandedKeys || defaultExpandedKeys,
|
||||
props.expandedKeys || defaultExpandedKeys || [],
|
||||
keyEntities,
|
||||
);
|
||||
} else {
|
||||
|
@ -120,7 +120,7 @@
|
||||
"rc-cascader": "~1.4.0",
|
||||
"rc-checkbox": "~2.3.0",
|
||||
"rc-collapse": "~3.1.0",
|
||||
"rc-dialog": "~8.5.1",
|
||||
"rc-dialog": "~8.6.0",
|
||||
"rc-drawer": "~4.3.0",
|
||||
"rc-dropdown": "~3.2.0",
|
||||
"rc-field-form": "~1.20.0",
|
||||
@ -236,8 +236,6 @@
|
||||
"pretty-quick": "^3.0.0",
|
||||
"querystring": "^0.2.0",
|
||||
"rc-footer": "^0.6.6",
|
||||
"rc-queue-anim": "^1.6.12",
|
||||
"rc-scroll-anim": "^2.5.8",
|
||||
"rc-tween-one": "^2.4.1",
|
||||
"rc-virtual-list": "^3.2.4",
|
||||
"react": "^17.0.1",
|
||||
|
20
typings/custom-typings.d.ts
vendored
20
typings/custom-typings.d.ts
vendored
@ -18,32 +18,12 @@ declare module 'jsonml.js/*';
|
||||
|
||||
declare module 'rc-pagination/*';
|
||||
|
||||
declare module 'rc-animate*';
|
||||
|
||||
declare module 'rc-util*';
|
||||
|
||||
declare module '@ant-design/css-animation*';
|
||||
|
||||
declare module 'rc-checkbox';
|
||||
|
||||
declare module 'rc-radio';
|
||||
|
||||
declare module 'rc-editor-mention';
|
||||
|
||||
declare module 'rc-tabs*';
|
||||
|
||||
declare module 'rc-tree/lib/util';
|
||||
|
||||
declare module 'rc-collapse';
|
||||
|
||||
declare module 'rc-dialog';
|
||||
|
||||
declare module 'rc-rate';
|
||||
|
||||
declare module 'rc-queue-anim';
|
||||
|
||||
declare module 'rc-steps';
|
||||
|
||||
declare module 'rc-switch';
|
||||
|
||||
declare module '*.json' {
|
||||
|
Loading…
Reference in New Issue
Block a user