@nutui/nutui-react 2.0.0-alpha.4 → 2.0.0-alpha.6

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 (47) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/esm/Avatar.js +30 -25
  3. package/dist/esm/AvatarGroup.js +10 -15
  4. package/dist/esm/Cascader.js +46 -58
  5. package/dist/esm/Checkbox.js +1 -2
  6. package/dist/esm/CheckboxGroup.js +18 -20
  7. package/dist/esm/DatePicker.js +10 -10
  8. package/dist/esm/Ellipsis.js +13 -12
  9. package/dist/esm/Empty.js +18 -26
  10. package/dist/esm/Image.js +3 -5
  11. package/dist/esm/Picker.js +175 -160
  12. package/dist/esm/Skeleton.js +1 -1
  13. package/dist/esm/Swipe.js +4 -10
  14. package/dist/esm/TabPane.js +39 -3
  15. package/dist/esm/Tabbar/style/index.js +1 -1
  16. package/dist/esm/Table.js +20 -34
  17. package/dist/esm/TextArea.js +53 -81
  18. package/dist/esm/cellgroup2.js +5 -4
  19. package/dist/esm/checkbox2.js +34 -47
  20. package/dist/esm/tabs2.js +10 -0
  21. package/dist/locales/base.js +1 -1
  22. package/dist/locales/en-US.js +1 -1
  23. package/dist/locales/id-ID.js +1 -1
  24. package/dist/locales/zh-CN.js +1 -1
  25. package/dist/locales/zh-TW.js +1 -1
  26. package/dist/locales/zh-UG.js +1 -1
  27. package/dist/nutui.react.mjs +723 -682
  28. package/dist/nutui.react.umd.js +723 -682
  29. package/dist/packages/cascader/cascader.scss +0 -26
  30. package/dist/packages/cellgroup/cellgroup.scss +20 -16
  31. package/dist/packages/checkbox/checkbox.scss +8 -11
  32. package/dist/packages/empty/empty.scss +0 -9
  33. package/dist/packages/picker/picker.scss +66 -137
  34. package/dist/packages/tabbar/tabbar.scss +1 -0
  35. package/dist/packages/table/table.scss +0 -56
  36. package/dist/packages/textarea/textarea.scss +5 -12
  37. package/dist/style.css +1 -1
  38. package/dist/style.mjs +1 -1
  39. package/dist/styles/themes/default.scss +0 -1
  40. package/dist/styles/variables-jmapp.scss +1 -4
  41. package/dist/styles/variables.scss +2 -6
  42. package/dist/types/index.d.ts +75 -91
  43. package/package.json +1 -1
  44. package/dist/esm/Icon.js +0 -83
  45. package/dist/esm/tabpane2.js +0 -42
  46. package/dist/packages/icon/icon.scss +0 -0
  47. /package/dist/esm/{AvatarContext.js → context.js} +0 -0
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  return value;
10
10
  };
11
11
  /*!
12
- * @nutui/nutui-react v2.0.0-alpha.4 Fri May 05 2023 16:12:43 GMT+0800 (China Standard Time)
12
+ * @nutui/nutui-react v2.0.0-alpha.6 Fri May 12 2023 15:13:32 GMT+0800 (China Standard Time)
13
13
  * (c) 2023 @jdf2e.
14
14
  * Released under the MIT License.
15
15
  */
@@ -1032,7 +1032,7 @@ var __publicField = (obj, key, value) => {
1032
1032
  set exports(h) {
1033
1033
  D = h;
1034
1034
  }
1035
- }, k$5 = {};
1035
+ }, k$6 = {};
1036
1036
  /**
1037
1037
  * @license React
1038
1038
  * react-jsx-runtime.production.min.js
@@ -1045,7 +1045,7 @@ var __publicField = (obj, key, value) => {
1045
1045
  var Re;
1046
1046
  function ur() {
1047
1047
  if (Re)
1048
- return k$5;
1048
+ return k$6;
1049
1049
  Re = 1;
1050
1050
  var h = React, S = Symbol.for("react.element"), M = Symbol.for("react.fragment"), R = Object.prototype.hasOwnProperty, A = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, I = { key: true, ref: true, __self: true, __source: true };
1051
1051
  function w(m, l2, T) {
@@ -1058,7 +1058,7 @@ var __publicField = (obj, key, value) => {
1058
1058
  g[d] === void 0 && (g[d] = l2[d]);
1059
1059
  return { $$typeof: S, type: m, key: _, ref: $, props: g, _owner: A.current };
1060
1060
  }
1061
- return k$5.Fragment = M, k$5.jsx = w, k$5.jsxs = w, k$5;
1061
+ return k$6.Fragment = M, k$6.jsx = w, k$6.jsxs = w, k$6;
1062
1062
  }
1063
1063
  var F = {};
1064
1064
  /**
@@ -1661,7 +1661,7 @@ Check the top-level render call using <` + t + ">.");
1661
1661
  process.env.NODE_ENV === "production" ? h.exports = ur() : h.exports = sr();
1662
1662
  })(ir);
1663
1663
  const lr = D.Fragment, cr = D.jsx, vr = D.jsxs;
1664
- const a$u = {
1664
+ const a$v = {
1665
1665
  className: "",
1666
1666
  style: void 0,
1667
1667
  name: "ArrowDown2",
@@ -1670,7 +1670,7 @@ Check the top-level render call using <` + t + ">.");
1670
1670
  onClick: () => {
1671
1671
  }
1672
1672
  }, y$8 = (h) => {
1673
- const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$u, ...h }, f = (t) => {
1673
+ const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$v, ...h }, f = (t) => {
1674
1674
  n && n(t);
1675
1675
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
1676
1676
  const t = "nut-icon";
@@ -1707,8 +1707,8 @@ Check the top-level render call using <` + t + ">.");
1707
1707
  }
1708
1708
  ) });
1709
1709
  };
1710
- y$8.defaultProps = a$u;
1711
- const a$t = {
1710
+ y$8.defaultProps = a$v;
1711
+ const a$u = {
1712
1712
  className: "",
1713
1713
  style: void 0,
1714
1714
  name: "ArrowUp2",
@@ -1717,7 +1717,7 @@ Check the top-level render call using <` + t + ">.");
1717
1717
  onClick: () => {
1718
1718
  }
1719
1719
  }, x$g = (h) => {
1720
- const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$t, ...h }, g = (t) => {
1720
+ const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$u, ...h }, g = (t) => {
1721
1721
  n && n(t);
1722
1722
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", w = () => {
1723
1723
  const t = "nut-icon";
@@ -1754,8 +1754,8 @@ Check the top-level render call using <` + t + ">.");
1754
1754
  }
1755
1755
  ) });
1756
1756
  };
1757
- x$g.defaultProps = a$t;
1758
- const a$s = {
1757
+ x$g.defaultProps = a$u;
1758
+ const a$t = {
1759
1759
  className: "",
1760
1760
  style: void 0,
1761
1761
  name: "CheckChecked",
@@ -1764,7 +1764,7 @@ Check the top-level render call using <` + t + ">.");
1764
1764
  onClick: () => {
1765
1765
  }
1766
1766
  }, y$7 = (h) => {
1767
- const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$s, ...h }, C = (t) => {
1767
+ const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$t, ...h }, C = (t) => {
1768
1768
  o && o(t);
1769
1769
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
1770
1770
  const t = "nut-icon";
@@ -1812,8 +1812,8 @@ Check the top-level render call using <` + t + ">.");
1812
1812
  }
1813
1813
  ) });
1814
1814
  };
1815
- y$7.defaultProps = a$s;
1816
- const a$r = {
1815
+ y$7.defaultProps = a$t;
1816
+ const a$s = {
1817
1817
  className: "",
1818
1818
  style: void 0,
1819
1819
  name: "CheckDisabled",
@@ -1822,7 +1822,7 @@ Check the top-level render call using <` + t + ">.");
1822
1822
  onClick: () => {
1823
1823
  }
1824
1824
  }, x$f = (h) => {
1825
- const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$r, ...h }, g = (t) => {
1825
+ const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$s, ...h }, g = (t) => {
1826
1826
  o && o(t);
1827
1827
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
1828
1828
  const t = "nut-icon";
@@ -1859,8 +1859,8 @@ Check the top-level render call using <` + t + ">.");
1859
1859
  }
1860
1860
  ) });
1861
1861
  };
1862
- x$f.defaultProps = a$r;
1863
- const a$q = {
1862
+ x$f.defaultProps = a$s;
1863
+ const a$r = {
1864
1864
  className: "",
1865
1865
  style: void 0,
1866
1866
  name: "CheckNormal",
@@ -1869,7 +1869,7 @@ Check the top-level render call using <` + t + ">.");
1869
1869
  onClick: () => {
1870
1870
  }
1871
1871
  }, N = (h) => {
1872
- const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$q, ...h }, f = (t) => {
1872
+ const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$r, ...h }, f = (t) => {
1873
1873
  r && r(t);
1874
1874
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
1875
1875
  const t = "nut-icon";
@@ -1906,8 +1906,8 @@ Check the top-level render call using <` + t + ">.");
1906
1906
  }
1907
1907
  ) });
1908
1908
  };
1909
- N.defaultProps = a$q;
1910
- const a$p = {
1909
+ N.defaultProps = a$r;
1910
+ const a$q = {
1911
1911
  className: "",
1912
1912
  style: void 0,
1913
1913
  name: "Check",
@@ -1916,7 +1916,7 @@ Check the top-level render call using <` + t + ">.");
1916
1916
  onClick: () => {
1917
1917
  }
1918
1918
  }, x$e = (h) => {
1919
- const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$p, ...h }, g = (t) => {
1919
+ const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$q, ...h }, g = (t) => {
1920
1920
  r && r(t);
1921
1921
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
1922
1922
  const t = "nut-icon";
@@ -1953,8 +1953,8 @@ Check the top-level render call using <` + t + ">.");
1953
1953
  }
1954
1954
  ) });
1955
1955
  };
1956
- x$e.defaultProps = a$p;
1957
- const a$o = {
1956
+ x$e.defaultProps = a$q;
1957
+ const a$p = {
1958
1958
  className: "",
1959
1959
  style: void 0,
1960
1960
  name: "Checked",
@@ -1963,7 +1963,7 @@ Check the top-level render call using <` + t + ">.");
1963
1963
  onClick: () => {
1964
1964
  }
1965
1965
  }, x$d = (h) => {
1966
- const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$o, ...h }, f = (t) => {
1966
+ const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$p, ...h }, f = (t) => {
1967
1967
  r && r(t);
1968
1968
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
1969
1969
  const t = "nut-icon";
@@ -2000,8 +2000,8 @@ Check the top-level render call using <` + t + ">.");
2000
2000
  }
2001
2001
  ) });
2002
2002
  };
2003
- x$d.defaultProps = a$o;
2004
- const a$n = {
2003
+ x$d.defaultProps = a$p;
2004
+ const a$o = {
2005
2005
  className: "",
2006
2006
  style: void 0,
2007
2007
  name: "Checklist",
@@ -2010,7 +2010,7 @@ Check the top-level render call using <` + t + ">.");
2010
2010
  onClick: () => {
2011
2011
  }
2012
2012
  }, x$c = (h) => {
2013
- const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$n, ...h }, g = (t) => {
2013
+ const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$o, ...h }, g = (t) => {
2014
2014
  o && o(t);
2015
2015
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
2016
2016
  const t = "nut-icon";
@@ -2047,8 +2047,8 @@ Check the top-level render call using <` + t + ">.");
2047
2047
  }
2048
2048
  ) });
2049
2049
  };
2050
- x$c.defaultProps = a$n;
2051
- const a$m = {
2050
+ x$c.defaultProps = a$o;
2051
+ const a$n = {
2052
2052
  className: "",
2053
2053
  style: void 0,
2054
2054
  name: "CircleClose",
@@ -2057,7 +2057,7 @@ Check the top-level render call using <` + t + ">.");
2057
2057
  onClick: () => {
2058
2058
  }
2059
2059
  }, x$b = (h) => {
2060
- const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$m, ...h }, f = (t) => {
2060
+ const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$n, ...h }, f = (t) => {
2061
2061
  o && o(t);
2062
2062
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2063
2063
  const t = "nut-icon";
@@ -2094,8 +2094,8 @@ Check the top-level render call using <` + t + ">.");
2094
2094
  }
2095
2095
  ) });
2096
2096
  };
2097
- x$b.defaultProps = a$m;
2098
- const a$l = {
2097
+ x$b.defaultProps = a$n;
2098
+ const a$m = {
2099
2099
  className: "",
2100
2100
  style: void 0,
2101
2101
  name: "Close",
@@ -2104,7 +2104,7 @@ Check the top-level render call using <` + t + ">.");
2104
2104
  onClick: () => {
2105
2105
  }
2106
2106
  }, x$a = (h) => {
2107
- const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$l, ...h }, g = (t) => {
2107
+ const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$m, ...h }, g = (t) => {
2108
2108
  r && r(t);
2109
2109
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
2110
2110
  const t = "nut-icon";
@@ -2141,8 +2141,8 @@ Check the top-level render call using <` + t + ">.");
2141
2141
  }
2142
2142
  ) });
2143
2143
  };
2144
- x$a.defaultProps = a$l;
2145
- const a$k = {
2144
+ x$a.defaultProps = a$m;
2145
+ const a$l = {
2146
2146
  className: "",
2147
2147
  style: void 0,
2148
2148
  name: "Del",
@@ -2151,7 +2151,7 @@ Check the top-level render call using <` + t + ">.");
2151
2151
  onClick: () => {
2152
2152
  }
2153
2153
  }, y$6 = (h) => {
2154
- const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$k, ...h }, g = (t) => {
2154
+ const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$l, ...h }, g = (t) => {
2155
2155
  r && r(t);
2156
2156
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2157
2157
  const t = "nut-icon";
@@ -2188,8 +2188,8 @@ Check the top-level render call using <` + t + ">.");
2188
2188
  }
2189
2189
  ) });
2190
2190
  };
2191
- y$6.defaultProps = a$k;
2192
- const a$j = {
2191
+ y$6.defaultProps = a$l;
2192
+ const a$k = {
2193
2193
  className: "",
2194
2194
  style: void 0,
2195
2195
  name: "DownArrow",
@@ -2198,7 +2198,7 @@ Check the top-level render call using <` + t + ">.");
2198
2198
  onClick: () => {
2199
2199
  }
2200
2200
  }, x$9 = (h) => {
2201
- const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$j, ...h }, f = (t) => {
2201
+ const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$k, ...h }, f = (t) => {
2202
2202
  n && n(t);
2203
2203
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2204
2204
  const t = "nut-icon";
@@ -2235,8 +2235,8 @@ Check the top-level render call using <` + t + ">.");
2235
2235
  }
2236
2236
  ) });
2237
2237
  };
2238
- x$9.defaultProps = a$j;
2239
- const a$i = {
2238
+ x$9.defaultProps = a$k;
2239
+ const a$j = {
2240
2240
  className: "",
2241
2241
  style: void 0,
2242
2242
  name: "Failure",
@@ -2245,7 +2245,7 @@ Check the top-level render call using <` + t + ">.");
2245
2245
  onClick: () => {
2246
2246
  }
2247
2247
  }, x$8 = (h) => {
2248
- const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$i, ...h }, u = (t) => {
2248
+ const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$j, ...h }, u = (t) => {
2249
2249
  l2 && l2(t);
2250
2250
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2251
2251
  const t = "nut-icon";
@@ -2282,8 +2282,8 @@ Check the top-level render call using <` + t + ">.");
2282
2282
  }
2283
2283
  ) });
2284
2284
  };
2285
- x$8.defaultProps = a$i;
2286
- const a$h = {
2285
+ x$8.defaultProps = a$j;
2286
+ const a$i = {
2287
2287
  className: "",
2288
2288
  style: void 0,
2289
2289
  name: "ImageError",
@@ -2291,8 +2291,8 @@ Check the top-level render call using <` + t + ">.");
2291
2291
  height: "",
2292
2292
  onClick: () => {
2293
2293
  }
2294
- }, k$4 = (h) => {
2295
- const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$h, ...h }, g = (t) => {
2294
+ }, k$5 = (h) => {
2295
+ const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$i, ...h }, g = (t) => {
2296
2296
  o && o(t);
2297
2297
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2298
2298
  const t = "nut-icon";
@@ -2340,8 +2340,8 @@ Check the top-level render call using <` + t + ">.");
2340
2340
  }
2341
2341
  ) });
2342
2342
  };
2343
- k$4.defaultProps = a$h;
2344
- const a$g = {
2343
+ k$5.defaultProps = a$i;
2344
+ const a$h = {
2345
2345
  className: "",
2346
2346
  style: void 0,
2347
2347
  name: "Image",
@@ -2349,8 +2349,8 @@ Check the top-level render call using <` + t + ">.");
2349
2349
  height: "",
2350
2350
  onClick: () => {
2351
2351
  }
2352
- }, k$3 = (h) => {
2353
- const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$g, ...h }, g = (t) => {
2352
+ }, k$4 = (h) => {
2353
+ const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$h, ...h }, g = (t) => {
2354
2354
  r && r(t);
2355
2355
  }, o = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2356
2356
  const t = "nut-icon";
@@ -2398,8 +2398,8 @@ Check the top-level render call using <` + t + ">.");
2398
2398
  }
2399
2399
  ) });
2400
2400
  };
2401
- k$3.defaultProps = a$g;
2402
- const a$f = {
2401
+ k$4.defaultProps = a$h;
2402
+ const a$g = {
2403
2403
  className: "",
2404
2404
  style: void 0,
2405
2405
  name: "JoySmile",
@@ -2408,7 +2408,7 @@ Check the top-level render call using <` + t + ">.");
2408
2408
  onClick: () => {
2409
2409
  }
2410
2410
  }, x$7 = (h) => {
2411
- const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$f, ...h }, g = (t) => {
2411
+ const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$g, ...h }, g = (t) => {
2412
2412
  r && r(t);
2413
2413
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2414
2414
  const t = "nut-icon";
@@ -2445,8 +2445,8 @@ Check the top-level render call using <` + t + ">.");
2445
2445
  }
2446
2446
  ) });
2447
2447
  };
2448
- x$7.defaultProps = a$f;
2449
- const a$e = {
2448
+ x$7.defaultProps = a$g;
2449
+ const a$f = {
2450
2450
  className: "",
2451
2451
  style: void 0,
2452
2452
  name: "Left",
@@ -2455,7 +2455,7 @@ Check the top-level render call using <` + t + ">.");
2455
2455
  onClick: () => {
2456
2456
  }
2457
2457
  }, y$5 = (h) => {
2458
- const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$e, ...h }, g = (t) => {
2458
+ const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$f, ...h }, g = (t) => {
2459
2459
  n && n(t);
2460
2460
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2461
2461
  const t = "nut-icon";
@@ -2492,8 +2492,8 @@ Check the top-level render call using <` + t + ">.");
2492
2492
  }
2493
2493
  ) });
2494
2494
  };
2495
- y$5.defaultProps = a$e;
2496
- const a$d = {
2495
+ y$5.defaultProps = a$f;
2496
+ const a$e = {
2497
2497
  className: "",
2498
2498
  style: void 0,
2499
2499
  name: "Link",
@@ -2502,7 +2502,7 @@ Check the top-level render call using <` + t + ">.");
2502
2502
  onClick: () => {
2503
2503
  }
2504
2504
  }, x$6 = (h) => {
2505
- const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$d, ...h }, g = (t) => {
2505
+ const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$e, ...h }, g = (t) => {
2506
2506
  n && n(t);
2507
2507
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
2508
2508
  const t = "nut-icon";
@@ -2539,8 +2539,8 @@ Check the top-level render call using <` + t + ">.");
2539
2539
  }
2540
2540
  ) });
2541
2541
  };
2542
- x$6.defaultProps = a$d;
2543
- const a$c = {
2542
+ x$6.defaultProps = a$e;
2543
+ const a$d = {
2544
2544
  className: "",
2545
2545
  style: void 0,
2546
2546
  name: "Loading",
@@ -2548,8 +2548,8 @@ Check the top-level render call using <` + t + ">.");
2548
2548
  height: "",
2549
2549
  onClick: () => {
2550
2550
  }
2551
- }, k$2 = (h) => {
2552
- const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$c, ...h }, f = (c) => {
2551
+ }, k$3 = (h) => {
2552
+ const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$d, ...h }, f = (c) => {
2553
2553
  o && o(c);
2554
2554
  }, n = (c) => c === "" ? "" : isNaN(Number(c)) ? String(c) : c + "px", z = () => {
2555
2555
  const c = "nut-icon";
@@ -2586,8 +2586,8 @@ Check the top-level render call using <` + t + ">.");
2586
2586
  }
2587
2587
  ) });
2588
2588
  };
2589
- k$2.defaultProps = a$c;
2590
- const a$b = {
2589
+ k$3.defaultProps = a$d;
2590
+ const a$c = {
2591
2591
  className: "",
2592
2592
  style: void 0,
2593
2593
  name: "Location2",
@@ -2596,7 +2596,7 @@ Check the top-level render call using <` + t + ">.");
2596
2596
  onClick: () => {
2597
2597
  }
2598
2598
  }, x$5 = (h) => {
2599
- const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$b, ...h }, g = (t) => {
2599
+ const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$c, ...h }, g = (t) => {
2600
2600
  n && n(t);
2601
2601
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
2602
2602
  const t = "nut-icon";
@@ -2633,8 +2633,8 @@ Check the top-level render call using <` + t + ">.");
2633
2633
  }
2634
2634
  ) });
2635
2635
  };
2636
- x$5.defaultProps = a$b;
2637
- const a$a = {
2636
+ x$5.defaultProps = a$c;
2637
+ const a$b = {
2638
2638
  className: "",
2639
2639
  style: void 0,
2640
2640
  name: "MaskClose",
@@ -2643,7 +2643,7 @@ Check the top-level render call using <` + t + ">.");
2643
2643
  onClick: () => {
2644
2644
  }
2645
2645
  }, x$4 = (h) => {
2646
- const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$a, ...h }, g = (t) => {
2646
+ const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$b, ...h }, g = (t) => {
2647
2647
  l2 && l2(t);
2648
2648
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
2649
2649
  const t = "nut-icon";
@@ -2680,8 +2680,8 @@ Check the top-level render call using <` + t + ">.");
2680
2680
  }
2681
2681
  ) });
2682
2682
  };
2683
- x$4.defaultProps = a$a;
2684
- const a$9 = {
2683
+ x$4.defaultProps = a$b;
2684
+ const a$a = {
2685
2685
  className: "",
2686
2686
  style: void 0,
2687
2687
  name: "Minus",
@@ -2690,7 +2690,7 @@ Check the top-level render call using <` + t + ">.");
2690
2690
  onClick: () => {
2691
2691
  }
2692
2692
  }, y$4 = (h) => {
2693
- const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$9, ...h }, u = (t) => {
2693
+ const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$a, ...h }, u = (t) => {
2694
2694
  o && o(t);
2695
2695
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2696
2696
  const t = "nut-icon";
@@ -2727,7 +2727,54 @@ Check the top-level render call using <` + t + ">.");
2727
2727
  }
2728
2728
  ) });
2729
2729
  };
2730
- y$4.defaultProps = a$9;
2730
+ y$4.defaultProps = a$a;
2731
+ const a$9 = {
2732
+ className: "",
2733
+ style: void 0,
2734
+ name: "My",
2735
+ width: "",
2736
+ height: "",
2737
+ onClick: () => {
2738
+ }
2739
+ }, k$2 = (h) => {
2740
+ const { className: o, style: d, name: s, color: m, width: p, height: f, onClick: r } = { ...a$9, ...h }, g = (t) => {
2741
+ r && r(t);
2742
+ }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2743
+ const t = "nut-icon";
2744
+ return classNames({
2745
+ [`${o}`]: o,
2746
+ [t]: true,
2747
+ [t + "-" + s]: s
2748
+ });
2749
+ }, e = {}, i = n(p || ""), l2 = n(f || "");
2750
+ i && (e.width = i), l2 && (e.height = l2);
2751
+ const y2 = () => ({
2752
+ ...d,
2753
+ ...e
2754
+ });
2755
+ return /* @__PURE__ */ cr(lr, { children: /* @__PURE__ */ cr(
2756
+ "svg",
2757
+ {
2758
+ className: u(),
2759
+ style: y2(),
2760
+ onClick: g,
2761
+ xmlns: "http://www.w3.org/2000/svg",
2762
+ color: m,
2763
+ viewBox: "0 0 1024 1024",
2764
+ "aria-labelledby": s,
2765
+ role: "presentation",
2766
+ children: /* @__PURE__ */ cr(
2767
+ "path",
2768
+ {
2769
+ d: "M512 813.949c-225.805 0-406.974-183.795-406.974-406.975S286.195 0 512 0s406.974 181.17 406.974 406.974S735.18 813.95 512 813.95zm0-735.18c-181.17 0-328.205 147.036-328.205 328.205S330.83 735.18 512 735.18s328.205-147.035 328.205-328.205S693.17 78.77 512 78.77zm202.174 939.98c-21.005 0-39.384-18.38-39.384-39.385 0-89.272-73.518-162.79-162.79-162.79-89.272 0-162.79 73.518-162.79 162.79 0 21.005-18.38 39.385-39.384 39.385s-39.385-18.38-39.385-39.385c0-133.908 107.651-241.559 241.559-241.559s241.559 107.651 241.559 241.56c0 21.004-15.754 39.384-39.385 39.384zM512 525.129c-39.385 0-78.77-13.129-105.026-36.76-15.753-13.128-18.38-39.384-2.625-55.138 13.128-15.754 39.384-18.38 55.138-2.626 23.63 21.005 81.395 21.005 105.026 0 15.754-13.128 42.01-13.128 55.138 5.251 13.128 15.754 13.128 42.01-5.251 55.139C590.77 512 551.385 525.128 512 525.128z",
2770
+ fill: "currentColor",
2771
+ fillOpacity: "0.9"
2772
+ }
2773
+ )
2774
+ }
2775
+ ) });
2776
+ };
2777
+ k$2.defaultProps = a$9;
2731
2778
  const a$8 = {
2732
2779
  className: "",
2733
2780
  style: void 0,
@@ -3204,7 +3251,7 @@ Check the top-level render call using <` + t + ">.");
3204
3251
  style: {}
3205
3252
  };
3206
3253
  const prefixCls = "nut-button";
3207
- const defaultProps$1r = {
3254
+ const defaultProps$1s = {
3208
3255
  ...ComponentDefaults,
3209
3256
  color: "",
3210
3257
  type: "default",
@@ -3236,7 +3283,7 @@ Check the top-level render call using <` + t + ">.");
3236
3283
  style,
