@nutui/nutui-react-taro 2.6.11 → 2.6.12

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v2.6.12
2
+ `2024-07-05`
3
+
4
+
5
+ * :sparkles: feat: add pagination whether to show pages in imagepreview (#2411) @xiaoyatong
6
+ * :bug: fix(uploader): pre-upload pmage preview bug (#2416) @Alex-huxiyang
7
+ * :bug: fix(taro-form-demo): 点击演示demo表单内的重置会触发提交表单事件bug修复 (#2415) @Skedush
8
+ * :bug: fix(form): validator 中的 value 类型更新为 any (#2406) @oasis-cloud
9
+ * :bug: fix(uploader): 京东小程序中可上传时可选择图片和视频 (#2410) @xueshufive
10
+ * :bug: fix(avatarcropper): 报错 (#2364) @Alex-huxiyang
11
+ * :bug: fix(form): setFields未触发校验 (#2400) @Alex-huxiyang
12
+
13
+
1
14
  # v2.6.11
2
15
  `2024-06-28`
3
16
 
@@ -65,12 +78,12 @@
65
78
  `2024-05-17`
66
79
 
67
80
 
68
- *🏡 chore(image): 官网taro的demo显示与h5不一致 (#2244) @Alex.huxiyang
81
+ *🏡 chore(image): 官网taro的demo显示与h5不一致 (#2244) @Alex-huxiyang
69
82
  * :bug: fix(circleprogress): update demo (#2260) @Eiinu
70
83
  * :bug: fix: 移除 defaultProps(2) (#2254) @Eiinu
71
- * :bug: fix: 关于checkbox&tabs的doc与demo修改 (#2253) @Alex.huxiyang
72
- * :bug: fix(table): 修复部分由于场景下width未生效导致的一些问题 (#2241) @Alex.huxiyang
73
- * :bug: fix(menu): 选项文字很多时右侧箭头展示异常 (#2252) @Alex.huxiyang
84
+ * :bug: fix: 关于checkbox&tabs的doc与demo修改 (#2253) @Alex-huxiyang
85
+ * :bug: fix(table): 修复部分由于场景下width未生效导致的一些问题 (#2241) @Alex-huxiyang
86
+ * :bug: fix(menu): 选项文字很多时右侧箭头展示异常 (#2252) @Alex-huxiyang
74
87
  * :bug: fix(input): 修复特殊场景下自动清除失效问题 (#2240) @Eiinu
75
88
 
76
89
 
@@ -1,4 +1,4 @@
1
- import { A as AvatarCropper } from "./avatarcropper.taro-R3OfWq1H.js";
1
+ import { A as AvatarCropper } from "./avatarcropper.taro-CAVcFvKC.js";
2
2
  export {
3
3
  AvatarCropper as default
4
4
  };
package/dist/esm/Form.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React__default from "react";
2
2
  import classNames from "classnames";
3
- import { u as useForm, S as SECRET, C as Context, F as FormItem } from "./formitem.taro-tLWeQ0P5.js";
3
+ import { u as useForm, S as SECRET, C as Context, F as FormItem } from "./formitem.taro-BsnxUebv.js";
4
4
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
5
5
  import { C as Cell } from "./cell.taro-CVFlcls2.js";
6
6
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { labelPosition: "right", starPosition: "left", divider: false, onFinish: (values) => {
@@ -1,4 +1,4 @@
1
- import { F as FormItem } from "./formitem.taro-tLWeQ0P5.js";
1
+ import { F as FormItem } from "./formitem.taro-BsnxUebv.js";
2
2
  export {
3
3
  FormItem as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { I as ImagePreview } from "./imagepreview.taro-B7eJN5Hn.js";
1
+ import { I as ImagePreview } from "./imagepreview.taro-BLXFYocO.js";
2
2
  export {
3
3
  ImagePreview as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { U as Uploader } from "./uploader.taro-E6R-Ow7M.js";
1
+ import { U as Uploader } from "./uploader.taro-CiamsRGo.js";
2
2
  export {
3
3
  Uploader as default
4
4
  };
@@ -137,6 +137,8 @@ const AvatarCropper = (props) => {
137
137
  if ((canvasDom === null || canvasDom === void 0 ? void 0 : canvasDom.tagName) !== "CANVAS") {
138
138
  canvas = canvasDom === null || canvasDom === void 0 ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
139
139
  }
140
+ if (!canvas)
141
+ return;
140
142
  canvas.width = state.displayWidth;
141
143
  canvas.height = state.displayHeight;
142
144
  const ctx = canvas.getContext("2d");
@@ -61,6 +61,7 @@ class FormStore {
61
61
  item.entity.onStoreChange("update");
62
62
  }
63
63
  });
64
+ this.validateFields();
64
65
  };
65
66
  this.setCallback = (callback) => {
66
67
  this.callbacks = Object.assign(Object.assign({}, this.callbacks), callback);
@@ -9,11 +9,11 @@ import InnerSwiper from "./Swiper.js";
9
9
  import { S as SwiperItem } from "./swiperitem.taro-DeiNSrJV.js";
10
10
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
11
11
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
12
- const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { images: [], videos: [], visible: false, autoPlay: false, defaultValue: 1, closeOnContentClick: false, indicator: false, indicatorColor: "#fff", closeIcon: false, closeIconPosition: "top-right", showMenuByLongpress: false, onChange: (value) => {
12
+ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { images: [], videos: [], visible: false, autoPlay: false, defaultValue: 1, closeOnContentClick: false, pagination: true, indicator: false, indicatorColor: "#fff", closeIcon: false, closeIconPosition: "top-right", showMenuByLongpress: false, onChange: (value) => {
13
13
  }, onClose: () => {
14
14
  } });
15
15
  const ImagePreview = (props) => {
16
- const { value, className, style, images, videos, visible, defaultValue, indicatorColor, indicator, autoPlay, closeOnContentClick, closeIcon, closeIconPosition, showMenuByLongpress, onClose, onChange } = Object.assign(Object.assign({}, defaultProps), props);
16
+ const { value, className, style, images, videos, visible, defaultValue, indicatorColor, pagination, indicator, autoPlay, closeOnContentClick, closeIcon, closeIconPosition, showMenuByLongpress, onClose, onChange } = Object.assign(Object.assign({}, defaultProps), props);
17
17
  const classPrefix = "nut-imagepreview";
18
18
  const ref = useRef(null);
19
19
  const [innerNo, setInnerNo] = usePropsValue({
@@ -159,13 +159,13 @@ const ImagePreview = (props) => {
159
159
  return React__default.createElement(SwiperItem, { key: index, className: "nut-imagepreview-swiper-item" }, Taro.getEnv() === "WEB" ? React__default.createElement(Image, { src: item.src, mode: "aspectFit" }) : React__default.createElement(Image, { src: item.src, mode: "aspectFit", showMenuByLongpress: !!showMenuByLongpress }));
160
160
  }) : []))
161
161
  ),
162
- React__default.createElement(
162
+ pagination ? React__default.createElement(
163
163
  "div",
164
164
  { className: `${classPrefix}-index` },
165
165
  active,
166
166
  "/",
167
167
  (images ? images.length : 0) + (videos ? videos.length : 0)
168
- ),
168
+ ) : null,
169
169
  closeIcon !== false ? React__default.createElement("div", { className: `${classPrefix}-close ${closeIconPosition}`, onClick: onCloseInner }, closeIcon === true ? React__default.createElement(Close, null) : closeIcon) : null
170
170
  );
171
171
  };
@@ -32,7 +32,7 @@ import { C as C8 } from "./cascader.taro-y9_hSUSJ.js";
32
32
  import { C as C9, a as a2 } from "./checkbox.taro-Dc054oRo.js";
33
33
  import { D as D2 } from "./datepicker.taro-DTyJrlhD.js";
34
34
  import { default as default2 } from "./Form.js";
35
- import { F as F2 } from "./formitem.taro-tLWeQ0P5.js";
35
+ import { F as F2 } from "./formitem.taro-BsnxUebv.js";
36
36
  import { I as I2 } from "./input.taro-B_B1lJq2.js";
37
37
  import { I as I3 } from "./inputnumber.taro-WN5Drnyz.js";
38
38
  import { M } from "./menu.taro-JDg_-XpO.js";
@@ -47,7 +47,7 @@ import { S as S8 } from "./shortpassword.taro-DpdtRsQ-.js";
47
47
  import { S as S9 } from "./signature.taro-zgwaJkIE.js";
48
48
  import { S as S10 } from "./switch.taro-CdBmDo18.js";
49
49
  import { T as T5 } from "./textarea.taro-DuceTjAx.js";
50
- import { U } from "./uploader.taro-E6R-Ow7M.js";
50
+ import { U } from "./uploader.taro-CiamsRGo.js";
51
51
  import { A as A2 } from "./actionsheet.taro-CJjNsNrH.js";
52
52
  import { B as B3 } from "./badge.taro-BGaxpEYi.js";
53
53
  import { B as B4 } from "./dialog.taro-BW9D2Gsr.js";
@@ -73,7 +73,7 @@ import { C as C11 } from "./collapse.taro-wqL6MWZr.js";
73
73
  import { C as C12 } from "./collapseitem.taro-DjUx5Nx8.js";
74
74
  import { C as C13 } from "./countdown.taro-mKXeisK0.js";
75
75
  import { E as E3 } from "./ellipsis.taro-cMTr1Wcw.js";
76
- import { I as I5 } from "./imagepreview.taro-B7eJN5Hn.js";
76
+ import { I as I5 } from "./imagepreview.taro-BLXFYocO.js";
77
77
  import { I as I6 } from "./indicator.taro-k8bxJf86.js";
78
78
  import { P as P5 } from "./pagination.taro-DdLO3OTc.js";
79
79
  import { P as P6 } from "./price.taro-DUW-OR83.js";
@@ -93,7 +93,7 @@ import { T as T10 } from "./timedetail.taro-ya5JNy2L.js";
93
93
  import { T as T11 } from "./timeselect.taro-DncKbp3l.js";
94
94
  import { T as T12 } from "./trendarrow.taro-DKx5cGIh.js";
95
95
  import { W } from "./watermark.taro-BR12yZQt.js";
96
- import { A as A7 } from "./avatarcropper.taro-R3OfWq1H.js";
96
+ import { A as A7 } from "./avatarcropper.taro-CAVcFvKC.js";
97
97
  export {
98
98
  A2 as ActionSheet,
99
99
  A as Address,
@@ -231,8 +231,7 @@ const InternalUploader = (props, ref) => {
231
231
  setUploadQueue(uploadQueue);
232
232
  } else {
233
233
  setUploadQueue([]);
234
- fileList.splice(0, fileList.length);
235
- setFileList([...fileList]);
234
+ setFileList([]);
236
235
  }
237
236
  };
238
237
  const _chooseImage = () => {
@@ -252,7 +251,7 @@ const InternalUploader = (props, ref) => {
252
251
  document.body.appendChild(obj);
253
252
  }
254
253
  }
255
- if (getEnv() === "WEAPP" && chooseMedia) {
254
+ if ((getEnv() === "WEAPP" || getEnv() === "JD") && chooseMedia) {
256
255
  chooseMedia({
257
256
  /** 最多可以选择的文件个数 */
258
257
  count: multiple ? maxCount * 1 - fileList.length : 1,
@@ -398,8 +397,7 @@ const InternalUploader = (props, ref) => {
398
397
  if (preview) {
399
398
  fileItem.url = fileType === "video" ? file.thumbTempFilePath : filepath;
400
399
  }
401
- fileList.push(fileItem);
402
- setFileList(fileList);
400
+ setFileList([...fileList, fileItem]);
403
401
  executeUpload(fileItem, index);
404
402
  });
405
403
  };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:48 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:21 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -3385,6 +3385,19 @@ function getScrollParent(el, root2 = defaultRoot) {
3385
3385
  }
3386
3386
  return root2;
3387
3387
  }
3388
+ let passiveSupported = false;
3389
+ if (canUseDom) {
3390
+ try {
3391
+ const opts = Object.defineProperty({}, "passive", {
3392
+ get() {
3393
+ passiveSupported = true;
3394
+ }
3395
+ });
3396
+ window.addEventListener("test-passive-supported", null, opts);
3397
+ } catch (e2) {
3398
+ console.log(e2);
3399
+ }
3400
+ }
3388
3401
  let totalLockCount = 0;
3389
3402
  const BODY_LOCK_CLASS = "nut-overflow-hidden";
3390
3403
  function getScrollableElement(el) {
@@ -3432,7 +3445,7 @@ function useLockScroll(rootRef, shouldLock) {
3432
3445
  document.addEventListener(
3433
3446
  "touchmove",
3434
3447
  onTouchMove,
3435
- false
3448
+ passiveSupported ? { passive: false } : false
3436
3449
  );
3437
3450
  if (!totalLockCount) {
3438
3451
  document.body.classList.add(BODY_LOCK_CLASS);
@@ -7963,7 +7976,7 @@ const InternalPickerPanel = (props, ref) => {
7963
7976
  moving: moving.current
7964
7977
  }));
7965
7978
  useEffect(() => {
7966
- const eventOptions = false;
7979
+ const eventOptions = passiveSupported ? { passive: false, once: true } : false;
7967
7980
  const element = pickerPanelRef.current;
7968
7981
  element.addEventListener("touchstart", touchStart, eventOptions);
7969
7982
  element.addEventListener("touchmove", touchMove, eventOptions);
@@ -9801,6 +9814,7 @@ class FormStore {
9801
9814
  item.entity.onStoreChange("update");
9802
9815
  }
9803
9816
  });
9817
+ this.validateFields();
9804
9818
  };
9805
9819
  this.setCallback = (callback) => {
9806
9820
  this.callbacks = {
@@ -12874,8 +12888,7 @@ const InternalUploader = (props, ref) => {
12874
12888
  setUploadQueue(uploadQueue);
12875
12889
  } else {
12876
12890
  setUploadQueue([]);
12877
- fileList.splice(0, fileList.length);
12878
- setFileList([...fileList]);
12891
+ setFileList([]);
12879
12892
  }
12880
12893
  };
12881
12894
  const _chooseImage = () => {
@@ -12898,7 +12911,7 @@ const InternalUploader = (props, ref) => {
12898
12911
  document.body.appendChild(obj);
12899
12912
  }
12900
12913
  }
12901
- if (getEnv() === "WEAPP" && chooseMedia) {
12914
+ if ((getEnv() === "WEAPP" || getEnv() === "JD") && chooseMedia) {
12902
12915
  chooseMedia({
12903
12916
  /** 最多可以选择的文件个数 */
12904
12917
  count: multiple ? maxCount * 1 - fileList.length : 1,
@@ -13050,8 +13063,7 @@ const InternalUploader = (props, ref) => {
13050
13063
  if (preview) {
13051
13064
  fileItem.url = fileType === "video" ? file.thumbTempFilePath : filepath;
13052
13065
  }
13053
- fileList.push(fileItem);
13054
- setFileList(fileList);
13066
+ setFileList([...fileList, fileItem]);
13055
13067
  executeUpload(fileItem, index);
13056
13068
  });
13057
13069
  };
@@ -16794,6 +16806,7 @@ const defaultProps$g = {
16794
16806
  autoPlay: false,
16795
16807
  defaultValue: 1,
16796
16808
  closeOnContentClick: false,
16809
+ pagination: true,
16797
16810
  indicator: false,
16798
16811
  indicatorColor: "#fff",
16799
16812
  closeIcon: false,
@@ -16814,6 +16827,7 @@ const ImagePreview = (props) => {
16814
16827
  visible,
16815
16828
  defaultValue,
16816
16829
  indicatorColor,
16830
+ pagination,
16817
16831
  indicator,
16818
16832
  autoPlay,
16819
16833
  closeOnContentClick,
@@ -17035,7 +17049,7 @@ const ImagePreview = (props) => {
17035
17049
  )
17036
17050
  )
17037
17051
  ),
17038
- /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)),
17052
+ pagination ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)) : null,
17039
17053
  closeIcon !== false ? /* @__PURE__ */ React__default.createElement(
17040
17054
  "div",
17041
17055
  {
@@ -18861,6 +18875,7 @@ const AvatarCropper = (props) => {
18861
18875
  if ((canvasDom == null ? void 0 : canvasDom.tagName) !== "CANVAS") {
18862
18876
  canvas = canvasDom == null ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
18863
18877
  }
18878
+ if (!canvas) return;
18864
18879
  canvas.width = state.displayWidth;
18865
18880
  canvas.height = state.displayHeight;
18866
18881
  const ctx = canvas.getContext("2d");
@@ -2,7 +2,7 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("@tarojs/taro"), require("@tarojs/components"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "@tarojs/taro", "@tarojs/components", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.Taro, global2.components, global2.ReactDOM));
3
3
  })(this, function(exports2, React, Taro, components, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react-taro v2.6.11 Fri Jun 28 2024 14:38:04 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react-taro v2.6.12 Fri Jul 05 2024 14:50:21 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -3401,6 +3401,19 @@
3401
3401
  }
3402
3402
  return root2;
3403
3403
  }
3404
+ let passiveSupported = false;
3405
+ if (canUseDom) {
3406
+ try {
3407
+ const opts = Object.defineProperty({}, "passive", {
3408
+ get() {
3409
+ passiveSupported = true;
3410
+ }
3411
+ });
3412
+ window.addEventListener("test-passive-supported", null, opts);
3413
+ } catch (e2) {
3414
+ console.log(e2);
3415
+ }
3416
+ }
3404
3417
  let totalLockCount = 0;
3405
3418
  const BODY_LOCK_CLASS = "nut-overflow-hidden";
3406
3419
  function getScrollableElement(el) {
@@ -3448,7 +3461,7 @@
3448
3461
  document.addEventListener(
3449
3462
  "touchmove",
3450
3463
  onTouchMove,
3451
- false
3464
+ passiveSupported ? { passive: false } : false
3452
3465
  );
3453
3466
  if (!totalLockCount) {
3454
3467
  document.body.classList.add(BODY_LOCK_CLASS);
@@ -7979,7 +7992,7 @@
7979
7992
  moving: moving.current
7980
7993
  }));
7981
7994
  React.useEffect(() => {
7982
- const eventOptions = false;
7995
+ const eventOptions = passiveSupported ? { passive: false, once: true } : false;
7983
7996
  const element = pickerPanelRef.current;
7984
7997
  element.addEventListener("touchstart", touchStart, eventOptions);
7985
7998
  element.addEventListener("touchmove", touchMove, eventOptions);
@@ -9817,6 +9830,7 @@
9817
9830
  item.entity.onStoreChange("update");
9818
9831
  }
9819
9832
  });
9833
+ this.validateFields();
9820
9834
  };
9821
9835
  this.setCallback = (callback) => {
9822
9836
  this.callbacks = {
@@ -12890,8 +12904,7 @@
12890
12904
  setUploadQueue(uploadQueue);
12891
12905
  } else {
12892
12906
  setUploadQueue([]);
12893
- fileList.splice(0, fileList.length);
12894
- setFileList([...fileList]);
12907
+ setFileList([]);
12895
12908
  }
12896
12909
  };
12897
12910
  const _chooseImage = () => {
@@ -12914,7 +12927,7 @@
12914
12927
  document.body.appendChild(obj);
12915
12928
  }
12916
12929
  }
12917
- if (Taro.getEnv() === "WEAPP" && Taro.chooseMedia) {
12930
+ if ((Taro.getEnv() === "WEAPP" || Taro.getEnv() === "JD") && Taro.chooseMedia) {
12918
12931
  Taro.chooseMedia({
12919
12932
  /** 最多可以选择的文件个数 */
12920
12933
  count: multiple ? maxCount * 1 - fileList.length : 1,
@@ -13066,8 +13079,7 @@
13066
13079
  if (preview) {
13067
13080
  fileItem.url = fileType === "video" ? file.thumbTempFilePath : filepath;
13068
13081
  }
13069
- fileList.push(fileItem);
13070
- setFileList(fileList);
13082
+ setFileList([...fileList, fileItem]);
13071
13083
  executeUpload(fileItem, index);
13072
13084
  });
13073
13085
  };
@@ -16810,6 +16822,7 @@
16810
16822
  autoPlay: false,
16811
16823
  defaultValue: 1,
16812
16824
  closeOnContentClick: false,
16825
+ pagination: true,
16813
16826
  indicator: false,
16814
16827
  indicatorColor: "#fff",
16815
16828
  closeIcon: false,
@@ -16830,6 +16843,7 @@
16830
16843
  visible,
16831
16844
  defaultValue,
16832
16845
  indicatorColor,
16846
+ pagination,
16833
16847
  indicator,
16834
16848
  autoPlay,
16835
16849
  closeOnContentClick,
@@ -17051,7 +17065,7 @@
17051
17065
  )
17052
17066
  )
17053
17067
  ),
17054
- /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)),
17068
+ pagination ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)) : null,
17055
17069
  closeIcon !== false ? /* @__PURE__ */ React.createElement(
17056
17070
  "div",
17057
17071
  {
@@ -18877,6 +18891,7 @@
18877
18891
  if ((canvasDom == null ? void 0 : canvasDom.tagName) !== "CANVAS") {
18878
18892
  canvas = canvasDom == null ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
18879
18893
  }
18894
+ if (!canvas) return;
18880
18895
  canvas.width = state.displayWidth;
18881
18896
  canvas.height = state.displayHeight;
18882
18897
  const ctx = canvas.getContext("2d");
@@ -0,0 +1,2 @@
1
+ import { FormInstance, NamePath } from './types';
2
+ export declare function useWatch(namePath: NamePath, form: FormInstance): undefined;
@@ -6,7 +6,7 @@ export interface FormItemRuleWithoutValidator {
6
6
  message?: string;
7
7
  }
8
8
  export interface FormItemRule extends FormItemRuleWithoutValidator {
9
- validator?: (ruleCfg: FormItemRuleWithoutValidator, value: string) => boolean | string | Promise<boolean | string>;
9
+ validator?: (ruleCfg: FormItemRuleWithoutValidator, value: any) => boolean | string | Promise<boolean | string>;
10
10
  }
11
11
  export interface BaseFormField {
12
12
  /**
@@ -20,6 +20,7 @@ export interface ImagePreviewProps extends BasicComponent {
20
20
  value?: number;
21
21
  defaultValue: number;
22
22
  closeOnContentClick: boolean;
23
+ pagination: boolean;
23
24
  indicator: boolean;
24
25
  indicatorColor: string;
25
26
  closeIcon: boolean | ReactNode;
@@ -49,6 +49,11 @@ export interface ImagePreviewProps extends BasicComponent {
49
49
  */
50
50
  closeOnContentClick: boolean
51
51
  /**
52
+ * 分页是否展示
53
+ * @default true
54
+ */
55
+ pagination: boolean
56
+ /**
52
57
  * 分页指示器是否展示
53
58
  * @default false
54
59
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "2.6.11",
3
+ "version": "2.6.12",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",