@nutui/nutui-react-taro 3.0.19-cpp-beta.4 → 3.0.19-cpp-beta.5

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.
@@ -53,7 +53,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
53
53
  ];
54
54
  return [
55
55
  4,
56
- (0, _getrect.getRectInMultiPlatformWithoutCache)(leftWrapper.current, leftId)
56
+ (0, _getrect.getRectInMultiPlatform)(leftWrapper.current, leftId)
57
57
  ];
58
58
  case 1:
59
59
  leftRect = _state.sent();
@@ -70,7 +70,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
70
70
  ];
71
71
  return [
72
72
  4,
73
- (0, _getrect.getRectInMultiPlatformWithoutCache)(rightWrapper.current, rightId)
73
+ (0, _getrect.getRectInMultiPlatform)(rightWrapper.current, rightId)
74
74
  ];
75
75
  case 3:
76
76
  rightRect = _state.sent();
@@ -126,10 +126,11 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
126
126
  var wrapperStyle = (0, _react.useMemo)(function() {
127
127
  return {
128
128
  transform: "translate(".concat(state.offset, "px, 0)"),
129
- transitionDuration: '.6s'
129
+ transitionDuration: state.dragging ? '0.01s' : '.6s'
130
130
  };
131
131
  }, [
132
- state.offset
132
+ state.offset,
133
+ state.dragging
133
134
  ]);
134
135
  var onTouchStart = /*#__PURE__*/ function() {
135
136
  var _ref = (0, _async_to_generator._)(function(event) {
@@ -206,7 +207,6 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
206
207
  name: name,
207
208
  position: side
208
209
  });
209
- // dd
210
210
  setState(function(prevState) {
211
211
  return (0, _object_spread_props._)((0, _object_spread._)({}, prevState), {
212
212
  offset: Number(offset) || 0
@@ -222,7 +222,6 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
222
222
  position: position || 'left'
223
223
  });
224
224
  }
225
- // setState((v) => ({ ...v, offset: 0 }))
226
225
  setState(function(prevState) {
227
226
  return (0, _object_spread_props._)((0, _object_spread._)({}, prevState), {
228
227
  offset: 0
@@ -8,7 +8,7 @@ import classNames from "classnames";
8
8
  import { View } from "@tarojs/components";
9
9
  import { nextTick, useReady } from "@tarojs/taro";
10
10
  import { useTouch } from "../../hooks/use-touch";
11
- import { getRectInMultiPlatformWithoutCache } from "../../utils/taro/get-rect";
11
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
13
  import { useRefState } from "../../hooks/use-ref-state";
14
14
  import { useUuid } from "../../hooks/use-uuid";
@@ -41,7 +41,7 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
41
41
  ];
42
42
  return [
43
43
  4,
44
- getRectInMultiPlatformWithoutCache(leftWrapper.current, leftId)
44
+ getRectInMultiPlatform(leftWrapper.current, leftId)
45
45
  ];
46
46
  case 1:
47
47
  leftRect = _state.sent();
@@ -58,7 +58,7 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
58
58
  ];
59
59
  return [
60
60
  4,
61
- getRectInMultiPlatformWithoutCache(rightWrapper.current, rightId)
61
+ getRectInMultiPlatform(rightWrapper.current, rightId)
62
62
  ];
63
63
  case 3:
64
64
  rightRect = _state.sent();
@@ -114,10 +114,11 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
114
114
  var wrapperStyle = useMemo(function() {
115
115
  return {
116
116
  transform: "translate(".concat(state.offset, "px, 0)"),
117
- transitionDuration: '.6s'
117
+ transitionDuration: state.dragging ? '0.01s' : '.6s'
118
118
  };
119
119
  }, [
120
- state.offset
120
+ state.offset,
121
+ state.dragging
121
122
  ]);
122
123
  var onTouchStart = /*#__PURE__*/ function() {
123
124
  var _ref = _async_to_generator(function(event) {
@@ -194,7 +195,6 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
194
195
  name: name,
195
196
  position: side
196
197
  });
197
- // dd
198
198
  setState(function(prevState) {
199
199
  return _object_spread_props(_object_spread({}, prevState), {
200
200
  offset: Number(offset) || 0
@@ -210,7 +210,6 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
210
210
  position: position || 'left'
211
211
  });
212
212
  }
213
- // setState((v) => ({ ...v, offset: 0 }))
214
213
  setState(function(prevState) {
215
214
  return _object_spread_props(_object_spread({}, prevState), {
216
215
  offset: 0
@@ -17107,7 +17107,7 @@
17107
17107
  ];
17108
17108
  return [
17109
17109
  4,
17110
- getRectInMultiPlatformWithoutCache(leftWrapper.current, leftId)
17110
+ getRectInMultiPlatform(leftWrapper.current, leftId)
17111
17111
  ];
17112
17112
  case 1:
17113
17113
  leftRect = _state.sent();
@@ -17124,7 +17124,7 @@
17124
17124
  ];
17125
17125
  return [
17126
17126
  4,
17127
- getRectInMultiPlatformWithoutCache(rightWrapper.current, rightId)
17127
+ getRectInMultiPlatform(rightWrapper.current, rightId)
17128
17128
  ];
17129
17129
  case 3:
17130
17130
  rightRect = _state.sent();
@@ -17179,10 +17179,11 @@
17179
17179
  var wrapperStyle = React.useMemo(function() {
17180
17180
  return {
17181
17181
  transform: "translate(".concat(state.offset, "px, 0)"),
17182
- transitionDuration: ".6s"
17182
+ transitionDuration: state.dragging ? "0.01s" : ".6s"
17183
17183
  };
17184
17184
  }, [
17185
- state.offset
17185
+ state.offset,
17186
+ state.dragging
17186
17187
  ]);
17187
17188
  var onTouchStart = /* @__PURE__ */ function() {
17188
17189
  var _ref = _async_to_generator(function(event) {