@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
  */
@@ -1496,12 +1496,15 @@
1496
1496
  iconSlot: null,
1497
1497
  linkSlot: null,
1498
1498
  click: (event) => {
1499
+ },
1500
+ onClick: (event) => {
1499
1501
  }
1500
1502
  };
1501
1503
  const Cell = (props) => {
1502
1504
  const {
1503
1505
  children,
1504
1506
  click,
1507
+ onClick,
1505
1508
  title,
1506
1509
  subTitle,
1507
1510
  desc,
@@ -1528,6 +1531,7 @@
1528
1531
  const history = useHistory();
1529
1532
  const handleClick2 = (event) => {
1530
1533
  click(event);
1534
+ onClick(event);
1531
1535
  if (to2 && history) {
1532
1536
  history[replace ? "replace" : "push"](to2);
1533
1537
  } else if (url) {
@@ -3190,6 +3194,8 @@
3190
3194
  className: "",
3191
3195
  style: {},
3192
3196
  tabSwitch: () => {
3197
+ },
3198
+ onSwitch: () => {
3193
3199
  }
3194
3200
  };
3195
3201
  const Tabbar = (props) => {
@@ -3203,7 +3209,8 @@
3203
3209
  safeAreaInsetBottom,
3204
3210
  className,
3205
3211
  style,
3206
- tabSwitch
3212
+ tabSwitch,
3213
+ onSwitch
3207
3214
  } = {
3208
3215
  ...defaultProps$17,
3209
3216
  ...props
@@ -3235,6 +3242,7 @@
3235
3242
  handleClick: () => {
3236
3243
  handleClick2(idx);
3237
3244
  tabSwitch(child, idx);
3245
+ onSwitch(child, idx);
3238
3246
  }
3239
3247
  };
3240
3248
  return React__default["default"].cloneElement(child, childProps);
@@ -8675,6 +8683,7 @@
8675
8683
  }
8676
8684
  const defaultProps$13 = {
8677
8685
  ...ComponentDefaults,
8686
+ tabStyle: {},
8678
8687
  value: 0,
8679
8688
  color: "",
8680
8689
  background: "",
@@ -8694,6 +8703,7 @@
8694
8703
  const {
8695
8704
  value,
8696
8705
  color,
8706
+ tabStyle,
8697
8707
  background,
8698
8708
  direction,
8699
8709
  type,
@@ -8775,7 +8785,7 @@
8775
8785
  ...rest
8776
8786
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
8777
8787
  className: classesTitle,
8778
- style: { background }
8788
+ style: { ...tabStyle, background }
8779
8789
  }, !!titleNode && typeof titleNode === "function" ? titleNode() : titles.current.map((item, index2) => {
8780
8790
  return /* @__PURE__ */ React__default["default"].createElement("div", {
8781
8791
  style: titleStyle,
@@ -8808,6 +8818,8 @@
8808
8818
  )
8809
8819
  }, item.title));
8810
8820
  })), /* @__PURE__ */ React__default["default"].createElement("div", {
8821
+ className: `${b2("")}__content__wrap`
8822
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
8811
8823
  className: `${b2("")}__content`,
8812
8824
  style: contentStyle
8813
8825
  }, React__default["default"].Children.map(children, (child, idx) => {
@@ -8826,7 +8838,7 @@
8826
8838
  };
8827
8839
  }
8828
8840
  return React__default["default"].cloneElement(child, childProps);
8829
- })));
8841
+ }))));
8830
8842
  };
8831
8843
  Tabs.defaultProps = defaultProps$13;
8832
8844
  Tabs.displayName = "NutTabs";
@@ -8837,7 +8849,7 @@
8837
8849
  disabled: false
8838
8850
  };
8839
8851
  const TabPane = (props) => {
8840
- const { children, paneKey, activeKey, autoHeightClassName } = {
8852
+ const { children, paneKey, activeKey, autoHeightClassName, className } = {
8841
8853
  ...defaultProps$12,
8842
8854
  ...props
8843
8855
  };
@@ -8847,7 +8859,8 @@
8847
8859
  active: paneKey === activeKey
8848
8860
  },
8849
8861
  b2(""),
8850
- autoHeightClassName
8862
+ autoHeightClassName,
8863
+ className
8851
8864
  );
