diff --git a/components/carousel/index.jsx b/components/carousel/index.jsx index 2adbc46a2..a00d55886 100644 --- a/components/carousel/index.jsx +++ b/components/carousel/index.jsx @@ -2,7 +2,7 @@ import PropTypes from '../_util/vue-types'; import debounce from 'lodash/debounce'; import hasProp, { initDefaultProps, - getComponentFromProp, + getComponent, filterEmpty, getListeners, } from '../_util/props-util'; @@ -174,8 +174,8 @@ const Carousel = { const SlickCarouselProps = { props: { ...props, - nextArrow: getComponentFromProp(this, 'nextArrow'), - prevArrow: getComponentFromProp(this, 'prevArrow'), + nextArrow: getComponent(this, 'nextArrow'), + prevArrow: getComponent(this, 'prevArrow'), }, on: getListeners(this), scopedSlots: this.$scopedSlots, diff --git a/components/date-picker/RangePicker.jsx b/components/date-picker/RangePicker.jsx index 193f9fdc5..2bd257f12 100644 --- a/components/date-picker/RangePicker.jsx +++ b/components/date-picker/RangePicker.jsx @@ -13,7 +13,7 @@ import { getOptionProps, initDefaultProps, mergeProps, - getComponentFromProp, + getComponent, getListeners, } from '../_util/props-util'; import BaseMixin from '../_util/BaseMixin'; @@ -262,7 +262,7 @@ export default { render() { const props = getOptionProps(this); - let suffixIcon = getComponentFromProp(this, 'suffixIcon'); + let suffixIcon = getComponent(this, 'suffixIcon'); suffixIcon = Array.isArray(suffixIcon) ? suffixIcon[0] : suffixIcon; const { sValue: value, diff --git a/components/date-picker/WeekPicker.jsx b/components/date-picker/WeekPicker.jsx index 402fa46c3..ed3f76ceb 100644 --- a/components/date-picker/WeekPicker.jsx +++ b/components/date-picker/WeekPicker.jsx @@ -7,7 +7,7 @@ import { hasProp, getOptionProps, initDefaultProps, - getComponentFromProp, + getComponent, getListeners, } from '../_util/props-util'; import BaseMixin from '../_util/BaseMixin'; @@ -135,7 +135,7 @@ export default { render() { const props = getOptionProps(this); - let suffixIcon = getComponentFromProp(this, 'suffixIcon'); + let suffixIcon = getComponent(this, 'suffixIcon'); suffixIcon = Array.isArray(suffixIcon) ? suffixIcon[0] : suffixIcon; const { prefixCls: customizePrefixCls, diff --git a/components/date-picker/createPicker.js b/components/date-picker/createPicker.js index 889a79252..c7a7bf37e 100644 --- a/components/date-picker/createPicker.js +++ b/components/date-picker/createPicker.js @@ -13,7 +13,7 @@ import { getOptionProps, initDefaultProps, mergeProps, - getComponentFromProp, + getComponent, isValidElement, getListeners, } from '../_util/props-util'; @@ -135,7 +135,7 @@ export default function createPicker(TheCalendar, props) { render() { const { $scopedSlots } = this; const { sValue: value, showDate, _open: open } = this.$data; - let suffixIcon = getComponentFromProp(this, 'suffixIcon'); + let suffixIcon = getComponent(this, 'suffixIcon'); suffixIcon = Array.isArray(suffixIcon) ? suffixIcon[0] : suffixIcon; const listeners = getListeners(this); const { panelChange = noop, focus = noop, blur = noop, ok = noop } = listeners; diff --git a/components/time-picker/index.jsx b/components/time-picker/index.jsx index 2248cd344..b5b091175 100644 --- a/components/time-picker/index.jsx +++ b/components/time-picker/index.jsx @@ -11,7 +11,7 @@ import { initDefaultProps, hasProp, getOptionProps, - getComponentFromProp, + getComponent, isValidElement, getListeners, } from '../_util/props-util'; @@ -174,7 +174,7 @@ const TimePicker = { }, renderInputIcon(prefixCls) { - let suffixIcon = getComponentFromProp(this, 'suffixIcon'); + let suffixIcon = getComponent(this, 'suffixIcon'); suffixIcon = Array.isArray(suffixIcon) ? suffixIcon[0] : suffixIcon; const clockIcon = (suffixIcon && isValidElement(suffixIcon) && @@ -186,7 +186,7 @@ const TimePicker = { }, renderClearIcon(prefixCls) { - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); const clearIconPrefixCls = `${prefixCls}-clear`; if (clearIcon && isValidElement(clearIcon)) { @@ -210,7 +210,7 @@ const TimePicker = { const pickerClassName = { [`${prefixCls}-${size}`]: !!size, }; - const tempAddon = getComponentFromProp(this, 'addon', {}, false); + const tempAddon = getComponent(this, 'addon', {}, false); const pickerAddon = panel => { return tempAddon ? (
diff --git a/components/vc-calendar/src/Calendar.jsx b/components/vc-calendar/src/Calendar.jsx index e27eaeb71..f0208573d 100644 --- a/components/vc-calendar/src/Calendar.jsx +++ b/components/vc-calendar/src/Calendar.jsx @@ -1,6 +1,6 @@ import PropTypes from '../../_util/vue-types'; import BaseMixin from '../../_util/BaseMixin'; -import { getOptionProps, hasProp, getComponentFromProp } from '../../_util/props-util'; +import { getOptionProps, hasProp, getComponent } from '../../_util/props-util'; import { cloneElement } from '../../_util/vnode'; import KeyCode from '../../_util/KeyCode'; import moment from 'moment'; @@ -261,7 +261,7 @@ const Calendar = { monthCellContentRender, $props: props, } = this; - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); const showTimePicker = sMode === 'time'; const disabledTimeConfig = showTimePicker && disabledTime && timePicker diff --git a/components/vc-calendar/src/RangeCalendar.jsx b/components/vc-calendar/src/RangeCalendar.jsx index 9e7b3d78a..7922d691a 100644 --- a/components/vc-calendar/src/RangeCalendar.jsx +++ b/components/vc-calendar/src/RangeCalendar.jsx @@ -4,7 +4,7 @@ import { getOptionProps, hasProp, mergeProps, - getComponentFromProp, + getComponent, getListeners, } from '../../_util/props-util'; import moment from 'moment'; @@ -669,7 +669,7 @@ const RangeCalendar = { type, seperator, } = props; - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); const { sHoverValue, sSelectedValue, sMode: mode, sShowTimePicker, sValue } = this; const className = { [prefixCls]: 1, diff --git a/components/vc-calendar/src/date/DateInput.jsx b/components/vc-calendar/src/date/DateInput.jsx index bcc059c52..c45efe328 100644 --- a/components/vc-calendar/src/date/DateInput.jsx +++ b/components/vc-calendar/src/date/DateInput.jsx @@ -1,6 +1,6 @@ import PropTypes from '../../../_util/vue-types'; import BaseMixin from '../../../_util/BaseMixin'; -import { getComponentFromProp } from '../../../_util/props-util'; +import { getComponent } from '../../../_util/props-util'; import moment from 'moment'; import { formatDate } from '../util'; import KeyCode from '../../../_util/KeyCode'; @@ -184,7 +184,7 @@ const DateInput = { inputMode, inputReadOnly, } = this; - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; return (
diff --git a/components/vc-calendar/src/range-calendar/CalendarPart.jsx b/components/vc-calendar/src/range-calendar/CalendarPart.jsx index 3191cdaec..e289b34f3 100644 --- a/components/vc-calendar/src/range-calendar/CalendarPart.jsx +++ b/components/vc-calendar/src/range-calendar/CalendarPart.jsx @@ -1,6 +1,6 @@ import PropTypes from '../../../_util/vue-types'; import BaseMixin from '../../../_util/BaseMixin'; -import { getOptionProps, getComponentFromProp, getListeners } from '../../../_util/props-util'; +import { getOptionProps, getComponent, getListeners } from '../../../_util/props-util'; import { cloneElement } from '../../../_util/vnode'; import CalendarHeader from '../calendar/CalendarHeader'; import DateTable from '../date/DateTable'; @@ -62,7 +62,7 @@ const CalendarPart = { inputMode, inputReadOnly, } = props; - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); const { inputChange = noop, inputSelect = noop, diff --git a/components/vc-time-picker/Panel.jsx b/components/vc-time-picker/Panel.jsx index f560d2726..b2a590193 100644 --- a/components/vc-time-picker/Panel.jsx +++ b/components/vc-time-picker/Panel.jsx @@ -3,7 +3,7 @@ import PropTypes from '../_util/vue-types'; import BaseMixin from '../_util/BaseMixin'; import Header from './Header'; import Combobox from './Combobox'; -import { getComponentFromProp, getListeners } from '../_util/props-util'; +import { getComponent, getListeners } from '../_util/props-util'; function noop() {} @@ -144,7 +144,7 @@ const Panel = { sValue, currentSelectPanel, } = this; - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); const { esc = noop, keydown = noop } = getListeners(this); const disabledHourOptions = this.disabledHours2(); diff --git a/components/vc-time-picker/TimePicker.jsx b/components/vc-time-picker/TimePicker.jsx index e19f200c4..44d9efd26 100644 --- a/components/vc-time-picker/TimePicker.jsx +++ b/components/vc-time-picker/TimePicker.jsx @@ -5,7 +5,7 @@ import BaseMixin from '../_util/BaseMixin'; import { initDefaultProps, hasProp, - getComponentFromProp, + getComponent, isValidElement, getEvents, } from '../_util/props-util'; @@ -205,7 +205,7 @@ export default { secondStep, sValue, } = this; - const clearIcon = getComponentFromProp(this, 'clearIcon'); + const clearIcon = getComponent(this, 'clearIcon'); return (