@nutui/nutui-react 2.0.0-alpha.8 → 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 +20 -0
- package/dist/esm/Audio.js +5 -5
- 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/Swiper.js +100 -111
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/radio2.js +52 -54
- 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 +718 -742
- package/dist/nutui.react.umd.js +717 -741
- 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/swiper/swiper.scss +0 -15
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +50 -44
- package/dist/styles/variables.scss +50 -46
- package/dist/types/index.d.ts +64 -80
- package/package.json +1 -1
- /package/dist/esm/{UserContext3.js → context2.js} +0 -0
package/dist/nutui.react.mjs
CHANGED
|
@@ -6,12 +6,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a;
|
|
8
8
|
/*!
|
|
9
|
-
* @nutui/nutui-react v2.0.0-alpha.
|
|
9
|
+
* @nutui/nutui-react v2.0.0-alpha.9 Wed May 17 2023 18:23:02 GMT+0800 (China Standard Time)
|
|
10
10
|
* (c) 2023 @jdf2e.
|
|
11
11
|
* Released under the MIT License.
|
|
12
12
|
*/
|
|
13
13
|
import * as React from "react";
|
|
14
|
-
import React__default, { useCallback, createContext, useMemo, useContext, useState, useRef, useEffect, useLayoutEffect, forwardRef, isValidElement, useImperativeHandle, Component, memo } from "react";
|
|
14
|
+
import React__default, { useCallback, createContext, useMemo, useContext, useState, useRef, useEffect, useLayoutEffect, forwardRef, isValidElement, useImperativeHandle, createElement, Component, memo } from "react";
|
|
15
15
|
import * as ReactDOM from "react-dom";
|
|
16
16
|
import ReactDOM__default, { unstable_batchedUpdates, createPortal } from "react-dom";
|
|
17
17
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -1643,7 +1643,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1643
1643
|
process.env.NODE_ENV === "production" ? h.exports = ur() : h.exports = sr();
|
|
1644
1644
|
})(ir);
|
|
1645
1645
|
const lr = D.Fragment, cr = D.jsx, vr = D.jsxs;
|
|
1646
|
-
const a$
|
|
1646
|
+
const a$w = {
|
|
1647
1647
|
className: "",
|
|
1648
1648
|
style: void 0,
|
|
1649
1649
|
name: "ArrowDown2",
|
|
@@ -1651,8 +1651,8 @@ const a$v = {
|
|
|
1651
1651
|
height: "",
|
|
1652
1652
|
onClick: () => {
|
|
1653
1653
|
}
|
|
1654
|
-
}, y$
|
|
1655
|
-
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$
|
|
1654
|
+
}, y$9 = (h) => {
|
|
1655
|
+
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$w, ...h }, f = (t) => {
|
|
1656
1656
|
n && n(t);
|
|
1657
1657
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
1658
1658
|
const t = "nut-icon";
|
|
@@ -1689,8 +1689,8 @@ const a$v = {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
) });
|
|
1691
1691
|
};
|
|
1692
|
-
y$
|
|
1693
|
-
const a$
|
|
1692
|
+
y$9.defaultProps = a$w;
|
|
1693
|
+
const a$v = {
|
|
1694
1694
|
className: "",
|
|
1695
1695
|
style: void 0,
|
|
1696
1696
|
name: "ArrowUp2",
|
|
@@ -1699,7 +1699,7 @@ const a$u = {
|
|
|
1699
1699
|
onClick: () => {
|
|
1700
1700
|
}
|
|
1701
1701
|
}, x$g = (h) => {
|
|
1702
|
-
const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$
|
|
1702
|
+
const { className: o, style: p, name: e, color: d, width: m, height: f, onClick: n } = { ...a$v, ...h }, g = (t) => {
|
|
1703
1703
|
n && n(t);
|
|
1704
1704
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", w = () => {
|
|
1705
1705
|
const t = "nut-icon";
|
|
@@ -1736,8 +1736,8 @@ const a$u = {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
) });
|
|
1738
1738
|
};
|
|
1739
|
-
x$g.defaultProps = a$
|
|
1740
|
-
const a$
|
|
1739
|
+
x$g.defaultProps = a$v;
|
|
1740
|
+
const a$u = {
|
|
1741
1741
|
className: "",
|
|
1742
1742
|
style: void 0,
|
|
1743
1743
|
name: "CheckChecked",
|
|
@@ -1745,8 +1745,8 @@ const a$t = {
|
|
|
1745
1745
|
height: "",
|
|
1746
1746
|
onClick: () => {
|
|
1747
1747
|
}
|
|
1748
|
-
}, y$
|
|
1749
|
-
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$
|
|
1748
|
+
}, y$8 = (h) => {
|
|
1749
|
+
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$u, ...h }, C = (t) => {
|
|
1750
1750
|
o && o(t);
|
|
1751
1751
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
|
|
1752
1752
|
const t = "nut-icon";
|
|
@@ -1794,8 +1794,8 @@ const a$t = {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
) });
|
|
1796
1796
|
};
|
|
1797
|
-
y$
|
|
1798
|
-
const a$
|
|
1797
|
+
y$8.defaultProps = a$u;
|
|
1798
|
+
const a$t = {
|
|
1799
1799
|
className: "",
|
|
1800
1800
|
style: void 0,
|
|
1801
1801
|
name: "CheckDisabled",
|
|
@@ -1804,7 +1804,7 @@ const a$s = {
|
|
|
1804
1804
|
onClick: () => {
|
|
1805
1805
|
}
|
|
1806
1806
|
}, x$f = (h) => {
|
|
1807
|
-
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$
|
|
1807
|
+
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$t, ...h }, g = (t) => {
|
|
1808
1808
|
o && o(t);
|
|
1809
1809
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
1810
1810
|
const t = "nut-icon";
|
|
@@ -1841,8 +1841,8 @@ const a$s = {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
) });
|
|
1843
1843
|
};
|
|
1844
|
-
x$f.defaultProps = a$
|
|
1845
|
-
const a$
|
|
1844
|
+
x$f.defaultProps = a$t;
|
|
1845
|
+
const a$s = {
|
|
1846
1846
|
className: "",
|
|
1847
1847
|
style: void 0,
|
|
1848
1848
|
name: "CheckNormal",
|
|
@@ -1851,7 +1851,7 @@ const a$r = {
|
|
|
1851
1851
|
onClick: () => {
|
|
1852
1852
|
}
|
|
1853
1853
|
}, N = (h) => {
|
|
1854
|
-
const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$
|
|
1854
|
+
const { className: o, style: m, name: e, color: d, width: p, height: C, onClick: r } = { ...a$s, ...h }, f = (t) => {
|
|
1855
1855
|
r && r(t);
|
|
1856
1856
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
1857
1857
|
const t = "nut-icon";
|
|
@@ -1888,8 +1888,8 @@ const a$r = {
|
|
|
1888
1888
|
}
|
|
1889
1889
|
) });
|
|
1890
1890
|
};
|
|
1891
|
-
N.defaultProps = a$
|
|
1892
|
-
const a$
|
|
1891
|
+
N.defaultProps = a$s;
|
|
1892
|
+
const a$r = {
|
|
1893
1893
|
className: "",
|
|
1894
1894
|
style: void 0,
|
|
1895
1895
|
name: "Check",
|
|
@@ -1898,7 +1898,7 @@ const a$q = {
|
|
|
1898
1898
|
onClick: () => {
|
|
1899
1899
|
}
|
|
1900
1900
|
}, x$e = (h) => {
|
|
1901
|
-
const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$
|
|
1901
|
+
const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: r } = { ...a$r, ...h }, g = (t) => {
|
|
1902
1902
|
r && r(t);
|
|
1903
1903
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
1904
1904
|
const t = "nut-icon";
|
|
@@ -1935,8 +1935,8 @@ const a$q = {
|
|
|
1935
1935
|
}
|
|
1936
1936
|
) });
|
|
1937
1937
|
};
|
|
1938
|
-
x$e.defaultProps = a$
|
|
1939
|
-
const a$
|
|
1938
|
+
x$e.defaultProps = a$r;
|
|
1939
|
+
const a$q = {
|
|
1940
1940
|
className: "",
|
|
1941
1941
|
style: void 0,
|
|
1942
1942
|
name: "Checked",
|
|
@@ -1945,7 +1945,7 @@ const a$p = {
|
|
|
1945
1945
|
onClick: () => {
|
|
1946
1946
|
}
|
|
1947
1947
|
}, x$d = (h) => {
|
|
1948
|
-
const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$
|
|
1948
|
+
const { className: o, style: d, name: e, color: m, width: p, height: C, onClick: r } = { ...a$q, ...h }, f = (t) => {
|
|
1949
1949
|
r && r(t);
|
|
1950
1950
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
1951
1951
|
const t = "nut-icon";
|
|
@@ -1982,8 +1982,8 @@ const a$p = {
|
|
|
1982
1982
|
}
|
|
1983
1983
|
) });
|
|
1984
1984
|
};
|
|
1985
|
-
x$d.defaultProps = a$
|
|
1986
|
-
const a$
|
|
1985
|
+
x$d.defaultProps = a$q;
|
|
1986
|
+
const a$p = {
|
|
1987
1987
|
className: "",
|
|
1988
1988
|
style: void 0,
|
|
1989
1989
|
name: "Checklist",
|
|
@@ -1992,7 +1992,7 @@ const a$o = {
|
|
|
1992
1992
|
onClick: () => {
|
|
1993
1993
|
}
|
|
1994
1994
|
}, x$c = (h) => {
|
|
1995
|
-
const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$
|
|
1995
|
+
const { className: i, style: d, name: e, color: p, width: m, height: f, onClick: o } = { ...a$p, ...h }, g = (t) => {
|
|
1996
1996
|
o && o(t);
|
|
1997
1997
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
|
|
1998
1998
|
const t = "nut-icon";
|
|
@@ -2029,8 +2029,8 @@ const a$o = {
|
|
|
2029
2029
|
}
|
|
2030
2030
|
) });
|
|
2031
2031
|
};
|
|
2032
|
-
x$c.defaultProps = a$
|
|
2033
|
-
const a$
|
|
2032
|
+
x$c.defaultProps = a$p;
|
|
2033
|
+
const a$o = {
|
|
2034
2034
|
className: "",
|
|
2035
2035
|
style: void 0,
|
|
2036
2036
|
name: "CircleClose",
|
|
@@ -2039,7 +2039,7 @@ const a$n = {
|
|
|
2039
2039
|
onClick: () => {
|
|
2040
2040
|
}
|
|
2041
2041
|
}, x$b = (h) => {
|
|
2042
|
-
const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$
|
|
2042
|
+
const { className: l2, style: m, name: e, color: d, width: p, height: C, onClick: o } = { ...a$o, ...h }, f = (t) => {
|
|
2043
2043
|
o && o(t);
|
|
2044
2044
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2045
2045
|
const t = "nut-icon";
|
|
@@ -2076,8 +2076,8 @@ const a$n = {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
) });
|
|
2078
2078
|
};
|
|
2079
|
-
x$b.defaultProps = a$
|
|
2080
|
-
const a$
|
|
2079
|
+
x$b.defaultProps = a$o;
|
|
2080
|
+
const a$n = {
|
|
2081
2081
|
className: "",
|
|
2082
2082
|
style: void 0,
|
|
2083
2083
|
name: "Close",
|
|
@@ -2086,7 +2086,7 @@ const a$m = {
|
|
|
2086
2086
|
onClick: () => {
|
|
2087
2087
|
}
|
|
2088
2088
|
}, x$a = (h) => {
|
|
2089
|
-
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2089
|
+
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$n, ...h }, g = (t) => {
|
|
2090
2090
|
r && r(t);
|
|
2091
2091
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
2092
2092
|
const t = "nut-icon";
|
|
@@ -2123,8 +2123,8 @@ const a$m = {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
) });
|
|
2125
2125
|
};
|
|
2126
|
-
x$a.defaultProps = a$
|
|
2127
|
-
const a$
|
|
2126
|
+
x$a.defaultProps = a$n;
|
|
2127
|
+
const a$m = {
|
|
2128
2128
|
className: "",
|
|
2129
2129
|
style: void 0,
|
|
2130
2130
|
name: "Del",
|
|
@@ -2132,8 +2132,8 @@ const a$l = {
|
|
|
2132
2132
|
height: "",
|
|
2133
2133
|
onClick: () => {
|
|
2134
2134
|
}
|
|
2135
|
-
}, y$
|
|
2136
|
-
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2135
|
+
}, y$7 = (h) => {
|
|
2136
|
+
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$m, ...h }, g = (t) => {
|
|
2137
2137
|
r && r(t);
|
|
2138
2138
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2139
2139
|
const t = "nut-icon";
|
|
@@ -2170,8 +2170,8 @@ const a$l = {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
) });
|
|
2172
2172
|
};
|
|
2173
|
-
y$
|
|
2174
|
-
const a$
|
|
2173
|
+
y$7.defaultProps = a$m;
|
|
2174
|
+
const a$l = {
|
|
2175
2175
|
className: "",
|
|
2176
2176
|
style: void 0,
|
|
2177
2177
|
name: "DownArrow",
|
|
@@ -2180,7 +2180,7 @@ const a$k = {
|
|
|
2180
2180
|
onClick: () => {
|
|
2181
2181
|
}
|
|
2182
2182
|
}, x$9 = (h) => {
|
|
2183
|
-
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$
|
|
2183
|
+
const { className: r, style: d, name: e, color: p, width: m, height: w, onClick: n } = { ...a$l, ...h }, f = (t) => {
|
|
2184
2184
|
n && n(t);
|
|
2185
2185
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2186
2186
|
const t = "nut-icon";
|
|
@@ -2217,8 +2217,8 @@ const a$k = {
|
|
|
2217
2217
|
}
|
|
2218
2218
|
) });
|
|
2219
2219
|
};
|
|
2220
|
-
x$9.defaultProps = a$
|
|
2221
|
-
const a$
|
|
2220
|
+
x$9.defaultProps = a$l;
|
|
2221
|
+
const a$k = {
|
|
2222
2222
|
className: "",
|
|
2223
2223
|
style: void 0,
|
|
2224
2224
|
name: "Failure",
|
|
@@ -2227,7 +2227,7 @@ const a$j = {
|
|
|
2227
2227
|
onClick: () => {
|
|
2228
2228
|
}
|
|
2229
2229
|
}, x$8 = (h) => {
|
|
2230
|
-
const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$
|
|
2230
|
+
const { className: r, style: d, name: e, color: m, width: p, height: f, onClick: l2 } = { ...a$k, ...h }, u = (t) => {
|
|
2231
2231
|
l2 && l2(t);
|
|
2232
2232
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2233
2233
|
const t = "nut-icon";
|
|
@@ -2264,8 +2264,8 @@ const a$j = {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
) });
|
|
2266
2266
|
};
|
|
2267
|
-
x$8.defaultProps = a$
|
|
2268
|
-
const a$
|
|
2267
|
+
x$8.defaultProps = a$k;
|
|
2268
|
+
const a$j = {
|
|
2269
2269
|
className: "",
|
|
2270
2270
|
style: void 0,
|
|
2271
2271
|
name: "ImageError",
|
|
@@ -2274,7 +2274,7 @@ const a$i = {
|
|
|
2274
2274
|
onClick: () => {
|
|
2275
2275
|
}
|
|
2276
2276
|
}, k$5 = (h) => {
|
|
2277
|
-
const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$
|
|
2277
|
+
const { className: s, style: d, name: e, color: m, width: p, height: f, onClick: o } = { ...a$j, ...h }, g = (t) => {
|
|
2278
2278
|
o && o(t);
|
|
2279
2279
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2280
2280
|
const t = "nut-icon";
|
|
@@ -2322,8 +2322,8 @@ const a$i = {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
) });
|
|
2324
2324
|
};
|
|
2325
|
-
k$5.defaultProps = a$
|
|
2326
|
-
const a$
|
|
2325
|
+
k$5.defaultProps = a$j;
|
|
2326
|
+
const a$i = {
|
|
2327
2327
|
className: "",
|
|
2328
2328
|
style: void 0,
|
|
2329
2329
|
name: "Image",
|
|
@@ -2332,7 +2332,7 @@ const a$h = {
|
|
|
2332
2332
|
onClick: () => {
|
|
2333
2333
|
}
|
|
2334
2334
|
}, k$4 = (h) => {
|
|
2335
|
-
const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2335
|
+
const { className: l2, style: d, name: c, color: m, width: p, height: f, onClick: r } = { ...a$i, ...h }, g = (t) => {
|
|
2336
2336
|
r && r(t);
|
|
2337
2337
|
}, o = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2338
2338
|
const t = "nut-icon";
|
|
@@ -2380,8 +2380,8 @@ const a$h = {
|
|
|
2380
2380
|
}
|
|
2381
2381
|
) });
|
|
2382
2382
|
};
|
|
2383
|
-
k$4.defaultProps = a$
|
|
2384
|
-
const a$
|
|
2383
|
+
k$4.defaultProps = a$i;
|
|
2384
|
+
const a$h = {
|
|
2385
2385
|
className: "",
|
|
2386
2386
|
style: void 0,
|
|
2387
2387
|
name: "JoySmile",
|
|
@@ -2390,7 +2390,7 @@ const a$g = {
|
|
|
2390
2390
|
onClick: () => {
|
|
2391
2391
|
}
|
|
2392
2392
|
}, x$7 = (h) => {
|
|
2393
|
-
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2393
|
+
const { className: i, style: d, name: e, color: m, width: p, height: f, onClick: r } = { ...a$h, ...h }, g = (t) => {
|
|
2394
2394
|
r && r(t);
|
|
2395
2395
|
}, c = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2396
2396
|
const t = "nut-icon";
|
|
@@ -2427,8 +2427,8 @@ const a$g = {
|
|
|
2427
2427
|
}
|
|
2428
2428
|
) });
|
|
2429
2429
|
};
|
|
2430
|
-
x$7.defaultProps = a$
|
|
2431
|
-
const a$
|
|
2430
|
+
x$7.defaultProps = a$h;
|
|
2431
|
+
const a$g = {
|
|
2432
2432
|
className: "",
|
|
2433
2433
|
style: void 0,
|
|
2434
2434
|
name: "Left",
|
|
@@ -2436,8 +2436,8 @@ const a$f = {
|
|
|
2436
2436
|
height: "",
|
|
2437
2437
|
onClick: () => {
|
|
2438
2438
|
}
|
|
2439
|
-
}, y$
|
|
2440
|
-
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$
|
|
2439
|
+
}, y$6 = (h) => {
|
|
2440
|
+
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$g, ...h }, g = (t) => {
|
|
2441
2441
|
n && n(t);
|
|
2442
2442
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2443
2443
|
const t = "nut-icon";
|
|
@@ -2474,8 +2474,8 @@ const a$f = {
|
|
|
2474
2474
|
}
|
|
2475
2475
|
) });
|
|
2476
2476
|
};
|
|
2477
|
-
y$
|
|
2478
|
-
const a$
|
|
2477
|
+
y$6.defaultProps = a$g;
|
|
2478
|
+
const a$f = {
|
|
2479
2479
|
className: "",
|
|
2480
2480
|
style: void 0,
|
|
2481
2481
|
name: "Link",
|
|
@@ -2484,7 +2484,7 @@ const a$e = {
|
|
|
2484
2484
|
onClick: () => {
|
|
2485
2485
|
}
|
|
2486
2486
|
}, x$6 = (h) => {
|
|
2487
|
-
const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$
|
|
2487
|
+
const { className: s, style: d, name: c, color: m, width: p, height: f, onClick: n } = { ...a$f, ...h }, g = (t) => {
|
|
2488
2488
|
n && n(t);
|
|
2489
2489
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", k2 = () => {
|
|
2490
2490
|
const t = "nut-icon";
|
|
@@ -2521,8 +2521,8 @@ const a$e = {
|
|
|
2521
2521
|
}
|
|
2522
2522
|
) });
|
|
2523
2523
|
};
|
|
2524
|
-
x$6.defaultProps = a$
|
|
2525
|
-
const a$
|
|
2524
|
+
x$6.defaultProps = a$f;
|
|
2525
|
+
const a$e = {
|
|
2526
2526
|
className: "",
|
|
2527
2527
|
style: void 0,
|
|
2528
2528
|
name: "Loading",
|
|
@@ -2531,7 +2531,7 @@ const a$d = {
|
|
|
2531
2531
|
onClick: () => {
|
|
2532
2532
|
}
|
|
2533
2533
|
}, k$3 = (h) => {
|
|
2534
|
-
const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$
|
|
2534
|
+
const { className: l2, style: m, name: t, color: d, width: p, height: g, onClick: o } = { ...a$e, ...h }, f = (c) => {
|
|
2535
2535
|
o && o(c);
|
|
2536
2536
|
}, n = (c) => c === "" ? "" : isNaN(Number(c)) ? String(c) : c + "px", z = () => {
|
|
2537
2537
|
const c = "nut-icon";
|
|
@@ -2568,8 +2568,8 @@ const a$d = {
|
|
|
2568
2568
|
}
|
|
2569
2569
|
) });
|
|
2570
2570
|
};
|
|
2571
|
-
k$3.defaultProps = a$
|
|
2572
|
-
const a$
|
|
2571
|
+
k$3.defaultProps = a$e;
|
|
2572
|
+
const a$d = {
|
|
2573
2573
|
className: "",
|
|
2574
2574
|
style: void 0,
|
|
2575
2575
|
name: "Location2",
|
|
@@ -2578,7 +2578,7 @@ const a$c = {
|
|
|
2578
2578
|
onClick: () => {
|
|
2579
2579
|
}
|
|
2580
2580
|
}, x$5 = (h) => {
|
|
2581
|
-
const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$
|
|
2581
|
+
const { className: o, style: m, name: s, color: d, width: p, height: f, onClick: n } = { ...a$d, ...h }, g = (t) => {
|
|
2582
2582
|
n && n(t);
|
|
2583
2583
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
2584
2584
|
const t = "nut-icon";
|
|
@@ -2615,8 +2615,8 @@ const a$c = {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
) });
|
|
2617
2617
|
};
|
|
2618
|
-
x$5.defaultProps = a$
|
|
2619
|
-
const a$
|
|
2618
|
+
x$5.defaultProps = a$d;
|
|
2619
|
+
const a$c = {
|
|
2620
2620
|
className: "",
|
|
2621
2621
|
style: void 0,
|
|
2622
2622
|
name: "MaskClose",
|
|
@@ -2625,7 +2625,7 @@ const a$b = {
|
|
|
2625
2625
|
onClick: () => {
|
|
2626
2626
|
}
|
|
2627
2627
|
}, x$4 = (h) => {
|
|
2628
|
-
const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$
|
|
2628
|
+
const { className: c, style: d, name: s, color: m, width: p, height: f, onClick: l2 } = { ...a$c, ...h }, g = (t) => {
|
|
2629
2629
|
l2 && l2(t);
|
|
2630
2630
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", C = () => {
|
|
2631
2631
|
const t = "nut-icon";
|
|
@@ -2662,8 +2662,8 @@ const a$b = {
|
|
|
2662
2662
|
}
|
|
2663
2663
|
) });
|
|
2664
2664
|
};
|
|
2665
|
-
x$4.defaultProps = a$
|
|
2666
|
-
const a$
|
|
2665
|
+
x$4.defaultProps = a$c;
|
|
2666
|
+
const a$b = {
|
|
2667
2667
|
className: "",
|
|
2668
2668
|
style: void 0,
|
|
2669
2669
|
name: "Minus",
|
|
@@ -2671,8 +2671,8 @@ const a$a = {
|
|
|
2671
2671
|
height: "",
|
|
2672
2672
|
onClick: () => {
|
|
2673
2673
|
}
|
|
2674
|
-
}, y$
|
|
2675
|
-
const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$
|
|
2674
|
+
}, y$5 = (h) => {
|
|
2675
|
+
const { className: i, style: d, name: s, color: p, width: m, height: f, onClick: o } = { ...a$b, ...h }, u = (t) => {
|
|
2676
2676
|
o && o(t);
|
|
2677
2677
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2678
2678
|
const t = "nut-icon";
|
|
@@ -2709,8 +2709,8 @@ const a$a = {
|
|
|
2709
2709
|
}
|
|
2710
2710
|
) });
|
|
2711
2711
|
};
|
|
2712
|
-
y$
|
|
2713
|
-
const a$
|
|
2712
|
+
y$5.defaultProps = a$b;
|
|
2713
|
+
const a$a = {
|
|
2714
2714
|
className: "",
|
|
2715
2715
|
style: void 0,
|
|
2716
2716
|
name: "My",
|
|
@@ -2719,7 +2719,7 @@ const a$9 = {
|
|
|
2719
2719
|
onClick: () => {
|
|
2720
2720
|
}
|
|
2721
2721
|
}, k$2 = (h) => {
|
|
2722
|
-
const { className: o, style: d, name: s, color: m, width: p, height: f, onClick: r } = { ...a$
|
|
2722
|
+
const { className: o, style: d, name: s, color: m, width: p, height: f, onClick: r } = { ...a$a, ...h }, g = (t) => {
|
|
2723
2723
|
r && r(t);
|
|
2724
2724
|
}, n = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2725
2725
|
const t = "nut-icon";
|
|
@@ -2756,8 +2756,8 @@ const a$9 = {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
) });
|
|
2758
2758
|
};
|
|
2759
|
-
k$2.defaultProps = a$
|
|
2760
|
-
const a$
|
|
2759
|
+
k$2.defaultProps = a$a;
|
|
2760
|
+
const a$9 = {
|
|
2761
2761
|
className: "",
|
|
2762
2762
|
style: void 0,
|
|
2763
2763
|
name: "Notice",
|
|
@@ -2766,7 +2766,7 @@ const a$8 = {
|
|
|
2766
2766
|
onClick: () => {
|
|
2767
2767
|
}
|
|
2768
2768
|
}, k$1 = (h) => {
|
|
2769
|
-
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: i } = { ...a$
|
|
2769
|
+
const { className: o, style: d, name: e, color: m, width: p, height: f, onClick: i } = { ...a$9, ...h }, g = (t) => {
|
|
2770
2770
|
i && i(t);
|
|
2771
2771
|
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", u = () => {
|
|
2772
2772
|
const t = "nut-icon";
|
|
@@ -2803,7 +2803,7 @@ const a$8 = {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
) });
|
|
2805
2805
|
};
|
|
2806
|
-
k$1.defaultProps = a$
|
|
2806
|
+
k$1.defaultProps = a$9;
|
|
2807
2807
|
const l = {
|
|
2808
2808
|
className: "",
|
|
2809
2809
|
style: void 0,
|
|
@@ -2851,7 +2851,7 @@ const l = {
|
|
|
2851
2851
|
) });
|
|
2852
2852
|
};
|
|
2853
2853
|
x$3.defaultProps = l;
|
|
2854
|
-
const a$
|
|
2854
|
+
const a$8 = {
|
|
2855
2855
|
className: "",
|
|
2856
2856
|
style: void 0,
|
|
2857
2857
|
name: "Plus",
|
|
@@ -2859,8 +2859,8 @@ const a$7 = {
|
|
|
2859
2859
|
height: "",
|
|
2860
2860
|
onClick: () => {
|
|
2861
2861
|
}
|
|
2862
|
-
}, y$
|
|
2863
|
-
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$
|
|
2862
|
+
}, y$4 = (h) => {
|
|
2863
|
+
const { className: r, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$8, ...h }, u = (t) => {
|
|
2864
2864
|
n && n(t);
|
|
2865
2865
|
}, i = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", g = () => {
|
|
2866
2866
|
const t = "nut-icon";
|
|
@@ -2897,6 +2897,53 @@ const a$7 = {
|
|
|
2897
2897
|
}
|
|
2898
2898
|
) });
|
|
2899
2899
|
};
|
|
2900
|
+
y$4.defaultProps = a$8;
|
|
2901
|
+
const a$7 = {
|
|
2902
|
+
className: "",
|
|
2903
|
+
style: void 0,
|
|
2904
|
+
name: "RectDown",
|
|
2905
|
+
width: "",
|
|
2906
|
+
height: "",
|
|
2907
|
+
onClick: () => {
|
|
2908
|
+
}
|
|
2909
|
+
}, y$3 = (h) => {
|
|
2910
|
+
const { className: o, style: d, name: e, color: p, width: m, height: f, onClick: n } = { ...a$7, ...h }, g = (t) => {
|
|
2911
|
+
n && n(t);
|
|
2912
|
+
}, r = (t) => t === "" ? "" : isNaN(Number(t)) ? String(t) : t + "px", w = () => {
|
|
2913
|
+
const t = "nut-icon";
|
|
2914
|
+
return classNames({
|
|
2915
|
+
[`${o}`]: o,
|
|
2916
|
+
[t]: true,
|
|
2917
|
+
[t + "-" + e]: e
|
|
2918
|
+
});
|
|
2919
|
+
}, s = {}, i = r(m || ""), l2 = r(f || "");
|
|
2920
|
+
i && (s.width = i), l2 && (s.height = l2);
|
|
2921
|
+
const u = () => ({
|
|
2922
|
+
...d,
|
|
2923
|
+
...s
|
|
2924
|
+
});
|
|
2925
|
+
return /* @__PURE__ */ cr(lr, { children: /* @__PURE__ */ cr(
|
|
2926
|
+
"svg",
|
|
2927
|
+
{
|
|
2928
|
+
className: w(),
|
|
2929
|
+
style: u(),
|
|
2930
|
+
onClick: g,
|
|
2931
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2932
|
+
color: p,
|
|
2933
|
+
viewBox: "0 0 1024 1024",
|
|
2934
|
+
"aria-labelledby": e,
|
|
2935
|
+
role: "presentation",
|
|
2936
|
+
children: /* @__PURE__ */ cr(
|
|
2937
|
+
"path",
|
|
2938
|
+
{
|
|
2939
|
+
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",
|
|
2940
|
+
fill: "currentColor",
|
|
2941
|
+
fillOpacity: "0.9"
|
|
2942
|
+
}
|
|
2943
|
+
)
|
|
2944
|
+
}
|
|
2945
|
+
) });
|
|
2946
|
+
};
|
|
2900
2947
|
y$3.defaultProps = a$7;
|
|
2901
2948
|
const a$6 = {
|
|
2902
2949
|
className: "",
|
|
@@ -3332,7 +3379,7 @@ const defaultProps$1r = {
|
|
|
3332
3379
|
onClick: (event) => {
|
|
3333
3380
|
}
|
|
3334
3381
|
};
|
|
3335
|
-
const classPrefix$
|
|
3382
|
+
const classPrefix$i = "nut-cell";
|
|
3336
3383
|
const Cell = (props) => {
|
|
3337
3384
|
const {
|
|
3338
3385
|
children,
|
|
@@ -3363,24 +3410,24 @@ const Cell = (props) => {
|
|
|
3363
3410
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3364
3411
|
"div",
|
|
3365
3412
|
{
|
|
3366
|
-
className: classNames(classPrefix$
|
|
3413
|
+
className: classNames(classPrefix$i, className),
|
|
3367
3414
|
onClick: (event) => handleClick2(event),
|
|
3368
3415
|
style: baseStyle,
|
|
3369
3416
|
...rest,
|
|
3370
3417
|
children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
3371
|
-
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$
|
|
3372
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3373
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3418
|
+
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$i}__left`, children: [
|
|
3419
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$i}__title`, children: title }) : null,
|
|
3420
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$i}__description`, children: description }) : null
|
|
3374
3421
|
] }) : null,
|
|
3375
3422
|
extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3376
3423
|
"div",
|
|
3377
3424
|
{
|
|
3378
|
-
className: `${classPrefix$
|
|
3425
|
+
className: `${classPrefix$i}__extra`,
|
|
3379
3426
|
style: styles,
|
|
3380
3427
|
children: extra
|
|
3381
3428
|
}
|
|
3382
3429
|
) : null,
|
|
3383
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3430
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$i}__divider` })
|
|
3384
3431
|
] })
|
|
3385
3432
|
}
|
|
3386
3433
|
);
|
|
@@ -3393,19 +3440,19 @@ const defaultProps$1q = {
|
|
|
3393
3440
|
description: "",
|
|
3394
3441
|
divider: true
|
|
3395
3442
|
};
|
|
3396
|
-
const classPrefix$
|
|
3443
|
+
const classPrefix$h = "nut-cell-group";
|
|
3397
3444
|
const CellGroup = (props) => {
|
|
3398
3445
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
3399
3446
|
...defaultProps$1q,
|
|
3400
3447
|
...props
|
|
3401
3448
|
};
|
|
3402
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$
|
|
3403
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3404
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3449
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$h, className), ...rest, children: [
|
|
3450
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$h}__title`, children: title }) : null,
|
|
3451
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$h}__description`, children: description }) : null,
|
|
3405
3452
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3406
3453
|
"div",
|
|
3407
3454
|
{
|
|
3408
|
-
className: `${classPrefix$
|
|
3455
|
+
className: `${classPrefix$h}__wrap ${divider ? `${classPrefix$h}__wrap--divider` : ""}`,
|
|
3409
3456
|
children
|
|
3410
3457
|
}
|
|
3411
3458
|
)
|
|
@@ -3883,7 +3930,7 @@ const defaultProps$1o = {
|
|
|
3883
3930
|
loading: true,
|
|
3884
3931
|
lazy: false
|
|
3885
3932
|
};
|
|
3886
|
-
const classPrefix$
|
|
3933
|
+
const classPrefix$g = "nut-image";
|
|
3887
3934
|
const Image$1 = (props) => {
|
|
3888
3935
|
const {
|
|
3889
3936
|
className,
|
|
@@ -3935,7 +3982,6 @@ const Image$1 = (props) => {
|
|
|
3935
3982
|
};
|
|
3936
3983
|
const observer = useRef(null);
|
|
3937
3984
|
const initObserver = () => {
|
|
3938
|
-
const images = document.querySelectorAll(".nut-img.lazyload");
|
|
3939
3985
|
const options2 = {
|
|
3940
3986
|
threshold: [0],
|
|
3941
3987
|
// 交会处
|
|
@@ -3951,14 +3997,12 @@ const Image$1 = (props) => {
|
|
|
3951
3997
|
img.src = img.dataset.src;
|
|
3952
3998
|
img.removeAttribute("data-src");
|
|
3953
3999
|
}
|
|
3954
|
-
|
|
4000
|
+
resetObserver();
|
|
3955
4001
|
}, 300);
|
|
3956
4002
|
}
|
|
3957
4003
|
});
|
|
3958
4004
|
}, options2);
|
|
3959
|
-
|
|
3960
|
-
observer.current.observe(item);
|
|
3961
|
-
});
|
|
4005
|
+
observer.current.observe(imgRef.current);
|
|
3962
4006
|
};
|
|
3963
4007
|
const resetObserver = () => {
|
|
3964
4008
|
observer.current.disconnect && observer.current.disconnect();
|
|
@@ -3997,7 +4041,7 @@ const Image$1 = (props) => {
|
|
|
3997
4041
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
3998
4042
|
"div",
|
|
3999
4043
|
{
|
|
4000
|
-
className: classNames(classPrefix$
|
|
4044
|
+
className: classNames(classPrefix$g, className),
|
|
4001
4045
|
style: containerStyle,
|
|
4002
4046
|
onClick: (e) => {
|
|
4003
4047
|
imageClick(e);
|
|
@@ -4165,21 +4209,21 @@ const defaultProps$1m = {
|
|
|
4165
4209
|
contentPosition: "center",
|
|
4166
4210
|
direction: "horizontal"
|
|
4167
4211
|
};
|
|
4168
|
-
const classPrefix$
|
|
4212
|
+
const classPrefix$f = `nut-divider`;
|
|
4169
4213
|
const Divider = (props) => {
|
|
4170
4214
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
4171
4215
|
...defaultProps$1m,
|
|
4172
4216
|
...props
|
|
4173
4217
|
};
|
|
4174
4218
|
const classes = direction === "horizontal" ? classNames({
|
|
4175
|
-
[`${classPrefix$
|
|
4176
|
-
[`${classPrefix$
|
|
4177
|
-
[`${classPrefix$
|
|
4178
|
-
[`${classPrefix$
|
|
4179
|
-
[`${classPrefix$
|
|
4219
|
+
[`${classPrefix$f}`]: true,
|
|
4220
|
+
[`${classPrefix$f}__center`]: children,
|
|
4221
|
+
[`${classPrefix$f}__left`]: contentPosition === "left",
|
|
4222
|
+
[`${classPrefix$f}__right`]: contentPosition === "right",
|
|
4223
|
+
[`${classPrefix$f}__hairline`]: true
|
|
4180
4224
|
}) : classNames({
|
|
4181
|
-
[`${classPrefix$
|
|
4182
|
-
[`${classPrefix$
|
|
4225
|
+
[`${classPrefix$f}`]: true,
|
|
4226
|
+
[`${classPrefix$f}__vertical`]: direction === "vertical"
|
|
4183
4227
|
});
|
|
4184
4228
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
|
|
4185
4229
|
};
|
|
@@ -4340,7 +4384,7 @@ const Layout = (props) => {
|
|
|
4340
4384
|
};
|
|
4341
4385
|
Layout.defaultProps = defaultProps$1j;
|
|
4342
4386
|
Layout.displayName = "NutLayout";
|
|
4343
|
-
const classPrefix$
|
|
4387
|
+
const classPrefix$e = "nut-row";
|
|
4344
4388
|
const defaultProps$1i = {
|
|
4345
4389
|
...ComponentDefaults,
|
|
4346
4390
|
type: "",
|
|
@@ -4375,7 +4419,7 @@ const Row = (props) => {
|
|
|
4375
4419
|
${getClass("justify", justify)}
|
|
4376
4420
|
${getClass("align", align)}
|
|
4377
4421
|
${getClass("flex", wrap)}
|
|
4378
|
-
${classPrefix$
|
|
4422
|
+
${classPrefix$e}
|
|
4379
4423
|
`;
|
|
4380
4424
|
};
|
|
4381
4425
|
const parentRow = {
|
|
@@ -4474,7 +4518,7 @@ const defaultProps$1h = {
|
|
|
4474
4518
|
threshold: 0,
|
|
4475
4519
|
zIndex: 2e3
|
|
4476
4520
|
};
|
|
4477
|
-
const classPrefix$
|
|
4521
|
+
const classPrefix$d = "nut-sticky";
|
|
4478
4522
|
const Sticky = (props) => {
|
|
4479
4523
|
const {
|
|
4480
4524
|
position,
|
|
@@ -4596,7 +4640,7 @@ const Sticky = (props) => {
|
|
|
4596
4640
|
{
|
|
4597
4641
|
ref: rootRef,
|
|
4598
4642
|
style: { ...style, ...rootStyle },
|
|
4599
|
-
className: classNames(classPrefix$
|
|
4643
|
+
className: classNames(classPrefix$d, className),
|
|
4600
4644
|
...rest,
|
|
4601
4645
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle, children })
|
|
4602
4646
|
}
|
|
@@ -9845,7 +9889,8 @@ const defaultProps$1f = {
|
|
|
9845
9889
|
list: [],
|
|
9846
9890
|
sticky: false,
|
|
9847
9891
|
spaceHeight: 23,
|
|
9848
|
-
titleHeight: 35
|
|
9892
|
+
titleHeight: 35,
|
|
9893
|
+
showKeys: true
|
|
9849
9894
|
};
|
|
9850
9895
|
const Elevator = (props) => {
|
|
9851
9896
|
const {
|
|
@@ -9855,6 +9900,7 @@ const Elevator = (props) => {
|
|
|
9855
9900
|
sticky,
|
|
9856
9901
|
spaceHeight,
|
|
9857
9902
|
titleHeight,
|
|
9903
|
+
showKeys,
|
|
9858
9904
|
className,
|
|
9859
9905
|
style,
|
|
9860
9906
|
onClickItem,
|
|
@@ -10010,39 +10056,41 @@ const Elevator = (props) => {
|
|
|
10010
10056
|
}) })
|
|
10011
10057
|
}
|
|
10012
10058
|
),
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10059
|
+
showKeys ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10060
|
+
list.length && scrollStart ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10061
|
+
"div",
|
|
10062
|
+
{
|
|
10063
|
+
className: classNames({
|
|
10064
|
+
[`${classPrefix2}__code--current`]: true,
|
|
10065
|
+
[`${classPrefix2}__code--current--current`]: true
|
|
10066
|
+
}),
|
|
10067
|
+
children: list[codeIndex][floorKey]
|
|
10068
|
+
}
|
|
10069
|
+
) : null,
|
|
10070
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__bars`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10071
|
+
animated.div,
|
|
10072
|
+
{
|
|
10073
|
+
className: `${classPrefix2}__bars__inner`,
|
|
10074
|
+
...bind(),
|
|
10075
|
+
style: { touchAction: "pan-y" },
|
|
10076
|
+
children: list.map((item, index) => {
|
|
10077
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10078
|
+
"div",
|
|
10079
|
+
{
|
|
10080
|
+
className: classNames({
|
|
10081
|
+
[`${classPrefix2}__bars__inner__item`]: true,
|
|
10082
|
+
[`${classPrefix2}__bars__inner__item--active`]: item[floorKey] === list[currentIndex][floorKey]
|
|
10083
|
+
}),
|
|
10084
|
+
"data-index": index,
|
|
10085
|
+
onClick: () => handleClickIndex(item[floorKey]),
|
|
10086
|
+
children: item[floorKey]
|
|
10087
|
+
},
|
|
10088
|
+
index
|
|
10089
|
+
);
|
|
10090
|
+
})
|
|
10091
|
+
}
|
|
10092
|
+
) })
|
|
10093
|
+
] }) : null
|
|
10046
10094
|
] });
|
|
10047
10095
|
};
|
|
10048
10096
|
Elevator.defaultProps = defaultProps$1f;
|
|
@@ -10128,7 +10176,7 @@ const FixedNav = (props) => {
|
|
|
10128
10176
|
);
|
|
10129
10177
|
}) }) }),
|
|
10130
10178
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__btn`, onClick: () => onUpdateValue(), children: content || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10131
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
10179
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(y$6, { color: "#fff" }),
|
|
10132
10180
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text", children: visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText })
|
|
10133
10181
|
] }) })
|
|
10134
10182
|
]
|
|
@@ -12495,7 +12543,7 @@ const defaultProps$15 = {
|
|
|
12495
12543
|
duration: 300,
|
|
12496
12544
|
autoHeight: false
|
|
12497
12545
|
};
|
|
12498
|
-
const classPrefix$
|
|
12546
|
+
const classPrefix$c = "nut-tabs";
|
|
12499
12547
|
const Tabs = (props) => {
|
|
12500
12548
|
const {
|
|
12501
12549
|
activeColor,
|
|
@@ -12589,14 +12637,14 @@ const Tabs = (props) => {
|
|
|
12589
12637
|
}
|
|
12590
12638
|
}, [children]);
|
|
12591
12639
|
const classes = classNames(
|
|
12592
|
-
classPrefix$
|
|
12593
|
-
`${classPrefix$
|
|
12640
|
+
classPrefix$c,
|
|
12641
|
+
`${classPrefix$c}--${direction}`,
|
|
12594
12642
|
className
|
|
12595
12643
|
);
|
|
12596
|
-
const classesTitle = classNames(`${classPrefix$
|
|
12597
|
-
[`${classPrefix$
|
|
12598
|
-
[`${classPrefix$
|
|
12599
|
-
[`${classPrefix$
|
|
12644
|
+
const classesTitle = classNames(`${classPrefix$c}__titles`, {
|
|
12645
|
+
[`${classPrefix$c}__titles--${activeType}`]: activeType,
|
|
12646
|
+
[`${classPrefix$c}__titles--scrollable`]: true,
|
|
12647
|
+
[`${classPrefix$c}__titles--${align}`]: align
|
|
12600
12648
|
});
|
|
12601
12649
|
const tabsActiveStyle = {
|
|
12602
12650
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -12627,7 +12675,7 @@ const Tabs = (props) => {
|
|
|
12627
12675
|
onClick: () => {
|
|
12628
12676
|
tabChange(item);
|
|
12629
12677
|
},
|
|
12630
|
-
className: classNames(`${classPrefix$
|
|
12678
|
+
className: classNames(`${classPrefix$c}__titles-item`, {
|
|
12631
12679
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
12632
12680
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
12633
12681
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -12637,14 +12685,14 @@ const Tabs = (props) => {
|
|
|
12637
12685
|
activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12638
12686
|
"div",
|
|
12639
12687
|
{
|
|
12640
|
-
className: `${classPrefix$
|
|
12688
|
+
className: `${classPrefix$c}__titles-item__line`,
|
|
12641
12689
|
style: tabsActiveStyle
|
|
12642
12690
|
}
|
|
12643
12691
|
),
|
|
12644
12692
|
activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12645
12693
|
"div",
|
|
12646
12694
|
{
|
|
12647
|
-
className: `${classPrefix$
|
|
12695
|
+
className: `${classPrefix$c}__titles-item__smile`,
|
|
12648
12696
|
style: tabsActiveStyle,
|
|
12649
12697
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(x$7, { color: activeColor, width: 40, height: 20 })
|
|
12650
12698
|
}
|
|
@@ -12656,7 +12704,7 @@ const Tabs = (props) => {
|
|
|
12656
12704
|
{
|
|
12657
12705
|
ellipsis: true
|
|
12658
12706
|
},
|
|
12659
|
-
`${classPrefix$
|
|
12707
|
+
`${classPrefix$c}__titles-item__text`
|
|
12660
12708
|
),
|
|
12661
12709
|
children: item.title
|
|
12662
12710
|
}
|
|
@@ -12666,7 +12714,7 @@ const Tabs = (props) => {
|
|
|
12666
12714
|
item.value
|
|
12667
12715
|
);
|
|
12668
12716
|
}) }),
|
|
12669
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
12717
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$c}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$c}__content`, style: contentStyle, children: React__default.Children.map(children, (child, idx) => {
|
|
12670
12718
|
if (!React__default.isValidElement(child)) {
|
|
12671
12719
|
return null;
|
|
12672
12720
|
}
|
|
@@ -13302,7 +13350,7 @@ const Address = (props) => {
|
|
|
13302
13350
|
};
|
|
13303
13351
|
const headerRender = () => {
|
|
13304
13352
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: b("header"), children: [
|
|
13305
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "arrow-back", onClick: onSwitchModule, children: privateType === "custom" && (React__default.isValidElement(backBtnIcon) ? backBtnIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
13353
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "arrow-back", onClick: onSwitchModule, children: privateType === "custom" && (React__default.isValidElement(backBtnIcon) ? backBtnIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(y$6, { color: "#cccccc" })) }),
|
|
13306
13354
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("header__title"), children: privateType === "custom" ? customAddressTitle || locale.address.selectRegion : existAddressTitle || locale.address.deliveryTo }),
|
|
13307
13355
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: () => handClose(), children: React__default.isValidElement(closeBtnIcon) ? closeBtnIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(x$b, { width: 18, height: 18, color: "#ccc" }) })
|
|
13308
13356
|
] });
|
|
@@ -14792,7 +14840,7 @@ const defaultProps$Z = {
|
|
|
14792
14840
|
},
|
|
14793
14841
|
options: []
|
|
14794
14842
|
};
|
|
14795
|
-
const classPrefix$
|
|
14843
|
+
const classPrefix$b = "nut-checkboxgroup";
|
|
14796
14844
|
const CheckboxGroup = React__default.forwardRef(
|
|
14797
14845
|
(props, ref) => {
|
|
14798
14846
|
const { children } = { ...defaultProps$Z, ...props };
|
|
@@ -14873,7 +14921,7 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
14873
14921
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14874
14922
|
"div",
|
|
14875
14923
|
{
|
|
14876
|
-
className: classNames(classPrefix$
|
|
14924
|
+
className: classNames(classPrefix$b, {
|
|
14877
14925
|
[`nut-checkboxgroup--${props.direction}`]: props.direction,
|
|
14878
14926
|
className
|
|
14879
14927
|
}),
|
|
@@ -14897,7 +14945,7 @@ const defaultProps$Y = {
|
|
|
14897
14945
|
onChange: (value) => {
|
|
14898
14946
|
}
|
|
14899
14947
|
};
|
|
14900
|
-
const classPrefix$
|
|
14948
|
+
const classPrefix$a = "nut-checkbox";
|
|
14901
14949
|
const Checkbox = (props) => {
|
|
14902
14950
|
const { children } = {
|
|
14903
14951
|
...defaultProps$Y,
|
|
@@ -14959,22 +15007,22 @@ const Checkbox = (props) => {
|
|
|
14959
15007
|
};
|
|
14960
15008
|
const color = () => {
|
|
14961
15009
|
if (innerDisabled) {
|
|
14962
|
-
return `${classPrefix$
|
|
15010
|
+
return `${classPrefix$a}__icon--disable`;
|
|
14963
15011
|
}
|
|
14964
15012
|
if (innerChecked) {
|
|
14965
15013
|
if (innerIndeterminate) {
|
|
14966
|
-
return `${classPrefix$
|
|
15014
|
+
return `${classPrefix$a}__icon--indeterminate`;
|
|
14967
15015
|
}
|
|
14968
|
-
return `${classPrefix$
|
|
15016
|
+
return `${classPrefix$a}__icon`;
|
|
14969
15017
|
}
|
|
14970
|
-
return `${classPrefix$
|
|
15018
|
+
return `${classPrefix$a}__icon--unchecked`;
|
|
14971
15019
|
};
|
|
14972
15020
|
const renderLabel = () => {
|
|
14973
15021
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14974
15022
|
"span",
|
|
14975
15023
|
{
|
|
14976
|
-
className: classNames(`${classPrefix$
|
|
14977
|
-
[`${classPrefix$
|
|
15024
|
+
className: classNames(`${classPrefix$a}__label `, {
|
|
15025
|
+
[`${classPrefix$a}__label--disabled`]: innerDisabled
|
|
14978
15026
|
}),
|
|
14979
15027
|
children: children || label
|
|
14980
15028
|
}
|
|
@@ -14993,8 +15041,8 @@ const Checkbox = (props) => {
|
|
|
14993
15041
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14994
15042
|
"div",
|
|
14995
15043
|
{
|
|
14996
|
-
className: classNames(classPrefix$
|
|
14997
|
-
[`${classPrefix$
|
|
15044
|
+
className: classNames(classPrefix$a, className, {
|
|
15045
|
+
[`${classPrefix$a}--reverse`]: labelPosition === "left"
|
|
14998
15046
|
}),
|
|
14999
15047
|
...rest,
|
|
15000
15048
|
onClick: handleClick2,
|
|
@@ -17445,7 +17493,7 @@ const defaultProps$S = {
|
|
|
17445
17493
|
digits: 0,
|
|
17446
17494
|
async: false
|
|
17447
17495
|
};
|
|
17448
|
-
const classPrefix$
|
|
17496
|
+
const classPrefix$9 = `nut-inputnumber`;
|
|
17449
17497
|
const InputNumber = (props) => {
|
|
17450
17498
|
const {
|
|
17451
17499
|
children,
|
|
@@ -17474,7 +17522,7 @@ const InputNumber = (props) => {
|
|
|
17474
17522
|
...props
|
|
17475
17523
|
};
|
|
17476
17524
|
const inputRef = useRef("");
|
|
17477
|
-
|
|
17525
|
+
const [_checked, setChecked] = usePropsValue({
|
|
17478
17526
|
value,
|
|
17479
17527
|
defaultValue
|
|
17480
17528
|
});
|
|
@@ -17488,8 +17536,8 @@ const InputNumber = (props) => {
|
|
|
17488
17536
|
}, []);
|
|
17489
17537
|
const classes = classNames(
|
|
17490
17538
|
{
|
|
17491
|
-
[`${classPrefix$
|
|
17492
|
-
[`${classPrefix$
|
|
17539
|
+
[`${classPrefix$9}`]: true,
|
|
17540
|
+
[`${classPrefix$9}--disabled`]: disabled
|
|
17493
17541
|
},
|
|
17494
17542
|
className
|
|
17495
17543
|
);
|
|
@@ -17635,7 +17683,7 @@ const InputNumber = (props) => {
|
|
|
17635
17683
|
};
|
|
17636
17684
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style: styles, ...restProps, children: [
|
|
17637
17685
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-minus", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17638
|
-
y$
|
|
17686
|
+
y$5,
|
|
17639
17687
|
{
|
|
17640
17688
|
className: iconMinusClasses,
|
|
17641
17689
|
onClick: (e) => reduceNumber(e)
|
|
@@ -17668,7 +17716,7 @@ const InputNumber = (props) => {
|
|
|
17668
17716
|
onFocus: focusValue
|
|
17669
17717
|
}
|
|
17670
17718
|
) }),
|
|
17671
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
17719
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(y$4, { className: iconAddClasses, onClick: (e) => addNumber(e) }) })
|
|
17672
17720
|
] });
|
|
17673
17721
|
};
|
|
17674
17722
|
InputNumber.defaultProps = defaultProps$S;
|
|
@@ -17782,7 +17830,7 @@ const Menu = (props) => {
|
|
|
17782
17830
|
}),
|
|
17783
17831
|
children: [
|
|
17784
17832
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-menu__title-text", children: finallyTitle() }),
|
|
17785
|
-
icon || (direction === "up" ? /* @__PURE__ */ jsxRuntimeExports.jsx(x$g, { className: "nut-menu__title-icon" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
17833
|
+
icon || (direction === "up" ? /* @__PURE__ */ jsxRuntimeExports.jsx(x$g, { className: "nut-menu__title-icon" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$9, { className: "nut-menu__title-icon" }))
|
|
17786
17834
|
]
|
|
17787
17835
|
}
|
|
17788
17836
|
)
|
|
@@ -18005,15 +18053,11 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
18005
18053
|
MenuItem.defaultProps = defaultProps$Q;
|
|
18006
18054
|
MenuItem.displayName = "NutMenuItem";
|
|
18007
18055
|
const defaultProps$P = {
|
|
18008
|
-
|
|
18009
|
-
title: "",
|
|
18056
|
+
...ComponentDefaults,
|
|
18010
18057
|
visible: false,
|
|
18011
|
-
overlay: true,
|
|
18012
18058
|
type: "default",
|
|
18013
|
-
|
|
18014
|
-
|
|
18015
|
-
randomKeys: false,
|
|
18016
|
-
popClass: "",
|
|
18059
|
+
custom: [],
|
|
18060
|
+
random: false,
|
|
18017
18061
|
onClose: () => {
|
|
18018
18062
|
}
|
|
18019
18063
|
};
|
|
@@ -18023,307 +18067,229 @@ const NumberKeyboard = (props) => {
|
|
|
18023
18067
|
title,
|
|
18024
18068
|
confirmText,
|
|
18025
18069
|
visible,
|
|
18026
|
-
overlay,
|
|
18027
18070
|
type: type4,
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
popClass,
|
|
18071
|
+
custom,
|
|
18072
|
+
random,
|
|
18031
18073
|
style,
|
|
18032
18074
|
className,
|
|
18033
18075
|
onChange,
|
|
18034
18076
|
onDelete,
|
|
18035
|
-
onClose
|
|
18077
|
+
onClose,
|
|
18078
|
+
onConfirm,
|
|
18079
|
+
...rest
|
|
18036
18080
|
} = props;
|
|
18037
|
-
const
|
|
18038
|
-
const [show, setShow] = useState(visible);
|
|
18039
|
-
const [clickKeyIndex, setClickKeyIndex] = useState(void 0);
|
|
18040
|
-
const [keysList, setKeysList] = useState([]);
|
|
18041
|
-
useEffect(() => {
|
|
18042
|
-
setShow(visible);
|
|
18043
|
-
}, [visible]);
|
|
18044
|
-
const defaultKey = () => {
|
|
18045
|
-
let leftBottomKey = {
|
|
18046
|
-
id: "lock",
|
|
18047
|
-
type: "lock"
|
|
18048
|
-
};
|
|
18049
|
-
if (customKey) {
|
|
18050
|
-
const customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
18051
|
-
if (customKeys.length > 0) {
|
|
18052
|
-
const newCustomKey = customKeys[0];
|
|
18053
|
-
leftBottomKey = {
|
|
18054
|
-
id: newCustomKey,
|
|
18055
|
-
type: "custom"
|
|
18056
|
-
};
|
|
18057
|
-
}
|
|
18058
|
-
}
|
|
18059
|
-
return [
|
|
18060
|
-
...getBasicKeys(),
|
|
18061
|
-
leftBottomKey,
|
|
18062
|
-
{ id: 0, type: "number" },
|
|
18063
|
-
{ id: "delete", type: "delete" }
|
|
18064
|
-
];
|
|
18065
|
-
};
|
|
18081
|
+
const classPrefix2 = "nut-numberkeyboard";
|
|
18066
18082
|
const getBasicKeys = () => {
|
|
18067
|
-
const keys =
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18073
|
-
|
|
18074
|
-
return keys;
|
|
18075
|
-
};
|
|
18076
|
-
const genCustomKeys = () => {
|
|
18077
|
-
const keys = getBasicKeys();
|
|
18078
|
-
if (!customKey)
|
|
18079
|
-
return [];
|
|
18080
|
-
let customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
18081
|
-
if (customKeys.length > 2) {
|
|
18082
|
-
customKeys = [customKeys[0], customKeys[1]];
|
|
18083
|
-
}
|
|
18084
|
-
if (customKeys.length === 2 && props.title && props.type !== "rightColumn") {
|
|
18085
|
-
customKeys = [customKeys[0]];
|
|
18086
|
-
}
|
|
18087
|
-
if (customKeys.length === 1) {
|
|
18088
|
-
if (props.title && props.type !== "rightColumn") {
|
|
18089
|
-
keys.push(
|
|
18090
|
-
{ id: customKeys[0], type: "custom" },
|
|
18091
|
-
{ id: 0, type: "number" },
|
|
18092
|
-
{ id: "delete", type: "delete" }
|
|
18093
|
-
);
|
|
18094
|
-
} else {
|
|
18095
|
-
keys.push(
|
|
18096
|
-
{ id: 0, type: "number" },
|
|
18097
|
-
{ id: customKeys[0], type: "custom" }
|
|
18098
|
-
);
|
|
18099
|
-
}
|
|
18100
|
-
} else if (customKeys.length === 2) {
|
|
18101
|
-
keys.push(
|
|
18102
|
-
{ id: customKeys[0], type: "custom" },
|
|
18103
|
-
{ id: 0, type: "number" },
|
|
18104
|
-
{ id: customKeys[1], type: "custom" }
|
|
18105
|
-
);
|
|
18106
|
-
}
|
|
18107
|
-
return keys;
|
|
18083
|
+
const keys = new Array(9).fill(0).map((_, index) => {
|
|
18084
|
+
return {
|
|
18085
|
+
id: String(index + 1),
|
|
18086
|
+
type: "num"
|
|
18087
|
+
};
|
|
18088
|
+
});
|
|
18089
|
+
return random ? keys.sort(() => Math.random() > 0.5 ? 1 : -1) : keys;
|
|
18108
18090
|
};
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
if (item.type === "number" || item.type === "custom") {
|
|
18120
|
-
onChange && onChange(item.id);
|
|
18121
|
-
}
|
|
18122
|
-
if (item.type === "lock") {
|
|
18123
|
-
onClose && onClose();
|
|
18091
|
+
const getCustomKeys = () => {
|
|
18092
|
+
const customKeys = [
|
|
18093
|
+
{ id: "close", type: "close" },
|
|
18094
|
+
{ id: "0", type: "num" },
|
|
18095
|
+
{ id: "delete", type: "delete" }
|
|
18096
|
+
];
|
|
18097
|
+
if (!custom)
|
|
18098
|
+
return customKeys;
|
|
18099
|
+
if (custom.length > 0) {
|
|
18100
|
+
customKeys[0] = { id: custom[0], type: "custom" };
|
|
18124
18101
|
}
|
|
18125
|
-
if (
|
|
18126
|
-
|
|
18102
|
+
if (custom.length > 1) {
|
|
18103
|
+
customKeys[2] = { id: custom[1], type: "custom" };
|
|
18127
18104
|
}
|
|
18105
|
+
return customKeys;
|
|
18128
18106
|
};
|
|
18129
|
-
const
|
|
18130
|
-
|
|
18107
|
+
const keysList = useMemo(() => {
|
|
18108
|
+
return [...getBasicKeys(), ...getCustomKeys()];
|
|
18109
|
+
}, [type4, random, custom]);
|
|
18110
|
+
const DeleteIcon = () => {
|
|
18111
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 1024 1024", width: "36", height: "36", children: [
|
|
18112
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18113
|
+
"path",
|
|
18114
|
+
{
|
|
18115
|
+
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",
|
|
18116
|
+
fill: "currentColor"
|
|
18117
|
+
}
|
|
18118
|
+
),
|
|
18119
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18120
|
+
"path",
|
|
18121
|
+
{
|
|
18122
|
+
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",
|
|
18123
|
+
fill: "currentColor"
|
|
18124
|
+
}
|
|
18125
|
+
)
|
|
18126
|
+
] });
|
|
18131
18127
|
};
|
|
18132
|
-
const
|
|
18133
|
-
|
|
18134
|
-
|
|
18128
|
+
const NumberKeyboardKey = (props2) => {
|
|
18129
|
+
const { item } = props2;
|
|
18130
|
+
const [active, setActive] = useState(false);
|
|
18131
|
+
const onTouchStart = () => {
|
|
18132
|
+
setActive(true);
|
|
18133
|
+
};
|
|
18134
|
+
const onTouchEnd = (item2) => {
|
|
18135
|
+
setActive(false);
|
|
18136
|
+
if (item2.type === "num" || item2.type === "custom") {
|
|
18137
|
+
onChange && onChange(item2.id);
|
|
18138
|
+
}
|
|
18139
|
+
if (item2.type === "close") {
|
|
18140
|
+
onClose && onClose();
|
|
18141
|
+
}
|
|
18142
|
+
if (item2.type === "delete") {
|
|
18143
|
+
onDelete && onDelete();
|
|
18144
|
+
}
|
|
18145
|
+
if (item2.type === "confirm") {
|
|
18146
|
+
onConfirm && onConfirm();
|
|
18147
|
+
}
|
|
18148
|
+
};
|
|
18149
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__body__wrapper`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18150
|
+
"div",
|
|
18151
|
+
{
|
|
18152
|
+
className: classNames({
|
|
18153
|
+
key: true,
|
|
18154
|
+
active,
|
|
18155
|
+
close: item.type === "close",
|
|
18156
|
+
delete: item.type === "delete",
|
|
18157
|
+
confirm: item.type === "confirm"
|
|
18158
|
+
}),
|
|
18159
|
+
onTouchStart: () => onTouchStart(),
|
|
18160
|
+
onTouchEnd: () => onTouchEnd(item),
|
|
18161
|
+
onTouchCancel: () => onTouchEnd(item),
|
|
18162
|
+
children: [
|
|
18163
|
+
(item.type === "num" || item.type === "custom") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item.id }),
|
|
18164
|
+
item.type === "delete" && /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteIcon, {}),
|
|
18165
|
+
item.type === "close" && /* @__PURE__ */ jsxRuntimeExports.jsx(y$3, { width: 25, height: 25 }),
|
|
18166
|
+
item.type === "confirm" && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: confirmText || locale.done })
|
|
18167
|
+
]
|
|
18168
|
+
}
|
|
18169
|
+
) }, item.id);
|
|
18135
18170
|
};
|
|
18136
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18171
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18137
18172
|
Popup,
|
|
18138
18173
|
{
|
|
18139
|
-
visible
|
|
18174
|
+
visible,
|
|
18140
18175
|
position: "bottom",
|
|
18141
|
-
className: popClass,
|
|
18142
18176
|
onClickOverlay: onClose,
|
|
18143
|
-
overlay,
|
|
18144
18177
|
onClickCloseIcon: onClose,
|
|
18145
18178
|
overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" },
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
{
|
|
18163
|
-
className: classNames({
|
|
18164
|
-
key: true,
|
|
18165
|
-
active: item.id === clickKeyIndex,
|
|
18166
|
-
lock: item.type === "lock",
|
|
18167
|
-
delete: item.type === "delete"
|
|
18168
|
-
}),
|
|
18169
|
-
onTouchStart: (event) => onTouchstart(item, event),
|
|
18170
|
-
onTouchMove,
|
|
18171
|
-
onTouchEnd,
|
|
18172
|
-
children: [
|
|
18173
|
-
item.type === "number" || item.type === "custom" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item.id }) : null,
|
|
18174
|
-
item.type === "lock" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18175
|
-
"img",
|
|
18176
|
-
{
|
|
18177
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png",
|
|
18178
|
-
alt: ""
|
|
18179
|
-
}
|
|
18180
|
-
) : null,
|
|
18181
|
-
item.type === "delete" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18182
|
-
"img",
|
|
18183
|
-
{
|
|
18184
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
18185
|
-
alt: ""
|
|
18186
|
-
}
|
|
18187
|
-
) : null
|
|
18188
|
-
]
|
|
18189
|
-
}
|
|
18190
|
-
)
|
|
18191
|
-
},
|
|
18192
|
-
index
|
|
18193
|
-
);
|
|
18179
|
+
...rest,
|
|
18180
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix2, className), style, children: [
|
|
18181
|
+
title && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__header`, children: [
|
|
18182
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `${classPrefix2}__header__title`, children: title }),
|
|
18183
|
+
type4 === "default" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18184
|
+
"span",
|
|
18185
|
+
{
|
|
18186
|
+
className: `${classPrefix2}__header__close`,
|
|
18187
|
+
onClick: onClose,
|
|
18188
|
+
children: locale.done
|
|
18189
|
+
}
|
|
18190
|
+
)
|
|
18191
|
+
] }),
|
|
18192
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__body`, children: [
|
|
18193
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__body__keys`, children: keysList == null ? void 0 : keysList.map((item) => {
|
|
18194
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(NumberKeyboardKey, { item }, item.id);
|
|
18194
18195
|
}) }),
|
|
18195
|
-
type4 === "rightColumn"
|
|
18196
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18197
|
-
|
|
18196
|
+
type4 === "rightColumn" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__sidebar`, children: [
|
|
18197
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18198
|
+
NumberKeyboardKey,
|
|
18198
18199
|
{
|
|
18199
|
-
|
|
18200
|
-
|
|
18201
|
-
|
|
18202
|
-
}
|
|
18203
|
-
|
|
18204
|
-
|
|
18205
|
-
|
|
18206
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18207
|
-
"img",
|
|
18208
|
-
{
|
|
18209
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
18210
|
-
alt: ""
|
|
18211
|
-
}
|
|
18212
|
-
)
|
|
18213
|
-
}
|
|
18214
|
-
) }),
|
|
18200
|
+
item: {
|
|
18201
|
+
id: "delete",
|
|
18202
|
+
type: "delete"
|
|
18203
|
+
}
|
|
18204
|
+
},
|
|
18205
|
+
"delete"
|
|
18206
|
+
),
|
|
18215
18207
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18216
|
-
|
|
18208
|
+
NumberKeyboardKey,
|
|
18217
18209
|
{
|
|
18218
|
-
|
|
18219
|
-
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
|
|
18223
|
-
|
|
18224
|
-
key: true,
|
|
18225
|
-
finish: true,
|
|
18226
|
-
activeFinsh: clickKeyIndex === "finish"
|
|
18227
|
-
}),
|
|
18228
|
-
children: confirmText || locale.done
|
|
18229
|
-
}
|
|
18230
|
-
)
|
|
18231
|
-
}
|
|
18210
|
+
item: {
|
|
18211
|
+
id: "confirm",
|
|
18212
|
+
type: "confirm"
|
|
18213
|
+
}
|
|
18214
|
+
},
|
|
18215
|
+
"confirm"
|
|
18232
18216
|
)
|
|
18233
|
-
] })
|
|
18217
|
+
] })
|
|
18234
18218
|
] })
|
|
18235
18219
|
] })
|
|
18236
18220
|
}
|
|
18237
|
-
)
|
|
18221
|
+
);
|
|
18238
18222
|
};
|
|
18239
18223
|
NumberKeyboard.defaultProps = defaultProps$P;
|
|
18240
18224
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
18241
|
-
const
|
|
18242
|
-
onChange: (val) => {
|
|
18243
|
-
}
|
|
18244
|
-
};
|
|
18245
|
-
const RadioContext = React__default.createContext(radioContext);
|
|
18225
|
+
const RadioContext = React__default.createContext(null);
|
|
18246
18226
|
const defaultProps$O = {
|
|
18247
|
-
|
|
18248
|
-
textPosition: "right",
|
|
18227
|
+
labelPosition: "right",
|
|
18249
18228
|
onChange: (value) => {
|
|
18250
18229
|
},
|
|
18251
18230
|
direction: "vertical",
|
|
18252
18231
|
options: []
|
|
18253
18232
|
};
|
|
18233
|
+
const classPrefix$8 = "nut-radiogroup";
|
|
18254
18234
|
const RadioGroup = React__default.forwardRef(
|
|
18255
18235
|
(props, ref) => {
|
|
18256
|
-
const { children } = { ...defaultProps$O, ...props };
|
|
18257
|
-
cn("RadioGroup");
|
|
18258
18236
|
const {
|
|
18237
|
+
children,
|
|
18259
18238
|
className,
|
|
18260
18239
|
value,
|
|
18240
|
+
defaultValue,
|
|
18261
18241
|
onChange,
|
|
18262
|
-
|
|
18242
|
+
labelPosition,
|
|
18263
18243
|
direction,
|
|
18264
18244
|
options: options2,
|
|
18245
|
+
disabled,
|
|
18265
18246
|
...rest
|
|
18266
|
-
} = props;
|
|
18267
|
-
const [val2State, setVal2State] =
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
return false;
|
|
18274
|
-
return val2State === child.props.value;
|
|
18275
|
-
}
|
|
18276
|
-
function validateChecked(value2) {
|
|
18277
|
-
if (val2State === null)
|
|
18278
|
-
return false;
|
|
18279
|
-
return val2State === value2;
|
|
18280
|
-
}
|
|
18281
|
-
function cloneChildren() {
|
|
18282
|
-
return React__default.Children.map(children, (child, index) => {
|
|
18283
|
-
const childChecked = validateChildChecked(child);
|
|
18284
|
-
if (child.type.displayName !== "NutRadio") {
|
|
18285
|
-
return React__default.cloneElement(child);
|
|
18286
|
-
}
|
|
18287
|
-
return React__default.cloneElement(child, {
|
|
18288
|
-
textPosition,
|
|
18289
|
-
checked: childChecked
|
|
18290
|
-
// onChange: handleChildChange,
|
|
18291
|
-
});
|
|
18292
|
-
});
|
|
18293
|
-
}
|
|
18247
|
+
} = { ...defaultProps$O, ...props };
|
|
18248
|
+
const [val2State, setVal2State] = usePropsValue({
|
|
18249
|
+
defaultValue: props.defaultValue,
|
|
18250
|
+
value: props.value,
|
|
18251
|
+
finalValue: "",
|
|
18252
|
+
onChange
|
|
18253
|
+
});
|
|
18294
18254
|
const renderOptionsChildren = useCallback(() => {
|
|
18295
|
-
return options2 == null ? void 0 : options2.map(({ label, value: value2, disabled, onChange: onChange2, ...rest2 }) => {
|
|
18296
|
-
|
|
18297
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18255
|
+
return options2 == null ? void 0 : options2.map(({ label, value: value2, disabled: disabled2, onChange: onChange2, ...rest2 }) => {
|
|
18256
|
+
return /* @__PURE__ */ createElement(
|
|
18298
18257
|
Radio,
|
|
18299
18258
|
{
|
|
18259
|
+
...rest2,
|
|
18260
|
+
key: value2 == null ? void 0 : value2.toString(),
|
|
18300
18261
|
children: label,
|
|
18301
18262
|
value: value2,
|
|
18302
|
-
disabled,
|
|
18263
|
+
disabled: disabled2,
|
|
18303
18264
|
onChange: onChange2,
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
},
|
|
18308
|
-
value2 == null ? void 0 : value2.toString()
|
|
18265
|
+
labelPosition,
|
|
18266
|
+
checked: value2 === val2State
|
|
18267
|
+
}
|
|
18309
18268
|
);
|
|
18310
18269
|
});
|
|
18311
|
-
}, [
|
|
18270
|
+
}, [options2]);
|
|
18312
18271
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18313
18272
|
RadioContext.Provider,
|
|
18314
18273
|
{
|
|
18315
18274
|
value: {
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18275
|
+
labelPosition: labelPosition || "right",
|
|
18276
|
+
disabled,
|
|
18277
|
+
value: val2State,
|
|
18278
|
+
check: (value2) => {
|
|
18279
|
+
setVal2State(value2);
|
|
18280
|
+
},
|
|
18281
|
+
uncheck: () => {
|
|
18282
|
+
setVal2State("");
|
|
18319
18283
|
}
|
|
18320
18284
|
},
|
|
18321
18285
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18322
18286
|
"div",
|
|
18323
18287
|
{
|
|
18324
|
-
className:
|
|
18288
|
+
className: classNames(classPrefix$8, className, {
|
|
18289
|
+
[`${classPrefix$8}--${props.direction}`]: props.direction
|
|
18290
|
+
}),
|
|
18325
18291
|
...rest,
|
|
18326
|
-
children: (options2 == null ? void 0 : options2.length) ? renderOptionsChildren() :
|
|
18292
|
+
children: (options2 == null ? void 0 : options2.length) ? renderOptionsChildren() : children
|
|
18327
18293
|
}
|
|
18328
18294
|
)
|
|
18329
18295
|
}
|
|
@@ -18334,52 +18300,64 @@ RadioGroup.defaultProps = defaultProps$O;
|
|
|
18334
18300
|
RadioGroup.displayName = "NutRadioGroup";
|
|
18335
18301
|
const defaultProps$N = {
|
|
18336
18302
|
...ComponentDefaults,
|
|
18337
|
-
className: "",
|
|
18338
|
-
style: {},
|
|
18339
18303
|
disabled: false,
|
|
18340
|
-
checked: false,
|
|
18341
18304
|
shape: "round",
|
|
18342
18305
|
value: "",
|
|
18343
|
-
|
|
18344
|
-
icon:
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
onChange: (e) => {
|
|
18306
|
+
labelPosition: "right",
|
|
18307
|
+
icon: null,
|
|
18308
|
+
activeIcon: null,
|
|
18309
|
+
onChange: (checked) => {
|
|
18348
18310
|
}
|
|
18349
18311
|
};
|
|
18350
18312
|
const Radio = (props) => {
|
|
18351
|
-
const
|
|
18352
|
-
...defaultProps$N,
|
|
18353
|
-
...props
|
|
18354
|
-
};
|
|
18313
|
+
const classPrefix2 = "nut-radio";
|
|
18355
18314
|
const {
|
|
18315
|
+
children,
|
|
18356
18316
|
className,
|
|
18357
|
-
|
|
18317
|
+
style,
|
|
18358
18318
|
checked,
|
|
18319
|
+
defaultChecked,
|
|
18359
18320
|
shape,
|
|
18360
|
-
textPosition,
|
|
18361
18321
|
value,
|
|
18362
18322
|
icon,
|
|
18363
|
-
|
|
18364
|
-
iconSize,
|
|
18323
|
+
activeIcon,
|
|
18365
18324
|
onChange,
|
|
18366
|
-
...
|
|
18367
|
-
} =
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18325
|
+
...others
|
|
18326
|
+
} = {
|
|
18327
|
+
...defaultProps$N,
|
|
18328
|
+
...props
|
|
18329
|
+
};
|
|
18330
|
+
let { labelPosition, disabled, ...rest } = others;
|
|
18331
|
+
let [checkedStatement, setCheckedStatement] = usePropsValue({
|
|
18332
|
+
value: checked,
|
|
18333
|
+
defaultValue: defaultChecked,
|
|
18334
|
+
finalValue: false,
|
|
18335
|
+
onChange
|
|
18336
|
+
});
|
|
18372
18337
|
const context = useContext(RadioContext);
|
|
18373
|
-
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18338
|
+
if (context) {
|
|
18339
|
+
checkedStatement = context.value === value;
|
|
18340
|
+
if (context.labelPosition !== void 0) {
|
|
18341
|
+
labelPosition = context.labelPosition;
|
|
18342
|
+
}
|
|
18343
|
+
if (context.disabled !== void 0) {
|
|
18344
|
+
disabled = context.disabled;
|
|
18345
|
+
}
|
|
18346
|
+
setCheckedStatement = (value2) => {
|
|
18347
|
+
if (value2) {
|
|
18348
|
+
context.check(props.value === void 0 ? "" : props.value);
|
|
18349
|
+
} else {
|
|
18350
|
+
context.uncheck();
|
|
18351
|
+
}
|
|
18352
|
+
};
|
|
18353
|
+
}
|
|
18378
18354
|
const renderLabel = () => {
|
|
18379
18355
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18380
18356
|
"div",
|
|
18381
18357
|
{
|
|
18382
|
-
className: `${
|
|
18358
|
+
className: classNames(`${classPrefix2}__label`, {
|
|
18359
|
+
[`${classPrefix2}__label--disabled`]: disabled
|
|
18360
|
+
}),
|
|
18383
18361
|
children
|
|
18384
18362
|
}
|
|
18385
18363
|
);
|
|
@@ -18388,40 +18366,40 @@ const Radio = (props) => {
|
|
|
18388
18366
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18389
18367
|
"div",
|
|
18390
18368
|
{
|
|
18391
|
-
className: `${
|
|
18369
|
+
className: classNames(`${classPrefix2}__button`, {
|
|
18370
|
+
[`${classPrefix2}__button--active`]: checkedStatement,
|
|
18371
|
+
[`${classPrefix2}__button--disabled`]: disabled
|
|
18372
|
+
}),
|
|
18392
18373
|
children
|
|
18393
18374
|
}
|
|
18394
18375
|
);
|
|
18395
18376
|
};
|
|
18396
18377
|
const color = () => {
|
|
18397
|
-
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
|
|
18401
|
-
|
|
18402
|
-
}
|
|
18403
|
-
return "nut-radio__icon--unchecked";
|
|
18378
|
+
return {
|
|
18379
|
+
[`${classPrefix2}__icon--disable`]: disabled,
|
|
18380
|
+
[`${classPrefix2}__icon`]: checkedStatement,
|
|
18381
|
+
[`${classPrefix2}__icon--unchecked`]: !checkedStatement
|
|
18382
|
+
};
|
|
18404
18383
|
};
|
|
18405
18384
|
const renderIcon = () => {
|
|
18406
|
-
const { icon: icon2,
|
|
18407
|
-
if (
|
|
18408
|
-
return React__default.isValidElement(
|
|
18409
|
-
...
|
|
18410
|
-
className: color()
|
|
18411
|
-
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$
|
|
18385
|
+
const { icon: icon2, activeIcon: activeIcon2 } = props;
|
|
18386
|
+
if (checkedStatement) {
|
|
18387
|
+
return React__default.isValidElement(activeIcon2) ? React__default.cloneElement(activeIcon2, {
|
|
18388
|
+
...activeIcon2.props,
|
|
18389
|
+
className: classNames(color())
|
|
18390
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(y$8, { className: classNames(color()) });
|
|
18412
18391
|
}
|
|
18413
18392
|
return React__default.isValidElement(icon2) ? React__default.cloneElement(icon2, {
|
|
18414
18393
|
...icon2.props,
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { width: iconSize2, height: iconSize2, className: color() });
|
|
18394
|
+
className: classNames(color())
|
|
18395
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(N, { className: classNames(color()) });
|
|
18418
18396
|
};
|
|
18419
|
-
const
|
|
18397
|
+
const reverse = labelPosition === "left";
|
|
18420
18398
|
const renderRadioItem = () => {
|
|
18421
18399
|
if (shape === "button") {
|
|
18422
18400
|
return renderButton();
|
|
18423
18401
|
}
|
|
18424
|
-
if (
|
|
18402
|
+
if (reverse) {
|
|
18425
18403
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18426
18404
|
renderLabel(),
|
|
18427
18405
|
renderIcon()
|
|
@@ -18433,16 +18411,15 @@ const Radio = (props) => {
|
|
|
18433
18411
|
] });
|
|
18434
18412
|
};
|
|
18435
18413
|
const handleClick2 = (e) => {
|
|
18436
|
-
if (
|
|
18414
|
+
if (disabled || checkedStatement)
|
|
18437
18415
|
return;
|
|
18438
18416
|
setCheckedStatement(!checkedStatement);
|
|
18439
|
-
onChange && onChange(e);
|
|
18440
|
-
context && context.onChange(valueStatement);
|
|
18441
18417
|
};
|
|
18442
18418
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18443
18419
|
"div",
|
|
18444
18420
|
{
|
|
18445
|
-
className:
|
|
18421
|
+
className: `${classPrefix2} ${className} ${reverse ? `${classPrefix2}--reverse` : ""}`,
|
|
18422
|
+
style,
|
|
18446
18423
|
onClick: handleClick2,
|
|
18447
18424
|
...rest,
|
|
18448
18425
|
children: renderRadioItem()
|
|
@@ -18451,7 +18428,7 @@ const Radio = (props) => {
|
|
|
18451
18428
|
};
|
|
18452
18429
|
Radio.defaultProps = defaultProps$N;
|
|
18453
18430
|
Radio.displayName = "NutRadio";
|
|
18454
|
-
Radio.
|
|
18431
|
+
Radio.Group = RadioGroup;
|
|
18455
18432
|
const defaultProps$M = {
|
|
18456
18433
|
...ComponentDefaults,
|
|
18457
18434
|
range: false,
|
|
@@ -20111,7 +20088,7 @@ const InternalUploader = (props, ref) => {
|
|
|
20111
20088
|
}
|
|
20112
20089
|
),
|
|
20113
20090
|
deletable && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20114
|
-
y$
|
|
20091
|
+
y$7,
|
|
20115
20092
|
{
|
|
20116
20093
|
color: "#808080",
|
|
20117
20094
|
className: "nut-uploader__preview-img__file__del",
|
|
@@ -20683,7 +20660,7 @@ const defaultProps$A = {
|
|
|
20683
20660
|
imageSize: "",
|
|
20684
20661
|
status: "empty"
|
|
20685
20662
|
};
|
|
20686
|
-
const classPrefix$
|
|
20663
|
+
const classPrefix$7 = `nut-empty`;
|
|
20687
20664
|
const Empty = (props) => {
|
|
20688
20665
|
const { locale } = useConfig();
|
|
20689
20666
|
const {
|
|
@@ -20718,9 +20695,9 @@ const Empty = (props) => {
|
|
|
20718
20695
|
};
|
|
20719
20696
|
});
|
|
20720
20697
|
}, [imageSize]);
|
|
20721
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
20722
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
20723
|
-
typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
20698
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$7} ${className}`, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
20699
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$7}__image`, style: imgStyle, children: imageNode }),
|
|
20700
|
+
typeof description === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$7}__description`, children: description || locale.noData }) : description,
|
|
20724
20701
|
children
|
|
20725
20702
|
] }) });
|
|
20726
20703
|
};
|
|
@@ -21352,6 +21329,7 @@ const NoticeBar = (props) => {
|
|
|
21352
21329
|
};
|
|
21353
21330
|
NoticeBar.defaultProps = defaultProps$y;
|
|
21354
21331
|
NoticeBar.displayName = "NutNoticeBar";
|
|
21332
|
+
const classPrefix$6 = "nut-notify";
|
|
21355
21333
|
let Notification$1 = (_a = class extends React.PureComponent {
|
|
21356
21334
|
constructor(props) {
|
|
21357
21335
|
super(props);
|
|
@@ -21373,7 +21351,7 @@ let Notification$1 = (_a = class extends React.PureComponent {
|
|
|
21373
21351
|
const element = document.getElementById(this.props.id);
|
|
21374
21352
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
21375
21353
|
}
|
|
21376
|
-
this.props.
|
|
21354
|
+
this.props.onClose();
|
|
21377
21355
|
}
|
|
21378
21356
|
startCloseTimer() {
|
|
21379
21357
|
const { duration } = this.props;
|
|
@@ -21399,45 +21377,30 @@ let Notification$1 = (_a = class extends React.PureComponent {
|
|
|
21399
21377
|
this.clearCloseTimer();
|
|
21400
21378
|
}
|
|
21401
21379
|
render() {
|
|
21402
|
-
const {
|
|
21403
|
-
|
|
21404
|
-
style,
|
|
21405
|
-
msg,
|
|
21406
|
-
color,
|
|
21407
|
-
background,
|
|
21408
|
-
type: type4,
|
|
21409
|
-
className,
|
|
21410
|
-
position,
|
|
21411
|
-
isWrapTeleport
|
|
21412
|
-
} = this.props;
|
|
21413
|
-
this.state;
|
|
21414
|
-
cn("notify");
|
|
21380
|
+
const { style, message, type: type4, className, position } = this.props;
|
|
21381
|
+
const { show } = this.state;
|
|
21415
21382
|
const classes = classNames({
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
[
|
|
21383
|
+
[`${classPrefix$6}--popup-top`]: position === "top",
|
|
21384
|
+
[`${classPrefix$6}--popup-bottom`]: position === "bottom",
|
|
21385
|
+
[`${classPrefix$6}`]: true,
|
|
21386
|
+
[`${classPrefix$6}--${type4}`]: true
|
|
21420
21387
|
});
|
|
21421
21388
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21422
21389
|
CSSTransition$1,
|
|
21423
21390
|
{
|
|
21424
|
-
in:
|
|
21391
|
+
in: show,
|
|
21425
21392
|
timeout: 300,
|
|
21426
21393
|
classNames: "fade",
|
|
21427
21394
|
unmountOnExit: true,
|
|
21428
21395
|
appear: true,
|
|
21429
21396
|
position,
|
|
21430
|
-
isWrapTeleport,
|
|
21431
21397
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21432
21398
|
"div",
|
|
21433
21399
|
{
|
|
21434
21400
|
className: `${classes} ${className}`,
|
|
21435
|
-
style
|
|
21436
|
-
color: `${color || ""}`,
|
|
21437
|
-
background: `${background || ""}`
|
|
21438
|
-
},
|
|
21401
|
+
style,
|
|
21439
21402
|
onClick: this.clickCover,
|
|
21440
|
-
children:
|
|
21403
|
+
children: message
|
|
21441
21404
|
}
|
|
21442
21405
|
)
|
|
21443
21406
|
}
|
|
@@ -21460,7 +21423,7 @@ Notification$1.newInstance = (properties, callback) => {
|
|
|
21460
21423
|
component: instance,
|
|
21461
21424
|
destroy() {
|
|
21462
21425
|
setTimeout(() => {
|
|
21463
|
-
|
|
21426
|
+
unmount(element);
|
|
21464
21427
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
21465
21428
|
}, 300);
|
|
21466
21429
|
}
|
|
@@ -21470,15 +21433,13 @@ Notification$1.newInstance = (properties, callback) => {
|
|
|
21470
21433
|
};
|
|
21471
21434
|
let messageInstance$1 = null;
|
|
21472
21435
|
const options$1 = {
|
|
21473
|
-
|
|
21436
|
+
...ComponentDefaults,
|
|
21474
21437
|
id: "",
|
|
21475
21438
|
duration: 3e3,
|
|
21476
21439
|
// 时长
|
|
21477
|
-
color: "",
|
|
21478
21440
|
type: "danger",
|
|
21479
|
-
className: "",
|
|
21480
21441
|
position: "top",
|
|
21481
|
-
|
|
21442
|
+
onClose: () => {
|
|
21482
21443
|
},
|
|
21483
21444
|
onClick: () => {
|
|
21484
21445
|
}
|
|
@@ -21498,31 +21459,31 @@ function notice$1(opts) {
|
|
|
21498
21459
|
messageInstance$1 = notification;
|
|
21499
21460
|
});
|
|
21500
21461
|
}
|
|
21501
|
-
const errorMsg$1 = (
|
|
21502
|
-
if (!
|
|
21503
|
-
console.warn("[NutUI Notify]:
|
|
21462
|
+
const errorMsg$1 = (message) => {
|
|
21463
|
+
if (!message) {
|
|
21464
|
+
console.warn("[NutUI Notify]: message不能为空");
|
|
21504
21465
|
}
|
|
21505
21466
|
};
|
|
21506
21467
|
const Notify = {
|
|
21507
|
-
text(
|
|
21508
|
-
errorMsg$1(
|
|
21509
|
-
return notice$1({
|
|
21468
|
+
text(message, option = {}) {
|
|
21469
|
+
errorMsg$1(message);
|
|
21470
|
+
return notice$1({ message, type: "base", ...option });
|
|
21510
21471
|
},
|
|
21511
|
-
success(
|
|
21512
|
-
errorMsg$1(
|
|
21513
|
-
return notice$1({
|
|
21472
|
+
success(message, option = {}) {
|
|
21473
|
+
errorMsg$1(message);
|
|
21474
|
+
return notice$1({ message, type: "success", ...option });
|
|
21514
21475
|
},
|
|
21515
|
-
primary(
|
|
21516
|
-
errorMsg$1(
|
|
21517
|
-
return notice$1({
|
|
21476
|
+
primary(message, option = {}) {
|
|
21477
|
+
errorMsg$1(message);
|
|
21478
|
+
return notice$1({ message, type: "primary", ...option });
|
|
21518
21479
|
},
|
|
21519
|
-
danger(
|
|
21520
|
-
errorMsg$1(
|
|
21521
|
-
return notice$1({
|
|
21480
|
+
danger(message, option = {}) {
|
|
21481
|
+
errorMsg$1(message);
|
|
21482
|
+
return notice$1({ message, type: "danger", ...option });
|
|
21522
21483
|
},
|
|
21523
|
-
warn(
|
|
21524
|
-
errorMsg$1(
|
|
21525
|
-
return notice$1({
|
|
21484
|
+
warn(message, option = {}) {
|
|
21485
|
+
errorMsg$1(message);
|
|
21486
|
+
return notice$1({ message, type: "warning", ...option });
|
|
21526
21487
|
},
|
|
21527
21488
|
hide() {
|
|
21528
21489
|
if (messageInstance$1) {
|
|
@@ -21741,8 +21702,7 @@ if (canUseDom) {
|
|
|
21741
21702
|
}
|
|
21742
21703
|
}
|
|
21743
21704
|
const defaultProps$w = {
|
|
21744
|
-
|
|
21745
|
-
style: {},
|
|
21705
|
+
...ComponentDefaults,
|
|
21746
21706
|
pullingText: "",
|
|
21747
21707
|
canReleaseText: "",
|
|
21748
21708
|
refreshingText: "",
|
|
@@ -21755,6 +21715,7 @@ const defaultProps$w = {
|
|
|
21755
21715
|
}
|
|
21756
21716
|
};
|
|
21757
21717
|
const PullToRefresh = (p) => {
|
|
21718
|
+
const classPrefix2 = "nut-pulltorefresh";
|
|
21758
21719
|
const { locale } = useConfig();
|
|
21759
21720
|
const props = {
|
|
21760
21721
|
...defaultProps$w,
|
|
@@ -21886,18 +21847,18 @@ const PullToRefresh = (p) => {
|
|
|
21886
21847
|
animated.div,
|
|
21887
21848
|
{
|
|
21888
21849
|
ref: elementRef,
|
|
21889
|
-
className:
|
|
21850
|
+
className: `${classPrefix2} ${props.className}`,
|
|
21890
21851
|
style: props.style,
|
|
21891
21852
|
children: [
|
|
21892
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(animated.div, { style: springStyles, className:
|
|
21853
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(animated.div, { style: springStyles, className: `${classPrefix2}-head`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21893
21854
|
"div",
|
|
21894
21855
|
{
|
|
21895
|
-
className:
|
|
21856
|
+
className: `${classPrefix2}-head-content`,
|
|
21896
21857
|
style: { height: headHeight },
|
|
21897
21858
|
children: renderStatusText()
|
|
21898
21859
|
}
|
|
21899
21860
|
) }),
|
|
21900
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
21861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}-content`, children: props.children })
|
|
21901
21862
|
]
|
|
21902
21863
|
}
|
|
21903
21864
|
);
|
|
@@ -22644,7 +22605,7 @@ const defaultProps$p = {
|
|
|
22644
22605
|
...ComponentDefaults,
|
|
22645
22606
|
src: "",
|
|
22646
22607
|
muted: false,
|
|
22647
|
-
|
|
22608
|
+
autoPlay: false,
|
|
22648
22609
|
loop: false,
|
|
22649
22610
|
preload: "auto",
|
|
22650
22611
|
type: "progress",
|
|
@@ -22670,7 +22631,7 @@ const Audio = (props) => {
|
|
|
22670
22631
|
src,
|
|
22671
22632
|
style,
|
|
22672
22633
|
muted,
|
|
22673
|
-
|
|
22634
|
+
autoPlay,
|
|
22674
22635
|
loop: loop2,
|
|
22675
22636
|
preload,
|
|
22676
22637
|
type: type4,
|
|
@@ -22698,7 +22659,7 @@ const Audio = (props) => {
|
|
|
22698
22659
|
duration: "00:00:00",
|
|
22699
22660
|
second: 0,
|
|
22700
22661
|
hanMuted: props.muted,
|
|
22701
|
-
playing: props.
|
|
22662
|
+
playing: props.autoPlay,
|
|
22702
22663
|
handPlaying: false
|
|
22703
22664
|
});
|
|
22704
22665
|
const classPrefix2 = "nut-audio";
|
|
@@ -22864,7 +22825,7 @@ const Audio = (props) => {
|
|
|
22864
22825
|
};
|
|
22865
22826
|
const handleCanplay = (e) => {
|
|
22866
22827
|
setIsCanPlay(true);
|
|
22867
|
-
if (props.
|
|
22828
|
+
if (props.autoPlay && !playing) {
|
|
22868
22829
|
AudioRef && AudioRef.current && AudioRef.current.play();
|
|
22869
22830
|
}
|
|
22870
22831
|
if (AudioRef.current) {
|
|
@@ -23700,45 +23661,73 @@ Video.defaultProps = defaultProps$i;
|
|
|
23700
23661
|
Video.displayName = "NutVideo";
|
|
23701
23662
|
const DataContext$1 = createContext({});
|
|
23702
23663
|
const defaultProps$h = {
|
|
23664
|
+
total: 3,
|
|
23665
|
+
current: 0,
|
|
23666
|
+
direction: "horizontal"
|
|
23667
|
+
};
|
|
23668
|
+
const classPrefix = `nut-indicator`;
|
|
23669
|
+
const Indicator = (props) => {
|
|
23670
|
+
const { total, current, children, className, direction, ...rest } = {
|
|
23671
|
+
...defaultProps$h,
|
|
23672
|
+
...props
|
|
23673
|
+
};
|
|
23674
|
+
const classes = classNames({
|
|
23675
|
+
[`${classPrefix}__vertical`]: direction === "vertical"
|
|
23676
|
+
});
|
|
23677
|
+
const renderElement = () => {
|
|
23678
|
+
const childs = [];
|
|
23679
|
+
for (let item = 0; item < total; item++) {
|
|
23680
|
+
childs.push(
|
|
23681
|
+
item === current ? children || /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23682
|
+
"div",
|
|
23683
|
+
{
|
|
23684
|
+
className: `${classPrefix}__dot ${classPrefix}__active`
|
|
23685
|
+
},
|
|
23686
|
+
item
|
|
23687
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix}__dot` }, item)
|
|
23688
|
+
);
|
|
23689
|
+
}
|
|
23690
|
+
return childs;
|
|
23691
|
+
};
|
|
23692
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(classes, className), ...rest, children: renderElement() });
|
|
23693
|
+
};
|
|
23694
|
+
Indicator.defaultProps = defaultProps$h;
|
|
23695
|
+
Indicator.displayName = "NutIndicator";
|
|
23696
|
+
const defaultProps$g = {
|
|
23703
23697
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
23704
23698
|
height: 0,
|
|
23705
23699
|
duration: 500,
|
|
23706
|
-
|
|
23700
|
+
defaultValue: 0,
|
|
23707
23701
|
autoPlay: 0,
|
|
23708
23702
|
direction: "horizontal",
|
|
23709
|
-
|
|
23710
|
-
paginationBgColor: "#ddd",
|
|
23711
|
-
paginationVisible: false,
|
|
23703
|
+
indicator: false,
|
|
23712
23704
|
loop: true,
|
|
23713
23705
|
touchable: true,
|
|
23714
|
-
|
|
23715
|
-
|
|
23716
|
-
|
|
23706
|
+
preventDefault: true,
|
|
23707
|
+
stopPropagation: true,
|
|
23708
|
+
center: false,
|
|
23717
23709
|
className: ""
|
|
23718
23710
|
};
|
|
23719
23711
|
const DISTANCE = 5;
|
|
23720
23712
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
23721
|
-
const propSwiper = { ...defaultProps$
|
|
23713
|
+
const propSwiper = { ...defaultProps$g, ...props };
|
|
23722
23714
|
const {
|
|
23723
23715
|
children,
|
|
23724
23716
|
direction,
|
|
23725
23717
|
className,
|
|
23726
|
-
pageContent,
|
|
23727
23718
|
onChange,
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
paginationVisible,
|
|
23719
|
+
defaultValue,
|
|
23720
|
+
indicator,
|
|
23731
23721
|
touchable,
|
|
23732
|
-
|
|
23733
|
-
|
|
23722
|
+
preventDefault: preventDefault2,
|
|
23723
|
+
stopPropagation,
|
|
23734
23724
|
autoPlay,
|
|
23735
|
-
|
|
23736
|
-
paginationBgColor,
|
|
23725
|
+
center,
|
|
23737
23726
|
...rest
|
|
23738
23727
|
} = propSwiper;
|
|
23739
23728
|
const container = useRef(null);
|
|
23740
23729
|
const innerRef = useRef(null);
|
|
23741
|
-
const
|
|
23730
|
+
const swiperRef = useRef({
|
|
23742
23731
|
moving: false,
|
|
23743
23732
|
autoplayTimer: null,
|
|
23744
23733
|
width: 0,
|
|
@@ -23755,7 +23744,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23755
23744
|
const [childOffset, setChildOffset] = useState([]);
|
|
23756
23745
|
const [ready, setReady] = useState(false);
|
|
23757
23746
|
let size = isVertical ? height : width;
|
|
23758
|
-
const [touch
|
|
23747
|
+
const [touch] = useState({
|
|
23759
23748
|
startX: 0,
|
|
23760
23749
|
startY: 0,
|
|
23761
23750
|
deltaX: 0,
|
|
@@ -23792,20 +23781,20 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23792
23781
|
return 0;
|
|
23793
23782
|
})();
|
|
23794
23783
|
const stopAutoPlay = () => {
|
|
23795
|
-
clearTimeout(
|
|
23796
|
-
|
|
23784
|
+
clearTimeout(swiperRef.current.autoplayTimer);
|
|
23785
|
+
swiperRef.current.autoplayTimer = null;
|
|
23797
23786
|
};
|
|
23798
|
-
const
|
|
23787
|
+
const startPlay = () => {
|
|
23799
23788
|
if (propSwiper.autoPlay <= 0 || childCount <= 1)
|
|
23800
23789
|
return;
|
|
23801
23790
|
stopAutoPlay();
|
|
23802
|
-
|
|
23791
|
+
swiperRef.current.autoplayTimer = setTimeout(() => {
|
|
23803
23792
|
next();
|
|
23804
|
-
|
|
23793
|
+
startPlay();
|
|
23805
23794
|
}, Number(propSwiper.autoPlay));
|
|
23806
23795
|
};
|
|
23807
|
-
const
|
|
23808
|
-
|
|
23796
|
+
const resetPosition = () => {
|
|
23797
|
+
swiperRef.current.moving = true;
|
|
23809
23798
|
if (active <= -1) {
|
|
23810
23799
|
move({ pace: childCount });
|
|
23811
23800
|
}
|
|
@@ -23814,47 +23803,41 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23814
23803
|
}
|
|
23815
23804
|
};
|
|
23816
23805
|
const prev = () => {
|
|
23817
|
-
|
|
23818
|
-
|
|
23806
|
+
resetPosition();
|
|
23807
|
+
resetTouchDetails();
|
|
23819
23808
|
requestFrame(() => {
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
isEmit: true
|
|
23825
|
-
});
|
|
23809
|
+
swiperRef.current.moving = false;
|
|
23810
|
+
move({
|
|
23811
|
+
pace: -1,
|
|
23812
|
+
isEmit: true
|
|
23826
23813
|
});
|
|
23827
23814
|
});
|
|
23828
23815
|
};
|
|
23829
23816
|
const next = () => {
|
|
23830
|
-
|
|
23831
|
-
|
|
23817
|
+
resetPosition();
|
|
23818
|
+
resetTouchDetails();
|
|
23832
23819
|
requestFrame(() => {
|
|
23833
|
-
|
|
23834
|
-
|
|
23835
|
-
|
|
23836
|
-
|
|
23837
|
-
isEmit: true
|
|
23838
|
-
});
|
|
23820
|
+
swiperRef.current.moving = false;
|
|
23821
|
+
move({
|
|
23822
|
+
pace: 1,
|
|
23823
|
+
isEmit: true
|
|
23839
23824
|
});
|
|
23840
23825
|
});
|
|
23841
23826
|
};
|
|
23842
23827
|
const to2 = (index) => {
|
|
23843
|
-
|
|
23844
|
-
|
|
23828
|
+
resetPosition();
|
|
23829
|
+
resetTouchDetails();
|
|
23845
23830
|
requestFrame(() => {
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
|
|
23855
|
-
|
|
23856
|
-
isEmit: true
|
|
23857
|
-
});
|
|
23831
|
+
swiperRef.current.moving = false;
|
|
23832
|
+
let targetIndex;
|
|
23833
|
+
if (props.loop && childCount === index) {
|
|
23834
|
+
targetIndex = active === 0 ? 0 : index;
|
|
23835
|
+
} else {
|
|
23836
|
+
targetIndex = index % childCount;
|
|
23837
|
+
}
|
|
23838
|
+
move({
|
|
23839
|
+
pace: targetIndex - active,
|
|
23840
|
+
isEmit: true
|
|
23858
23841
|
});
|
|
23859
23842
|
});
|
|
23860
23843
|
};
|
|
@@ -23924,7 +23907,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23924
23907
|
return "vertical";
|
|
23925
23908
|
return "";
|
|
23926
23909
|
};
|
|
23927
|
-
const
|
|
23910
|
+
const resetTouchDetails = () => {
|
|
23928
23911
|
touch.startX = 0;
|
|
23929
23912
|
touch.startY = 0;
|
|
23930
23913
|
touch.deltaX = 0;
|
|
@@ -23936,11 +23919,11 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23936
23919
|
touch.touchTime = 0;
|
|
23937
23920
|
};
|
|
23938
23921
|
const touchStart = (e) => {
|
|
23939
|
-
|
|
23922
|
+
resetTouchDetails();
|
|
23940
23923
|
touch.startX = e.touches[0].clientX;
|
|
23941
23924
|
touch.startY = e.touches[0].clientY;
|
|
23942
23925
|
};
|
|
23943
|
-
const
|
|
23926
|
+
const handleTouchMove = (e) => {
|
|
23944
23927
|
touch.deltaX = e.touches[0].clientX - touch.startX;
|
|
23945
23928
|
touch.deltaY = e.touches[0].clientY - touch.startY;
|
|
23946
23929
|
touch.offsetX = Math.abs(touch.deltaX);
|
|
@@ -23950,42 +23933,41 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23950
23933
|
touch.stateDirection = getDirection2(touch.offsetX, touch.offsetY);
|
|
23951
23934
|
}
|
|
23952
23935
|
};
|
|
23953
|
-
const
|
|
23954
|
-
const classes = classNames(b(""));
|
|
23936
|
+
const classPrefix2 = "nut-swiper";
|
|
23955
23937
|
const contentClass = classNames({
|
|
23956
|
-
[`${
|
|
23957
|
-
[`${
|
|
23938
|
+
[`${classPrefix2}__inner`]: true,
|
|
23939
|
+
[`${classPrefix2}__vertical`]: isVertical
|
|
23958
23940
|
});
|
|
23959
23941
|
const getStyle = (moveOffset = offset) => {
|
|
23960
23942
|
const target = innerRef.current;
|
|
23961
23943
|
let _offset = 0;
|
|
23962
|
-
if (!
|
|
23944
|
+
if (!center) {
|
|
23963
23945
|
_offset = moveOffset;
|
|
23964
23946
|
} else {
|
|
23965
23947
|
const _size = isVertical ? height : width;
|
|
23966
23948
|
const val = isVertical ? rect.height - _size : rect.width - _size;
|
|
23967
23949
|
_offset = moveOffset + (active === childCount - 1 && !props.loop ? -val / 2 : val / 2);
|
|
23968
23950
|
}
|
|
23969
|
-
target.style.transitionDuration = `${
|
|
23951
|
+
target.style.transitionDuration = `${swiperRef.current.moving ? 0 : props.duration}ms`;
|
|
23970
23952
|
target.style[isVertical ? "height" : "width"] = `${Number(size) * childCount}px`;
|
|
23971
23953
|
target.style[isVertical ? "width" : "height"] = `${isVertical ? width : height}px`;
|
|
23972
23954
|
target.style.transform = `translate3D${!isVertical ? `(${_offset}px,0,0)` : `(0,${_offset}px,0)`}`;
|
|
23973
23955
|
};
|
|
23974
23956
|
const onTouchStart = (e) => {
|
|
23975
|
-
if (props.
|
|
23957
|
+
if (props.preventDefault)
|
|
23976
23958
|
e.preventDefault();
|
|
23977
|
-
if (props.
|
|
23959
|
+
if (props.stopPropagation)
|
|
23978
23960
|
e.stopPropagation();
|
|
23979
23961
|
if (!props.touchable)
|
|
23980
23962
|
return;
|
|
23981
23963
|
touchStart(e);
|
|
23982
23964
|
touch.touchTime = Date.now();
|
|
23983
23965
|
stopAutoPlay();
|
|
23984
|
-
|
|
23966
|
+
resetPosition();
|
|
23985
23967
|
};
|
|
23986
23968
|
const onTouchMove = (e) => {
|
|
23987
|
-
if (props.touchable &&
|
|
23988
|
-
|
|
23969
|
+
if (props.touchable && swiperRef.current.moving) {
|
|
23970
|
+
handleTouchMove(e);
|
|
23989
23971
|
if (touch.stateDirection === props.direction) {
|
|
23990
23972
|
move({
|
|
23991
23973
|
offset: touch.delta
|
|
@@ -23994,12 +23976,12 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23994
23976
|
}
|
|
23995
23977
|
};
|
|
23996
23978
|
const onTouchEnd = (e) => {
|
|
23997
|
-
if (!props.touchable || !
|
|
23979
|
+
if (!props.touchable || !swiperRef.current.moving)
|
|
23998
23980
|
return;
|
|
23999
23981
|
const speed = touch.delta / (Date.now() - touch.touchTime);
|
|
24000
|
-
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta) >
|
|
23982
|
+
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta) > Number((size / 2).toFixed(2));
|
|
24001
23983
|
let pace = 0;
|
|
24002
|
-
|
|
23984
|
+
swiperRef.current.moving = false;
|
|
24003
23985
|
if (isShouldMove && touch.stateDirection === props.direction) {
|
|
24004
23986
|
const offset2 = isVertical ? touch.offsetY : touch.offsetX;
|
|
24005
23987
|
if (props.loop) {
|
|
@@ -24020,27 +24002,27 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
24020
24002
|
} else {
|
|
24021
24003
|
getStyle();
|
|
24022
24004
|
}
|
|
24023
|
-
|
|
24005
|
+
startPlay();
|
|
24024
24006
|
};
|
|
24025
24007
|
useEffect(() => {
|
|
24026
|
-
|
|
24008
|
+
swiperRef.current.activePagination = (active + childCount) % childCount;
|
|
24027
24009
|
}, [active]);
|
|
24028
|
-
const init = (active2 = +propSwiper.
|
|
24010
|
+
const init = (active2 = +propSwiper.defaultValue) => {
|
|
24029
24011
|
const rect2 = getRect(container == null ? void 0 : container.current);
|
|
24030
|
-
const
|
|
24031
|
-
const
|
|
24032
|
-
const
|
|
24033
|
-
size = isVertical ?
|
|
24012
|
+
const currentIndex = Math.max(Math.min(childCount - 1, active2), 0);
|
|
24013
|
+
const width2 = +propSwiper.width || rect2.width;
|
|
24014
|
+
const height2 = +propSwiper.height || rect2.height;
|
|
24015
|
+
size = isVertical ? height2 : width2;
|
|
24034
24016
|
trackSize = childCount * Number(size);
|
|
24035
|
-
const targetOffset = getOffset(
|
|
24036
|
-
|
|
24017
|
+
const targetOffset = getOffset(currentIndex);
|
|
24018
|
+
swiperRef.current.moving = true;
|
|
24037
24019
|
if (ready) {
|
|
24038
|
-
|
|
24020
|
+
swiperRef.current.moving = false;
|
|
24039
24021
|
}
|
|
24040
24022
|
setRect(rect2);
|
|
24041
|
-
setActive(
|
|
24042
|
-
setWidth(
|
|
24043
|
-
setHeight(
|
|
24023
|
+
setActive(currentIndex);
|
|
24024
|
+
setWidth(width2);
|
|
24025
|
+
setHeight(height2);
|
|
24044
24026
|
setOffset(targetOffset);
|
|
24045
24027
|
setReady(true);
|
|
24046
24028
|
};
|
|
@@ -24052,19 +24034,15 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
24052
24034
|
useEffect(() => {
|
|
24053
24035
|
if (ready) {
|
|
24054
24036
|
stopAutoPlay();
|
|
24055
|
-
|
|
24037
|
+
startPlay();
|
|
24056
24038
|
}
|
|
24057
|
-
return () =>
|
|
24058
|
-
setReady(false);
|
|
24059
|
-
};
|
|
24039
|
+
return () => setReady(false);
|
|
24060
24040
|
}, [ready]);
|
|
24061
24041
|
useEffect(() => {
|
|
24062
24042
|
stopAutoPlay();
|
|
24063
|
-
|
|
24043
|
+
startPlay();
|
|
24064
24044
|
}, [children]);
|
|
24065
|
-
useEffect(() =>
|
|
24066
|
-
init();
|
|
24067
|
-
}, [propSwiper.initPage]);
|
|
24045
|
+
useEffect(() => init(), [propSwiper.defaultValue]);
|
|
24068
24046
|
useEffect(() => {
|
|
24069
24047
|
const target = container.current;
|
|
24070
24048
|
target.addEventListener("touchstart", onTouchStart, false);
|
|
@@ -24077,20 +24055,16 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
24077
24055
|
};
|
|
24078
24056
|
});
|
|
24079
24057
|
useEffect(() => {
|
|
24080
|
-
return () =>
|
|
24081
|
-
stopAutoPlay();
|
|
24082
|
-
};
|
|
24058
|
+
return () => stopAutoPlay();
|
|
24083
24059
|
}, []);
|
|
24084
|
-
const
|
|
24060
|
+
const getItemStyle = (index) => {
|
|
24085
24061
|
const style = {};
|
|
24086
|
-
|
|
24087
|
-
|
|
24088
|
-
if (_size) {
|
|
24089
|
-
style[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
|
|
24062
|
+
if (size) {
|
|
24063
|
+
style[direction === "horizontal" ? "width" : "height"] = `${size}px`;
|
|
24090
24064
|
}
|
|
24091
24065
|
const offset2 = childOffset[index];
|
|
24092
24066
|
if (offset2) {
|
|
24093
|
-
style.transform = `translate3D${
|
|
24067
|
+
style.transform = `translate3D${direction === "horizontal" ? `(${offset2}px,0,0)` : `(0,${offset2}px,0)`}`;
|
|
24094
24068
|
}
|
|
24095
24069
|
return style;
|
|
24096
24070
|
};
|
|
@@ -24100,52 +24074,58 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
24100
24074
|
prev,
|
|
24101
24075
|
resize
|
|
24102
24076
|
}));
|
|
24103
|
-
|
|
24104
|
-
|
|
24077
|
+
const renderIndicator = () => {
|
|
24078
|
+
if (React__default.isValidElement(indicator))
|
|
24079
|
+
return indicator;
|
|
24080
|
+
if (indicator === true) {
|
|
24105
24081
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24106
24082
|
"div",
|
|
24107
24083
|
{
|
|
24108
|
-
className:
|
|
24109
|
-
|
|
24110
|
-
|
|
24111
|
-
|
|
24112
|
-
|
|
24113
|
-
|
|
24114
|
-
}) }),
|
|
24115
|
-
propSwiper.paginationVisible && !("pageContent" in propSwiper) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24116
|
-
"div",
|
|
24117
|
-
{
|
|
24118
|
-
className: classNames({
|
|
24119
|
-
[`${b("pagination")}`]: true,
|
|
24120
|
-
[`${b("pagination-vertical")}`]: isVertical
|
|
24121
|
-
}),
|
|
24122
|
-
children: React__default.Children.map(childs, (item, index) => {
|
|
24123
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24124
|
-
"i",
|
|
24084
|
+
className: classNames({
|
|
24085
|
+
[`${classPrefix2}__pagination`]: true,
|
|
24086
|
+
[`${classPrefix2}__pagination-vertical`]: isVertical
|
|
24087
|
+
}),
|
|
24088
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24089
|
+
Indicator,
|
|
24125
24090
|
{
|
|
24126
|
-
|
|
24127
|
-
|
|
24128
|
-
|
|
24129
|
-
|
|
24130
|
-
|
|
24131
|
-
|
|
24132
|
-
|
|
24133
|
-
|
|
24134
|
-
|
|
24135
|
-
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24091
|
+
current: (active + childCount) % childCount,
|
|
24092
|
+
total: childs == null ? void 0 : childs.length,
|
|
24093
|
+
direction
|
|
24094
|
+
}
|
|
24095
|
+
)
|
|
24096
|
+
}
|
|
24097
|
+
);
|
|
24098
|
+
}
|
|
24099
|
+
return null;
|
|
24100
|
+
};
|
|
24101
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DataContext$1.Provider, { value: parent, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24102
|
+
"div",
|
|
24103
|
+
{
|
|
24104
|
+
className: classNames(classPrefix2, className),
|
|
24105
|
+
ref: container,
|
|
24106
|
+
...rest,
|
|
24107
|
+
children: [
|
|
24108
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClass, ref: innerRef, children: React__default.Children.map(childs, (child, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24109
|
+
"div",
|
|
24110
|
+
{
|
|
24111
|
+
className: `${classPrefix2}__item-wrapper`,
|
|
24112
|
+
style: getItemStyle(index),
|
|
24113
|
+
children: child
|
|
24114
|
+
},
|
|
24115
|
+
index
|
|
24116
|
+
)) }),
|
|
24117
|
+
renderIndicator()
|
|
24118
|
+
]
|
|
24119
|
+
}
|
|
24120
|
+
) });
|
|
24141
24121
|
});
|
|
24142
|
-
Swiper.defaultProps = defaultProps$
|
|
24122
|
+
Swiper.defaultProps = defaultProps$g;
|
|
24143
24123
|
Swiper.displayName = "NutSwiper";
|
|
24144
|
-
const defaultProps$
|
|
24124
|
+
const defaultProps$f = {
|
|
24145
24125
|
direction: "horizontal"
|
|
24146
24126
|
};
|
|
24147
24127
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
24148
|
-
const _props = { ...defaultProps$
|
|
24128
|
+
const _props = { ...defaultProps$f, ...props };
|
|
24149
24129
|
const { className, style, children, direction, size } = _props;
|
|
24150
24130
|
const parent = useContext(DataContext$1);
|
|
24151
24131
|
const b = cn("swiper-item");
|
|
@@ -24161,16 +24141,16 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
24161
24141
|
};
|
|
24162
24142
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, style: { ...style, ...getStyle() }, children });
|
|
24163
24143
|
});
|
|
24164
|
-
SwiperItem.defaultProps = defaultProps$
|
|
24144
|
+
SwiperItem.defaultProps = defaultProps$f;
|
|
24165
24145
|
SwiperItem.displayName = "NutSwiperItem";
|
|
24166
|
-
const defaultProps$
|
|
24146
|
+
const defaultProps$e = {
|
|
24167
24147
|
images: [],
|
|
24168
24148
|
videos: [],
|
|
24169
24149
|
show: false,
|
|
24170
|
-
|
|
24150
|
+
autoPlay: 3e3,
|
|
24171
24151
|
initNo: 1,
|
|
24172
24152
|
contentClose: false,
|
|
24173
|
-
|
|
24153
|
+
indicator: false,
|
|
24174
24154
|
paginationColor: "#fff",
|
|
24175
24155
|
onClose: () => {
|
|
24176
24156
|
}
|
|
@@ -24182,8 +24162,8 @@ const ImagePreview = (props) => {
|
|
|
24182
24162
|
show,
|
|
24183
24163
|
initNo,
|
|
24184
24164
|
paginationColor,
|
|
24185
|
-
|
|
24186
|
-
|
|
24165
|
+
indicator,
|
|
24166
|
+
autoPlay,
|
|
24187
24167
|
contentClose,
|
|
24188
24168
|
onClose
|
|
24189
24169
|
} = props;
|
|
@@ -24332,16 +24312,18 @@ const ImagePreview = (props) => {
|
|
|
24332
24312
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24333
24313
|
Swiper,
|
|
24334
24314
|
{
|
|
24335
|
-
autoPlay
|
|
24315
|
+
autoPlay,
|
|
24336
24316
|
className: "nut-imagepreview-swiper",
|
|
24337
24317
|
loop: true,
|
|
24338
|
-
|
|
24339
|
-
style: {
|
|
24318
|
+
preventDefault: false,
|
|
24319
|
+
style: {
|
|
24320
|
+
display: showPop ? "block" : "none",
|
|
24321
|
+
"--nutui-indicator-color": paginationColor
|
|
24322
|
+
},
|
|
24340
24323
|
direction: "horizontal",
|
|
24341
24324
|
onChange: slideChangeEnd,
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
paginationVisible,
|
|
24325
|
+
defaultValue: innerNo && (innerNo > maxNo ? maxNo - 1 : innerNo - 1),
|
|
24326
|
+
indicator,
|
|
24345
24327
|
children: (videos && videos.length > 0 ? videos.map((item, index) => {
|
|
24346
24328
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SwiperItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Video, { source: item.source, options: item.options }) }, index);
|
|
24347
24329
|
}) : []).concat(
|
|
@@ -24369,41 +24351,8 @@ const ImagePreview = (props) => {
|
|
|
24369
24351
|
}
|
|
24370
24352
|
);
|
|
24371
24353
|
};
|
|
24372
|
-
ImagePreview.defaultProps = defaultProps$
|
|
24354
|
+
ImagePreview.defaultProps = defaultProps$e;
|
|
24373
24355
|
ImagePreview.displayName = "NutImagePreview";
|
|
24374
|
-
const defaultProps$e = {
|
|
24375
|
-
total: 3,
|
|
24376
|
-
current: 1,
|
|
24377
|
-
direction: "horizontal"
|
|
24378
|
-
};
|
|
24379
|
-
const classPrefix = `nut-indicator`;
|
|
24380
|
-
const Indicator = (props) => {
|
|
24381
|
-
const { total, current, children, className, direction, ...rest } = {
|
|
24382
|
-
...defaultProps$e,
|
|
24383
|
-
...props
|
|
24384
|
-
};
|
|
24385
|
-
const classes = classNames({
|
|
24386
|
-
[`${classPrefix}__vertical`]: direction === "vertical"
|
|
24387
|
-
});
|
|
24388
|
-
const renderElement = () => {
|
|
24389
|
-
const childs = [];
|
|
24390
|
-
for (let item = 1; item <= total; item++) {
|
|
24391
|
-
childs.push(
|
|
24392
|
-
item === current ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children || /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24393
|
-
"div",
|
|
24394
|
-
{
|
|
24395
|
-
className: `${classPrefix}__dot ${classPrefix}__active`
|
|
24396
|
-
},
|
|
24397
|
-
item
|
|
24398
|
-
) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix}__dot` }, item)
|
|
24399
|
-
);
|
|
24400
|
-
}
|
|
24401
|
-
return childs;
|
|
24402
|
-
};
|
|
24403
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(classes, className), ...rest, children: renderElement() });
|
|
24404
|
-
};
|
|
24405
|
-
Indicator.defaultProps = defaultProps$e;
|
|
24406
|
-
Indicator.displayName = "NutIndicator";
|
|
24407
24356
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
24408
24357
|
let index = 0;
|
|
24409
24358
|
const positions = Array(length);
|
|
@@ -24819,33 +24768,34 @@ const Pagination = (props) => {
|
|
|
24819
24768
|
Pagination.defaultProps = defaultProps$c;
|
|
24820
24769
|
Pagination.displayName = "NutPagination";
|
|
24821
24770
|
const defaultProps$b = {
|
|
24771
|
+
...ComponentDefaults,
|
|
24822
24772
|
price: 0,
|
|
24823
|
-
needSymbol: true,
|
|
24824
24773
|
symbol: "¥",
|
|
24825
|
-
|
|
24774
|
+
digits: 2,
|
|
24826
24775
|
thousands: false,
|
|
24827
24776
|
position: "before",
|
|
24828
24777
|
size: "large",
|
|
24829
|
-
|
|
24778
|
+
line: false
|
|
24830
24779
|
};
|
|
24831
24780
|
const Price = (props) => {
|
|
24832
24781
|
const {
|
|
24833
24782
|
price,
|
|
24834
|
-
needSymbol,
|
|
24835
24783
|
symbol,
|
|
24836
|
-
|
|
24784
|
+
digits,
|
|
24837
24785
|
thousands,
|
|
24838
24786
|
position,
|
|
24839
24787
|
size,
|
|
24788
|
+
line,
|
|
24840
24789
|
className,
|
|
24790
|
+
style,
|
|
24841
24791
|
...rest
|
|
24842
24792
|
} = {
|
|
24843
24793
|
...defaultProps$b,
|
|
24844
24794
|
...props
|
|
24845
24795
|
};
|
|
24846
|
-
const
|
|
24796
|
+
const classPrefix2 = "nut-price";
|
|
24847
24797
|
const showSymbol = () => {
|
|
24848
|
-
return { __html:
|
|
24798
|
+
return { __html: symbol || "" };
|
|
24849
24799
|
};
|
|
24850
24800
|
const checkPoint = (price2) => {
|
|
24851
24801
|
return String(price2).indexOf(".") > 0;
|
|
@@ -24855,7 +24805,7 @@ const Price = (props) => {
|
|
|
24855
24805
|
num = 0;
|
|
24856
24806
|
}
|
|
24857
24807
|
if (checkPoint(num)) {
|
|
24858
|
-
num = Number(num).toFixed(
|
|
24808
|
+
num = Number(num).toFixed(digits);
|
|
24859
24809
|
num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
|
|
24860
24810
|
} else {
|
|
24861
24811
|
num = num.toString();
|
|
@@ -24870,31 +24820,57 @@ const Price = (props) => {
|
|
|
24870
24820
|
decimalNum = 0;
|
|
24871
24821
|
}
|
|
24872
24822
|
if (checkPoint(decimalNum)) {
|
|
24873
|
-
decimalNum = Number(decimalNum).toFixed(
|
|
24823
|
+
decimalNum = Number(decimalNum).toFixed(digits);
|
|
24874
24824
|
decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] || 0;
|
|
24875
24825
|
} else {
|
|
24876
24826
|
decimalNum = 0;
|
|
24877
24827
|
}
|
|
24878
24828
|
const result = `0.${decimalNum}`;
|
|
24879
|
-
const resultFixed = Number(result).toFixed(
|
|
24829
|
+
const resultFixed = Number(result).toFixed(digits);
|
|
24880
24830
|
return String(resultFixed).substring(2, resultFixed.length);
|
|
24881
24831
|
};
|
|
24882
24832
|
const renderSymbol = () => {
|
|
24883
24833
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24884
24834
|
"div",
|
|
24885
24835
|
{
|
|
24886
|
-
className: `${
|
|
24836
|
+
className: `${classPrefix2}__symbol ${classPrefix2}__symbol-${size}`,
|
|
24887
24837
|
dangerouslySetInnerHTML: showSymbol()
|
|
24888
24838
|
}
|
|
24889
24839
|
);
|
|
24890
24840
|
};
|
|
24891
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24892
|
-
|
|
24893
|
-
|
|
24894
|
-
|
|
24895
|
-
|
|
24896
|
-
|
|
24897
|
-
|
|
24841
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24842
|
+
"div",
|
|
24843
|
+
{
|
|
24844
|
+
className: `${classPrefix2} ${className} ${line ? `${classPrefix2}--line` : ""}`,
|
|
24845
|
+
style,
|
|
24846
|
+
...rest,
|
|
24847
|
+
children: [
|
|
24848
|
+
symbol && position === "before" ? renderSymbol() : null,
|
|
24849
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24850
|
+
"div",
|
|
24851
|
+
{
|
|
24852
|
+
className: `${classPrefix2}__integer ${classPrefix2}__integer-${size}`,
|
|
24853
|
+
children: formatThousands(price)
|
|
24854
|
+
}
|
|
24855
|
+
),
|
|
24856
|
+
digits !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24857
|
+
"div",
|
|
24858
|
+
{
|
|
24859
|
+
className: `${classPrefix2}__decimal ${classPrefix2}__decimal-${size}`,
|
|
24860
|
+
children: "."
|
|
24861
|
+
}
|
|
24862
|
+
) : null,
|
|
24863
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24864
|
+
"div",
|
|
24865
|
+
{
|
|
24866
|
+
className: `${classPrefix2}__decimal ${classPrefix2}__decimal-${size}`,
|
|
24867
|
+
children: formatDecimal(price)
|
|
24868
|
+
}
|
|
24869
|
+
),
|
|
24870
|
+
symbol && position === "after" ? renderSymbol() : null
|
|
24871
|
+
]
|
|
24872
|
+
}
|
|
24873
|
+
);
|
|
24898
24874
|
};
|
|
24899
24875
|
Price.defaultProps = defaultProps$b;
|
|
24900
24876
|
Price.displayName = "NutPrice";
|