@nutui/nutui-react 2.6.14 → 2.6.16

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 (49) hide show
  1. package/CHANGELOG.md +931 -909
  2. package/README.md +21 -28
  3. package/dist/esm/Audio.js +10 -11
  4. package/dist/esm/CalendarItem.js +3 -1
  5. package/dist/esm/CheckboxGroup.js +4 -5
  6. package/dist/esm/DatePicker.js +3 -4
  7. package/dist/esm/Dialog.js +1 -2
  8. package/dist/esm/InputNumber.js +26 -9
  9. package/dist/esm/Menu.js +11 -4
  10. package/dist/esm/NumberKeyboard.js +38 -27
  11. package/dist/esm/PullToRefresh.js +0 -1
  12. package/dist/esm/RadioGroup.js +0 -1
  13. package/dist/esm/Sticky.js +24 -30
  14. package/dist/esm/Swipe.js +0 -1
  15. package/dist/esm/Swiper.js +0 -1
  16. package/dist/esm/SwiperItem.js +0 -1
  17. package/dist/esm/Table.js +6 -5
  18. package/dist/esm/Uploader/style/style.css +1 -1
  19. package/dist/esm/Uploader.js +12 -11
  20. package/dist/esm/WaterMark.js +3 -3
  21. package/dist/esm/formitem2.js +2 -2
  22. package/dist/esm/menuitem2.js +1 -1
  23. package/dist/esm/radio2.js +0 -1
  24. package/dist/locales/base.js +1 -1
  25. package/dist/locales/en-US.js +1 -1
  26. package/dist/locales/id-ID.js +1 -1
  27. package/dist/locales/tr-TR.js +1 -1
  28. package/dist/locales/zh-CN.js +1 -1
  29. package/dist/locales/zh-TW.js +1 -1
  30. package/dist/locales/zh-UG.js +1 -1
  31. package/dist/nutui.react.es.js +257 -224
  32. package/dist/nutui.react.umd.js +257 -224
  33. package/dist/packages/uploader/uploader.scss +3 -1
  34. package/dist/style.css +1 -1
  35. package/dist/types/packages/cell/cell.d.ts +2 -2
  36. package/dist/types/packages/cell/cell.taro.d.ts +1 -1
  37. package/dist/types/packages/formitem/formitem.d.ts +5 -0
  38. package/dist/types/packages/formitem/formitem.taro.d.ts +1 -0
  39. package/dist/types/packages/inputnumber/inputnumber.d.ts +1 -1
  40. package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +1 -1
  41. package/dist/types/packages/menuitem/menuitem.d.ts +5 -0
  42. package/dist/types/packages/menuitem/menuitem.taro.d.ts +1 -0
  43. package/dist/types/packages/swiper/swiper.taro.d.ts +2 -1
  44. package/dist/types/packages/swiperitem/swiperitem.d.ts +0 -1
  45. package/dist/types/packages/watermark/watermark.d.ts +10 -0
  46. package/dist/types/packages/watermark/watermark.taro.d.ts +2 -0
  47. package/dist/types/utils/get-scroll-parent.d.ts +1 -1
  48. package/dist/types/utils/use-client-rect.d.ts +1 -1
  49. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.6.14 Fri Jul 19 2024 16:21:28 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.16 Sat Aug 03 2024 09:49:59 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -530,7 +530,7 @@ const ComponentDefaults = {
530
530
  style: {}
531
531
  };
532
532
  const prefixCls$2 = "nut-button";
