@nutui/nutui-react 3.0.11 → 3.0.13-beta.0

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 (148) hide show
  1. package/CHANGELOG.md +19 -7
  2. package/dist/cjs/packages/address/style/address.scss +114 -0
  3. package/dist/cjs/packages/address/style/style.css +103 -0
  4. package/dist/cjs/packages/address/style-jmapp/address.scss +114 -0
  5. package/dist/cjs/packages/address/style-jmapp/style.css +103 -0
  6. package/dist/cjs/packages/address/style-jrkf/address.scss +114 -0
  7. package/dist/cjs/packages/address/style-jrkf/style.css +103 -0
  8. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  9. package/dist/cjs/packages/elevator/style/css.js +0 -2
  10. package/dist/cjs/packages/elevator/style/elevator.scss +116 -95
  11. package/dist/cjs/packages/elevator/style/index.js +0 -2
  12. package/dist/cjs/packages/elevator/style/style.css +98 -83
  13. package/dist/cjs/packages/elevator/style-jmapp/css.js +0 -2
  14. package/dist/cjs/packages/elevator/style-jmapp/elevator.scss +116 -95
  15. package/dist/cjs/packages/elevator/style-jmapp/index.js +0 -2
  16. package/dist/cjs/packages/elevator/style-jmapp/style.css +98 -83
  17. package/dist/cjs/packages/elevator/style-jrkf/css.js +0 -2
  18. package/dist/cjs/packages/elevator/style-jrkf/elevator.scss +116 -95
  19. package/dist/cjs/packages/elevator/style-jrkf/index.js +0 -2
  20. package/dist/cjs/packages/elevator/style-jrkf/style.css +98 -83
  21. package/dist/cjs/packages/input/input.js +3 -0
  22. package/dist/cjs/packages/progress/progress.js +38 -17
  23. package/dist/cjs/packages/progress/style/progress.scss +5 -21
  24. package/dist/cjs/packages/progress/style/style.css +5 -19
  25. package/dist/cjs/packages/progress/style-jmapp/progress.scss +5 -21
  26. package/dist/cjs/packages/progress/style-jmapp/style.css +4 -18
  27. package/dist/cjs/packages/progress/style-jrkf/progress.scss +5 -21
  28. package/dist/cjs/packages/progress/style-jrkf/style.css +4 -18
  29. package/dist/cjs/packages/range/range.js +5 -11
  30. package/dist/cjs/packages/range/style/range.scss +6 -2
  31. package/dist/cjs/packages/range/style/style.css +3 -1
  32. package/dist/cjs/packages/range/style-jmapp/range.scss +6 -2
  33. package/dist/cjs/packages/range/style-jmapp/style.css +3 -1
  34. package/dist/cjs/packages/range/style-jrkf/range.scss +6 -2
  35. package/dist/cjs/packages/range/style-jrkf/style.css +3 -1
  36. package/dist/cjs/packages/range/utils.d.ts +3 -0
  37. package/dist/cjs/packages/range/utils.js +24 -0
  38. package/dist/cjs/packages/searchbar/searchbar.js +162 -87
  39. package/dist/cjs/packages/searchbar/style/searchbar.scss +99 -25
  40. package/dist/cjs/packages/searchbar/style/style.css +102 -38
  41. package/dist/cjs/packages/searchbar/style-jmapp/searchbar.scss +99 -25
  42. package/dist/cjs/packages/searchbar/style-jmapp/style.css +85 -21
  43. package/dist/cjs/packages/searchbar/style-jrkf/searchbar.scss +99 -25
  44. package/dist/cjs/packages/searchbar/style-jrkf/style.css +85 -21
  45. package/dist/cjs/packages/step/step.js +74 -33
  46. package/dist/cjs/packages/step/style/step.scss +104 -195
  47. package/dist/cjs/packages/step/style/style.css +85 -159
  48. package/dist/cjs/packages/step/style-jmapp/step.scss +104 -195
  49. package/dist/cjs/packages/step/style-jmapp/style.css +88 -162
  50. package/dist/cjs/packages/step/style-jrkf/step.scss +104 -195
  51. package/dist/cjs/packages/step/style-jrkf/style.css +88 -162
  52. package/dist/cjs/packages/steps/steps.js +23 -8
  53. package/dist/cjs/packages/steps/style/steps.scss +328 -4
  54. package/dist/cjs/packages/steps/style/style.css +219 -2
  55. package/dist/cjs/packages/steps/style-jmapp/steps.scss +328 -4
  56. package/dist/cjs/packages/steps/style-jmapp/style.css +219 -2
  57. package/dist/cjs/packages/steps/style-jrkf/steps.scss +328 -4
  58. package/dist/cjs/packages/steps/style-jrkf/style.css +219 -2
  59. package/dist/cjs/packages/swiper/swiper.js +52 -43
  60. package/dist/cjs/packages/textarea/textarea.d.ts +2 -2
  61. package/dist/cjs/packages/textarea/textarea.js +25 -8
  62. package/dist/cjs/packages/uploader/uploader.js +20 -9
  63. package/dist/cjs/types/spec/lottie/taro.d.ts +1 -0
  64. package/dist/cjs/types/spec/progress/base.d.ts +6 -0
  65. package/dist/cjs/types/spec/progress/taro.d.ts +4 -0
  66. package/dist/cjs/types/spec/searchbar/base.d.ts +3 -0
  67. package/dist/cjs/types/spec/steps/base.d.ts +11 -2
  68. package/dist/cjs/types/spec/swiper/base.d.ts +4 -0
  69. package/dist/cjs/types/spec/swiper/taro.d.ts +4 -0
  70. package/dist/es/packages/address/style/address.scss +114 -0
  71. package/dist/es/packages/address/style/style.css +103 -0
  72. package/dist/es/packages/address/style-jmapp/address.scss +114 -0
  73. package/dist/es/packages/address/style-jmapp/style.css +103 -0
  74. package/dist/es/packages/address/style-jrkf/address.scss +114 -0
  75. package/dist/es/packages/address/style-jrkf/style.css +103 -0
  76. package/dist/es/packages/configprovider/types.d.ts +1 -1
  77. package/dist/es/packages/elevator/style/css.js +0 -2
  78. package/dist/es/packages/elevator/style/elevator.scss +116 -95
  79. package/dist/es/packages/elevator/style/index.js +0 -2
  80. package/dist/es/packages/elevator/style/style.css +98 -83
  81. package/dist/es/packages/elevator/style-jmapp/css.js +0 -2
  82. package/dist/es/packages/elevator/style-jmapp/elevator.scss +116 -95
  83. package/dist/es/packages/elevator/style-jmapp/index.js +0 -2
  84. package/dist/es/packages/elevator/style-jmapp/style.css +98 -83
  85. package/dist/es/packages/elevator/style-jrkf/css.js +0 -2
  86. package/dist/es/packages/elevator/style-jrkf/elevator.scss +116 -95
  87. package/dist/es/packages/elevator/style-jrkf/index.js +0 -2
  88. package/dist/es/packages/elevator/style-jrkf/style.css +98 -83
  89. package/dist/es/packages/input/input.js +3 -0
  90. package/dist/es/packages/progress/progress.js +38 -17
  91. package/dist/es/packages/progress/style/progress.scss +5 -21
  92. package/dist/es/packages/progress/style/style.css +5 -19
  93. package/dist/es/packages/progress/style-jmapp/progress.scss +5 -21
  94. package/dist/es/packages/progress/style-jmapp/style.css +4 -18
  95. package/dist/es/packages/progress/style-jrkf/progress.scss +5 -21
  96. package/dist/es/packages/progress/style-jrkf/style.css +4 -18
  97. package/dist/es/packages/range/range.js +5 -11
  98. package/dist/es/packages/range/style/range.scss +6 -2
  99. package/dist/es/packages/range/style/style.css +3 -1
  100. package/dist/es/packages/range/style-jmapp/range.scss +6 -2
  101. package/dist/es/packages/range/style-jmapp/style.css +3 -1
  102. package/dist/es/packages/range/style-jrkf/range.scss +6 -2
  103. package/dist/es/packages/range/style-jrkf/style.css +3 -1
  104. package/dist/es/packages/range/utils.d.ts +3 -0
  105. package/dist/es/packages/range/utils.js +6 -0
  106. package/dist/es/packages/searchbar/searchbar.js +163 -89
  107. package/dist/es/packages/searchbar/style/searchbar.scss +99 -25
  108. package/dist/es/packages/searchbar/style/style.css +102 -38
  109. package/dist/es/packages/searchbar/style-jmapp/searchbar.scss +99 -25
  110. package/dist/es/packages/searchbar/style-jmapp/style.css +85 -21
  111. package/dist/es/packages/searchbar/style-jrkf/searchbar.scss +99 -25
  112. package/dist/es/packages/searchbar/style-jrkf/style.css +85 -21
  113. package/dist/es/packages/step/step.js +75 -34
  114. package/dist/es/packages/step/style/step.scss +104 -195
  115. package/dist/es/packages/step/style/style.css +85 -159
  116. package/dist/es/packages/step/style-jmapp/step.scss +104 -195
  117. package/dist/es/packages/step/style-jmapp/style.css +88 -162
  118. package/dist/es/packages/step/style-jrkf/step.scss +104 -195
  119. package/dist/es/packages/step/style-jrkf/style.css +88 -162
  120. package/dist/es/packages/steps/steps.js +23 -8
  121. package/dist/es/packages/steps/style/steps.scss +328 -4
  122. package/dist/es/packages/steps/style/style.css +219 -2
  123. package/dist/es/packages/steps/style-jmapp/steps.scss +328 -4
  124. package/dist/es/packages/steps/style-jmapp/style.css +219 -2
  125. package/dist/es/packages/steps/style-jrkf/steps.scss +328 -4
  126. package/dist/es/packages/steps/style-jrkf/style.css +219 -2
  127. package/dist/es/packages/swiper/swiper.js +53 -44
  128. package/dist/es/packages/textarea/textarea.d.ts +2 -2
  129. package/dist/es/packages/textarea/textarea.js +26 -9
  130. package/dist/es/packages/uploader/uploader.js +20 -9
  131. package/dist/es/types/spec/lottie/taro.d.ts +1 -0
  132. package/dist/es/types/spec/progress/base.d.ts +24 -0
  133. package/dist/es/types/spec/progress/taro.d.ts +4 -0
  134. package/dist/es/types/spec/searchbar/base.d.ts +10 -1
  135. package/dist/es/types/spec/steps/base.d.ts +26 -5
  136. package/dist/es/types/spec/swiper/base.d.ts +5 -1
  137. package/dist/es/types/spec/swiper/taro.d.ts +4 -0
  138. package/dist/nutui.react.umd.js +399 -223
  139. package/dist/style-jmapp.css +1 -1
  140. package/dist/style-jmapp.scss +44 -44
  141. package/dist/style-jrkf.css +1 -1
  142. package/dist/style-jrkf.scss +37 -37
  143. package/dist/style.css +1 -1
  144. package/dist/style.scss +37 -37
  145. package/dist/styles/variables-jmapp.scss +133 -79
  146. package/dist/styles/variables-jrkf.scss +134 -80
  147. package/dist/styles/variables.scss +148 -89
  148. package/package.json +1 -1
