@nutui/nutui-react 2.6.3 → 2.6.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v2.6.4
2
+ `2024-05-10`
3
+
4
+
5
+ *🏡 chore: 修改默认的微信基础库版本 (#2235) @eiinu
6
+ *🏡 chore(image): demo代码风格优化 (#2220) @Alex-huxiyang
7
+ * 📖 docs(uploader): 文件上传编码使用提示 (#2224) @Alex-huxiyang
8
+ * :bug: fix(imagePreview): 阻止关闭预览事件对父结构的非必要影响 (#2227) @Alex-huxiyang
9
+ * :bug: fix(picker): 修复连续多次打开 picker 时显示值错误 (#2222) @eiinu
10
+ * :bug: fix(virtualList): 修复部分场景onScroll不触发 (#2221) @Alex-huxiyang
11
+ * :bug: fix: 移除 defaultProps (#2230) @eiinu
12
+
13
+
1
14
  # v2.6.3
2
15
  `2024-04-30`
3
16
 
@@ -87,7 +87,6 @@ const BackTop = (props) => {
87
87
  goTop(e);
88
88
  } }, children || React__default.createElement(Top, { width: 19, height: 19, className: "nut-backtop-main" }));
89
89
  };
90
- BackTop.defaultProps = defaultProps;
91
90
  BackTop.displayName = "NutBackTop";
92
91
  export {
93
92
  BackTop as default
package/dist/esm/Cell.js CHANGED
@@ -34,7 +34,6 @@ const Cell = (props) => {
34
34
  (ctx === null || ctx === void 0 ? void 0 : ctx.divider) ? React__default.createElement("div", { className: `${classPrefix}-divider` }) : null
35
35
  );
36
36
  };
37
- Cell.defaultProps = defaultProps;
38
37
  Cell.displayName = "NutCell";
39
38
  Cell.Group = CellGroup__default;
40
39
  export {
@@ -19,7 +19,6 @@ const CellGroup = (props) => {
19
19
  )
20
20
  );
21
21
  };
22
- CellGroup.defaultProps = defaultProps;
23
22
  CellGroup.displayName = "NutCellGroup";
24
23
  export {
25
24
  CellGroup as default
package/dist/esm/Col.js CHANGED
@@ -26,7 +26,6 @@ const Col = (props) => {
26
26
  onClick && onClick(e, "col");
27
27
  } }, children);
28
28
  };
29
- Col.defaultProps = defaultProps;
30
29
  Col.displayName = "NutCol";
31
30
  export {
32
31
  Col as default
@@ -18,7 +18,6 @@ const Divider = (props) => {
18
18
  });
19
19
  return React__default.createElement("div", Object.assign({ className: `${classes} ${className || ""}`, style }, rest), children);
20
20
  };
21
- Divider.defaultProps = defaultProps;
22
21
  Divider.displayName = "NutDivider";
23
22
  export {
24
23
  Divider as default
@@ -173,7 +173,6 @@ const Elevator = (props) => {
173
173
  ) : null
174
174
  );
175
175
  };
176
- Elevator.defaultProps = defaultProps;
177
176
  Elevator.displayName = "NutElevator";
178
177
  Elevator.Context = elevatorContext;
179
178
  export {
@@ -43,7 +43,6 @@ const FixedNav = (props) => {
43
43
  ))
44
44
  );
45
45
  };
46
- FixedNav.defaultProps = defaultProps;
47
46
  FixedNav.displayName = "NutFixedNav";
48
47
  export {
49
48
  FixedNav as default
package/dist/esm/Grid.js CHANGED
@@ -46,7 +46,6 @@ const Grid = (props) => {
46
46
  }))
47
47
  );
48
48
  };
49
- Grid.defaultProps = defaultProps;
50
49
  Grid.displayName = "NutGrid";
51
50
  Grid.Item = GridItem;
52
51
  export {
package/dist/esm/Image.js CHANGED
@@ -6,7 +6,7 @@ import { p as pxCheck } from "./px-check.js";
6
6
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { fit: "fill", position: "center", alt: "", width: "", height: "", error: true, loading: true, lazy: false });
7
7
  const classPrefix = "nut-image";
8
8
  const Image = (props) => {
9
- const { className, style, src, fit, position, alt, width, height, radius, error, loading, lazy, onClick, onLoad, onError } = Object.assign(Object.assign({}, defaultProps), props);
9
+ const { className, style, src, fit, position, alt, width, height, radius, error, loading, lazy, draggable, onClick, onLoad, onError } = Object.assign(Object.assign({}, defaultProps), props);
10
10
  const [innerLoading, setInnerLoading] = useState(false);
11
11
  const [isError, setIsError] = useState(false);
12
12
  const [complete, setComplete] = useState(false);
@@ -114,12 +114,11 @@ const Image = (props) => {
114
114
  { className: classNames(classPrefix, className), style: containerStyle, onClick: (e) => {
115
115
  imageClick(e);
116
116
  } },
117
- lazy ? React__default.createElement("img", { ref: imgRef, className: "nut-img lazyload", style: imgStyle, "data-src": src, alt, loading: "lazy", onLoad: handleLoad, onError: handleError, draggable: props.draggable }) : React__default.createElement("img", { ref: imgRef, className: "nut-img", style: imgStyle, src, alt, onLoad: handleLoad, onError: handleError, draggable: props.draggable }),
117
+ lazy ? React__default.createElement("img", { ref: imgRef, className: "nut-img lazyload", style: imgStyle, "data-src": src, alt, loading: "lazy", onLoad: handleLoad, onError: handleError, draggable }) : React__default.createElement("img", { ref: imgRef, className: "nut-img", style: imgStyle, src, alt, onLoad: handleLoad, onError: handleError, draggable }),
118
118
  renderLoading(),
119
119
  renderErrorImg()
120
120
  );
121
121
  };