8852
8865
  return /* @__PURE__ */ React__default["default"].createElement("div", {
8853
8866
  className: classes
@@ -8938,7 +8951,7 @@
8938
8951
  children,
8939
8952
  className,
8940
8953
  showhead,
8941
- handleClose,
8954
+ onClose,
8942
8955
  ...rest
8943
8956
  } = {
8944
8957
  ...defaultProps$10,
@@ -8949,7 +8962,7 @@
8949
8962
  visible,
8950
8963
  style: { width, height: "100%" },
8951
8964
  position,
8952
- onClose: handleClose
8965
+ onClose
8953
8966
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
8954
8967
  className: className ? `${className} nut-sidenavbar` : "nut-sidenavbar",
8955
8968
  ...rest
@@ -8975,7 +8988,7 @@
8975
8988
  open: true
8976
8989
  };
8977
8990
  const SubSideNavBar = (props) => {
8978
- const { title, ikey, children, titleClick, open, ...rest } = {
8991
+ const { title, ikey, children, onClick, open, ...rest } = {
8979
8992
  ...defaultProps$$,
8980
8993
  ...props
8981
8994
  };
@@ -9012,7 +9025,7 @@
9012
9025
  handleClick(e2);
9013
9026
  const currentClass = e2.currentTarget.className;
9014
9027
  const isShow = currentClass.includes("nutShow");
9015
- titleClick && titleClick({ title, ikey, isShow });
9028
+ onClick && onClick({ title, ikey, isShow });
9016
9029
  };
9017
9030
  React.useEffect(() => {
9018
9031
  var _a, _b;
@@ -9036,10 +9049,10 @@
9036
9049
  }, children));
9037
9050
  };
9038
9051
  const SideNavBarItem = (props) => {
9039
- const { title, ikey, children, click, ...rest } = props;
9052
+ const { title, ikey, children, onClick, ...rest } = props;
9040
9053
  const clickFn = (e2) => {
9041
9054
  e2.stopPropagation();
9042
- click && click({ title, ikey });
9055
+ onClick && onClick({ title, ikey });
9043
9056
  };
9044
9057
  return /* @__PURE__ */ React__default["default"].createElement("div", {
9045
9058
  className: "nut-subsidenavbar__item border-bt",
@@ -9081,7 +9094,6 @@
9081
9094
  const onScroll = () => {
9082
9095
  const { scrollFixed: scrollFixed2 } = props;
9083
9096
  const scrollTop = getScrollTop(window);
9084
- console.log(scrollTop);
9085
9097
  const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
9086
9098
  setIsScrollFixed(isFixed);
9087
9099
  };
@@ -9126,11 +9138,12 @@
9126
9138
  });
9127
9139
  });
9128
9140
  };
9129
- console.log("isScrollFixed", isScrollFixed);
9130
9141
  return /* @__PURE__ */ React__default["default"].createElement("div", {
9131
9142
  className: `nut-menu ${className} ${isScrollFixed ? "scroll-fixed" : ""}`,
9132
9143
  ...rest,
9133
9144
  ref: parentRef
9145
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
9146
+ className: "nut-menu-relative"
9134
9147
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
9135
9148
  className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
9136
9149
  }, React__default["default"].Children.toArray(children).map((child, index) => {
@@ -9173,7 +9186,7 @@
9173
9186
  size: "10",
9174
9187
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
9175
9188
  })));
9176
- })), cloneChildren());
9189
+ })), cloneChildren()));
9177
9190
  };
9178
9191
  Menu.defaultProps = defaultProps$_;
9179
9192
  Menu.displayName = "NutMenu";
