@nutui/nutui-react 2.6.4 → 2.6.5

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 (78) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/dist/esm/ActionSheet.js +0 -1
  3. package/dist/esm/Address.js +0 -1
  4. package/dist/esm/Animate.js +0 -1
  5. package/dist/esm/Avatar.js +2 -3
  6. package/dist/esm/AvatarCropper.js +0 -1
  7. package/dist/esm/AvatarGroup.js +0 -1
  8. package/dist/esm/Barrage.js +0 -1
  9. package/dist/esm/Calendar.js +0 -1
  10. package/dist/esm/CalendarCard.js +0 -1
  11. package/dist/esm/CalendarItem.js +3 -4
  12. package/dist/esm/Card.js +0 -1
  13. package/dist/esm/CircleProgress.js +3 -5
  14. package/dist/esm/Collapse.js +0 -1
  15. package/dist/esm/CountDown.js +0 -1
  16. package/dist/esm/Drag.js +1 -2
  17. package/dist/esm/Ellipsis.js +0 -1
  18. package/dist/esm/Empty.js +0 -1
  19. package/dist/esm/Form.js +0 -1
  20. package/dist/esm/ImagePreview.js +4 -7
  21. package/dist/esm/Indicator.js +0 -1
  22. package/dist/esm/InfiniteLoading.js +0 -1
  23. package/dist/esm/Input.js +6 -9
  24. package/dist/esm/InputNumber.js +0 -1
  25. package/dist/esm/Layout.js +0 -1
  26. package/dist/esm/Loading.js +0 -1
  27. package/dist/esm/Menu/style/style.css +1 -1
  28. package/dist/esm/Menu.js +0 -1
  29. package/dist/esm/MenuItem/style/style.css +1 -1
  30. package/dist/esm/NoticeBar.js +0 -1
  31. package/dist/esm/NumberKeyboard.js +1 -2
  32. package/dist/esm/Pagination.js +0 -1
  33. package/dist/esm/Popover.js +4 -8
  34. package/dist/esm/Price.js +0 -1
  35. package/dist/esm/Progress.js +0 -1
  36. package/dist/esm/Range.js +0 -1
  37. package/dist/esm/Rate.js +0 -1
  38. package/dist/esm/SearchBar.js +6 -7
  39. package/dist/esm/ShortPassword.js +2 -2
  40. package/dist/esm/Signature.js +0 -1
  41. package/dist/esm/Skeleton.js +0 -1
  42. package/dist/esm/Step.js +0 -1
  43. package/dist/esm/Steps.js +1 -2
  44. package/dist/esm/Switch.js +0 -1
  45. package/dist/esm/Table/style/style.css +1 -1
  46. package/dist/esm/Table.js +1 -2
  47. package/dist/esm/Tag.js +0 -1
  48. package/dist/esm/TextArea.js +0 -1
  49. package/dist/esm/TimeDetail.js +0 -1
  50. package/dist/esm/TimeSelect.js +0 -1
  51. package/dist/esm/Tour.js +0 -1
  52. package/dist/esm/TrendArrow.js +0 -1
  53. package/dist/esm/Uploader.js +2 -3
  54. package/dist/esm/Video.js +0 -1
  55. package/dist/esm/VirtualList.js +0 -1
  56. package/dist/esm/WaterMark.js +0 -1
  57. package/dist/esm/badge2.js +0 -1
  58. package/dist/esm/cascader2.js +4 -5
  59. package/dist/esm/checkbox2.js +2 -3
  60. package/dist/esm/collapseitem2.js +0 -1
  61. package/dist/esm/menuitem2.js +0 -1
  62. package/dist/esm/popup2.js +0 -1
  63. package/dist/locales/base.js +1 -1
  64. package/dist/locales/en-US.js +1 -1
  65. package/dist/locales/id-ID.js +1 -1
  66. package/dist/locales/tr-TR.js +1 -1
  67. package/dist/locales/zh-CN.js +1 -1
  68. package/dist/locales/zh-TW.js +1 -1
  69. package/dist/locales/zh-UG.js +1 -1
  70. package/dist/nutui.react.es.js +133 -199
  71. package/dist/nutui.react.umd.js +133 -199
  72. package/dist/packages/menu/menu.scss +1 -0
  73. package/dist/packages/menuitem/menuitem.scss +1 -0
  74. package/dist/packages/table/table.scss +2 -1
  75. package/dist/style.css +1 -1
  76. package/dist/style.mjs +1 -1
  77. package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +5 -1
  78. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,9 +1,22 @@
