@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
@@ -31,7 +31,58 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
31
31
  });
32
32
  export var PullToRefresh = function(p) {
33
33
  var doRefresh = function doRefresh() {
34
- return _doRefresh.apply(this, arguments);
34
+ return _async_to_generator(function() {
35
+ var e;
36
+ return _ts_generator(this, function(_state) {
37
+ switch(_state.label){
38
+ case 0:
39
+ setHeight(headHeight);
40
+ setStatus('refreshing');
41
+ _state.label = 1;
42
+ case 1:
43
+ _state.trys.push([
44
+ 1,
45
+ 3,
46
+ ,
47
+ 4
48
+ ]);
49
+ return [
50
+ 4,
51
+ props.onRefresh()
52
+ ];
53
+ case 2:
54
+ _state.sent();
55
+ setStatus('complete');
56
+ return [
57
+ 3,
58
+ 4
59
+ ];
60
+ case 3:
61
+ e = _state.sent();
62
+ setHeight(0);
63
+ setStatus('pulling');
64
+ throw e;
65
+ case 4:
66
+ if (!(props.completeDelay > 0)) return [
67
+ 3,
68
+ 6
69
+ ];
70
+ return [
71
+ 4,
72
+ sleep(props.completeDelay)
73
+ ];
74
+ case 5:
75
+ _state.sent();
76
+ _state.label = 6;
77
+ case 6:
78
+ setHeight(0);
79
+ setStatus('pulling');
80
+ return [
81
+ 2
82
+ ];
83
+ }
84
+ });
85
+ })();
35
86
  };
36
87
  var classPrefix = 'nut-pulltorefresh';
37
88
  var locale = useConfig().locale;
@@ -88,61 +139,6 @@ export var PullToRefresh = function(p) {
88
139
  }
89
140
  clearTimeout(timer.current);
90
141
  };
91
- function _doRefresh() {
92
- _doRefresh = _async_to_generator(function() {
93
- var e;
94
- return _ts_generator(this, function(_state) {
95
- switch(_state.label){
96
- case 0:
97
- setHeight(headHeight);
98
- setStatus('refreshing');
99
- _state.label = 1;
100
- case 1:
101
- _state.trys.push([
102
- 1,
103
- 3,
104
- ,
105
- 4
106
- ]);
107
- return [
108
- 4,
109
- props.onRefresh()
110
- ];
111
- case 2:
112
- _state.sent();
113
- setStatus('complete');
114
- return [
115
- 3,
116
- 4
117
- ];
118
- case 3:
119
- e = _state.sent();
120
- setHeight(0);
121
- setStatus('pulling');
122
- throw e;
123
- case 4:
124
- if (!(props.completeDelay > 0)) return [
125
- 3,
126
- 6
127
- ];
128
- return [
129
- 4,
130
- sleep(props.completeDelay)
131
- ];
132
- case 5:
133
- _state.sent();
134
- _state.label = 6;
135
- case 6:
136
- setHeight(0);
137
- setStatus('pulling');
138
- return [
139
- 2
140
- ];
141
- }
142
- });
143
- });
144
- return _doRefresh.apply(this, arguments);
145
- }
146
142
  var handleTouchEnd = function() {
147
143
  if (props.disabled) return;
148
144
  pullingRef.current = false;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Radio } from "./radio";
3
2
  import { RadioGroup } from "../radiogroup/radiogroup";
4
3
  var InnerRadio = Radio;
@@ -224,8 +224,8 @@ export var Range = function(props) {
224
224
  onEnd,
225
225
  setInnerValue
226
226
  ]);
