@nutui/nutui-react 3.0.0-beta.1 → 3.0.0-beta.3

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 (101) hide show
  1. package/dist/cjs/packages/avatar/style/avatar.scss +7 -60
  2. package/dist/cjs/packages/avatar/style/style.css +5 -43
  3. package/dist/cjs/packages/badge/badge.js +5 -3
  4. package/dist/cjs/packages/badge/style/badge.scss +18 -24
  5. package/dist/cjs/packages/badge/style/style.css +17 -15
  6. package/dist/cjs/packages/calendarcard/calendarcard.js +8 -3
  7. package/dist/cjs/packages/calendarcard/style/calendarcard.scss +25 -4
  8. package/dist/cjs/packages/calendarcard/style/style.css +27 -2
  9. package/dist/cjs/packages/input/style/input.scss +4 -0
  10. package/dist/cjs/packages/input/style/style.css +4 -0
  11. package/dist/cjs/packages/navbar/navbar.js +10 -5
  12. package/dist/cjs/packages/navbar/style/navbar.scss +46 -101
  13. package/dist/cjs/packages/navbar/style/style.css +44 -89
  14. package/dist/cjs/packages/pagination/pagination.js +2 -0
  15. package/dist/cjs/packages/pagination/style/pagination.scss +6 -12
  16. package/dist/cjs/packages/pagination/style/style.css +8 -14
  17. package/dist/cjs/packages/radio/index.d.ts +8 -2
  18. package/dist/cjs/packages/radio/index.js +6 -1
  19. package/dist/cjs/packages/radio/radio.d.ts +1 -4
  20. package/dist/cjs/packages/radio/radio.js +0 -2
  21. package/dist/cjs/packages/radio/style/radio.scss +1 -0
  22. package/dist/cjs/packages/radiogroup/radiogroup.js +1 -1
  23. package/dist/cjs/packages/safearea/style/safearea.scss +1 -1
  24. package/dist/cjs/packages/safearea/style/style.css +1 -1
  25. package/dist/cjs/packages/searchbar/style/searchbar.scss +10 -7
  26. package/dist/cjs/packages/searchbar/style/style.css +11 -8
  27. package/dist/cjs/packages/skeleton/style/style.css +5 -43
  28. package/dist/cjs/packages/tabbar/style/style.css +17 -15
  29. package/dist/cjs/packages/tabbaritem/style/style.css +17 -15
  30. package/dist/cjs/packages/toast/Notification.js +13 -24
  31. package/dist/cjs/packages/toast/style/style.css +56 -30
  32. package/dist/cjs/packages/toast/style/toast.scss +65 -49
  33. package/dist/cjs/packages/toast/toast.js +2 -2
  34. package/dist/cjs/packages/trendarrow/style/style.css +2 -1
  35. package/dist/cjs/packages/trendarrow/style/trendarrow.scss +2 -1
  36. package/dist/es/packages/avatar/style/avatar.scss +7 -60
  37. package/dist/es/packages/avatar/style/style.css +5 -43
  38. package/dist/es/packages/badge/badge.d.ts +7 -35
  39. package/dist/es/packages/badge/badge.js +5 -3
  40. package/dist/es/packages/badge/style/badge.scss +18 -24
  41. package/dist/es/packages/badge/style/style.css +17 -15
  42. package/dist/es/packages/calendarcard/calendarcard.d.ts +13 -65
  43. package/dist/es/packages/calendarcard/calendarcard.js +9 -4
  44. package/dist/es/packages/calendarcard/style/calendarcard.scss +25 -4
  45. package/dist/es/packages/calendarcard/style/style.css +27 -2
  46. package/dist/es/packages/input/style/input.scss +4 -0
  47. package/dist/es/packages/input/style/style.css +4 -0
  48. package/dist/es/packages/loading/loading.d.ts +3 -15
  49. package/dist/es/packages/navbar/navbar.js +10 -5
  50. package/dist/es/packages/navbar/style/navbar.scss +46 -101
  51. package/dist/es/packages/navbar/style/style.css +44 -89
  52. package/dist/es/packages/pagination/pagination.js +2 -0
  53. package/dist/es/packages/pagination/style/pagination.scss +6 -12
  54. package/dist/es/packages/pagination/style/style.css +8 -14
  55. package/dist/es/packages/radio/index.d.ts +8 -2
  56. package/dist/es/packages/radio/index.js +5 -1
  57. package/dist/es/packages/radio/radio.d.ts +10 -49
  58. package/dist/es/packages/radio/radio.js +0 -2
  59. package/dist/es/packages/radio/style/radio.scss +1 -0
  60. package/dist/es/packages/radiogroup/radiogroup.d.ts +7 -35
  61. package/dist/es/packages/radiogroup/radiogroup.js +1 -1
  62. package/dist/es/packages/safearea/safearea.d.ts +1 -5
  63. package/dist/es/packages/safearea/style/safearea.scss +1 -1
  64. package/dist/es/packages/safearea/style/style.css +1 -1
  65. package/dist/es/packages/searchbar/searchbar.d.ts +19 -95
  66. package/dist/es/packages/searchbar/style/searchbar.scss +10 -7
  67. package/dist/es/packages/searchbar/style/style.css +11 -8
  68. package/dist/es/packages/skeleton/style/style.css +5 -43
  69. package/dist/es/packages/tabbar/style/style.css +17 -15
  70. package/dist/es/packages/tabbaritem/style/style.css +17 -15
  71. package/dist/es/packages/toast/Notification.js +14 -25
  72. package/dist/es/packages/toast/style/style.css +56 -30
  73. package/dist/es/packages/toast/style/toast.scss +65 -49
  74. package/dist/es/packages/toast/toast.d.ts +12 -60
  75. package/dist/es/packages/toast/toast.js +2 -2
  76. package/dist/es/packages/trendarrow/style/style.css +2 -1
  77. package/dist/es/packages/trendarrow/style/trendarrow.scss +2 -1
  78. package/dist/es/packages/trendarrow/trendarrow.d.ts +11 -55
  79. package/dist/es/packages/video/video.d.ts +5 -25
  80. package/dist/nutui.react.umd.js +150 -125
  81. package/dist/style.css +1 -1
  82. package/dist/styles/themes/default.scss +35 -35
  83. package/dist/styles/variables-jrkf.scss +21 -27
  84. package/dist/styles/variables.scss +7 -4
  85. package/package.json +1 -1
  86. package/dist/cjs/packages/nutui.react.build.rn.d.ts +0 -203
  87. package/dist/cjs/packages/nutui.react.build.rn.js +0 -418
  88. package/dist/cjs/packages/nutui.react.rn.d.ts +0 -304
  89. package/dist/cjs/packages/nutui.react.rn.js +0 -519
  90. package/dist/cjs/packages/popup/index.rn.d.ts +0 -3
  91. package/dist/cjs/packages/popup/index.rn.js +0 -12
  92. package/dist/cjs/packages/popup/popup.rn.d.ts +0 -26
  93. package/dist/cjs/packages/popup/popup.rn.js +0 -186
  94. package/dist/es/packages/nutui.react.build.rn.d.ts +0 -203
  95. package/dist/es/packages/nutui.react.build.rn.js +0 -203
  96. package/dist/es/packages/nutui.react.rn.d.ts +0 -304
  97. package/dist/es/packages/nutui.react.rn.js +0 -304
  98. package/dist/es/packages/popup/index.rn.d.ts +0 -3
  99. package/dist/es/packages/popup/index.rn.js +0 -2
  100. package/dist/es/packages/popup/popup.rn.d.ts +0 -26
  101. package/dist/es/packages/popup/popup.rn.js +0 -174