3237
3284
  ...rest
3238
3285
  } = {
3239
- ...defaultProps$1r,
3286
+ ...defaultProps$1s,
3240
3287
  ...props
3241
3288
  };
3242
3289
  const getStyle = React.useCallback(() => {
@@ -3283,7 +3330,7 @@ Check the top-level render call using <` + t + ">.");
3283
3330
  style: { ...getStyle(), ...style },
3284
3331
  onClick: (e) => handleClick2(e),
3285
3332
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "nut-button__warp", children: [
3286
- loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, { className: "nut-icon-loading" }) : null,
3333
+ loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, { className: "nut-icon-loading" }) : null,
3287
3334
  !loading && icon ? icon : null,
3288
3335
  children && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: icon || loading ? "nut-button-text" : "", children })
3289
3336
  ] })
@@ -3293,7 +3340,7 @@ Check the top-level render call using <` + t + ">.");
3293
3340
  }
3294
3341
  );
3295
3342
  Button.displayName = "NutButton";
3296
- const defaultProps$1q = {
3343
+ const defaultProps$1r = {
3297
3344
  ...ComponentDefaults,
3298
3345
  title: null,
3299
3346
  description: null,
@@ -3303,7 +3350,7 @@ Check the top-level render call using <` + t + ">.");
3303
3350
  onClick: (event) => {
3304
3351
  }
3305
3352
  };
3306
- const classPrefix$a = "nut-cell";
3353
+ const classPrefix$g = "nut-cell";
3307
3354
  const Cell = (props) => {
3308
3355
  const {
3309
3356
  children,
@@ -3317,7 +3364,7 @@ Check the top-level render call using <` + t + ">.");
3317
3364
  style,
3318
3365
  ...rest
3319
3366
  } = {
3320
- ...defaultProps$1q,
3367
+ ...defaultProps$1r,
3321
3368
  ...props
3322
3369
  };
3323
3370
  const handleClick2 = (event) => {
@@ -3334,48 +3381,55 @@ Check the top-level render call using <` + t + ">.");
3334
3381
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3335
3382
  "div",
3336
3383
  {
3337
- className: classNames(classPrefix$a, className),
3384
+ className: classNames(classPrefix$g, className),
3338
3385
  onClick: (event) => handleClick2(event),
3339
3386
  style: baseStyle,
3340
3387
  ...rest,
3341
3388
  children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3342
- title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$a}__left`, children: [
3343
- title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__title`, children: title }) : null,
3344
- description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__description`, children: description }) : null
3389
+ title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$g}__left`, children: [
3390
+ title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$g}__title`, children: title }) : null,
3391
+ description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$g}__description`, children: description }) : null
3345
3392
  ] }) : null,
3346
3393
  extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
3347
3394
  "div",
3348
3395
  {
3349
- className: `${classPrefix$a}__extra`,
3396
+ className: `${classPrefix$g}__extra`,
3350
3397
  style: styles,
3351
3398
  children: extra
3352
3399
  }
3353
3400
  ) : null,
3354
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__divider` })
3401
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$g}__divider` })
3355
3402
  ] })
3356
3403
  }
3357
3404
  );
3358
3405
  };
3359
- Cell.defaultProps = defaultProps$1q;
3406
+ Cell.defaultProps = defaultProps$1r;
3360
3407
  Cell.displayName = "NutCell";
3361
- const defaultProps$1p = {
3408
+ const defaultProps$1q = {
3362
3409
  ...ComponentDefaults,
3363
3410
  title: "",
3364
- description: ""
3411
+ description: "",
3412
+ divider: true
3365
3413
  };
3366
- const classPrefix$9 = "nut-cell-group";
3414
+ const classPrefix$f = "nut-cell-group";
3367
3415
  const CellGroup = (props) => {
3368
- const { children, className, style, title, description, ...rest } = {
3369
- ...defaultProps$1p,
3416
+ const { children, className, style, title, description, divider, ...rest } = {
3417
+ ...defaultProps$1q,
3370
3418
  ...props
3371
3419
  };
3372
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$9, className), ...rest, children: [
3373
- title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__title`, children: title }) : null,
3374
- description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__description`, children: description }) : null,
3375
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__wrap`, children })
3420
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$f, className), ...rest, children: [
3421
+ title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$f}__title`, children: title }) : null,
3422
+ description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$f}__description`, children: description }) : null,
3423
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
3424
+ "div",
3425
+ {
3426
+ className: `${classPrefix$f}__wrap ${divider ? `${classPrefix$f}__wrap--divider` : ""}`,
3427
+ children
3428
+ }
3429
+ )
3376
3430
  ] });
3377
3431
  };
3378
- CellGroup.defaultProps = defaultProps$1p;
3432
+ CellGroup.defaultProps = defaultProps$1q;
3379
3433
  CellGroup.displayName = "NutCellGroup";
3380
3434
  var INFINITY = 1 / 0;
3381
3435
  var symbolTag = "[object Symbol]";
@@ -3790,7 +3844,7 @@ Check the top-level render call using <` + t + ">.");
3790
3844
  errorCanvasTips: "当前环境不支持Canvas"
3791
3845
  }
3792
3846
  };
3793
- const defaultProps$1o = {
3847
+ const defaultProps$1p = {
3794
3848
  locale: zhCN
3795
3849
  };
3796
3850
  const defaultConfigRef = {
@@ -3813,7 +3867,7 @@ Check the top-level render call using <` + t + ">.");
3813
3867
  return cssVars;
3814
3868
  }
3815
3869
  const ConfigProvider = (props) => {
3816
- const { children, ...config2 } = { ...defaultProps$1o, ...props };
3870
+ const { children, ...config2 } = { ...defaultProps$1p, ...props };
3817
3871
  const parentConfig = useConfig();
3818
3872
  const theme = config2.theme || {};
3819
3873
  const style = React.useMemo(
@@ -3831,12 +3885,12 @@ Check the top-level render call using <` + t + ">.");
3831
3885
  }
3832
3886
  );
3833
3887
  };
3834
- ConfigProvider.defaultProps = defaultProps$1o;
3888
+ ConfigProvider.defaultProps = defaultProps$1p;
3835
3889
  ConfigProvider.displayName = "NutConfigProvider";
3836
3890
  const pxCheck = (value) => {
3837
3891
  return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
3838
3892
  };
3839
- const defaultProps$1n = {
3893
+ const defaultProps$1o = {
3840
3894
  ...ComponentDefaults,
3841
3895
  fit: "fill",
3842
3896
  position: "center",
@@ -3847,7 +3901,7 @@ Check the top-level render call using <` + t + ">.");
3847
3901
  loading: true,
3848
3902
  lazy: false
3849
3903
  };
3850
- const classPrefix$8 = "nut-image";
3904
+ const classPrefix$e = "nut-image";
3851
3905
  const Image$1 = (props) => {
3852
3906
  const {
3853
3907
  className,
@@ -3865,21 +3919,19 @@ Check the top-level render call using <` + t + ">.");
3865
3919
  onClick,
3866
3920
  onLoad,
3867
3921
  onError
3868
- } = { ...defaultProps$1n, ...props };
3922
+ } = { ...defaultProps$1o, ...props };
3869
3923
  const [innerLoading, setInnerLoading] = React.useState(true);
3870
3924
  const [isError, setIsError] = React.useState(false);
3871
- const [_src, setSrc] = React.useState("");
3872
3925
  const imgRef = React.useRef(null);
3873
3926
  React.useEffect(() => {
3874
3927
  if (imgRef.current && imgRef.current.complete && imgRef.current.naturalHeight !== 0) {
3875
3928
  setInnerLoading(false);
3876
3929
  } else if (src) {
3877
- setSrc(src);
3878
- setIsError(false);
3879
3930
  setInnerLoading(true);
3880
3931
  }
3881
3932
  }, [src]);
3882
3933
  const handleLoad = () => {
3934
+ setIsError(false);
3883
3935
  setInnerLoading(false);
3884
3936
  onLoad && onLoad();
3885
3937
  };
@@ -3942,7 +3994,7 @@ Check the top-level render call using <` + t + ">.");
3942
3994
  if (!isError)
3943
3995
  return null;
3944
3996
  if (typeof error === "boolean" && error === true && !innerLoading) {
3945
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-error", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$4, {}) });
3997
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-error", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$5, {}) });
3946
3998
  }
3947
3999
  if (React.isValidElement(error) && !innerLoading) {
3948
4000
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-error", children: error });
@@ -3953,7 +4005,7 @@ Check the top-level render call using <` + t + ">.");
3953
4005
  if (!loading)
3954
4006
  return null;
3955
4007
  if (typeof loading === "boolean" && loading === true && innerLoading) {
3956
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-loading", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, {}) });
4008
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-loading", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$4, {}) });
3957
4009
  }
3958
4010
  if (React.isValidElement(loading) && innerLoading) {
3959
4011
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-loading", children: loading });
@@ -3963,7 +4015,7 @@ Check the top-level render call using <` + t + ">.");
3963
4015
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
3964
4016
  "div",
3965
4017
  {
3966
- className: classNames(classPrefix$8, className),
4018
+ className: classNames(classPrefix$e, className),
3967
4019
  style: containerStyle,
3968
4020
  onClick: (e) => {
3969
4021
  imageClick(e);
@@ -3975,7 +4027,7 @@ Check the top-level render call using <` + t + ">.");
3975
4027
  ref: imgRef,
3976
4028
  className: "nut-img lazyload",
3977
4029
  style: imgStyle,
3978
- "data-src": _src,
4030
+ "data-src": src,
3979
4031
  alt,
3980
4032
  loading: "lazy",
3981
4033
  onLoad: handleLoad,
@@ -3987,7 +4039,7 @@ Check the top-level render call using <` + t + ">.");
3987
4039
  ref: imgRef,
3988
4040
  className: "nut-img",
3989
4041
  style: imgStyle,
3990
- src: _src,
4042
+ src,
3991
4043
  alt,
3992
4044
  onLoad: handleLoad,
3993
4045
  onError: handleError
@@ -3999,7 +4051,7 @@ Check the top-level render call using <` + t + ">.");
3999
4051
  }
4000
4052
  );
4001
4053
  };
4002
- Image$1.defaultProps = defaultProps$1n;
4054
+ Image$1.defaultProps = defaultProps$1o;
4003
4055
  Image$1.displayName = "NutImage";
4004
4056
  const defaultOverlayProps = {
4005
4057
  ...ComponentDefaults,
@@ -4084,7 +4136,7 @@ Check the top-level render call using <` + t + ">.");
4084
4136
  Overlay.defaultProps = defaultOverlayProps;
4085
4137
  Overlay.displayName = "NutOverlay";
4086
4138
  const DataContext$2 = React.createContext({});
4087
- const defaultProps$1m = {
4139
+ const defaultProps$1n = {
4088
4140
  ...ComponentDefaults,
4089
4141
  span: "24",
4090
4142
  offset: "0",
@@ -4092,7 +4144,7 @@ Check the top-level render call using <` + t + ">.");
4092
4144
  };
4093
4145
  const Col = (props) => {
4094
4146
  const { className, style, span, offset, children, onClick } = {
4095
- ...defaultProps$1m,
4147
+ ...defaultProps$1n,
4096
4148
  ...props
4097
4149
  };
4098
4150
  const [colName, setColName] = React.useState("");
@@ -4124,39 +4176,39 @@ Check the top-level render call using <` + t + ">.");
4124
4176
  }
4125
4177
  );