122
- Image.defaultProps = defaultProps;
123
122
  Image.displayName = "NutImage";
124
123
  export {
125
124
  Image as default
@@ -125,16 +125,17 @@ const ImagePreview = (props) => {
125
125
  setActive(page + 1);
126
126
  (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, page + 1);
127
127
  };
128
- const onCloseInner = () => {
128
+ const onCloseInner = (e) => {
129
+ e.stopPropagation();
129
130
  setShowPop(false);
130
131
  setActive(innerNo);
131
132
  scaleNow();
132
133
  onClose && onClose();
133
134
  setStore(Object.assign(Object.assign({}, store), { scale: 1 }));
134
135
  };
135
- const closeOnImg = () => {
136
+ const closeOnImg = (e) => {
136
137
  if (closeOnContentClick) {
137
- onCloseInner();
138
+ onCloseInner(e);
138
139
  }
139
140
  };
140
141
  const duration = typeof autoPlay === "string" ? parseInt(autoPlay) : autoPlay;
@@ -79,7 +79,6 @@ const NavBar = (props) => {
79
79
  const cls = classNames(classPrefix, classes, className);
80
80
  return React__default.createElement(React__default.Fragment, null, fixed && placeholder ? React__default.createElement("div", { className: `${classPrefix}-placeholder` }, renderWrapper()) : renderWrapper());
81
81
  };
82
- NavBar.defaultProps = defaultProps;
83
82
  NavBar.displayName = "NutNavBar";
84
83
  export {
85
84
  NavBar as default
package/dist/esm/Row.js CHANGED
@@ -25,7 +25,6 @@ const Row = (props) => {
25
25
  }
26
26
  }, children));
27
27
  };
28
- Row.defaultProps = defaultProps;
29
28
  Row.displayName = "NutRow";
30
29
  export {
31
30
  Row as default
@@ -7,8 +7,8 @@ import { C as ComponentDefaults } from "./typings.js";
7
7
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { position: "left", width: "80%" });
8
8
  const SideNavBar = (props) => {
9
9
  const classPrefix = "nut-sidenavbar";
10
- const _a = Object.assign(Object.assign({}, defaultProps), props), { title, visible, width, position, children, className, onClose } = _a, rest = __rest(_a, ["title", "visible", "width", "position", "children", "className", "onClose"]);
11
- const indent = props.indent ? Number(props.indent) : 20;
10
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { title, visible, width, position, children, className, onClose, indent } = _a, rest = __rest(_a, ["title", "visible", "width", "position", "children", "className", "onClose", "indent"]);
11
+ const innerIndent = indent ? Number(indent) : 20;
12
12
  return React__default.createElement(
13
13
  Popup__default,
14
14
  { visible, style: { width, height: "100%" }, position, onClose },
@@ -23,14 +23,14 @@ const SideNavBar = (props) => {
23
23
  { className: `${classPrefix}-list sidenavbar-show`, onClick: handleClick },
24
24
  React__default.createElement(
25
25
  "div",
26
- { className: `${classPrefix}-title ${classPrefix}-border-bt`, style: { paddingLeft: `${indent}px` } },
26
+ { className: `${classPrefix}-title ${classPrefix}-border-bt`, style: { paddingLeft: `${innerIndent}px` } },
27
27
  title,
28
28
  " ",
29
29
  React__default.createElement("i", { className: "arrow-icon arrow-down" })
30
30
  ),
31
31
  React__default.createElement(
32
32
  OffsetContext.Provider,
33
- { value: indent },
33
+ { value: innerIndent },
34
34
  React__default.createElement("div", { className: `${classPrefix}-content` }, children)
35
35
  )
36
36
  )
@@ -38,7 +38,6 @@ const SideNavBar = (props) => {
38
38
  )
39
39
  );
40
40
  };
41
- SideNavBar.defaultProps = defaultProps;
42
41
  SideNavBar.displayName = "NutSideNavBar";
43
42
  export {
44
43
  SideNavBar as default
package/dist/esm/Space.js CHANGED
@@ -11,7 +11,6 @@ const Space = (props) => {
11
11
  return child !== null && child !== void 0 && React__default.createElement("div", { className: `${prefixCls}-item` }, child);
12
12
  }));
13
13
  };
14
- Space.defaultProps = defaultProps;
15
14
  Space.displayName = "NutSpace";
16
15
  export {
17
16
  Space as default
@@ -131,7 +131,6 @@ const Sticky = (props) => {
131
131
  React__default.createElement("div", { className: "nut-sticky-box", ref: stickyRef, style: stickyStyle }, children)
132
132
  );
133
133
  };
134
- Sticky.defaultProps = defaultProps;
135
134
  Sticky.displayName = "NutSticky";
136
135
  export {
137
136
  Sticky as default
@@ -36,7 +36,6 @@ const Tabbar = (props) => {
36
36
  (fixed || safeArea) && React__default.createElement("div", { className: `${classPrefix}-safe-area` })
37
37
  );
38
38
  };
