react-vant-nova 1.0.7 → 1.1.0-test
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/bundle/react-vant-nova.es.js +8 -9
- package/bundle/react-vant-nova.js +8 -9
- package/bundle/react-vant-nova.min.js +2 -2
- package/es/popup/Popup.js +0 -3
- package/es/toast/Toast.js +23 -19
- package/es/utils/dom/event.js +8 -6
- package/lib/popup/Popup.js +0 -3
- package/lib/toast/Toast.js +23 -19
- package/lib/utils/dom/event.js +8 -6
- package/package.json +1 -1
package/es/popup/Popup.js
CHANGED
|
@@ -168,9 +168,6 @@ const Popup = forwardRef((p, ref) => {
|
|
|
168
168
|
const name = position === 'center' ? 'rv-fade' : `rv-popup-slide-${position}`;
|
|
169
169
|
return _jsx(CSSTransition, Object.assign({
|
|
170
170
|
in: visible,
|
|
171
|
-
/**
|
|
172
|
-
* https://github.com/reactjs/react-transition-group/pull/559
|
|
173
|
-
*/
|
|
174
171
|
nodeRef: popupRef,
|
|
175
172
|
timeout: duration,
|
|
176
173
|
classNames: transition || name,
|
package/es/toast/Toast.js
CHANGED
|
@@ -50,6 +50,7 @@ const Toast = p => {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
if (type === 'loading') {
|
|
53
|
+
// @ts-ignore
|
|
53
54
|
return _jsx(Loading, {
|
|
54
55
|
className: clsx(bem('loading')),
|
|
55
56
|
type: loadingType
|
|
@@ -70,24 +71,27 @@ const Toast = p => {
|
|
|
70
71
|
}
|
|
71
72
|
return null;
|
|
72
73
|
};
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
return (
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
_jsxs(Popup, Object.assign({
|
|
77
|
+
className: clsx([bem([props.position, {
|
|
78
|
+
[props.type]: !props.icon
|
|
79
|
+
}]), props.className]),
|
|
80
|
+
visible: props.visible,
|
|
81
|
+
overlay: props.overlay,
|
|
82
|
+
transition: props.transition,
|
|
83
|
+
overlayClass: props.overlayClass,
|
|
84
|
+
overlayStyle: props.overlayStyle,
|
|
85
|
+
closeOnClickOverlay: props.closeOnClickOverlay,
|
|
86
|
+
lockScroll: false,
|
|
87
|
+
onClick: onClick,
|
|
88
|
+
onClose: props.onClose,
|
|
89
|
+
onClosed: props.onClosed,
|
|
90
|
+
onOpened: props.onOpened,
|
|
91
|
+
teleport: props.teleport
|
|
92
|
+
}, {
|
|
93
|
+
children: [renderIcon(), renderMessage()]
|
|
94
|
+
}))
|
|
95
|
+
);
|
|
92
96
|
};
|
|
93
97
|
export default Toast;
|
package/es/utils/dom/event.js
CHANGED
|
@@ -18,12 +18,14 @@ const eventToPropRecord = {
|
|
|
18
18
|
export function withStopPropagation(events, element) {
|
|
19
19
|
const props = Object.assign({}, element.props);
|
|
20
20
|
for (const key of events) {
|
|
21
|
-
const prop =
|
|
22
|
-
props[prop]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
const prop = key.startsWith('on') ? key : `on${key.charAt(0).toUpperCase() + key.slice(1)}`;
|
|
22
|
+
if (typeof element.props[prop] === 'function') {
|
|
23
|
+
props[prop] = function (e) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
(_b = (_a = element.props)[prop]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
return React.cloneElement(element, props);
|
|
29
31
|
}
|
package/lib/popup/Popup.js
CHANGED
|
@@ -207,9 +207,6 @@ const Popup = (0, _react().forwardRef)((p, ref) => {
|
|
|
207
207
|
const name = position === 'center' ? 'rv-fade' : `rv-popup-slide-${position}`;
|
|
208
208
|
return (0, _jsxRuntime().jsx)(_reactTransitionGroup().CSSTransition, Object.assign({
|
|
209
209
|
in: visible,
|
|
210
|
-
/**
|
|
211
|
-
* https://github.com/reactjs/react-transition-group/pull/559
|
|
212
|
-
*/
|
|
213
210
|
nodeRef: popupRef,
|
|
214
211
|
timeout: duration,
|
|
215
212
|
classNames: transition || name,
|
package/lib/toast/Toast.js
CHANGED
|
@@ -82,6 +82,7 @@ const Toast = p => {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
if (type === 'loading') {
|
|
85
|
+
// @ts-ignore
|
|
85
86
|
return (0, _jsxRuntime().jsx)(_loading.default, {
|
|
86
87
|
className: (0, _clsx().default)(bem('loading')),
|
|
87
88
|
type: loadingType
|
|
@@ -102,24 +103,27 @@ const Toast = p => {
|
|
|
102
103
|
}
|
|
103
104
|
return null;
|
|
104
105
|
};
|
|
105
|
-
return (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
return (
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
(0, _jsxRuntime().jsxs)(_popup.default, Object.assign({
|
|
109
|
+
className: (0, _clsx().default)([bem([props.position, {
|
|
110
|
+
[props.type]: !props.icon
|
|
111
|
+
}]), props.className]),
|
|
112
|
+
visible: props.visible,
|
|
113
|
+
overlay: props.overlay,
|
|
114
|
+
transition: props.transition,
|
|
115
|
+
overlayClass: props.overlayClass,
|
|
116
|
+
overlayStyle: props.overlayStyle,
|
|
117
|
+
closeOnClickOverlay: props.closeOnClickOverlay,
|
|
118
|
+
lockScroll: false,
|
|
119
|
+
onClick: onClick,
|
|
120
|
+
onClose: props.onClose,
|
|
121
|
+
onClosed: props.onClosed,
|
|
122
|
+
onOpened: props.onOpened,
|
|
123
|
+
teleport: props.teleport
|
|
124
|
+
}, {
|
|
125
|
+
children: [renderIcon(), renderMessage()]
|
|
126
|
+
}))
|
|
127
|
+
);
|
|
124
128
|
};
|
|
125
129
|
var _default = exports.default = Toast;
|
package/lib/utils/dom/event.js
CHANGED
|
@@ -33,12 +33,14 @@ const eventToPropRecord = {
|
|
|
33
33
|
function withStopPropagation(events, element) {
|
|
34
34
|
const props = Object.assign({}, element.props);
|
|
35
35
|
for (const key of events) {
|
|
36
|
-
const prop =
|
|
37
|
-
props[prop]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const prop = key.startsWith('on') ? key : `on${key.charAt(0).toUpperCase() + key.slice(1)}`;
|
|
37
|
+
if (typeof element.props[prop] === 'function') {
|
|
38
|
+
props[prop] = function (e) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
(_b = (_a = element.props)[prop]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
return _react().default.cloneElement(element, props);
|
|
44
46
|
}
|