@@ -9246,7 +9259,6 @@
9246
9259
  setTimeout(() => {
9247
9260
  const p2 = parent.parent().current;
9248
9261
  const rect = p2.getBoundingClientRect();
9249
- console.log(rect, p2.offsetTop, window.screenTop);
9250
9262
  setPosition({
9251
9263
  height: rect.height,
9252
9264
  top: rect.top
@@ -9292,15 +9304,14 @@
9292
9304
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
9293
9305
  }
9294
9306
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
9295
- className: "nut-menu-item__wrap",
9307
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
9296
9308
  style: {
9297
- ...getPosition(),
9298
9309
  ...isShow()
9299
9310
  }
9300
9311
  }, /* @__PURE__ */ React__default["default"].createElement(CSSTransition$1, {
9301
9312
  in: _showPopup,
9302
9313
  timeout: 100,
9303
- classNames: "menu-item"
9314
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
9304
9315
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
9305
9316
  className: "nut-menu-item__content"
9306
9317
  }, options2 == null ? void 0 : options2.map((item, index) => {
@@ -9657,7 +9668,10 @@
9657
9668
  marks,
9658
9669
  change,
9659
9670
  dragStart,
9660
- dragEnd
9671
+ dragEnd,
9672
+ onChange,
9673
+ onDragStart,
9674
+ onDragEnd
9661
9675
  } = { ...defaultProps$Y, ...props };
9662
9676
  let { min, max, step } = { ...defaultProps$Y, ...props };
9663
9677
  min = Number(min);
@@ -9821,6 +9835,7 @@
9821
9835
  }
9822
9836
  if ((marks || end) && !isSameValue(value, startValue)) {
9823
9837
  change && change(value);
9838
+ onChange && onChange(value);
9824
9839
  }
9825
9840
  };
9826
9841
  const click = (event) => {
@@ -9868,6 +9883,7 @@
9868
9883
  }
9869
9884
  if (dragStatus === "start") {
9870
9885
  dragStart && dragStart();
9886
+ onDragStart && onDragStart();
9871
9887
  }
9872
9888
  touch.move(event);
9873
9889
  SetDragStatus("draging");
@@ -9894,6 +9910,7 @@
9894
9910
  if (dragStatus === "draging") {
9895
9911
  updateValue(currentValue, true);
9896
9912
  dragEnd && dragEnd();
9913
+ onDragEnd && onDragEnd();
9897
9914
  }
9898
9915
  SetDragStatus("");
9899
9916
  };
@@ -11787,6 +11804,12 @@
11787
11804
  overlimit,
11788
11805
  blur,
11789
11806
  focus,
11807
+ onAdd,
11808
+ onReduce,
11809
+ onOverlimit,
11810
+ onBlurFuc,
11811
+ onFocus,
11812
+ onChangeFuc,
11790
11813
  iconClassPrefix,
11791
11814
  iconFontClassName,
11792
11815
  ...restProps
@@ -11827,6 +11850,7 @@
11827
11850
  };
11828
11851
  const emitChange = (value, e2) => {
11829
11852
  const outputValue = fixedDecimalPlaces(value);
11853
+ onChangeFuc && onChangeFuc(outputValue, e2);
11830
11854
  change && change(outputValue, e2);
11831
11855
  if (!isAsync) {
11832
11856
  if (Number(outputValue) < Number(min)) {
@@ -11839,26 +11863,31 @@
11839
11863
  }
11840
11864
  };
11841
11865
  const reduceNumber = (e2) => {
11866
+ onReduce && onReduce(e2);
11842
11867
  reduce && reduce(e2);
11843
11868
  if (reduceAllow()) {
11844
11869
  const outputValue = Number(inputValue) - Number(step);
11845
11870
  emitChange(outputValue, e2);
11846
11871
  } else {
11872
+ onOverlimit && onOverlimit(e2);
11847
11873
  overlimit && overlimit(e2);
11848
11874
  }
11849
11875
  };
11850
11876
  const addNumber = (e2) => {
11877
+ onAdd && onAdd(e2);
11851
11878
  add && add(e2);
11852
11879
  if (addAllow()) {
11853
11880
  const outputValue = Number(inputValue) + Number(step);
11854
11881
  emitChange(outputValue, e2);
11855
11882
  } else {
11883
+ onOverlimit && onOverlimit(e2);
11856
11884
  overlimit && overlimit(e2);
11857
11885
  }
11858
11886
  };
11859
11887
  const changeValue = (e2) => {
11860
11888
  const input = e2.target;
11861
11889
  change && change(input.valueAsNumber, e2);
11890
+ onChangeFuc && onChangeFuc(input.valueAsNumber, e2);
11862
11891
  if (!isAsync) {
11863
11892
  if (Number.isNaN(input.valueAsNumber)) {
11864
11893
  setInputValue(inputValue);
@@ -11872,6 +11901,7 @@
11872
11901
  return;
11873
11902
  if (readonly)
11874
11903
  return;
11904
+ onFocus && onFocus(e2);
11875
11905
  focus && focus(e2);
11876
11906
  };
11877
11907
  const burValue = (e2) => {
@@ -11887,6 +11917,7 @@
11887
11917
  value = Number(max);
11888
11918
  }
11889
11919
  emitChange(value, e2);
11920
+ onBlurFuc && onBlurFuc(e2);
11890
11921
  blur && blur(e2);
11891
11922
  };
11892
11923
  return /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -12019,12 +12050,20 @@
12019
12050
  rows,
12020
12051
  slotButton,
12021
12052
  slotInput,
12053
+ onChange,
12054
+ onBlur,
12055
+ onFocus,
12056
+ onClear,
12057
+ formatter,
12058
+ keypress,
12059
+ onClickInput,
12060
+ onClickLeftIcon,
12061
+ onClickRightIcon,
12062
+ onClick,
12022
12063
  change,
12023
12064
  blur,
12024
12065
  focus,
12025
12066
  clear,
12026
- formatter,
12027
- keypress,
12028
12067
  clickInput,
12029
12068
  clickLeftIcon,
12030
12069
  clickRightIcon,
@@ -12090,20 +12129,22 @@
12090
12129
  }
12091
12130
  SetInputValue(val);
12092
12131
  };