39
- Tabbar.defaultProps = defaultProps;
40
39
  Tabbar.displayName = "NutTabbar";
41
40
  Tabbar.Item = TabbarItem;
42
41
  export {
@@ -69,7 +69,6 @@ const GridItem = (props) => {
69
69
  )
70
70
  );
71
71
  };
72
- GridItem.defaultProps = defaultProps;
73
72
  GridItem.displayName = "NutGridItem";
74
73
  export {
75
74
  GridItem as G,
@@ -87,7 +87,7 @@ const Overlay = (props) => {
87
87
  setInnerVisible(false);
88
88
  }
89
89
  }, [visible]);
90
- useLockScroll(nodeRef, !!props.lockScroll && innerVisible);
90
+ useLockScroll(nodeRef, !!lockScroll && innerVisible);
91
91
  const classes = classNames(classPrefix, className);
92
92
  const styles = Object.assign({}, style);
93
93
  const handleClick = (e) => {
@@ -111,7 +111,6 @@ const Overlay = (props) => {
111
111
  )
112
112
  );
113
113
  };
114
- Overlay.defaultProps = defaultOverlayProps;
115
114
  Overlay.displayName = "NutOverlay";
116
115
  export {
117
116
  Overlay as O,
@@ -4,6 +4,7 @@ const classPrefix = "nut-safe-area";
4
4
  const SafeArea = (props) => {
5
5
  return React__default.createElement("div", { className: classNames(classPrefix, `${classPrefix}-position-${props.position}`) });
6
6
  };
7
+ SafeArea.displayName = "NutSafeArea";
7
8
  export {
8
9
  SafeArea as S
9
10
  };
package/dist/esm/tabs2.js CHANGED
@@ -11,10 +11,10 @@ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { tabSt
11
11
  const classPrefix = "nut-tabs";
12
12
  const Tabs = (props) => {
13
13
  const rtl = useRtl();
14
- const _a = Object.assign(Object.assign({}, defaultProps), props), { activeColor, tabStyle, direction, activeType, duration, align, title, children, onClick, onChange, className, autoHeight } = _a, rest = __rest(_a, ["activeColor", "tabStyle", "direction", "activeType", "duration", "align", "title", "children", "onClick", "onChange", "className", "autoHeight"]);
14
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { activeColor, tabStyle, direction, activeType, duration, align, title, children, onClick, onChange, className, autoHeight, value: outerValue, defaultValue: outerDefaultValue } = _a, rest = __rest(_a, ["activeColor", "tabStyle", "direction", "activeType", "duration", "align", "title", "children", "onClick", "onChange", "className", "autoHeight", "value", "defaultValue"]);
15
15
  const [value, setValue] = usePropsValue({
16
- value: props.value,
17
- defaultValue: props.defaultValue,
16
+ value: outerValue,
17
+ defaultValue: outerDefaultValue,
18
18
  finalValue: 0,
19
19
  onChange
20
20
  });
@@ -44,13 +44,13 @@ const Tabs = (props) => {
44
44
  }
45
45
  const title2 = titleItem[index];
46
46
  let to = 0;
47
- if (props.direction === "vertical") {
47
+ if (direction === "vertical") {
48
48
  const runTop = title2.offsetTop - nav.offsetTop + 10;
49
49
  to = runTop - (nav.offsetHeight - title2.offsetHeight) / 2;
50
50
  } else {
51
51
  to = title2.offsetLeft - (nav.offsetWidth - title2.offsetWidth) / 2;
52
52
  }
53
- scrollDirection(nav, to, immediate ? 0 : 0.3, props.direction);
53
+ scrollDirection(nav, to, immediate ? 0 : 0.3, direction);
54
54
  };
55
55
  const getTitles = () => {
56
56
  const titles2 = [];
@@ -156,7 +156,6 @@ const Tabs = (props) => {
156
156
  )
157
157
  );
158
158
  };
159
- Tabs.defaultProps = defaultProps;
160
159
  Tabs.displayName = "NutTabs";
161
160
  Tabs.TabPane = TabPane__default;
162
161
  export {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.6.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:33 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.3 Tue Apr 30 2024 14:15:24 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:06 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1242,7 +1242,6 @@ const CellGroup = (props) => {
1242
1242
  /* @__PURE__ */ React__default.createElement(CellGroupContext.Provider, { value: { divider } }, children)
1243
1243
  ));
1244
1244
  };
1245
- CellGroup.defaultProps = defaultProps$1t;
1246
1245
  CellGroup.displayName = "NutCellGroup";
1247
1246
  const defaultProps$1s = {
1248
1247
  ...ComponentDefaults,
@@ -1302,7 +1301,6 @@ const Cell = (props) => {
1302
1301
  (ctx2 == null ? void 0 : ctx2.divider) ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$q}-divider` }) : null
1303
1302
  );
1304
1303
  };
1305
- Cell.defaultProps = defaultProps$1s;
1306
1304
  Cell.displayName = "NutCell";
1307
1305
  Cell.Group = CellGroup;
1308
1306
  var INFINITY = 1 / 0;
@@ -2490,6 +2488,7 @@ const Image$1 = (props) => {
2490
2488
  error,
2491
2489
  loading,
2492
2490
  lazy,
2491
+ draggable,
2493
2492
  onClick,
2494
2493
  onLoad,
2495
2494
  onError
@@ -2618,7 +2617,7 @@ const Image$1 = (props) => {
2618
2617
  loading: "lazy",
2619
2618
  onLoad: handleLoad,
2620
2619
  onError: handleError,
2621
- draggable: props.draggable
2620
+ draggable
2622
2621
  }
2623
2622
  ) : /* @__PURE__ */ React__default.createElement(
2624
2623
  "img",
@@ -2630,14 +2629,13 @@ const Image$1 = (props) => {
2630
2629
  alt,
2631
2630
  onLoad: handleLoad,
2632
2631
  onError: handleError,
2633
- draggable: props.draggable
2632
+ draggable
2634
2633
  }
2635
2634
  ),
2636
2635
  renderLoading(),
2637
2636
  renderErrorImg()
2638
2637
  );
2639
2638
  };
2640
- Image$1.defaultProps = defaultProps$1r;
2641
2639
  Image$1.displayName = "NutImage";
2642
2640
  function _extends$4() {
2643
2641
  _extends$4 = Object.assign ? Object.assign.bind() : function(target) {
@@ -4598,7 +4596,7 @@ const Overlay = (props) => {
4598
4596
  setInnerVisible(false);
4599
4597
  }
4600
4598
  }, [visible]);
4601
- useLockScroll(nodeRef, !!props.lockScroll && innerVisible);
4599
+ useLockScroll(nodeRef, !!lockScroll && innerVisible);
4602
4600
  const classes = classNames(classPrefix2, className);
4603
4601
  const styles = {
4604
4602
  ...style
@@ -4638,7 +4636,6 @@ const Overlay = (props) => {
4638
4636
  )
4639
4637
  ));
4640
4638
  };
4641
- Overlay.defaultProps = defaultOverlayProps;
4642
4639
  Overlay.displayName = "NutOverlay";
4643
4640
  const DataContext$1 = createContext({});
4644
4641
  const defaultProps$1q = {
@@ -4681,7 +4678,6 @@ const Col = (props) => {
4681
4678
  children
4682
4679
  );
4683
4680
  };
4684
- Col.defaultProps = defaultProps$1q;
4685
4681
  Col.displayName = "NutCol";
4686
4682
  const defaultProps$1p = {
4687
4683
  ...ComponentDefaults,
@@ -4706,7 +4702,6 @@ const Divider = (props) => {
4706
4702
  });
4707
4703
  return /* @__PURE__ */ React__default.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
4708
4704
  };
4709
- Divider.defaultProps = defaultProps$1p;
4710
4705
  Divider.displayName = "NutDivider";
4711
4706
  const gridContext = {
4712
4707
  onClick: (item, index) => {
@@ -4797,7 +4792,6 @@ const GridItem = (props) => {
4797
4792
  /* @__PURE__ */ React__default.createElement("div", { className: contentClass() }, children && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children), text && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-text` }, text))
