fix: proptypes.bool default value error

pull/2992/head
tangjinzhou 2020-10-11 21:31:57 +08:00
parent 4c9d3161fd
commit 95eaf941d7
42 changed files with 140 additions and 130 deletions

@ -1 +1 @@
Subproject commit ac51177e860801a773d0e4241931d03be0efce65 Subproject commit 88970d13f8e2e6f5c96a28697fe0b399eccdcb07

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
export default () => ({ export default () => ({
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
type: PropTypes.string, type: PropTypes.string,
@ -6,7 +6,7 @@ export default () => ({
// icon: PropTypes.string, // icon: PropTypes.string,
shape: PropTypes.oneOf(['circle', 'circle-outline', 'round']), shape: PropTypes.oneOf(['circle', 'circle-outline', 'round']),
size: PropTypes.oneOf(['small', 'large', 'default']).def('default'), size: PropTypes.oneOf(['small', 'large', 'default']).def('default'),
loading: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,
ghost: PropTypes.looseBool, ghost: PropTypes.looseBool,
block: PropTypes.looseBool, block: PropTypes.looseBool,

View File

@ -1,5 +1,5 @@
import { inject, provide } from 'vue'; import { inject, provide } from 'vue';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import VcCascader from '../vc-cascader'; import VcCascader from '../vc-cascader';
import arrayTreeFilter from 'array-tree-filter'; import arrayTreeFilter from 'array-tree-filter';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
@ -45,7 +45,7 @@ const ShowSearchType = PropTypes.shape({
render: PropTypes.func, render: PropTypes.func,
sort: PropTypes.func, sort: PropTypes.func,
matchInputWidth: PropTypes.looseBool, matchInputWidth: PropTypes.looseBool,
limit: PropTypes.oneOfType([Boolean, Number]), limit: withUndefined(PropTypes.oneOfType([Boolean, Number])),
}).loose; }).loose;
function noop() {} function noop() {}
@ -76,7 +76,7 @@ const CascaderProps = {
disabled: PropTypes.looseBool.def(false), disabled: PropTypes.looseBool.def(false),
/** 是否支持清除*/ /** 是否支持清除*/
allowClear: PropTypes.looseBool.def(true), allowClear: PropTypes.looseBool.def(true),
showSearch: PropTypes.oneOfType([Boolean, ShowSearchType]), showSearch: withUndefined(PropTypes.oneOfType([Boolean, ShowSearchType])),
notFoundContent: PropTypes.any, notFoundContent: PropTypes.any,
loadData: PropTypes.func, loadData: PropTypes.func,
/** 次级菜单的展开方式,可选 'click' 和 'hover' */ /** 次级菜单的展开方式,可选 'click' 和 'hover' */

View File

@ -1,5 +1,5 @@
// import { TimePickerProps } from '../time-picker' // import { TimePickerProps } from '../time-picker'
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { TimesType, TimeType } from '../_util/moment-util'; import { TimesType, TimeType } from '../_util/moment-util';
export const PickerProps = () => ({ export const PickerProps = () => ({
@ -50,7 +50,7 @@ export const SinglePickerProps = () => ({
export const DatePickerProps = () => ({ export const DatePickerProps = () => ({
...PickerProps(), ...PickerProps(),
...SinglePickerProps(), ...SinglePickerProps(),
showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool]), showTime: withUndefined(PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool])),
open: PropTypes.looseBool, open: PropTypes.looseBool,
disabledTime: PropTypes.func, disabledTime: PropTypes.func,
mode: PropTypes.oneOf(['time', 'date', 'month', 'year']), mode: PropTypes.oneOf(['time', 'date', 'month', 'year']),
@ -74,7 +74,7 @@ export const RangePickerProps = () => ({
defaultValue: TimesType, defaultValue: TimesType,
defaultPickerValue: TimesType, defaultPickerValue: TimesType,
timePicker: PropTypes.any, timePicker: PropTypes.any,
showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool]), showTime: withUndefined(PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool])),
ranges: PropTypes.object, ranges: PropTypes.object,
placeholder: PropTypes.arrayOf(String), placeholder: PropTypes.arrayOf(String),
mode: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(String)]), mode: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(String)]),

View File

@ -12,7 +12,7 @@ export default {
return ['small', 'large', 'default'].includes(value); return ['small', 'large', 'default'].includes(value);
}, },
}, },
compact: Boolean, compact: PropTypes.looseBool,
}, },
setup() { setup() {
return { return {

View File

@ -6,7 +6,7 @@ import raf from '../_util/raf';
import warning from '../_util/warning'; import warning from '../_util/warning';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import inputProps from './inputProps'; import inputProps from './inputProps';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { getOptionProps } from '../_util/props-util'; import { getOptionProps } from '../_util/props-util';
import { withDirectives } from 'vue'; import { withDirectives } from 'vue';
import antInput from '../_util/antInputDirective'; import antInput from '../_util/antInputDirective';
@ -17,8 +17,8 @@ const RESIZE_STATUS_RESIZED = 2;
const TextAreaProps = { const TextAreaProps = {
...inputProps, ...inputProps,
autosize: PropTypes.oneOfType([Object, Boolean]), autosize: withUndefined(PropTypes.oneOfType([Object, Boolean])),
autoSize: PropTypes.oneOfType([Object, Boolean]), autoSize: withUndefined(PropTypes.oneOfType([Object, Boolean])),
onResize: PropTypes.func, onResize: PropTypes.func,
}; };
const ResizableTextArea = { const ResizableTextArea = {

View File

@ -5,12 +5,12 @@ import inputProps from './inputProps';
import { hasProp, getOptionProps } from '../_util/props-util'; import { hasProp, getOptionProps } from '../_util/props-util';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
import { fixControlledValue, resolveOnChange } from './Input'; import { fixControlledValue, resolveOnChange } from './Input';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
const TextAreaProps = { const TextAreaProps = {
...inputProps, ...inputProps,
autosize: PropTypes.oneOfType([Object, Boolean]), autosize: withUndefined(PropTypes.oneOfType([Object, Boolean])),
autoSize: PropTypes.oneOfType([Object, Boolean]), autoSize: withUndefined(PropTypes.oneOfType([Object, Boolean])),
}; };
export default { export default {

View File

@ -24,8 +24,8 @@ export default {
prefix: PropTypes.any, prefix: PropTypes.any,
suffix: PropTypes.any, suffix: PropTypes.any,
// spellCheck: Boolean, // spellCheck: Boolean,
autofocus: Boolean, autofocus: PropTypes.looseBool,
allowClear: Boolean, allowClear: PropTypes.looseBool,
lazy: { lazy: {
default: true, default: true,
type: Boolean, type: Boolean,

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import omit from 'omit.js'; import omit from 'omit.js';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
@ -37,9 +37,11 @@ export const ListProps = () => ({
extra: PropTypes.any, extra: PropTypes.any,
grid: PropTypes.shape(ListGridType).loose, grid: PropTypes.shape(ListGridType).loose,
itemLayout: PropTypes.string, itemLayout: PropTypes.string,
loading: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
loadMore: PropTypes.any, loadMore: PropTypes.any,
pagination: PropTypes.oneOfType([PropTypes.shape(PaginationConfig()).loose, PropTypes.looseBool]), pagination: withUndefined(
PropTypes.oneOfType([PropTypes.shape(PaginationConfig()).loose, PropTypes.looseBool]),
),
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
rowKey: PropTypes.any, rowKey: PropTypes.any,
renderItem: PropTypes.any, renderItem: PropTypes.any,

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import VcSelect from '../select'; import VcSelect from '../select';
import MiniSelect from './MiniSelect'; import MiniSelect from './MiniSelect';
import LocaleReceiver from '../locale-provider/LocaleReceiver'; import LocaleReceiver from '../locale-provider/LocaleReceiver';
@ -25,7 +25,7 @@ export const PaginationProps = () => ({
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
buildOptionText: PropTypes.func, buildOptionText: PropTypes.func,
showSizeChange: PropTypes.func, showSizeChange: PropTypes.func,
showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), showQuickJumper: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
showTotal: PropTypes.any, showTotal: PropTypes.any,
size: PropTypes.string, size: PropTypes.string,
simple: PropTypes.looseBool, simple: PropTypes.looseBool,

View File

@ -21,7 +21,7 @@ export default {
default: () => [], default: () => [],
type: Array, type: Array,
}, },
disabled: Boolean, disabled: PropTypes.looseBool,
name: String, name: String,
buttonStyle: PropTypes.string.def('outline'), buttonStyle: PropTypes.string.def('outline'),
onChange: PropTypes.func, onChange: PropTypes.func,

View File

@ -12,14 +12,14 @@ export default {
}, },
props: { props: {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
defaultChecked: Boolean, defaultChecked: PropTypes.looseBool,
checked: { type: Boolean, default: undefined }, checked: PropTypes.looseBool,
disabled: Boolean, disabled: PropTypes.looseBool,
isGroup: Boolean, isGroup: PropTypes.looseBool,
value: PropTypes.any, value: PropTypes.any,
name: String, name: String,
id: String, id: String,
autofocus: Boolean, autofocus: PropTypes.looseBool,
type: PropTypes.string.def('radio'), type: PropTypes.string.def('radio'),
onChange: PropTypes.func, onChange: PropTypes.func,
onFocus: PropTypes.func, onFocus: PropTypes.func,

View File

@ -1,7 +1,7 @@
import { provide, inject } from 'vue'; import { provide, inject } from 'vue';
import warning from '../_util/warning'; import warning from '../_util/warning';
import omit from 'omit.js'; import omit from 'omit.js';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { Select as VcSelect, Option, OptGroup } from '../vc-select'; import { Select as VcSelect, Option, OptGroup } from '../vc-select';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
import { getComponent, getOptionProps, isValidElement, getSlot } from '../_util/props-util'; import { getComponent, getOptionProps, isValidElement, getSlot } from '../_util/props-util';
@ -30,7 +30,7 @@ const AbstractSelectProps = () => ({
dropdownMenuStyle: PropTypes.any, dropdownMenuStyle: PropTypes.any,
dropdownMatchSelectWidth: PropTypes.looseBool, dropdownMatchSelectWidth: PropTypes.looseBool,
// onSearch: (value: string) => any, // onSearch: (value: string) => any,
filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]), filterOption: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
autofocus: PropTypes.looseBool, autofocus: PropTypes.looseBool,
backfill: PropTypes.looseBool, backfill: PropTypes.looseBool,
showArrow: PropTypes.looseBool, showArrow: PropTypes.looseBool,

View File

@ -1,6 +1,6 @@
import { inject } from 'vue'; import { inject } from 'vue';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { initDefaultProps, hasProp } from '../_util/props-util'; import { initDefaultProps, hasProp } from '../_util/props-util';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
import Avatar, { SkeletonAvatarProps } from './Avatar'; import Avatar, { SkeletonAvatarProps } from './Avatar';
@ -12,9 +12,15 @@ export const SkeletonProps = {
loading: PropTypes.looseBool, loading: PropTypes.looseBool,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
children: PropTypes.any, children: PropTypes.any,
avatar: PropTypes.oneOfType([PropTypes.string, SkeletonAvatarProps, PropTypes.looseBool]), avatar: withUndefined(
title: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonTitleProps]), PropTypes.oneOfType([PropTypes.string, SkeletonAvatarProps, PropTypes.looseBool]),
paragraph: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonParagraphProps]), ),
title: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonTitleProps]),
),
paragraph: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonParagraphProps]),
),
}; };
function getComponentProps(prop) { function getComponentProps(prop) {

View File

@ -1,7 +1,7 @@
import { inject } from 'vue'; import { inject } from 'vue';
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
import CheckOutlined from '@ant-design/icons-vue/CheckOutlined'; import CheckOutlined from '@ant-design/icons-vue/CheckOutlined';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { initDefaultProps, getOptionProps, getComponent, getSlot } from '../_util/props-util'; import { initDefaultProps, getOptionProps, getComponent, getSlot } from '../_util/props-util';
import VcSteps from '../vc-steps'; import VcSteps from '../vc-steps';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
@ -16,7 +16,7 @@ const getStepsProps = (defaultProps = {}) => {
status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']), status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']),
size: PropTypes.oneOf(['default', 'small']), size: PropTypes.oneOf(['default', 'small']),
direction: PropTypes.oneOf(['horizontal', 'vertical']), direction: PropTypes.oneOf(['horizontal', 'vertical']),
progressDot: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]), progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
type: PropTypes.oneOf(['default', 'navigation']), type: PropTypes.oneOf(['default', 'navigation']),
onChange: PropTypes.func, onChange: PropTypes.func,
'onUpdate:current': PropTypes.func, 'onUpdate:current': PropTypes.func,

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { PaginationProps as getPaginationProps } from '../pagination'; import { PaginationProps as getPaginationProps } from '../pagination';
import { SpinProps as getSpinProps } from '../spin'; import { SpinProps as getSpinProps } from '../spin';
import { Store } from './createStore'; import { Store } from './createStore';
@ -33,12 +33,16 @@ export const ColumnProps = {
colSpan: PropTypes.number, colSpan: PropTypes.number,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
className: PropTypes.string, className: PropTypes.string,
fixed: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.oneOf(['left', 'right'])]), fixed: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.oneOf(['left', 'right'])]),
),
filterIcon: PropTypes.any, filterIcon: PropTypes.any,
filteredValue: PropTypes.array, filteredValue: PropTypes.array,
filtered: PropTypes.looseBool, filtered: PropTypes.looseBool,
defaultFilteredValue: PropTypes.array, defaultFilteredValue: PropTypes.array,
sortOrder: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.oneOf(['ascend', 'descend'])]), sortOrder: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.oneOf(['ascend', 'descend'])]),
),
sortDirections: PropTypes.array, sortDirections: PropTypes.array,
// children?: ColumnProps<T>[]; // children?: ColumnProps<T>[];
// onCellClick?: (record: T, event: any) => void; // onCellClick?: (record: T, event: any) => void;
@ -83,7 +87,7 @@ export const TableRowSelection = {
// onSelect?: SelectionSelectFn<T>; // onSelect?: SelectionSelectFn<T>;
// onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => any; // onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => any;
// onSelectInvert?: (selectedRows: Object[]) => any; // onSelectInvert?: (selectedRows: Object[]) => any;
selections: PropTypes.oneOfType([PropTypes.array, PropTypes.looseBool]), selections: withUndefined(PropTypes.oneOfType([PropTypes.array, PropTypes.looseBool])),
hideDefaultSelections: PropTypes.looseBool, hideDefaultSelections: PropTypes.looseBool,
fixed: PropTypes.looseBool, fixed: PropTypes.looseBool,
columnWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), columnWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),

