@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
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  var _a;
8
8
  /*!
9
- * @nutui/nutui-react v2.0.0-alpha.4 Fri May 05 2023 16:12:43 GMT+0800 (China Standard Time)
9
+ * @nutui/nutui-react v2.0.0-alpha.6 Fri May 12 2023 15:13:32 GMT+0800 (China Standard Time)
10
10
  * (c) 2023 @jdf2e.
11
11
  * Released under the MIT License.
12
12
  */
@@ -1014,7 +1014,7 @@ var D = {}, ir = {
1014
1014
  set exports(h) {
1015
1015
  D = h;
1016
1016
  }
1017
- }, k$5 = {};
1017
+ }, k$6 = {};
1018
1018
  /**
1019
1019
  * @license React
1020
1020
  * react-jsx-runtime.production.min.js
@@ -1027,7 +1027,7 @@ var D = {}, ir = {
1027
1027
  var Re;
1028
1028
  function ur() {
1029
1029
  if (Re)
1030
- return k$5;
1030
+ return k$6;
1031
1031
  Re = 1;
1032
1032
  var h = React__default, 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 };
1033
1033
  function w(m, l2, T) {
@@ -1040,7 +1040,7 @@ function ur() {
1040
1040
  g[d] === void 0 && (g[d] = l2[d]);
1041
1041
  return { $$typeof: S, type: m, key: _, ref: $, props: g, _owner: A.current };
1042
1042
  }
1043
- return k$5.Fragment = M, k$5.jsx = w, k$5.jsxs = w, k$5;
1043
+ return k$6.Fragment = M, k$6.jsx = w, k$6.jsxs = w, k$6;
1044
1044
  }
1045
1045
  var F = {};
1046
1046
  /**
@@ -1643,7 +1643,7 @@ Check the top-level render call using <` + t + ">.");
1643
1643
  process.env.NODE_ENV === "production" ? h.exports = ur() : h.exports = sr();
1644
1644
  })(ir);
1645
1645
  const lr = D.Fragment, cr = D.jsx, vr = D.jsxs;
1646
- const a$u = {
1646
+ const a$v = {
1647
1647
  className: "",
1648
1648
  style: void 0,
1649
1649
  name: "ArrowDown2",
@@ -1652,7 +1652,7 @@ const a$u = {
1652
1652
  onClick: () => {
1653
1653
  }
1654
1654
  }, y$8 = (h) => {
1655
- const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$u, ...h }, f = (t) => {
1655
+ const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$v, ...h }, f = (t) => {
1656
1656
  n && n(t);
1657
1657
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
1658
1658
  const t = "nut-icon";
@@ -1689,8 +1689,8 @@ const a$u = {
1689
1689
  }
1690
1690
  ) });
1691
1691
  };
1692
- y$8.defaultProps = a$u;
1693
- const a$t = {
1692
+ y$8.defaultProps = a$v;
1693
+ const a$u = {
1694
1694
  className: "",
1695
1695
  style: void 0,
1696
1696
  name: "ArrowUp2",
@@ -1699,7 +1699,7 @@ const a$t = {
1699
1699
  onClick: () => {
1700
1700
  }
1701
1701
  }, x$g = (h) => {
1702
- const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$t, ...h }, g = (t) => {
1702
+ const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$u, ...h }, g = (t) => {
1703
1703
  n && n(t);
1704
1704
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", w = () => {
1705
1705
  const t = "nut-icon";
@@ -1736,8 +1736,8 @@ const a$t = {
1736
1736
  }
1737
1737
  ) });
1738
1738
  };
1739
- x$g.defaultProps = a$t;
1740
- const a$s = {
1739
+ x$g.defaultProps = a$u;
1740
+ const a$t = {
1741
1741
  className: "",
1742
1742
  style: void 0,
1743
1743
  name: "CheckChecked",
@@ -1746,7 +1746,7 @@ const a$s = {
1746
1746
  onClick: () => {
1747
1747
  }
1748
1748
  }, y$7 = (h) => {
1749
- const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$s, ...h }, C = (t) => {
1749
+ const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$t, ...h }, C = (t) => {
1750
1750
  o && o(t);
1751
1751
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
1752
1752
  const t = "nut-icon";
@@ -1794,8 +1794,8 @@ const a$s = {
1794
1794
  }
1795
1795
  ) });
1796
1796
  };
1797
- y$7.defaultProps = a$s;
1798
- const a$r = {
1797
+ y$7.defaultProps = a$t;
1798
+ const a$s = {
1799
1799
  className: "",
1800
1800
  style: void 0,
1801
1801
  name: "CheckDisabled",
@@ -1804,7 +1804,7 @@ const a$r = {
1804
1804
  onClick: () => {
1805
1805
  }
1806
1806
  }, x$f = (h) => {
1807
- const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$r, ...h }, g = (t) => {
1807
+ const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$s, ...h }, g = (t) => {
1808
1808
  o && o(t);
1809
1809
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
1810
1810
  const t = "nut-icon";
@@ -1841,8 +1841,8 @@ const a$r = {
1841
1841
  }
1842
1842
  ) });
1843
1843
  };
1844
- x$f.defaultProps = a$r;
1845
- const a$q = {
1844
+ x$f.defaultProps = a$s;
1845
+ const a$r = {
1846
1846
  className: "",
1847
1847
  style: void 0,
1848
1848
  name: "CheckNormal",
@@ -1851,7 +1851,7 @@ const a$q = {
1851
1851
  onClick: () => {
1852
1852
  }
1853
1853
  }, N = (h) => {
1854
- const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$q, ...h }, f = (t) => {
1854
+ const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$r, ...h }, f = (t) => {
1855
1855
  r && r(t);
1856
1856
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
1857
1857
  const t = "nut-icon";
@@ -1888,8 +1888,8 @@ const a$q = {
1888
1888
  }
1889
1889
  ) });
1890
1890
  };
1891
- N.defaultProps = a$q;
1892
- const a$p = {
1891
+ N.defaultProps = a$r;
1892
+ const a$q = {
1893
1893
  className: "",
1894
1894
  style: void 0,
1895
1895
  name: "Check",
@@ -1898,7 +1898,7 @@ const a$p = {
1898
1898
  onClick: () => {
1899
1899
  }
1900
1900
  }, x$e = (h) => {
1901
- const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$p, ...h }, g = (t) => {
1901
+ const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$q, ...h }, g = (t) => {
1902
1902
  r && r(t);
1903
1903
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
1904
1904
  const t = "nut-icon";
@@ -1935,8 +1935,8 @@ const a$p = {
1935
1935
  }
1936
1936
  ) });
1937
1937
  };
1938
- x$e.defaultProps = a$p;
1939
- const a$o = {
1938
+ x$e.defaultProps = a$q;
1939
+ const a$p = {
1940
1940
  className: "",
1941
1941
  style: void 0,
1942
1942
  name: "Checked",
@@ -1945,7 +1945,7 @@ const a$o = {
1945
1945
  onClick: () => {
1946
1946
  }
1947
1947
  }, x$d = (h) => {
1948
- const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$o, ...h }, f = (t) => {
1948
+ const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$p, ...h }, f = (t) => {
1949
1949
  r && r(t);
1950
1950
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
1951
1951
  const t = "nut-icon";
@@ -1982,8 +1982,8 @@ const a$o = {
1982
1982
  }
1983
1983
  ) });
1984
1984
  };
1985
- x$d.defaultProps = a$o;
1986
- const a$n = {
1985
+ x$d.defaultProps = a$p;
1986
+ const a$o = {
1987
1987
  className: "",
1988
1988
  style: void 0,
1989
1989
  name: "Checklist",
@@ -1992,7 +1992,7 @@ const a$n = {
1992
1992
  onClick: () => {
1993
1993
  }
1994
1994
  }, x$c = (h) => {
1995
- const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$n, ...h }, g = (t) => {
1995
+ const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$o, ...h }, g = (t) => {
1996
1996
  o && o(t);
1997
1997
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
1998
1998
  const t = "nut-icon";
@@ -2029,8 +2029,8 @@ const a$n = {
2029
2029
  }
2030
2030
  ) });
2031
2031
  };
2032
- x$c.defaultProps = a$n;
2033
- const a$m = {
2032
+ x$c.defaultProps = a$o;
2033
+ const a$n = {
2034
2034
  className: "",
2035
2035
  style: void 0,
2036
2036
  name: "CircleClose",
@@ -2039,7 +2039,7 @@ const a$m = {
2039
2039
  onClick: () => {
2040
2040
  }
2041
2041
  }, x$b = (h) => {
2042
- const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$m, ...h }, f = (t) => {
2042
+ const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$n, ...h }, f = (t) => {
2043
2043
  o && o(t);
2044
2044
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2045
2045
  const t = "nut-icon";
@@ -2076,8 +2076,8 @@ const a$m = {
2076
2076
  }
2077
2077
  ) });
2078
2078
  };
2079
- x$b.defaultProps = a$m;
2080
- const a$l = {
2079
+ x$b.defaultProps = a$n;
2080
+ const a$m = {
2081
2081
  className: "",
2082
2082
  style: void 0,
2083
2083
  name: "Close",
@@ -2086,7 +2086,7 @@ const a$l = {
2086
2086
  onClick: () => {
2087
2087
  }
2088
2088
  }, x$a = (h) => {
2089
- const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$l, ...h }, g = (t) => {
2089
+ const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$m, ...h }, g = (t) => {
2090
2090
  r && r(t);
2091
2091
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
2092
2092
  const t = "nut-icon";
@@ -2123,8 +2123,8 @@ const a$l = {
2123
2123
  }
2124
2124
  ) });
2125
2125
  };
2126
- x$a.defaultProps = a$l;
2127
- const a$k = {
2126
+ x$a.defaultProps = a$m;
2127
+ const a$l = {
2128
2128
  className: "",
2129
2129
  style: void 0,
2130
2130
  name: "Del",
@@ -2133,7 +2133,7 @@ const a$k = {
2133
2133
  onClick: () => {
2134
2134
  }
2135
2135
  }, y$6 = (h) => {
2136
- const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$k, ...h }, g = (t) => {
2136
+ const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$l, ...h }, g = (t) => {
2137
2137
  r && r(t);
2138
2138
  }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2139
2139
  const t = "nut-icon";
@@ -2170,8 +2170,8 @@ const a$k = {
2170
2170
  }
2171
2171
  ) });
2172
2172
  };
2173
- y$6.defaultProps = a$k;
2174
- const a$j = {
2173
+ y$6.defaultProps = a$l;
2174
+ const a$k = {
2175
2175
  className: "",
2176
2176
  style: void 0,
2177
2177
  name: "DownArrow",
@@ -2180,7 +2180,7 @@ const a$j = {
2180
2180
  onClick: () => {
2181
2181
  }
2182
2182
  }, x$9 = (h) => {
2183
- const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$j, ...h }, f = (t) => {
2183
+ const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$k, ...h }, f = (t) => {
2184
2184
  n && n(t);
2185
2185
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2186
2186
  const t = "nut-icon";
@@ -2217,8 +2217,8 @@ const a$j = {
2217
2217
  }
2218
2218
  ) });
2219
2219
  };
2220
- x$9.defaultProps = a$j;
2221
- const a$i = {
2220
+ x$9.defaultProps = a$k;
2221
+ const a$j = {
2222
2222
  className: "",
2223
2223
  style: void 0,
2224
2224
  name: "Failure",
@@ -2227,7 +2227,7 @@ const a$i = {
2227
2227
  onClick: () => {
2228
2228
  }
2229
2229
  }, x$8 = (h) => {
2230
- const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$i, ...h }, u = (t) => {
2230
+ const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$j, ...h }, u = (t) => {
2231
2231
  l2 && l2(t);
2232
2232
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2233
2233
  const t = "nut-icon";
@@ -2264,8 +2264,8 @@ const a$i = {
2264
2264
  }
2265
2265
  ) });
2266
2266
  };
2267
- x$8.defaultProps = a$i;
2268
- const a$h = {
2267
+ x$8.defaultProps = a$j;
2268
+ const a$i = {
2269
2269
  className: "",
2270
2270
  style: void 0,
2271
2271
  name: "ImageError",
@@ -2273,8 +2273,8 @@ const a$h = {
2273
2273
  height: "",
2274
2274
  onClick: () => {
2275
2275
  }
2276
- }, k$4 = (h) => {
2277
- const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$h, ...h }, g = (t) => {
2276
+ }, k$5 = (h) => {
2277
+ const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$i, ...h }, g = (t) => {
2278
2278
  o && o(t);
2279
2279
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2280
2280
  const t = "nut-icon";
@@ -2322,8 +2322,8 @@ const a$h = {
2322
2322
  }
2323
2323
  ) });
2324
2324
  };
2325
- k$4.defaultProps = a$h;
2326
- const a$g = {
2325
+ k$5.defaultProps = a$i;
2326
+ const a$h = {
2327
2327
  className: "",
2328
2328
  style: void 0,
2329
2329
  name: "Image",
@@ -2331,8 +2331,8 @@ const a$g = {
2331
2331
  height: "",
2332
2332
  onClick: () => {
2333
2333
  }
2334
- }, k$3 = (h) => {
2335
- const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$g, ...h }, g = (t) => {
2334
+ }, k$4 = (h) => {
2335
+ const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$h, ...h }, g = (t) => {
2336
2336
  r && r(t);
2337
2337
  }, o = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2338
2338
  const t = "nut-icon";
@@ -2380,8 +2380,8 @@ const a$g = {
2380
2380
  }
2381
2381
  ) });
2382
2382
  };
2383
- k$3.defaultProps = a$g;
2384
- const a$f = {
2383
+ k$4.defaultProps = a$h;
2384
+ const a$g = {
2385
2385
  className: "",
2386
2386
  style: void 0,
2387
2387
  name: "JoySmile",
@@ -2390,7 +2390,7 @@ const a$f = {
2390
2390
  onClick: () => {
2391
2391
  }
2392
2392
  }, x$7 = (h) => {
2393
- const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$f, ...h }, g = (t) => {
2393
+ const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$g, ...h }, g = (t) => {
2394
2394
  r && r(t);
2395
2395
  }, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2396
2396
  const t = "nut-icon";
@@ -2427,8 +2427,8 @@ const a$f = {
2427
2427
  }
2428
2428
  ) });
2429
2429
  };
2430
- x$7.defaultProps = a$f;
2431
- const a$e = {
2430
+ x$7.defaultProps = a$g;
2431
+ const a$f = {
2432
2432
  className: "",
2433
2433
  style: void 0,
2434
2434
  name: "Left",
@@ -2437,7 +2437,7 @@ const a$e = {
2437
2437
  onClick: () => {
2438
2438
  }
2439
2439
  }, y$5 = (h) => {
2440
- const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$e, ...h }, g = (t) => {
2440
+ const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$f, ...h }, g = (t) => {
2441
2441
  n && n(t);
2442
2442
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2443
2443
  const t = "nut-icon";
@@ -2474,8 +2474,8 @@ const a$e = {
2474
2474
  }
2475
2475
  ) });
2476
2476
  };
2477
- y$5.defaultProps = a$e;
2478
- const a$d = {
2477
+ y$5.defaultProps = a$f;
2478
+ const a$e = {
2479
2479
  className: "",
2480
2480
  style: void 0,
2481
2481
  name: "Link",
@@ -2484,7 +2484,7 @@ const a$d = {
2484
2484
  onClick: () => {
2485
2485
  }
2486
2486
  }, x$6 = (h) => {
2487
- const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$d, ...h }, g = (t) => {
2487
+ const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$e, ...h }, g = (t) => {
2488
2488
  n && n(t);
2489
2489
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
2490
2490
  const t = "nut-icon";
@@ -2521,8 +2521,8 @@ const a$d = {
2521
2521
  }
2522
2522
  ) });
2523
2523
  };
2524
- x$6.defaultProps = a$d;
2525
- const a$c = {
2524
+ x$6.defaultProps = a$e;
2525
+ const a$d = {
2526
2526
  className: "",
2527
2527
  style: void 0,
2528
2528
  name: "Loading",
@@ -2530,8 +2530,8 @@ const a$c = {
2530
2530
  height: "",
2531
2531
  onClick: () => {
2532
2532
  }
2533
- }, k$2 = (h) => {
2534
- const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$c, ...h }, f = (c) => {
2533
+ }, k$3 = (h) => {
2534
+ const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$d, ...h }, f = (c) => {
2535
2535
  o && o(c);
2536
2536
  }, n = (c) => c === "" ? "" : isNaN(Number(c)) ? String(c) : c + "px", z = () => {
2537
2537
  const c = "nut-icon";
@@ -2568,8 +2568,8 @@ const a$c = {
2568
2568
  }
2569
2569
  ) });
2570
2570
  };
2571
- k$2.defaultProps = a$c;
2572
- const a$b = {
2571
+ k$3.defaultProps = a$d;
2572
+ const a$c = {
2573
2573
  className: "",
2574
2574
  style: void 0,
2575
2575
  name: "Location2",
@@ -2578,7 +2578,7 @@ const a$b = {
2578
2578
  onClick: () => {
2579
2579
  }
2580
2580
  }, x$5 = (h) => {
2581
- const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$b, ...h }, g = (t) => {
2581
+ const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$c, ...h }, g = (t) => {
2582
2582
  n && n(t);
2583
2583
  }, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
2584
2584
  const t = "nut-icon";
@@ -2615,8 +2615,8 @@ const a$b = {
2615
2615
  }
2616
2616
  ) });
2617
2617
  };
2618
- x$5.defaultProps = a$b;
2619
- const a$a = {
2618
+ x$5.defaultProps = a$c;
2619
+ const a$b = {
2620
2620
  className: "",
2621
2621
  style: void 0,
2622
2622
  name: "MaskClose",
@@ -2625,7 +2625,7 @@ const a$a = {
2625
2625
  onClick: () => {
2626
2626
  }
2627
2627
  }, x$4 = (h) => {
2628
- const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$a, ...h }, g = (t) => {
2628
+ const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$b, ...h }, g = (t) => {
2629
2629
  l2 && l2(t);
2630
2630
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
2631
2631
  const t = "nut-icon";
@@ -2662,8 +2662,8 @@ const a$a = {
2662
2662
  }
2663
2663
  ) });
2664
2664
  };
2665
- x$4.defaultProps = a$a;
2666
- const a$9 = {
2665
+ x$4.defaultProps = a$b;
2666
+ const a$a = {
2667
2667
  className: "",
2668
2668
  style: void 0,
2669
2669
  name: "Minus",
@@ -2672,7 +2672,7 @@ const a$9 = {
2672
2672
  onClick: () => {
2673
2673
  }
2674
2674
  }, y$4 = (h) => {
2675
- const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$9, ...h }, u = (t) => {
2675
+ const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$a, ...h }, u = (t) => {
2676
2676
  o && o(t);
2677
2677
  }, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
2678
2678
  const t = "nut-icon";
@@ -2709,7 +2709,54 @@ const a$9 = {
2709
2709
  }
2710
2710
  ) });
2711
2711
  };
2712
- y$4.defaultProps = a$9;
2712
+ y$4.defaultProps = a$a;
2713
+ const a$9 = {
2714
+ className: "",
2715
+ style: void 0,
2716
+ name: "My",
2717
+ width: "",
2718
+ height: "",
2719
+ onClick: () => {
2720
+ }
2721
+ }, k$2 = (h) => {
2722
+ const { className: o, style: d, name: s, color: m, width: p, height: f, onClick: r } = { ...a$9, ...h }, g = (t) => {
2723
+ r && r(t);
2724
+ }, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
2725
+ const t = "nut-icon";
2726
+ return classNames({
2727
+ [`${o}`]: o,
2728
+ [t]: true,
2729
+ [t + "-" + s]: s
2730
+ });
2731
+ }, e = {}, i = n(p || ""), l2 = n(f || "");
2732
+ i && (e.width = i), l2 && (e.height = l2);
2733
+ const y2 = () => ({
2734
+ ...d,
2735
+ ...e
2736
+ });
2737
+ return /* @__PURE__ */ cr(lr, { children: /* @__PURE__ */ cr(
2738
+ "svg",
2739
+ {
2740
+ className: u(),
2741
+ style: y2(),
2742
+ onClick: g,
2743
+ xmlns: "http://www.w3.org/2000/svg",
2744
+ color: m,
2745
+ viewBox: "0 0 1024 1024",
2746
+ "aria-labelledby": s,
2747
+ role: "presentation",
2748
+ children: /* @__PURE__ */ cr(
2749
+ "path",
2750
+ {
2751
+ 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",
2752
+ fill: "currentColor",
2753
+ fillOpacity: "0.9"
2754
+ }
2755
+ )
2756
+ }
2757
+ ) });
2758
+ };
2759
+ k$2.defaultProps = a$9;
2713
2760
  const a$8 = {
2714
2761
  className: "",
2715
2762
  style: void 0,
@@ -3186,7 +3233,7 @@ const ComponentDefaults = {
3186
3233
  style: {}
3187
3234
  };
3188
3235
  const prefixCls = "nut-button";
3189
- const defaultProps$1r = {
3236
+ const defaultProps$1s = {
3190
3237
  ...ComponentDefaults,
3191
3238
  color: "",
3192
3239
  type: "default",
@@ -3218,7 +3265,7 @@ const Button = React__default.forwardRef(
3218
3265
  style,
3219
3266
  ...rest
3220
3267
  } = {
3221
- ...defaultProps$1r,
3268
+ ...defaultProps$1s,
3222
3269
  ...props
3223
3270
  };
3224
3271
  const getStyle = useCallback(() => {
@@ -3265,7 +3312,7 @@ const Button = React__default.forwardRef(
3265
3312
  style: { ...getStyle(), ...style },
3266
3313
  onClick: (e) => handleClick2(e),
3267
3314
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "nut-button__warp", children: [
3268
- loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, { className: "nut-icon-loading" }) : null,
3315
+ loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, { className: "nut-icon-loading" }) : null,
3269
3316
  !loading && icon ? icon : null,
3270
3317
  children && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: icon || loading ? "nut-button-text" : "", children })
3271
3318
  ] })