4126
4178
  };
4127
- Col.defaultProps = defaultProps$1m;
4179
+ Col.defaultProps = defaultProps$1n;
4128
4180
  Col.displayName = "NutCol";
4129
- const defaultProps$1l = {
4181
+ const defaultProps$1m = {
4130
4182
  ...ComponentDefaults,
4131
4183
  contentPosition: "center",
4132
4184
  direction: "horizontal"
4133
4185
  };
4134
- const classPrefix$7 = `nut-divider`;
4186
+ const classPrefix$d = `nut-divider`;
4135
4187
  const Divider = (props) => {
4136
4188
  const { children, contentPosition, style, className, direction, ...rest } = {
4137
- ...defaultProps$1l,
4189
+ ...defaultProps$1m,
4138
4190
  ...props
4139
4191
  };
4140
4192
  const classes = direction === "horizontal" ? classNames({
4141
- [`${classPrefix$7}`]: true,
4142
- [`${classPrefix$7}__center`]: children,
4143
- [`${classPrefix$7}__left`]: contentPosition === "left",
4144
- [`${classPrefix$7}__right`]: contentPosition === "right",
4145
- [`${classPrefix$7}__hairline`]: true
4193
+ [`${classPrefix$d}`]: true,
4194
+ [`${classPrefix$d}__center`]: children,
4195
+ [`${classPrefix$d}__left`]: contentPosition === "left",
4196
+ [`${classPrefix$d}__right`]: contentPosition === "right",
4197
+ [`${classPrefix$d}__hairline`]: true
4146
4198
  }) : classNames({
4147
- [`${classPrefix$7}`]: true,
4148
- [`${classPrefix$7}__vertical`]: direction === "vertical"
4199
+ [`${classPrefix$d}`]: true,
4200
+ [`${classPrefix$d}__vertical`]: direction === "vertical"
4149
4201
  });
4150
4202
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
4151
4203
  };
4152
- Divider.defaultProps = defaultProps$1l;
4204
+ Divider.defaultProps = defaultProps$1m;
4153
4205
  Divider.displayName = "NutDivider";
4154
4206
  const gridContext = {
4155
4207
  onClick: (item, index) => {
4156
4208
  }
4157
4209
  };
4158
4210
  const GridContext = React.createContext(gridContext);
4159
- const defaultProps$1k = {
4211
+ const defaultProps$1l = {
4160
4212
  text: "",
4161
4213
  columns: 4,
4162
4214
  gap: 0,
@@ -4182,7 +4234,7 @@ Check the top-level render call using <` + t + ">.");
4182
4234
  onClick,
4183
4235
  ...rest
4184
4236
  } = {
4185
- ...defaultProps$1k,
4237
+ ...defaultProps$1l,
4186
4238
  ...props
4187
4239
  };
4188
4240
  const classPrefix2 = "nut-grid-item";
@@ -4243,9 +4295,9 @@ Check the top-level render call using <` + t + ">.");
4243
4295
  }
4244
4296
  );
4245
4297
  };
4246
- GridItem.defaultProps = defaultProps$1k;
4298
+ GridItem.defaultProps = defaultProps$1l;
4247
4299
  GridItem.displayName = "NutGridItem";
4248
- const defaultProps$1j = {
4300
+ const defaultProps$1k = {
4249
4301
  columns: 4,
4250
4302
  gap: 0,
4251
4303
  center: true,
@@ -4266,7 +4318,7 @@ Check the top-level render call using <` + t + ">.");
4266
4318
  className,
4267
4319
  onClick,
4268
4320
  ...rest
4269
- } = { ...defaultProps$1j, ...props };
4321
+ } = { ...defaultProps$1k, ...props };
4270
4322
  const childrenDom = React.Children.toArray(children);
4271
4323
  const classPrefix2 = "nut-grid";
4272
4324
  const rootClass = () => {
@@ -4296,18 +4348,18 @@ Check the top-level render call using <` + t + ">.");
4296
4348
  });
4297
4349
  }) }) });
4298
4350
  };
4299
- Grid.defaultProps = defaultProps$1j;
4351
+ Grid.defaultProps = defaultProps$1k;
4300
4352
  Grid.displayName = "NutGrid";
4301
4353
  Grid.Item = GridItem;
4302
- const defaultProps$1i = {};
4354
+ const defaultProps$1j = {};
4303
4355
  const Layout = (props) => {
4304
- ({ ...defaultProps$1i, ...props });
4356
+ ({ ...defaultProps$1j, ...props });
4305
4357
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-layout", children: "Layout" });
4306
4358
  };
4307
- Layout.defaultProps = defaultProps$1i;
4359
+ Layout.defaultProps = defaultProps$1j;
4308
4360
  Layout.displayName = "NutLayout";
4309
- const classPrefix$6 = "nut-row";
4310
- const defaultProps$1h = {
4361
+ const classPrefix$c = "nut-row";
4362
+ const defaultProps$1i = {
4311
4363
  ...ComponentDefaults,
4312
4364
  type: "",
4313
4365
  justify: "start",
@@ -4327,7 +4379,7 @@ Check the top-level render call using <` + t + ">.");
4327
4379
  gutter,
4328
4380
  onClick
4329
4381
  } = {
4330
- ...defaultProps$1h,
4382
+ ...defaultProps$1i,
4331
4383
  ...props
4332
4384
  };
4333
4385
  const getClass = (prefix2, type22) => {
@@ -4341,7 +4393,7 @@ Check the top-level render call using <` + t + ">.");
4341
4393
  ${getClass("justify", justify)}
4342
4394
  ${getClass("align", align)}
4343
4395
  ${getClass("flex", wrap)}
4344
- ${classPrefix$6}
4396
+ ${classPrefix$c}
4345
4397
  `;
4346
4398
  };
4347
4399
  const parentRow = {
@@ -4359,7 +4411,7 @@ Check the top-level render call using <` + t + ">.");
4359
4411
  children
4360
4412
  ) });
4361
4413
  };
4362
- Row.defaultProps = defaultProps$1h;
4414
+ Row.defaultProps = defaultProps$1i;
4363
4415
  Row.displayName = "NutRow";
4364
4416
  const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
4365
4417
  const defaultRoot = canUseDom ? window : void 0;
@@ -4434,13 +4486,13 @@ Check the top-level render call using <` + t + ">.");
4434
4486
  stop2.current = true;
4435
4487
  };
4436
4488
  }
4437
- const defaultProps$1g = {
4489
+ const defaultProps$1h = {
4438
4490
  ...ComponentDefaults,
4439
4491
  position: "top",
4440
4492
  threshold: 0,
4441
4493
  zIndex: 2e3
4442
4494
  };
4443
- const classPrefix$5 = "nut-sticky";
4495
+ const classPrefix$b = "nut-sticky";
4444
4496
  const Sticky = (props) => {
4445
4497
  const {
4446
4498
  position,
@@ -4452,7 +4504,7 @@ Check the top-level render call using <` + t + ">.");
4452
4504
  threshold,
4453
4505
  onChange,
4454
4506
  ...rest
4455
- } = { ...defaultProps$1g, ...props };
4507
+ } = { ...defaultProps$1h, ...props };
4456
4508
  const stickyRef = React.useRef(null);
4457
4509
  const rootRef = React.useRef(null);
4458
4510
  const [isFixed, setIsFixed] = React.useState(false);
@@ -4562,15 +4614,15 @@ Check the top-level render call using <` + t + ">.");
4562
4614
  {
4563
4615
  ref: rootRef,
4564
4616
  style: { ...style, ...rootStyle },
4565
- className: classNames(classPrefix$5, className),
4617
+ className: classNames(classPrefix$b, className),
4566
4618
  ...rest,
4567
4619
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle, children })
4568
4620
  }
4569
4621
  );
4570
4622
  };
4571
- Sticky.defaultProps = defaultProps$1g;
4623
+ Sticky.defaultProps = defaultProps$1h;
4572
4624
  Sticky.displayName = "NutSticky";
4573
- const defaultProps$1f = {
4625
+ const defaultProps$1g = {
4574
4626
  ...ComponentDefaults,
4575
4627
  target: "",
4576
4628
  threshold: 200,
@@ -4588,7 +4640,7 @@ Check the top-level render call using <` + t + ">.");
4588
4640
  style,
4589
4641
  onClick
4590
4642
  } = {
4591
- ...defaultProps$1f,
4643
+ ...defaultProps$1g,
4592
4644
  ...props
4593
4645
  };
4594
4646
  const classPrefix2 = "nut-backtop";
@@ -4686,7 +4738,7 @@ Check the top-level render call using <` + t + ">.");
4686
4738
  }
4687
4739
  );
4688
4740
  };
4689
- BackTop.defaultProps = defaultProps$1f;
4741
+ BackTop.defaultProps = defaultProps$1g;
4690
4742
  BackTop.displayName = "NutBackTop";
4691
4743
  function clamp$1(v, min, max) {
4692
4744
  return Math.max(min, Math.min(v, max));
@@ -9804,7 +9856,7 @@ Please add \`${key}Action\` when creating your handler.`);
9804
9856
  });
9805
9857
  const animated = host.animated;
9806
9858
  const elevatorContext = React.createContext({});
9807
- const defaultProps$1e = {
9859
+ const defaultProps$1f = {
9808
9860
  ...ComponentDefaults,
9809
9861
  height: "200px",
9810
9862
  floorKey: "title",
@@ -9828,7 +9880,7 @@ Please add \`${key}Action\` when creating your handler.`);
9828
9880
  children,
9829
9881
  ...rest
9830
9882
  } = {
9831
- ...defaultProps$1e,
9883
+ ...defaultProps$1f,
9832
9884
  ...props
9833
9885
  };
9834
9886
  const classPrefix2 = "nut-elevator";
@@ -10011,10 +10063,10 @@ Please add \`${key}Action\` when creating your handler.`);
10011
10063
  ) })
10012
10064
  ] });
10013
10065
  };
10014
- Elevator.defaultProps = defaultProps$1e;
10066
+ Elevator.defaultProps = defaultProps$1f;
10015
10067
  Elevator.displayName = "NutElevator";
10016
10068
  Elevator.Context = elevatorContext;
10017
- const defaultProps$1d = {
10069
+ const defaultProps$1e = {
10018
10070
  ...ComponentDefaults,
10019
10071
  activeText: "",
10020
10072
  inactiveText: "",
@@ -10042,7 +10094,7 @@ Please add \`${key}Action\` when creating your handler.`);
10042
10094
  content,
10043
10095
  ...rest
10044
10096
  } = {
10045
- ...defaultProps$1d,
10097
+ ...defaultProps$1e,
10046
10098
  ...props
10047
10099
  };
10048
10100
  const classPrefix2 = "nut-fixednav";
@@ -10101,9 +10153,9 @@ Please add \`${key}Action\` when creating your handler.`);
10101
10153
  }
10102
10154
  );
10103
10155
  };
10104
- FixedNav.defaultProps = defaultProps$1d;
10156
+ FixedNav.defaultProps = defaultProps$1e;
10105
10157
  FixedNav.displayName = "NutFixedNav";
10106
- const defaultProps$1c = {
10158
+ const defaultProps$1d = {
10107
10159
  ...ComponentDefaults,
10108
10160
  left: "",
10109
10161
  right: "",
@@ -10126,7 +10178,7 @@ Please add \`${key}Action\` when creating your handler.`);
10126
10178
  zIndex,
10127
10179
  onClickBack
10128
10180
  } = {
10129
- ...defaultProps$1c,
10181
+ ...defaultProps$1d,
10130
10182
  ...props
10131
10183
  };
10132
10184
  const classPrefix2 = "nut-navbar";
@@ -10170,7 +10222,7 @@ Please add \`${key}Action\` when creating your handler.`);
10170
10222
  const cls = classNames(classPrefix2, classes, className);
10171
10223
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: fixed && placeholder ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}--placeholder`, children: renderWrapper() }) : renderWrapper() });
10172
10224
  };
10173
- NavBar.defaultProps = defaultProps$1c;
10225
+ NavBar.defaultProps = defaultProps$1d;
10174
10226
  NavBar.displayName = "NutNavBar";
10175
10227
  function _extends$1() {
10176
10228
  _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
@@ -11913,7 +11965,7 @@ Please add \`${key}Action\` when creating your handler.`);
11913
11965
  onExited: propTypesExports.func
11914
11966
  }) : {};
11915
11967
  const CSSTransition$1 = CSSTransition;
11916
- const defaultProps$1b = {
11968
+ const defaultProps$1c = {
11917
11969
  ...ComponentDefaults,
11918
11970
  position: "center",
11919
11971
  transition: "",
@@ -12092,7 +12144,7 @@ Please add \`${key}Action\` when creating your handler.`);
12092
12144
  }, [position, transition]);
12093
12145
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderToContainer(portal, renderNode()) });
12094
12146
  };
12095
- Popup.defaultProps = defaultProps$1b;
12147
+ Popup.defaultProps = defaultProps$1c;
12096
12148
  Popup.displayName = "NutPopup";
12097
12149
  const handleClick = (e) => {
12098
12150
  e.stopPropagation();
@@ -12108,7 +12160,7 @@ Please add \`${key}Action\` when creating your handler.`);
12108
12160
  }
12109
12161
  };
12110
12162
  const OffsetContext = React.createContext(20);
12111
- const defaultProps$1a = {
12163
+ const defaultProps$1b = {
12112
12164
  showhead: false,
12113
12165
  position: "left",
12114
12166
  width: "80%"
@@ -12125,7 +12177,7 @@ Please add \`${key}Action\` when creating your handler.`);
12125
12177
  onClose,
12126
12178
  ...rest
12127
12179
  } = {
12128
- ...defaultProps$1a,
12180
+ ...defaultProps$1b,
12129
12181
  ...props
12130
12182
  };
12131
12183
  const offset = props.offset ? Number(props.offset) : 20;
@@ -12161,7 +12213,7 @@ Please add \`${key}Action\` when creating your handler.`);
12161
12213
  }
12162
12214
  );
12163
12215
  };
12164
- SideNavBar.defaultProps = defaultProps$1a;
12216
+ SideNavBar.defaultProps = defaultProps$1b;
12165
12217
  SideNavBar.displayName = "NutSideNavBar";
12166
12218
  const SideNavBarItem = (props) => {
12167
12219
  const { title, key, children, onClick, ...rest } = props;
@@ -12179,12 +12231,12 @@ Please add \`${key}Action\` when creating your handler.`);
12179
12231
  }
12180
12232
  );
12181
12233
  };
12182
- const defaultProps$19 = {
12234
+ const defaultProps$1a = {
12183
12235
  open: true
12184
12236
  };
12185
12237
  const SubSideNavBar = (props) => {
12186
12238
  const { title, key, children, onClick, open, ...rest } = {
12187
- ...defaultProps$19,
12239
+ ...defaultProps$1a,
12188
12240
  ...props
12189
12241
  };
12190
12242
  const offset = React.useContext(OffsetContext);
@@ -12258,7 +12310,7 @@ Please add \`${key}Action\` when creating your handler.`);
12258
12310
  }
12259
12311
  return [uncontrolled, handleUncontrolledChange];
12260
12312
  }
12261
- const defaultProps$18 = {
12313
+ const defaultProps$19 = {
12262
12314
  ...ComponentDefaults,
12263
12315
  value: "",
12264
12316
  dot: false,
@@ -12269,7 +12321,7 @@ Please add \`${key}Action\` when creating your handler.`);
12269
12321
  };
12270
12322
  const Badge = (props) => {
12271
12323
  const { className, style, value, max, children, dot, top, right, color } = {
12272
- ...defaultProps$18,
12324
+ ...defaultProps$19,
12273
12325
  ...props
12274
12326
  };
12275
12327
  const classPrefix2 = "nut-badge";
@@ -12300,9 +12352,9 @@ Please add \`${key}Action\` when creating your handler.`);
12300
12352
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
12301
12353
  ] });
12302
12354
  };
12303
- Badge.defaultProps = defaultProps$18;
12355
+ Badge.defaultProps = defaultProps$19;
12304
12356
  Badge.displayName = "NutBadge";
12305
- const defaultProps$17 = {
12357
+ const defaultProps$18 = {
12306
12358
  ...ComponentDefaults,
12307
12359
  title: "",
12308
12360
  icon: null,
@@ -12324,7 +12376,7 @@ Please add \`${key}Action\` when creating your handler.`);
12324
12376
  handleClick: handleClick2,
12325
12377
  ...rest
12326
12378
  } = {
12327
- ...defaultProps$17,
12379
+ ...defaultProps$18,
12328
12380
  ...props
12329
12381
  };