View File

@ -3,7 +3,7 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
import LeftOutlined from '@ant-design/icons-vue/LeftOutlined'; import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import RightOutlined from '@ant-design/icons-vue/RightOutlined';
import ScrollableInkTabBar from '../vc-tabs/src/ScrollableInkTabBar'; import ScrollableInkTabBar from '../vc-tabs/src/ScrollableInkTabBar';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
const TabBar = { const TabBar = {
name: 'TabBar', name: 'TabBar',
@ -16,7 +16,7 @@ const TabBar = {
tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'), tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'),
tabBarPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), tabBarPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
size: PropTypes.oneOf(['default', 'small', 'large']), size: PropTypes.oneOf(['default', 'small', 'large']),
animated: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), animated: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
renderTabBar: PropTypes.func, renderTabBar: PropTypes.func,
panels: PropTypes.array.def([]), panels: PropTypes.array.def([]),
activeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), activeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),

View File

@ -4,7 +4,7 @@ import PlusOutlined from '@ant-design/icons-vue/PlusOutlined';
import VcTabs, { TabPane } from '../vc-tabs/src'; import VcTabs, { TabPane } from '../vc-tabs/src';
import TabContent from '../vc-tabs/src/TabContent'; import TabContent from '../vc-tabs/src/TabContent';
import { isFlexSupported } from '../_util/styleChecker'; import { isFlexSupported } from '../_util/styleChecker';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { import {
getComponent, getComponent,
getOptionProps, getOptionProps,
@ -33,7 +33,7 @@ export default {
type: PropTypes.oneOf(['line', 'card', 'editable-card']), type: PropTypes.oneOf(['line', 'card', 'editable-card']),
tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'), tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'),
size: PropTypes.oneOf(['default', 'small', 'large']), size: PropTypes.oneOf(['default', 'small', 'large']),
animated: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), animated: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
tabBarGutter: PropTypes.number, tabBarGutter: PropTypes.number,
renderTabBar: PropTypes.func, renderTabBar: PropTypes.func,
onChange: PropTypes.func, onChange: PropTypes.func,

View File

@ -126,10 +126,7 @@ Tag.props = {
color: PropTypes.string, color: PropTypes.string,
closable: PropTypes.looseBool.def(false), closable: PropTypes.looseBool.def(false),
closeIcon: PropTypes.any, closeIcon: PropTypes.any,
visible: { visible: PropTypes.looseBool,
type: Boolean,
default: undefined,
},
onClose: PropTypes.func, onClose: PropTypes.func,
icon: PropTypes.any, icon: PropTypes.any,
}; };

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import Lazyload from '../vc-lazy-load'; import Lazyload from '../vc-lazy-load';
import Checkbox from '../checkbox'; import Checkbox from '../checkbox';
@ -12,7 +12,7 @@ export default {
renderedText: PropTypes.any, renderedText: PropTypes.any,
renderedEl: PropTypes.any, renderedEl: PropTypes.any,
item: PropTypes.any, item: PropTypes.any,
lazy: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), lazy: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
checked: PropTypes.looseBool, checked: PropTypes.looseBool,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,

