Merge remote-tracking branch 'origin/next' into v2.3
commit
c1c7c8e5d4
|
@ -6,3 +6,5 @@ export type ChangeEvent = Event & {
|
||||||
value?: string | undefined;
|
value?: string | undefined;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type EventHandler = (...args: any[]) => void;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import hasProp, { getOptionProps, getSlot } from '../_util/props-util';
|
||||||
import { defaultConfigProvider } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
import warning from '../_util/warning';
|
import warning from '../_util/warning';
|
||||||
import type { RadioChangeEvent } from '../radio/interface';
|
import type { RadioChangeEvent } from '../radio/interface';
|
||||||
|
import type { EventHandler } from '../_util/EventInterface';
|
||||||
function noop() {}
|
function noop() {}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -127,8 +128,8 @@ export default defineComponent({
|
||||||
<label
|
<label
|
||||||
class={classString}
|
class={classString}
|
||||||
style={style}
|
style={style}
|
||||||
onMouseenter={onMouseenter as EventHandlerNonNull}
|
onMouseenter={onMouseenter as EventHandler}
|
||||||
onMouseleave={onMouseleave as EventHandlerNonNull}
|
onMouseleave={onMouseleave as EventHandler}
|
||||||
>
|
>
|
||||||
<VcCheckbox {...checkboxProps} class={checkboxClass} ref="vcCheckbox" />
|
<VcCheckbox {...checkboxProps} class={checkboxClass} ref="vcCheckbox" />
|
||||||
{children.length ? <span>{children}</span> : null}
|
{children.length ? <span>{children}</span> : null}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
|
||||||
import VcInputNumber from '../vc-input-number/src';
|
import VcInputNumber from '../vc-input-number/src';
|
||||||
import { defaultConfigProvider } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
import { tuple, withInstall } from '../_util/type';
|
import { tuple, withInstall } from '../_util/type';
|
||||||
|
import type { EventHandler } from '../_util/EventInterface';
|
||||||
|
|
||||||
const inputNumberProps = {
|
const inputNumberProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
|
@ -28,7 +29,7 @@ const inputNumberProps = {
|
||||||
precision: PropTypes.number,
|
precision: PropTypes.number,
|
||||||
autofocus: PropTypes.looseBool,
|
autofocus: PropTypes.looseBool,
|
||||||
onPressEnter: {
|
onPressEnter: {
|
||||||
type: Function as PropType<EventHandlerNonNull>,
|
type: Function as PropType<EventHandler>,
|
||||||
},
|
},
|
||||||
onChange: Function as PropType<(num: number) => void>,
|
onChange: Function as PropType<(num: number) => void>,
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,6 +30,7 @@ import {
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import type { AutoSizeType } from '../input/ResizableTextArea';
|
import type { AutoSizeType } from '../input/ResizableTextArea';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
import type { EventHandler } from '../_util/EventInterface';
|
||||||
|
|
||||||
export type BaseType = 'secondary' | 'success' | 'warning' | 'danger';
|
export type BaseType = 'secondary' | 'success' | 'warning' | 'danger';
|
||||||
|
|
||||||
|
@ -58,7 +59,7 @@ export interface EllipsisConfig {
|
||||||
expandable?: boolean;
|
expandable?: boolean;
|
||||||
suffix?: string;
|
suffix?: string;
|
||||||
symbol?: string;
|
symbol?: string;
|
||||||
onExpand?: EventHandlerNonNull;
|
onExpand?: EventHandler;
|
||||||
onEllipsis?: (ellipsis: boolean) => void;
|
onEllipsis?: (ellipsis: boolean) => void;
|
||||||
tooltip?: boolean;
|
tooltip?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ export const imageProps = {
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
onVisibleChange: PropTypes.func,
|
onVisibleChange: PropTypes.func,
|
||||||
getContainer: PropTypes.oneOf([PropTypes.func, PropTypes.bool]),
|
getContainer: PropTypes.oneOfType([PropTypes.func, PropTypes.looseBool, PropTypes.string]),
|
||||||
}).loose,
|
}).loose,
|
||||||
]).def(true),
|
]).def(true),
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,6 +22,8 @@ export interface RefOptionListProps {
|
||||||
onKeyup: (e?: KeyboardEvent) => void;
|
onKeyup: (e?: KeyboardEvent) => void;
|
||||||
scrollTo?: (index: number) => void;
|
scrollTo?: (index: number) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import type { EventHandler } from '../_util/EventInterface';
|
||||||
export interface OptionListProps<OptionType extends object> {
|
export interface OptionListProps<OptionType extends object> {
|
||||||
prefixCls: string;
|
prefixCls: string;
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -43,10 +45,10 @@ export interface OptionListProps<OptionType extends object> {
|
||||||
onToggleOpen: (open?: boolean) => void;
|
onToggleOpen: (open?: boolean) => void;
|
||||||
/** Tell Select that some value is now active to make accessibility work */
|
/** Tell Select that some value is now active to make accessibility work */
|
||||||
onActiveValue: OnActiveValue;
|
onActiveValue: OnActiveValue;
|
||||||
onScroll: EventHandlerNonNull;
|
onScroll: EventHandler;
|
||||||
|
|
||||||
/** Tell Select that mouse enter the popup to force re-render */
|
/** Tell Select that mouse enter the popup to force re-render */
|
||||||
onMouseenter?: EventHandlerNonNull;
|
onMouseenter?: EventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
const OptionListProps = {
|
const OptionListProps = {
|
||||||
|
@ -96,7 +98,7 @@ const OptionList = defineComponent<OptionListProps<SelectOptionsType[number]>, {
|
||||||
// =========================== List ===========================
|
// =========================== List ===========================
|
||||||
const listRef = createRef();
|
const listRef = createRef();
|
||||||
|
|
||||||
const onListMouseDown: EventHandlerNonNull = event => {
|
const onListMouseDown: EventHandler = event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import PropTypes from '../../_util/vue-types';
|
||||||
import type { RefObject } from '../../_util/createRef';
|
import type { RefObject } from '../../_util/createRef';
|
||||||
import antInput from '../../_util/antInputDirective';
|
import antInput from '../../_util/antInputDirective';
|
||||||
import classNames from '../../_util/classNames';
|
import classNames from '../../_util/classNames';
|
||||||
|
import type { EventHandler } from '../../_util/EventInterface';
|
||||||
|
|
||||||
interface InputProps {
|
interface InputProps {
|
||||||
prefixCls: string;
|
prefixCls: string;
|
||||||
|
@ -21,19 +22,43 @@ interface InputProps {
|
||||||
/** Pass accessibility props to input */
|
/** Pass accessibility props to input */
|
||||||
attrs: object;
|
attrs: object;
|
||||||
inputRef: RefObject;
|
inputRef: RefObject;
|
||||||
onKeydown: EventHandlerNonNull;
|
onKeydown: EventHandler;
|
||||||
onMousedown: EventHandlerNonNull;
|
onMousedown: EventHandler;
|
||||||
onChange: EventHandlerNonNull;
|
onChange: EventHandler;
|
||||||
onPaste: EventHandlerNonNull;
|
onPaste: EventHandler;
|
||||||
onCompositionstart: EventHandlerNonNull;
|
onCompositionstart: EventHandler;
|
||||||
onCompositionend: EventHandlerNonNull;
|
onCompositionend: EventHandler;
|
||||||
onFocus: EventHandlerNonNull;
|
onFocus: EventHandler;
|
||||||
onBlur: EventHandlerNonNull;
|
onBlur: EventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Input = defineComponent<InputProps, { VCSelectContainerEvent: any; blurTimeout: any }>({
|
const Input = defineComponent({
|
||||||
name: 'Input',
|
name: 'Input',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
props: {
|
||||||
|
inputRef: PropTypes.any,
|
||||||
|
prefixCls: PropTypes.string,
|
||||||
|
id: PropTypes.string,
|
||||||
|
inputElement: PropTypes.any,
|
||||||
|
disabled: PropTypes.looseBool,
|
||||||
|
autofocus: PropTypes.looseBool,
|
||||||
|
autocomplete: PropTypes.string,
|
||||||
|
editable: PropTypes.looseBool,
|
||||||
|
accessibilityIndex: PropTypes.number,
|
||||||
|
value: PropTypes.string,
|
||||||
|
open: PropTypes.looseBool,
|
||||||
|
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||||
|
/** Pass accessibility props to input */
|
||||||
|
attrs: PropTypes.object,
|
||||||
|
onKeydown: PropTypes.func,
|
||||||
|
onMousedown: PropTypes.func,
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
onPaste: PropTypes.func,
|
||||||
|
onCompositionstart: PropTypes.func,
|
||||||
|
onCompositionend: PropTypes.func,
|
||||||
|
onFocus: PropTypes.func,
|
||||||
|
onBlur: PropTypes.func,
|
||||||
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
if (process.env.NODE_ENV === 'test') {
|
if (process.env.NODE_ENV === 'test') {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -47,7 +72,7 @@ const Input = defineComponent<InputProps, { VCSelectContainerEvent: any; blurTim
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
blurTimeout: null,
|
blurTimeout: null,
|
||||||
VCSelectContainerEvent: inject('VCSelectContainerEvent'),
|
VCSelectContainerEvent: inject('VCSelectContainerEvent') as any,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
|
@ -164,29 +189,29 @@ const Input = defineComponent<InputProps, { VCSelectContainerEvent: any; blurTim
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Input.props = {
|
// Input.props = {
|
||||||
inputRef: PropTypes.any,
|
// inputRef: PropTypes.any,
|
||||||
prefixCls: PropTypes.string,
|
// prefixCls: PropTypes.string,
|
||||||
id: PropTypes.string,
|
// id: PropTypes.string,
|
||||||
inputElement: PropTypes.any,
|
// inputElement: PropTypes.any,
|
||||||
disabled: PropTypes.looseBool,
|
// disabled: PropTypes.looseBool,
|
||||||
autofocus: PropTypes.looseBool,
|
// autofocus: PropTypes.looseBool,
|
||||||
autocomplete: PropTypes.string,
|
// autocomplete: PropTypes.string,
|
||||||
editable: PropTypes.looseBool,
|
// editable: PropTypes.looseBool,
|
||||||
accessibilityIndex: PropTypes.number,
|
// accessibilityIndex: PropTypes.number,
|
||||||
value: PropTypes.string,
|
// value: PropTypes.string,
|
||||||
open: PropTypes.looseBool,
|
// open: PropTypes.looseBool,
|
||||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
// tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||||
/** Pass accessibility props to input */
|
// /** Pass accessibility props to input */
|
||||||
attrs: PropTypes.object,
|
// attrs: PropTypes.object,
|
||||||
onKeydown: PropTypes.func,
|
// onKeydown: PropTypes.func,
|
||||||
onMousedown: PropTypes.func,
|
// onMousedown: PropTypes.func,
|
||||||
onChange: PropTypes.func,
|
// onChange: PropTypes.func,
|
||||||
onPaste: PropTypes.func,
|
// onPaste: PropTypes.func,
|
||||||
onCompositionstart: PropTypes.func,
|
// onCompositionstart: PropTypes.func,
|
||||||
onCompositionend: PropTypes.func,
|
// onCompositionend: PropTypes.func,
|
||||||
onFocus: PropTypes.func,
|
// onFocus: PropTypes.func,
|
||||||
onBlur: PropTypes.func,
|
// onBlur: PropTypes.func,
|
||||||
};
|
// };
|
||||||
|
|
||||||
export default Input;
|
export default Input;
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { defineComponent } from 'vue';
|
||||||
import createRef from '../../_util/createRef';
|
import createRef from '../../_util/createRef';
|
||||||
import PropTypes from '../../_util/vue-types';
|
import PropTypes from '../../_util/vue-types';
|
||||||
import type { VueNode } from '../../_util/type';
|
import type { VueNode } from '../../_util/type';
|
||||||
|
import type { EventHandler } from '../../_util/EventInterface';
|
||||||
|
|
||||||
export interface SelectorProps {
|
export interface SelectorProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -106,7 +107,7 @@ const Selector = defineComponent<SelectorProps>({
|
||||||
onSearch: PropTypes.func,
|
onSearch: PropTypes.func,
|
||||||
onSearchSubmit: PropTypes.func,
|
onSearchSubmit: PropTypes.func,
|
||||||
onSelect: PropTypes.func,
|
onSelect: PropTypes.func,
|
||||||
onInputKeyDown: PropTypes.func,
|
onInputKeyDown: { type: Function as PropType<EventHandler> },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private get real dom for trigger align.
|
* @private get real dom for trigger align.
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RefObject } from '../../_util/createRef';
|
||||||
import type { VNodeChild } from 'vue';
|
import type { VNodeChild } from 'vue';
|
||||||
import type { Mode } from '../interface';
|
import type { Mode } from '../interface';
|
||||||
import type { LabelValueType } from '../interface/generator';
|
import type { LabelValueType } from '../interface/generator';
|
||||||
|
import type { EventHandler } from '../../_util/EventInterface';
|
||||||
|
|
||||||
export interface InnerSelectorProps {
|
export interface InnerSelectorProps {
|
||||||
prefixCls: string;
|
prefixCls: string;
|
||||||
|
@ -18,10 +19,10 @@ export interface InnerSelectorProps {
|
||||||
accessibilityIndex: number;
|
accessibilityIndex: number;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
tabindex?: number | string;
|
tabindex?: number | string;
|
||||||
onInputKeyDown: EventHandlerNonNull;
|
onInputKeyDown: EventHandler;
|
||||||
onInputMouseDown: EventHandlerNonNull;
|
onInputMouseDown: EventHandler;
|
||||||
onInputChange: EventHandlerNonNull;
|
onInputChange: EventHandler;
|
||||||
onInputPaste: EventHandlerNonNull;
|
onInputPaste: EventHandler;
|
||||||
onInputCompositionStart: EventHandlerNonNull;
|
onInputCompositionStart: EventHandler;
|
||||||
onInputCompositionEnd: EventHandlerNonNull;
|
onInputCompositionEnd: EventHandler;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
"through2": "^3.0.0",
|
"through2": "^3.0.0",
|
||||||
"ts-jest": "^26.4.1",
|
"ts-jest": "^26.4.1",
|
||||||
"ts-loader": "^9.1.0",
|
"ts-loader": "^9.1.0",
|
||||||
"typescript": "^4.2.0",
|
"typescript": "~4.3.5",
|
||||||
"umi-mock-middleware": "^1.0.0",
|
"umi-mock-middleware": "^1.0.0",
|
||||||
"umi-request": "^1.3.5",
|
"umi-request": "^1.3.5",
|
||||||
"url-loader": "^3.0.0",
|
"url-loader": "^3.0.0",
|
||||||
|
|
2
v2-doc
2
v2-doc
|
@ -1 +1 @@
|
||||||
Subproject commit 36b2776cbf91e0db3b14d40d14879417490c56eb
|
Subproject commit 17abe8a32a993726902f52e153f5470c1ffba02a
|
Loading…
Reference in New Issue