feat(components): export multiple components props (#5353)

pull/5361/head
bqy_fe 2022-03-18 09:30:37 +08:00 committed by GitHub
parent a2ecd5f48e
commit 120980cb5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 28 additions and 28 deletions

View File

@ -41,7 +41,7 @@ export interface AffixState {
}
// Affix
const affixProps = {
export const affixProps = {
/**
* 距离窗口顶部达到指定偏移量后触发
*/

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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>>;

View File

@ -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'),

View File

@ -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,

View File

@ -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'),

View File

@ -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,

View File

@ -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],

View File

@ -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: {

View File

@ -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,
};

View File

@ -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,

View File

@ -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,

View File

@ -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: {

View File

@ -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: {

View File

@ -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'),

View File

@ -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]>,

View File

@ -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),

View File

@ -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[]> },

View File

@ -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> },

View File

@ -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>>,

View File

@ -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 },

View File

@ -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> },
};

View File

@ -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>,

View File

@ -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,