View File

@ -1,5 +1,5 @@
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { import {
isValidElement, isValidElement,
initDefaultProps, initDefaultProps,
@ -50,7 +50,7 @@ export const TransferListProps = {
body: PropTypes.any, body: PropTypes.any,
renderList: PropTypes.any, renderList: PropTypes.any,
footer: PropTypes.any, footer: PropTypes.any,
lazy: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), lazy: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,
direction: PropTypes.string, direction: PropTypes.string,
showSelectAll: PropTypes.looseBool, showSelectAll: PropTypes.looseBool,

View File

@ -1,7 +1,7 @@
import { TransitionGroup } from 'vue'; import { TransitionGroup } from 'vue';
import raf from '../_util/raf'; import raf from '../_util/raf';
import ListItem from './ListItem'; import ListItem from './ListItem';
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import getTransitionProps from '../_util/getTransitionProps'; import getTransitionProps from '../_util/getTransitionProps';
import { findDOMNode } from '../_util/props-util'; import { findDOMNode } from '../_util/props-util';
function noop() {} function noop() {}
@ -11,7 +11,7 @@ const ListBody = {
props: { props: {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
filteredRenderItems: PropTypes.array.def([]), filteredRenderItems: PropTypes.array.def([]),
lazy: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), lazy: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
selectedKeys: PropTypes.array, selectedKeys: PropTypes.array,
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,
onItemSelect: PropTypes.func, onItemSelect: PropTypes.func,

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { AbstractSelectProps } from '../select'; import { AbstractSelectProps } from '../select';
export const TreeData = PropTypes.shape({ export const TreeData = PropTypes.shape({
@ -13,7 +13,7 @@ export const TreeSelectProps = () => ({
...AbstractSelectProps(), ...AbstractSelectProps(),
autofocus: PropTypes.looseBool, autofocus: PropTypes.looseBool,
dropdownStyle: PropTypes.object, dropdownStyle: PropTypes.object,
filterTreeNode: PropTypes.oneOfType([Function, Boolean]), filterTreeNode: withUndefined(PropTypes.oneOfType([Function, Boolean])),
getPopupContainer: PropTypes.func, getPopupContainer: PropTypes.func,
labelInValue: PropTypes.looseBool, labelInValue: PropTypes.looseBool,
loadData: PropTypes.func, loadData: PropTypes.func,
@ -37,10 +37,10 @@ export const TreeSelectProps = () => ({
searchValue: PropTypes.string, searchValue: PropTypes.string,
showCheckedStrategy: PropTypes.oneOf(['SHOW_ALL', 'SHOW_PARENT', 'SHOW_CHILD']), showCheckedStrategy: PropTypes.oneOf(['SHOW_ALL', 'SHOW_PARENT', 'SHOW_CHILD']),
suffixIcon: PropTypes.any, suffixIcon: PropTypes.any,
treeCheckable: PropTypes.oneOfType([PropTypes.any, PropTypes.looseBool]), treeCheckable: withUndefined(PropTypes.oneOfType([PropTypes.any, PropTypes.looseBool])),
treeCheckStrictly: PropTypes.looseBool, treeCheckStrictly: PropTypes.looseBool,
treeData: PropTypes.arrayOf(Object), treeData: PropTypes.arrayOf(Object),
treeDataSimpleMode: PropTypes.oneOfType([Boolean, Object]), treeDataSimpleMode: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, Object])),
dropdownClassName: PropTypes.string, dropdownClassName: PropTypes.string,
dropdownMatchSelectWidth: PropTypes.looseBool, dropdownMatchSelectWidth: PropTypes.looseBool,

View File

@ -1,6 +1,6 @@
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import { getOptionProps, hasProp, initDefaultProps } from '../../_util/props-util'; import { getOptionProps, hasProp, initDefaultProps } from '../../_util/props-util';
@ -14,8 +14,8 @@ export default {
name: PropTypes.string, name: PropTypes.string,
id: PropTypes.string, id: PropTypes.string,
type: PropTypes.string, type: PropTypes.string,
defaultChecked: PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool]), defaultChecked: withUndefined(PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool])),
checked: PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool]), checked: withUndefined(PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool])),
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,
// onFocus: PropTypes.func, // onFocus: PropTypes.func,
// onBlur: PropTypes.func, // onBlur: PropTypes.func,

View File

@ -1,4 +1,4 @@
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import { initDefaultProps } from '../../_util/props-util'; import { initDefaultProps } from '../../_util/props-util';
import enhancer from './enhancer'; import enhancer from './enhancer';
import { propTypes, defaultProps } from './types'; import { propTypes, defaultProps } from './types';
@ -6,7 +6,9 @@ import { propTypes, defaultProps } from './types';
const circlePropTypes = { const circlePropTypes = {
...propTypes, ...propTypes,
gapPosition: PropTypes.oneOf(['top', 'bottom', 'left', 'right']), gapPosition: PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
gapDegree: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.looseBool]), gapDegree: withUndefined(
PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.looseBool]),
),
}; };
const circleDefaultProps = { const circleDefaultProps = {

View File

@ -49,14 +49,14 @@ const OptionListProps = {
height: PropTypes.number, height: PropTypes.number,
itemHeight: PropTypes.number, itemHeight: PropTypes.number,
values: PropTypes.any, values: PropTypes.any,
multiple: { type: Boolean, default: undefined }, multiple: PropTypes.looseBool,
open: { type: Boolean, default: undefined }, open: PropTypes.looseBool,
defaultActiveFirstOption: { type: Boolean, default: undefined }, defaultActiveFirstOption: PropTypes.looseBool,
notFoundContent: PropTypes.any, notFoundContent: PropTypes.any,
menuItemSelectedIcon: PropTypes.any, menuItemSelectedIcon: PropTypes.any,
childrenAsData: { type: Boolean, default: undefined }, childrenAsData: PropTypes.looseBool,
searchValue: PropTypes.string, searchValue: PropTypes.string,
virtual: { type: Boolean, default: undefined }, virtual: PropTypes.looseBool,
onSelect: PropTypes.func, onSelect: PropTypes.func,
onToggleOpen: PropTypes.func, onToggleOpen: PropTypes.func,

View File

@ -137,11 +137,11 @@ const SelectTrigger = defineComponent<SelectTriggerProps, { popupRef: any }>({
}); });
SelectTrigger.props = { SelectTrigger.props = {
dropdownAlign: PropTypes.object, dropdownAlign: PropTypes.object,
visible: { type: Boolean, default: undefined }, visible: PropTypes.looseBool,
disabled: { type: Boolean, default: undefined }, disabled: PropTypes.looseBool,
dropdownClassName: PropTypes.string, dropdownClassName: PropTypes.string,
dropdownStyle: PropTypes.object, dropdownStyle: PropTypes.object,
empty: { type: Boolean, default: undefined }, empty: PropTypes.looseBool,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
popupClassName: PropTypes.string, popupClassName: PropTypes.string,
animation: PropTypes.string, animation: PropTypes.string,

View File

@ -143,13 +143,13 @@ Input.props = {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
id: PropTypes.string, id: PropTypes.string,
inputElement: PropTypes.any, inputElement: PropTypes.any,
disabled: { type: Boolean, default: undefined }, disabled: PropTypes.looseBool,
autofocus: { type: Boolean, default: undefined }, autofocus: PropTypes.looseBool,
autocomplete: PropTypes.string, autocomplete: PropTypes.string,
editable: { type: Boolean, default: undefined }, editable: PropTypes.looseBool,
accessibilityIndex: PropTypes.number, accessibilityIndex: PropTypes.number,
value: PropTypes.string, value: PropTypes.string,
open: { type: Boolean, default: undefined }, open: PropTypes.looseBool,
tabindex: PropTypes.number, tabindex: PropTypes.number,
/** Pass accessibility props to input */ /** Pass accessibility props to input */
attrs: PropTypes.object, attrs: PropTypes.object,

View File

@ -43,19 +43,19 @@ const props = {
id: PropTypes.string, id: PropTypes.string,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
values: PropTypes.array, values: PropTypes.array,
open: { type: Boolean, default: undefined }, open: PropTypes.looseBool,
searchValue: PropTypes.string, searchValue: PropTypes.string,
inputRef: PropTypes.any, inputRef: PropTypes.any,
placeholder: PropTypes.any, placeholder: PropTypes.any,
disabled: { type: Boolean, default: undefined }, disabled: PropTypes.looseBool,
mode: PropTypes.string, mode: PropTypes.string,
showSearch: { type: Boolean, default: undefined }, showSearch: PropTypes.looseBool,
autofocus: { type: Boolean, default: undefined }, autofocus: PropTypes.looseBool,
autocomplete: PropTypes.string, autocomplete: PropTypes.string,
accessibilityIndex: PropTypes.number, accessibilityIndex: PropTypes.number,
tabindex: PropTypes.number, tabindex: PropTypes.number,
removeIcon: { type: Boolean, default: undefined }, removeIcon: PropTypes.looseBool,
choiceTransitionName: PropTypes.string, choiceTransitionName: PropTypes.string,
maxTagCount: PropTypes.number, maxTagCount: PropTypes.number,

View File

@ -14,19 +14,19 @@ const props = {
id: PropTypes.string, id: PropTypes.string,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
values: PropTypes.array, values: PropTypes.array,
open: { type: Boolean, default: undefined }, open: PropTypes.looseBool,
searchValue: PropTypes.string, searchValue: PropTypes.string,
inputRef: PropTypes.any, inputRef: PropTypes.any,
placeholder: PropTypes.any, placeholder: PropTypes.any,
disabled: { type: Boolean, default: undefined }, disabled: PropTypes.looseBool,
mode: PropTypes.string, mode: PropTypes.string,
showSearch: { type: Boolean, default: undefined }, showSearch: PropTypes.looseBool,
autofocus: { type: Boolean, default: undefined }, autofocus: PropTypes.looseBool,
autocomplete: PropTypes.string, autocomplete: PropTypes.string,
accessibilityIndex: PropTypes.number, accessibilityIndex: PropTypes.number,
tabindex: PropTypes.number, tabindex: PropTypes.number,
activeValue: PropTypes.string, activeValue: PropTypes.string,
backfill: { type: Boolean, default: undefined }, backfill: PropTypes.looseBool,
onInputChange: PropTypes.func, onInputChange: PropTypes.func,
onInputPaste: PropTypes.func, onInputPaste: PropTypes.func,
onInputKeyDown: PropTypes.func, onInputKeyDown: PropTypes.func,

View File

@ -252,20 +252,20 @@ Selector.inheritAttrs = false;
Selector.props = { Selector.props = {
id: PropTypes.string, id: PropTypes.string,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
showSearch: { type: Boolean, default: undefined }, showSearch: PropTypes.looseBool,
open: { type: Boolean, default: undefined }, open: PropTypes.looseBool,
/** Display in the Selector value, it's not same as `value` prop */ /** Display in the Selector value, it's not same as `value` prop */
values: PropTypes.array, values: PropTypes.array,
multiple: { type: Boolean, default: undefined }, multiple: PropTypes.looseBool,
mode: PropTypes.string, mode: PropTypes.string,
searchValue: PropTypes.string, searchValue: PropTypes.string,
activeValue: PropTypes.string, activeValue: PropTypes.string,
inputElement: PropTypes.any, inputElement: PropTypes.any,
autofocus: { type: Boolean, default: undefined }, autofocus: PropTypes.looseBool,
accessibilityIndex: PropTypes.number, accessibilityIndex: PropTypes.number,
tabindex: PropTypes.number, tabindex: PropTypes.number,
disabled: { type: Boolean, default: undefined }, disabled: PropTypes.looseBool,
placeholder: PropTypes.any, placeholder: PropTypes.any,
removeIcon: PropTypes.any, removeIcon: PropTypes.any,
@ -276,7 +276,7 @@ Selector.props = {
tagRender: PropTypes.func, tagRender: PropTypes.func,
/** Check if `tokenSeparators` contains `\n` or `\r\n` */ /** Check if `tokenSeparators` contains `\n` or `\r\n` */
tokenWithEnter: { type: Boolean, default: undefined }, tokenWithEnter: PropTypes.looseBool,
// Motion // Motion
choiceTransitionName: PropTypes.string, choiceTransitionName: PropTypes.string,

View File

@ -1235,7 +1235,7 @@ export default function generateSelector<
// Value // Value
value: PropTypes.any, value: PropTypes.any,
defaultValue: PropTypes.any, defaultValue: PropTypes.any,
labelInValue: { type: Boolean, default: undefined }, labelInValue: PropTypes.looseBool,
// Search // Search
inputValue: PropTypes.string, inputValue: PropTypes.string,
@ -1247,31 +1247,28 @@ export default function generateSelector<
* It's by design. * It's by design.
*/ */
filterOption: PropTypes.any, filterOption: PropTypes.any,
showSearch: { type: Boolean, default: undefined }, showSearch: PropTypes.looseBool,
autoClearSearchValue: { type: Boolean, default: undefined }, autoClearSearchValue: PropTypes.looseBool,
onSearch: PropTypes.func, onSearch: PropTypes.func,
onClear: PropTypes.func, onClear: PropTypes.func,
// Icons // Icons
allowClear: { type: Boolean, default: undefined }, allowClear: PropTypes.looseBool,
clearIcon: PropTypes.any, clearIcon: PropTypes.any,
showArrow: { showArrow: PropTypes.looseBool,
type: Boolean,
default: undefined,
},
inputIcon: PropTypes.any, inputIcon: PropTypes.any,
removeIcon: PropTypes.any, removeIcon: PropTypes.any,
menuItemSelectedIcon: PropTypes.func, menuItemSelectedIcon: PropTypes.func,
// Dropdown // Dropdown
open: { type: Boolean, default: undefined }, open: PropTypes.looseBool,
defaultOpen: { type: Boolean, default: undefined }, defaultOpen: PropTypes.looseBool,
listHeight: PropTypes.number.def(200), listHeight: PropTypes.number.def(200),
listItemHeight: PropTypes.number.def(20), listItemHeight: PropTypes.number.def(20),
dropdownStyle: PropTypes.object, dropdownStyle: PropTypes.object,
dropdownClassName: PropTypes.string, dropdownClassName: PropTypes.string,
dropdownMatchSelectWidth: PropTypes.oneOfType([Boolean, Number]).def(true), dropdownMatchSelectWidth: PropTypes.oneOfType([Boolean, Number]).def(true),
virtual: { type: Boolean, default: undefined }, virtual: PropTypes.looseBool,
dropdownRender: PropTypes.func, dropdownRender: PropTypes.func,
dropdownAlign: PropTypes.any, dropdownAlign: PropTypes.any,
animation: PropTypes.string, animation: PropTypes.string,
@ -1280,13 +1277,13 @@ export default function generateSelector<
direction: PropTypes.string, direction: PropTypes.string,
// Others // Others
disabled: { type: Boolean, default: undefined }, disabled: PropTypes.looseBool,
loading: { type: Boolean, default: undefined }, loading: PropTypes.looseBool,
autofocus: { type: Boolean, default: undefined }, autofocus: PropTypes.looseBool,
defaultActiveFirstOption: { type: Boolean, default: undefined }, defaultActiveFirstOption: PropTypes.looseBool,
notFoundContent: PropTypes.any.def('Not Found'), notFoundContent: PropTypes.any.def('Not Found'),
placeholder: PropTypes.any, placeholder: PropTypes.any,
backfill: { type: Boolean, default: undefined }, backfill: PropTypes.looseBool,
getInputElement: PropTypes.func, getInputElement: PropTypes.func,
optionLabelProp: PropTypes.string, optionLabelProp: PropTypes.string,
maxTagTextLength: PropTypes.number, maxTagTextLength: PropTypes.number,

View File

@ -1,5 +1,5 @@
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import { initDefaultProps, hasProp } from '../../_util/props-util'; import { initDefaultProps, hasProp } from '../../_util/props-util';
import Track from './common/Track'; import Track from './common/Track';
@ -26,7 +26,7 @@ const rangeProps = {
defaultValue: PropTypes.arrayOf(PropTypes.number), defaultValue: PropTypes.arrayOf(PropTypes.number),
value: PropTypes.arrayOf(PropTypes.number), value: PropTypes.arrayOf(PropTypes.number),
count: PropTypes.number, count: PropTypes.number,
pushable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number]), pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])),
allowCross: PropTypes.looseBool, allowCross: PropTypes.looseBool,
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,
reverse: PropTypes.looseBool, reverse: PropTypes.looseBool,

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { getOptionProps, getComponent } from '../_util/props-util'; import { getOptionProps, getComponent } from '../_util/props-util';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
@ -24,7 +24,7 @@ export default {
description: PropTypes.any, description: PropTypes.any,
title: PropTypes.any, title: PropTypes.any,
subTitle: PropTypes.any, subTitle: PropTypes.any,
progressDot: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]), progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
tailContent: PropTypes.any, tailContent: PropTypes.any,
icons: PropTypes.shape({ icons: PropTypes.shape({
finish: PropTypes.any, finish: PropTypes.any,

View File

@ -1,4 +1,4 @@
import PropTypes from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import debounce from 'lodash-es/debounce'; import debounce from 'lodash-es/debounce';
import isFlexSupported from '../_util/isFlexSupported'; import isFlexSupported from '../_util/isFlexSupported';
@ -16,7 +16,7 @@ export default {
labelPlacement: PropTypes.string.def('horizontal'), labelPlacement: PropTypes.string.def('horizontal'),
status: PropTypes.string.def('process'), status: PropTypes.string.def('process'),
size: PropTypes.string.def(''), size: PropTypes.string.def(''),
progressDot: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]), progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
initial: PropTypes.number.def(0), initial: PropTypes.number.def(0),
current: PropTypes.number.def(0), current: PropTypes.number.def(0),
icons: PropTypes.shape({ icons: PropTypes.shape({

View File

@ -1,5 +1,5 @@
import { inject } from 'vue'; import { inject } from 'vue';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import ColGroup from './ColGroup'; import ColGroup from './ColGroup';
import TableHeader from './TableHeader'; import TableHeader from './TableHeader';
@ -11,7 +11,7 @@ const BaseTable = {
name: 'BaseTable', name: 'BaseTable',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool]), fixed: withUndefined(PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool])),
columns: PropTypes.array.isRequired, columns: PropTypes.array.isRequired,
tableClassName: PropTypes.string.isRequired, tableClassName: PropTypes.string.isRequired,
hasHead: PropTypes.looseBool.isRequired, hasHead: PropTypes.looseBool.isRequired,

View File

@ -1,5 +1,5 @@
import { inject } from 'vue'; import { inject } from 'vue';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import { measureScrollbar } from './utils'; import { measureScrollbar } from './utils';
import BaseTable from './BaseTable'; import BaseTable from './BaseTable';
@ -7,7 +7,7 @@ export default {
name: 'BodyTable', name: 'BodyTable',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool]), fixed: withUndefined(PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool])),
columns: PropTypes.array.isRequired, columns: PropTypes.array.isRequired,
tableClassName: PropTypes.string.isRequired, tableClassName: PropTypes.string.isRequired,
handleBodyScroll: PropTypes.func.isRequired, handleBodyScroll: PropTypes.func.isRequired,

View File

@ -1,4 +1,4 @@
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import ExpandIcon from './ExpandIcon'; import ExpandIcon from './ExpandIcon';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import { connect } from '../../_util/store'; import { connect } from '../../_util/store';
@ -11,7 +11,7 @@ const ExpandableRow = {
props: { props: {
prefixCls: PropTypes.string.isRequired, prefixCls: PropTypes.string.isRequired,
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool]), fixed: withUndefined(PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool])),
record: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired, record: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,
indentSize: PropTypes.number, indentSize: PropTypes.number,
needIndentSpaced: PropTypes.looseBool.isRequired, needIndentSpaced: PropTypes.looseBool.isRequired,

View File

@ -1,5 +1,5 @@
import { inject } from 'vue'; import { inject } from 'vue';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import { measureScrollbar } from './utils'; import { measureScrollbar } from './utils';
import BaseTable from './BaseTable'; import BaseTable from './BaseTable';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
@ -8,7 +8,7 @@ export default {
name: 'HeadTable', name: 'HeadTable',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool]), fixed: withUndefined(PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool])),
columns: PropTypes.array.isRequired, columns: PropTypes.array.isRequired,
tableClassName: PropTypes.string.isRequired, tableClassName: PropTypes.string.isRequired,
handleBodyScrollLeft: PropTypes.func.isRequired, handleBodyScrollLeft: PropTypes.func.isRequired,

View File

@ -1,5 +1,5 @@
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import { connect } from '../../_util/store'; import { connect } from '../../_util/store';
import TableCell from './TableCell'; import TableCell from './TableCell';
import { initDefaultProps, findDOMNode } from '../../_util/props-util'; import { initDefaultProps, findDOMNode } from '../../_util/props-util';
@ -32,7 +32,7 @@ const TableRow = {
hovered: PropTypes.looseBool.isRequired, hovered: PropTypes.looseBool.isRequired,
visible: PropTypes.looseBool.isRequired, visible: PropTypes.looseBool.isRequired,
store: PropTypes.object.isRequired, store: PropTypes.object.isRequired,
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool]), fixed: withUndefined(PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool])),
renderExpandIcon: PropTypes.func, renderExpandIcon: PropTypes.func,
renderExpandIconCell: PropTypes.func, renderExpandIconCell: PropTypes.func,
components: PropTypes.any, components: PropTypes.any,