12093
- const onFocus = (event) => {
12132
+ const handleFocus = (event) => {
12094
12133
  const val = event.target.value;
12095
12134
  SetActive(true);
12135
+ onFocus && onFocus(val, event);
12096
12136
  focus && focus(val, event);
12097
12137
  };
12098
- const onInput = (event) => {
12138
+ const handleInput = (event) => {
12099
12139
  let val = event.target.value;
12100
12140
  if (maxlength && val.length > Number(maxlength)) {
12101
12141
  val = val.slice(0, Number(maxlength));
12102
12142
  }
12103
12143
  updateValue(val);
12144
+ onChange && onChange(val, event);
12104
12145
  change && change(val, event);
12105
12146
  };
12106
- const onBlur = (event) => {
12147
+ const handleBlur = (event) => {
12107
12148
  setTimeout(() => {
12108
12149
  SetActive(false);
12109
12150
  }, 200);
@@ -12112,15 +12153,19 @@
12112
12153
  val = val.slice(0, Number(maxlength));
12113
12154
  }
12114
12155
  updateValue(getModelValue(), "onBlur");
12156
+ onBlur && onBlur(val, event);
12115
12157
  blur && blur(val, event);
12116
12158
  };
12117
- const onClickInput = (event) => {
12159
+ const handleClickInput = (event) => {
12160
+ onClickInput && onClickInput(event);
12118
12161
  clickInput && clickInput(event);
12119
12162
  };
12120
- const onClickLeftIcon = (event) => {
12163
+ const handleClickLeftIcon = (event) => {
12164
+ onClickLeftIcon && onClickLeftIcon(event);
12121
12165
  clickLeftIcon && clickLeftIcon(event);
12122
12166
  };
12123
- const onClickRightIcon = (event) => {
12167
+ const handleClickRightIcon = (event) => {
12168
+ onClickRightIcon && onClickRightIcon(event);
12124
12169
  clickRightIcon && clickRightIcon(event);
12125
12170
  };
12126
12171
  const resetValidation = () => {
@@ -12136,6 +12181,7 @@
12136
12181
  };
12137
12182
  const handleClear = (event) => {
12138
12183
  updateValue("");
12184
+ onClear && onClear("", event);
12139
12185
  clear && clear("", event);
12140
12186
  };
12141
12187
  return /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -12143,6 +12189,7 @@
12143
12189
  style,
12144
12190
  ...rest,
12145
12191
  onClick: (e2) => {
12192
+ onClick && onClick(e2);
12146
12193
  click && click(e2);
12147
12194
  }
12148
12195
  }, slotInput ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -12155,12 +12202,12 @@
12155
12202
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
12156
12203
  className: "nut-input-inner",
12157
12204
  onClick: (e2) => {
12158
- onClickInput(e2);
12205
+ handleClickInput(e2);
12159
12206
  }
12160
12207
  }, slotInput))) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, leftIcon && leftIcon.length > 0 ? /* @__PURE__ */ React__default["default"].createElement("div", {
12161
12208
  className: "nut-input-left-icon",
12162
12209
  onClick: (e2) => {
12163
- onClickLeftIcon(e2);
12210
+ handleClickLeftIcon(e2);
12164
12211
  }
12165
12212
  }, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
12166
12213
  classPrefix: iconClassPrefix,
@@ -12177,7 +12224,7 @@
12177
12224
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
12178
12225
  className: "nut-input-inner",
12179
12226
  onClick: (e2) => {
12180
- onClickInput(e2);
12227
+ handleClickInput(e2);
12181
12228
  }
12182
12229
  }, type === "textarea" ? /* @__PURE__ */ React__default["default"].createElement("textarea", {
12183
12230
  className: "input-text",
@@ -12193,13 +12240,13 @@
12193
12240
  value: inputValue,
12194
12241
  autoFocus: autofocus,
12195
12242
  onBlur: (e2) => {
12196
- onBlur(e2);
12243
+ handleBlur(e2);
12197
12244
  },
12198
12245
  onFocus: (e2) => {
12199
- onFocus(e2);
12246
+ handleFocus(e2);
12200
12247
  },
12201
12248
  onInput: (e2) => {
12202
- onInput(e2);
12249
+ handleInput(e2);
12203
12250
  }
12204
12251
  }) : /* @__PURE__ */ React__default["default"].createElement("input", {
12205
12252
  className: "input-text",
@@ -12213,13 +12260,13 @@
12213
12260
  value: inputValue,
12214
12261
  autoFocus: autofocus,
12215
12262
  onBlur: (e2) => {
12216
- onBlur(e2);
12263
+ handleBlur(e2);
12217
12264
  },
12218
12265
  onFocus: (e2) => {
12219
- onFocus(e2);
12266
+ handleFocus(e2);
12220
12267
  },
12221
12268
  onInput: (e2) => {
12222
- onInput(e2);
12269
+ handleInput(e2);
12223
12270
  }
12224
12271
  }), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
