@nutui/nutui-react-taro 3.0.19-cpp.22-2 → 3.0.19-cpp.22-4

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 (143) hide show
  1. package/dist/cjs/hooks/taro/use-custom-event.js +5 -5
  2. package/dist/cjs/hooks/use-ref-state.js +3 -3
  3. package/dist/cjs/hooks/use-touch.js +2 -1
  4. package/dist/cjs/packages/address/utils.js +3 -3
  5. package/dist/cjs/packages/avatarcropper/avatarcropper.js +28 -16
  6. package/dist/cjs/packages/badge/badge.js +7 -4
  7. package/dist/cjs/packages/barrage/barrage.js +24 -14
  8. package/dist/cjs/packages/calendar/style/calendar.scss +32 -1
  9. package/dist/cjs/packages/calendar/style/style.css +21 -1
  10. package/dist/cjs/packages/calendar/style/style.harmony.css +21 -1
  11. package/dist/cjs/packages/calendar/style-jmapp/calendar.scss +32 -1
  12. package/dist/cjs/packages/calendar/style-jmapp/style.css +21 -1
  13. package/dist/cjs/packages/calendar/style-jrkf/calendar.scss +32 -1
  14. package/dist/cjs/packages/calendar/style-jrkf/style.css +21 -1
  15. package/dist/cjs/packages/calendar/utils.js +8 -8
  16. package/dist/cjs/packages/calendarcard/icon.js +9 -15
  17. package/dist/cjs/packages/calendarcard/style/calendarcard.scss +13 -0
  18. package/dist/cjs/packages/calendarcard/style/style.css +8 -0
  19. package/dist/cjs/packages/calendarcard/style/style.harmony.css +8 -0
  20. package/dist/cjs/packages/calendarcard/style-jmapp/calendarcard.scss +13 -0
  21. package/dist/cjs/packages/calendarcard/style-jmapp/style.css +8 -0
  22. package/dist/cjs/packages/calendarcard/style-jrkf/calendarcard.scss +13 -0
  23. package/dist/cjs/packages/calendarcard/style-jrkf/style.css +8 -0
  24. package/dist/cjs/packages/calendarcard/utils.js +6 -6
  25. package/dist/cjs/packages/cascader/cascader.js +21 -12
  26. package/dist/cjs/packages/cascader/utils.js +3 -3
  27. package/dist/cjs/packages/collapseitem/collapseitem.js +7 -4
  28. package/dist/cjs/packages/configprovider/configprovider.js +7 -7
  29. package/dist/cjs/packages/configprovider/index.js +6 -6
  30. package/dist/cjs/packages/countdown/countdown.js +2 -1
  31. package/dist/cjs/packages/datepicker/utils.js +9 -9
  32. package/dist/cjs/packages/dialog/content.js +3 -3
  33. package/dist/cjs/packages/dialog/dialog.js +11 -8
  34. package/dist/cjs/packages/drag/drag.js +7 -4
  35. package/dist/cjs/packages/elevator/elevator.js +10 -7
  36. package/dist/cjs/packages/ellipsis/ellipsis.js +30 -17
  37. package/dist/cjs/packages/form/index.js +2 -0
  38. package/dist/cjs/packages/form/useform.js +57 -50
  39. package/dist/cjs/packages/infiniteloading/infiniteloading.js +14 -8
  40. package/dist/cjs/packages/inputnumber/inputnumber.js +28 -16
  41. package/dist/cjs/packages/lottie/types.js +2 -0
  42. package/dist/cjs/packages/menuitem/menuitem.js +22 -24
  43. package/dist/cjs/packages/noticebar/noticebar.js +70 -74
  44. package/dist/cjs/packages/notify/notify.js +4 -4
  45. package/dist/cjs/packages/nutui.react.build.js +105 -105
  46. package/dist/cjs/packages/nutui.react.js +105 -105
  47. package/dist/cjs/packages/overlay/overlay.js +3 -3
  48. package/dist/cjs/packages/pickerview/pickerroller.js +7 -4
  49. package/dist/cjs/packages/pickerview/pickerview.js +2 -1
  50. package/dist/cjs/packages/pickerview/utils.js +3 -3
  51. package/dist/cjs/packages/popover/popover.js +77 -75
  52. package/dist/cjs/packages/popup/popup.js +14 -8
  53. package/dist/cjs/packages/price/price.js +6 -4
  54. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +56 -52
  55. package/dist/cjs/packages/radio/index.js +2 -0
  56. package/dist/cjs/packages/range/range.js +28 -16
  57. package/dist/cjs/packages/shortpassword/shortpassword.js +3 -3
  58. package/dist/cjs/packages/sticky/sticky.js +7 -4
  59. package/dist/cjs/packages/swipe/swipe.js +14 -8
  60. package/dist/cjs/packages/swiper/index.js +1 -0
  61. package/dist/cjs/packages/switch/switch.js +7 -4
  62. package/dist/cjs/packages/toast/toast.js +4 -4
  63. package/dist/cjs/packages/uploader/uploader.js +51 -38
  64. package/dist/cjs/packages/virtuallist/utils.js +6 -6
  65. package/dist/cjs/packages/watermark/watermark.js +8 -4
  66. package/dist/cjs/types/spec/address/base.js +2 -0
  67. package/dist/cjs/types/spec/price/base.d.ts +1 -0
  68. package/dist/cjs/utils/date.js +5 -5
  69. package/dist/cjs/utils/event-mocker.js +18 -10
  70. package/dist/cjs/utils/get-rect.js +4 -4
  71. package/dist/cjs/utils/get-scroll-parent.js +3 -3
  72. package/dist/cjs/utils/merge-props.js +3 -3
  73. package/dist/cjs/utils/merge.js +6 -6
  74. package/dist/cjs/utils/raf.js +3 -3
  75. package/dist/cjs/utils/render.js +9 -5
  76. package/dist/cjs/utils/rubberband.js +3 -3
  77. package/dist/cjs/utils/should-render-price-raw.d.ts +1 -0
  78. package/dist/cjs/utils/should-render-price-raw.js +17 -6
  79. package/dist/cjs/utils/taro/get-rect.js +24 -14
  80. package/dist/cjs/utils/taro/get-system-info.js +4 -4
  81. package/dist/cjs/utils/taro/platform.js +5 -5
  82. package/dist/es/hooks/use-touch.js +1 -1
  83. package/dist/es/packages/avatarcropper/avatarcropper.js +28 -16
  84. package/dist/es/packages/badge/badge.js +7 -4
  85. package/dist/es/packages/barrage/barrage.js +24 -14
  86. package/dist/es/packages/calendar/style/calendar.scss +32 -1
  87. package/dist/es/packages/calendar/style/style.css +21 -1
  88. package/dist/es/packages/calendar/style/style.harmony.css +21 -1
  89. package/dist/es/packages/calendar/style-jmapp/calendar.scss +32 -1
  90. package/dist/es/packages/calendar/style-jmapp/style.css +21 -1
  91. package/dist/es/packages/calendar/style-jrkf/calendar.scss +32 -1
  92. package/dist/es/packages/calendar/style-jrkf/style.css +21 -1
  93. package/dist/es/packages/calendarcard/icon.js +5 -11
  94. package/dist/es/packages/calendarcard/style/calendarcard.scss +13 -0
  95. package/dist/es/packages/calendarcard/style/style.css +8 -0
  96. package/dist/es/packages/calendarcard/style/style.harmony.css +8 -0
  97. package/dist/es/packages/calendarcard/style-jmapp/calendarcard.scss +13 -0
  98. package/dist/es/packages/calendarcard/style-jmapp/style.css +8 -0
  99. package/dist/es/packages/calendarcard/style-jrkf/calendarcard.scss +13 -0
  100. package/dist/es/packages/calendarcard/style-jrkf/style.css +8 -0
  101. package/dist/es/packages/cascader/cascader.js +21 -12
  102. package/dist/es/packages/collapseitem/collapseitem.js +7 -4
  103. package/dist/es/packages/countdown/countdown.js +2 -1
  104. package/dist/es/packages/dialog/dialog.js +7 -4
  105. package/dist/es/packages/drag/drag.js +7 -4
  106. package/dist/es/packages/elevator/elevator.js +7 -4
  107. package/dist/es/packages/ellipsis/ellipsis.js +30 -17
  108. package/dist/es/packages/form/index.js +1 -0
  109. package/dist/es/packages/form/useform.js +53 -46
  110. package/dist/es/packages/infiniteloading/infiniteloading.js +14 -8
  111. package/dist/es/packages/inputnumber/inputnumber.js +28 -16
  112. package/dist/es/packages/lottie/types.js +1 -1
  113. package/dist/es/packages/menuitem/menuitem.js +22 -24
  114. package/dist/es/packages/noticebar/noticebar.js +70 -74
  115. package/dist/es/packages/pickerview/pickerroller.js +7 -4
  116. package/dist/es/packages/pickerview/pickerview.js +2 -1
  117. package/dist/es/packages/popover/popover.js +77 -75
  118. package/dist/es/packages/popup/popup.js +14 -8
  119. package/dist/es/packages/price/price.js +7 -5
  120. package/dist/es/packages/pulltorefresh/pulltorefresh.js +56 -52
  121. package/dist/es/packages/radio/index.js +1 -0
  122. package/dist/es/packages/range/range.js +28 -16
  123. package/dist/es/packages/sticky/sticky.js +7 -4
  124. package/dist/es/packages/swipe/swipe.js +14 -8
  125. package/dist/es/packages/swiper/index.js +1 -0
  126. package/dist/es/packages/switch/switch.js +7 -4
  127. package/dist/es/packages/uploader/uploader.js +51 -38
  128. package/dist/es/packages/watermark/watermark.js +8 -4
  129. package/dist/es/types/spec/address/base.js +1 -1
  130. package/dist/es/types/spec/price/base.d.ts +1 -0
  131. package/dist/es/utils/event-mocker.js +12 -4
  132. package/dist/es/utils/render.js +6 -2
  133. package/dist/es/utils/should-render-price-raw.d.ts +1 -0
  134. package/dist/es/utils/should-render-price-raw.js +6 -3
  135. package/dist/es/utils/taro/get-rect.js +20 -10
  136. package/dist/nutui.react.umd.js +871 -663
  137. package/dist/style-jmapp.css +1 -1
  138. package/dist/style-jmapp.scss +41 -41
  139. package/dist/style-jrkf.css +1 -1
  140. package/dist/style-jrkf.scss +24 -24
  141. package/dist/style.css +1 -1
  142. package/dist/style.scss +31 -31
  143. package/package.json +1 -1