View File

@ -23,7 +23,7 @@ import shallowEqual from '../../_util/shallowequal';
import raf from 'raf'; import raf from 'raf';
import scrollIntoView from 'dom-scroll-into-view'; import scrollIntoView from 'dom-scroll-into-view';
import warning from 'warning'; import warning from 'warning';
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import KeyCode from '../../_util/KeyCode'; import KeyCode from '../../_util/KeyCode';
import SelectTrigger from './SelectTrigger'; import SelectTrigger from './SelectTrigger';
@ -103,10 +103,12 @@ const Select = {
dropdownVisibleChange: PropTypes.func, dropdownVisibleChange: PropTypes.func,
dropdownMatchSelectWidth: PropTypes.looseBool, dropdownMatchSelectWidth: PropTypes.looseBool,
treeData: PropTypes.array, treeData: PropTypes.array,
treeDataSimpleMode: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), treeDataSimpleMode: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
),
treeNodeFilterProp: PropTypes.string, treeNodeFilterProp: PropTypes.string,
treeNodeLabelProp: PropTypes.string, treeNodeLabelProp: PropTypes.string,
treeCheckable: PropTypes.oneOfType([PropTypes.any, PropTypes.object, PropTypes.looseBool]), treeCheckable: PropTypes.any,
// treeCheckable: PropTypes.any, // treeCheckable: PropTypes.any,
treeCheckStrictly: PropTypes.looseBool, treeCheckStrictly: PropTypes.looseBool,
treeIcon: PropTypes.looseBool, treeIcon: PropTypes.looseBool,
@ -115,7 +117,7 @@ const Select = {
treeDefaultExpandedKeys: PropTypes.array, treeDefaultExpandedKeys: PropTypes.array,
treeExpandedKeys: PropTypes.array, treeExpandedKeys: PropTypes.array,
loadData: PropTypes.func, loadData: PropTypes.func,
filterTreeNode: PropTypes.oneOfType([PropTypes.func, PropTypes.looseBool]), filterTreeNode: withUndefined(PropTypes.oneOfType([PropTypes.func, PropTypes.looseBool])),
notFoundContent: PropTypes.any, notFoundContent: PropTypes.any,
getPopupContainer: PropTypes.func, getPopupContainer: PropTypes.func,

View File

@ -1,4 +1,4 @@
import PropTypes from '../../_util/vue-types'; import PropTypes, { withUndefined } from '../../_util/vue-types';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import warning from 'warning'; import warning from 'warning';
import { hasProp, initDefaultProps, getOptionProps, getSlot } from '../../_util/props-util'; import { hasProp, initDefaultProps, getOptionProps, getSlot } from '../../_util/props-util';
@ -57,7 +57,7 @@ const Tree = {
selectable: PropTypes.looseBool, selectable: PropTypes.looseBool,
disabled: PropTypes.looseBool, disabled: PropTypes.looseBool,
multiple: PropTypes.looseBool, multiple: PropTypes.looseBool,
checkable: PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool]), checkable: withUndefined(PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool])),
checkStrictly: PropTypes.looseBool, checkStrictly: PropTypes.looseBool,
draggable: PropTypes.looseBool, draggable: PropTypes.looseBool,
defaultExpandParent: PropTypes.looseBool, defaultExpandParent: PropTypes.looseBool,