533
- const defaultProps$1t = {
533
+ const defaultProps$1u = {
534
534
  ...ComponentDefaults,
535
535
  color: "",
536
536
  type: "default",
@@ -566,7 +566,7 @@ const Button = React__default.forwardRef(
566
566
  onClick,
567
567
  ...rest
568
568
  } = {
569
- ...defaultProps$1t,
569
+ ...defaultProps$1u,
570
570
  ...props
571
571
  };
572
572
  const getStyle = useCallback(() => {
@@ -625,7 +625,7 @@ const Button = React__default.forwardRef(
625
625
  );
626
626
  Button.displayName = "NutButton";
627
627
  const CellGroupContext = createContext(null);
628
- const defaultProps$1s = {
628
+ const defaultProps$1t = {
629
629
  ...ComponentDefaults,
630
630
  title: "",
631
631
  description: "",
@@ -634,7 +634,7 @@ const defaultProps$1s = {
634
634
  const classPrefix$r = "nut-cell-group";
635
635
  const CellGroup = (props) => {
636
636
  const { children, className, title, description, divider, ...rest } = {
637
- ...defaultProps$1s,
637
+ ...defaultProps$1t,
638
638
  ...props
639
639
  };
640
640
  return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix$r, className), ...rest }, title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$r}-title` }, title) : null, description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$r}-description` }, description) : null, /* @__PURE__ */ React__default.createElement(
@@ -646,7 +646,7 @@ const CellGroup = (props) => {
646
646
  ));
647
647
  };
648
648
  CellGroup.displayName = "NutCellGroup";
649
- const defaultProps$1r = {
649
+ const defaultProps$1s = {
650
650
  ...ComponentDefaults,
651
651
  title: null,
652
652
  description: null,
@@ -671,7 +671,7 @@ const Cell = (props) => {
671
671
  style,
672
672
  ...rest
673
673
  } = {
674
- ...defaultProps$1r,
674
+ ...defaultProps$1s,
675
675
  ...props
676
676
  };
677
677
  const handleClick2 = (event) => {
@@ -1862,7 +1862,7 @@ ConfigProvider.displayName = "NutConfigProvider";
1862
1862
  const pxCheck = (value) => {
1863
1863
  return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
1864
1864
  };
1865
- const defaultProps$1q = {
1865
+ const defaultProps$1r = {
1866
1866
  ...ComponentDefaults,
1867
1867
  fit: "fill",
1868
1868
  position: "center",
@@ -1892,7 +1892,7 @@ const Image$1 = (props) => {
1892
1892
  onClick,
1893
1893
  onLoad,
1894
1894
  onError
1895
- } = { ...defaultProps$1q, ...props };
1895
+ } = { ...defaultProps$1r, ...props };
1896
1896
  const [innerLoading, setInnerLoading] = useState(false);
1897
1897
  const [isError, setIsError] = useState(false);
1898
1898
  const [complete, setComplete] = useState(false);
@@ -2754,7 +2754,7 @@ const Overlay = (props) => {
2754
2754
  };
2755
2755
  Overlay.displayName = "NutOverlay";
2756
2756
  const DataContext$1 = createContext({});
2757
- const defaultProps$1p = {
2757
+ const defaultProps$1q = {
2758
2758
  ...ComponentDefaults,
2759
2759
  span: "24",
2760
2760
  offset: "0",
@@ -2762,7 +2762,7 @@ const defaultProps$1p = {
2762
2762
  };
2763
2763
  const Col = (props) => {
2764
2764
  const { className, style, span, offset, children, onClick } = {
2765
- ...defaultProps$1p,
2765
+ ...defaultProps$1q,
2766
2766
  ...props
2767
2767
  };
2768
2768
  const [colName, setColName] = useState("");
@@ -2795,7 +2795,7 @@ const Col = (props) => {
2795
2795
  );
2796
2796
  };
2797
2797
  Col.displayName = "NutCol";
2798
- const defaultProps$1o = {
2798
+ const defaultProps$1p = {
2799
2799
  ...ComponentDefaults,
2800
2800
  contentPosition: "center",
2801
2801
  direction: "horizontal"
@@ -2803,7 +2803,7 @@ const defaultProps$1o = {
2803
2803
  const classPrefix$n = `nut-divider`;
2804
2804
  const Divider = (props) => {
2805
2805
  const { children, contentPosition, style, className, direction, ...rest } = {
2806
- ...defaultProps$1o,
2806
+ ...defaultProps$1p,
2807
2807
  ...props
2808
2808
  };
2809
2809
  const classes = direction === "horizontal" ? classNames({
@@ -2824,7 +2824,7 @@ const gridContext = {
2824
2824
  }
2825
2825
  };
2826
2826
  const GridContext = React__default.createContext(gridContext);
2827
- const defaultProps$1n = {
2827
+ const defaultProps$1o = {
2828
2828
  text: "",
2829
2829
  columns: 4,
2830
2830
  gap: 0,
@@ -2850,7 +2850,7 @@ const GridItem = (props) => {
2850
2850
  onClick,
2851
2851
  ...rest
2852
2852
  } = {
2853
- ...defaultProps$1n,
2853
+ ...defaultProps$1o,
2854
2854
  ...props
2855
2855
  };
2856
2856
  const classPrefix2 = "nut-grid-item";
@@ -2909,7 +2909,7 @@ const GridItem = (props) => {
2909
2909
  );
2910
2910
  };
2911
2911
  GridItem.displayName = "NutGridItem";
2912
- const defaultProps$1m = {
2912
+ const defaultProps$1n = {
2913
2913
  columns: 4,
2914
2914
  gap: 0,
2915
2915
  center: true,
@@ -2930,7 +2930,7 @@ const Grid = (props) => {
2930
2930
  className,
2931
2931
  onClick,
2932
2932
  ...rest
2933
- } = { ...defaultProps$1m, ...props };
2933
+ } = { ...defaultProps$1n, ...props };
2934
2934
  const childrenDom = React__default.Children.toArray(children);
2935
2935
  const classPrefix2 = "nut-grid";
2936
2936
  const rootClass = () => {
@@ -2966,14 +2966,14 @@ const Grid = (props) => {
2966
2966
  };
2967
2967
  Grid.displayName = "NutGrid";
2968
2968
  Grid.Item = GridItem;
2969
- const defaultProps$1l = {};
2969
+ const defaultProps$1m = {};
2970
2970
  const Layout = (props) => {
2971
- ({ ...defaultProps$1l, ...props });
2971
+ ({ ...defaultProps$1m, ...props });
2972
2972
  return /* @__PURE__ */ React__default.createElement("div", { className: "nut-layout" }, "Layout");
2973
2973
  };
2974
2974
  Layout.displayName = "NutLayout";
2975
2975
  const classPrefix$m = "nut-row";
2976
- const defaultProps$1k = {
2976
+ const defaultProps$1l = {
2977
2977
  ...ComponentDefaults,
2978
2978
  type: "",
2979
2979
  justify: "start",
@@ -2993,7 +2993,7 @@ const Row = (props) => {
2993
2993
  gutter,
2994
2994
  onClick
2995
2995
  } = {
2996
- ...defaultProps$1k,
2996
+ ...defaultProps$1l,
2997
2997
  ...props
2998
2998
  };
2999
2999
  const getClass = (prefix2, type22) => {
@@ -3027,12 +3027,12 @@ const Row = (props) => {
3027
3027
  };
3028
3028
  Row.displayName = "NutRow";
3029
3029
  const prefixCls$1 = "nut-space";
3030
- const defaultProps$1j = {
3030
+ const defaultProps$1k = {
3031
3031
  direction: "horizontal"
3032
3032
  };
3033
3033
  const Space = (props) => {
3034
3034
  const { className, style, children, wrap, align, direction, justify } = {
3035
- ...defaultProps$1j,
3035
+ ...defaultProps$1k,
3036
3036
  ...props
3037
3037
  };
3038
3038
  const cls = classNames(
@@ -3100,7 +3100,7 @@ function useWatch(dep, callback, config2 = { immediate: false }) {
3100
3100
  stop2.current = true;
3101
3101
  };
3102
3102
  }
3103
- const defaultProps$1i = {
3103
+ const defaultProps$1j = {
3104
3104
  ...ComponentDefaults,
3105
3105
  position: "top",
3106
3106
  threshold: 0,
@@ -3118,7 +3118,7 @@ const Sticky = (props) => {
3118
3118
  threshold,
3119
3119
  onChange,
3120
3120
  ...rest
3121
- } = { ...defaultProps$1i, ...props };
3121
+ } = { ...defaultProps$1j, ...props };
3122
3122
  const stickyRef = useRef(null);
3123
3123
  const rootRef = useRef(null);
3124
3124
  const [isFixed, setIsFixed] = useState(false);
@@ -3132,13 +3132,14 @@ const Sticky = (props) => {
3132
3132
  }, []);
3133
3133
  useEffect(() => {
3134
3134
  if (position === "top") return;
3135
- const containerEle = container == null ? void 0 : container.current;
3136
- if (!rootRef.current && !containerEle) return;
3137
- const rootRect = getRect(rootRef.current);
3135
+ const containerEle = container && container.current;
3136
+ const rootEle = rootRef.current;
3137
+ const stickyEle = stickyRef.current;
3138
+ if (!rootEle && !containerEle) return;
3139
+ const rootRect = getRect(rootEle);
3138
3140
  const containerRect = getRect(containerEle);
3139
3141
  const clientHeight = document.documentElement.clientHeight;
3140
- const stCurrent = stickyRef.current;
3141
- const stickyRect = getRect(stCurrent);
3142
+ const stickyRect = getRect(stickyEle);
3142
3143
  let fixed = clientHeight - threshold < rootRect.bottom;
3143
3144
  if (containerEle) {
3144
3145
  fixed = containerRect.bottom > clientHeight - threshold - stickyRect.height && clientHeight - threshold - stickyRect.height > containerRect.top;
@@ -3153,19 +3154,18 @@ const Sticky = (props) => {
3153
3154
  setIsFixed(fixed);
3154
3155
  }, [position, container, threshold]);
3155
3156
  const handleScroll = useCallback(() => {
3156
- const containerEle = container == null ? void 0 : container.current;
3157
- if (!rootRef.current && !containerEle) return;
3158
- const rootRect = getRect(rootRef.current);
3159
- const stCurrent = stickyRef.current;
3160
- const stickyRect = getRect(stCurrent);
3157
+ const containerEle = container && container.current;
3158
+ const rootEle = rootRef.current;
3159
+ const stickyEle = stickyRef.current;
3160
+ if (!rootEle && !containerEle) return;
3161
+ const rootRect = getRect(rootEle);
3162
+ const stickyRect = getRect(stickyEle);
3161
3163
  const containerRect = getRect(containerEle);
3162
3164
  if (rootRect.height) {
3163
- setRootStyle((prev) => {
3164
- return {
3165
- ...prev,
3166
- height: rootRect.height
3167
- };
3168
- });
3165
+ setRootStyle((prev) => ({
3166
+ ...prev,
3167
+ height: rootRect.height
3168
+ }));
3169
3169
  }
3170
3170
  const getFixed = () => {
3171
3171
  let fixed2 = false;
@@ -3181,22 +3181,16 @@ const Sticky = (props) => {
3181
3181
  };
3182
3182
  };
3183
3183
  const getTransform = () => {
3184
- if (position === "top") {
3185
- if (containerEle) {
3186
- const diff = containerRect.bottom - threshold - stickyRect.height;
3187
- const transform = diff < 0 ? diff : 0;
3188
- return { transform: `translate3d(0, ${transform}px, 0)` };
3189
- }
3190
- return {};
3184
+ if (position === "top" && containerEle) {
3185
+ const diff = containerRect.bottom - threshold - stickyRect.height;
3186
+ const transform = diff < 0 ? diff : 0;
3187
+ return { transform: `translate3d(0, ${transform}px, 0)` };
3191
3188
  }
3192
- if (position === "bottom") {
3193
- if (containerEle) {
3194
- const clientHeight = document.documentElement.clientHeight;
3195
- const diff = containerRect.bottom - (clientHeight - threshold);
3196
- const transform = diff < 0 ? diff : 0;
3197
- return { transform: `translate3d(0, ${transform}px, 0)` };
3198
- }
3199
- return {};
3189
+ if (position === "bottom" && containerEle) {
3190
+ const clientHeight = document.documentElement.clientHeight;
3191
+ const diff = containerRect.bottom - (clientHeight - threshold);
3192
+ const transform = diff < 0 ? diff : 0;
3193
+ return { transform: `translate3d(0, ${transform}px, 0)` };
3200
3194
  }
3201
3195
  return {};
3202
3196
  };
@@ -3215,9 +3209,9 @@ const Sticky = (props) => {
3215
3209
  });
3216
3210
  useEffect(() => {
3217
3211
  const el = getElement();
3218
- el.addEventListener("scroll", handleScroll, false);
3212
+ el == null ? void 0 : el.addEventListener("scroll", handleScroll, false);
3219
3213
  return () => {
3220
- el.removeEventListener("scroll", handleScroll);
3214
+ el == null ? void 0 : el.removeEventListener("scroll", handleScroll);
3221
3215
  };
3222
3216
  }, [getElement, handleScroll]);
3223
3217
  return /* @__PURE__ */ React__default.createElement(
@@ -3245,7 +3239,7 @@ const SafeArea = (props) => {
3245
3239
  );
3246
3240
  };
3247
3241
  SafeArea.displayName = "NutSafeArea";
3248
- const defaultProps$1h = {
3242
+ const defaultProps$1i = {
3249
3243
  ...ComponentDefaults,
3250
3244
  target: "",
3251
3245
  threshold: 200,
@@ -3264,7 +3258,7 @@ const BackTop = (props) => {
3264
3258
  style,
3265
3259
  onClick
3266
3260
  } = {
3267
- ...defaultProps$1h,
3261
+ ...defaultProps$1i,
3268
3262
  ...props
3269
3263
  };
3270
3264
  const classPrefix2 = "nut-backtop";
@@ -8182,7 +8176,7 @@ const host = createHost(primitives, {
8182
8176
  });
8183
8177
  const animated = host.animated;
8184
8178
  const elevatorContext = createContext({});
8185
- const defaultProps$1g = {
8179
+ const defaultProps$1h = {
8186
8180
  ...ComponentDefaults,
8187
8181
  height: "200px",
8188
8182
  floorKey: "title",
@@ -8208,7 +8202,7 @@ const Elevator = (props) => {
8208
8202
  children,
8209
8203
  ...rest
8210
8204
  } = {
8211
- ...defaultProps$1g,
8205
+ ...defaultProps$1h,
8212
8206
  ...props
8213
8207
  };
8214
8208
  const classPrefix2 = "nut-elevator";
@@ -8386,7 +8380,7 @@ const Elevator = (props) => {
8386
8380
  };
8387
8381
  Elevator.displayName = "NutElevator";
8388
8382
  Elevator.Context = elevatorContext;
8389
- const defaultProps$1f = {
8383
+ const defaultProps$1g = {
8390
8384
  ...ComponentDefaults,
8391
8385
  activeText: "",
8392
8386
  inactiveText: "",
@@ -8414,7 +8408,7 @@ const FixedNav = (props) => {
8414
8408
  content,
8415
8409
  ...rest
8416
8410
  } = {
8417
- ...defaultProps$1f,
8411
+ ...defaultProps$1g,
8418
8412
  ...props
8419
8413
  };
8420
8414
  const classPrefix2 = "nut-fixednav";
@@ -8467,7 +8461,7 @@ const FixedNav = (props) => {
8467
8461
  );
8468
8462
  };
8469
8463
  FixedNav.displayName = "NutFixedNav";
8470
- const defaultProps$1e = {
8464
+ const defaultProps$1f = {
8471
8465
  ...ComponentDefaults,
8472
8466
  left: "",
8473
8467
  right: "",
@@ -8492,7 +8486,7 @@ const NavBar = (props) => {
8492
8486
  zIndex,
8493
8487
  onBackClick
8494
8488
  } = {
8495
- ...defaultProps$1e,
8489
+ ...defaultProps$1f,
8496
8490
  ...props
8497
8491
  };
8498
8492
  const classPrefix2 = "nut-navbar";
@@ -8569,7 +8563,7 @@ const NavBar = (props) => {
8569
8563
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-placeholder` }, renderWrapper()) : renderWrapper());
8570
8564
  };
8571
8565
  NavBar.displayName = "NutNavBar";
8572
- const defaultProps$1d = {
8566
+ const defaultProps$1e = {
8573
8567
  ...ComponentDefaults,
8574
8568
  position: "center",
8575
8569
  transition: "",
@@ -8622,7 +8616,7 @@ const Popup = (props) => {
8622
8616
  afterShow,
8623
8617
  afterClose,
8624
8618
  onClick
8625
- } = { ...defaultProps$1d, ...props };
8619
+ } = { ...defaultProps$1e, ...props };
8626
8620
  const nodeRef = React__default.useRef(null);
8627
8621
  let innerIndex = zIndex || _zIndex;
8628
8622
  const [index, setIndex] = useState(innerIndex);
@@ -8778,7 +8772,7 @@ const handleClick = (e2) => {
8778
8772
  }
8779
8773
  };
8780
8774
  const OffsetContext = createContext(20);
8781
- const defaultProps$1c = {
8775
+ const defaultProps$1d = {
8782
8776
  ...ComponentDefaults,
8783
8777
  position: "left",
8784
8778
  width: "80%"
@@ -8796,7 +8790,7 @@ const SideNavBar = (props) => {
8796
8790
  indent,
8797
8791
  ...rest
8798
8792
  } = {
8799
- ...defaultProps$1c,
8793
+ ...defaultProps$1d,
8800
8794
  ...props
8801
8795
  };
8802
8796
  const innerIndent = indent ? Number(indent) : 20;
@@ -8846,13 +8840,13 @@ const SideNavBarItem = (props) => {
8846
8840
  title
8847
8841
  );
8848
8842
  };
8849
- const defaultProps$1b = {
8843
+ const defaultProps$1c = {
8850
8844
  open: true
8851
8845
  };
8852
8846
  const SubSideNavBar = (props) => {
8853
8847
  const classPrefix2 = "nut-subsidenavbar";
8854
8848
  const { title, value, children, onClick, open, ...rest } = {
8855
- ...defaultProps$1b,
8849
+ ...defaultProps$1c,
8856
8850
  ...props
8857
8851
  };
8858
8852
  const offset = useContext(OffsetContext);
@@ -8929,7 +8923,7 @@ function usePropsValue({
8929
8923
  );
8930
8924
  return [stateRef.current, setState];
8931
8925
  }
8932
- const defaultProps$1a = {
8926
+ const defaultProps$1b = {
8933
8927
  ...ComponentDefaults,
8934
8928
  value: "",
8935
8929
  dot: false,
@@ -8954,7 +8948,7 @@ const Badge = (props) => {
8954
8948
  color,
8955
8949
  fill
8956
8950
  } = {
8957
- ...defaultProps$1a,
8951
+ ...defaultProps$1b,
8958
8952
  ...props
8959
8953
  };
8960
8954
  const classPrefix2 = "nut-badge";
@@ -9008,7 +9002,7 @@ const Badge = (props) => {
9008
9002
  };
9009
9003
  Badge.displayName = "NutBadge";
9010
9004
  const TabbarContext = React__default.createContext(null);
9011
- const defaultProps$19 = {
9005
+ const defaultProps$1a = {
9012
9006
  ...ComponentDefaults,
9013
9007
  title: "",
9014
9008
  icon: null,
@@ -9034,7 +9028,7 @@ const TabbarItem = (props) => {
9034
9028
  index,
9035
9029
  ...rest
9036
9030
  } = {
9037
- ...defaultProps$19,
9031
+ ...defaultProps$1a,
9038
9032
  ...props
9039
9033
  };
9040
9034
  const active = index === (ctx2 == null ? void 0 : ctx2.selectIndex);
@@ -9072,7 +9066,7 @@ const TabbarItem = (props) => {
9072
9066
  icon ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Badge, { ...badgeProps }, /* @__PURE__ */ React__default.createElement("div", { className: boxPrefix }, icon)), /* @__PURE__ */ React__default.createElement("div", { className: titleClass }, title)) : /* @__PURE__ */ React__default.createElement(Badge, { ...badgeProps }, /* @__PURE__ */ React__default.createElement("div", { className: titleClass }, title))
9073
9067
  );
9074
9068
  };
9075
- const defaultProps$18 = {
9069
+ const defaultProps$19 = {
9076
9070
  ...ComponentDefaults,
9077
9071
  defaultValue: 0,
9078
9072
  fixed: false,
@@ -9095,7 +9089,7 @@ const Tabbar = (props) => {
9095
9089
  style,
9096
9090
  onSwitch
9097
9091
  } = {
9098
- ...defaultProps$18,
9092
+ ...defaultProps$19,
9099
9093
  ...props
9100
9094
  };
9101
9095
  const classPrefix2 = "nut-tabbar";
@@ -9137,14 +9131,14 @@ const Tabbar = (props) => {
9137
9131
  };
9138
9132
  Tabbar.displayName = "NutTabbar";
9139
9133
  Tabbar.Item = TabbarItem;
9140
- const defaultProps$17 = {
9134
+ const defaultProps$18 = {
9141
9135
  title: "",
9142
9136
  value: "",
9143
9137
  disabled: false
9144
9138
  };
9145
9139
  const TabPane = (props) => {
9146
9140
  const { children, autoHeightClassName, className, disabled } = {
9147
- ...defaultProps$17,
9141
+ ...defaultProps$18,
9148
9142
  ...props
9149
9143
  };
9150
9144
  const classPrefix2 = "nut-tabpane";
@@ -9158,7 +9152,7 @@ const TabPane = (props) => {
9158
9152
  );
9159
9153
  return children ? /* @__PURE__ */ React__default.createElement("div", { className: classes }, !disabled && children) : null;
9160
9154
  };
9161
- const defaultProps$16 = {
9155
+ const defaultProps$17 = {
9162
9156
  ...ComponentDefaults,
9163
9157
  tabStyle: {},
9164
9158
  activeColor: "",
@@ -9187,7 +9181,7 @@ const Tabs = (props) => {
9187
9181
  defaultValue: outerDefaultValue,
9188
9182
  ...rest
9189
9183
  } = {
9190
- ...defaultProps$16,
9184
+ ...defaultProps$17,
9191
9185
  ...props
9192
9186
  };
9193
9187
  const [value, setValue] = usePropsValue({
@@ -9495,7 +9489,7 @@ class Tree {
9495
9489
  return pathNodes;
9496
9490
  }
9497
9491
  }
9498
- const defaultProps$15 = {
9492
+ const defaultProps$16 = {
9499
9493
  ...ComponentDefaults,
9500
9494
  activeColor: "",
9501
9495
  activeIcon: "checklist",
@@ -9540,7 +9534,7 @@ const InternalCascader = (props, ref) => {
9540
9534
  onClose,
9541
9535
  onChange,
9542
9536
  onPathChange
9543
- } = { ...defaultProps$15, ...props };
9537
+ } = { ...defaultProps$16, ...props };
9544
9538
  const [tabvalue, setTabvalue] = useState("c1");
9545
9539
  const [optionsData, setOptionsData] = useState([]);
9546
9540
  const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
@@ -9847,7 +9841,7 @@ const InternalCascader = (props, ref) => {
9847
9841
  };
9848
9842
  const Cascader = React__default.forwardRef(InternalCascader);
9849
9843
  Cascader.displayName = "NutCascader";
9850
- const defaultProps$14 = {
9844
+ const defaultProps$15 = {
9851
9845
  ...ComponentDefaults,
9852
9846
  visible: false,
9853
9847
  type: "custom",
@@ -9874,7 +9868,7 @@ const CustomRender = (props) => {
9874
9868
  onPathChange,
9875
9869
  ...rest
9876
9870
  } = {
9877
- ...defaultProps$14,
9871
+ ...defaultProps$15,
9878
9872
  ...props
9879
9873
  };
9880
9874
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, type4 === "custom" && /* @__PURE__ */ React__default.createElement(
@@ -9899,7 +9893,7 @@ const CustomRender = (props) => {
9899
9893
  }
9900
9894
  ));
9901
9895
  };
9902
- const defaultProps$13 = {
9896
+ const defaultProps$14 = {
9903
9897
  type: "custom",
9904
9898
  existList: [],
9905
9899
  defaultIcon: null,
@@ -9918,7 +9912,7 @@ const ExistRender = (props) => {
9918
9912
  onSelect,
9919
9913
  onSwitch,
9920
9914
  ...rest
9921
- } = { ...defaultProps$13, ...props };
9915
+ } = { ...defaultProps$14, ...props };
9922
9916
  const classPrefix2 = "nut-address";
9923
9917
  const selectedExist = (item) => {
9924
9918
  existList.forEach((list, index) => {
@@ -9947,7 +9941,7 @@ const ExistRender = (props) => {
9947
9941
  );
9948
9942
  })), (custom || custom && locale.address.chooseAnotherAddress) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer`, onClick }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer-btn` }, custom)));
9949
9943
  };
9950
- const defaultProps$12 = {
9944
+ const defaultProps$13 = {
9951
9945
  ...ComponentDefaults,
9952
9946
  defaultValue: [],
9953
9947
  type: "custom",
@@ -9989,7 +9983,7 @@ const InternalAddress = (props, ref) => {
9989
9983
  onSwitch,
9990
9984
  ...rest
9991
9985
  } = {
9992
- ...defaultProps$12,
9986
+ ...defaultProps$13,
9993
9987
  ...props
9994
9988
  };
9995
9989
  const classPrefix2 = "nut-address";
@@ -10327,7 +10321,7 @@ const isEnd = (day, days) => {
10327
10321
  const isStartAndEnd = (days) => {
10328
10322
  return days.length >= 2 && Utils.isEqual(days[0], days[1]);
10329
10323
  };
10330
- const defaultProps$11 = {
10324
+ const defaultProps$12 = {
10331
10325
  ...ComponentDefaults,
10332
10326
  type: "single",
10333
10327
  autoBackfill: false,
@@ -10388,7 +10382,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
10388
10382
  onUpdate,
10389
10383
  onDayClick,
10390
10384
  onPageChange
10391
- } = { ...defaultProps$11, ...props };
10385
+ } = { ...defaultProps$12, ...props };
10392
10386
  const weekdays = locale.calendaritem.weekdays;
10393
10387
  const weeks = [
10394
10388
  ...weekdays.slice(firstDayOfWeek, 7),
@@ -10680,8 +10674,10 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
10680
10674
  };
10681
10675
  useEffect(() => {
10682
10676
  setCurrentDate(resetDefaultValue() || []);
10683
- popup && resetRender();
10684
10677
  }, [defaultValue]);
10678
+ useEffect(() => {
10679
+ popup && resetRender();
10680
+ }, [currentDate]);
10685
10681
  const scrollToDate = (date4) => {
10686
10682
  if (Utils.compareDate(date4, propStartDate)) {
10687
10683
  date4 = propStartDate;
@@ -10925,7 +10921,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
10925
10921
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: classes, style }, renderHeader(), renderContent(), popup && !autoBackfill ? renderFooter() : ""));
10926
10922
  });
10927
10923
  CalendarItem.displayName = "NutCalendarItem";
10928
- const defaultProps$10 = {
10924
+ const defaultProps$11 = {
10929
10925
  ...ComponentDefaults,
10930
10926
  type: "single",
10931
10927
  autoBackfill: false,
@@ -10988,7 +10984,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
10988
10984
  onConfirm,
10989
10985
  onDayClick,
10990
10986
  onPageChange
10991
- } = { ...defaultProps$10, ...props };
10987
+ } = { ...defaultProps$11, ...props };
10992
10988
  const calendarRef = useRef(null);
10993
10989
  const close = () => {
10994
10990
  onClose && onClose();
@@ -11168,7 +11164,7 @@ const getCurrentWeekDays = (day, firstDayOfWeek) => {
11168
11164
  )
11169
11165
  ];
11170
11166
  };
11171
- const defaultProps$$ = {
11167
+ const defaultProps$10 = {
11172
11168
  ...ComponentDefaults,
11173
11169
  type: "single",
11174
11170
  firstDayOfWeek: 0
@@ -11192,7 +11188,7 @@ const CalendarCard = React__default.forwardRef((props, ref) => {
11192
11188
  onDayClick,
11193
11189
  onPageChange,
11194
11190
  onChange
11195
- } = { ...defaultProps$$, ...props };
11191
+ } = { ...defaultProps$10, ...props };
11196
11192
  const [month, setMonth] = useState(() => {
11197
11193
  let date4 = new Date(Date.now());
11198
11194
  const val = value || defaultValue;
@@ -11496,7 +11492,7 @@ const CalendarCard = React__default.forwardRef((props, ref) => {
11496
11492
  });
11497
11493
  CalendarCard.displayName = "NutCalendarCard";
11498
11494
  const CheckboxGroupContext = createContext(null);
11499
- const defaultProps$_ = {
11495
+ const defaultProps$$ = {
11500
11496
  max: void 0,
11501
11497
  min: void 0,
11502
11498
  list: false,
@@ -11516,17 +11512,17 @@ const CheckboxGroup = React__default.forwardRef(
11516
11512
  className,
11517
11513
  disabled,
11518
11514
  list,
11519
- onChange,
11520
11515
  value,
11521
11516
  defaultValue,
11522
11517
  max,
11523
11518
  min,
11524
- onLimit,
11525
11519
  labelPosition,
11526
11520
  direction,
11527
11521
  options: options2,
11522
+ onChange,
11523
+ onLimit,
11528
11524
  ...rest
11529
- } = { ...defaultProps$_, ...props };
11525
+ } = { ...defaultProps$$, ...props };
11530
11526
  useImperativeHandle(ref, () => ({
11531
11527
  toggle(state) {
11532
11528
  if (state === false) {
@@ -11553,8 +11549,8 @@ const CheckboxGroup = React__default.forwardRef(
11553
11549
  }
11554
11550
  }));
11555
11551
  const [_value, setValue] = usePropsValue({
11556
- value: props.value,
11557
- defaultValue: props.defaultValue,
11552
+ value,
11553
+ defaultValue,
11558
11554
  finalValue: [],
11559
11555
  onChange
11560
11556
  });
@@ -11606,7 +11602,7 @@ const CheckboxGroup = React__default.forwardRef(
11606
11602
  className: classNames(
11607
11603
  classPrefix$i,
11608
11604
  {
11609
- [`nut-checkboxgroup-${props.direction}`]: props.direction,
11605
+ [`nut-checkboxgroup-${direction}`]: direction,
11610
11606
  [`nut-checkboxgroup-list`]: list
11611
11607
  },
11612
11608
  className
@@ -11618,9 +11614,8 @@ const CheckboxGroup = React__default.forwardRef(
11618
11614
  );
11619
11615
  }
11620
11616
  );
11621
- CheckboxGroup.defaultProps = defaultProps$_;
11622
11617
  CheckboxGroup.displayName = "NutCheckboxGroup";
11623
- const defaultProps$Z = {
11618
+ const defaultProps$_ = {
11624
11619
  ...ComponentDefaults,
11625
11620
  disabled: false,
11626
11621
  shape: "round",
@@ -11634,7 +11629,7 @@ const defaultProps$Z = {
11634
11629
  const classPrefix$h = "nut-checkbox";
11635
11630
  const Checkbox = (props) => {
11636
11631
  const { children } = {
11637
- ...defaultProps$Z,
11632
+ ...defaultProps$_,
11638
11633
  ...props
11639
11634
  };
11640
11635
  const {
@@ -12011,7 +12006,7 @@ function useRefs() {
12011
12006
  }, []);
12012
12007
  return [refs.current, setRefs, reset];
12013
12008
  }
12014
- const defaultProps$Y = {
12009
+ const defaultProps$Z = {
12015
12010
  ...ComponentDefaults,
12016
12011
  title: "",
12017
12012
  options: [],
@@ -12041,7 +12036,7 @@ const InternalPicker = (props, ref) => {
12041
12036
  afterClose,
12042
12037
  onChange,
12043
12038
  ...rest
12044
- } = { ...defaultProps$Y, ...props };
12039
+ } = { ...defaultProps$Z, ...props };
12045
12040
  const classPrefix2 = "nut-picker";
12046
12041
  const classes = classNames(classPrefix2, className);
12047
12042
  const [selectedValue, setSelectedValue] = usePropsValue({
@@ -12282,7 +12277,7 @@ const padZero = (num, targetLength = 2) => {
12282
12277
  return str;
12283
12278
  };
12284
12279
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
12285
- const defaultProps$X = {
12280
+ const defaultProps$Y = {
12286
12281
  ...ComponentDefaults,
12287
12282
  visible: false,
12288
12283
  title: "",
@@ -12315,7 +12310,7 @@ const DatePicker = (props) => {
12315
12310
  style,
12316
12311
  ...rest
12317
12312
  } = {
12318
- ...defaultProps$X,
12313
+ ...defaultProps$Y,
12319
12314
  ...props
12320
12315
  };
12321
12316
  const { locale } = useConfig();
@@ -12439,7 +12434,7 @@ const DatePicker = (props) => {
12439
12434
  if (!isEqual2) {
12440
12435
  setSelectedDate(formatValue(newDate));
12441
12436
  }
12442
- props.onChange && props.onChange(
12437
+ onChange == null ? void 0 : onChange(
12443
12438
  selectedOptions,
12444
12439
  [
12445
12440
  String(newDate.getFullYear()),
@@ -12536,8 +12531,8 @@ const DatePicker = (props) => {
12536
12531
  }
12537
12532
  pickerValue[columnIndex] = (_a = arr[index]) == null ? void 0 : _a.value;
12538
12533
  setPickerValue([...pickerValue]);
12539
- if (props.filter && props.filter(type22, arr)) {
12540
- return props.filter(type22, arr);
12534
+ if (filter == null ? void 0 : filter(type22, arr)) {
12535
+ return filter == null ? void 0 : filter(type22, arr);
12541
12536
  }
12542
12537
  return arr;
12543
12538
  };
@@ -12595,7 +12590,6 @@ const DatePicker = (props) => {
12595
12590
  }
12596
12591
  ));
12597
12592
  };
12598
- DatePicker.defaultProps = defaultProps$X;
12599
12593
  DatePicker.displayName = "NutDatePicker";
12600
12594
  const Context = createContext({});
12601
12595
  function _extends() {
@@ -13827,7 +13821,7 @@ const useForm = (form) => {
13827
13821
  }
13828
13822
  return [formRef.current];
13829
13823
  };
13830
- const defaultProps$W = {
13824
+ const defaultProps$X = {
13831
13825
  ...ComponentDefaults,
13832
13826
  labelPosition: "right",
13833
13827
  starPosition: "left",
@@ -13858,7 +13852,7 @@ const Form = React__default.forwardRef(
13858
13852
  starPosition,
13859
13853
  form
13860
13854
  } = {
13861
- ...defaultProps$W,
13855
+ ...defaultProps$X,
13862
13856
  ...props
13863
13857
  };
13864
13858
  let formInstance;
@@ -13914,7 +13908,7 @@ function isForwardRefComponent(component) {
13914
13908
  }
13915
13909
  ).$$typeof === component.type.$$typeof;
13916
13910
  }
13917
- const defaultProps$V = {
13911
+ const defaultProps$W = {
13918
13912
  ...ComponentDefaults,
13919
13913
  required: false,
13920
13914
  name: "",
@@ -14007,9 +14001,10 @@ const _FormItem = class _FormItem extends React__default.Component {
14007
14001
  rules: rules2,
14008
14002
  className,
14009
14003
  style,
14010
- errorMessageAlign
14004
+ errorMessageAlign,
14005
+ align
14011
14006
  } = {
14012
- ...defaultProps$V,
14007
+ ...defaultProps$W,
14013
14008
  ...this.props
14014
14009
  };
14015
14010
  const requiredInRules = rules2 == null ? void 0 : rules2.some((rule) => rule.required);
@@ -14022,6 +14017,7 @@ const _FormItem = class _FormItem extends React__default.Component {
14022
14017
  {
14023
14018
  className: `nut-form-item ${className}`,
14024
14019
  style,
14020
+ align,
14025
14021
  onClick: (e2) => this.props.onClick && this.props.onClick(e2, this.componentRef)
14026
14022
  },
14027
14023
  label ? /* @__PURE__ */ React__default.createElement("div", { className: "nut-cell-title nut-form-item-label" }, renderLabel) : null,
@@ -14075,7 +14071,7 @@ const _FormItem = class _FormItem extends React__default.Component {
14075
14071
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: this.state.resetCount }, this.props.noStyle ? returnChildNode : this.renderLayout(returnChildNode));
14076
14072
  }
14077
14073
  };
14078
- _FormItem.defaultProps = defaultProps$V;
14074
+ _FormItem.defaultProps = defaultProps$W;
14079
14075
  _FormItem.contextType = Context;
14080
14076
  let FormItem = _FormItem;
14081
14077
  const InnerForm = Form;
@@ -14105,7 +14101,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
14105
14101
  const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
14106
14102
  return value.replace(regExp, "");
14107
14103
  }
14108
- const defaultProps$U = {
14104
+ const defaultProps$V = {
14109
14105
  ...ComponentDefaults,
14110
14106
  type: "text",
14111
14107
  name: "",
@@ -14151,7 +14147,7 @@ const Input = forwardRef(
14151
14147
  onCompositionEnd,
14152
14148
  ...rest
14153
14149
  } = {
14154
- ...defaultProps$U,
14150
+ ...defaultProps$V,
14155
14151
  ...props
14156
14152
  };
14157
14153
  const [value, setValue] = usePropsValue({
@@ -14296,7 +14292,7 @@ const Input = forwardRef(
14296
14292
  }
14297
14293
  );
14298
14294
  Input.displayName = "NutInput";
14299
- const defaultProps$T = {
14295
+ const defaultProps$U = {
14300
14296
  ...ComponentDefaults,
14301
14297
  disabled: false,
14302
14298
  readOnly: false,
@@ -14332,7 +14328,7 @@ const InputNumber = (props) => {
14332
14328
  onChange,
14333
14329
  ...restProps
14334
14330
  } = {
14335
- ...defaultProps$T,
14331
+ ...defaultProps$U,
14336
14332
  ...props
14337
14333
  };
14338
14334
  const classes = classNames(classPrefix$g, className, {
@@ -14423,6 +14419,17 @@ const InputNumber = (props) => {
14423
14419
  if (text === "-") return null;
14424
14420
  return text;
14425
14421
  };
14422
+ const clampValue = (valueStr) => {
14423
+ if (valueStr === null) return defaultValue;
14424
+ const val = Number(parseFloat(valueStr || "0").toFixed(digits));
14425
+ return Math.max(Number(min), Math.min(Number(max), val));
14426
+ };
14427
+ const handleValueChange = (valueStr, e2) => {
14428
+ const val = clampValue(valueStr);
14429
+ if (val !== Number(shadowValue)) {
14430
+ onChange == null ? void 0 : onChange(val, e2);
14431
+ }
14432
+ };
14426
14433
  const handleInputChange = (e2) => {
14427
14434
  setInputValue(e2.target.value);
14428
14435
  const valueStr = parseValue(e2.target.value);
@@ -14433,26 +14440,31 @@ const InputNumber = (props) => {
14433
14440
  setShadowValue(defaultValue);
14434
14441
  }
14435
14442
  } else {
14436
- setShadowValue(valueStr);
14437
- }
14438
- if (!async) {
14439
- onChange == null ? void 0 : onChange(parseFloat(valueStr || "0").toFixed(digits), e2);
14443
+ setShadowValue(clampValue(valueStr));
14440
14444
  }
14445
+ !async && handleValueChange(valueStr, e2);
14441
14446
  };
14442
14447
  const handleFocus = (e2) => {
14443
14448
  setFocused(true);
14444
14449
  setInputValue(
14445
14450
  shadowValue !== void 0 && shadowValue !== null ? bound2(Number(shadowValue), Number(min), Number(max)).toString() : ""
14446
14451
  );
14447
- onFocus && onFocus(e2);
14452
+ onFocus == null ? void 0 : onFocus(e2);
14448
14453
  };
14449
14454
  const handleBlur = (e2) => {
14450
14455
  setFocused(false);
14451
- onBlur && onBlur(e2);
14452
- if (async) {
14453
- const valueStr = parseValue(e2.target.value);
14454
- onChange == null ? void 0 : onChange(parseFloat(valueStr || "0").toFixed(digits), e2);
14456
+ onBlur == null ? void 0 : onBlur(e2);
14457
+ const valueStr = parseValue(e2.target.value);
14458
+ if (valueStr === null) {
14459
+ if (allowEmpty) {
14460
+ setShadowValue(null);
14461
+ } else {
14462
+ setShadowValue(defaultValue);
14463
+ }
14464
+ } else {
14465
+ setShadowValue(clampValue(valueStr));
14455
14466
  }
14467
+ async && handleValueChange(valueStr, e2);
14456
14468
  };
14457
14469
  return /* @__PURE__ */ React__default.createElement("div", { className: classes, style, ...restProps }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-input-minus", onClick: handleReduce }, /* @__PURE__ */ React__default.createElement(
14458
14470
  e$6,
@@ -14532,8 +14544,9 @@ function useClickAway(onClickAway, target, eventName = "click", useCapture, isLi
14532
14544
  };
14533
14545
  }, [target]);
14534
14546
  }
14535
- const defaultProps$S = {
14547
+ const defaultProps$T = {
14536
14548
  ...ComponentDefaults,
14549
+ titleIcon: null,
14537
14550
  columns: 1,
14538
14551
  direction: "down",
14539
14552
  icon: null,
@@ -14563,7 +14576,7 @@ const MenuItem = forwardRef((props, ref) => {
14563
14576
  parent,
14564
14577
  index
14565
14578
  } = {
14566
- ...defaultProps$S,
14579
+ ...defaultProps$T,
14567
14580
  ...props
14568
14581
  };
14569
14582
  const [showPopup, setShowPopup] = useState(show2);
@@ -14732,7 +14745,7 @@ const MenuItem = forwardRef((props, ref) => {
14732
14745
  ));
14733
14746
  });
14734
14747
  MenuItem.displayName = "NutMenuItem";
14735
- const defaultProps$R = {
14748
+ const defaultProps$S = {
14736
14749
  ...ComponentDefaults,
14737
14750
  activeColor: "",
14738
14751
  closeOnOverlayClick: true,
@@ -14759,7 +14772,7 @@ const Menu = (props) => {
14759
14772
  onOpen,
14760
14773
  ...rest
14761
14774
  } = {
14762
- ...defaultProps$R,
14775
+ ...defaultProps$S,
14763
14776
  ...props
14764
14777
  };
14765
14778
  const menuRef = useRef(null);
@@ -14824,7 +14837,15 @@ const Menu = (props) => {
14824
14837
  const menuTitle = () => {
14825
14838
  return React__default.Children.map(children, (child, index) => {
14826
14839
  if (React__default.isValidElement(child)) {
14827
- const { title, options: options2, value, defaultValue, disabled, direction } = child.props;
14840
+ const {
14841
+ title,
14842
+ titleIcon,
14843
+ options: options2,
14844
+ value,
14845
+ defaultValue,
14846
+ disabled,
14847
+ direction
14848
+ } = child.props;
14828
14849
  const selected = options2 == null ? void 0 : options2.filter(
14829
14850
  (option) => option.value === (value !== void 0 ? value : defaultValue)
14830
14851
  );
@@ -14835,27 +14856,10 @@ const Menu = (props) => {
14835
14856
  return selected[0].text;
14836
14857
  return "";
14837
14858
  };
14838
- return /* @__PURE__ */ React__default.createElement(
14839
- "div",
14840
- {
14841
- className: classNames(
14842
- "nut-menu-title ",
14843
- {
14844
- active: showMenuItem[index],
14845
- disabled
14846
- },
14847
- className
14848
- ),
14849
- style: { color: showMenuItem[index] ? activeColor : "" },
14850
- key: index,
14851
- onClick: (e2) => {
14852
- e2.stopPropagation();
14853
- if ((!options2 || !options2.length) && !child.props.children) return;
14854
- !disabled && toggleMenuItem(index);
14855
- }
14856
- },
14857
- /* @__PURE__ */ React__default.createElement("div", { className: "nut-menu-title-text" }, finallyTitle()),
14858
- icon || (direction === "up" ? /* @__PURE__ */ React__default.createElement(
14859
+ const finallyIcon = () => {
14860
+ if (titleIcon) return titleIcon;
14861
+ if (icon) return icon;
14862
+ return direction === "up" ? /* @__PURE__ */ React__default.createElement(
14859
14863
  l$2,
14860
14864
  {
14861
14865
  className: "nut-menu-title-icon",
@@ -14869,7 +14873,25 @@ const Menu = (props) => {
14869
14873
  width: "12px",
14870
14874
  height: "12px"
14871
14875
  }
14872
- ))
14876
+ );
14877
+ };
14878
+ return /* @__PURE__ */ React__default.createElement(
14879
+ "div",
14880
+ {
14881
+ className: classNames("nut-menu-title", `nut-menu-title-${index}`, {
14882
+ active: showMenuItem[index],
14883
+ disabled
14884
+ }),
14885
+ style: { color: showMenuItem[index] ? activeColor : "" },
14886
+ key: index,
14887
+ onClick: (e2) => {
14888
+ e2.stopPropagation();
14889
+ if ((!options2 || !options2.length) && !child.props.children) return;
14890
+ !disabled && toggleMenuItem(index);
14891
+ }
14892
+ },
14893
+ /* @__PURE__ */ React__default.createElement("div", { className: "nut-menu-title-text" }, finallyTitle()),
14894
+ finallyIcon()
14873
14895
  );
14874
14896
  }
14875
14897
  return null;
@@ -14898,6 +14920,16 @@ const Menu = (props) => {
14898
14920
  };
14899
14921
  Menu.displayName = "NutMenu";
14900
14922
  Menu.Item = MenuItem;
14923
+ const defaultProps$R = {
14924
+ ...ComponentDefaults,
14925
+ visible: false,
14926
+ rightActions: "",
14927
+ type: "default",
14928
+ custom: [],
14929
+ random: false,
14930
+ onClose: () => {
14931
+ }
14932
+ };
14901
14933
  const NumberKeyboard = (props) => {
14902
14934
  const { locale } = useConfig();
14903
14935
  const {
@@ -14915,7 +14947,7 @@ const NumberKeyboard = (props) => {
14915
14947
  onClose,
14916
14948
  onConfirm,
14917
14949
  ...rest
14918
- } = props;
14950
+ } = { ...defaultProps$R, ...props };
14919
14951
  const classPrefix2 = "nut-numberkeyboard";
14920
14952
  const getBasicKeys = () => {
14921
14953
  const keys = new Array(9).fill(0).map((_, index) => {
@@ -14967,17 +14999,35 @@ const NumberKeyboard = (props) => {
14967
14999
  };
14968
15000
  const onTouchEnd = (item2) => {
14969
15001
  setActive(false);
14970
- if (item2.type === "num" || item2.type === "custom") {
14971
- onChange && onChange(item2.id);
14972
- }
14973
- if (item2.type === "close") {
14974
- onClose && onClose();
14975
- }
14976
- if (item2.type === "delete") {
14977
- onDelete && onDelete();
15002
+ switch (item2.type) {
15003
+ case "num":
15004
+ case "custom":
15005
+ onChange == null ? void 0 : onChange(item2.id);
15006
+ break;
15007
+ case "close":
15008
+ onClose == null ? void 0 : onClose();
15009
+ break;
15010
+ case "delete":
15011
+ onDelete == null ? void 0 : onDelete();
15012
+ break;
15013
+ case "confirm":
15014
+ onConfirm == null ? void 0 : onConfirm();
15015
+ break;
14978
15016
  }
14979
- if (item2.type === "confirm") {
14980
- onConfirm && onConfirm();
15017
+ };
15018
+ const renderContent = (item2) => {
15019
+ switch (item2.type) {
15020
+ case "num":
15021
+ case "custom":
15022
+ return /* @__PURE__ */ React__default.createElement("div", null, item2.id);
15023
+ case "delete":
15024
+ return /* @__PURE__ */ React__default.createElement(DeleteIcon, null);
15025
+ case "close":
15026
+ return /* @__PURE__ */ React__default.createElement(l$3, { width: 18, height: 18 });
15027
+ case "confirm":
15028
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, confirmText || locale.done);
15029
+ default:
15030
+ return null;
14981
15031
  }
14982
15032
  };
14983
15033
  return /* @__PURE__ */ React__default.createElement("div", { key: item.id, className: `${classPrefix2}-body-wrapper` }, /* @__PURE__ */ React__default.createElement(
@@ -14994,22 +15044,19 @@ const NumberKeyboard = (props) => {
14994
15044
  onTouchEnd: () => onTouchEnd(item),
14995
15045
  onTouchCancel: () => onTouchEnd(item)
14996
15046
  },
14997
- (item.type === "num" || item.type === "custom") && /* @__PURE__ */ React__default.createElement("div", null, item.id),
14998
- item.type === "delete" && /* @__PURE__ */ React__default.createElement(DeleteIcon, null),
14999
- item.type === "close" && /* @__PURE__ */ React__default.createElement(l$3, { width: 18, height: 18 }),
15000
- item.type === "confirm" && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, confirmText || locale.done)
15047
+ renderContent(item)
15001
15048
  ));
15002
15049
  };
15003
15050
  return /* @__PURE__ */ React__default.createElement(
15004
15051
  Popup,
15005
15052
  {
15053
+ ...rest,
15006
15054
  visible,
15007
15055
  position: "bottom",
15008
15056
  onOverlayClick: onClose,
15009
15057
  onCloseIconClick: onClose,
15010
15058
  zIndex: 9999,
15011
- overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" },
15012
- ...rest
15059
+ overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" }
15013
15060
  },
15014
15061
  /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className), style }, title && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-header` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-header-title` }, title), type4 === "default" && /* @__PURE__ */ React__default.createElement(
15015
15062
  "span",
@@ -15122,7 +15169,6 @@ const RadioGroup = React__default.forwardRef(
15122
15169
  );
15123
15170
  }
15124
15171
  );
15125
- RadioGroup.defaultProps = defaultProps$Q;
15126
15172
  RadioGroup.displayName = "NutRadioGroup";
15127
15173
  const defaultProps$P = {
15128
15174
  ...ComponentDefaults,
@@ -15250,7 +15296,6 @@ const Radio = (props) => {
15250
15296
  renderRadioItem()
15251
15297
  );
15252
15298
  };
15253
- Radio.defaultProps = defaultProps$P;
15254
15299
  Radio.displayName = "NutRadio";
15255
15300
  Radio.Group = RadioGroup;
15256
15301
  const defaultProps$O = {
@@ -16629,6 +16674,7 @@ const defaultProps$G = {
16629
16674
  };
16630
16675
  const InternalUploader = (props, ref) => {
16631
16676
  const { locale } = useConfig();
16677
+ const fileListRef = useRef([]);
16632
16678
  const {
16633
16679
  children,
16634
16680
  uploadIcon,
@@ -16681,6 +16727,9 @@ const InternalUploader = (props, ref) => {
16681
16727
  });
16682
16728
  const [uploadQueue, setUploadQueue] = useState([]);
16683
16729
  const classes = classNames(className, "nut-uploader");
16730
+ useEffect(() => {
16731
+ fileListRef.current = fileList;
16732
+ }, [fileList]);
16684
16733
  useImperativeHandle(ref, () => ({
16685
16734
  submit: () => {
16686
16735
  Promise.all(uploadQueue).then((res) => {
@@ -16725,7 +16774,7 @@ const InternalUploader = (props, ref) => {
16725
16774
  uploadOption.onStart = (option) => {
16726
16775
  clearUploadQueue(index);
16727
16776
  setFileList(
16728
- fileList.map((item) => {
16777
+ fileListRef.current.map((item) => {
16729
16778
  if (item.uid === fileItem.uid) {
16730
16779
  item.status = "ready";
16731
16780
  item.message = locale.uploader.readyUpload;
@@ -16733,23 +16782,23 @@ const InternalUploader = (props, ref) => {
16733
16782
  return item;
16734
16783
  })
16735
16784
  );
16736
- onStart && onStart(option);
16785
+ onStart == null ? void 0 : onStart(option);
16737
16786
  };
16738
16787
  uploadOption.onProgress = (e2, option) => {
16739
16788
  setFileList(
16740
- fileList.map((item) => {
16789
+ fileListRef.current.map((item) => {
16741
16790
  if (item.uid === fileItem.uid) {
16742
16791
  item.status = UPLOADING;
16743
16792
  item.message = locale.uploader.uploading;
16744
16793
  item.percentage = (e2.loaded / e2.total * 100).toFixed(0);
16745
- onProgress && onProgress({ e: e2, option, percentage: item.percentage });
16794
+ onProgress == null ? void 0 : onProgress({ e: e2, option, percentage: item.percentage });
16746
16795
  }
16747
16796
  return item;
16748
16797
  })
16749
16798
  );
16750
16799
  };
16751
16800
  uploadOption.onSuccess = (responseText, option) => {
16752
- const list = fileList.map((item) => {
16801
+ const list = fileListRef.current.map((item) => {
16753
16802
  if (item.uid === fileItem.uid) {
16754
16803
  item.status = SUCCESS;
16755
16804
  item.message = locale.uploader.success;
@@ -16766,7 +16815,7 @@ const InternalUploader = (props, ref) => {
16766
16815
  });
16767
16816
  };
16768
16817
  uploadOption.onFailure = (responseText, option) => {
16769
- const list = fileList.map((item) => {
16818
+ const list = fileListRef.current.map((item) => {
16770
16819
  if (item.uid === fileItem.uid) {
16771
16820
  item.status = ERROR;
16772
16821
  item.message = locale.uploader.error;
@@ -16828,9 +16877,7 @@ const InternalUploader = (props, ref) => {
16828
16877
  }
16829
16878
  return true;
16830
16879
  });
16831
- if (oversizes.length) {
16832
- onOversize && onOversize(files);
16833
- }
16880
+ oversizes.length && (onOversize == null ? void 0 : onOversize(files));
16834
16881
  if (filterFile.length > maximum) {
16835
16882
  filterFile.splice(maximum, filterFile.length - maximum);
16836
16883
  }
@@ -16869,7 +16916,6 @@ const InternalUploader = (props, ref) => {
16869
16916
  const _files = filterFiles(new Array().slice.call(files));
16870
16917
  readFile(_files);
16871
16918
  }
16872
- setFileList(fileList);
16873
16919
  if (clearInput) {
16874
16920
  clearInputValue($el);
16875
16921
  }
@@ -17194,18 +17240,6 @@ const Content = (props) => {
17194
17240
  );
17195
17241
  };
17196
17242
  Content.displayName = "NutContent";
17197
- const defaultDialogProps = {
17198
- ...ComponentDefaults,
17199
- overlay: true,
17200
- overlayStyle: {},
17201
- overlayClassName: "",
17202
- onCancel: () => {
17203
- },
17204
- onClose: () => {
17205
- },
17206
- onOverlayClick: (e2) => true,
17207
- ...defaultOverlayProps
17208
- };
17209
17243
  const DialogWrap = (props) => {
17210
17244
  const {
17211
17245
  visible,
@@ -17247,7 +17281,6 @@ const DialogWrap = (props) => {
17247
17281
  /* @__PURE__ */ React__default.createElement(Content, { ...props, visible })
17248
17282
  ));
17249
17283
  };
17250
- DialogWrap.defaultProps = defaultDialogProps;
17251
17284
  DialogWrap.displayName = "NutDialogWrap";
17252
17285
  const defaultProps$E = {
17253
17286
  ...ComponentDefaults,
@@ -18780,7 +18813,6 @@ const PullToRefresh = (p) => {
18780
18813
  /* @__PURE__ */ React__default.createElement("div", null, renderStatusText())
18781
18814
  )), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-content` }, props.children));
18782
18815
  };
18783
- PullToRefresh.defaultProps = defaultProps$x;
18784
18816
  PullToRefresh.displayName = "NutPullToRefresh";
18785
18817
  const AvatarContext = createContext({});
18786
18818
  const defaultProps$w = {
@@ -19164,7 +19196,6 @@ const Swipe = forwardRef((props, instanceRef) => {
19164
19196
  /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-wrapper`, style: wrapperStyle }, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef))
19165
19197
  );
19166
19198
  });
19167
- Swipe.defaultProps = defaultProps$t;
19168
19199
  Swipe.displayName = "NutSwipe";
19169
19200
  const classPrefix$8 = "nut-toast";
19170
19201
  class Notification2 extends React.PureComponent {
@@ -19564,16 +19595,16 @@ const Audio = (props) => {
19564
19595
  percent: 0,
19565
19596
  duration: "00:00:00",
19566
19597
  second: 0,
19567
- hanMuted: props.muted,
19568
- playing: props.autoPlay,
19598
+ hanMuted: muted,
19599
+ playing: autoPlay,
19569
19600
  handPlaying: false
19570
19601
  });
19571
19602
  const classPrefix2 = "nut-audio";
19572
19603
  const handleEnded = (e2) => {
19573
- if (props.loop) {
19604
+ if (loop2) {
19574
19605
  console.warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
19575
19606
  } else {
19576
- props.onEnd && props.onEnd(e2);
19607
+ onEnd == null ? void 0 : onEnd(e2);
19577
19608
  }
19578
19609
  };
19579
19610
  function watch() {
@@ -19614,25 +19645,25 @@ const Audio = (props) => {
19614
19645
  if (statusRef.current.currentTime > 0 && AudioRef.current) {
19615
19646
  statusRef.current.currentTime--;
19616
19647
  AudioRef.current.currentTime = statusRef.current.currentTime;
19617
- props.onBack && props.onBack(AudioRef.current);
19648
+ onBack == null ? void 0 : onBack(AudioRef.current);
19618
19649
  }
19619
19650
  };
19620
19651
  const handleForward = () => {
19621
19652
  if (AudioRef.current) {
19622
19653
  statusRef.current.currentTime++;
19623
19654
  AudioRef.current.currentTime = statusRef.current.currentTime;
19624
- props.onForward && props.onForward(AudioRef.current);
19655
+ onForward == null ? void 0 : onForward(AudioRef.current);
19625
19656
  }
19626
19657
  };
19627
19658
  const handleMute = () => {
19628
19659
  if (AudioRef.current) {
19629
19660
  AudioRef.current.muted = !AudioRef.current.muted;
19630
- props.onMute && props.onMute(AudioRef.current);
19661
+ onMute == null ? void 0 : onMute(AudioRef.current);
19631
19662
  }
19632
19663
  };
19633
19664
  const handlePause = (e2) => {
19634
19665
  setPlaying(false);
19635
- props.onPause && props.onPause(e2);
19666
+ onPause == null ? void 0 : onPause(e2);
19636
19667
  };
19637
19668
  const formatSeconds = (value) => {
19638
19669
  if (!value) {
@@ -19721,12 +19752,12 @@ const Audio = (props) => {
19721
19752
  };
19722
19753
  const handleCanplay = (e2) => {
19723
19754
  setIsCanPlay(true);
19724
- if (props.autoPlay && !playing) {
19755
+ if (autoPlay && !playing) {
19725
19756
  AudioRef && AudioRef.current && AudioRef.current.play();
19726
19757
  }
19727
19758
  if (AudioRef.current) {
19728
19759
  statusRef.current.second = AudioRef.current.duration || 0;
19729
- props.onCanPlay && props.onCanPlay(e2);
19760
+ onCanPlay == null ? void 0 : onCanPlay(e2);
19730
19761
  }
19731
19762
  };
19732
19763
  const onTimeupdate = (e2) => {
@@ -19755,7 +19786,6 @@ const Audio = (props) => {
19755
19786
  /* @__PURE__ */ React__default.createElement("track", { kind: "captions" })
19756
19787
  ));
19757
19788
  };
19758
- Audio.defaultProps = defaultProps$p;
19759
19789
  Audio.displayName = "NutAudio";
19760
19790
  const defaultProps$o = {
19761
19791
  ...ComponentDefaults,
@@ -20951,7 +20981,6 @@ const Swiper = React__default.forwardRef(
20951
20981
  );
20952
20982
  }
20953
20983
  );
20954
- Swiper.defaultProps = defaultProps$h;
20955
20984
  Swiper.displayName = "NutSwiper";
20956
20985
  const defaultProps$g = {
20957
20986
  onClick: (e2) => void 0
@@ -20962,7 +20991,6 @@ const SwiperItem = (props) => {
20962
20991
  const classes = classNames(classPrefix2, className);
20963
20992
  return /* @__PURE__ */ React__default.createElement("div", { className: classes, onClick: props.onClick, style }, children);
20964
20993
  };
20965
- SwiperItem.defaultProps = defaultProps$g;
20966
20994
  SwiperItem.displayName = "NutSwiperItem";
20967
20995
  const InnerSwiper = Swiper;
20968
20996
  InnerSwiper.Item = SwiperItem;
@@ -21658,10 +21686,6 @@ const Table = (props) => {
21658
21686
  });
21659
21687
  };
21660
21688
  const renderBodyTds = (item, rowIndex) => {
21661
- const { rowRender } = item;
21662
- if (rowRender && typeof rowRender === "function") {
21663
- return rowRender(item, rowIndex);
21664
- }
21665
21689
  return sortDataItem().map(([value, render2]) => {
21666
21690
  return /* @__PURE__ */ React__default.createElement(
21667
21691
  "div",
@@ -21680,7 +21704,12 @@ const Table = (props) => {
21680
21704
  };
21681
21705
  const renderBodyTrs = () => {
21682
21706
  return innerValue.map((item, index) => {
21683
- return /* @__PURE__ */ React__default.createElement("div", { className: bodyClassPrefix, key: index }, renderBodyTds(item, index));
21707
+ const inner = renderBodyTds(item, index);
21708
+ const { rowRender } = item;
21709
+ if (rowRender && typeof rowRender === "function") {
21710
+ return rowRender(item, index, { inner });
21711
+ }
21712
+ return /* @__PURE__ */ React__default.createElement("div", { className: bodyClassPrefix, key: index }, inner);
21684
21713
  });
21685
21714
  };
21686
21715
  return /* @__PURE__ */ React__default.createElement("div", { className: cls, ...rest }, /* @__PURE__ */ React__default.createElement(
@@ -22704,6 +22733,8 @@ const defaultProps$1 = {
22704
22733
  gapY: 48,
22705
22734
  width: 120,
22706
22735
  height: 64,
22736
+ startX: 0,
22737
+ startY: 0,
22707
22738
  image: "",
22708
22739
  imageWidth: 120,
22709
22740
  imageHeight: 64,
@@ -22722,6 +22753,8 @@ const WaterMark = (props) => {
22722
22753
  className,
22723
22754
  gapX,
22724
22755
  gapY,
22756
+ startX,
22757
+ startY,
22725
22758
  width,
22726
22759
  height,
22727
22760
  image,
@@ -22784,7 +22817,7 @@ const WaterMark = (props) => {
22784
22817
  const markSize = Number(fontSize) * ratio;
22785
22818
  ctx2.font = `${fontStyle} normal ${fontWeight} ${markSize}px/${markHeight}px ${fontFamily}`;
22786
22819
  ctx2.fillStyle = color;
22787
- ctx2.fillText(content, 0, 0);
22820
+ ctx2.fillText(content, startX, startY);
22788
22821
  ctx2.restore();
22789
22822
  setBase64Url(canvas.toDataURL());
22790
22823
  }