@@ -3275,7 +3322,7 @@ const Button = React__default.forwardRef(
3275
3322
  }
3276
3323
  );
3277
3324
  Button.displayName = "NutButton";
3278
- const defaultProps$1q = {
3325
+ const defaultProps$1r = {
3279
3326
  ...ComponentDefaults,
3280
3327
  title: null,
3281
3328
  description: null,
@@ -3285,7 +3332,7 @@ const defaultProps$1q = {
3285
3332
  onClick: (event) => {
3286
3333
  }
3287
3334
  };
3288
- const classPrefix$a = "nut-cell";
3335
+ const classPrefix$g = "nut-cell";
3289
3336
  const Cell = (props) => {
3290
3337
  const {
3291
3338
  children,
@@ -3299,7 +3346,7 @@ const Cell = (props) => {
3299
3346
  style,
3300
3347
  ...rest
3301
3348
  } = {
3302
- ...defaultProps$1q,
3349
+ ...defaultProps$1r,
3303
3350
  ...props
3304
3351
  };
3305
3352
  const handleClick2 = (event) => {
@@ -3316,48 +3363,55 @@ const Cell = (props) => {
3316
3363
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3317
3364
  "div",
3318
3365
  {
3319
- className: classNames(classPrefix$a, className),
3366
+ className: classNames(classPrefix$g, className),
3320
3367
  onClick: (event) => handleClick2(event),
3321
3368
  style: baseStyle,
3322
3369
  ...rest,
3323
3370
  children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3324
- title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$a}__left`, children: [
3325
- title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__title`, children: title }) : null,
3326
- description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__description`, children: description }) : null
3371
+ title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$g}__left`, children: [
3372
+ title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$g}__title`, children: title }) : null,
3373
+ description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$g}__description`, children: description }) : null
3327
3374
  ] }) : null,
3328
3375
  extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
3329
3376
  "div",
3330
3377
  {
3331
- className: `${classPrefix$a}__extra`,
3378
+ className: `${classPrefix$g}__extra`,
3332
3379
  style: styles,
3333
3380
  children: extra
3334
3381
  }
3335
3382
  ) : null,
3336
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__divider` })
3383
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$g}__divider` })
3337
3384
  ] })
3338
3385
  }
3339
3386
  );
3340
3387
  };
3341
- Cell.defaultProps = defaultProps$1q;
3388
+ Cell.defaultProps = defaultProps$1r;
3342
3389
  Cell.displayName = "NutCell";
3343
- const defaultProps$1p = {
3390
+ const defaultProps$1q = {
3344
3391
  ...ComponentDefaults,
3345
3392
  title: "",
3346
- description: ""
3393
+ description: "",
3394
+ divider: true
3347
3395
  };
3348
- const classPrefix$9 = "nut-cell-group";
3396
+ const classPrefix$f = "nut-cell-group";
3349
3397
  const CellGroup = (props) => {
3350
- const { children, className, style, title, description, ...rest } = {
3351
- ...defaultProps$1p,
3398
+ const { children, className, style, title, description, divider, ...rest } = {
3399
+ ...defaultProps$1q,
3352
3400
  ...props
3353
3401
  };
3354
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$9, className), ...rest, children: [
3355
- title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__title`, children: title }) : null,
3356
- description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__description`, children: description }) : null,
3357
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__wrap`, children })
3402
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$f, className), ...rest, children: [
3403
+ title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$f}__title`, children: title }) : null,
3404
+ description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$f}__description`, children: description }) : null,
3405
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
3406
+ "div",
3407
+ {
3408
+ className: `${classPrefix$f}__wrap ${divider ? `${classPrefix$f}__wrap--divider` : ""}`,
3409
+ children
3410
+ }
3411
+ )
3358
3412
  ] });
3359
3413
  };
3360
- CellGroup.defaultProps = defaultProps$1p;
3414
+ CellGroup.defaultProps = defaultProps$1q;
3361
3415
  CellGroup.displayName = "NutCellGroup";
3362
3416
  var INFINITY = 1 / 0;
3363
3417
  var symbolTag = "[object Symbol]";
@@ -3772,7 +3826,7 @@ const zhCN = {
3772
3826
  errorCanvasTips: "当前环境不支持Canvas"
3773
3827
  }
3774
3828
  };
3775
- const defaultProps$1o = {
3829
+ const defaultProps$1p = {
3776
3830
  locale: zhCN
3777
3831
  };
3778
3832
  const defaultConfigRef = {
@@ -3795,7 +3849,7 @@ function convertThemeVarsToCSSVars(themeVars) {
3795
3849
  return cssVars;
3796
3850
  }
3797
3851
  const ConfigProvider = (props) => {
3798
- const { children, ...config2 } = { ...defaultProps$1o, ...props };
3852
+ const { children, ...config2 } = { ...defaultProps$1p, ...props };
3799
3853
  const parentConfig = useConfig();
3800
3854
  const theme = config2.theme || {};
3801
3855
  const style = useMemo(
@@ -3813,12 +3867,12 @@ const ConfigProvider = (props) => {
3813
3867
  }
3814
3868
  );
3815
3869
  };
3816
- ConfigProvider.defaultProps = defaultProps$1o;
3870
+ ConfigProvider.defaultProps = defaultProps$1p;
3817
3871
  ConfigProvider.displayName = "NutConfigProvider";
3818
3872
  const pxCheck = (value) => {
3819
3873
  return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
3820
3874
  };
3821
- const defaultProps$1n = {
3875
+ const defaultProps$1o = {
3822
3876
  ...ComponentDefaults,
3823
3877
  fit: "fill",
3824
3878
  position: "center",
@@ -3829,7 +3883,7 @@ const defaultProps$1n = {
3829
3883
  loading: true,
3830
3884
  lazy: false
3831
3885
  };
3832
- const classPrefix$8 = "nut-image";
3886
+ const classPrefix$e = "nut-image";
3833
3887
  const Image$1 = (props) => {
3834
3888
  const {
3835
3889
  className,
@@ -3847,21 +3901,19 @@ const Image$1 = (props) => {
3847
3901
  onClick,
3848
3902
  onLoad,
3849
3903
  onError
3850
- } = { ...defaultProps$1n, ...props };
3904
+ } = { ...defaultProps$1o, ...props };
3851
3905
  const [innerLoading, setInnerLoading] = useState(true);
3852
3906
  const [isError, setIsError] = useState(false);
3853
- const [_src, setSrc] = useState("");
3854
3907
  const imgRef = useRef(null);
3855
3908
  useEffect(() => {
3856
3909
  if (imgRef.current && imgRef.current.complete && imgRef.current.naturalHeight !== 0) {
3857
3910
  setInnerLoading(false);
3858
3911
  } else if (src) {
3859
- setSrc(src);
3860
- setIsError(false);
3861
3912
  setInnerLoading(true);
3862
3913
  }
3863
3914
  }, [src]);
3864
3915
  const handleLoad = () => {
3916
+ setIsError(false);
3865
3917
  setInnerLoading(false);
3866
3918
  onLoad && onLoad();
3867
3919
  };
@@ -3924,7 +3976,7 @@ const Image$1 = (props) => {
3924
3976
  if (!isError)
3925
3977
  return null;
3926
3978
  if (typeof error === "boolean" && error === true && !innerLoading) {
3927
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-error", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$4, {}) });
3979
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-error", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$5, {}) });
3928
3980
  }
3929
3981
  if (React__default.isValidElement(error) && !innerLoading) {
3930
3982
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-error", children: error });
@@ -3935,7 +3987,7 @@ const Image$1 = (props) => {
3935
3987
  if (!loading)
3936
3988
  return null;
3937
3989
  if (typeof loading === "boolean" && loading === true && innerLoading) {
3938
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-loading", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, {}) });
3990
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-loading", children: /* @__PURE__ */ jsxRuntimeExports.jsx(k$4, {}) });
3939
3991
  }
3940
3992
  if (React__default.isValidElement(loading) && innerLoading) {
3941
3993
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-img-loading", children: loading });
@@ -3945,7 +3997,7 @@ const Image$1 = (props) => {
3945
3997
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
3946
3998
  "div",
3947
3999
  {
3948
- className: classNames(classPrefix$8, className),
4000
+ className: classNames(classPrefix$e, className),
3949
4001
  style: containerStyle,
3950
4002
  onClick: (e) => {
3951
4003
  imageClick(e);
@@ -3957,7 +4009,7 @@ const Image$1 = (props) => {
3957
4009
  ref: imgRef,
3958
4010
  className: "nut-img lazyload",
3959
4011
  style: imgStyle,
3960
- "data-src": _src,
4012
+ "data-src": src,
3961
4013
  alt,
3962
4014
  loading: "lazy",
3963
4015
  onLoad: handleLoad,
@@ -3969,7 +4021,7 @@ const Image$1 = (props) => {
3969
4021
  ref: imgRef,
3970
4022
  className: "nut-img",
3971
4023
  style: imgStyle,
3972
- src: _src,
4024
+ src,
3973
4025
  alt,
3974
4026
  onLoad: handleLoad,
3975
4027
  onError: handleError
@@ -3981,7 +4033,7 @@ const Image$1 = (props) => {
3981
4033
  }
3982
4034
  );
3983
4035
  };
3984
- Image$1.defaultProps = defaultProps$1n;
4036
+ Image$1.defaultProps = defaultProps$1o;
3985
4037
  Image$1.displayName = "NutImage";
3986
4038
  const defaultOverlayProps = {
3987
4039
  ...ComponentDefaults,
@@ -4066,7 +4118,7 @@ const Overlay = (props) => {
4066
4118
  Overlay.defaultProps = defaultOverlayProps;
4067
4119
  Overlay.displayName = "NutOverlay";
4068
4120
  const DataContext$2 = createContext({});
4069
- const defaultProps$1m = {
4121
+ const defaultProps$1n = {
4070
4122
  ...ComponentDefaults,
4071
4123
  span: "24",
4072
4124
  offset: "0",
@@ -4074,7 +4126,7 @@ const defaultProps$1m = {
4074
4126
  };
4075
4127
  const Col = (props) => {
4076
4128
  const { className, style, span, offset, children, onClick } = {
4077
- ...defaultProps$1m,
4129
+ ...defaultProps$1n,
4078
4130
  ...props
4079
4131
  };
4080
4132
  const [colName, setColName] = useState("");
@@ -4106,39 +4158,39 @@ const Col = (props) => {
4106
4158
  }
4107
4159
  );
4108
4160
  };
4109
- Col.defaultProps = defaultProps$1m;
4161
+ Col.defaultProps = defaultProps$1n;
4110
4162
  Col.displayName = "NutCol";
4111
- const defaultProps$1l = {
4163
+ const defaultProps$1m = {
4112
4164
  ...ComponentDefaults,
4113
4165
  contentPosition: "center",
4114
4166
  direction: "horizontal"
4115
4167
  };
4116
- const classPrefix$7 = `nut-divider`;
4168
+ const classPrefix$d = `nut-divider`;
4117
4169
  const Divider = (props) => {
4118
4170
  const { children, contentPosition, style, className, direction, ...rest } = {
4119
- ...defaultProps$1l,
4171
+ ...defaultProps$1m,
4120
4172
  ...props
4121
4173
  };
4122
4174
  const classes = direction === "horizontal" ? classNames({
4123
- [`${classPrefix$7}`]: true,
4124
- [`${classPrefix$7}__center`]: children,
4125
- [`${classPrefix$7}__left`]: contentPosition === "left",
4126
- [`${classPrefix$7}__right`]: contentPosition === "right",
4127
- [`${classPrefix$7}__hairline`]: true
4175
+ [`${classPrefix$d}`]: true,
4176
+ [`${classPrefix$d}__center`]: children,
4177
+ [`${classPrefix$d}__left`]: contentPosition === "left",
4178
+ [`${classPrefix$d}__right`]: contentPosition === "right",
4179
+ [`${classPrefix$d}__hairline`]: true
4128
4180
  }) : classNames({
4129
- [`${classPrefix$7}`]: true,
4130
- [`${classPrefix$7}__vertical`]: direction === "vertical"
4181
+ [`${classPrefix$d}`]: true,
4182
+ [`${classPrefix$d}__vertical`]: direction === "vertical"
4131
4183
  });
4132
4184
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
4133
4185
  };
4134
- Divider.defaultProps = defaultProps$1l;
4186
+ Divider.defaultProps = defaultProps$1m;
4135
4187
  Divider.displayName = "NutDivider";
4136
4188
  const gridContext = {
4137
4189
  onClick: (item, index) => {
4138
4190
  }
4139
4191
  };
4140
4192
  const GridContext = React__default.createContext(gridContext);
4141
- const defaultProps$1k = {
4193
+ const defaultProps$1l = {
4142
4194
  text: "",
4143
4195
  columns: 4,
4144
4196
  gap: 0,
@@ -4164,7 +4216,7 @@ const GridItem = (props) => {
4164
4216
  onClick,
4165
4217
  ...rest
4166
4218
  } = {
4167
- ...defaultProps$1k,
4219
+ ...defaultProps$1l,
4168
4220
  ...props
4169
4221
  };
4170
4222
  const classPrefix2 = "nut-grid-item";
@@ -4225,9 +4277,9 @@ const GridItem = (props) => {
4225
4277
  }
4226
4278
  );
4227
4279
  };
4228
- GridItem.defaultProps = defaultProps$1k;
4280
+ GridItem.defaultProps = defaultProps$1l;
4229
4281
  GridItem.displayName = "NutGridItem";
4230
- const defaultProps$1j = {
4282
+ const defaultProps$1k = {
4231
4283
  columns: 4,
4232
4284
  gap: 0,
4233
4285
  center: true,
@@ -4248,7 +4300,7 @@ const Grid = (props) => {
4248
4300
  className,
4249
4301
  onClick,
4250
4302
  ...rest
4251
- } = { ...defaultProps$1j, ...props };
4303
+ } = { ...defaultProps$1k, ...props };
4252
4304
  const childrenDom = React__default.Children.toArray(children);
4253
4305
  const classPrefix2 = "nut-grid";
4254
4306
  const rootClass = () => {
@@ -4278,18 +4330,18 @@ const Grid = (props) => {
4278
4330
  });
4279
4331
  }) }) });
4280
4332
  };
4281
- Grid.defaultProps = defaultProps$1j;
4333
+ Grid.defaultProps = defaultProps$1k;
4282
4334
  Grid.displayName = "NutGrid";
4283
4335
  Grid.Item = GridItem;
4284
- const defaultProps$1i = {};
4336
+ const defaultProps$1j = {};
4285
4337
  const Layout = (props) => {
4286
- ({ ...defaultProps$1i, ...props });
4338
+ ({ ...defaultProps$1j, ...props });
4287
4339
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-layout", children: "Layout" });
4288
4340
  };
4289
- Layout.defaultProps = defaultProps$1i;
4341
+ Layout.defaultProps = defaultProps$1j;
4290
4342
  Layout.displayName = "NutLayout";
4291
- const classPrefix$6 = "nut-row";
4292
- const defaultProps$1h = {
4343
+ const classPrefix$c = "nut-row";
4344
+ const defaultProps$1i = {
4293
4345
  ...ComponentDefaults,
4294
4346
  type: "",
4295
4347
  justify: "start",
@@ -4309,7 +4361,7 @@ const Row = (props) => {
4309
4361
  gutter,
4310
4362
  onClick
4311
4363
  } = {
4312
- ...defaultProps$1h,
4364
+ ...defaultProps$1i,
4313
4365
  ...props
4314
4366
  };
4315
4367
  const getClass = (prefix2, type22) => {
@@ -4323,7 +4375,7 @@ const Row = (props) => {
4323
4375
  ${getClass("justify", justify)}
4324
4376
  ${getClass("align", align)}
4325
4377
  ${getClass("flex", wrap)}
4326
- ${classPrefix$6}
4378
+ ${classPrefix$c}
4327
4379
  `;