@@ -16899,6 +16899,9 @@ Please add \`${key2}Action\` when creating your handler.`);
16899
16899
  var _inputRef_current;
16900
16900
  return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.blur();
16901
16901
  },
16902
+ get: function() {
16903
+ return inputRef.current;
16904
+ },
16902
16905
  get nativeElement() {
16903
16906
  return inputRef.current;
16904
16907
  }
@@ -18210,10 +18213,8 @@ Please add \`${key2}Action\` when creating your handler.`);
18210
18213
  onEnd,
18211
18214
  setCurrent
18212
18215
  ]);
18213
- var click = React.useCallback(function(event) {
18214
- if (disabled || !root2.current) {
18215
- return;
18216
- }
18216
+ var handleClick = React.useCallback(function(event) {
18217
+ if (disabled || !root2.current) return;
18217
18218
  setDragStatus("");
18218
18219
  var rect = getRect(root2.current);
18219
18220
  var delta = event.clientX - rect.left;
@@ -18251,9 +18252,7 @@ Please add \`${key2}Action\` when creating your handler.`);
18251
18252
  vertical
18252
18253
  ]);
18253
18254
  var onTouchStart = React.useCallback(function(event) {
18254
- if (disabled) {
18255
- return;
18256
- }
18255
+ if (disabled) return;
18257
18256
  touch.start(event);
18258
18257
  setExactValue(current);
18259
18258
  if (isRange(current)) {
@@ -18466,11 +18465,9 @@ Please add \`${key2}Action\` when creating your handler.`);
18466
18465
  }, minDescription || min), /* @__PURE__ */ React.createElement("div", {
18467
18466
  ref: root2,
18468
18467
  className: classes,
18469
- onClick: function(e2) {
18470
- return click(e2);
18471
- }
18468
+ onClick: handleClick
18472
18469
  }, renderMarks(), /* @__PURE__ */ React.createElement("div", {
18473
- className: "".concat(classPrefix$f, "-bar"),
18470
+ className: "".concat(classPrefix$f, "-bar ").concat(classPrefix$f, "-bar-animate"),
18474
18471
  style: barStyle()
18475
18472
  }, renderButtonWrapper())), maxDescription !== null && /* @__PURE__ */ React.createElement("div", {
18476
18473
  className: "".concat(classPrefix$f, "-max")
@@ -18657,134 +18654,205 @@ Please add \`${key2}Action\` when creating your handler.`);
18657
18654
  left: "",
18658
18655
  right: "",
18659
18656
  rightIn: "",
18660
- leftIn: /* @__PURE__ */ React.createElement(n, {
18661
- width: "16",
18662
- height: "16"
18663
- })
18657
+ leftIn: /* @__PURE__ */ React.createElement(n, null),
18658
+ tag: false
18664
18659
  });
