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 () => ({
prefixCls: PropTypes.string,
type: PropTypes.string,
@ -6,7 +6,7 @@ export default () => ({
// icon: PropTypes.string,
shape: PropTypes.oneOf(['circle', 'circle-outline', 'round']),
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,
ghost: PropTypes.looseBool,
block: PropTypes.looseBool,

View File

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

View File

@ -1,5 +1,5 @@
// 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';
export const PickerProps = () => ({
@ -50,7 +50,7 @@ export const SinglePickerProps = () => ({
export const DatePickerProps = () => ({
...PickerProps(),
...SinglePickerProps(),
showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool]),
showTime: withUndefined(PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool])),
open: PropTypes.looseBool,
disabledTime: PropTypes.func,
mode: PropTypes.oneOf(['time', 'date', 'month', 'year']),
@ -74,7 +74,7 @@ export const RangePickerProps = () => ({
defaultValue: TimesType,
defaultPickerValue: TimesType,
timePicker: PropTypes.any,
showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool]),
showTime: withUndefined(PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool])),
ranges: PropTypes.object,
placeholder: 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);
},
},
compact: Boolean,
compact: PropTypes.looseBool,
},
setup() {
return {

View File

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

View File

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

View File

@ -24,8 +24,8 @@ export default {
prefix: PropTypes.any,
suffix: PropTypes.any,
// spellCheck: Boolean,
autofocus: Boolean,
allowClear: Boolean,
autofocus: PropTypes.looseBool,
allowClear: PropTypes.looseBool,
lazy: {
default: true,
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 omit from 'omit.js';
import { defaultConfigProvider } from '../config-provider';
@ -37,9 +37,11 @@ export const ListProps = () => ({
extra: PropTypes.any,
grid: PropTypes.shape(ListGridType).loose,
itemLayout: PropTypes.string,
loading: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
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,
rowKey: 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 MiniSelect from './MiniSelect';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
@ -25,7 +25,7 @@ export const PaginationProps = () => ({
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
buildOptionText: PropTypes.func,
showSizeChange: PropTypes.func,
showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
showQuickJumper: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
showTotal: PropTypes.any,
size: PropTypes.string,
simple: PropTypes.looseBool,

View File

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

View File

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

View File

@ -1,7 +1,7 @@
import { provide, inject } from 'vue';
import warning from '../_util/warning';
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 { defaultConfigProvider } from '../config-provider';
import { getComponent, getOptionProps, isValidElement, getSlot } from '../_util/props-util';
@ -30,7 +30,7 @@ const AbstractSelectProps = () => ({
dropdownMenuStyle: PropTypes.any,
dropdownMatchSelectWidth: PropTypes.looseBool,
// onSearch: (value: string) => any,
filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]),
filterOption: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
autofocus: PropTypes.looseBool,
backfill: PropTypes.looseBool,
showArrow: PropTypes.looseBool,

View File

@ -1,6 +1,6 @@
import { inject } from 'vue';
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 { defaultConfigProvider } from '../config-provider';
import Avatar, { SkeletonAvatarProps } from './Avatar';
@ -12,9 +12,15 @@ export const SkeletonProps = {
loading: PropTypes.looseBool,
prefixCls: PropTypes.string,
children: PropTypes.any,
avatar: PropTypes.oneOfType([PropTypes.string, SkeletonAvatarProps, PropTypes.looseBool]),
title: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonTitleProps]),
paragraph: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonParagraphProps]),
avatar: withUndefined(
PropTypes.oneOfType([PropTypes.string, SkeletonAvatarProps, PropTypes.looseBool]),
),
title: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonTitleProps]),
),
paragraph: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.string, SkeletonParagraphProps]),
),
};
function getComponentProps(prop) {

View File

@ -1,7 +1,7 @@
import { inject } from 'vue';
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
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 VcSteps from '../vc-steps';
import { defaultConfigProvider } from '../config-provider';
@ -16,7 +16,7 @@ const getStepsProps = (defaultProps = {}) => {
status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']),
size: PropTypes.oneOf(['default', 'small']),
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']),
onChange: 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 { SpinProps as getSpinProps } from '../spin';
import { Store } from './createStore';
@ -33,12 +33,16 @@ export const ColumnProps = {
colSpan: PropTypes.number,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
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,
filteredValue: PropTypes.array,
filtered: PropTypes.looseBool,
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,
// children?: ColumnProps<T>[];
// onCellClick?: (record: T, event: any) => void;
@ -83,7 +87,7 @@ export const TableRowSelection = {
// onSelect?: SelectionSelectFn<T>;
// onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => any;
// onSelectInvert?: (selectedRows: Object[]) => any;
selections: PropTypes.oneOfType([PropTypes.array, PropTypes.looseBool]),
selections: withUndefined(PropTypes.oneOfType([PropTypes.array, PropTypes.looseBool])),
hideDefaultSelections: PropTypes.looseBool,
fixed: PropTypes.looseBool,
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 RightOutlined from '@ant-design/icons-vue/RightOutlined';
import ScrollableInkTabBar from '../vc-tabs/src/ScrollableInkTabBar';
import PropTypes from '../_util/vue-types';
import PropTypes, { withUndefined } from '../_util/vue-types';
const TabBar = {
name: 'TabBar',
@ -16,7 +16,7 @@ const TabBar = {
tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'),
tabBarPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
size: PropTypes.oneOf(['default', 'small', 'large']),
animated: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
animated: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
renderTabBar: PropTypes.func,
panels: PropTypes.array.def([]),
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 TabContent from '../vc-tabs/src/TabContent';
import { isFlexSupported } from '../_util/styleChecker';
import PropTypes from '../_util/vue-types';
import PropTypes, { withUndefined } from '../_util/vue-types';
import {
getComponent,
getOptionProps,
@ -33,7 +33,7 @@ export default {
type: PropTypes.oneOf(['line', 'card', 'editable-card']),
tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'),
size: PropTypes.oneOf(['default', 'small', 'large']),
animated: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
animated: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
tabBarGutter: PropTypes.number,
renderTabBar: PropTypes.func,
onChange: PropTypes.func,

View File

@ -126,10 +126,7 @@ Tag.props = {
color: PropTypes.string,
closable: PropTypes.looseBool.def(false),
closeIcon: PropTypes.any,
visible: {
type: Boolean,
default: undefined,
},
visible: PropTypes.looseBool,
onClose: PropTypes.func,
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 Lazyload from '../vc-lazy-load';
import Checkbox from '../checkbox';
@ -12,7 +12,7 @@ export default {
renderedText: PropTypes.any,
renderedEl: PropTypes.any,
item: PropTypes.any,
lazy: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
lazy: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
checked: PropTypes.looseBool,
prefixCls: PropTypes.string,
disabled: PropTypes.looseBool,

View File

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

View File

@ -1,7 +1,7 @@
import { TransitionGroup } from 'vue';
import raf from '../_util/raf';
import ListItem from './ListItem';
import PropTypes from '../_util/vue-types';
import PropTypes, { withUndefined } from '../_util/vue-types';
import getTransitionProps from '../_util/getTransitionProps';
import { findDOMNode } from '../_util/props-util';
function noop() {}
@ -11,7 +11,7 @@ const ListBody = {
props: {
prefixCls: PropTypes.string,
filteredRenderItems: PropTypes.array.def([]),
lazy: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
lazy: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
selectedKeys: PropTypes.array,
disabled: PropTypes.looseBool,
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';
export const TreeData = PropTypes.shape({
@ -13,7 +13,7 @@ export const TreeSelectProps = () => ({
...AbstractSelectProps(),
autofocus: PropTypes.looseBool,
dropdownStyle: PropTypes.object,
filterTreeNode: PropTypes.oneOfType([Function, Boolean]),
filterTreeNode: withUndefined(PropTypes.oneOfType([Function, Boolean])),
getPopupContainer: PropTypes.func,
labelInValue: PropTypes.looseBool,
loadData: PropTypes.func,
@ -37,10 +37,10 @@ export const TreeSelectProps = () => ({
searchValue: PropTypes.string,
showCheckedStrategy: PropTypes.oneOf(['SHOW_ALL', 'SHOW_PARENT', 'SHOW_CHILD']),
suffixIcon: PropTypes.any,
treeCheckable: PropTypes.oneOfType([PropTypes.any, PropTypes.looseBool]),
treeCheckable: withUndefined(PropTypes.oneOfType([PropTypes.any, PropTypes.looseBool])),
treeCheckStrictly: PropTypes.looseBool,
treeData: PropTypes.arrayOf(Object),
treeDataSimpleMode: PropTypes.oneOfType([Boolean, Object]),
treeDataSimpleMode: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, Object])),
dropdownClassName: PropTypes.string,
dropdownMatchSelectWidth: PropTypes.looseBool,

View File

@ -1,6 +1,6 @@
import { nextTick } from 'vue';
import classNames from '../../_util/classNames';
import PropTypes from '../../_util/vue-types';
import PropTypes, { withUndefined } from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin';
import { getOptionProps, hasProp, initDefaultProps } from '../../_util/props-util';
@ -14,8 +14,8 @@ export default {
name: PropTypes.string,
id: PropTypes.string,
type: PropTypes.string,
defaultChecked: PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool]),
checked: PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool]),
defaultChecked: withUndefined(PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool])),
checked: withUndefined(PropTypes.oneOfType([PropTypes.number, PropTypes.looseBool])),
disabled: PropTypes.looseBool,
// onFocus: 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 enhancer from './enhancer';
import { propTypes, defaultProps } from './types';
@ -6,7 +6,9 @@ import { propTypes, defaultProps } from './types';
const circlePropTypes = {
...propTypes,
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 = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import classNames from '../../_util/classNames';
import PropTypes from '../../_util/vue-types';
import PropTypes, { withUndefined } from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin';
import { initDefaultProps, hasProp } from '../../_util/props-util';
import Track from './common/Track';
@ -26,7 +26,7 @@ const rangeProps = {
defaultValue: PropTypes.arrayOf(PropTypes.number),
value: PropTypes.arrayOf(PropTypes.number),
count: PropTypes.number,
pushable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number]),
pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])),
allowCross: PropTypes.looseBool,
disabled: 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 BaseMixin from '../_util/BaseMixin';
@ -24,7 +24,7 @@ export default {
description: PropTypes.any,
title: PropTypes.any,
subTitle: PropTypes.any,
progressDot: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]),
progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
tailContent: PropTypes.any,
icons: PropTypes.shape({
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 debounce from 'lodash-es/debounce';
import isFlexSupported from '../_util/isFlexSupported';
@ -16,7 +16,7 @@ export default {
labelPlacement: PropTypes.string.def('horizontal'),
status: PropTypes.string.def('process'),
size: PropTypes.string.def(''),
progressDot: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]),
progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
initial: PropTypes.number.def(0),
current: PropTypes.number.def(0),
icons: PropTypes.shape({

View File

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

View File

@ -1,5 +1,5 @@
import { inject } from 'vue';
import PropTypes from '../../_util/vue-types';
import PropTypes, { withUndefined } from '../../_util/vue-types';
import { measureScrollbar } from './utils';
import BaseTable from './BaseTable';
@ -7,7 +7,7 @@ export default {
name: 'BodyTable',
inheritAttrs: false,
props: {
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool]),
fixed: withUndefined(PropTypes.oneOfType([PropTypes.string, PropTypes.looseBool])),
columns: PropTypes.array.isRequired,
tableClassName: PropTypes.string.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 BaseMixin from '../../_util/BaseMixin';
import { connect } from '../../_util/store';
@ -11,7 +11,7 @@ const ExpandableRow = {
props: {
prefixCls: PropTypes.string.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,
indentSize: PropTypes.number,
needIndentSpaced: PropTypes.looseBool.isRequired,

View File

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

View File

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

View File

@ -23,7 +23,7 @@ import shallowEqual from '../../_util/shallowequal';
import raf from 'raf';
import scrollIntoView from 'dom-scroll-into-view';
import warning from 'warning';
import PropTypes from '../../_util/vue-types';
import PropTypes, { withUndefined } from '../../_util/vue-types';
import KeyCode from '../../_util/KeyCode';
import SelectTrigger from './SelectTrigger';
@ -103,10 +103,12 @@ const Select = {
dropdownVisibleChange: PropTypes.func,
dropdownMatchSelectWidth: PropTypes.looseBool,
treeData: PropTypes.array,
treeDataSimpleMode: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
treeDataSimpleMode: withUndefined(
PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
),
treeNodeFilterProp: PropTypes.string,
treeNodeLabelProp: PropTypes.string,
treeCheckable: PropTypes.oneOfType([PropTypes.any, PropTypes.object, PropTypes.looseBool]),
treeCheckable: PropTypes.any,
// treeCheckable: PropTypes.any,
treeCheckStrictly: PropTypes.looseBool,
treeIcon: PropTypes.looseBool,
@ -115,7 +117,7 @@ const Select = {
treeDefaultExpandedKeys: PropTypes.array,
treeExpandedKeys: PropTypes.array,
loadData: PropTypes.func,
filterTreeNode: PropTypes.oneOfType([PropTypes.func, PropTypes.looseBool]),
filterTreeNode: withUndefined(PropTypes.oneOfType([PropTypes.func, PropTypes.looseBool])),
notFoundContent: PropTypes.any,
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 warning from 'warning';
import { hasProp, initDefaultProps, getOptionProps, getSlot } from '../../_util/props-util';
@ -57,7 +57,7 @@ const Tree = {
selectable: PropTypes.looseBool,
disabled: PropTypes.looseBool,
multiple: PropTypes.looseBool,
checkable: PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool]),
checkable: withUndefined(PropTypes.oneOfType([PropTypes.object, PropTypes.looseBool])),
checkStrictly: PropTypes.looseBool,
draggable: PropTypes.looseBool,
defaultExpandParent: PropTypes.looseBool,