react-vant-nova 1.0.7 → 1.1.1-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 +9 -10
- package/bundle/react-vant-nova.js +9 -10
- 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/toast/method.js +3 -2
- package/es/utils/dom/event.js +8 -6
- package/lib/popup/Popup.js +0 -3
- package/lib/toast/Toast.js +23 -19
- package/lib/toast/method.js +2 -1
- package/lib/utils/dom/event.js +8 -6
- package/package.json +1 -1
|
@@ -120,18 +120,17 @@ function preventDefault(event, isStopPropagation) {
|
|
|
120
120
|
stopPropagation(event);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
const eventToPropRecord = {
|
|
124
|
-
"click": "onClick"
|
|
125
|
-
};
|
|
126
123
|
function withStopPropagation(events, element) {
|
|
127
124
|
const props = { ...element.props };
|
|
128
125
|
for (const key of events) {
|
|
129
|
-
const prop =
|
|
130
|
-
props[prop]
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
const prop = key.startsWith("on") ? key : `on${key.charAt(0).toUpperCase() + key.slice(1)}`;
|
|
127
|
+
if (typeof element.props[prop] === "function") {
|
|
128
|
+
props[prop] = function(e) {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
e.stopPropagation();
|
|
131
|
+
(_b = (_a = element.props)[prop]) == null ? void 0 : _b.call(_a, e);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
135
134
|
}
|
|
136
135
|
return React.cloneElement(element, props);
|
|
137
136
|
}
|
|
@@ -5731,7 +5730,7 @@ const ToastObj = (p) => {
|
|
|
5731
5730
|
},
|
|
5732
5731
|
[setState]
|
|
5733
5732
|
);
|
|
5734
|
-
|
|
5733
|
+
useIsomorphicLayoutEffect(() => {
|
|
5735
5734
|
setVisible(true);
|
|
5736
5735
|
if (!allowMultiple)
|
|
5737
5736
|
syncClear();
|
|
@@ -140,18 +140,17 @@
|
|
|
140
140
|
stopPropagation(event);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
const eventToPropRecord = {
|
|
144
|
-
"click": "onClick"
|
|
145
|
-
};
|
|
146
143
|
function withStopPropagation(events, element) {
|
|
147
144
|
const props = { ...element.props };
|
|
148
145
|
for (const key of events) {
|
|
149
|
-
const prop =
|
|
150
|
-
props[prop]
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
const prop = key.startsWith("on") ? key : `on${key.charAt(0).toUpperCase() + key.slice(1)}`;
|
|
147
|
+
if (typeof element.props[prop] === "function") {
|
|
148
|
+
props[prop] = function(e2) {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
e2.stopPropagation();
|
|
151
|
+
(_b = (_a = element.props)[prop]) == null ? void 0 : _b.call(_a, e2);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
155
154
|
}
|
|
156
155
|
return React__default["default"].cloneElement(element, props);
|
|
157
156
|
}
|
|
@@ -12290,7 +12289,7 @@
|
|
|
12290
12289
|
},
|
|
12291
12290
|
[setState]
|
|
12292
12291
|
);
|
|
12293
|
-
|
|
12292
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
12294
12293
|
setVisible(true);
|
|
12295
12294
|
if (!allowMultiple)
|
|
12296
12295
|
syncClear();
|