18665
18660
  var SearchBar = function(props) {
18666
18661
  var classPrefix2 = "nut-searchbar";
18667
18662
  var locale = useConfig().locale;
18668
- var searchRef = React.useRef(null);
18669
- var _$_object_spread = _object_spread({}, defaultProps$P, props), outerValue = _$_object_spread.value, style = _$_object_spread.style, placeholder = _$_object_spread.placeholder, shape = _$_object_spread.shape, className = _$_object_spread.className, disabled = _$_object_spread.disabled, maxLength = _$_object_spread.maxLength, clearable = _$_object_spread.clearable, readOnly = _$_object_spread.readOnly, autoFocus = _$_object_spread.autoFocus, backable = _$_object_spread.backable, right = _$_object_spread.right, left = _$_object_spread.left, leftIn = _$_object_spread.leftIn, rightIn = _$_object_spread.rightIn, onChange = _$_object_spread.onChange, onFocus = _$_object_spread.onFocus, onBlur = _$_object_spread.onBlur, onClear = _$_object_spread.onClear, onSearch = _$_object_spread.onSearch, onInputClick = _$_object_spread.onInputClick;
18670
- var _useState = _sliced_to_array(React.useState(function() {
18671
- return outerValue;
18672
- }), 2), value2 = _useState[0], setValue = _useState[1];
18673
- var forceFocus = function() {
18674
- var searchSelf = searchRef.current;
18675
- searchSelf && searchSelf.focus();
18676
- };
18677
- var change = function(event) {
18663
+ var searchInputRef = React.useRef(null);
18664
+ var _$_object_spread = _object_spread({}, defaultProps$P, props), outerValue = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, style = _$_object_spread.style, placeholder = _$_object_spread.placeholder, shape = _$_object_spread.shape, className = _$_object_spread.className, disabled = _$_object_spread.disabled, maxLength = _$_object_spread.maxLength, clearable = _$_object_spread.clearable, readOnly = _$_object_spread.readOnly, autoFocus = _$_object_spread.autoFocus, backable = _$_object_spread.backable, right = _$_object_spread.right, left = _$_object_spread.left, leftIn = _$_object_spread.leftIn, rightIn = _$_object_spread.rightIn, tag = _$_object_spread.tag, onChange = _$_object_spread.onChange, onFocus = _$_object_spread.onFocus, onBlur = _$_object_spread.onBlur, onClear = _$_object_spread.onClear, onSearch = _$_object_spread.onSearch, onInputClick = _$_object_spread.onInputClick, onItemClick = _$_object_spread.onItemClick;
18665
+ var _usePropsValue = _sliced_to_array(usePropsValue({
18666
+ value: outerValue,
18667
+ defaultValue,
18668
+ finalValue: ""
18669
+ }), 2), value2 = _usePropsValue[0], setValue = _usePropsValue[1];
18670
+ var _useState = _sliced_to_array(React.useState(tag), 2), innerTag = _useState[0], setInnerTag = _useState[1];
18671
+ var forceFocus = React.useCallback(function() {
18672
+ var _searchInputRef_current;
18673
+ (_searchInputRef_current = searchInputRef.current) === null || _searchInputRef_current === void 0 ? void 0 : _searchInputRef_current.focus();
18674
+ }, []);
18675
+ var handleChange = React.useCallback(function(event) {
18678
18676
  var value3 = event.target.value;
18679
- onChange && (onChange === null || onChange === void 0 ? void 0 : onChange(value3, event));
18677
+ onChange && onChange(value3, event);
18680
18678
  setValue(value3);
18681
- };
18682
- var focus = function(event) {
18683
- var value3 = event.target.value;
18684
- onFocus && (onFocus === null || onFocus === void 0 ? void 0 : onFocus(value3, event));
18685
- };
18686
- var blur = function(event) {
18687
- var searchSelf = searchRef.current;
18688
- searchSelf && searchSelf.blur();
18689
- var value3 = event.target.value;
18690
- onBlur && (onBlur === null || onBlur === void 0 ? void 0 : onBlur(value3, event));
18691
- };
18679
+ }, [
18680
+ onChange,
18681
+ setValue
18682
+ ]);
18683
+ var handleInputClick = React.useCallback(function(event) {
18684
+ onInputClick === null || onInputClick === void 0 ? void 0 : onInputClick(event);
18685
+ }, [
18686
+ onInputClick
18687
+ ]);
18688
+ var handleFocus = React.useCallback(function(event) {
18689
+ var _event_target;
18690
+ onFocus && onFocus((_event_target = event.target) === null || _event_target === void 0 ? void 0 : _event_target.value, event);
18691
+ if (tag) setInnerTag(false);
18692
+ }, [
18693
+ onFocus,
18694
+ tag
18695
+ ]);
18696
+ var _useState1 = _sliced_to_array(React.useState(null), 2), blurTimer = _useState1[0], setBlurTimer = _useState1[1];
18697
+ var handleBlur = React.useCallback(function(event) {
18698
+ var _searchInputRef_current, _event_target;
18699
+ (_searchInputRef_current = searchInputRef.current) === null || _searchInputRef_current === void 0 ? void 0 : _searchInputRef_current.blur();
18700
+ onBlur && onBlur((_event_target = event.target) === null || _event_target === void 0 ? void 0 : _event_target.value, event);
18701
+ if (tag) {
18702
+ var timer = setTimeout(function() {
18703
+ var _event_target2;
18704
+ setInnerTag(((_event_target2 = event.target) === null || _event_target2 === void 0 ? void 0 : _event_target2.value) ? tag : false);
18705
+ }, 150);
18706
+ setBlurTimer(timer);
18707
+ }
18708
+ }, [
18709
+ onBlur,
18710
+ tag
18711
+ ]);
18692
18712
  React.useEffect(function() {
18693
- setValue(outerValue);
18713
+ return function() {
18714
+ if (blurTimer) clearTimeout(blurTimer);
18715
+ };
18694
18716
  }, [
18695
- outerValue
18717
+ blurTimer
18718
+ ]);
18719
+ var clearaVal = React.useCallback(function(event) {
18720
+ if (disabled || readOnly) return;
18721
+ setValue("");
18722
+ forceFocus();
18723
+ onChange && onChange("");
18724
+ onClear && onClear(event);
18725
+ }, [
18726
+ disabled,
18727
+ readOnly,
18728
+ onChange,
18729
+ onClear,
18730
+ setValue,
18731
+ forceFocus
18732
+ ]);
18733
+ var onKeydown = React.useCallback(function(e2) {
18734
+ if (e2.key === "Enter") {
18735
+ var event = e2.nativeEvent;
18736
+ if (typeof event.cancelable !== "boolean" || event.cancelable) {
18737
+ event.preventDefault();
18738
+ }
18739
+ onSearch && onSearch(value2);
18740
+ }
18741
+ }, [
18742
+ onSearch,
18743
+ value2
18744
+ ]);
18745
+ var cls = React.useMemo(function() {
18746
+ var _obj;
18747
+ return classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix2, "-focus"), left || backable), _obj), className);
18748
+ }, [
18749
+ disabled,
18750
+ backable,
18751
+ left,
18752
+ className
18696
18753
  ]);
18697
18754
  React.useEffect(function() {
18698
- autoFocus && forceFocus();
18755
+ if (autoFocus) {
18756
+ forceFocus();
18757
+ }
18699
18758
  }, [
18700
- autoFocus
18759
+ autoFocus,
18760
+ forceFocus
18701
18761
  ]);
18702
18762
  var renderField = function() {
18763
+ var inputCls = classNames("".concat(classPrefix2, "-input"));
18703
18764
  return /* @__PURE__ */ React.createElement("input", {
18704
- className: "".concat(classPrefix2, "-input ").concat(clearable ? "".concat(classPrefix2, "-input-clear") : ""),
18705
- ref: searchRef,
18765
+ className: inputCls,
18766
+ ref: searchInputRef,
18706
18767
  value: value2 || "",
18707
18768
  placeholder: placeholder || locale.placeholder,
18708
18769
  disabled,
18709
18770
  readOnly,
18710
18771
  maxLength,
18711
18772
  onKeyDown: onKeydown,
18712
- onChange: function(e2) {
18713
- return change(e2);
18714
- },
18715
- onFocus: function(e2) {
18716
- return focus(e2);
18717
- },
18718
- onBlur: function(e2) {
18719
- return blur(e2);
18720
- },
18721
- onClick: function(e2) {
18722
- return clickInput(e2);
18723
- }
18773
+ onChange: handleChange,
18774
+ onFocus: handleFocus,
18775
+ onBlur: handleBlur,
18776
+ onClick: handleInputClick
18724
18777
  });
18725
18778
  };