@@ -843,7 +843,7 @@ Check the top-level render call using <` + t + ">.");
843
843
  }
844
844
  ) });
845
845
  };
846
- const p$5 = (o) => {
846
+ const p$6 = (o) => {
847
847
  const r = { ...dr, ...o };
848
848
  return /* @__PURE__ */ gr(mr, { ...r, name: r.name || "CheckChecked", viewBox: "0 0 1024 1024", children: [
849
849
  /* @__PURE__ */ xe(
@@ -931,7 +931,7 @@ Check the top-level render call using <` + t + ">.");
931
931
  }
932
932
  ) });
933
933
  };
934
- const p$4 = (r) => {
934
+ const p$5 = (r) => {
935
935
  const a = { ...dr, ...r };
936
936
  return /* @__PURE__ */ gr(mr, { ...a, name: a.name || "Del", viewBox: "0 0 1024 1024", children: [
937
937
  /* @__PURE__ */ xe(
@@ -953,7 +953,7 @@ Check the top-level render call using <` + t + ">.");
953
953
  )
954
954
  ] });
955
955
  };
956
- const p$3 = (a) => {
956
+ const p$4 = (a) => {
957
957
  const l = { ...dr, ...a };
958
958
  return /* @__PURE__ */ gr(mr, { ...l, name: l.name || "Failure", viewBox: "0 0 1024 1024", children: [
959
959
  /* @__PURE__ */ xe(
@@ -975,7 +975,7 @@ Check the top-level render call using <` + t + ">.");
975
975
  )
976
976
  ] });
977
977
  };
