react-vant-nova 1.0.7-test → 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 +15 -18
- package/bundle/react-vant-nova.js +15 -18
- package/bundle/react-vant-nova.min.js +2 -2
- package/es/popup/Popup.js +0 -3
- package/es/toast/Toast.js +11 -14
- package/es/utils/dom/event.js +8 -6
- package/lib/popup/Popup.js +0 -3
- package/lib/toast/Toast.js +11 -14
- 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
|
}
|
|
@@ -5634,15 +5633,13 @@ const Toast$1 = (p) => {
|
|
|
5634
5633
|
return null;
|
|
5635
5634
|
};
|
|
5636
5635
|
const renderMessage = () => {
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
return null;
|
|
5645
|
-
}, 100);
|
|
5636
|
+
const { message } = props;
|
|
5637
|
+
if (isDef(message) && message !== "") {
|
|
5638
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
5639
|
+
className: clsx(bem$10("info"))
|
|
5640
|
+
}, message);
|
|
5641
|
+
}
|
|
5642
|
+
return null;
|
|
5646
5643
|
};
|
|
5647
5644
|
return /* @__PURE__ */ React.createElement(Popup, {
|
|
5648
5645
|
className: clsx([
|
|
@@ -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
|
}
|
|
@@ -12193,15 +12192,13 @@
|
|
|
12193
12192
|
return null;
|
|
12194
12193
|
};
|
|
12195
12194
|
const renderMessage = () => {
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
|
|
12199
|
-
|
|
12200
|
-
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
return null;
|
|
12204
|
-
}, 100);
|
|
12195
|
+
const { message } = props;
|
|
12196
|
+
if (isDef(message) && message !== "") {
|
|
12197
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12198
|
+
className: clsx(bem$10("info"))
|
|
12199
|
+
}, message);
|
|
12200
|
+
}
|
|
12201
|
+
return null;
|
|
12205
12202
|
};
|
|
12206
12203
|
return /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
12207
12204
|
className: clsx([
|