18726
- var clickInput = function(e2) {
18727
- onInputClick && onInputClick(e2);
18728
- };
18729
- var renderLeftIn = function() {
18779
+ var renderValueByTags = React.useCallback(function() {
18780
+ if (!value2) {
18781
+ setTimeout(function() {
18782
+ forceFocus();
18783
+ }, 0);
18784
+ return null;
18785
+ }
18786
+ var list = value2.split(",");
18787
+ if (!list) return null;
18788
+ return /* @__PURE__ */ React.createElement("div", {
18789
+ className: "nut-searchbar-values"
18790
+ }, list.map(function(item, index2) {
18791
+ return /* @__PURE__ */ React.createElement("div", {
18792
+ key: "def-".concat(index2),
18793
+ className: "nut-searchbar-value",
18794
+ onClick: function(e2) {
18795
+ return onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, e2);
18796
+ }
18797
+ }, item, /* @__PURE__ */ React.createElement(n$6, null));
18798
+ }));
18799
+ }, [
18800
+ value2,
18801
+ onItemClick
18802
+ ]);
18803
+ var renderLeftIn = React.useCallback(function() {
18730
18804
  if (!leftIn) return null;
18731
18805
  return /* @__PURE__ */ React.createElement("div", {
18732
18806
  className: "".concat(classPrefix2, "-leftin ").concat(classPrefix2, "-icon")
18733
18807
  }, leftIn);
18734
- };
18735
- var renderLeft = function() {
18808
+ }, [
18809
+ leftIn
18810
+ ]);
18811
+ var renderLeft = React.useCallback(function() {
18736
18812
  if (!backable && !left) return null;
18737
18813
  return /* @__PURE__ */ React.createElement("div", {
18738
18814
  className: "".concat(classPrefix2, "-left")
18739
- }, backable ? /* @__PURE__ */ React.createElement(d$7, {
18740
- width: "16",
18741
- height: "16"
18742
- }) : left);
18743
- };
18744
- var renderRightIn = function() {
18815
+ }, backable ? /* @__PURE__ */ React.createElement(d$7, null) : left);
18816
+ }, [
18817
+ backable,
18818
+ left
18819
+ ]);
18820
+ var renderRightIn = React.useCallback(function() {
18745
18821
  if (!rightIn) return null;
18746
- return /* @__PURE__ */ React.createElement("div", {
18822
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.isValidElement(rightIn) ? /* @__PURE__ */ React.createElement("div", {
18747
18823
  className: "".concat(classPrefix2, "-rightin ").concat(classPrefix2, "-icon")
18748
- }, rightIn);
18749
- };
18750
- var renderRight = function() {
18824
+ }, rightIn) : /* @__PURE__ */ React.createElement("div", {
18825
+ className: "".concat(classPrefix2, "-rightin")
18826
+ }, rightIn));
18827
+ }, [
18828
+ rightIn
18829
+ ]);
18830
+ var renderRight = React.useCallback(function() {
18751
18831
  if (!right) return null;
18752
18832
  return /* @__PURE__ */ React.createElement("div", {
18753
18833
  className: "".concat(classPrefix2, "-right")
18754
18834
  }, right);
18755
- };
18756
- var handleClear = function() {
18835
+ }, [
18836
+ right
18837
+ ]);
18838
+ var renderClear = React.useCallback(function() {
18839
+ if (!value2 || !clearable) return null;
18757
18840
  return /* @__PURE__ */ React.createElement("div", {
18758
18841
  className: "".concat(classPrefix2, "-clear ").concat(classPrefix2, "-icon"),
18759
- onClick: function(e2) {
18760
- return clearaVal(e2);
18761
- }
18842
+ onClick: clearaVal,
18843
+ "aria-label": "清除"
18762
18844
  }, /* @__PURE__ */ React.createElement(n$2, null));
18763
- };
18764
- var clearaVal = function(event) {
18765
- if (disabled || readOnly) {
18766
- return;
18767
- }
18768
- setValue("");
18769
- onChange && (onChange === null || onChange === void 0 ? void 0 : onChange(""));
18770
- onClear && onClear(event);
18771
- forceFocus();
18772
- };
18773
- var onKeydown = function(e2) {
18774
- if (e2.key === "Enter") {
18775
- var event = e2.nativeEvent;
18776
- if (typeof event.cancelable !== "boolean" || event.cancelable) {
18777
- event.preventDefault();
18778
- }
18779
- onSearch && onSearch(value2);
18780
- }
18781
- };
18845
+ }, [
18846
+ value2,
18847
+ clearable,
18848
+ clearaVal
18849
+ ]);
18782
18850
  return /* @__PURE__ */ React.createElement("div", {
18783
- className: "".concat(classPrefix2, " ").concat(disabled ? "".concat(classPrefix2, "-disabled") : "", " ").concat(className || ""),
18851
+ className: cls,
18784
18852
  style
18785
18853
  }, renderLeft(), /* @__PURE__ */ React.createElement("div", {
18786
- className: "".concat(classPrefix2, "-content ").concat(shape === "round" ? "".concat(classPrefix2, "-round") : "")
18787
- }, renderLeftIn(), renderField(), clearable && !value2 && renderRightIn(), clearable && value2 && handleClear()), renderRight());
18854
+ className: classNames("".concat(classPrefix2, "-content"), _define_property({}, "".concat(classPrefix2, "-round"), shape === "round"))
18855
+ }, renderLeftIn(), renderField(), innerTag ? renderValueByTags() : renderClear(), renderRightIn()), renderRight());
18788
18856
  };
18789
18857
  SearchBar.displayName = "NutSearchBar";
18790
18858
  var defaultProps$O = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -19206,14 +19274,13 @@ Please add \`${key2}Action\` when creating your handler.`);
19206
19274
  showCount: false,
19207
19275
  rows: 2,
19208
19276
  maxLength: 140,
19209
- placeholder: "",
19210
19277
  readOnly: false,
19211
19278
  disabled: false,
19212
19279
  autoSize: false,
19213
19280
  plain: false,
19214
19281
  status: "default"
19215
19282
  });
19216
- var TextArea = function(props) {
19283
+ var TextArea = /* @__PURE__ */ React.forwardRef(function(props, ref) {
19217
19284
  var locale = useConfig().locale;
19218
19285
  var _ref = _object_spread({}, defaultProps$L, props), className = _ref.className, value2 = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
19219
19286
  "className",
@@ -19248,13 +19315,13 @@ Please add \`${key2}Action\` when creating your handler.`);
19248
19315
  defaultValue,
19249
19316
  finalValue: format2(defaultValue),
19250
19317
  onChange
19251
- }), 2), inputValue = _usePropsValue[0], setInputValue = _usePropsValue[1];
19318
+ }), 2), innerValue = _usePropsValue[0], setInnerValue = _usePropsValue[1];
19252
19319
  React.useEffect(function() {
19253
19320
  if (autoSize) setContentHeight();
19254
19321
  }, [
19255
19322
  autoSize,
19256
19323
  defaultValue,
19257
- inputValue
19324
+ innerValue
19258
19325
  ]);