12225
12272
  classPrefix: iconClassPrefix,
@@ -12233,7 +12280,7 @@
12233
12280
  }) : null, rightIcon && rightIcon.length > 0 ? /* @__PURE__ */ React__default["default"].createElement("div", {
12234
12281
  className: "nut-input-right-icon",
12235
12282
  onClick: (e2) => {
12236
- onClickRightIcon(e2);
12283
+ handleClickRightIcon(e2);
12237
12284
  }
12238
12285
  }, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
12239
12286
  classPrefix: iconClassPrefix,
@@ -12387,9 +12434,9 @@
12387
12434
  return renderButton();
12388
12435
  }
12389
12436
  if (reverseState) {
12390
- return [renderLabel(), renderIcon()];
12437
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderLabel(), renderIcon());
12391
12438
  }
12392
- return [renderIcon(), renderLabel()];
12439
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderIcon(), renderLabel());
12393
12440
  };
12394
12441
  const handleClick2 = (e2) => {
12395
12442
  if (disabledStatement || checkedStatement)
@@ -13462,7 +13509,7 @@
13462
13509
  classPrefix: iconClassPrefix,
13463
13510
  fontClassName: iconFontClassName,
13464
13511
  name: "link"
13465
- }), "\xA0", item.name), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
13512
+ }), "\xA0", item.name), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
13466
13513
  classPrefix: iconClassPrefix,
13467
13514
  fontClassName: iconFontClassName,
13468
13515
  color: "#808080",
@@ -15357,7 +15404,7 @@
15357
15404
  inactiveColor,
15358
15405
  activeText,
15359
15406
  inactiveText,
15360
- change,
15407
+ onChange,
15361
15408
  className,
15362
15409
  style
15363
15410
  } = {
@@ -15385,7 +15432,7 @@
15385
15432
  if (!isAsync) {
15386
15433
  setValue(!value);
15387
15434
  }
15388
- change && change(!value, event);
15435
+ onChange && onChange(!value, event);
15389
15436
  };