12330
12382
  const classPrefix2 = "nut-tabbar-item";
@@ -12351,7 +12403,7 @@ Please add \`${key}Action\` when creating your handler.`);
12351
12403
  }
12352
12404
  );
12353
12405
  };
12354
- const defaultProps$16 = {
12406
+ const defaultProps$17 = {
12355
12407
  ...ComponentDefaults,
12356
12408
  defaultValue: 0,
12357
12409
  fixed: false,
@@ -12374,7 +12426,7 @@ Please add \`${key}Action\` when creating your handler.`);
12374
12426
  style,
12375
12427
  onSwitch
12376
12428
  } = {
12377
- ...defaultProps$16,
12429
+ ...defaultProps$17,
12378
12430
  ...props
12379
12431
  };
12380
12432
  const classPrefix2 = "nut-tabbar";
@@ -12411,17 +12463,17 @@ Please add \`${key}Action\` when creating your handler.`);
12411
12463
  }
12412
12464
  );
12413
12465
  };
12414
- Tabbar.defaultProps = defaultProps$16;
12466
+ Tabbar.defaultProps = defaultProps$17;
12415
12467
  Tabbar.displayName = "NutTabbar";
12416
12468
  Tabbar.Item = TabbarItem;
12417
- const defaultProps$15 = {
12469
+ const defaultProps$16 = {
12418
12470
  title: "",
12419
12471
  value: "",
12420
12472
  disabled: false
12421
12473
  };
12422
12474
  const TabPane = (props) => {
12423
12475
  const { children, autoHeightClassName, className, disabled } = {
12424
- ...defaultProps$15,
12476
+ ...defaultProps$16,
12425
12477
  ...props
12426
12478
  };
12427
12479
  const classPrefix2 = "nut-tabpane";
@@ -12448,7 +12500,7 @@ Please add \`${key}Action\` when creating your handler.`);
12448
12500
  }
12449
12501
  }
12450
12502
  const requestAniFrame$1 = requestAniFrame();
12451
- const defaultProps$14 = {
12503
+ const defaultProps$15 = {
12452
12504
  ...ComponentDefaults,
12453
12505
  tabStyle: {},
12454
12506
  activeColor: "",
@@ -12457,7 +12509,7 @@ Please add \`${key}Action\` when creating your handler.`);
12457
12509
  duration: 300,
12458
12510
  autoHeight: false
12459
12511
  };
12460
- const classPrefix$4 = "nut-tabs";
12512
+ const classPrefix$a = "nut-tabs";
12461
12513
  const Tabs = (props) => {
12462
12514
  const {
12463
12515
  activeColor,
@@ -12474,7 +12526,7 @@ Please add \`${key}Action\` when creating your handler.`);
12474
12526
  autoHeight,
12475
12527
  ...rest
12476
12528
  } = {
12477
- ...defaultProps$14,
12529
+ ...defaultProps$15,
12478
12530
  ...props
12479
12531
  };
12480
12532
  const [value, setValue] = usePropsValue({
@@ -12535,15 +12587,25 @@ Please add \`${key}Action\` when creating your handler.`);
12535
12587
  return titles2;
12536
12588
  };
12537
12589
  const titles = React.useRef(getTitles());
12590
+ React.useEffect(() => {
12591
+ titles.current = getTitles();
12592
+ let current = "";
12593
+ titles.current.forEach((title2) => {
12594
+ if (title2.value === value) {
12595
+ current = value;
12596
+ }
12597
+ });
12598
+ setValue(current);
12599
+ }, [children]);
12538
12600
  const classes = classNames(
12539
- classPrefix$4,
12540
- `${classPrefix$4}--${direction}`,
12601
+ classPrefix$a,
12602
+ `${classPrefix$a}--${direction}`,
12541
12603
  className
12542
12604
  );
12543
- const classesTitle = classNames(`${classPrefix$4}__titles`, {
12544
- [`${classPrefix$4}__titles--${activeType}`]: activeType,
12545
- [`${classPrefix$4}__titles--scrollable`]: true,
12546
- [`${classPrefix$4}__titles--${align}`]: align
12605
+ const classesTitle = classNames(`${classPrefix$a}__titles`, {
12606
+ [`${classPrefix$a}__titles--${activeType}`]: activeType,
12607
+ [`${classPrefix$a}__titles--scrollable`]: true,
12608
+ [`${classPrefix$a}__titles--${align}`]: align
12547
12609
  });
12548
12610
  const tabsActiveStyle = {
12549
12611
  color: activeType === "smile" ? activeColor : "",
@@ -12572,7 +12634,7 @@ Please add \`${key}Action\` when creating your handler.`);
12572
12634
  onClick: (e) => {
12573
12635
  tabChange(item);
12574
12636
  },
12575
- className: classNames(`${classPrefix$4}__titles-item`, {
12637
+ className: classNames(`${classPrefix$a}__titles-item`, {
12576
12638
  [`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
12577
12639
  [`nut-tabs__titles-item--disabled`]: item.disabled,
12578
12640
  [`nut-tabs__titles-item--${align}`]: align
@@ -12582,14 +12644,14 @@ Please add \`${key}Action\` when creating your handler.`);
12582
12644
  activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
12583
12645
  "div",
12584
12646
  {
12585
- className: `${classPrefix$4}__titles-item__line`,
12647
+ className: `${classPrefix$a}__titles-item__line`,
12586
12648
  style: tabsActiveStyle
12587
12649
  }
12588
12650
  ),
12589
12651
  activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
12590
12652
  "div",
12591
12653
  {
12592
- className: `${classPrefix$4}__titles-item__smile`,
12654
+ className: `${classPrefix$a}__titles-item__smile`,
12593
12655
  style: tabsActiveStyle,
12594
12656
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(x$7, { color: activeColor, width: 40, height: 20 })
12595
12657
  }
@@ -12601,7 +12663,7 @@ Please add \`${key}Action\` when creating your handler.`);
12601
12663
  {
12602
12664
  ellipsis: true
12603
12665
  },
12604
- `${classPrefix$4}__titles-item__text`
12666
+ `${classPrefix$a}__titles-item__text`
12605
12667
  ),
12606
12668
  children: item.title
12607
12669
  }
@@ -12611,7 +12673,7 @@ Please add \`${key}Action\` when creating your handler.`);
12611
12673
  item.value
12612
12674
  );
12613
12675
  }) }),
12614
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$4}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$4}__content`, style: contentStyle, children: React.Children.map(children, (child, idx) => {
12676
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__content`, style: contentStyle, children: React.Children.map(children, (child, idx) => {
12615
12677
  if (!React.isValidElement(child)) {
12616
12678
  return null;
12617
12679
  }
@@ -12629,7 +12691,7 @@ Please add \`${key}Action\` when creating your handler.`);
12629
12691
  }) }) })
12630
12692
  ] });
12631
12693
  };
12632
- Tabs.defaultProps = defaultProps$14;
12694
+ Tabs.defaultProps = defaultProps$15;
12633
12695
  Tabs.displayName = "NutTabs";
12634
12696
  Tabs.TabPane = TabPane;
12635
12697
  var classnameExports = {};
@@ -12752,7 +12814,7 @@ Please add \`${key}Action\` when creating your handler.`);
12752
12814
  }
12753
12815
  })(classname);
12754
12816
  const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
12755
- const defaultProps$13 = {
12817
+ const defaultProps$14 = {
12756
12818
  type: "custom",
12757
12819
  existAddress: [],
12758
12820
  defaultIcon: null,
@@ -12774,7 +12836,7 @@ Please add \`${key}Action\` when creating your handler.`);
12774
12836
  onClose,
12775
12837
  onSwitchModule,
12776
12838
  ...rest
12777
- } = { ...defaultProps$13, ...props };
12839
+ } = { ...defaultProps$14, ...props };
12778
12840
  const b = cn("address");
12779
12841
  const selectedExist = (item) => {
12780
12842
  const copyExistAdd = existAddress;
@@ -12816,7 +12878,7 @@ Please add \`${key}Action\` when creating your handler.`);
12816
12878
  isShowCustomAddress && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("choose-other"), onClick: onSwitch, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("choose-other-btn"), children: customAndExistTitle || locale.address.chooseAnotherAddress }) })
12817
12879
  ] });
12818
12880
  };
12819
- const defaultProps$12 = {
12881
+ const defaultProps$13 = {
12820
12882
  modelValue: [],
12821
12883
  type: "custom",
12822
12884
  province: [],
@@ -12841,7 +12903,7 @@ Please add \`${key}Action\` when creating your handler.`);
12841
12903
  onClose,
12842
12904
  ...rest
12843
12905
  } = {
12844
- ...defaultProps$12,
12906
+ ...defaultProps$13,
12845
12907
  ...props
12846
12908
  };
12847
12909
  const b = cn("address");
@@ -13010,28 +13072,28 @@ Please add \`${key}Action\` when creating your handler.`);
13010
13072
  nextAreaList(item);
13011
13073
  };
13012
13074
  React.useEffect(() => {
13013
- const { province: province2 } = { ...defaultProps$12, ...props };
13075
+ const { province: province2 } = { ...defaultProps$13, ...props };
13014
13076
  setRegionList({
13015
13077
  ...regionList,
13016
13078
  province: isCustom2() ? transformData(province2) : province2
13017
13079
  });
13018
13080
  }, [province]);
13019
13081
  React.useEffect(() => {
13020
- const { city: city2 } = { ...defaultProps$12, ...props };
13082
+ const { city: city2 } = { ...defaultProps$13, ...props };
13021
13083
  setRegionList({
13022
13084
  ...regionList,
13023
13085
  city: isCustom2() ? transformData(city2) : city2
13024
13086
  });
13025
13087
  }, [city]);
13026
13088
  React.useEffect(() => {
13027
- const { country: country2 } = { ...defaultProps$12, ...props };
13089
+ const { country: country2 } = { ...defaultProps$13, ...props };
13028
13090
  setRegionList({
13029
13091
  ...regionList,
13030
13092
  country: isCustom2() ? transformData(country2) : country2
13031
13093
  });
13032
13094
  }, [country]);
13033
13095
  React.useEffect(() => {
13034
- const { town: town2 } = { ...defaultProps$12, ...props };
13096
+ const { town: town2 } = { ...defaultProps$13, ...props };
13035
13097
  setRegionList({
13036
13098
  ...regionList,
13037
13099
  town: isCustom2() ? transformData(town2) : town2
@@ -13106,7 +13168,7 @@ Please add \`${key}Action\` when creating your handler.`);
13106
13168
  ) })
13107
13169
  ] });
13108
13170
  };
13109
- const defaultProps$11 = {
13171
+ const defaultProps$12 = {
13110
13172
  ...ComponentDefaults,
13111
13173
  modelValue: false,
13112
13174
  modelSelect: [],
@@ -13157,7 +13219,7 @@ Please add \`${key}Action\` when creating your handler.`);
13157
13219
  className,
13158
13220
  ...rest
13159
13221
  } = {
13160
- ...defaultProps$11,
13222
+ ...defaultProps$12,
13161
13223
  ...props
13162
13224
  };
13163
13225
  const b = cn("address");
@@ -13315,7 +13377,7 @@ Please add \`${key}Action\` when creating your handler.`);
13315
13377
  }
13316
13378
  ) });
13317
13379
  };
13318
- Address.defaultProps = defaultProps$11;
13380
+ Address.defaultProps = defaultProps$12;
13319
13381
  Address.displayName = "NutAddress";
13320
13382
  const Utils = {
13321
13383
  /**
@@ -13435,7 +13497,7 @@ Please add \`${key}Action\` when creating your handler.`);
13435
13497
  return false;
13436
13498
  }
13437
13499
  };
13438
- const defaultProps$10 = {
13500
+ const defaultProps$11 = {
13439
13501
  type: "one",
13440
13502
  isAutoBackFill: false,
13441
13503
  poppable: true,
@@ -13487,7 +13549,7 @@ Please add \`${key}Action\` when creating your handler.`);
13487
13549
  onUpdate,
13488
13550
  onSelected,
13489
13551
  onYearMonthChange
13490
- } = { ...defaultProps$10, ...props };
13552
+ } = { ...defaultProps$11, ...props };
13491
13553
  const weeks = locale.calendaritem.weekdays;
13492
13554
  const [yearMonthTitle, setYearMonthTitle] = React.useState("");
13493
13555
  const [monthsData, setMonthsData] = React.useState([]);
@@ -14083,9 +14145,9 @@ Please add \`${key}Action\` when creating your handler.`);
14083
14145
  poppable && !isAutoBackFill ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-calendar-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "calendar-confirm-btn", onClick: confirm2, children: confirmText || locale.confirm }) }) : ""
14084
14146
  ] }) });
14085
14147
  });
14086
- CalendarItem.defaultProps = defaultProps$10;
14148
+ CalendarItem.defaultProps = defaultProps$11;
14087
14149
  CalendarItem.displayName = "NutCalendarItem";
14088
- const defaultProps$$ = {
14150
+ const defaultProps$10 = {
14089
14151
  type: "one",
14090
14152
  isAutoBackFill: false,
14091
14153
  poppable: true,
@@ -14140,7 +14202,7 @@ Please add \`${key}Action\` when creating your handler.`);
14140
14202
  onChoose,
14141
14203
  onSelected,
14142
14204
  onYearMonthChange
14143
- } = { ...defaultProps$$, ...props };
14205
+ } = { ...defaultProps$10, ...props };
14144
14206
  const calendarRef = React.useRef(null);
14145
14207
  const close = () => {
14146
14208
  onClose && onClose();
@@ -14210,9 +14272,9 @@ Please add \`${key}Action\` when creating your handler.`);
14210
14272
  }
14211
14273
  ) : renderItem() });
14212
14274
  });
14213
- Calendar.defaultProps = defaultProps$$;
14275
+ Calendar.defaultProps = defaultProps$10;
14214
14276
  Calendar.displayName = "NutCalendar";
14215
- const defaultProps$_ = {
14277
+ const defaultProps$$ = {
14216
14278
  data: {
14217
14279
  text: "",
14218
14280
  value: "",
@@ -14223,32 +14285,37 @@ Please add \`${key}Action\` when creating your handler.`);
14223
14285
  },
14224
14286
  activeColor: "",
14225
14287
  checked: false,
14226
- checkedIcon: "checklist",
14288
+ activeIcon: "checklist",
14227
14289
  chooseItem: () => {
14228
14290
  }
14229
14291
  };
14230
14292
  const InternalCascaderItem = (props, ref) => {
14231
- const { data, checked, checkedIcon, chooseItem, activeColor } = {
14232
- ...defaultProps$_,
14293
+ const { data, checked, activeIcon, chooseItem, activeColor } = {
14294
+ ...defaultProps$$,
14233
14295
  ...props
14234
14296
  };
14235
- const b = cn("cascader-item");
14297
+ const classPrefix2 = "nut-cascader-item";
14236
14298
  const classes = classNames(
14237
14299
  {
14238
14300
  active: checked,
14239
14301
  disabled: data.disabled
14240
14302
  },
14241
- b("")
14303
+ classPrefix2
14242
14304
  );
14243
14305
  const classesTitle = classNames({
14244
- [`${b("")}__title`]: true
14306
+ [`${classPrefix2}__title`]: true
14245
14307
  });
14246
14308
  const renderIcon = () => {
14247
14309
  if (checked) {
14248
- if (React.isValidElement(checkedIcon)) {
14249
- return checkedIcon;
14310
+ if (React.isValidElement(activeIcon)) {
14311
+ return activeIcon;
14250
14312
  }
14251
- return /* @__PURE__ */ jsxRuntimeExports.jsx(x$c, { className: `${checked ? b("icon-check") : ""}` });
14313
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
14314
+ x$c,
14315
+ {
14316
+ className: `${checked ? `${classPrefix2}__icon-check` : ""}`
14317
+ }
14318
+ );
14252
14319
  }
14253
14320
  return null;
14254
14321
  };
@@ -14262,13 +14329,13 @@ Please add \`${key}Action\` when creating your handler.`);
14262
14329
  },
14263
14330
  children: [
14264
14331
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesTitle, children: data.text }),
14265
- data.loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, { color: "#969799", className: "nut-cascader-item__icon-loading" }) : renderIcon()
14332
+ data.loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, { color: "#969799", className: "nut-cascader-item__icon-loading" }) : renderIcon()
14266
14333
  ]
14267
14334
  }
14268
14335
  );
14269
14336
  };
14270
14337
  const CascaderItem = React.forwardRef(InternalCascaderItem);
14271
- CascaderItem.defaultProps = defaultProps$_;
14338
+ CascaderItem.defaultProps = defaultProps$$;
14272
14339
  CascaderItem.displayName = "NutCascaderItem";
14273
14340
  const formatTree = (tree, parent, config2) => tree.map((node) => {
14274
14341
  const {
@@ -14406,26 +14473,22 @@ Please add \`${key}Action\` when creating your handler.`);
14406
14473
  }
14407
14474
  }
14408
14475
  const Tree$1 = Tree;