978
- const p$2 = (a) => {
978
+ const p$3 = (a) => {
979
979
  const l = { ...dr, ...a };
980
980
  return /* @__PURE__ */ gr(mr, { ...l, name: l.name || "ImageError", viewBox: "0 0 1024 1024", children: [
981
981
  /* @__PURE__ */ xe(
@@ -997,7 +997,7 @@ Check the top-level render call using <` + t + ">.");
997
997
  )
998
998
  ] });
999
999
  };
1000
- const p$1 = (o) => {
1000
+ const p$2 = (o) => {
1001
1001
  const a = { ...dr, ...o };
1002
1002
  return /* @__PURE__ */ gr(mr, { ...a, name: a.name || "Image", viewBox: "0 0 1024 1024", children: [
1003
1003
  /* @__PURE__ */ xe(
@@ -1195,6 +1195,28 @@ Check the top-level render call using <` + t + ">.");
1195
1195
  }
1196
1196
  ) });
1197
1197
  };
1198
+ const p$1 = (l) => {
1199
+ const r = { ...dr, ...l };
1200
+ return /* @__PURE__ */ gr(mr, { ...r, name: r.name || "Success", viewBox: "0 0 1024 1024", children: [
1201
+ /* @__PURE__ */ xe(
1202
+ "path",
1203
+ {
1204
+ d: "M743 405.33 682.67 345 448 579.67l-128-128L259.67 512 448 700.33z",
1205
+ fill: "currentColor",
1206
+ fillOpacity: "0.9"
1207
+ }
1208
+ ),
1209
+ ",",
1210
+ /* @__PURE__ */ xe(
1211
+ "path",
1212
+ {
1213
+ d: "M512 1024c282.77 0 512-229.23 512-512S794.77 0 512 0 0 229.23 0 512s229.23 512 512 512m0-85.33C276.35 938.67 85.33 747.65 85.33 512S276.35 85.33 512 85.33 938.67 276.35 938.67 512 747.65 938.67 512 938.67",
1214
+ fill: "currentColor",
1215
+ fillOpacity: "0.9"
1216
+ }
1217
+ )
1218
+ ] });
1219
+ };
1198
1220
  const c = (r) => {
1199
1221
  const a = { ...dr, ...r };
1200
1222
  return /* @__PURE__ */ gr(mr, { ...a, name: a.name || "Tips", viewBox: "0 0 1024 1024", children: [
@@ -2779,7 +2801,7 @@ Check the top-level render call using <` + t + ">.");
2779
2801
  if (typeof error === "boolean" && error === true && !innerLoading) {
2780
2802
  return /* @__PURE__ */ React.createElement("div", {
2781
2803
  className: "".concat(classPrefix$r, "-error")
2782
- }, /* @__PURE__ */ React.createElement(p$2, null));
2804
+ }, /* @__PURE__ */ React.createElement(p$3, null));
2783
2805
  }
2784
2806
  if (/* @__PURE__ */ React.isValidElement(error) && !innerLoading) {
2785
2807
  return /* @__PURE__ */ React.createElement("div", {
@@ -2796,7 +2818,7 @@ Check the top-level render call using <` + t + ">.");
2796
2818
  if (typeof loading === "boolean" && loading === true && innerLoading) {
2797
2819
  return /* @__PURE__ */ React.createElement("div", {
2798
2820
  className: "".concat(classPrefix$r, "-loading")
2799
- }, /* @__PURE__ */ React.createElement(p$1, null));
2821
+ }, /* @__PURE__ */ React.createElement(p$2, null));
2800
2822
  }
2801
2823
  if (/* @__PURE__ */ React.isValidElement(loading) && innerLoading) {
2802
2824
  return /* @__PURE__ */ React.createElement("div", {
@@ -10705,6 +10727,7 @@ Please add \`${key}Action\` when creating your handler.`);
10705
10727
  var NavBar = function(props) {
10706
10728
  var _$_object_spread = _object_spread({}, defaultProps$1g, props), right = _$_object_spread.right, left = _$_object_spread.left, titleAlign = _$_object_spread.titleAlign, className = _$_object_spread.className, style = _$_object_spread.style, back = _$_object_spread.back, fixed = _$_object_spread.fixed, safeAreaInsetTop = _$_object_spread.safeAreaInsetTop, placeholder = _$_object_spread.placeholder, zIndex = _$_object_spread.zIndex, onBackClick = _$_object_spread.onBackClick;
10707
10729
  var classPrefix2 = "nut-navbar";
10730
+ var rtl = useRtl();
10708
10731
  var children = Array.isArray(props.children) ? props.children : [
10709
10732
  props.children
10710
10733
  ];
@@ -10748,11 +10771,12 @@ Please add \`${key}Action\` when creating your handler.`);
10748
10771
  back
10749
10772
  ]);
10750
10773
  var renderLeft = function() {
10774
+ var _obj2, _obj1;
10751
10775
  return back || left ? /* @__PURE__ */ React.createElement("div", {
10752
- className: "".concat(classPrefix2, "-left"),
10776
+ className: classNames((_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-left"), true), _define_property(_obj2, "".concat(classPrefix2, "-left-align-").concat(titleAlign), true), _define_property(_obj2, "".concat(classPrefix2, "-left-rtl"), rtl), _obj2)),
10753
10777
  ref: leftRef
10754
10778
  }, back && /* @__PURE__ */ React.createElement("div", {
10755
- className: "".concat(classPrefix2, "-left-back"),
10779
+ className: classNames((_obj1 = {}, _define_property(_obj1, "".concat(classPrefix2, "-left-back"), true), _define_property(_obj1, "".concat(classPrefix2, "-left-back-align-").concat(titleAlign), true), _define_property(_obj1, "".concat(classPrefix2, "-left-back-children"), left), _define_property(_obj1, "".concat(classPrefix2, "-left-back-children-rtl"), left && rtl), _obj1)),
10756
10780
  onClick: function(e) {
10757
10781
  return onBackClick(e);
10758
10782
  }
@@ -10767,14 +10791,16 @@ Please add \`${key}Action\` when creating your handler.`);
10767
10791
  width: contentRealWidth
10768
10792
  };
10769
10793
  }
10794
+ var _obj2;
10770
10795
  return /* @__PURE__ */ React.createElement("div", {
10771
- className: "".concat(classPrefix2, "-title"),
10796
+ className: classNames((_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-title"), true), _define_property(_obj2, "".concat(classPrefix2, "-title-align-").concat(titleAlign), true), _obj2)),
10772
10797
  style: titleStyle
10773
10798
  }, children);
10774
10799
  };
10775
10800
  var renderRight = function() {
10801
+ var _obj2;
10776
10802
  return /* @__PURE__ */ React.createElement("div", {
10777
- className: "".concat(classPrefix2, "-right"),
10803
+ className: classNames((_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-right"), true), _define_property(_obj2, "".concat(classPrefix2, "-right-align-").concat(titleAlign), true), _define_property(_obj2, "".concat(classPrefix2, "-right-rtl"), rtl), _obj2)),
10778
10804
  ref: rightRef
10779
10805
  }, right);
10780
10806
  };
@@ -10786,7 +10812,7 @@ Please add \`${key}Action\` when creating your handler.`);
10786
10812
  }, renderLeft(), renderContent(), renderRight());
10787
10813
  };
10788
10814
  var _obj;
10789
- var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-fixed"), fixed), _define_property(_obj, "".concat(classPrefix2, "-title-align-").concat(titleAlign), true), _obj));
10815
+ var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-fixed"), fixed), _define_property(_obj, "".concat(classPrefix2, "-safe-area-inset-top"), safeAreaInsetTop), _define_property(_obj, "".concat(classPrefix2, "-align-").concat(titleAlign), true), _define_property(_obj, "".concat(classPrefix2, "-rtl"), rtl), _obj));
10790
10816
  var cls = classNames(classPrefix2, classes, className);
10791
10817
  return /* @__PURE__ */ React.createElement(React.Fragment, null, safeAreaInsetTop && /* @__PURE__ */ React.createElement(SafeArea, {
10792
10818
  position: "top"
@@ -11179,10 +11205,11 @@ Please add \`${key}Action\` when creating your handler.`);
11179
11205
  var _$_object_spread = _object_spread({}, defaultProps$1c, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, color = _$_object_spread.color, fill = _$_object_spread.fill;
11180
11206
  var classPrefix2 = "nut-badge";
11181
11207
  var classes = classNames(classPrefix2, className, _define_property({}, "".concat(classPrefix2, "-").concat(fill), fill === "outline"));
11182
- var contentClasses = classNames(_define_property({}, "".concat(classPrefix2, "-dot"), dot), "".concat(classPrefix2, "-content"), _define_property({}, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property({}, "".concat(classPrefix2, "-one"), typeof content() === "string" && ((_this = "".concat(content())) === null || _this === void 0 ? void 0 : _this.length) === 1));
11208
+ var _obj;
11209
+ var contentClasses = classNames("".concat(classPrefix2, "-content"), (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof content() === "string" && ((_this = "".concat(content())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _obj));
11183
11210
  var getStyle = function() {
11184
11211
  var style2 = {};
11185
- style2.top = "".concat(Number(top) || parseFloat(String(top)) || 0, "px");
11212
+ style2.top = "".concat(Number(-top) || parseFloat(String(-top)) || 0, "px");
11186
11213
  var dir = rtl ? "left" : "right";
11187
11214
  style2[dir] = "".concat(Number(right) || parseFloat(String(right)) || 0, "px");
11188
11215
  if (color) {
@@ -11199,11 +11226,12 @@ Please add \`${key}Action\` when creating your handler.`);
11199
11226
  }
11200
11227
  return style2;
11201
11228
  };
11229
+ var _obj1;
11202
11230
  return /* @__PURE__ */ React.createElement("div", {
11203
11231
  className: classes,
11204
11232
  style
11205
11233
  }, isIcon() && /* @__PURE__ */ React.createElement("div", {
11206
- className: "".concat(classPrefix2, "-icon")
11234
+ className: classNames("".concat(classPrefix2, "-content"), (_obj1 = {}, _define_property(_obj1, "".concat(classPrefix2, "-icon"), true), _define_property(_obj1, "".concat(classPrefix2, "-icon-rtl"), rtl), _obj1))
11207
11235
  }, value), children, !isIcon() && /* @__PURE__ */ React.createElement("div", {
11208
11236
  className: contentClasses,
11209
11237
  style: getStyle()
@@ -13638,7 +13666,7 @@ Please add \`${key}Action\` when creating your handler.`);
13638
13666
  onChange === null || onChange === void 0 ? void 0 : onChange(val);
13639
13667
  }
13640
13668
  };
13641
- var getDays = function(month2) {
13669
+ var getDays = React.useCallback(function(month2) {
13642
13670
  var y = month2.year;
13643
13671
  var m2 = month2.month;
13644
13672
  var days2 = _to_consumable_array(getPrevMonthDays(y, m2, firstDayOfWeek)).concat(_to_consumable_array(getCurrentMonthDays(y, m2)));
@@ -13654,13 +13682,18 @@ Please add \`${key}Action\` when creating your handler.`);
13654
13682
  });
13655
13683
  }
13656
13684
  return days2;
13657
- };
13685
+ }, [
13686
+ firstDayOfWeek
13687
+ ]);
13658
13688
  React.useEffect(function() {
13659
13689
  var newDays = getDays(month);
13660
13690
  setDays(newDays);
13661
13691
  onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(month);
13662
13692
  }, [
13663
- month
13693
+ month,
13694
+ getDays,
13695
+ onPageChange,
13696
+ firstDayOfWeek
13664
13697
  ]);
13665
13698
  var isSameDay = function(day1, day2) {
13666
13699
  return (day1 === null || day1 === void 0 ? void 0 : day1.year) === (day2 === null || day2 === void 0 ? void 0 : day2.year) && (day1 === null || day1 === void 0 ? void 0 : day1.month) === (day2 === null || day2 === void 0 ? void 0 : day2.month) && (day1 === null || day1 === void 0 ? void 0 : day1.date) === (day2 === null || day2 === void 0 ? void 0 : day2.date);
@@ -17682,81 +17715,7 @@ Please add \`${key}Action\` when creating your handler.`);
17682
17715
  };
17683
17716
  NumberKeyboard.displayName = "NutNumberKeyboard";
17684
17717
  const RadioContext = React.createContext(null);
17685
- var defaultProps$R = {
17686
- labelPosition: "right",
17687
- onChange: function(value) {
17688
- },
17689
- direction: "vertical",
17690
- options: []
17691
- };
17692
- var classPrefix$g = "nut-radiogroup";
17693
- var RadioGroup = /* @__PURE__ */ React.forwardRef(function(props, ref) {
17694
- var _ref = _object_spread({}, defaultProps$R, props), children = _ref.children, className = _ref.className;
17695
- _ref.value;
17696
- _ref.defaultValue;
17697
- var onChange = _ref.onChange, shape = _ref.shape, labelPosition = _ref.labelPosition;
17698
- _ref.direction;
17699
- var options2 = _ref.options, disabled = _ref.disabled, rest = _object_without_properties(_ref, [
17700
- "children",
17701
- "className",
17702
- "value",
17703
- "defaultValue",
17704
- "onChange",
17705
- "shape",
17706
- "labelPosition",
17707
- "direction",
17708
- "options",
17709
- "disabled"
17710
- ]);
17711
- var cls = classNames(classPrefix$g, _define_property({}, "".concat(classPrefix$g, "-").concat(props.direction), props.direction), className);
17712
- var _usePropsValue = _sliced_to_array(usePropsValue({
17713
- defaultValue: props.defaultValue,
17714
- value: props.value,
17715
- finalValue: "",
17716
- onChange
17717
- }), 2), val2State = _usePropsValue[0], setVal2State = _usePropsValue[1];
17718
- var renderOptionsChildren = React.useCallback(function() {
17719
- return options2 === null || options2 === void 0 ? void 0 : options2.map(function(_param) {
17720
- var label = _param.label, value = _param.value, disabled2 = _param.disabled, onChange2 = _param.onChange, rest2 = _object_without_properties(_param, [
17721
- "label",
17722
- "value",
17723
- "disabled",
17724
- "onChange"
17725
- ]);
17726
- return /* @__PURE__ */ React.createElement(Radio, _object_spread_props(_object_spread({}, rest2), {
17727
- key: value === null || value === void 0 ? void 0 : value.toString(),
17728
- children: label,
17729
- value,
17730
- disabled: disabled2,
17731
- onChange: onChange2,
17732
- labelPosition,
17733
- checked: value === val2State
17734
- }));
17735
- });
17736
- }, [
17737
- options2,
17738
- labelPosition,
17739
- val2State
17740
- ]);
17741
- return /* @__PURE__ */ React.createElement(RadioContext.Provider, {
17742
- value: {
17743
- labelPosition: labelPosition || "right",
17744
- disabled,
17745
- shape,
17746
- value: val2State,
17747
- check: function(value) {
17748
- setVal2State(value);
17749
- },
17750
- uncheck: function() {
17751
- setVal2State("");
17752
- }
17753
- }
17754
- }, /* @__PURE__ */ React.createElement("div", _object_spread({
17755
- className: cls
17756
- }, rest), (options2 === null || options2 === void 0 ? void 0 : options2.length) ? renderOptionsChildren() : children));
17757
- });
17758
- RadioGroup.displayName = "NutRadioGroup";
17759
- var defaultProps$Q = _object_spread_props(_object_spread({}, ComponentDefaults), {
17718
+ var defaultProps$R = _object_spread_props(_object_spread({}, ComponentDefaults), {
17760
17719
  disabled: false,
17761
17720
  shape: "round",
17762
17721
  value: "",
@@ -17768,7 +17727,7 @@ Please add \`${key}Action\` when creating your handler.`);
17768
17727
  });
17769
17728
  var Radio = function(props) {
17770
17729
  var classPrefix2 = "nut-radio";
17771
- var _ref = _object_spread({}, defaultProps$Q, props), children = _ref.children, className = _ref.className, style = _ref.style, checked = _ref.checked, defaultChecked = _ref.defaultChecked, shape = _ref.shape, value = _ref.value;
17730
+ var _ref = _object_spread({}, defaultProps$R, props), children = _ref.children, className = _ref.className, style = _ref.style, checked = _ref.checked, defaultChecked = _ref.defaultChecked, shape = _ref.shape, value = _ref.value;
17772
17731
  _ref.icon;
17773
17732
  _ref.activeIcon;
17774
17733
  var onChange = _ref.onChange, others = _object_without_properties(_ref, [
@@ -17824,7 +17783,7 @@ Please add \`${key}Action\` when creating your handler.`);
17824
17783
  if (checkedStatement) {
17825
17784
  return /* @__PURE__ */ React.isValidElement(activeIcon) ? /* @__PURE__ */ React.cloneElement(activeIcon, _object_spread_props(_object_spread({}, activeIcon.props), {
17826
17785
  className: classNames(color())
17827
- })) : /* @__PURE__ */ React.createElement(p$5, {
17786
+ })) : /* @__PURE__ */ React.createElement(p$6, {
17828
17787
  className: classNames(color())
17829
17788
  });
17830
17789
  }
@@ -17865,7 +17824,80 @@ Please add \`${key}Action\` when creating your handler.`);
17865
17824
  }, rest), renderRadioItem());
17866
17825
  };
