update configProvider

pull/1225/head
tangjinzhou 2019-09-11 22:35:25 +08:00
parent a47a820a29
commit 4ce99b91e1
81 changed files with 188 additions and 197 deletions

View File

@ -57,7 +57,7 @@ const Affix = {
props: AffixProps, props: AffixProps,
mixins: [BaseMixin], mixins: [BaseMixin],
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
this.events = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load']; this.events = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'];
@ -246,7 +246,7 @@ const Affix = {
render() { render() {
const { prefixCls, affixStyle, placeholderStyle, $slots, $props } = this; const { prefixCls, affixStyle, placeholderStyle, $slots, $props } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const className = classNames({ const className = classNames({
[getPrefixCls('affix', prefixCls)]: affixStyle, [getPrefixCls('affix', prefixCls)]: affixStyle,
}); });

View File

@ -38,7 +38,7 @@ const Alert = {
props: AlertProps, props: AlertProps,
mixins: [BaseMixin], mixins: [BaseMixin],
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -71,7 +71,7 @@ const Alert = {
render() { render() {
const { prefixCls: customizePrefixCls, banner, closing, closed } = this; const { prefixCls: customizePrefixCls, banner, closing, closed } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('alert', customizePrefixCls); const prefixCls = getPrefixCls('alert', customizePrefixCls);
let { closable, type, showIcon, iconType } = this; let { closable, type, showIcon, iconType } = this;

View File

@ -97,7 +97,7 @@ export default {
getContainer: getDefaultContainer, getContainer: getDefaultContainer,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
this.links = []; this.links = [];
@ -222,7 +222,7 @@ export default {
getContainer, getContainer,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('anchor', customizePrefixCls); const prefixCls = getPrefixCls('anchor', customizePrefixCls);
this._sPrefixCls = prefixCls; this._sPrefixCls = prefixCls;

View File

@ -17,7 +17,7 @@ export default {
inject: { inject: {
antAnchor: { default: () => ({}) }, antAnchor: { default: () => ({}) },
antAnchorContext: { default: () => ({}) }, antAnchorContext: { default: () => ({}) },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
watch: { watch: {
href(val, oldVal) { href(val, oldVal) {
@ -49,7 +49,7 @@ export default {
render() { render() {
const { prefixCls: customizePrefixCls, href, $slots } = this; const { prefixCls: customizePrefixCls, href, $slots } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('anchor', customizePrefixCls); const prefixCls = getPrefixCls('anchor', customizePrefixCls);
const title = getComponentFromProp(this, 'title'); const title = getComponentFromProp(this, 'title');

View File

@ -58,7 +58,7 @@ const AutoComplete = {
event: 'change', event: 'change',
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
provide() { provide() {
return { return {
@ -99,7 +99,7 @@ const AutoComplete = {
$listeners, $listeners,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('select', customizePrefixCls); const prefixCls = getPrefixCls('select', customizePrefixCls);
const cls = { const cls = {

View File

@ -26,7 +26,7 @@ export default {
loadError: Function, loadError: Function,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -89,7 +89,7 @@ export default {
render() { render() {
const { prefixCls: customizePrefixCls, shape, size, src, icon, alt, srcSet } = this.$props; const { prefixCls: customizePrefixCls, shape, size, src, icon, alt, srcSet } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('avatar', customizePrefixCls); const prefixCls = getPrefixCls('avatar', customizePrefixCls);
const { isImgExist, scale } = this.$data; const { isImgExist, scale } = this.$data;

View File

@ -37,7 +37,7 @@ const BackTop = {
visibilityHeight: PropTypes.number.def(400), visibilityHeight: PropTypes.number.def(400),
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
this.scrollEvent = null; this.scrollEvent = null;
@ -108,7 +108,7 @@ const BackTop = {
render() { render() {
const { prefixCls: customizePrefixCls, $slots, $listeners } = this; const { prefixCls: customizePrefixCls, $slots, $listeners } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('back-top', customizePrefixCls); const prefixCls = getPrefixCls('back-top', customizePrefixCls);
const defaultElement = ( const defaultElement = (

View File

@ -32,7 +32,7 @@ export default {
overflowCount: 99, overflowCount: 99,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
getBadgeClassName(prefixCls) { getBadgeClassName(prefixCls) {
@ -157,7 +157,7 @@ export default {
$slots, $slots,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('badge', customizePrefixCls); const prefixCls = getPrefixCls('badge', customizePrefixCls);
const scrollNumberPrefixCls = getPrefixCls('scroll-number', customizeScrollNumberPrefixCls); const scrollNumberPrefixCls = getPrefixCls('scroll-number', customizeScrollNumberPrefixCls);

View File

@ -29,7 +29,7 @@ export default {
mixins: [BaseMixin], mixins: [BaseMixin],
props: ScrollNumberProps, props: ScrollNumberProps,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -133,7 +133,7 @@ export default {
displayComponent, displayComponent,
className, className,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('scroll-number', customizePrefixCls); const prefixCls = getPrefixCls('scroll-number', customizePrefixCls);
if (displayComponent) { if (displayComponent) {
return cloneElement(displayComponent, { return cloneElement(displayComponent, {

View File

@ -34,7 +34,7 @@ export default {
name: 'ABreadcrumb', name: 'ABreadcrumb',
props: BreadcrumbProps, props: BreadcrumbProps,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
defaultItemRender({ route, params, routes, paths }) { defaultItemRender({ route, params, routes, paths }) {
@ -46,7 +46,7 @@ export default {
render() { render() {
let crumbs; let crumbs;
const { prefixCls: customizePrefixCls, routes, params = {}, $slots, $scopedSlots } = this; const { prefixCls: customizePrefixCls, routes, params = {}, $slots, $scopedSlots } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls); const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
const children = filterEmpty($slots.default); const children = filterEmpty($slots.default);

View File

@ -11,11 +11,11 @@ export default {
separator: PropTypes.any, separator: PropTypes.any,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, $slots } = this; const { prefixCls: customizePrefixCls, $slots } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls); const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
const children = $slots.default; const children = $slots.default;

View File

@ -15,7 +15,7 @@ export default {
name: 'AButtonGroup', name: 'AButtonGroup',
props: ButtonGroupProps, props: ButtonGroupProps,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -27,7 +27,7 @@ export default {
}, },
render() { render() {
const { prefixCls: customizePrefixCls, size, sizeMap, $slots } = this; const { prefixCls: customizePrefixCls, size, sizeMap, $slots } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('btn-group', customizePrefixCls); const prefixCls = getPrefixCls('btn-group', customizePrefixCls);
// large => lg // large => lg

View File

@ -13,7 +13,7 @@ export default {
__ANT_BUTTON: true, __ANT_BUTTON: true,
props, props,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -40,7 +40,7 @@ export default {
icon, icon,
$slots, $slots,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('btn', customizePrefixCls); const prefixCls = getPrefixCls('btn', customizePrefixCls);
const autoInsertSpace = this.configProvider.autoInsertSpaceInButton !== false; const autoInsertSpace = this.configProvider.autoInsertSpaceInButton !== false;

View File

@ -24,7 +24,7 @@ export default {
yearSelectTotal: 20, yearSelectTotal: 20,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
// private calenderHeaderNode: HTMLDivElement; // private calenderHeaderNode: HTMLDivElement;
methods: { methods: {
@ -136,7 +136,7 @@ export default {
render() { render() {
const { prefixCls: customizePrefixCls, type, value, locale, fullscreen } = this; const { prefixCls: customizePrefixCls, type, value, locale, fullscreen } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls); const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls);
const yearSelect = this.getYearSelectElement(prefixCls, value.year()); const yearSelect = this.getYearSelectElement(prefixCls, value.year());

View File

@ -61,7 +61,7 @@ const Calendar = {
event: 'change', event: 'change',
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const value = this.value || this.defaultValue || interopDefault(moment)(); const value = this.value || this.defaultValue || interopDefault(moment)();
@ -182,7 +182,7 @@ const Calendar = {
dateFullCellRender, dateFullCellRender,
monthFullCellRender, monthFullCellRender,
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls); const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls);
const type = mode === 'year' ? 'month' : 'date'; const type = mode === 'year' ? 'month' : 'date';

View File

@ -30,7 +30,7 @@ export default {
defaultActiveTabKey: PropTypes.string, defaultActiveTabKey: PropTypes.string,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
this.updateWiderPaddingCalled = false; this.updateWiderPaddingCalled = false;
@ -109,7 +109,7 @@ export default {
defaultActiveTabKey, defaultActiveTabKey,
} = this.$props; } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('card', customizePrefixCls); const prefixCls = getPrefixCls('card', customizePrefixCls);
const { $slots, $scopedSlots, $listeners } = this; const { $slots, $scopedSlots, $listeners } = this;

View File

@ -8,12 +8,12 @@ export default {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls } = this.$props; const { prefixCls: customizePrefixCls } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('card', customizePrefixCls); const prefixCls = getPrefixCls('card', customizePrefixCls);
const classString = { const classString = {

View File

@ -10,12 +10,12 @@ export default {
description: PropTypes.any, description: PropTypes.any,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls } = this.$props; const { prefixCls: customizePrefixCls } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('card', customizePrefixCls); const prefixCls = getPrefixCls('card', customizePrefixCls);
const classString = { const classString = {

View File

@ -75,7 +75,7 @@ const Carousel = {
draggable: false, draggable: false,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
beforeMount() { beforeMount() {
@ -137,7 +137,7 @@ const Carousel = {
props.fade = true; props.fade = true;
} }
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
let className = getPrefixCls('carousel', props.prefixCls); let className = getPrefixCls('carousel', props.prefixCls);
if (props.vertical) { if (props.vertical) {

View File

@ -149,7 +149,7 @@ const Cascader = {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
localeData: { default: () => ({}) }, localeData: { default: () => ({}) },
}, },
data() { data() {
@ -388,10 +388,8 @@ const Cascader = {
showSearch = false, showSearch = false,
...otherProps ...otherProps
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const renderEmpty = const renderEmpty = this.configProvider.renderEmpty;
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
ConfigConsumerProps.renderEmpty;
const prefixCls = getPrefixCls('cascader', customizePrefixCls); const prefixCls = getPrefixCls('cascader', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls); const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);

View File

@ -25,7 +25,7 @@ export default {
autoFocus: PropTypes.bool, autoFocus: PropTypes.bool,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
checkboxGroupContext: { default: () => null }, checkboxGroupContext: { default: () => null },
}, },
methods: { methods: {
@ -48,7 +48,7 @@ export default {
const children = $slots.default; const children = $slots.default;
const { mouseenter = noop, mouseleave = noop, ...restListeners } = $listeners; const { mouseenter = noop, mouseleave = noop, ...restListeners } = $listeners;
const { prefixCls: customizePrefixCls, indeterminate, ...restProps } = props; const { prefixCls: customizePrefixCls, indeterminate, ...restProps } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('checkbox', customizePrefixCls); const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
const checkboxProps = { const checkboxProps = {

View File

@ -22,7 +22,7 @@ export default {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const { value, defaultValue } = this; const { value, defaultValue } = this;
@ -70,7 +70,7 @@ export default {
render() { render() {
const { $props: props, $data: state, $slots } = this; const { $props: props, $data: state, $slots } = this;
const { prefixCls: customizePrefixCls, options } = props; const { prefixCls: customizePrefixCls, options } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('checkbox', customizePrefixCls); const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
let children = $slots.default; let children = $slots.default;

View File

@ -21,7 +21,7 @@ export default {
openAnimation: animation, openAnimation: animation,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
renderExpandIcon(panelProps, prefixCls) { renderExpandIcon(panelProps, prefixCls) {
@ -38,7 +38,7 @@ export default {
}, },
render() { render() {
const { prefixCls: customizePrefixCls, bordered, $listeners } = this; const { prefixCls: customizePrefixCls, bordered, $listeners } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('collapse', customizePrefixCls); const prefixCls = getPrefixCls('collapse', customizePrefixCls);
const collapseClassName = { const collapseClassName = {

View File

@ -8,11 +8,11 @@ export default {
...panelProps(), ...panelProps(),
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, showArrow = true, $listeners } = this; const { prefixCls: customizePrefixCls, showArrow = true, $listeners } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('collapse', customizePrefixCls); const prefixCls = getPrefixCls('collapse', customizePrefixCls);
const collapsePanelClassName = { const collapsePanelClassName = {

View File

@ -20,7 +20,7 @@ const Comment = {
name: 'AComment', name: 'AComment',
props: CommentProps, props: CommentProps,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
getAction(actions) { getAction(actions) {
@ -40,7 +40,7 @@ const Comment = {
render() { render() {
const { prefixCls: customizePrefixCls } = this.$props; const { prefixCls: customizePrefixCls } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('comment', customizePrefixCls); const prefixCls = getPrefixCls('comment', customizePrefixCls);
const actions = getComponentFromProp(this, 'actions'); const actions = getComponentFromProp(this, 'actions');

View File

@ -42,9 +42,10 @@ const ConfigProvider = {
...getWatch(['prefixCls', 'csp', 'autoInsertSpaceInButton']), ...getWatch(['prefixCls', 'csp', 'autoInsertSpaceInButton']),
}, },
methods: { methods: {
renderEmptyComponent() { renderEmptyComponent(h, name) {
const customRender = getComponentFromProp(this, 'renderEmpty', {}, false); const renderEmpty =
return this.$props.renderEmpty || customRender || defaultRenderEmpty; getComponentFromProp(this, 'renderEmpty', {}, false) || defaultRenderEmpty;
return renderEmpty(h, name);
}, },
getPrefixCls(suffixCls, customizePrefixCls) { getPrefixCls(suffixCls, customizePrefixCls) {
const { prefixCls = 'ant' } = this.$props; const { prefixCls = 'ant' } = this.$props;

View File

@ -6,7 +6,7 @@ import { ConfigConsumerProps } from './';
const RenderEmpty = { const RenderEmpty = {
functional: true, functional: true,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
props: { props: {
componentName: PropTypes.string, componentName: PropTypes.string,
@ -14,8 +14,7 @@ const RenderEmpty = {
render(createElement, context) { render(createElement, context) {
const { props, injections } = context; const { props, injections } = context;
function renderHtml(componentName) { function renderHtml(componentName) {
const getPrefixCls = const getPrefixCls = injections.configProvider.getPrefixCls;
injections.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
const prefix = getPrefixCls('empty'); const prefix = getPrefixCls('empty');
switch (componentName) { switch (componentName) {
case 'Table': case 'Table':

View File

@ -78,7 +78,7 @@ export default {
showToday: false, showToday: false,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const value = this.value || this.defaultValue || []; const value = this.value || this.defaultValue || [];
@ -285,7 +285,7 @@ export default {
localeCode, localeCode,
format, format,
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('calendar', customizePrefixCls); const prefixCls = getPrefixCls('calendar', customizePrefixCls);
const tagPrefixCls = getPrefixCls('tag', customizeTagPrefixCls); const tagPrefixCls = getPrefixCls('tag', customizeTagPrefixCls);
this._prefixCls = prefixCls; this._prefixCls = prefixCls;

View File

@ -38,7 +38,7 @@ export default {
allowClear: true, allowClear: true,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const value = this.value || this.defaultValue; const value = this.value || this.defaultValue;
@ -153,7 +153,7 @@ export default {
$scopedSlots, $scopedSlots,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('calendar', customizePrefixCls); const prefixCls = getPrefixCls('calendar', customizePrefixCls);
this._prefixCls = prefixCls; this._prefixCls = prefixCls;

View File

@ -34,7 +34,7 @@ export default function createPicker(TheCalendar, props) {
event: 'change', event: 'change',
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const value = this.value || this.defaultValue; const value = this.value || this.defaultValue;
@ -139,7 +139,7 @@ export default function createPicker(TheCalendar, props) {
const props = getOptionProps(this); const props = getOptionProps(this);
const { prefixCls: customizePrefixCls, locale, localeCode } = props; const { prefixCls: customizePrefixCls, locale, localeCode } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('calendar', customizePrefixCls); const prefixCls = getPrefixCls('calendar', customizePrefixCls);
this._prefixCls = prefixCls; this._prefixCls = prefixCls;

View File

@ -50,7 +50,7 @@ export default function wrapPicker(Picker, props, pickerType) {
event: 'change', event: 'change',
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
provide() { provide() {
return { return {
@ -125,7 +125,7 @@ export default function wrapPicker(Picker, props, pickerType) {
locale[LOCALE_FORMAT_MAPPING[mergedPickerType]] || locale[LOCALE_FORMAT_MAPPING[mergedPickerType]] ||
DEFAULT_FORMAT[mergedPickerType]; DEFAULT_FORMAT[mergedPickerType];
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('calendar', customizePrefixCls); const prefixCls = getPrefixCls('calendar', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls); const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);

View File

@ -11,11 +11,11 @@ const Divider = {
orientation: PropTypes.oneOf(['left', 'right']), orientation: PropTypes.oneOf(['left', 'right']),
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, type, $slots, dashed, orientation = '' } = this; const { prefixCls: customizePrefixCls, type, $slots, dashed, orientation = '' } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('divider', customizePrefixCls); const prefixCls = getPrefixCls('divider', customizePrefixCls);
const orientationPrefix = orientation.length > 0 ? '-' + orientation : orientation; const orientationPrefix = orientation.length > 0 ? '-' + orientation : orientation;

View File

@ -41,7 +41,7 @@ const Drawer = {
parentDrawer: { parentDrawer: {
default: () => null, default: () => null,
}, },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
provide() { provide() {
return { return {
@ -192,7 +192,7 @@ const Drawer = {
offsetStyle.height = typeof height === 'number' ? `${height}px` : height; offsetStyle.height = typeof height === 'number' ? `${height}px` : height;
} }
const handler = getComponentFromProp(this, 'handle') || false; const handler = getComponentFromProp(this, 'handle') || false;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('drawer', customizePrefixCls); const prefixCls = getPrefixCls('drawer', customizePrefixCls);
const vcDrawerProps = { const vcDrawerProps = {

View File

@ -34,7 +34,7 @@ export default {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
savePopupRef(ref) { savePopupRef(ref) {
@ -62,7 +62,7 @@ export default {
...restProps ...restProps
} = this.$props; } = this.$props;
const { getPopupContainer: getContextPopupContainer } = this.configProvider; const { getPopupContainer: getContextPopupContainer } = this.configProvider;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('dropdown-button', customizePrefixCls); const prefixCls = getPrefixCls('dropdown-button', customizePrefixCls);
const dropdownProps = { const dropdownProps = {
props: { props: {

View File

@ -27,7 +27,7 @@ const Dropdown = {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
savePopupRef(ref) { savePopupRef(ref) {
@ -76,7 +76,7 @@ const Dropdown = {
const props = getOptionProps(this); const props = getOptionProps(this);
const { prefixCls: customizePrefixCls, trigger, disabled, getPopupContainer } = props; const { prefixCls: customizePrefixCls, trigger, disabled, getPopupContainer } = props;
const { getPopupContainer: getContextPopupContainer } = this.configProvider; const { getPopupContainer: getContextPopupContainer } = this.configProvider;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('dropdown', customizePrefixCls); const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
const dropdownTrigger = cloneElement($slots.default, { const dropdownTrigger = cloneElement($slots.default, {

View File

@ -92,7 +92,12 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
<div class="ant-list ant-list-split"> <div class="ant-list ant-list-split">
<div class="ant-spin-nested-loading"> <div class="ant-spin-nested-loading">
<div class="ant-spin-container"> <div class="ant-spin-container">
<div class="ant-list-empty-text"></div> <div class="ant-list-empty-text">
<div class="ant-empty ant-empty-normal">
<div class="ant-empty-image"><img alt="No Data" src=""></div>
<p class="ant-empty-description">No Data</p>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -167,7 +167,7 @@ const Form = {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
watch: { watch: {
form() { form() {
@ -207,7 +207,7 @@ const Form = {
autoFormCreate, autoFormCreate,
options = {}, options = {},
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('form', customizePrefixCls); const prefixCls = getPrefixCls('form', customizePrefixCls);
const formClassName = classNames(prefixCls, { const formClassName = classNames(prefixCls, {

View File

@ -68,7 +68,7 @@ export default {
FormProps: { default: () => ({}) }, FormProps: { default: () => ({}) },
decoratorFormProps: { default: () => ({}) }, decoratorFormProps: { default: () => ({}) },
collectFormItemContext: { default: () => noop }, collectFormItemContext: { default: () => noop },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { helpShow: false }; return { helpShow: false };
@ -421,7 +421,7 @@ export default {
}, },
renderFormItem() { renderFormItem() {
const { prefixCls: customizePrefixCls, colon } = this.$props; const { prefixCls: customizePrefixCls, colon } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('form', customizePrefixCls); const prefixCls = getPrefixCls('form', customizePrefixCls);
const children = this.renderChildren(prefixCls); const children = this.renderChildren(prefixCls);
const itemClassName = { const itemClassName = {

View File

@ -32,7 +32,7 @@ export default {
name: 'ACol', name: 'ACol',
props: ColProps, props: ColProps,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
rowContext: { rowContext: {
default: () => null, default: () => null,
}, },
@ -50,7 +50,7 @@ export default {
$listeners, $listeners,
rowContext, rowContext,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('col', customizePrefixCls); const prefixCls = getPrefixCls('col', customizePrefixCls);
let sizeClassObj = {}; let sizeClassObj = {};

View File

@ -59,7 +59,7 @@ export default {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -119,7 +119,7 @@ export default {
render() { render() {
const { type, justify, align, prefixCls: customizePrefixCls, $slots } = this; const { type, justify, align, prefixCls: customizePrefixCls, $slots } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('row', customizePrefixCls); const prefixCls = getPrefixCls('row', customizePrefixCls);
const gutter = this.getGutter(); const gutter = this.getGutter();

View File

@ -36,7 +36,7 @@ const InputNumber = {
step: 1, step: 1,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
focus() { focus() {
@ -49,7 +49,7 @@ const InputNumber = {
render() { render() {
const { prefixCls: customizePrefixCls, size, ...others } = getOptionProps(this); const { prefixCls: customizePrefixCls, size, ...others } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('input-number', customizePrefixCls); const prefixCls = getPrefixCls('input-number', customizePrefixCls);
const inputNumberClass = classNames({ const inputNumberClass = classNames({

View File

@ -14,12 +14,12 @@ export default {
compact: Boolean, compact: Boolean,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
computed: { computed: {
classes() { classes() {
const { prefixCls: customizePrefixCls, size, compact = false } = this; const { prefixCls: customizePrefixCls, size, compact = false } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('input-group', customizePrefixCls); const prefixCls = getPrefixCls('input-group', customizePrefixCls);
return { return {

View File

@ -33,7 +33,7 @@ export default {
...inputProps, ...inputProps,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const { value, defaultValue } = this.$props; const { value, defaultValue } = this.$props;
@ -266,7 +266,7 @@ export default {
return <TextArea {...textareaProps} ref="input" />; return <TextArea {...textareaProps} ref="input" />;
} }
const { prefixCls: customizePrefixCls } = this.$props; const { prefixCls: customizePrefixCls } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('input', customizePrefixCls); const prefixCls = getPrefixCls('input', customizePrefixCls);
return this.renderLabeledInput(prefixCls, this.renderInput(prefixCls)); return this.renderLabeledInput(prefixCls, this.renderInput(prefixCls));
}, },

View File

@ -20,7 +20,7 @@ export default {
enterButton: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.object]), enterButton: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.object]),
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
onSearch(e) { onSearch(e) {
@ -103,7 +103,7 @@ export default {
size, size,
...others ...others
} = getOptionProps(this); } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('input-search', customizePrefixCls); const prefixCls = getPrefixCls('input-search', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls); const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);

View File

@ -39,7 +39,7 @@ export default {
autosize: [Object, Boolean], autosize: [Object, Boolean],
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const { value, defaultValue } = this.$props; const { value, defaultValue } = this.$props;
@ -155,7 +155,7 @@ export default {
'value', 'value',
'defaultValue', 'defaultValue',
]); ]);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('input', customizePrefixCls); const prefixCls = getPrefixCls('input', customizePrefixCls);
const cls = classNames(prefixCls, { const cls = classNames(prefixCls, {

View File

@ -112,7 +112,7 @@ export default {
}, },
inject: { inject: {
siderHook: { default: () => ({}) }, siderHook: { default: () => ({}) },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
// getChildContext() { // getChildContext() {
// return { // return {
@ -187,7 +187,7 @@ export default {
width, width,
collapsedWidth, collapsedWidth,
} = getOptionProps(this); } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('layout-sider', customizePrefixCls); const prefixCls = getPrefixCls('layout-sider', customizePrefixCls);
const trigger = getComponentFromProp(this, 'trigger'); const trigger = getComponentFromProp(this, 'trigger');

View File

@ -14,12 +14,12 @@ function generator(props, name) {
name, name,
props: BasicComponent.props, props: BasicComponent.props,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { suffixCls } = props; const { suffixCls } = props;
const { prefixCls: customizePrefixCls } = this.$props; const { prefixCls: customizePrefixCls } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls(suffixCls, customizePrefixCls); const prefixCls = getPrefixCls(suffixCls, customizePrefixCls);
const basicComponentProps = { const basicComponentProps = {

View File

@ -24,12 +24,12 @@ export const Meta = {
name: 'AListItemMeta', name: 'AListItemMeta',
__ANT_LIST_ITEM_META: true, __ANT_LIST_ITEM_META: true,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render(h, context) { render(h, context) {
const { props, slots, listeners, injections } = context; const { props, slots, listeners, injections } = context;
const slotsMap = slots(); const slotsMap = slots();
const getPrefixCls = injections.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = injections.configProvider.getPrefixCls;
const { prefixCls: customizePrefixCls } = props; const { prefixCls: customizePrefixCls } = props;
const prefixCls = getPrefixCls('list', customizePrefixCls); const prefixCls = getPrefixCls('list', customizePrefixCls);
@ -61,12 +61,12 @@ export default {
props: ListItemProps, props: ListItemProps,
inject: { inject: {
listContext: { default: () => ({}) }, listContext: { default: () => ({}) },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { grid } = this.listContext; const { grid } = this.listContext;
const { prefixCls: customizePrefixCls, $slots, $listeners } = this; const { prefixCls: customizePrefixCls, $slots, $listeners } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('list', customizePrefixCls); const prefixCls = getPrefixCls('list', customizePrefixCls);
const classString = `${prefixCls}-item`; const classString = `${prefixCls}-item`;

View File

@ -66,7 +66,7 @@ const List = {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
this.keys = []; this.keys = [];
@ -140,7 +140,7 @@ const List = {
$slots, $slots,
paginationCurrent, paginationCurrent,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('list', customizePrefixCls); const prefixCls = getPrefixCls('list', customizePrefixCls);
const loadMore = getComponentFromProp(this, 'loadMore'); const loadMore = getComponentFromProp(this, 'loadMore');
@ -223,9 +223,7 @@ const List = {
childrenContent = grid ? <Row gutter={grid.gutter}>{childrenList}</Row> : childrenList; childrenContent = grid ? <Row gutter={grid.gutter}>{childrenList}</Row> : childrenList;
} else if (!children.length && !isLoading) { } else if (!children.length && !isLoading) {
const renderEmpty = const renderEmpty = this.configProvider.renderEmpty;
(this.configProvider.renderEmpty && this.configProvider.renderEmpty) ||
ConfigConsumerProps.renderEmpty;
childrenContent = this.renderEmpty(prefixCls, renderEmpty); childrenContent = this.renderEmpty(prefixCls, renderEmpty);
} }
const paginationPosition = paginationProps.position || 'bottom'; const paginationPosition = paginationProps.position || 'bottom';

View File

@ -52,7 +52,7 @@ const Menu = {
mixins: [BaseMixin], mixins: [BaseMixin],
inject: { inject: {
layoutSiderContext: { default: () => ({}) }, layoutSiderContext: { default: () => ({}) },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
model: { model: {
prop: 'selectedKeys', prop: 'selectedKeys',
@ -209,7 +209,7 @@ const Menu = {
const { collapsedWidth } = layoutSiderContext; const { collapsedWidth } = layoutSiderContext;
const { getPopupContainer: getContextPopupContainer } = this.configProvider; const { getPopupContainer: getContextPopupContainer } = this.configProvider;
const { prefixCls: customizePrefixCls, theme, getPopupContainer } = this.$props; const { prefixCls: customizePrefixCls, theme, getPopupContainer } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('menu', customizePrefixCls); const prefixCls = getPrefixCls('menu', customizePrefixCls);
const menuMode = this.getRealMenuMode(); const menuMode = this.getRealMenuMode();
const menuOpenAnimation = this.getMenuOpenAnimation(menuMode); const menuOpenAnimation = this.getMenuOpenAnimation(menuMode);

View File

@ -89,7 +89,7 @@ export default {
// cancelButtonDisabled: false, // cancelButtonDisabled: false,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
mounted() { mounted() {
if (mousePositionEventBinded) { if (mousePositionEventBinded) {
@ -162,7 +162,7 @@ export default {
$slots, $slots,
} = this; } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('modal', customizePrefixCls); const prefixCls = getPrefixCls('modal', customizePrefixCls);
const defaultFooter = ( const defaultFooter = (

View File

@ -4,7 +4,7 @@ import MiniSelect from './MiniSelect';
import LocaleReceiver from '../locale-provider/LocaleReceiver'; import LocaleReceiver from '../locale-provider/LocaleReceiver';
import { getOptionProps } from '../_util/props-util'; import { getOptionProps } from '../_util/props-util';
import VcPagination from '../vc-pagination'; import VcPagination from '../vc-pagination';
import enUS from '../pagination/locale/en_US'; import enUS from '../vc-pagination/locale/en_US';
import Icon from '../icon'; import Icon from '../icon';
import { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumerProps } from '../config-provider';
@ -93,7 +93,7 @@ export default {
locale: customLocale, locale: customLocale,
...restProps ...restProps
} = getOptionProps(this); } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('pagination', customizePrefixCls); const prefixCls = getPrefixCls('pagination', customizePrefixCls);
const selectPrefixCls = getPrefixCls('select', customizeSelectPrefixCls); const selectPrefixCls = getPrefixCls('select', customizeSelectPrefixCls);
@ -119,7 +119,11 @@ export default {
}, },
render() { render() {
return ( return (
<LocaleReceiver componentName="Pagination" defaultLocale={enUS} scopedSlots={{ default: this.renderPagination }} /> <LocaleReceiver
componentName="Pagination"
defaultLocale={enUS}
scopedSlots={{ default: this.renderPagination }}
/>
); );
}, },
}; };

View File

@ -126,7 +126,7 @@ const Popconfirm = {
render() { render() {
const props = getOptionProps(this); const props = getOptionProps(this);
const { prefixCls: customizePrefixCls } = props; const { prefixCls: customizePrefixCls } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('popover', customizePrefixCls); const prefixCls = getPrefixCls('popover', customizePrefixCls);
const otherProps = omit(props, ['title', 'content', 'cancelText', 'okText']); const otherProps = omit(props, ['title', 'content', 'cancelText', 'okText']);

View File

@ -30,7 +30,7 @@ const Popover = {
render() { render() {
const { title, prefixCls: customizePrefixCls, $slots } = this; const { title, prefixCls: customizePrefixCls, $slots } = this;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('popover', customizePrefixCls); const prefixCls = getPrefixCls('popover', customizePrefixCls);
const props = getOptionProps(this); const props = getOptionProps(this);

View File

@ -45,7 +45,7 @@ export default {
strokeLinecap: 'round', strokeLinecap: 'round',
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
renderProcessInfo(prefixCls, progressStatus) { renderProcessInfo(prefixCls, progressStatus) {
@ -89,7 +89,7 @@ export default {
strokeLinecap = 'round', strokeLinecap = 'round',
...restProps ...restProps
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('progress', customizePrefixCls); const prefixCls = getPrefixCls('progress', customizePrefixCls);
const progressStatus = const progressStatus =

View File

@ -42,7 +42,7 @@ export default {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
computed: { computed: {
radioOptions() { radioOptions() {
@ -83,7 +83,7 @@ export default {
const { mouseenter = noop, mouseleave = noop } = this.$listeners; const { mouseenter = noop, mouseleave = noop } = this.$listeners;
const props = getOptionProps(this); const props = getOptionProps(this);
const { prefixCls: customizePrefixCls, options, buttonStyle } = props; const { prefixCls: customizePrefixCls, options, buttonStyle } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('radio', customizePrefixCls); const prefixCls = getPrefixCls('radio', customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`; const groupPrefixCls = `${prefixCls}-group`;

View File

@ -27,7 +27,7 @@ export default {
}, },
inject: { inject: {
radioGroupContext: { default: undefined }, radioGroupContext: { default: undefined },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
handleChange(event) { handleChange(event) {
@ -49,7 +49,7 @@ export default {
const children = $slots.default; const children = $slots.default;
const { mouseenter = noop, mouseleave = noop, ...restListeners } = $listeners; const { mouseenter = noop, mouseleave = noop, ...restListeners } = $listeners;
const { prefixCls: customizePrefixCls, ...restProps } = props; const { prefixCls: customizePrefixCls, ...restProps } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('radio', customizePrefixCls); const prefixCls = getPrefixCls('radio', customizePrefixCls);
const radioProps = { const radioProps = {

View File

@ -12,11 +12,11 @@ export default {
}, },
inject: { inject: {
radioGroupContext: { default: undefined }, radioGroupContext: { default: undefined },
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, ...otherProps } = getOptionProps(this); const { prefixCls: customizePrefixCls, ...otherProps } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('radio-button', customizePrefixCls); const prefixCls = getPrefixCls('radio-button', customizePrefixCls);
const radioProps = { const radioProps = {

View File

@ -28,7 +28,7 @@ const Rate = {
}, },
props: RateProps, props: RateProps,
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
focus() { focus() {
@ -50,7 +50,7 @@ const Rate = {
}, },
render() { render() {
const { prefixCls: customizePrefixCls, ...restProps } = getOptionProps(this); const { prefixCls: customizePrefixCls, ...restProps } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('rate', customizePrefixCls); const prefixCls = getPrefixCls('rate', customizePrefixCls);
const character = getComponentFromProp(this, 'character') || ( const character = getComponentFromProp(this, 'character') || (

View File

@ -112,7 +112,7 @@ const Select = {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
created() { created() {
warning( warning(
@ -173,10 +173,8 @@ const Select = {
...restProps ...restProps
} = getOptionProps(this); } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const renderEmpty = const renderEmpty = this.configProvider.renderEmpty;
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
ConfigConsumerProps.renderEmpty;
const prefixCls = getPrefixCls('select', customizePrefixCls); const prefixCls = getPrefixCls('select', customizePrefixCls);
const { getPopupContainer: getContextPopupContainer } = this.configProvider; const { getPopupContainer: getContextPopupContainer } = this.configProvider;

View File

@ -70,7 +70,7 @@ const Skeleton = {
paragraph: true, paragraph: true,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { const {
@ -81,7 +81,7 @@ const Skeleton = {
paragraph, paragraph,
active, active,
} = this.$props; } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('skeleton', customizePrefixCls); const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
if (loading || !hasProp(this, 'loading')) { if (loading || !hasProp(this, 'loading')) {

View File

@ -47,7 +47,7 @@ export default {
wrapperClassName: '', wrapperClassName: '',
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const { spinning, delay } = this; const { spinning, delay } = this;
@ -124,7 +124,7 @@ export default {
wrapperClassName, wrapperClassName,
...restProps ...restProps
} = this.$props; } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('spin', customizePrefixCls); const prefixCls = getPrefixCls('spin', customizePrefixCls);
const { sSpinning } = this; const { sSpinning } = this;

View File

@ -26,12 +26,12 @@ export default {
groupSeparator: ',', groupSeparator: ',',
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, value = 0, valueStyle, valueRender } = this.$props; const { prefixCls: customizePrefixCls, value = 0, valueStyle, valueRender } = this.$props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('statistic', customizePrefixCls); const prefixCls = getPrefixCls('statistic', customizePrefixCls);
const title = getComponentFromProp(this, 'title'); const title = getComponentFromProp(this, 'title');

View File

@ -26,13 +26,13 @@ const Steps = {
current: 0, current: 0,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
Step: { ...VcSteps.Step, name: 'AStep' }, Step: { ...VcSteps.Step, name: 'AStep' },
render() { render() {
const props = getOptionProps(this); const props = getOptionProps(this);
const { prefixCls: customizePrefixCls, iconPrefix: customizeIconPrefixCls } = props; const { prefixCls: customizePrefixCls, iconPrefix: customizeIconPrefixCls } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('steps', customizePrefixCls); const prefixCls = getPrefixCls('steps', customizePrefixCls);
const iconPrefix = getPrefixCls('', customizeIconPrefixCls); const iconPrefix = getPrefixCls('', customizeIconPrefixCls);

View File

@ -26,7 +26,7 @@ const Switch = {
loading: PropTypes.bool, loading: PropTypes.bool,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
methods: { methods: {
focus() { focus() {
@ -41,7 +41,7 @@ const Switch = {
const { prefixCls: customizePrefixCls, size, loading, disabled, ...restProps } = getOptionProps( const { prefixCls: customizePrefixCls, size, loading, disabled, ...restProps } = getOptionProps(
this, this,
); );
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('switch', customizePrefixCls); const prefixCls = getPrefixCls('switch', customizePrefixCls);
const classes = { const classes = {

View File

@ -73,7 +73,7 @@ export default {
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
// CheckboxPropsCache: { // CheckboxPropsCache: {
// [key: string]: any; // [key: string]: any;
@ -1135,10 +1135,8 @@ export default {
props: { ...loading }, props: { ...loading },
}; };
} }
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const renderEmpty = const renderEmpty = this.configProvider.renderEmpty;
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
ConfigConsumerProps.renderEmpty;
const prefixCls = getPrefixCls('table', customizePrefixCls); const prefixCls = getPrefixCls('table', customizePrefixCls);
const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls); const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);

View File

@ -31,7 +31,7 @@ export default {
renderTabBar: PropTypes.func, renderTabBar: PropTypes.func,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
mounted() { mounted() {
const NO_FLEX = ' no-flex'; const NO_FLEX = ' no-flex';
@ -76,7 +76,7 @@ export default {
hideAdd, hideAdd,
renderTabBar, renderTabBar,
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('tabs', customizePrefixCls); const prefixCls = getPrefixCls('tabs', customizePrefixCls);
const children = filterEmpty(this.$slots.default); const children = filterEmpty(this.$slots.default);

View File

@ -97,7 +97,7 @@ const TimePicker = {
}; };
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
const value = this.value || this.defaultValue; const value = this.value || this.defaultValue;
@ -185,7 +185,7 @@ const TimePicker = {
props = omit(props, ['defaultValue', 'suffixIcon', 'allowEmpty', 'allowClear']); props = omit(props, ['defaultValue', 'suffixIcon', 'allowEmpty', 'allowClear']);
const { prefixCls: customizePrefixCls, getPopupContainer, placeholder, size } = props; const { prefixCls: customizePrefixCls, getPopupContainer, placeholder, size } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('time-picker', customizePrefixCls); const prefixCls = getPrefixCls('time-picker', customizePrefixCls);
const format = this.getDefaultFormat(); const format = this.getDefaultFormat();

View File

@ -26,11 +26,11 @@ export default {
reverse: false, reverse: false,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, reverse, mode, ...restProps } = getOptionProps(this); const { prefixCls: customizePrefixCls, reverse, mode, ...restProps } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('timeline', customizePrefixCls); const prefixCls = getPrefixCls('timeline', customizePrefixCls);
const pendingDot = getComponentFromProp(this, 'pendingDot'); const pendingDot = getComponentFromProp(this, 'pendingDot');

View File

@ -17,11 +17,11 @@ export default {
pending: false, pending: false,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
render() { render() {
const { prefixCls: customizePrefixCls, color = '', pending } = getOptionProps(this); const { prefixCls: customizePrefixCls, color = '', pending } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('timeline', customizePrefixCls); const prefixCls = getPrefixCls('timeline', customizePrefixCls);
const dot = getComponentFromProp(this, 'dot'); const dot = getComponentFromProp(this, 'dot');

View File

@ -35,7 +35,7 @@ export default {
title: PropTypes.any, title: PropTypes.any,
}, },
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
return { return {
@ -161,7 +161,7 @@ export default {
const { $props, $data, $slots, $listeners } = this; const { $props, $data, $slots, $listeners } = this;
const { prefixCls: customizePrefixCls, openClassName, getPopupContainer } = $props; const { prefixCls: customizePrefixCls, openClassName, getPopupContainer } = $props;
const { getPopupContainer: getContextPopupContainer } = this.configProvider; const { getPopupContainer: getContextPopupContainer } = this.configProvider;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('tooltip', customizePrefixCls); const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
let children = ($slots.default || []).filter(c => c.tag || c.text.trim() !== ''); let children = ($slots.default || []).filter(c => c.tag || c.text.trim() !== '');
children = children.length === 1 ? children[0] : children; children = children.length === 1 ? children[0] : children;

View File

@ -60,7 +60,7 @@ const Transfer = {
showSearch: false, showSearch: false,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
data() { data() {
// vue slot便notFoundContentsearchPlaceholder // vue slot便notFoundContentsearchPlaceholder
@ -346,12 +346,10 @@ const Transfer = {
filterOption, filterOption,
lazy, lazy,
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('transfer', customizePrefixCls); const prefixCls = getPrefixCls('transfer', customizePrefixCls);
const renderEmpty = const renderEmpty = this.configProvider.renderEmpty;
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
ConfigConsumerProps.renderEmpty;
const locale = this.getLocale(transferLocale, renderEmpty); const locale = this.getLocale(transferLocale, renderEmpty);
const { const {
leftFilter, leftFilter,

View File

@ -96,7 +96,7 @@ const TreeSelect = {
getPopupContainer, getPopupContainer,
...restProps ...restProps
} = props; } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('select', customizePrefixCls); const prefixCls = getPrefixCls('select', customizePrefixCls);
const renderEmpty = this.configProvider.renderEmpty; const renderEmpty = this.configProvider.renderEmpty;

View File

@ -9,16 +9,10 @@ import BaseMixin from '../_util/BaseMixin';
import { initDefaultProps, getOptionProps } from '../_util/props-util'; import { initDefaultProps, getOptionProps } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumerProps } from '../config-provider';
// export type ExpandAction = false | 'click' | 'doubleClick'; // export type ExpandAction = false | 'click' | 'doubleClick'; export interface
// DirectoryTreeProps extends TreeProps { expandAction?: ExpandAction; }
// export interface DirectoryTreeProps extends TreeProps { // export interface DirectoryTreeState { expandedKeys?: string[];
// expandAction?: ExpandAction; // selectedKeys?: string[]; }
// }
// export interface DirectoryTreeState {
// expandedKeys?: string[];
// selectedKeys?: string[];
// }
function getIcon(props, h) { function getIcon(props, h) {
const { isLeaf, expanded } = props; const { isLeaf, expanded } = props;
@ -36,21 +30,23 @@ export default {
event: 'check', event: 'check',
}, },
props: initDefaultProps( props: initDefaultProps(
{ ...TreeProps(), expandAction: PropTypes.oneOf([false, 'click', 'doubleclick']) }, {
...TreeProps(),
expandAction: PropTypes.oneOf([false, 'click', 'doubleclick']),
},
{ {
showIcon: true, showIcon: true,
expandAction: 'click', expandAction: 'click',
}, },
), ),
// state: DirectoryTreeState; // state: DirectoryTreeState; onDebounceExpand: (event, node: AntTreeNode) =>
// onDebounceExpand: (event, node: AntTreeNode) => void; // void; // Shift click usage lastSelectedKey?: string; cachedSelectedKeys?:
// string[];
// // Shift click usage
// lastSelectedKey?: string;
// cachedSelectedKeys?: string[];
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: {
default: () => ConfigConsumerProps,
},
}, },
data() { data() {
const props = getOptionProps(this); const props = getOptionProps(this);
@ -69,9 +65,7 @@ export default {
state._expandedKeys = expandedKeys || defaultExpandedKeys; state._expandedKeys = expandedKeys || defaultExpandedKeys;
} }
this.onDebounceExpand = debounce(this.expandFolderNode, 200, { this.onDebounceExpand = debounce(this.expandFolderNode, 200, { leading: true });
leading: true,
});
return { return {
_selectedKeys: [], _selectedKeys: [],
_expandedKeys: [], _expandedKeys: [],
@ -184,7 +178,7 @@ export default {
render() { render() {
const { prefixCls: customizePrefixCls, ...props } = getOptionProps(this); const { prefixCls: customizePrefixCls, ...props } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('tree', customizePrefixCls); const prefixCls = getPrefixCls('tree', customizePrefixCls);
const { _expandedKeys: expandedKeys, _selectedKeys: selectedKeys } = this.$data; const { _expandedKeys: expandedKeys, _selectedKeys: selectedKeys } = this.$data;
const treeProps = { const treeProps = {

View File

@ -107,7 +107,7 @@ export default {
}, },
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
created() { created() {
warning( warning(
@ -189,7 +189,7 @@ export default {
render() { render() {
const props = getOptionProps(this); const props = getOptionProps(this);
const { prefixCls: customizePrefixCls, showIcon, treeNodes } = props; const { prefixCls: customizePrefixCls, showIcon, treeNodes } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('tree', customizePrefixCls); const prefixCls = getPrefixCls('tree', customizePrefixCls);
const switcherIcon = getComponentFromProp(this, 'switcherIcon'); const switcherIcon = getComponentFromProp(this, 'switcherIcon');
const checkable = props.checkable; const checkable = props.checkable;

View File

@ -32,7 +32,7 @@ export default {
supportServerRender: true, supportServerRender: true,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
// recentUploadStatus: boolean | PromiseLike<any>; // recentUploadStatus: boolean | PromiseLike<any>;
data() { data() {
@ -227,7 +227,7 @@ export default {
disabled, disabled,
} = getOptionProps(this); } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('upload', customizePrefixCls); const prefixCls = getPrefixCls('upload', customizePrefixCls);
const vcUploadProps = { const vcUploadProps = {

View File

@ -60,7 +60,7 @@ export default {
showPreviewIcon: true, showPreviewIcon: true,
}), }),
inject: { inject: {
configProvider: { default: () => ({}) }, configProvider: { default: () => ConfigConsumerProps },
}, },
updated() { updated() {
this.$nextTick(() => { this.$nextTick(() => {
@ -112,7 +112,7 @@ export default {
showRemoveIcon, showRemoveIcon,
locale, locale,
} = getOptionProps(this); } = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('upload', customizePrefixCls); const prefixCls = getPrefixCls('upload', customizePrefixCls);
const list = items.map(file => { const list = items.map(file => {

View File

@ -73,7 +73,8 @@ export default {
if ( if (
!reAlign && !reAlign &&
source && source &&
(!isSimilarValue(preRect.width, sourceRect.width) || !isSimilarValue(preRect.height, sourceRect.height)) (!isSimilarValue(preRect.width, sourceRect.width) ||
!isSimilarValue(preRect.height, sourceRect.height))
) { ) {
reAlign = true; reAlign = true;
} }

View File

@ -46,10 +46,7 @@ export function isSimilarValue(val1, val2) {
export function restoreFocus(activeElement, container) { export function restoreFocus(activeElement, container) {
// Focus back if is in the container // Focus back if is in the container
if ( if (activeElement !== document.activeElement && contains(container, activeElement)) {
activeElement !== document.activeElement &&
contains(container, activeElement)
) {
activeElement.focus(); activeElement.focus();
} }
} }

View File

@ -57,7 +57,7 @@ export default {
const key = option[this.getFieldName('value')]; const key = option[this.getFieldName('value')];
const expandProps = { const expandProps = {
attrs: { attrs: {
role: "menuitem", role: 'menuitem',
}, },
on: { on: {
click: onSelect, click: onSelect,

View File

@ -84,7 +84,7 @@ export default {
let panelEvents = {}; let panelEvents = {};
if (!disabled && disabled !== '') { if (!disabled && disabled !== '') {
panelEvents = { panelEvents = {
itemClick: this.onClickItem, itemClick: this.onClickItem,
}; };
} }