14409
- const defaultProps$Z = {
14410
- className: "",
14411
- style: {},
14476
+ const defaultProps$_ = {
14477
+ ...ComponentDefaults,
14412
14478
  activeColor: "",
14413
- checkedIcon: "checklist",
14414
- tabsColor: "",
14415
- poppable: true,
14479
+ activeIcon: "checklist",
14480
+ popup: true,
14416
14481
  visible: false,
14417
14482
  options: [],
14418
14483
  value: [],
14419
14484
  title: "",
14420
- textKey: "text",
14421
- valueKey: "value",
14422
- childrenKey: "children",
14423
- convertConfig: {},
14485
+ optionKey: { textKey: "text", valueKey: "value", childrenKey: "children" },
14486
+ format: {},
14424
14487
  closeable: false,
14425
14488
  closeIconPosition: "top-right",
14426
14489
  closeIcon: "close",
14427
14490
  lazy: false,
14428
- lazyLoad: () => {
14491
+ onLoad: () => {
14429
14492
  },
14430
14493
  onClose: () => {
14431
14494
  },
@@ -14439,28 +14502,25 @@ Please add \`${key}Action\` when creating your handler.`);
14439
14502
  const {
14440
14503
  className,
14441
14504
  style,
14442
- tabsColor,
14443
- poppable,
14505
+ popup,
14444
14506
  visible,
14445
14507
  options: options2,
14446
14508
  value,
14447
14509
  title,
14448
- textKey,
14449
- valueKey,
14450
- childrenKey,
14451
- convertConfig: convertConfig2,
14510
+ optionKey: optionKey2,
14511
+ format: format2,
14452
14512
  closeable,
14453
14513
  closeIconPosition,
14454
14514
  closeIcon,
14455
14515
  lazy,
14456
- lazyLoad,
14516
+ onLoad,
14457
14517
  onClose,
14458
14518
  onChange,
14459
14519
  onPathChange
14460
- } = { ...defaultProps$Z, ...props };
14520
+ } = { ...defaultProps$_, ...props };
14461
14521
  const [tabvalue, setTabvalue] = React.useState("c1");
14462
14522
  const [optionsData, setOptionsData] = React.useState([]);
14463
- const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
14523
+ const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
14464
14524
  const [state] = React.useState({
14465
14525
  optionsData: [],
14466
14526
  panes: [
@@ -14478,44 +14538,38 @@ Please add \`${key}Action\` when creating your handler.`);
14478
14538
  currentProcessNode: [],
14479
14539
  configs: {
14480
14540
  lazy,
14481
- lazyLoad,
14482
- valueKey,
14483
- textKey,
14484
- childrenKey,
14485
- convertConfig: convertConfig2
14541
+ onLoad,
14542
+ optionKey: optionKey2,
14543
+ format: format2
14486
14544
  },
14487
14545
  lazyLoadMap: /* @__PURE__ */ new Map()
14488
14546
  });
14489
- const b = cn("cascader");
14490
- const classes = classNames(b(""));
14547
+ const classPrefix2 = classNames(`nut-cascader`);
14491
14548
  const classesPane = classNames({
14492
- [`${b("")}-pane`]: true
14549
+ [`${classPrefix2}-pane`]: true
14493
14550
  });
14494
14551
  React.useEffect(() => {
14495
14552
  initData();
14496
- }, []);
14553
+ }, [options2]);
14497
14554
  React.useEffect(() => {
14498
14555
  if (value !== state.innerValue) {
14499
14556
  state.innerValue = value;
14500
14557
  }
14501
14558
  }, [value]);
14502
- React.useEffect(() => {
14503
- initData();
14504
- }, [options2]);
14505
14559
  const initData = async () => {
14506
14560
  state.lazyLoadMap.clear();
14507
- if (convertConfig2 && Object.keys(convertConfig2).length > 0) {
14561
+ if (format2 && Object.keys(format2).length > 0) {
14508
14562
  state.optionsData = convertListToOptions(
14509
14563
  options2,
14510
- convertConfig2
14564
+ format2
14511
14565
  );
14512
14566
  } else {
14513
14567
  state.optionsData = options2;
14514
14568
  }
14515
14569
  state.tree = new Tree$1(state.optionsData, {
14516
- value: state.configs.valueKey,
14517
- text: state.configs.textKey,
14518
- children: state.configs.childrenKey
14570
+ value: state.configs.optionKey.valueKey,
14571
+ text: state.configs.optionKey.textKey,
14572
+ children: state.configs.optionKey.childrenKey
14519
14573
  });
14520
14574
  if (isLazy() && !state.tree.nodes.length) {
14521
14575
  await invokeLazyLoad({
@@ -14581,7 +14635,7 @@ Please add \`${key}Action\` when creating your handler.`);
14581
14635
  if (!node) {
14582
14636
  return;
14583
14637
  }
14584
- if (!state.configs.lazyLoad) {
14638
+ if (!state.configs.onLoad) {
14585
14639
  node.leaf = true;
14586
14640
  return;
14587
14641
  }
@@ -14594,7 +14648,7 @@ Please add \`${key}Action\` when creating your handler.`);
14594
14648
  if (!lazyLoadPromise) {
14595
14649
  lazyLoadPromise = new Promise((resolve) => {
14596
14650
  var _a2, _b;
14597
- (_b = (_a2 = state.configs).lazyLoad) == null ? void 0 : _b.call(_a2, node, resolve);
14651
+ (_b = (_a2 = state.configs).onLoad) == null ? void 0 : _b.call(_a2, node, resolve);
14598
14652
  });
14599
14653
  state.lazyLoadMap.set(node, lazyLoadPromise);
14600
14654
  }
@@ -14641,8 +14695,8 @@ Please add \`${key}Action\` when creating your handler.`);
14641
14695
  selectedNode: null,
14642
14696
  paneKey: `c${state.tabsCursor + 1}`
14643
14697
  });
14644
- setTabvalue(`c${state.tabsCursor + 1}`);
14645
14698
  setOptionsData(state.panes);
14699
+ setTabvalue(`c${state.tabsCursor + 1}`);
14646
14700
  if (!type2) {
14647
14701
  const pathNodes = state.panes.map((item) => item.selectedNode);
14648
14702
  const optionParams = pathNodes.map((item) => item == null ? void 0 : item.value);
@@ -14662,8 +14716,8 @@ Please add \`${key}Action\` when creating your handler.`);
14662
14716
  setOptionsData(state.panes);
14663
14717
  };
14664
14718
  const renderItem = () => {
14665
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classes} ${className}`, style, children: [
14666
- poppable && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("title"), children: title }),
14719
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2} ${className}`, style, children: [
14720
+ popup && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-cascader__title", children: title }),
14667
14721
  /* @__PURE__ */ jsxRuntimeExports.jsx(
14668
14722
  Tabs,
14669
14723
  {
@@ -14678,27 +14732,21 @@ Please add \`${key}Action\` when creating your handler.`);
14678
14732
  setTabvalue(pane.paneKey);
14679
14733
  state.tabsCursor = index;
14680
14734
  },
14681
- className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
14735
+ className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "nut-tabs__titles-item--active" : ""}`,
14682
14736
  children: [
14683
14737
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "nut-tabs__titles-item__text", children: [
14684
14738
  !state.initLoading && state.panes.length && ((_a2 = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a2.text),
14685
14739
  !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "请选择",
14686
14740
  !(!state.initLoading && state.panes.length) && "Loading..."
14687
14741
  ] }),
14688
- /* @__PURE__ */ jsxRuntimeExports.jsx(
14689
- "span",
14690
- {
14691
- className: "nut-tabs__titles-item__line",
14692
- style: { background: tabsColor }
14693
- }
14694
- )
14742
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-tabs__titles-item__line" })
14695
14743
  ]
14696
14744
  },
14697
14745
  pane.paneKey
14698
14746
  );
14699
14747
  });
14700
14748
  },
14701
- children: !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { value: pane.paneKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane, children: pane.nodes && pane.nodes.map((node, index) => {
14749
+ children: !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { value: pane.paneKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane, children: pane.nodes && pane.nodes.map((node, index) => {
14702
14750
  var _a2;
14703
14751
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
14704
14752
  CascaderItem,
@@ -14710,15 +14758,14 @@ Please add \`${key}Action\` when creating your handler.`);
14710
14758
  },
14711
14759
  index
14712
14760
  );
14713
- }) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
14761
+ }) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
14714
14762
  }
14715
14763
  )
14716
14764
  ] });
14717
14765
  };
14718
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: poppable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
14766
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: popup ? /* @__PURE__ */ jsxRuntimeExports.jsx(
14719
14767
  Popup,
14720
14768
  {
14721
- className: "cascadar-popup",
14722
14769
  visible,
14723
14770
  position: "bottom",
14724
14771
  round: true,
@@ -14732,23 +14779,22 @@ Please add \`${key}Action\` when creating your handler.`);
14732
14779
  ) : renderItem() });
14733
14780
  };
14734
14781
  const Cascader = React.forwardRef(InternalCascader);
14735
- Cascader.defaultProps = defaultProps$Z;
14782
+ Cascader.defaultProps = defaultProps$_;
14736
14783
  Cascader.displayName = "NutCascader";
14737
14784
  const CheckboxGroupContext = React.createContext(null);
14738
14785
  const Context = CheckboxGroupContext;
14739
- const defaultProps$Y = {
14740
- disabled: false,
14786
+ const defaultProps$Z = {
14741
14787
  max: void 0,
14742
- textPosition: "right",
14788
+ labelPosition: "right",
14743
14789
  direction: "vertical",
14744
14790
  onChange: (value) => {
14745
14791
  },
14746
14792
  options: []
14747
14793
  };
14794
+ const classPrefix$9 = "nut-checkboxgroup";
14748
14795
  const CheckboxGroup = React.forwardRef(
14749
14796
  (props, ref) => {
14750
- const { children } = { ...defaultProps$Y, ...props };
14751
- const b = cn("checkboxgroup");
14797
+ const { children } = { ...defaultProps$Z, ...props };
14752
14798
  const {
14753
14799
  className,
14754
14800
  disabled,
@@ -14756,29 +14802,29 @@ Please add \`${key}Action\` when creating your handler.`);
14756
14802
  value,
14757
14803
  defaultValue,
14758
14804
  max,
14759
- textPosition,
14805
+ labelPosition,
14760
14806
  direction,
14761
14807
  options: options2,
14762
14808
  ...rest
14763
14809
  } = props;
14764
14810
  React.useImperativeHandle(ref, () => ({
14765
- toggleAll(state) {
14811
+ toggle(state) {
14766
14812
  if (state === false) {
14767
14813
  setValue([]);
14768
14814
  } else {
14769
14815
  const childrenLabel = [];
14770
14816
  React.Children.map(children, (child) => {
14771
14817
  const childProps = child.props;
14772
- childrenLabel.push(childProps.label || child.children);
14818
+ childrenLabel.push(childProps.value);
14773
14819
  });
14774
14820
  setValue(childrenLabel);
14775
14821
  }
14776
14822
  },
14777
- toggleReverse() {
14823
+ reverse() {
14778
14824
  const childrenLabel = [];
14779
14825
  React.Children.map(children, (child) => {
14780
14826
  const childProps = child.props;
14781
- childrenLabel.push(childProps.label || child.children);
14827
+ childrenLabel.push(childProps.value);
14782
14828
  });
14783
14829
  const reverse = childrenLabel.filter(
14784
14830
  (c) => (_value == null ? void 0 : _value.findIndex((v) => v === c)) === -1
@@ -14797,8 +14843,9 @@ Please add \`${key}Action\` when creating your handler.`);
14797
14843
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
14798
14844
  Checkbox,
14799
14845
  {
14800
- children: label,
14801
- label: value2,
14846
+ label,
14847
+ disabled: disabled2,
14848
+ value: value2,
14802
14849
  ...rest2
14803
14850
  },
14804
14851
  value2 == null ? void 0 : value2.toString()
@@ -14809,25 +14856,26 @@ Please add \`${key}Action\` when creating your handler.`);
14809
14856
  Context.Provider,
14810
14857
  {
14811
14858
  value: {
14812
- textPosition: textPosition || "left",
14859
+ labelPosition: labelPosition || "right",
14813
14860
  disabled,
14814
14861
  max,
14815
- checkedValue: _value,
14862
+ value: _value,
14816
14863
  check: (value2) => {
14817
14864
  const combined = [..._value, value2];
14818
14865
  setValue(combined);
14819
- onChange && onChange(combined);
14820
14866
  },
14821
14867
  uncheck: (value2) => {
14822
14868
  const reduced = _value.filter((item) => item !== value2);
14823
14869
  setValue(reduced);
14824
- onChange && onChange(reduced);
14825
14870
  }
14826
14871
  },
14827
14872
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
14828
14873
  "div",
14829
14874
  {
14830
- className: `${b()} nut-checkboxgroup--${props.direction} ${className || ""}`,
14875
+ className: classNames(classPrefix$9, {
14876
+ [`nut-checkboxgroup--${props.direction}`]: props.direction,
14877
+ className
14878
+ }),
14831
14879
  ...rest,
14832
14880
  children: (options2 == null ? void 0 : options2.length) ? renderOptions() : children
14833
14881
  }
@@ -14836,112 +14884,117 @@ Please add \`${key}Action\` when creating your handler.`);
14836
14884
  );
14837
14885
  }
14838
14886
  );
14839
- CheckboxGroup.defaultProps = defaultProps$Y;
14887
+ CheckboxGroup.defaultProps = defaultProps$Z;
14840
14888
  CheckboxGroup.displayName = "NutCheckboxGroup";
14841
- const defaultProps$X = {
14889
+ const defaultProps$Y = {
14842
14890
  ...ComponentDefaults,
14843
14891
  disabled: false,
14844
- textPosition: "right",
14845
- iconSize: 18,
14846
- icon: "check-normal",
14847
- checkedIcon: "checked",
14848
- iconClassPrefix: "nut-icon",
14849
- iconFontClassName: "nutui-iconfont",
14850
- indeterminateIcon: "check-disabled",
14851
- onChange: (state) => {
14892
+ labelPosition: "right",
14893
+ icon: null,
14894
+ activeIcon: null,
14895
+ indeterminateIcon: null,
14896
+ onChange: (value) => {
14852
14897
  }
14853
14898
  };
14899
+ const classPrefix$8 = "nut-checkbox";
14854
14900
  const Checkbox = (props) => {
14855
14901
  const { children } = {
14856
- ...defaultProps$X,
14902
+ ...defaultProps$Y,
14857
14903
  ...props
14858
14904
  };
14859
- const b = cn("checkbox");
14860
14905
  const {
14861
14906
  icon,
14862
- iconSize,
14863
14907
  label,
14864
14908
  className,
14865
- checkedIcon,
14909
+ activeIcon,
14866
14910
  checked,
14911
+ value,
14867
14912
  defaultChecked,
14868
14913
  disabled,
14869
14914
  onChange,
14870
14915
  indeterminate,
14871
- iconClassPrefix,
14872
- iconFontClassName,
14873
14916
  indeterminateIcon,
14874
14917
  ...others
14875
14918
  } = props;
14876
- let { textPosition, ...rest } = others;
14919
+ let { labelPosition, ...rest } = others;
14877
14920
  const ctx2 = React.useContext(Context);
14878
- let [_checked, setChecked] = usePropsValue({
14921
+ let [innerChecked, setChecked] = usePropsValue({
14879
14922
  value: props.checked,
14880
14923
  defaultValue: props.defaultChecked,
14881
14924
  finalValue: defaultChecked,
14882
14925
  onChange
14883
14926
  });
14884
14927
  let [innerDisabled, setDisabled] = React.useState(disabled);
14885
- const [_indeterminate, setIndeterminate] = React.useState(indeterminate);
14928
+ const [innerIndeterminate, setIndeterminate] = React.useState(indeterminate);
14886
14929
  React.useEffect(() => {
14887
- !ctx2 && setChecked(checked);
14888
14930
  setDisabled(disabled);
14931
+ }, [disabled]);
14932
+ React.useEffect(() => {
14889
14933
  setIndeterminate(indeterminate);
14890
- }, [disabled, indeterminate]);
14934
+ }, [indeterminate]);
14891
14935
  if (ctx2) {
14892
- if (ctx2.textPosition !== void 0) {
14893
- textPosition = ctx2.textPosition;
14936
+ if (ctx2.labelPosition !== void 0) {
14937
+ labelPosition = ctx2.labelPosition;
14894
14938
  }
14895
- innerDisabled = ctx2.disabled;
14896
- _checked = ctx2.checkedValue.includes(label);
14939
+ innerDisabled = ctx2.disabled !== void 0 ? ctx2.disabled : innerDisabled;
14940
+ innerChecked = ctx2.value.includes(value);
14897
14941
  setChecked = (checked2) => {
14898
14942
  if (ctx2.disabled)
14899
14943
  return;
14900
14944
  if (checked2)
14901
- ctx2.check(label);
14945
+ ctx2.check(value);
14902
14946
  if (!checked2)
14903
- ctx2.uncheck(label);
14947
+ ctx2.uncheck(value);
14904
14948
  };
14905
14949
  }
14906
14950
  const renderIcon = () => {
14907
- if (!_checked) {
14908
- return React.isValidElement(icon) ? icon : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { width: iconSize, height: iconSize, className: color() });
14951
+ if (!innerChecked) {
14952
+ return React.isValidElement(icon) ? icon : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { className: color() });
14909
14953
  }
14910
- if (_indeterminate) {
14911
- return React.isValidElement(indeterminateIcon) ? indeterminateIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$f, { width: iconSize, height: iconSize, className: color() });
14954
+ if (innerIndeterminate) {
14955
+ return React.isValidElement(indeterminateIcon) ? indeterminateIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$f, { className: color() });
14912
14956
  }
14913
- return React.isValidElement(checkedIcon) ? checkedIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$d, { width: iconSize, height: iconSize, className: color() });
14957
+ return React.isValidElement(activeIcon) ? activeIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$d, { className: color() });
14914
14958
  };
14915
14959
  const color = () => {
14916
14960
  if (innerDisabled) {
14917
- return "nut-checkbox__icon--disable";
14961
+ return `${classPrefix$8}__icon--disable`;
14918
14962
  }
14919
- if (_checked) {
14920
- if (_indeterminate) {
14921
- return "nut-checkbox__icon--indeterminate";
14963
+ if (innerChecked) {
14964
+ if (innerIndeterminate) {
14965
+ return `${classPrefix$8}__icon--indeterminate`;
14922
14966
  }
14923
- return "nut-checkbox__icon";
14967
+ return `${classPrefix$8}__icon`;
14924
14968
  }
14925
- return "nut-checkbox__icon--unchecked";
14969
+ return `${classPrefix$8}__icon--unchecked`;
14926
14970
  };
14927
14971
  const renderLabel = () => {
14928
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${b("label", { disabled: innerDisabled })} `, children: children || label });
14972
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
14973
+ "span",
14974
+ {
14975
+ className: classNames(`${classPrefix$8}__label `, {
14976
+ [`${classPrefix$8}__label--disabled`]: innerDisabled
14977
+ }),
14978
+ children: children || label
14979
+ }
14980
+ );
14929
14981
  };
14930
14982
  const handleClick2 = () => {
14931
14983
  if (disabled)
14932
14984
  return;
14933
- const latestChecked = !_checked;
14985
+ const latestChecked = !innerChecked;
14934
14986
  if (ctx2 && ctx2.max !== void 0) {
14935
- if (latestChecked && ctx2.checkedValue.length >= ctx2.max)
14987
+ if (latestChecked && ctx2.value.length >= ctx2.max)
14936
14988
  return;
14937
14989
  }
14938
- onChange && onChange(latestChecked, label || children);
14939
14990
  setChecked(latestChecked);
14940
14991
  };
14941
14992
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
14942
14993
  "div",
14943
14994
  {
14944
- className: `${b({ reverse: textPosition === "left" })} ${className || ""}`,
14995
+ className: classNames(classPrefix$8, className, {
14996
+ [`${classPrefix$8}--reverse`]: labelPosition === "left"
14997
+ }),
14945
14998
  ...rest,
14946
14999
  onClick: handleClick2,
14947
15000
  children: [
@@ -14951,7 +15004,7 @@ Please add \`${key}Action\` when creating your handler.`);
14951
15004
  }
14952
15005
  );
14953
15006
  };
14954
- Checkbox.defaultProps = defaultProps$X;
15007
+ Checkbox.defaultProps = defaultProps$Y;
14955
15008
  Checkbox.displayName = "NutCheckBox";
14956
15009
  Checkbox.Group = CheckboxGroup;
14957
15010
  const MIN_DISTANCE = 10;
@@ -15019,13 +15072,13 @@ Please add \`${key}Action\` when creating your handler.`);
15019
15072
  isHorizontal
15020
15073
  };
15021
15074
  }
