@nutui/nutui-react 2.0.0-alpha.7 → 2.0.0-alpha.9
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.
- package/CHANGELOG.md +26 -0
- package/dist/esm/Audio.js +12 -8
- package/dist/esm/Cascader.js +20 -12
- package/dist/esm/Elevator.js +6 -5
- package/dist/esm/Image.js +2 -5
- package/dist/esm/ImagePreview.js +9 -9
- package/dist/esm/Indicator.js +4 -4
- package/dist/esm/Notify.js +35 -46
- package/dist/esm/NumberKeyboard.js +137 -195
- package/dist/esm/Price.js +22 -23
- package/dist/esm/PullToRefresh.js +8 -8
- package/dist/esm/Radio.js +2 -0
- package/dist/esm/RadioGroup.js +31 -51
- package/dist/esm/Range/style/index.js +1 -1
- package/dist/esm/Range.js +119 -174
- package/dist/esm/Swiper.js +100 -111
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/radio2.js +52 -54
- package/dist/esm/tabs2.js +19 -8
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.mjs +1306 -1386
- package/dist/nutui.react.umd.js +1305 -1385
- package/dist/packages/imagepreview/imagepreview.scss +5 -0
- package/dist/packages/notify/notify.scss +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.scss +29 -77
- package/dist/packages/price/price.scss +8 -0
- package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -8
- package/dist/packages/radio/radio.scss +13 -32
- package/dist/packages/radiogroup/radiogroup.scss +17 -51
- package/dist/packages/range/range.scss +24 -49
- package/dist/packages/swiper/swiper.scss +0 -15
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +61 -61
- package/dist/styles/variables.scss +61 -60
- package/dist/types/index.d.ts +84 -106
- package/package.json +1 -1
- /package/dist/esm/{UserContext3.js → context2.js} +0 -0
package/dist/nutui.react.umd.js
CHANGED
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9
9
|
return value;
|
|
10
10
|
};
|
|
11
11
|
/*!
|
|
12
|
-
* @nutui/nutui-react v2.0.0-alpha.
|
|
12
|
+
* @nutui/nutui-react v2.0.0-alpha.9 Wed May 17 2023 18:23:02 GMT+0800 (China Standard Time)
|
|
13
13
|
* (c) 2023 @jdf2e.
|
|
14
14
|
* Released under the MIT License.
|
|
15
15
|
*/
|
|
@@ -1661,7 +1661,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1661
1661
|
process.env.NODE_ENV === "production" ? h.exports = ur() : h.exports = sr();
|
|
1662
1662
|
})(ir);
|
|
1663
1663
|
const lr = D.Fragment, cr = D.jsx, vr = D.jsxs;
|
|
1664
|
-
const a$
|
|
1664
|
+
const a$w = {
|
|
1665
1665
|
className: "",
|
|
1666
1666
|
style: void 0,
|
|
1667
1667
|
name: "ArrowDown2",
|
|
@@ -1669,8 +1669,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1669
1669
|
height: "",
|
|
1670
1670
|
onClick: () => {
|
|
1671
1671
|
}
|
|
1672
|
-
}, y$
|
|
1673
|
-
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$
|
|
1672
|
+
}, y$9 = (h) => {
|
|
1673
|
+
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$w, ...h }, f = (t) => {
|
|
1674
1674
|
n && n(t);
|
|
1675
1675
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
1676
1676
|
const t = "nut-icon";
|
|
@@ -1707,8 +1707,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1707
1707
|
}
|
|
1708
1708
|
) });
|
|
1709
1709
|
};
|
|
1710
|
-
y$
|
|
1711
|
-
const a$
|
|
1710
|
+
y$9.defaultProps = a$w;
|
|
1711
|
+
const a$v = {
|
|
1712
1712
|
className: "",
|
|
1713
1713
|
style: void 0,
|
|
1714
1714
|
name: "ArrowUp2",
|
|
@@ -1717,7 +1717,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1717
1717
|
onClick: () => {
|
|
1718
1718
|
}
|
|
1719
1719
|
}, x$g = (h) => {
|
|
1720
|
-
const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$
|
|
1720
|
+
const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$v, ...h }, g = (t) => {
|
|
1721
1721
|
n && n(t);
|
|
1722
1722
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", w = () => {
|
|
1723
1723
|
const t = "nut-icon";
|
|
@@ -1754,8 +1754,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1754
1754
|
}
|
|
1755
1755
|
) });
|
|
1756
1756
|
};
|
|
1757
|
-
x$g.defaultProps = a$
|
|
1758
|
-
const a$
|
|
1757
|
+
x$g.defaultProps = a$v;
|
|
1758
|
+
const a$u = {
|
|
1759
1759
|
className: "",
|
|
1760
1760
|
style: void 0,
|
|
1761
1761
|
name: "CheckChecked",
|
|
@@ -1763,8 +1763,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1763
1763
|
height: "",
|
|
1764
1764
|
onClick: () => {
|
|
1765
1765
|
}
|
|
1766
|
-
}, y$
|
|
1767
|
-
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$
|
|
1766
|
+
}, y$8 = (h) => {
|
|
1767
|
+
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$u, ...h }, C = (t) => {
|
|
1768
1768
|
o && o(t);
|
|
1769
1769
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
|
|
1770
1770
|
const t = "nut-icon";
|
|
@@ -1812,8 +1812,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1812
1812
|
}
|
|
1813
1813
|
) });
|
|
1814
1814
|
};
|
|
1815
|
-
y$
|
|
1816
|
-
const a$
|
|
1815
|
+
y$8.defaultProps = a$u;
|
|
1816
|
+
const a$t = {
|
|
1817
1817
|
className: "",
|
|
1818
1818
|
style: void 0,
|
|
1819
1819
|
name: "CheckDisabled",
|
|
@@ -1822,7 +1822,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1822
1822
|
onClick: () => {
|
|
1823
1823
|
}
|
|
1824
1824
|
}, x$f = (h) => {
|
|
1825
|
-
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$
|
|
1825
|
+
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$t, ...h }, g = (t) => {
|
|
1826
1826
|
o && o(t);
|
|
1827
1827
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
1828
1828
|
const t = "nut-icon";
|
|
@@ -1859,8 +1859,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1859
1859
|
}
|
|
1860
1860
|
) });
|
|
1861
1861
|
};
|
|
1862
|
-
x$f.defaultProps = a$
|
|
1863
|
-
const a$
|
|
1862
|
+
x$f.defaultProps = a$t;
|
|
1863
|
+
const a$s = {
|
|
1864
1864
|
className: "",
|
|
1865
1865
|
style: void 0,
|
|
1866
1866
|
name: "CheckNormal",
|
|
@@ -1869,7 +1869,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1869
1869
|
onClick: () => {
|
|
1870
1870
|
}
|
|
1871
1871
|
}, N = (h) => {
|
|
1872
|
-
const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$
|
|
1872
|
+
const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$s, ...h }, f = (t) => {
|
|
1873
1873
|
r && r(t);
|
|
1874
1874
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
1875
1875
|
const t = "nut-icon";
|
|
@@ -1906,8 +1906,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1906
1906
|
}
|
|
1907
1907
|
) });
|
|
1908
1908
|
};
|
|
1909
|
-
N.defaultProps = a$
|
|
1910
|
-
const a$
|
|
1909
|
+
N.defaultProps = a$s;
|
|
1910
|
+
const a$r = {
|
|
1911
1911
|
className: "",
|
|
1912
1912
|
style: void 0,
|
|
1913
1913
|
name: "Check",
|
|
@@ -1916,7 +1916,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1916
1916
|
onClick: () => {
|
|
1917
1917
|
}
|
|
1918
1918
|
}, x$e = (h) => {
|
|
1919
|
-
const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$
|
|
1919
|
+
const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$r, ...h }, g = (t) => {
|
|
1920
1920
|
r && r(t);
|
|
1921
1921
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
1922
1922
|
const t = "nut-icon";
|
|
@@ -1953,8 +1953,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1953
1953
|
}
|
|
1954
1954
|
) });
|
|
1955
1955
|
};
|
|
1956
|
-
x$e.defaultProps = a$
|
|
1957
|
-
const a$
|
|
1956
|
+
x$e.defaultProps = a$r;
|
|
1957
|
+
const a$q = {
|
|
1958
1958
|
className: "",
|
|
1959
1959
|
style: void 0,
|
|
1960
1960
|
name: "Checked",
|
|
@@ -1963,7 +1963,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1963
1963
|
onClick: () => {
|
|
1964
1964
|
}
|
|
1965
1965
|
}, x$d = (h) => {
|
|
1966
|
-
const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$
|
|
1966
|
+
const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$q, ...h }, f = (t) => {
|
|
1967
1967
|
r && r(t);
|
|
1968
1968
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
1969
1969
|
const t = "nut-icon";
|
|
@@ -2000,8 +2000,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2000
2000
|
}
|
|
2001
2001
|
) });
|
|
2002
2002
|
};
|
|
2003
|
-
x$d.defaultProps = a$
|
|
2004
|
-
const a$
|
|
2003
|
+
x$d.defaultProps = a$q;
|
|
2004
|
+
const a$p = {
|
|
2005
2005
|
className: "",
|
|
2006
2006
|
style: void 0,
|
|
2007
2007
|
name: "Checklist",
|
|
@@ -2010,7 +2010,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2010
2010
|
onClick: () => {
|
|
2011
2011
|
}
|
|
2012
2012
|
}, x$c = (h) => {
|
|
2013
|
-
const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$
|
|
2013
|
+
const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$p, ...h }, g = (t) => {
|
|
2014
2014
|
o && o(t);
|
|
2015
2015
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
|
|
2016
2016
|
const t = "nut-icon";
|
|
@@ -2047,8 +2047,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2047
2047
|
}
|
|
2048
2048
|
) });
|
|
2049
2049
|
};
|
|
2050
|
-
x$c.defaultProps = a$
|
|
2051
|
-
const a$
|
|
2050
|
+
x$c.defaultProps = a$p;
|
|
2051
|
+
const a$o = {
|
|
2052
2052
|
className: "",
|
|
2053
2053
|
style: void 0,
|
|
2054
2054
|
name: "CircleClose",
|
|
@@ -2057,7 +2057,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2057
2057
|
onClick: () => {
|
|
2058
2058
|
}
|
|
2059
2059
|
}, x$b = (h) => {
|
|
2060
|
-
const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$
|
|
2060
|
+
const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$o, ...h }, f = (t) => {
|
|
2061
2061
|
o && o(t);
|
|
2062
2062
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2063
2063
|
const t = "nut-icon";
|
|
@@ -2094,8 +2094,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2094
2094
|
}
|
|
2095
2095
|
) });
|
|
2096
2096
|
};
|
|
2097
|
-
x$b.defaultProps = a$
|
|
2098
|
-
const a$
|
|
2097
|
+
x$b.defaultProps = a$o;
|
|
2098
|
+
const a$n = {
|
|
2099
2099
|
className: "",
|
|
2100
2100
|
style: void 0,
|
|
2101
2101
|
name: "Close",
|
|
@@ -2104,7 +2104,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2104
2104
|
onClick: () => {
|
|
2105
2105
|
}
|
|
2106
2106
|
}, x$a = (h) => {
|
|
2107
|
-
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2107
|
+
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$n, ...h }, g = (t) => {
|
|
2108
2108
|
r && r(t);
|
|
2109
2109
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
2110
2110
|
const t = "nut-icon";
|
|
@@ -2141,8 +2141,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2141
2141
|
}
|
|
2142
2142
|
) });
|
|
2143
2143
|
};
|
|
2144
|
-
x$a.defaultProps = a$
|
|
2145
|
-
const a$
|
|
2144
|
+
x$a.defaultProps = a$n;
|
|
2145
|
+
const a$m = {
|
|
2146
2146
|
className: "",
|
|
2147
2147
|
style: void 0,
|
|
2148
2148
|
name: "Del",
|
|
@@ -2150,8 +2150,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2150
2150
|
height: "",
|
|
2151
2151
|
onClick: () => {
|
|
2152
2152
|
}
|
|
2153
|
-
}, y$
|
|
2154
|
-
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2153
|
+
}, y$7 = (h) => {
|
|
2154
|
+
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$m, ...h }, g = (t) => {
|
|
2155
2155
|
r && r(t);
|
|
2156
2156
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2157
2157
|
const t = "nut-icon";
|
|
@@ -2188,8 +2188,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2188
2188
|
}
|
|
2189
2189
|
) });
|
|
2190
2190
|
};
|
|
2191
|
-
y$
|
|
2192
|
-
const a$
|
|
2191
|
+
y$7.defaultProps = a$m;
|
|
2192
|
+
const a$l = {
|
|
2193
2193
|
className: "",
|
|
2194
2194
|
style: void 0,
|
|
2195
2195
|
name: "DownArrow",
|
|
@@ -2198,7 +2198,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2198
2198
|
onClick: () => {
|
|
2199
2199
|
}
|
|
2200
2200
|
}, x$9 = (h) => {
|
|
2201
|
-
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$
|
|
2201
|
+
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$l, ...h }, f = (t) => {
|
|
2202
2202
|
n && n(t);
|
|
2203
2203
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2204
2204
|
const t = "nut-icon";
|
|
@@ -2235,8 +2235,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2235
2235
|
}
|
|
2236
2236
|
) });
|
|
2237
2237
|
};
|
|
2238
|
-
x$9.defaultProps = a$
|
|
2239
|
-
const a$
|
|
2238
|
+
x$9.defaultProps = a$l;
|
|
2239
|
+
const a$k = {
|
|
2240
2240
|
className: "",
|
|
2241
2241
|
style: void 0,
|
|
2242
2242
|
name: "Failure",
|
|
@@ -2245,7 +2245,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2245
2245
|
onClick: () => {
|
|
2246
2246
|
}
|
|
2247
2247
|
}, x$8 = (h) => {
|
|
2248
|
-
const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$
|
|
2248
|
+
const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$k, ...h }, u = (t) => {
|
|
2249
2249
|
l2 && l2(t);
|
|
2250
2250
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2251
2251
|
const t = "nut-icon";
|
|
@@ -2282,8 +2282,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2282
2282
|
}
|
|
2283
2283
|
) });
|
|
2284
2284
|
};
|
|
2285
|
-
x$8.defaultProps = a$
|
|
2286
|
-
const a$
|
|
2285
|
+
x$8.defaultProps = a$k;
|
|
2286
|
+
const a$j = {
|
|
2287
2287
|
className: "",
|
|
2288
2288
|
style: void 0,
|
|
2289
2289
|
name: "ImageError",
|
|
@@ -2292,7 +2292,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2292
2292
|
onClick: () => {
|
|
2293
2293
|
}
|
|
2294
2294
|
}, k$5 = (h) => {
|
|
2295
|
-
const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$
|
|
2295
|
+
const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$j, ...h }, g = (t) => {
|
|
2296
2296
|
o && o(t);
|
|
2297
2297
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2298
2298
|
const t = "nut-icon";
|
|
@@ -2340,8 +2340,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2340
2340
|
}
|
|
2341
2341
|
) });
|
|
2342
2342
|
};
|
|
2343
|
-
k$5.defaultProps = a$
|
|
2344
|
-
const a$
|
|
2343
|
+
k$5.defaultProps = a$j;
|
|
2344
|
+
const a$i = {
|
|
2345
2345
|
className: "",
|
|
2346
2346
|
style: void 0,
|
|
2347
2347
|
name: "Image",
|
|
@@ -2350,7 +2350,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2350
2350
|
onClick: () => {
|
|
2351
2351
|
}
|
|
2352
2352
|
}, k$4 = (h) => {
|
|
2353
|
-
const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2353
|
+
const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$i, ...h }, g = (t) => {
|
|
2354
2354
|
r && r(t);
|
|
2355
2355
|
}, o = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2356
2356
|
const t = "nut-icon";
|
|
@@ -2398,8 +2398,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2398
2398
|
}
|
|
2399
2399
|
) });
|
|
2400
2400
|
};
|
|
2401
|
-
k$4.defaultProps = a$
|
|
2402
|
-
const a$
|
|
2401
|
+
k$4.defaultProps = a$i;
|
|
2402
|
+
const a$h = {
|
|
2403
2403
|
className: "",
|
|
2404
2404
|
style: void 0,
|
|
2405
2405
|
name: "JoySmile",
|
|
@@ -2408,7 +2408,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2408
2408
|
onClick: () => {
|
|
2409
2409
|
}
|
|
2410
2410
|
}, x$7 = (h) => {
|
|
2411
|
-
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2411
|
+
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$h, ...h }, g = (t) => {
|
|
2412
2412
|
r && r(t);
|
|
2413
2413
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2414
2414
|
const t = "nut-icon";
|
|
@@ -2445,8 +2445,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2445
2445
|
}
|
|
2446
2446
|
) });
|
|
2447
2447
|
};
|
|
2448
|
-
x$7.defaultProps = a$
|
|
2449
|
-
const a$
|
|
2448
|
+
x$7.defaultProps = a$h;
|
|
2449
|
+
const a$g = {
|
|
2450
2450
|
className: "",
|
|
2451
2451
|
style: void 0,
|
|
2452
2452
|
name: "Left",
|
|
@@ -2454,8 +2454,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2454
2454
|
height: "",
|
|
2455
2455
|
onClick: () => {
|
|
2456
2456
|
}
|
|
2457
|
-
}, y$
|
|
2458
|
-
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$
|
|
2457
|
+
}, y$6 = (h) => {
|
|
2458
|
+
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$g, ...h }, g = (t) => {
|
|
2459
2459
|
n && n(t);
|
|
2460
2460
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2461
2461
|
const t = "nut-icon";
|
|
@@ -2492,8 +2492,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2492
2492
|
}
|
|
2493
2493
|
) });
|
|
2494
2494
|
};
|
|
2495
|
-
y$
|
|
2496
|
-
const a$
|
|
2495
|
+
y$6.defaultProps = a$g;
|
|
2496
|
+
const a$f = {
|
|
2497
2497
|
className: "",
|
|
2498
2498
|
style: void 0,
|
|
2499
2499
|
name: "Link",
|
|
@@ -2502,7 +2502,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2502
2502
|
onClick: () => {
|
|
2503
2503
|
}
|
|
2504
2504
|
}, x$6 = (h) => {
|
|
2505
|
-
const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$
|
|
2505
|
+
const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$f, ...h }, g = (t) => {
|
|
2506
2506
|
n && n(t);
|
|
2507
2507
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
|
|
2508
2508
|
const t = "nut-icon";
|
|
@@ -2539,8 +2539,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2539
2539
|
}
|
|
2540
2540
|
) });
|
|
2541
2541
|
};
|
|
2542
|
-
x$6.defaultProps = a$
|
|
2543
|
-
const a$
|
|
2542
|
+
x$6.defaultProps = a$f;
|
|
2543
|
+
const a$e = {
|
|
2544
2544
|
className: "",
|
|
2545
2545
|
style: void 0,
|
|
2546
2546
|
name: "Loading",
|
|
@@ -2549,7 +2549,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2549
2549
|
onClick: () => {
|
|
2550
2550
|
}
|
|
2551
2551
|
}, k$3 = (h) => {
|
|
2552
|
-
const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$
|
|
2552
|
+
const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$e, ...h }, f = (c) => {
|
|
2553
2553
|
o && o(c);
|
|
2554
2554
|
}, n = (c) => c === "" ? "" : isNaN(Number(c)) ? String(c) : c + "px", z = () => {
|
|
2555
2555
|
const c = "nut-icon";
|
|
@@ -2586,8 +2586,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2586
2586
|
}
|
|
2587
2587
|
) });
|
|
2588
2588
|
};
|
|
2589
|
-
k$3.defaultProps = a$
|
|
2590
|
-
const a$
|
|
2589
|
+
k$3.defaultProps = a$e;
|
|
2590
|
+
const a$d = {
|
|
2591
2591
|
className: "",
|
|
2592
2592
|
style: void 0,
|
|
2593
2593
|
name: "Location2",
|
|
@@ -2596,7 +2596,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2596
2596
|
onClick: () => {
|
|
2597
2597
|
}
|
|
2598
2598
|
}, x$5 = (h) => {
|
|
2599
|
-
const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$
|
|
2599
|
+
const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$d, ...h }, g = (t) => {
|
|
2600
2600
|
n && n(t);
|
|
2601
2601
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
2602
2602
|
const t = "nut-icon";
|
|
@@ -2633,8 +2633,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2633
2633
|
}
|
|
2634
2634
|
) });
|
|
2635
2635
|
};
|
|
2636
|
-
x$5.defaultProps = a$
|
|
2637
|
-
const a$
|
|
2636
|
+
x$5.defaultProps = a$d;
|
|
2637
|
+
const a$c = {
|
|
2638
2638
|
className: "",
|
|
2639
2639
|
style: void 0,
|
|
2640
2640
|
name: "MaskClose",
|
|
@@ -2643,7 +2643,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2643
2643
|
onClick: () => {
|
|
2644
2644
|
}
|
|
2645
2645
|
}, x$4 = (h) => {
|
|
2646
|
-
const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$
|
|
2646
|
+
const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$c, ...h }, g = (t) => {
|
|
2647
2647
|
l2 && l2(t);
|
|
2648
2648
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
2649
2649
|
const t = "nut-icon";
|
|
@@ -2680,8 +2680,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2680
2680
|
}
|
|
2681
2681
|
) });
|
|
2682
2682
|
};
|
|
2683
|
-
x$4.defaultProps = a$
|
|
2684
|
-
const a$
|
|
2683
|
+
x$4.defaultProps = a$c;
|
|
2684
|
+
const a$b = {
|
|
2685
2685
|
className: "",
|
|
2686
2686
|
style: void 0,
|
|
2687
2687
|
name: "Minus",
|
|
@@ -2689,8 +2689,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2689
2689
|
height: "",
|
|
2690
2690
|
onClick: () => {
|
|
2691
2691
|
}
|
|
2692
|
-
}, y$
|
|
2693
|
-
const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$
|
|
2692
|
+
}, y$5 = (h) => {
|
|
2693
|
+
const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$b, ...h }, u = (t) => {
|
|
2694
2694
|
o && o(t);
|
|
2695
2695
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2696
2696
|
const t = "nut-icon";
|
|
@@ -2727,8 +2727,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2727
2727
|
}
|
|
2728
2728
|
) });
|
|
2729
2729
|
};
|
|
2730
|
-
y$
|
|
2731
|
-
const a$
|
|
2730
|
+
y$5.defaultProps = a$b;
|
|
2731
|
+
const a$a = {
|
|
2732
2732
|
className: "",
|
|
2733
2733
|
style: void 0,
|
|
2734
2734
|
name: "My",
|
|
@@ -2737,7 +2737,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2737
2737
|
onClick: () => {
|
|
2738
2738
|
}
|
|
2739
2739
|
}, k$2 = (h) => {
|
|
2740
|
-
const { className: o, style: d, name: s, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2740
|
+
const { className: o, style: d, name: s, color: m, width: p, height: f, onClick: r } = { ...a$a, ...h }, g = (t) => {
|
|
2741
2741
|
r && r(t);
|
|
2742
2742
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2743
2743
|
const t = "nut-icon";
|
|
@@ -2774,8 +2774,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2774
2774
|
}
|
|
2775
2775
|
) });
|
|
2776
2776
|
};
|
|
2777
|
-
k$2.defaultProps = a$
|
|
2778
|
-
const a$
|
|
2777
|
+
k$2.defaultProps = a$a;
|
|
2778
|
+
const a$9 = {
|
|
2779
2779
|
className: "",
|
|
2780
2780
|
style: void 0,
|
|
2781
2781
|
name: "Notice",
|
|
@@ -2784,7 +2784,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2784
2784
|
onClick: () => {
|
|
2785
2785
|
}
|
|
2786
2786
|
}, k$1 = (h) => {
|
|
2787
|
-
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: i } = { ...a$
|
|
2787
|
+
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: i } = { ...a$9, ...h }, g = (t) => {
|
|
2788
2788
|
i && i(t);
|
|
2789
2789
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2790
2790
|
const t = "nut-icon";
|
|
@@ -2821,7 +2821,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2821
2821
|
}
|
|
2822
2822
|
) });
|
|
2823
2823
|
};
|
|
2824
|
-
k$1.defaultProps = a$
|
|
2824
|
+
k$1.defaultProps = a$9;
|
|
2825
2825
|
const l = {
|
|
2826
2826
|
className: "",
|
|
2827
2827
|
style: void 0,
|
|
@@ -2869,7 +2869,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2869
2869
|
) });
|
|
2870
2870
|
};
|
|
2871
2871
|
x$3.defaultProps = l;
|
|
2872
|
-
const a$
|
|
2872
|
+
const a$8 = {
|
|
2873
2873
|
className: "",
|
|
2874
2874
|
style: void 0,
|
|
2875
2875
|
name: "Plus",
|
|
@@ -2877,8 +2877,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2877
2877
|
height: "",
|
|
2878
2878
|
onClick: () => {
|
|
2879
2879
|
}
|
|
2880
|
-
}, y$
|
|
2881
|
-
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$
|
|
2880
|
+
}, y$4 = (h) => {
|
|
2881
|
+
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$8, ...h }, u = (t) => {
|
|
2882
2882
|
n && n(t);
|
|
2883
2883
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2884
2884
|
const t = "nut-icon";
|
|
@@ -2915,6 +2915,53 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2915
2915
|
}
|
|
2916
2916
|
) });
|
|
2917
2917
|
};
|
|
2918
|
+
y$4.defaultProps = a$8;
|
|
2919
|
+
const a$7 = {
|
|
2920
|
+
className: "",
|
|
2921
|
+
style: void 0,
|
|
2922
|
+
name: "RectDown",
|
|
2923
|
+
width: "",
|
|
2924
|
+
height: "",
|
|
2925
|
+
onClick: () => {
|
|
2926
|
+
}
|
|
2927
|
+
}, y$3 = (h) => {
|
|
2928
|
+
const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$7, ...h }, g = (t) => {
|
|
2929
|
+
n && n(t);
|
|
2930
|
+
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", w = () => {
|
|
2931
|
+
const t = "nut-icon";
|
|
2932
|
+
return classNames({
|
|
2933
|
+
[`${o}`]: o,
|
|
2934
|
+
[t]: true,
|
|
2935
|
+
[t + "-" + e]: e
|
|
2936
|
+
});
|
|
2937
|
+
}, s = {}, i = r(m || ""), l2 = r(f || "");
|
|
2938
|
+
i && (s.width = i), l2 && (s.height = l2);
|
|
2939
|
+
const u = () => ({
|
|
2940
|
+
...d,
|
|
2941
|
+
...s
|
|
2942
|
+
});
|
|
2943
|
+
return /* @__PURE__ */ cr(lr, { children: /* @__PURE__ */ cr(
|
|
2944
|
+
"svg",
|
|
2945
|
+
{
|
|
2946
|
+
className: w(),
|
|
2947
|
+
style: u(),
|
|
2948
|
+
onClick: g,
|
|
2949
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2950
|
+
color: p,
|
|
2951
|
+
viewBox: "0 0 1024 1024",
|
|
2952
|
+
"aria-labelledby": e,
|
|
2953
|
+
role: "presentation",
|
|
2954
|
+
children: /* @__PURE__ */ cr(
|
|
2955
|
+
"path",
|
|
2956
|
+
{
|
|
2957
|
+
d: "M515.072 778.24c-14.336 0-28.672-5.632-39.936-16.384L69.12 356.864c-22.016-22.016-22.016-57.856 0-79.872s57.856-22.016 79.872 0L515.584 642.56 880.64 275.968c22.016-22.016 57.856-22.016 79.872 0s22.016 57.856 0 79.872L555.008 762.368c-10.752 10.752-25.6 15.872-39.936 15.872z",
|
|
2958
|
+
fill: "currentColor",
|
|
2959
|
+
fillOpacity: "0.9"
|
|
2960
|
+
}
|
|
2961
|
+
)
|
|
2962
|
+
}
|
|
2963
|
+
) });
|
|
2964
|
+
};
|
|
2918
2965
|
y$3.defaultProps = a$7;
|
|
2919
2966
|
const a$6 = {
|
|
2920
2967
|
className: "",
|
|
@@ -3350,7 +3397,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
3350
3397
|
onClick: (event) => {
|
|
3351
3398
|
}
|
|
3352
3399
|
};
|
|
3353
|
-
const classPrefix$
|
|
3400
|
+
const classPrefix$i = "nut-cell";
|
|
3354
3401
|
const Cell = (props) => {
|
|
3355
3402
|
const {
|
|
3356
3403
|
children,
|
|
@@ -3381,24 +3428,24 @@ Check the top-level render call using <` + t + ">.");
|
|
|
3381
3428
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3382
3429
|
"div",
|
|
3383
3430
|
{
|
|
3384
|
-
className: classNames(classPrefix$
|
|
3431
|
+
className: classNames(classPrefix$i, className),
|
|
3385
3432
|
onClick: (event) => handleClick2(event),
|
|
3386
3433
|
style: baseStyle,
|
|
3387
3434
|
...rest,
|
|
3388
3435
|
children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
3389
|
-
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$
|
|
3390
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3391
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3436
|
+
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$i}__left`, children: [
|
|
3437
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$i}__title`, children: title }) : null,
|
|
3438
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$i}__description`, children: description }) : null
|
|
3392
3439
|
] }) : null,
|
|
3393
3440
|
extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3394
3441
|
"div",
|
|
3395
3442
|
{
|
|
3396
|
-
className: `${classPrefix$
|
|
3443
|
+
className: `${classPrefix$i}__extra`,
|
|
3397
3444
|
style: styles,
|
|
3398
3445
|
children: extra
|
|
3399
3446
|
}
|
|
3400
3447
|
) : null,
|
|
3401
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3448
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$i}__divider` })
|
|
3402
3449
|
] })
|
|
3403
3450
|
}
|
|
3404
3451
|
);
|
|
@@ -3411,19 +3458,19 @@ Check the top-level render call using <` + t + ">.");
|
|
|
3411
3458
|
description: "",
|
|
3412
3459
|
divider: true
|
|
3413
3460
|
};
|
|
3414
|
-
const classPrefix$
|
|
3461
|
+
const classPrefix$h = "nut-cell-group";
|
|
3415
3462
|
const CellGroup = (props) => {
|
|
3416
3463
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
3417
3464
|
...defaultProps$1q,
|
|
3418
3465
|
...props
|
|
3419
3466
|
};
|
|
3420
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$
|
|
3421
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3422
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3467
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$h, className), ...rest, children: [
|
|
3468
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$h}__title`, children: title }) : null,
|
|
3469
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$h}__description`, children: description }) : null,
|
|
3423
3470
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3424
3471
|
"div",
|
|
3425
3472
|
{
|
|
3426
|
-
className: `${classPrefix$
|
|
3473
|
+
className: `${classPrefix$h}__wrap ${divider ? `${classPrefix$h}__wrap--divider` : ""}`,
|
|
3427
3474
|
children
|
|
3428
3475
|
}
|
|
3429
3476
|
)
|
|
@@ -3901,7 +3948,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
3901
3948
|
loading: true,
|
|
3902
3949
|
lazy: false
|
|
3903
3950
|
};
|
|
3904
|
-
const classPrefix$
|
|
3951
|
+
const classPrefix$g = "nut-image";
|
|
3905
3952
|
const Image$1 = (props) => {
|
|
3906
3953
|
const {
|
|
3907
3954
|
className,
|
|
@@ -3953,7 +4000,6 @@ Check the top-level render call using <` + t + ">.");
|
|
|
3953
4000
|
};
|
|
3954
4001
|
const observer = React.useRef(null);
|
|
3955
4002
|
const initObserver = () => {
|
|
3956
|
-
const images = document.querySelectorAll(".nut-img.lazyload");
|
|
3957
4003
|
const options2 = {
|
|
3958
4004
|
threshold: [0],
|
|
3959
4005
|
// 交会处
|
|
@@ -3969,14 +4015,12 @@ Check the top-level render call using <` + t + ">.");
|
|
|
3969
4015
|
img.src = img.dataset.src;
|
|
3970
4016
|
img.removeAttribute("data-src");
|
|
3971
4017
|
}
|
|
3972
|
-
|
|
4018
|
+
resetObserver();
|
|
3973
4019
|
}, 300);
|
|
3974
4020
|
}
|
|
3975
4021
|
});
|
|
3976
4022
|
}, options2);
|
|
3977
|
-
|
|
3978
|
-
observer.current.observe(item);
|
|
3979
|
-
});
|
|
4023
|
+
observer.current.observe(imgRef.current);
|
|
3980
4024
|
};
|
|
3981
4025
|
const resetObserver = () => {
|
|
3982
4026
|
observer.current.disconnect && observer.current.disconnect();
|
|
@@ -4015,7 +4059,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4015
4059
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4016
4060
|
"div",
|
|
4017
4061
|
{
|
|
4018
|
-
className: classNames(classPrefix$
|
|
4062
|
+
className: classNames(classPrefix$g, className),
|
|
4019
4063
|
style: containerStyle,
|
|
4020
4064
|
onClick: (e) => {
|
|
4021
4065
|
imageClick(e);
|
|
@@ -4183,21 +4227,21 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4183
4227
|
contentPosition: "center",
|
|
4184
4228
|
direction: "horizontal"
|
|
4185
4229
|
};
|
|
4186
|
-
const classPrefix$
|
|
4230
|
+
const classPrefix$f = `nut-divider`;
|
|
4187
4231
|
const Divider = (props) => {
|
|
4188
4232
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
4189
4233
|
...defaultProps$1m,
|
|
4190
4234
|
...props
|
|
4191
4235
|
};
|
|
4192
4236
|
const classes = direction === "horizontal" ? classNames({
|
|
4193
|
-
[`${classPrefix$
|
|
4194
|
-
[`${classPrefix$
|
|
4195
|
-
[`${classPrefix$
|
|
4196
|
-
[`${classPrefix$
|
|
4197
|
-
[`${classPrefix$
|
|
4237
|
+
[`${classPrefix$f}`]: true,
|
|
4238
|
+
[`${classPrefix$f}__center`]: children,
|
|
4239
|
+
[`${classPrefix$f}__left`]: contentPosition === "left",
|
|
4240
|
+
[`${classPrefix$f}__right`]: contentPosition === "right",
|
|
4241
|
+
[`${classPrefix$f}__hairline`]: true
|
|
4198
4242
|
}) : classNames({
|
|
4199
|
-
[`${classPrefix$
|
|
4200
|
-
[`${classPrefix$
|
|
4243
|
+
[`${classPrefix$f}`]: true,
|
|
4244
|
+
[`${classPrefix$f}__vertical`]: direction === "vertical"
|
|
4201
4245
|
});
|
|
4202
4246
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
|
|
4203
4247
|
};
|
|
@@ -4358,7 +4402,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4358
4402
|
};
|
|
4359
4403
|
Layout.defaultProps = defaultProps$1j;
|
|
4360
4404
|
Layout.displayName = "NutLayout";
|
|
4361
|
-
const classPrefix$
|
|
4405
|
+
const classPrefix$e = "nut-row";
|
|
4362
4406
|
const defaultProps$1i = {
|
|
4363
4407
|
...ComponentDefaults,
|
|
4364
4408
|
type: "",
|
|
@@ -4393,7 +4437,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4393
4437
|
${getClass("justify", justify)}
|
|
4394
4438
|
${getClass("align", align)}
|
|
4395
4439
|
${getClass("flex", wrap)}
|
|
4396
|
-
${classPrefix$
|
|
4440
|
+
${classPrefix$e}
|
|
4397
4441
|
`;
|
|
4398
4442
|
};
|
|
4399
4443
|
const parentRow = {
|
|
@@ -4492,7 +4536,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4492
4536
|
threshold: 0,
|
|
4493
4537
|
zIndex: 2e3
|
|
4494
4538
|
};
|
|
4495
|
-
const classPrefix$
|
|
4539
|
+
const classPrefix$d = "nut-sticky";
|
|
4496
4540
|
const Sticky = (props) => {
|
|
4497
4541
|
const {
|
|
4498
4542
|
position,
|
|
@@ -4614,7 +4658,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4614
4658
|
{
|
|
4615
4659
|
ref: rootRef,
|
|
4616
4660
|
style: { ...style, ...rootStyle },
|
|
4617
|
-
className: classNames(classPrefix$
|
|
4661
|
+
className: classNames(classPrefix$d, className),
|
|
4618
4662
|
...rest,
|
|
4619
4663
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle, children })
|
|
4620
4664
|
}
|
|
@@ -7543,7 +7587,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
7543
7587
|
}, []);
|
|
7544
7588
|
return isMounted;
|
|
7545
7589
|
};
|
|
7546
|
-
function useForceUpdate() {
|
|
7590
|
+
function useForceUpdate$1() {
|
|
7547
7591
|
const update2 = React.useState()[1];
|
|
7548
7592
|
const isMounted = useIsMounted();
|
|
7549
7593
|
return () => {
|
|
@@ -7804,7 +7848,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
7804
7848
|
instanceRef.current = updateRef(givenRef, value);
|
|
7805
7849
|
}, [givenRef]);
|
|
7806
7850
|
const [props, deps] = getAnimatedState(givenProps, host2);
|
|
7807
|
-
const forceUpdate = useForceUpdate();
|
|
7851
|
+
const forceUpdate = useForceUpdate$1();
|
|
7808
7852
|
const callback = () => {
|
|
7809
7853
|
const instance = instanceRef.current;
|
|
7810
7854
|
if (hasInstance && !instance) {
|
|
@@ -9459,7 +9503,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
9459
9503
|
deps = [];
|
|
9460
9504
|
const ref = React.useMemo(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []);
|
|
9461
9505
|
const layoutId = React.useRef(0);
|
|
9462
|
-
const forceUpdate = useForceUpdate();
|
|
9506
|
+
const forceUpdate = useForceUpdate$1();
|
|
9463
9507
|
const state = React.useMemo(() => ({
|
|
9464
9508
|
ctrls: [],
|
|
9465
9509
|
queue: [],
|
|
@@ -9863,7 +9907,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
9863
9907
|
list: [],
|
|
9864
9908
|
sticky: false,
|
|
9865
9909
|
spaceHeight: 23,
|
|
9866
|
-
titleHeight: 35
|
|
9910
|
+
titleHeight: 35,
|
|
9911
|
+
showKeys: true
|
|
9867
9912
|
};
|
|
9868
9913
|
const Elevator = (props) => {
|
|
9869
9914
|
const {
|
|
@@ -9873,6 +9918,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
9873
9918
|
sticky,
|
|
9874
9919
|
spaceHeight,
|
|
9875
9920
|
titleHeight,
|
|
9921
|
+
showKeys,
|
|
9876
9922
|
className,
|
|
9877
9923
|
style,
|
|
9878
9924
|
onClickItem,
|
|
@@ -10028,39 +10074,41 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
10028
10074
|
}) })
|
|
10029
10075
|
}
|
|
10030
10076
|
),
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10077
|
+
showKeys ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10078
|
+
list.length && scrollStart ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10079
|
+
"div",
|
|
10080
|
+
{
|
|
10081
|
+
className: classNames({
|
|
10082
|
+
[`${classPrefix2}__code--current`]: true,
|
|
10083
|
+
[`${classPrefix2}__code--current--current`]: true
|
|
10084
|
+
}),
|
|
10085
|
+
children: list[codeIndex][floorKey]
|
|
10086
|
+
}
|
|
10087
|
+
) : null,
|
|
10088
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__bars`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10089
|
+
animated.div,
|
|
10090
|
+
{
|
|
10091
|
+
className: `${classPrefix2}__bars__inner`,
|
|
10092
|
+
...bind(),
|
|
10093
|
+
style: { touchAction: "pan-y" },
|
|
10094
|
+
children: list.map((item, index) => {
|
|
10095
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10096
|
+
"div",
|
|
10097
|
+
{
|
|
10098
|
+
className: classNames({
|
|
10099
|
+
[`${classPrefix2}__bars__inner__item`]: true,
|
|
10100
|
+
[`${classPrefix2}__bars__inner__item--active`]: item[floorKey] === list[currentIndex][floorKey]
|
|
10101
|
+
}),
|
|
10102
|
+
"data-index": index,
|
|
10103
|
+
onClick: () => handleClickIndex(item[floorKey]),
|
|
10104
|
+
children: item[floorKey]
|
|
10105
|
+
},
|
|
10106
|
+
index
|
|
10107
|
+
);
|
|
10108
|
+
})
|
|
10109
|
+
}
|
|
10110
|
+
) })
|
|
10111
|
+
] }) : null
|
|
10064
10112
|
] });
|
|
10065
10113
|
};
|
|
10066
10114
|
Elevator.defaultProps = defaultProps$1f;
|
|
@@ -10146,7 +10194,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
10146
10194
|
);
|
|
10147
10195
|
}) }) }),
|
|
10148
10196
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__btn`, onClick: () => onUpdateValue(), children: content || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10149
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
10197
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(y$6, { color: "#fff" }),
|
|
10150
10198
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text", children: visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText })
|
|
10151
10199
|
] }) })
|
|
10152
10200
|
]
|
|
@@ -12500,6 +12548,10 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12500
12548
|
}
|
|
12501
12549
|
}
|
|
12502
12550
|
const requestAniFrame$1 = requestAniFrame();
|
|
12551
|
+
function useForceUpdate() {
|
|
12552
|
+
const [, updateState] = React.useState();
|
|
12553
|
+
return React.useCallback(() => updateState({}), []);
|
|
12554
|
+
}
|
|
12503
12555
|
const defaultProps$15 = {
|
|
12504
12556
|
...ComponentDefaults,
|
|
12505
12557
|
tabStyle: {},
|
|
@@ -12509,7 +12561,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12509
12561
|
duration: 300,
|
|
12510
12562
|
autoHeight: false
|
|
12511
12563
|
};
|
|
12512
|
-
const classPrefix$
|
|
12564
|
+
const classPrefix$c = "nut-tabs";
|
|
12513
12565
|
const Tabs = (props) => {
|
|
12514
12566
|
const {
|
|
12515
12567
|
activeColor,
|
|
@@ -12587,41 +12639,46 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12587
12639
|
return titles2;
|
|
12588
12640
|
};
|
|
12589
12641
|
const titles = React.useRef(getTitles());
|
|
12642
|
+
const forceUpdate = useForceUpdate();
|
|
12590
12643
|
React.useEffect(() => {
|
|
12591
12644
|
titles.current = getTitles();
|
|
12592
12645
|
let current = "";
|
|
12593
12646
|
titles.current.forEach((title2) => {
|
|
12594
|
-
if (title2.value
|
|
12647
|
+
if (title2.value == value) {
|
|
12595
12648
|
current = value;
|
|
12596
12649
|
}
|
|
12597
12650
|
});
|
|
12598
|
-
if (current !== "") {
|
|
12651
|
+
if (current !== "" && current !== value) {
|
|
12599
12652
|
setValue(current);
|
|
12653
|
+
} else {
|
|
12654
|
+
forceUpdate();
|
|
12600
12655
|
}
|
|
12601
12656
|
}, [children]);
|
|
12602
12657
|
const classes = classNames(
|
|
12603
|
-
classPrefix$
|
|
12604
|
-
`${classPrefix$
|
|
12658
|
+
classPrefix$c,
|
|
12659
|
+
`${classPrefix$c}--${direction}`,
|
|
12605
12660
|
className
|
|
12606
12661
|
);
|
|
12607
|
-
const classesTitle = classNames(`${classPrefix$
|
|
12608
|
-
[`${classPrefix$
|
|
12609
|
-
[`${classPrefix$
|
|
12610
|
-
[`${classPrefix$
|
|
12662
|
+
const classesTitle = classNames(`${classPrefix$c}__titles`, {
|
|
12663
|
+
[`${classPrefix$c}__titles--${activeType}`]: activeType,
|
|
12664
|
+
[`${classPrefix$c}__titles--scrollable`]: true,
|
|
12665
|
+
[`${classPrefix$c}__titles--${align}`]: align
|
|
12611
12666
|
});
|
|
12612
12667
|
const tabsActiveStyle = {
|
|
12613
12668
|
color: activeType === "smile" ? activeColor : "",
|
|
12614
12669
|
background: activeType === "line" ? activeColor : ""
|
|
12615
12670
|
};
|
|
12616
12671
|
React.useEffect(() => {
|
|
12617
|
-
const index = titles.current.findIndex((t) => t.value
|
|
12672
|
+
const index = titles.current.findIndex((t) => t.value == value);
|
|
12618
12673
|
setContentStyle({
|
|
12619
12674
|
transform: direction === "horizontal" ? `translate3d(-${index * 100}%, 0, 0)` : `translate3d( 0,-${index * 100}%, 0)`,
|
|
12620
12675
|
transitionDuration: `${duration}ms`
|
|
12621
12676
|
});
|
|
12622
|
-
|
|
12677
|
+
setTimeout(() => {
|
|
12678
|
+
scrollIntoView(index);
|
|
12679
|
+
});
|
|
12623
12680
|
}, [value]);
|
|
12624
|
-
const tabChange = (item
|
|
12681
|
+
const tabChange = (item) => {
|
|
12625
12682
|
onClick && onClick(item.value);
|
|
12626
12683
|
if (item.disabled) {
|
|
12627
12684
|
return;
|
|
@@ -12629,14 +12686,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12629
12686
|
setValue(item.value);
|
|
12630
12687
|
};
|
|
12631
12688
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, ...rest, children: [
|
|
12632
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesTitle, style: { ...tabStyle }, ref: navRef, children: !!title && typeof title === "function" ? title() : titles.current.map((item
|
|
12689
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesTitle, style: { ...tabStyle }, ref: navRef, children: !!title && typeof title === "function" ? title() : titles.current.map((item) => {
|
|
12633
12690
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12634
12691
|
"div",
|
|
12635
12692
|
{
|
|
12636
|
-
onClick: (
|
|
12693
|
+
onClick: () => {
|
|
12637
12694
|
tabChange(item);
|
|
12638
12695
|
},
|
|
12639
|
-
className: classNames(`${classPrefix$
|
|
12696
|
+
className: classNames(`${classPrefix$c}__titles-item`, {
|
|
12640
12697
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
12641
12698
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
12642
12699
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -12646,14 +12703,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12646
12703
|
activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12647
12704
|
"div",
|
|
12648
12705
|
{
|
|
12649
|
-
className: `${classPrefix$
|
|
12706
|
+
className: `${classPrefix$c}__titles-item__line`,
|
|
12650
12707
|
style: tabsActiveStyle
|
|
12651
12708
|
}
|
|
12652
12709
|
),
|
|
12653
12710
|
activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12654
12711
|
"div",
|
|
12655
12712
|
{
|
|
12656
|
-
className: `${classPrefix$
|
|
12713
|
+
className: `${classPrefix$c}__titles-item__smile`,
|
|
12657
12714
|
style: tabsActiveStyle,
|
|
12658
12715
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(x$7, { color: activeColor, width: 40, height: 20 })
|
|
12659
12716
|
}
|
|
@@ -12665,7 +12722,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12665
12722
|
{
|
|
12666
12723
|
ellipsis: true
|
|
12667
12724
|
},
|
|
12668
|
-
`${classPrefix$
|
|
12725
|
+
`${classPrefix$c}__titles-item__text`
|
|
12669
12726
|
),
|
|
12670
12727
|
children: item.title
|
|
12671
12728
|
}
|
|
@@ -12675,7 +12732,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12675
12732
|
item.value
|
|
12676
12733
|
);
|
|
12677
12734
|
}) }),
|
|
12678
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
12735
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$c}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$c}__content`, style: contentStyle, children: React.Children.map(children, (child, idx) => {
|
|
12679
12736
|
if (!React.isValidElement(child)) {
|
|
12680
12737
|
return null;
|
|
12681
12738
|
}
|
|
@@ -13311,7 +13368,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13311
13368
|
};
|
|
13312
13369
|
const headerRender = () => {
|
|
13313
13370
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: b("header"), children: [
|
|
13314
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "arrow-back", onClick: onSwitchModule, children: privateType === "custom" && (React.isValidElement(backBtnIcon) ? backBtnIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
13371
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "arrow-back", onClick: onSwitchModule, children: privateType === "custom" && (React.isValidElement(backBtnIcon) ? backBtnIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(y$6, { color: "#cccccc" })) }),
|
|
13315
13372
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("header__title"), children: privateType === "custom" ? customAddressTitle || locale.address.selectRegion : existAddressTitle || locale.address.deliveryTo }),
|
|
13316
13373
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: () => handClose(), children: React.isValidElement(closeBtnIcon) ? closeBtnIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$b, { width: 18, height: 18, color: "#ccc" }) })
|
|
13317
13374
|
] });
|
|
@@ -14482,7 +14539,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14482
14539
|
popup: true,
|
|
14483
14540
|
visible: false,
|
|
14484
14541
|
options: [],
|
|
14485
|
-
value: [],
|
|
14486
14542
|
title: "",
|
|
14487
14543
|
optionKey: { textKey: "text", valueKey: "value", childrenKey: "children" },
|
|
14488
14544
|
format: {},
|
|
@@ -14497,8 +14553,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14497
14553
|
onChange: () => {
|
|
14498
14554
|
},
|
|
14499
14555
|
onPathChange: () => {
|
|
14500
|
-
}
|
|
14501
|
-
...Popup.defaultProps
|
|
14556
|
+
}
|
|
14502
14557
|
};
|
|
14503
14558
|
const InternalCascader = (props, ref) => {
|
|
14504
14559
|
const {
|
|
@@ -14508,6 +14563,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14508
14563
|
visible,
|
|
14509
14564
|
options: options2,
|
|
14510
14565
|
value,
|
|
14566
|
+
defaultValue,
|
|
14511
14567
|
title,
|
|
14512
14568
|
optionKey: optionKey2,
|
|
14513
14569
|
format: format2,
|
|
@@ -14523,6 +14579,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14523
14579
|
const [tabvalue, setTabvalue] = React.useState("c1");
|
|
14524
14580
|
const [optionsData, setOptionsData] = React.useState([]);
|
|
14525
14581
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
|
|
14582
|
+
const [innerValue, setInnerValue] = usePropsValue({
|
|
14583
|
+
value,
|
|
14584
|
+
defaultValue,
|
|
14585
|
+
finalValue: defaultValue,
|
|
14586
|
+
onChange: (val) => {
|
|
14587
|
+
var _a2;
|
|
14588
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, val);
|
|
14589
|
+
}
|
|
14590
|
+
});
|
|
14526
14591
|
const [state] = React.useState({
|
|
14527
14592
|
optionsData: [],
|
|
14528
14593
|
panes: [
|
|
@@ -14532,7 +14597,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14532
14597
|
paneKey: ""
|
|
14533
14598
|
}
|
|
14534
14599
|
],
|
|
14535
|
-
innerValue: value,
|
|
14536
14600
|
tree: new Tree$1([], {}),
|
|
14537
14601
|
tabsCursor: 0,
|
|
14538
14602
|
// 选中的tab项
|
|
@@ -14552,12 +14616,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14552
14616
|
});
|
|
14553
14617
|
React.useEffect(() => {
|
|
14554
14618
|
initData();
|
|
14555
|
-
}, [options2]);
|
|
14619
|
+
}, [options2, format2]);
|
|
14556
14620
|
React.useEffect(() => {
|
|
14557
|
-
if (
|
|
14558
|
-
|
|
14621
|
+
if (defaultValue && defaultValue !== innerValue) {
|
|
14622
|
+
setInnerValue(defaultValue);
|
|
14559
14623
|
}
|
|
14560
|
-
}, [
|
|
14624
|
+
}, [defaultValue]);
|
|
14561
14625
|
const initData = async () => {
|
|
14562
14626
|
state.lazyLoadMap.clear();
|
|
14563
14627
|
if (format2 && Object.keys(format2).length > 0) {
|
|
@@ -14592,24 +14656,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14592
14656
|
setOptionsData(state.panes);
|
|
14593
14657
|
};
|
|
14594
14658
|
const syncValue = async () => {
|
|
14595
|
-
const
|
|
14596
|
-
if (
|
|
14659
|
+
const currentValue = innerValue;
|
|
14660
|
+
if (currentValue === void 0 || currentValue !== defaultValue || !state.tree.nodes.length) {
|
|
14597
14661
|
return;
|
|
14598
14662
|
}
|
|
14599
|
-
if (
|
|
14663
|
+
if (currentValue.length === 0) {
|
|
14600
14664
|
state.tabsCursor = 0;
|
|
14601
14665
|
return;
|
|
14602
14666
|
}
|
|
14603
|
-
let needToSync =
|
|
14604
|
-
if (isLazy() && Array.isArray(
|
|
14667
|
+
let needToSync = currentValue;
|
|
14668
|
+
if (isLazy() && Array.isArray(currentValue) && currentValue.length) {
|
|
14605
14669
|
needToSync = [];
|
|
14606
14670
|
const parent = state.tree.nodes.find(
|
|
14607
|
-
(node) => node.value ===
|
|
14671
|
+
(node) => node.value === currentValue[0]
|
|
14608
14672
|
);
|
|
14609
14673
|
if (parent) {
|
|
14610
14674
|
needToSync = [parent.value];
|
|
14611
14675
|
state.initLoading = true;
|
|
14612
|
-
const last = await
|
|
14676
|
+
const last = await currentValue.slice(1).reduce(async (p, value2) => {
|
|
14613
14677
|
var _a2;
|
|
14614
14678
|
const parent2 = await p;
|
|
14615
14679
|
await invokeLazyLoad(parent2);
|
|
@@ -14625,7 +14689,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14625
14689
|
state.initLoading = false;
|
|
14626
14690
|
}
|
|
14627
14691
|
}
|
|
14628
|
-
if (needToSync.length &&
|
|
14692
|
+
if (needToSync.length && currentValue === defaultValue) {
|
|
14629
14693
|
const pathNodes = state.tree.getPathNodesByValue(needToSync);
|
|
14630
14694
|
pathNodes.forEach((node, index) => {
|
|
14631
14695
|
state.tabsCursor = index;
|
|
@@ -14682,6 +14746,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14682
14746
|
const optionParams = pathNodes.map((item) => item.value);
|
|
14683
14747
|
onChange(optionParams, pathNodes);
|
|
14684
14748
|
onPathChange(optionParams, pathNodes);
|
|
14749
|
+
setInnerValue(optionParams);
|
|
14685
14750
|
}
|
|
14686
14751
|
setOptionsData(state.panes);
|
|
14687
14752
|
close();
|
|
@@ -14793,7 +14858,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14793
14858
|
},
|
|
14794
14859
|
options: []
|
|
14795
14860
|
};
|
|
14796
|
-
const classPrefix$
|
|
14861
|
+
const classPrefix$b = "nut-checkboxgroup";
|
|
14797
14862
|
const CheckboxGroup = React.forwardRef(
|
|
14798
14863
|
(props, ref) => {
|
|
14799
14864
|
const { children } = { ...defaultProps$Z, ...props };
|
|
@@ -14874,7 +14939,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14874
14939
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14875
14940
|
"div",
|
|
14876
14941
|
{
|
|
14877
|
-
className: classNames(classPrefix$
|
|
14942
|
+
className: classNames(classPrefix$b, {
|
|
14878
14943
|
[`nut-checkboxgroup--${props.direction}`]: props.direction,
|
|
14879
14944
|
className
|
|
14880
14945
|
}),
|
|
@@ -14898,7 +14963,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14898
14963
|
onChange: (value) => {
|
|
14899
14964
|
}
|
|
14900
14965
|
};
|
|
14901
|
-
const classPrefix$
|
|
14966
|
+
const classPrefix$a = "nut-checkbox";
|
|
14902
14967
|
const Checkbox = (props) => {
|
|
14903
14968
|
const { children } = {
|
|
14904
14969
|
...defaultProps$Y,
|
|
@@ -14960,22 +15025,22 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14960
15025
|
};
|
|
14961
15026
|
const color = () => {
|
|
14962
15027
|
if (innerDisabled) {
|
|
14963
|
-
return `${classPrefix$
|
|
15028
|
+
return `${classPrefix$a}__icon--disable`;
|
|
14964
15029
|
}
|
|
14965
15030
|
if (innerChecked) {
|
|
14966
15031
|
if (innerIndeterminate) {
|
|
14967
|
-
return `${classPrefix$
|
|
15032
|
+
return `${classPrefix$a}__icon--indeterminate`;
|
|
14968
15033
|
}
|
|
14969
|
-
return `${classPrefix$
|
|
15034
|
+
return `${classPrefix$a}__icon`;
|
|
14970
15035
|
}
|
|
14971
|
-
return `${classPrefix$
|
|
15036
|
+
return `${classPrefix$a}__icon--unchecked`;
|
|
14972
15037
|
};
|
|
14973
15038
|
const renderLabel = () => {
|
|
14974
15039
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14975
15040
|
"span",
|
|
14976
15041
|
{
|
|
14977
|
-
className: classNames(`${classPrefix$
|
|
14978
|
-
[`${classPrefix$
|
|
15042
|
+
className: classNames(`${classPrefix$a}__label `, {
|
|
15043
|
+
[`${classPrefix$a}__label--disabled`]: innerDisabled
|
|
14979
15044
|
}),
|
|
14980
15045
|
children: children || label
|
|
14981
15046
|
}
|
|
@@ -14994,8 +15059,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14994
15059
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14995
15060
|
"div",
|
|
14996
15061
|
{
|
|
14997
|
-
className: classNames(classPrefix$
|
|
14998
|
-
[`${classPrefix$
|
|
15062
|
+
className: classNames(classPrefix$a, className, {
|
|
15063
|
+
[`${classPrefix$a}--reverse`]: labelPosition === "left"
|
|
14999
15064
|
}),
|
|
15000
15065
|
...rest,
|
|
15001
15066
|
onClick: handleClick2,
|
|
@@ -17446,7 +17511,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17446
17511
|
digits: 0,
|
|
17447
17512
|
async: false
|
|
17448
17513
|
};
|
|
17449
|
-
const classPrefix$
|
|
17514
|
+
const classPrefix$9 = `nut-inputnumber`;
|
|
17450
17515
|
const InputNumber = (props) => {
|
|
17451
17516
|
const {
|
|
17452
17517
|
children,
|
|
@@ -17475,7 +17540,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17475
17540
|
...props
|
|
17476
17541
|
};
|
|
17477
17542
|
const inputRef = React.useRef("");
|
|
17478
|
-
|
|
17543
|
+
const [_checked, setChecked] = usePropsValue({
|
|
17479
17544
|
value,
|
|
17480
17545
|
defaultValue
|
|
17481
17546
|
});
|
|
@@ -17489,8 +17554,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17489
17554
|
}, []);
|
|
17490
17555
|
const classes = classNames(
|
|
17491
17556
|
{
|
|
17492
|
-
[`${classPrefix$
|
|
17493
|
-
[`${classPrefix$
|
|
17557
|
+
[`${classPrefix$9}`]: true,
|
|
17558
|
+
[`${classPrefix$9}--disabled`]: disabled
|
|
17494
17559
|
},
|
|
17495
17560
|
className
|
|
17496
17561
|
);
|
|
@@ -17636,7 +17701,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17636
17701
|
};
|
|
17637
17702
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style: styles, ...restProps, children: [
|
|
17638
17703
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-minus", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17639
|
-
y$
|
|
17704
|
+
y$5,
|
|
17640
17705
|
{
|
|
17641
17706
|
className: iconMinusClasses,
|
|
17642
17707
|
onClick: (e) => reduceNumber(e)
|
|
@@ -17669,7 +17734,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17669
17734
|
onFocus: focusValue
|
|
17670
17735
|
}
|
|
17671
17736
|
) }),
|
|
17672
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
17737
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(y$4, { className: iconAddClasses, onClick: (e) => addNumber(e) }) })
|
|
17673
17738
|
] });
|
|
17674
17739
|
};
|
|
17675
17740
|
InputNumber.defaultProps = defaultProps$S;
|
|
@@ -17783,7 +17848,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17783
17848
|
}),
|
|
17784
17849
|
children: [
|
|
17785
17850
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-menu__title-text", children: finallyTitle() }),
|
|
17786
|
-
icon || (direction === "up" ? /* @__PURE__ */ jsxRuntimeExports.jsx(x$g, { className: "nut-menu__title-icon" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
17851
|
+
icon || (direction === "up" ? /* @__PURE__ */ jsxRuntimeExports.jsx(x$g, { className: "nut-menu__title-icon" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$9, { className: "nut-menu__title-icon" }))
|
|
17787
17852
|
]
|
|
17788
17853
|
}
|
|
17789
17854
|
)
|
|
@@ -18006,15 +18071,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18006
18071
|
MenuItem.defaultProps = defaultProps$Q;
|
|
18007
18072
|
MenuItem.displayName = "NutMenuItem";
|
|
18008
18073
|
const defaultProps$P = {
|
|
18009
|
-
|
|
18010
|
-
title: "",
|
|
18074
|
+
...ComponentDefaults,
|
|
18011
18075
|
visible: false,
|
|
18012
|
-
overlay: true,
|
|
18013
18076
|
type: "default",
|
|
18014
|
-
|
|
18015
|
-
|
|
18016
|
-
randomKeys: false,
|
|
18017
|
-
popClass: "",
|
|
18077
|
+
custom: [],
|
|
18078
|
+
random: false,
|
|
18018
18079
|
onClose: () => {
|
|
18019
18080
|
}
|
|
18020
18081
|
};
|
|
@@ -18024,307 +18085,229 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18024
18085
|
title,
|
|
18025
18086
|
confirmText,
|
|
18026
18087
|
visible,
|
|
18027
|
-
overlay,
|
|
18028
18088
|
type: type2,
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
popClass,
|
|
18089
|
+
custom,
|
|
18090
|
+
random,
|
|
18032
18091
|
style,
|
|
18033
18092
|
className,
|
|
18034
18093
|
onChange,
|
|
18035
18094
|
onDelete,
|
|
18036
|
-
onClose
|
|
18095
|
+
onClose,
|
|
18096
|
+
onConfirm,
|
|
18097
|
+
...rest
|
|
18037
18098
|
} = props;
|
|
18038
|
-
const
|
|
18039
|
-
const [show, setShow] = React.useState(visible);
|
|
18040
|
-
const [clickKeyIndex, setClickKeyIndex] = React.useState(void 0);
|
|
18041
|
-
const [keysList, setKeysList] = React.useState([]);
|
|
18042
|
-
React.useEffect(() => {
|
|
18043
|
-
setShow(visible);
|
|
18044
|
-
}, [visible]);
|
|
18045
|
-
const defaultKey = () => {
|
|
18046
|
-
let leftBottomKey = {
|
|
18047
|
-
id: "lock",
|
|
18048
|
-
type: "lock"
|
|
18049
|
-
};
|
|
18050
|
-
if (customKey) {
|
|
18051
|
-
const customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
18052
|
-
if (customKeys.length > 0) {
|
|
18053
|
-
const newCustomKey = customKeys[0];
|
|
18054
|
-
leftBottomKey = {
|
|
18055
|
-
id: newCustomKey,
|
|
18056
|
-
type: "custom"
|
|
18057
|
-
};
|
|
18058
|
-
}
|
|
18059
|
-
}
|
|
18060
|
-
return [
|
|
18061
|
-
...getBasicKeys(),
|
|
18062
|
-
leftBottomKey,
|
|
18063
|
-
{ id: 0, type: "number" },
|
|
18064
|
-
{ id: "delete", type: "delete" }
|
|
18065
|
-
];
|
|
18066
|
-
};
|
|
18099
|
+
const classPrefix2 = "nut-numberkeyboard";
|
|
18067
18100
|
const getBasicKeys = () => {
|
|
18068
|
-
const keys =
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18073
|
-
|
|
18074
|
-
|
|
18075
|
-
return keys;
|
|
18076
|
-
};
|
|
18077
|
-
const genCustomKeys = () => {
|
|
18078
|
-
const keys = getBasicKeys();
|
|
18079
|
-
if (!customKey)
|
|
18080
|
-
return [];
|
|
18081
|
-
let customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
18082
|
-
if (customKeys.length > 2) {
|
|
18083
|
-
customKeys = [customKeys[0], customKeys[1]];
|
|
18084
|
-
}
|
|
18085
|
-
if (customKeys.length === 2 && props.title && props.type !== "rightColumn") {
|
|
18086
|
-
customKeys = [customKeys[0]];
|
|
18087
|
-
}
|
|
18088
|
-
if (customKeys.length === 1) {
|
|
18089
|
-
if (props.title && props.type !== "rightColumn") {
|
|
18090
|
-
keys.push(
|
|
18091
|
-
{ id: customKeys[0], type: "custom" },
|
|
18092
|
-
{ id: 0, type: "number" },
|
|
18093
|
-
{ id: "delete", type: "delete" }
|
|
18094
|
-
);
|
|
18095
|
-
} else {
|
|
18096
|
-
keys.push(
|
|
18097
|
-
{ id: 0, type: "number" },
|
|
18098
|
-
{ id: customKeys[0], type: "custom" }
|
|
18099
|
-
);
|
|
18100
|
-
}
|
|
18101
|
-
} else if (customKeys.length === 2) {
|
|
18102
|
-
keys.push(
|
|
18103
|
-
{ id: customKeys[0], type: "custom" },
|
|
18104
|
-
{ id: 0, type: "number" },
|
|
18105
|
-
{ id: customKeys[1], type: "custom" }
|
|
18106
|
-
);
|
|
18107
|
-
}
|
|
18108
|
-
return keys;
|
|
18101
|
+
const keys = new Array(9).fill(0).map((_, index) => {
|
|
18102
|
+
return {
|
|
18103
|
+
id: String(index + 1),
|
|
18104
|
+
type: "num"
|
|
18105
|
+
};
|
|
18106
|
+
});
|
|
18107
|
+
return random ? keys.sort(() => Math.random() > 0.5 ? 1 : -1) : keys;
|
|
18109
18108
|
};
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
|
|
18120
|
-
if (item.type === "number" || item.type === "custom") {
|
|
18121
|
-
onChange && onChange(item.id);
|
|
18122
|
-
}
|
|
18123
|
-
if (item.type === "lock") {
|
|
18124
|
-
onClose && onClose();
|
|
18109
|
+
const getCustomKeys = () => {
|
|
18110
|
+
const customKeys = [
|
|
18111
|
+
{ id: "close", type: "close" },
|
|
18112
|
+
{ id: "0", type: "num" },
|
|
18113
|
+
{ id: "delete", type: "delete" }
|
|
18114
|
+
];
|
|
18115
|
+
if (!custom)
|
|
18116
|
+
return customKeys;
|
|
18117
|
+
if (custom.length > 0) {
|
|
18118
|
+
customKeys[0] = { id: custom[0], type: "custom" };
|
|
18125
18119
|
}
|
|
18126
|
-
if (
|
|
18127
|
-
|
|
18120
|
+
if (custom.length > 1) {
|
|
18121
|
+
customKeys[2] = { id: custom[1], type: "custom" };
|
|
18128
18122
|
}
|
|
18123
|
+
return customKeys;
|
|
18129
18124
|
};
|
|
18130
|
-
const
|
|
18131
|
-
|
|
18125
|
+
const keysList = React.useMemo(() => {
|
|
18126
|
+
return [...getBasicKeys(), ...getCustomKeys()];
|
|
18127
|
+
}, [type2, random, custom]);
|
|
18128
|
+
const DeleteIcon = () => {
|
|
18129
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 1024 1024", width: "36", height: "36", children: [
|
|
18130
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18131
|
+
"path",
|
|
18132
|
+
{
|
|
18133
|
+
d: "M875.594 186.122H390.803a51.162 51.162 0 0 0-36.18 14.986L79.91 475.821a51.166 51.166 0 0 0 0 72.358l274.714 274.712a51.164 51.164 0 0 0 36.179 14.986h484.791c46.033 0 83.484-37.45 83.484-83.483V269.606c.001-46.033-37.45-83.484-83.483-83.484zm32.32 568.274c0 17.85-14.473 32.318-32.32 32.318H390.803L116.089 512l274.714-274.714h484.791c17.849 0 32.32 14.47 32.32 32.32v484.789z",
|
|
18134
|
+
fill: "currentColor"
|
|
18135
|
+
}
|
|
18136
|
+
),
|
|
18137
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18138
|
+
"path",
|
|
18139
|
+
{
|
|
18140
|
+
d: "M753.945 360.214l-121.43 121.429-121.43-121.429s-16.062-8.224-30.356 6.072c-14.295 14.295-6.073 30.357-6.073 30.357l121.43 121.428L486.8 627.357s-8.222 16.062 6.072 30.357c14.297 14.296 30.358 6.072 30.358 6.072l109.286-109.285 109.286 109.285s16.062 8.224 30.357-6.072c14.295-14.295 6.07-30.357 6.07-30.357L668.944 518.072l121.431-121.43s8.22-16.061-6.074-30.356c-14.294-14.296-30.356-6.072-30.356-6.072z",
|
|
18141
|
+
fill: "currentColor"
|
|
18142
|
+
}
|
|
18143
|
+
)
|
|
18144
|
+
] });
|
|
18132
18145
|
};
|
|
18133
|
-
const
|
|
18134
|
-
|
|
18135
|
-
|
|
18146
|
+
const NumberKeyboardKey = (props2) => {
|
|
18147
|
+
const { item } = props2;
|
|
18148
|
+
const [active, setActive] = React.useState(false);
|
|
18149
|
+
const onTouchStart = () => {
|
|
18150
|
+
setActive(true);
|
|
18151
|
+
};
|
|
18152
|
+
const onTouchEnd = (item2) => {
|
|
18153
|
+
setActive(false);
|
|
18154
|
+
if (item2.type === "num" || item2.type === "custom") {
|
|
18155
|
+
onChange && onChange(item2.id);
|
|
18156
|
+
}
|
|
18157
|
+
if (item2.type === "close") {
|
|
18158
|
+
onClose && onClose();
|
|
18159
|
+
}
|
|
18160
|
+
if (item2.type === "delete") {
|
|
18161
|
+
onDelete && onDelete();
|
|
18162
|
+
}
|
|
18163
|
+
if (item2.type === "confirm") {
|
|
18164
|
+
onConfirm && onConfirm();
|
|
18165
|
+
}
|
|
18166
|
+
};
|
|
18167
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__body__wrapper`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18168
|
+
"div",
|
|
18169
|
+
{
|
|
18170
|
+
className: classNames({
|
|
18171
|
+
key: true,
|
|
18172
|
+
active,
|
|
18173
|
+
close: item.type === "close",
|
|
18174
|
+
delete: item.type === "delete",
|
|
18175
|
+
confirm: item.type === "confirm"
|
|
18176
|
+
}),
|
|
18177
|
+
onTouchStart: () => onTouchStart(),
|
|
18178
|
+
onTouchEnd: () => onTouchEnd(item),
|
|
18179
|
+
onTouchCancel: () => onTouchEnd(item),
|
|
18180
|
+
children: [
|
|
18181
|
+
(item.type === "num" || item.type === "custom") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item.id }),
|
|
18182
|
+
item.type === "delete" && /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteIcon, {}),
|
|
18183
|
+
item.type === "close" && /* @__PURE__ */ jsxRuntimeExports.jsx(y$3, { width: 25, height: 25 }),
|
|
18184
|
+
item.type === "confirm" && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: confirmText || locale.done })
|
|
18185
|
+
]
|
|
18186
|
+
}
|
|
18187
|
+
) }, item.id);
|
|
18136
18188
|
};
|
|
18137
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18189
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18138
18190
|
Popup,
|
|
18139
18191
|
{
|
|
18140
|
-
visible
|
|
18192
|
+
visible,
|
|
18141
18193
|
position: "bottom",
|
|
18142
|
-
className: popClass,
|
|
18143
18194
|
onClickOverlay: onClose,
|
|
18144
|
-
overlay,
|
|
18145
18195
|
onClickCloseIcon: onClose,
|
|
18146
18196
|
overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" },
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18197
|
+
...rest,
|
|
18198
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix2, className), style, children: [
|
|
18199
|
+
title && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__header`, children: [
|
|
18200
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `${classPrefix2}__header__title`, children: title }),
|
|
18201
|
+
type2 === "default" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18202
|
+
"span",
|
|
18203
|
+
{
|
|
18204
|
+
className: `${classPrefix2}__header__close`,
|
|
18205
|
+
onClick: onClose,
|
|
18206
|
+
children: locale.done
|
|
18207
|
+
}
|
|
18208
|
+
)
|
|
18209
|
+
] }),
|
|
18210
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__body`, children: [
|
|
18211
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__body__keys`, children: keysList == null ? void 0 : keysList.map((item) => {
|
|
18212
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(NumberKeyboardKey, { item }, item.id);
|
|
18213
|
+
}) }),
|
|
18214
|
+
type2 === "rightColumn" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__sidebar`, children: [
|
|
18215
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18216
|
+
NumberKeyboardKey,
|
|
18156
18217
|
{
|
|
18157
|
-
|
|
18158
|
-
"
|
|
18159
|
-
|
|
18160
|
-
}
|
|
18161
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18162
|
-
"div",
|
|
18163
|
-
{
|
|
18164
|
-
className: classNames({
|
|
18165
|
-
key: true,
|
|
18166
|
-
active: item.id === clickKeyIndex,
|
|
18167
|
-
lock: item.type === "lock",
|
|
18168
|
-
delete: item.type === "delete"
|
|
18169
|
-
}),
|
|
18170
|
-
onTouchStart: (event) => onTouchstart(item, event),
|
|
18171
|
-
onTouchMove,
|
|
18172
|
-
onTouchEnd,
|
|
18173
|
-
children: [
|
|
18174
|
-
item.type === "number" || item.type === "custom" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item.id }) : null,
|
|
18175
|
-
item.type === "lock" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18176
|
-
"img",
|
|
18177
|
-
{
|
|
18178
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png",
|
|
18179
|
-
alt: ""
|
|
18180
|
-
}
|
|
18181
|
-
) : null,
|
|
18182
|
-
item.type === "delete" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18183
|
-
"img",
|
|
18184
|
-
{
|
|
18185
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
18186
|
-
alt: ""
|
|
18187
|
-
}
|
|
18188
|
-
) : null
|
|
18189
|
-
]
|
|
18190
|
-
}
|
|
18191
|
-
)
|
|
18218
|
+
item: {
|
|
18219
|
+
id: "delete",
|
|
18220
|
+
type: "delete"
|
|
18221
|
+
}
|
|
18192
18222
|
},
|
|
18193
|
-
|
|
18194
|
-
)
|
|
18195
|
-
}) }),
|
|
18196
|
-
type2 === "rightColumn" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: b("sidebar"), children: [
|
|
18197
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "key-board-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18198
|
-
"div",
|
|
18199
|
-
{
|
|
18200
|
-
className: classNames({
|
|
18201
|
-
key: true,
|
|
18202
|
-
active: clickKeyIndex === "delete"
|
|
18203
|
-
}),
|
|
18204
|
-
onTouchStart: (event) => onTouchstart({ id: "delete", type: "delete" }, event),
|
|
18205
|
-
onTouchMove,
|
|
18206
|
-
onTouchEnd,
|
|
18207
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18208
|
-
"img",
|
|
18209
|
-
{
|
|
18210
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
18211
|
-
alt: ""
|
|
18212
|
-
}
|
|
18213
|
-
)
|
|
18214
|
-
}
|
|
18215
|
-
) }),
|
|
18223
|
+
"delete"
|
|
18224
|
+
),
|
|
18216
18225
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18217
|
-
|
|
18226
|
+
NumberKeyboardKey,
|
|
18218
18227
|
{
|
|
18219
|
-
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
|
|
18223
|
-
|
|
18224
|
-
|
|
18225
|
-
key: true,
|
|
18226
|
-
finish: true,
|
|
18227
|
-
activeFinsh: clickKeyIndex === "finish"
|
|
18228
|
-
}),
|
|
18229
|
-
children: confirmText || locale.done
|
|
18230
|
-
}
|
|
18231
|
-
)
|
|
18232
|
-
}
|
|
18228
|
+
item: {
|
|
18229
|
+
id: "confirm",
|
|
18230
|
+
type: "confirm"
|
|
18231
|
+
}
|
|
18232
|
+
},
|
|
18233
|
+
"confirm"
|
|
18233
18234
|
)
|
|
18234
|
-
] })
|
|
18235
|
+
] })
|
|
18235
18236
|
] })
|
|
18236
18237
|
] })
|
|
18237
18238
|
}
|
|
18238
|
-
)
|
|
18239
|
+
);
|
|
18239
18240
|
};
|
|
18240
18241
|
NumberKeyboard.defaultProps = defaultProps$P;
|
|
18241
18242
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
18242
|
-
const
|
|
18243
|
-
onChange: (val) => {
|
|
18244
|
-
}
|
|
18245
|
-
};
|
|
18246
|
-
const RadioContext = React.createContext(radioContext);
|
|
18243
|
+
const RadioContext = React.createContext(null);
|
|
18247
18244
|
const defaultProps$O = {
|
|
18248
|
-
|
|
18249
|
-
textPosition: "right",
|
|
18245
|
+
labelPosition: "right",
|
|
18250
18246
|
onChange: (value) => {
|
|
18251
18247
|
},
|
|
18252
18248
|
direction: "vertical",
|
|
18253
18249
|
options: []
|
|
18254
18250
|
};
|
|
18251
|
+
const classPrefix$8 = "nut-radiogroup";
|
|
18255
18252
|
const RadioGroup = React.forwardRef(
|
|
18256
18253
|
(props, ref) => {
|
|
18257
|
-
const { children } = { ...defaultProps$O, ...props };
|
|
18258
|
-
cn("RadioGroup");
|
|
18259
18254
|
const {
|
|
18255
|
+
children,
|
|
18260
18256
|
className,
|
|
18261
18257
|
value,
|
|
18258
|
+
defaultValue,
|
|
18262
18259
|
onChange,
|
|
18263
|
-
|
|
18260
|
+
labelPosition,
|
|
18264
18261
|
direction,
|
|
18265
18262
|
options: options2,
|
|
18263
|
+
disabled,
|
|
18266
18264
|
...rest
|
|
18267
|
-
} = props;
|
|
18268
|
-
const [val2State, setVal2State] =
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
return false;
|
|
18275
|
-
return val2State === child.props.value;
|
|
18276
|
-
}
|
|
18277
|
-
function validateChecked(value2) {
|
|
18278
|
-
if (val2State === null)
|
|
18279
|
-
return false;
|
|
18280
|
-
return val2State === value2;
|
|
18281
|
-
}
|
|
18282
|
-
function cloneChildren() {
|
|
18283
|
-
return React.Children.map(children, (child, index) => {
|
|
18284
|
-
const childChecked = validateChildChecked(child);
|
|
18285
|
-
if (child.type.displayName !== "NutRadio") {
|
|
18286
|
-
return React.cloneElement(child);
|
|
18287
|
-
}
|
|
18288
|
-
return React.cloneElement(child, {
|
|
18289
|
-
textPosition,
|
|
18290
|
-
checked: childChecked
|
|
18291
|
-
// onChange: handleChildChange,
|
|
18292
|
-
});
|
|
18293
|
-
});
|
|
18294
|
-
}
|
|
18265
|
+
} = { ...defaultProps$O, ...props };
|
|
18266
|
+
const [val2State, setVal2State] = usePropsValue({
|
|
18267
|
+
defaultValue: props.defaultValue,
|
|
18268
|
+
value: props.value,
|
|
18269
|
+
finalValue: "",
|
|
18270
|
+
onChange
|
|
18271
|
+
});
|
|
18295
18272
|
const renderOptionsChildren = React.useCallback(() => {
|
|
18296
|
-
return options2 == null ? void 0 : options2.map(({ label, value: value2, disabled, onChange: onChange2, ...rest2 }) => {
|
|
18297
|
-
|
|
18298
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18273
|
+
return options2 == null ? void 0 : options2.map(({ label, value: value2, disabled: disabled2, onChange: onChange2, ...rest2 }) => {
|
|
18274
|
+
return /* @__PURE__ */ React.createElement(
|
|
18299
18275
|
Radio,
|
|
18300
18276
|
{
|
|
18277
|
+
...rest2,
|
|
18278
|
+
key: value2 == null ? void 0 : value2.toString(),
|
|
18301
18279
|
children: label,
|
|
18302
18280
|
value: value2,
|
|
18303
|
-
disabled,
|
|
18281
|
+
disabled: disabled2,
|
|
18304
18282
|
onChange: onChange2,
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
|
|
18308
|
-
},
|
|
18309
|
-
value2 == null ? void 0 : value2.toString()
|
|
18283
|
+
labelPosition,
|
|
18284
|
+
checked: value2 === val2State
|
|
18285
|
+
}
|
|
18310
18286
|
);
|
|
18311
18287
|
});
|
|
18312
|
-
}, [
|
|
18288
|
+
}, [options2]);
|
|
18313
18289
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18314
18290
|
RadioContext.Provider,
|
|
18315
18291
|
{
|
|
18316
18292
|
value: {
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18293
|
+
labelPosition: labelPosition || "right",
|
|
18294
|
+
disabled,
|
|
18295
|
+
value: val2State,
|
|
18296
|
+
check: (value2) => {
|
|
18297
|
+
setVal2State(value2);
|
|
18298
|
+
},
|
|
18299
|
+
uncheck: () => {
|
|
18300
|
+
setVal2State("");
|
|
18320
18301
|
}
|
|
18321
18302
|
},
|
|
18322
18303
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18323
18304
|
"div",
|
|
18324
18305
|
{
|
|
18325
|
-
className:
|
|
18306
|
+
className: classNames(classPrefix$8, className, {
|
|
18307
|
+
[`${classPrefix$8}--${props.direction}`]: props.direction
|
|
18308
|
+
}),
|
|
18326
18309
|
...rest,
|
|
18327
|
-
children: (options2 == null ? void 0 : options2.length) ? renderOptionsChildren() :
|
|
18310
|
+
children: (options2 == null ? void 0 : options2.length) ? renderOptionsChildren() : children
|
|
18328
18311
|
}
|
|
18329
18312
|
)
|
|
18330
18313
|
}
|
|
@@ -18335,517 +18318,233 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18335
18318
|
RadioGroup.displayName = "NutRadioGroup";
|
|
18336
18319
|
const defaultProps$N = {
|
|
18337
18320
|
...ComponentDefaults,
|
|
18338
|
-
className: "",
|
|
18339
|
-
style: {},
|
|
18340
18321
|
disabled: false,
|
|
18341
|
-
checked: false,
|
|
18342
18322
|
shape: "round",
|
|
18343
18323
|
value: "",
|
|
18344
|
-
|
|
18345
|
-
icon: "check-normal",
|
|
18346
|
-
checkedIcon: "check-checked",
|
|
18347
|
-
iconSize: 18,
|
|
18348
|
-
onChange: (e) => {
|
|
18349
|
-
}
|
|
18350
|
-
};
|
|
18351
|
-
const Radio = (props) => {
|
|
18352
|
-
const { children } = {
|
|
18353
|
-
...defaultProps$N,
|
|
18354
|
-
...props
|
|
18355
|
-
};
|
|
18356
|
-
const {
|
|
18357
|
-
className,
|
|
18358
|
-
disabled,
|
|
18359
|
-
checked,
|
|
18360
|
-
shape,
|
|
18361
|
-
textPosition,
|
|
18362
|
-
value,
|
|
18363
|
-
icon,
|
|
18364
|
-
checkedIcon,
|
|
18365
|
-
iconSize,
|
|
18366
|
-
onChange,
|
|
18367
|
-
...rest
|
|
18368
|
-
} = props;
|
|
18369
|
-
const componentName = "nut-radio";
|
|
18370
|
-
const [checkedStatement, setCheckedStatement] = React.useState(checked);
|
|
18371
|
-
const [valueStatement, setValueStatement] = React.useState(value);
|
|
18372
|
-
const [disabledStatement, setDisabledStatement] = React.useState(disabled);
|
|
18373
|
-
const context = React.useContext(RadioContext);
|
|
18374
|
-
React.useEffect(() => {
|
|
18375
|
-
setDisabledStatement(disabled);
|
|
18376
|
-
setValueStatement(value);
|
|
18377
|
-
setCheckedStatement(checked);
|
|
18378
|
-
}, [disabled, value, checked]);
|
|
18379
|
-
const renderLabel = () => {
|
|
18380
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18381
|
-
"div",
|
|
18382
|
-
{
|
|
18383
|
-
className: `${componentName}__label ${disabledStatement ? `${componentName}__label--disabled` : ""}`,
|
|
18384
|
-
children
|
|
18385
|
-
}
|
|
18386
|
-
);
|
|
18387
|
-
};
|
|
18388
|
-
const renderButton = () => {
|
|
18389
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18390
|
-
"div",
|
|
18391
|
-
{
|
|
18392
|
-
className: `${componentName}__button ${!disabledStatement && checkedStatement && `${componentName}__button--active`} ${disabledStatement ? `${componentName}__button--disabled` : ""}`,
|
|
18393
|
-
children
|
|
18394
|
-
}
|
|
18395
|
-
);
|
|
18396
|
-
};
|
|
18397
|
-
const color = () => {
|
|
18398
|
-
if (disabledStatement) {
|
|
18399
|
-
return "nut-radio__icon--disable";
|
|
18400
|
-
}
|
|
18401
|
-
if (checkedStatement) {
|
|
18402
|
-
return "nut-radio__icon";
|
|
18403
|
-
}
|
|
18404
|
-
return "nut-radio__icon--unchecked";
|
|
18405
|
-
};
|
|
18406
|
-
const renderIcon = () => {
|
|
18407
|
-
const { icon: icon2, iconSize: iconSize2, checkedIcon: checkedIcon2 } = props;
|
|
18408
|
-
if (!disabledStatement && checkedStatement) {
|
|
18409
|
-
return React.isValidElement(checkedIcon2) ? React.cloneElement(checkedIcon2, {
|
|
18410
|
-
...checkedIcon2.props,
|
|
18411
|
-
className: color()
|
|
18412
|
-
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$7, { width: iconSize2, height: iconSize2, className: color() });
|
|
18413
|
-
}
|
|
18414
|
-
return React.isValidElement(icon2) ? React.cloneElement(icon2, {
|
|
18415
|
-
...icon2.props,
|
|
18416
|
-
size: iconSize2,
|
|
18417
|
-
className: color()
|
|
18418
|
-
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { width: iconSize2, height: iconSize2, className: color() });
|
|
18419
|
-
};
|
|
18420
|
-
const reverseState = textPosition === "left";
|
|
18421
|
-
const renderRadioItem = () => {
|
|
18422
|
-
if (shape === "button") {
|
|
18423
|
-
return renderButton();
|
|
18424
|
-
}
|
|
18425
|
-
if (reverseState) {
|
|
18426
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18427
|
-
renderLabel(),
|
|
18428
|
-
renderIcon()
|
|
18429
|
-
] });
|
|
18430
|
-
}
|
|
18431
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18432
|
-
renderIcon(),
|
|
18433
|
-
renderLabel()
|
|
18434
|
-
] });
|
|
18435
|
-
};
|
|
18436
|
-
const handleClick2 = (e) => {
|
|
18437
|
-
if (disabledStatement || checkedStatement)
|
|
18438
|
-
return;
|
|
18439
|
-
setCheckedStatement(!checkedStatement);
|
|
18440
|
-
onChange && onChange(e);
|
|
18441
|
-
context && context.onChange(valueStatement);
|
|
18442
|
-
};
|
|
18443
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18444
|
-
"div",
|
|
18445
|
-
{
|
|
18446
|
-
className: `nut-radio ${className} ${reverseState ? `${componentName}--reverse` : ""}`,
|
|
18447
|
-
onClick: handleClick2,
|
|
18448
|
-
...rest,
|
|
18449
|
-
children: renderRadioItem()
|
|
18450
|
-
}
|
|
18451
|
-
);
|
|
18452
|
-
};
|
|
18453
|
-
Radio.defaultProps = defaultProps$N;
|
|
18454
|
-
Radio.displayName = "NutRadio";
|
|
18455
|
-
Radio.RadioGroup = RadioGroup;
|
|
18456
|
-
const fullClone = {
|
|
18457
|
-
...ReactDOM__namespace
|
|
18458
|
-
};
|
|
18459
|
-
const { version, render: reactRender, unmountComponentAtNode } = fullClone;
|
|
18460
|
-
let createRoot;
|
|
18461
|
-
try {
|
|
18462
|
-
const mainVersion = Number((version || "").split(".")[0]);
|
|
18463
|
-
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
18464
|
-
createRoot = fullClone.createRoot;
|
|
18465
|
-
}
|
|
18466
|
-
} catch (e) {
|
|
18467
|
-
}
|
|
18468
|
-
function toggleWarning(skip) {
|
|
18469
|
-
const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } = fullClone;
|
|
18470
|
-
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
|
|
18471
|
-
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
18472
|
-
}
|
|
18473
|
-
}
|
|
18474
|
-
const MARK = "__nutui_react_root__";
|
|
18475
|
-
function legacyRender(node, container) {
|
|
18476
|
-
reactRender(node, container);
|
|
18477
|
-
}
|
|
18478
|
-
function concurrentRender(node, container) {
|
|
18479
|
-
toggleWarning(true);
|
|
18480
|
-
const root2 = container[MARK] || createRoot(container);
|
|
18481
|
-
toggleWarning(false);
|
|
18482
|
-
root2.render(node);
|
|
18483
|
-
container[MARK] = root2;
|
|
18484
|
-
}
|
|
18485
|
-
function render(node, container) {
|
|
18486
|
-
if (createRoot) {
|
|
18487
|
-
concurrentRender(node, container);
|
|
18488
|
-
return;
|
|
18489
|
-
}
|
|
18490
|
-
legacyRender(node, container);
|
|
18491
|
-
}
|
|
18492
|
-
function legacyUnmount(container) {
|
|
18493
|
-
return unmountComponentAtNode(container);
|
|
18494
|
-
}
|
|
18495
|
-
async function concurrentUnmount(container) {
|
|
18496
|
-
return Promise.resolve().then(() => {
|
|
18497
|
-
var _a2;
|
|
18498
|
-
(_a2 = container[MARK]) == null ? void 0 : _a2.unmount();
|
|
18499
|
-
delete container[MARK];
|
|
18500
|
-
});
|
|
18501
|
-
}
|
|
18502
|
-
function unmount(container) {
|
|
18503
|
-
if (createRoot) {
|
|
18504
|
-
return concurrentUnmount(container);
|
|
18505
|
-
}
|
|
18506
|
-
return legacyUnmount(container);
|
|
18507
|
-
}
|
|
18508
|
-
let Notification$1 = (_a = class extends React__namespace.PureComponent {
|
|
18509
|
-
constructor(props) {
|
|
18510
|
-
super(props);
|
|
18511
|
-
__publicField(this, "closeTimer");
|
|
18512
|
-
this.close = this.close.bind(this);
|
|
18513
|
-
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
18514
|
-
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
18515
|
-
this.close = this.close.bind(this);
|
|
18516
|
-
this.clickCover = this.clickCover.bind(this);
|
|
18517
|
-
}
|
|
18518
|
-
close() {
|
|
18519
|
-
this.clearCloseTimer();
|
|
18520
|
-
this.props.onClose();
|
|
18521
|
-
}
|
|
18522
|
-
startCloseTimer() {
|
|
18523
|
-
const { duration } = this.props;
|
|
18524
|
-
if (duration) {
|
|
18525
|
-
this.closeTimer = window.setTimeout(() => {
|
|
18526
|
-
this.close();
|
|
18527
|
-
}, duration * 1e3);
|
|
18528
|
-
}
|
|
18529
|
-
}
|
|
18530
|
-
clearCloseTimer() {
|
|
18531
|
-
if (this.closeTimer) {
|
|
18532
|
-
clearTimeout(this.closeTimer);
|
|
18533
|
-
this.closeTimer = -1;
|
|
18534
|
-
}
|
|
18535
|
-
}
|
|
18536
|
-
clickCover() {
|
|
18537
|
-
const { closeOnClickOverlay } = this.props;
|
|
18538
|
-
if (closeOnClickOverlay) {
|
|
18539
|
-
this.close();
|
|
18540
|
-
}
|
|
18541
|
-
}
|
|
18542
|
-
componentDidMount() {
|
|
18543
|
-
this.startCloseTimer();
|
|
18544
|
-
}
|
|
18545
|
-
componentWillUnmount() {
|
|
18546
|
-
this.clearCloseTimer();
|
|
18547
|
-
}
|
|
18548
|
-
render() {
|
|
18549
|
-
const {
|
|
18550
|
-
id,
|
|
18551
|
-
style,
|
|
18552
|
-
icon,
|
|
18553
|
-
title,
|
|
18554
|
-
msg,
|
|
18555
|
-
bottom,
|
|
18556
|
-
center,
|
|
18557
|
-
bgColor,
|
|
18558
|
-
coverColor,
|
|
18559
|
-
textAlignCenter,
|
|
18560
|
-
size,
|
|
18561
|
-
customClass,
|
|
18562
|
-
cover,
|
|
18563
|
-
type: type2
|
|
18564
|
-
} = this.props;
|
|
18565
|
-
const toastBem = cn("toast");
|
|
18566
|
-
const classes = classNames({
|
|
18567
|
-
"nut-toast-center": center,
|
|
18568
|
-
"nut-toast-has-icon": icon,
|
|
18569
|
-
"nut-toast-cover": cover,
|
|
18570
|
-
"nut-toast-loading": type2 === "loading",
|
|
18571
|
-
[`${customClass}`]: true,
|
|
18572
|
-
[`nut-toast-${size}`]: true
|
|
18573
|
-
});
|
|
18574
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18575
|
-
"div",
|
|
18576
|
-
{
|
|
18577
|
-
className: `${toastBem()} ${classes}`,
|
|
18578
|
-
id: `toast-${id}`,
|
|
18579
|
-
style: {
|
|
18580
|
-
bottom: center ? "auto" : `${bottom}`,
|
|
18581
|
-
backgroundColor: cover ? coverColor : "",
|
|
18582
|
-
...style
|
|
18583
|
-
},
|
|
18584
|
-
onClick: () => {
|
|
18585
|
-
this.clickCover();
|
|
18586
|
-
},
|
|
18587
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18588
|
-
"div",
|
|
18589
|
-
{
|
|
18590
|
-
className: toastBem("inner"),
|
|
18591
|
-
style: {
|
|
18592
|
-
textAlign: textAlignCenter ? "center" : "left",
|
|
18593
|
-
backgroundColor: bgColor
|
|
18594
|
-
},
|
|
18595
|
-
children: [
|
|
18596
|
-
icon ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: toastBem("icon-wrapper"), children: icon }) : null,
|
|
18597
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-toast-title", children: title }) : null,
|
|
18598
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: toastBem("text"), children: msg })
|
|
18599
|
-
]
|
|
18600
|
-
}
|
|
18601
|
-
)
|
|
18602
|
-
}
|
|
18603
|
-
) });
|
|
18604
|
-
}
|
|
18605
|
-
}, __publicField(_a, "newInstance"), _a);
|
|
18606
|
-
Notification$1.newInstance = (properties, callback) => {
|
|
18607
|
-
const element = document.createElement("div");
|
|
18608
|
-
if (properties.id) {
|
|
18609
|
-
element.setAttribute("id", `${properties.id}`);
|
|
18610
|
-
}
|
|
18611
|
-
document.body.appendChild(element);
|
|
18612
|
-
let called = false;
|
|
18613
|
-
function ref(instance) {
|
|
18614
|
-
if (called) {
|
|
18615
|
-
return;
|
|
18616
|
-
}
|
|
18617
|
-
called = true;
|
|
18618
|
-
callback({
|
|
18619
|
-
component: instance,
|
|
18620
|
-
destroy() {
|
|
18621
|
-
unmount(element);
|
|
18622
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
18623
|
-
}
|
|
18624
|
-
});
|
|
18625
|
-
}
|
|
18626
|
-
render(/* @__PURE__ */ jsxRuntimeExports.jsx(Notification$1, { ...properties, ref }), element);
|
|
18627
|
-
};
|
|
18628
|
-
let messageInstance$1 = null;
|
|
18629
|
-
const options$1 = {
|
|
18630
|
-
msg: "",
|
|
18631
|
-
id: "",
|
|
18632
|
-
style: {},
|
|
18633
|
-
duration: 1.5,
|
|
18634
|
-
// 时长,duration为0则一直展示
|
|
18635
|
-
center: true,
|
|
18636
|
-
// toast是否居中展示
|
|
18637
|
-
type: "text",
|
|
18638
|
-
title: "",
|
|
18639
|
-
customClass: "",
|
|
18640
|
-
// 自定义样式名
|
|
18641
|
-
bottom: "30px",
|
|
18642
|
-
// center为false时生效,距离底部位置
|
|
18643
|
-
size: "base",
|
|
18644
|
-
// 设置字体大小,默认base,可选large\small\base
|
|
18324
|
+
labelPosition: "right",
|
|
18645
18325
|
icon: null,
|
|
18646
|
-
|
|
18647
|
-
|
|
18648
|
-
// 文字是否居中显示,true为居中,false为left
|
|
18649
|
-
loadingRotate: true,
|
|
18650
|
-
// 未实现
|
|
18651
|
-
bgColor: "rgba(0, 0, 0, .8)",
|
|
18652
|
-
onClose: () => {
|
|
18653
|
-
},
|
|
18654
|
-
cover: false,
|
|
18655
|
-
// 是否展示透明遮罩层
|
|
18656
|
-
coverColor: "rgba(0, 0, 0, 0)",
|
|
18657
|
-
// 遮罩颜色设定
|
|
18658
|
-
closeOnClickOverlay: false
|
|
18659
|
-
// 是否点击遮罩可关闭
|
|
18660
|
-
};
|
|
18661
|
-
function getInstance$1(props, callback) {
|
|
18662
|
-
if (messageInstance$1) {
|
|
18663
|
-
messageInstance$1.destroy();
|
|
18664
|
-
messageInstance$1 = null;
|
|
18665
|
-
}
|
|
18666
|
-
Notification$1.newInstance(props, (notification) => {
|
|
18667
|
-
return callback && callback(notification);
|
|
18668
|
-
});
|
|
18669
|
-
}
|
|
18670
|
-
function notice$1(opts) {
|
|
18671
|
-
function close() {
|
|
18672
|
-
if (messageInstance$1) {
|
|
18673
|
-
messageInstance$1.destroy();
|
|
18674
|
-
messageInstance$1 = null;
|
|
18675
|
-
}
|
|
18676
|
-
}
|
|
18677
|
-
const opts2 = { ...options$1, ...opts, onClose: close };
|
|
18678
|
-
getInstance$1(opts2, (notification) => {
|
|
18679
|
-
messageInstance$1 = notification;
|
|
18680
|
-
});
|
|
18681
|
-
}
|
|
18682
|
-
const errorMsg$1 = (msg) => {
|
|
18683
|
-
if (!msg) {
|
|
18684
|
-
console.warn("[NutUI Toast]: msg cannot be null");
|
|
18326
|
+
activeIcon: null,
|
|
18327
|
+
onChange: (checked) => {
|
|
18685
18328
|
}
|
|
18686
18329
|
};
|
|
18687
|
-
const
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
}
|
|
18712
|
-
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18330
|
+
const Radio = (props) => {
|
|
18331
|
+
const classPrefix2 = "nut-radio";
|
|
18332
|
+
const {
|
|
18333
|
+
children,
|
|
18334
|
+
className,
|
|
18335
|
+
style,
|
|
18336
|
+
checked,
|
|
18337
|
+
defaultChecked,
|
|
18338
|
+
shape,
|
|
18339
|
+
value,
|
|
18340
|
+
icon,
|
|
18341
|
+
activeIcon,
|
|
18342
|
+
onChange,
|
|
18343
|
+
...others
|
|
18344
|
+
} = {
|
|
18345
|
+
...defaultProps$N,
|
|
18346
|
+
...props
|
|
18347
|
+
};
|
|
18348
|
+
let { labelPosition, disabled, ...rest } = others;
|
|
18349
|
+
let [checkedStatement, setCheckedStatement] = usePropsValue({
|
|
18350
|
+
value: checked,
|
|
18351
|
+
defaultValue: defaultChecked,
|
|
18352
|
+
finalValue: false,
|
|
18353
|
+
onChange
|
|
18354
|
+
});
|
|
18355
|
+
const context = React.useContext(RadioContext);
|
|
18356
|
+
if (context) {
|
|
18357
|
+
checkedStatement = context.value === value;
|
|
18358
|
+
if (context.labelPosition !== void 0) {
|
|
18359
|
+
labelPosition = context.labelPosition;
|
|
18716
18360
|
}
|
|
18361
|
+
if (context.disabled !== void 0) {
|
|
18362
|
+
disabled = context.disabled;
|
|
18363
|
+
}
|
|
18364
|
+
setCheckedStatement = (value2) => {
|
|
18365
|
+
if (value2) {
|
|
18366
|
+
context.check(props.value === void 0 ? "" : props.value);
|
|
18367
|
+
} else {
|
|
18368
|
+
context.uncheck();
|
|
18369
|
+
}
|
|
18370
|
+
};
|
|
18717
18371
|
}
|
|
18372
|
+
const renderLabel = () => {
|
|
18373
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18374
|
+
"div",
|
|
18375
|
+
{
|
|
18376
|
+
className: classNames(`${classPrefix2}__label`, {
|
|
18377
|
+
[`${classPrefix2}__label--disabled`]: disabled
|
|
18378
|
+
}),
|
|
18379
|
+
children
|
|
18380
|
+
}
|
|
18381
|
+
);
|
|
18382
|
+
};
|
|
18383
|
+
const renderButton = () => {
|
|
18384
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18385
|
+
"div",
|
|
18386
|
+
{
|
|
18387
|
+
className: classNames(`${classPrefix2}__button`, {
|
|
18388
|
+
[`${classPrefix2}__button--active`]: checkedStatement,
|
|
18389
|
+
[`${classPrefix2}__button--disabled`]: disabled
|
|
18390
|
+
}),
|
|
18391
|
+
children
|
|
18392
|
+
}
|
|
18393
|
+
);
|
|
18394
|
+
};
|
|
18395
|
+
const color = () => {
|
|
18396
|
+
return {
|
|
18397
|
+
[`${classPrefix2}__icon--disable`]: disabled,
|
|
18398
|
+
[`${classPrefix2}__icon`]: checkedStatement,
|
|
18399
|
+
[`${classPrefix2}__icon--unchecked`]: !checkedStatement
|
|
18400
|
+
};
|
|
18401
|
+
};
|
|
18402
|
+
const renderIcon = () => {
|
|
18403
|
+
const { icon: icon2, activeIcon: activeIcon2 } = props;
|
|
18404
|
+
if (checkedStatement) {
|
|
18405
|
+
return React.isValidElement(activeIcon2) ? React.cloneElement(activeIcon2, {
|
|
18406
|
+
...activeIcon2.props,
|
|
18407
|
+
className: classNames(color())
|
|
18408
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$8, { className: classNames(color()) });
|
|
18409
|
+
}
|
|
18410
|
+
return React.isValidElement(icon2) ? React.cloneElement(icon2, {
|
|
18411
|
+
...icon2.props,
|
|
18412
|
+
className: classNames(color())
|
|
18413
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { className: classNames(color()) });
|
|
18414
|
+
};
|
|
18415
|
+
const reverse = labelPosition === "left";
|
|
18416
|
+
const renderRadioItem = () => {
|
|
18417
|
+
if (shape === "button") {
|
|
18418
|
+
return renderButton();
|
|
18419
|
+
}
|
|
18420
|
+
if (reverse) {
|
|
18421
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18422
|
+
renderLabel(),
|
|
18423
|
+
renderIcon()
|
|
18424
|
+
] });
|
|
18425
|
+
}
|
|
18426
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18427
|
+
renderIcon(),
|
|
18428
|
+
renderLabel()
|
|
18429
|
+
] });
|
|
18430
|
+
};
|
|
18431
|
+
const handleClick2 = (e) => {
|
|
18432
|
+
if (disabled || checkedStatement)
|
|
18433
|
+
return;
|
|
18434
|
+
setCheckedStatement(!checkedStatement);
|
|
18435
|
+
};
|
|
18436
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18437
|
+
"div",
|
|
18438
|
+
{
|
|
18439
|
+
className: `${classPrefix2} ${className} ${reverse ? `${classPrefix2}--reverse` : ""}`,
|
|
18440
|
+
style,
|
|
18441
|
+
onClick: handleClick2,
|
|
18442
|
+
...rest,
|
|
18443
|
+
children: renderRadioItem()
|
|
18444
|
+
}
|
|
18445
|
+
);
|
|
18718
18446
|
};
|
|
18447
|
+
Radio.defaultProps = defaultProps$N;
|
|
18448
|
+
Radio.displayName = "NutRadio";
|
|
18449
|
+
Radio.Group = RadioGroup;
|
|
18719
18450
|
const defaultProps$M = {
|
|
18451
|
+
...ComponentDefaults,
|
|
18720
18452
|
range: false,
|
|
18721
|
-
hiddenRange: false,
|
|
18722
|
-
hiddenTag: false,
|
|
18723
18453
|
min: 0,
|
|
18724
18454
|
max: 100,
|
|
18725
18455
|
step: 1,
|
|
18726
|
-
modelValue: 0,
|
|
18727
18456
|
vertical: false,
|
|
18728
18457
|
marks: {}
|
|
18729
18458
|
};
|
|
18730
|
-
let startValue;
|
|
18731
|
-
let currentValue;
|
|
18732
18459
|
const Range = (props) => {
|
|
18733
|
-
const { locale } = useConfig();
|
|
18734
18460
|
const {
|
|
18735
18461
|
className,
|
|
18736
18462
|
range: range2,
|
|
18737
18463
|
disabled,
|
|
18738
|
-
activeColor,
|
|
18739
|
-
inactiveColor,
|
|
18740
|
-
buttonColor,
|
|
18741
|
-
hiddenRange,
|
|
18742
|
-
hiddenTag,
|
|
18743
|
-
modelValue,
|
|
18744
18464
|
button,
|
|
18745
18465
|
vertical,
|
|
18746
18466
|
marks,
|
|
18747
|
-
dragStart,
|
|
18748
|
-
dragEnd,
|
|
18749
18467
|
onChange,
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18468
|
+
onStart,
|
|
18469
|
+
onEnd,
|
|
18470
|
+
minDescription,
|
|
18471
|
+
maxDescription,
|
|
18472
|
+
currentDescription,
|
|
18473
|
+
min,
|
|
18474
|
+
max,
|
|
18475
|
+
step,
|
|
18476
|
+
value,
|
|
18477
|
+
defaultValue
|
|
18755
18478
|
} = { ...defaultProps$M, ...props };
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
18759
|
-
step = Number(step);
|
|
18760
|
-
const [buttonIndex, SetButtonIndex] = React.useState(0);
|
|
18761
|
-
const [initValue, SetInitValue] = React.useState();
|
|
18762
|
-
const [dragStatus, SetDragStatus] = React.useState("start");
|
|
18479
|
+
const classPrefix2 = "nut-range";
|
|
18480
|
+
const [buttonIndex, setButtonIndex] = React.useState(0);
|
|
18481
|
+
const [dragStatus, setDragStatus] = React.useState("start");
|
|
18763
18482
|
const touch = useTouch();
|
|
18764
18483
|
const root2 = React.useRef(null);
|
|
18765
|
-
const [marksList,
|
|
18766
|
-
React.
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
}
|
|
18484
|
+
const [marksList, setMarksList] = React.useState([]);
|
|
18485
|
+
const [startValue, setStartValue] = React.useState(0);
|
|
18486
|
+
const handleChange = (value2) => {
|
|
18487
|
+
onChange && onChange(value2);
|
|
18488
|
+
};
|
|
18489
|
+
const [current, setCurrent] = usePropsValue({
|
|
18490
|
+
value,
|
|
18491
|
+
defaultValue,
|
|
18492
|
+
finalValue: 0,
|
|
18493
|
+
onChange: handleChange
|
|
18494
|
+
});
|
|
18495
|
+
const [exactValue, setEaxctValue] = React.useState(
|
|
18496
|
+
() => value || defaultValue || 0
|
|
18497
|
+
);
|
|
18776
18498
|
React.useEffect(() => {
|
|
18777
18499
|
if (marks) {
|
|
18778
18500
|
const marksKeys = Object.keys(marks);
|
|
18779
18501
|
const list = marksKeys.map(parseFloat).sort((a2, b) => a2 - b).filter((point) => point >= min && point <= max);
|
|
18780
|
-
|
|
18502
|
+
setMarksList(list);
|
|
18781
18503
|
}
|
|
18782
18504
|
}, [marks]);
|
|
18783
18505
|
const scope = () => {
|
|
18784
|
-
return
|
|
18506
|
+
return max - min;
|
|
18785
18507
|
};
|
|
18786
|
-
const classes =
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
].filter(Boolean).join(" ");
|
|
18794
|
-
}, [disabled, vertical, hiddenRange]);
|
|
18795
|
-
const containerClasses = React.useCallback(() => {
|
|
18796
|
-
const prefixCls2 = "nut-range-container";
|
|
18797
|
-
return [prefixCls2, `${vertical ? `${prefixCls2}-vertical` : ""}`, className].filter(Boolean).join(" ");
|
|
18798
|
-
}, [vertical, className]);
|
|
18508
|
+
const classes = classNames(classPrefix2, {
|
|
18509
|
+
[`${classPrefix2}-disabled`]: disabled,
|
|
18510
|
+
[`${classPrefix2}-vertical`]: vertical
|
|
18511
|
+
});
|
|
18512
|
+
const containerClasses = classNames(`${classPrefix2}-container`, className, {
|
|
18513
|
+
[`${classPrefix2}-container-vertical`]: vertical
|
|
18514
|
+
});
|
|
18799
18515
|
const markClassName = React.useCallback(
|
|
18800
18516
|
(mark) => {
|
|
18801
|
-
const
|
|
18802
|
-
let lowerBound =
|
|
18803
|
-
let upperBound =
|
|
18804
|
-
if (range2) {
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
upperBound = right;
|
|
18517
|
+
const classPrefix22 = "nut-range-mark";
|
|
18518
|
+
let lowerBound = min;
|
|
18519
|
+
let upperBound = max;
|
|
18520
|
+
if (range2 && Array.isArray(current)) {
|
|
18521
|
+
lowerBound = current[0];
|
|
18522
|
+
upperBound = current[1];
|
|
18808
18523
|
} else {
|
|
18809
|
-
upperBound =
|
|
18524
|
+
upperBound = current;
|
|
18810
18525
|
}
|
|
18811
18526
|
const isActive = mark <= upperBound && mark >= lowerBound;
|
|
18812
18527
|
return [
|
|
18813
|
-
`${
|
|
18814
|
-
`${isActive ? `${
|
|
18815
|
-
].
|
|
18528
|
+
`${classPrefix22}-text`,
|
|
18529
|
+
`${isActive ? `${classPrefix22}-text-active` : ""}`
|
|
18530
|
+
].join(" ");
|
|
18816
18531
|
},
|
|
18817
|
-
[range2,
|
|
18532
|
+
[range2, current, min, max]
|
|
18818
18533
|
);
|
|
18819
|
-
const [rangeName, setRangeName] = React.useState(classes());
|
|
18820
|
-
const [containerName, setContainerName] = React.useState(containerClasses());
|
|
18821
|
-
React.useEffect(() => {
|
|
18822
|
-
setRangeName(classes());
|
|
18823
|
-
setContainerName(containerClasses());
|
|
18824
|
-
}, [classes, containerClasses]);
|
|
18825
|
-
const wrapperStyle = () => {
|
|
18826
|
-
return {
|
|
18827
|
-
background: inactiveColor
|
|
18828
|
-
};
|
|
18829
|
-
};
|
|
18830
|
-
const buttonStyle = () => {
|
|
18831
|
-
return {
|
|
18832
|
-
borderColor: buttonColor
|
|
18833
|
-
};
|
|
18834
|
-
};
|
|
18835
18534
|
const isRange = (val) => {
|
|
18836
18535
|
return !!range2 && Array.isArray(val);
|
|
18837
18536
|
};
|
|
18838
18537
|
const calcMainAxis = () => {
|
|
18839
|
-
const modelVal =
|
|
18538
|
+
const modelVal = current;
|
|
18840
18539
|
if (isRange(modelVal)) {
|
|
18841
18540
|
return `${(modelVal[1] - modelVal[0]) * 100 / scope()}%`;
|
|
18842
18541
|
}
|
|
18843
|
-
return `${(modelVal -
|
|
18542
|
+
return `${(modelVal - min) * 100 / scope()}%`;
|
|
18844
18543
|
};
|
|
18845
18544
|
const calcOffset = () => {
|
|
18846
|
-
const modelVal =
|
|
18545
|
+
const modelVal = current;
|
|
18847
18546
|
if (isRange(modelVal)) {
|
|
18848
|
-
return `${(modelVal[0] -
|
|
18547
|
+
return `${(modelVal[0] - min) * 100 / scope()}%`;
|
|
18849
18548
|
}
|
|
18850
18549
|
return `0%`;
|
|
18851
18550
|
};
|
|
@@ -18854,74 +18553,61 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18854
18553
|
return {
|
|
18855
18554
|
height: calcMainAxis(),
|
|
18856
18555
|
top: calcOffset(),
|
|
18857
|
-
background: activeColor,
|
|
18858
18556
|
transition: dragStatus ? "none" : void 0
|
|
18859
18557
|
};
|
|
18860
18558
|
}
|
|
18861
18559
|
return {
|
|
18862
18560
|
width: calcMainAxis(),
|
|
18863
18561
|
left: calcOffset(),
|
|
18864
|
-
background: activeColor,
|
|
18865
18562
|
transition: dragStatus ? "none" : void 0
|
|
18866
18563
|
};
|
|
18867
18564
|
};
|
|
18868
18565
|
const marksStyle = (mark) => {
|
|
18869
18566
|
let style = {
|
|
18870
|
-
left: `${(mark -
|
|
18567
|
+
left: `${(mark - min) / scope() * 100}%`
|
|
18871
18568
|
};
|
|
18872
18569
|
if (vertical) {
|
|
18873
18570
|
style = {
|
|
18874
|
-
top: `${(mark -
|
|
18571
|
+
top: `${(mark - min) / scope() * 100}%`
|
|
18875
18572
|
};
|
|
18876
18573
|
}
|
|
18877
18574
|
return style;
|
|
18878
18575
|
};
|
|
18879
|
-
const
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
if (range2) {
|
|
18883
|
-
const [left, right] = modelValue;
|
|
18884
|
-
lowerBound = left;
|
|
18885
|
-
upperBound = right;
|
|
18576
|
+
const tickClass = (mark) => {
|
|
18577
|
+
if (range2 && Array.isArray(current)) {
|
|
18578
|
+
return mark <= current[1] && mark >= current[0];
|
|
18886
18579
|
}
|
|
18887
|
-
|
|
18888
|
-
const style = {
|
|
18889
|
-
background: !isActive ? inactiveColor : activeColor
|
|
18890
|
-
};
|
|
18891
|
-
return style;
|
|
18580
|
+
return mark <= current;
|
|
18892
18581
|
};
|
|
18893
|
-
const format2 = (
|
|
18894
|
-
|
|
18895
|
-
return Math.round(
|
|
18582
|
+
const format2 = (value2) => {
|
|
18583
|
+
value2 = Math.max(+min, Math.min(value2, +max));
|
|
18584
|
+
return Math.round(value2 / +step) * +step;
|
|
18896
18585
|
};
|
|
18897
18586
|
const isSameValue = (newValue, oldValue) => {
|
|
18898
18587
|
return JSON.stringify(newValue) === JSON.stringify(oldValue);
|
|
18899
18588
|
};
|
|
18900
|
-
const handleOverlap = (
|
|
18901
|
-
if (
|
|
18902
|
-
return
|
|
18589
|
+
const handleOverlap = (value2) => {
|
|
18590
|
+
if (value2[0] > value2[1]) {
|
|
18591
|
+
return value2.slice(0).reverse();
|
|
18903
18592
|
}
|
|
18904
|
-
return
|
|
18593
|
+
return value2;
|
|
18905
18594
|
};
|
|
18906
|
-
const updateValue = (
|
|
18907
|
-
if (isRange(
|
|
18908
|
-
|
|
18595
|
+
const updateValue = (value2, end) => {
|
|
18596
|
+
if (isRange(value2)) {
|
|
18597
|
+
value2 = handleOverlap(value2).map(format2);
|
|
18909
18598
|
} else {
|
|
18910
|
-
|
|
18599
|
+
value2 = format2(value2);
|
|
18911
18600
|
}
|
|
18912
|
-
|
|
18913
|
-
|
|
18914
|
-
SetInitValue(value);
|
|
18915
|
-
}
|
|
18916
|
-
if ((marks || end) && !isSameValue(value, startValue)) {
|
|
18917
|
-
onChange && onChange(value);
|
|
18601
|
+
if (!isSameValue(value2, current)) {
|
|
18602
|
+
setCurrent(value2);
|
|
18918
18603
|
}
|
|
18604
|
+
end && onEnd && onEnd(value2);
|
|
18919
18605
|
};
|
|
18920
18606
|
const click = (event) => {
|
|
18921
18607
|
if (disabled || !root2.current) {
|
|
18922
18608
|
return;
|
|
18923
18609
|
}
|
|
18924
|
-
|
|
18610
|
+
setDragStatus("");
|
|
18925
18611
|
const rect = getRect(root2.current);
|
|
18926
18612
|
let delta = event.clientX - rect.left;
|
|
18927
18613
|
let total = rect.width;
|
|
@@ -18929,18 +18615,18 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18929
18615
|
delta = event.clientY - rect.top;
|
|
18930
18616
|
total = rect.height;
|
|
18931
18617
|
}
|
|
18932
|
-
const
|
|
18933
|
-
|
|
18934
|
-
if (isRange(
|
|
18935
|
-
const [left, right] =
|
|
18618
|
+
const value2 = min + delta / total * scope();
|
|
18619
|
+
setEaxctValue(current);
|
|
18620
|
+
if (isRange(current)) {
|
|
18621
|
+
const [left, right] = current;
|
|
18936
18622
|
const middle = (left + right) / 2;
|
|
18937
|
-
if (
|
|
18938
|
-
updateValue([
|
|
18623
|
+
if (value2 <= middle) {
|
|
18624
|
+
updateValue([value2, right], true);
|
|
18939
18625
|
} else {
|
|
18940
|
-
updateValue([left,
|
|
18626
|
+
updateValue([left, value2], true);
|
|
18941
18627
|
}
|
|
18942
18628
|
} else {
|
|
18943
|
-
updateValue(
|
|
18629
|
+
updateValue(value2, true);
|
|
18944
18630
|
}
|
|
18945
18631
|
};
|
|
18946
18632
|
const onTouchStart = (event) => {
|
|
@@ -18948,24 +18634,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18948
18634
|
return;
|
|
18949
18635
|
}
|
|
18950
18636
|
touch.start(event);
|
|
18951
|
-
|
|
18952
|
-
if (isRange(
|
|
18953
|
-
|
|
18637
|
+
setEaxctValue(current);
|
|
18638
|
+
if (isRange(current)) {
|
|
18639
|
+
setStartValue(current.map(format2));
|
|
18954
18640
|
} else {
|
|
18955
|
-
|
|
18641
|
+
setStartValue(format2(current));
|
|
18956
18642
|
}
|
|
18957
|
-
|
|
18643
|
+
setDragStatus("start");
|
|
18958
18644
|
};
|
|
18959
18645
|
const onTouchMove = (event) => {
|
|
18646
|
+
event.stopPropagation();
|
|
18960
18647
|
if (disabled || !root2.current) {
|
|
18961
18648
|
return;
|
|
18962
18649
|
}
|
|
18963
18650
|
if (dragStatus === "start") {
|
|
18964
|
-
|
|
18965
|
-
onDragStart && onDragStart();
|
|
18651
|
+
onStart && onStart();
|
|
18966
18652
|
}
|
|
18967
18653
|
touch.move(event);
|
|
18968
|
-
|
|
18654
|
+
setDragStatus("draging");
|
|
18969
18655
|
const rect = getRect(root2.current);
|
|
18970
18656
|
let delta = touch.deltaX;
|
|
18971
18657
|
let total = rect.width;
|
|
@@ -18975,121 +18661,91 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18975
18661
|
total = rect.height;
|
|
18976
18662
|
diff = delta / total * scope();
|
|
18977
18663
|
}
|
|
18664
|
+
let newValue;
|
|
18978
18665
|
if (isRange(startValue)) {
|
|
18979
|
-
|
|
18666
|
+
newValue = exactValue.slice();
|
|
18667
|
+
newValue[buttonIndex] = startValue[buttonIndex] + diff;
|
|
18980
18668
|
} else {
|
|
18981
|
-
|
|
18669
|
+
newValue = startValue + diff;
|
|
18982
18670
|
}
|
|
18983
|
-
|
|
18671
|
+
setEaxctValue(newValue);
|
|
18672
|
+
updateValue(newValue);
|
|
18984
18673
|
};
|
|
18985
18674
|
const onTouchEnd = (event) => {
|
|
18986
18675
|
if (disabled) {
|
|
18987
18676
|
return;
|
|
18988
18677
|
}
|
|
18989
18678
|
if (dragStatus === "draging") {
|
|
18990
|
-
updateValue(
|
|
18991
|
-
dragEnd && dragEnd();
|
|
18992
|
-
onDragEnd && onDragEnd();
|
|
18679
|
+
updateValue(current, true);
|
|
18993
18680
|
}
|
|
18994
|
-
|
|
18681
|
+
setDragStatus("");
|
|
18995
18682
|
};
|
|
18996
18683
|
const curValue = (idx) => {
|
|
18997
|
-
const modelVal =
|
|
18998
|
-
const
|
|
18999
|
-
return
|
|
18684
|
+
const modelVal = current;
|
|
18685
|
+
const value2 = typeof idx === "number" ? modelVal[idx] : modelVal;
|
|
18686
|
+
return value2;
|
|
19000
18687
|
};
|
|
19001
|
-
|
|
19002
|
-
|
|
19003
|
-
|
|
19004
|
-
|
|
19005
|
-
|
|
19006
|
-
|
|
19007
|
-
|
|
19008
|
-
|
|
19009
|
-
|
|
19010
|
-
|
|
19011
|
-
|
|
19012
|
-
|
|
19013
|
-
|
|
19014
|
-
|
|
19015
|
-
|
|
19016
|
-
|
|
19017
|
-
|
|
19018
|
-
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
18688
|
+
const renderButton = (index) => {
|
|
18689
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: button || /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-range-button", children: currentDescription !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "number", children: currentDescription ? currentDescription(curValue(index)) : curValue(index) }) }) });
|
|
18690
|
+
};
|
|
18691
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: containerClasses, children: [
|
|
18692
|
+
minDescription !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min", children: minDescription || min }),
|
|
18693
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: root2, className: classes, onClick: (e) => click(e), children: [
|
|
18694
|
+
marksList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-range-mark", children: marksList.map((marks2) => {
|
|
18695
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18696
|
+
"span",
|
|
18697
|
+
{
|
|
18698
|
+
className: markClassName(marks2),
|
|
18699
|
+
style: marksStyle(marks2),
|
|
18700
|
+
children: [
|
|
18701
|
+
marks2,
|
|
18702
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18703
|
+
"span",
|
|
18704
|
+
{
|
|
18705
|
+
className: classNames("nut-range-tick", {
|
|
18706
|
+
active: tickClass(marks2)
|
|
18707
|
+
})
|
|
18708
|
+
}
|
|
18709
|
+
)
|
|
18710
|
+
]
|
|
18711
|
+
},
|
|
18712
|
+
marks2
|
|
18713
|
+
);
|
|
18714
|
+
}) }),
|
|
18715
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-range-bar", style: barStyle(), children: range2 ? [0, 1].map((item, index) => {
|
|
18716
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18717
|
+
"div",
|
|
18718
|
+
{
|
|
18719
|
+
className: `${index === 0 ? "nut-range-button-wrapper-left" : ""}
|
|
19033
18720
|
${index === 1 ? "nut-range-button-wrapper-right" : ""}`,
|
|
19034
|
-
|
|
19035
|
-
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
|
|
19043
|
-
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19058
|
-
|
|
19059
|
-
|
|
19060
|
-
|
|
19061
|
-
|
|
19062
|
-
"div",
|
|
19063
|
-
{
|
|
19064
|
-
role: "slider",
|
|
19065
|
-
className: "nut-range-button-wrapper",
|
|
19066
|
-
tabIndex: disabled ? -1 : 0,
|
|
19067
|
-
"aria-valuemin": +min,
|
|
19068
|
-
"aria-valuenow": curValue(),
|
|
19069
|
-
"aria-valuemax": +max,
|
|
19070
|
-
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
19071
|
-
onTouchStart: (e) => {
|
|
19072
|
-
onTouchStart(e);
|
|
19073
|
-
},
|
|
19074
|
-
onTouchMove: (e) => {
|
|
19075
|
-
onTouchMove(e);
|
|
19076
|
-
},
|
|
19077
|
-
onTouchEnd: (e) => {
|
|
19078
|
-
onTouchEnd();
|
|
19079
|
-
},
|
|
19080
|
-
onTouchCancel: (e) => {
|
|
19081
|
-
onTouchEnd();
|
|
19082
|
-
},
|
|
19083
|
-
onClick: (e) => {
|
|
19084
|
-
e.stopPropagation();
|
|
19085
|
-
},
|
|
19086
|
-
children: button || /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-range-button", style: buttonStyle(), children: !hiddenTag ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "number", children: curValueDesc || curValue() }) : null })
|
|
19087
|
-
}
|
|
19088
|
-
) })
|
|
19089
|
-
]
|
|
19090
|
-
}
|
|
19091
|
-
),
|
|
19092
|
-
!hiddenRange ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max", children: maxDesc || +max }) : null
|
|
18721
|
+
onTouchStart: (e) => {
|
|
18722
|
+
if (typeof index === "number") {
|
|
18723
|
+
setButtonIndex(index);
|
|
18724
|
+
}
|
|
18725
|
+
onTouchStart(e);
|
|
18726
|
+
},
|
|
18727
|
+
onTouchMove: (e) => onTouchMove(e),
|
|
18728
|
+
onTouchEnd: (e) => onTouchEnd(),
|
|
18729
|
+
onTouchCancel: (e) => onTouchEnd(),
|
|
18730
|
+
onClick: (e) => e.stopPropagation(),
|
|
18731
|
+
children: renderButton(index)
|
|
18732
|
+
},
|
|
18733
|
+
index
|
|
18734
|
+
);
|
|
18735
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18736
|
+
"div",
|
|
18737
|
+
{
|
|
18738
|
+
className: "nut-range-button-wrapper",
|
|
18739
|
+
onTouchStart: (e) => onTouchStart(e),
|
|
18740
|
+
onTouchMove: (e) => onTouchMove(e),
|
|
18741
|
+
onTouchEnd: (e) => onTouchEnd(),
|
|
18742
|
+
onTouchCancel: (e) => onTouchEnd(),
|
|
18743
|
+
onClick: (e) => e.stopPropagation(),
|
|
18744
|
+
children: renderButton()
|
|
18745
|
+
}
|
|
18746
|
+
) })
|
|
18747
|
+
] }),
|
|
18748
|
+
maxDescription !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max", children: maxDescription || max })
|
|
19093
18749
|
] });
|
|
19094
18750
|
};
|
|
19095
18751
|
Range.defaultProps = defaultProps$M;
|
|
@@ -20450,7 +20106,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20450
20106
|
}
|
|
20451
20107
|
),
|
|
20452
20108
|
deletable && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20453
|
-
y$
|
|
20109
|
+
y$7,
|
|
20454
20110
|
{
|
|
20455
20111
|
color: "#808080",
|
|
20456
20112
|
className: "nut-uploader__preview-img__file__del",
|
|
@@ -20593,6 +20249,58 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20593
20249
|
};
|
|
20594
20250
|
ActionSheet.defaultProps = defaultProps$D;
|
|
20595
20251
|
ActionSheet.displayName = "NutActionSheet";
|
|
20252
|
+
const fullClone = {
|
|
20253
|
+
...ReactDOM__namespace
|
|
20254
|
+
};
|
|
20255
|
+
const { version, render: reactRender, unmountComponentAtNode } = fullClone;
|
|
20256
|
+
let createRoot;
|
|
20257
|
+
try {
|
|
20258
|
+
const mainVersion = Number((version || "").split(".")[0]);
|
|
20259
|
+
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
20260
|
+
createRoot = fullClone.createRoot;
|
|
20261
|
+
}
|
|
20262
|
+
} catch (e) {
|
|
20263
|
+
}
|
|
20264
|
+
function toggleWarning(skip) {
|
|
20265
|
+
const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } = fullClone;
|
|
20266
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
|
|
20267
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
20268
|
+
}
|
|
20269
|
+
}
|
|
20270
|
+
const MARK = "__nutui_react_root__";
|
|
20271
|
+
function legacyRender(node, container) {
|
|
20272
|
+
reactRender(node, container);
|
|
20273
|
+
}
|
|
20274
|
+
function concurrentRender(node, container) {
|
|
20275
|
+
toggleWarning(true);
|
|
20276
|
+
const root2 = container[MARK] || createRoot(container);
|
|
20277
|
+
toggleWarning(false);
|
|
20278
|
+
root2.render(node);
|
|
20279
|
+
container[MARK] = root2;
|
|
20280
|
+
}
|
|
20281
|
+
function render(node, container) {
|
|
20282
|
+
if (createRoot) {
|
|
20283
|
+
concurrentRender(node, container);
|
|
20284
|
+
return;
|
|
20285
|
+
}
|
|
20286
|
+
legacyRender(node, container);
|
|
20287
|
+
}
|
|
20288
|
+
function legacyUnmount(container) {
|
|
20289
|
+
return unmountComponentAtNode(container);
|
|
20290
|
+
}
|
|
20291
|
+
async function concurrentUnmount(container) {
|
|
20292
|
+
return Promise.resolve().then(() => {
|
|
20293
|
+
var _a2;
|
|
20294
|
+
(_a2 = container[MARK]) == null ? void 0 : _a2.unmount();
|
|
20295
|
+
delete container[MARK];
|
|
20296
|
+
});
|
|
20297
|
+
}
|
|
20298
|
+
function unmount(container) {
|
|
20299
|
+
if (createRoot) {
|
|
20300
|
+
return concurrentUnmount(container);
|
|
20301
|
+
}
|
|
20302
|
+
return legacyUnmount(container);
|
|
20303
|
+
}
|
|
20596
20304
|
function ConfirmDialog(props) {
|
|
20597
20305
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { ...props, children: props.content });
|
|
20598
20306
|
}
|
|
@@ -20970,7 +20678,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20970
20678
|
imageSize: "",
|
|
20971
20679
|
status: "empty"
|
|
20972
20680
|
};
|
|
20973
|
-
const classPrefix$
|
|
20681
|
+
const classPrefix$7 = `nut-empty`;
|
|
20974
20682
|
const Empty = (props) => {
|
|
20975
20683
|
const { locale } = useConfig();
|
|
20976
20684
|
const {
|
|
@@ -21005,9 +20713,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21005
20713
|
};
|
|
21006
20714
|
});
|
|
21007
20715
|
}, [imageSize]);
|
|
21008
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
21009
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
21010
|
-
typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
20716
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$7} ${className}`, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
20717
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$7}__image`, style: imgStyle, children: imageNode }),
|
|
20718
|
+
typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$7}__description`, children: description || locale.noData }) : description,
|
|
21011
20719
|
children
|
|
21012
20720
|
] }) });
|
|
21013
20721
|
};
|
|
@@ -21639,7 +21347,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21639
21347
|
};
|
|
21640
21348
|
NoticeBar.defaultProps = defaultProps$y;
|
|
21641
21349
|
NoticeBar.displayName = "NutNoticeBar";
|
|
21642
|
-
|
|
21350
|
+
const classPrefix$6 = "nut-notify";
|
|
21351
|
+
let Notification$1 = (_a = class extends React__namespace.PureComponent {
|
|
21643
21352
|
constructor(props) {
|
|
21644
21353
|
super(props);
|
|
21645
21354
|
__publicField(this, "closeTimer");
|
|
@@ -21660,7 +21369,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21660
21369
|
const element = document.getElementById(this.props.id);
|
|
21661
21370
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
21662
21371
|
}
|
|
21663
|
-
this.props.
|
|
21372
|
+
this.props.onClose();
|
|
21664
21373
|
}
|
|
21665
21374
|
startCloseTimer() {
|
|
21666
21375
|
const { duration } = this.props;
|
|
@@ -21686,53 +21395,37 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21686
21395
|
this.clearCloseTimer();
|
|
21687
21396
|
}
|
|
21688
21397
|
render() {
|
|
21689
|
-
const {
|
|
21690
|
-
|
|
21691
|
-
style,
|
|
21692
|
-
msg,
|
|
21693
|
-
color,
|
|
21694
|
-
background,
|
|
21695
|
-
type: type2,
|
|
21696
|
-
className,
|
|
21697
|
-
position,
|
|
21698
|
-
isWrapTeleport
|
|
21699
|
-
} = this.props;
|
|
21700
|
-
this.state;
|
|
21701
|
-
cn("notify");
|
|
21398
|
+
const { style, message, type: type2, className, position } = this.props;
|
|
21399
|
+
const { show } = this.state;
|
|
21702
21400
|
const classes = classNames({
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
[
|
|
21401
|
+
[`${classPrefix$6}--popup-top`]: position === "top",
|
|
21402
|
+
[`${classPrefix$6}--popup-bottom`]: position === "bottom",
|
|
21403
|
+
[`${classPrefix$6}`]: true,
|
|
21404
|
+
[`${classPrefix$6}--${type2}`]: true
|
|
21707
21405
|
});
|
|
21708
21406
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21709
21407
|
CSSTransition$1,
|
|
21710
21408
|
{
|
|
21711
|
-
in:
|
|
21409
|
+
in: show,
|
|
21712
21410
|
timeout: 300,
|
|
21713
21411
|
classNames: "fade",
|
|
21714
21412
|
unmountOnExit: true,
|
|
21715
21413
|
appear: true,
|
|
21716
21414
|
position,
|
|
21717
|
-
isWrapTeleport,
|
|
21718
21415
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21719
21416
|
"div",
|
|
21720
21417
|
{
|
|
21721
21418
|
className: `${classes} ${className}`,
|
|
21722
|
-
style
|
|
21723
|
-
color: `${color || ""}`,
|
|
21724
|
-
background: `${background || ""}`
|
|
21725
|
-
},
|
|
21419
|
+
style,
|
|
21726
21420
|
onClick: this.clickCover,
|
|
21727
|
-
children:
|
|
21421
|
+
children: message
|
|
21728
21422
|
}
|
|
21729
21423
|
)
|
|
21730
21424
|
}
|
|
21731
|
-
) });
|
|
21732
|
-
}
|
|
21733
|
-
}
|
|
21734
|
-
|
|
21735
|
-
Notification.newInstance = (properties, callback) => {
|
|
21425
|
+
) });
|
|
21426
|
+
}
|
|
21427
|
+
}, __publicField(_a, "newInstance"), _a);
|
|
21428
|
+
Notification$1.newInstance = (properties, callback) => {
|
|
21736
21429
|
const element = document.createElement("div");
|
|
21737
21430
|
const id = properties.id ? properties.id : `${(/* @__PURE__ */ new Date()).getTime()}`;
|
|
21738
21431
|
element.id = id;
|
|
@@ -21748,74 +21441,72 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21748
21441
|
component: instance,
|
|
21749
21442
|
destroy() {
|
|
21750
21443
|
setTimeout(() => {
|
|
21751
|
-
|
|
21444
|
+
unmount(element);
|
|
21752
21445
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
21753
21446
|
}, 300);
|
|
21754
21447
|
}
|
|
21755
21448
|
});
|
|
21756
21449
|
}
|
|
21757
|
-
render(/* @__PURE__ */ jsxRuntimeExports.jsx(Notification, { ...properties, ref }), element);
|
|
21450
|
+
render(/* @__PURE__ */ jsxRuntimeExports.jsx(Notification$1, { ...properties, ref }), element);
|
|
21758
21451
|
};
|
|
21759
|
-
let messageInstance = null;
|
|
21760
|
-
const options = {
|
|
21761
|
-
|
|
21452
|
+
let messageInstance$1 = null;
|
|
21453
|
+
const options$1 = {
|
|
21454
|
+
...ComponentDefaults,
|
|
21762
21455
|
id: "",
|
|
21763
21456
|
duration: 3e3,
|
|
21764
21457
|
// 时长
|
|
21765
|
-
color: "",
|
|
21766
21458
|
type: "danger",
|
|
21767
|
-
className: "",
|
|
21768
21459
|
position: "top",
|
|
21769
|
-
|
|
21460
|
+
onClose: () => {
|
|
21770
21461
|
},
|
|
21771
21462
|
onClick: () => {
|
|
21772
21463
|
}
|
|
21773
21464
|
};
|
|
21774
|
-
function getInstance(props, callback) {
|
|
21775
|
-
if (messageInstance) {
|
|
21776
|
-
messageInstance.destroy();
|
|
21777
|
-
messageInstance = null;
|
|
21465
|
+
function getInstance$1(props, callback) {
|
|
21466
|
+
if (messageInstance$1) {
|
|
21467
|
+
messageInstance$1.destroy();
|
|
21468
|
+
messageInstance$1 = null;
|
|
21778
21469
|
}
|
|
21779
|
-
Notification.newInstance(props, (notification) => {
|
|
21470
|
+
Notification$1.newInstance(props, (notification) => {
|
|
21780
21471
|
return callback && callback(notification);
|
|
21781
21472
|
});
|
|
21782
21473
|
}
|
|
21783
|
-
function notice(opts) {
|
|
21784
|
-
opts = { ...options, ...opts };
|
|
21785
|
-
getInstance(opts, (notification) => {
|
|
21786
|
-
messageInstance = notification;
|
|
21474
|
+
function notice$1(opts) {
|
|
21475
|
+
opts = { ...options$1, ...opts };
|
|
21476
|
+
getInstance$1(opts, (notification) => {
|
|
21477
|
+
messageInstance$1 = notification;
|
|
21787
21478
|
});
|
|
21788
21479
|
}
|
|
21789
|
-
const errorMsg = (
|
|
21790
|
-
if (!
|
|
21791
|
-
console.warn("[NutUI Notify]:
|
|
21480
|
+
const errorMsg$1 = (message) => {
|
|
21481
|
+
if (!message) {
|
|
21482
|
+
console.warn("[NutUI Notify]: message不能为空");
|
|
21792
21483
|
}
|
|
21793
21484
|
};
|
|
21794
21485
|
const Notify = {
|
|
21795
|
-
text(
|
|
21796
|
-
errorMsg(
|
|
21797
|
-
return notice({
|
|
21486
|
+
text(message, option = {}) {
|
|
21487
|
+
errorMsg$1(message);
|
|
21488
|
+
return notice$1({ message, type: "base", ...option });
|
|
21798
21489
|
},
|
|
21799
|
-
success(
|
|
21800
|
-
errorMsg(
|
|
21801
|
-
return notice({
|
|
21490
|
+
success(message, option = {}) {
|
|
21491
|
+
errorMsg$1(message);
|
|
21492
|
+
return notice$1({ message, type: "success", ...option });
|
|
21802
21493
|
},
|
|
21803
|
-
primary(
|
|
21804
|
-
errorMsg(
|
|
21805
|
-
return notice({
|
|
21494
|
+
primary(message, option = {}) {
|
|
21495
|
+
errorMsg$1(message);
|
|
21496
|
+
return notice$1({ message, type: "primary", ...option });
|
|
21806
21497
|
},
|
|
21807
|
-
danger(
|
|
21808
|
-
errorMsg(
|
|
21809
|
-
return notice({
|
|
21498
|
+
danger(message, option = {}) {
|
|
21499
|
+
errorMsg$1(message);
|
|
21500
|
+
return notice$1({ message, type: "danger", ...option });
|
|
21810
21501
|
},
|
|
21811
|
-
warn(
|
|
21812
|
-
errorMsg(
|
|
21813
|
-
return notice({
|
|
21502
|
+
warn(message, option = {}) {
|
|
21503
|
+
errorMsg$1(message);
|
|
21504
|
+
return notice$1({ message, type: "warning", ...option });
|
|
21814
21505
|
},
|
|
21815
21506
|
hide() {
|
|
21816
|
-
if (messageInstance) {
|
|
21817
|
-
messageInstance.destroy();
|
|
21818
|
-
messageInstance = null;
|
|
21507
|
+
if (messageInstance$1) {
|
|
21508
|
+
messageInstance$1.destroy();
|
|
21509
|
+
messageInstance$1 = null;
|
|
21819
21510
|
}
|
|
21820
21511
|
}
|
|
21821
21512
|
};
|
|
@@ -22029,8 +21720,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22029
21720
|
}
|
|
22030
21721
|
}
|
|
22031
21722
|
const defaultProps$w = {
|
|
22032
|
-
|
|
22033
|
-
style: {},
|
|
21723
|
+
...ComponentDefaults,
|
|
22034
21724
|
pullingText: "",
|
|
22035
21725
|
canReleaseText: "",
|
|
22036
21726
|
refreshingText: "",
|
|
@@ -22043,6 +21733,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22043
21733
|
}
|
|
22044
21734
|
};
|
|
22045
21735
|
const PullToRefresh = (p) => {
|
|
21736
|
+
const classPrefix2 = "nut-pulltorefresh";
|
|
22046
21737
|
const { locale } = useConfig();
|
|
22047
21738
|
const props = {
|
|
22048
21739
|
...defaultProps$w,
|
|
@@ -22174,18 +21865,18 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22174
21865
|
animated.div,
|
|
22175
21866
|
{
|
|
22176
21867
|
ref: elementRef,
|
|
22177
|
-
className:
|
|
21868
|
+
className: `${classPrefix2} ${props.className}`,
|
|
22178
21869
|
style: props.style,
|
|
22179
21870
|
children: [
|
|
22180
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(animated.div, { style: springStyles, className:
|
|
21871
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(animated.div, { style: springStyles, className: `${classPrefix2}-head`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22181
21872
|
"div",
|
|
22182
21873
|
{
|
|
22183
|
-
className:
|
|
21874
|
+
className: `${classPrefix2}-head-content`,
|
|
22184
21875
|
style: { height: headHeight },
|
|
22185
21876
|
children: renderStatusText()
|
|
22186
21877
|
}
|
|
22187
21878
|
) }),
|
|
22188
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
21879
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}-content`, children: props.children })
|
|
22189
21880
|
]
|
|
22190
21881
|
}
|
|
22191
21882
|
);
|
|
@@ -22549,46 +22240,258 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22549
22240
|
} else {
|
|
22550
22241
|
props.onActionClick && props.onActionClick(event, position);
|
|
22551
22242
|
}
|
|
22552
|
-
};
|
|
22553
|
-
React.useImperativeHandle(instanceRef, () => ({
|
|
22554
|
-
open,
|
|
22555
|
-
close: () => close()
|
|
22556
|
-
}));
|
|
22557
|
-
React.useEffect(() => {
|
|
22558
|
-
const handler = (event) => {
|
|
22559
|
-
const targets = [root2];
|
|
22560
|
-
if (targets.some((targetItem) => {
|
|
22561
|
-
const targetElement = targetItem.current || targetItem;
|
|
22562
|
-
return !targetElement || (targetElement == null ? void 0 : targetElement.contains(event.target));
|
|
22563
|
-
})) {
|
|
22564
|
-
return;
|
|
22565
|
-
}
|
|
22566
|
-
close();
|
|
22567
|
-
};
|
|
22568
|
-
document.addEventListener("touchstart", handler);
|
|
22569
|
-
return () => {
|
|
22570
|
-
document.removeEventListener("touchstart", handler);
|
|
22571
|
-
};
|
|
22572
|
-
}, []);
|
|
22573
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22574
|
-
"div",
|
|
22575
|
-
{
|
|
22576
|
-
ref: root2,
|
|
22577
|
-
className: classNames(swipeBem(), className),
|
|
22578
|
-
onTouchStart: (e) => onTouchStart(e),
|
|
22579
|
-
onTouchMove: (e) => onTouchMove(e),
|
|
22580
|
-
onTouchEnd: (e) => onTouchEnd(e),
|
|
22581
|
-
style,
|
|
22582
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${swipeBem("wrapper")}`, style: wrapperStyle, children: [
|
|
22583
|
-
renderActionContent("left", leftRef),
|
|
22584
|
-
children,
|
|
22585
|
-
renderActionContent("right", rightRef)
|
|
22586
|
-
] })
|
|
22243
|
+
};
|
|
22244
|
+
React.useImperativeHandle(instanceRef, () => ({
|
|
22245
|
+
open,
|
|
22246
|
+
close: () => close()
|
|
22247
|
+
}));
|
|
22248
|
+
React.useEffect(() => {
|
|
22249
|
+
const handler = (event) => {
|
|
22250
|
+
const targets = [root2];
|
|
22251
|
+
if (targets.some((targetItem) => {
|
|
22252
|
+
const targetElement = targetItem.current || targetItem;
|
|
22253
|
+
return !targetElement || (targetElement == null ? void 0 : targetElement.contains(event.target));
|
|
22254
|
+
})) {
|
|
22255
|
+
return;
|
|
22256
|
+
}
|
|
22257
|
+
close();
|
|
22258
|
+
};
|
|
22259
|
+
document.addEventListener("touchstart", handler);
|
|
22260
|
+
return () => {
|
|
22261
|
+
document.removeEventListener("touchstart", handler);
|
|
22262
|
+
};
|
|
22263
|
+
}, []);
|
|
22264
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22265
|
+
"div",
|
|
22266
|
+
{
|
|
22267
|
+
ref: root2,
|
|
22268
|
+
className: classNames(swipeBem(), className),
|
|
22269
|
+
onTouchStart: (e) => onTouchStart(e),
|
|
22270
|
+
onTouchMove: (e) => onTouchMove(e),
|
|
22271
|
+
onTouchEnd: (e) => onTouchEnd(e),
|
|
22272
|
+
style,
|
|
22273
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${swipeBem("wrapper")}`, style: wrapperStyle, children: [
|
|
22274
|
+
renderActionContent("left", leftRef),
|
|
22275
|
+
children,
|
|
22276
|
+
renderActionContent("right", rightRef)
|
|
22277
|
+
] })
|
|
22278
|
+
}
|
|
22279
|
+
);
|
|
22280
|
+
});
|
|
22281
|
+
Swipe.defaultProps = defaultProps$t;
|
|
22282
|
+
Swipe.displayName = "NutSwipe";
|
|
22283
|
+
class Notification extends React__namespace.PureComponent {
|
|
22284
|
+
constructor(props) {
|
|
22285
|
+
super(props);
|
|
22286
|
+
__publicField(this, "closeTimer");
|
|
22287
|
+
this.close = this.close.bind(this);
|
|
22288
|
+
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
22289
|
+
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
22290
|
+
this.close = this.close.bind(this);
|
|
22291
|
+
this.clickCover = this.clickCover.bind(this);
|
|
22292
|
+
}
|
|
22293
|
+
close() {
|
|
22294
|
+
this.clearCloseTimer();
|
|
22295
|
+
this.props.onClose();
|
|
22296
|
+
}
|
|
22297
|
+
startCloseTimer() {
|
|
22298
|
+
const { duration } = this.props;
|
|
22299
|
+
if (duration) {
|
|
22300
|
+
this.closeTimer = window.setTimeout(() => {
|
|
22301
|
+
this.close();
|
|
22302
|
+
}, duration * 1e3);
|
|
22303
|
+
}
|
|
22304
|
+
}
|
|
22305
|
+
clearCloseTimer() {
|
|
22306
|
+
if (this.closeTimer) {
|
|
22307
|
+
clearTimeout(this.closeTimer);
|
|
22308
|
+
this.closeTimer = -1;
|
|
22309
|
+
}
|
|
22310
|
+
}
|
|
22311
|
+
clickCover() {
|
|
22312
|
+
const { closeOnClickOverlay } = this.props;
|
|
22313
|
+
if (closeOnClickOverlay) {
|
|
22314
|
+
this.close();
|
|
22315
|
+
}
|
|
22316
|
+
}
|
|
22317
|
+
componentDidMount() {
|
|
22318
|
+
this.startCloseTimer();
|
|
22319
|
+
}
|
|
22320
|
+
componentWillUnmount() {
|
|
22321
|
+
this.clearCloseTimer();
|
|
22322
|
+
}
|
|
22323
|
+
render() {
|
|
22324
|
+
const {
|
|
22325
|
+
id,
|
|
22326
|
+
style,
|
|
22327
|
+
icon,
|
|
22328
|
+
title,
|
|
22329
|
+
msg,
|
|
22330
|
+
bottom,
|
|
22331
|
+
center,
|
|
22332
|
+
bgColor,
|
|
22333
|
+
coverColor,
|
|
22334
|
+
textAlignCenter,
|
|
22335
|
+
size,
|
|
22336
|
+
customClass,
|
|
22337
|
+
cover,
|
|
22338
|
+
type: type2
|
|
22339
|
+
} = this.props;
|
|
22340
|
+
const toastBem = cn("toast");
|
|
22341
|
+
const classes = classNames({
|
|
22342
|
+
"nut-toast-center": center,
|
|
22343
|
+
"nut-toast-has-icon": icon,
|
|
22344
|
+
"nut-toast-cover": cover,
|
|
22345
|
+
"nut-toast-loading": type2 === "loading",
|
|
22346
|
+
[`${customClass}`]: true,
|
|
22347
|
+
[`nut-toast-${size}`]: true
|
|
22348
|
+
});
|
|
22349
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22350
|
+
"div",
|
|
22351
|
+
{
|
|
22352
|
+
className: `${toastBem()} ${classes}`,
|
|
22353
|
+
id: `toast-${id}`,
|
|
22354
|
+
style: {
|
|
22355
|
+
bottom: center ? "auto" : `${bottom}`,
|
|
22356
|
+
backgroundColor: cover ? coverColor : "",
|
|
22357
|
+
...style
|
|
22358
|
+
},
|
|
22359
|
+
onClick: () => {
|
|
22360
|
+
this.clickCover();
|
|
22361
|
+
},
|
|
22362
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
22363
|
+
"div",
|
|
22364
|
+
{
|
|
22365
|
+
className: toastBem("inner"),
|
|
22366
|
+
style: {
|
|
22367
|
+
textAlign: textAlignCenter ? "center" : "left",
|
|
22368
|
+
backgroundColor: bgColor
|
|
22369
|
+
},
|
|
22370
|
+
children: [
|
|
22371
|
+
icon ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: toastBem("icon-wrapper"), children: icon }) : null,
|
|
22372
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-toast-title", children: title }) : null,
|
|
22373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: toastBem("text"), children: msg })
|
|
22374
|
+
]
|
|
22375
|
+
}
|
|
22376
|
+
)
|
|
22377
|
+
}
|
|
22378
|
+
) });
|
|
22379
|
+
}
|
|
22380
|
+
}
|
|
22381
|
+
__publicField(Notification, "newInstance");
|
|
22382
|
+
Notification.newInstance = (properties, callback) => {
|
|
22383
|
+
const element = document.createElement("div");
|
|
22384
|
+
if (properties.id) {
|
|
22385
|
+
element.setAttribute("id", `${properties.id}`);
|
|
22386
|
+
}
|
|
22387
|
+
document.body.appendChild(element);
|
|
22388
|
+
let called = false;
|
|
22389
|
+
function ref(instance) {
|
|
22390
|
+
if (called) {
|
|
22391
|
+
return;
|
|
22392
|
+
}
|
|
22393
|
+
called = true;
|
|
22394
|
+
callback({
|
|
22395
|
+
component: instance,
|
|
22396
|
+
destroy() {
|
|
22397
|
+
unmount(element);
|
|
22398
|
+
element && element.parentNode && element.parentNode.removeChild(element);
|
|
22399
|
+
}
|
|
22400
|
+
});
|
|
22401
|
+
}
|
|
22402
|
+
render(/* @__PURE__ */ jsxRuntimeExports.jsx(Notification, { ...properties, ref }), element);
|
|
22403
|
+
};
|
|
22404
|
+
let messageInstance = null;
|
|
22405
|
+
const options = {
|
|
22406
|
+
msg: "",
|
|
22407
|
+
id: "",
|
|
22408
|
+
style: {},
|
|
22409
|
+
duration: 1.5,
|
|
22410
|
+
// 时长,duration为0则一直展示
|
|
22411
|
+
center: true,
|
|
22412
|
+
// toast是否居中展示
|
|
22413
|
+
type: "text",
|
|
22414
|
+
title: "",
|
|
22415
|
+
customClass: "",
|
|
22416
|
+
// 自定义样式名
|
|
22417
|
+
bottom: "30px",
|
|
22418
|
+
// center为false时生效,距离底部位置
|
|
22419
|
+
size: "base",
|
|
22420
|
+
// 设置字体大小,默认base,可选large\small\base
|
|
22421
|
+
icon: null,
|
|
22422
|
+
iconSize: "20",
|
|
22423
|
+
textAlignCenter: true,
|
|
22424
|
+
// 文字是否居中显示,true为居中,false为left
|
|
22425
|
+
loadingRotate: true,
|
|
22426
|
+
// 未实现
|
|
22427
|
+
bgColor: "rgba(0, 0, 0, .8)",
|
|
22428
|
+
onClose: () => {
|
|
22429
|
+
},
|
|
22430
|
+
cover: false,
|
|
22431
|
+
// 是否展示透明遮罩层
|
|
22432
|
+
coverColor: "rgba(0, 0, 0, 0)",
|
|
22433
|
+
// 遮罩颜色设定
|
|
22434
|
+
closeOnClickOverlay: false
|
|
22435
|
+
// 是否点击遮罩可关闭
|
|
22436
|
+
};
|
|
22437
|
+
function getInstance(props, callback) {
|
|
22438
|
+
if (messageInstance) {
|
|
22439
|
+
messageInstance.destroy();
|
|
22440
|
+
messageInstance = null;
|
|
22441
|
+
}
|
|
22442
|
+
Notification.newInstance(props, (notification) => {
|
|
22443
|
+
return callback && callback(notification);
|
|
22444
|
+
});
|
|
22445
|
+
}
|
|
22446
|
+
function notice(opts) {
|
|
22447
|
+
function close() {
|
|
22448
|
+
if (messageInstance) {
|
|
22449
|
+
messageInstance.destroy();
|
|
22450
|
+
messageInstance = null;
|
|
22451
|
+
}
|
|
22452
|
+
}
|
|
22453
|
+
const opts2 = { ...options, ...opts, onClose: close };
|
|
22454
|
+
getInstance(opts2, (notification) => {
|
|
22455
|
+
messageInstance = notification;
|
|
22456
|
+
});
|
|
22457
|
+
}
|
|
22458
|
+
const errorMsg = (msg) => {
|
|
22459
|
+
if (!msg) {
|
|
22460
|
+
console.warn("[NutUI Toast]: msg cannot be null");
|
|
22461
|
+
}
|
|
22462
|
+
};
|
|
22463
|
+
const Toast = {
|
|
22464
|
+
text(msg, option = {}) {
|
|
22465
|
+
errorMsg(msg);
|
|
22466
|
+
return notice({ msg, type: "text", ...option });
|
|
22467
|
+
},
|
|
22468
|
+
success(msg, option = {}) {
|
|
22469
|
+
errorMsg(msg);
|
|
22470
|
+
return notice({ msg, icon: "success", type: "success", ...option });
|
|
22471
|
+
},
|
|
22472
|
+
fail(msg, option = {}) {
|
|
22473
|
+
errorMsg(msg);
|
|
22474
|
+
return notice({ msg, icon: "failure", type: "fail", ...option });
|
|
22475
|
+
},
|
|
22476
|
+
loading(msg, option = {}) {
|
|
22477
|
+
errorMsg(msg);
|
|
22478
|
+
return notice({ msg, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(k$3, {}), type: "loading", ...option });
|
|
22479
|
+
},
|
|
22480
|
+
warn(msg, option = {}) {
|
|
22481
|
+
errorMsg(msg);
|
|
22482
|
+
return notice({ msg, icon: "tips", type: "warn", ...option });
|
|
22483
|
+
},
|
|
22484
|
+
customIcon(msg, option = {}) {
|
|
22485
|
+
errorMsg(msg);
|
|
22486
|
+
return notice({ msg, ...option });
|
|
22487
|
+
},
|
|
22488
|
+
hide() {
|
|
22489
|
+
if (messageInstance) {
|
|
22490
|
+
messageInstance.destroy();
|
|
22491
|
+
messageInstance = null;
|
|
22587
22492
|
}
|
|
22588
|
-
|
|
22589
|
-
}
|
|
22590
|
-
Swipe.defaultProps = defaultProps$t;
|
|
22591
|
-
Swipe.displayName = "NutSwipe";
|
|
22493
|
+
}
|
|
22494
|
+
};
|
|
22592
22495
|
const defaultProps$s = {
|
|
22593
22496
|
...ComponentDefaults,
|
|
22594
22497
|
type: "shake",
|
|
@@ -22720,7 +22623,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22720
22623
|
...ComponentDefaults,
|
|
22721
22624
|
src: "",
|
|
22722
22625
|
muted: false,
|
|
22723
|
-
|
|
22626
|
+
autoPlay: false,
|
|
22724
22627
|
loop: false,
|
|
22725
22628
|
preload: "auto",
|
|
22726
22629
|
type: "progress",
|
|
@@ -22746,7 +22649,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22746
22649
|
src,
|
|
22747
22650
|
style,
|
|
22748
22651
|
muted,
|
|
22749
|
-
|
|
22652
|
+
autoPlay,
|
|
22750
22653
|
loop: loop2,
|
|
22751
22654
|
preload,
|
|
22752
22655
|
type: type2,
|
|
@@ -22774,7 +22677,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22774
22677
|
duration: "00:00:00",
|
|
22775
22678
|
second: 0,
|
|
22776
22679
|
hanMuted: props.muted,
|
|
22777
|
-
playing: props.
|
|
22680
|
+
playing: props.autoPlay,
|
|
22778
22681
|
handPlaying: false
|
|
22779
22682
|
});
|
|
22780
22683
|
const classPrefix2 = "nut-audio";
|
|
@@ -22865,9 +22768,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22865
22768
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__progress-bar-wrapper`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22866
22769
|
Range,
|
|
22867
22770
|
{
|
|
22868
|
-
|
|
22869
|
-
|
|
22870
|
-
|
|
22771
|
+
value: percent,
|
|
22772
|
+
onChange: (val) => setPercent(val),
|
|
22773
|
+
currentDescription: null,
|
|
22774
|
+
maxDescription: null,
|
|
22775
|
+
minDescription: null,
|
|
22871
22776
|
"inactive-color": "#cccccc",
|
|
22872
22777
|
"active-color": "#fa2c19"
|
|
22873
22778
|
}
|
|
@@ -22938,7 +22843,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22938
22843
|
};
|
|
22939
22844
|
const handleCanplay = (e) => {
|
|
22940
22845
|
setIsCanPlay(true);
|
|
22941
|
-
if (props.
|
|
22846
|
+
if (props.autoPlay && !playing) {
|
|
22942
22847
|
AudioRef && AudioRef.current && AudioRef.current.play();
|
|
22943
22848
|
}
|
|
22944
22849
|
if (AudioRef.current) {
|
|
@@ -23774,45 +23679,73 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23774
23679
|
Video.displayName = "NutVideo";
|
|
23775
23680
|
const DataContext$1 = React.createContext({});
|
|
23776
23681
|
const defaultProps$h = {
|
|
23682
|
+
total: 3,
|
|
23683
|
+
current: 0,
|
|
23684
|
+
direction: "horizontal"
|
|
23685
|
+
};
|
|
23686
|
+
const classPrefix = `nut-indicator`;
|
|
23687
|
+
const Indicator = (props) => {
|
|
23688
|
+
const { total, current, children, className, direction, ...rest } = {
|
|
23689
|
+
...defaultProps$h,
|
|
23690
|
+
...props
|
|
23691
|
+
};
|
|
23692
|
+
const classes = classNames({
|
|
23693
|
+
[`${classPrefix}__vertical`]: direction === "vertical"
|
|
23694
|
+
});
|
|
23695
|
+
const renderElement = () => {
|
|
23696
|
+
const childs = [];
|
|
23697
|
+
for (let item = 0; item < total; item++) {
|
|
23698
|
+
childs.push(
|
|
23699
|
+
item === current ? children || /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23700
|
+
"div",
|
|
23701
|
+
{
|
|
23702
|
+
className: `${classPrefix}__dot ${classPrefix}__active`
|
|
23703
|
+
},
|
|
23704
|
+
item
|
|
23705
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix}__dot` }, item)
|
|
23706
|
+
);
|
|
23707
|
+
}
|
|
23708
|
+
return childs;
|
|
23709
|
+
};
|
|
23710
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(classes, className), ...rest, children: renderElement() });
|
|
23711
|
+
};
|
|
23712
|
+
Indicator.defaultProps = defaultProps$h;
|
|
23713
|
+
Indicator.displayName = "NutIndicator";
|
|
23714
|
+
const defaultProps$g = {
|
|
23777
23715
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
23778
23716
|
height: 0,
|
|
23779
23717
|
duration: 500,
|
|
23780
|
-
|
|
23718
|
+
defaultValue: 0,
|
|
23781
23719
|
autoPlay: 0,
|
|
23782
23720
|
direction: "horizontal",
|
|
23783
|
-
|
|
23784
|
-
paginationBgColor: "#ddd",
|
|
23785
|
-
paginationVisible: false,
|
|
23721
|
+
indicator: false,
|
|
23786
23722
|
loop: true,
|
|
23787
23723
|
touchable: true,
|
|
23788
|
-
|
|
23789
|
-
|
|
23790
|
-
|
|
23724
|
+
preventDefault: true,
|
|
23725
|
+
stopPropagation: true,
|
|
23726
|
+
center: false,
|
|
23791
23727
|
className: ""
|
|
23792
23728
|
};
|
|
23793
23729
|
const DISTANCE = 5;
|
|
23794
23730
|
const Swiper = React.forwardRef((props, ref) => {
|
|
23795
|
-
const propSwiper = { ...defaultProps$
|
|
23731
|
+
const propSwiper = { ...defaultProps$g, ...props };
|
|
23796
23732
|
const {
|
|
23797
23733
|
children,
|
|
23798
23734
|
direction,
|
|
23799
23735
|
className,
|
|
23800
|
-
pageContent,
|
|
23801
23736
|
onChange,
|
|
23802
|
-
|
|
23803
|
-
|
|
23804
|
-
paginationVisible,
|
|
23737
|
+
defaultValue,
|
|
23738
|
+
indicator,
|
|
23805
23739
|
touchable,
|
|
23806
|
-
|
|
23807
|
-
|
|
23740
|
+
preventDefault: preventDefault2,
|
|
23741
|
+
stopPropagation,
|
|
23808
23742
|
autoPlay,
|
|
23809
|
-
|
|
23810
|
-
paginationBgColor,
|
|
23743
|
+
center,
|
|
23811
23744
|
...rest
|
|
23812
23745
|
} = propSwiper;
|
|
23813
23746
|
const container = React.useRef(null);
|
|
23814
23747
|
const innerRef = React.useRef(null);
|
|
23815
|
-
const
|
|
23748
|
+
const swiperRef = React.useRef({
|
|
23816
23749
|
moving: false,
|
|
23817
23750
|
autoplayTimer: null,
|
|
23818
23751
|
width: 0,
|
|
@@ -23829,7 +23762,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23829
23762
|
const [childOffset, setChildOffset] = React.useState([]);
|
|
23830
23763
|
const [ready, setReady] = React.useState(false);
|
|
23831
23764
|
let size = isVertical ? height : width;
|
|
23832
|
-
const [touch
|
|
23765
|
+
const [touch] = React.useState({
|
|
23833
23766
|
startX: 0,
|
|
23834
23767
|
startY: 0,
|
|
23835
23768
|
deltaX: 0,
|
|
@@ -23866,20 +23799,20 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23866
23799
|
return 0;
|
|
23867
23800
|
})();
|
|
23868
23801
|
const stopAutoPlay = () => {
|
|
23869
|
-
clearTimeout(
|
|
23870
|
-
|
|
23802
|
+
clearTimeout(swiperRef.current.autoplayTimer);
|
|
23803
|
+
swiperRef.current.autoplayTimer = null;
|
|
23871
23804
|
};
|
|
23872
|
-
const
|
|
23805
|
+
const startPlay = () => {
|
|
23873
23806
|
if (propSwiper.autoPlay <= 0 || childCount <= 1)
|
|
23874
23807
|
return;
|
|
23875
23808
|
stopAutoPlay();
|
|
23876
|
-
|
|
23809
|
+
swiperRef.current.autoplayTimer = setTimeout(() => {
|
|
23877
23810
|
next();
|
|
23878
|
-
|
|
23811
|
+
startPlay();
|
|
23879
23812
|
}, Number(propSwiper.autoPlay));
|
|
23880
23813
|
};
|
|
23881
|
-
const
|
|
23882
|
-
|
|
23814
|
+
const resetPosition = () => {
|
|
23815
|
+
swiperRef.current.moving = true;
|
|
23883
23816
|
if (active <= -1) {
|
|
23884
23817
|
move({ pace: childCount });
|
|
23885
23818
|
}
|
|
@@ -23888,47 +23821,41 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23888
23821
|
}
|
|
23889
23822
|
};
|
|
23890
23823
|
const prev = () => {
|
|
23891
|
-
|
|
23892
|
-
|
|
23824
|
+
resetPosition();
|
|
23825
|
+
resetTouchDetails();
|
|
23893
23826
|
requestFrame(() => {
|
|
23894
|
-
|
|
23895
|
-
|
|
23896
|
-
|
|
23897
|
-
|
|
23898
|
-
isEmit: true
|
|
23899
|
-
});
|
|
23827
|
+
swiperRef.current.moving = false;
|
|
23828
|
+
move({
|
|
23829
|
+
pace: -1,
|
|
23830
|
+
isEmit: true
|
|
23900
23831
|
});
|
|
23901
23832
|
});
|
|
23902
23833
|
};
|
|
23903
23834
|
const next = () => {
|
|
23904
|
-
|
|
23905
|
-
|
|
23835
|
+
resetPosition();
|
|
23836
|
+
resetTouchDetails();
|
|
23906
23837
|
requestFrame(() => {
|
|
23907
|
-
|
|
23908
|
-
|
|
23909
|
-
|
|
23910
|
-
|
|
23911
|
-
isEmit: true
|
|
23912
|
-
});
|
|
23838
|
+
swiperRef.current.moving = false;
|
|
23839
|
+
move({
|
|
23840
|
+
pace: 1,
|
|
23841
|
+
isEmit: true
|
|
23913
23842
|
});
|
|
23914
23843
|
});
|
|
23915
23844
|
};
|
|
23916
23845
|
const to2 = (index) => {
|
|
23917
|
-
|
|
23918
|
-
|
|
23846
|
+
resetPosition();
|
|
23847
|
+
resetTouchDetails();
|
|
23919
23848
|
requestFrame(() => {
|
|
23920
|
-
|
|
23921
|
-
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23930
|
-
isEmit: true
|
|
23931
|
-
});
|
|
23849
|
+
swiperRef.current.moving = false;
|
|
23850
|
+
let targetIndex;
|
|
23851
|
+
if (props.loop && childCount === index) {
|
|
23852
|
+
targetIndex = active === 0 ? 0 : index;
|
|
23853
|
+
} else {
|
|
23854
|
+
targetIndex = index % childCount;
|
|
23855
|
+
}
|
|
23856
|
+
move({
|
|
23857
|
+
pace: targetIndex - active,
|
|
23858
|
+
isEmit: true
|
|
23932
23859
|
});
|
|
23933
23860
|
});
|
|
23934
23861
|
};
|
|
@@ -23998,7 +23925,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23998
23925
|
return "vertical";
|
|
23999
23926
|
return "";
|
|
24000
23927
|
};
|
|
24001
|
-
const
|
|
23928
|
+
const resetTouchDetails = () => {
|
|
24002
23929
|
touch.startX = 0;
|
|
24003
23930
|
touch.startY = 0;
|
|
24004
23931
|
touch.deltaX = 0;
|
|
@@ -24010,11 +23937,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24010
23937
|
touch.touchTime = 0;
|
|
24011
23938
|
};
|
|
24012
23939
|
const touchStart = (e) => {
|
|
24013
|
-
|
|
23940
|
+
resetTouchDetails();
|
|
24014
23941
|
touch.startX = e.touches[0].clientX;
|
|
24015
23942
|
touch.startY = e.touches[0].clientY;
|
|
24016
23943
|
};
|
|
24017
|
-
const
|
|
23944
|
+
const handleTouchMove = (e) => {
|
|
24018
23945
|
touch.deltaX = e.touches[0].clientX - touch.startX;
|
|
24019
23946
|
touch.deltaY = e.touches[0].clientY - touch.startY;
|
|
24020
23947
|
touch.offsetX = Math.abs(touch.deltaX);
|
|
@@ -24024,42 +23951,41 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24024
23951
|
touch.stateDirection = getDirection2(touch.offsetX, touch.offsetY);
|
|
24025
23952
|
}
|
|
24026
23953
|
};
|
|
24027
|
-
const
|
|
24028
|
-
const classes = classNames(b(""));
|
|
23954
|
+
const classPrefix2 = "nut-swiper";
|
|
24029
23955
|
const contentClass = classNames({
|
|
24030
|
-
[`${
|
|
24031
|
-
[`${
|
|
23956
|
+
[`${classPrefix2}__inner`]: true,
|
|
23957
|
+
[`${classPrefix2}__vertical`]: isVertical
|
|
24032
23958
|
});
|
|
24033
23959
|
const getStyle = (moveOffset = offset) => {
|
|
24034
23960
|
const target = innerRef.current;
|
|
24035
23961
|
let _offset = 0;
|
|
24036
|
-
if (!
|
|
23962
|
+
if (!center) {
|
|
24037
23963
|
_offset = moveOffset;
|
|
24038
23964
|
} else {
|
|
24039
23965
|
const _size = isVertical ? height : width;
|
|
24040
23966
|
const val = isVertical ? rect.height - _size : rect.width - _size;
|
|
24041
23967
|
_offset = moveOffset + (active === childCount - 1 && !props.loop ? -val / 2 : val / 2);
|
|
24042
23968
|
}
|
|
24043
|
-
target.style.transitionDuration = `${
|
|
23969
|
+
target.style.transitionDuration = `${swiperRef.current.moving ? 0 : props.duration}ms`;
|
|
24044
23970
|
target.style[isVertical ? "height" : "width"] = `${Number(size) * childCount}px`;
|
|
24045
23971
|
target.style[isVertical ? "width" : "height"] = `${isVertical ? width : height}px`;
|
|
24046
23972
|
target.style.transform = `translate3D${!isVertical ? `(${_offset}px,0,0)` : `(0,${_offset}px,0)`}`;
|
|
24047
23973
|
};
|
|
24048
23974
|
const onTouchStart = (e) => {
|
|
24049
|
-
if (props.
|
|
23975
|
+
if (props.preventDefault)
|
|
24050
23976
|
e.preventDefault();
|
|
24051
|
-
if (props.
|
|
23977
|
+
if (props.stopPropagation)
|
|
24052
23978
|
e.stopPropagation();
|
|
24053
23979
|
if (!props.touchable)
|
|
24054
23980
|
return;
|
|
24055
23981
|
touchStart(e);
|
|
24056
23982
|
touch.touchTime = Date.now();
|
|
24057
23983
|
stopAutoPlay();
|
|
24058
|
-
|
|
23984
|
+
resetPosition();
|
|
24059
23985
|
};
|
|
24060
23986
|
const onTouchMove = (e) => {
|
|
24061
|
-
if (props.touchable &&
|
|
24062
|
-
|
|
23987
|
+
if (props.touchable && swiperRef.current.moving) {
|
|
23988
|
+
handleTouchMove(e);
|
|
24063
23989
|
if (touch.stateDirection === props.direction) {
|
|
24064
23990
|
move({
|
|
24065
23991
|
offset: touch.delta
|
|
@@ -24068,12 +23994,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24068
23994
|
}
|
|
24069
23995
|
};
|
|
24070
23996
|
const onTouchEnd = (e) => {
|
|
24071
|
-
if (!props.touchable || !
|
|
23997
|
+
if (!props.touchable || !swiperRef.current.moving)
|
|
24072
23998
|
return;
|
|
24073
23999
|
const speed = touch.delta / (Date.now() - touch.touchTime);
|
|
24074
|
-
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta) >
|
|
24000
|
+
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta) > Number((size / 2).toFixed(2));
|
|
24075
24001
|
let pace = 0;
|
|
24076
|
-
|
|
24002
|
+
swiperRef.current.moving = false;
|
|
24077
24003
|
if (isShouldMove && touch.stateDirection === props.direction) {
|
|
24078
24004
|
const offset2 = isVertical ? touch.offsetY : touch.offsetX;
|
|
24079
24005
|
if (props.loop) {
|
|
@@ -24094,27 +24020,27 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24094
24020
|
} else {
|
|
24095
24021
|
getStyle();
|
|
24096
24022
|
}
|
|
24097
|
-
|
|
24023
|
+
startPlay();
|
|
24098
24024
|
};
|
|
24099
24025
|
React.useEffect(() => {
|
|
24100
|
-
|
|
24026
|
+
swiperRef.current.activePagination = (active + childCount) % childCount;
|
|
24101
24027
|
}, [active]);
|
|
24102
|
-
const init = (active2 = +propSwiper.
|
|
24028
|
+
const init = (active2 = +propSwiper.defaultValue) => {
|
|
24103
24029
|
const rect2 = getRect(container == null ? void 0 : container.current);
|
|
24104
|
-
const
|
|
24105
|
-
const
|
|
24106
|
-
const
|
|
24107
|
-
size = isVertical ?
|
|
24030
|
+
const currentIndex = Math.max(Math.min(childCount - 1, active2), 0);
|
|
24031
|
+
const width2 = +propSwiper.width || rect2.width;
|
|
24032
|
+
const height2 = +propSwiper.height || rect2.height;
|
|
24033
|
+
size = isVertical ? height2 : width2;
|
|
24108
24034
|
trackSize = childCount * Number(size);
|
|
24109
|
-
const targetOffset = getOffset(
|
|
24110
|
-
|
|
24035
|
+
const targetOffset = getOffset(currentIndex);
|
|
24036
|
+
swiperRef.current.moving = true;
|
|
24111
24037
|
if (ready) {
|
|
24112
|
-
|
|
24038
|
+
swiperRef.current.moving = false;
|
|
24113
24039
|
}
|
|
24114
24040
|
setRect(rect2);
|
|
24115
|
-
setActive(
|
|
24116
|
-
setWidth(
|
|
24117
|
-
setHeight(
|
|
24041
|
+
setActive(currentIndex);
|
|
24042
|
+
setWidth(width2);
|
|
24043
|
+
setHeight(height2);
|
|
24118
24044
|
setOffset(targetOffset);
|
|
24119
24045
|
setReady(true);
|
|
24120
24046
|
};
|
|
@@ -24126,19 +24052,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24126
24052
|
React.useEffect(() => {
|
|
24127
24053
|
if (ready) {
|
|
24128
24054
|
stopAutoPlay();
|
|
24129
|
-
|
|
24055
|
+
startPlay();
|
|
24130
24056
|
}
|
|
24131
|
-
return () =>
|
|
24132
|
-
setReady(false);
|
|
24133
|
-
};
|
|
24057
|
+
return () => setReady(false);
|
|
24134
24058
|
}, [ready]);
|
|
24135
24059
|
React.useEffect(() => {
|
|
24136
24060
|
stopAutoPlay();
|
|
24137
|
-
|
|
24061
|
+
startPlay();
|
|
24138
24062
|
}, [children]);
|
|
24139
|
-
React.useEffect(() =>
|
|
24140
|
-
init();
|
|
24141
|
-
}, [propSwiper.initPage]);
|
|
24063
|
+
React.useEffect(() => init(), [propSwiper.defaultValue]);
|
|
24142
24064
|
React.useEffect(() => {
|
|
24143
24065
|
const target = container.current;
|
|
24144
24066
|
target.addEventListener("touchstart", onTouchStart, false);
|
|
@@ -24151,20 +24073,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24151
24073
|
};
|
|
24152
24074
|
});
|
|
24153
24075
|
React.useEffect(() => {
|
|
24154
|
-
return () =>
|
|
24155
|
-
stopAutoPlay();
|
|
24156
|
-
};
|
|
24076
|
+
return () => stopAutoPlay();
|
|
24157
24077
|
}, []);
|
|
24158
|
-
const
|
|
24078
|
+
const getItemStyle = (index) => {
|
|
24159
24079
|
const style = {};
|
|
24160
|
-
|
|
24161
|
-
|
|
24162
|
-
if (_size) {
|
|
24163
|
-
style[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
|
|
24080
|
+
if (size) {
|
|
24081
|
+
style[direction === "horizontal" ? "width" : "height"] = `${size}px`;
|
|
24164
24082
|
}
|
|
24165
24083
|
const offset2 = childOffset[index];
|
|
24166
24084
|
if (offset2) {
|
|
24167
|
-
style.transform = `translate3D${
|
|
24085
|
+
style.transform = `translate3D${direction === "horizontal" ? `(${offset2}px,0,0)` : `(0,${offset2}px,0)`}`;
|
|
24168
24086
|
}
|
|
24169
24087
|
return style;
|
|
24170
24088
|
};
|
|
@@ -24174,52 +24092,58 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24174
24092
|
prev,
|
|
24175
24093
|
resize
|
|
24176
24094
|
}));
|
|
24177
|
-
|
|
24178
|
-
|
|
24095
|
+
const renderIndicator = () => {
|
|
24096
|
+
if (React.isValidElement(indicator))
|
|
24097
|
+
return indicator;
|
|
24098
|
+
if (indicator === true) {
|
|
24179
24099
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24180
24100
|
"div",
|
|
24181
24101
|
{
|
|
24182
|
-
className:
|
|
24183
|
-
|
|
24184
|
-
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
}) }),
|
|
24189
|
-
propSwiper.paginationVisible && !("pageContent" in propSwiper) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24190
|
-
"div",
|
|
24191
|
-
{
|
|
24192
|
-
className: classNames({
|
|
24193
|
-
[`${b("pagination")}`]: true,
|
|
24194
|
-
[`${b("pagination-vertical")}`]: isVertical
|
|
24195
|
-
}),
|
|
24196
|
-
children: React.Children.map(childs, (item, index) => {
|
|
24197
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24198
|
-
"i",
|
|
24102
|
+
className: classNames({
|
|
24103
|
+
[`${classPrefix2}__pagination`]: true,
|
|
24104
|
+
[`${classPrefix2}__pagination-vertical`]: isVertical
|
|
24105
|
+
}),
|
|
24106
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24107
|
+
Indicator,
|
|
24199
24108
|
{
|
|
24200
|
-
|
|
24201
|
-
|
|
24202
|
-
|
|
24203
|
-
|
|
24204
|
-
|
|
24205
|
-
|
|
24206
|
-
|
|
24207
|
-
|
|
24208
|
-
|
|
24209
|
-
|
|
24210
|
-
|
|
24211
|
-
|
|
24212
|
-
|
|
24213
|
-
|
|
24214
|
-
|
|
24109
|
+
current: (active + childCount) % childCount,
|
|
24110
|
+
total: childs == null ? void 0 : childs.length,
|
|
24111
|
+
direction
|
|
24112
|
+
}
|
|
24113
|
+
)
|
|
24114
|
+
}
|
|
24115
|
+
);
|
|
24116
|
+
}
|
|
24117
|
+
return null;
|
|
24118
|
+
};
|
|
24119
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DataContext$1.Provider, { value: parent, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24120
|
+
"div",
|
|
24121
|
+
{
|
|
24122
|
+
className: classNames(classPrefix2, className),
|
|
24123
|
+
ref: container,
|
|
24124
|
+
...rest,
|
|
24125
|
+
children: [
|
|
24126
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClass, ref: innerRef, children: React.Children.map(childs, (child, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24127
|
+
"div",
|
|
24128
|
+
{
|
|
24129
|
+
className: `${classPrefix2}__item-wrapper`,
|
|
24130
|
+
style: getItemStyle(index),
|
|
24131
|
+
children: child
|
|
24132
|
+
},
|
|
24133
|
+
index
|
|
24134
|
+
)) }),
|
|
24135
|
+
renderIndicator()
|
|
24136
|
+
]
|
|
24137
|
+
}
|
|
24138
|
+
) });
|
|
24215
24139
|
});
|
|
24216
|
-
Swiper.defaultProps = defaultProps$
|
|
24140
|
+
Swiper.defaultProps = defaultProps$g;
|
|
24217
24141
|
Swiper.displayName = "NutSwiper";
|
|
24218
|
-
const defaultProps$
|
|
24142
|
+
const defaultProps$f = {
|
|
24219
24143
|
direction: "horizontal"
|
|
24220
24144
|
};
|
|
24221
24145
|
const SwiperItem = React.forwardRef((props, ref) => {
|
|
24222
|
-
const _props = { ...defaultProps$
|
|
24146
|
+
const _props = { ...defaultProps$f, ...props };
|
|
24223
24147
|
const { className, style, children, direction, size } = _props;
|
|
24224
24148
|
const parent = React.useContext(DataContext$1);
|
|
24225
24149
|
const b = cn("swiper-item");
|
|
@@ -24235,16 +24159,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24235
24159
|
};
|
|
24236
24160
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, style: { ...style, ...getStyle() }, children });
|
|
24237
24161
|
});
|
|
24238
|
-
SwiperItem.defaultProps = defaultProps$
|
|
24162
|
+
SwiperItem.defaultProps = defaultProps$f;
|
|
24239
24163
|
SwiperItem.displayName = "NutSwiperItem";
|
|
24240
|
-
const defaultProps$
|
|
24164
|
+
const defaultProps$e = {
|
|
24241
24165
|
images: [],
|
|
24242
24166
|
videos: [],
|
|
24243
24167
|
show: false,
|
|
24244
|
-
|
|
24168
|
+
autoPlay: 3e3,
|
|
24245
24169
|
initNo: 1,
|
|
24246
24170
|
contentClose: false,
|
|
24247
|
-
|
|
24171
|
+
indicator: false,
|
|
24248
24172
|
paginationColor: "#fff",
|
|
24249
24173
|
onClose: () => {
|
|
24250
24174
|
}
|
|
@@ -24256,8 +24180,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24256
24180
|
show,
|
|
24257
24181
|
initNo,
|
|
24258
24182
|
paginationColor,
|
|
24259
|
-
|
|
24260
|
-
|
|
24183
|
+
indicator,
|
|
24184
|
+
autoPlay,
|
|
24261
24185
|
contentClose,
|
|
24262
24186
|
onClose
|
|
24263
24187
|
} = props;
|
|
@@ -24406,16 +24330,18 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24406
24330
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24407
24331
|
Swiper,
|
|
24408
24332
|
{
|
|
24409
|
-
autoPlay
|
|
24333
|
+
autoPlay,
|
|
24410
24334
|
className: "nut-imagepreview-swiper",
|
|
24411
24335
|
loop: true,
|
|
24412
|
-
|
|
24413
|
-
style: {
|
|
24336
|
+
preventDefault: false,
|
|
24337
|
+
style: {
|
|
24338
|
+
display: showPop ? "block" : "none",
|
|
24339
|
+
"--nutui-indicator-color": paginationColor
|
|
24340
|
+
},
|
|
24414
24341
|
direction: "horizontal",
|
|
24415
24342
|
onChange: slideChangeEnd,
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
paginationVisible,
|
|
24343
|
+
defaultValue: innerNo && (innerNo > maxNo ? maxNo - 1 : innerNo - 1),
|
|
24344
|
+
indicator,
|
|
24419
24345
|
children: (videos && videos.length > 0 ? videos.map((item, index) => {
|
|
24420
24346
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SwiperItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Video, { source: item.source, options: item.options }) }, index);
|
|
24421
24347
|
}) : []).concat(
|
|
@@ -24443,41 +24369,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24443
24369
|
}
|
|
24444
24370
|
);
|
|
24445
24371
|
};
|
|
24446
|
-
ImagePreview.defaultProps = defaultProps$
|
|
24372
|
+
ImagePreview.defaultProps = defaultProps$e;
|
|
24447
24373
|
ImagePreview.displayName = "NutImagePreview";
|
|
24448
|
-
const defaultProps$e = {
|
|
24449
|
-
total: 3,
|
|
24450
|
-
current: 1,
|
|
24451
|
-
direction: "horizontal"
|
|
24452
|
-
};
|
|
24453
|
-
const classPrefix = `nut-indicator`;
|
|
24454
|
-
const Indicator = (props) => {
|
|
24455
|
-
const { total, current, children, className, direction, ...rest } = {
|
|
24456
|
-
...defaultProps$e,
|
|
24457
|
-
...props
|
|
24458
|
-
};
|
|
24459
|
-
const classes = classNames({
|
|
24460
|
-
[`${classPrefix}__vertical`]: direction === "vertical"
|
|
24461
|
-
});
|
|
24462
|
-
const renderElement = () => {
|
|
24463
|
-
const childs = [];
|
|
24464
|
-
for (let item = 1; item <= total; item++) {
|
|
24465
|
-
childs.push(
|
|
24466
|
-
item === current ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children || /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24467
|
-
"div",
|
|
24468
|
-
{
|
|
24469
|
-
className: `${classPrefix}__dot ${classPrefix}__active`
|
|
24470
|
-
},
|
|
24471
|
-
item
|
|
24472
|
-
) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix}__dot` }, item)
|
|
24473
|
-
);
|
|
24474
|
-
}
|
|
24475
|
-
return childs;
|
|
24476
|
-
};
|
|
24477
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(classes, className), ...rest, children: renderElement() });
|
|
24478
|
-
};
|
|
24479
|
-
Indicator.defaultProps = defaultProps$e;
|
|
24480
|
-
Indicator.displayName = "NutIndicator";
|
|
24481
24374
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
24482
24375
|
let index = 0;
|
|
24483
24376
|
const positions = Array(length);
|
|
@@ -24893,33 +24786,34 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24893
24786
|
Pagination.defaultProps = defaultProps$c;
|
|
24894
24787
|
Pagination.displayName = "NutPagination";
|
|
24895
24788
|
const defaultProps$b = {
|
|
24789
|
+
...ComponentDefaults,
|
|
24896
24790
|
price: 0,
|
|
24897
|
-
needSymbol: true,
|
|
24898
24791
|
symbol: "¥",
|
|
24899
|
-
|
|
24792
|
+
digits: 2,
|
|
24900
24793
|
thousands: false,
|
|
24901
24794
|
position: "before",
|
|
24902
24795
|
size: "large",
|
|
24903
|
-
|
|
24796
|
+
line: false
|
|
24904
24797
|
};
|
|
24905
24798
|
const Price = (props) => {
|
|
24906
24799
|
const {
|
|
24907
24800
|
price,
|
|
24908
|
-
needSymbol,
|
|
24909
24801
|
symbol,
|
|
24910
|
-
|
|
24802
|
+
digits,
|
|
24911
24803
|
thousands,
|
|
24912
24804
|
position,
|
|
24913
24805
|
size,
|
|
24806
|
+
line,
|
|
24914
24807
|
className,
|
|
24808
|
+
style,
|
|
24915
24809
|
...rest
|
|
24916
24810
|
} = {
|
|
24917
24811
|
...defaultProps$b,
|
|
24918
24812
|
...props
|
|
24919
24813
|
};
|
|
24920
|
-
const
|
|
24814
|
+
const classPrefix2 = "nut-price";
|
|
24921
24815
|
const showSymbol = () => {
|
|
24922
|
-
return { __html:
|
|
24816
|
+
return { __html: symbol || "" };
|
|
24923
24817
|
};
|
|
24924
24818
|
const checkPoint = (price2) => {
|
|
24925
24819
|
return String(price2).indexOf(".") > 0;
|
|
@@ -24929,7 +24823,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24929
24823
|
num = 0;
|
|
24930
24824
|
}
|
|
24931
24825
|
if (checkPoint(num)) {
|
|
24932
|
-
num = Number(num).toFixed(
|
|
24826
|
+
num = Number(num).toFixed(digits);
|
|
24933
24827
|
num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
|
|
24934
24828
|
} else {
|
|
24935
24829
|
num = num.toString();
|
|
@@ -24944,31 +24838,57 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24944
24838
|
decimalNum = 0;
|
|
24945
24839
|
}
|
|
24946
24840
|
if (checkPoint(decimalNum)) {
|
|
24947
|
-
decimalNum = Number(decimalNum).toFixed(
|
|
24841
|
+
decimalNum = Number(decimalNum).toFixed(digits);
|
|
24948
24842
|
decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] || 0;
|
|
24949
24843
|
} else {
|
|
24950
24844
|
decimalNum = 0;
|
|
24951
24845
|
}
|
|
24952
24846
|
const result = `0.${decimalNum}`;
|
|
24953
|
-
const resultFixed = Number(result).toFixed(
|
|
24847
|
+
const resultFixed = Number(result).toFixed(digits);
|
|
24954
24848
|
return String(resultFixed).substring(2, resultFixed.length);
|
|
24955
24849
|
};
|
|
24956
24850
|
const renderSymbol = () => {
|
|
24957
24851
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24958
24852
|
"div",
|
|
24959
24853
|
{
|
|
24960
|
-
className: `${
|
|
24854
|
+
className: `${classPrefix2}__symbol ${classPrefix2}__symbol-${size}`,
|
|
24961
24855
|
dangerouslySetInnerHTML: showSymbol()
|
|
24962
24856
|
}
|
|
24963
24857
|
);
|
|
24964
24858
|
};
|
|
24965
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24966
|
-
|
|
24967
|
-
|
|
24968
|
-
|
|
24969
|
-
|
|
24970
|
-
|
|
24971
|
-
|
|
24859
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24860
|
+
"div",
|
|
24861
|
+
{
|
|
24862
|
+
className: `${classPrefix2} ${className} ${line ? `${classPrefix2}--line` : ""}`,
|
|
24863
|
+
style,
|
|
24864
|
+
...rest,
|
|
24865
|
+
children: [
|
|
24866
|
+
symbol && position === "before" ? renderSymbol() : null,
|
|
24867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24868
|
+
"div",
|
|
24869
|
+
{
|
|
24870
|
+
className: `${classPrefix2}__integer ${classPrefix2}__integer-${size}`,
|
|
24871
|
+
children: formatThousands(price)
|
|
24872
|
+
}
|
|
24873
|
+
),
|
|
24874
|
+
digits !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24875
|
+
"div",
|
|
24876
|
+
{
|
|
24877
|
+
className: `${classPrefix2}__decimal ${classPrefix2}__decimal-${size}`,
|
|
24878
|
+
children: "."
|
|
24879
|
+
}
|
|
24880
|
+
) : null,
|
|
24881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24882
|
+
"div",
|
|
24883
|
+
{
|
|
24884
|
+
className: `${classPrefix2}__decimal ${classPrefix2}__decimal-${size}`,
|
|
24885
|
+
children: formatDecimal(price)
|
|
24886
|
+
}
|
|
24887
|
+
),
|
|
24888
|
+
symbol && position === "after" ? renderSymbol() : null
|
|
24889
|
+
]
|
|
24890
|
+
}
|
|
24891
|
+
);
|
|
24972
24892
|
};
|
|
24973
24893
|
Price.defaultProps = defaultProps$b;
|
|
24974
24894
|
Price.displayName = "NutPrice";
|