4328
4380
  };
4329
4381
  const parentRow = {
@@ -4341,7 +4393,7 @@ const Row = (props) => {
4341
4393
  children
4342
4394
  ) });
4343
4395
  };
4344
- Row.defaultProps = defaultProps$1h;
4396
+ Row.defaultProps = defaultProps$1i;
4345
4397
  Row.displayName = "NutRow";
4346
4398
  const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
4347
4399
  const defaultRoot = canUseDom ? window : void 0;
@@ -4416,13 +4468,13 @@ function useWatch(dep, callback, config2 = { immediate: false }) {
4416
4468
  stop2.current = true;
4417
4469
  };
4418
4470
  }
4419
- const defaultProps$1g = {
4471
+ const defaultProps$1h = {
4420
4472
  ...ComponentDefaults,
4421
4473
  position: "top",
4422
4474
  threshold: 0,
4423
4475
  zIndex: 2e3
4424
4476
  };
4425
- const classPrefix$5 = "nut-sticky";
4477
+ const classPrefix$b = "nut-sticky";
4426
4478
  const Sticky = (props) => {
4427
4479
  const {
4428
4480
  position,
@@ -4434,7 +4486,7 @@ const Sticky = (props) => {
4434
4486
  threshold,
4435
4487
  onChange,
4436
4488
  ...rest
4437
- } = { ...defaultProps$1g, ...props };
4489
+ } = { ...defaultProps$1h, ...props };
4438
4490
  const stickyRef = useRef(null);
4439
4491
  const rootRef = useRef(null);
4440
4492
  const [isFixed, setIsFixed] = useState(false);
@@ -4544,15 +4596,15 @@ const Sticky = (props) => {
4544
4596
  {
4545
4597
  ref: rootRef,
4546
4598
  style: { ...style, ...rootStyle },
4547
- className: classNames(classPrefix$5, className),
4599
+ className: classNames(classPrefix$b, className),
4548
4600
  ...rest,
4549
4601
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle, children })
4550
4602
  }
4551
4603
  );
4552
4604
  };
4553
- Sticky.defaultProps = defaultProps$1g;
4605
+ Sticky.defaultProps = defaultProps$1h;
4554
4606
  Sticky.displayName = "NutSticky";
4555
- const defaultProps$1f = {
4607
+ const defaultProps$1g = {
4556
4608
  ...ComponentDefaults,
4557
4609
  target: "",
4558
4610
  threshold: 200,
@@ -4570,7 +4622,7 @@ const BackTop = (props) => {
4570
4622
  style,
4571
4623
  onClick
4572
4624
  } = {
4573
- ...defaultProps$1f,
4625
+ ...defaultProps$1g,
4574
4626
  ...props
4575
4627
  };
4576
4628
  const classPrefix2 = "nut-backtop";
@@ -4668,7 +4720,7 @@ const BackTop = (props) => {
4668
4720
  }
4669
4721
  );
4670
4722
  };
4671
- BackTop.defaultProps = defaultProps$1f;
4723
+ BackTop.defaultProps = defaultProps$1g;
4672
4724
  BackTop.displayName = "NutBackTop";
4673
4725
  function clamp$1(v, min, max) {
4674
4726
  return Math.max(min, Math.min(v, max));
@@ -9786,7 +9838,7 @@ const host = createHost(primitives, {
9786
9838
  });
9787
9839
  const animated = host.animated;
9788
9840
  const elevatorContext = createContext({});
9789
- const defaultProps$1e = {
9841
+ const defaultProps$1f = {
9790
9842
  ...ComponentDefaults,
9791
9843
  height: "200px",
9792
9844
  floorKey: "title",
@@ -9810,7 +9862,7 @@ const Elevator = (props) => {
9810
9862
  children,
9811
9863
  ...rest
9812
9864
  } = {
9813
- ...defaultProps$1e,
9865
+ ...defaultProps$1f,
9814
9866
  ...props
9815
9867
  };
9816
9868
  const classPrefix2 = "nut-elevator";
@@ -9993,10 +10045,10 @@ const Elevator = (props) => {
9993
10045
  ) })
9994
10046
  ] });
9995
10047
  };
9996
- Elevator.defaultProps = defaultProps$1e;
10048
+ Elevator.defaultProps = defaultProps$1f;
9997
10049
  Elevator.displayName = "NutElevator";
9998
10050
  Elevator.Context = elevatorContext;
9999
- const defaultProps$1d = {
10051
+ const defaultProps$1e = {
10000
10052
  ...ComponentDefaults,
10001
10053
  activeText: "",
10002
10054
  inactiveText: "",
@@ -10024,7 +10076,7 @@ const FixedNav = (props) => {
10024
10076
  content,
10025
10077
  ...rest
10026
10078
  } = {
10027
- ...defaultProps$1d,
10079
+ ...defaultProps$1e,
10028
10080
  ...props
10029
10081
  };
10030
10082
  const classPrefix2 = "nut-fixednav";
@@ -10083,9 +10135,9 @@ const FixedNav = (props) => {
10083
10135
  }
10084
10136
  );
10085
10137
  };
10086
- FixedNav.defaultProps = defaultProps$1d;
10138
+ FixedNav.defaultProps = defaultProps$1e;
10087
10139
  FixedNav.displayName = "NutFixedNav";
10088
- const defaultProps$1c = {
10140
+ const defaultProps$1d = {
10089
10141
  ...ComponentDefaults,
10090
10142
  left: "",
10091
10143
  right: "",
@@ -10108,7 +10160,7 @@ const NavBar = (props) => {
10108
10160
  zIndex,
10109
10161
  onClickBack
10110
10162
  } = {
10111
- ...defaultProps$1c,
10163
+ ...defaultProps$1d,
10112
10164
  ...props
10113
10165
  };
10114
10166
  const classPrefix2 = "nut-navbar";
@@ -10152,7 +10204,7 @@ const NavBar = (props) => {
10152
10204
  const cls = classNames(classPrefix2, classes, className);
10153
10205
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: fixed && placeholder ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}--placeholder`, children: renderWrapper() }) : renderWrapper() });
10154
10206
  };
10155
- NavBar.defaultProps = defaultProps$1c;
10207
+ NavBar.defaultProps = defaultProps$1d;
10156
10208
  NavBar.displayName = "NutNavBar";
10157
10209
  function _extends$1() {
10158
10210
  _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
@@ -11895,7 +11947,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$1({},
11895
11947
  onExited: propTypesExports.func
11896
11948
  }) : {};
11897
11949
  const CSSTransition$1 = CSSTransition;
11898
- const defaultProps$1b = {
11950
+ const defaultProps$1c = {
11899
11951
  ...ComponentDefaults,
11900
11952
  position: "center",
11901
11953
  transition: "",
@@ -12074,7 +12126,7 @@ const Popup = (props) => {
12074
12126
  }, [position, transition]);
12075
12127
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderToContainer(portal, renderNode()) });
12076
12128
  };
12077
- Popup.defaultProps = defaultProps$1b;
12129
+ Popup.defaultProps = defaultProps$1c;
12078
12130
  Popup.displayName = "NutPopup";
12079
12131
  const handleClick = (e) => {
12080
12132
  e.stopPropagation();
@@ -12090,7 +12142,7 @@ const handleClick = (e) => {
12090
12142
  }
12091
12143
  };
12092
12144
  const OffsetContext = createContext(20);
12093
- const defaultProps$1a = {
12145
+ const defaultProps$1b = {
12094
12146
  showhead: false,
12095
12147
  position: "left",
12096
12148
  width: "80%"
@@ -12107,7 +12159,7 @@ const SideNavBar = (props) => {
12107
12159
  onClose,
12108
12160
  ...rest
12109
12161
  } = {
12110
- ...defaultProps$1a,
12162
+ ...defaultProps$1b,
12111
12163
  ...props
12112
12164
  };
12113
12165
  const offset = props.offset ? Number(props.offset) : 20;
@@ -12143,7 +12195,7 @@ const SideNavBar = (props) => {
12143
12195
  }
12144
12196
  );
12145
12197
  };
12146
- SideNavBar.defaultProps = defaultProps$1a;
12198
+ SideNavBar.defaultProps = defaultProps$1b;
12147
12199
  SideNavBar.displayName = "NutSideNavBar";
12148
12200
  const SideNavBarItem = (props) => {
12149
12201
  const { title, key, children, onClick, ...rest } = props;
@@ -12161,12 +12213,12 @@ const SideNavBarItem = (props) => {
12161
12213
  }
12162
12214
  );
12163
12215
  };
12164
- const defaultProps$19 = {
12216
+ const defaultProps$1a = {
12165
12217
  open: true
12166
12218
  };
12167
12219
  const SubSideNavBar = (props) => {
12168
12220
  const { title, key, children, onClick, open, ...rest } = {
12169
- ...defaultProps$19,
12221
+ ...defaultProps$1a,
12170
12222
  ...props
12171
12223
  };
12172
12224
  const offset = useContext(OffsetContext);
@@ -12240,7 +12292,7 @@ function usePropsValue({
12240
12292
  }
12241
12293
  return [uncontrolled, handleUncontrolledChange];
12242
12294
  }
12243
- const defaultProps$18 = {
12295
+ const defaultProps$19 = {
12244
12296
  ...ComponentDefaults,
12245
12297
  value: "",
12246
12298
  dot: false,
@@ -12251,7 +12303,7 @@ const defaultProps$18 = {
12251
12303
  };
12252
12304
  const Badge = (props) => {
12253
12305
  const { className, style, value, max, children, dot, top, right, color } = {
12254
- ...defaultProps$18,
12306
+ ...defaultProps$19,
12255
12307
  ...props
12256
12308
  };
12257
12309
  const classPrefix2 = "nut-badge";
@@ -12282,9 +12334,9 @@ const Badge = (props) => {
12282
12334
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
12283
12335
  ] });
12284
12336
  };
12285
- Badge.defaultProps = defaultProps$18;
12337
+ Badge.defaultProps = defaultProps$19;
12286
12338
  Badge.displayName = "NutBadge";
12287
- const defaultProps$17 = {
12339
+ const defaultProps$18 = {
12288
12340
  ...ComponentDefaults,
12289
12341
  title: "",
12290
12342
  icon: null,
@@ -12306,7 +12358,7 @@ const TabbarItem = (props) => {
12306
12358
  handleClick: handleClick2,
12307
12359
  ...rest
12308
12360
  } = {
12309
- ...defaultProps$17,
12361
+ ...defaultProps$18,
12310
12362
  ...props
12311
12363
  };
12312
12364
  const classPrefix2 = "nut-tabbar-item";
@@ -12333,7 +12385,7 @@ const TabbarItem = (props) => {
12333
12385
  }
12334
12386
  );
12335
12387
  };
12336
- const defaultProps$16 = {
12388
+ const defaultProps$17 = {
12337
12389
  ...ComponentDefaults,
12338
12390
  defaultValue: 0,
12339
12391
  fixed: false,
@@ -12356,7 +12408,7 @@ const Tabbar = (props) => {
12356
12408
  style,
12357
12409
  onSwitch
12358
12410
  } = {
12359
- ...defaultProps$16,
12411
+ ...defaultProps$17,
12360
12412
  ...props
12361
12413
  };
12362
12414
  const classPrefix2 = "nut-tabbar";
@@ -12393,17 +12445,17 @@ const Tabbar = (props) => {
12393
12445
  }
12394
12446
  );
12395
12447
  };
12396
- Tabbar.defaultProps = defaultProps$16;
12448
+ Tabbar.defaultProps = defaultProps$17;
12397
12449
  Tabbar.displayName = "NutTabbar";
12398
12450
  Tabbar.Item = TabbarItem;
12399
- const defaultProps$15 = {
12451
+ const defaultProps$16 = {
12400
12452
  title: "",
12401
12453
  value: "",
12402
12454
  disabled: false
12403
12455
  };
12404
12456
  const TabPane = (props) => {
12405
12457
  const { children, autoHeightClassName, className, disabled } = {
12406
- ...defaultProps$15,
12458
+ ...defaultProps$16,
12407
12459
  ...props
12408
12460
  };
12409
12461
  const classPrefix2 = "nut-tabpane";
@@ -12430,7 +12482,7 @@ function requestAniFrame() {
12430
12482
  }
12431
12483
  }
12432
12484
  const requestAniFrame$1 = requestAniFrame();
12433
- const defaultProps$14 = {
12485
+ const defaultProps$15 = {
12434
12486
  ...ComponentDefaults,
12435
12487
  tabStyle: {},
12436
12488
  activeColor: "",
@@ -12439,7 +12491,7 @@ const defaultProps$14 = {
12439
12491
  duration: 300,
12440
12492
  autoHeight: false
12441
12493
  };
12442
- const classPrefix$4 = "nut-tabs";
12494
+ const classPrefix$a = "nut-tabs";
12443
12495
  const Tabs = (props) => {
12444
12496
  const {
12445
12497
  activeColor,
@@ -12456,7 +12508,7 @@ const Tabs = (props) => {
12456
12508
  autoHeight,
12457
12509
  ...rest
12458
12510
  } = {
12459
- ...defaultProps$14,
12511
+ ...defaultProps$15,
12460
12512
  ...props
12461
12513
  };
12462
12514
  const [value, setValue] = usePropsValue({
@@ -12517,15 +12569,25 @@ const Tabs = (props) => {
12517
12569
  return titles2;
12518
12570
  };
12519
12571
  const titles = useRef(getTitles());
12572
+ useEffect(() => {
12573
+ titles.current = getTitles();
12574
+ let current = "";
12575
+ titles.current.forEach((title2) => {
12576
+ if (title2.value === value) {
12577
+ current = value;
12578
+ }
12579
+ });
12580
+ setValue(current);
12581
+ }, [children]);
12520
12582
  const classes = classNames(
12521
- classPrefix$4,
12522
- `${classPrefix$4}--${direction}`,
12583
+ classPrefix$a,
12584
+ `${classPrefix$a}--${direction}`,
12523
12585
  className
12524
12586
  );
12525
- const classesTitle = classNames(`${classPrefix$4}__titles`, {
12526
- [`${classPrefix$4}__titles--${activeType}`]: activeType,
12527
- [`${classPrefix$4}__titles--scrollable`]: true,
12528
- [`${classPrefix$4}__titles--${align}`]: align
12587
+ const classesTitle = classNames(`${classPrefix$a}__titles`, {
12588
+ [`${classPrefix$a}__titles--${activeType}`]: activeType,
12589
+ [`${classPrefix$a}__titles--scrollable`]: true,
12590
+ [`${classPrefix$a}__titles--${align}`]: align
12529
12591
  });
12530
12592
  const tabsActiveStyle = {
12531
12593
  color: activeType === "smile" ? activeColor : "",
@@ -12554,7 +12616,7 @@ const Tabs = (props) => {
12554
12616
  onClick: (e) => {
12555
12617
  tabChange(item);
12556
12618
  },
12557
- className: classNames(`${classPrefix$4}__titles-item`, {
12619
+ className: classNames(`${classPrefix$a}__titles-item`, {
12558
12620
  [`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
12559
12621
  [`nut-tabs__titles-item--disabled`]: item.disabled,
12560
12622
  [`nut-tabs__titles-item--${align}`]: align
@@ -12564,14 +12626,14 @@ const Tabs = (props) => {
12564
12626
  activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
12565
12627
  "div",
12566
12628
  {
12567
- className: `${classPrefix$4}__titles-item__line`,
12629
+ className: `${classPrefix$a}__titles-item__line`,
12568
12630
  style: tabsActiveStyle
12569
12631
  }
12570
12632
  ),
12571
12633
  activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
12572
12634
  "div",
12573
12635
  {
12574
- className: `${classPrefix$4}__titles-item__smile`,
12636
+ className: `${classPrefix$a}__titles-item__smile`,
12575
12637
  style: tabsActiveStyle,
12576
12638
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(x$7, { color: activeColor, width: 40, height: 20 })
12577
12639
  }
@@ -12583,7 +12645,7 @@ const Tabs = (props) => {
12583
12645
  {
12584
12646
  ellipsis: true
12585
12647
  },
12586
- `${classPrefix$4}__titles-item__text`
12648
+ `${classPrefix$a}__titles-item__text`
12587
12649
  ),
12588
12650
  children: item.title
12589
12651
  }
@@ -12593,7 +12655,7 @@ const Tabs = (props) => {
12593
12655
  item.value
12594
12656
  );
12595
12657
  }) }),
