@nutui/nutui-react 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
 
@@ -8,11 +8,11 @@ import Swiper__default from "./Swiper.js";
8
8
  import SwiperItem__default from "./SwiperItem.js";
9
9
  import { C as ComponentDefaults } from "./typings.js";
10
10
  import { u as usePropsValue } from "./use-props-value.js";
11
- const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { images: [], videos: [], visible: false, autoPlay: 3e3, defaultValue: 0, closeOnContentClick: false, indicator: false, indicatorColor: "#fff", closeIcon: false, closeIconPosition: "top-right", onChange: (value) => {
11
+ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { images: [], videos: [], visible: false, autoPlay: 3e3, defaultValue: 0, closeOnContentClick: false, pagination: true, indicator: false, indicatorColor: "#fff", closeIcon: false, closeIconPosition: "top-right", onChange: (value) => {
12
12
  }, onClose: () => {
13
13
  } });
14
14
  const ImagePreview = (props) => {
15
- const { value, className, style, images, videos, visible, defaultValue, indicatorColor, indicator, autoPlay, closeOnContentClick, closeIcon, closeIconPosition, onClose, onChange } = Object.assign(Object.assign({}, defaultProps), props);
15
+ const { value, className, style, images, videos, visible, defaultValue, indicatorColor, pagination, indicator, autoPlay, closeOnContentClick, closeIcon, closeIconPosition, onClose, onChange } = Object.assign(Object.assign({}, defaultProps), props);
16
16
  const classPrefix = "nut-imagepreview";
17
17
  const ref = useRef(null);
18
18
  const [innerNo, setInnerNo] = usePropsValue({
@@ -156,13 +156,13 @@ const ImagePreview = (props) => {
156
156
  React__default.createElement(Image__default, { src: item.src, draggable: false })
157
157
  );
158
158
  }) : [])) : null),
159
- React__default.createElement(
159
+ pagination ? React__default.createElement(
160
160
  "div",
161
161
  { className: `${classPrefix}-index` },
162
162
  active,
163
163
  "/",
164
164
  (images ? images.length : 0) + (videos ? videos.length : 0)
165
- ),
165
+ ) : null,
166
166
  closeIcon !== false ? React__default.createElement("div", { className: `${classPrefix}-close ${closeIconPosition}`, onClick: onCloseInner }, closeIcon === true ? React__default.createElement(Close, null) : closeIcon) : null
167
167
  );
168
168
  };
@@ -188,8 +188,7 @@ const InternalUploader = (props, ref) => {
188
188
  setUploadQueue(uploadQueue);
189
189
  } else {
190
190
  setUploadQueue([]);
191
- fileList.splice(0, fileList.length);
192
- setFileList([...fileList]);
191
+ setFileList([]);
193
192
  }
194
193
  };
195
194
  const clearInputValue = (el) => {
@@ -296,13 +295,11 @@ const InternalUploader = (props, ref) => {
296
295
  const reader = new FileReader();
297
296
  reader.onload = (event) => {
298
297
  fileItem.url = event.target.result;
299
- fileList.push(fileItem);
300
- setFileList([...fileList]);
298
+ setFileList([...fileList, fileItem]);
301
299
  };
302
300
  reader.readAsDataURL(file);
303
301
  } else {
304
- fileList.push(fileItem);
305
- setFileList([...fileList]);
302
+ setFileList([...fileList, fileItem]);
306
303
  }
307
304
  });
308
305
  };
@@ -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);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:19:08 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:45 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 v2.6.11 Fri Jun 28 2024 15:18:39 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:13 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -13703,6 +13703,7 @@ class FormStore {
13703
13703
  item.entity.onStoreChange("update");
13704
13704
  }
13705
13705
  });
13706
+ this.validateFields();
13706
13707
  };