4798
4793
  );
4799
4794
  };
4800
- GridItem.defaultProps = defaultProps$1o;
4801
4795
  GridItem.displayName = "NutGridItem";
4802
4796
  const defaultProps$1n = {
4803
4797
  columns: 4,
@@ -4854,7 +4848,6 @@ const Grid = (props) => {
4854
4848
  });
4855
4849
  })));
4856
4850
  };
4857
- Grid.defaultProps = defaultProps$1n;
4858
4851
  Grid.displayName = "NutGrid";
4859
4852
  Grid.Item = GridItem;
4860
4853
  const defaultProps$1m = {};
@@ -4917,7 +4910,6 @@ const Row = (props) => {
4917
4910
  children
4918
4911
  ));
4919
4912
  };
4920
- Row.defaultProps = defaultProps$1l;
4921
4913
  Row.displayName = "NutRow";
4922
4914
  const prefixCls$1 = "nut-space";
4923
4915
  const defaultProps$1k = {
@@ -4940,7 +4932,6 @@ const Space = (props) => {
4940
4932
  return child !== null && child !== void 0 && /* @__PURE__ */ React__default.createElement("div", { className: `${prefixCls$1}-item` }, child);
4941
4933
  }));
4942
4934
  };
4943
- Space.defaultProps = defaultProps$1k;
4944
4935
  Space.displayName = "NutSpace";
4945
4936
  function isWindow(val) {
4946
4937
  return val === window;
@@ -5128,7 +5119,6 @@ const Sticky = (props) => {
5128
5119
  /* @__PURE__ */ React__default.createElement("div", { className: "nut-sticky-box", ref: stickyRef, style: stickyStyle }, children)
5129
5120
  );
5130
5121
  };
5131
- Sticky.defaultProps = defaultProps$1j;
5132
5122
  Sticky.displayName = "NutSticky";
5133
5123
  const classPrefix$k = "nut-safe-area";
5134
5124
  const SafeArea = (props) => {
@@ -5142,6 +5132,7 @@ const SafeArea = (props) => {
5142
5132
  }
5143
5133
  );
5144
5134
  };
5135
+ SafeArea.displayName = "NutSafeArea";
5145
5136
  const defaultProps$1i = {
5146
5137
  ...ComponentDefaults,
5147
5138
  target: "",
@@ -5258,7 +5249,6 @@ const BackTop = (props) => {
5258
5249
  children || /* @__PURE__ */ React__default.createElement(e$1, { width: 19, height: 19, className: "nut-backtop-main" })
5259
5250
  );
5260
5251
  };
5261
- BackTop.defaultProps = defaultProps$1i;
5262
5252
  BackTop.displayName = "NutBackTop";