12596
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$4}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$4}__content`, style: contentStyle, children: React__default.Children.map(children, (child, idx) => {
12658
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__content`, style: contentStyle, children: React__default.Children.map(children, (child, idx) => {
12597
12659
  if (!React__default.isValidElement(child)) {
12598
12660
  return null;
12599
12661
  }
@@ -12611,7 +12673,7 @@ const Tabs = (props) => {
12611
12673
  }) }) })
12612
12674
  ] });
12613
12675
  };
12614
- Tabs.defaultProps = defaultProps$14;
12676
+ Tabs.defaultProps = defaultProps$15;
12615
12677
  Tabs.displayName = "NutTabs";
12616
12678
  Tabs.TabPane = TabPane;
12617
12679
  var classnameExports = {};
@@ -12734,7 +12796,7 @@ function requireClassname_development() {
12734
12796
  }
12735
12797
  })(classname);
12736
12798
  const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
12737
- const defaultProps$13 = {
12799
+ const defaultProps$14 = {
12738
12800
  type: "custom",
12739
12801
  existAddress: [],
12740
12802
  defaultIcon: null,
@@ -12756,7 +12818,7 @@ const ExistRender = (props) => {
12756
12818
  onClose,
12757
12819
  onSwitchModule,
12758
12820
  ...rest
12759
- } = { ...defaultProps$13, ...props };
12821
+ } = { ...defaultProps$14, ...props };
12760
12822
  const b = cn("address");
12761
12823
  const selectedExist = (item) => {
12762
12824
  const copyExistAdd = existAddress;
@@ -12798,7 +12860,7 @@ const ExistRender = (props) => {
12798
12860
  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 }) })
12799
12861
  ] });
12800
12862
  };
12801
- const defaultProps$12 = {
12863
+ const defaultProps$13 = {
12802
12864
  modelValue: [],
12803
12865
  type: "custom",
12804
12866
  province: [],
@@ -12823,7 +12885,7 @@ const CustomRender = (props) => {
12823
12885
  onClose,
12824
12886
  ...rest
12825
12887
  } = {
12826
- ...defaultProps$12,
12888
+ ...defaultProps$13,
12827
12889
  ...props
12828
12890
  };
12829
12891
  const b = cn("address");
@@ -12992,28 +13054,28 @@ const CustomRender = (props) => {
12992
13054
  nextAreaList(item);
12993
13055
  };
12994
13056
  useEffect(() => {
12995
- const { province: province2 } = { ...defaultProps$12, ...props };
13057
+ const { province: province2 } = { ...defaultProps$13, ...props };
12996
13058
  setRegionList({
12997
13059
  ...regionList,
12998
13060
  province: isCustom2() ? transformData(province2) : province2
12999
13061
  });
13000
13062
  }, [province]);
13001
13063
  useEffect(() => {
13002
- const { city: city2 } = { ...defaultProps$12, ...props };
13064
+ const { city: city2 } = { ...defaultProps$13, ...props };
13003
13065
  setRegionList({
13004
13066
  ...regionList,
13005
13067
  city: isCustom2() ? transformData(city2) : city2
13006
13068
  });
13007
13069
  }, [city]);
13008
13070
  useEffect(() => {
13009
- const { country: country2 } = { ...defaultProps$12, ...props };
13071
+ const { country: country2 } = { ...defaultProps$13, ...props };
13010
13072
  setRegionList({
13011
13073
  ...regionList,
13012
13074
  country: isCustom2() ? transformData(country2) : country2
13013
13075
  });
13014
13076
  }, [country]);
13015
13077
  useEffect(() => {
13016
- const { town: town2 } = { ...defaultProps$12, ...props };
13078
+ const { town: town2 } = { ...defaultProps$13, ...props };
13017
13079
  setRegionList({
13018
13080
  ...regionList,
13019
13081
  town: isCustom2() ? transformData(town2) : town2
@@ -13088,7 +13150,7 @@ const CustomRender = (props) => {
13088
13150
  ) })
13089
13151
  ] });
13090
13152
  };
13091
- const defaultProps$11 = {
13153
+ const defaultProps$12 = {
13092
13154
  ...ComponentDefaults,
13093
13155
  modelValue: false,
13094
13156
  modelSelect: [],
@@ -13139,7 +13201,7 @@ const Address = (props) => {
13139
13201
  className,
13140
13202
  ...rest
13141
13203
  } = {
13142
- ...defaultProps$11,
13204
+ ...defaultProps$12,
13143
13205
  ...props
13144
13206
  };
13145
13207
  const b = cn("address");
@@ -13297,7 +13359,7 @@ const Address = (props) => {
13297
13359
  }
13298
13360
  ) });
13299
13361
  };
13300
- Address.defaultProps = defaultProps$11;
13362
+ Address.defaultProps = defaultProps$12;
13301
13363
  Address.displayName = "NutAddress";
13302
13364
  const Utils = {
13303
13365
  /**
@@ -13417,7 +13479,7 @@ const Utils = {
13417
13479
  return false;
13418
13480
  }
13419
13481
  };
13420
- const defaultProps$10 = {
13482
+ const defaultProps$11 = {
13421
13483
  type: "one",
13422
13484
  isAutoBackFill: false,
13423
13485
  poppable: true,
@@ -13469,7 +13531,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
13469
13531
  onUpdate,
13470
13532
  onSelected,
13471
13533
  onYearMonthChange
13472
- } = { ...defaultProps$10, ...props };
13534
+ } = { ...defaultProps$11, ...props };
13473
13535
  const weeks = locale.calendaritem.weekdays;
13474
13536
  const [yearMonthTitle, setYearMonthTitle] = useState("");
13475
13537
  const [monthsData, setMonthsData] = useState([]);
@@ -14065,9 +14127,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
14065
14127
  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 }) }) : ""
14066
14128
  ] }) });
14067
14129
  });
14068
- CalendarItem.defaultProps = defaultProps$10;
14130
+ CalendarItem.defaultProps = defaultProps$11;
14069
14131
  CalendarItem.displayName = "NutCalendarItem";
14070
- const defaultProps$$ = {
14132
+ const defaultProps$10 = {
14071
14133
  type: "one",
14072
14134
  isAutoBackFill: false,
14073
14135
  poppable: true,
@@ -14122,7 +14184,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
14122
14184
  onChoose,
14123
14185
  onSelected,
14124
14186
  onYearMonthChange
14125
- } = { ...defaultProps$$, ...props };
14187
+ } = { ...defaultProps$10, ...props };
14126
14188
  const calendarRef = useRef(null);
14127
14189
  const close = () => {
14128
14190
  onClose && onClose();
@@ -14192,9 +14254,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
14192
14254
  }
14193
14255
  ) : renderItem() });
14194
14256
  });
14195
- Calendar.defaultProps = defaultProps$$;
14257
+ Calendar.defaultProps = defaultProps$10;
14196
14258
  Calendar.displayName = "NutCalendar";
14197
- const defaultProps$_ = {
14259
+ const defaultProps$$ = {
14198
14260
  data: {
14199
14261
  text: "",
14200
14262
  value: "",
@@ -14205,32 +14267,37 @@ const defaultProps$_ = {
14205
14267
  },
14206
14268
  activeColor: "",
14207
14269
  checked: false,
14208
- checkedIcon: "checklist",
14270
+ activeIcon: "checklist",
14209
14271
  chooseItem: () => {
14210
14272
  }
14211
14273
  };
14212
14274
  const InternalCascaderItem = (props, ref) => {
14213
- const { data, checked, checkedIcon, chooseItem, activeColor } = {
14214
- ...defaultProps$_,
14275
+ const { data, checked, activeIcon, chooseItem, activeColor } = {
14276
+ ...defaultProps$$,
14215
14277
  ...props
14216
14278
  };
14217
- const b = cn("cascader-item");
14279
+ const classPrefix2 = "nut-cascader-item";
14218
14280
  const classes = classNames(
14219
14281
  {
14220
14282
  active: checked,
14221
14283
  disabled: data.disabled
14222
14284
  },
14223
- b("")
14285
+ classPrefix2
14224
14286
  );
14225
14287
  const classesTitle = classNames({
14226
- [`${b("")}__title`]: true
14288
+ [`${classPrefix2}__title`]: true
14227
14289
  });
14228
14290
  const renderIcon = () => {
14229
14291
  if (checked) {
14230
- if (isValidElement(checkedIcon)) {
14231
- return checkedIcon;
14292
+ if (isValidElement(activeIcon)) {
14293
+ return activeIcon;
14232
14294
  }
14233
- return /* @__PURE__ */ jsxRuntimeExports.jsx(x$c, { className: `${checked ? b("icon-check") : ""}` });
14295
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
14296
+ x$c,
14297
+ {
14298
+ className: `${checked ? `${classPrefix2}__icon-check` : ""}`
14299
+ }
14300
+ );
14234
14301
  }
14235
14302
  return null;
14236
14303
  };
@@ -14244,13 +14311,13 @@ const InternalCascaderItem = (props, ref) => {
14244
14311
  },
14245
14312
  children: [
14246
14313
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesTitle, children: data.text }),
14247
- data.loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, { color: "#969799", className: "nut-cascader-item__icon-loading" }) : renderIcon()
14314
+ data.loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, { color: "#969799", className: "nut-cascader-item__icon-loading" }) : renderIcon()
14248
14315
  ]
14249
14316
  }
14250
14317
  );
14251
14318
  };
14252
14319
  const CascaderItem = React__default.forwardRef(InternalCascaderItem);
14253
- CascaderItem.defaultProps = defaultProps$_;
14320
+ CascaderItem.defaultProps = defaultProps$$;
14254
14321
  CascaderItem.displayName = "NutCascaderItem";