15022
- const InternalPickerSlot = (props, ref) => {
15075
+ const InternalPickerPanel = (props, ref) => {
15023
15076
  const {
15024
15077
  keyIndex = 0,
15025
15078
  defaultValue,
15026
- listData = [],
15079
+ options: options2 = [],
15027
15080
  threeDimensional = true,
15028
- swipeDuration = 1e3,
15081
+ duration = 1e3,
15029
15082
  chooseItem
15030
15083
  } = props;
15031
15084
  const touch = useTouch();
@@ -15039,9 +15092,8 @@ Please add \`${key}Action\` when creating your handler.`);
15039
15092
  const rotation = 20;
15040
15093
  const moving = React.useRef(false);
15041
15094
  let timer;
15042
- React.useRef(null);
15043
15095
  const rollerRef = React.useRef(null);
15044
- const pickerSlotRef = React.useRef(null);
15096
+ const PickerPanelRef = React.useRef(null);
15045
15097
  const [startTime, setStartTime] = React.useState(0);
15046
15098
  const [startY, setStartY] = React.useState(0);
15047
15099
  const transformY = React.useRef(0);
@@ -15067,8 +15119,8 @@ Please add \`${key}Action\` when creating your handler.`);
15067
15119
  if (updateMove > 0) {
15068
15120
  updateMove = 0;
15069
15121
  }
15070
- if (updateMove < -(listData.length - 1) * lineSpacing) {
15071
- updateMove = -(listData.length - 1) * lineSpacing;
15122
+ if (updateMove < -(options2.length - 1) * lineSpacing) {
15123
+ updateMove = -(options2.length - 1) * lineSpacing;
15072
15124
  }
15073
15125
  const endMove = Math.round(updateMove / lineSpacing) * lineSpacing;
15074
15126
  const deg = `${(Math.abs(Math.round(endMove / lineSpacing)) + 1) * rotation}deg`;
@@ -15077,7 +15129,7 @@ Please add \`${key}Action\` when creating your handler.`);
15077
15129
  } else {
15078
15130
  let deg = 0;
15079
15131
  const currentDeg = (-updateMove / lineSpacing + 1) * rotation;
15080
- const maxDeg = (listData.length + 1) * rotation;
15132
+ const maxDeg = (options2.length + 1) * rotation;
15081
15133
  const minDeg = 0;
15082
15134
  deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
15083
15135
  if (minDeg < deg && deg < maxDeg) {
@@ -15087,7 +15139,7 @@ Please add \`${key}Action\` when creating your handler.`);
15087
15139
  }
15088
15140
  };
15089
15141
  const setChooseValue = (move) => {
15090
- chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing)], keyIndex);
15142
+ chooseItem && chooseItem(options2 == null ? void 0 : options2[Math.round(-move / lineSpacing)], keyIndex);
15091
15143
  };
15092
15144
  const touchStart = (event) => {
15093
15145
  touch.start(event);
@@ -15111,7 +15163,7 @@ Please add \`${key}Action\` when creating your handler.`);
15111
15163
  const moveTime = Date.now() - startTime;
15112
15164
  if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
15113
15165
  const distance = momentum(move, moveTime);
15114
- setMove(distance, "end", +swipeDuration);
15166
+ setMove(distance, "end", +duration);
15115
15167
  } else {
15116
15168
  setMove(move, "end");
15117
15169
  }
@@ -15119,9 +15171,9 @@ Please add \`${key}Action\` when creating your handler.`);
15119
15171
  touch.reset();
15120
15172
  }, 0);
15121
15173
  };
15122
- const momentum = (distance, duration) => {
15174
+ const momentum = (distance, duration2) => {
15123
15175
  let nDistance = distance;
15124
- const speed = Math.abs(nDistance / duration);
15176
+ const speed = Math.abs(nDistance / duration2);
15125
15177
  nDistance = speed / 3e-3 * (nDistance < 0 ? -1 : 1);
15126
15178
  return nDistance;
15127
15179
  };
@@ -15129,7 +15181,7 @@ Please add \`${key}Action\` when creating your handler.`);
15129
15181
  const value = val || defaultValue;
15130
15182
  let index = -1;
