@arco-design/mobile-react 2.27.3 → 2.27.5
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/CHANGELOG.md +27 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.js +1 -1
- package/cjs/action-sheet/index.d.ts +2 -2
- package/cjs/badge/index.js +2 -1
- package/cjs/dialog/index.d.ts +2 -2
- package/cjs/form/type.js +2 -0
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/image-preview/index.js +2 -1
- package/cjs/image-preview/style/css/index.css +3 -0
- package/cjs/image-preview/style/index.less +4 -0
- package/cjs/index-bar/utils.js +1 -3
- package/cjs/index.d.ts +12 -12
- package/cjs/index.js +46 -46
- package/cjs/load-more/index.d.ts +5 -0
- package/cjs/load-more/index.js +2 -1
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/masking/index.js +4 -2
- package/cjs/notify/index.d.ts +8 -8
- package/cjs/popover/popover.js +10 -2
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/show-monitor/index.js +4 -3
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/popover.js +6 -2
- package/cjs/stepper/hooks/useButtonClick.js +8 -9
- package/cjs/style.d.ts +13 -13
- package/cjs/style.js +24 -24
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/index.js +5 -2
- package/dist/index.js +13859 -13830
- package/dist/index.min.js +3 -3
- package/dist/style.css +3273 -3270
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.js +2 -2
- package/esm/action-sheet/index.d.ts +2 -2
- package/esm/badge/index.js +2 -1
- package/esm/dialog/index.d.ts +2 -2
- package/esm/form/type.js +2 -0
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/image-preview/index.js +2 -1
- package/esm/image-preview/style/css/index.css +3 -0
- package/esm/image-preview/style/index.less +4 -0
- package/esm/index-bar/utils.js +1 -2
- package/esm/index.d.ts +12 -12
- package/esm/index.js +12 -12
- package/esm/load-more/index.d.ts +5 -0
- package/esm/load-more/index.js +2 -1
- package/esm/masking/index.d.ts +2 -2
- package/esm/masking/index.js +4 -2
- package/esm/notify/index.d.ts +8 -8
- package/esm/popover/popover.js +10 -2
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/show-monitor/index.js +4 -3
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/popover.js +7 -3
- package/esm/stepper/hooks/useButtonClick.js +8 -9
- package/esm/style.d.ts +13 -13
- package/esm/style.js +13 -13
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/index.js +5 -2
- package/package.json +3 -3
- package/umd/_helpers/hooks.js +1 -1
- package/umd/action-sheet/index.d.ts +2 -2
- package/umd/badge/index.js +2 -1
- package/umd/dialog/index.d.ts +2 -2
- package/umd/form/type.js +2 -0
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/image-preview/index.js +2 -1
- package/umd/image-preview/style/css/index.css +3 -0
- package/umd/image-preview/style/index.less +4 -0
- package/umd/index-bar/utils.js +5 -5
- package/umd/index.d.ts +12 -12
- package/umd/index.js +28 -28
- package/umd/load-more/index.d.ts +5 -0
- package/umd/load-more/index.js +2 -1
- package/umd/masking/index.d.ts +2 -2
- package/umd/masking/index.js +4 -2
- package/umd/notify/index.d.ts +8 -8
- package/umd/popover/popover.js +10 -2
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/show-monitor/index.js +4 -3
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/popover.js +6 -2
- package/umd/stepper/hooks/useButtonClick.js +8 -9
- package/umd/style.d.ts +13 -13
- package/umd/style.js +2 -2
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/index.js +5 -2
package/cjs/popup/index.d.ts
CHANGED
@@ -66,11 +66,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupProps & React.RefAt
|
|
66
66
|
* @param {PopupProps} config Configuration
|
67
67
|
* @returns {{ close: () => void; update: (newConfig: PopupProps) => void; }}
|
68
68
|
*/
|
69
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "
|
69
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
|
70
70
|
key?: string | undefined;
|
71
71
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
72
72
|
close: () => void;
|
73
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "
|
73
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
|
74
74
|
key?: string | undefined;
|
75
75
|
}) => void;
|
76
76
|
};
|
@@ -76,11 +76,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
|
|
76
76
|
* @param {string | PopupSwiperProps} config Configuration
|
77
77
|
* @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
|
78
78
|
*/
|
79
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "
|
79
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
80
80
|
key?: string | undefined;
|
81
81
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
82
82
|
close: () => void;
|
83
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "
|
83
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
84
84
|
key?: string | undefined;
|
85
85
|
}) => void; /**
|
86
86
|
* 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
|
@@ -232,8 +232,9 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
232
232
|
onOnceEmittedListeners[key] = [];
|
233
233
|
}, []);
|
234
234
|
|
235
|
-
function handleCheckChildrenExist() {
|
236
|
-
|
235
|
+
function handleCheckChildrenExist(target) {
|
236
|
+
var dom = target || domRef.current;
|
237
|
+
return isChildrenExist.current && (dom == null ? void 0 : dom.children.length);
|
237
238
|
}
|
238
239
|
|
239
240
|
function handleObserverStatusChange(entries) {
|
@@ -253,7 +254,7 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
253
254
|
* @en Callback when the visible status of current element changes before the comparison
|
254
255
|
*/
|
255
256
|
|
256
|
-
isIntersecting !== curVisible && handleCheckChildrenExist() && onCompVisibleChange(isIntersecting, target);
|
257
|
+
isIntersecting !== curVisible && handleCheckChildrenExist(target) && onCompVisibleChange(isIntersecting, target);
|
257
258
|
/**
|
258
259
|
* 当前元素状态由不可见变为可见,且只触发一次
|
259
260
|
* @en The current element is invisible -> visible, and once, triggers the callback
|
@@ -5,7 +5,7 @@ export declare type LinePosition = {
|
|
5
5
|
length: number;
|
6
6
|
start: number;
|
7
7
|
};
|
8
|
-
export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "
|
8
|
+
export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "onAfterChange" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks">>;
|
9
9
|
export * from './useSliderIcon';
|
10
10
|
export * from './useSliderInit';
|
11
11
|
export * from './useSliderStyle';
|
package/cjs/slider/popover.js
CHANGED
@@ -24,15 +24,19 @@ function Popover(_ref) {
|
|
24
24
|
_useContext$prefixCls = _useContext.prefixCls,
|
25
25
|
prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls;
|
26
26
|
|
27
|
+
var domRef = (0, _react.useRef)(null);
|
27
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
28
29
|
className: prefixCls + "-slider-popover-wrapper"
|
29
30
|
}, /*#__PURE__*/_react.default.createElement(_transition.default, {
|
30
31
|
in: visible,
|
31
32
|
timeout: 300,
|
32
33
|
type: "fade",
|
33
|
-
mountOnEnter: true
|
34
|
+
mountOnEnter: true,
|
35
|
+
unmountOnExit: true,
|
36
|
+
nodeRef: domRef
|
34
37
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
35
|
-
className: prefixCls + "-slider-popover" + (content ? '' : ' no-content')
|
38
|
+
className: prefixCls + "-slider-popover" + (content ? '' : ' no-content'),
|
39
|
+
ref: domRef
|
36
40
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
37
41
|
className: prefixCls + "-slider-popover-content"
|
38
42
|
}, content), /*#__PURE__*/_react.default.createElement("div", {
|
@@ -22,16 +22,15 @@ function useButtonClick(params) {
|
|
22
22
|
updateValue = params.updateValue,
|
23
23
|
onAddButtonClick = params.onAddButtonClick,
|
24
24
|
onMinusButtonClick = params.onMinusButtonClick;
|
25
|
+
var minusDisable = actualInputValue <= min || disabled;
|
25
26
|
|
26
|
-
var _useState = (0, _react.useState)(
|
27
|
-
return actualInputValue === min || disabled;
|
28
|
-
}),
|
27
|
+
var _useState = (0, _react.useState)(minusDisable),
|
29
28
|
minusButtonDisable = _useState[0],
|
30
29
|
setMinusButtonDisable = _useState[1];
|
31
30
|
|
32
|
-
var
|
33
|
-
|
34
|
-
|
31
|
+
var addDisable = actualInputValue >= max || disabled;
|
32
|
+
|
33
|
+
var _useState2 = (0, _react.useState)(addDisable),
|
35
34
|
addButtonDisable = _useState2[0],
|
36
35
|
setAddButtonDisable = _useState2[1];
|
37
36
|
|
@@ -62,9 +61,9 @@ function useButtonClick(params) {
|
|
62
61
|
|
63
62
|
|
64
63
|
(0, _react.useEffect)(function () {
|
65
|
-
setMinusButtonDisable(
|
66
|
-
setAddButtonDisable(
|
67
|
-
}, [
|
64
|
+
setMinusButtonDisable(minusDisable);
|
65
|
+
setAddButtonDisable(addDisable);
|
66
|
+
}, [minusDisable, addDisable]);
|
68
67
|
return {
|
69
68
|
minusButtonDisable: minusButtonDisable,
|
70
69
|
addButtonDisable: addButtonDisable,
|
package/cjs/style.d.ts
CHANGED
@@ -1,35 +1,32 @@
|
|
1
1
|
import '../style/public.less';
|
2
|
-
import './
|
2
|
+
import './tabs/style';
|
3
|
+
import './sticky/style';
|
4
|
+
import './load-more/style';
|
5
|
+
import './cell/style';
|
3
6
|
import './action-sheet/style';
|
4
7
|
import './avatar/style';
|
5
8
|
import './badge/style';
|
9
|
+
import './button/style';
|
6
10
|
import './carousel/style';
|
7
|
-
import './cell/style';
|
8
11
|
import './checkbox/style';
|
9
12
|
import './circle-progress/style';
|
10
13
|
import './collapse/style';
|
11
14
|
import './context-provider/style';
|
12
15
|
import './count-down/style';
|
13
16
|
import './date-picker/style';
|
14
|
-
import './divider/style';
|
15
17
|
import './dialog/style';
|
18
|
+
import './divider/style';
|
16
19
|
import './dropdown/style';
|
17
20
|
import './dropdown-menu/style';
|
18
21
|
import './ellipsis/style';
|
19
22
|
import './form/style';
|
20
|
-
import './input/style';
|
21
|
-
import './textarea/style';
|
22
|
-
import './radio/style';
|
23
|
-
import './image-picker/style';
|
24
|
-
import './rate/style';
|
25
|
-
import './slider/style';
|
26
23
|
import './grid/style';
|
27
24
|
import './image/style';
|
28
|
-
import './
|
25
|
+
import './image-picker/style';
|
29
26
|
import './image-preview/style';
|
30
27
|
import './index-bar/style';
|
28
|
+
import './input/style';
|
31
29
|
import './keyboard/style';
|
32
|
-
import './load-more/style';
|
33
30
|
import './loading/style';
|
34
31
|
import './masking/style';
|
35
32
|
import './nav-bar/style';
|
@@ -44,15 +41,18 @@ import './popup-swiper/style';
|
|
44
41
|
import './portal/style';
|
45
42
|
import './progress/style';
|
46
43
|
import './pull-refresh/style';
|
44
|
+
import './radio/style';
|
45
|
+
import './rate/style';
|
47
46
|
import './search-bar/style';
|
47
|
+
import './show-monitor/style';
|
48
|
+
import './slider/style';
|
48
49
|
import './stepper/style';
|
49
50
|
import './steps/style';
|
50
|
-
import './sticky/style';
|
51
51
|
import './swipe-action/style';
|
52
52
|
import './swipe-load/style';
|
53
53
|
import './switch/style';
|
54
54
|
import './tab-bar/style';
|
55
|
-
import './tabs/style';
|
56
55
|
import './tag/style';
|
56
|
+
import './textarea/style';
|
57
57
|
import './toast/style';
|
58
58
|
import './transition/style';
|
package/cjs/style.js
CHANGED
@@ -2,7 +2,13 @@
|
|
2
2
|
|
3
3
|
require("../style/public.less");
|
4
4
|
|
5
|
-
require("./
|
5
|
+
require("./tabs/style");
|
6
|
+
|
7
|
+
require("./sticky/style");
|
8
|
+
|
9
|
+
require("./load-more/style");
|
10
|
+
|
11
|
+
require("./cell/style");
|
6
12
|
|
7
13
|
require("./action-sheet/style");
|
8
14
|
|
@@ -10,9 +16,9 @@ require("./avatar/style");
|
|
10
16
|
|
11
17
|
require("./badge/style");
|
12
18
|
|
13
|
-
require("./
|
19
|
+
require("./button/style");
|
14
20
|
|
15
|
-
require("./
|
21
|
+
require("./carousel/style");
|
16
22
|
|
17
23
|
require("./checkbox/style");
|
18
24
|
|
@@ -26,10 +32,10 @@ require("./count-down/style");
|
|
26
32
|
|
27
33
|
require("./date-picker/style");
|
28
34
|
|
29
|
-
require("./divider/style");
|
30
|
-
|
31
35
|
require("./dialog/style");
|
32
36
|
|
37
|
+
require("./divider/style");
|
38
|
+
|
33
39
|
require("./dropdown/style");
|
34
40
|
|
35
41
|
require("./dropdown-menu/style");
|
@@ -38,31 +44,19 @@ require("./ellipsis/style");
|
|
38
44
|
|
39
45
|
require("./form/style");
|
40
46
|
|
41
|
-
require("./input/style");
|
42
|
-
|
43
|
-
require("./textarea/style");
|
44
|
-
|
45
|
-
require("./radio/style");
|
46
|
-
|
47
|
-
require("./image-picker/style");
|
48
|
-
|
49
|
-
require("./rate/style");
|
50
|
-
|
51
|
-
require("./slider/style");
|
52
|
-
|
53
47
|
require("./grid/style");
|
54
48
|
|
55
49
|
require("./image/style");
|
56
50
|
|
57
|
-
require("./
|
51
|
+
require("./image-picker/style");
|
58
52
|
|
59
53
|
require("./image-preview/style");
|
60
54
|
|
61
55
|
require("./index-bar/style");
|
62
56
|
|
63
|
-
require("./
|
57
|
+
require("./input/style");
|
64
58
|
|
65
|
-
require("./
|
59
|
+
require("./keyboard/style");
|
66
60
|
|
67
61
|
require("./loading/style");
|
68
62
|
|
@@ -92,14 +86,20 @@ require("./progress/style");
|
|
92
86
|
|
93
87
|
require("./pull-refresh/style");
|
94
88
|
|
89
|
+
require("./radio/style");
|
90
|
+
|
91
|
+
require("./rate/style");
|
92
|
+
|
95
93
|
require("./search-bar/style");
|
96
94
|
|
95
|
+
require("./show-monitor/style");
|
96
|
+
|
97
|
+
require("./slider/style");
|
98
|
+
|
97
99
|
require("./stepper/style");
|
98
100
|
|
99
101
|
require("./steps/style");
|
100
102
|
|
101
|
-
require("./sticky/style");
|
102
|
-
|
103
103
|
require("./swipe-action/style");
|
104
104
|
|
105
105
|
require("./swipe-load/style");
|
@@ -108,10 +108,10 @@ require("./switch/style");
|
|
108
108
|
|
109
109
|
require("./tab-bar/style");
|
110
110
|
|
111
|
-
require("./tabs/style");
|
112
|
-
|
113
111
|
require("./tag/style");
|
114
112
|
|
113
|
+
require("./textarea/style");
|
114
|
+
|
115
115
|
require("./toast/style");
|
116
116
|
|
117
117
|
require("./transition/style");
|
package/cjs/toast/index.d.ts
CHANGED
@@ -185,8 +185,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
185
185
|
* @param {string | ToastProps} config Configuration
|
186
186
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
187
187
|
*/
|
188
|
-
toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
189
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
188
|
+
toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
189
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
190
190
|
close: () => void;
|
191
191
|
hide: () => void;
|
192
192
|
};
|
@@ -196,8 +196,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
196
196
|
* @param {string | ToastProps} config Configuration
|
197
197
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
198
198
|
*/
|
199
|
-
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
200
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
199
|
+
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
200
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
201
201
|
close: () => void;
|
202
202
|
hide: () => void;
|
203
203
|
};
|
@@ -207,8 +207,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
207
207
|
* @param {string | ToastProps} config Configuration
|
208
208
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
209
209
|
*/
|
210
|
-
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
211
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
210
|
+
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
211
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
212
212
|
close: () => void;
|
213
213
|
hide: () => void;
|
214
214
|
};
|
@@ -218,8 +218,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
218
218
|
* @param {string | ToastProps} config Configuration
|
219
219
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
220
220
|
*/
|
221
|
-
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
222
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
221
|
+
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
222
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
223
223
|
close: () => void;
|
224
224
|
hide: () => void;
|
225
225
|
};
|
@@ -229,8 +229,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
229
229
|
* @param {string | ToastProps} config Configuration
|
230
230
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
231
231
|
*/
|
232
|
-
loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
233
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
232
|
+
loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
233
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
234
234
|
close: () => void;
|
235
235
|
hide: () => void;
|
236
236
|
};
|
@@ -240,8 +240,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
240
240
|
* @param {string | ToastProps} config Configuration
|
241
241
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
242
242
|
*/
|
243
|
-
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
244
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "
|
243
|
+
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
244
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
245
245
|
close: () => void;
|
246
246
|
hide: () => void;
|
247
247
|
};
|
package/cjs/toast/index.js
CHANGED
@@ -71,6 +71,7 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
71
71
|
initialBodyOverflow = props.initialBodyOverflow;
|
72
72
|
var closeTimerRef = (0, _react.useRef)();
|
73
73
|
var domRef = (0, _react.useRef)(null);
|
74
|
+
var wrapDomRef = (0, _react.useRef)(null);
|
74
75
|
var isInitialMount = (0, _react.useRef)(false);
|
75
76
|
var hasType = type && type !== 'info';
|
76
77
|
(0, _react.useImperativeHandle)(ref, function () {
|
@@ -139,7 +140,8 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
139
140
|
className: (0, _mobileUtils.cls)(prefixClass + "-wrapper", "from-" + direction, {
|
140
141
|
'no-event': !disableBodyTouch
|
141
142
|
}),
|
142
|
-
onClick: handleClickMask
|
143
|
+
onClick: handleClickMask,
|
144
|
+
ref: wrapDomRef
|
143
145
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
144
146
|
className: (0, _mobileUtils.cls)(prefixClass + "-inner", layout, (_cls = {}, _cls[prefixClass + "-inner-mixin"] = (loading || hasType || icon) && layout === 'vertical', _cls))
|
145
147
|
}, loading && /*#__PURE__*/_react.default.createElement("div", {
|
@@ -166,7 +168,8 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
166
168
|
}, /*#__PURE__*/_react.default.createElement(_transition.default, {
|
167
169
|
in: visible,
|
168
170
|
timeout: transitionDuration,
|
169
|
-
type: "fade"
|
171
|
+
type: "fade",
|
172
|
+
nodeRef: wrapDomRef
|
170
173
|
}, renderComponent(prefixCls + "-toast"))));
|
171
174
|
});
|
172
175
|
});
|