5263
5253
  function clamp$2(v, min, max) {
5264
5254
  return Math.max(min, Math.min(v, max));
@@ -10578,7 +10568,6 @@ const Elevator = (props) => {
10578
10568
  })
10579
10569
  ))) : null);
10580
10570
  };
10581
- Elevator.defaultProps = defaultProps$1h;
10582
10571
  Elevator.displayName = "NutElevator";
10583
10572
  Elevator.Context = elevatorContext;
10584
10573
  const defaultProps$1g = {
@@ -10661,7 +10650,6 @@ const FixedNav = (props) => {
10661
10650
  /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-btn`, onClick: () => onUpdateValue() }, content || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(e$d, { color: "#fff" }), /* @__PURE__ */ React__default.createElement("div", { className: "text" }, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText)))
10662
10651
  );
10663
10652
  };
10664
- FixedNav.defaultProps = defaultProps$1g;
10665
10653
  FixedNav.displayName = "NutFixedNav";
10666
10654
  const defaultProps$1f = {
10667
10655
  ...ComponentDefaults,
@@ -10764,7 +10752,6 @@ const NavBar = (props) => {
10764
10752
  const cls = classNames(classPrefix2, classes, className);
10765
10753
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-placeholder` }, renderWrapper()) : renderWrapper());
10766
10754
  };
10767
- NavBar.defaultProps = defaultProps$1f;
10768
10755
  NavBar.displayName = "NutNavBar";
10769
10756
  const defaultProps$1e = {
10770
10757
  ...ComponentDefaults,
@@ -10991,12 +10978,13 @@ const SideNavBar = (props) => {
10991
10978
  children,
10992
10979
  className,
10993
10980
  onClose,
10981
+ indent,
10994
10982
  ...rest
10995
10983
  } = {
10996
10984
  ...defaultProps$1d,
10997
10985
  ...props
10998
10986
  };
10999
- const indent = props.indent ? Number(props.indent) : 20;
10987
+ const innerIndent = indent ? Number(indent) : 20;
11000
10988
  return /* @__PURE__ */ React__default.createElement(
11001
10989
  Popup,
11002
10990
  {
@@ -11015,17 +11003,16 @@ const SideNavBar = (props) => {
11015
11003
  "div",
11016
11004
  {
11017
11005
  className: `${classPrefix2}-title ${classPrefix2}-border-bt`,
11018
- style: { paddingLeft: `${indent}px` }
11006
+ style: { paddingLeft: `${innerIndent}px` }
11019
11007
  },
11020
11008
  title,
11021
11009
  " ",
11022
11010
  /* @__PURE__ */ React__default.createElement("i", { className: "arrow-icon arrow-down" })
11023
11011
  ),
11024
- /* @__PURE__ */ React__default.createElement(OffsetContext.Provider, { value: indent }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-content` }, children))
11012
+ /* @__PURE__ */ React__default.createElement(OffsetContext.Provider, { value: innerIndent }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-content` }, children))
11025
11013
  )))
11026
11014
  );
11027
11015
  };
11028
- SideNavBar.defaultProps = defaultProps$1d;
11029
11016
  SideNavBar.displayName = "NutSideNavBar";
11030
11017
  const SideNavBarItem = (props) => {
11031
11018
  const classPrefix2 = "nut-subsidenavbar";
@@ -11339,7 +11326,6 @@ const Tabbar = (props) => {
11339
11326
  (fixed || safeArea) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-safe-area` })
11340
11327
  );
11341
11328
  };
11342
- Tabbar.defaultProps = defaultProps$19;
11343
11329
  Tabbar.displayName = "NutTabbar";
11344
11330
  Tabbar.Item = TabbarItem;
11345
11331
  const defaultProps$18 = {
@@ -11388,14 +11374,16 @@ const Tabs = (props) => {
11388
11374
  onChange,
11389
11375
  className,
11390
11376
  autoHeight,
11377
+ value: outerValue,
11378
+ defaultValue: outerDefaultValue,
11391
11379
  ...rest
11392
11380
  } = {
11393
11381
  ...defaultProps$17,
11394
11382
  ...props
11395
11383
  };
11396
11384
  const [value, setValue] = usePropsValue({
11397
- value: props.value,
11398
- defaultValue: props.defaultValue,
11385
+ value: outerValue,
11386
+ defaultValue: outerDefaultValue,
11399
11387
  finalValue: 0,
11400
11388
  onChange
11401
11389
  });
@@ -11425,13 +11413,13 @@ const Tabs = (props) => {
11425
11413
  }
11426
11414
  const title2 = titleItem[index];
11427
11415
  let to2 = 0;
11428
- if (props.direction === "vertical") {
11416
+ if (direction === "vertical") {
11429
11417
  const runTop = title2.offsetTop - nav.offsetTop + 10;
11430
11418
  to2 = runTop - (nav.offsetHeight - title2.offsetHeight) / 2;
11431
11419
  } else {
11432
11420
  to2 = title2.offsetLeft - (nav.offsetWidth - title2.offsetWidth) / 2;
11433
11421
  }
11434
- scrollDirection(nav, to2, immediate ? 0 : 0.3, props.direction);
11422
+ scrollDirection(nav, to2, immediate ? 0 : 0.3, direction);
11435
11423
  };
11436
11424
  const getTitles = () => {
11437
11425
  const titles2 = [];
@@ -11561,7 +11549,6 @@ const Tabs = (props) => {
11561
11549
  return React__default.cloneElement(child, childProps);
11562
11550
  }))));
11563
11551
  };
11564
- Tabs.defaultProps = defaultProps$17;
11565
11552
  Tabs.displayName = "NutTabs";
11566
11553
  Tabs.TabPane = TabPane;
11567
11554
  const formatTree = (tree, parent, config2) => tree.map((node) => {
@@ -23409,7 +23396,8 @@ const ImagePreview = (props) => {
23409
23396
  setActive(page + 1);
23410
23397
  (_a = props.onChange) == null ? void 0 : _a.call(props, page + 1);
23411
23398
  };
23412
- const onCloseInner = () => {
23399
+ const onCloseInner = (e2) => {
23400
+ e2.stopPropagation();
23413
23401
  setShowPop(false);
23414
23402
  setActive(innerNo);
23415
23403
  scaleNow();
@@ -23419,9 +23407,9 @@ const ImagePreview = (props) => {
23419
23407
  scale: 1
23420
23408
  });
23421
23409
  };
23422
- const closeOnImg = () => {
23410
+ const closeOnImg = (e2) => {
23423
23411
  if (closeOnContentClick) {
23424
- onCloseInner();
23412
+ onCloseInner(e2);
23425
23413
  }
23426
23414
  };
23427
23415
  const duration = typeof autoPlay === "string" ? parseInt(autoPlay) : autoPlay;
@@ -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.nutui || {}, global2.nutui.react = {}), global2.React, global2.ReactDOM));
3
3
  })(this, function(exports2, React, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react v2.6.3 Tue Apr 30 2024 14:15:24 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:06 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -1260,7 +1260,6 @@ Check the top-level render call using <` + t2 + ">.");
1260
1260
  /* @__PURE__ */ React.createElement(CellGroupContext.Provider, { value: { divider } }, children)
1261
1261
  ));
