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/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 _jsxs(Popup, Object.assign({
74
- className: clsx([bem([props.position, {
75
- [props.type]: !props.icon
76
- }]), props.className]),
77
- visible: props.visible,
78
- overlay: props.overlay,
79
- transition: props.transition,
80
- overlayClass: props.overlayClass,
81
- overlayStyle: props.overlayStyle,
82
- closeOnClickOverlay: props.closeOnClickOverlay,
83
- lockScroll: false,
84
- onClick: onClick,
85
- onClose: props.onClose,
86
- onClosed: props.onClosed,
87
- onOpened: props.onOpened,
88
- teleport: props.teleport
89
- }, {
90
- children: [renderIcon(), renderMessage()]
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;
@@ -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 = eventToPropRecord[key];
22
- props[prop] = function (e) {
23
- var _a, _b;
24
- e.stopPropagation();
25
- (_b = (_a = element.props)[prop]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
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
  }
@@ -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,
@@ -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 (0, _jsxRuntime().jsxs)(_popup.default, Object.assign({
106
- className: (0, _clsx().default)([bem([props.position, {
107
- [props.type]: !props.icon
108
- }]), props.className]),
109
- visible: props.visible,
110
- overlay: props.overlay,
111
- transition: props.transition,
112
- overlayClass: props.overlayClass,
113
- overlayStyle: props.overlayStyle,
114
- closeOnClickOverlay: props.closeOnClickOverlay,
115
- lockScroll: false,
116
- onClick: onClick,
117
- onClose: props.onClose,
118
- onClosed: props.onClosed,
119
- onOpened: props.onOpened,
120
- teleport: props.teleport
121
- }, {
122
- children: [renderIcon(), renderMessage()]
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;
@@ -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 = eventToPropRecord[key];
37
- props[prop] = function (e) {
38
- var _a, _b;
39
- e.stopPropagation();
40
- (_b = (_a = element.props)[prop]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-vant-nova",
3
- "version": "1.0.7",
3
+ "version": "1.1.0-test",
4
4
  "description": "React Mobile UI Components based on Vant UI (兼容 React 19+,新增轻量 Table 组件)",
5
5
  "keywords": [
6
6
  "ui",