Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(components): export multiple components props #5353

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/affix/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface AffixState {
}

// Affix
const affixProps = {
export const affixProps = {
/**
* 距离窗口顶部达到指定偏移量后触发
*/
Expand Down
2 changes: 1 addition & 1 deletion components/anchor/AnchorLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classNames from '../_util/classNames';
import useConfigInject from '../_util/hooks/useConfigInject';
import { useInjectAnchor } from './context';

const anchorLinkProps = {
export const anchorLinkProps = {
prefixCls: PropTypes.string,
href: PropTypes.string.def('#'),
title: PropTypes.any,
Expand Down
2 changes: 1 addition & 1 deletion components/auto-complete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function isSelectOptionOrSelectOptGroup(child: any): boolean {
return child?.type?.isSelectOption || child?.type?.isSelectOptGroup;
}

const autoCompleteProps = {
export const autoCompleteProps = {
...omit(selectProps(), ['loading', 'mode', 'optionLabelProp', 'labelInValue']),
dataSource: PropTypes.array,
dropdownMenuStyle: PropTypes.style,
Expand Down
2 changes: 1 addition & 1 deletion components/badge/Ribbon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { defineComponent, computed } from 'vue';
import PropTypes from '../_util/vue-types';
import useConfigInject from '../_util/hooks/useConfigInject';

const ribbonProps = {
export const ribbonProps = {
prefix: PropTypes.string,
color: { type: String as PropType<LiteralUnion<PresetColorType, string>> },
text: PropTypes.any,
Expand Down
2 changes: 1 addition & 1 deletion components/breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Route {
children?: Omit<Route, 'children'>[];
}

const breadcrumbProps = {
export const breadcrumbProps = {
prefixCls: PropTypes.string,
routes: { type: Array as PropType<Route[]> },
params: PropTypes.any,
Expand Down
2 changes: 1 addition & 1 deletion components/breadcrumb/BreadcrumbItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DropDown from '../dropdown/dropdown';
import DownOutlined from '@ant-design/icons-vue/DownOutlined';
import useConfigInject from '../_util/hooks/useConfigInject';

const breadcrumbItemProps = {
export const breadcrumbItemProps = {
prefixCls: PropTypes.string,
href: PropTypes.string,
separator: PropTypes.any,
Expand Down
2 changes: 1 addition & 1 deletion components/breadcrumb/BreadcrumbSeparator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from '../_util/vue-types';
import { flattenChildren } from '../_util/props-util';
import useConfigInject from '../_util/hooks/useConfigInject';

const breadcrumbSeparatorProps = {
export const breadcrumbSeparatorProps = {
prefixCls: PropTypes.string,
};
export type BreadcrumbSeparatorProps = Partial<ExtractPropTypes<typeof breadcrumbSeparatorProps>>;
Expand Down
2 changes: 1 addition & 1 deletion components/button/buttonTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function convertLegacyProps(type?: LegacyButtonType): ButtonProps {
return { type };
}

const buttonProps = () => ({
export const buttonProps = () => ({
prefixCls: PropTypes.string,
type: PropTypes.oneOf(ButtonTypes),
htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'),
Expand Down
2 changes: 1 addition & 1 deletion components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type CardSize = 'default' | 'small';

const { TabPane } = Tabs;

const cardProps = () => ({
export const cardProps = () => ({
prefixCls: PropTypes.string,
title: PropTypes.any,
extra: PropTypes.any,
Expand Down
2 changes: 1 addition & 1 deletion components/descriptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function getRows(children: VNode[], column: number) {
return rows;
}

const descriptionsProps = {
export const descriptionsProps = {
prefixCls: PropTypes.string,
bordered: PropTypes.looseBool,
size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'),
Expand Down
2 changes: 1 addition & 1 deletion components/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface PushState {

const defaultPushState: PushState = { distance: 180 };

const drawerProps = () => ({
export const drawerProps = () => ({
autofocus: PropTypes.looseBool,
closable: PropTypes.looseBool,
closeIcon: PropTypes.any,
Expand Down
2 changes: 1 addition & 1 deletion components/grid/Col.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function parseFlex(flex: FlexType): string {
return flex;
}

const colProps = () => ({
export const colProps = () => ({
span: [String, Number],
order: [String, Number],
offset: [String, Number],
Expand Down
2 changes: 1 addition & 1 deletion components/mentions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const getMentions = (value = '', config: MentionsConfig = {}): MentionsEntity[]
.filter((entity): entity is MentionsEntity => !!entity && !!entity.value);
};

const mentionsProps = {
export const mentionsProps = {
...baseMentionsProps,
loading: PropTypes.looseBool,
onFocus: {
Expand Down
2 changes: 1 addition & 1 deletion components/menu/src/ItemGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from '../../_util/vue-types';
import { useInjectMenu } from './hooks/useMenuContext';
import { useMeasure } from './hooks/useKeyPath';

const menuItemGroupProps = {
export const menuItemGroupProps = {
title: PropTypes.any,
};

Expand Down
2 changes: 1 addition & 1 deletion components/menu/src/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Overflow from '../../vc-overflow';
import devWarning from '../../vc-util/devWarning';

let indexGuid = 0;
const menuItemProps = {
export const menuItemProps = {
id: String,
role: String,
disabled: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion components/menu/src/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import isValid from '../../_util/isValid';

let indexGuid = 0;

const subMenuProps = {
export const subMenuProps = {
icon: PropTypes.any,
title: PropTypes.any,
disabled: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion components/progress/Line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { StringGradients, ProgressGradient } from './props';
import { progressProps } from './props';
import { getSuccessPercent, validProgress } from './utils';

const lineProps = {
export const lineProps = {
...progressProps(),
prefixCls: PropTypes.string,
direction: {
Expand Down
2 changes: 1 addition & 1 deletion components/progress/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from '../_util/vue-types';
import type { ProgressSize } from './props';
import { progressProps } from './props';

const stepsProps = {
export const stepsProps = {
...progressProps(),
steps: PropTypes.number,
size: {
Expand Down
2 changes: 1 addition & 1 deletion components/radio/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type RadioGroupChildOption = {
disabled?: boolean;
};

const radioGroupProps = {
export const radioGroupProps = {
prefixCls: PropTypes.string,
value: PropTypes.any,
size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'),
Expand Down
2 changes: 1 addition & 1 deletion components/space/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const spaceSize = {
middle: 16,
large: 24,
};
const spaceProps = {
export const spaceProps = {
prefixCls: PropTypes.string,
size: {
type: [String, Number, Array] as PropType<SpaceSize | [SpaceSize, SpaceSize]>,
Expand Down
2 changes: 1 addition & 1 deletion components/switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import omit from '../_util/omit';

export const SwitchSizes = tuple('small', 'default');
type CheckedType = boolean | string | number;
const switchProps = {
export const switchProps = {
id: PropTypes.string,
prefixCls: PropTypes.string,
size: PropTypes.oneOf(SwitchSizes),
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/src/TabNavList/OperationNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PropTypes from '../../../_util/vue-types';
import useState from '../../../_util/hooks/useState';
import { EllipsisOutlined } from '@ant-design/icons-vue';

const operationNodeProps = {
export const operationNodeProps = {
prefixCls: { type: String },
id: { type: String },
tabs: { type: Object as PropType<Tab[]> },
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/src/TabNavList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import useRefs from '../../../_util/hooks/useRefs';
import pick from 'lodash-es/pick';

const DEFAULT_SIZE = { width: 0, height: 0, left: 0, top: 0, right: 0 };
const tabNavListProps = () => {
export const tabNavListProps = () => {
return {
id: { type: String },
tabPosition: { type: String as PropType<TabPosition> },
Expand Down
2 changes: 1 addition & 1 deletion components/tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)?$`);
const PresetStatusColorRegex = new RegExp(`^(${PresetStatusColorTypes.join('|')})$`);

const tagProps = {
export const tagProps = {
prefixCls: PropTypes.string,
color: {
type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>,
Expand Down
2 changes: 1 addition & 1 deletion components/time-picker/time-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface TimePickerLocale {
rangePlaceholder?: [string, string];
}

const timePickerProps = {
export const timePickerProps = {
format: String,
showNow: { type: Boolean, default: undefined },
showHour: { type: Boolean, default: undefined },
Expand Down
2 changes: 1 addition & 1 deletion components/tree/DirectoryTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { filterEmpty } from '../_util/props-util';

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

const directoryTreeProps = {
export const directoryTreeProps = {
...treeProps(),
expandAction: { type: [Boolean, String] as PropType<ExpandAction> },
};
Expand Down
2 changes: 1 addition & 1 deletion components/vc-align/Align.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface AlignProps {
disabled?: boolean;
}

const alignProps = {
export const alignProps = {
align: Object as PropType<AlignType>,
target: [Object, Function] as PropType<TargetType>,
onAlign: Function as PropType<OnAlign>,
Expand Down
2 changes: 1 addition & 1 deletion components/vc-checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types';
import { initDefaultProps } from '../_util/props-util';

const checkboxProps = {
export const checkboxProps = {
prefixCls: String,
name: String,
id: String,
Expand Down