14255
14322
  const formatTree = (tree, parent, config2) => tree.map((node) => {
14256
14323
  const {
@@ -14388,26 +14455,22 @@ class Tree {
14388
14455
  }
14389
14456
  }
14390
14457
  const Tree$1 = Tree;
14391
- const defaultProps$Z = {
14392
- className: "",
14393
- style: {},
14458
+ const defaultProps$_ = {
14459
+ ...ComponentDefaults,
14394
14460
  activeColor: "",
14395
- checkedIcon: "checklist",
14396
- tabsColor: "",
14397
- poppable: true,
14461
+ activeIcon: "checklist",
14462
+ popup: true,
14398
14463
  visible: false,
14399
14464
  options: [],
14400
14465
  value: [],
14401
14466
  title: "",
14402
- textKey: "text",
14403
- valueKey: "value",
14404
- childrenKey: "children",
14405
- convertConfig: {},
14467
+ optionKey: { textKey: "text", valueKey: "value", childrenKey: "children" },
14468
+ format: {},
14406
14469
  closeable: false,
14407
14470
  closeIconPosition: "top-right",
14408
14471
  closeIcon: "close",
14409
14472
  lazy: false,
14410
- lazyLoad: () => {
14473
+ onLoad: () => {
14411
14474
  },
14412
14475
  onClose: () => {
14413
14476
  },
@@ -14421,28 +14484,25 @@ const InternalCascader = (props, ref) => {
14421
14484
  const {
14422
14485
  className,
14423
14486
  style,
14424
- tabsColor,
14425
- poppable,
14487
+ popup,
14426
14488
  visible,
14427
14489
  options: options2,
14428
14490
  value,
14429
14491
  title,
14430
- textKey,
14431
- valueKey,
14432
- childrenKey,
14433
- convertConfig: convertConfig2,
14492
+ optionKey: optionKey2,
14493
+ format: format2,
14434
14494
  closeable,
14435
14495
  closeIconPosition,
14436
14496
  closeIcon,
14437
14497
  lazy,
14438
- lazyLoad,
14498
+ onLoad,
14439
14499
  onClose,
14440
14500
  onChange,
14441
14501
  onPathChange
14442
- } = { ...defaultProps$Z, ...props };
14502
+ } = { ...defaultProps$_, ...props };
14443
14503
  const [tabvalue, setTabvalue] = useState("c1");
14444
14504
  const [optionsData, setOptionsData] = useState([]);
14445
- const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
14505
+ const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
14446
14506
  const [state] = useState({
14447
14507
  optionsData: [],
14448
14508
  panes: [
@@ -14460,44 +14520,38 @@ const InternalCascader = (props, ref) => {
14460
14520
  currentProcessNode: [],
14461
14521
  configs: {
14462
14522
  lazy,
14463
- lazyLoad,
14464
- valueKey,
14465
- textKey,
14466
- childrenKey,
14467
- convertConfig: convertConfig2
14523
+ onLoad,
14524
+ optionKey: optionKey2,
14525
+ format: format2
14468
14526
  },
14469
14527
  lazyLoadMap: /* @__PURE__ */ new Map()
14470
14528
  });
14471
- const b = cn("cascader");
14472
- const classes = classNames(b(""));
14529
+ const classPrefix2 = classNames(`nut-cascader`);
14473
14530
  const classesPane = classNames({
14474
- [`${b("")}-pane`]: true
14531
+ [`${classPrefix2}-pane`]: true
14475
14532
  });
14476
14533
  useEffect(() => {
14477
14534
  initData();
14478
- }, []);
14535
+ }, [options2]);
14479
14536
  useEffect(() => {
14480
14537
  if (value !== state.innerValue) {
14481
14538
  state.innerValue = value;
14482
14539
  }
14483
14540
  }, [value]);
14484
- useEffect(() => {
14485
- initData();
14486
- }, [options2]);
14487
14541
  const initData = async () => {
14488
14542
  state.lazyLoadMap.clear();
14489
- if (convertConfig2 && Object.keys(convertConfig2).length > 0) {
14543
+ if (format2 && Object.keys(format2).length > 0) {
14490
14544
  state.optionsData = convertListToOptions(
14491
14545
  options2,
14492
- convertConfig2
14546
+ format2
14493
14547
  );
14494
14548
  } else {
14495
14549
  state.optionsData = options2;
14496
14550
  }
14497
14551
  state.tree = new Tree$1(state.optionsData, {
14498
- value: state.configs.valueKey,
14499
- text: state.configs.textKey,
14500
- children: state.configs.childrenKey
14552
+ value: state.configs.optionKey.valueKey,
14553
+ text: state.configs.optionKey.textKey,
14554
+ children: state.configs.optionKey.childrenKey
14501
14555
  });
14502
14556
  if (isLazy() && !state.tree.nodes.length) {
14503
14557
  await invokeLazyLoad({
@@ -14563,7 +14617,7 @@ const InternalCascader = (props, ref) => {
14563
14617
  if (!node) {
14564
14618
  return;
14565
14619
  }
14566
- if (!state.configs.lazyLoad) {
14620
+ if (!state.configs.onLoad) {
14567
14621
  node.leaf = true;
14568
14622
  return;
14569
14623
  }
@@ -14576,7 +14630,7 @@ const InternalCascader = (props, ref) => {
14576
14630
  if (!lazyLoadPromise) {
14577
14631
  lazyLoadPromise = new Promise((resolve) => {
14578
14632
  var _a2, _b;
14579
- (_b = (_a2 = state.configs).lazyLoad) == null ? void 0 : _b.call(_a2, node, resolve);
14633
+ (_b = (_a2 = state.configs).onLoad) == null ? void 0 : _b.call(_a2, node, resolve);
14580
14634
  });
14581
14635
  state.lazyLoadMap.set(node, lazyLoadPromise);
14582
14636
  }
@@ -14623,8 +14677,8 @@ const InternalCascader = (props, ref) => {
14623
14677
  selectedNode: null,
14624
14678
  paneKey: `c${state.tabsCursor + 1}`
14625
14679
  });
14626
- setTabvalue(`c${state.tabsCursor + 1}`);
14627
14680
  setOptionsData(state.panes);
14681
+ setTabvalue(`c${state.tabsCursor + 1}`);
14628
14682
  if (!type4) {
14629
14683
  const pathNodes = state.panes.map((item) => item.selectedNode);
14630
14684
  const optionParams = pathNodes.map((item) => item == null ? void 0 : item.value);
@@ -14644,8 +14698,8 @@ const InternalCascader = (props, ref) => {
14644
14698
  setOptionsData(state.panes);
14645
14699
  };
14646
14700
  const renderItem = () => {
14647
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classes} ${className}`, style, children: [
14648
- poppable && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("title"), children: title }),
14701
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2} ${className}`, style, children: [
14702
+ popup && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-cascader__title", children: title }),
14649
14703
  /* @__PURE__ */ jsxRuntimeExports.jsx(
14650
14704
  Tabs,
14651
14705
  {
@@ -14660,27 +14714,21 @@ const InternalCascader = (props, ref) => {
14660
14714
  setTabvalue(pane.paneKey);
14661
14715
  state.tabsCursor = index;
14662
14716
  },
14663
- className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
14717
+ className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "nut-tabs__titles-item--active" : ""}`,
14664
14718
  children: [
14665
14719
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "nut-tabs__titles-item__text", children: [
14666
14720
  !state.initLoading && state.panes.length && ((_a2 = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a2.text),
14667
14721
  !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "请选择",
14668
14722
  !(!state.initLoading && state.panes.length) && "Loading..."
14669
14723
  ] }),
14670
- /* @__PURE__ */ jsxRuntimeExports.jsx(
14671
- "span",
14672
- {
14673
- className: "nut-tabs__titles-item__line",
14674
- style: { background: tabsColor }
14675
- }
14676
- )
14724
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-tabs__titles-item__line" })
14677
14725
  ]
14678
14726
  },
14679
14727
  pane.paneKey
14680
14728
  );
14681
14729
  });
14682
14730
  },
14683
- 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) => {
14731
+ 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) => {
14684
14732
  var _a2;
14685
14733
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
14686
14734
  CascaderItem,
@@ -14692,15 +14740,14 @@ const InternalCascader = (props, ref) => {
14692
14740
  },
14693
14741
  index
14694
14742
  );
14695
- }) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
14743
+ }) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
14696
14744
  }
14697
14745
  )
14698
14746
  ] });
14699
14747
  };
14700
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: poppable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
14748
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: popup ? /* @__PURE__ */ jsxRuntimeExports.jsx(
14701
14749
  Popup,
14702
14750
  {
14703
- className: "cascadar-popup",
14704
14751
  visible,
14705
14752
  position: "bottom",
14706
14753
  round: true,
@@ -14714,23 +14761,22 @@ const InternalCascader = (props, ref) => {
14714
14761
  ) : renderItem() });
14715
14762
  };
14716
14763
  const Cascader = React__default.forwardRef(InternalCascader);
14717
- Cascader.defaultProps = defaultProps$Z;
14764
+ Cascader.defaultProps = defaultProps$_;
14718
14765
  Cascader.displayName = "NutCascader";
14719
14766
  const CheckboxGroupContext = createContext(null);
14720
14767
  const Context = CheckboxGroupContext;
14721
- const defaultProps$Y = {
14722
- disabled: false,
14768
+ const defaultProps$Z = {
14723
14769
  max: void 0,
14724
- textPosition: "right",
14770
+ labelPosition: "right",
14725
14771
  direction: "vertical",
14726
14772
  onChange: (value) => {
14727
14773
  },
14728
14774
  options: []
14729
14775
  };
14776
+ const classPrefix$9 = "nut-checkboxgroup";
14730
14777
  const CheckboxGroup = React__default.forwardRef(
14731
14778
  (props, ref) => {
14732
- const { children } = { ...defaultProps$Y, ...props };
14733
- const b = cn("checkboxgroup");
14779
+ const { children } = { ...defaultProps$Z, ...props };
14734
14780
  const {
14735
14781
  className,
14736
14782
  disabled,
@@ -14738,29 +14784,29 @@ const CheckboxGroup = React__default.forwardRef(
14738
14784
  value,
14739
14785
  defaultValue,
14740
14786
  max,
14741
- textPosition,
14787
+ labelPosition,
14742
14788
  direction,
14743
14789
  options: options2,
14744
14790
  ...rest
14745
14791
  } = props;
14746
14792
  useImperativeHandle(ref, () => ({
14747
- toggleAll(state) {
14793
+ toggle(state) {
14748
14794
  if (state === false) {
14749
14795
  setValue([]);
14750
14796
  } else {
14751
14797
  const childrenLabel = [];
14752
14798
  React__default.Children.map(children, (child) => {
14753
14799
  const childProps = child.props;
14754
- childrenLabel.push(childProps.label || child.children);
14800
+ childrenLabel.push(childProps.value);
14755
14801
  });
14756
14802
  setValue(childrenLabel);
14757
14803
  }
14758
14804
  },
14759
- toggleReverse() {
14805
+ reverse() {
14760
14806
  const childrenLabel = [];
14761
14807
  React__default.Children.map(children, (child) => {
14762
14808
  const childProps = child.props;
14763
- childrenLabel.push(childProps.label || child.children);
14809
+ childrenLabel.push(childProps.value);
14764
14810
  });
14765
14811
  const reverse = childrenLabel.filter(
14766
14812
  (c) => (_value == null ? void 0 : _value.findIndex((v) => v === c)) === -1
@@ -14779,8 +14825,9 @@ const CheckboxGroup = React__default.forwardRef(
14779
14825
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
14780
14826
  Checkbox,
14781
14827
  {
14782
- children: label,
14783
- label: value2,
14828
+ label,
14829
+ disabled: disabled2,
14830
+ value: value2,
14784
14831
  ...rest2
14785
14832
  },
14786
14833
  value2 == null ? void 0 : value2.toString()
@@ -14791,25 +14838,26 @@ const CheckboxGroup = React__default.forwardRef(
14791
14838
  Context.Provider,
14792
14839
  {
14793
14840
  value: {
14794
- textPosition: textPosition || "left",
14841
+ labelPosition: labelPosition || "right",
14795
14842
  disabled,
14796
14843
  max,
14797
- checkedValue: _value,
14844
+ value: _value,
14798
14845
  check: (value2) => {
14799
14846
  const combined = [..._value, value2];
14800
14847
  setValue(combined);
14801
- onChange && onChange(combined);
14802
14848
  },
14803
14849
  uncheck: (value2) => {
14804
14850
  const reduced = _value.filter((item) => item !== value2);
14805
14851
  setValue(reduced);
14806
- onChange && onChange(reduced);
14807
14852
  }
14808
14853
  },
14809
14854
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
14810
14855
  "div",
14811
14856
  {
14812
- className: `${b()} nut-checkboxgroup--${props.direction} ${className || ""}`,
14857
+ className: classNames(classPrefix$9, {
14858
+ [`nut-checkboxgroup--${props.direction}`]: props.direction,
14859
+ className
14860
+ }),
14813
14861
  ...rest,
14814
14862
  children: (options2 == null ? void 0 : options2.length) ? renderOptions() : children
14815
14863
  }
@@ -14818,112 +14866,117 @@ const CheckboxGroup = React__default.forwardRef(
14818
14866
  );
14819
14867
  }
14820
14868
  );
14821
- CheckboxGroup.defaultProps = defaultProps$Y;
14869
+ CheckboxGroup.defaultProps = defaultProps$Z;
14822
14870
  CheckboxGroup.displayName = "NutCheckboxGroup";
14823
- const defaultProps$X = {
14871
+ const defaultProps$Y = {
14824
14872
  ...ComponentDefaults,
14825
14873
  disabled: false,
14826
- textPosition: "right",
14827
- iconSize: 18,
14828
- icon: "check-normal",
14829
- checkedIcon: "checked",
14830
- iconClassPrefix: "nut-icon",
14831
- iconFontClassName: "nutui-iconfont",
14832
- indeterminateIcon: "check-disabled",
14833
- onChange: (state) => {
14874
+ labelPosition: "right",
14875
+ icon: null,
14876
+ activeIcon: null,
14877
+ indeterminateIcon: null,
14878
+ onChange: (value) => {
14834
14879
  }
14835
14880
  };
14881
+ const classPrefix$8 = "nut-checkbox";
14836
14882
  const Checkbox = (props) => {
14837
14883
  const { children } = {
14838
- ...defaultProps$X,
14884
+ ...defaultProps$Y,
14839
14885
  ...props
14840
14886
  };
14841
- const b = cn("checkbox");
14842
14887
  const {
14843
14888
  icon,
14844
- iconSize,
14845
14889
  label,
14846
14890
  className,
14847
- checkedIcon,
14891
+ activeIcon,
14848
14892
  checked,
14893
+ value,
14849
14894
  defaultChecked,
14850
14895
  disabled,
14851
14896
  onChange,
14852
14897
  indeterminate,
14853
- iconClassPrefix,
14854
- iconFontClassName,
14855
14898
  indeterminateIcon,
14856
14899
  ...others
14857
14900
  } = props;
14858
- let { textPosition, ...rest } = others;
14901
+ let { labelPosition, ...rest } = others;
14859
14902
  const ctx2 = useContext(Context);
14860
- let [_checked, setChecked] = usePropsValue({
14903
+ let [innerChecked, setChecked] = usePropsValue({
14861
14904
  value: props.checked,
14862
14905
  defaultValue: props.defaultChecked,
14863
14906
  finalValue: defaultChecked,
14864
14907
  onChange
14865
14908
  });
14866
14909
  let [innerDisabled, setDisabled] = useState(disabled);
14867
- const [_indeterminate, setIndeterminate] = useState(indeterminate);
14910
+ const [innerIndeterminate, setIndeterminate] = useState(indeterminate);
14868
14911
  useEffect(() => {
14869
- !ctx2 && setChecked(checked);
14870
14912
  setDisabled(disabled);
14913
+ }, [disabled]);
14914
+ useEffect(() => {
14871
14915
  setIndeterminate(indeterminate);
14872
- }, [disabled, indeterminate]);
14916
+ }, [indeterminate]);
14873
14917
  if (ctx2) {
14874
- if (ctx2.textPosition !== void 0) {
14875
- textPosition = ctx2.textPosition;
14918
+ if (ctx2.labelPosition !== void 0) {
14919
+ labelPosition = ctx2.labelPosition;
14876
14920
  }
14877
- innerDisabled = ctx2.disabled;
14878
- _checked = ctx2.checkedValue.includes(label);
14921
+ innerDisabled = ctx2.disabled !== void 0 ? ctx2.disabled : innerDisabled;
14922
+ innerChecked = ctx2.value.includes(value);
14879
14923
  setChecked = (checked2) => {
14880
14924
  if (ctx2.disabled)
14881
14925
  return;
14882
14926
  if (checked2)
14883
- ctx2.check(label);
14927
+ ctx2.check(value);
14884
14928
  if (!checked2)
14885
- ctx2.uncheck(label);
14929
+ ctx2.uncheck(value);
14886
14930
  };
14887
14931
  }
14888
14932
  const renderIcon = () => {
14889
- if (!_checked) {
14890
- return React__default.isValidElement(icon) ? icon : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { width: iconSize, height: iconSize, className: color() });
14933
+ if (!innerChecked) {
14934
+ return React__default.isValidElement(icon) ? icon : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { className: color() });
14891
14935
  }
14892
- if (_indeterminate) {
14893
- return React__default.isValidElement(indeterminateIcon) ? indeterminateIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$f, { width: iconSize, height: iconSize, className: color() });
14936
+ if (innerIndeterminate) {
14937
+ return React__default.isValidElement(indeterminateIcon) ? indeterminateIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$f, { className: color() });
14894
14938
  }
14895
- return React__default.isValidElement(checkedIcon) ? checkedIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$d, { width: iconSize, height: iconSize, className: color() });
14939
+ return React__default.isValidElement(activeIcon) ? activeIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$d, { className: color() });
14896
14940
  };
14897
14941
  const color = () => {
14898
14942
  if (innerDisabled) {
14899
- return "nut-checkbox__icon--disable";
14943
+ return `${classPrefix$8}__icon--disable`;
14900
14944
  }
14901
- if (_checked) {
14902
- if (_indeterminate) {
14903
- return "nut-checkbox__icon--indeterminate";
14945
+ if (innerChecked) {
14946
+ if (innerIndeterminate) {
14947
+ return `${classPrefix$8}__icon--indeterminate`;
14904
14948
  }
14905
- return "nut-checkbox__icon";
14949
+ return `${classPrefix$8}__icon`;
14906
14950
  }
14907
- return "nut-checkbox__icon--unchecked";
14951
+ return `${classPrefix$8}__icon--unchecked`;
14908
14952
  };
14909
14953
  const renderLabel = () => {
14910
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${b("label", { disabled: innerDisabled })} `, children: children || label });
14954
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
14955
+ "span",
14956
+ {
14957
+ className: classNames(`${classPrefix$8}__label `, {
14958
+ [`${classPrefix$8}__label--disabled`]: innerDisabled
14959
+ }),
14960
+ children: children || label
14961
+ }
14962
+ );
14911
14963
  };
14912
14964
  const handleClick2 = () => {
14913
14965
  if (disabled)
14914
14966
  return;
14915
- const latestChecked = !_checked;
14967
+ const latestChecked = !innerChecked;
14916
14968
  if (ctx2 && ctx2.max !== void 0) {
14917
- if (latestChecked && ctx2.checkedValue.length >= ctx2.max)
14969
+ if (latestChecked && ctx2.value.length >= ctx2.max)
14918
14970
  return;
14919
14971
  }
14920
- onChange && onChange(latestChecked, label || children);
14921
14972
  setChecked(latestChecked);
14922
14973
  };
14923
14974
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
14924
14975
  "div",
14925
14976
  {
14926
- className: `${b({ reverse: textPosition === "left" })} ${className || ""}`,
14977
+ className: classNames(classPrefix$8, className, {
14978
+ [`${classPrefix$8}--reverse`]: labelPosition === "left"
14979
+ }),
14927
14980
  ...rest,
14928
14981
  onClick: handleClick2,
14929
14982
  children: [
@@ -14933,7 +14986,7 @@ const Checkbox = (props) => {
14933
14986
  }
14934
14987
  );
14935
14988
  };
14936
- Checkbox.defaultProps = defaultProps$X;
14989
+ Checkbox.defaultProps = defaultProps$Y;
14937
14990
  Checkbox.displayName = "NutCheckBox";
14938
14991
  Checkbox.Group = CheckboxGroup;
14939
14992
  const MIN_DISTANCE = 10;
@@ -15001,13 +15054,13 @@ function useTouch() {
15001
15054
  isHorizontal
15002
15055
  };
15003
15056
  }
15004
- const InternalPickerSlot = (props, ref) => {
15057
+ const InternalPickerPanel = (props, ref) => {
15005
15058
  const {
15006
15059
  keyIndex = 0,
15007
15060
  defaultValue,
15008
- listData = [],
15061
+ options: options2 = [],
15009
15062
  threeDimensional = true,
15010
- swipeDuration = 1e3,
15063
+ duration = 1e3,
15011
15064
  chooseItem
15012
15065
  } = props;
15013
15066
  const touch = useTouch();
@@ -15021,9 +15074,8 @@ const InternalPickerSlot = (props, ref) => {
15021
15074
  const rotation = 20;
15022
15075
  const moving = useRef(false);
15023
15076
  let timer;
15024
- useRef(null);
15025
15077
  const rollerRef = useRef(null);
15026
- const pickerSlotRef = useRef(null);
15078
+ const PickerPanelRef = useRef(null);
15027
15079
  const [startTime, setStartTime] = useState(0);
15028
15080
  const [startY, setStartY] = useState(0);
15029
15081
  const transformY = useRef(0);
@@ -15049,8 +15101,8 @@ const InternalPickerSlot = (props, ref) => {
15049
15101
  if (updateMove > 0) {
15050
15102
  updateMove = 0;
15051
15103
  }
15052
- if (updateMove < -(listData.length - 1) * lineSpacing) {
15053
- updateMove = -(listData.length - 1) * lineSpacing;
15104
+ if (updateMove < -(options2.length - 1) * lineSpacing) {
15105
+ updateMove = -(options2.length - 1) * lineSpacing;
15054
15106
  }
15055
15107
  const endMove = Math.round(updateMove / lineSpacing) * lineSpacing;
15056
15108
  const deg = `${(Math.abs(Math.round(endMove / lineSpacing)) + 1) * rotation}deg`;
@@ -15059,7 +15111,7 @@ const InternalPickerSlot = (props, ref) => {
15059
15111
  } else {
15060
15112
  let deg = 0;
15061
15113
  const currentDeg = (-updateMove / lineSpacing + 1) * rotation;
15062
- const maxDeg = (listData.length + 1) * rotation;
15114
+ const maxDeg = (options2.length + 1) * rotation;
15063
15115
  const minDeg = 0;
15064
15116
  deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
15065
15117
  if (minDeg < deg && deg < maxDeg) {
@@ -15069,7 +15121,7 @@ const InternalPickerSlot = (props, ref) => {
15069
15121
  }
15070
15122
  };
15071
15123
  const setChooseValue = (move) => {
15072
- chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing)], keyIndex);
15124
+ chooseItem && chooseItem(options2 == null ? void 0 : options2[Math.round(-move / lineSpacing)], keyIndex);
15073
15125
  };
15074
15126
  const touchStart = (event) => {
15075
15127
  touch.start(event);
@@ -15093,7 +15145,7 @@ const InternalPickerSlot = (props, ref) => {
15093
15145
  const moveTime = Date.now() - startTime;
15094
15146
  if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
15095
15147
  const distance = momentum(move, moveTime);
15096
- setMove(distance, "end", +swipeDuration);
15148
+ setMove(distance, "end", +duration);
15097
15149
  } else {
15098
15150
  setMove(move, "end");
15099
15151
  }
@@ -15101,9 +15153,9 @@ const InternalPickerSlot = (props, ref) => {
15101
15153
  touch.reset();
15102
15154
  }, 0);
15103
15155
  };
15104
- const momentum = (distance, duration) => {
15156
+ const momentum = (distance, duration2) => {
15105
15157
  let nDistance = distance;
15106
- const speed = Math.abs(nDistance / duration);
15158
+ const speed = Math.abs(nDistance / duration2);
15107
15159
  nDistance = speed / 3e-3 * (nDistance < 0 ? -1 : 1);
15108
15160
  return nDistance;
15109
15161
  };
@@ -15111,7 +15163,7 @@ const InternalPickerSlot = (props, ref) => {
15111
15163
  const value = val || defaultValue;
15112
15164
  let index = -1;
15113
15165
  if (value) {
15114
- listData.some((item, idx) => {
15166
+ options2.some((item, idx) => {
15115
15167
  if (item.value === value) {
15116
15168
  index = idx;
15117
15169
  return true;
@@ -15119,7 +15171,7 @@ const InternalPickerSlot = (props, ref) => {
15119
15171
  return false;
15120
15172
  });
15121
15173
  } else {
15122
- listData.forEach((item, i) => {
15174
+ options2.forEach((item, i) => {
15123
15175
  if (item.value === defaultValue) {
15124
15176
  index = i;
15125
15177
  }
@@ -15162,7 +15214,7 @@ const InternalPickerSlot = (props, ref) => {
15162
15214
  return () => {
15163
15215
  clearTimeout(timer);
15164
15216
  };
15165
- }, [listData]);
15217
+ }, [options2]);
15166
15218
  useImperativeHandle(ref, () => ({
15167
15219
  stopMomentum,
15168
15220
  moving: moving.current
@@ -15171,7 +15223,7 @@ const InternalPickerSlot = (props, ref) => {
15171
15223
  "div",
15172
15224
  {
15173
15225
  className: "nut-picker-list",
15174
- ref: pickerSlotRef,
15226
+ ref: PickerPanelRef,
15175
15227
  onTouchStart: touchStart,
15176
15228
  onTouchMove: touchMove,
15177
15229
  onTouchEnd: touchEnd,
@@ -15184,7 +15236,7 @@ const InternalPickerSlot = (props, ref) => {
15184
15236
  style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
15185
15237
  onTransitionEnd: stopMomentum,
15186
15238
  children: [
15187
- threeDimensional && listData.map((item, index) => {
15239
+ threeDimensional && options2.map((item, index) => {
15188
15240
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15189
15241
  "div",
15190
15242
  {
@@ -15197,7 +15249,7 @@ const InternalPickerSlot = (props, ref) => {
15197
15249
  item.value ? item.value : index
15198
15250
  );
15199
15251
  }),
15200
- !threeDimensional && listData.map((item, index) => {
15252
+ !threeDimensional && options2.map((item, index) => {
15201
15253
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15202
15254
  "div",
15203
15255
  {
@@ -15216,8 +15268,8 @@ const InternalPickerSlot = (props, ref) => {
15216
15268
  }
15217
15269
  );
15218
15270
  };
15219
- const PickerSlot = React__default.forwardRef(InternalPickerSlot);
15220
- const PickerSlot$1 = PickerSlot;
15271
+ const PickerPanel = React__default.forwardRef(InternalPickerPanel);
15272
+ const PickerPanel$1 = PickerPanel;
15221
15273
  function useRefs() {
15222
15274
  const refs = React__default.useRef([]);
15223
15275
  const setRefs = React__default.useCallback(
@@ -15232,180 +15284,202 @@ function useRefs() {
15232
15284
  }, []);
15233
15285
  return [refs.current, setRefs, reset];
15234
15286
  }
15287
+ const defaultProps$X = {
15288
+ ...ComponentDefaults,
15289
+ visible: false,
15290
+ title: "",
15291
+ options: [],
15292
+ value: [],
15293
+ defaultValue: [],
15294
+ threeDimensional: true,
15295
+ duration: 1e3
15296
+ };
15235
15297
  const InternalPicker = (props, ref) => {
15236
15298
  const { locale } = useConfig();
15237
15299
  const {
15238
15300
  visible,
15239
15301
  title,
15240
- listData = [],
15241
- defaultValueData,
15242
- onConfirm,
15243
- onClose,
15244
- onCloseUpdate,
15245
- onChange,
15302
+ options: options2 = [],
15303
+ defaultValue = [],
15246
15304
  className,
15247
15305
  style,
15248
15306
  threeDimensional,
15249
- swipeDuration,
15307
+ duration,
15308
+ onConfirm,
15309
+ onClose,
15310
+ afterClose,
15311
+ onChange,
15250
15312
  ...rest
15251
- } = props;
15252
- const [chooseValueData, setchooseValueData] = useState([]);
15253
- const [columnIndex, setcolumnIndex] = useState(0);
15313
+ } = { ...defaultProps$X, ...props };
15314
+ const classPrefix2 = "nut-picker";
15315
+ const classes = classNames(classPrefix2, className);
15316
+ const [selectedValue, setSelectedValue] = usePropsValue({
15317
+ value: props.value,
15318
+ defaultValue: [...defaultValue],
15319
+ finalValue: [...defaultValue],
15320
+ onChange: (val) => {
15321
+ var _a2;
15322
+ (_a2 = props.onConfirm) == null ? void 0 : _a2.call(props, setSelectedOptions(), val);
15323
+ }
15324
+ });
15325
+ const [columnIndex, setColumnIndex] = useState(0);
15254
15326
  const pickerRef = useRef(null);
15255
15327
  const [refs, setRefs] = useRefs();
15256
15328
  const [columnsList, setColumnsList] = useState([]);
15257
- const b = cn("picker");
15258
15329
  const isConfirmEvent = useRef(false);
15259
- useEffect(() => {
15260
- if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
15261
- const data = [...defaultValueData];
15262
- setchooseValueData(data);
15263
- setColumnsList(normalListData());
15330
+ const formatCascade = (columns, values) => {
15331
+ const formatted = [];
15332
+ let columnOptions = {
15333
+ text: "",
15334
+ value: "",
15335
+ children: columns
15336
+ };
15337
+ let columnIndex2 = 0;
15338
+ while (columnOptions && columnOptions.children) {
15339
+ const options22 = columnOptions.children;
15340
+ const value = values[columnIndex2];
15341
+ let index = options22.findIndex(
15342
+ (columnItem) => columnItem.value === value
15343
+ );
15344
+ if (index === -1)
15345
+ index = 0;
15346
+ columnOptions = columnOptions.children[index];
15347
+ columnIndex2++;
15348
+ formatted.push(options22);
15264
15349
  }
15265
- }, [defaultValueData]);
15266
- useEffect(() => {
15267
- onChange && onChange(columnIndex, chooseValueData, selectedOptions());
15268
- if (isConfirmEvent.current) {
15269
- isConfirmEvent.current = false;
15270
- onConfirm && onConfirm(chooseValueData, selectedOptions());
15350
+ return formatted;
15351
+ };
15352
+ const columnsType = () => {
15353
+ const firstColumn = options2[0];
15354
+ if (firstColumn) {
15355
+ if (Array.isArray(firstColumn)) {
15356
+ return "multiple";
15357
+ }
15358
+ if ("children" in firstColumn) {
15359
+ return "cascade";
15360
+ }
15271
15361
  }
15272
- }, [chooseValueData]);
15273
- useEffect(() => {
15274
- init();
15275
- }, [listData]);
15276
- const closeActionSheet = () => {
15277
- onClose && onClose(chooseValueData, selectedOptions());
15278
- onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
15362
+ return "single";
15279
15363
  };
15280
- const confirm2 = () => {
15281
- let movings = false;
15282
- refs.forEach((_ref) => {
15283
- if (_ref.moving)
15284
- movings = true;
15285
- _ref.stopMomentum();
15364
+ const normalListData = () => {
15365
+ const type4 = columnsType();
15366
+ switch (type4) {
15367
+ case "multiple":
15368
+ return options2;
15369
+ case "cascade":
15370
+ return formatCascade(options2, selectedValue);
15371
+ default:
15372
+ return [options2];
15373
+ }
15374
+ };
15375
+ const init = () => {
15376
+ const normalData = normalListData();
15377
+ setColumnsList(normalData);
15378
+ const data = [];
15379
+ normalData.length > 0 && normalData.map((item) => {
15380
+ item[0] && data.push(item[0].value);
15381
+ return item;
15286
15382
  });
15287
- if (movings) {
15288
- isConfirmEvent.current = true;
15289
- } else {
15290
- onConfirm && onConfirm(chooseValueData, selectedOptions());
15383
+ if (!defaultValue.length && selectedValue.length === 0) {
15384
+ setSelectedValue([...data]);
15291
15385
  }
15292
- onClose && onClose(chooseValueData, selectedOptions());
15293
- setTimeout(() => {
15294
- isConfirmEvent.current = false;
15295
- }, 0);
15296
15386
  };
15297
- const selectedOptions = () => {
15298
- const optins = [];
15299
- columnsList.map((column, index) => {
15300
- let currOptions = [];
15301
- currOptions = column.filter(
15302
- (item) => item.value === chooseValueData[index]
15387
+ useEffect(() => {
15388
+ if (!visible) {
15389
+ return;
15390
+ }
15391
+ init();
15392
+ }, [options2, visible]);
15393
+ const setSelectedOptions = () => {
15394
+ const options22 = [];
15395
+ let currOptions = [];
15396
+ columnsList.forEach((columnOptions, index) => {
15397
+ currOptions = columnOptions.filter(
15398
+ (item) => item.value === selectedValue[index]
15303
15399
  );
15304
15400
  if (currOptions[0]) {
15305
- optins.push(currOptions[0]);
15401
+ options22.push(currOptions[0]);
15306
15402
  } else {
15307
- column[0] && optins.push(column[0]);
15403
+ columnOptions[0] && options22.push(columnOptions[0]);
15308
15404
  }
15309
- return column;
15310
15405
  });
15311
- return optins;
15406
+ return options22;
15312
15407
  };
15313
- const chooseItem = (option, columnIndex2) => {
15314
- if (option && Object.keys(option).length) {
15315
- if (chooseValueData[columnIndex2] !== option.value) {
15408
+ useEffect(() => {
15409
+ if (!visible) {
15410
+ return;
15411
+ }
15412
+ onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
15413
+ if (isConfirmEvent.current) {
15414
+ isConfirmEvent.current = false;
15415
+ onConfirm && onConfirm(setSelectedOptions(), selectedValue);
15416
+ }
15417
+ }, [selectedValue, columnsList, visible]);
15418
+ const chooseItem = (columnOptions, columnIndex2) => {
15419
+ var _a2, _b;
15420
+ if (columnOptions && Object.keys(columnOptions).length) {
15421
+ if (selectedValue[columnIndex2] !== columnOptions.value) {
15316
15422
  if (columnsType() === "cascade") {
15317
- chooseValueData[columnIndex2] = option.value ? option.value : "";
15318
- setchooseValueData([...chooseValueData]);
15319
- let index = columnIndex2;
15320
- let cursor = option;
15321
- while (cursor && cursor.children && cursor.children[0]) {
15322
- chooseValueData[index + 1] = cursor.children[0].value;
15323
- setchooseValueData([...chooseValueData]);
15324
- index++;
15325
- const cc = cursor.children[0];
15326
- cursor = cc;
15423
+ selectedValue[columnIndex2] = columnOptions.value || "";
15424
+ setSelectedValue([...selectedValue]);
15425
+ while ((_a2 = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a2[0]) {
15426
+ selectedValue[columnIndex2 + 1] = columnOptions.children[0].value;
15427
+ setSelectedValue([...selectedValue]);
15428
+ columnIndex2++;
15429
+ columnOptions = columnOptions.children[0];
15327
15430
  }
15328
- if (cursor && cursor.children) {
15329
- chooseValueData[index + 1] = "";
15330
- setchooseValueData([...chooseValueData]);
15431
+ if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
15432
+ selectedValue[columnIndex2 + 1] = "";
15433
+ setSelectedValue([...selectedValue]);
15331
15434
  }
15332
15435
  setColumnsList(normalListData());
15333
15436
  } else {
15334
- setchooseValueData((data) => {
15437
+ setSelectedValue((data) => {
15335
15438
  const cdata = [...data];
15336
15439
  cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
15337
- option,
15440
+ columnOptions,
15338
15441
  "value"
15339
- ) ? option.value : "";
15442
+ ) ? columnOptions.value : "";
15340
15443
  return cdata;
15341
15444
  });
15342
15445
  }
15343
- setcolumnIndex(columnIndex2);
15344
- }
15345
- }
15346
- };
15347
- const normalListData = () => {
15348
- const type4 = columnsType();
15349
- switch (type4) {
15350
- case "multiple":
15351
- return listData;
15352
- case "cascade":
15353
- return formatCascade(listData, chooseValueData);
15354
- default:
15355
- return [listData];
15356
- }
15357
- };
15358
- const columnsType = () => {
15359
- const firstColumn = listData[0];
15360
- if (firstColumn) {
15361
- if (Array.isArray(firstColumn)) {
15362
- return "multiple";
15363
- }
15364
- if ("children" in firstColumn) {
15365
- return "cascade";
15446
+ setColumnIndex(columnIndex2);
15366
15447
  }
15367
15448
  }
15368
- return "single";
15369
15449
  };
15370
- const formatCascade = (columns, defaultValues) => {
15371
- const formatted = [];
15372
- let cursor = {
15373
- text: "",
15374
- value: "",
15375
- children: columns
15376
- };
15377
- let columnIndex2 = 0;
15378
- while (cursor && cursor.children) {
15379
- const options2 = cursor.children;
15380
- const value = defaultValues[columnIndex2];
15381
- let index = options2.findIndex(
15382
- (columnItem) => columnItem.value === value
15383
- );
15384
- if (index === -1)
15385
- index = 0;
15386
- cursor = cursor.children[index];
15387
- columnIndex2++;
15388
- formatted.push(options2);
15389
- }
15390
- return formatted;
15391
- };
15392
- const init = () => {
15393
- const data = [];
15394
- const normalData = normalListData();
15395
- setColumnsList(normalData);
15396
- normalData.length > 0 && normalData.map((item) => {
15397
- item[0] && data.push(item[0].value);
15398
- return item;
15450
+ const confirm2 = () => {
15451
+ let movings = false;
15452
+ refs.forEach((ref2) => {
15453
+ if (ref2.moving)
15454
+ movings = true;
15455
+ ref2.stopMomentum();
15399
15456
  });
15400
- if (!defaultValueData && chooseValueData.length === 0) {
15401
- setchooseValueData([...data]);
15457
+ if (movings) {
15458
+ isConfirmEvent.current = true;
15459
+ } else {
15460
+ onConfirm && onConfirm(setSelectedOptions(), selectedValue);
15461
+ closePicker();
15402
15462
  }
15463
+ setTimeout(() => {
15464
+ isConfirmEvent.current = false;
15465
+ }, 0);
15403
15466
  };
15404
- const renderToolbar = () => {
15405
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: b("control"), children: [
15406
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: b("cancel-btn"), onClick: () => closeActionSheet(), children: locale.cancel }),
15407
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("title"), children: title || "" }),
15408
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: b("confirm-btn"), onClick: confirm2, children: locale.confirm })
15467
+ const closePicker = () => {
15468
+ onClose && onClose(setSelectedOptions(), selectedValue);
15469
+ afterClose && afterClose(setSelectedOptions(), selectedValue, pickerRef);
15470
+ };
15471
+ const renderTitleBar = () => {
15472
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__control`, children: [
15473
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
15474
+ "span",
15475
+ {
15476
+ className: `${classPrefix2}__cancel-btn`,
15477
+ onClick: () => closePicker(),
15478
+ children: locale.cancel
15479
+ }
15480
+ ),
15481
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__title`, children: title || "" }),
15482
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${classPrefix2}__confirm-btn`, onClick: confirm2, children: locale.confirm })
15409
15483
  ] });
15410
15484
  };
15411
15485
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -15414,20 +15488,20 @@ const InternalPicker = (props, ref) => {
15414
15488
  visible,
15415
15489
  position: "bottom",
15416
15490
  onClose: () => {
15417
- closeActionSheet();
15491
+ closePicker();
15418
15492
  },
15419
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${b()} ${className || ""}`, style, ...rest, children: [
15420
- renderToolbar(),
15421
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("panel"), ref: pickerRef, children: columnsList == null ? void 0 : columnsList.map((item, index) => {
15493
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, ...rest, children: [
15494
+ renderTitleBar(),
15495
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__panel`, ref: pickerRef, children: columnsList == null ? void 0 : columnsList.map((item, index) => {
15422
15496
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15423
- PickerSlot$1,
15497
+ PickerPanel$1,
15424
15498
  {
15425
15499
  ref: setRefs(index),
15426
- defaultValue: chooseValueData == null ? void 0 : chooseValueData[index],
15427
- listData: item,
15500
+ defaultValue: selectedValue == null ? void 0 : selectedValue[index],
15501
+ options: item,
15428
15502
  threeDimensional,
15429
15503
  chooseItem: (value, index2) => chooseItem(value, index2),
15430
- swipeDuration,
15504
+ duration,
15431
15505
  keyIndex: index
15432
15506
  },
15433
15507
  index
@@ -15478,7 +15552,7 @@ const DatePicker = (props) => {
15478
15552
  const [show, setShow] = useState(false);
15479
15553
  const [currentDate, setCurrentDate] = useState(modelValue);
15480
15554
  const [defaultValue, setDefaultValue] = useState([]);
15481
- const [listData, setListData] = useState([]);
15555
+ const [options2, setListData] = useState([]);
15482
15556
  const pickerRef = useRef(null);
15483
15557
  const isDate = (val) => {
15484
15558
  return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
@@ -15596,7 +15670,7 @@ const DatePicker = (props) => {
15596
15670
  }
15597
15671
  return result;
15598
15672
  };
15599
- const updateChooseValueCustmer = (index, selectedValue, cacheValueData) => {
15673
+ const updateChooseValueCustmer = (cacheValueData, selectedValue, index) => {
15600
15674
  if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
15601
15675
  type4.toLocaleLowerCase()
15602
15676
  )) {
@@ -15635,7 +15709,7 @@ const DatePicker = (props) => {
15635
15709
  const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date4 == null ? void 0 : date4.getTime());
15636
15710
  date4 && isDate(date4) && !isEqual2 && setCurrentDate(formatValue(date4));
15637
15711
  }
15638
- props.onChange && props.onChange(index, selectedValue, cacheValueData);
15712
+ props.onChange && props.onChange(cacheValueData, selectedValue, index);
15639
15713
  };
15640
15714
  const padZero = (num, targetLength = 2) => {
15641
15715
  let str = `${num}`;
@@ -15731,16 +15805,16 @@ const DatePicker = (props) => {
15731
15805
  className: `nut-datepicker ${className || ""}`,
15732
15806
  style,
15733
15807
  ...rest,
15734
- children: listData.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
15808
+ children: options2.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
15735
15809
  Picker$1,
15736
15810
  {
15737
15811
  title,
15738
15812
  visible: show,
15739
- listData,
15813
+ options: options2,
15740
15814
  onClose: onCloseDatePicker,
15741
- defaultValueData: defaultValue,
15742
- onConfirm: (values, options2) => onConfirmDatePicker && onConfirmDatePicker(values, options2),
15743
- onChange: (index, value, list) => updateChooseValueCustmer(index, value, list),
15815
+ defaultValue,
15816
+ onConfirm: (options22, values) => onConfirmDatePicker && onConfirmDatePicker(options22, values),
15817
+ onChange: (list, value, index) => updateChooseValueCustmer(list, value, index),
15744
15818
  threeDimensional,
15745
15819
  ref: pickerRef
15746
15820
  }
@@ -17352,7 +17426,7 @@ const defaultProps$S = {
17352
17426
  digits: 0,
17353
17427
  async: false
17354
17428
  };
17355
- const classPrefix$3 = `nut-inputnumber`;
17429
+ const classPrefix$7 = `nut-inputnumber`;
17356
17430
  const InputNumber = (props) => {
17357
17431
  const {
17358
17432
  children,
@@ -17395,8 +17469,8 @@ const InputNumber = (props) => {
17395
17469
  }, []);
17396
17470
  const classes = classNames(
17397
17471
  {
17398
- [`${classPrefix$3}`]: true,
17399
- [`${classPrefix$3}--disabled`]: disabled
17472
+ [`${classPrefix$7}`]: true,
17473
+ [`${classPrefix$7}--disabled`]: disabled
17400
17474
  },
17401
17475
  className
17402
17476
  );
@@ -18605,7 +18679,7 @@ const Toast = {
18605
18679
  },
18606
18680
  loading(msg, option = {}) {
18607
18681
  errorMsg$1(msg);
18608
- return notice$1({ msg, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, {}), type: "loading", ...option });
18682
+ return notice$1({ msg, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, {}), type: "loading", ...option });
18609
18683
  },
18610
18684
  warn(msg, option = {}) {
18611
18685
  errorMsg$1(msg);
@@ -19690,144 +19764,120 @@ const Switch = (props) => {
19690
19764
  Switch.defaultProps = defaultProps$H;
19691
19765
  Switch.displayName = "NutSwitch";
19692
19766
  const defaultProps$G = {
19767
+ ...ComponentDefaults,
19693
19768
  defaultValue: "",
19694
- textAlign: "left",
19695
- limitshow: false,
19696
- maxlength: "",
19697
- rows: "",
19769
+ showCount: false,
19770
+ rows: 2,
19771
+ maxLength: 140,
19698
19772
  placeholder: "",
19699
- readonly: false,
19773
+ readOnly: false,
19700
19774
  disabled: false,
19701
- autosize: false
19775
+ autoSize: false
19702
19776
  };
19703
19777
  const TextArea = (props) => {
19704
19778
  const { locale } = useConfig();
19705
19779
  const {
19706
19780
  className,
19781
+ value,
19707
19782
  defaultValue,
19708
- textAlign,
19709
- limitshow,
19710
- maxlength,
19783
+ showCount,
19784
+ maxLength,
19711
19785
  rows,
19712
19786
  placeholder,
19713
- readonly,
19787
+ readOnly,
19714
19788
  disabled,
19715
- autosize,
19789
+ autoSize,
19716
19790
  style,
19717
19791
  onChange,
19718
19792
  onBlur,
19719
- onFocus
19793
+ onFocus,
19794
+ ...rest
19720
19795
  } = { ...defaultProps$G, ...props };
19721
- const textareaBem = cn("textarea");
19722
- const [inputValue, SetInputValue] = useState("");
19796
+ const classPrefix2 = "nut-textarea";
19723
19797
  const textareaRef = useRef(null);
19724
- const compositingRef = useRef(false);
19725
- useEffect(() => {
19726
- let initValue = defaultValue;
19727
- if (initValue && maxlength && [...initValue].length > Number(maxlength)) {
19728
- initValue = initValue.substring(0, Number(maxlength));
19729
- }
19730
- SetInputValue(initValue);
19731
- if (autosize) {
19732
- setTimeout(() => {
19733
- setContentHeight();
19734
- });
19798
+ const compositionRef = useRef(false);
19799
+ const format2 = (value2) => {
19800
+ if (maxLength !== void 0 && value2.length > maxLength) {
19801
+ return value2.substring(0, maxLength);
19735
19802
  }
19736
- }, [defaultValue, autosize]);
19803
+ return value2;
19804
+ };
19805
+ const [inputValue, setInputValue] = usePropsValue({
19806
+ value,
19807
+ defaultValue,
19808
+ finalValue: format2(defaultValue),
19809
+ onChange
19810
+ });
19737
19811
  useEffect(() => {
19738
- if (inputValue) {
19739
- if (autosize) {
19740
- setContentHeight();
19741
- }
19812
+ if (autoSize) {
19813
+ setContentHeight();
19742
19814
  }
19743
- }, [inputValue]);
19815
+ }, [autoSize, defaultValue, inputValue]);
19744
19816
  const setContentHeight = () => {
19745
19817
  const textarea = textareaRef.current;
19746
19818
  if (textarea) {
19747
19819
  textarea.style.height = "auto";
19748
- let height = textarea == null ? void 0 : textarea.scrollHeight;
19749
- if (typeof autosize === "object") {
19750
- const { maxHeight, minHeight } = autosize;
19751
- if (maxHeight !== void 0) {
19752
- height = Math.min(height, maxHeight);
19753
- }
19754
- if (minHeight !== void 0) {
19755
- height = Math.max(height, minHeight);
19756
- }
19757
- }
19820
+ const height = textarea == null ? void 0 : textarea.scrollHeight;
19758
19821
  if (height) {
19759
19822
  textarea.style.height = `${height}px`;
19760
19823
  }
19761
19824
  }
19762
19825
  };
19763
- const textChange = (event) => {
19826
+ const handleChange = (event) => {
19764
19827
  const text = event.target;
19765
- if (maxlength && [...text.value].length > Number(maxlength) && !compositingRef.current) {
19766
- text.value = text.value.substring(0, Number(maxlength));
19767
- }
19768
- SetInputValue(text.value);
19769
- onChange && onChange(text.value, event);
19828
+ const value2 = compositionRef.current ? text.value : format2(text.value);
19829
+ setInputValue(value2);
19770
19830
  };
19771
- const textFocus = (event) => {
19831
+ const handleFocus = (event) => {
19772
19832
  if (disabled)
19773
19833
  return;
19774
- if (readonly)
19834
+ if (readOnly)
19775
19835
  return;
19776
19836
  onFocus && onFocus(event);
19777
19837
  };
19778
- const textBlur = (event) => {
19838
+ const handleBlur = (event) => {
19779
19839
  if (disabled)
19780
19840
  return;
19781
- if (readonly)
19841
+ if (readOnly)
19782
19842
  return;
19783
- const text = event.target;
19784
- onChange && onChange(text.value, event);
19785
19843
  onBlur && onBlur(event);
19786
19844
  };
19787
- const startComposing = () => {
19788
- compositingRef.current = true;
19789
- };
19790
- const endComposing = () => {
19791
- compositingRef.current = false;
19792
- };
19793
19845
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
19794
19846
  "div",
19795
19847
  {
19796
- className: `${textareaBem()} ${disabled ? textareaBem("disabled") : ""} ${className || ""}`,
19848
+ className: classNames(classPrefix2, className, {
19849
+ [`${classPrefix2}__disabled`]: disabled
19850
+ }),
19797
19851
  children: [
19798
19852
  /* @__PURE__ */ jsxRuntimeExports.jsx(
19799
19853
  "textarea",
19800
19854
  {
19801
19855
  ref: textareaRef,
19802
- className: textareaBem("textarea"),
19803
- style: {
19804
- textAlign,
19805
- ...style
19806
- },
19856
+ className: `${classPrefix2}__textarea`,
19857
+ style,
19807
19858
  disabled,
19808
- readOnly: readonly,
19859
+ readOnly,
19809
19860
  value: inputValue,
19810
- onChange: (e) => {
19811
- textChange(e);
19812
- },
19813
- onBlur: (e) => {
19814
- textBlur(e);
19861
+ onChange: (e) => handleChange(e),
19862
+ onBlur: (e) => handleBlur(e),
19863
+ onFocus: (e) => handleFocus(e),
19864
+ onCompositionEnd: () => {
19865
+ compositionRef.current = false;
19815
19866
  },
19816
- onFocus: (e) => {
19817
- textFocus(e);
19867
+ onCompositionStart: () => {
19868
+ compositionRef.current = true;
19818
19869
  },
19819
- onCompositionEnd: (e) => endComposing(),
19820
- onCompositionStart: (e) => startComposing(),
19821
19870
  rows,
19822
- maxLength: maxlength < 0 ? 0 : maxlength,
19823
- placeholder: placeholder || locale.placeholder
19871
+ maxLength: maxLength === -1 ? void 0 : maxLength,
19872
+ placeholder: placeholder || locale.placeholder,
19873
+ ...rest
19824
19874
  }
19825
19875
  ),
19826
- limitshow ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: textareaBem("limit"), children: [
19827
- [...inputValue].length,
19876
+ showCount && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__limit`, children: [
19877
+ inputValue.length,
19828
19878
  "/",
19829
- maxlength < 0 ? 0 : maxlength
19830
- ] }) : null
19879
+ maxLength < 0 ? 0 : maxLength
19880
+ ] })
19831
19881
  ]
19832
19882
  }
19833
19883
  );
@@ -20327,7 +20377,7 @@ const InternalUploader = (props, ref) => {
20327
20377
  ),
20328
20378
  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: [
20329
20379
  item.failIcon !== " " && item.loadingIcon !== " " && (item.status === "error" ? item.failIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(x$8, { color: "#fff" }) : item.loadingIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(
20330
- k$2,
20380
+ k$3,
20331
20381
  {
20332
20382
  className: "nut-icon-loading",
20333
20383
  color: "#fff"
@@ -20895,25 +20945,29 @@ const defaultStatus = {
20895
20945
  network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
20896
20946
  };
20897
20947
  const defaultProps$A = {
20948
+ ...ComponentDefaults,
20898
20949
  description: "",
20899
- image: "empty",
20900
20950
  imageSize: "",
20901
- className: ""
20951
+ status: "empty"
20902
20952
  };
20953
+ const classPrefix$6 = `nut-empty`;
20903
20954
  const Empty = (props) => {
20904
20955
  const { locale } = useConfig();
20905
- const { image, imageSize, description, children, className, ...rest } = {
20956
+ const {
20957
+ image,
20958
+ imageSize,
20959
+ description,
20960
+ children,
20961
+ className,
20962
+ status,
20963
+ ...rest
20964
+ } = {
20906
20965
  ...defaultProps$A,
20907
20966
  ...props
20908
20967
  };
20909
20968
  const [imgStyle, setImgStyle] = useState({});
20910
- const b = cn("empty");
20911
- let imageNode = image;
20912
- if (typeof image === "string") {
20913
- const isHttpUrl = image.startsWith("https://") || image.startsWith("http://") || image.startsWith("//");
20914
- const imageUrl = isHttpUrl ? image : defaultStatus[image];
20915
- imageNode = /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "img", src: imageUrl, alt: "empty" });
20916
- }
20969
+ const imageUrl = image || defaultStatus[status];
20970
+ const imageNode = typeof imageUrl === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "img", src: imageUrl, alt: "empty" }) : imageUrl;
20917
20971
  useEffect(() => {
20918
20972
  setImgStyle(() => {
20919
20973
  if (!imageSize) {
@@ -20931,9 +20985,9 @@ const Empty = (props) => {
20931
20985
  };
20932
20986
  });
20933
20987
  }, [imageSize]);
20934
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${b()} ${className}`, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
20935
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("image"), style: imgStyle, children: imageNode }),
20936
- typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("description"), children: description || locale.noData }) : { description },
20988
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$6} ${className}`, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
20989
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$6}__image`, style: imgStyle, children: imageNode }),
20990
+ typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$6}__description`, children: description || locale.noData }) : description,
20937
20991
  children
20938
20992
  ] }) });
20939
20993
  };
@@ -22122,29 +22176,30 @@ const AvatarContext = createContext({});
22122
22176
  const defaultProps$v = {
22123
22177
  ...ComponentDefaults,
22124
22178
  size: "",
22179
+ shape: "round",
22125
22180
  icon: "",
22126
- bgColor: "#eee",
22181
+ background: "#eee",
22127
22182
  color: "#666",
22128
- prefixCls: "nut-avatar",
22129
- url: "",
22183
+ fit: "cover",
22184
+ src: "",
22130
22185
  alt: ""
22131
22186
  };
22187
+ const classPrefix$5 = `nut-avatar`;
22132
22188
  const Avatar = (props) => {
22133
22189
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
22134
22190
  const {
22135
22191
  children,
22136
- prefixCls: prefixCls2,
22137
22192
  size,
22138
22193
  shape,
22139
- bgColor,
22194
+ background,
22140
22195
  color,
22141
- url: url2,
22196
+ src,
22142
22197
  alt,
22143
22198
  icon,
22199
+ fit,
22144
22200
  className,
22145
22201
  style,
22146
- activeAvatar,
22147
- onActiveAvatar,
22202
+ onClick,
22148
22203
  onError,
22149
22204
  ...rest
22150
22205
  } = {
@@ -22156,24 +22211,23 @@ const Avatar = (props) => {
22156
22211
  const [avatarIndex, setAvatarIndex] = useState(1);
22157
22212
  const avatarRef = useRef(null);
22158
22213
  const parent = useContext(AvatarContext);
22159
- const b = cn("avatar");
22214
+ const sizeValue = ["large", "normal", "small"];
22160
22215
  const classes = classNames({
22161
- [`nut-avatar-${size || ((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || "normal"}`]: true,
22162
- [`nut-avatar-${shape || ((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || "round"}`]: true
22216
+ [`nut-avatar-${((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || size || "normal"}`]: true,
22217
+ [`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
22163
22218
  });
22164
- const cls = classNames(b(""), classes, className);
22165
- const sizeValue = ["large", "normal", "small"];
22219
+ const cls = classNames(classPrefix$5, classes, className);
22166
22220
  const styles = {
22167
22221
  width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
22168
22222
  height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
22169
- backgroundColor: `${bgColor}`,
22223
+ backgroundColor: `${background}`,
22170
22224
  color: `${color}`,
22171
- 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` : "",
22172
- zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
22225
+ 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` : "",
22226
+ zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.level) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
22173
22227
  ...style
22174
22228
  };
22175
22229
  const maxStyles = {
22176
- backgroundColor: `${(_f = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _f.maxBgColor}`,
22230
+ backgroundColor: `${(_f = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _f.maxBackground}`,
22177
22231
  color: `${(_g = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _g.maxColor}`
22178
22232
  };
22179
22233
  useEffect(() => {
@@ -22191,23 +22245,22 @@ const Avatar = (props) => {
22191
22245
  }
22192
22246
  }
22193
22247
  const index = Number((_b2 = (_a3 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a3.dataset) == null ? void 0 : _b2.index);
22194
- const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.maxCount;
22248
+ const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.max;
22195
22249
  setMaxSum(children2.length);
22196
22250
  setAvatarIndex(index);
22197
22251
  if (index === children2.length && index !== maxCount && children2.length > maxCount) {
22198
22252
  setShowMax(true);
22199
22253
  }
22200
22254
  };
22201
- const errorEvent = (e) => {
22255
+ const errorEvent = () => {
22202
22256
  if (props.onError) {
22203
- props.onError(e);
22257
+ props.onError();
22204
22258
  }
22205
22259
  };
22206
22260
  const clickAvatar = (e) => {
22207
- activeAvatar && activeAvatar(e);
22208
- onActiveAvatar && onActiveAvatar(e);
22261
+ onClick && onClick(e);
22209
22262
  };
22210
- 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(
22263
+ 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(
22211
22264
  "div",
22212
22265
  {
22213
22266
  className: cls,
@@ -22216,13 +22269,14 @@ const Avatar = (props) => {
22216
22269
  onClick: clickAvatar,
22217
22270
  ref: avatarRef,
22218
22271
  children: [
22219
- (!((_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: [
22220
- url2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
22221
- "img",
22272
+ (!((_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: [
22273
+ src && /* @__PURE__ */ jsxRuntimeExports.jsx(
22274
+ Image$1,
22222
22275
  {
22223
22276
  className: "avatar-img",
22224
- src: url2,
22277
+ src,
22225
22278
  alt,
22279
+ style: { objectFit: fit },
22226
22280
  onError: errorEvent
22227
22281
  }
22228
22282
  ),
@@ -22230,9 +22284,10 @@ const Avatar = (props) => {
22230
22284
  ...icon.props,
22231
22285
  className: `${icon.props.className || ""} icon`
22232
22286
  }) : null,
22233
- children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text", children })
22287
+ children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text", children }),
22288
+ !src && !icon && !children && /* @__PURE__ */ jsxRuntimeExports.jsx(k$2, { className: "icon" })
22234
22289
  ] }),
22235
- 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)}` })
22290
+ 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)}` })
22236
22291
  ]
22237
22292
  }
22238
22293
  ) });
@@ -22302,7 +22357,7 @@ const Skeleton = (props) => {
22302
22357
  Avatar,
22303
22358
  {
22304
22359
  className: avatarClass,
22305
- bgColor: "rgb(239, 239, 239)",
22360
+ background: "rgb(239, 239, 239)",
22306
22361
  shape: avatarShape,
22307
22362
  style: getStyle()
22308
22363
  }
@@ -22335,9 +22390,7 @@ function preventDefault(event, isStopPropagation) {
22335
22390
  }
22336
22391
  }
22337
22392
  const defaultProps$t = {
22338
- name: "",
22339
- leftWidth: 0,
22340
- rightWidth: 0
22393
+ name: ""
22341
22394
  };
22342
22395
  const Swipe = forwardRef((props, instanceRef) => {
22343
22396
  const swipeBem = cn("swipe");
@@ -22359,14 +22412,8 @@ const Swipe = forwardRef((props, instanceRef) => {
22359
22412
  transform: `translate3d(${state.offset}px, 0, 0)`,
22360
22413
  transitionDuration: state.dragging ? "0s" : ".6s"
22361
22414
  };
22362
- const leftWidth = useMemo(
22363
- () => props.leftWidth ? props.leftWidth : actionWidth.left,
22364
- [props.leftWidth, actionWidth.left]
22365
- );
22366
- const rightWidth = useMemo(
22367
- () => props.rightWidth ? props.rightWidth : actionWidth.right,
22368
- [props.rightWidth, actionWidth.right]
22369
- );
22415
+ const leftWidth = actionWidth.left;
22416
+ const rightWidth = actionWidth.right;
22370
22417
  const onTouchStart = (event) => {
22371
22418
  if (!props.disabled) {
22372
22419
  startOffset.current = state.offset;
@@ -22530,7 +22577,7 @@ const defaultProps$s = {
22530
22577
  onClick: (event) => {
22531
22578
  }
22532
22579
  };
22533
- const classPrefix$2 = `nut-animate`;
22580
+ const classPrefix$4 = `nut-animate`;
22534
22581
  const Animate = (props) => {
22535
22582
  const { className, type: type4, action, loop: loop2, onClick, children, ...rest } = {
22536
22583
  ...defaultProps$s,
@@ -22539,7 +22586,7 @@ const Animate = (props) => {
22539
22586
  const [clicked, setClicked] = useState(false);
22540
22587
  const classes = classNames({
22541
22588
  "nut-ani-container": true,
22542
- [`${classPrefix$2}-${type4}`]: action === "initial" || clicked ? type4 : false,
22589
+ [`${classPrefix$4}-${type4}`]: action === "initial" || clicked ? type4 : false,
22543
22590
  loop: loop2
22544
22591
  });
22545
22592
  const cls = classNames(classes, className);
@@ -22911,22 +22958,20 @@ const Audio = (props) => {
22911
22958
  Audio.defaultProps = defaultProps$p;
22912
22959
  Audio.displayName = "NutAudio";
22913
22960
  const defaultProps$o = {
22961
+ ...ComponentDefaults,
22914
22962
  maxContent: "",
22915
- maxCount: "",
22916
- maxBgColor: "#eee",
22963
+ max: "",
22964
+ maxBackground: "#eee",
22917
22965
  maxColor: "#666",
22918
- size: "",
22919
- shape: "",
22920
- span: "-8",
22921
- zIndex: "left"
22966
+ gap: "-8",
22967
+ level: "left"
22922
22968
  };
22969
+ const classPrefix$3 = `nut-avatar-group`;
22923
22970
  const AvatarGroup = (props) => {
22924
- useConfig();
22925
22971
  const propAvatarGroup = { ...defaultProps$o, ...props };
22926
22972
  const { className, style, children } = propAvatarGroup;
22927
22973
  const avatarGroupRef = useRef(null);
22928
- const b = cn("avatar-group");
22929
- const cls = classNames(b(""), className);
22974
+ const cls = classNames(classPrefix$3, className);
22930
22975
  const parentAvatar = {
22931
22976
  propAvatarGroup,
22932
22977
  avatarGroupRef
@@ -22944,7 +22989,7 @@ const defaultProps$n = {
22944
22989
  background: "#e5e9f2",
22945
22990
  clockwise: true
22946
22991
  };
22947
- const classPrefix$1 = `nut-circleprogress`;
22992
+ const classPrefix$2 = `nut-circleprogress`;
22948
22993
  const CircleProgress = (props) => {
22949
22994
  var _a2;
22950
22995
  const {
@@ -22963,7 +23008,7 @@ const CircleProgress = (props) => {
22963
23008
  ...defaultProps$n,
22964
23009
  ...props
22965
23010
  };
22966
- const classes = classNames(className, classPrefix$1);
23011
+ const classes = classNames(className, classPrefix$2);
22967
23012
  const refRandomId = Math.random().toString(36).slice(-8);
22968
23013
  const styles = {
22969
23014
  height: `${Number(radius) * 2}px`,
@@ -23434,6 +23479,7 @@ const CountDown = React__default.forwardRef(InternalCountDown);
23434
23479
  CountDown.defaultProps = defaultProps$k;
23435
23480
  CountDown.displayName = "NutCountDown";
23436
23481
  const defaultProps$j = {
23482
+ ...ComponentDefaults,
23437
23483
  content: "",
23438
23484
  direction: "end",
23439
23485
  rows: 1,
@@ -23442,12 +23488,13 @@ const defaultProps$j = {
23442
23488
  symbol: "...",
23443
23489
  lineHeight: "20"
23444
23490
  };
23491
+ const classPrefix$1 = `nut-ellipsis`;
23445
23492
  const Ellipsis = (props) => {
23446
23493
  var _a2, _b;
23447
- useConfig();
23448
23494
  const {
23449
23495
  children,
23450
23496
  content,
23497
+ className,
23451
23498
  direction,
23452
23499
  rows,
23453
23500
  expandText,
@@ -23455,7 +23502,8 @@ const Ellipsis = (props) => {
23455
23502
  symbol,
23456
23503
  lineHeight,
23457
23504
  onClick,
23458
- onChange
23505
+ onChange,
23506
+ ...rest
23459
23507
  } = { ...defaultProps$j, ...props };
23460
23508
  let container = null;
23461
23509
  let maxHeight = 0;
@@ -23463,10 +23511,8 @@ const Ellipsis = (props) => {
23463
23511
  const [expanded, setExpanded] = useState(false);
23464
23512
  const ellipsis = useRef();
23465
23513
  const root2 = useRef(null);
23514
+ const classes = classNames(classPrefix$1, className);
23466
23515
  useLayoutEffect(() => {
23467
- createContainer();
23468
- }, []);
23469
- useEffect(() => {
23470
23516
  if (content) {
23471
23517
  createContainer();
23472
23518
  }
@@ -23584,7 +23630,7 @@ const Ellipsis = (props) => {
23584
23630
  const handleClick2 = () => {
23585
23631
  onClick && onClick();
23586
23632
  };
23587
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-ellipsis", onClick: handleClick2, ref: root2, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
23633
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, onClick: handleClick2, ref: root2, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
23588
23634
  !exceeded ? content : null,
23589
23635
  exceeded && !expanded ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
23590
23636
  (_a2 = ellipsis.current) == null ? void 0 : _a2.leading,
@@ -25014,13 +25060,11 @@ Steps.defaultProps = defaultProps$9;
25014
25060
  Steps.displayName = "NutSteps";
25015
25061
  const defaultProps$8 = {
25016
25062
  ...ComponentDefaults,
25017
- className: "",
25018
- style: {},
25019
25063
  columns: [],
25020
25064
  data: [],
25021
25065
  bordered: true,
25022
25066
  striped: false,
25023
- noData: "无数据",
25067
+ noData: "",
25024
25068
  sorterIcon: null,
25025
25069
  showHeader: true
25026
25070
  };
@@ -25037,9 +25081,9 @@ const Table = (props) => {
25037
25081
  summary,
25038
25082
  striped,
25039
25083
  noData,
25040
- onSorter,
25041
25084
  sorterIcon,
25042
25085
  showHeader,
25086
+ onSort,
25043
25087
  ...rest
25044
25088
  } = {
25045
25089
  ...defaultProps$8,
@@ -25051,12 +25095,13 @@ const Table = (props) => {
25051
25095
  setCurData(data);
25052
25096
  }
25053
25097
  }, [data]);
25054
- const b = cn("table");
25055
- const classes = classNames({});
25056
- const cls = classNames(b(), classes, className);
25098
+ const classPrefix2 = "nut-table";
25099
+ const headerClassPrefix = `${classPrefix2}__main__head__tr`;
25100
+ const bodyClassPrefix = `${classPrefix2}__main__body__tr`;
25101
+ const cls = classNames(classPrefix2, className);
25057
25102
  const handleSorterClick = (item) => {
25058
25103
  if (item.sorter) {
25059
- onSorter && onSorter(item, curData);
25104
+ onSort && onSort(item, curData);
25060
25105
  if (typeof item.sorter === "function") {
25061
25106
  setCurData(curData.sort(item.sorter));
25062
25107
  } else {
@@ -25066,8 +25111,8 @@ const Table = (props) => {
25066
25111
  };
25067
25112
  const cellClasses = (item) => {
25068
25113
  return {
25069
- "nut-table__main__head__tr--border": props.bordered,
25070
- [`nut-table__main__head__tr--align${item.align ? item.align : ""}`]: true
25114
+ [`${headerClassPrefix}--border`]: props.bordered,
25115
+ [`${headerClassPrefix}--align${item.align ? item.align : ""}`]: true
25071
25116
  };
25072
25117
  };
25073
25118
  const getColumnItem = (value) => {
@@ -25078,10 +25123,7 @@ const Table = (props) => {
25078
25123
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
25079
25124
  "span",
25080
25125
  {
25081
- className: classNames(
25082
- "nut-table__main__head__tr__th",
25083
- cellClasses(item)
25084
- ),
25126
+ className: classNames(`${headerClassPrefix}__th`, cellClasses(item)),
25085
25127
  onClick: () => handleSorterClick(item),
25086
25128
  children: [
25087
25129
  item.title,
@@ -25104,7 +25146,7 @@ const Table = (props) => {
25104
25146
  "span",
25105
25147
  {
25106
25148
  className: classNames(
25107
- "nut-table__main__body__tr__td",
25149
+ `${bodyClassPrefix}__td`,
25108
25150
  cellClasses(getColumnItem(value))
25109
25151
  ),
25110
25152
  children: typeof item[value] === "function" || typeof render2 === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: render2 ? render2(item) : item[value](item) }) : item[value]
@@ -25115,24 +25157,23 @@ const Table = (props) => {
25115
25157
  };
25116
25158
  const renderBoyTrs = () => {
25117
25159
  return curData.map((item, index) => {
25118
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__body__tr", children: renderBodyTds(item) }, index);
25160
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bodyClassPrefix, children: renderBodyTds(item) }, index);
25119
25161
  });
25120
25162
  };
25121
25163
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cls, style, ...rest, children: [
25122
25164
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
25123
25165
  "div",
25124
25166
  {
25125
- className: classNames("nut-table__main", {
25126
- "nut-table__main--striped": striped
25167
+ className: classNames(`${classPrefix2}__main`, {
25168
+ [`${classPrefix2}__main--striped`]: striped
25127
25169
  }),
25128
25170
  children: [
25129
- showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__head__tr", children: renderHeadCells() }) }),
25130
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__body", children: renderBoyTrs() })
25171
+ showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__head`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: headerClassPrefix, children: renderHeadCells() }) }),
25172
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__body`, children: renderBoyTrs() })
25131
25173
  ]
25132
25174
  }
25133
25175
  ),
25134
- summary && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__summary", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-table__summary__text", children: summary }) }),
25135
- 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 }) }) })
25176
+ (summary || curData.length === 0) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__summary`, children: summary || noData })
25136
25177
  ] });
25137
25178
  };
25138
25179
  Table.defaultProps = defaultProps$8;