1262
1262
  };
1263
- CellGroup.defaultProps = defaultProps$1t;
1264
1263
  CellGroup.displayName = "NutCellGroup";
1265
1264
  const defaultProps$1s = {
1266
1265
  ...ComponentDefaults,
@@ -1320,7 +1319,6 @@ Check the top-level render call using <` + t2 + ">.");
1320
1319
  (ctx2 == null ? void 0 : ctx2.divider) ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$q}-divider` }) : null
1321
1320
  );
1322
1321
  };
1323
- Cell.defaultProps = defaultProps$1s;
1324
1322
  Cell.displayName = "NutCell";
1325
1323
  Cell.Group = CellGroup;
1326
1324
  var INFINITY = 1 / 0;
@@ -2508,6 +2506,7 @@ Check the top-level render call using <` + t2 + ">.");
2508
2506
  error,
2509
2507
  loading,
2510
2508
  lazy,
2509
+ draggable,
2511
2510
  onClick,
2512
2511
  onLoad,
2513
2512
  onError
@@ -2636,7 +2635,7 @@ Check the top-level render call using <` + t2 + ">.");
2636
2635
  loading: "lazy",
2637
2636
  onLoad: handleLoad,
2638
2637
  onError: handleError,
2639
- draggable: props.draggable
2638
+ draggable
2640
2639
  }
2641
2640
  ) : /* @__PURE__ */ React.createElement(
2642
2641
  "img",
@@ -2648,14 +2647,13 @@ Check the top-level render call using <` + t2 + ">.");
2648
2647
  alt,
2649
2648
  onLoad: handleLoad,
2650
2649
  onError: handleError,
2651
- draggable: props.draggable
2650
+ draggable
2652
2651
  }
2653
2652
  ),
2654
2653
  renderLoading(),
2655
2654
  renderErrorImg()
2656
2655
  );
2657
2656
  };
2658
- Image$1.defaultProps = defaultProps$1r;
2659
2657
  Image$1.displayName = "NutImage";
2660
2658
  function _extends$4() {
2661
2659
  _extends$4 = Object.assign ? Object.assign.bind() : function(target) {
@@ -4616,7 +4614,7 @@ Check the top-level render call using <` + t2 + ">.");
4616
4614
  setInnerVisible(false);
4617
4615
  }
4618
4616
  }, [visible]);
4619
- useLockScroll(nodeRef, !!props.lockScroll && innerVisible);
4617
+ useLockScroll(nodeRef, !!lockScroll && innerVisible);
4620
4618
  const classes = classNames(classPrefix2, className);
4621
4619
  const styles = {
4622
4620
  ...style
@@ -4656,7 +4654,6 @@ Check the top-level render call using <` + t2 + ">.");
4656
4654
  )
4657
4655
  ));
4658
4656
  };
4659
- Overlay.defaultProps = defaultOverlayProps;
4660
4657
  Overlay.displayName = "NutOverlay";
4661
4658
  const DataContext$1 = React.createContext({});
4662
4659
  const defaultProps$1q = {
@@ -4699,7 +4696,6 @@ Check the top-level render call using <` + t2 + ">.");
4699
4696
  children
4700
4697
  );
4701
4698
  };
4702
- Col.defaultProps = defaultProps$1q;
4703
4699
  Col.displayName = "NutCol";