17867
17826
  Radio.displayName = "NutRadio";
17868
- Radio.Group = RadioGroup;
17827
+ var defaultProps$Q = {
17828
+ labelPosition: "right",
17829
+ onChange: function(value) {
17830
+ },
17831
+ direction: "vertical",
17832
+ options: []
17833
+ };
17834
+ var classPrefix$g = "nut-radiogroup";
17835
+ var RadioGroup = /* @__PURE__ */ React.forwardRef(function(props, ref) {
17836
+ var _ref = _object_spread({}, defaultProps$Q, props), children = _ref.children, className = _ref.className;
17837
+ _ref.value;
17838
+ _ref.defaultValue;
17839
+ var onChange = _ref.onChange, shape = _ref.shape, labelPosition = _ref.labelPosition, direction = _ref.direction, options2 = _ref.options, disabled = _ref.disabled, rest = _object_without_properties(_ref, [
17840
+ "children",
17841
+ "className",
17842
+ "value",
17843
+ "defaultValue",
17844
+ "onChange",
17845
+ "shape",
17846
+ "labelPosition",
17847
+ "direction",
17848
+ "options",
17849
+ "disabled"
17850
+ ]);
17851
+ var cls = classNames(classPrefix$g, _define_property({}, "".concat(classPrefix$g, "-").concat(direction), direction), className);
17852
+ var _usePropsValue = _sliced_to_array(usePropsValue({
17853
+ defaultValue: props.defaultValue,
17854
+ value: props.value,
17855
+ finalValue: "",
17856
+ onChange
17857
+ }), 2), val2State = _usePropsValue[0], setVal2State = _usePropsValue[1];
17858
+ var renderOptionsChildren = React.useCallback(function() {
17859
+ return options2 === null || options2 === void 0 ? void 0 : options2.map(function(_param) {
17860
+ var label = _param.label, value = _param.value, disabled2 = _param.disabled, onChange2 = _param.onChange, rest2 = _object_without_properties(_param, [
17861
+ "label",
17862
+ "value",
17863
+ "disabled",
17864
+ "onChange"
17865
+ ]);
17866
+ return /* @__PURE__ */ React.createElement(InnerRadio, _object_spread_props(_object_spread({}, rest2), {
17867
+ key: value === null || value === void 0 ? void 0 : value.toString(),
17868
+ children: label,
17869
+ value,
17870
+ disabled: disabled2,
17871
+ onChange: onChange2,
17872
+ labelPosition,
17873
+ checked: value === val2State
17874
+ }));
17875
+ });
17876
+ }, [
17877
+ options2,
17878
+ labelPosition,
17879
+ val2State
17880
+ ]);
17881
+ return /* @__PURE__ */ React.createElement(RadioContext.Provider, {
17882
+ value: {
17883
+ labelPosition: labelPosition || "right",
17884
+ disabled,
17885
+ shape,
17886
+ value: val2State,
17887
+ check: function(value) {
17888
+ setVal2State(value);
17889
+ },
17890
+ uncheck: function() {
17891
+ setVal2State("");
17892
+ }
17893
+ }
17894
+ }, /* @__PURE__ */ React.createElement("div", _object_spread({
17895
+ className: cls
17896
+ }, rest), (options2 === null || options2 === void 0 ? void 0 : options2.length) ? renderOptionsChildren() : children));
17897
+ });
17898
+ RadioGroup.displayName = "NutRadioGroup";
17899
+ var InnerRadio = Radio;
17900
+ InnerRadio.Group = RadioGroup;
17869
17901
  var defaultProps$P = _object_spread_props(_object_spread({}, ComponentDefaults), {
17870
17902
  range: false,
17871
17903
  min: 0,
@@ -19348,7 +19380,7 @@ Please add \`${key}Action\` when creating your handler.`);
19348
19380
  var fileList = param.fileList, previewType = param.previewType, deletable = param.deletable, onDeleteItem = param.onDeleteItem, handleItemClick = param.handleItemClick, previewUrl = param.previewUrl, deleteIcon = param.deleteIcon, children = param.children;
19349
19381
  var renderIcon = function(item) {
19350
19382
  if (item.status === ERROR) {
19351
- return item.failIcon || /* @__PURE__ */ React.createElement(p$3, {
19383
+ return item.failIcon || /* @__PURE__ */ React.createElement(p$4, {
19352
19384
  color: "#fff"
19353
19385
  });
19354
19386
  }
@@ -19412,7 +19444,7 @@ Please add \`${key}Action\` when creating your handler.`);
19412
19444
  onClick: function() {
19413
19445
  return handleItemClick(item, index);
19414
19446
  }
19415
- }, /* @__PURE__ */ React.createElement(s$3, null), /* @__PURE__ */ React.createElement("span", null, " ", item.name)), deletable && /* @__PURE__ */ React.createElement(p$4, {
19447
+ }, /* @__PURE__ */ React.createElement(s$3, null), /* @__PURE__ */ React.createElement("span", null, " ", item.name)), deletable && /* @__PURE__ */ React.createElement(p$5, {
19416
19448
  color: "#808080",
19417
19449
  className: "nut-uploader-preview-img-file-del",
19418
19450
  onClick: function() {
@@ -19466,7 +19498,7 @@ Please add \`${key}Action\` when creating your handler.`);
19466
19498
  height: "20px",
19467
19499
  color: "#808080"
19468
19500
  }),
19469
- deleteIcon: /* @__PURE__ */ React.createElement(p$3, {
19501
+ deleteIcon: /* @__PURE__ */ React.createElement(p$4, {
19470
19502
  color: "rgba(0,0,0,0.6)"
19471
19503
  }),
19472
19504
  beforeDelete: function(file, files) {
@@ -22408,23 +22440,14 @@ Please add \`${key}Action\` when creating your handler.`);
22408
22440
  value: function renderIcon() {
22409
22441
  var icon = this.props.icon;
22410
22442
  if (typeof icon === "string") {
22411
- var iconNode = null;
22412
- switch (icon) {
22413
- case "success":
22414
- iconNode = /* @__PURE__ */ React__namespace.createElement(i$5, null);
22415
- break;
22416
- case "loading":
22417
- iconNode = /* @__PURE__ */ React__namespace.createElement(n$4, {
22418
- className: "nut-icon-loading"
22419
- });
22420
- break;
22421
- case "fail":
22422
- iconNode = /* @__PURE__ */ React__namespace.createElement(p$3, null);
22423
- break;
22424
- case "warn":
22425
- iconNode = /* @__PURE__ */ React__namespace.createElement(c, null);
22426
- break;
22427
- }
22443
+ var iconNode = {
22444
+ success: /* @__PURE__ */ React__namespace.createElement(p$1, null),
22445
+ fail: /* @__PURE__ */ React__namespace.createElement(p$4, null),
22446
+ warn: /* @__PURE__ */ React__namespace.createElement(c, null),
22447
+ loading: /* @__PURE__ */ React__namespace.createElement(n$4, {
22448
+ className: "nut-icon-loading"
22449
+ })
22450
+ }[icon];
22428
22451
  return /* @__PURE__ */ React__namespace.createElement("p", {
22429
22452
  className: "".concat(classPrefix$8, "-icon-wrapper")
22430
22453
  }, iconNode);
@@ -22450,9 +22473,9 @@ Please add \`${key}Action\` when creating your handler.`);
22450
22473
  var _this = this;
22451
22474
  var _this_props = this.props, id = _this_props.id, icon = _this_props.icon, title = _this_props.title, content = _this_props.content, position = _this_props.position, size = _this_props.size, closeOnOverlayClick = _this_props.closeOnOverlayClick, lockScroll = _this_props.lockScroll, style = _this_props.style, className = _this_props.className, contentClassName = _this_props.contentClassName, contentStyle = _this_props.contentStyle, wordBreak = _this_props.wordBreak;
22452
22475
  var show2 = this.state.show;
22453
- var classes = classNames(_define_property({
22476
+ var classes = classNames({
22454
22477
  "nut-toast-has-icon": icon
22455
- }, "nut-toast-".concat(size), true));
22478
+ });
22456
22479
  return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Overlay, {
22457
22480
  visible: show2,
22458
22481
  style,
@@ -22466,12 +22489,12 @@ Please add \`${key}Action\` when creating your handler.`);
22466
22489
  className: "".concat(classPrefix$8, " ").concat(classes),
22467
22490
  id: "toast-".concat(id)
22468
22491
  }, /* @__PURE__ */ React__namespace.createElement("div", {
22469
- className: "".concat(classPrefix$8, "-inner ").concat(classPrefix$8, "-").concat(position, " ").concat(contentClassName, " ").concat(wordBreak),
22470
- style: contentStyle
22492
+ className: "".concat(classPrefix$8, "-inner ").concat(classPrefix$8, "-").concat(position, " ").concat(contentClassName, " ").concat(classPrefix$8, "-inner-").concat(size, " ").concat(classPrefix$8, "-inner-").concat(wordBreak),
22493
+ style: _object_spread({}, contentStyle)
22471
22494
  }, this.renderIcon(), title ? /* @__PURE__ */ React__namespace.createElement("div", {
22472
22495
  className: "".concat(classPrefix$8, "-title")
22473
22496
  }, title) : null, /* @__PURE__ */ React__namespace.createElement("span", {
22474
- className: "".concat(classPrefix$8, "-text")
22497
+ className: "".concat(classPrefix$8, "-text ").concat(content ? "" : "".concat(classPrefix$8, "-text-empty"))
22475
22498
  }, content)))));
