@nutui/nutui-react 1.3.6 → 1.3.8

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 (64) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/esm/Avatar.js +4 -5
  3. package/dist/esm/Cascader.js +2 -2
  4. package/dist/esm/Cell.js +5 -2
  5. package/dist/esm/Collapse.js +7 -3
  6. package/dist/esm/Input.js +35 -19
  7. package/dist/esm/InputNumber.js +15 -1
  8. package/dist/esm/Menu.js +3 -3
  9. package/dist/esm/MenuItem.js +3 -4
  10. package/dist/esm/NoticeBar.js +6 -0
  11. package/dist/esm/Radio.js +2 -2
  12. package/dist/esm/Range.js +7 -1
  13. package/dist/esm/SideNavBar.js +3 -3
  14. package/dist/esm/SideNavBarItem.js +3 -3
  15. package/dist/esm/Signature.js +14 -8
  16. package/dist/esm/Step.js +3 -5
  17. package/dist/esm/Steps.js +2 -1
  18. package/dist/esm/SubSideNavBar.js +3 -3
  19. package/dist/esm/Switch.js +2 -2
  20. package/dist/esm/TabPane.js +2 -2
  21. package/dist/esm/Tabbar.js +5 -2
  22. package/dist/esm/Tabs.js +2 -2
  23. package/dist/esm/TimeSelect.js +20 -5
  24. package/dist/esm/Uploader.js +1 -1
  25. package/dist/esm/Video.js +7 -1
  26. package/dist/esm/VirtualList.js +11 -6
  27. package/dist/esm/{tabpane-c957ab14.js → tabpane-9b8ca8a8.js} +3 -2
  28. package/dist/esm/{tabs-0896a61b.js → tabs-ee05fd2f.js} +8 -4
  29. package/dist/esm/types/src/packages/avatar/avatar.d.ts +1 -0
  30. package/dist/esm/types/src/packages/cell/cell.d.ts +1 -0
  31. package/dist/esm/types/src/packages/collapse/collapse.d.ts +3 -1
  32. package/dist/esm/types/src/packages/input/input.d.ts +10 -2
  33. package/dist/esm/types/src/packages/inputnumber/inputnumber.d.ts +6 -0
  34. package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +3 -1
  35. package/dist/esm/types/src/packages/range/range.d.ts +4 -1
  36. package/dist/esm/types/src/packages/sidenavbar/sidenavbar.d.ts +1 -1
  37. package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.d.ts +1 -1
  38. package/dist/esm/types/src/packages/signature/signature.d.ts +2 -0
  39. package/dist/esm/types/src/packages/steps/steps.d.ts +1 -0
  40. package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.d.ts +1 -1
  41. package/dist/esm/types/src/packages/switch/switch.d.ts +1 -1
  42. package/dist/esm/types/src/packages/tabbar/tabbar.d.ts +1 -0
  43. package/dist/esm/types/src/packages/tabpane/tabpane.d.ts +6 -2
  44. package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -0
  45. package/dist/esm/types/src/packages/timeselect/timeselect.d.ts +5 -1
  46. package/dist/esm/types/src/packages/video/video.d.ts +3 -0
  47. package/dist/esm/types/src/packages/virtuallist/type.d.ts +3 -1
  48. package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +2 -2
  49. package/dist/locales/base.js +1 -1
  50. package/dist/locales/en-US.js +1 -1
  51. package/dist/locales/id-ID.js +1 -1
  52. package/dist/locales/zh-CN.js +1 -1
  53. package/dist/locales/zh-TW.js +1 -1
  54. package/dist/nutui.react.es.js +167 -72
  55. package/dist/nutui.react.umd.js +167 -72
  56. package/dist/packages/divider/divider.scss +2 -1
  57. package/dist/packages/menu/menu.scss +4 -0
  58. package/dist/packages/menuitem/menuitem.scss +27 -2
  59. package/dist/packages/noticebar/noticebar.scss +4 -1
  60. package/dist/packages/tabs/tabs.scss +3 -1
  61. package/dist/style.css +1 -1
  62. package/dist/style.es.js +1 -1
  63. package/dist/types/index.d.ts +54 -14
  64. package/package.json +3 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:06:20 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.8 Wed Oct 26 2022 17:29:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1469,12 +1469,15 @@ const defaultProps$1j = {
1469
1469
  iconSlot: null,
1470
1470
  linkSlot: null,
1471
1471
  click: (event) => {
1472
+ },
1473
+ onClick: (event) => {
1472
1474
  }
1473
1475
  };