15131
15183
  if (value) {
15132
- listData.some((item, idx) => {
15184
+ options2.some((item, idx) => {
15133
15185
  if (item.value === value) {
15134
15186
  index = idx;
15135
15187
  return true;
@@ -15137,7 +15189,7 @@ Please add \`${key}Action\` when creating your handler.`);
15137
15189
  return false;
15138
15190
  });
15139
15191
  } else {
15140
- listData.forEach((item, i) => {
15192
+ options2.forEach((item, i) => {
15141
15193
  if (item.value === defaultValue) {
15142
15194
  index = i;
15143
15195
  }
@@ -15180,7 +15232,7 @@ Please add \`${key}Action\` when creating your handler.`);
15180
15232
  return () => {
15181
15233
  clearTimeout(timer);
15182
15234
  };
15183
- }, [listData]);
15235
+ }, [options2]);
15184
15236
  React.useImperativeHandle(ref, () => ({
15185
15237
  stopMomentum,
15186
15238
  moving: moving.current
@@ -15189,7 +15241,7 @@ Please add \`${key}Action\` when creating your handler.`);
15189
15241
  "div",
15190
15242
  {
15191
15243
  className: "nut-picker-list",
15192
- ref: pickerSlotRef,
15244
+ ref: PickerPanelRef,
15193
15245
  onTouchStart: touchStart,
15194
15246
  onTouchMove: touchMove,
15195
15247
  onTouchEnd: touchEnd,
@@ -15202,7 +15254,7 @@ Please add \`${key}Action\` when creating your handler.`);
15202
15254
  style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
15203
15255
  onTransitionEnd: stopMomentum,
15204
15256
  children: [
15205
- threeDimensional && listData.map((item, index) => {
15257
+ threeDimensional && options2.map((item, index) => {
15206
15258
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15207
15259
  "div",
15208
15260
  {
@@ -15215,7 +15267,7 @@ Please add \`${key}Action\` when creating your handler.`);
15215
15267
  item.value ? item.value : index
15216
15268
  );
15217
15269
  }),
15218
- !threeDimensional && listData.map((item, index) => {
15270
+ !threeDimensional && options2.map((item, index) => {
15219
15271
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15220
15272
  "div",
15221
15273
  {
@@ -15234,8 +15286,8 @@ Please add \`${key}Action\` when creating your handler.`);
15234
15286
  }
15235
15287
  );
15236
15288
  };
15237
- const PickerSlot = React.forwardRef(InternalPickerSlot);
15238
- const PickerSlot$1 = PickerSlot;
15289
+ const PickerPanel = React.forwardRef(InternalPickerPanel);
15290
+ const PickerPanel$1 = PickerPanel;
15239
15291
  function useRefs() {
15240
15292
  const refs = React.useRef([]);
15241
15293
  const setRefs = React.useCallback(
@@ -15250,180 +15302,202 @@ Please add \`${key}Action\` when creating your handler.`);
15250
15302
  }, []);
15251
15303
  return [refs.current, setRefs, reset];
15252
15304
  }
15305
+ const defaultProps$X = {
15306
+ ...ComponentDefaults,
15307
+ visible: false,
15308
+ title: "",
15309
+ options: [],
15310
+ value: [],
15311
+ defaultValue: [],
15312
+ threeDimensional: true,
15313
+ duration: 1e3
15314
+ };
15253
15315
  const InternalPicker = (props, ref) => {
15254
15316
  const { locale } = useConfig();
15255
15317
  const {
15256
15318
  visible,
15257
15319
  title,
15258
- listData = [],
15259
- defaultValueData,
15260
- onConfirm,
15261
- onClose,
15262
- onCloseUpdate,
15263
- onChange,
15320
+ options: options2 = [],
15321
+ defaultValue = [],
15264
15322
  className,
15265
15323
  style,
15266
15324
  threeDimensional,
15267
- swipeDuration,
15325
+ duration,
15326
+ onConfirm,
15327
+ onClose,
15328
+ afterClose,
15329
+ onChange,
15268
15330
  ...rest
15269
- } = props;
15270
- const [chooseValueData, setchooseValueData] = React.useState([]);
15271
- const [columnIndex, setcolumnIndex] = React.useState(0);
15331
+ } = { ...defaultProps$X, ...props };
15332
+ const classPrefix2 = "nut-picker";
15333
+ const classes = classNames(classPrefix2, className);
15334
+ const [selectedValue, setSelectedValue] = usePropsValue({
15335
+ value: props.value,
15336
+ defaultValue: [...defaultValue],
15337
+ finalValue: [...defaultValue],
15338
+ onChange: (val) => {
15339
+ var _a2;
15340
+ (_a2 = props.onConfirm) == null ? void 0 : _a2.call(props, setSelectedOptions(), val);
15341
+ }
15342
+ });
15343
+ const [columnIndex, setColumnIndex] = React.useState(0);
15272
15344
  const pickerRef = React.useRef(null);
15273
15345
  const [refs, setRefs] = useRefs();
15274
15346
  const [columnsList, setColumnsList] = React.useState([]);
15275
- const b = cn("picker");
15276
15347
  const isConfirmEvent = React.useRef(false);
15277
- React.useEffect(() => {
15278
- if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
15279
- const data = [...defaultValueData];
15280
- setchooseValueData(data);
15281
- setColumnsList(normalListData());
15348
+ const formatCascade = (columns, values) => {
15349
+ const formatted = [];
15350
+ let columnOptions = {
15351
+ text: "",
15352
+ value: "",
15353
+ children: columns
15354
+ };
15355
+ let columnIndex2 = 0;
15356
+ while (columnOptions && columnOptions.children) {
15357
+ const options22 = columnOptions.children;
15358
+ const value = values[columnIndex2];
15359
+ let index = options22.findIndex(
15360
+ (columnItem) => columnItem.value === value
15361
+ );
15362
+ if (index === -1)
15363
+ index = 0;
15364
+ columnOptions = columnOptions.children[index];
15365
+ columnIndex2++;
15366
+ formatted.push(options22);
15282
15367
  }
15283
- }, [defaultValueData]);
15284
- React.useEffect(() => {
15285
- onChange && onChange(columnIndex, chooseValueData, selectedOptions());
15286
- if (isConfirmEvent.current) {
15287
- isConfirmEvent.current = false;
15288
- onConfirm && onConfirm(chooseValueData, selectedOptions());
15368
+ return formatted;
15369
+ };
15370
+ const columnsType = () => {
15371
+ const firstColumn = options2[0];
15372
+ if (firstColumn) {
15373
+ if (Array.isArray(firstColumn)) {
15374
+ return "multiple";
15375
+ }
15376
+ if ("children" in firstColumn) {
15377
+ return "cascade";
15378
+ }
15289
15379
  }
15290
- }, [chooseValueData]);
15291
- React.useEffect(() => {
15292
- init();
15293
- }, [listData]);
15294
- const closeActionSheet = () => {
15295
- onClose && onClose(chooseValueData, selectedOptions());
15296
- onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
15380
+ return "single";
15297
15381
  };
15298
- const confirm2 = () => {
15299
- let movings = false;
15300
- refs.forEach((_ref) => {
15301
- if (_ref.moving)
15302
- movings = true;
15303
- _ref.stopMomentum();
15382
+ const normalListData = () => {
15383
+ const type2 = columnsType();
15384
+ switch (type2) {
15385
+ case "multiple":
15386
+ return options2;
15387
+ case "cascade":
15388
+ return formatCascade(options2, selectedValue);
15389
+ default:
15390
+ return [options2];
15391
+ }
15392
+ };
15393
+ const init = () => {
15394
+ const normalData = normalListData();
15395
+ setColumnsList(normalData);
15396
+ const data = [];
15397
+ normalData.length > 0 && normalData.map((item) => {
15398
+ item[0] && data.push(item[0].value);
15399
+ return item;
15304
15400
  });
15305
- if (movings) {
15306
- isConfirmEvent.current = true;
15307
- } else {
15308
- onConfirm && onConfirm(chooseValueData, selectedOptions());
15401
+ if (!defaultValue.length && selectedValue.length === 0) {
15402
+ setSelectedValue([...data]);
15309
15403
  }
15310
- onClose && onClose(chooseValueData, selectedOptions());
15311
- setTimeout(() => {
15312
- isConfirmEvent.current = false;
15313
- }, 0);
15314
15404
  };
15315
- const selectedOptions = () => {
15316
- const optins = [];
15317
- columnsList.map((column, index) => {
15318
- let currOptions = [];
15319
- currOptions = column.filter(
15320
- (item) => item.value === chooseValueData[index]
15405
+ React.useEffect(() => {
15406
+ if (!visible) {
15407
+ return;
15408
+ }
15409
+ init();
15410
+ }, [options2, visible]);
15411
+ const setSelectedOptions = () => {
15412
+ const options22 = [];
15413
+ let currOptions = [];
15414
+ columnsList.forEach((columnOptions, index) => {
15415
+ currOptions = columnOptions.filter(
15416
+ (item) => item.value === selectedValue[index]
15321
15417
  );
15322
15418
  if (currOptions[0]) {
15323
- optins.push(currOptions[0]);
15419
+ options22.push(currOptions[0]);
15324
15420
  } else {
15325
- column[0] && optins.push(column[0]);
15421
+ columnOptions[0] && options22.push(columnOptions[0]);
15326
15422
  }
15327
- return column;
15328
15423
  });
15329
- return optins;
15424
+ return options22;
15330
15425
  };
15331
- const chooseItem = (option, columnIndex2) => {
15332
- if (option && Object.keys(option).length) {
15333
- if (chooseValueData[columnIndex2] !== option.value) {
15426
+ React.useEffect(() => {
15427
+ if (!visible) {
15428
+ return;
15429
+ }
15430
+ onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
15431
+ if (isConfirmEvent.current) {
15432
+ isConfirmEvent.current = false;
15433
+ onConfirm && onConfirm(setSelectedOptions(), selectedValue);
15434
+ }
15435
+ }, [selectedValue, columnsList, visible]);
15436
+ const chooseItem = (columnOptions, columnIndex2) => {
15437
+ var _a2, _b;
15438
+ if (columnOptions && Object.keys(columnOptions).length) {
15439
+ if (selectedValue[columnIndex2] !== columnOptions.value) {
15334
15440
  if (columnsType() === "cascade") {
15335
- chooseValueData[columnIndex2] = option.value ? option.value : "";
15336
- setchooseValueData([...chooseValueData]);
15337
- let index = columnIndex2;
15338
- let cursor = option;
15339
- while (cursor && cursor.children && cursor.children[0]) {
15340
- chooseValueData[index + 1] = cursor.children[0].value;
15341
- setchooseValueData([...chooseValueData]);
15342
- index++;
15343
- const cc = cursor.children[0];
15344
- cursor = cc;
15441
+ selectedValue[columnIndex2] = columnOptions.value || "";
15442
+ setSelectedValue([...selectedValue]);
15443
+ while ((_a2 = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a2[0]) {
15444
+ selectedValue[columnIndex2 + 1] = columnOptions.children[0].value;
15445
+ setSelectedValue([...selectedValue]);
15446
+ columnIndex2++;
15447
+ columnOptions = columnOptions.children[0];
15345
15448
  }
15346
- if (cursor && cursor.children) {
15347
- chooseValueData[index + 1] = "";
15348
- setchooseValueData([...chooseValueData]);
15449
+ if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
15450
+ selectedValue[columnIndex2 + 1] = "";
15451
+ setSelectedValue([...selectedValue]);
15349
15452
  }
15350
15453
  setColumnsList(normalListData());
15351
15454
  } else {
15352
- setchooseValueData((data) => {
15455
+ setSelectedValue((data) => {
15353
15456
  const cdata = [...data];
15354
15457
  cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
15355
- option,
15458
+ columnOptions,
15356
15459
  "value"
15357
- ) ? option.value : "";
15460
+ ) ? columnOptions.value : "";
15358
15461
  return cdata;
15359
15462
  });
15360
15463
  }
15361
- setcolumnIndex(columnIndex2);
15362
- }
15363
- }
15364
- };
15365
- const normalListData = () => {
15366
- const type2 = columnsType();
15367
- switch (type2) {
15368
- case "multiple":
15369
- return listData;
15370
- case "cascade":
15371
- return formatCascade(listData, chooseValueData);
15372
- default:
15373
- return [listData];
15374
- }
15375
- };
15376
- const columnsType = () => {
15377
- const firstColumn = listData[0];
15378
- if (firstColumn) {
15379
- if (Array.isArray(firstColumn)) {
15380
- return "multiple";
15381
- }
15382
- if ("children" in firstColumn) {
15383
- return "cascade";
15464
+ setColumnIndex(columnIndex2);
15384
15465
  }
15385
15466
  }
15386
- return "single";
15387
15467
  };
15388
- const formatCascade = (columns, defaultValues) => {
15389
- const formatted = [];
15390
- let cursor = {
15391
- text: "",
15392
- value: "",
15393
- children: columns
15394
- };
15395
- let columnIndex2 = 0;
15396
- while (cursor && cursor.children) {
15397
- const options2 = cursor.children;
15398
- const value = defaultValues[columnIndex2];
15399
- let index = options2.findIndex(
15400
- (columnItem) => columnItem.value === value
15401
- );
15402
- if (index === -1)
15403
- index = 0;
15404
- cursor = cursor.children[index];
15405
- columnIndex2++;
15406
- formatted.push(options2);
15407
- }
15408
- return formatted;
15409
- };
15410
- const init = () => {
15411
- const data = [];
15412
- const normalData = normalListData();
15413
- setColumnsList(normalData);
15414
- normalData.length > 0 && normalData.map((item) => {
15415
- item[0] && data.push(item[0].value);
15416
- return item;
15468
+ const confirm2 = () => {
15469
+ let movings = false;
15470
+ refs.forEach((ref2) => {
15471
+ if (ref2.moving)
15472
+ movings = true;
15473
+ ref2.stopMomentum();
15417
15474
  });
15418
- if (!defaultValueData && chooseValueData.length === 0) {
15419
- setchooseValueData([...data]);
15475
+ if (movings) {
15476
+ isConfirmEvent.current = true;
15477
+ } else {
15478
+ onConfirm && onConfirm(setSelectedOptions(), selectedValue);
15479
+ closePicker();
15420
15480
  }
15481
+ setTimeout(() => {
15482
+ isConfirmEvent.current = false;
15483
+ }, 0);
15421
15484
  };
15422
- const renderToolbar = () => {
15423
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: b("control"), children: [
15424
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: b("cancel-btn"), onClick: () => closeActionSheet(), children: locale.cancel }),
15425
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("title"), children: title || "" }),
15426
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: b("confirm-btn"), onClick: confirm2, children: locale.confirm })
15485
+ const closePicker = () => {
15486
+ onClose && onClose(setSelectedOptions(), selectedValue);
15487
+ afterClose && afterClose(setSelectedOptions(), selectedValue, pickerRef);
15488
+ };
15489
+ const renderTitleBar = () => {
15490
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__control`, children: [
15491
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
15492
+ "span",
15493
+ {
15494
+ className: `${classPrefix2}__cancel-btn`,
15495
+ onClick: () => closePicker(),
15496
+ children: locale.cancel
15497
+ }
15498
+ ),
15499
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__title`, children: title || "" }),
15500
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${classPrefix2}__confirm-btn`, onClick: confirm2, children: locale.confirm })
15427
15501
  ] });
15428
15502
  };
15429
15503
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -15432,20 +15506,20 @@ Please add \`${key}Action\` when creating your handler.`);
15432
15506
  visible,
15433
15507
  position: "bottom",
15434
15508
  onClose: () => {
15435
- closeActionSheet();
15509
+ closePicker();
15436
15510
  },
15437
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${b()} ${className || ""}`, style, ...rest, children: [
15438
- renderToolbar(),
15439
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("panel"), ref: pickerRef, children: columnsList == null ? void 0 : columnsList.map((item, index) => {
15511
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, ...rest, children: [
15512
+ renderTitleBar(),
15513
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__panel`, ref: pickerRef, children: columnsList == null ? void 0 : columnsList.map((item, index) => {
15440
15514
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15441
- PickerSlot$1,
15515
+ PickerPanel$1,
15442
15516
  {
15443
15517
  ref: setRefs(index),
15444
- defaultValue: chooseValueData == null ? void 0 : chooseValueData[index],
15445
- listData: item,
15518
+ defaultValue: selectedValue == null ? void 0 : selectedValue[index],
15519
+ options: item,
15446
15520
  threeDimensional,
15447
15521
  chooseItem: (value, index2) => chooseItem(value, index2),
15448
- swipeDuration,
15522
+ duration,
15449
15523
  keyIndex: index
15450
15524
  },
15451
15525
  index
@@ -15496,7 +15570,7 @@ Please add \`${key}Action\` when creating your handler.`);
15496
15570
  const [show, setShow] = React.useState(false);
15497
15571
  const [currentDate, setCurrentDate] = React.useState(modelValue);
15498
15572
  const [defaultValue, setDefaultValue] = React.useState([]);
15499
- const [listData, setListData] = React.useState([]);
15573
+ const [options2, setListData] = React.useState([]);
15500
15574
  const pickerRef = React.useRef(null);
15501
15575
  const isDate = (val) => {
15502
15576
  return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
@@ -15614,7 +15688,7 @@ Please add \`${key}Action\` when creating your handler.`);
15614
15688
  }
15615
15689
  return result;
15616
15690
  };
15617
- const updateChooseValueCustmer = (index, selectedValue, cacheValueData) => {
15691
+ const updateChooseValueCustmer = (cacheValueData, selectedValue, index) => {
15618
15692
  if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
15619
15693
  type2.toLocaleLowerCase()
15620
15694
  )) {
@@ -15653,7 +15727,7 @@ Please add \`${key}Action\` when creating your handler.`);
15653
15727
  const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date2 == null ? void 0 : date2.getTime());
15654
15728
  date2 && isDate(date2) && !isEqual2 && setCurrentDate(formatValue(date2));
15655
15729
  }
15656
- props.onChange && props.onChange(index, selectedValue, cacheValueData);
15730
+ props.onChange && props.onChange(cacheValueData, selectedValue, index);
15657
15731
  };
15658
15732
  const padZero = (num, targetLength = 2) => {
15659
15733
  let str = `${num}`;
@@ -15749,16 +15823,16 @@ Please add \`${key}Action\` when creating your handler.`);
15749
15823
  className: `nut-datepicker ${className || ""}`,
15750
15824
  style,
15751
15825
  ...rest,
15752
- children: listData.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
15826
+ children: options2.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
15753
15827
  Picker$1,
15754
15828
  {
15755
15829
  title,
15756
15830
  visible: show,
15757
- listData,
15831
+ options: options2,
15758
15832
  onClose: onCloseDatePicker,
15759
- defaultValueData: defaultValue,
15760
- onConfirm: (values, options2) => onConfirmDatePicker && onConfirmDatePicker(values, options2),
15761
- onChange: (index, value, list) => updateChooseValueCustmer(index, value, list),
15833
+ defaultValue,
15834
+ onConfirm: (options22, values) => onConfirmDatePicker && onConfirmDatePicker(options22, values),
15835
+ onChange: (list, value, index) => updateChooseValueCustmer(list, value, index),
15762
15836
  threeDimensional,
15763
15837
  ref: pickerRef
15764
15838
  }
@@ -17370,7 +17444,7 @@ Please add \`${key}Action\` when creating your handler.`);
17370
17444
  digits: 0,
17371
17445
  async: false
17372
17446
  };
17373
- const classPrefix$3 = `nut-inputnumber`;
17447
+ const classPrefix$7 = `nut-inputnumber`;
17374
17448
  const InputNumber = (props) => {
17375
17449
  const {
17376
17450
  children,
@@ -17413,8 +17487,8 @@ Please add \`${key}Action\` when creating your handler.`);
17413
17487
  }, []);
17414
17488
  const classes = classNames(
17415
17489
  {
17416
- [`${classPrefix$3}`]: true,
17417
- [`${classPrefix$3}--disabled`]: disabled
17490
+ [`${classPrefix$7}`]: true,
17491
+ [`${classPrefix$7}--disabled`]: disabled
17418
17492
  },
17419
17493
  className
17420
17494
  );
@@ -18623,7 +18697,7 @@ Please add \`${key}Action\` when creating your handler.`);
18623
18697
  },
18624
18698
  loading(msg, option = {}) {
18625
18699
  errorMsg$1(msg);
18626
- return notice$1({ msg, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, {}), type: "loading", ...option });
18700
+ return notice$1({ msg, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, {}), type: "loading", ...option });
18627
18701
  },
18628
18702
  warn(msg, option = {}) {
18629
18703
  errorMsg$1(msg);
@@ -19708,144 +19782,120 @@ Please add \`${key}Action\` when creating your handler.`);
19708
19782
  Switch.defaultProps = defaultProps$H;
19709
19783
  Switch.displayName = "NutSwitch";
19710
19784
  const defaultProps$G = {
19785
+ ...ComponentDefaults,
19711
19786
  defaultValue: "",
19712
- textAlign: "left",
19713
- limitshow: false,
19714
- maxlength: "",
19715
- rows: "",
19787
+ showCount: false,
19788
+ rows: 2,
19789
+ maxLength: 140,
19716
19790
  placeholder: "",
19717
- readonly: false,
19791
+ readOnly: false,
19718
19792
  disabled: false,
19719
- autosize: false
19793
+ autoSize: false
19720
19794
  };
19721
19795
  const TextArea = (props) => {
19722
19796
  const { locale } = useConfig();
19723
19797
  const {
19724
19798
  className,
19799
+ value,
19725
19800
  defaultValue,
19726
- textAlign,
19727
- limitshow,
19728
- maxlength,
19801
+ showCount,
19802
+ maxLength,
19729
19803
  rows,
19730
19804
  placeholder,
19731
- readonly,
19805
+ readOnly,
19732
19806
  disabled,
19733
- autosize,
19807
+ autoSize,
19734
19808
  style,
19735
19809
  onChange,
19736
19810
  onBlur,
19737
- onFocus
19811
+ onFocus,
19812
+ ...rest
19738
19813
  } = { ...defaultProps$G, ...props };
19739
- const textareaBem = cn("textarea");
19740
- const [inputValue, SetInputValue] = React.useState("");
19814
+ const classPrefix2 = "nut-textarea";
19741
19815
  const textareaRef = React.useRef(null);
19742
- const compositingRef = React.useRef(false);
19743
- React.useEffect(() => {
19744
- let initValue = defaultValue;
19745
- if (initValue && maxlength && [...initValue].length > Number(maxlength)) {
19746
- initValue = initValue.substring(0, Number(maxlength));
19747
- }
19748
- SetInputValue(initValue);
19749
- if (autosize) {
19750
- setTimeout(() => {
19751
- setContentHeight();
19752
- });
19816
+ const compositionRef = React.useRef(false);
19817
+ const format2 = (value2) => {
19818
+ if (maxLength !== void 0 && value2.length > maxLength) {
19819
+ return value2.substring(0, maxLength);
19753
19820
  }
19754
- }, [defaultValue, autosize]);
19821
+ return value2;
19822
+ };
19823
+ const [inputValue, setInputValue] = usePropsValue({
19824
+ value,
19825
+ defaultValue,
19826
+ finalValue: format2(defaultValue),
19827
+ onChange
19828
+ });
19755
19829
  React.useEffect(() => {
19756
- if (inputValue) {
19757
- if (autosize) {
19758
- setContentHeight();
19759
- }
19830
+ if (autoSize) {
19831
+ setContentHeight();
19760
19832
  }
19761
- }, [inputValue]);
19833
+ }, [autoSize, defaultValue, inputValue]);
19762
19834
  const setContentHeight = () => {
19763
19835
  const textarea = textareaRef.current;
19764
19836
  if (textarea) {
19765
19837
  textarea.style.height = "auto";
19766
- let height = textarea == null ? void 0 : textarea.scrollHeight;
19767
- if (typeof autosize === "object") {
19768
- const { maxHeight, minHeight } = autosize;
19769
- if (maxHeight !== void 0) {
19770
- height = Math.min(height, maxHeight);
19771
- }
19772
- if (minHeight !== void 0) {
19773
- height = Math.max(height, minHeight);
19774
- }
19775
- }
19838
+ const height = textarea == null ? void 0 : textarea.scrollHeight;
19776
19839
  if (height) {
19777
19840
  textarea.style.height = `${height}px`;
19778
19841
  }
19779
19842
  }
19780
19843
  };
19781
- const textChange = (event) => {
19844
+ const handleChange = (event) => {
19782
19845
  const text = event.target;
19783
- if (maxlength && [...text.value].length > Number(maxlength) && !compositingRef.current) {
19784
- text.value = text.value.substring(0, Number(maxlength));
19785
- }
19786
- SetInputValue(text.value);
19787
- onChange && onChange(text.value, event);
19846
+ const value2 = compositionRef.current ? text.value : format2(text.value);
19847
+ setInputValue(value2);
19788
19848
  };
19789
- const textFocus = (event) => {
19849
+ const handleFocus = (event) => {
19790
19850
  if (disabled)
19791
19851
  return;
19792
- if (readonly)
19852
+ if (readOnly)
19793
19853
  return;
19794
19854
  onFocus && onFocus(event);
19795
19855
  };
19796
- const textBlur = (event) => {
19856
+ const handleBlur = (event) => {
19797
19857
  if (disabled)
19798
19858
  return;
19799
- if (readonly)
19859
+ if (readOnly)
19800
19860
  return;
19801
- const text = event.target;
19802
- onChange && onChange(text.value, event);
19803
19861
  onBlur && onBlur(event);
19804
19862
  };
19805
- const startComposing = () => {
19806
- compositingRef.current = true;
19807
- };
19808
- const endComposing = () => {
19809
- compositingRef.current = false;
19810
- };
19811
19863
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
19812
19864
  "div",
19813
19865
  {
19814
- className: `${textareaBem()} ${disabled ? textareaBem("disabled") : ""} ${className || ""}`,
19866
+ className: classNames(classPrefix2, className, {
19867
+ [`${classPrefix2}__disabled`]: disabled
19868
+ }),
19815
19869
  children: [
19816
19870
  /* @__PURE__ */ jsxRuntimeExports.jsx(
19817
19871
  "textarea",
19818
19872
  {
19819
19873
  ref: textareaRef,
19820
- className: textareaBem("textarea"),
19821
- style: {
19822
- textAlign,
19823
- ...style
19824
- },
19874
+ className: `${classPrefix2}__textarea`,
19875
+ style,
19825
19876
  disabled,
19826
- readOnly: readonly,
19877
+ readOnly,
19827
19878
  value: inputValue,
19828
- onChange: (e) => {
19829
- textChange(e);
19830
- },
19831
- onBlur: (e) => {
19832
- textBlur(e);
19879
+ onChange: (e) => handleChange(e),
19880
+ onBlur: (e) => handleBlur(e),
19881
+ onFocus: (e) => handleFocus(e),
19882
+ onCompositionEnd: () => {
19883
+ compositionRef.current = false;
19833
19884
  },
19834
- onFocus: (e) => {
19835
- textFocus(e);
19885
+ onCompositionStart: () => {
19886
+ compositionRef.current = true;
19836
19887
  },
19837
- onCompositionEnd: (e) => endComposing(),
19838
- onCompositionStart: (e) => startComposing(),
19839
19888
  rows,
19840
- maxLength: maxlength < 0 ? 0 : maxlength,
19841
- placeholder: placeholder || locale.placeholder
19889
+ maxLength: maxLength === -1 ? void 0 : maxLength,
19890
+ placeholder: placeholder || locale.placeholder,
19891
+ ...rest
19842
19892
  }
19843
19893
  ),
19844
- limitshow ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: textareaBem("limit"), children: [
19845
- [...inputValue].length,
19894
+ showCount && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__limit`, children: [
19895
+ inputValue.length,
19846
19896
  "/",
19847
- maxlength < 0 ? 0 : maxlength
19848
- ] }) : null
19897
+ maxLength < 0 ? 0 : maxLength
19898
+ ] })
19849
19899
  ]
19850
19900
  }
19851
19901
  );
@@ -20345,7 +20395,7 @@ Please add \`${key}Action\` when creating your handler.`);
20345
20395
  ),
20346
20396
  item.status === "ready" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-uploader__preview__progress", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-uploader__preview__progress__msg", children: item.message }) }) : item.status !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "nut-uploader__preview__progress", children: [
20347
20397
  item.failIcon !== " " && item.loadingIcon !== " " && (item.status === "error" ? item.failIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(x$8, { color: "#fff" }) : item.loadingIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(
20348
- k$2,
20398
+ k$3,
20349
20399
  {
20350
20400
  className: "nut-icon-loading",
20351
20401
  color: "#fff"
@@ -20913,25 +20963,29 @@ Please add \`${key}Action\` when creating your handler.`);
20913
20963
  network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
20914
20964
  };
20915
20965
  const defaultProps$A = {
20966
+ ...ComponentDefaults,
20916
20967
  description: "",
20917
- image: "empty",
20918
20968
  imageSize: "",
20919
- className: ""
20969
+ status: "empty"
20920
20970
  };
20971
+ const classPrefix$6 = `nut-empty`;
20921
20972
  const Empty = (props) => {
20922
20973
  const { locale } = useConfig();
20923
- const { image, imageSize, description, children, className, ...rest } = {
20974
+ const {
20975
+ image,
20976
+ imageSize,
20977
+ description,
20978
+ children,
20979
+ className,
20980
+ status,
20981
+ ...rest
20982
+ } = {
20924
20983
  ...defaultProps$A,
20925
20984
  ...props
20926
20985
  };
20927
20986
  const [imgStyle, setImgStyle] = React.useState({});
20928
- const b = cn("empty");
20929
- let imageNode = image;
20930
- if (typeof image === "string") {
20931
- const isHttpUrl = image.startsWith("https://") || image.startsWith("http://") || image.startsWith("//");
20932
- const imageUrl = isHttpUrl ? image : defaultStatus[image];
20933
- imageNode = /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "img", src: imageUrl, alt: "empty" });
20934
- }
20987
+ const imageUrl = image || defaultStatus[status];
20988
+ const imageNode = typeof imageUrl === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "img", src: imageUrl, alt: "empty" }) : imageUrl;
20935
20989
  React.useEffect(() => {
20936
20990
  setImgStyle(() => {
20937
20991
  if (!imageSize) {
@@ -20949,9 +21003,9 @@ Please add \`${key}Action\` when creating your handler.`);
20949
21003
  };
20950
21004
  });
20951
21005
  }, [imageSize]);
20952
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${b()} ${className}`, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
20953
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("image"), style: imgStyle, children: imageNode }),
20954
- typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("description"), children: description || locale.noData }) : { description },
21006
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$6} ${className}`, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
21007
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$6}__image`, style: imgStyle, children: imageNode }),
21008
+ typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$6}__description`, children: description || locale.noData }) : description,
20955
21009
  children
20956
21010
  ] }) });
20957
21011
  };
