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.
@@ -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
  }
@@ -5731,7 +5730,7 @@ const ToastObj = (p) => {
5731
5730
  },
5732
5731
  [setState]
5733
5732
  );
5734
- useEffect(() => {
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 = 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
  }
@@ -12290,7 +12289,7 @@
12290
12289
  },
12291
12290
  [setState]
12292
12291
  );
12293
- React.useEffect(() => {
12292
+ useIsomorphicLayoutEffect$1(() => {
12294
12293
  setVisible(true);
12295
12294
  if (!allowMultiple)
12296
12295
  syncClear();