diff --git a/components/progress/Circle.tsx b/components/progress/Circle.tsx index c2265d354..4a055b338 100644 --- a/components/progress/Circle.tsx +++ b/components/progress/Circle.tsx @@ -1,17 +1,12 @@ -import type { CSSProperties, ExtractPropTypes } from 'vue'; +import type { CSSProperties } from 'vue'; import { computed, defineComponent } from 'vue'; import { presetPrimaryColors } from '@ant-design/colors'; import { Circle as VCCircle } from '../vc-progress'; import { getSuccessPercent, validProgress } from './utils'; +import type { ProgressProps } from './props'; import { progressProps } from './props'; -import PropTypes from '../_util/vue-types'; -const circleProps = { - ...progressProps, - prefixCls: PropTypes.string, - // progressStatus: PropTypes.string, -}; -export type CircleProps = Partial>; +export type CircleProps = ProgressProps; function getPercentage({ percent, success, successPercent }: CircleProps) { const realSuccessPercent = validProgress(getSuccessPercent({ success, successPercent })); @@ -19,8 +14,8 @@ function getPercentage({ percent, success, successPercent }: CircleProps) { } export default defineComponent({ - props: progressProps, inheritAttrs: false, + props: progressProps(), setup(props, { slots }) { const gapDeg = computed(() => { // Support gapDeg = 0 when type = 'dashboard' diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index df9bfe42c..db01a2e6c 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -7,7 +7,7 @@ import { progressProps } from './props'; import { getSuccessPercent, validProgress } from './utils'; const lineProps = { - ...progressProps, + ...progressProps(), prefixCls: PropTypes.string, direction: { type: String as PropType, @@ -68,8 +68,8 @@ export const handleGradient = (strokeColor: ProgressGradient, directionConfig: D }; export default defineComponent({ - props: lineProps, name: 'Line', + props: lineProps, setup(props, { slots }) { const backgroundProps = computed(() => { const { strokeColor, direction } = props; diff --git a/components/progress/Steps.tsx b/components/progress/Steps.tsx index e50518bff..6d7543aec 100644 --- a/components/progress/Steps.tsx +++ b/components/progress/Steps.tsx @@ -1,11 +1,12 @@ -import { computed, ExtractPropTypes, PropType, VNodeChild } from 'vue'; +import type { ExtractPropTypes, PropType, VNodeChild } from 'vue'; +import { computed } from 'vue'; import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import type { ProgressSize } from './props'; import { progressProps } from './props'; const stepsProps = { - ...progressProps, + ...progressProps(), steps: PropTypes.number, size: { type: String as PropType, diff --git a/components/progress/progress.tsx b/components/progress/progress.tsx index 668470e9e..aa5feb010 100644 --- a/components/progress/progress.tsx +++ b/components/progress/progress.tsx @@ -15,7 +15,7 @@ import { progressProps, progressStatuses } from './props'; export default defineComponent({ name: 'AProgress', - props: initDefaultProps(progressProps, { + props: initDefaultProps(progressProps(), { type: 'line', percent: 0, showInfo: true, diff --git a/components/progress/props.ts b/components/progress/props.ts index fc038f3f5..fb5c2de10 100644 --- a/components/progress/props.ts +++ b/components/progress/props.ts @@ -17,7 +17,7 @@ export interface SuccessProps { strokeColor?: string; } -export const progressProps = { +export const progressProps = () => ({ prefixCls: PropTypes.string, type: PropTypes.oneOf(ProgressType), percent: PropTypes.number, @@ -41,6 +41,6 @@ export const progressProps = { steps: PropTypes.number, /** @deprecated Use `success` instead */ successPercent: PropTypes.number, -}; +}); -export type ProgressProps = Partial>; +export type ProgressProps = Partial>>; diff --git a/components/vc-progress/src/Circle.tsx b/components/vc-progress/src/Circle.tsx index 3c8ef3dd0..a4aa86ece 100644 --- a/components/vc-progress/src/Circle.tsx +++ b/components/vc-progress/src/Circle.tsx @@ -1,5 +1,6 @@ import { useTransitionDuration, defaultProps } from './common'; -import { propTypes, GapPositionType } from './types'; +import type { GapPositionType } from './types'; +import { propTypes } from './types'; import { computed, defineComponent, ref } from 'vue'; import initDefaultProps from '../../_util/props-util/initDefaultProps'; import { useRef } from '../../_util/hooks/useRef'; diff --git a/v2-doc b/v2-doc index d2c096476..57c08127b 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit d2c096476ee3e8d27fbb9e1cb7933887501b1fab +Subproject commit 57c08127bf0e3e826b03f845df3e1332820964e5