Skip to content

Commit 120980c

Browse files
authored
feat(components): export multiple components props (#5353)
1 parent a2ecd5f commit 120980c

File tree

28 files changed

+28
-28
lines changed

28 files changed

+28
-28
lines changed

components/affix/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface AffixState {
4141
}
4242

4343
// Affix
44-
const affixProps = {
44+
export const affixProps = {
4545
/**
4646
* 距离窗口顶部达到指定偏移量后触发
4747
*/

components/anchor/AnchorLink.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import classNames from '../_util/classNames';
66
import useConfigInject from '../_util/hooks/useConfigInject';
77
import { useInjectAnchor } from './context';
88

9-
const anchorLinkProps = {
9+
export const anchorLinkProps = {
1010
prefixCls: PropTypes.string,
1111
href: PropTypes.string.def('#'),
1212
title: PropTypes.any,

components/auto-complete/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function isSelectOptionOrSelectOptGroup(child: any): boolean {
1313
return child?.type?.isSelectOption || child?.type?.isSelectOptGroup;
1414
}
1515

16-
const autoCompleteProps = {
16+
export const autoCompleteProps = {
1717
...omit(selectProps(), ['loading', 'mode', 'optionLabelProp', 'labelInValue']),
1818
dataSource: PropTypes.array,
1919
dropdownMenuStyle: PropTypes.style,

components/badge/Ribbon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { defineComponent, computed } from 'vue';
77
import PropTypes from '../_util/vue-types';
88
import useConfigInject from '../_util/hooks/useConfigInject';
99

10-
const ribbonProps = {
10+
export const ribbonProps = {
1111
prefix: PropTypes.string,
1212
color: { type: String as PropType<LiteralUnion<PresetColorType, string>> },
1313
text: PropTypes.any,

components/breadcrumb/Breadcrumb.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface Route {
1414
children?: Omit<Route, 'children'>[];
1515
}
1616

17-
const breadcrumbProps = {
17+
export const breadcrumbProps = {
1818
prefixCls: PropTypes.string,
1919
routes: { type: Array as PropType<Route[]> },
2020
params: PropTypes.any,

components/breadcrumb/BreadcrumbItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import DropDown from '../dropdown/dropdown';
66
import DownOutlined from '@ant-design/icons-vue/DownOutlined';
77
import useConfigInject from '../_util/hooks/useConfigInject';
88

9-
const breadcrumbItemProps = {
9+
export const breadcrumbItemProps = {
1010
prefixCls: PropTypes.string,
1111
href: PropTypes.string,
1212
separator: PropTypes.any,

components/breadcrumb/BreadcrumbSeparator.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PropTypes from '../_util/vue-types';
44
import { flattenChildren } from '../_util/props-util';
55
import useConfigInject from '../_util/hooks/useConfigInject';
66

7-
const breadcrumbSeparatorProps = {
7+
export const breadcrumbSeparatorProps = {
88
prefixCls: PropTypes.string,
99
};
1010
export type BreadcrumbSeparatorProps = Partial<ExtractPropTypes<typeof breadcrumbSeparatorProps>>;

components/button/buttonTypes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function convertLegacyProps(type?: LegacyButtonType): ButtonProps {
2020
return { type };
2121
}
2222

23-
const buttonProps = () => ({
23+
export const buttonProps = () => ({
2424
prefixCls: PropTypes.string,
2525
type: PropTypes.oneOf(ButtonTypes),
2626
htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'),

components/card/Card.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type CardSize = 'default' | 'small';
2323

2424
const { TabPane } = Tabs;
2525

26-
const cardProps = () => ({
26+
export const cardProps = () => ({
2727
prefixCls: PropTypes.string,
2828
title: PropTypes.any,
2929
extra: PropTypes.any,

components/descriptions/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function getRows(children: VNode[], column: number) {
128128
return rows;
129129
}
130130

131-
const descriptionsProps = {
131+
export const descriptionsProps = {
132132
prefixCls: PropTypes.string,
133133
bordered: PropTypes.looseBool,
134134
size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'),

components/drawer/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface PushState {
3434

3535
const defaultPushState: PushState = { distance: 180 };
3636

37-
const drawerProps = () => ({
37+
export const drawerProps = () => ({
3838
autofocus: PropTypes.looseBool,
3939
closable: PropTypes.looseBool,
4040
closeIcon: PropTypes.any,

components/grid/Col.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function parseFlex(flex: FlexType): string {
2828
return flex;
2929
}
3030

31-
const colProps = () => ({
31+
export const colProps = () => ({
3232
span: [String, Number],
3333
order: [String, Number],
3434
offset: [String, Number],

components/mentions/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const getMentions = (value = '', config: MentionsConfig = {}): MentionsEntity[]
5858
.filter((entity): entity is MentionsEntity => !!entity && !!entity.value);
5959
};
6060

61-
const mentionsProps = {
61+
export const mentionsProps = {
6262
...baseMentionsProps,
6363
loading: PropTypes.looseBool,
6464
onFocus: {

components/menu/src/ItemGroup.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PropTypes from '../../_util/vue-types';
55
import { useInjectMenu } from './hooks/useMenuContext';
66
import { useMeasure } from './hooks/useKeyPath';
77

8-
const menuItemGroupProps = {
8+
export const menuItemGroupProps = {
99
title: PropTypes.any,
1010
};
1111

components/menu/src/MenuItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Overflow from '../../vc-overflow';
1313
import devWarning from '../../vc-util/devWarning';
1414

1515
let indexGuid = 0;
16-
const menuItemProps = {
16+
export const menuItemProps = {
1717
id: String,
1818
role: String,
1919
disabled: Boolean,

components/menu/src/SubMenu.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import isValid from '../../_util/isValid';
2222

2323
let indexGuid = 0;
2424

25-
const subMenuProps = {
25+
export const subMenuProps = {
2626
icon: PropTypes.any,
2727
title: PropTypes.any,
2828
disabled: Boolean,

components/progress/Line.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { StringGradients, ProgressGradient } from './props';
77
import { progressProps } from './props';
88
import { getSuccessPercent, validProgress } from './utils';
99

10-
const lineProps = {
10+
export const lineProps = {
1111
...progressProps(),
1212
prefixCls: PropTypes.string,
1313
direction: {

components/progress/Steps.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PropTypes from '../_util/vue-types';
55
import type { ProgressSize } from './props';
66
import { progressProps } from './props';
77

8-
const stepsProps = {
8+
export const stepsProps = {
99
...progressProps(),
1010
steps: PropTypes.number,
1111
size: {

components/radio/Group.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type RadioGroupChildOption = {
2222
disabled?: boolean;
2323
};
2424

25-
const radioGroupProps = {
25+
export const radioGroupProps = {
2626
prefixCls: PropTypes.string,
2727
value: PropTypes.any,
2828
size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'),

components/space/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const spaceSize = {
1414
middle: 16,
1515
large: 24,
1616
};
17-
const spaceProps = {
17+
export const spaceProps = {
1818
prefixCls: PropTypes.string,
1919
size: {
2020
type: [String, Number, Array] as PropType<SpaceSize | [SpaceSize, SpaceSize]>,

components/switch/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import omit from '../_util/omit';
1313

1414
export const SwitchSizes = tuple('small', 'default');
1515
type CheckedType = boolean | string | number;
16-
const switchProps = {
16+
export const switchProps = {
1717
id: PropTypes.string,
1818
prefixCls: PropTypes.string,
1919
size: PropTypes.oneOf(SwitchSizes),

components/tabs/src/TabNavList/OperationNode.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import PropTypes from '../../../_util/vue-types';
1111
import useState from '../../../_util/hooks/useState';
1212
import { EllipsisOutlined } from '@ant-design/icons-vue';
1313

14-
const operationNodeProps = {
14+
export const operationNodeProps = {
1515
prefixCls: { type: String },
1616
id: { type: String },
1717
tabs: { type: Object as PropType<Tab[]> },

components/tabs/src/TabNavList/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import useRefs from '../../../_util/hooks/useRefs';
3030
import pick from 'lodash-es/pick';
3131

3232
const DEFAULT_SIZE = { width: 0, height: 0, left: 0, top: 0, right: 0 };
33-
const tabNavListProps = () => {
33+
export const tabNavListProps = () => {
3434
return {
3535
id: { type: String },
3636
tabPosition: { type: String as PropType<TabPosition> },

components/tag/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
1313
const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)?$`);
1414
const PresetStatusColorRegex = new RegExp(`^(${PresetStatusColorTypes.join('|')})$`);
1515

16-
const tagProps = {
16+
export const tagProps = {
1717
prefixCls: PropTypes.string,
1818
color: {
1919
type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>,

components/time-picker/time-picker.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface TimePickerLocale {
1919
rangePlaceholder?: [string, string];
2020
}
2121

22-
const timePickerProps = {
22+
export const timePickerProps = {
2323
format: String,
2424
showNow: { type: Boolean, default: undefined },
2525
showHour: { type: Boolean, default: undefined },

components/tree/DirectoryTree.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { filterEmpty } from '../_util/props-util';
2121

2222
export type ExpandAction = false | 'click' | 'doubleclick' | 'dblclick';
2323

24-
const directoryTreeProps = {
24+
export const directoryTreeProps = {
2525
...treeProps(),
2626
expandAction: { type: [Boolean, String] as PropType<ExpandAction> },
2727
};

components/vc-align/Align.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface AlignProps {
3030
disabled?: boolean;
3131
}
3232

33-
const alignProps = {
33+
export const alignProps = {
3434
align: Object as PropType<AlignType>,
3535
target: [Object, Function] as PropType<TargetType>,
3636
onAlign: Function as PropType<OnAlign>,

components/vc-checkbox/Checkbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import classNames from '../_util/classNames';
55
import PropTypes from '../_util/vue-types';
66
import { initDefaultProps } from '../_util/props-util';
77

8-
const checkboxProps = {
8+
export const checkboxProps = {
99
prefixCls: String,
1010
name: String,
1111
id: String,

0 commit comments

Comments
 (0)