13707
13708
  this.setCallback = (callback) => {
13708
13709
  this.callbacks = {
@@ -16695,8 +16696,7 @@ const InternalUploader = (props, ref) => {
16695
16696
  setUploadQueue(uploadQueue);
16696
16697
  } else {
16697
16698
  setUploadQueue([]);
16698
- fileList.splice(0, fileList.length);
16699
- setFileList([...fileList]);
16699
+ setFileList([]);
16700
16700
  }
16701
16701
  };
16702
16702
  const clearInputValue = (el) => {
@@ -16809,13 +16809,11 @@ const InternalUploader = (props, ref) => {
16809
16809
  const reader = new FileReader();
16810
16810
  reader.onload = (event) => {
16811
16811
  fileItem.url = event.target.result;
16812
- fileList.push(fileItem);
16813
- setFileList([...fileList]);
16812
+ setFileList([...fileList, fileItem]);
16814
16813
  };
16815
16814
  reader.readAsDataURL(file);
16816
16815
  } else {
16817
- fileList.push(fileItem);
16818
- setFileList([...fileList]);
16816
+ setFileList([...fileList, fileItem]);
16819
16817
  }
16820
16818
  });
16821
16819
  };
@@ -20951,6 +20949,7 @@ const defaultProps$f = {
20951
20949
  autoPlay: 3e3,
20952
20950
  defaultValue: 0,
20953
20951
  closeOnContentClick: false,
20952
+ pagination: true,
20954
20953
  indicator: false,
20955
20954
  indicatorColor: "#fff",
20956
20955
  closeIcon: false,
@@ -20970,6 +20969,7 @@ const ImagePreview = (props) => {
20970
20969
  visible,
20971
20970
  defaultValue,
20972
20971
  indicatorColor,
20972
+ pagination,
20973
20973
  indicator,
20974
20974
  autoPlay,
20975
20975
  closeOnContentClick,
@@ -21158,7 +21158,7 @@ const ImagePreview = (props) => {
21158
21158
  )
21159
21159
  ) : null
21160
21160
  ),
21161
- /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)),
21161
+ pagination ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)) : null,
21162
21162
  closeIcon !== false ? /* @__PURE__ */ React__default.createElement(
21163
21163
  "div",
21164
21164
  {
@@ -2,7 +2,7 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.nutui = {}, global2.React, global2.ReactDOM));
3
3
  })(this, function(exports2, React, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react v2.6.11 Fri Jun 28 2024 15:18:39 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react v2.6.12 Fri Jul 05 2024 14:48:13 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -13721,6 +13721,7 @@
13721
13721
  item.entity.onStoreChange("update");
13722
13722
  }
13723
13723
  });
13724
+ this.validateFields();
13724
13725
  };
13725
13726
  this.setCallback = (callback) => {
13726
13727
  this.callbacks = {
@@ -16713,8 +16714,7 @@
16713
16714
  setUploadQueue(uploadQueue);
16714
16715
  } else {
16715
16716
  setUploadQueue([]);
16716
- fileList.splice(0, fileList.length);
16717
- setFileList([...fileList]);
16717
+ setFileList([]);
16718
16718
  }
16719
16719
  };
16720
16720
  const clearInputValue = (el) => {
@@ -16827,13 +16827,11 @@
16827
16827
  const reader = new FileReader();
16828
16828
  reader.onload = (event) => {
16829
16829
  fileItem.url = event.target.result;
16830
- fileList.push(fileItem);
16831
- setFileList([...fileList]);
16830
+ setFileList([...fileList, fileItem]);
16832
16831
  };
16833
16832
  reader.readAsDataURL(file);
16834
16833
  } else {
16835
- fileList.push(fileItem);
16836
- setFileList([...fileList]);
16834
+ setFileList([...fileList, fileItem]);
16837
16835
  }
16838
16836
  });
16839
16837
  };
@@ -20969,6 +20967,7 @@
20969
20967
  autoPlay: 3e3,
20970
20968
  defaultValue: 0,
20971
20969
  closeOnContentClick: false,
20970
+ pagination: true,
20972
20971
  indicator: false,
20973
20972
  indicatorColor: "#fff",
20974
20973
  closeIcon: false,
@@ -20988,6 +20987,7 @@
20988
20987
  visible,
20989
20988
  defaultValue,
20990
20989
  indicatorColor,
20990
+ pagination,
20991
20991
  indicator,
20992
20992
  autoPlay,
20993
20993
  closeOnContentClick,
@@ -21176,7 +21176,7 @@
21176
21176
  )
21177
21177
  ) : null
21178
21178
  ),
21179
- /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)),
21179
+ pagination ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)) : null,
21180
21180
  closeIcon !== false ? /* @__PURE__ */ React.createElement(
21181
21181
  "div",
21182
21182
  {
@@ -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
  /**
@@ -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
  */
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
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",