1
+ # v2.6.5
2
+ `2024-05-17`
3
+
4
+
5
+ *🏡 chore(image): 官网taro的demo显示与h5不一致 (#2244) @Alex.huxiyang
6
+ * :bug: fix(circleprogress): update demo (#2260) @Eiinu
7
+ * :bug: fix: 移除 defaultProps(2) (#2254) @Eiinu
8
+ * :bug: fix: 关于checkbox&tabs的doc与demo修改 (#2253) @Alex.huxiyang
9
+ * :bug: fix(table): 修复部分由于场景下width未生效导致的一些问题 (#2241) @Alex.huxiyang
10
+ * :bug: fix(menu): 选项文字很多时右侧箭头展示异常 (#2252) @Alex.huxiyang
11
+ * :bug: fix(input): 修复特殊场景下自动清除失效问题 (#2240) @Eiinu
12
+
13
+
1
14
  # v2.6.4
2
15
  `2024-05-10`
3
16
 
4
17
 
5
- *🏡 chore: 修改默认的微信基础库版本 (#2235) @eiinu
6
- *🏡 chore(image): demo代码风格优化 (#2220) @Alex-huxiyang
18
+ * 🏡 chore: 修改默认的微信基础库版本 (#2235) @eiinu
19
+ * 🏡 chore(image): demo代码风格优化 (#2220) @Alex-huxiyang
7
20
  * 📖 docs(uploader): 文件上传编码使用提示 (#2224) @Alex-huxiyang
8
21
  * :bug: fix(imagePreview): 阻止关闭预览事件对父结构的非必要影响 (#2227) @Alex-huxiyang
9
22
  * :bug: fix(picker): 修复连续多次打开 picker 时显示值错误 (#2222) @eiinu
@@ -36,7 +36,6 @@ const ActionSheet = (props) => {
36
36
  )
37
37
  );
38
38
  };
39
- ActionSheet.defaultProps = defaultProps;
40
39
  ActionSheet.displayName = "NutActionSheet";
41
40
  export {
42
41
  ActionSheet as default
@@ -124,7 +124,6 @@ const InternalAddress = (props, ref) => {
124
124
  ));
125
125
  };
126
126
  const Address = forwardRef(InternalAddress);
127
- Address.defaultProps = defaultProps;
128
127
  Address.displayName = "NutAddress";
129
128
  export {
130
129
  Address as default
@@ -29,7 +29,6 @@ const Animate = (props) => {
29
29
  React__default.createElement("div", Object.assign({ className: cls, onClick: handleClick }, rest), children)
30
30
  );
31
31
  };
32
- Animate.defaultProps = defaultProps;
33
32
  Animate.displayName = "NutAnimate";
34
33
  export {
35
34
  Animate as default
@@ -50,8 +50,8 @@ const Avatar = (props) => {
50
50
  }
51
51
  };
52
52
  const errorEvent = () => {
53
- if (props.onError) {
54
- props.onError();
53
+ if (onError) {
54
+ onError();
55
55
  }
56
56
  };
57
57
  const clickAvatar = (e) => {
@@ -71,7 +71,6 @@ const Avatar = (props) => {
71
71
  showMax && React__default.createElement("div", { className: "text" }, ((_m = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _m === void 0 ? void 0 : _m.maxContent) ? (_o = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _o === void 0 ? void 0 : _o.maxContent : `+ ${avatarIndex - Number(((_p = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _p === void 0 ? void 0 : _p.max) || 0)}`)
72
72
  ));
73
73
  };
74
- Avatar.defaultProps = defaultProps;
75
74
  Avatar.displayName = "NutAvatar";
76
75
  Avatar.Group = AvatarGroup__default;
77
76
  export {
@@ -299,7 +299,6 @@ const AvatarCropper = (props) => {
299
299
  CropperPopup()
300
300
  );
301
301
  };
302
- AvatarCropper.defaultProps = defaultProps;
303
302
  AvatarCropper.displayName = "NutAvatarCropper";
304
303
  export {
305
304
  AvatarCropper as default
@@ -19,7 +19,6 @@ const AvatarGroup = (props) => {
19
19
  React__default.createElement("div", { className: cls, style, ref: avatarGroupRef }, children)
20
20
  );
21
21
  };
22
- AvatarGroup.defaultProps = defaultProps;
23
22
  AvatarGroup.displayName = "NutAvatarGroup";
24
23
  export {
25
24
  AvatarGroup as default
@@ -85,7 +85,6 @@ const InternalBarrage = (props, ref) => {
85
85
  );
86
86
  };
87
87
  const Barrage = React__default.forwardRef(InternalBarrage);
88
- Barrage.defaultProps = defaultProps;
89
88
  Barrage.displayName = "NutBarrage";
90
89
  export {
91
90
  Barrage as default
@@ -41,7 +41,6 @@ const Calendar = React__default.forwardRef((props, ref) => {
41
41
  };
42
42
  return React__default.createElement(React__default.Fragment, null, popup ? React__default.createElement(Popup__default, { className: "nut-calendar-popup", visible, position: "bottom", round: true, closeable: true, destroyOnClose: true, onOverlayClick: closePopup, onCloseIconClick: closePopup, style: { height: "83%" } }, renderItem()) : renderItem());
43
43
  });
44
- Calendar.defaultProps = defaultProps;
45
44
  Calendar.displayName = "NutCalendar";
46
45
  export {
47
46
  Calendar as default
@@ -411,7 +411,6 @@ const CalendarCard = React__default.forwardRef((props, ref) => {
411
411
  renderContent()
412
412
  ) : null;
413
413
  });
414
- CalendarCard.defaultProps = defaultProps;
415
414
  CalendarCard.displayName = "NutCalendarCard";
416
415
  export {
417
416
  CalendarCard as default
@@ -40,7 +40,7 @@ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { type:
40
40
  } });
41
41
  const CalendarItem = React__default.forwardRef((props, ref) => {
42
42
  const { locale } = useConfig();
43
- const { style, className, children, popup, type, autoBackfill, title, defaultValue, startDate, endDate, showToday, startText, endText, confirmText, showTitle, showSubTitle, scrollAnimation, firstDayOfWeek, disableDate, renderHeaderButtons, renderDay, renderDayTop, renderDayBottom, onConfirm, onUpdate, onDayClick, onPageChange } = Object.assign(Object.assign({}, defaultProps), props);
43
+ const { style, className, children, popup, type, autoBackfill, title, defaultValue, startDate, endDate, showToday, startText, endText, confirmText, showTitle, showSubTitle, scrollAnimation, firstDayOfWeek, disableDate, renderHeaderButtons, renderDay, renderDayTop, renderDayBottom, value, onConfirm, onUpdate, onDayClick, onPageChange } = Object.assign(Object.assign({}, defaultProps), props);
44
44
  const weekdays = locale.calendaritem.weekdays;
45
45
  const weeks = [
46
46
  ...weekdays.slice(firstDayOfWeek, 7),
@@ -72,7 +72,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
72
72
  return void 0;
73
73
  };
74
74
  const [currentDate, setCurrentDate] = usePropsValue({
75
- value: props.value,
75
+ value,
76
76
  defaultValue: resetDefaultValue(),
77
77
  finalValue: [],
78
78
  onChange: (val) => {
@@ -261,7 +261,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
261
261
  if (type === "range") {
262
262
  chooseDay({ day: defaultData[2], type: "active" }, monthsData[current.current], true);
263
263
  chooseDay({ day: defaultData[5], type: "active" }, monthsData[current.lastCurrent], true);
264
- } else if (props.type === "week") {
264
+ } else if (type === "week") {
265
265
  chooseDay({ day: defaultData[2], type: "curr" }, monthsData[current.current], true);
266
266
  } else if (type === "multiple") {
267
267
  [...currentDate].forEach((item) => {
@@ -558,7 +558,6 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
558
558
  )
559
559
  );
560
560
  });
561
- CalendarItem.defaultProps = defaultProps;
562
561
  CalendarItem.displayName = "NutCalendarItem";
563
562
  export {
564
563
  CalendarItem as default
package/dist/esm/Card.js CHANGED
@@ -42,7 +42,6 @@ const Card = (props) => {
42
42
  )
43
43
  );
44
44
  };
45
- Card.defaultProps = defaultProps;
46
45
  Card.displayName = "NutCard";
47
46
  export {
48
47
  Card as default
@@ -27,11 +27,10 @@ const CircleProgress = (props) => {
27
27
  return `M 50 50 m -45 0 a 45 45 0 1 ${isWise} 90 0 a 45 45 0 1 ${isWise} -90 0`;
28
28
  };
29
29
  const stop = () => {
30
- if (!isObject(props.color)) {
30
+ if (!isObject(color)) {
31
31
  return;
32
32
  }
33
- const color2 = props.color;
34
- const colorArr = Object.keys(color2).sort((a, b) => parseFloat(a) - parseFloat(b));
33
+ const colorArr = Object.keys(color).sort((a, b) => parseFloat(a) - parseFloat(b));
35
34
  const stopArr = [];
36
35
  colorArr.forEach((item) => {
37
36
  const obj = {
@@ -39,7 +38,7 @@ const CircleProgress = (props) => {
39
38
  value: ""
40
39
  };
41
40
  obj.key = item;
42
- obj.value = color2[item];
41
+ obj.value = color[item];
43
42
  stopArr.push(obj);
44
43
  });
45
44
  return stopArr;
@@ -63,7 +62,6 @@ const CircleProgress = (props) => {
63
62
  React__default.createElement("div", { className: "nut-circleprogress-text" }, children)
64
63
  );
65
64
  };
66
- CircleProgress.defaultProps = defaultProps;
67
65
  CircleProgress.displayName = "NutCircleProgress";
68
66
  export {
69
67
  CircleProgress as default
@@ -55,7 +55,6 @@ const Collapse = (props) => {
55
55
  React__default.createElement("div", { className: classNames(classPrefix, className), style }, children)
56
56
  );
57
57
  };
58
- Collapse.defaultProps = defaultProps;
59
58
  Collapse.displayName = "NutCollapse";
60
59
  Collapse.Item = CollapseItem;
61
60
  export {
@@ -197,7 +197,6 @@ const InternalCountDown = (props, ref) => {
197
197
  }));
198
198
  };
199
199
  const CountDown = React__default.forwardRef(InternalCountDown);
200
- CountDown.defaultProps = defaultProps;
201
200
  CountDown.displayName = "NutCountDown";
202
201
  export {
203
202
  CountDown as default
package/dist/esm/Drag.js CHANGED
@@ -37,7 +37,7 @@ const Drag = (props) => {
37
37
  const bind = useDrag(({ down, last, offset: [x, y] }) => {
38
38
  api.start({ x, y, immediate: down });
39
39
  if (last) {
40
- if (props.direction !== "y" && props.attract) {
40
+ if (direction !== "y" && attract) {
41
41
  if (x < middleLine.current) {
42
42
  api.start({ x: boundaryState.left, y, immediate: down });
43
43
  } else {
@@ -63,7 +63,6 @@ const Drag = (props) => {
63
63
  React__default.createElement(animated.div, Object.assign({ style: currstyle }, bind()), children)
64
64
  );
65
65
  };
66
- Drag.defaultProps = defaultProps;
67
66
  Drag.displayName = "NutDrag";
68
67
  export {
69
68
  Drag as default
@@ -154,7 +154,6 @@ const Ellipsis = (props) => {
154
154
  ) : null
155
155
  );
156
156
  };
157
- Ellipsis.defaultProps = defaultProps;
158
157
  Ellipsis.displayName = "NutEllipsis";
159
158
  export {
160
159
  Ellipsis as default
package/dist/esm/Empty.js CHANGED
@@ -53,7 +53,6 @@ const Empty = (props) => {
53
53
  children
54
54
  );
55
55
  };
56
- Empty.defaultProps = defaultProps;
57
56
  Empty.displayName = "NutEmpty";
58
57
  export {
59
58
  Empty as default
package/dist/esm/Form.js CHANGED
@@ -52,7 +52,6 @@ const Form = React__default.forwardRef((props, ref) => {
52
52
  )
53
53
  );
54
54
  });
55
- Form.defaultProps = defaultProps;
56
55
  Form.displayName = "NutForm";
57
56
  const InnerForm = Form;
58
57
  InnerForm.Item = FormItem;
@@ -12,16 +12,15 @@ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { image
12
12
  }, onClose: () => {
13
13
  } });
14
14
  const ImagePreview = (props) => {
15
- const { className, style, images, videos, visible, defaultValue, indicatorColor, indicator, autoPlay, closeOnContentClick, closeIcon, closeIconPosition, onClose } = props;
15
+ const { value, className, style, images, videos, visible, defaultValue, indicatorColor, 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({
19
- value: props.value,
19
+ value,
20
20
  defaultValue,
21
21
  finalValue: defaultValue,
22
22
  onChange: (val) => {
23
- var _a;
24
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, val);
23
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
25
24
  }
26
25
  });
27
26
  const [showPop, setShowPop] = useState(visible);
@@ -121,9 +120,8 @@ const ImagePreview = (props) => {
121
120
  return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
122
121
  };
123
122
  const slideChangeEnd = (page) => {
124
- var _a;
125
123
  setActive(page + 1);
126
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, page + 1);
124
+ onChange === null || onChange === void 0 ? void 0 : onChange(page + 1);
127
125
  };
128
126
  const onCloseInner = (e) => {
129
127
  e.stopPropagation();
@@ -167,7 +165,6 @@ const ImagePreview = (props) => {
167
165
  closeIcon !== false ? React__default.createElement("div", { className: `${classPrefix}-close ${closeIconPosition}`, onClick: onCloseInner }, closeIcon === true ? React__default.createElement(Close, null) : closeIcon) : null
168
166
  );
169
167
  };
170
- ImagePreview.defaultProps = defaultProps;
171
168
  ImagePreview.displayName = "NutImagePreview";
172
169
  export {
173
170
  ImagePreview as default
@@ -21,7 +21,6 @@ const Indicator = (props) => {
21
21
  };
22
22
  return React__default.createElement("div", Object.assign({ className: classNames(classPrefix, classes, className) }, rest), renderElement());
23
23
  };
24
- Indicator.defaultProps = defaultProps;
25
24
  Indicator.displayName = "NutIndicator";
26
25
  export {
27
26
  Indicator as default
@@ -141,7 +141,6 @@ const InfiniteLoading = (props) => {
141
141
  React__default.createElement("div", { className: "nut-infinite-bottom" }, isInfiniting ? React__default.createElement("div", { className: "nut-infinite-bottom-tips" }, loadingText || locale.infiniteloading.loadText) : !hasMore && React__default.createElement("div", { className: "nut-infinite-bottom-tips" }, loadMoreText || locale.infiniteloading.loadMoreText))
142
142
  );
143
143
  };
144
- InfiniteLoading.defaultProps = defaultProps;
145
144
  InfiniteLoading.displayName = "NutInfiniteLoading";
146
145
  export {
147
146
  InfiniteLoading as default
package/dist/esm/Input.js CHANGED
@@ -32,10 +32,10 @@ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { type:
32
32
  const Input = forwardRef((props, ref) => {
33
33
  const rtl = useRtl();
34
34
  const { locale } = useConfig();
35
- const _a = Object.assign(Object.assign({}, defaultProps), props), { type, name, placeholder, align, disabled, readOnly, maxLength, clearable, clearIcon, formatTrigger, autoFocus, style, className, onChange, onFocus, onClear, formatter, onClick, confirmType, defaultValue, value: _value } = _a, rest = __rest(_a, ["type", "name", "placeholder", "align", "disabled", "readOnly", "maxLength", "clearable", "clearIcon", "formatTrigger", "autoFocus", "style", "className", "onChange", "onFocus", "onClear", "formatter", "onClick", "confirmType", "defaultValue", "value"]);
35
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { type, name, placeholder, align, disabled, readOnly, maxLength, clearable, clearIcon, formatTrigger, autoFocus, style, className, onChange, onFocus, onClear, formatter, onClick, confirmType, defaultValue, value: _value, onCompositionStart, onCompositionEnd } = _a, rest = __rest(_a, ["type", "name", "placeholder", "align", "disabled", "readOnly", "maxLength", "clearable", "clearIcon", "formatTrigger", "autoFocus", "style", "className", "onChange", "onFocus", "onClear", "formatter", "onClick", "confirmType", "defaultValue", "value", "onCompositionStart", "onCompositionEnd"]);
36
36
  const [value, setValue] = usePropsValue({
37
- value: props.value,
38
- defaultValue: props.defaultValue,
37
+ value: _value,
38
+ defaultValue,
39
39
  finalValue: "",
40
40
  onChange
41
41
  });
@@ -126,15 +126,13 @@ const Input = forwardRef((props, ref) => {
126
126
  }, onChange: (e) => {
127
127
  handleInput(e.currentTarget.value);
128
128
  }, onCompositionStart: (e) => {
129
- var _a2;
130
129
  composingRef.current = true;
131
- (_a2 = props.onCompositionStart) === null || _a2 === void 0 ? void 0 : _a2.call(props, e);
130
+ onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
132
131
  }, onCompositionEnd: (e) => {
133
- var _a2;
134
132
  composingRef.current = false;
135
- (_a2 = props.onCompositionEnd) === null || _a2 === void 0 ? void 0 : _a2.call(props, e);
133
+ onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
136
134
  } })),
137
- clearable && !readOnly && active && value.length > 0 ? React__default.createElement("span", { style: { display: "flex", alignItems: "center" }, onClick: () => {
135
+ clearable && !readOnly && active && value.length > 0 ? React__default.createElement("span", { style: { display: "flex", alignItems: "center", cursor: "pointer" }, onClick: () => {
138
136
  if (!disabled) {
139
137
  setValue("");
140
138
  onClear && onClear("");
@@ -142,7 +140,6 @@ const Input = forwardRef((props, ref) => {
142
140
  } }, clearIcon || React__default.createElement(MaskClose, { className: "nut-input-clear" })) : null
143
141
  );
144
142
  });
145
- Input.defaultProps = defaultProps;
146
143
  Input.displayName = "NutInput";
147
144
  export {
148
145
  Input as default
@@ -151,7 +151,6 @@ const InputNumber = (props) => {
151
151
  )
152
152
  );
153
153
  };
154
- InputNumber.defaultProps = defaultProps;
155
154
  InputNumber.displayName = "NutInputNumber";
156
155
  export {
157
156
  InputNumber as default
@@ -4,7 +4,6 @@ const Layout = (props) => {
4
4
  Object.assign(Object.assign({}, defaultProps), props);
5
5
  return React__default.createElement("div", { className: "nut-layout" }, "Layout");
6
6
  };
7
- Layout.defaultProps = defaultProps;
8
7
  Layout.displayName = "NutLayout";
9
8
  export {
10
9
  Layout as default
@@ -23,7 +23,6 @@ const Loading = (props) => {
23
23
  children ? React__default.createElement("div", { className: `${classPrefix}-text` }, children) : ""
24
24
  );
25
25
  };
26
- Loading.defaultProps = defaultProps;
27
26
  Loading.displayName = "NutLoading";
28
27
  export {
29
28
  Loading as default
@@ -1 +1 @@
1
- .nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-black-10, rgba(0, 0, 0, .7)));z-index:var(--nutui-overlay-zIndex, 1000)}.nut-overlay .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-1, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-7, #1a1a1a))}[dir=rtl] .nut-overlay,.nut-rtl .nut-overlay{left:auto;right:0}.nut-overflow-hidden,.nut-overflow-hidden .taro_page{overflow:hidden!important}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-overlay-slide-enter-active,.nut-overlay-slide-appear-active{animation-fill-mode:both;animation-name:nut-fade-in;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-overlay-slide-exit-active{animation-fill-mode:both;animation-name:nut-fade-out;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-menu-container-content{padding:var(--nutui-menu-content-padding, 12px 24px);max-height:var(--nutui-menu-content-max-height, 214px);overflow-y:auto;display:flex;flex-wrap:wrap;background:var(--nutui-menu-content-background-color, var(--nutui-gray-1, #ffffff))}.nut-menu-container-content_fixed{width:100%;opacity:0;position:fixed}.nut-menu-container-item{display:flex;align-items:center;color:var(--nutui-gray-7, #1a1a1a);font-size:var(--nutui-font-size-3, 14px);padding:var(--nutui-menu-item-padding, 12px 0)}.nut-menu-container-item.active{font-weight:var(--nutui-menu-item-active-font-weight, var(--nutui-font-weight-bold, 500));color:var(--nutui-menu-item-active-color, var(--nutui-color-primary, #fa2c19))}.nut-menu-container-item .nut-icon{display:inline-flex;align-items:center;margin-right:var(--nutui-menu-item-icon-margin, 8px)}.nut-menu-container-wrap,.nut-menu-container-wrap-up{position:absolute;width:100%;z-index:var(--nutui-menu-container-z-index, 1000);overflow:hidden}.nut-menu-container-wrap-up{bottom:var(--nutui-menu-bar-line-height, 48px)}.overlay-fade-enter-active.nut-menu-container-overlay{top:auto;z-index:var(--nutui-menu-container-z-index, 1000)}.nut-menu-placeholder-element{position:fixed;top:-var(--nutui-menu-bar-line-height,48px);left:0;right:0;z-index:var(--nutui-menu-bar-opened-z-index, 1000);background-color:transparent}.nut-menu-placeholder-element.up{bottom:-var(--nutui-menu-bar-line-height,48px)}.nut-menu-container-down-enter{opacity:0;transform:translateY(-30px)}.nut-menu-container-down-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-down-exit{opacity:1;transition:all .1s}.nut-menu-container-down-exit-done{opacity:0;transition:all .1s}.nut-menu-container-up-enter{opacity:0;transform:translateY(30px)}.nut-menu-container-up-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-up-exit{opacity:1;transition:all .1s}.nut-menu-container-up-exit-done{opacity:0;transition:all .1s}[dir=rtl] .nut-menu-container-item .nut-icon,.nut-rtl .nut-menu-container-item .nut-icon{margin-right:0;margin-left:var(--nutui-menu-item-icon-margin, 8px)}[dir=rtl] .nut-menu-container .nut-icon,.nut-rtl .nut-menu-container .nut-icon{transform:rotateY(180deg)}.nut-menu{position:relative}.nut-menu.scroll-fixed{position:fixed;top:var(--nutui-menu-scroll-fixed-top, 0);z-index:var(--nutui-menu-scroll-fixed-z-index, 1000);width:100%}.nut-menu-bar{position:relative;display:flex;line-height:var(--nutui-menu-bar-line-height, 48px);background-color:var(--nutui-gray-1, #ffffff);box-shadow:var(--nutui-menu-bar-box-shadow, 0 2px 12px rgba(89, 89, 89, .12))}.nut-menu-bar.opened{z-index:var(--nutui-menu-bar-opened-z-index, 1000)}.nut-menu-title{flex:1;text-align:center;font-size:var(--nutui-menu-title-font-size, var(--nutui-font-size-3, 14px));color:var(--nutui-menu-title-color, var(--nutui-gray-7, #1a1a1a));min-width:0;display:flex;align-items:center;justify-content:center;max-width:100%}.nut-menu-title-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;padding:var(--nutui-menu-title-padding, 0 8px)}.nut-menu-title-icon{transition:all .2s linear}.nut-menu-title.active{color:var(--nutui-menu-item-active-color, var(--nutui-color-primary, #fa2c19))}.nut-menu-title.disabled{color:var(--nutui-menu-item-disabled-color, var(--nutui-color-text-disabled, #bfbfbf))}.nut-menu-title.active .nut-menu-title-icon{transform:rotate(180deg)}
1
+ .nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-black-10, rgba(0, 0, 0, .7)));z-index:var(--nutui-overlay-zIndex, 1000)}.nut-overlay .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-1, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-7, #1a1a1a))}[dir=rtl] .nut-overlay,.nut-rtl .nut-overlay{left:auto;right:0}.nut-overflow-hidden,.nut-overflow-hidden .taro_page{overflow:hidden!important}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-overlay-slide-enter-active,.nut-overlay-slide-appear-active{animation-fill-mode:both;animation-name:nut-fade-in;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-overlay-slide-exit-active{animation-fill-mode:both;animation-name:nut-fade-out;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-menu-container-content{padding:var(--nutui-menu-content-padding, 12px 24px);max-height:var(--nutui-menu-content-max-height, 214px);overflow-y:auto;display:flex;flex-wrap:wrap;background:var(--nutui-menu-content-background-color, var(--nutui-gray-1, #ffffff))}.nut-menu-container-content_fixed{width:100%;opacity:0;position:fixed}.nut-menu-container-item{display:flex;align-items:center;color:var(--nutui-gray-7, #1a1a1a);font-size:var(--nutui-font-size-3, 14px);padding:var(--nutui-menu-item-padding, 12px 0)}.nut-menu-container-item.active{font-weight:var(--nutui-menu-item-active-font-weight, var(--nutui-font-weight-bold, 500));color:var(--nutui-menu-item-active-color, var(--nutui-color-primary, #fa2c19))}.nut-menu-container-item .nut-icon{display:inline-flex;align-items:center;margin-right:var(--nutui-menu-item-icon-margin, 8px);flex-shrink:0}.nut-menu-container-wrap,.nut-menu-container-wrap-up{position:absolute;width:100%;z-index:var(--nutui-menu-container-z-index, 1000);overflow:hidden}.nut-menu-container-wrap-up{bottom:var(--nutui-menu-bar-line-height, 48px)}.overlay-fade-enter-active.nut-menu-container-overlay{top:auto;z-index:var(--nutui-menu-container-z-index, 1000)}.nut-menu-placeholder-element{position:fixed;top:-var(--nutui-menu-bar-line-height,48px);left:0;right:0;z-index:var(--nutui-menu-bar-opened-z-index, 1000);background-color:transparent}.nut-menu-placeholder-element.up{bottom:-var(--nutui-menu-bar-line-height,48px)}.nut-menu-container-down-enter{opacity:0;transform:translateY(-30px)}.nut-menu-container-down-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-down-exit{opacity:1;transition:all .1s}.nut-menu-container-down-exit-done{opacity:0;transition:all .1s}.nut-menu-container-up-enter{opacity:0;transform:translateY(30px)}.nut-menu-container-up-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-up-exit{opacity:1;transition:all .1s}.nut-menu-container-up-exit-done{opacity:0;transition:all .1s}[dir=rtl] .nut-menu-container-item .nut-icon,.nut-rtl .nut-menu-container-item .nut-icon{margin-right:0;margin-left:var(--nutui-menu-item-icon-margin, 8px)}[dir=rtl] .nut-menu-container .nut-icon,.nut-rtl .nut-menu-container .nut-icon{transform:rotateY(180deg)}.nut-menu{position:relative}.nut-menu.scroll-fixed{position:fixed;top:var(--nutui-menu-scroll-fixed-top, 0);z-index:var(--nutui-menu-scroll-fixed-z-index, 1000);width:100%}.nut-menu-bar{position:relative;display:flex;line-height:var(--nutui-menu-bar-line-height, 48px);background-color:var(--nutui-gray-1, #ffffff);box-shadow:var(--nutui-menu-bar-box-shadow, 0 2px 12px rgba(89, 89, 89, .12))}.nut-menu-bar.opened{z-index:var(--nutui-menu-bar-opened-z-index, 1000)}.nut-menu-title{flex:1;text-align:center;font-size:var(--nutui-menu-title-font-size, var(--nutui-font-size-3, 14px));color:var(--nutui-menu-title-color, var(--nutui-gray-7, #1a1a1a));min-width:0;display:flex;align-items:center;justify-content:center;max-width:100%}.nut-menu-title-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;padding:var(--nutui-menu-title-padding, 0 8px)}.nut-menu-title-icon{flex-shrink:0;transition:all .2s linear}.nut-menu-title.active{color:var(--nutui-menu-item-active-color, var(--nutui-color-primary, #fa2c19))}.nut-menu-title.disabled{color:var(--nutui-menu-item-disabled-color, var(--nutui-color-text-disabled, #bfbfbf))}.nut-menu-title.active .nut-menu-title-icon{transform:rotate(180deg)}
package/dist/esm/Menu.js CHANGED
@@ -108,7 +108,6 @@ const Menu = (props) => {
108
108
  cloneChildren()
109
109
  );
110
110
  };
111
- Menu.defaultProps = defaultProps;
112
111
  Menu.displayName = "NutMenu";
113
112
  Menu.Item = MenuItem;
114
113
  export {
@@ -1 +1 @@
1
- .nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-black-10, rgba(0, 0, 0, .7)));z-index:var(--nutui-overlay-zIndex, 1000)}.nut-overlay .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-1, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-7, #1a1a1a))}[dir=rtl] .nut-overlay,.nut-rtl .nut-overlay{left:auto;right:0}.nut-overflow-hidden,.nut-overflow-hidden .taro_page{overflow:hidden!important}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-overlay-slide-enter-active,.nut-overlay-slide-appear-active{animation-fill-mode:both;animation-name:nut-fade-in;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-overlay-slide-exit-active{animation-fill-mode:both;animation-name:nut-fade-out;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-menu-container-content{padding:var(--nutui-menu-content-padding, 12px 24px);max-height:var(--nutui-menu-content-max-height, 214px);overflow-y:auto;display:flex;flex-wrap:wrap;background:var(--nutui-menu-content-background-color, var(--nutui-gray-1, #ffffff))}.nut-menu-container-content_fixed{width:100%;opacity:0;position:fixed}.nut-menu-container-item{display:flex;align-items:center;color:var(--nutui-gray-7, #1a1a1a);font-size:var(--nutui-font-size-3, 14px);padding:var(--nutui-menu-item-padding, 12px 0)}.nut-menu-container-item.active{font-weight:var(--nutui-menu-item-active-font-weight, var(--nutui-font-weight-bold, 500));color:var(--nutui-menu-item-active-color, var(--nutui-color-primary, #fa2c19))}.nut-menu-container-item .nut-icon{display:inline-flex;align-items:center;margin-right:var(--nutui-menu-item-icon-margin, 8px)}.nut-menu-container-wrap,.nut-menu-container-wrap-up{position:absolute;width:100%;z-index:var(--nutui-menu-container-z-index, 1000);overflow:hidden}.nut-menu-container-wrap-up{bottom:var(--nutui-menu-bar-line-height, 48px)}.overlay-fade-enter-active.nut-menu-container-overlay{top:auto;z-index:var(--nutui-menu-container-z-index, 1000)}.nut-menu-placeholder-element{position:fixed;top:-var(--nutui-menu-bar-line-height,48px);left:0;right:0;z-index:var(--nutui-menu-bar-opened-z-index, 1000);background-color:transparent}.nut-menu-placeholder-element.up{bottom:-var(--nutui-menu-bar-line-height,48px)}.nut-menu-container-down-enter{opacity:0;transform:translateY(-30px)}.nut-menu-container-down-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-down-exit{opacity:1;transition:all .1s}.nut-menu-container-down-exit-done{opacity:0;transition:all .1s}.nut-menu-container-up-enter{opacity:0;transform:translateY(30px)}.nut-menu-container-up-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-up-exit{opacity:1;transition:all .1s}.nut-menu-container-up-exit-done{opacity:0;transition:all .1s}[dir=rtl] .nut-menu-container-item .nut-icon,.nut-rtl .nut-menu-container-item .nut-icon{margin-right:0;margin-left:var(--nutui-menu-item-icon-margin, 8px)}[dir=rtl] .nut-menu-container .nut-icon,.nut-rtl .nut-menu-container .nut-icon{transform:rotateY(180deg)}
1
+ .nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-black-10, rgba(0, 0, 0, .7)));z-index:var(--nutui-overlay-zIndex, 1000)}.nut-overlay .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-1, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-7, #1a1a1a))}[dir=rtl] .nut-overlay,.nut-rtl .nut-overlay{left:auto;right:0}.nut-overflow-hidden,.nut-overflow-hidden .taro_page{overflow:hidden!important}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-overlay-slide-enter-active,.nut-overlay-slide-appear-active{animation-fill-mode:both;animation-name:nut-fade-in;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-overlay-slide-exit-active{animation-fill-mode:both;animation-name:nut-fade-out;animation-duration:var(--nutui-overlay-animation-duration, .3s)}.nut-menu-container-content{padding:var(--nutui-menu-content-padding, 12px 24px);max-height:var(--nutui-menu-content-max-height, 214px);overflow-y:auto;display:flex;flex-wrap:wrap;background:var(--nutui-menu-content-background-color, var(--nutui-gray-1, #ffffff))}.nut-menu-container-content_fixed{width:100%;opacity:0;position:fixed}.nut-menu-container-item{display:flex;align-items:center;color:var(--nutui-gray-7, #1a1a1a);font-size:var(--nutui-font-size-3, 14px);padding:var(--nutui-menu-item-padding, 12px 0)}.nut-menu-container-item.active{font-weight:var(--nutui-menu-item-active-font-weight, var(--nutui-font-weight-bold, 500));color:var(--nutui-menu-item-active-color, var(--nutui-color-primary, #fa2c19))}.nut-menu-container-item .nut-icon{display:inline-flex;align-items:center;margin-right:var(--nutui-menu-item-icon-margin, 8px);flex-shrink:0}.nut-menu-container-wrap,.nut-menu-container-wrap-up{position:absolute;width:100%;z-index:var(--nutui-menu-container-z-index, 1000);overflow:hidden}.nut-menu-container-wrap-up{bottom:var(--nutui-menu-bar-line-height, 48px)}.overlay-fade-enter-active.nut-menu-container-overlay{top:auto;z-index:var(--nutui-menu-container-z-index, 1000)}.nut-menu-placeholder-element{position:fixed;top:-var(--nutui-menu-bar-line-height,48px);left:0;right:0;z-index:var(--nutui-menu-bar-opened-z-index, 1000);background-color:transparent}.nut-menu-placeholder-element.up{bottom:-var(--nutui-menu-bar-line-height,48px)}.nut-menu-container-down-enter{opacity:0;transform:translateY(-30px)}.nut-menu-container-down-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-down-exit{opacity:1;transition:all .1s}.nut-menu-container-down-exit-done{opacity:0;transition:all .1s}.nut-menu-container-up-enter{opacity:0;transform:translateY(30px)}.nut-menu-container-up-enter-done{opacity:1;transform:translate(0);transition:all .1s}.nut-menu-container-up-exit{opacity:1;transition:all .1s}.nut-menu-container-up-exit-done{opacity:0;transition:all .1s}[dir=rtl] .nut-menu-container-item .nut-icon,.nut-rtl .nut-menu-container-item .nut-icon{margin-right:0;margin-left:var(--nutui-menu-item-icon-margin, 8px)}[dir=rtl] .nut-menu-container .nut-icon,.nut-rtl .nut-menu-container .nut-icon{transform:rotateY(180deg)}
@@ -340,7 +340,6 @@ const NoticeBar = (props) => {
340
340
  ) : null
341
341
  );
342
342
  };
343
- NoticeBar.defaultProps = defaultProps;
344
343
  NoticeBar.displayName = "NutNoticeBar";
345
344
  export {
346
345
  NoticeBar as default
@@ -5,7 +5,7 @@ import { ArrowDown } from "@nutui/icons-react";
5
5
  import Popup__default from "./Popup.js";
6
6
  import { useConfig } from "./ConfigProvider.js";
7
7
  import { C as ComponentDefaults } from "./typings.js";
8
- const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { visible: false, rightActions: "", type: "default", custom: [], random: false, onClose: () => {
8
+ Object.assign(Object.assign({}, ComponentDefaults), { visible: false, rightActions: "", type: "default", custom: [], random: false, onClose: () => {
9
9
  } });
10
10
  const NumberKeyboard = (props) => {
11
11
  const { locale } = useConfig();
@@ -121,7 +121,6 @@ const NumberKeyboard = (props) => {
121
121
  )
122
122
  );
123
123
  };
124
- NumberKeyboard.defaultProps = defaultProps;
125
124
  NumberKeyboard.displayName = "NutNumberKeyboard";
126
125
  export {
127
126
  NumberKeyboard as default
@@ -89,7 +89,6 @@ const Pagination = (props) => {
89
89
  )
90
90
  );
91
91
  };
92
- Pagination.defaultProps = defaultProps;
93
92
  Pagination.displayName = "NutPagination";
94
93
  export {
95
94
  Pagination as default
@@ -50,8 +50,7 @@ const Popover = (props) => {
50
50
  targetSet = [popoverRef.current, popoverContentRef.current];
51
51
  }
52
52
  useClickAway(() => {
53
- var _a2;
54
- (_a2 = props.onClick) === null || _a2 === void 0 ? void 0 : _a2.call(props);
53
+ onClick === null || onClick === void 0 ? void 0 : onClick();
55
54
  onClose === null || onClose === void 0 ? void 0 : onClose();
56
55
  }, targetSet, "touchstart", true, visible, closeOnOutsideClick);
57
56
  const scrollableParents = useMemo(() => {
@@ -129,7 +128,7 @@ const Popover = (props) => {
129
128
  const direction = location.split("-")[0];
130
129
  const skew = location.split("-")[1];
131
130
  const base = 16;
132
- if (props.arrowOffset !== 0) {
131
+ if (arrowOffset !== 0) {
133
132
  const dir = rtl ? "right" : "left";
134
133
  const dir2 = rtl ? "left" : "right";
135
134
  if (["bottom", "top"].includes(direction)) {
@@ -158,12 +157,11 @@ const Popover = (props) => {
158
157
  return styles;
159
158
  };
160
159
  const handleSelect = (item, index) => {
161
- var _a2;
162
160
  if (!item.disabled) {
163
161
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(item, index);
164
162
  }
165
163
  if (closeOnActionClick) {
166
- (_a2 = props.onClick) === null || _a2 === void 0 ? void 0 : _a2.call(props);
164
+ onClick === null || onClick === void 0 ? void 0 : onClick();
167
165
  onClose === null || onClose === void 0 ? void 0 : onClose();
168
166
  }
169
167
  };
@@ -171,8 +169,7 @@ const Popover = (props) => {
171
169
  React__default.Fragment,
172
170
  null,
173
171
  !targetId && React__default.createElement("div", { className: "nut-popover-wrapper", ref: popoverRef, onClick: () => {
174
- var _a2;
175
- (_a2 = props.onClick) === null || _a2 === void 0 ? void 0 : _a2.call(props);
172
+ onClick === null || onClick === void 0 ? void 0 : onClick();
176
173
  if (!visible) {
177
174
  onOpen === null || onOpen === void 0 ? void 0 : onOpen();
178
175
  } else {
@@ -210,7 +207,6 @@ const Popover = (props) => {
210
207
  ), document.body)
211
208
  );
212
209
  };
213
- Popover.defaultProps = defaultProps;
214
210
  Popover.displayName = "NutPopover";
215
211
  export {
216
212
  Popover as default
package/dist/esm/Price.js CHANGED
@@ -53,7 +53,6 @@ const Price = (props) => {
53
53
  symbol && position === "after" ? renderSymbol() : null
54
54
  );
55
55
  };
56
- Price.defaultProps = defaultProps;
57
56
  Price.displayName = "NutPrice";
58
57
  export {
59
58
  Price as default
@@ -84,7 +84,6 @@ const Progress = (props) => {
84
84
  )
85
85
  );
86
86
  };
87
- Progress.defaultProps = defaultProps;
88
87
  Progress.displayName = "NutProgress";
89
88
  export {
90
89
  Progress as default
package/dist/esm/Range.js CHANGED
@@ -258,7 +258,6 @@ const Range = (props) => {
258
258
  maxDescription !== null && React__default.createElement("div", { className: "max" }, maxDescription || max)
259
259
  );
260
260
  };
261
- Range.defaultProps = defaultProps;
262
261
  Range.displayName = "NutRange";
263
262
  export {
264
263
  Range as default
package/dist/esm/Rate.js CHANGED
@@ -137,7 +137,6 @@ const Rate = (props) => {
137
137
  );
138
138
  }));
139
139
  };
140
- Rate.defaultProps = defaultProps;
141
140
  Rate.displayName = "NutRate";
142
141
  export {
143
142
  Rate as default
@@ -7,8 +7,8 @@ const SearchBar = (props) => {
7
7
  const classPrefix = "nut-searchbar";
8
8
  const { locale } = useConfig();
9
9
  const searchRef = useRef(null);
10
- const [value, setValue] = useState(() => props.value);
11
- const { placeholder, shape, className, disabled, maxLength, clearable, readOnly, autoFocus, backable, right, left, leftIn, rightIn, onChange, onFocus, onBlur, onClear, onSearch, onInputClick } = Object.assign(Object.assign({}, defaultProps), props);
10
+ const { value: outerValue, style, placeholder, shape, className, disabled, maxLength, clearable, readOnly, autoFocus, backable, right, left, leftIn, rightIn, onChange, onFocus, onBlur, onClear, onSearch, onInputClick } = Object.assign(Object.assign({}, defaultProps), props);
11
+ const [value, setValue] = useState(() => outerValue);
12
12
  const forceFocus = () => {
13
13
  const searchSelf = searchRef.current;
14
14
  searchSelf && searchSelf.focus();
@@ -29,13 +29,13 @@ const SearchBar = (props) => {
29
29
  onBlur && (onBlur === null || onBlur === void 0 ? void 0 : onBlur(value2, event));
30
30
  };
31
31
  useEffect(() => {
32
- setValue(props.value);
33
- }, [props.value]);
32
+ setValue(outerValue);
33
+ }, [outerValue]);
34
34
  useEffect(() => {
35
35
  autoFocus && forceFocus();
36
36
  }, [autoFocus]);
37
37
  const renderField = () => {
38
- return React__default.createElement("input", { className: `${classPrefix}-input ${clearable ? `${classPrefix}-input-clear` : ""}`, ref: searchRef, style: Object.assign({}, props.style), value: value || "", placeholder: placeholder || locale.placeholder, disabled, readOnly, maxLength, onKeyDown: onKeydown, onChange: (e) => change(e), onFocus: (e) => focus(e), onBlur: (e) => blur(e), onClick: (e) => clickInput(e) });
38
+ return React__default.createElement("input", { className: `${classPrefix}-input ${clearable ? `${classPrefix}-input-clear` : ""}`, ref: searchRef, style, value: value || "", placeholder: placeholder || locale.placeholder, disabled, readOnly, maxLength, onKeyDown: onKeydown, onChange: (e) => change(e), onFocus: (e) => focus(e), onBlur: (e) => blur(e), onClick: (e) => clickInput(e) });
39
39
  };
40
40
  const clickInput = (e) => {
41
41
  onInputClick && onInputClick(e);
@@ -86,7 +86,7 @@ const SearchBar = (props) => {
86
86
  };
87
87
  return React__default.createElement(
88
88
  "div",
89
- { className: `${classPrefix} ${disabled ? `${classPrefix}-disabled` : ""} ${className || ""}`, style: Object.assign({}, props.style) },
89
+ { className: `${classPrefix} ${disabled ? `${classPrefix}-disabled` : ""} ${className || ""}`, style },
90
90
  renderLeft(),
91
91
  React__default.createElement(
92
92
  "div",
@@ -99,7 +99,6 @@ const SearchBar = (props) => {
99
99
  renderRight()
100
100
  );
101
101
  };
102
- SearchBar.defaultProps = defaultProps;
103
102
  SearchBar.displayName = "NutSearchBar";
104
103
  export {
105
104
  SearchBar as default
@@ -9,7 +9,7 @@ import { u as usePropsValue } from "./use-props-value.js";
9
9
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { value: "", visible: false, plain: false, hideFooter: true, length: 6, autoFocus: false });
10
10
  const InternalShortPassword = (props, ref) => {
11
11
  const { locale } = useConfig();
12
- const _a = Object.assign(Object.assign({}, defaultProps), props), { title, description, tips, visible: deleteVisible, value, error, hideFooter, length, plain, style, className, closeable, autoFocus, onFocus, onChange, onConfirm, onTips, onCancel, onClose, onComplete, onOverlayClick, onCloseIconClick } = _a, rest = __rest(_a, ["title", "description", "tips", "visible", "value", "error", "hideFooter", "length", "plain", "style", "className", "closeable", "autoFocus", "onFocus", "onChange", "onConfirm", "onTips", "onCancel", "onClose", "onComplete", "onOverlayClick", "onCloseIconClick"]);
12
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { title, description, tips, visible: outerVisible, value, error, hideFooter, length, plain, style, className, closeable, autoFocus, onFocus, onChange, onConfirm, onTips, onCancel, onClose, onComplete, onOverlayClick, onCloseIconClick } = _a, rest = __rest(_a, ["title", "description", "tips", "visible", "value", "error", "hideFooter", "length", "plain", "style", "className", "closeable", "autoFocus", "onFocus", "onChange", "onConfirm", "onTips", "onCancel", "onClose", "onComplete", "onOverlayClick", "onCloseIconClick"]);
13
13
  const classPrefix = "nut-shortpassword";
14
14
  const comLen = useMemo(() => {
15
15
  return Math.min(Math.max(4, length || 4), 6);
@@ -18,7 +18,7 @@ const InternalShortPassword = (props, ref) => {
18
18
  return val.slice(0, comLen);
19
19
  };
20
20
  const [visible, setVisible] = usePropsValue({
21
- value: props.visible,
21
+ value: outerVisible,
22
22
  defaultValue: false,
23
23
  finalValue: false
24
24
  });
@@ -113,7 +113,6 @@ const InternalSignature = (props, ref) => {
113
113
  );
114
114
  };
115
115
  const Signature = React__default.forwardRef(InternalSignature);
116
- Signature.defaultProps = defaultProps;
117
116
  Signature.displayName = "NutSignature";
118
117
  export {
119
118
  Signature as default