1474
1476
  const Cell = (props) => {
1475
1477
  const {
1476
1478
  children,
1477
1479
  click,
1480
+ onClick,
1478
1481
  title,
1479
1482
  subTitle,
1480
1483
  desc,
@@ -1501,6 +1504,7 @@ const Cell = (props) => {
1501
1504
  const history = useHistory();
1502
1505
  const handleClick2 = (event) => {
1503
1506
  click(event);
1507
+ onClick(event);
1504
1508
  if (to2 && history) {
1505
1509
  history[replace ? "replace" : "push"](to2);
1506
1510
  } else if (url) {
@@ -3163,6 +3167,8 @@ const defaultProps$17 = {
3163
3167
  className: "",
3164
3168
  style: {},
3165
3169
  tabSwitch: () => {
3170
+ },
3171
+ onSwitch: () => {
3166
3172
  }
3167
3173
  };
3168
3174
  const Tabbar = (props) => {
@@ -3176,7 +3182,8 @@ const Tabbar = (props) => {
3176
3182
  safeAreaInsetBottom,
3177
3183
  className,
3178
3184
  style,
3179
- tabSwitch
3185
+ tabSwitch,
3186
+ onSwitch
3180
3187
  } = {
3181
3188
  ...defaultProps$17,
3182
3189
  ...props
@@ -3208,6 +3215,7 @@ const Tabbar = (props) => {
3208
3215
  handleClick: () => {
3209
3216
  handleClick2(idx);
3210
3217
  tabSwitch(child, idx);
3218
+ onSwitch(child, idx);
3211
3219
  }
3212
3220
  };
3213
3221
  return React__default.cloneElement(child, childProps);
@@ -8648,6 +8656,7 @@ class Title {
8648
8656
  }
8649
8657
  const defaultProps$13 = {
8650
8658
  ...ComponentDefaults,
8659
+ tabStyle: {},
8651
8660
  value: 0,
8652
8661
  color: "",
8653
8662
  background: "",
@@ -8667,6 +8676,7 @@ const Tabs = (props) => {
8667
8676
  const {
8668
8677
  value,
8669
8678
  color,
8679
+ tabStyle,
8670
8680
  background,
8671
8681
  direction,
8672
8682
  type,
@@ -8748,7 +8758,7 @@ const Tabs = (props) => {
8748
8758
  ...rest
8749
8759
  }, /* @__PURE__ */ React__default.createElement("div", {
8750
8760
  className: classesTitle,
8751
- style: { background }
8761
+ style: { ...tabStyle, background }
8752
8762
  }, !!titleNode && typeof titleNode === "function" ? titleNode() : titles.current.map((item, index2) => {
8753
8763
  return /* @__PURE__ */ React__default.createElement("div", {
8754
8764
  style: titleStyle,
@@ -8781,6 +8791,8 @@ const Tabs = (props) => {
8781
8791
  )
8782
8792
  }, item.title));
8783
8793
  })), /* @__PURE__ */ React__default.createElement("div", {
8794
+ className: `${b2("")}__content__wrap`
8795
+ }, /* @__PURE__ */ React__default.createElement("div", {
8784
8796
  className: `${b2("")}__content`,
8785
8797
  style: contentStyle
8786
8798
  }, React__default.Children.map(children, (child, idx) => {
@@ -8799,7 +8811,7 @@ const Tabs = (props) => {
8799
8811
  };
8800
8812
  }
8801
8813
  return React__default.cloneElement(child, childProps);
8802
- })));
8814
+ }))));
8803
8815
  };
8804
8816
  Tabs.defaultProps = defaultProps$13;
8805
8817
  Tabs.displayName = "NutTabs";
@@ -8810,7 +8822,7 @@ const defaultProps$12 = {
8810
8822
  disabled: false
8811
8823
  };
8812
8824
  const TabPane = (props) => {
8813
- const { children, paneKey, activeKey, autoHeightClassName } = {
8825
+ const { children, paneKey, activeKey, autoHeightClassName, className } = {
8814
8826
  ...defaultProps$12,
8815
8827
  ...props
8816
8828
  };
@@ -8820,7 +8832,8 @@ const TabPane = (props) => {
8820
8832
  active: paneKey === activeKey
8821
8833
  },
8822
8834
  b2(""),
8823
- autoHeightClassName
8835
+ autoHeightClassName,
8836
+ className
8824
8837
  );
8825
8838
  return /* @__PURE__ */ React__default.createElement("div", {
8826
8839
  className: classes
@@ -8911,7 +8924,7 @@ const SideNavBar = (props) => {
8911
8924
  children,
8912
8925
  className,
8913
8926
  showhead,
8914
- handleClose,
8927
+ onClose,
8915
8928
  ...rest
8916
8929
  } = {
8917
8930
  ...defaultProps$10,
@@ -8922,7 +8935,7 @@ const SideNavBar = (props) => {
8922
8935
  visible,
8923
8936
  style: { width, height: "100%" },
8924
8937
  position,
8925
- onClose: handleClose
8938
+ onClose
8926
8939
  }, /* @__PURE__ */ React__default.createElement("div", {
8927
8940
  className: className ? `${className} nut-sidenavbar` : "nut-sidenavbar",
8928
8941
  ...rest
@@ -8948,7 +8961,7 @@ const defaultProps$$ = {
8948
8961
  open: true
8949
8962
  };
8950
8963
  const SubSideNavBar = (props) => {
8951
- const { title, ikey, children, titleClick, open, ...rest } = {
8964
+ const { title, ikey, children, onClick, open, ...rest } = {
8952
8965
  ...defaultProps$$,
8953
8966
  ...props
8954
8967
  };
@@ -8985,7 +8998,7 @@ const SubSideNavBar = (props) => {
8985
8998
  handleClick(e2);
8986
8999
  const currentClass = e2.currentTarget.className;
8987
9000
  const isShow = currentClass.includes("nutShow");
8988
- titleClick && titleClick({ title, ikey, isShow });
9001
+ onClick && onClick({ title, ikey, isShow });
8989
9002
  };
8990
9003
  useEffect(() => {
8991
9004
  var _a, _b;
@@ -9009,10 +9022,10 @@ const SubSideNavBar = (props) => {
9009
9022
  }, children));
9010
9023
  };
9011
9024
  const SideNavBarItem = (props) => {
9012
- const { title, ikey, children, click, ...rest } = props;
9025
+ const { title, ikey, children, onClick, ...rest } = props;
9013
9026
  const clickFn = (e2) => {
9014
9027
  e2.stopPropagation();
9015
- click && click({ title, ikey });
9028
+ onClick && onClick({ title, ikey });
9016
9029
  };
9017
9030
  return /* @__PURE__ */ React__default.createElement("div", {
9018
9031
  className: "nut-subsidenavbar__item border-bt",
@@ -9054,7 +9067,6 @@ const Menu = (props) => {
9054
9067
  const onScroll = () => {
9055
9068
  const { scrollFixed: scrollFixed2 } = props;
9056
9069
  const scrollTop = getScrollTop(window);
9057
- console.log(scrollTop);
9058
9070
  const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
9059
9071
  setIsScrollFixed(isFixed);
9060
9072
  };
@@ -9099,11 +9111,12 @@ const Menu = (props) => {
9099
9111
  });
9100
9112
  });
9101
9113
  };
9102
- console.log("isScrollFixed", isScrollFixed);
9103
9114
  return /* @__PURE__ */ React__default.createElement("div", {
9104
9115
  className: `nut-menu ${className} ${isScrollFixed ? "scroll-fixed" : ""}`,
9105
9116
  ...rest,
9106
9117
  ref: parentRef
9118
+ }, /* @__PURE__ */ React__default.createElement("div", {
9119
+ className: "nut-menu-relative"
9107
9120
  }, /* @__PURE__ */ React__default.createElement("div", {
9108
9121
  className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
9109
9122
  }, React__default.Children.toArray(children).map((child, index) => {
@@ -9146,7 +9159,7 @@ const Menu = (props) => {
9146
9159
  size: "10",
9147
9160
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
9148
9161
  })));
9149
- })), cloneChildren());
9162
+ })), cloneChildren()));
9150
9163
  };
9151
9164
  Menu.defaultProps = defaultProps$_;
9152
9165
  Menu.displayName = "NutMenu";
@@ -9219,7 +9232,6 @@ const MenuItem = (props) => {
9219
9232
  setTimeout(() => {
9220
9233
  const p2 = parent.parent().current;
9221
9234
  const rect = p2.getBoundingClientRect();
9222
- console.log(rect, p2.offsetTop, window.screenTop);
9223
9235
  setPosition({
9224
9236
  height: rect.height,
9225
9237
  top: rect.top
@@ -9265,15 +9277,14 @@ const MenuItem = (props) => {
9265
9277
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
9266
9278
  }
9267
9279
  }), /* @__PURE__ */ React__default.createElement("div", {
9268
- className: "nut-menu-item__wrap",
9280
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
9269
9281
  style: {
9270
- ...getPosition(),
9271
9282
  ...isShow()
9272
9283
  }
9273
9284
  }, /* @__PURE__ */ React__default.createElement(CSSTransition$1, {
9274
9285
  in: _showPopup,
9275
9286
  timeout: 100,
9276
- classNames: "menu-item"
9287
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
9277
9288
  }, /* @__PURE__ */ React__default.createElement("div", {
9278
9289
  className: "nut-menu-item__content"
9279
9290
  }, options2 == null ? void 0 : options2.map((item, index) => {
@@ -9630,7 +9641,10 @@ const Range = (props) => {
9630
9641
  marks,
9631
9642
  change,
9632
9643
  dragStart,
9633
- dragEnd
9644
+ dragEnd,
9645
+ onChange,
9646
+ onDragStart,
9647
+ onDragEnd
9634
9648
  } = { ...defaultProps$Y, ...props };
9635
9649
  let { min, max, step } = { ...defaultProps$Y, ...props };
9636
9650
  min = Number(min);
@@ -9794,6 +9808,7 @@ const Range = (props) => {
9794
9808
  }
9795
9809
  if ((marks || end) && !isSameValue(value, startValue)) {
9796
9810
  change && change(value);
9811
+ onChange && onChange(value);
9797
9812
  }
9798
9813
  };
9799
9814
  const click = (event) => {
@@ -9841,6 +9856,7 @@ const Range = (props) => {
9841
9856
  }
9842
9857
  if (dragStatus === "start") {
9843
9858
  dragStart && dragStart();
9859
+ onDragStart && onDragStart();
9844
9860
  }
9845
9861
  touch.move(event);
9846
9862
  SetDragStatus("draging");
@@ -9867,6 +9883,7 @@ const Range = (props) => {
9867
9883
  if (dragStatus === "draging") {
9868
9884
  updateValue(currentValue, true);
9869
9885
  dragEnd && dragEnd();
9886
+ onDragEnd && onDragEnd();
9870
9887
  }
9871
9888
  SetDragStatus("");
9872
9889
  };
@@ -11760,6 +11777,12 @@ const InputNumber = (props) => {
11760
11777
  overlimit,
11761
11778
  blur,
11762
11779
  focus,
11780
+ onAdd,
11781
+ onReduce,
11782
+ onOverlimit,
11783
+ onBlurFuc,
11784
+ onFocus,
11785
+ onChangeFuc,
11763
11786
  iconClassPrefix,
11764
11787
  iconFontClassName,
11765
11788
  ...restProps
@@ -11800,6 +11823,7 @@ const InputNumber = (props) => {
11800
11823
  };
11801
11824
  const emitChange = (value, e2) => {
11802
11825
  const outputValue = fixedDecimalPlaces(value);
11826
+ onChangeFuc && onChangeFuc(outputValue, e2);
11803
11827
  change && change(outputValue, e2);
11804
11828
  if (!isAsync) {
11805
11829
  if (Number(outputValue) < Number(min)) {
@@ -11812,26 +11836,31 @@ const InputNumber = (props) => {
11812
11836
  }
11813
11837
  };
11814
11838
  const reduceNumber = (e2) => {
11839
+ onReduce && onReduce(e2);
11815
11840
  reduce && reduce(e2);
11816
11841
  if (reduceAllow()) {
11817
11842
  const outputValue = Number(inputValue) - Number(step);
11818
11843
  emitChange(outputValue, e2);
11819
11844
  } else {
11845
+ onOverlimit && onOverlimit(e2);
11820
11846
  overlimit && overlimit(e2);
11821
11847
  }
11822
11848
  };
11823
11849
  const addNumber = (e2) => {
11850
+ onAdd && onAdd(e2);
11824
11851
  add && add(e2);
11825
11852
  if (addAllow()) {
11826
11853
  const outputValue = Number(inputValue) + Number(step);
11827
11854
  emitChange(outputValue, e2);
11828
11855
  } else {
11856
+ onOverlimit && onOverlimit(e2);
11829
11857
  overlimit && overlimit(e2);
11830
11858
  }
11831
11859
  };
11832
11860
  const changeValue = (e2) => {
11833
11861
  const input = e2.target;
11834
11862
  change && change(input.valueAsNumber, e2);
11863
+ onChangeFuc && onChangeFuc(input.valueAsNumber, e2);
11835
11864
  if (!isAsync) {
11836
11865
  if (Number.isNaN(input.valueAsNumber)) {
11837
11866
  setInputValue(inputValue);
@@ -11845,6 +11874,7 @@ const InputNumber = (props) => {
11845
11874
  return;
11846
11875
  if (readonly)
11847
11876
  return;
11877
+ onFocus && onFocus(e2);
11848
11878
  focus && focus(e2);
11849
11879
  };
11850
11880
  const burValue = (e2) => {
@@ -11860,6 +11890,7 @@ const InputNumber = (props) => {
11860
11890
  value = Number(max);
11861
11891
  }
11862
11892
  emitChange(value, e2);
11893
+ onBlurFuc && onBlurFuc(e2);
11863
11894
  blur && blur(e2);
11864
11895
  };
11865
11896
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -11992,12 +12023,20 @@ const Input = (props) => {
11992
12023
  rows,
11993
12024
  slotButton,
11994
12025
  slotInput,
12026
+ onChange,
12027
+ onBlur,
12028
+ onFocus,
12029
+ onClear,
12030
+ formatter,
12031
+ keypress,
12032
+ onClickInput,
12033
+ onClickLeftIcon,
12034
+ onClickRightIcon,
12035
+ onClick,
11995
12036
  change,
11996
12037
  blur,
11997
12038
  focus,
11998
12039
  clear,
11999
- formatter,
12000
- keypress,
12001
12040
  clickInput,
12002
12041
  clickLeftIcon,
12003
12042
  clickRightIcon,
@@ -12063,20 +12102,22 @@ const Input = (props) => {
12063
12102
  }
12064
12103
  SetInputValue(val);
12065
12104
  };
12066
- const onFocus = (event) => {
12105
+ const handleFocus = (event) => {
12067
12106
  const val = event.target.value;
12068
12107
  SetActive(true);
12108
+ onFocus && onFocus(val, event);
12069
12109
  focus && focus(val, event);
12070
12110
  };
12071
- const onInput = (event) => {
12111
+ const handleInput = (event) => {
12072
12112
  let val = event.target.value;
12073
12113
  if (maxlength && val.length > Number(maxlength)) {
12074
12114
  val = val.slice(0, Number(maxlength));
12075
12115
  }
12076
12116
  updateValue(val);
12117
+ onChange && onChange(val, event);
12077
12118
  change && change(val, event);
12078
12119
  };
12079
- const onBlur = (event) => {
12120
+ const handleBlur = (event) => {
12080
12121
  setTimeout(() => {
12081
12122
  SetActive(false);
12082
12123
  }, 200);
@@ -12085,15 +12126,19 @@ const Input = (props) => {
12085
12126
  val = val.slice(0, Number(maxlength));
12086
12127
  }
12087
12128
  updateValue(getModelValue(), "onBlur");
12129
+ onBlur && onBlur(val, event);
12088
12130
  blur && blur(val, event);
12089
12131
  };
12090
- const onClickInput = (event) => {
12132
+ const handleClickInput = (event) => {
12133
+ onClickInput && onClickInput(event);
12091
12134
  clickInput && clickInput(event);
12092
12135
  };
12093
- const onClickLeftIcon = (event) => {
12136
+ const handleClickLeftIcon = (event) => {
12137
+ onClickLeftIcon && onClickLeftIcon(event);
12094
12138
  clickLeftIcon && clickLeftIcon(event);
12095
12139
  };
12096
- const onClickRightIcon = (event) => {
12140
+ const handleClickRightIcon = (event) => {
12141
+ onClickRightIcon && onClickRightIcon(event);
12097
12142
  clickRightIcon && clickRightIcon(event);
12098
12143
  };
12099
12144
  const resetValidation = () => {
@@ -12109,6 +12154,7 @@ const Input = (props) => {
12109
12154
  };
12110
12155
  const handleClear = (event) => {
12111
12156
  updateValue("");
12157
+ onClear && onClear("", event);
12112
12158
  clear && clear("", event);
12113
12159
  };
12114
12160
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -12116,6 +12162,7 @@ const Input = (props) => {
12116
12162
  style,
12117
12163
  ...rest,
12118
12164
  onClick: (e2) => {
12165
+ onClick && onClick(e2);
12119
12166
  click && click(e2);
12120
12167
  }
12121
12168
  }, slotInput ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
@@ -12128,12 +12175,12 @@ const Input = (props) => {
12128
12175
  }, /* @__PURE__ */ React__default.createElement("div", {
12129
12176
  className: "nut-input-inner",
12130
12177
  onClick: (e2) => {
12131
- onClickInput(e2);
12178
+ handleClickInput(e2);
12132
12179
  }
12133
12180
  }, slotInput))) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, leftIcon && leftIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
12134
12181
  className: "nut-input-left-icon",
12135
12182
  onClick: (e2) => {
12136
- onClickLeftIcon(e2);
12183
+ handleClickLeftIcon(e2);
12137
12184
  }
12138
12185
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12139
12186
  classPrefix: iconClassPrefix,
@@ -12150,7 +12197,7 @@ const Input = (props) => {
12150
12197
  }, /* @__PURE__ */ React__default.createElement("div", {
12151
12198
  className: "nut-input-inner",
12152
12199
  onClick: (e2) => {
12153
- onClickInput(e2);
12200
+ handleClickInput(e2);
12154
12201
  }
12155
12202
  }, type === "textarea" ? /* @__PURE__ */ React__default.createElement("textarea", {
12156
12203
  className: "input-text",
@@ -12166,13 +12213,13 @@ const Input = (props) => {
12166
12213
  value: inputValue,
12167
12214
  autoFocus: autofocus,
12168
12215
  onBlur: (e2) => {
12169
- onBlur(e2);
12216
+ handleBlur(e2);
12170
12217
  },
12171
12218
  onFocus: (e2) => {
12172
- onFocus(e2);
12219
+ handleFocus(e2);
12173
12220
  },
12174
12221
  onInput: (e2) => {
12175
- onInput(e2);
12222
+ handleInput(e2);
12176
12223
  }
12177
12224
  }) : /* @__PURE__ */ React__default.createElement("input", {
12178
12225
  className: "input-text",
@@ -12186,13 +12233,13 @@ const Input = (props) => {
12186
12233
  value: inputValue,
12187
12234
  autoFocus: autofocus,
12188
12235
  onBlur: (e2) => {
12189
- onBlur(e2);
12236
+ handleBlur(e2);
12190
12237
  },
12191
12238
  onFocus: (e2) => {
12192
- onFocus(e2);
12239
+ handleFocus(e2);
12193
12240
  },
12194
12241
  onInput: (e2) => {
12195
- onInput(e2);
12242
+ handleInput(e2);
12196
12243
  }
12197
12244
  }), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default.createElement(Icon$1, {
12198
12245
  classPrefix: iconClassPrefix,
@@ -12206,7 +12253,7 @@ const Input = (props) => {
12206
12253
  }) : null, rightIcon && rightIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
12207
12254
  className: "nut-input-right-icon",
12208
12255
  onClick: (e2) => {
12209
- onClickRightIcon(e2);
12256
+ handleClickRightIcon(e2);
12210
12257
  }
12211
12258
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12212
12259
  classPrefix: iconClassPrefix,
@@ -12360,9 +12407,9 @@ const Radio = (props) => {
12360
12407
  return renderButton();
12361
12408
  }
12362
12409
  if (reverseState) {
12363
- return [renderLabel(), renderIcon()];
12410
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderLabel(), renderIcon());
12364
12411
  }
12365
- return [renderIcon(), renderLabel()];
12412
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderIcon(), renderLabel());
12366
12413
  };
12367
12414
  const handleClick2 = (e2) => {
12368
12415
  if (disabledStatement || checkedStatement)
@@ -13435,7 +13482,7 @@ const InternalUploader = (props, ref) => {
13435
13482
  classPrefix: iconClassPrefix,
13436
13483
  fontClassName: iconFontClassName,
13437
13484
  name: "link"
13438
- }), "\xA0", item.name), /* @__PURE__ */ React__default.createElement(Icon$1, {
13485
+ }), "\xA0", item.name), isDeletable && /* @__PURE__ */ React__default.createElement(Icon$1, {
13439
13486
  classPrefix: iconClassPrefix,
13440
13487
  fontClassName: iconFontClassName,
13441
13488
  color: "#808080",
@@ -15330,7 +15377,7 @@ const Switch = (props) => {
15330
15377
  inactiveColor,
15331
15378
  activeText,
15332
15379
  inactiveText,
15333
- change,
15380
+ onChange,
15334
15381
  className,
15335
15382
  style
15336
15383
  } = {
@@ -15358,7 +15405,7 @@ const Switch = (props) => {
15358
15405
  if (!isAsync) {
15359
15406
  setValue(!value);
15360
15407
  }
15361
- change && change(!value, event);
15408
+ onChange && onChange(!value, event);
15362
15409
  };
15363
15410
  return /* @__PURE__ */ React__default.createElement("div", {
15364
15411
  className: classes(),
@@ -15905,6 +15952,8 @@ const NoticeBar = (props) => {
15905
15952
  rightIcon,
15906
15953
  close,
15907
15954
  click,
15955
+ onClose,
15956
+ onClick,
15908
15957
  iconClassPrefix,
15909
15958
  iconFontClassName
15910
15959
  } = {
@@ -15990,11 +16039,13 @@ const NoticeBar = (props) => {
15990
16039
  };
15991
16040
  const handleClick2 = (event) => {
15992
16041
  click && click(event);
16042
+ onClick && onClick(event);
15993
16043
  };
15994
16044
  const onClickIcon = (event) => {
15995
16045
  event.stopPropagation();
15996
16046
  SetShowNoticeBar(!closeMode);
15997
16047
  close && close(event);
16048
+ onClose && onClose(event);
15998
16049
  };
15999
16050
  const onAnimationEnd = () => {
16000
16051
  SetFirstRound(false);
@@ -16044,9 +16095,11 @@ const NoticeBar = (props) => {
16044
16095
  };
16045
16096
  const go = (item) => {
16046
16097
  click && click(item);
16098
+ onClick && onClick(item);
16047
16099
  };
16048
16100
  const handleClickIcon = () => {
16049
16101
  close && close(scrollList[0]);
16102
+ onClose && onClose(scrollList[0]);
16050
16103
  };
16051
16104
  const iconShow = () => {
16052
16105
  if (leftIcon === "close") {
@@ -16172,6 +16225,7 @@ const Steps = (props) => {
16172
16225
  className,
16173
16226
  progressDot,
16174
16227
  clickStep,
16228
+ onClickStep,
16175
16229
  ...restProps
16176
16230
  } = propSteps;
16177
16231
  const parentSteps = {
@@ -16235,10 +16289,9 @@ const Step = (props) => {
16235
16289
  return index === +parent.propSteps.current ? "process" : "wait";
16236
16290
  };
16237
16291
  const handleClickStep = () => {
16238
- var _a, _b;
16239
- if ((_a = parent.propSteps) == null ? void 0 : _a.clickStep) {
16240
- (_b = parent.propSteps) == null ? void 0 : _b.clickStep(activeIndex);
16241
- }
16292
+ var _a, _b, _c, _d;
16293
+ ((_a = parent.propSteps) == null ? void 0 : _a.onClickStep) && ((_b = parent.propSteps) == null ? void 0 : _b.onClickStep(activeIndex));
16294
+ ((_c = parent.propSteps) == null ? void 0 : _c.clickStep) && ((_d = parent.propSteps) == null ? void 0 : _d.clickStep(activeIndex));
16242
16295
  };
16243
16296
  const b2 = cn("step");
16244
16297
  const classes = classNames(
@@ -16770,6 +16823,7 @@ const Avatar = (props) => {
16770
16823
  className,
16771
16824
  style,
16772
16825
  activeAvatar,
16826
+ onActiveAvatar,
16773
16827
  onError,
16774
16828
  iconClassPrefix,
16775
16829
  iconFontClassName,
@@ -16814,7 +16868,6 @@ const Avatar = (props) => {
16814
16868
  const avatarLength = (children2) => {
16815
16869
  var _a2, _b2, _c2;
16816
16870
  for (let i = 0; i < children2.length; i++) {
16817
- console.log("child", children2[i], children2[i].classList);
16818
16871
  if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
16819
16872
  children2[i].setAttribute("data-index", i + 1);
16820
16873
  }
@@ -16833,9 +16886,8 @@ const Avatar = (props) => {
16833
16886
  }
16834
16887
  };
16835
16888
  const clickAvatar = (e2) => {
16836
- if (props.activeAvatar) {
16837
- props.activeAvatar(e2);
16838
- }
16889
+ activeAvatar && activeAvatar(e2);
16890
+ onActiveAvatar && onActiveAvatar(e2);
16839
16891
  };
16840
16892
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (showMax || !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount) || avatarIndex <= ((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount)) && /* @__PURE__ */ React__default.createElement("div", {
16841
16893
  className: cls,
@@ -17621,6 +17673,7 @@ const CountDown = React__default.forwardRef(InternalCountDown);
17621
17673
  CountDown.defaultProps = defaultProps$j;
17622
17674
  CountDown.displayName = "NutCountDown";
17623
17675
  const defaultProps$i = {
17676
+ style: {},
17624
17677
  activeName: ["0"],
17625
17678
  accordion: false,
17626
17679
  icon: "",
@@ -17634,6 +17687,8 @@ function areEqual(prevProps, nextProps) {
17634
17687
  const Collapse = memo(
17635
17688
  (props) => {
17636
17689
  const {
17690
+ className,
17691
+ style,
17637
17692
  children,
17638
17693
  activeName,
17639
17694
  accordion,
@@ -17641,7 +17696,7 @@ const Collapse = memo(
17641
17696
  rotate,
17642
17697
  iconSize,
17643
17698
  iconColor,
17644
- change
17699
+ onChange
17645
17700
  } = {
17646
17701
  ...defaultProps$i,
17647
17702
  ...props
@@ -17683,10 +17738,11 @@ const Collapse = memo(
17683
17738
  }
17684
17739
  }
17685
17740
  setDefaultOpenIndex(newOpenIndex);
17686
- change && change(!isOpen, name);
17741
+ onChange && onChange(!isOpen, name);
17687
17742
  };
17688
17743
  return /* @__PURE__ */ React__default.createElement("div", {
17689
- className: colBem()
17744
+ className: `${colBem()} ${className}`,
17745
+ style
17690
17746
  }, childrenDom.map((item) => {
17691
17747
  return React__default.cloneElement(item, {
17692
17748
  isOpen: defaultOpenIndex.includes(item.props.name),
@@ -18111,6 +18167,7 @@ const VirtualList = (props) => {
18111
18167
  overscan = 2,
18112
18168
  key,
18113
18169
  handleScroll,
18170
+ onScroll,
18114
18171
  className,
18115
18172
  containerSize,
18116
18173
  ...rest
@@ -18177,7 +18234,7 @@ const VirtualList = (props) => {
18177
18234
  const totalSize = getListTotalSize(positions, horizontal);
18178
18235
  setListTotalSize(totalSize);
18179
18236
  }, [positions, sizeKey, horizontal]);
18180
- const onScroll = useCallback(() => {
18237
+ const scroll = useCallback(() => {
18181
18238
  requestAnimationFrame((e2) => {
18182
18239
  const scrollSize = getElement()[scrollKey];
18183
18240
  const startIndex = binarySearch(positions, scrollSize, horizontal);
@@ -18198,7 +18255,11 @@ const VirtualList = (props) => {
18198
18255
  const startOffset = positions[startIndex][offsetKey];
18199
18256
  setOptions({ startOffset, startIndex, overStart, endIndex });
18200
18257
  if (endIndex > sourceData.length - 1) {
18201
- handleScroll && handleScroll();
18258
+ if (onScroll) {
18259
+ onScroll();
18260
+ } else if (handleScroll) {
18261
+ handleScroll();
18262
+ }
18202
18263
  }
18203
18264
  });
18204
18265
  }, [
@@ -18218,11 +18279,11 @@ const VirtualList = (props) => {
18218
18279
  ]);
18219
18280
  useEffect(() => {
18220
18281
  const element = getElement();
18221
- element.addEventListener("scroll", onScroll, false);
18282
+ element.addEventListener("scroll", scroll, false);
18222
18283
  return () => {
18223
- element.removeEventListener("scroll", onScroll, false);
18284
+ element.removeEventListener("scroll", scroll, false);
18224
18285
  };
18225
- }, [getElement, onScroll]);
18286
+ }, [getElement, scroll]);
18226
18287
  return /* @__PURE__ */ React__default.createElement("div", {
18227
18288
  className: className ? `${className} nut-virtualList-box` : "nut-virtualList-box",
18228
18289
  ...rest,
@@ -18412,6 +18473,9 @@ const Video = (props) => {
18412
18473
  play,
18413
18474
  pause,
18414
18475
  playend,
18476
+ onPlayFuc,
18477
+ onPauseFuc,
18478
+ onPlayend,
18415
18479
  ...restProps
18416
18480
  } = {
18417
18481
  ...defaultProps$b,
@@ -18438,13 +18502,16 @@ const Video = (props) => {
18438
18502
  videoRef.setAttribute("x5-video-player-fullscreen", "false");
18439
18503
  }
18440
18504
  videoRef.addEventListener("play", () => {
18505
+ onPlayFuc && onPlayFuc(videoRef);
18441
18506
  play && play(videoRef);
18442
18507
  });
18443
18508
  videoRef.addEventListener("pause", () => {
18509
+ onPauseFuc && onPauseFuc(videoRef);
18444
18510
  pause && pause(videoRef);
18445
18511
  });
18446
18512
  videoRef.addEventListener("ended", () => {
18447
18513
  videoRef.currentTime = 0;
18514
+ onPlayend && onPlayend(videoRef);
18448
18515
  playend && playend(videoRef);
18449
18516
  });
18450
18517
  }
@@ -19568,7 +19635,18 @@ const defaultProps$4 = {
19568
19635
  };
19569
19636
  const Signature = (props) => {
19570
19637
  const { locale } = useConfig();
19571
- const { type, lineWidth, strokeStyle, unSupportTpl, className, ...rest } = {
19638
+ const {
19639
+ type,
19640
+ lineWidth,
19641
+ strokeStyle,
19642
+ unSupportTpl,
19643
+ className,
19644
+ confirm: confirm2,
19645
+ clear,
19646
+ onConfirm,
19647
+ onClear,
19648
+ ...rest
19649
+ } = {
19572
19650
  ...defaultProps$4,
19573
19651
  ...props
19574
19652
  };
@@ -19633,15 +19711,16 @@ const Signature = (props) => {
19633
19711
  canvasRef.current.removeEventListener(events[2], endEventHandler, false);
19634
19712
  }
19635
19713
  };
19636
- const clear = () => {
19714
+ const handleClearBtn = () => {
19637
19715
  if (canvasRef.current && ctx2.current) {
19638
19716
  canvasRef.current.addEventListener(events[2], endEventHandler, false);
19639
19717
  ctx2.current.clearRect(0, 0, canvasWidth, canvasHeight);
19640
19718
  ctx2.current.closePath();
19641
19719
  }
19642
- props.clear && props.clear();
19720
+ clear && clear();
19721
+ onClear && onClear();
19643
19722
  };
19644
- const confirm2 = () => {
19723
+ const handleConfirmBtn = () => {
19645
19724
  onSave(canvasRef.current);
19646
19725
  };
19647
19726
  const onSave = (canvas) => {
@@ -19656,8 +19735,9 @@ const Signature = (props) => {
19656
19735
  default:
19657
19736
  dataurl = canvas.toDataURL("image/png");
19658
19737
  }
19659
- clear();
19660
- props.confirm && props.confirm(canvas, dataurl);
19738
+ handleClearBtn();
19739
+ confirm2 && confirm2(canvas, dataurl);
19740
+ onConfirm && onConfirm(canvas, dataurl);
19661
19741
  };
19662
19742
  return /* @__PURE__ */ React__default.createElement("div", {
19663
19743
  className: `${b2()} ${className}`,
@@ -19674,11 +19754,11 @@ const Signature = (props) => {
19674
19754
  }, locale.signature.unSupportTpl || unSupportTpl)), /* @__PURE__ */ React__default.createElement(Button, {
19675
19755
  className: `${b2("btn")}`,
19676
19756
  type: "default",
19677
- onClick: () => clear()
19757
+ onClick: () => handleClearBtn()
19678
19758
  }, locale.signature.reSign), /* @__PURE__ */ React__default.createElement(Button, {
19679
19759
  className: `${b2("btn")}`,
19680
19760
  type: "primary",
19681
- onClick: () => confirm2()
19761
+ onClick: () => handleConfirmBtn()
19682
19762
  }, locale.confirm));
19683
19763
  };
19684
19764
  Signature.defaultProps = defaultProps$4;
@@ -19805,6 +19885,7 @@ TimeDetail.defaultProps = defaultProps$1;
19805
19885
  TimeDetail.displayName = "NutTimeDetail";
19806
19886
  const defaultProps = {
19807
19887
  className: "",
19888
+ style: {},
19808
19889
  visible: false,
19809
19890
  height: "20%",
19810
19891
  multiple: false,
@@ -19817,7 +19898,6 @@ const defaultProps = {
19817
19898
  const TimeSelect = (props) => {
19818
19899
  useConfig();
19819
19900
  const {
19820
- children,
19821
19901
  visible,
19822
19902
  className,
19823
19903
  height,
@@ -19829,7 +19909,10 @@ const TimeSelect = (props) => {
19829
19909
  multiple,
19830
19910
  select,
19831
19911
  pannelChange,
19832
- timeChange
19912
+ timeChange,
19913
+ onSelect,
19914
+ onPannelChange,
19915
+ onTimeChange
19833
19916
  } = {
19834
19917
  ...defaultProps,
19835
19918
  ...props
@@ -19850,7 +19933,11 @@ const TimeSelect = (props) => {
19850
19933
  };
19851
19934
  const b2 = cn("timeselect");
19852
19935
  const closeFun = () => {
19853
- select && select(activeTime);
19936
+ if (onSelect) {
19937
+ onSelect(activeTime);
19938
+ } else if (select) {
19939
+ select(activeTime);
19940
+ }
19854
19941
  };
19855
19942
  const handleSelectTime = (time) => {
19856
19943
  let curTimeData = {};
@@ -19873,7 +19960,11 @@ const TimeSelect = (props) => {
19873
19960
  const resultTimeData = [...activeTime];
19874
19961
  resultTimeData.splice(curIndex, 1, curTimeData);
19875
19962
  setActiveTime(resultTimeData);
19876
- timeChange && timeChange(time, resultTimeData);
19963
+ if (onTimeChange) {
19964
+ onTimeChange(time, resultTimeData);
19965
+ } else if (timeChange) {
19966
+ timeChange(time, resultTimeData);
19967
+ }
19877
19968
  };
19878
19969
  const handleChange = (pannelKey) => {
19879
19970
  const resultTimeData = [...activeTime];
@@ -19899,7 +19990,11 @@ const TimeSelect = (props) => {
19899
19990
  ]);
19900
19991
  }
19901
19992
  }
19902
- pannelChange && pannelChange(pannelKey, resultTimeData);
19993
+ if (onPannelChange) {
19994
+ onPannelChange(pannelKey, resultTimeData);
19995
+ } else if (pannelChange) {
19996
+ pannelChange(pannelKey, resultTimeData);
19997
+ }
19903
19998
  };
19904
19999
  const getTimePannelClass = (dataItem) => {
19905
20000
  if (String(dataItem["pannel-key"]) === String(activeKey)) {