19259
19326
  var setContentHeight = function() {
19260
19327
  var textarea = textareaRef.current;
@@ -19269,7 +19336,7 @@ Please add \`${key2}Action\` when creating your handler.`);
19269
19336
  var handleChange = function(event) {
19270
19337
  var text2 = event.target;
19271
19338
  var value3 = compositionRef.current ? text2.value : format2(text2.value);
19272
- setInputValue(value3);
19339
+ setInnerValue(value3);
19273
19340
  };
19274
19341
  var isDisabled = function() {
19275
19342
  return disabled || readOnly;
@@ -19282,6 +19349,24 @@ Please add \`${key2}Action\` when creating your handler.`);
19282
19349
  if (isDisabled()) return;
19283
19350
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
19284
19351
  };
19352
+ React.useImperativeHandle(ref, function() {
19353
+ return {
19354
+ clear: function() {
19355
+ return setInnerValue("");
19356
+ },
19357
+ focus: function() {
19358
+ var _textareaRef_current;
19359
+ return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.focus();
19360
+ },
19361
+ blur: function() {
19362
+ var _textareaRef_current;
19363
+ return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.blur();
19364
+ },
19365
+ get nativeElement() {
19366
+ return textareaRef.current;
19367
+ }
19368
+ };
19369
+ });
19285
19370
  var _obj;
19286
19371
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
19287
19372
  className: classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix2, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix2, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix2, "-plain"), plain), _define_property(_obj, "".concat(classPrefix2, "-container"), !plain), _define_property(_obj, "".concat(classPrefix2, "-").concat(status), status), _obj), className)
@@ -19291,7 +19376,7 @@ Please add \`${key2}Action\` when creating your handler.`);
19291
19376
  style,
19292
19377
  disabled,
19293
19378
  readOnly,
19294
- value: inputValue,
19379
+ value: innerValue,
19295
19380
  onChange: handleChange,
19296
19381
  onBlur: handleBlur,
19297
19382
  onFocus: handleFocus,
@@ -19306,8 +19391,8 @@ Please add \`${key2}Action\` when creating your handler.`);
19306
19391
  placeholder: placeholder !== void 0 ? placeholder : locale.placeholder
19307
19392
  })), showCount && /* @__PURE__ */ React.createElement("div", {
19308
19393
  className: classNames("".concat(classPrefix2, "-limit"), _define_property({}, "".concat(classPrefix2, "-limit-disabled"), disabled))
19309
- }, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)));
19310
- };
19394
+ }, innerValue.length, "/", maxLength < 0 ? 0 : maxLength)));
19395
+ });
19311
19396
  TextArea.displayName = "NutTextArea";
19312
19397
  var defaultProps$K = _object_spread_props(_object_spread({}, ComponentDefaults), {
19313
19398
  percent: 0,
@@ -19317,8 +19402,8 @@ Please add \`${key2}Action\` when creating your handler.`);
19317
19402
  delay: 0
19318
19403
  });
19319
19404
  var Progress = function(props) {
19320
- var rtl = useRtl();
19321
- var _ref = _object_spread({}, defaultProps$K, props), className = _ref.className, style = _ref.style, percent = _ref.percent, background = _ref.background, color = _ref.color, strokeWidth = _ref.strokeWidth, showText = _ref.showText, animated2 = _ref.animated, children = _ref.children, lazy = _ref.lazy, delay = _ref.delay, rest = _object_without_properties(_ref, [
19405
+ useRtl();
19406
+ var _ref = _object_spread({}, defaultProps$K, props), className = _ref.className, style = _ref.style, percent = _ref.percent, background = _ref.background, color = _ref.color, strokeWidth = _ref.strokeWidth, showText = _ref.showText, animated2 = _ref.animated, children = _ref.children, lazy = _ref.lazy, delay = _ref.delay, borderRadius = _ref.borderRadius, fontSize = _ref.fontSize, activeMode = _ref.activeMode, duration = _ref.duration, ariaLabel = _ref.ariaLabel, onActiveEnd = _ref.onActiveEnd, rest = _object_without_properties(_ref, [
19322
19407
  "className",
19323
19408
  "style",
19324
19409
  "percent",
@@ -19329,24 +19414,48 @@ Please add \`${key2}Action\` when creating your handler.`);
19329
19414
  "animated",
19330
19415
  "children",
19331
19416
  "lazy",
19332
- "delay"
19417
+ "delay",
19418
+ "borderRadius",
19419
+ "fontSize",
19420
+ "activeMode",
19421
+ "duration",
19422
+ "ariaLabel",
19423
+ "onActiveEnd"
19333
19424
  ]);
19334
19425
  var classPrefix2 = "nut-progress";
19335
19426
  var _obj;
19336
19427
  var classesInner = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-inner"), true), _define_property(_obj, "".concat(classPrefix2, "-active"), animated2), _obj));
19337
19428
  var stylesOuter = {
19338
19429
  height: "".concat(strokeWidth, "px"),
19430
+ borderRadius: borderRadius && parseInt(borderRadius.toString()),
19339
19431
  background
19340
19432
  };
19341
19433
  var _useState = _sliced_to_array(React.useState(0), 2), displayPercent = _useState[0], setDispalyPercent = _useState[1];
19342
19434
  var stylesInner = {
19343
19435
  width: "".concat(displayPercent, "%"),
19344
- background: color || "#FF0F23"
19436
+ background: color || "#FF0F23",
19437
+ borderRadius: borderRadius && parseInt(borderRadius.toString()),
19438
+ transition: "width ".concat(duration || 300, "ms ease-in-out")
19345
19439
  };
19346
19440
  React.useEffect(function() {
19347
- setDispalyPercent(percent);
19441
+ var timer = null;
19442
+ if (activeMode === "backwards") {
19443
+ setDispalyPercent(0);
19444
+ timer = setTimeout(function() {
19445
+ setDispalyPercent(percent);
19446
+ }, duration || 300);
19447
+ } else {
19448
+ setDispalyPercent(percent);
19449
+ }
19450
+ return function() {
19451
+ if (timer) {
19452
+ clearTimeout(timer);
19453
+ }
19454
+ };
19348
19455
  }, [
19349
- percent
19456
+ percent,
19457
+ activeMode,
19458
+ duration
19350
19459
  ]);
19351
19460
  var _useState1 = _sliced_to_array(React.useState(false), 2), intersecting = _useState1[0], setIntersecting = _useState1[1];
19352
19461
  var progressRef = React.useRef(null);
@@ -19398,26 +19507,23 @@ Please add \`${key2}Action\` when creating your handler.`);
19398
19507
  return /* @__PURE__ */ React.createElement("div", _object_spread({
19399
19508
  ref: progressRef,
19400
19509
  className: classNames(classPrefix2, className),
19401
- style
19510
+ style,
19511
+ "aria-label": ariaLabel
19402
19512
  }, rest), /* @__PURE__ */ React.createElement("div", {
19403
19513
  className: "".concat(classPrefix2, "-outer"),
19404
19514
  style: stylesOuter
19405
19515
  }, /* @__PURE__ */ React.createElement("div", {
19406
19516
  className: classesInner,
19407
- style: stylesInner
19408
- }, showText && /* @__PURE__ */ React.createElement("div", {
19409
- className: "".concat(classPrefix2, "-text"),
19410
- style: rtl ? {
19411
- right: "".concat(displayPercent, "%")
19412
- } : {
19413
- left: "".concat(displayPercent, "%")
19517
+ style: stylesInner,
19518
+ onTransitionEnd: function() {
19519
+ onActiveEnd === null || onActiveEnd === void 0 ? void 0 : onActiveEnd();
19414
19520
  }
19415
- }, children || /* @__PURE__ */ React.createElement("div", {
19416
- className: "".concat(classPrefix2, "-text-inner"),
19521
+ })), showText && /* @__PURE__ */ React.createElement("div", {
19522
+ className: "".concat(classPrefix2, "-text"),
19417
19523
  style: {
19418
- background: color
19524
+ fontSize: fontSize && parseInt(fontSize.toString())
19419
19525
  }
19420
- }, percent, "%")))));
19526
+ }, children || "".concat(percent, "%")));
19421
19527
  };