4704
4700
  const defaultProps$1p = {
4705
4701
  ...ComponentDefaults,
@@ -4724,7 +4720,6 @@ Check the top-level render call using <` + t2 + ">.");
4724
4720
  });
4725
4721
  return /* @__PURE__ */ React.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
4726
4722
  };
4727
- Divider.defaultProps = defaultProps$1p;
4728
4723
  Divider.displayName = "NutDivider";
4729
4724
  const gridContext = {
4730
4725
  onClick: (item, index) => {
@@ -4815,7 +4810,6 @@ Check the top-level render call using <` + t2 + ">.");
4815
4810
  /* @__PURE__ */ React.createElement("div", { className: contentClass() }, children && /* @__PURE__ */ React.createElement(React.Fragment, null, children), text && /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-text` }, text))
4816
4811
  );
4817
4812
  };
4818
- GridItem.defaultProps = defaultProps$1o;
4819
4813
  GridItem.displayName = "NutGridItem";
4820
4814
  const defaultProps$1n = {
4821
4815
  columns: 4,
@@ -4872,7 +4866,6 @@ Check the top-level render call using <` + t2 + ">.");
4872
4866
  });
4873
4867
  })));
4874
4868
  };
4875
- Grid.defaultProps = defaultProps$1n;
4876
4869
  Grid.displayName = "NutGrid";
4877
4870
  Grid.Item = GridItem;
4878
4871
  const defaultProps$1m = {};
@@ -4935,7 +4928,6 @@ Check the top-level render call using <` + t2 + ">.");
4935
4928
  children
4936
4929
  ));
4937
4930
  };
4938
- Row.defaultProps = defaultProps$1l;
4939
4931
  Row.displayName = "NutRow";
4940
4932
  const prefixCls$1 = "nut-space";
4941
4933
  const defaultProps$1k = {
@@ -4958,7 +4950,6 @@ Check the top-level render call using <` + t2 + ">.");
4958
4950
  return child !== null && child !== void 0 && /* @__PURE__ */ React.createElement("div", { className: `${prefixCls$1}-item` }, child);
4959
4951
  }));
4960
4952
  };
4961
- Space.defaultProps = defaultProps$1k;
4962
4953
  Space.displayName = "NutSpace";
4963
4954
  function isWindow(val) {
4964
4955
  return val === window;
@@ -5146,7 +5137,6 @@ Check the top-level render call using <` + t2 + ">.");
5146
5137
  /* @__PURE__ */ React.createElement("div", { className: "nut-sticky-box", ref: stickyRef, style: stickyStyle }, children)
5147
5138
  );
5148
5139
  };
5149
- Sticky.defaultProps = defaultProps$1j;
5150
5140
  Sticky.displayName = "NutSticky";
5151
5141
  const classPrefix$k = "nut-safe-area";
5152
5142
  const SafeArea = (props) => {
@@ -5160,6 +5150,7 @@ Check the top-level render call using <` + t2 + ">.");
5160
5150
  }
5161
5151
  );
5162
5152
  };
5153
+ SafeArea.displayName = "NutSafeArea";
5163
5154
  const defaultProps$1i = {
5164
5155
  ...ComponentDefaults,
5165
5156
  target: "",
@@ -5276,7 +5267,6 @@ Check the top-level render call using <` + t2 + ">.");
5276
5267
  children || /* @__PURE__ */ React.createElement(e$1, { width: 19, height: 19, className: "nut-backtop-main" })
5277
5268
  );
5278
5269
  };
5279
- BackTop.defaultProps = defaultProps$1i;
5280
5270
  BackTop.displayName = "NutBackTop";
5281
5271
  function clamp$2(v, min, max) {
5282
5272
  return Math.max(min, Math.min(v, max));
@@ -10596,7 +10586,6 @@ Please add \`${key}Action\` when creating your handler.`);
10596
10586
  })
10597
10587
  ))) : null);
10598
10588
  };
10599
- Elevator.defaultProps = defaultProps$1h;
10600
10589
  Elevator.displayName = "NutElevator";
10601
10590
  Elevator.Context = elevatorContext;
10602
10591
  const defaultProps$1g = {
@@ -10679,7 +10668,6 @@ Please add \`${key}Action\` when creating your handler.`);
10679
10668
  /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-btn`, onClick: () => onUpdateValue() }, content || /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(e$d, { color: "#fff" }), /* @__PURE__ */ React.createElement("div", { className: "text" }, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText)))
10680
10669
  );
10681
10670
  };
10682
- FixedNav.defaultProps = defaultProps$1g;
10683
10671
  FixedNav.displayName = "NutFixedNav";
10684
10672
  const defaultProps$1f = {
10685
10673
  ...ComponentDefaults,
@@ -10782,7 +10770,6 @@ Please add \`${key}Action\` when creating your handler.`);
10782
10770
  const cls = classNames(classPrefix2, classes, className);
10783
10771
  return /* @__PURE__ */ React.createElement(React.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-placeholder` }, renderWrapper()) : renderWrapper());
10784
10772
  };
10785
- NavBar.defaultProps = defaultProps$1f;
10786
10773
  NavBar.displayName = "NutNavBar";
10787
10774
  const defaultProps$1e = {
10788
10775
  ...ComponentDefaults,
@@ -11009,12 +10996,13 @@ Please add \`${key}Action\` when creating your handler.`);
11009
10996
  children,
11010
10997
  className,
11011
10998
  onClose,
10999
+ indent,
11012
11000
  ...rest
11013
11001
  } = {
11014
11002
  ...defaultProps$1d,
11015
11003
  ...props
11016
11004
  };