15390
15437
  return /* @__PURE__ */ React__default["default"].createElement("div", {
15391
15438
  className: classes(),
@@ -15932,6 +15979,8 @@
15932
15979
  rightIcon,
15933
15980
  close,
15934
15981
  click,
15982
+ onClose,
15983
+ onClick,
15935
15984
  iconClassPrefix,
15936
15985
  iconFontClassName
15937
15986
  } = {
@@ -16017,11 +16066,13 @@
16017
16066
  };
16018
16067
  const handleClick2 = (event) => {
16019
16068
  click && click(event);
16069
+ onClick && onClick(event);
16020
16070
  };
16021
16071
  const onClickIcon = (event) => {
16022
16072
  event.stopPropagation();
16023
16073
  SetShowNoticeBar(!closeMode);
16024
16074
  close && close(event);
16075
+ onClose && onClose(event);
16025
16076
  };
16026
16077
  const onAnimationEnd = () => {
16027
16078
  SetFirstRound(false);
@@ -16071,9 +16122,11 @@
16071
16122
  };
16072
16123
  const go = (item) => {
16073
16124
  click && click(item);
16125
+ onClick && onClick(item);
16074
16126
  };
16075
16127
  const handleClickIcon = () => {
16076
16128
  close && close(scrollList[0]);
16129
+ onClose && onClose(scrollList[0]);
16077
16130
  };
16078
16131
  const iconShow = () => {
16079
16132
  if (leftIcon === "close") {
@@ -16199,6 +16252,7 @@
16199
16252
  className,
16200
16253
  progressDot,
16201
16254
  clickStep,
16255
+ onClickStep,
16202
16256
  ...restProps
16203
16257
  } = propSteps;
16204
16258
  const parentSteps = {
@@ -16262,10 +16316,9 @@
16262
16316
  return index === +parent.propSteps.current ? "process" : "wait";
16263
16317
  };
16264
16318
  const handleClickStep = () => {
16265
- var _a, _b;
16266
- if ((_a = parent.propSteps) == null ? void 0 : _a.clickStep) {
16267
- (_b = parent.propSteps) == null ? void 0 : _b.clickStep(activeIndex);
16268
- }
16319
+ var _a, _b, _c, _d;
16320
+ ((_a = parent.propSteps) == null ? void 0 : _a.onClickStep) && ((_b = parent.propSteps) == null ? void 0 : _b.onClickStep(activeIndex));
16321
+ ((_c = parent.propSteps) == null ? void 0 : _c.clickStep) && ((_d = parent.propSteps) == null ? void 0 : _d.clickStep(activeIndex));
16269
16322
  };
16270
16323
  const b2 = cn("step");
16271
16324
  const classes = classNames(
@@ -16797,6 +16850,7 @@
16797
16850
  className,
16798
16851
  style,
16799
16852
  activeAvatar,
16853
+ onActiveAvatar,
16800
16854
  onError,
16801
16855
  iconClassPrefix,
16802
16856
  iconFontClassName,
@@ -16841,7 +16895,6 @@
16841
16895
  const avatarLength = (children2) => {
16842
16896
  var _a2, _b2, _c2;
16843
16897
  for (let i = 0; i < children2.length; i++) {
16844
- console.log("child", children2[i], children2[i].classList);
16845
16898
  if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
16846
16899
  children2[i].setAttribute("data-index", i + 1);
16847
16900
  }
@@ -16860,9 +16913,8 @@
16860
16913
  }
16861
16914
  };
16862
16915
  const clickAvatar = (e2) => {
16863
- if (props.activeAvatar) {
16864
- props.activeAvatar(e2);
16865
- }
16916
+ activeAvatar && activeAvatar(e2);
16917
+ onActiveAvatar && onActiveAvatar(e2);
16866
16918
  };
16867
16919
  return /* @__PURE__ */ React__default["default"].createElement(React__default["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["default"].createElement("div", {
16868
16920
  className: cls,
@@ -17648,6 +17700,7 @@
17648
17700
  CountDown.defaultProps = defaultProps$j;
17649
17701
  CountDown.displayName = "NutCountDown";
17650
17702
  const defaultProps$i = {
17703
+ style: {},
17651
17704
  activeName: ["0"],
17652
17705
  accordion: false,
17653
17706
  icon: "",
@@ -17661,6 +17714,8 @@
17661
17714
  const Collapse = React.memo(
17662
17715
  (props) => {
17663
17716
  const {
17717
+ className,
17718
+ style,
17664
17719
  children,
17665
17720
  activeName,
17666
17721
  accordion,
@@ -17668,7 +17723,7 @@
17668
17723
  rotate,
17669
17724
  iconSize,
17670
17725
  iconColor,
17671
- change
17726
+ onChange
17672
17727
  } = {
17673
17728
  ...defaultProps$i,
17674
17729
  ...props
@@ -17710,10 +17765,11 @@
17710
17765
  }
17711
17766
  }
17712
17767
  setDefaultOpenIndex(newOpenIndex);
17713
- change && change(!isOpen, name);
17768
+ onChange && onChange(!isOpen, name);
17714
17769
  };
17715
17770
  return /* @__PURE__ */ React__default["default"].createElement("div", {
17716
- className: colBem()
17771
+ className: `${colBem()} ${className}`,
17772
+ style
17717
17773
  }, childrenDom.map((item) => {
17718
17774
  return React__default["default"].cloneElement(item, {
17719
17775
  isOpen: defaultOpenIndex.includes(item.props.name),
@@ -18138,6 +18194,7 @@
18138
18194
  overscan = 2,
18139
18195
  key,
18140
18196
  handleScroll,
18197
+ onScroll,
18141
18198
  className,
18142
18199
  containerSize,
18143
18200
  ...rest
@@ -18204,7 +18261,7 @@
18204
18261
  const totalSize = getListTotalSize(positions, horizontal);
18205
18262
  setListTotalSize(totalSize);
18206
18263
  }, [positions, sizeKey, horizontal]);
18207
- const onScroll = React.useCallback(() => {
18264
+ const scroll = React.useCallback(() => {
18208
18265
  requestAnimationFrame((e2) => {
18209
18266
  const scrollSize = getElement()[scrollKey];
18210
18267
  const startIndex = binarySearch(positions, scrollSize, horizontal);
@@ -18225,7 +18282,11 @@
18225
18282
  const startOffset = positions[startIndex][offsetKey];
18226
18283
  setOptions({ startOffset, startIndex, overStart, endIndex });
18227
18284
  if (endIndex > sourceData.length - 1) {
18228
- handleScroll && handleScroll();
18285
+ if (onScroll) {
18286
+ onScroll();
18287
+ } else if (handleScroll) {
18288
+ handleScroll();
18289
+ }
18229
18290
  }
18230
18291
  });
18231
18292
  }, [
@@ -18245,11 +18306,11 @@
18245
18306
  ]);
18246
18307
  React.useEffect(() => {
18247
18308
  const element = getElement();
18248
- element.addEventListener("scroll", onScroll, false);
18309
+ element.addEventListener("scroll", scroll, false);
18249
18310
  return () => {
18250
- element.removeEventListener("scroll", onScroll, false);
18311
+ element.removeEventListener("scroll", scroll, false);
18251
18312
  };
18252
- }, [getElement, onScroll]);
18313
+ }, [getElement, scroll]);
18253
18314
  return /* @__PURE__ */ React__default["default"].createElement("div", {
18254
18315
  className: className ? `${className} nut-virtualList-box` : "nut-virtualList-box",
18255
18316
  ...rest,
@@ -18439,6 +18500,9 @@
18439
18500
  play,
18440
18501
  pause,
18441
18502
  playend,
18503
+ onPlayFuc,
18504
+ onPauseFuc,
18505
+ onPlayend,
18442
18506
  ...restProps
18443
18507
  } = {
18444
18508
  ...defaultProps$b,
@@ -18465,13 +18529,16 @@
18465
18529
  videoRef.setAttribute("x5-video-player-fullscreen", "false");
18466
18530
  }
18467
18531
  videoRef.addEventListener("play", () => {
18532
+ onPlayFuc && onPlayFuc(videoRef);
18468
18533
  play && play(videoRef);
18469
18534
  });
18470
18535
  videoRef.addEventListener("pause", () => {
18536
+ onPauseFuc && onPauseFuc(videoRef);
18471
18537
  pause && pause(videoRef);
18472
18538
  });
18473
18539
  videoRef.addEventListener("ended", () => {
18474
18540
  videoRef.currentTime = 0;
18541
+ onPlayend && onPlayend(videoRef);
18475
18542
  playend && playend(videoRef);
18476
18543
  });
18477
18544
  }
@@ -19595,7 +19662,18 @@
19595
19662
  };
19596
19663
  const Signature = (props) => {
19597
19664
  const { locale } = useConfig();
19598
- const { type, lineWidth, strokeStyle, unSupportTpl, className, ...rest } = {
19665
+ const {
19666
+ type,
19667
+ lineWidth,
19668
+ strokeStyle,
19669
+ unSupportTpl,
19670
+ className,
19671
+ confirm: confirm2,
19672
+ clear,
19673
+ onConfirm,
19674
+ onClear,
19675
+ ...rest
19676
+ } = {
19599
19677
  ...defaultProps$4,
19600
19678
  ...props
19601
19679
  };
@@ -19660,15 +19738,16 @@
19660
19738
  canvasRef.current.removeEventListener(events[2], endEventHandler, false);
19661
19739
  }
19662
19740
  };
19663
- const clear = () => {
19741
+ const handleClearBtn = () => {
19664
19742
  if (canvasRef.current && ctx2.current) {
19665
19743
  canvasRef.current.addEventListener(events[2], endEventHandler, false);
19666
19744
  ctx2.current.clearRect(0, 0, canvasWidth, canvasHeight);
19667
19745
  ctx2.current.closePath();
19668
19746
  }
19669
- props.clear && props.clear();
19747
+ clear && clear();
19748
+ onClear && onClear();
19670
19749
  };
19671
- const confirm2 = () => {
19750
+ const handleConfirmBtn = () => {
19672
19751
  onSave(canvasRef.current);
19673
19752
  };
19674
19753
  const onSave = (canvas) => {
@@ -19683,8 +19762,9 @@
19683
19762
  default:
19684
19763
  dataurl = canvas.toDataURL("image/png");
19685
19764
  }
19686
- clear();
19687
- props.confirm && props.confirm(canvas, dataurl);
19765
+ handleClearBtn();
19766
+ confirm2 && confirm2(canvas, dataurl);
19767
+ onConfirm && onConfirm(canvas, dataurl);
19688
19768
  };
19689
19769
  return /* @__PURE__ */ React__default["default"].createElement("div", {
19690
19770
  className: `${b2()} ${className}`,
@@ -19701,11 +19781,11 @@
19701
19781
  }, locale.signature.unSupportTpl || unSupportTpl)), /* @__PURE__ */ React__default["default"].createElement(Button, {
19702
19782
  className: `${b2("btn")}`,
19703
19783
  type: "default",
19704
- onClick: () => clear()
19784
+ onClick: () => handleClearBtn()
19705
19785
  }, locale.signature.reSign), /* @__PURE__ */ React__default["default"].createElement(Button, {
19706
19786
  className: `${b2("btn")}`,
19707
19787
  type: "primary",
19708
- onClick: () => confirm2()
19788
+ onClick: () => handleConfirmBtn()
19709
19789
  }, locale.confirm));
19710
19790
  };
19711
19791
  Signature.defaultProps = defaultProps$4;
@@ -19832,6 +19912,7 @@
19832
19912
  TimeDetail.displayName = "NutTimeDetail";
19833
19913
  const defaultProps = {
19834
19914
  className: "",
19915
+ style: {},
19835
19916
  visible: false,
19836
19917
  height: "20%",
19837
19918
  multiple: false,
@@ -19844,7 +19925,6 @@
19844
19925
  const TimeSelect = (props) => {
19845
19926
  useConfig();
19846
19927
  const {
19847
- children,
19848
19928
  visible,
19849
19929
  className,
19850
19930
  height,
@@ -19856,7 +19936,10 @@
19856
19936
  multiple,
19857
19937
  select,
19858
19938
  pannelChange,
19859
- timeChange
19939
+ timeChange,
19940
+ onSelect,
19941
+ onPannelChange,
19942
+ onTimeChange
19860
19943
  } = {
19861
19944
  ...defaultProps,
19862
19945
  ...props
@@ -19877,7 +19960,11 @@
19877
19960
  };
19878
19961
  const b2 = cn("timeselect");
19879
19962
  const closeFun = () => {
19880
- select && select(activeTime);
19963
+ if (onSelect) {
19964
+ onSelect(activeTime);
19965
+ } else if (select) {
19966
+ select(activeTime);
19967
+ }
19881
19968
  };
19882
19969
  const handleSelectTime = (time) => {
19883
19970
  let curTimeData = {};
@@ -19900,7 +19987,11 @@
19900
19987
  const resultTimeData = [...activeTime];
19901
19988
  resultTimeData.splice(curIndex, 1, curTimeData);
19902
19989
  setActiveTime(resultTimeData);
19903
- timeChange && timeChange(time, resultTimeData);
19990
+ if (onTimeChange) {
19991
+ onTimeChange(time, resultTimeData);
19992
+ } else if (timeChange) {
19993
+ timeChange(time, resultTimeData);
19994
+ }
19904
19995
  };
19905
19996
  const handleChange = (pannelKey) => {
19906
19997
  const resultTimeData = [...activeTime];
@@ -19926,7 +20017,11 @@
19926
20017
  ]);
19927
20018
  }
19928
20019
  }
19929
- pannelChange && pannelChange(pannelKey, resultTimeData);
20020
+ if (onPannelChange) {
20021
+ onPannelChange(pannelKey, resultTimeData);
20022
+ } else if (pannelChange) {
20023
+ pannelChange(pannelKey, resultTimeData);
20024
+ }
19930
20025
  };
19931
20026
  const getTimePannelClass = (dataItem) => {
19932
20027
  if (String(dataItem["pannel-key"]) === String(activeKey)) {