19422
19528
  Progress.displayName = "NutProgress";
19423
19529
  var Preview = function(param) {
@@ -19682,10 +19788,21 @@ Please add \`${key2}Action\` when creating your handler.`);
19682
19788
  ];
19683
19789
  case 1:
19684
19790
  _files = _state.sent();
19685
- if (!_files.length) $el.value = "";
19686
- _state.label = 2;
19791
+ if (!_files.length) {
19792
+ $el.value = "";
19793
+ return [
19794
+ 2
19795
+ ];
19796
+ }
19797
+ return [
19798
+ 3,
19799
+ 3
19800
+ ];
19687
19801
  case 2:
19688
- _files = filterFiles(filesArr);
19802
+ _files = filesArr;
19803
+ _state.label = 3;
19804
+ case 3:
19805
+ _files = filterFiles(_files);
19689
19806
  tasks = _files.map(function(file) {
19690
19807
  var _file_type;
19691
19808
  var info = {
@@ -19712,22 +19829,22 @@ Please add \`${key2}Action\` when creating your handler.`);
19712
19829
  });
19713
19830
  if (!!autoUpload) return [
19714
19831
  3,
19715
- 3
19832
+ 4
19716
19833
  ];
19717
19834
  setUploadQueue(tasks);
19718
19835
  return [
19719
19836
  3,
19720
- 5
19837
+ 6
19721
19838
  ];
19722
- case 3:
19839
+ case 4:
19723
19840
  return [
19724
19841
  4,
19725
19842
  uploadAction(tasks)
19726
19843
  ];
19727
- case 4:
19728
- _state.sent();
19729
- _state.label = 5;
19730
19844
  case 5:
19845
+ _state.sent();
19846
+ _state.label = 6;
19847
+ case 6:
19731
19848
  if (clearInput) {
19732
19849
  $el.value = "";
19733
19850
  }
@@ -23919,47 +24036,63 @@ Please add \`${key2}Action\` when creating your handler.`);
23919
24036
  indicator: false,
23920
24037
  loop: false,
23921
24038
  duration: 3e3,
23922
- autoPlay: false,
24039
+ autoplay: false,
23923
24040
  defaultValue: 0,
23924
24041
  touchable: true,
23925
24042
  effect: void 0
23926
24043
  };
