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.
@@ -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 = eventToPropRecord[key];
130
- props[prop] = function(e) {
131
- var _a, _b;
132
- e.stopPropagation();
133
- (_b = (_a = element.props)[prop]) == null ? void 0 : _b.call(_a, e);
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
- setTimeout(() => {
5638
- const { message } = props;
5639
- if (isDef(message) && message !== "") {
5640
- return /* @__PURE__ */ React.createElement("div", {
5641
- className: clsx(bem$10("info"))
5642
- }, message);
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 = eventToPropRecord[key];
150
- props[prop] = function(e2) {
151
- var _a, _b;
152
- e2.stopPropagation();
153
- (_b = (_a = element.props)[prop]) == null ? void 0 : _b.call(_a, e2);
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
- setTimeout(() => {
12197
- const { message } = props;
12198
- if (isDef(message) && message !== "") {
12199
- return /* @__PURE__ */ React__default["default"].createElement("div", {
12200
- className: clsx(bem$10("info"))
12201
- }, message);
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([