11017
- const indent = props.indent ? Number(props.indent) : 20;
11005
+ const innerIndent = indent ? Number(indent) : 20;
11018
11006
  return /* @__PURE__ */ React.createElement(
11019
11007
  Popup,
11020
11008
  {
@@ -11033,17 +11021,16 @@ Please add \`${key}Action\` when creating your handler.`);
11033
11021
  "div",
11034
11022
  {
11035
11023
  className: `${classPrefix2}-title ${classPrefix2}-border-bt`,
11036
- style: { paddingLeft: `${indent}px` }
11024
+ style: { paddingLeft: `${innerIndent}px` }
11037
11025
  },
11038
11026
  title,
11039
11027
  " ",
11040
11028
  /* @__PURE__ */ React.createElement("i", { className: "arrow-icon arrow-down" })
11041
11029
  ),
11042
- /* @__PURE__ */ React.createElement(OffsetContext.Provider, { value: indent }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-content` }, children))
11030
+ /* @__PURE__ */ React.createElement(OffsetContext.Provider, { value: innerIndent }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-content` }, children))
11043
11031
  )))
11044
11032
  );
11045
11033
  };
11046
- SideNavBar.defaultProps = defaultProps$1d;
11047
11034
  SideNavBar.displayName = "NutSideNavBar";
11048
11035
  const SideNavBarItem = (props) => {
11049
11036
  const classPrefix2 = "nut-subsidenavbar";
@@ -11357,7 +11344,6 @@ Please add \`${key}Action\` when creating your handler.`);
11357
11344
  (fixed || safeArea) && /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-safe-area` })
11358
11345
  );
11359
11346
  };
11360
- Tabbar.defaultProps = defaultProps$19;
11361
11347
  Tabbar.displayName = "NutTabbar";
11362
11348
  Tabbar.Item = TabbarItem;
11363
11349
  const defaultProps$18 = {
@@ -11406,14 +11392,16 @@ Please add \`${key}Action\` when creating your handler.`);
11406
11392
  onChange,
11407
11393
  className,
11408
11394
  autoHeight,
11395
+ value: outerValue,
11396
+ defaultValue: outerDefaultValue,
11409
11397
  ...rest
11410
11398
  } = {
11411
11399
  ...defaultProps$17,
11412
11400
  ...props
11413
11401
  };
11414
11402
  const [value, setValue] = usePropsValue({
11415
- value: props.value,
11416
- defaultValue: props.defaultValue,
11403
+ value: outerValue,
11404
+ defaultValue: outerDefaultValue,
11417
11405
  finalValue: 0,
11418
11406
  onChange
11419
11407
  });
@@ -11443,13 +11431,13 @@ Please add \`${key}Action\` when creating your handler.`);
11443
11431
  }
11444
11432
  const title2 = titleItem[index];
11445
11433
  let to2 = 0;
11446
- if (props.direction === "vertical") {
11434
+ if (direction === "vertical") {
11447
11435
  const runTop = title2.offsetTop - nav.offsetTop + 10;
11448
11436
  to2 = runTop - (nav.offsetHeight - title2.offsetHeight) / 2;
11449
11437
  } else {
11450
11438
  to2 = title2.offsetLeft - (nav.offsetWidth - title2.offsetWidth) / 2;
11451
11439
  }
11452
- scrollDirection(nav, to2, immediate ? 0 : 0.3, props.direction);
11440
+ scrollDirection(nav, to2, immediate ? 0 : 0.3, direction);
11453
11441
  };
11454
11442
  const getTitles = () => {
11455
11443
  const titles2 = [];
@@ -11579,7 +11567,6 @@ Please add \`${key}Action\` when creating your handler.`);
11579
11567
  return React.cloneElement(child, childProps);
11580
11568
  }))));
11581
11569
  };
11582
- Tabs.defaultProps = defaultProps$17;
11583
11570
  Tabs.displayName = "NutTabs";
11584
11571
  Tabs.TabPane = TabPane;
11585
11572
  const formatTree = (tree, parent, config2) => tree.map((node) => {
@@ -23427,7 +23414,8 @@ Please add \`${key}Action\` when creating your handler.`);
23427
23414
  setActive(page + 1);
23428
23415
  (_a = props.onChange) == null ? void 0 : _a.call(props, page + 1);
23429
23416
  };
23430
- const onCloseInner = () => {
23417
+ const onCloseInner = (e2) => {
23418
+ e2.stopPropagation();
23431
23419
  setShowPop(false);
23432
23420
  setActive(innerNo);
23433
23421
  scaleNow();
@@ -23437,9 +23425,9 @@ Please add \`${key}Action\` when creating your handler.`);
23437
23425
  scale: 1
23438
23426
  });
23439
23427
  };
23440
- const closeOnImg = () => {
23428
+ const closeOnImg = (e2) => {
23441
23429
  if (closeOnContentClick) {
23442
- onCloseInner();
23430
+ onCloseInner(e2);
23443
23431
  }
23444
23432
  };
23445
23433
  const duration = typeof autoPlay === "string" ? parseInt(autoPlay) : autoPlay;
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.6.3 Tue Apr 30 2024 14:15:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.4 Fri May 10 2024 14:45:24 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",
@@ -1,2 +0,0 @@
1
- declare function useLockFn<P extends any[] = any[], V = any>(fn: (...args: P) => Promise<V>): (...args: P) => Promise<V | undefined>;
2
- export default useLockFn;