22476
22499
  }
22477
22500
  }
@@ -22511,12 +22534,12 @@ Please add \`${key}Action\` when creating your handler.`);
22511
22534
  title: "",
22512
22535
  size: "base",
22513
22536
  icon: null,
22514
- onClose: function() {
22515
- },
22516
22537
  closeOnOverlayClick: false,
22517
22538
  lockScroll: false,
22518
22539
  contentClassName: "",
22519
- wordBreak: "break-all"
22540
+ wordBreak: "break-all",
22541
+ onClose: function() {
22542
+ }
22520
22543
  });
22521
22544
  function getInstance(props, callback) {
22522
22545
  if (messageInstance) {
@@ -24494,6 +24517,8 @@ Please add \`${key}Action\` when creating your handler.`);
24494
24517
  }, /* @__PURE__ */ React.createElement("div", {
24495
24518
  className: "".concat(classPrefix2, "-lite-active")
24496
24519
  }, currentPage), /* @__PURE__ */ React.createElement("div", {
24520
+ className: "".concat(classPrefix2, "-lite-spliterator")
24521
+ }, "/"), /* @__PURE__ */ React.createElement("div", {
24497
24522
  className: "".concat(classPrefix2, "-lite-default")
24498
24523
  }, pageCount)));
24499
24524
  };
@@ -26456,7 +26481,7 @@ Please add \`${key}Action\` when creating your handler.`);
26456
26481
  exports2.Price = Price;
26457
26482
  exports2.Progress = Progress;
26458
26483
  exports2.PullToRefresh = PullToRefresh;
26459
- exports2.Radio = Radio;
26484
+ exports2.Radio = InnerRadio;
26460
26485
  exports2.RadioGroup = RadioGroup;
26461
26486
  exports2.Range = Range;
26462
26487
  exports2.Rate = Rate;