@nutui/nutui-react-taro 3.0.20-beta.0 → 3.0.20

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +5 -4
  2. package/dist/cjs/hooks/taro/use-custom-event.js +5 -5
  3. package/dist/cjs/hooks/use-ref-state.js +3 -3
  4. package/dist/cjs/hooks/use-touch.js +1 -2
  5. package/dist/cjs/packages/address/utils.js +3 -3
  6. package/dist/cjs/packages/avatarcropper/avatarcropper.js +16 -28
  7. package/dist/cjs/packages/badge/badge.js +4 -7
  8. package/dist/cjs/packages/barrage/barrage.js +14 -24
  9. package/dist/cjs/packages/calendar/utils.js +8 -8
  10. package/dist/cjs/packages/calendarcard/icon.js +5 -5
  11. package/dist/cjs/packages/calendarcard/utils.js +6 -6
  12. package/dist/cjs/packages/cascader/cascader.js +12 -21
  13. package/dist/cjs/packages/cascader/utils.js +3 -3
  14. package/dist/cjs/packages/collapseitem/collapseitem.js +4 -7
  15. package/dist/cjs/packages/configprovider/configprovider.js +7 -7
  16. package/dist/cjs/packages/configprovider/index.js +6 -6
  17. package/dist/cjs/packages/countdown/countdown.js +1 -2
  18. package/dist/cjs/packages/datepicker/utils.js +9 -9
  19. package/dist/cjs/packages/dialog/content.js +3 -3
  20. package/dist/cjs/packages/dialog/dialog.js +8 -11
  21. package/dist/cjs/packages/drag/drag.js +4 -7
  22. package/dist/cjs/packages/elevator/elevator.js +7 -10
  23. package/dist/cjs/packages/ellipsis/ellipsis.js +17 -30
  24. package/dist/cjs/packages/form/index.js +0 -2
  25. package/dist/cjs/packages/form/useform.js +50 -57
  26. package/dist/cjs/packages/infiniteloading/infiniteloading.js +8 -14
  27. package/dist/cjs/packages/inputnumber/inputnumber.js +16 -28
  28. package/dist/cjs/packages/lottie/types.js +0 -2
  29. package/dist/cjs/packages/menuitem/menuitem.js +24 -22
  30. package/dist/cjs/packages/noticebar/noticebar.js +74 -70
  31. package/dist/cjs/packages/notify/notify.js +4 -4
  32. package/dist/cjs/packages/nutui.react.build.js +105 -105
  33. package/dist/cjs/packages/nutui.react.js +105 -105
  34. package/dist/cjs/packages/overlay/overlay.js +3 -3
  35. package/dist/cjs/packages/pickerview/pickerroller.js +4 -7
  36. package/dist/cjs/packages/pickerview/pickerview.js +1 -2
  37. package/dist/cjs/packages/pickerview/utils.js +3 -3
  38. package/dist/cjs/packages/popover/popover.js +75 -77
  39. package/dist/cjs/packages/popup/popup.js +8 -14
  40. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +52 -56
  41. package/dist/cjs/packages/radio/index.js +0 -2
  42. package/dist/cjs/packages/range/range.js +12 -21
  43. package/dist/cjs/packages/shortpassword/shortpassword.js +3 -3
  44. package/dist/cjs/packages/sticky/sticky.js +4 -7
  45. package/dist/cjs/packages/swipe/swipe.js +8 -14
  46. package/dist/cjs/packages/swiper/index.js +0 -1
  47. package/dist/cjs/packages/switch/switch.js +4 -7
  48. package/dist/cjs/packages/toast/toast.js +4 -4
  49. package/dist/cjs/packages/uploader/uploader.js +38 -51
  50. package/dist/cjs/packages/virtuallist/utils.js +6 -6
  51. package/dist/cjs/packages/watermark/watermark.js +4 -8
  52. package/dist/cjs/types/spec/address/base.js +0 -2
  53. package/dist/cjs/utils/date.js +5 -5
  54. package/dist/cjs/utils/event-mocker.js +10 -18
  55. package/dist/cjs/utils/get-rect.js +4 -4
  56. package/dist/cjs/utils/get-scroll-parent.js +3 -3
  57. package/dist/cjs/utils/merge-props.js +3 -3
  58. package/dist/cjs/utils/merge.js +6 -6
  59. package/dist/cjs/utils/raf.js +3 -3
  60. package/dist/cjs/utils/render.js +5 -9
  61. package/dist/cjs/utils/rubberband.js +3 -3
  62. package/dist/cjs/utils/taro/ConfigurableCSSTransition copy.d.ts +15 -0
  63. package/dist/cjs/utils/taro/ConfigurableCSSTransition copy.js +130 -0
  64. package/dist/cjs/utils/taro/get-rect.js +14 -24
  65. package/dist/cjs/utils/taro/get-system-info.js +4 -4
  66. package/dist/cjs/utils/taro/platform.js +5 -5
  67. package/dist/es/hooks/use-touch.js +1 -1
  68. package/dist/es/packages/avatarcropper/avatarcropper.js +16 -28
  69. package/dist/es/packages/badge/badge.js +4 -7
  70. package/dist/es/packages/barrage/barrage.js +14 -24
  71. package/dist/es/packages/cascader/cascader.js +12 -21
  72. package/dist/es/packages/collapseitem/collapseitem.js +4 -7
  73. package/dist/es/packages/countdown/countdown.js +1 -2
  74. package/dist/es/packages/dialog/dialog.js +4 -7
  75. package/dist/es/packages/drag/drag.js +4 -7
  76. package/dist/es/packages/elevator/elevator.js +4 -7
  77. package/dist/es/packages/ellipsis/ellipsis.js +17 -30
  78. package/dist/es/packages/form/index.js +0 -1
  79. package/dist/es/packages/form/useform.js +46 -53
  80. package/dist/es/packages/infiniteloading/infiniteloading.js +8 -14
  81. package/dist/es/packages/inputnumber/inputnumber.js +16 -28
  82. package/dist/es/packages/lottie/types.js +1 -1
  83. package/dist/es/packages/menuitem/menuitem.js +24 -22
  84. package/dist/es/packages/noticebar/noticebar.js +74 -70
  85. package/dist/es/packages/pickerview/pickerroller.js +4 -7
  86. package/dist/es/packages/pickerview/pickerview.js +1 -2
  87. package/dist/es/packages/popover/popover.js +75 -77
  88. package/dist/es/packages/popup/popup.js +8 -14
  89. package/dist/es/packages/pulltorefresh/pulltorefresh.js +52 -56
  90. package/dist/es/packages/radio/index.js +0 -1
  91. package/dist/es/packages/range/range.js +12 -21
  92. package/dist/es/packages/sticky/sticky.js +4 -7
  93. package/dist/es/packages/swipe/swipe.js +8 -14
  94. package/dist/es/packages/swiper/index.js +0 -1
  95. package/dist/es/packages/switch/switch.js +4 -7
  96. package/dist/es/packages/uploader/uploader.js +38 -51
  97. package/dist/es/packages/watermark/watermark.js +4 -8
  98. package/dist/es/types/spec/address/base.js +1 -1
  99. package/dist/es/utils/event-mocker.js +4 -12
  100. package/dist/es/utils/render.js +2 -6
  101. package/dist/es/utils/taro/ConfigurableCSSTransition copy.d.ts +15 -0
  102. package/dist/es/utils/taro/ConfigurableCSSTransition copy.js +119 -0
  103. package/dist/es/utils/taro/get-rect.js +10 -20
  104. package/dist/nutui.react.umd.js +1602 -856
  105. package/dist/style-jmapp.css +1 -1
  106. package/dist/style-jmapp.scss +38 -38
  107. package/dist/style-jrkf.css +1 -1
  108. package/dist/style-jrkf.scss +37 -37
  109. package/dist/style.css +1 -1
  110. package/dist/style.scss +34 -34
  111. package/package.json +1 -1
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- simulateTouchMove: function() {
12
+ get simulateTouchMove () {
13
13
  return simulateTouchMove;
14
14
  },
15
- simulateTouchZoom: function() {
15
+ get simulateTouchZoom () {
16
16
  return simulateTouchZoom;
17
17
  },
18
- sleep: function() {
18
+ get sleep () {
19
19
  return sleep;
20
20
  },
21
- trigger: function() {
21
+ get trigger () {
22
22
  return trigger;
23
23
  },
24
- triggerDrag: function() {
24
+ get triggerDrag () {
25
25
  return triggerDrag;
26
26
  }
27
27
  });
@@ -89,10 +89,7 @@ function triggerDrag(el) {
89
89
  trigger(el, 'touchend', x, y);
90
90
  }
91
91
  function simulateTouchMove(element, startX, startY, endX, endY, duration) {
92
- return _simulateTouchMove.apply(this, arguments);
93
- }
94
- function _simulateTouchMove() {
95
- _simulateTouchMove = (0, _async_to_generator._)(function(element, startX, startY, endX, endY, duration) {
92
+ return (0, _async_to_generator._)(function() {
96
93
  var touch, touchList, distanceX, distanceY, startTime, elapsed, progress, currentX, currentY, currentTouch, currentTouchList;
97
94
  return (0, _ts_generator._)(this, function(_state) {
98
95
  switch(_state.label){
@@ -145,14 +142,10 @@ function _simulateTouchMove() {
145
142
  ];
146
143
  }
147
144
  });
148
- });
149
- return _simulateTouchMove.apply(this, arguments);
145
+ })();
150
146
  }
151
147
  function simulateTouchZoom(element, startDistance, endDistance, duration) {
152
- return _simulateTouchZoom.apply(this, arguments);
153
- }
154
- function _simulateTouchZoom() {
155
- _simulateTouchZoom = (0, _async_to_generator._)(function(element, startDistance, endDistance, duration) {
148
+ return (0, _async_to_generator._)(function() {
156
149
  var centerX, centerY, startScale, endScale, startTouches, endTouches, progress, currentScale, currentDistance, currentTouches;
157
150
  return (0, _ts_generator._)(this, function(_state) {
158
151
  switch(_state.label){
@@ -212,6 +205,5 @@ function _simulateTouchZoom() {
212
205
  ];
213
206
  }
214
207
  });
215
- });
216
- return _simulateTouchZoom.apply(this, arguments);
208
+ })();
217
209
  }
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getRect: function() {
12
+ get getRect () {
13
13
  return getRect;
14
14
  },
15
- inBrowser: function() {
15
+ get inBrowser () {
16
16
  return inBrowser;
17
17
  },
18
- isWindow: function() {
18
+ get isWindow () {
19
19
  return isWindow;
20
20
  }
21
21
  });
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getAllScrollableParents: function() {
12
+ get getAllScrollableParents () {
13
13
  return getAllScrollableParents;
14
14
  },
15
- getScrollParent: function() {
15
+ get getScrollParent () {
16
16
  return getScrollParent;
17
17
  }
18
18
  });
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- mergeProp: function() {
12
+ get mergeProp () {
13
13
  return mergeProp;
14
14
  },
15
- mergeProps: function() {
15
+ get mergeProps () {
16
16
  return mergeProps;
17
17
  }
18
18
  });
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- clone: function() {
12
+ get clone () {
13
13
  return clone;
14
14
  },
15
- isPlainObject: function() {
15
+ get isPlainObject () {
16
16
  return isPlainObject;
17
17
  },
18
- main: function() {
18
+ get main () {
19
19
  return main;
20
20
  },
21
- merge: function() {
21
+ get merge () {
22
22
  return merge;
23
23
  },
24
- recursive: function() {
24
+ get recursive () {
25
25
  return recursive;
26
26
  }
27
27
  });
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- cancelRaf: function() {
12
+ get cancelRaf () {
13
13
  return cancelRaf;
14
14
  },
15
- default: function() {
15
+ get default () {
16
16
  return _default;
17
17
  }
18
18
  });
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- render: function() {
12
+ get render () {
13
13
  return render;
14
14
  },
15
- unmount: function() {
15
+ get unmount () {
16
16
  return unmount;
17
17
  }
18
18
  });
@@ -64,10 +64,7 @@ function legacyUnmount(container) {
64
64
  return unmountComponentAtNode(container);
65
65
  }
66
66
  function concurrentUnmount(container) {
67
- return _concurrentUnmount.apply(this, arguments);
68
- }
69
- function _concurrentUnmount() {
70
- _concurrentUnmount = (0, _async_to_generator._)(function(container) {
67
+ return (0, _async_to_generator._)(function() {
71
68
  return (0, _ts_generator._)(this, function(_state) {
72
69
  // Delay to unmount to avoid React 18 sync warning
73
70
  return [
@@ -79,8 +76,7 @@ function _concurrentUnmount() {
79
76
  })
80
77
  ];
81
78
  });
82
- });
83
- return _concurrentUnmount.apply(this, arguments);
79
+ })();
84
80
  }
85
81
  function unmount(container) {
86
82
  if (createRoot) {
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- rubberband: function() {
12
+ get rubberband () {
13
13
  return rubberband;
14
14
  },
15
- rubberbandIfOutOfBounds: function() {
15
+ get rubberbandIfOutOfBounds () {
16
16
  return rubberbandIfOutOfBounds;
17
17
  }
18
18
  });
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export type TransitionStatus = 'entering' | 'entered' | 'exiting' | 'exited' | 'unmounted';
3
+ interface CSSTransitionProps {
4
+ in?: boolean;
5
+ timeout?: number;
6
+ classNames?: string;
7
+ nodeRef?: React.RefObject<any>;
8
+ mountOnEnter?: boolean;
9
+ unmountOnExit?: boolean;
10
+ onEntered?: () => void;
11
+ onExited?: () => void;
12
+ children: React.ReactElement;
13
+ }
14
+ declare const ConfigurableCSSTransition: React.FC<CSSTransitionProps>;
15
+ export default ConfigurableCSSTransition;
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
13
+ var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
+ var ConfigurableCSSTransition = function ConfigurableCSSTransition(props) {
15
+ var inPhase = props.in, _props_timeout = props.timeout, timeout = _props_timeout === void 0 ? 300 : _props_timeout, tmp = props.classNames, baseClassName = tmp === void 0 ? '' : tmp, nodeRef = props.nodeRef, mountOnEnter = props.mountOnEnter, unmountOnExit = props.unmountOnExit, onEntered = props.onEntered, onExited = props.onExited, children = props.children;
16
+ var _useState = (0, _sliced_to_array._)((0, _react.useState)(function() {
17
+ if (inPhase) return 'entered';
18
+ return unmountOnExit || mountOnEnter ? 'unmounted' : 'exited';
19
+ }), 2), status = _useState[0], setStatus = _useState[1];
20
+ var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(function() {
21
+ if (inPhase) return "".concat(baseClassName, "-enter-done");
22
+ return "".concat(baseClassName, "-exit-done");
23
+ }), 2), classes = _useState1[0], setClasses = _useState1[1];
24
+ var fallbackTimerRef = (0, _react.useRef)(null);
25
+ var statusRef = (0, _react.useRef)(status);
26
+ var prevInPhase = (0, _react.useRef)(inPhase);
27
+ var latestOnAnimationEnd = (0, _react.useRef)(children.props.onAnimationEnd);
28
+ (0, _react.useEffect)(function() {
29
+ latestOnAnimationEnd.current = children.props.onAnimationEnd;
30
+ });
31
+ var updateStatus = (0, _react.useCallback)(function(nextStatus) {
32
+ statusRef.current = nextStatus;
33
+ setStatus(nextStatus);
34
+ }, []);
35
+ var handleAnimationEnd = (0, _react.useCallback)(function(e) {
36
+ var _latestOnAnimationEnd_current;
37
+ (_latestOnAnimationEnd_current = latestOnAnimationEnd.current) === null || _latestOnAnimationEnd_current === void 0 ? void 0 : _latestOnAnimationEnd_current.call(latestOnAnimationEnd, e);
38
+ if (e && e.target !== e.currentTarget) return;
39
+ if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
40
+ if (statusRef.current === 'entering') {
41
+ updateStatus('entered');
42
+ setClasses("".concat(baseClassName, "-enter-done"));
43
+ onEntered === null || onEntered === void 0 ? void 0 : onEntered();
44
+ } else if (statusRef.current === 'exiting') {
45
+ updateStatus('exited');
46
+ setClasses("".concat(baseClassName, "-exit-done"));
47
+ if (unmountOnExit) {
48
+ updateStatus('unmounted');
49
+ }
50
+ onExited === null || onExited === void 0 ? void 0 : onExited();
51
+ }
52
+ }, [
53
+ baseClassName,
54
+ onEntered,
55
+ onExited,
56
+ unmountOnExit,
57
+ updateStatus
58
+ ]);
59
+ var enter = (0, _react.useCallback)(function() {
60
+ if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
61
+ if (statusRef.current === 'unmounted') {
62
+ updateStatus('exited');
63
+ }
64
+ if (timeout === 0) {
65
+ updateStatus('entered');
66
+ setClasses("".concat(baseClassName, "-enter-done"));
67
+ onEntered === null || onEntered === void 0 ? void 0 : onEntered();
68
+ return;
69
+ }
70
+ updateStatus('entering');
71
+ setClasses("".concat(baseClassName, "-enter ").concat(baseClassName, "-enter-active"));
72
+ // Safety fallback: Give it extra time over the expected timeout in case onAnimationEnd misses
73
+ fallbackTimerRef.current = setTimeout(function() {
74
+ handleAnimationEnd(null);
75
+ }, timeout + 200);
76
+ }, [
77
+ baseClassName,
78
+ handleAnimationEnd,
79
+ onEntered,
80
+ timeout,
81
+ updateStatus
82
+ ]);
83
+ var exit = (0, _react.useCallback)(function() {
84
+ if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
85
+ if (timeout === 0) {
86
+ updateStatus('exited');
87
+ setClasses("".concat(baseClassName, "-exit-done"));
88
+ if (unmountOnExit) {
89
+ updateStatus('unmounted');
90
+ }
91
+ onExited === null || onExited === void 0 ? void 0 : onExited();
92
+ return;
93
+ }
94
+ updateStatus('exiting');
95
+ setClasses("".concat(baseClassName, "-exit ").concat(baseClassName, "-exit-active"));
96
+ fallbackTimerRef.current = setTimeout(function() {
97
+ handleAnimationEnd(null);
98
+ }, timeout + 200);
99
+ }, [
100
+ baseClassName,
101
+ handleAnimationEnd,
102
+ onExited,
103
+ timeout,
104
+ unmountOnExit,
105
+ updateStatus
106
+ ]);
107
+ (0, _react.useEffect)(function() {
108
+ if (prevInPhase.current !== inPhase) {
109
+ if (inPhase) {
110
+ enter();
111
+ } else {
112
+ exit();
113
+ }
114
+ prevInPhase.current = inPhase;
115
+ }
116
+ return function() {
117
+ if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
118
+ };
119
+ }, [
120
+ inPhase,
121
+ enter,
122
+ exit
123
+ ]);
124
+ if (status === 'unmounted') return null;
125
+ return /*#__PURE__*/ (0, _react.cloneElement)(children, {
126
+ className: "".concat(children.props.className || '', " ").concat(classes),
127
+ onAnimationEnd: handleAnimationEnd
128
+ });
129
+ };
130
+ var _default = ConfigurableCSSTransition;
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getRectInMultiPlatform: function() {
12
+ get getRectInMultiPlatform () {
13
13
  return getRectInMultiPlatform;
14
14
  },
15
- getRectInMultiPlatformWithoutCache: function() {
15
+ get getRectInMultiPlatformWithoutCache () {
16
16
  return getRectInMultiPlatformWithoutCache;
17
17
  },
18
- makeRect: function() {
18
+ get makeRect () {
19
19
  return makeRect;
20
20
  }
21
21
  });
@@ -36,12 +36,10 @@ function makeRect(width, height) {
36
36
  height: height
37
37
  };
38
38
  }
39
- var getRectInMultiPlatform = /*#__PURE__*/ function() {
40
- var _ref = (0, _async_to_generator._)(function(element) {
41
- var harmonyId;
42
- var _arguments = arguments;
39
+ var getRectInMultiPlatform = function getRectInMultiPlatform(element) {
40
+ var harmonyId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
41
+ return (0, _async_to_generator._)(function() {
43
42
  return (0, _ts_generator._)(this, function(_state) {
44
- harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
45
43
  if (element) {
46
44
  if (_getrect.inBrowser) {
47
45
  return [
@@ -72,17 +70,12 @@ var getRectInMultiPlatform = /*#__PURE__*/ function() {
72
70
  Promise.resolve(makeRect(0, 0))
73
71
  ];
74
72
  });
75
- });
76
- return function getRectInMultiPlatform(element) {
77
- return _ref.apply(this, arguments);
78
- };
79
- }();
80
- var getRectInMultiPlatformWithoutCache = /*#__PURE__*/ function() {
81
- var _ref = (0, _async_to_generator._)(function(element) {
82
- var harmonyId;
83
- var _arguments = arguments;
73
+ })();
74
+ };
75
+ var getRectInMultiPlatformWithoutCache = function getRectInMultiPlatformWithoutCache(element) {
76
+ var harmonyId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
77
+ return (0, _async_to_generator._)(function() {
84
78
  return (0, _ts_generator._)(this, function(_state) {
85
- harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
86
79
  if (element) {
87
80
  if (_getrect.inBrowser) {
88
81
  return [
@@ -105,8 +98,5 @@ var getRectInMultiPlatformWithoutCache = /*#__PURE__*/ function() {
105
98
  Promise.resolve(makeRect(0, 0))
106
99
  ];
107
100
  });
108
- });
109
- return function getRectInMultiPlatformWithoutCache(element) {
110
- return _ref.apply(this, arguments);
111
- };
112
- }();
101
+ })();
102
+ };
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getAppBaseInfo: function() {
12
+ get getAppBaseInfo () {
13
13
  return getAppBaseInfo;
14
14
  },
15
- getDeviceInfo: function() {
15
+ get getDeviceInfo () {
16
16
  return getDeviceInfo;
17
17
  },
18
- getWindowInfo: function() {
18
+ get getWindowInfo () {
19
19
  return getWindowInfo;
20
20
  }
21
21
  });
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- harmony: function() {
12
+ get harmony () {
13
13
  return harmony;
14
14
  },
15
- miniprogram: function() {
15
+ get miniprogram () {
16
16
  return miniprogram;
17
17
  },
18
- td: function() {
18
+ get td () {
19
19
  return td;
20
20
  },
21
- web: function() {
21
+ get web () {
22
22
  return web;
23
23
  }
24
24
  });
@@ -1,4 +1,4 @@
1
- import React, { useRef } from "react";
1
+ import { useRef } from "react";
2
2
  var MIN_DISTANCE = 10;
3
3
  function getDirection(x, y) {
4
4
  if (x > y && x > MIN_DISTANCE) {
@@ -311,8 +311,8 @@ export var AvatarCropper = function(props) {
311
311
  draw
312
312
  ]);
313
313
  // 设置绘制图片
314
- var setDrawImgInfo = /*#__PURE__*/ function() {
315
- var _ref = _async_to_generator(function(image) {
314
+ var setDrawImgInfo = function(image) {
315
+ return _async_to_generator(function() {
316
316
  var displayWidth, cropperWidth, copyDrawImg, imgWidth, imgHeight, isPortrait, rate, scale;
317
317
  return _ts_generator(this, function(_state) {
318
318
  switch(_state.label){
@@ -362,11 +362,8 @@ export var AvatarCropper = function(props) {
362
362
  ];
363
363
  }
364
364
  });
365
- });
366
- return function setDrawImgInfo(image) {
367
- return _ref.apply(this, arguments);
368
- };
369
- }();
365
+ })();
366
+ };
370
367
  var chooseImage = function() {
371
368
  Taro.chooseImage({
372
369
  count: 1,
@@ -380,8 +377,8 @@ export var AvatarCropper = function(props) {
380
377
  }
381
378
  });
382
379
  };
383
- var imageChange = /*#__PURE__*/ function() {
384
- var _ref = _async_to_generator(function(file) {
380
+ var imageChange = function(file) {
381
+ return _async_to_generator(function() {
385
382
  return _ts_generator(this, function(_state) {
386
383
  Taro.getImageInfo({
387
384
  src: file.path
@@ -393,11 +390,8 @@ export var AvatarCropper = function(props) {
393
390
  2
394
391
  ];
395
392
  });
396
- });
397
- return function imageChange(file) {
398
- return _ref.apply(this, arguments);
399
- };
400
- }();
393
+ })();
394
+ };
401
395
  var resetScale = function(scale) {
402
396
  setState(_object_spread_props(_object_spread({}, state), {
403
397
  moveX: 0,
@@ -553,8 +547,8 @@ export var AvatarCropper = function(props) {
553
547
  height: cropperWidth,
554
548
  destWidth: cropperWidth,
555
549
  destHeight: cropperWidth,
556
- success: /*#__PURE__*/ function() {
557
- var _ref = _async_to_generator(function(res) {
550
+ success: function(res) {
551
+ return _async_to_generator(function() {
558
552
  var filePath;
559
553
  return _ts_generator(this, function(_state) {
560
554
  filePath = res.tempFilePath;
@@ -564,11 +558,8 @@ export var AvatarCropper = function(props) {
564
558
  2
565
559
  ];
566
560
  });
567
- });
568
- return function(res) {
569
- return _ref.apply(this, arguments);
570
- };
571
- }()
561
+ })();
562
+ }
572
563
  });
573
564
  };
574
565
  // 裁剪图片
@@ -592,8 +583,8 @@ export var AvatarCropper = function(props) {
592
583
  height: cropperWidth,
593
584
  destWidth: cropperWidth * systemInfo.pixelRatio,
594
585
  destHeight: cropperWidth * systemInfo.pixelRatio,
595
- success: /*#__PURE__*/ function() {
596
- var _ref = _async_to_generator(function(res) {
586
+ success: function(res) {
587
+ return _async_to_generator(function() {
597
588
  var filePath;
598
589
  return _ts_generator(this, function(_state) {
599
590
  filePath = res.tempFilePath;
@@ -603,11 +594,8 @@ export var AvatarCropper = function(props) {
603
594
  2
604
595
  ];
605
596
  });
606
- });
607
- return function(res) {
608
- return _ref.apply(this, arguments);
609
- };
610
- }()
597
+ })();
598
+ }
611
599
  });
612
600
  };
613
601
  var ToolBar = function() {
@@ -54,8 +54,8 @@ export var Badge = function(props) {
54
54
  getPositionStyle();
55
55
  }
56
56
  }, []);
57
- var getPositionStyle = /*#__PURE__*/ function() {
58
- var _ref = _async_to_generator(function() {
57
+ var getPositionStyle = function() {
58
+ return _async_to_generator(function() {
59
59
  var style;
60
60
  return _ts_generator(this, function(_state) {
61
61
  style = _define_property({
@@ -66,11 +66,8 @@ export var Badge = function(props) {
66
66
  2
67
67
  ];
68
68
  });
69
- });
70
- return function getPositionStyle() {
71
- return _ref.apply(this, arguments);
72
- };
73
- }();
69
+ })();
70
+ };
74
71
  var _obj1;
75
72
  return /*#__PURE__*/ React.createElement(View, {
76
73
  className: classes,