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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,7 +26,7 @@ export default {
loadError: Function,
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
data() {
return {
@ -89,7 +89,7 @@ export default {
render() {
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 { isImgExist, scale } = this.$data;

View File

@ -37,7 +37,7 @@ const BackTop = {
visibilityHeight: PropTypes.number.def(400),
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
data() {
this.scrollEvent = null;
@ -108,7 +108,7 @@ const BackTop = {
render() {
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 defaultElement = (

View File

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

View File

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

View File

@ -34,7 +34,7 @@ export default {
name: 'ABreadcrumb',
props: BreadcrumbProps,
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
methods: {
defaultItemRender({ route, params, routes, paths }) {
@ -46,7 +46,7 @@ export default {
render() {
let crumbs;
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 children = filterEmpty($slots.default);

View File

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

View File

@ -15,7 +15,7 @@ export default {
name: 'AButtonGroup',
props: ButtonGroupProps,
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
data() {
return {
@ -27,7 +27,7 @@ export default {
},
render() {
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);
// large => lg

View File

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

View File

@ -24,7 +24,7 @@ export default {
yearSelectTotal: 20,
}),
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
// private calenderHeaderNode: HTMLDivElement;
methods: {
@ -136,7 +136,7 @@ export default {
render() {
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 yearSelect = this.getYearSelectElement(prefixCls, value.year());

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,11 +8,11 @@ export default {
...panelProps(),
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
render() {
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 collapsePanelClassName = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,11 +11,11 @@ const Divider = {
orientation: PropTypes.oneOf(['left', 'right']),
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
render() {
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 orientationPrefix = orientation.length > 0 ? '-' + orientation : orientation;

View File

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

View File

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

View File

@ -27,7 +27,7 @@ const Dropdown = {
};
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
methods: {
savePopupRef(ref) {
@ -76,7 +76,7 @@ const Dropdown = {
const props = getOptionProps(this);
const { prefixCls: customizePrefixCls, trigger, disabled, getPopupContainer } = props;
const { getPopupContainer: getContextPopupContainer } = this.configProvider;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
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-spin-nested-loading">
<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>

View File

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

View File

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

View File

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

View File

@ -59,7 +59,7 @@ export default {
};
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
data() {
return {
@ -119,7 +119,7 @@ export default {
render() {
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 gutter = this.getGutter();

View File

@ -36,7 +36,7 @@ const InputNumber = {
step: 1,
}),
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
methods: {
focus() {
@ -49,7 +49,7 @@ const InputNumber = {
render() {
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 inputNumberClass = classNames({

View File

@ -14,12 +14,12 @@ export default {
compact: Boolean,
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
computed: {
classes() {
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);
return {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -52,7 +52,7 @@ const Menu = {
mixins: [BaseMixin],
inject: {
layoutSiderContext: { default: () => ({}) },
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
model: {
prop: 'selectedKeys',
@ -209,7 +209,7 @@ const Menu = {
const { collapsedWidth } = layoutSiderContext;
const { getPopupContainer: getContextPopupContainer } = this.configProvider;
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 menuMode = this.getRealMenuMode();
const menuOpenAnimation = this.getMenuOpenAnimation(menuMode);

View File

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

View File

@ -4,7 +4,7 @@ import MiniSelect from './MiniSelect';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import { getOptionProps } from '../_util/props-util';
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 { ConfigConsumerProps } from '../config-provider';
@ -93,7 +93,7 @@ export default {
locale: customLocale,
...restProps
} = getOptionProps(this);
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('pagination', customizePrefixCls);
const selectPrefixCls = getPrefixCls('select', customizeSelectPrefixCls);
@ -119,7 +119,11 @@ export default {
},
render() {
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() {
const props = getOptionProps(this);
const { prefixCls: customizePrefixCls } = props;
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('popover', customizePrefixCls);
const otherProps = omit(props, ['title', 'content', 'cancelText', 'okText']);

View File

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

View File

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

View File

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

View File

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

View File

@ -12,11 +12,11 @@ export default {
},
inject: {
radioGroupContext: { default: undefined },
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
render() {
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 radioProps = {

View File

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

View File

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

View File

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

View File

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

View File

@ -26,12 +26,12 @@ export default {
groupSeparator: ',',
}),
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
render() {
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 title = getComponentFromProp(this, 'title');

View File

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

View File

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

View File

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

View File

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

View File

@ -97,7 +97,7 @@ const TimePicker = {
};
},
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
data() {
const value = this.value || this.defaultValue;
@ -185,7 +185,7 @@ const TimePicker = {
props = omit(props, ['defaultValue', 'suffixIcon', 'allowEmpty', 'allowClear']);
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 format = this.getDefaultFormat();

View File

@ -26,11 +26,11 @@ export default {
reverse: false,
}),
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
render() {
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 pendingDot = getComponentFromProp(this, 'pendingDot');

View File

@ -17,11 +17,11 @@ export default {
pending: false,
}),
inject: {
configProvider: { default: () => ({}) },
configProvider: { default: () => ConfigConsumerProps },
},
render() {
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 dot = getComponentFromProp(this, 'dot');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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