fix: getComponentFromProp to getComponent
parent
a194bbdf43
commit
a3592033be
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 ? (
|
||||
<div class={`${prefixCls}-panel-addon`}>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 (
|
||||
<div class={`${prefixCls}-input-wrap`}>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 (
|
||||
<Panel
|
||||
clearText={clearText}
|
||||
|
@ -296,7 +296,7 @@ export default {
|
|||
if (!allowEmpty || !sValue || disabled) {
|
||||
return null;
|
||||
}
|
||||
const clearIcon = getComponentFromProp(this, 'clearIcon');
|
||||
const clearIcon = getComponent(this, 'clearIcon');
|
||||
if (isValidElement(clearIcon)) {
|
||||
const { click } = getEvents(clearIcon) || {};
|
||||
return cloneElement(clearIcon, {
|
||||
|
@ -344,7 +344,7 @@ export default {
|
|||
popupStyle,
|
||||
} = this;
|
||||
const popupClassName = this.getPopupClassName();
|
||||
const inputIcon = getComponentFromProp(this, 'inputIcon');
|
||||
const inputIcon = getComponent(this, 'inputIcon');
|
||||
return (
|
||||
<Trigger
|
||||
prefixCls={`${prefixCls}-panel`}
|
||||
|
|
Loading…
Reference in New Issue