227
- var handleClick = useCallback(/*#__PURE__*/ function() {
228
- var _ref = _async_to_generator(function(event) {
227
+ var handleClick = useCallback(function(event) {
228
+ return _async_to_generator(function() {
229
229
  var _event_detail, rect, _event_detail_x, x, delta, total, _event_detail1, _event_detail_y, y, value, _innerValue, left, right, middle;
230
230
  return _ts_generator(this, function(_state) {
231
231
  switch(_state.label){
@@ -280,11 +280,8 @@ export var Range = function(props) {
280
280
  ];
281
281
  }
282
282
  });
283
- });
284
- return function(event) {
285
- return _ref.apply(this, arguments);
286
- };
287
- }(), [
283
+ })();
284
+ }, [
288
285
  innerValue,
289
286
  disabled,
290
287
  isRange,
@@ -317,8 +314,8 @@ export var Range = function(props) {
317
314
  isRange,
318
315
  touch
319
316
  ]);
320
- var onTouchMove = useCallback(/*#__PURE__*/ function() {
321
- var _ref = _async_to_generator(function(event) {
317
+ var onTouchMove = useCallback(function(event) {
318
+ return _async_to_generator(function() {
322
319
  var handleMove;
323
320
  return _ts_generator(this, function(_state) {
324
321
  // @TODO RN、鸿蒙端垂直滑动时,页面会一同滑动,待解决
@@ -330,8 +327,8 @@ export var Range = function(props) {
330
327
  dragStatusRef.current = 'draging';
331
328
  }
332
329
  touch.move(event);
333
- handleMove = /*#__PURE__*/ function() {
334
- var _ref = _async_to_generator(function() {
330
+ handleMove = function() {
331
+ return _async_to_generator(function() {
335
332
  var delta, total, diff, newValue;
336
333
  return _ts_generator(this, function(_state) {
337
334
  if (!rootRect.current) return [
@@ -357,21 +354,15 @@ export var Range = function(props) {
357
354
  2
358
355
  ];
359
356
  });
360
- });
361
- return function handleMove() {
362
- return _ref.apply(this, arguments);
363
- };
364
- }();
357
+ })();
358
+ };
365
359
  requestAnimationFrame(handleMove);
366
360
  return [
367
361
  2
368
362
  ];
369
363
  });
370
- });
371
- return function(event) {
372
- return _ref.apply(this, arguments);
373
- };
374
- }(), [
364
+ })();
365
+ }, [
375
366
  disabled,
376
367
  isRange,
377
368
  onStart,
@@ -81,8 +81,8 @@ export var Sticky = function(props) {
81
81
  threshold,
82
82
  zIndex
83
83
  ]);
84
- var handleScroll = /*#__PURE__*/ function() {
85
- var _ref = _async_to_generator(function(scrollTop) {
84
+ var handleScroll = function(scrollTop) {
85
+ return _async_to_generator(function() {
86
86
  var curRootRect, stickyRect, containerRect, difference, curTransform, curFixed, windowHeight;
87
87
  return _ts_generator(this, function(_state) {
88
88
  switch(_state.label){
@@ -150,11 +150,8 @@ export var Sticky = function(props) {
150
150
  ];
151
151
  }
152
152
  });
153
- });
154
- return function handleScroll(scrollTop) {
155
- return _ref.apply(this, arguments);
156
- };
157
- }();
153
+ })();
154
+ };
158
155
  var getElement = useCallback(function() {
159
156
  return getScrollParent(rootRef.current);
160
157
  }, []);
@@ -60,8 +60,8 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
60
60
  ]);
61
61
  // 获取元素的时候要在页面 onReady 后,需要参考小程序的事件周期
62
62
  useLayoutEffect(function() {
63
- var getWidth = /*#__PURE__*/ function() {
64
- var _ref = _async_to_generator(function() {
63
+ var getWidth = function() {
64
+ return _async_to_generator(function() {
65
65
  var leftRect, rightRect;
66
66
  return _ts_generator(this, function(_state) {
67
67
  switch(_state.label){
@@ -105,11 +105,8 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
105
105
  ];
106
106
  }
107
107
  });
108
- });
109
- return function getWidth() {
110
- return _ref.apply(this, arguments);
111
- };
112
- }();
108
+ })();
109
+ };
113
110
  getWidth();
114
111
  }, [
115
112
  leftId,
@@ -120,8 +117,8 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
120
117
  transform: "translate(".concat(state.offset).concat(!harmony() ? 'px' : '', ", 0)"),
121
118
  transitionDuration: state.dragging ? '0s' : '.6s'
122
119
  };
123
- var onTouchStart = /*#__PURE__*/ function() {
124
- var _ref = _async_to_generator(function(event) {
120
+ var onTouchStart = function(event) {
121
+ return _async_to_generator(function() {
125
122
  var leftRect, rightRect, _props_onTouchStart;
126
123
  return _ts_generator(this, function(_state) {
127
124
  switch(_state.label){
@@ -171,11 +168,8 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
171
168
  ];
172
169
  }
173
170
  });
174
- });
175
- return function onTouchStart(event) {
176
- return _ref.apply(this, arguments);
177
- };
178
- }();
171
+ })();
172
+ };
179
173
  var onTouchMove = function(event) {
180
174
  var _props_onTouchMove;
181
175
  if (props.disabled) {
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Swiper } from "./swiper";
3
2
  import SwiperItem from "../swiperitem/index";
4
3
  var InnerSwiper = Swiper;
@@ -63,8 +63,8 @@ export var Switch = function(props) {
63
63
  (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-close"), !value), _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix, "-disabled-close"), disabled && !value), _obj)
64
64
  ]);
65
65
  };
66
- var onClick = /*#__PURE__*/ function() {
67
- var _ref = _async_to_generator(function() {
66
+ var onClick = function() {
67
+ return _async_to_generator(function() {
68
68
  var e;
69
69
  return _ts_generator(this, function(_state) {
70
70
  switch(_state.label){
@@ -109,11 +109,8 @@ export var Switch = function(props) {
109
109
  ];
110
110
  }
111
111
  });
112
- });
113
- return function onClick() {
114
- return _ref.apply(this, arguments);
115
- };
116
- }();
112
+ })();
113
+ };
117
114
  var _obj, _obj1;
118
115
  return /*#__PURE__*/ React.createElement(View, _object_spread({
119
116
  className: classes(),
@@ -106,22 +106,24 @@ var InternalUploader = function(props, ref) {
106
106
  var classes = classNames(className, 'nut-uploader');
107
107
  useImperativeHandle(ref, function() {
108
108
  return {
109
- submit: /*#__PURE__*/ _async_to_generator(function() {
110
- return _ts_generator(this, function(_state) {
111
- switch(_state.label){
112
- case 0:
113
- return [
114
- 4,
115
- uploadAction(uploadQueue)
116
- ];
117
- case 1:
118
- _state.sent();
119
- return [
120
- 2
121
- ];
122
- }
123
- });
124
- }),
109
+ submit: function() {
110
+ return _async_to_generator(function() {
111
+ return _ts_generator(this, function(_state) {
112
+ switch(_state.label){
113
+ case 0:
114
+ return [
115
+ 4,
116
+ uploadAction(uploadQueue)
117
+ ];
118
+ case 1:
119
+ _state.sent();
120
+ return [
121
+ 2
122
+ ];
123
+ }
124
+ });
125
+ })();
126
+ },
125
127
  clear: function() {
126
128
  clearUploadQueue();
127
129
  }
@@ -190,8 +192,8 @@ var InternalUploader = function(props, ref) {
190
192
  });
191
193
  }
192
194
  };
193
- var uploadAction = /*#__PURE__*/ function() {
194
- var _ref = _async_to_generator(function(tasks) {
195
+ var uploadAction = function(tasks) {
196
+ return _async_to_generator(function() {
195
197
  var taskIds, list;
196
198
  return _ts_generator(this, function(_state) {
197
199
  switch(_state.label){
@@ -211,8 +213,8 @@ var InternalUploader = function(props, ref) {
211
213
  setFileList(list);
212
214
  return [
213
215
  4,
214
- Promise.all(tasks.map(/*#__PURE__*/ function() {
215
- var _ref = _async_to_generator(function(currentTask, index) {
216
+ Promise.all(tasks.map(function(currentTask, index) {
217
+ return _async_to_generator(function() {
216
218
  var result, list, e, list1;
217
219
  return _ts_generator(this, function(_state) {
218
220
  switch(_state.label){
@@ -259,11 +261,8 @@ var InternalUploader = function(props, ref) {
259
261
  ];
260
262
  }
261
263
  });
262
- });
263
- return function(currentTask, index) {
264
- return _ref.apply(this, arguments);
265
- };
266
- }())).catch(function(errs) {
264
+ })();
265
+ })).catch(function(errs) {
267
266
  return console.error(errs);
268
267
  })
269
268
  ];
@@ -274,14 +273,11 @@ var InternalUploader = function(props, ref) {
274
273
  ];
275
274
  }
276
275
  });
277
- });
278
- return function uploadAction(tasks) {
279
- return _ref.apply(this, arguments);
280
- };
281
- }();
276
+ })();
277
+ };
282
278
  var idCountRef = useRef(0);
283
- var readFile = /*#__PURE__*/ function() {
284
- var _ref = _async_to_generator(function(files) {
279
+ var readFile = function(files) {
280
+ return _async_to_generator(function() {
285
281
  var tasks;
286
282
  return _ts_generator(this, function(_state) {
287
283
  switch(_state.label){
@@ -339,11 +335,8 @@ var InternalUploader = function(props, ref) {
339
335
  ];
340
336
  }
341
337
  });
342
- });
343
- return function readFile(files) {
344
- return _ref.apply(this, arguments);
345
- };
346
- }();
338
+ })();
339
+ };
347
340
  var filterFiles = function(files) {
348
341
  var maximum = maxCount * 1;
349
342
  var maximize = maxFileSize * 1;
@@ -382,8 +375,8 @@ var InternalUploader = function(props, ref) {
382
375
  }
383
376
  });
384
377
  };
385
- var onChangeMedia = /*#__PURE__*/ function() {
386
- var _ref = _async_to_generator(function(res) {
378
+ var onChangeMedia = function(res) {
379
+ return _async_to_generator(function() {
387
380
  var tempFiles, _files;
388
381
  return _ts_generator(this, function(_state) {
389
382
  // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
@@ -402,13 +395,10 @@ var InternalUploader = function(props, ref) {
402
395
  2
403
396
  ];
404
397
  });
405
- });
406
- return function onChangeMedia(res) {
407
- return _ref.apply(this, arguments);
408
- };
409
- }();
410
- var onChangeImage = /*#__PURE__*/ function() {
411
- var _ref = _async_to_generator(function(res) {
398
+ })();
399
+ };
400
+ var onChangeImage = function(res) {
401
+ return _async_to_generator(function() {
412
402
  var tempFiles, _files;
413
403
  return _ts_generator(this, function(_state) {
414
404
  tempFiles = res.tempFiles;
@@ -426,11 +416,8 @@ var InternalUploader = function(props, ref) {
426
416
  2
427
417
  ];
428
418
  });
429
- });
430
- return function onChangeImage(res) {
431
- return _ref.apply(this, arguments);
432
- };
433
- }();
419
+ })();
420
+ };
434
421
  var handleItemClick = function(file, index) {
435
422
  onFileItemClick === null || onFileItemClick === void 0 ? void 0 : onFileItemClick(file, index);
436
423
  };
@@ -79,20 +79,16 @@ export var WaterMark = function(props) {
79
79
  setBase64Url(canvas.toDataURL());
80
80
  };
81
81
  } else if (content) {
82
- ctx.textBaseline = 'middle' // 设置或返回在绘制文本时使用的当前文本基线。(正中)
83
- ;
84
- ctx.textAlign = 'center' // 设置或返回文本内容的当前对齐方式。
85
- ;
82
+ ctx.textBaseline = 'middle'; // 设置或返回在绘制文本时使用的当前文本基线。(正中)
83
+ ctx.textAlign = 'center'; // 设置或返回文本内容的当前对齐方式。
86
84
  // 文字绕中间旋转
87
85
  ctx.translate(markWidth / 2, markHeight / 2);
88
86
  ctx.rotate(Math.PI / 180 * Number(rotate));
89
87
  var markSize = Number(fontSize) * ratio;
90
88
  ctx.font = "".concat(fontStyle, " normal ").concat(fontWeight, " ").concat(markSize, "px/").concat(markHeight, "px ").concat(fontFamily);
91
89
  ctx.fillStyle = color;
92
- ctx.fillText(content, startX, startY) // 在画布上绘制"被填充的"文本。
93
- ;
94
- ctx.restore() // 返回之前保存过的路径状态和属性。
95
- ;
90
+ ctx.fillText(content, startX, startY); // 在画布上绘制"被填充的"文本。
91
+ ctx.restore(); // 返回之前保存过的路径状态和属性。
96
92
  setBase64Url(canvas.toDataURL());
97
93
  }
98
94
  } else {
@@ -1 +1 @@
1
- import React from "react";
1
+ export { };
@@ -72,10 +72,7 @@ export function triggerDrag(el) {
72
72
  * @param {number} endY 结束触摸点的 Y 坐标
73
73
  * @param {number} duration 移动持续时间(毫秒)
74
74
  */ export function simulateTouchMove(element, startX, startY, endX, endY, duration) {
75
- return _simulateTouchMove.apply(this, arguments);
76
- }
77
- function _simulateTouchMove() {
78
- _simulateTouchMove = _async_to_generator(function(element, startX, startY, endX, endY, duration) {
75
+ return _async_to_generator(function() {
79
76
  var touch, touchList, distanceX, distanceY, startTime, elapsed, progress, currentX, currentY, currentTouch, currentTouchList;
80
77
  return _ts_generator(this, function(_state) {
81
78
  switch(_state.label){
@@ -128,8 +125,7 @@ function _simulateTouchMove() {
128
125
  ];
129
126
  }
130
127
  });
131
- });
132
- return _simulateTouchMove.apply(this, arguments);
128
+ })();
133
129
  }
134
130
  /**
135
131
  * 模拟触摸缩放方法
@@ -138,10 +134,7 @@ function _simulateTouchMove() {
138
134
  * @param {number} endDistance 结束触摸点的距离
139
135
  * @param {number} duration 缩放持续时间(毫秒)
140
136
  */ export function simulateTouchZoom(element, startDistance, endDistance, duration) {
141
- return _simulateTouchZoom.apply(this, arguments);
142
- }
143
- function _simulateTouchZoom() {
144
- _simulateTouchZoom = _async_to_generator(function(element, startDistance, endDistance, duration) {
137
+ return _async_to_generator(function() {
145
138
  var centerX, centerY, startScale, endScale, startTouches, endTouches, progress, currentScale, currentDistance, currentTouches;
146
139
  return _ts_generator(this, function(_state) {
147
140
  switch(_state.label){
@@ -201,6 +194,5 @@ function _simulateTouchZoom() {
201
194
  ];
202
195
  }
203
196
  });
204
- });
205
- return _simulateTouchZoom.apply(this, arguments);
197
+ })();
206
198
  }
@@ -45,10 +45,7 @@ function legacyUnmount(container) {
45
45
  return unmountComponentAtNode(container);
46
46
  }
47
47
  function concurrentUnmount(container) {
48
- return _concurrentUnmount.apply(this, arguments);
49
- }
50
- function _concurrentUnmount() {
51
- _concurrentUnmount = _async_to_generator(function(container) {
48
+ return _async_to_generator(function() {
52
49
  return _ts_generator(this, function(_state) {
53
50
  // Delay to unmount to avoid React 18 sync warning
54
51
  return [
@@ -60,8 +57,7 @@ function _concurrentUnmount() {
60
57
  })
61
58
  ];
62
59
  });
63
- });
64
- return _concurrentUnmount.apply(this, arguments);
60
+ })();
65
61
  }
66
62
  export function unmount(container) {
67
63
  if (createRoot) {
@@ -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;