23927
24044
  var Swiper = /* @__PURE__ */ React.forwardRef(function(props, ref) {
23928
- var boundIndex = function boundIndex2(current2) {
24045
+ var boundIndex = function boundIndex2(current) {
23929
24046
  var min = 0;
23930
24047
  var max = count - 1;
23931
- if (current2 === max && !loop2 && props.slideSize) {
24048
+ if (current === max && !loop2 && props.slideSize) {
23932
24049
  var slideSize = props.slideSize;
23933
24050
  var swiperSize = getSwiperSize();
23934
24051
  var ratio = (swiperSize - slideSize) / slideSize;
23935
- return bound2(current2, min, max - ratio);
24052
+ return bound2(current, min, max - ratio);
23936
24053
  }
23937
- return current2;
24054
+ return current;
23938
24055
  };
23939
24056
  var classPrefix2 = "nut-swiper";
23940
- var _$_object_spread = _object_spread({}, defaultProps$i, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop2 = _$_object_spread.loop, effect2 = _$_object_spread.effect, autoPlay = _$_object_spread.autoPlay, touchable = _$_object_spread.touchable, defaultValue = _$_object_spread.defaultValue, duration = _$_object_spread.duration, style = _$_object_spread.style, className = _$_object_spread.className;
24057
+ var _$_object_spread = _object_spread({}, defaultProps$i, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop2 = _$_object_spread.loop, effect2 = _$_object_spread.effect, autoplay = _$_object_spread.autoplay, touchable = _$_object_spread.touchable, defaultValue = _$_object_spread.defaultValue, duration = _$_object_spread.duration, style = _$_object_spread.style, className = _$_object_spread.className;
23941
24058
  var isVertical = direction === "vertical";
23942
24059
  var count = React.useMemo(function() {
23943
24060
  var c6 = 0;
23944
- React.Children.map(children, function(child, index2) {
24061
+ React.Children.map(children, function() {
23945
24062
  c6 += 1;
23946
24063
  });
23947
24064
  return c6;
23948
24065
  }, [
23949
24066
  children
23950
24067
  ]);
24068
+ var timeoutRef = React.useRef(null);
24069
+ var _useState = _sliced_to_array(React.useState(false), 2), dragging = _useState[0], setDragging = _useState[1];
24070
+ var _useRefState = _sliced_to_array(useRefState(defaultValue), 2), innerValue = _useRefState[0], setInnerValue = _useRefState[1];
24071
+ var stageRef = React.useRef(null);
24072
+ var swiperRef = React.useRef(null);
24073
+ var _useSpring = _sliced_to_array(useSpring(function() {
24074
+ return {
24075
+ x: !isVertical ? innerValue.current * 100 * -1 : 0,
24076
+ y: isVertical ? innerValue.current * 100 * -1 : 0,
24077
+ s: 0,
24078
+ reset: function() {
24079
+ },
24080
+ config: {
24081
+ tension: 200,
24082
+ friction: 30
24083
+ }
24084
+ };
24085
+ }), 2), springs = _useSpring[0], api = _useSpring[1];
23951
24086
  var getSlideSize = function() {
23952
24087
  if (props.slideSize) return props.slideSize;
23953
24088
  if (stageRef.current) {
23954
- if (isVertical) return stageRef.current.offsetHeight;
23955
- return stageRef.current.offsetWidth;
24089
+ return isVertical ? stageRef.current.offsetHeight : stageRef.current.offsetWidth;
23956
24090
  }
23957
24091
  return 0;
23958
24092
  };
23959
24093
  var getSwiperSize = function() {
23960
24094
  if (swiperRef.current) {
23961
- if (isVertical) return swiperRef.current.offsetHeight;
23962
- return swiperRef.current.offsetWidth;
24095
+ return isVertical ? swiperRef.current.offsetHeight : swiperRef.current.offsetWidth;
23963
24096
  }
23964
24097
  return 0;
23965
24098
  };
@@ -23972,51 +24105,44 @@ Please add \`${key2}Action\` when creating your handler.`);
23972
24105
  }
23973
24106
  return v;
23974
24107
  };
23975
- var timeoutRef = React.useRef(null);
23976
- var _useState = _sliced_to_array(React.useState(false), 2), dragging = _useState[0], setDragging = _useState[1];
23977
- var _useRefState = _sliced_to_array(useRefState(defaultValue), 2), current = _useRefState[0], setCurrent = _useRefState[1];
23978
- var stageRef = React.useRef(null);
23979
- var swiperRef = React.useRef(null);
23980
- var _useSpring = _sliced_to_array(useSpring(function() {
23981
- return {
23982
- x: !isVertical ? current.current * 100 * -1 : 0,
23983
- y: isVertical ? current.current * 100 * -1 : 0,
23984
- s: 0,
23985
- reset: function() {
23986
- },
23987
- config: {
23988
- tension: 200,
23989
- friction: 30
23990
- }
23991
- };
23992
- }), 2), springs = _useSpring[0], api = _useSpring[1];
23993
24108
  React.useEffect(function() {
23994
24109
  var _obj;
23995
- api.start((_obj = {}, _define_property(_obj, isVertical ? "y" : "x", boundIndex(current.current) * -1 * 100), _define_property(_obj, "immediate", true), _obj));
24110
+ api.start((_obj = {}, _define_property(_obj, isVertical ? "y" : "x", boundIndex(innerValue.current) * -1 * 100), _define_property(_obj, "immediate", true), _obj));
23996
24111
  }, [
23997
24112
  swiperRef.current
23998
24113
  ]);
23999
24114
  var swiperDirection = React.useRef(1);
24000
- var _useList = _sliced_to_array(useList(effect2, count, current), 2), transforms = _useList[0], setTransforms = _useList[1];
24001
- var runTimeSwiper = function() {
24115
+ var _useList = _sliced_to_array(useList(effect2, count, innerValue), 2), transforms = _useList[0], setTransforms = _useList[1];
24116
+ var runTimeSwiper = React.useCallback(function() {
24002
24117
  var durationNumber = typeof duration === "string" ? parseInt(duration) : duration;
24003
- var d2 = typeof autoPlay === "number" ? autoPlay : durationNumber;
24118
+ var d2 = durationNumber;
24119
+ if (typeof props.autoPlay === "number") {
24120
+ d2 = props.autoPlay;
24121
+ } else if (typeof autoplay === "number") {
24122
+ d2 = autoplay;
24123
+ }
24004
24124
  timeoutRef.current = window.setTimeout(function() {
24005
24125
  next();
24006
24126
  runTimeSwiper();
24007
24127
  }, d2);
24008
- };
24128
+ }, [
24129
+ props.autoPlay,
24130
+ autoplay,
24131
+ duration
24132
+ ]);
24009
24133
  React.useEffect(function() {
24010
- if (!autoPlay || dragging) return;
24134
+ var shouldAutoplay = props.autoPlay || autoplay;
24135
+ if (!shouldAutoplay || dragging) return;
24011
24136
  runTimeSwiper();
24012
24137
  return function() {
24013
24138
  if (timeoutRef.current) window.clearTimeout(timeoutRef.current);
24014
24139
  };
24015
24140
  }, [
24016
- autoPlay,
24141
+ autoplay,
24017
24142
  duration,
24018
24143
  dragging,
24019
- count
24144
+ count,
24145
+ runTimeSwiper
24020
24146
  ]);
24021
24147
  var to2 = function(index2) {
24022
24148
  var immediate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -24026,7 +24152,7 @@ Please add \`${key2}Action\` when creating your handler.`);
24026
24152
  var cycleIndex = index2 % count;
24027
24153
  targetIndex = cycleIndex < 0 ? cycleIndex + count : cycleIndex;
24028
24154
  }
24029
- setCurrent(targetIndex);
24155
+ setInnerValue(targetIndex);
24030
24156
  (_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, targetIndex);
24031
24157
  if (effect2) {
24032
24158
  updateTransform(transforms, setTransforms, effect2, targetIndex);
@@ -24090,13 +24216,10 @@ Please add \`${key2}Action\` when creating your handler.`);
24090
24216
  bounds: function() {
24091
24217
  if (loop2) return {};
24092
24218
  var slideSize = getSlideSize();
24093
- if (isVertical) {
24094
- return {
24095
- top: 0,
24096
- bottom: (count - 1) * slideSize
24097
- };
24098
- }
24099
- return {
24219
+ return isVertical ? {
24220
+ top: 0,
24221
+ bottom: (count - 1) * slideSize
24222
+ } : {
24100
24223
  left: 0,
24101
24224
  right: (count - 1) * slideSize
24102
24225
  };
@@ -24110,13 +24233,13 @@ Please add \`${key2}Action\` when creating your handler.`);
24110
24233
  }
24111
24234
  });
24112
24235
  var renderIndicator = function() {
24113
- if (/* @__PURE__ */ React.isValidElement(indicator)) return indicator;
24114
24236
  if (!indicator) return null;
24237
+ if (/* @__PURE__ */ React.isValidElement(indicator)) return indicator;
24115
24238
  var _obj;
24116
24239
  return /* @__PURE__ */ React.createElement("div", {
24117
24240
  className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-indicator"), true), _define_property(_obj, "".concat(classPrefix2, "-indicator-vertical"), isVertical), _define_property(_obj, "".concat(classPrefix2, "-indicator-horizontal"), !isVertical), _obj))
24118
24241
  }, /* @__PURE__ */ React.createElement(Indicator, {
24119
- current: getRefValue(current),
24242
+ current: getRefValue(innerValue),
24120
24243
  total: count,
24121
24244
  direction
24122
24245
  }));
@@ -24137,7 +24260,7 @@ Please add \`${key2}Action\` when creating your handler.`);
24137
24260
  count,
24138
24261
  isVertical,
24139
24262
  effect: effect2,
24140
- current,
24263
+ current: innerValue,
24141
24264
  swiperDirection,
24142
24265
  dragging,
24143
24266
  transforms
@@ -41479,9 +41602,10 @@ Please add \`${key2}Action\` when creating your handler.`);
41479
41602
  icon: null
41480
41603
  });
41481
41604
  var Step = function(props) {
41482
- var _ref = _object_spread({}, defaultProps$c, props);
41605
+ var _ref = _object_spread({}, defaultProps$c, props), type2 = _ref.type;
41483
41606
  _ref.children;
41484
41607
  var title = _ref.title, description = _ref.description, value2 = _ref.value, icon = _ref.icon, className = _ref.className, restProps = _object_without_properties(_ref, [
41608
+ "type",
41485
41609
  "children",
41486
41610
  "title",
41487
41611
  "description",
@@ -41490,65 +41614,107 @@ Please add \`${key2}Action\` when creating your handler.`);
41490
41614
  "className"
41491
41615
  ]);
41492
41616
  var parent2 = React.useContext(DataContext);
41493
- var dot = parent2.propSteps.dot;
41494
- var getCurrentStatus = function() {
41495
- var index2 = value2;
41496
- if (index2 < +parent2.propSteps.value) return "finish";
41497
- return index2 === +parent2.propSteps.value ? "process" : "wait";
41498
- };
41499
- var handleClickStep = function() {
41500
- var _parent_propSteps, _parent_propSteps1;
41501
- ((_parent_propSteps = parent2.propSteps) === null || _parent_propSteps === void 0 ? void 0 : _parent_propSteps.onStepClick) && ((_parent_propSteps1 = parent2.propSteps) === null || _parent_propSteps1 === void 0 ? void 0 : _parent_propSteps1.onStepClick(value2));
41502
- };
41617
+ var _parent_propSteps = parent2.propSteps, parentType = _parent_propSteps.type, parentValue = _parent_propSteps.value, status = _parent_propSteps.status, parentIcon = _parent_propSteps.icon, onStepClick = _parent_propSteps.onStepClick;
41618
+ var currentStatus = React.useMemo(function() {
41619
+ if ([
41620
+ "default",
41621
+ "business"
41622
+ ].includes(status)) {
41623
+ return status;
41624
+ }
41625
+ if (value2 < +parentValue) return "finish";
41626
+ return value2 === +parentValue ? "process" : "wait";
41627
+ }, [
41628
+ value2,
41629
+ parentValue
41630
+ ]);
41631
+ var handleClickStep = React.useCallback(function() {
41632
+ onStepClick === null || onStepClick === void 0 ? void 0 : onStepClick(value2);
41633
+ }, [
41634
+ onStepClick,
41635
+ value2
41636
+ ]);
41503
41637
  var classPrefix2 = "nut-step";