@@ -22140,29 +22194,30 @@ Please add \`${key}Action\` when creating your handler.`);
22140
22194
  const defaultProps$v = {
22141
22195
  ...ComponentDefaults,
22142
22196
  size: "",
22197
+ shape: "round",
22143
22198
  icon: "",
22144
- bgColor: "#eee",
22199
+ background: "#eee",
22145
22200
  color: "#666",
22146
- prefixCls: "nut-avatar",
22147
- url: "",
22201
+ fit: "cover",
22202
+ src: "",
22148
22203
  alt: ""
22149
22204
  };
22205
+ const classPrefix$5 = `nut-avatar`;
22150
22206
  const Avatar = (props) => {
22151
22207
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
22152
22208
  const {
22153
22209
  children,
22154
- prefixCls: prefixCls2,
22155
22210
  size,
22156
22211
  shape,
22157
- bgColor,
22212
+ background,
22158
22213
  color,
22159
- url,
22214
+ src,
22160
22215
  alt,
22161
22216
  icon,
22217
+ fit,
22162
22218
  className,
22163
22219
  style,
22164
- activeAvatar,
22165
- onActiveAvatar,
22220
+ onClick,
22166
22221
  onError,
22167
22222
  ...rest
22168
22223
  } = {
@@ -22174,24 +22229,23 @@ Please add \`${key}Action\` when creating your handler.`);
22174
22229
  const [avatarIndex, setAvatarIndex] = React.useState(1);
22175
22230
  const avatarRef = React.useRef(null);
22176
22231
  const parent = React.useContext(AvatarContext);
22177
- const b = cn("avatar");
22232
+ const sizeValue = ["large", "normal", "small"];
22178
22233
  const classes = classNames({
22179
- [`nut-avatar-${size || ((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || "normal"}`]: true,
22180
- [`nut-avatar-${shape || ((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || "round"}`]: true
22234
+ [`nut-avatar-${((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || size || "normal"}`]: true,
22235
+ [`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
22181
22236
  });
22182
- const cls = classNames(b(""), classes, className);
22183
- const sizeValue = ["large", "normal", "small"];
22237
+ const cls = classNames(classPrefix$5, classes, className);
22184
22238
  const styles = {
22185
22239
  width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
22186
22240
  height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
22187
- backgroundColor: `${bgColor}`,
22241
+ backgroundColor: `${background}`,
22188
22242
  color: `${color}`,
22189
- marginLeft: avatarIndex !== 1 && ((_c = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c.span) ? `${(_d = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _d.span}px` : "",
22190
- zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
22243
+ marginLeft: avatarIndex !== 1 && ((_c = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c.gap) ? `${(_d = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _d.gap}px` : "",
22244
+ zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.level) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
22191
22245
  ...style
22192
22246
  };
22193
22247
  const maxStyles = {
22194
- backgroundColor: `${(_f = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _f.maxBgColor}`,
22248
+ backgroundColor: `${(_f = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _f.maxBackground}`,
22195
22249
  color: `${(_g = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _g.maxColor}`
22196
22250
  };
22197
22251
  React.useEffect(() => {
@@ -22209,23 +22263,22 @@ Please add \`${key}Action\` when creating your handler.`);
22209
22263
  }
22210
22264
  }
22211
22265
  const index = Number((_b2 = (_a3 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a3.dataset) == null ? void 0 : _b2.index);
22212
- const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.maxCount;
22266
+ const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.max;
22213
22267
  setMaxSum(children2.length);
22214
22268
  setAvatarIndex(index);
22215
22269
  if (index === children2.length && index !== maxCount && children2.length > maxCount) {
22216
22270
  setShowMax(true);
22217
22271
  }
22218
22272
  };
22219
- const errorEvent = (e) => {
22273
+ const errorEvent = () => {
22220
22274
  if (props.onError) {
22221
- props.onError(e);
22275
+ props.onError();
22222
22276
  }
22223
22277
  };
22224
22278
  const clickAvatar = (e) => {
22225
- activeAvatar && activeAvatar(e);
22226
- onActiveAvatar && onActiveAvatar(e);
22279
+ onClick && onClick(e);
22227
22280
  };
22228
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (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__ */ jsxRuntimeExports.jsxs(
22281
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (showMax || !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.max) || avatarIndex <= ((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.max)) && /* @__PURE__ */ jsxRuntimeExports.jsxs(
22229
22282
  "div",
22230
22283
  {
22231
22284
  className: cls,
@@ -22234,13 +22287,14 @@ Please add \`${key}Action\` when creating your handler.`);
22234
22287
  onClick: clickAvatar,
22235
22288
  ref: avatarRef,
22236
22289
  children: [
22237
- (!((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.maxCount) || avatarIndex <= ((_k = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _k.maxCount)) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
22238
- url && /* @__PURE__ */ jsxRuntimeExports.jsx(
22239
- "img",
22290
+ (!((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.max) || avatarIndex <= ((_k = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _k.max)) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
22291
+ src && /* @__PURE__ */ jsxRuntimeExports.jsx(
22292
+ Image$1,
22240
22293
  {
22241
22294
  className: "avatar-img",
22242
- src: url,
22295
+ src,
22243
22296
  alt,
22297
+ style: { objectFit: fit },
22244
22298
  onError: errorEvent
22245
22299
  }
22246
22300
  ),
@@ -22248,9 +22302,10 @@ Please add \`${key}Action\` when creating your handler.`);
22248
22302
  ...icon.props,
22249
22303
  className: `${icon.props.className || ""} icon`
22250
22304
  }) : null,
22251
- children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text", children })
22305
+ children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text", children }),
22306
+ !src && !icon && !children && /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, { className: "icon" })
22252
22307
  ] }),
22253
- showMax && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text", children: ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}` })
22308
+ showMax && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text", children: ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.max)}` })
22254
22309
  ]
22255
22310
  }
22256
22311
  ) });
@@ -22320,7 +22375,7 @@ Please add \`${key}Action\` when creating your handler.`);
22320
22375
  Avatar,
22321
22376
  {
22322
22377
  className: avatarClass,
22323
- bgColor: "rgb(239, 239, 239)",
22378
+ background: "rgb(239, 239, 239)",
22324
22379
  shape: avatarShape,
22325
22380
  style: getStyle()
22326
22381
  }
@@ -22353,9 +22408,7 @@ Please add \`${key}Action\` when creating your handler.`);
22353
22408
  }
22354
22409
  }
22355
22410
  const defaultProps$t = {
22356
- name: "",
22357
- leftWidth: 0,
22358
- rightWidth: 0
22411
+ name: ""
22359
22412
  };
22360
22413
  const Swipe = React.forwardRef((props, instanceRef) => {
22361
22414
  const swipeBem = cn("swipe");
@@ -22377,14 +22430,8 @@ Please add \`${key}Action\` when creating your handler.`);
22377
22430
  transform: `translate3d(${state.offset}px, 0, 0)`,
22378
22431
  transitionDuration: state.dragging ? "0s" : ".6s"
22379
22432
  };
22380
- const leftWidth = React.useMemo(
22381
- () => props.leftWidth ? props.leftWidth : actionWidth.left,
22382
- [props.leftWidth, actionWidth.left]
22383
- );
22384
- const rightWidth = React.useMemo(
22385
- () => props.rightWidth ? props.rightWidth : actionWidth.right,
22386
- [props.rightWidth, actionWidth.right]
22387
- );
22433
+ const leftWidth = actionWidth.left;
22434
+ const rightWidth = actionWidth.right;
22388
22435
  const onTouchStart = (event) => {
22389
22436
  if (!props.disabled) {
22390
22437
  startOffset.current = state.offset;
@@ -22548,7 +22595,7 @@ Please add \`${key}Action\` when creating your handler.`);
22548
22595
  onClick: (event) => {
22549
22596
  }
22550
22597
  };
22551
- const classPrefix$2 = `nut-animate`;
22598
+ const classPrefix$4 = `nut-animate`;
22552
22599
  const Animate = (props) => {
22553
22600
  const { className, type: type2, action, loop: loop2, onClick, children, ...rest } = {
22554
22601
  ...defaultProps$s,
@@ -22557,7 +22604,7 @@ Please add \`${key}Action\` when creating your handler.`);
22557
22604
  const [clicked, setClicked] = React.useState(false);
22558
22605
  const classes = classNames({
22559
22606
  "nut-ani-container": true,
22560
- [`${classPrefix$2}-${type2}`]: action === "initial" || clicked ? type2 : false,
22607
+ [`${classPrefix$4}-${type2}`]: action === "initial" || clicked ? type2 : false,
22561
22608
  loop: loop2
22562
22609
  });
22563
22610
  const cls = classNames(classes, className);
@@ -22929,22 +22976,20 @@ Please add \`${key}Action\` when creating your handler.`);
22929
22976
  Audio.defaultProps = defaultProps$p;
22930
22977
  Audio.displayName = "NutAudio";
22931
22978
  const defaultProps$o = {
22979
+ ...ComponentDefaults,
22932
22980
  maxContent: "",
22933
- maxCount: "",
22934
- maxBgColor: "#eee",
22981
+ max: "",
22982
+ maxBackground: "#eee",
22935
22983
  maxColor: "#666",
22936
- size: "",
22937
- shape: "",
22938
- span: "-8",
22939
- zIndex: "left"
22984
+ gap: "-8",
22985
+ level: "left"
22940
22986
  };
22987
+ const classPrefix$3 = `nut-avatar-group`;
22941
22988
  const AvatarGroup = (props) => {
22942
- useConfig();
22943
22989
  const propAvatarGroup = { ...defaultProps$o, ...props };
22944
22990
  const { className, style, children } = propAvatarGroup;
22945
22991
  const avatarGroupRef = React.useRef(null);
22946
- const b = cn("avatar-group");
22947
- const cls = classNames(b(""), className);
22992
+ const cls = classNames(classPrefix$3, className);
22948
22993
  const parentAvatar = {
22949
22994
  propAvatarGroup,
22950
22995
  avatarGroupRef
@@ -22962,7 +23007,7 @@ Please add \`${key}Action\` when creating your handler.`);
22962
23007
  background: "#e5e9f2",
22963
23008
  clockwise: true
22964
23009
  };
22965
- const classPrefix$1 = `nut-circleprogress`;
23010
+ const classPrefix$2 = `nut-circleprogress`;
22966
23011
  const CircleProgress = (props) => {
22967
23012
  var _a2;
22968
23013
  const {
@@ -22981,7 +23026,7 @@ Please add \`${key}Action\` when creating your handler.`);
22981
23026
  ...defaultProps$n,
22982
23027
  ...props
22983
23028
  };
22984
- const classes = classNames(className, classPrefix$1);
23029
+ const classes = classNames(className, classPrefix$2);
22985
23030
  const refRandomId = Math.random().toString(36).slice(-8);
22986
23031
  const styles = {
22987
23032
  height: `${Number(radius) * 2}px`,
@@ -23452,6 +23497,7 @@ Please add \`${key}Action\` when creating your handler.`);
23452
23497
  CountDown.defaultProps = defaultProps$k;
23453
23498
  CountDown.displayName = "NutCountDown";
23454
23499
  const defaultProps$j = {
23500
+ ...ComponentDefaults,
23455
23501
  content: "",
23456
23502
  direction: "end",
23457
23503
  rows: 1,
@@ -23460,12 +23506,13 @@ Please add \`${key}Action\` when creating your handler.`);
23460
23506
  symbol: "...",
23461
23507
  lineHeight: "20"
23462
23508
  };
23509
+ const classPrefix$1 = `nut-ellipsis`;
23463
23510
  const Ellipsis = (props) => {
23464
23511
  var _a2, _b;
23465
- useConfig();
23466
23512
  const {
23467
23513
  children,
23468
23514
  content,
23515
+ className,
23469
23516
  direction,
23470
23517
  rows,
23471
23518
  expandText,
@@ -23473,7 +23520,8 @@ Please add \`${key}Action\` when creating your handler.`);
23473
23520
  symbol,
23474
23521
  lineHeight,
23475
23522
  onClick,
23476
- onChange
23523
+ onChange,
23524
+ ...rest
23477
23525
  } = { ...defaultProps$j, ...props };
23478
23526
  let container = null;
23479
23527
  let maxHeight = 0;
@@ -23481,10 +23529,8 @@ Please add \`${key}Action\` when creating your handler.`);
23481
23529
  const [expanded, setExpanded] = React.useState(false);
23482
23530
  const ellipsis = React.useRef();
23483
23531
  const root2 = React.useRef(null);
23532
+ const classes = classNames(classPrefix$1, className);
23484
23533
  React.useLayoutEffect(() => {
23485
- createContainer();
23486
- }, []);
23487
- React.useEffect(() => {
23488
23534
  if (content) {
23489
23535
  createContainer();
23490
23536
  }
@@ -23602,7 +23648,7 @@ Please add \`${key}Action\` when creating your handler.`);
23602
23648
  const handleClick2 = () => {
23603
23649
  onClick && onClick();
23604
23650
  };
23605
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-ellipsis", onClick: handleClick2, ref: root2, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
23651
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, onClick: handleClick2, ref: root2, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
23606
23652
  !exceeded ? content : null,
23607
23653
  exceeded && !expanded ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
23608
23654
  (_a2 = ellipsis.current) == null ? void 0 : _a2.leading,
@@ -25032,13 +25078,11 @@ Please add \`${key}Action\` when creating your handler.`);
25032
25078
  Steps.displayName = "NutSteps";
25033
25079
  const defaultProps$8 = {
25034
25080
  ...ComponentDefaults,
25035
- className: "",
25036
- style: {},
25037
25081
  columns: [],
25038
25082
  data: [],
25039
25083
  bordered: true,
25040
25084
  striped: false,
25041
- noData: "无数据",
25085
+ noData: "",
25042
25086
  sorterIcon: null,
25043
25087
  showHeader: true
25044
25088
  };
@@ -25055,9 +25099,9 @@ Please add \`${key}Action\` when creating your handler.`);
25055
25099
  summary,
25056
25100
  striped,
25057
25101
  noData,
25058
- onSorter,
25059
25102
  sorterIcon,
25060
25103
  showHeader,
25104
+ onSort,
25061
25105
  ...rest
25062
25106
  } = {
25063
25107
  ...defaultProps$8,
@@ -25069,12 +25113,13 @@ Please add \`${key}Action\` when creating your handler.`);
25069
25113
  setCurData(data);
25070
25114
  }
25071
25115
  }, [data]);
25072
- const b = cn("table");
25073
- const classes = classNames({});
25074
- const cls = classNames(b(), classes, className);
25116
+ const classPrefix2 = "nut-table";
25117
+ const headerClassPrefix = `${classPrefix2}__main__head__tr`;
25118
+ const bodyClassPrefix = `${classPrefix2}__main__body__tr`;
25119
+ const cls = classNames(classPrefix2, className);
25075
25120
  const handleSorterClick = (item) => {
25076
25121
  if (item.sorter) {
25077
- onSorter && onSorter(item, curData);
25122
+ onSort && onSort(item, curData);
25078
25123
  if (typeof item.sorter === "function") {
25079
25124
  setCurData(curData.sort(item.sorter));
25080
25125
  } else {
@@ -25084,8 +25129,8 @@ Please add \`${key}Action\` when creating your handler.`);
25084
25129
  };
25085
25130
  const cellClasses = (item) => {
25086
25131
  return {
25087
- "nut-table__main__head__tr--border": props.bordered,
25088
- [`nut-table__main__head__tr--align${item.align ? item.align : ""}`]: true
25132
+ [`${headerClassPrefix}--border`]: props.bordered,
25133
+ [`${headerClassPrefix}--align${item.align ? item.align : ""}`]: true
25089
25134
  };
25090
25135
  };
25091
25136
  const getColumnItem = (value) => {
@@ -25096,10 +25141,7 @@ Please add \`${key}Action\` when creating your handler.`);
25096
25141
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
25097
25142
  "span",
25098
25143
  {
25099
- className: classNames(
25100
- "nut-table__main__head__tr__th",
25101
- cellClasses(item)
25102
- ),
25144
+ className: classNames(`${headerClassPrefix}__th`, cellClasses(item)),
25103
25145
  onClick: () => handleSorterClick(item),
25104
25146
  children: [
25105
25147
  item.title,
@@ -25122,7 +25164,7 @@ Please add \`${key}Action\` when creating your handler.`);
25122
25164
  "span",
25123
25165
  {
25124
25166
  className: classNames(
25125
- "nut-table__main__body__tr__td",
25167
+ `${bodyClassPrefix}__td`,
25126
25168
  cellClasses(getColumnItem(value))
25127
25169
  ),
25128
25170
  children: typeof item[value] === "function" || typeof render2 === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: render2 ? render2(item) : item[value](item) }) : item[value]
@@ -25133,24 +25175,23 @@ Please add \`${key}Action\` when creating your handler.`);
25133
25175
  };
25134
25176
  const renderBoyTrs = () => {
25135
25177
  return curData.map((item, index) => {
25136
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__body__tr", children: renderBodyTds(item) }, index);
25178
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bodyClassPrefix, children: renderBodyTds(item) }, index);
25137
25179
  });
25138
25180
  };
25139
25181
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cls, style, ...rest, children: [
25140
25182
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
25141
25183
  "div",
25142
25184
  {
25143
- className: classNames("nut-table__main", {
25144
- "nut-table__main--striped": striped
25185
+ className: classNames(`${classPrefix2}__main`, {
25186
+ [`${classPrefix2}__main--striped`]: striped
25145
25187
  }),
25146
25188
  children: [
25147
- showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__head__tr", children: renderHeadCells() }) }),
25148
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__body", children: renderBoyTrs() })
25189
+ showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__head`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: headerClassPrefix, children: renderHeadCells() }) }),
25190
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__body`, children: renderBoyTrs() })
25149
25191
  ]
25150
25192
  }
25151
25193
  ),
25152
- summary && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__summary", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-table__summary__text", children: summary }) }),
25153
- curData.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata__text", children: noData }) }) })
25194
+ (summary || curData.length === 0) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__summary`, children: summary || noData })
25154
25195
  ] });
25155
25196
  };
25156
25197
  Table.defaultProps = defaultProps$8;