@@ -225,8 +225,8 @@ export var Range = function(props) {
225
225
  onEnd,
226
226
  setInnerValue
227
227
  ]);
228
- var handleClick = useCallback(function(event) {
229
- return _async_to_generator(function() {
228
+ var handleClick = useCallback(/*#__PURE__*/ function() {
229
+ var _ref = _async_to_generator(function(event) {
230
230
  var _event_detail, rect, _event_detail_x, x, delta, total, _event_detail1, _event_detail_y, y, value, _innerValue, left, right, middle;
231
231
  return _ts_generator(this, function(_state) {
232
232
  switch(_state.label){
@@ -281,8 +281,11 @@ export var Range = function(props) {
281
281
  ];
282
282
  }
283
283
  });
284
- })();
285
- }, [
284
+ });
285
+ return function(event) {
286
+ return _ref.apply(this, arguments);
287
+ };
288
+ }(), [
286
289
  innerValue,
287
290
  disabled,
288
291
  isRange,
@@ -292,8 +295,8 @@ export var Range = function(props) {
292
295
  vertical
293
296
  ]);
294
297
  useReady(function() {
295
- var getRootRect = function() {
296
- return _async_to_generator(function() {
298
+ var getRootRect = /*#__PURE__*/ function() {
299
+ var _ref = _async_to_generator(function() {
297
300
  var rect;
298
301
  return _ts_generator(this, function(_state) {
299
302
  switch(_state.label){
@@ -316,8 +319,11 @@ export var Range = function(props) {
316
319
  ];
317
320
  }
318
321
  });
319
- })();
320
- };
322
+ });
323
+ return function getRootRect() {
324
+ return _ref.apply(this, arguments);
325
+ };
326
+ }();
321
327
  nextTick(function() {
322
328
  getRootRect();
323
329
  });
@@ -339,8 +345,8 @@ export var Range = function(props) {
339
345
  isRange,
340
346
  touch
341
347
  ]);
342
- var onTouchMove = useCallback(function(event) {
343
- return _async_to_generator(function() {
348
+ var onTouchMove = useCallback(/*#__PURE__*/ function() {
349
+ var _ref = _async_to_generator(function(event) {
344
350
  var handleMove;
345
351
  return _ts_generator(this, function(_state) {
346
352
  // @TODO RN、鸿蒙端垂直滑动时,页面会一同滑动,待解决
@@ -352,8 +358,8 @@ export var Range = function(props) {
352
358
  dragStatusRef.current = 'draging';
353
359
  }
354
360
  touch.move(event);
355
- handleMove = function() {
356
- return _async_to_generator(function() {
361
+ handleMove = /*#__PURE__*/ function() {
362
+ var _ref = _async_to_generator(function() {
357
363
  var delta, total, diff, newValue;
358
364
  return _ts_generator(this, function(_state) {
359
365
  if (!rootRect.current) return [
@@ -379,15 +385,21 @@ export var Range = function(props) {
379
385
  2
380
386
  ];
381
387
  });
382
- })();
383
- };
388
+ });
389
+ return function handleMove() {
390
+ return _ref.apply(this, arguments);
391
+ };
392
+ }();
384
393
  requestAnimationFrame(handleMove);
385
394
  return [
386
395
  2
387
396
  ];
388
397
  });
389
- })();
390
- }, [
398
+ });
399
+ return function(event) {
400
+ return _ref.apply(this, arguments);
401
+ };
402
+ }(), [
391
403
  disabled,
392
404
  isRange,
393
405
  onStart,
@@ -81,8 +81,8 @@ export var Sticky = function(props) {
81
81
  threshold,
82
82
  zIndex
83
83
  ]);
84
- var handleScroll = function(scrollTop) {
85
- return _async_to_generator(function() {
84
+ var handleScroll = /*#__PURE__*/ function() {
85
+ var _ref = _async_to_generator(function(scrollTop) {
86
86
  var curRootRect, stickyRect, containerRect, difference, curTransform, curFixed, windowHeight;
87
87
  return _ts_generator(this, function(_state) {
88
88
  switch(_state.label){
@@ -150,8 +150,11 @@ export var Sticky = function(props) {
150
150
  ];
151
151
  }
152
152
  });
153
- })();
154
- };
153
+ });
154
+ return function handleScroll(scrollTop) {
155
+ return _ref.apply(this, arguments);
156
+ };
157
+ }();
155
158
  var getElement = useCallback(function() {
156
159
  return getScrollParent(rootRef.current);
157
160
  }, []);
@@ -29,8 +29,8 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
29
29
  var uid = useUuid();
30
30
  var leftId = "swipe-left-".concat(uid);
31
31
  var rightId = "swipe-right-".concat(uid);
32
- var getWidth = function() {
33
- return _async_to_generator(function() {
32
+ var getWidth = /*#__PURE__*/ function() {
33
+ var _ref = _async_to_generator(function() {
34
34
  var leftRect, rightRect;
35
35
  return _ts_generator(this, function(_state) {
36
36
  switch(_state.label){
@@ -74,8 +74,11 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
74
74
  ];
75
75
  }
76
76
  });
77
- })();
78
- };
77
+ });
78
+ return function getWidth() {
79
+ return _ref.apply(this, arguments);
80
+ };
81
+ }();
79
82
  // 获取元素的时候要在页面 onReady 后,需要参考小程序的事件周期
80
83
  useReady(function() {
81
84
  nextTick(function() {
@@ -117,8 +120,8 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
117
120
  state.offset,
118
121
  state.dragging
119
122
  ]);
120
- var onTouchStart = function(event) {
121
- return _async_to_generator(function() {
123
+ var onTouchStart = /*#__PURE__*/ function() {
124
+ var _ref = _async_to_generator(function(event) {
122
125
  var _props_onTouchStart;
123
126
  return _ts_generator(this, function(_state) {
124
127
  if (!props.disabled) {
@@ -132,8 +135,11 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
132
135
  2
133
136
  ];
134
137
  });
135
- })();
136
- };
138
+ });
139
+ return function onTouchStart(event) {
140
+ return _ref.apply(this, arguments);
141
+ };
142
+ }();
137
143
  var onTouchMove = function(event) {
138
144
  var _props_onTouchMove;
139
145
  if (props.disabled) return;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { Swiper } from "./swiper";
2
3
  import SwiperItem from "../swiperitem/index";
3
4
  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 = function() {
67
- return _async_to_generator(function() {
66
+ var onClick = /*#__PURE__*/ function() {
67
+ var _ref = _async_to_generator(function() {
68
68
  var e;
69
69
  return _ts_generator(this, function(_state) {
70
70
  switch(_state.label){
@@ -109,8 +109,11 @@ export var Switch = function(props) {
109
109
  ];
110
110
  }
111
111
  });
112
- })();
113
- };
112
+ });
113
+ return function onClick() {
114
+ return _ref.apply(this, arguments);
115
+ };
116
+ }();
114
117
  var _obj, _obj1;
115
118
  return /*#__PURE__*/ React.createElement(View, _object_spread({
116
119
  className: classes(),
@@ -106,24 +106,22 @@ var InternalUploader = function(props, ref) {
106
106
  var classes = classNames(className, 'nut-uploader');
107
107
  useImperativeHandle(ref, function() {
108
108
  return {
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
- },
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
+ }),
127
125
  clear: function() {
128
126
  clearUploadQueue();
129
127
  }
@@ -192,8 +190,8 @@ var InternalUploader = function(props, ref) {
192
190
  });
193
191
  }
194
192
  };
195
- var uploadAction = function(tasks) {
196
- return _async_to_generator(function() {
193
+ var uploadAction = /*#__PURE__*/ function() {
194
+ var _ref = _async_to_generator(function(tasks) {
197
195
  var taskIds, list;
198
196
  return _ts_generator(this, function(_state) {
199
197
  switch(_state.label){
@@ -213,8 +211,8 @@ var InternalUploader = function(props, ref) {
213
211
  setFileList(list);
214
212
  return [
215
213
  4,
216
- Promise.all(tasks.map(function(currentTask, index) {
217
- return _async_to_generator(function() {
214
+ Promise.all(tasks.map(/*#__PURE__*/ function() {
215
+ var _ref = _async_to_generator(function(currentTask, index) {
218
216
  var result, list, e, list1;
219
217
  return _ts_generator(this, function(_state) {
220
218
  switch(_state.label){
@@ -261,8 +259,11 @@ var InternalUploader = function(props, ref) {
261
259
  ];
262
260
  }
263
261
  });
264
- })();
265
- })).catch(function(errs) {
262
+ });
263
+ return function(currentTask, index) {
264
+ return _ref.apply(this, arguments);
265
+ };
266
+ }())).catch(function(errs) {
266
267
  return console.error(errs);
267
268
  })
268
269
  ];
@@ -273,11 +274,14 @@ var InternalUploader = function(props, ref) {
273
274
  ];
274
275
  }
275
276
  });
276
- })();
277
- };
277
+ });
278
+ return function uploadAction(tasks) {
279
+ return _ref.apply(this, arguments);
280
+ };
281
+ }();
278
282
  var idCountRef = useRef(0);
279
- var readFile = function(files) {
280
- return _async_to_generator(function() {
283
+ var readFile = /*#__PURE__*/ function() {
284
+ var _ref = _async_to_generator(function(files) {
281
285
  var tasks;
282
286
  return _ts_generator(this, function(_state) {
283
287
  switch(_state.label){
@@ -335,8 +339,11 @@ var InternalUploader = function(props, ref) {
335
339
  ];
336
340
  }
337
341
  });
338
- })();
339
- };
342
+ });
343
+ return function readFile(files) {
344
+ return _ref.apply(this, arguments);
345
+ };
346
+ }();
340
347
  var filterFiles = function(files) {
341
348
  var maximum = maxCount * 1;
342
349
  var maximize = maxFileSize * 1;
@@ -375,8 +382,8 @@ var InternalUploader = function(props, ref) {
375
382
  }
376
383
  });
377
384
  };
378
- var onChangeMedia = function(res) {
379
- return _async_to_generator(function() {
385
+ var onChangeMedia = /*#__PURE__*/ function() {
386
+ var _ref = _async_to_generator(function(res) {
380
387
  var tempFiles, _files;
381
388
  return _ts_generator(this, function(_state) {
382
389
  // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
@@ -395,10 +402,13 @@ var InternalUploader = function(props, ref) {
395
402
  2
396
403
  ];
397
404
  });
398
- })();
399
- };
400
- var onChangeImage = function(res) {
401
- return _async_to_generator(function() {
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) {
402
412
  var tempFiles, _files;
403
413
  return _ts_generator(this, function(_state) {
404
414
  tempFiles = res.tempFiles;
@@ -416,8 +426,11 @@ var InternalUploader = function(props, ref) {
416
426
  2
417
427
  ];
418
428
  });
419
- })();
420
- };
429
+ });
430
+ return function onChangeImage(res) {
431
+ return _ref.apply(this, arguments);
432
+ };
433
+ }();
421
434
  var handleItemClick = function(file, index) {
422
435
  onFileItemClick === null || onFileItemClick === void 0 ? void 0 : onFileItemClick(file, index);
423
436
  };
@@ -79,16 +79,20 @@ export var WaterMark = function(props) {
79
79
  setBase64Url(canvas.toDataURL());
80
80
  };
81
81
  } else if (content) {
82
- ctx.textBaseline = 'middle'; // 设置或返回在绘制文本时使用的当前文本基线。(正中)
83
- ctx.textAlign = 'center'; // 设置或返回文本内容的当前对齐方式。
82
+ ctx.textBaseline = 'middle' // 设置或返回在绘制文本时使用的当前文本基线。(正中)
83
+ ;
84
+ ctx.textAlign = 'center' // 设置或返回文本内容的当前对齐方式。
85
+ ;
84
86
  // 文字绕中间旋转
85
87
  ctx.translate(markWidth / 2, markHeight / 2);
86
88
  ctx.rotate(Math.PI / 180 * Number(rotate));
87
89
  var markSize = Number(fontSize) * ratio;
88
90
  ctx.font = "".concat(fontStyle, " normal ").concat(fontWeight, " ").concat(markSize, "px/").concat(markHeight, "px ").concat(fontFamily);
89
91
  ctx.fillStyle = color;
90
- ctx.fillText(content, startX, startY); // 在画布上绘制"被填充的"文本。
91
- ctx.restore(); // 返回之前保存过的路径状态和属性。
92
+ ctx.fillText(content, startX, startY) // 在画布上绘制"被填充的"文本。
93
+ ;
94
+ ctx.restore() // 返回之前保存过的路径状态和属性。
95
+ ;
92
96
  setBase64Url(canvas.toDataURL());
93
97
  }
94
98
  } else {
@@ -1 +1 @@
1
- export { };
1
+ import React from "react";
@@ -41,4 +41,5 @@ export interface BasePrice extends BaseProps {
41
41
  * 是否划线价
42
42
  */
43
43
  line: boolean
44
+ raw: boolean;
44
45
  }
@@ -72,7 +72,10 @@ 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 _async_to_generator(function() {
75
+ return _simulateTouchMove.apply(this, arguments);
76
+ }
77
+ function _simulateTouchMove() {
78
+ _simulateTouchMove = _async_to_generator(function(element, startX, startY, endX, endY, duration) {
76
79
  var touch, touchList, distanceX, distanceY, startTime, elapsed, progress, currentX, currentY, currentTouch, currentTouchList;
77
80
  return _ts_generator(this, function(_state) {
78
81
  switch(_state.label){
@@ -125,7 +128,8 @@ export function triggerDrag(el) {
125
128
  ];
126
129
  }
127
130
  });
128
- })();
131
+ });
132
+ return _simulateTouchMove.apply(this, arguments);
129
133
  }
130
134
  /**
131
135
  * 模拟触摸缩放方法
@@ -134,7 +138,10 @@ export function triggerDrag(el) {
134
138
  * @param {number} endDistance 结束触摸点的距离
135
139
  * @param {number} duration 缩放持续时间(毫秒)
136
140
  */ export function simulateTouchZoom(element, startDistance, endDistance, duration) {
137
- return _async_to_generator(function() {
141
+ return _simulateTouchZoom.apply(this, arguments);
142
+ }
143
+ function _simulateTouchZoom() {
144
+ _simulateTouchZoom = _async_to_generator(function(element, startDistance, endDistance, duration) {
138
145
  var centerX, centerY, startScale, endScale, startTouches, endTouches, progress, currentScale, currentDistance, currentTouches;
139
146
  return _ts_generator(this, function(_state) {
140
147
  switch(_state.label){
@@ -194,5 +201,6 @@ export function triggerDrag(el) {
194
201
  ];
195
202
  }
196
203
  });
197
- })();
204
+ });
205
+ return _simulateTouchZoom.apply(this, arguments);
198
206
  }
@@ -45,7 +45,10 @@ function legacyUnmount(container) {
45
45
  return unmountComponentAtNode(container);
46
46
  }
47
47
  function concurrentUnmount(container) {
48
- return _async_to_generator(function() {
48
+ return _concurrentUnmount.apply(this, arguments);
49
+ }
50
+ function _concurrentUnmount() {
51
+ _concurrentUnmount = _async_to_generator(function(container) {
49
52
  return _ts_generator(this, function(_state) {
50
53
  // Delay to unmount to avoid React 18 sync warning
51
54
  return [
@@ -57,7 +60,8 @@ function concurrentUnmount(container) {
57
60
  })
58
61
  ];
59
62
  });
60
- })();
63
+ });
64
+ return _concurrentUnmount.apply(this, arguments);
61
65
  }
62
66
  export function unmount(container) {
63
67
  if (createRoot) {
@@ -1 +1,2 @@
1
1
  export declare function shouldRenderPriceAsRaw(s: string): boolean;
2
+ export declare function hasNonPriceChars(s: string): boolean;
@@ -1,5 +1,6 @@
1
- var CJK = /[\u4E00-\u9FFF]/;
2
1
  var RE_NUM = /\d+(?:\.\d+)?/g;
2
+ // 价格合法字符:数字、小数点、负号、大写货币代码(HK USD EUR 等)、常见货币符号 Unicode 区块(含全角 ¥)
3
+ var PRICE_CHARS = /^[\d.\-A-Z¥¥$€£₩₹₽₺₴₪฿\u20A0-\u20CF\uFE69\uFF04\uFFE5]*$/;
3
4
  function hasNoExtractablePrice(s) {
4
5
  var t = s.trim();
5
6
  if (!t) return true;
@@ -12,7 +13,6 @@ export function shouldRenderPriceAsRaw(s) {
12
13
  return true;
13
14
  }
14
15
  var t = s.trim();
15
- if (!CJK.test(t)) return false;
16
16
  var matches = Array.from(t.matchAll(RE_NUM));
17
17
  if (matches.length < 2) return false;
18
18
  var a = matches[0];
@@ -20,5 +20,8 @@ export function shouldRenderPriceAsRaw(s) {
20
20
  var i0 = a.index;
21
21
  var i1 = b.index;
22
22
  var between = t.slice(i0 + a[0].length, i1);
23
- return CJK.test(between);
23
+ return !PRICE_CHARS.test(between);
24
+ }
25
+ export function hasNonPriceChars(s) {
26
+ return !PRICE_CHARS.test(s);
24
27
  }
@@ -15,10 +15,12 @@ export function makeRect(width, height) {
15
15
  height: height
16
16
  };
17
17
  }
18
- export var getRectInMultiPlatform = function(element) {
19
- var harmonyId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
20
- return _async_to_generator(function() {
18
+ export var getRectInMultiPlatform = /*#__PURE__*/ function() {
19
+ var _ref = _async_to_generator(function(element) {
20
+ var harmonyId;
21
+ var _arguments = arguments;
21
22
  return _ts_generator(this, function(_state) {
23
+ harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
22
24
  if (element) {
23
25
  if (inBrowser) {
24
26
  return [
@@ -49,13 +51,18 @@ export var getRectInMultiPlatform = function(element) {
49
51
  Promise.resolve(makeRect(0, 0))
50
52
  ];
51
53
  });
52
- })();
53
- };
54
+ });
55
+ return function getRectInMultiPlatform(element) {
56
+ return _ref.apply(this, arguments);
57
+ };
58
+ }();
54
59
  // 获取元素位置,不走缓存
55
- export var getRectInMultiPlatformWithoutCache = function(element) {
56
- var harmonyId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
57
- return _async_to_generator(function() {
60
+ export var getRectInMultiPlatformWithoutCache = /*#__PURE__*/ function() {
61
+ var _ref = _async_to_generator(function(element) {
62
+ var harmonyId;
63
+ var _arguments = arguments;
58
64
  return _ts_generator(this, function(_state) {
65
+ harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
59
66
  if (element) {
60
67
  if (inBrowser) {
61
68
  return [
@@ -78,5 +85,8 @@ export var getRectInMultiPlatformWithoutCache = function(element) {
78
85
  Promise.resolve(makeRect(0, 0))
79
86
  ];
80
87
  });
81
- })();
82
- };
88
+ });
89
+ return function getRectInMultiPlatformWithoutCache(element) {
90
+ return _ref.apply(this, arguments);
91
+ };
92
+ }();