41504
- var classes = classNames(classPrefix2, _define_property({}, "".concat(classPrefix2, "-").concat(getCurrentStatus()), true), className);
41505
- var renderIconClass = function() {
41506
- if (icon) {
41507
- return "".concat(classPrefix2, "-icon is-icon");
41508
- }
41509
- if (!dot && !icon) {
41510
- return "".concat(classPrefix2, "-icon is-text");
41638
+ var classes = React.useMemo(function() {
41639
+ var _obj;
41640
+ return classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-").concat(currentStatus), true), _define_property(_obj, "".concat(classPrefix2, "-").concat(type2 || parentType), true), _define_property(_obj, "".concat(classPrefix2, "-special"), description), _obj), className);
41641
+ }, [
41642
+ currentStatus,
41643
+ type2,
41644
+ className
41645
+ ]);
41646
+ var renderHeadType = React.useMemo(function() {
41647
+ switch (type2 || parentType) {
41648
+ case "text":
41649
+ return /* @__PURE__ */ React.createElement("span", {
41650
+ className: "".concat(classPrefix2, "-head-text")
41651
+ }, value2);
41652
+ case "dot":
41653
+ return /* @__PURE__ */ React.createElement("span", {
41654
+ className: "".concat(classPrefix2, "-head-dot")
41655
+ });
41656
+ case "icon":
41657
+ return /* @__PURE__ */ React.createElement("span", {
41658
+ className: "".concat(classPrefix2, "-head-icon")
41659
+ }, icon || parentIcon);
41660
+ default:
41661
+ return null;
41511
41662
  }
41512
- return "".concat(classPrefix2, "-icon");
41513
- };
41663
+ }, [
41664
+ type2,
41665
+ value2,
41666
+ icon
41667
+ ]);
41668
+ var renderContent = React.useMemo(function() {
41669
+ if (!title && !description) return null;
41670
+ return /* @__PURE__ */ React.createElement("div", {
41671
+ className: "".concat(classPrefix2, "-main")
41672
+ }, title && /* @__PURE__ */ React.createElement("span", {
41673
+ className: "".concat(classPrefix2, "-title")
41674
+ }, title), description && /* @__PURE__ */ React.createElement("span", {
41675
+ className: "".concat(classPrefix2, "-description")
41676
+ }, description));
41677
+ }, [
41678
+ title,
41679
+ description
41680
+ ]);
41514
41681
  return /* @__PURE__ */ React.createElement("div", _object_spread_props(_object_spread({
41515
41682
  className: classes
41516
41683
  }, restProps), {
41517
41684
  onClick: handleClickStep
41518
41685
  }), /* @__PURE__ */ React.createElement("div", {
41519
- className: "nut-step-head"
41686
+ className: "".concat(classPrefix2, "-head")
41520
41687
  }, /* @__PURE__ */ React.createElement("div", {
41521
- className: "nut-step-line"
41522
- }), /* @__PURE__ */ React.createElement("div", {
41523
- className: renderIconClass()
41524
- }, icon || !dot && /* @__PURE__ */ React.createElement("span", {
41525
- className: "nut-step-inner"
41526
- }, value2))), (title || description) && /* @__PURE__ */ React.createElement("div", {
41527
- className: "nut-step-main"
41528
- }, /* @__PURE__ */ React.createElement("span", {
41529
- className: "nut-step-title"
41530
- }, title), description && /* @__PURE__ */ React.createElement("span", {
41531
- className: "nut-step-description"
41532
- }, description)));
41688
+ className: "".concat(classPrefix2, "-head-").concat(type2 || parentType, "-wrap")
41689
+ }, renderHeadType)), /* @__PURE__ */ React.createElement("div", {
41690
+ className: "".concat(classPrefix2, "-line")
41691
+ }, /* @__PURE__ */ React.createElement("div", {
41692
+ className: "".concat(classPrefix2, "-line-inner")
41693
+ })), renderContent);
41533
41694
  };
41534
41695
  Step.displayName = "NutStep";
41535
41696
  var defaultProps$b = _object_spread_props(_object_spread({}, ComponentDefaults), {
41536
- value: 0,
41537
41697
  direction: "horizontal",
41538
- dot: false
41698
+ layout: "single",
41699
+ type: "text",
41700
+ status: "default",
41701
+ value: 0,
41702
+ icon: null
41539
41703
  });
41540
41704
  var Steps = function(props) {
41541
41705
  var propSteps = _object_spread({}, defaultProps$b, props);
41542
- var children = propSteps.children;
41706
+ var direction = propSteps.direction;
41543
41707
  propSteps.value;
41544
- var direction = propSteps.direction, className = propSteps.className, dot = propSteps.dot;
41708
+ var layout = propSteps.layout, status = propSteps.status, type2 = propSteps.type, className = propSteps.className, children = propSteps.children;
41545
41709
  propSteps.onStepClick;
41546
41710
  var restProps = _object_without_properties(propSteps, [
41547
- "children",
41548
- "value",
41549
41711
  "direction",
41712
+ "value",
41713
+ "layout",
41714
+ "status",
41715
+ "type",
41550
41716
  "className",
41551
- "dot",
41717
+ "children",
41552
41718
  "onStepClick"
41553
41719
  ]);
41554
41720
  var parentSteps = {
@@ -41556,12 +41722,22 @@ Please add \`${key2}Action\` when creating your handler.`);
41556
41722
  };
41557
41723
  var classPrefix2 = "nut-steps";
41558
41724
  var _obj;
41559
- var classes = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-").concat(direction), true), _define_property(_obj, "".concat(classPrefix2, "-dot"), !!dot), _obj), className);
41725
+ var classes = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-").concat(direction), true), _define_property(_obj, "".concat(classPrefix2, "-").concat(direction, "-count-").concat(React.Children.count(children)), true), _define_property(_obj, "".concat(classPrefix2, "-").concat(direction, "-").concat(layout), true), _define_property(_obj, "".concat(classPrefix2, "-").concat(direction, "-").concat(type2), true), _define_property(_obj, "".concat(classPrefix2, "-").concat(direction, "-").concat(status), true), _obj), className);
41560
41726
  return /* @__PURE__ */ React.createElement(DataContext.Provider, {
41561
41727
  value: parentSteps
41562
41728
  }, /* @__PURE__ */ React.createElement("div", _object_spread({
41563
41729
  className: classes
41564
- }, restProps), children));
41730
+ }, restProps), React.Children.map(children, function(child, index2) {
41731
+ if (/* @__PURE__ */ React.isValidElement(child)) {
41732
+ return /* @__PURE__ */ React.cloneElement(child, {
41733
+ // @ts-ignore
41734
+ className: classNames(child.props.className, {
41735
+ "nut-step-last": index2 === React.Children.count(children) - 1
41736
+ })
41737
+ });
41738
+ }
41739
+ return child;
41740
+ })));
41565
41741
  };
41566
41742
  Steps.displayName = "NutSteps";
41567
41743
  function useTableSticky(columns) {