feat: support vite-plugin-components
parent
22141e74de
commit
fdecafbbb3
|
@ -0,0 +1,14 @@
|
||||||
|
import { FunctionalComponent } from 'vue';
|
||||||
|
import { OptionGroupData } from '../vc-select/interface';
|
||||||
|
|
||||||
|
export type OptGroupProps = Omit<OptionGroupData, 'options'>;
|
||||||
|
|
||||||
|
export interface OptionGroupFC extends FunctionalComponent<OptGroupProps> {
|
||||||
|
/** Legacy for check if is a Option Group */
|
||||||
|
isSelectOptGroup: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const OptGroup: OptionGroupFC = () => null;
|
||||||
|
OptGroup.isSelectOptGroup = true;
|
||||||
|
OptGroup.displayName = 'AAutoCompleteOptGroup';
|
||||||
|
export default OptGroup;
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { FunctionalComponent } from 'vue';
|
||||||
|
import { OptionCoreData } from '../vc-select/interface';
|
||||||
|
|
||||||
|
export interface OptionProps extends Omit<OptionCoreData, 'label'> {
|
||||||
|
/** Save for customize data */
|
||||||
|
[prop: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OptionFC extends FunctionalComponent<OptionProps> {
|
||||||
|
/** Legacy for check if is a Option Group */
|
||||||
|
isSelectOption: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Option: OptionFC = () => null;
|
||||||
|
Option.isSelectOption = true;
|
||||||
|
Option.displayName = 'AAutoCompleteOption';
|
||||||
|
export default Option;
|
|
@ -1,4 +1,4 @@
|
||||||
import { App, defineComponent, inject, provide, Plugin, VNode } from 'vue';
|
import { App, defineComponent, inject, provide, Plugin, VNode, ExtractPropTypes } from 'vue';
|
||||||
import Select, { SelectProps } from '../select';
|
import Select, { SelectProps } from '../select';
|
||||||
import Input from '../input';
|
import Input from '../input';
|
||||||
import InputElement from './InputElement';
|
import InputElement from './InputElement';
|
||||||
|
@ -7,14 +7,14 @@ import { defaultConfigProvider } from '../config-provider';
|
||||||
import { getComponent, getOptionProps, isValidElement, getSlot } from '../_util/props-util';
|
import { getComponent, getOptionProps, isValidElement, getSlot } from '../_util/props-util';
|
||||||
import Omit from 'omit.js';
|
import Omit from 'omit.js';
|
||||||
import warning from '../_util/warning';
|
import warning from '../_util/warning';
|
||||||
|
import Option from './Option';
|
||||||
const { Option, OptGroup } = Select;
|
import OptGroup from './OptGroup';
|
||||||
|
|
||||||
function isSelectOptionOrSelectOptGroup(child: any): boolean {
|
function isSelectOptionOrSelectOptGroup(child: any): boolean {
|
||||||
return child?.type?.isSelectOption || child?.type?.isSelectOptGroup;
|
return child?.type?.isSelectOption || child?.type?.isSelectOptGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AutoCompleteProps = {
|
const autoCompleteProps = {
|
||||||
...SelectProps(),
|
...SelectProps(),
|
||||||
dataSource: PropTypes.array,
|
dataSource: PropTypes.array,
|
||||||
dropdownMenuStyle: PropTypes.style,
|
dropdownMenuStyle: PropTypes.style,
|
||||||
|
@ -22,11 +22,17 @@ const AutoCompleteProps = {
|
||||||
dropdownMatchSelectWidth: PropTypes.looseBool,
|
dropdownMatchSelectWidth: PropTypes.looseBool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AutoCompleteProps = Partial<ExtractPropTypes<typeof autoCompleteProps>>;
|
||||||
|
|
||||||
|
export const AutoCompleteOption = Option;
|
||||||
|
|
||||||
|
export const AutoCompleteOptGroup = OptGroup;
|
||||||
|
|
||||||
const AutoComplete = defineComponent({
|
const AutoComplete = defineComponent({
|
||||||
name: 'AAutoComplete',
|
name: 'AAutoComplete',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
...AutoCompleteProps,
|
...autoCompleteProps,
|
||||||
prefixCls: PropTypes.string.def('ant-select'),
|
prefixCls: PropTypes.string.def('ant-select'),
|
||||||
showSearch: PropTypes.looseBool,
|
showSearch: PropTypes.looseBool,
|
||||||
transitionName: PropTypes.string.def('slide-up'),
|
transitionName: PropTypes.string.def('slide-up'),
|
||||||
|
@ -38,8 +44,8 @@ const AutoComplete = defineComponent({
|
||||||
defaultActiveFirstOption: PropTypes.looseBool.def(true),
|
defaultActiveFirstOption: PropTypes.looseBool.def(true),
|
||||||
},
|
},
|
||||||
emits: ['change', 'select', 'focus', 'blur'],
|
emits: ['change', 'select', 'focus', 'blur'],
|
||||||
Option: { ...Option, name: 'AAutoCompleteOption' },
|
Option,
|
||||||
OptGroup: { ...OptGroup, name: 'AAutoCompleteOptGroup' },
|
OptGroup,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
warning(
|
warning(
|
||||||
!(props.dataSource !== undefined || 'dataSource' in slots),
|
!(props.dataSource !== undefined || 'dataSource' in slots),
|
||||||
|
@ -142,8 +148,8 @@ const AutoComplete = defineComponent({
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
AutoComplete.install = function(app: App) {
|
AutoComplete.install = function(app: App) {
|
||||||
app.component(AutoComplete.name, AutoComplete);
|
app.component(AutoComplete.name, AutoComplete);
|
||||||
app.component(AutoComplete.Option.name, AutoComplete.Option);
|
app.component(AutoComplete.Option.displayName, AutoComplete.Option);
|
||||||
app.component(AutoComplete.OptGroup.name, AutoComplete.OptGroup);
|
app.component(AutoComplete.OptGroup.displayName, AutoComplete.OptGroup);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ Avatar.install = function(app: App) {
|
||||||
app.component(Group.name, Group);
|
app.component(Group.name, Group);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
export { Group as AvatarGroup };
|
||||||
export default Avatar as typeof Avatar &
|
export default Avatar as typeof Avatar &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Group: typeof Group;
|
readonly Group: typeof Group;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { App, Plugin } from 'vue';
|
import { App, Plugin } from 'vue';
|
||||||
import Badge from './Badge';
|
import Badge from './Badge';
|
||||||
import Ribbon from './Ribbon';
|
import Ribbon from './Ribbon';
|
||||||
|
export type { BadgeProps } from './Badge'
|
||||||
|
|
||||||
Badge.install = function(app: App) {
|
Badge.install = function(app: App) {
|
||||||
app.component(Badge.name, Badge);
|
app.component(Badge.name, Badge);
|
||||||
|
@ -8,6 +9,8 @@ Badge.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export {Ribbon as BadgeRibbon}
|
||||||
|
|
||||||
export default Badge as typeof Badge &
|
export default Badge as typeof Badge &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Ribbon: typeof Ribbon;
|
readonly Ribbon: typeof Ribbon;
|
||||||
|
|
|
@ -3,16 +3,16 @@ import PropTypes from '../_util/vue-types';
|
||||||
import { flattenChildren } from '../_util/props-util';
|
import { flattenChildren } from '../_util/props-util';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
const breadcrumbSeparator = {
|
const breadcrumbSeparatorProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
};
|
};
|
||||||
export type BreadcrumbSeparator = Partial<ExtractPropTypes<typeof breadcrumbSeparator>>;
|
export type BreadcrumbSeparatorProps = Partial<ExtractPropTypes<typeof breadcrumbSeparatorProps>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ABreadcrumbSeparator',
|
name: 'ABreadcrumbSeparator',
|
||||||
__ANT_BREADCRUMB_SEPARATOR: true,
|
__ANT_BREADCRUMB_SEPARATOR: true,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: breadcrumbSeparator,
|
props: breadcrumbSeparatorProps,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { prefixCls } = useConfigInject('breadcrumb', props);
|
const { prefixCls } = useConfigInject('breadcrumb', props);
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ import Breadcrumb from './Breadcrumb';
|
||||||
import BreadcrumbItem from './BreadcrumbItem';
|
import BreadcrumbItem from './BreadcrumbItem';
|
||||||
import BreadcrumbSeparator from './BreadcrumbSeparator';
|
import BreadcrumbSeparator from './BreadcrumbSeparator';
|
||||||
|
|
||||||
export { BreadcrumbProps } from './Breadcrumb';
|
export type { BreadcrumbProps } from './Breadcrumb';
|
||||||
export { BreadcrumbItemProps } from './BreadcrumbItem';
|
export type { BreadcrumbItemProps } from './BreadcrumbItem';
|
||||||
export { BreadcrumbSeparator } from './BreadcrumbSeparator';
|
export type { BreadcrumbSeparatorProps } from './BreadcrumbSeparator';
|
||||||
|
|
||||||
Breadcrumb.Item = BreadcrumbItem;
|
Breadcrumb.Item = BreadcrumbItem;
|
||||||
Breadcrumb.Separator = BreadcrumbSeparator;
|
Breadcrumb.Separator = BreadcrumbSeparator;
|
||||||
|
@ -18,6 +18,7 @@ Breadcrumb.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { BreadcrumbItem, BreadcrumbSeparator };
|
||||||
export default Breadcrumb as typeof Breadcrumb &
|
export default Breadcrumb as typeof Breadcrumb &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Item: typeof BreadcrumbItem;
|
readonly Item: typeof BreadcrumbItem;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { defineComponent, inject, Text, VNode } from 'vue';
|
import { defineComponent, ExtractPropTypes, inject, Text, VNode } from 'vue';
|
||||||
import Wave from '../_util/wave';
|
import Wave from '../_util/wave';
|
||||||
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
|
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
|
||||||
import buttonTypes from './buttonTypes';
|
import buttonTypes from './buttonTypes';
|
||||||
|
@ -8,6 +8,9 @@ import { defaultConfigProvider } from '../config-provider';
|
||||||
const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
|
const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
|
||||||
const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
|
const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
|
||||||
const props = buttonTypes();
|
const props = buttonTypes();
|
||||||
|
|
||||||
|
export type ButtonProps = Partial<ExtractPropTypes<ReturnType<typeof buttonTypes>>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AButton',
|
name: 'AButton',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { App, Plugin } from 'vue';
|
import { App, Plugin } from 'vue';
|
||||||
import Button from './button';
|
import Button from './button';
|
||||||
import ButtonGroup from './button-group';
|
import ButtonGroup from './button-group';
|
||||||
|
export type {ButtonProps} from './button'
|
||||||
|
|
||||||
Button.Group = ButtonGroup;
|
Button.Group = ButtonGroup;
|
||||||
|
|
||||||
|
@ -10,7 +11,7 @@ Button.install = function(app: App) {
|
||||||
app.component(ButtonGroup.name, ButtonGroup);
|
app.component(ButtonGroup.name, ButtonGroup);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
export {ButtonGroup}
|
||||||
export default Button as typeof Button &
|
export default Button as typeof Button &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Group: typeof ButtonGroup;
|
readonly Group: typeof ButtonGroup;
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
import { inject, isVNode, defineComponent, VNodeTypes, PropType, VNode } from 'vue';
|
import {
|
||||||
|
inject,
|
||||||
|
isVNode,
|
||||||
|
defineComponent,
|
||||||
|
VNodeTypes,
|
||||||
|
PropType,
|
||||||
|
VNode,
|
||||||
|
ExtractPropTypes,
|
||||||
|
} from 'vue';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import Tabs from '../tabs';
|
import Tabs from '../tabs';
|
||||||
import Row from '../row';
|
import Row from '../row';
|
||||||
|
@ -20,32 +28,36 @@ export type CardType = 'inner';
|
||||||
|
|
||||||
const { TabPane } = Tabs;
|
const { TabPane } = Tabs;
|
||||||
|
|
||||||
|
const cardProps = {
|
||||||
|
prefixCls: PropTypes.string,
|
||||||
|
title: PropTypes.VNodeChild,
|
||||||
|
extra: PropTypes.VNodeChild,
|
||||||
|
bordered: PropTypes.looseBool.def(true),
|
||||||
|
bodyStyle: PropTypes.style,
|
||||||
|
headStyle: PropTypes.style,
|
||||||
|
loading: PropTypes.looseBool.def(false),
|
||||||
|
hoverable: PropTypes.looseBool.def(false),
|
||||||
|
type: PropTypes.string,
|
||||||
|
size: PropTypes.oneOf(tuple('default', 'small')),
|
||||||
|
actions: PropTypes.VNodeChild,
|
||||||
|
tabList: {
|
||||||
|
type: Array as PropType<CardTabListType[]>,
|
||||||
|
},
|
||||||
|
tabBarExtraContent: PropTypes.VNodeChild,
|
||||||
|
activeTabKey: PropTypes.string,
|
||||||
|
defaultActiveTabKey: PropTypes.string,
|
||||||
|
cover: PropTypes.VNodeChild,
|
||||||
|
onTabChange: {
|
||||||
|
type: Function as PropType<(key: string) => void>,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CardProps = Partial<ExtractPropTypes<typeof cardProps>>;
|
||||||
|
|
||||||
const Card = defineComponent({
|
const Card = defineComponent({
|
||||||
name: 'ACard',
|
name: 'ACard',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
props: {
|
props: cardProps,
|
||||||
prefixCls: PropTypes.string,
|
|
||||||
title: PropTypes.VNodeChild,
|
|
||||||
extra: PropTypes.VNodeChild,
|
|
||||||
bordered: PropTypes.looseBool.def(true),
|
|
||||||
bodyStyle: PropTypes.style,
|
|
||||||
headStyle: PropTypes.style,
|
|
||||||
loading: PropTypes.looseBool.def(false),
|
|
||||||
hoverable: PropTypes.looseBool.def(false),
|
|
||||||
type: PropTypes.string,
|
|
||||||
size: PropTypes.oneOf(tuple('default', 'small')),
|
|
||||||
actions: PropTypes.VNodeChild,
|
|
||||||
tabList: {
|
|
||||||
type: Array as PropType<CardTabListType[]>,
|
|
||||||
},
|
|
||||||
tabBarExtraContent: PropTypes.VNodeChild,
|
|
||||||
activeTabKey: PropTypes.string,
|
|
||||||
defaultActiveTabKey: PropTypes.string,
|
|
||||||
cover: PropTypes.VNodeChild,
|
|
||||||
onTabChange: {
|
|
||||||
type: Function as PropType<(key: string) => void>,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
configProvider: inject('configProvider', defaultConfigProvider),
|
configProvider: inject('configProvider', defaultConfigProvider),
|
||||||
|
|
|
@ -3,6 +3,8 @@ import Card from './Card';
|
||||||
import Meta from './Meta';
|
import Meta from './Meta';
|
||||||
import Grid from './Grid';
|
import Grid from './Grid';
|
||||||
|
|
||||||
|
export type {CardProps} from './Card'
|
||||||
|
|
||||||
Card.Meta = Meta;
|
Card.Meta = Meta;
|
||||||
Card.Grid = Grid;
|
Card.Grid = Grid;
|
||||||
|
|
||||||
|
@ -14,6 +16,8 @@ Card.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export {Meta as CardMeta, Grid as CardGrid}
|
||||||
|
|
||||||
export default Card as typeof Card &
|
export default Card as typeof Card &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Meta: typeof Meta;
|
readonly Meta: typeof Meta;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { inject, provide, PropType, defineComponent, CSSProperties } from 'vue';
|
import { inject, provide, PropType, defineComponent, CSSProperties, ExtractPropTypes } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import VcCascader from '../vc-cascader';
|
import VcCascader from '../vc-cascader';
|
||||||
import arrayTreeFilter from 'array-tree-filter';
|
import arrayTreeFilter from 'array-tree-filter';
|
||||||
|
@ -99,7 +99,7 @@ export interface FilteredOptionsType extends EmptyFilteredOptionsType {
|
||||||
// }).loose;
|
// }).loose;
|
||||||
function noop() {}
|
function noop() {}
|
||||||
|
|
||||||
const CascaderProps = {
|
const cascaderProps = {
|
||||||
/** 可选项数据源 */
|
/** 可选项数据源 */
|
||||||
options: { type: Array as PropType<CascaderOptionType[]>, default: [] },
|
options: { type: Array as PropType<CascaderOptionType[]>, default: [] },
|
||||||
/** 默认的选中项 */
|
/** 默认的选中项 */
|
||||||
|
@ -154,6 +154,8 @@ const CascaderProps = {
|
||||||
'onUpdate:value': PropTypes.func,
|
'onUpdate:value': PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CascaderProps = Partial<ExtractPropTypes<typeof cascaderProps>>;
|
||||||
|
|
||||||
// We limit the filtered item count by default
|
// We limit the filtered item count by default
|
||||||
const defaultLimit = 50;
|
const defaultLimit = 50;
|
||||||
|
|
||||||
|
@ -214,7 +216,7 @@ const Cascader = defineComponent({
|
||||||
name: 'ACascader',
|
name: 'ACascader',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: CascaderProps,
|
props: cascaderProps,
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
configProvider: inject('configProvider', defaultConfigProvider),
|
configProvider: inject('configProvider', defaultConfigProvider),
|
||||||
|
|
|
@ -10,7 +10,7 @@ Checkbox.install = function(app: App) {
|
||||||
app.component(CheckboxGroup.name, CheckboxGroup);
|
app.component(CheckboxGroup.name, CheckboxGroup);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
export { CheckboxGroup };
|
||||||
export default Checkbox as typeof Checkbox &
|
export default Checkbox as typeof Checkbox &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Group: typeof CheckboxGroup;
|
readonly Group: typeof CheckboxGroup;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Col } from '../grid';
|
import { Col } from '../grid';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
|
export type {ColProps} from '../grid'
|
||||||
export default withInstall(Col);
|
export default withInstall(Col);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { CSSProperties, defineComponent, inject, PropType } from 'vue';
|
import { CSSProperties, defineComponent, ExtractPropTypes, inject, PropType } from 'vue';
|
||||||
import animation from '../_util/openAnimation';
|
import animation from '../_util/openAnimation';
|
||||||
import { getOptionProps, getComponent, isValidElement, getSlot } from '../_util/props-util';
|
import { getOptionProps, getComponent, isValidElement, getSlot } from '../_util/props-util';
|
||||||
import { cloneElement } from '../_util/vnode';
|
import { cloneElement } from '../_util/vnode';
|
||||||
|
@ -20,22 +20,27 @@ export interface PanelProps {
|
||||||
extra?: VueNode;
|
extra?: VueNode;
|
||||||
}
|
}
|
||||||
type ActiveKeyType = Array<string | number> | string | number;
|
type ActiveKeyType = Array<string | number> | string | number;
|
||||||
|
|
||||||
|
const collapseProps = {
|
||||||
|
prefixCls: PropTypes.string,
|
||||||
|
activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
||||||
|
defaultActiveKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
||||||
|
accordion: PropTypes.looseBool,
|
||||||
|
destroyInactivePanel: PropTypes.looseBool,
|
||||||
|
bordered: PropTypes.looseBool.def(true),
|
||||||
|
expandIcon: PropTypes.func,
|
||||||
|
openAnimation: PropTypes.object.def(animation),
|
||||||
|
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')).def('left'),
|
||||||
|
'onUpdate:activeKey': PropTypes.func,
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CollapseProps = Partial<ExtractPropTypes<typeof collapseProps>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ACollapse',
|
name: 'ACollapse',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: collapseProps,
|
||||||
prefixCls: PropTypes.string,
|
|
||||||
activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
|
||||||
defaultActiveKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
|
||||||
accordion: PropTypes.looseBool,
|
|
||||||
destroyInactivePanel: PropTypes.looseBool,
|
|
||||||
bordered: PropTypes.looseBool.def(true),
|
|
||||||
expandIcon: PropTypes.func,
|
|
||||||
openAnimation: PropTypes.object.def(animation),
|
|
||||||
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')).def('left'),
|
|
||||||
'onUpdate:activeKey': PropTypes.func,
|
|
||||||
onChange: PropTypes.func,
|
|
||||||
},
|
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
configProvider: inject('configProvider', defaultConfigProvider),
|
configProvider: inject('configProvider', defaultConfigProvider),
|
||||||
|
|
|
@ -1,27 +1,30 @@
|
||||||
import { defineComponent, inject } from 'vue';
|
import { defineComponent, ExtractPropTypes, inject } from 'vue';
|
||||||
import { getOptionProps, getComponent, getSlot } from '../_util/props-util';
|
import { getOptionProps, getComponent, getSlot } from '../_util/props-util';
|
||||||
import VcCollapse from '../vc-collapse';
|
import VcCollapse from '../vc-collapse';
|
||||||
import { defaultConfigProvider } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
|
||||||
|
const collapsePanelProps = {
|
||||||
|
openAnimation: PropTypes.object,
|
||||||
|
prefixCls: PropTypes.string,
|
||||||
|
header: PropTypes.VNodeChild,
|
||||||
|
headerClass: PropTypes.string,
|
||||||
|
showArrow: PropTypes.looseBool,
|
||||||
|
isActive: PropTypes.looseBool,
|
||||||
|
destroyInactivePanel: PropTypes.looseBool,
|
||||||
|
disabled: PropTypes.looseBool,
|
||||||
|
accordion: PropTypes.looseBool,
|
||||||
|
forceRender: PropTypes.looseBool,
|
||||||
|
expandIcon: PropTypes.func,
|
||||||
|
extra: PropTypes.VNodeChild,
|
||||||
|
panelKey: PropTypes.VNodeChild,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CollapsePanelProps = Partial<ExtractPropTypes<typeof collapsePanelProps>>;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ACollapsePanel',
|
name: 'ACollapsePanel',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: collapsePanelProps,
|
||||||
openAnimation: PropTypes.object,
|
|
||||||
prefixCls: PropTypes.string,
|
|
||||||
header: PropTypes.VNodeChild,
|
|
||||||
headerClass: PropTypes.string,
|
|
||||||
showArrow: PropTypes.looseBool,
|
|
||||||
isActive: PropTypes.looseBool,
|
|
||||||
destroyInactivePanel: PropTypes.looseBool,
|
|
||||||
disabled: PropTypes.looseBool,
|
|
||||||
accordion: PropTypes.looseBool,
|
|
||||||
forceRender: PropTypes.looseBool,
|
|
||||||
expandIcon: PropTypes.func,
|
|
||||||
extra: PropTypes.VNodeChild,
|
|
||||||
panelKey: PropTypes.VNodeChild,
|
|
||||||
},
|
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
configProvider: inject('configProvider', defaultConfigProvider),
|
configProvider: inject('configProvider', defaultConfigProvider),
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { App, Plugin } from 'vue';
|
import { App, Plugin } from 'vue';
|
||||||
import Collapse from './Collapse';
|
import Collapse from './Collapse';
|
||||||
import CollapsePanel from './CollapsePanel';
|
import CollapsePanel from './CollapsePanel';
|
||||||
|
export type {CollapseProps} from './Collapse'
|
||||||
|
export type {CollapsePanelProps} from './CollapsePanel'
|
||||||
|
|
||||||
|
|
||||||
Collapse.Panel = CollapsePanel;
|
Collapse.Panel = CollapsePanel;
|
||||||
|
|
||||||
|
@ -11,6 +14,7 @@ Collapse.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export {CollapsePanel}
|
||||||
export default Collapse as typeof Collapse &
|
export default Collapse as typeof Collapse &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Panel: typeof CollapsePanel;
|
readonly Panel: typeof CollapsePanel;
|
||||||
|
|
|
@ -0,0 +1,178 @@
|
||||||
|
|
||||||
|
export type { AffixProps } from './affix';
|
||||||
|
export { default as Affix } from './affix';
|
||||||
|
|
||||||
|
export type { AnchorProps, AnchorLinkProps } from './anchor';
|
||||||
|
export { default as Anchor, AnchorLink } from './anchor';
|
||||||
|
|
||||||
|
export type { AutoCompleteProps } from './auto-complete';
|
||||||
|
export {default as AutoComplete, AutoCompleteOptGroup, AutoCompleteOption } from './auto-complete'
|
||||||
|
|
||||||
|
export type { AlertProps } from './alert';
|
||||||
|
export { default as Alert } from './alert';
|
||||||
|
|
||||||
|
export type { AvatarProps } from './avatar';
|
||||||
|
export { default as Avatar, AvatarGroup } from './avatar';
|
||||||
|
|
||||||
|
export type { BackTopProps } from './back-top';
|
||||||
|
export { default as BackTop } from './back-top';
|
||||||
|
|
||||||
|
export type { BadgeProps } from './badge';
|
||||||
|
export { default as Badge, BadgeRibbon } from './badge';
|
||||||
|
|
||||||
|
export type { BreadcrumbProps, BreadcrumbItemProps, BreadcrumbSeparatorProps } from './breadcrumb';
|
||||||
|
export { default as Breadcrumb, BreadcrumbItem, BreadcrumbSeparator } from './breadcrumb';
|
||||||
|
|
||||||
|
export type { ButtonProps } from './button';
|
||||||
|
export { default as Button, ButtonGroup } from './button';
|
||||||
|
|
||||||
|
export type { CalendarProps } from './calendar';
|
||||||
|
export { default as Calendar } from './calendar';
|
||||||
|
|
||||||
|
export type { CardProps } from './card';
|
||||||
|
export { default as Card, CardGrid, CardMeta } from './card';
|
||||||
|
|
||||||
|
export type { CollapseProps, CollapsePanelProps } from './collapse';
|
||||||
|
export { default as Collapse, CollapsePanel } from './collapse';
|
||||||
|
|
||||||
|
export type { CarouselProps } from './carousel';
|
||||||
|
export { default as Carousel } from './carousel';
|
||||||
|
|
||||||
|
export type { CascaderProps } from './cascader';
|
||||||
|
export { default as Cascader } from './cascader';
|
||||||
|
|
||||||
|
export { default as Checkbox, CheckboxGroup } from './checkbox';
|
||||||
|
|
||||||
|
export type { ColProps } from './col';
|
||||||
|
export { default as Col } from './col';
|
||||||
|
|
||||||
|
export type { CommentProps } from './comment';
|
||||||
|
export { default as Comment } from './comment';
|
||||||
|
|
||||||
|
export { default as ConfigProvider } from './config-provider';
|
||||||
|
|
||||||
|
export { default as DatePicker, RangePicker, MonthPicker, WeekPicker } from './date-picker';
|
||||||
|
|
||||||
|
export type { DescriptionsProps } from './descriptions';
|
||||||
|
export { default as Descriptions, DescriptionsItem } from './descriptions';
|
||||||
|
|
||||||
|
export type { DividerProps } from './divider';
|
||||||
|
export { default as Divider } from './divider';
|
||||||
|
|
||||||
|
export type { DropdownProps } from './dropdown';
|
||||||
|
export { default as Dropdown, DropdownButton } from './dropdown';
|
||||||
|
|
||||||
|
export { default as Drawer } from './drawer';
|
||||||
|
|
||||||
|
export type { EmptyProps } from './empty';
|
||||||
|
export { default as Empty } from './empty';
|
||||||
|
|
||||||
|
export type { FormProps, FormItemProps } from './form';
|
||||||
|
export { default as Form, FormItem } from './form';
|
||||||
|
|
||||||
|
export { default as Grid } from './grid';
|
||||||
|
|
||||||
|
export { default as Input, InputGroup, InputPassword, InputSearch, TextArea } from './input';
|
||||||
|
|
||||||
|
export type { ImageProps } from './image';
|
||||||
|
export { default as Image, ImagePreviewGroup } from './image';
|
||||||
|
|
||||||
|
export type { InputNumberProps } from './input-number';
|
||||||
|
export { default as InputNumber } from './input-number';
|
||||||
|
|
||||||
|
export type { LayoutProps } from './layout';
|
||||||
|
export { default as Layout, LayoutHeader, LayouSider, LayouFooter, LayouContent } from './layout';
|
||||||
|
|
||||||
|
export type { ListProps } from './list';
|
||||||
|
export { default as List, ListItem, ListItemMeta } from './list';
|
||||||
|
|
||||||
|
export type { MessageArgsProps } from './message';
|
||||||
|
export { default as message } from './message';
|
||||||
|
|
||||||
|
export type { MenuProps, MenuTheme, SubMenuProps, MenuItemProps } from './menu';
|
||||||
|
export { default as Menu, MenuDivider, MenuItem, MenuItemGroup, SubMenu } from './menu';
|
||||||
|
|
||||||
|
export type { MentionsProps } from './mentions';
|
||||||
|
export { default as Mentions, MentionsOption } from './mentions';
|
||||||
|
|
||||||
|
export type { ModalProps, ModalFuncProps } from './modal';
|
||||||
|
export { default as Modal } from './modal';
|
||||||
|
|
||||||
|
export type { StatisticProps } from './statistic';
|
||||||
|
export { default as Statistic, StatisticCountdown } from './statistic';
|
||||||
|
|
||||||
|
export { default as notification } from './notification';
|
||||||
|
|
||||||
|
export type { PageHeaderProps } from './page-header';
|
||||||
|
export { default as PageHeader } from './page-header';
|
||||||
|
|
||||||
|
export type { PaginationProps } from './pagination';
|
||||||
|
export { default as Pagination } from './pagination';
|
||||||
|
|
||||||
|
export { default as Popconfirm } from './popconfirm';
|
||||||
|
|
||||||
|
export { default as Popover } from './popover';
|
||||||
|
|
||||||
|
export type { ProgressProps } from './progress';
|
||||||
|
export { default as Progress } from './progress';
|
||||||
|
|
||||||
|
export { default as Radio, RadioButton, RadioGroup } from './radio';
|
||||||
|
|
||||||
|
export type { RateProps } from './rate';
|
||||||
|
export { default as Rate } from './rate';
|
||||||
|
|
||||||
|
export type { ResultProps } from './result';
|
||||||
|
export { default as Result } from './result';
|
||||||
|
|
||||||
|
export type { RowProps } from './row';
|
||||||
|
export { default as Row } from './row';
|
||||||
|
|
||||||
|
export type { SelectProps } from './select';
|
||||||
|
export { default as Select, SelectOptGroup, SelectOption } from './select';
|
||||||
|
|
||||||
|
export type { SkeletonProps } from './skeleton';
|
||||||
|
export { default as Skeleton, SkeletonButton, SkeletonAvatar, SkeletonInput, SkeletonImage } from './skeleton';
|
||||||
|
|
||||||
|
export { default as Slider } from './slider';
|
||||||
|
|
||||||
|
export type { SpaceProps } from './space';
|
||||||
|
export { default as Space } from './space';
|
||||||
|
|
||||||
|
export type { SpinProps } from './spin';
|
||||||
|
export { default as Spin } from './spin';
|
||||||
|
|
||||||
|
export { default as Steps, Step } from './steps';
|
||||||
|
|
||||||
|
export type { SwitchProps } from './switch';
|
||||||
|
export { default as Switch } from './switch';
|
||||||
|
|
||||||
|
export { default as Table, TableColumn, TableColumnGroup } from './table';
|
||||||
|
|
||||||
|
export type { TransferProps } from './transfer';
|
||||||
|
export { default as Transfer } from './transfer';
|
||||||
|
|
||||||
|
export { default as Tree, TreeNode, DirectoryTree } from './tree';
|
||||||
|
|
||||||
|
export type { TreeSelectProps } from './tree-select';
|
||||||
|
export { default as TreeSelect, TreeSelectNode } from './tree-select';
|
||||||
|
|
||||||
|
export { default as Tabs, TabPane, TabContent } from './tabs';
|
||||||
|
|
||||||
|
export type { TagProps } from './tag';
|
||||||
|
export { default as Tag, CheckableTag } from './tag';
|
||||||
|
|
||||||
|
export type { TimePickerProps } from './time-picker';
|
||||||
|
export { default as TimePicker } from './time-picker';
|
||||||
|
|
||||||
|
export type { TimelineProps, TimelineItemProps } from './timeline';
|
||||||
|
export { default as Timeline, TimelineItem } from './timeline';
|
||||||
|
|
||||||
|
export type { TooltipProps } from './tooltip';
|
||||||
|
export { default as Tooltip } from './tooltip';
|
||||||
|
|
||||||
|
export type { TypographyProps } from './typography';
|
||||||
|
export { default as Typography, TypographyLink, TypographyParagraph, TypographyText, TypographyTitle } from './typography';
|
||||||
|
|
||||||
|
export type { UploadProps } from './upload';
|
||||||
|
|
||||||
|
export { default as Upload } from './upload';
|
|
@ -56,4 +56,6 @@ DatePicker.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { RangePicker, MonthPicker, WeekPicker };
|
||||||
|
|
||||||
export default DatePicker as typeof DatePicker & Plugin;
|
export default DatePicker as typeof DatePicker & Plugin;
|
||||||
|
|
|
@ -249,7 +249,6 @@ Descriptions.install = function(app: App) {
|
||||||
app.component(Descriptions.Item.name, Descriptions.Item);
|
app.component(Descriptions.Item.name, Descriptions.Item);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Descriptions as typeof Descriptions &
|
export default Descriptions as typeof Descriptions &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Item: typeof DescriptionsItem;
|
readonly Item: typeof DescriptionsItem;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { provide, inject, defineComponent, VNode } from 'vue';
|
import { provide, inject, defineComponent, VNode, ExtractPropTypes } from 'vue';
|
||||||
import Button from '../button';
|
import Button from '../button';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import buttonTypes from '../button/buttonTypes';
|
import buttonTypes from '../button/buttonTypes';
|
||||||
|
@ -14,7 +14,7 @@ import { tuple } from '../_util/type';
|
||||||
const ButtonTypesProps = buttonTypes();
|
const ButtonTypesProps = buttonTypes();
|
||||||
const DropdownProps = getDropdownProps();
|
const DropdownProps = getDropdownProps();
|
||||||
const ButtonGroup = Button.Group;
|
const ButtonGroup = Button.Group;
|
||||||
const DropdownButtonProps = {
|
const dropdownButtonProps = {
|
||||||
...ButtonGroupProps,
|
...ButtonGroupProps,
|
||||||
...DropdownProps,
|
...DropdownProps,
|
||||||
type: PropTypes.oneOf(tuple('primary', 'ghost', 'dashed', 'danger', 'default')).def('default'),
|
type: PropTypes.oneOf(tuple('primary', 'ghost', 'dashed', 'danger', 'default')).def('default'),
|
||||||
|
@ -30,11 +30,11 @@ const DropdownButtonProps = {
|
||||||
onVisibleChange: PropTypes.func,
|
onVisibleChange: PropTypes.func,
|
||||||
'onUpdate:visible': PropTypes.func,
|
'onUpdate:visible': PropTypes.func,
|
||||||
};
|
};
|
||||||
export { DropdownButtonProps };
|
export type DropdownButtonProps = Partial<ExtractPropTypes<typeof dropdownButtonProps>>;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ADropdownButton',
|
name: 'ADropdownButton',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: DropdownButtonProps,
|
props: dropdownButtonProps,
|
||||||
emits: ['click', 'visibleChange', 'update:visible'],
|
emits: ['click', 'visibleChange', 'update:visible'],
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { provide, inject, cloneVNode, defineComponent, VNode } from 'vue';
|
import { provide, inject, cloneVNode, defineComponent, VNode, ExtractPropTypes } from 'vue';
|
||||||
import RcDropdown from '../vc-dropdown/src/index';
|
import RcDropdown from '../vc-dropdown/src/index';
|
||||||
import DropdownButton from './dropdown-button';
|
import DropdownButton from './dropdown-button';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
@ -15,16 +15,19 @@ import getDropdownProps from './getDropdownProps';
|
||||||
import { defaultConfigProvider } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
|
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
|
||||||
|
|
||||||
const DropdownProps = getDropdownProps();
|
const dropdownProps = getDropdownProps();
|
||||||
|
|
||||||
|
export type DropdownProps = Partial<ExtractPropTypes<typeof dropdownProps>>;
|
||||||
|
|
||||||
const Dropdown = defineComponent({
|
const Dropdown = defineComponent({
|
||||||
name: 'ADropdown',
|
name: 'ADropdown',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
...DropdownProps,
|
...dropdownProps,
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
mouseEnterDelay: PropTypes.number.def(0.15),
|
mouseEnterDelay: PropTypes.number.def(0.15),
|
||||||
mouseLeaveDelay: PropTypes.number.def(0.1),
|
mouseLeaveDelay: PropTypes.number.def(0.1),
|
||||||
placement: DropdownProps.placement.def('bottomLeft'),
|
placement: dropdownProps.placement.def('bottomLeft'),
|
||||||
onVisibleChange: PropTypes.func,
|
onVisibleChange: PropTypes.func,
|
||||||
'onUpdate:visible': PropTypes.func,
|
'onUpdate:visible': PropTypes.func,
|
||||||
},
|
},
|
||||||
|
@ -114,4 +117,3 @@ const Dropdown = defineComponent({
|
||||||
|
|
||||||
Dropdown.Button = DropdownButton;
|
Dropdown.Button = DropdownButton;
|
||||||
export default Dropdown;
|
export default Dropdown;
|
||||||
export { DropdownProps };
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { App, Plugin } from 'vue';
|
||||||
import Dropdown from './dropdown';
|
import Dropdown from './dropdown';
|
||||||
import DropdownButton from './dropdown-button';
|
import DropdownButton from './dropdown-button';
|
||||||
|
|
||||||
export { DropdownProps } from './dropdown';
|
export type { DropdownProps } from './dropdown';
|
||||||
export { DropdownButtonProps } from './dropdown-button';
|
export type { DropdownButtonProps } from './dropdown-button';
|
||||||
|
|
||||||
Dropdown.Button = DropdownButton;
|
Dropdown.Button = DropdownButton;
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ Dropdown.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export {DropdownButton}
|
||||||
|
|
||||||
export default Dropdown as typeof Dropdown &
|
export default Dropdown as typeof Dropdown &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Button: typeof DropdownButton;
|
readonly Button: typeof DropdownButton;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { withInstall } from '../_util/type';
|
||||||
const defaultEmptyImg = <DefaultEmptyImg />;
|
const defaultEmptyImg = <DefaultEmptyImg />;
|
||||||
const simpleEmptyImg = <SimpleEmptyImg />;
|
const simpleEmptyImg = <SimpleEmptyImg />;
|
||||||
|
|
||||||
export interface TransferLocale {
|
interface Locale {
|
||||||
description?: string;
|
description?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ const Empty: EmptyType = (props, { slots = {}, attrs }) => {
|
||||||
return (
|
return (
|
||||||
<LocaleReceiver
|
<LocaleReceiver
|
||||||
componentName="Empty"
|
componentName="Empty"
|
||||||
children={(locale: TransferLocale) => {
|
children={(locale: Locale) => {
|
||||||
const prefixCls = getPrefixCls('empty', customizePrefixCls);
|
const prefixCls = getPrefixCls('empty', customizePrefixCls);
|
||||||
const des = typeof description !== 'undefined' ? description : locale.description;
|
const des = typeof description !== 'undefined' ? description : locale.description;
|
||||||
const alt = typeof des === 'string' ? des : 'empty';
|
const alt = typeof des === 'string' ? des : 'empty';
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { App, Plugin } from 'vue';
|
import { App, Plugin } from 'vue';
|
||||||
import Form from './Form';
|
import Form, {formProps} from './Form';
|
||||||
|
import FormItem, {formItemProps} from './FormItem';
|
||||||
|
|
||||||
export { FormProps, formProps } from './Form';
|
export type { FormProps } from './Form';
|
||||||
export { FormItemProps, formItemProps } from './FormItem';
|
export type { FormItemProps } from './FormItem';
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
Form.install = function(app: App) {
|
Form.install = function(app: App) {
|
||||||
|
@ -11,6 +12,7 @@ Form.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { FormItem, formItemProps, formProps };
|
||||||
export default Form as typeof Form &
|
export default Form as typeof Form &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Item: typeof Form.Item;
|
readonly Item: typeof Form.Item;
|
||||||
|
|
|
@ -34,6 +34,8 @@ Image.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { PreviewGroup as ImagePreviewGroup };
|
||||||
|
|
||||||
export default Image as typeof Image &
|
export default Image as typeof Image &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly PreviewGroup: typeof PreviewGroup;
|
readonly PreviewGroup: typeof PreviewGroup;
|
||||||
|
|
|
@ -1,308 +1,29 @@
|
||||||
/* @remove-on-es-build-begin */
|
|
||||||
// this file is not used if use https://github.com/ant-design/babel-plugin-import
|
|
||||||
const ENV = process.env.NODE_ENV;
|
|
||||||
if (
|
|
||||||
ENV !== 'production' &&
|
|
||||||
ENV !== 'test' &&
|
|
||||||
typeof console !== 'undefined' &&
|
|
||||||
console.warn &&
|
|
||||||
typeof window !== 'undefined'
|
|
||||||
) {
|
|
||||||
console.warn(
|
|
||||||
'You are using a whole package of antd, ' +
|
|
||||||
'please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size. Not support Vite !!!',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/* @remove-on-es-build-end */
|
|
||||||
import { App } from 'vue';
|
import { App } from 'vue';
|
||||||
|
|
||||||
import { default as Affix } from './affix';
|
import * as components from './components';
|
||||||
|
|
||||||
import { default as Anchor } from './anchor';
|
|
||||||
|
|
||||||
import { default as AutoComplete } from './auto-complete';
|
|
||||||
|
|
||||||
import { default as Alert } from './alert';
|
|
||||||
|
|
||||||
import { default as Avatar } from './avatar';
|
|
||||||
|
|
||||||
import { default as BackTop } from './back-top';
|
|
||||||
|
|
||||||
import { default as Badge } from './badge';
|
|
||||||
|
|
||||||
import { default as Breadcrumb } from './breadcrumb';
|
|
||||||
|
|
||||||
import { default as Button } from './button';
|
|
||||||
|
|
||||||
import { default as Calendar } from './calendar';
|
|
||||||
|
|
||||||
import { default as Card } from './card';
|
|
||||||
|
|
||||||
import { default as Collapse } from './collapse';
|
|
||||||
|
|
||||||
import { default as Carousel } from './carousel';
|
|
||||||
|
|
||||||
import { default as Cascader } from './cascader';
|
|
||||||
|
|
||||||
import { default as Checkbox } from './checkbox';
|
|
||||||
|
|
||||||
import { default as Col } from './col';
|
|
||||||
|
|
||||||
import { default as DatePicker } from './date-picker';
|
|
||||||
|
|
||||||
import { default as Divider } from './divider';
|
|
||||||
|
|
||||||
import { default as Dropdown } from './dropdown';
|
|
||||||
|
|
||||||
import { default as Form } from './form';
|
|
||||||
|
|
||||||
import { default as Icon } from './icon';
|
|
||||||
|
|
||||||
import { default as Input } from './input';
|
|
||||||
|
|
||||||
import { default as InputNumber } from './input-number';
|
|
||||||
|
|
||||||
import { default as Layout } from './layout';
|
|
||||||
|
|
||||||
import { default as List } from './list';
|
|
||||||
|
|
||||||
import { default as LocaleProvider } from './locale-provider';
|
|
||||||
|
|
||||||
import { default as message } from './message';
|
|
||||||
|
|
||||||
import { default as Menu } from './menu';
|
|
||||||
|
|
||||||
import { default as Mentions } from './mentions';
|
|
||||||
|
|
||||||
import { default as Modal } from './modal';
|
|
||||||
|
|
||||||
import { default as notification } from './notification';
|
|
||||||
|
|
||||||
import { default as Pagination } from './pagination';
|
|
||||||
|
|
||||||
import { default as Popconfirm } from './popconfirm';
|
|
||||||
|
|
||||||
import { default as Popover } from './popover';
|
|
||||||
|
|
||||||
import { default as Progress } from './progress';
|
|
||||||
|
|
||||||
import { default as Radio } from './radio';
|
|
||||||
|
|
||||||
import { default as Rate } from './rate';
|
|
||||||
|
|
||||||
import { default as Row } from './row';
|
|
||||||
|
|
||||||
import { default as Select } from './select';
|
|
||||||
|
|
||||||
import { default as Slider } from './slider';
|
|
||||||
|
|
||||||
import { default as Spin } from './spin';
|
|
||||||
|
|
||||||
import { default as Statistic } from './statistic';
|
|
||||||
|
|
||||||
import { default as Steps } from './steps';
|
|
||||||
|
|
||||||
import { default as Switch } from './switch';
|
|
||||||
|
|
||||||
import { default as Table } from './table';
|
|
||||||
|
|
||||||
import { default as Transfer } from './transfer';
|
|
||||||
|
|
||||||
import { default as Tree } from './tree';
|
|
||||||
|
|
||||||
import { default as TreeSelect } from './tree-select';
|
|
||||||
|
|
||||||
import { default as Tabs } from './tabs';
|
|
||||||
|
|
||||||
import { default as Tag } from './tag';
|
|
||||||
|
|
||||||
import { default as TimePicker } from './time-picker';
|
|
||||||
|
|
||||||
import { default as Timeline } from './timeline';
|
|
||||||
|
|
||||||
import { default as Tooltip } from './tooltip';
|
|
||||||
|
|
||||||
// import { default as Mention } from './mention'
|
|
||||||
|
|
||||||
import { default as Upload } from './upload';
|
|
||||||
|
|
||||||
import { default as version } from './version';
|
import { default as version } from './version';
|
||||||
|
export * from './components';
|
||||||
|
|
||||||
import { default as Drawer } from './drawer';
|
export const install = function(app: App) {
|
||||||
|
Object.keys(components).forEach(key => {
|
||||||
import { default as Skeleton } from './skeleton';
|
const component = components[key];
|
||||||
|
if (component.install) {
|
||||||
import { default as Comment } from './comment';
|
app.use(component);
|
||||||
import { default as Image } from './image';
|
}
|
||||||
// import { default as ColorPicker } from './color-picker';
|
|
||||||
|
|
||||||
import { default as ConfigProvider } from './config-provider';
|
|
||||||
|
|
||||||
import { default as Empty } from './empty';
|
|
||||||
|
|
||||||
import { default as Result } from './result';
|
|
||||||
|
|
||||||
import { default as Descriptions } from './descriptions';
|
|
||||||
import { default as PageHeader } from './page-header';
|
|
||||||
import { default as Space } from './space';
|
|
||||||
|
|
||||||
import { default as Typography } from './typography';
|
|
||||||
|
|
||||||
const components = [
|
|
||||||
Affix,
|
|
||||||
Anchor,
|
|
||||||
AutoComplete,
|
|
||||||
Alert,
|
|
||||||
Avatar,
|
|
||||||
BackTop,
|
|
||||||
Badge,
|
|
||||||
Breadcrumb,
|
|
||||||
Button,
|
|
||||||
Calendar,
|
|
||||||
Card,
|
|
||||||
Collapse,
|
|
||||||
Carousel,
|
|
||||||
Cascader,
|
|
||||||
Checkbox,
|
|
||||||
Col,
|
|
||||||
DatePicker,
|
|
||||||
Divider,
|
|
||||||
Dropdown,
|
|
||||||
Form,
|
|
||||||
Icon,
|
|
||||||
Input,
|
|
||||||
InputNumber,
|
|
||||||
Layout,
|
|
||||||
List,
|
|
||||||
LocaleProvider,
|
|
||||||
Menu,
|
|
||||||
Mentions,
|
|
||||||
Modal,
|
|
||||||
Pagination,
|
|
||||||
Popconfirm,
|
|
||||||
Popover,
|
|
||||||
Progress,
|
|
||||||
Radio,
|
|
||||||
Rate,
|
|
||||||
Row,
|
|
||||||
Select,
|
|
||||||
Slider,
|
|
||||||
Spin,
|
|
||||||
Statistic,
|
|
||||||
Steps,
|
|
||||||
Switch,
|
|
||||||
Table,
|
|
||||||
Transfer,
|
|
||||||
Tree,
|
|
||||||
TreeSelect,
|
|
||||||
Tabs,
|
|
||||||
Tag,
|
|
||||||
TimePicker,
|
|
||||||
Timeline,
|
|
||||||
Tooltip,
|
|
||||||
Upload,
|
|
||||||
Drawer,
|
|
||||||
Skeleton,
|
|
||||||
Comment,
|
|
||||||
// ColorPicker,
|
|
||||||
ConfigProvider,
|
|
||||||
Empty,
|
|
||||||
Result,
|
|
||||||
Descriptions,
|
|
||||||
PageHeader,
|
|
||||||
Space,
|
|
||||||
Image,
|
|
||||||
Typography,
|
|
||||||
];
|
|
||||||
|
|
||||||
const install = function(app: App) {
|
|
||||||
components.forEach(component => {
|
|
||||||
app.use(component);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.config.globalProperties.$message = message;
|
app.config.globalProperties.$message = components.message;
|
||||||
app.config.globalProperties.$notification = notification;
|
app.config.globalProperties.$notification = components.notification;
|
||||||
app.config.globalProperties.$info = Modal.info;
|
app.config.globalProperties.$info = components.Modal.info;
|
||||||
app.config.globalProperties.$success = Modal.success;
|
app.config.globalProperties.$success = components.Modal.success;
|
||||||
app.config.globalProperties.$error = Modal.error;
|
app.config.globalProperties.$error = components.Modal.error;
|
||||||
app.config.globalProperties.$warning = Modal.warning;
|
app.config.globalProperties.$warning = components.Modal.warning;
|
||||||
app.config.globalProperties.$confirm = Modal.confirm;
|
app.config.globalProperties.$confirm = components.Modal.confirm;
|
||||||
app.config.globalProperties.$destroyAll = Modal.destroyAll;
|
app.config.globalProperties.$destroyAll = components.Modal.destroyAll;
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* istanbul ignore if */
|
export { version };
|
||||||
|
|
||||||
export {
|
|
||||||
version,
|
|
||||||
install,
|
|
||||||
message,
|
|
||||||
notification,
|
|
||||||
Affix,
|
|
||||||
Anchor,
|
|
||||||
AutoComplete,
|
|
||||||
Alert,
|
|
||||||
Avatar,
|
|
||||||
BackTop,
|
|
||||||
Badge,
|
|
||||||
Breadcrumb,
|
|
||||||
Button,
|
|
||||||
Calendar,
|
|
||||||
Card,
|
|
||||||
Collapse,
|
|
||||||
Carousel,
|
|
||||||
Cascader,
|
|
||||||
Checkbox,
|
|
||||||
Col,
|
|
||||||
DatePicker,
|
|
||||||
Divider,
|
|
||||||
Dropdown,
|
|
||||||
Form,
|
|
||||||
Icon,
|
|
||||||
Input,
|
|
||||||
InputNumber,
|
|
||||||
Layout,
|
|
||||||
List,
|
|
||||||
LocaleProvider,
|
|
||||||
Menu,
|
|
||||||
Mentions,
|
|
||||||
Modal,
|
|
||||||
Pagination,
|
|
||||||
Popconfirm,
|
|
||||||
Popover,
|
|
||||||
Progress,
|
|
||||||
Radio,
|
|
||||||
Rate,
|
|
||||||
Row,
|
|
||||||
Select,
|
|
||||||
Slider,
|
|
||||||
Spin,
|
|
||||||
Statistic,
|
|
||||||
Steps,
|
|
||||||
Switch,
|
|
||||||
Table,
|
|
||||||
Transfer,
|
|
||||||
Tree,
|
|
||||||
TreeSelect,
|
|
||||||
Tabs,
|
|
||||||
Tag,
|
|
||||||
TimePicker,
|
|
||||||
Timeline,
|
|
||||||
Tooltip,
|
|
||||||
Upload,
|
|
||||||
Drawer,
|
|
||||||
Skeleton,
|
|
||||||
Comment,
|
|
||||||
// ColorPicker,
|
|
||||||
ConfigProvider,
|
|
||||||
Empty,
|
|
||||||
Result,
|
|
||||||
Descriptions,
|
|
||||||
PageHeader,
|
|
||||||
Space,
|
|
||||||
Image,
|
|
||||||
Typography,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
version,
|
version,
|
||||||
|
|
|
@ -20,6 +20,8 @@ Input.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { Group as InputGroup, Search as InputSearch, TextArea, Password as InputPassword };
|
||||||
|
|
||||||
export default Input as typeof Input &
|
export default Input as typeof Input &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Group: typeof Group;
|
readonly Group: typeof Group;
|
||||||
|
|
|
@ -16,6 +16,12 @@ Layout.install = function(app: App) {
|
||||||
app.component(Layout.Content.name, Layout.Content);
|
app.component(Layout.Content.name, Layout.Content);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
const LayoutHeader = Layout.Header;
|
||||||
|
const LayouFooter = Layout.Footer;
|
||||||
|
const LayouSider = Layout.Sider;
|
||||||
|
const LayouContent = Layout.Content;
|
||||||
|
|
||||||
|
export { LayoutHeader, LayouSider, LayouFooter, LayouContent };
|
||||||
export default Layout as typeof Layout &
|
export default Layout as typeof Layout &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Sider: typeof Sider;
|
readonly Sider: typeof Sider;
|
||||||
|
|
|
@ -30,7 +30,6 @@ import { Breakpoint, responsiveArray } from '../_util/responsiveObserve';
|
||||||
|
|
||||||
export { ListItemProps } from './Item';
|
export { ListItemProps } from './Item';
|
||||||
export { ListItemMetaProps } from './ItemMeta';
|
export { ListItemMetaProps } from './ItemMeta';
|
||||||
export const ListItemMeta = ItemMeta;
|
|
||||||
|
|
||||||
export type ColumnType = 'gutter' | 'column' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
export type ColumnType = 'gutter' | 'column' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
||||||
|
|
||||||
|
@ -330,6 +329,8 @@ List.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { ItemMeta as ListItemMeta, Item as ListItem };
|
||||||
|
|
||||||
export default List as typeof List &
|
export default List as typeof List &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Item: typeof Item & {
|
readonly Item: typeof Item & {
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
import { App, defineComponent, inject, nextTick, PropType, VNodeTypes, Plugin } from 'vue';
|
import {
|
||||||
|
App,
|
||||||
|
defineComponent,
|
||||||
|
inject,
|
||||||
|
nextTick,
|
||||||
|
PropType,
|
||||||
|
VNodeTypes,
|
||||||
|
Plugin,
|
||||||
|
ExtractPropTypes,
|
||||||
|
} from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import omit from 'omit.js';
|
import omit from 'omit.js';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import VcMentions from '../vc-mentions';
|
import VcMentions from '../vc-mentions';
|
||||||
import { mentionsProps } from '../vc-mentions/src/mentionsProps';
|
import { mentionsProps as baseMentionsProps } from '../vc-mentions/src/mentionsProps';
|
||||||
import Spin from '../spin';
|
import Spin from '../spin';
|
||||||
import BaseMixin from '../_util/BaseMixin';
|
import BaseMixin from '../_util/BaseMixin';
|
||||||
import { defaultConfigProvider } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
|
@ -17,7 +26,7 @@ interface MentionsConfig {
|
||||||
split?: string;
|
split?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OptionProps {
|
export interface MentionsOptionProps {
|
||||||
value: string;
|
value: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
children: VNodeTypes;
|
children: VNodeTypes;
|
||||||
|
@ -57,28 +66,32 @@ function getMentions(value = '', config: MentionsConfig) {
|
||||||
.filter(entity => !!entity && !!entity.value);
|
.filter(entity => !!entity && !!entity.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const mentionsProps = {
|
||||||
|
...baseMentionsProps,
|
||||||
|
loading: PropTypes.looseBool,
|
||||||
|
onFocus: {
|
||||||
|
type: Function as PropType<(e: FocusEvent) => void>,
|
||||||
|
},
|
||||||
|
onBlur: {
|
||||||
|
type: Function as PropType<(e: FocusEvent) => void>,
|
||||||
|
},
|
||||||
|
onSelect: {
|
||||||
|
type: Function as PropType<(option: MentionsOptionProps, prefix: string) => void>,
|
||||||
|
},
|
||||||
|
onChange: {
|
||||||
|
type: Function as PropType<(text: string) => void>,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export type MentionsProps = Partial<ExtractPropTypes<typeof mentionsProps>>;
|
||||||
|
|
||||||
const Mentions = defineComponent({
|
const Mentions = defineComponent({
|
||||||
name: 'AMentions',
|
name: 'AMentions',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
Option: { ...Option, name: 'AMentionsOption' },
|
Option: { ...Option, name: 'AMentionsOption' },
|
||||||
getMentions,
|
getMentions,
|
||||||
props: {
|
props: mentionsProps,
|
||||||
...mentionsProps,
|
|
||||||
loading: PropTypes.looseBool,
|
|
||||||
onFocus: {
|
|
||||||
type: Function as PropType<(e: FocusEvent) => void>,
|
|
||||||
},
|
|
||||||
onBlur: {
|
|
||||||
type: Function as PropType<(e: FocusEvent) => void>,
|
|
||||||
},
|
|
||||||
onSelect: {
|
|
||||||
type: Function as PropType<(option: OptionProps, prefix: string) => void>,
|
|
||||||
},
|
|
||||||
onChange: {
|
|
||||||
type: Function as PropType<(text: string) => void>,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ['update:value', 'change', 'focus', 'blur', 'select'],
|
emits: ['update:value', 'change', 'focus', 'blur', 'select'],
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
|
@ -112,7 +125,7 @@ const Mentions = defineComponent({
|
||||||
focused: false,
|
focused: false,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelect(...args: [OptionProps, string]) {
|
handleSelect(...args: [MentionsOptionProps, string]) {
|
||||||
this.$emit('select', ...args);
|
this.$emit('select', ...args);
|
||||||
this.setState({
|
this.setState({
|
||||||
focused: true,
|
focused: true,
|
||||||
|
@ -204,6 +217,8 @@ Mentions.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const MentionsOption = Mentions.Option;
|
||||||
|
|
||||||
export default Mentions as typeof Mentions &
|
export default Mentions as typeof Mentions &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Option: typeof Option;
|
readonly Option: typeof Option;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import SubMenu, { SubMenuProps } from './src/SubMenu';
|
||||||
import ItemGroup, { MenuItemGroupProps } from './src/ItemGroup';
|
import ItemGroup, { MenuItemGroupProps } from './src/ItemGroup';
|
||||||
import Divider from './src/Divider';
|
import Divider from './src/Divider';
|
||||||
import { App, Plugin } from 'vue';
|
import { App, Plugin } from 'vue';
|
||||||
|
import { MenuTheme } from './src/interface';
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
Menu.install = function(app: App) {
|
Menu.install = function(app: App) {
|
||||||
app.component(Menu.name, Menu);
|
app.component(Menu.name, Menu);
|
||||||
|
@ -24,11 +25,14 @@ export {
|
||||||
MenuItem as Item,
|
MenuItem as Item,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
ItemGroup,
|
ItemGroup,
|
||||||
|
ItemGroup as MenuItemGroup,
|
||||||
Divider,
|
Divider,
|
||||||
|
Divider as MenuDivider,
|
||||||
MenuProps,
|
MenuProps,
|
||||||
SubMenuProps,
|
SubMenuProps,
|
||||||
MenuItemProps,
|
MenuItemProps,
|
||||||
MenuItemGroupProps,
|
MenuItemGroupProps,
|
||||||
|
MenuTheme,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Menu as typeof Menu &
|
export default Menu as typeof Menu &
|
||||||
|
|
|
@ -59,7 +59,7 @@ export interface MessageType {
|
||||||
promise: Promise<void>;
|
promise: Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ArgsProps {
|
export interface MessageArgsProps {
|
||||||
content: VNodeTypes;
|
content: VNodeTypes;
|
||||||
duration: number | null;
|
duration: number | null;
|
||||||
type: NoticeType;
|
type: NoticeType;
|
||||||
|
@ -70,7 +70,7 @@ export interface ArgsProps {
|
||||||
class?: string;
|
class?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function notice(args: ArgsProps): MessageType {
|
function notice(args: MessageArgsProps): MessageType {
|
||||||
const duration = args.duration !== undefined ? args.duration : defaultDuration;
|
const duration = args.duration !== undefined ? args.duration : defaultDuration;
|
||||||
const Icon = iconMap[args.type];
|
const Icon = iconMap[args.type];
|
||||||
const iconNode = Icon ? <Icon /> : '';
|
const iconNode = Icon ? <Icon /> : '';
|
||||||
|
@ -115,13 +115,13 @@ function notice(args: ArgsProps): MessageType {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigDuration = number | (() => void);
|
type ConfigDuration = number | (() => void);
|
||||||
type JointContent = VNodeTypes | ArgsProps;
|
type JointContent = VNodeTypes | MessageArgsProps;
|
||||||
export type ConfigOnClose = () => void;
|
export type ConfigOnClose = () => void;
|
||||||
|
|
||||||
function isArgsProps(content: JointContent): content is ArgsProps {
|
function isArgsProps(content: JointContent): content is MessageArgsProps {
|
||||||
return (
|
return (
|
||||||
Object.prototype.toString.call(content) === '[object Object]' &&
|
Object.prototype.toString.call(content) === '[object Object]' &&
|
||||||
!!(content as ArgsProps).content
|
!!(content as MessageArgsProps).content
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ export interface MessageApi {
|
||||||
warn(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
warn(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
||||||
warning(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
warning(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
||||||
loading(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
loading(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
||||||
open(args: ArgsProps): MessageType;
|
open(args: MessageArgsProps): MessageType;
|
||||||
config(options: ConfigOptions): void;
|
config(options: ConfigOptions): void;
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ const typeToIcon = {
|
||||||
warning: ExclamationCircleOutlined,
|
warning: ExclamationCircleOutlined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ArgsProps {
|
export interface NotificationArgsProps {
|
||||||
message: VNodeTypes;
|
message: VNodeTypes;
|
||||||
description?: VNodeTypes;
|
description?: VNodeTypes;
|
||||||
btn?: VNodeTypes;
|
btn?: VNodeTypes;
|
||||||
|
@ -162,7 +162,7 @@ export interface ArgsProps {
|
||||||
closeIcon?: VNodeTypes;
|
closeIcon?: VNodeTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
function notice(args: ArgsProps) {
|
function notice(args: NotificationArgsProps) {
|
||||||
const { icon, type, description, message, btn } = args;
|
const { icon, type, description, message, btn } = args;
|
||||||
const outerPrefixCls = args.prefixCls || 'ant-notification';
|
const outerPrefixCls = args.prefixCls || 'ant-notification';
|
||||||
const prefixCls = `${outerPrefixCls}-notice`;
|
const prefixCls = `${outerPrefixCls}-notice`;
|
||||||
|
|
|
@ -16,7 +16,7 @@ Radio.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
export { Button, Group };
|
export { Button, Group, Button as RadioButton, Group as RadioGroup };
|
||||||
export default Radio as typeof Radio &
|
export default Radio as typeof Radio &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Group: typeof Group;
|
readonly Group: typeof Group;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { Row } from '../grid';
|
import { Row } from '../grid';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
|
|
||||||
|
export type {RowProps} from '../grid'
|
||||||
|
|
||||||
export default withInstall(Row);
|
export default withInstall(Row);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import getIcons from './utils/iconUtil';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
import { SizeType } from '../config-provider';
|
||||||
|
|
||||||
type RawValue = string | number;
|
type RawValue = string | number;
|
||||||
|
|
||||||
|
@ -19,7 +20,6 @@ export interface LabeledValue {
|
||||||
value: RawValue;
|
value: RawValue;
|
||||||
label: VNodeChild;
|
label: VNodeChild;
|
||||||
}
|
}
|
||||||
export type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
||||||
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
|
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
|
||||||
|
|
||||||
export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
|
export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
|
||||||
|
@ -206,6 +206,9 @@ Select.install = function(app: App) {
|
||||||
app.component(Select.OptGroup.displayName, Select.OptGroup);
|
app.component(Select.OptGroup.displayName, Select.OptGroup);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const SelectOption = Select.Option;
|
||||||
|
export const SelectOptGroup = Select.OptGroup;
|
||||||
export default Select as typeof Select &
|
export default Select as typeof Select &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Option: typeof Option;
|
readonly Option: typeof Option;
|
||||||
|
|
|
@ -21,7 +21,7 @@ Skeleton.install = function(app: App) {
|
||||||
app.component(Skeleton.Image.name, SkeletonImage);
|
app.component(Skeleton.Image.name, SkeletonImage);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
export { SkeletonButton, SkeletonAvatar, SkeletonInput, SkeletonImage };
|
||||||
export default Skeleton as typeof Skeleton &
|
export default Skeleton as typeof Skeleton &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Button: typeof SkeletonButton;
|
readonly Button: typeof SkeletonButton;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { defineComponent, onBeforeUnmount, onMounted, onUpdated, ref } from 'vue
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import interopDefault from '../_util/interopDefault';
|
import interopDefault from '../_util/interopDefault';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import Statistic, { StatisticProps } from './Statistic';
|
import Statistic, { statisticProps } from './Statistic';
|
||||||
import { formatCountdown as formatCD, countdownValueType, FormatConfig } from './utils';
|
import { formatCountdown as formatCD, countdownValueType, FormatConfig } from './utils';
|
||||||
|
|
||||||
const REFRESH_INTERVAL = 1000 / 30;
|
const REFRESH_INTERVAL = 1000 / 30;
|
||||||
|
@ -13,7 +13,7 @@ function getTime(value?: countdownValueType) {
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AStatisticCountdown',
|
name: 'AStatisticCountdown',
|
||||||
props: initDefaultProps(StatisticProps, {
|
props: initDefaultProps(statisticProps, {
|
||||||
format: 'HH:mm:ss',
|
format: 'HH:mm:ss',
|
||||||
}),
|
}),
|
||||||
emits: ['finish', 'change'],
|
emits: ['finish', 'change'],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { defineComponent, PropType } from 'vue';
|
import { defineComponent, ExtractPropTypes, PropType } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import StatisticNumber from './Number';
|
import StatisticNumber from './Number';
|
||||||
|
@ -6,7 +6,7 @@ import { countdownValueType } from './utils';
|
||||||
import Skeleton from '../skeleton/Skeleton';
|
import Skeleton from '../skeleton/Skeleton';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
export const StatisticProps = {
|
export const statisticProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
decimalSeparator: PropTypes.string,
|
decimalSeparator: PropTypes.string,
|
||||||
groupSeparator: PropTypes.string,
|
groupSeparator: PropTypes.string,
|
||||||
|
@ -25,9 +25,11 @@ export const StatisticProps = {
|
||||||
loading: PropTypes.looseBool,
|
loading: PropTypes.looseBool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type StatisticProps = Partial<ExtractPropTypes<typeof statisticProps>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AStatistic',
|
name: 'AStatistic',
|
||||||
props: initDefaultProps(StatisticProps, {
|
props: initDefaultProps(statisticProps, {
|
||||||
decimalSeparator: '.',
|
decimalSeparator: '.',
|
||||||
groupSeparator: ',',
|
groupSeparator: ',',
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
|
@ -2,6 +2,8 @@ import { App, Plugin } from 'vue';
|
||||||
import Statistic from './Statistic';
|
import Statistic from './Statistic';
|
||||||
import Countdown from './Countdown';
|
import Countdown from './Countdown';
|
||||||
|
|
||||||
|
export type {StatisticProps} from './Statistic'
|
||||||
|
|
||||||
Statistic.Countdown = Countdown;
|
Statistic.Countdown = Countdown;
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
Statistic.install = function(app: App) {
|
Statistic.install = function(app: App) {
|
||||||
|
@ -10,6 +12,8 @@ Statistic.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const StatisticCountdown = Statistic.Countdown
|
||||||
|
|
||||||
export default Statistic as typeof Statistic &
|
export default Statistic as typeof Statistic &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Countdown: typeof Countdown;
|
readonly Countdown: typeof Countdown;
|
||||||
|
|
|
@ -76,6 +76,8 @@ Steps.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const Step = Steps.Step;
|
||||||
|
|
||||||
export default Steps as typeof Steps &
|
export default Steps as typeof Steps &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Step: typeof VcSteps.Step;
|
readonly Step: typeof VcSteps.Step;
|
||||||
|
|
|
@ -100,6 +100,9 @@ Table.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const TableColumn = Table.Column;
|
||||||
|
export const TableColumnGroup = Table.ColumnGroup;
|
||||||
|
|
||||||
export default Table as typeof Table &
|
export default Table as typeof Table &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Column: typeof Column;
|
readonly Column: typeof Column;
|
||||||
|
|
|
@ -146,6 +146,8 @@ Tag.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { CheckableTag };
|
||||||
|
|
||||||
export default Tag as typeof Tag &
|
export default Tag as typeof Tag &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly CheckableTag: typeof CheckableTag;
|
readonly CheckableTag: typeof CheckableTag;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import omit from 'omit.js';
|
import omit from 'omit.js';
|
||||||
import { defineComponent, inject, provide } from 'vue';
|
import { defineComponent, ExtractPropTypes, inject, provide } from 'vue';
|
||||||
import VcTimePicker from '../vc-time-picker';
|
import VcTimePicker from '../vc-time-picker';
|
||||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||||
import BaseMixin from '../_util/BaseMixin';
|
import BaseMixin from '../_util/BaseMixin';
|
||||||
|
@ -29,7 +29,7 @@ export function generateShowHourMinuteSecond(format: string) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TimePickerProps = () => ({
|
export const timePickerProps = () => ({
|
||||||
size: PropTypes.oneOf(tuple('large', 'default', 'small')),
|
size: PropTypes.oneOf(tuple('large', 'default', 'small')),
|
||||||
value: TimeOrTimesType,
|
value: TimeOrTimesType,
|
||||||
defaultValue: TimeOrTimesType,
|
defaultValue: TimeOrTimesType,
|
||||||
|
@ -74,11 +74,13 @@ export const TimePickerProps = () => ({
|
||||||
onOpenChange: PropTypes.func,
|
onOpenChange: PropTypes.func,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export type TimePickerProps = Partial<ExtractPropTypes<ReturnType<typeof timePickerProps>>>;
|
||||||
|
|
||||||
const TimePicker = defineComponent({
|
const TimePicker = defineComponent({
|
||||||
name: 'ATimePicker',
|
name: 'ATimePicker',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: initDefaultProps(TimePickerProps(), {
|
props: initDefaultProps(timePickerProps(), {
|
||||||
align: {
|
align: {
|
||||||
offset: [0, -2],
|
offset: [0, -2],
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,7 @@ import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import { defaultConfigProvider } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
|
|
||||||
export const timeLineItemProps = {
|
export const timelineItemProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
color: PropTypes.string,
|
color: PropTypes.string,
|
||||||
dot: PropTypes.any,
|
dot: PropTypes.any,
|
||||||
|
@ -14,11 +14,11 @@ export const timeLineItemProps = {
|
||||||
position: PropTypes.oneOf(tuple('left', 'right', '')).def(''),
|
position: PropTypes.oneOf(tuple('left', 'right', '')).def(''),
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TimeLineItemProps = Partial<ExtractPropTypes<typeof timeLineItemProps>>;
|
export type TimelineItemProps = Partial<ExtractPropTypes<typeof timelineItemProps>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ATimelineItem',
|
name: 'ATimelineItem',
|
||||||
props: initDefaultProps(timeLineItemProps, {
|
props: initDefaultProps(timelineItemProps, {
|
||||||
color: 'blue',
|
color: 'blue',
|
||||||
pending: false,
|
pending: false,
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { App, Plugin } from 'vue';
|
||||||
import Timeline from './Timeline';
|
import Timeline from './Timeline';
|
||||||
import TimelineItem from './TimelineItem';
|
import TimelineItem from './TimelineItem';
|
||||||
|
|
||||||
export { TimelineProps } from './Timeline';
|
export type { TimelineProps } from './Timeline';
|
||||||
export { TimeLineItemProps } from './TimelineItem';
|
export type { TimelineItemProps } from './TimelineItem';
|
||||||
|
|
||||||
Timeline.Item = TimelineItem;
|
Timeline.Item = TimelineItem;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ Timeline.install = function(app: App) {
|
||||||
app.component(TimelineItem.name, TimelineItem);
|
app.component(TimelineItem.name, TimelineItem);
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
export {TimelineItem}
|
||||||
export default Timeline as typeof Timeline &
|
export default Timeline as typeof Timeline &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Item: typeof TimelineItem;
|
readonly Item: typeof TimelineItem;
|
||||||
|
|
|
@ -203,6 +203,8 @@ TreeSelect.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const TreeSelectNode = TreeSelect.TreeNode;
|
||||||
|
|
||||||
export default TreeSelect as typeof TreeSelect &
|
export default TreeSelect as typeof TreeSelect &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly TreeNode: typeof TreeNode;
|
readonly TreeNode: typeof TreeNode;
|
||||||
|
|
|
@ -12,6 +12,8 @@ Tree.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const TreeNode = Tree.TreeNode;
|
||||||
|
export { DirectoryTree };
|
||||||
export default Tree as typeof Tree &
|
export default Tree as typeof Tree &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly TreeNode: any;
|
readonly TreeNode: any;
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
import Text from './Text';
|
|
||||||
import Title from './Title';
|
|
||||||
import Paragraph from './Paragraph';
|
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { defineComponent, HTMLAttributes, App, Plugin } from 'vue';
|
import { defineComponent, HTMLAttributes } from 'vue';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import Link from './Link';
|
|
||||||
import Base from './Base';
|
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
|
|
||||||
export interface TypographyProps extends HTMLAttributes {
|
export interface TypographyProps extends HTMLAttributes {
|
||||||
|
@ -18,11 +13,6 @@ interface InternalTypographyProps extends TypographyProps {
|
||||||
|
|
||||||
const Typography = defineComponent<InternalTypographyProps>({
|
const Typography = defineComponent<InternalTypographyProps>({
|
||||||
name: 'ATypography',
|
name: 'ATypography',
|
||||||
Base,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
Paragraph,
|
|
||||||
Link,
|
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { prefixCls } = useConfigInject('typography', props);
|
const { prefixCls } = useConfigInject('typography', props);
|
||||||
|
@ -47,20 +37,4 @@ Typography.props = {
|
||||||
component: PropTypes.string,
|
component: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
Typography.install = function(app: App) {
|
export default Typography;
|
||||||
app.component(Typography.name, Typography);
|
|
||||||
app.component(Typography.Text.displayName, Text);
|
|
||||||
app.component(Typography.Title.displayName, Title);
|
|
||||||
app.component(Typography.Paragraph.displayName, Paragraph);
|
|
||||||
app.component(Typography.Link.displayName, Link);
|
|
||||||
return app;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Typography as typeof Typography &
|
|
||||||
Plugin & {
|
|
||||||
readonly Text: typeof Text;
|
|
||||||
readonly Title: typeof Title;
|
|
||||||
readonly Paragraph: typeof Paragraph;
|
|
||||||
readonly Link: typeof Link;
|
|
||||||
readonly Base: typeof Base;
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,3 +1,41 @@
|
||||||
|
import { App, Plugin } from 'vue';
|
||||||
|
import Base from './Base';
|
||||||
|
import Link from './Link';
|
||||||
|
import Paragraph from './Paragraph';
|
||||||
|
import Text from './Text';
|
||||||
|
import Title from './Title';
|
||||||
import Typography from './Typography';
|
import Typography from './Typography';
|
||||||
|
|
||||||
export default Typography;
|
export type {TypographyProps} from './Typography'
|
||||||
|
|
||||||
|
|
||||||
|
Typography.Text = Text
|
||||||
|
Typography.Title = Title
|
||||||
|
Typography.Paragraph = Paragraph
|
||||||
|
Typography.Link = Link
|
||||||
|
Typography.Base = Base
|
||||||
|
|
||||||
|
Typography.install = function(app: App) {
|
||||||
|
app.component(Typography.name, Typography);
|
||||||
|
app.component(Typography.Text.displayName, Text);
|
||||||
|
app.component(Typography.Title.displayName, Title);
|
||||||
|
app.component(Typography.Paragraph.displayName, Paragraph);
|
||||||
|
app.component(Typography.Link.displayName, Link);
|
||||||
|
return app;
|
||||||
|
};
|
||||||
|
|
||||||
|
export {
|
||||||
|
Text as TypographyText,
|
||||||
|
Title as TypographyTitle,
|
||||||
|
Paragraph as TypographyParagraph,
|
||||||
|
Link as TypographyLink,
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Typography as typeof Typography &
|
||||||
|
Plugin & {
|
||||||
|
readonly Text: typeof Text;
|
||||||
|
readonly Title: typeof Title;
|
||||||
|
readonly Paragraph: typeof Paragraph;
|
||||||
|
readonly Link: typeof Link;
|
||||||
|
readonly Base: typeof Base;
|
||||||
|
};
|
||||||
|
|
|
@ -13,6 +13,8 @@ Upload.install = function(app: App) {
|
||||||
return app;
|
return app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const UploadDragger = Dragger;
|
||||||
|
|
||||||
export default Upload as typeof Upload &
|
export default Upload as typeof Upload &
|
||||||
Plugin & {
|
Plugin & {
|
||||||
readonly Dragger: typeof Dragger;
|
readonly Dragger: typeof Dragger;
|
||||||
|
|
Loading…
Reference in New Issue