@autobest-ui/components 2.6.3-alpha.0 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -1
- package/esm/input/Adorn.js +4 -8
- package/esm/input/Input.d.ts +6 -6
- package/esm/input/TextArea.d.ts +3 -3
- package/esm/input-number/index.d.ts +1 -13
- package/esm/popover/index.d.ts +12 -0
- package/esm/trigger/index.d.ts +30 -12
- package/lib/index.d.ts +2 -0
- package/lib/index.js +7 -0
- package/lib/input/Adorn.js +4 -8
- package/lib/input/Input.d.ts +6 -6
- package/lib/input/TextArea.d.ts +3 -3
- package/lib/input-number/index.d.ts +1 -13
- package/lib/popover/index.d.ts +12 -0
- package/lib/trigger/index.d.ts +30 -12
- package/package.json +2 -2
package/esm/index.d.ts
CHANGED
|
@@ -56,3 +56,5 @@ export { default as LoadingContainer } from './loading-container';
|
|
|
56
56
|
export { default as LoadingBar } from './loading-bar';
|
|
57
57
|
export type { LoadingIconProps } from './loading-icon';
|
|
58
58
|
export { default as LoadingIcon } from './loading-icon';
|
|
59
|
+
export type { TriggerProps, TriggerType, TriggerPlacement, ArrowStyleProps } from './trigger';
|
|
60
|
+
export { default as Trigger } from './trigger';
|
package/esm/index.js
CHANGED
|
@@ -26,4 +26,5 @@ export { default as Tabs } from './tabs';
|
|
|
26
26
|
export { default as Loading } from './loading';
|
|
27
27
|
export { default as LoadingContainer } from './loading-container';
|
|
28
28
|
export { default as LoadingBar } from './loading-bar';
|
|
29
|
-
export { default as LoadingIcon } from './loading-icon';
|
|
29
|
+
export { default as LoadingIcon } from './loading-icon';
|
|
30
|
+
export { default as Trigger } from './trigger';
|
package/esm/input/Adorn.js
CHANGED
|
@@ -33,24 +33,20 @@ var Adorn = function Adorn(props) {
|
|
|
33
33
|
if (disabled) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
changeFocusStatus(true);
|
|
38
|
-
}
|
|
36
|
+
changeFocusStatus(true);
|
|
39
37
|
if (onFocus) {
|
|
40
38
|
onFocus(ev);
|
|
41
39
|
}
|
|
42
|
-
}, [onFocus,
|
|
40
|
+
}, [onFocus, disabled]);
|
|
43
41
|
var onBlurCallback = useCallback(function (ev) {
|
|
44
|
-
|
|
45
|
-
changeFocusStatus(false);
|
|
46
|
-
}
|
|
42
|
+
changeFocusStatus(false);
|
|
47
43
|
if (disabled) {
|
|
48
44
|
return;
|
|
49
45
|
}
|
|
50
46
|
if (onBlur) {
|
|
51
47
|
onBlur(ev);
|
|
52
48
|
}
|
|
53
|
-
}, [onBlur,
|
|
49
|
+
}, [onBlur, disabled]);
|
|
54
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
51
|
className: classNames(prefixCls, className, (_a = {}, _a["".concat(prefixCls, "-enter")] = isEnter || isFocus, _a), (_b = {}, _b["".concat(prefixCls, "-focus")] = isFocus, _b), (_c = {}, _c["".concat(prefixCls, "-disabled")] = disabled, _c)),
|
|
56
52
|
onMouseEnter: onMouseEnterCallback,
|
package/esm/input/Input.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AdornProps } from './Adorn';
|
|
3
3
|
export declare type InputValue = string | File | undefined;
|
|
4
|
-
export interface InputProps extends Omit<AdornProps, 'prefixCls' | 'children' | 'onBlur' | 'onFocus'>, Pick<React.InputHTMLAttributes<any>, 'placeholder' | 'style' | 'maxLength' | 'type' | 'accept'> {
|
|
4
|
+
export interface InputProps<T = InputValue> extends Omit<AdornProps, 'prefixCls' | 'children' | 'onBlur' | 'onFocus'>, Pick<React.InputHTMLAttributes<any>, 'placeholder' | 'style' | 'maxLength' | 'type' | 'accept'> {
|
|
5
5
|
/**
|
|
6
6
|
* 输入框默认值,用于非受控组件,配合ref使用
|
|
7
7
|
*/
|
|
@@ -21,15 +21,15 @@ export interface InputProps extends Omit<AdornProps, 'prefixCls' | 'children' |
|
|
|
21
21
|
/**
|
|
22
22
|
* 值修改后的回调函数,用于修改value属性
|
|
23
23
|
*/
|
|
24
|
-
onChange?: (value:
|
|
24
|
+
onChange?: (value: T, name?: string) => void;
|
|
25
25
|
/**
|
|
26
26
|
* 获得焦点的回调函数
|
|
27
27
|
*/
|
|
28
|
-
onFocus?: (value:
|
|
28
|
+
onFocus?: (value: T, name?: string) => void;
|
|
29
29
|
/**
|
|
30
30
|
* 失去焦点的回调函数
|
|
31
31
|
*/
|
|
32
|
-
onBlur?: (value:
|
|
32
|
+
onBlur?: (value: T, name?: string) => void;
|
|
33
33
|
/**
|
|
34
34
|
* 用户触发keydown时的回调,主要用于键盘监听
|
|
35
35
|
*/
|
|
@@ -38,7 +38,7 @@ export interface InputProps extends Omit<AdornProps, 'prefixCls' | 'children' |
|
|
|
38
38
|
interface InputStates {
|
|
39
39
|
value: string | undefined;
|
|
40
40
|
}
|
|
41
|
-
interface InputPropsWithRef extends InputProps {
|
|
41
|
+
interface InputPropsWithRef extends InputProps<any> {
|
|
42
42
|
/**
|
|
43
43
|
* 此属性可以忽略, storybook问题
|
|
44
44
|
*/
|
|
@@ -66,5 +66,5 @@ export declare class InputNotRef extends React.Component<InputPropsWithRef, Inpu
|
|
|
66
66
|
onKeyDown: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
67
67
|
render(): JSX.Element;
|
|
68
68
|
}
|
|
69
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
69
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps<any> & React.RefAttributes<HTMLInputElement>>;
|
|
70
70
|
export default Input;
|
package/esm/input/TextArea.d.ts
CHANGED
|
@@ -20,15 +20,15 @@ export interface TextAreaProps extends Omit<AdornProps, 'prefixCls' | 'children'
|
|
|
20
20
|
/**
|
|
21
21
|
* 值修改后的回调函数,用于修改value属性
|
|
22
22
|
*/
|
|
23
|
-
onChange?: (value: string
|
|
23
|
+
onChange?: (value: string, name?: string) => void;
|
|
24
24
|
/**
|
|
25
25
|
* 获得焦点的回调函数
|
|
26
26
|
*/
|
|
27
|
-
onFocus?: (value: string
|
|
27
|
+
onFocus?: (value: string, name?: string) => void;
|
|
28
28
|
/**
|
|
29
29
|
* 失去焦点的回调函数
|
|
30
30
|
*/
|
|
31
|
-
onBlur?: (value: string
|
|
31
|
+
onBlur?: (value: string, name?: string) => void;
|
|
32
32
|
/**
|
|
33
33
|
* 用户触发keydown时的回调,主要用于键盘监听
|
|
34
34
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AddListenerEventHandler } from '@autobest-ui/utils';
|
|
3
3
|
import { InputProps, InputValue } from '../input/Input';
|
|
4
|
-
export interface InputNumberProps extends Omit<InputProps
|
|
4
|
+
export interface InputNumberProps extends Omit<InputProps<number>, 'value' | 'defaultValue' | 'suffix' | 'onKeyDown'> {
|
|
5
5
|
/**
|
|
6
6
|
* 输入框默认值,用于非受控组件,配合ref使用
|
|
7
7
|
*/
|
|
@@ -38,23 +38,11 @@ export interface InputNumberProps extends Omit<InputProps, 'value' | 'defaultVal
|
|
|
38
38
|
* 是否启用键盘上下快捷行为
|
|
39
39
|
*/
|
|
40
40
|
keyboard?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* 值修改后的回调函数,用于修改value属性
|
|
43
|
-
*/
|
|
44
|
-
onChange?: (parserValue: number | undefined, name?: string) => void;
|
|
45
41
|
/**
|
|
46
42
|
* 值发生改变将会触发,onChange是不合法将不在触发,只在最后onBlur时再触发一次
|
|
47
43
|
* 该方法主要用在用户输入内容判断上,不要在此方法中执行修改value的操作
|
|
48
44
|
*/
|
|
49
45
|
onContinualChange?: (originalValue: string | number | undefined, parserValue: number | undefined, name?: string) => void;
|
|
50
|
-
/**
|
|
51
|
-
* 获得焦点的回调函数
|
|
52
|
-
*/
|
|
53
|
-
onFocus?: (parserValue: number | undefined, name?: string) => void;
|
|
54
|
-
/**
|
|
55
|
-
* 失去焦点的回调函数
|
|
56
|
-
*/
|
|
57
|
-
onBlur?: (parserValue: number | undefined, name?: string) => void;
|
|
58
46
|
/**
|
|
59
47
|
* 用户触发keydown时的回调,主要用于键盘监听
|
|
60
48
|
*/
|
package/esm/popover/index.d.ts
CHANGED
|
@@ -14,6 +14,18 @@ export interface PopoverProps extends Pick<TriggerProps, Exclude<keyof TriggerPr
|
|
|
14
14
|
* 是否隐藏close图标
|
|
15
15
|
*/
|
|
16
16
|
hiddenClose?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 箭头 className
|
|
19
|
+
*/
|
|
20
|
+
arrowClassName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* close图标 className
|
|
23
|
+
*/
|
|
24
|
+
closeClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 内容样式,可以定义内容元素样式
|
|
27
|
+
*/
|
|
28
|
+
innerClassName?: string;
|
|
17
29
|
}
|
|
18
30
|
export declare type PopoverPlacement = TriggerPlacement;
|
|
19
31
|
export declare type PopoverTriggerType = TriggerType;
|
package/esm/trigger/index.d.ts
CHANGED
|
@@ -28,7 +28,13 @@ export interface TriggerProps {
|
|
|
28
28
|
* 用于手动控制浮层显隐
|
|
29
29
|
*/
|
|
30
30
|
visible?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 水平位移
|
|
33
|
+
*/
|
|
31
34
|
translateX?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 垂直位移
|
|
37
|
+
*/
|
|
32
38
|
translateY?: number;
|
|
33
39
|
/**
|
|
34
40
|
* 用于嵌套多个弹框提示时, 点击别处只隐藏当前元素
|
|
@@ -38,6 +44,9 @@ export interface TriggerProps {
|
|
|
38
44
|
* 插入元素,不使用传送门, 和当前元素同级,形成兄弟节点(sibling)
|
|
39
45
|
*/
|
|
40
46
|
isInsertNode?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 监听屏幕大小变化并更新位置
|
|
49
|
+
*/
|
|
41
50
|
monitorWindowResize?: boolean;
|
|
42
51
|
/**
|
|
43
52
|
* 当resize时,隐藏trigger
|
|
@@ -55,32 +64,38 @@ export interface TriggerProps {
|
|
|
55
64
|
* 隐藏时延迟时间 单位:秒
|
|
56
65
|
*/
|
|
57
66
|
mouseLeaveDelay?: number;
|
|
67
|
+
/**
|
|
68
|
+
* 弹框最多高度,超出显示滚动条
|
|
69
|
+
*/
|
|
58
70
|
maxHeight?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 弹框最小宽度是 root 元素的宽度
|
|
73
|
+
*/
|
|
59
74
|
isMinRootWidth?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 弹框最大宽度是 root 元素的宽度
|
|
77
|
+
*/
|
|
60
78
|
isMaxRootWidth?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* 元素到弹框之间的间距
|
|
81
|
+
*/
|
|
61
82
|
rootToPopupSpacing?: number;
|
|
83
|
+
/**
|
|
84
|
+
* 弹框到边界的间距
|
|
85
|
+
*/
|
|
62
86
|
popupLimitSpacing?: number;
|
|
87
|
+
/**
|
|
88
|
+
* 动画原点方位, horizontal,circle
|
|
89
|
+
*/
|
|
63
90
|
isTransformHorizontalDirection?: boolean;
|
|
64
91
|
/**
|
|
65
92
|
* 隐藏箭头
|
|
66
93
|
*/
|
|
67
94
|
hiddenArrow?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* 箭头样式重置
|
|
70
|
-
*/
|
|
71
|
-
arrowClassName?: string;
|
|
72
95
|
/**
|
|
73
96
|
* 主体样式, 这里可以定义内容宽度,高度, border等
|
|
74
97
|
*/
|
|
75
98
|
wrapClassName?: string;
|
|
76
|
-
/**
|
|
77
|
-
* 内容样式,可以定义内容元素样式
|
|
78
|
-
*/
|
|
79
|
-
innerClassName?: string;
|
|
80
|
-
/**
|
|
81
|
-
* 对当前Popover close图标, 重置样式
|
|
82
|
-
*/
|
|
83
|
-
closeClassName?: string;
|
|
84
99
|
/**
|
|
85
100
|
* visible变化的回调函数,回调函数返回status和name
|
|
86
101
|
*/
|
|
@@ -90,6 +105,9 @@ export interface TriggerProps {
|
|
|
90
105
|
* 隐藏后的回调函数
|
|
91
106
|
*/
|
|
92
107
|
onDestroy?: () => void;
|
|
108
|
+
/**
|
|
109
|
+
* 参数为箭头位置信息
|
|
110
|
+
*/
|
|
93
111
|
onArrowStyleChange?: (v: ArrowStyleProps) => void;
|
|
94
112
|
}
|
|
95
113
|
interface TriggerStates {
|
package/lib/index.d.ts
CHANGED
|
@@ -56,3 +56,5 @@ export { default as LoadingContainer } from './loading-container';
|
|
|
56
56
|
export { default as LoadingBar } from './loading-bar';
|
|
57
57
|
export type { LoadingIconProps } from './loading-icon';
|
|
58
58
|
export { default as LoadingIcon } from './loading-icon';
|
|
59
|
+
export type { TriggerProps, TriggerType, TriggerPlacement, ArrowStyleProps } from './trigger';
|
|
60
|
+
export { default as Trigger } from './trigger';
|
package/lib/index.js
CHANGED
|
@@ -185,6 +185,12 @@ Object.defineProperty(exports, "Tooltip", {
|
|
|
185
185
|
return _tooltip.default;
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
|
+
Object.defineProperty(exports, "Trigger", {
|
|
189
|
+
enumerable: true,
|
|
190
|
+
get: function get() {
|
|
191
|
+
return _trigger.default;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
188
194
|
Object.defineProperty(exports, "message", {
|
|
189
195
|
enumerable: true,
|
|
190
196
|
get: function get() {
|
|
@@ -220,5 +226,6 @@ var _loading = _interopRequireDefault(require("./loading"));
|
|
|
220
226
|
var _loadingContainer = _interopRequireDefault(require("./loading-container"));
|
|
221
227
|
var _loadingBar = _interopRequireDefault(require("./loading-bar"));
|
|
222
228
|
var _loadingIcon = _interopRequireDefault(require("./loading-icon"));
|
|
229
|
+
var _trigger = _interopRequireDefault(require("./trigger"));
|
|
223
230
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
224
231
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/lib/input/Adorn.js
CHANGED
|
@@ -43,24 +43,20 @@ var Adorn = function Adorn(props) {
|
|
|
43
43
|
if (disabled) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
changeFocusStatus(true);
|
|
48
|
-
}
|
|
46
|
+
changeFocusStatus(true);
|
|
49
47
|
if (onFocus) {
|
|
50
48
|
onFocus(ev);
|
|
51
49
|
}
|
|
52
|
-
}, [onFocus,
|
|
50
|
+
}, [onFocus, disabled]);
|
|
53
51
|
var onBlurCallback = (0, _react.useCallback)(function (ev) {
|
|
54
|
-
|
|
55
|
-
changeFocusStatus(false);
|
|
56
|
-
}
|
|
52
|
+
changeFocusStatus(false);
|
|
57
53
|
if (disabled) {
|
|
58
54
|
return;
|
|
59
55
|
}
|
|
60
56
|
if (onBlur) {
|
|
61
57
|
onBlur(ev);
|
|
62
58
|
}
|
|
63
|
-
}, [onBlur,
|
|
59
|
+
}, [onBlur, disabled]);
|
|
64
60
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
61
|
className: (0, _classnames.default)(prefixCls, className, (_a = {}, _a["".concat(prefixCls, "-enter")] = isEnter || isFocus, _a), (_b = {}, _b["".concat(prefixCls, "-focus")] = isFocus, _b), (_c = {}, _c["".concat(prefixCls, "-disabled")] = disabled, _c)),
|
|
66
62
|
onMouseEnter: onMouseEnterCallback,
|
package/lib/input/Input.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AdornProps } from './Adorn';
|
|
3
3
|
export declare type InputValue = string | File | undefined;
|
|
4
|
-
export interface InputProps extends Omit<AdornProps, 'prefixCls' | 'children' | 'onBlur' | 'onFocus'>, Pick<React.InputHTMLAttributes<any>, 'placeholder' | 'style' | 'maxLength' | 'type' | 'accept'> {
|
|
4
|
+
export interface InputProps<T = InputValue> extends Omit<AdornProps, 'prefixCls' | 'children' | 'onBlur' | 'onFocus'>, Pick<React.InputHTMLAttributes<any>, 'placeholder' | 'style' | 'maxLength' | 'type' | 'accept'> {
|
|
5
5
|
/**
|
|
6
6
|
* 输入框默认值,用于非受控组件,配合ref使用
|
|
7
7
|
*/
|
|
@@ -21,15 +21,15 @@ export interface InputProps extends Omit<AdornProps, 'prefixCls' | 'children' |
|
|
|
21
21
|
/**
|
|
22
22
|
* 值修改后的回调函数,用于修改value属性
|
|
23
23
|
*/
|
|
24
|
-
onChange?: (value:
|
|
24
|
+
onChange?: (value: T, name?: string) => void;
|
|
25
25
|
/**
|
|
26
26
|
* 获得焦点的回调函数
|
|
27
27
|
*/
|
|
28
|
-
onFocus?: (value:
|
|
28
|
+
onFocus?: (value: T, name?: string) => void;
|
|
29
29
|
/**
|
|
30
30
|
* 失去焦点的回调函数
|
|
31
31
|
*/
|
|
32
|
-
onBlur?: (value:
|
|
32
|
+
onBlur?: (value: T, name?: string) => void;
|
|
33
33
|
/**
|
|
34
34
|
* 用户触发keydown时的回调,主要用于键盘监听
|
|
35
35
|
*/
|
|
@@ -38,7 +38,7 @@ export interface InputProps extends Omit<AdornProps, 'prefixCls' | 'children' |
|
|
|
38
38
|
interface InputStates {
|
|
39
39
|
value: string | undefined;
|
|
40
40
|
}
|
|
41
|
-
interface InputPropsWithRef extends InputProps {
|
|
41
|
+
interface InputPropsWithRef extends InputProps<any> {
|
|
42
42
|
/**
|
|
43
43
|
* 此属性可以忽略, storybook问题
|
|
44
44
|
*/
|
|
@@ -66,5 +66,5 @@ export declare class InputNotRef extends React.Component<InputPropsWithRef, Inpu
|
|
|
66
66
|
onKeyDown: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
67
67
|
render(): JSX.Element;
|
|
68
68
|
}
|
|
69
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
69
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps<any> & React.RefAttributes<HTMLInputElement>>;
|
|
70
70
|
export default Input;
|
package/lib/input/TextArea.d.ts
CHANGED
|
@@ -20,15 +20,15 @@ export interface TextAreaProps extends Omit<AdornProps, 'prefixCls' | 'children'
|
|
|
20
20
|
/**
|
|
21
21
|
* 值修改后的回调函数,用于修改value属性
|
|
22
22
|
*/
|
|
23
|
-
onChange?: (value: string
|
|
23
|
+
onChange?: (value: string, name?: string) => void;
|
|
24
24
|
/**
|
|
25
25
|
* 获得焦点的回调函数
|
|
26
26
|
*/
|
|
27
|
-
onFocus?: (value: string
|
|
27
|
+
onFocus?: (value: string, name?: string) => void;
|
|
28
28
|
/**
|
|
29
29
|
* 失去焦点的回调函数
|
|
30
30
|
*/
|
|
31
|
-
onBlur?: (value: string
|
|
31
|
+
onBlur?: (value: string, name?: string) => void;
|
|
32
32
|
/**
|
|
33
33
|
* 用户触发keydown时的回调,主要用于键盘监听
|
|
34
34
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AddListenerEventHandler } from '@autobest-ui/utils';
|
|
3
3
|
import { InputProps, InputValue } from '../input/Input';
|
|
4
|
-
export interface InputNumberProps extends Omit<InputProps
|
|
4
|
+
export interface InputNumberProps extends Omit<InputProps<number>, 'value' | 'defaultValue' | 'suffix' | 'onKeyDown'> {
|
|
5
5
|
/**
|
|
6
6
|
* 输入框默认值,用于非受控组件,配合ref使用
|
|
7
7
|
*/
|
|
@@ -38,23 +38,11 @@ export interface InputNumberProps extends Omit<InputProps, 'value' | 'defaultVal
|
|
|
38
38
|
* 是否启用键盘上下快捷行为
|
|
39
39
|
*/
|
|
40
40
|
keyboard?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* 值修改后的回调函数,用于修改value属性
|
|
43
|
-
*/
|
|
44
|
-
onChange?: (parserValue: number | undefined, name?: string) => void;
|
|
45
41
|
/**
|
|
46
42
|
* 值发生改变将会触发,onChange是不合法将不在触发,只在最后onBlur时再触发一次
|
|
47
43
|
* 该方法主要用在用户输入内容判断上,不要在此方法中执行修改value的操作
|
|
48
44
|
*/
|
|
49
45
|
onContinualChange?: (originalValue: string | number | undefined, parserValue: number | undefined, name?: string) => void;
|
|
50
|
-
/**
|
|
51
|
-
* 获得焦点的回调函数
|
|
52
|
-
*/
|
|
53
|
-
onFocus?: (parserValue: number | undefined, name?: string) => void;
|
|
54
|
-
/**
|
|
55
|
-
* 失去焦点的回调函数
|
|
56
|
-
*/
|
|
57
|
-
onBlur?: (parserValue: number | undefined, name?: string) => void;
|
|
58
46
|
/**
|
|
59
47
|
* 用户触发keydown时的回调,主要用于键盘监听
|
|
60
48
|
*/
|
package/lib/popover/index.d.ts
CHANGED
|
@@ -14,6 +14,18 @@ export interface PopoverProps extends Pick<TriggerProps, Exclude<keyof TriggerPr
|
|
|
14
14
|
* 是否隐藏close图标
|
|
15
15
|
*/
|
|
16
16
|
hiddenClose?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 箭头 className
|
|
19
|
+
*/
|
|
20
|
+
arrowClassName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* close图标 className
|
|
23
|
+
*/
|
|
24
|
+
closeClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 内容样式,可以定义内容元素样式
|
|
27
|
+
*/
|
|
28
|
+
innerClassName?: string;
|
|
17
29
|
}
|
|
18
30
|
export declare type PopoverPlacement = TriggerPlacement;
|
|
19
31
|
export declare type PopoverTriggerType = TriggerType;
|
package/lib/trigger/index.d.ts
CHANGED
|
@@ -28,7 +28,13 @@ export interface TriggerProps {
|
|
|
28
28
|
* 用于手动控制浮层显隐
|
|
29
29
|
*/
|
|
30
30
|
visible?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 水平位移
|
|
33
|
+
*/
|
|
31
34
|
translateX?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 垂直位移
|
|
37
|
+
*/
|
|
32
38
|
translateY?: number;
|
|
33
39
|
/**
|
|
34
40
|
* 用于嵌套多个弹框提示时, 点击别处只隐藏当前元素
|
|
@@ -38,6 +44,9 @@ export interface TriggerProps {
|
|
|
38
44
|
* 插入元素,不使用传送门, 和当前元素同级,形成兄弟节点(sibling)
|
|
39
45
|
*/
|
|
40
46
|
isInsertNode?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 监听屏幕大小变化并更新位置
|
|
49
|
+
*/
|
|
41
50
|
monitorWindowResize?: boolean;
|
|
42
51
|
/**
|
|
43
52
|
* 当resize时,隐藏trigger
|
|
@@ -55,32 +64,38 @@ export interface TriggerProps {
|
|
|
55
64
|
* 隐藏时延迟时间 单位:秒
|
|
56
65
|
*/
|
|
57
66
|
mouseLeaveDelay?: number;
|
|
67
|
+
/**
|
|
68
|
+
* 弹框最多高度,超出显示滚动条
|
|
69
|
+
*/
|
|
58
70
|
maxHeight?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 弹框最小宽度是 root 元素的宽度
|
|
73
|
+
*/
|
|
59
74
|
isMinRootWidth?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 弹框最大宽度是 root 元素的宽度
|
|
77
|
+
*/
|
|
60
78
|
isMaxRootWidth?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* 元素到弹框之间的间距
|
|
81
|
+
*/
|
|
61
82
|
rootToPopupSpacing?: number;
|
|
83
|
+
/**
|
|
84
|
+
* 弹框到边界的间距
|
|
85
|
+
*/
|
|
62
86
|
popupLimitSpacing?: number;
|
|
87
|
+
/**
|
|
88
|
+
* 动画原点方位, horizontal,circle
|
|
89
|
+
*/
|
|
63
90
|
isTransformHorizontalDirection?: boolean;
|
|
64
91
|
/**
|
|
65
92
|
* 隐藏箭头
|
|
66
93
|
*/
|
|
67
94
|
hiddenArrow?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* 箭头样式重置
|
|
70
|
-
*/
|
|
71
|
-
arrowClassName?: string;
|
|
72
95
|
/**
|
|
73
96
|
* 主体样式, 这里可以定义内容宽度,高度, border等
|
|
74
97
|
*/
|
|
75
98
|
wrapClassName?: string;
|
|
76
|
-
/**
|
|
77
|
-
* 内容样式,可以定义内容元素样式
|
|
78
|
-
*/
|
|
79
|
-
innerClassName?: string;
|
|
80
|
-
/**
|
|
81
|
-
* 对当前Popover close图标, 重置样式
|
|
82
|
-
*/
|
|
83
|
-
closeClassName?: string;
|
|
84
99
|
/**
|
|
85
100
|
* visible变化的回调函数,回调函数返回status和name
|
|
86
101
|
*/
|
|
@@ -90,6 +105,9 @@ export interface TriggerProps {
|
|
|
90
105
|
* 隐藏后的回调函数
|
|
91
106
|
*/
|
|
92
107
|
onDestroy?: () => void;
|
|
108
|
+
/**
|
|
109
|
+
* 参数为箭头位置信息
|
|
110
|
+
*/
|
|
93
111
|
onArrowStyleChange?: (v: ArrowStyleProps) => void;
|
|
94
112
|
}
|
|
95
113
|
interface TriggerStates {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobest-ui/components",
|
|
3
|
-
"version": "2.6.3
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "components common ui for React",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@autobest-ui/utils": "^2.1.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "61c137cce5fd878ad5c1402bfc211e7514d44cba"
|
|
56
56
|
}
|