test-nut-ui
Version:
<p align="center"> <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;"> </p>
1,497 lines (1,493 loc) • 906 kB
JavaScript
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.ReactDOM));
})(this, function(exports2, React, ReactDOM) {
var _a;
"use strict";var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
/*!
* test-nut-ui v0.0.62 Sun Oct 08 2023 16:36:51 GMT+0800 (中国标准时间)
* (c) 2023 @jdf2e.
* Released under the MIT License.
*/
function _interopNamespaceDefault(e) {
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
if (e) {
for (const k2 in e) {
if (k2 !== "default") {
const d = Object.getOwnPropertyDescriptor(e, k2);
Object.defineProperty(n, k2, d.get ? d : {
enumerable: true,
get: () => e[k2]
});
}
}
}
n.default = e;
return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
var classnamesExports = {};
var classnames = {
get exports() {
return classnamesExports;
},
set exports(v) {
classnamesExports = v;
}
};
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
(function(module2) {
(function() {
var hasOwn = {}.hasOwnProperty;
function classNames() {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg)
continue;
var argType = typeof arg;
if (argType === "string" || argType === "number") {
classes.push(arg);
} else if (Array.isArray(arg)) {
if (arg.length) {
var inner = classNames.apply(null, arg);
if (inner) {
classes.push(inner);
}
}
} else if (argType === "object") {
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
classes.push(arg.toString());
continue;
}
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(" ");
}
if (module2.exports) {
classNames.default = classNames;
module2.exports = classNames;
} else {
window.classNames = classNames;
}
})();
})(classnames);
const ComponentDefaults = {
className: "",
style: {}
};
const style = "";
function ur$1(r) {
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var Q = { exports: {} }, W = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var _e;
function lr$1() {
if (_e)
return W;
_e = 1;
var r = React, R = Symbol.for("react.element"), g = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, y2 = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: true, ref: true, __self: true, __source: true };
function _(E, m, P) {
var j, w = {}, S = null, L = null;
P !== void 0 && (S = "" + P), m.key !== void 0 && (S = "" + m.key), m.ref !== void 0 && (L = m.ref);
for (j in m)
h.call(m, j) && !v.hasOwnProperty(j) && (w[j] = m[j]);
if (E && E.defaultProps)
for (j in m = E.defaultProps, m)
w[j] === void 0 && (w[j] = m[j]);
return { $$typeof: R, type: E, key: S, ref: L, props: w, _owner: y2.current };
}
return W.Fragment = g, W.jsx = _, W.jsxs = _, W;
}
var $ = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var we;
function fr() {
return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
var r = React, R = Symbol.for("react.element"), g = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), y2 = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), E = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), Z = Symbol.iterator, Se = "@@iterator";
function Oe(e) {
if (e === null || typeof e != "object")
return null;
var n = Z && e[Z] || e[Se];
return typeof n == "function" ? n : null;
}
var F2 = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function p(e) {
{
for (var n = arguments.length, a2 = new Array(n > 1 ? n - 1 : 0), s = 1; s < n; s++)
a2[s - 1] = arguments[s];
Pe("error", e, a2);
}
}
function Pe(e, n, a2) {
{
var s = F2.ReactDebugCurrentFrame, u = s.getStackAddendum();
u !== "" && (n += "%s", a2 = a2.concat([u]));
var l = a2.map(function(c) {
return String(c);
});
l.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, l);
}
}
var Fe = false, ke = false, Ae = false, De = false, Ie = false, ee;
ee = Symbol.for("react.module.reference");
function We(e) {
return !!(typeof e == "string" || typeof e == "function" || e === h || e === v || Ie || e === y2 || e === P || e === j || De || e === L || Fe || ke || Ae || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === w || e.$$typeof === _ || e.$$typeof === E || e.$$typeof === m || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === ee || e.getModuleId !== void 0));
}
function $e(e, n, a2) {
var s = e.displayName;
if (s)
return s;
var u = n.displayName || n.name || "";
return u !== "" ? a2 + "(" + u + ")" : a2;
}
function re(e) {
return e.displayName || "Context";
}
function T(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case h:
return "Fragment";
case g:
return "Portal";
case v:
return "Profiler";
case y2:
return "StrictMode";
case P:
return "Suspense";
case j:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case E:
var n = e;
return re(n) + ".Consumer";
case _:
var a2 = e;
return re(a2._context) + ".Provider";
case m:
return $e(e, e.render, "ForwardRef");
case w:
var s = e.displayName || null;
return s !== null ? s : T(e.type) || "Memo";
case S: {
var u = e, l = u._payload, c = u._init;
try {
return T(c(l));
} catch {
return null;
}
}
}
return null;
}
var O = Object.assign, D2 = 0, ne, te, ae, oe, se, ie, ce;
function ue() {
}
ue.__reactDisabledLog = true;
function Le() {
{
if (D2 === 0) {
ne = console.log, te = console.info, ae = console.warn, oe = console.error, se = console.group, ie = console.groupCollapsed, ce = console.groupEnd;
var e = {
configurable: true,
enumerable: true,
value: ue,
writable: true
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
D2++;
}
}
function Ne() {
{
if (D2--, D2 === 0) {
var e = {
configurable: true,
enumerable: true,
writable: true
};
Object.defineProperties(console, {
log: O({}, e, {
value: ne
}),
info: O({}, e, {
value: te
}),
warn: O({}, e, {
value: ae
}),
error: O({}, e, {
value: oe
}),
group: O({}, e, {
value: se
}),
groupCollapsed: O({}, e, {
value: ie
}),
groupEnd: O({}, e, {
value: ce
})
});
}
D2 < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var B = F2.ReactCurrentDispatcher, q;
function N(e, n, a2) {
{
if (q === void 0)
try {
throw Error();
} catch (u) {
var s = u.stack.trim().match(/\n( *(at )?)/);
q = s && s[1] || "";
}
return `
` + q + e;
}
}
var z = false, Y;
{
var Ye = typeof WeakMap == "function" ? WeakMap : Map;
Y = new Ye();
}
function le(e, n) {
if (!e || z)
return "";
{
var a2 = Y.get(e);
if (a2 !== void 0)
return a2;
}
var s;
z = true;
var u = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var l;
l = B.current, B.current = null, Le();
try {
if (n) {
var c = function() {
throw Error();
};
if (Object.defineProperty(c.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(c, []);
} catch (C) {
s = C;
}
Reflect.construct(e, [], c);
} else {
try {
c.call();
} catch (C) {
s = C;
}
e.call(c.prototype);
}
} else {
try {
throw Error();
} catch (C) {
s = C;
}
e();
}
} catch (C) {
if (C && s && typeof C.stack == "string") {
for (var i = C.stack.split(`
`), b = s.stack.split(`
`), f = i.length - 1, d = b.length - 1; f >= 1 && d >= 0 && i[f] !== b[d]; )
d--;
for (; f >= 1 && d >= 0; f--, d--)
if (i[f] !== b[d]) {
if (f !== 1 || d !== 1)
do
if (f--, d--, d < 0 || i[f] !== b[d]) {
var x2 = `
` + i[f].replace(" at new ", " at ");
return e.displayName && x2.includes("<anonymous>") && (x2 = x2.replace("<anonymous>", e.displayName)), typeof e == "function" && Y.set(e, x2), x2;
}
while (f >= 1 && d >= 0);
break;
}
}
} finally {
z = false, B.current = l, Ne(), Error.prepareStackTrace = u;
}
var A = e ? e.displayName || e.name : "", Re2 = A ? N(A) : "";
return typeof e == "function" && Y.set(e, Re2), Re2;
}
function Me(e, n, a2) {
return le(e, false);
}
function Ue(e) {
var n = e.prototype;
return !!(n && n.isReactComponent);
}
function M(e, n, a2) {
if (e == null)
return "";
if (typeof e == "function")
return le(e, Ue(e));
if (typeof e == "string")
return N(e);
switch (e) {
case P:
return N("Suspense");
case j:
return N("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case m:
return Me(e.render);
case w:
return M(e.type, n, a2);
case S: {
var s = e, u = s._payload, l = s._init;
try {
return M(l(u), n, a2);
} catch {
}
}
}
return "";
}
var U = Object.prototype.hasOwnProperty, fe = {}, de = F2.ReactDebugCurrentFrame;
function V2(e) {
if (e) {
var n = e._owner, a2 = M(e.type, e._source, n ? n.type : null);
de.setExtraStackFrame(a2);
} else
de.setExtraStackFrame(null);
}
function Ve(e, n, a2, s, u) {
{
var l = Function.call.bind(U);
for (var c in e)
if (l(e, c)) {
var i = void 0;
try {
if (typeof e[c] != "function") {
var b = Error((s || "React class") + ": " + a2 + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw b.name = "Invariant Violation", b;
}
i = e[c](n, c, s, a2, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (f) {
i = f;
}
i && !(i instanceof Error) && (V2(u), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", a2, c, typeof i), V2(null)), i instanceof Error && !(i.message in fe) && (fe[i.message] = true, V2(u), p("Failed %s type: %s", a2, i.message), V2(null));
}
}
}
var Be = Array.isArray;
function H(e) {
return Be(e);
}
function qe(e) {
{
var n = typeof Symbol == "function" && Symbol.toStringTag, a2 = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
return a2;
}
}
function ze(e) {
try {
return ve(e), false;
} catch {
return true;
}
}
function ve(e) {
return "" + e;
}
function me(e) {
if (ze(e))
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ve(e);
}
var I = F2.ReactCurrentOwner, He = {
key: true,
ref: true,
__self: true,
__source: true
}, pe, be, J;
J = {};
function Je(e) {
if (U.call(e, "ref")) {
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
if (n && n.isReactWarning)
return false;
}
return e.ref !== void 0;
}
function Ge(e) {
if (U.call(e, "key")) {
var n = Object.getOwnPropertyDescriptor(e, "key").get;
if (n && n.isReactWarning)
return false;
}
return e.key !== void 0;
}
function Ke(e, n) {
if (typeof e.ref == "string" && I.current && n && I.current.stateNode !== n) {
var a2 = T(I.current.type);
J[a2] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T(I.current.type), e.ref), J[a2] = true);
}
}
function Xe(e, n) {
{
var a2 = function() {
pe || (pe = true, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
};
a2.isReactWarning = true, Object.defineProperty(e, "key", {
get: a2,
configurable: true
});
}
}
function Qe(e, n) {
{
var a2 = function() {
be || (be = true, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
};
a2.isReactWarning = true, Object.defineProperty(e, "ref", {
get: a2,
configurable: true
});
}
}
var Ze = function(e, n, a2, s, u, l, c) {
var i = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: R,
// Built-in properties that belong on the element
type: e,
key: n,
ref: a2,
props: c,
// Record the component responsible for creating this element.
_owner: l
};
return i._store = {}, Object.defineProperty(i._store, "validated", {
configurable: false,
enumerable: false,
writable: true,
value: false
}), Object.defineProperty(i, "_self", {
configurable: false,
enumerable: false,
writable: false,
value: s
}), Object.defineProperty(i, "_source", {
configurable: false,
enumerable: false,
writable: false,
value: u
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
};
function er(e, n, a2, s, u) {
{
var l, c = {}, i = null, b = null;
a2 !== void 0 && (me(a2), i = "" + a2), Ge(n) && (me(n.key), i = "" + n.key), Je(n) && (b = n.ref, Ke(n, u));
for (l in n)
U.call(n, l) && !He.hasOwnProperty(l) && (c[l] = n[l]);
if (e && e.defaultProps) {
var f = e.defaultProps;
for (l in f)
c[l] === void 0 && (c[l] = f[l]);
}
if (i || b) {
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
i && Xe(c, d), b && Qe(c, d);
}
return Ze(e, i, b, u, s, I.current, c);
}
}
var G = F2.ReactCurrentOwner, he = F2.ReactDebugCurrentFrame;
function k2(e) {
if (e) {
var n = e._owner, a2 = M(e.type, e._source, n ? n.type : null);
he.setExtraStackFrame(a2);
} else
he.setExtraStackFrame(null);
}
var K;
K = false;
function X(e) {
return typeof e == "object" && e !== null && e.$$typeof === R;
}
function je() {
{
if (G.current) {
var e = T(G.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function rr(e) {
{
if (e !== void 0) {
var n = e.fileName.replace(/^.*[\\\/]/, ""), a2 = e.lineNumber;
return `
Check your code at ` + n + ":" + a2 + ".";
}
return "";
}
}
var xe = {};
function nr(e) {
{
var n = je();
if (!n) {
var a2 = typeof e == "string" ? e : e.displayName || e.name;
a2 && (n = `
Check the top-level render call using <` + a2 + ">.");
}
return n;
}
}
function ge(e, n) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = true;
var a2 = nr(n);
if (xe[a2])
return;
xe[a2] = true;
var s = "";
e && e._owner && e._owner !== G.current && (s = " It was passed a child from " + T(e._owner.type) + "."), k2(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a2, s), k2(null);
}
}
function ye(e, n) {
{
if (typeof e != "object")
return;
if (H(e))
for (var a2 = 0; a2 < e.length; a2++) {
var s = e[a2];
X(s) && ge(s, n);
}
else if (X(e))
e._store && (e._store.validated = true);
else if (e) {
var u = Oe(e);
if (typeof u == "function" && u !== e.entries)
for (var l = u.call(e), c; !(c = l.next()).done; )
X(c.value) && ge(c.value, n);
}
}
}
function tr(e) {
{
var n = e.type;
if (n == null || typeof n == "string")
return;
var a2;
if (typeof n == "function")
a2 = n.propTypes;
else if (typeof n == "object" && (n.$$typeof === m || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
n.$$typeof === w))
a2 = n.propTypes;
else
return;
if (a2) {
var s = T(n);
Ve(a2, e.props, "prop", s, e);
} else if (n.PropTypes !== void 0 && !K) {
K = true;
var u = T(n);
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
}
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function ar(e) {
{
for (var n = Object.keys(e.props), a2 = 0; a2 < n.length; a2++) {
var s = n[a2];
if (s !== "children" && s !== "key") {
k2(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), k2(null);
break;
}
}
e.ref !== null && (k2(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), k2(null));
}
}
function Ee(e, n, a2, s, u, l) {
{
var c = We(e);
if (!c) {
var i = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var b = rr(u);
b ? i += b : i += je();
var f;
e === null ? f = "null" : H(e) ? f = "array" : e !== void 0 && e.$$typeof === R ? (f = "<" + (T(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, i);
}
var d = er(e, n, a2, u, l);
if (d == null)
return d;
if (c) {
var x2 = n.children;
if (x2 !== void 0)
if (s)
if (H(x2)) {
for (var A = 0; A < x2.length; A++)
ye(x2[A], e);
Object.freeze && Object.freeze(x2);
} else
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
ye(x2, e);
}
return e === h ? ar(d) : tr(d), d;
}
}
function or(e, n, a2) {
return Ee(e, n, a2, true);
}
function sr2(e, n, a2) {
return Ee(e, n, a2, false);
}
var ir2 = sr2, cr2 = or;
$.Fragment = h, $.jsx = ir2, $.jsxs = cr2;
}()), $;
}
process.env.NODE_ENV === "production" ? Q.exports = lr$1() : Q.exports = fr();
var t = Q.exports, Ce = { exports: {} };
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
(function(r) {
(function() {
var R = {}.hasOwnProperty;
function g() {
for (var h = [], y2 = 0; y2 < arguments.length; y2++) {
var v = arguments[y2];
if (v) {
var _ = typeof v;
if (_ === "string" || _ === "number")
h.push(v);
else if (Array.isArray(v)) {
if (v.length) {
var E = g.apply(null, v);
E && h.push(E);
}
} else if (_ === "object") {
if (v.toString !== Object.prototype.toString && !v.toString.toString().includes("[native code]")) {
h.push(v.toString());
continue;
}
for (var m in v)
R.call(v, m) && v[m] && h.push(m);
}
}
}
return h.join(" ");
}
r.exports ? (g.default = g, r.exports = g) : window.classNames = g;
})();
})(Ce);
var dr = Ce.exports;
const vr = /* @__PURE__ */ ur$1(dr), o = (r) => {
const R = vr("iconfont nut-icon", r.name, r.className), g = r.color || "", h = r.size || "", y2 = r.size || "", v = r.size || "";
return /* @__PURE__ */ t.jsx(
"i",
{
className: R,
style: Object.assign({ color: g, width: h, height: y2, fontSize: v }, r.style),
onClick: r.onClick
}
);
}, pr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-add-none" }), br = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-down" }), jr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-drowdown" }), xr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-dropup" }), gr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-left" }), yr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-circle-left" }), Er = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-right" }), Rr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-arrow-circle-right" }), Tr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-book" }), Or = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-select-halfselected" }), Pr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-select-n" }), kr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-thick-delect" }), Yr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-error" }), Mr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-error-cricle" }), Br = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-pic-defeated" }), qr = (r) => /* @__PURE__ */ t.jsx(o, { className: "nut-icon-loading", ...r, name: "iconns-loading" }), Hr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-splin" }), Jr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-succeed" }), Gr = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-succeed-cricle" }), jn = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-reduce" }), gn = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-select" }), En = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-face-none" }), Tn = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-search" }), Cn = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-warm" }), Fn = (r) => /* @__PURE__ */ t.jsx(o, { ...r, name: "iconns-file-picture-58" });
const prefixCls = "nut-button";
const defaultProps$1w = {
...ComponentDefaults,
color: "",
type: "default",
size: "normal",
shape: "round",
fill: "solid",
plain: false,
iconPosition: "left",
loading: false,
disabled: false,
block: false,
icon: null,
nativeType: "button",
onClick: (e) => {
}
};
const Button = React.forwardRef(
(props, ref) => {
const {
color,
shape,
fill,
loading,
disabled,
type: type2,
plain,
iconPosition,
size,
block,
icon,
children,
onClick,
className,
style: style2,
nativeType,
...rest
} = {
...defaultProps$1w,
...props
};
const getStyle = React.useCallback(() => {
const style22 = {};
if (props.color) {
if (fill && fill === "outline") {
style22.color = color;
style22.background = "#fff";
if (!(color == null ? void 0 : color.includes("gradient"))) {
style22.borderColor = color;
}
} else {
style22.color = "#fff";
style22.background = color;
}
}
return style22;
}, [color]);
const handleClick2 = (e) => {
if (!loading && !disabled && onClick) {
onClick(e);
}
};
return (
// eslint-disable-next-line react/button-has-type
/* @__PURE__ */ React.createElement(
"button",
{
...rest,
ref,
type: nativeType,
className: classnamesExports(
prefixCls,
className,
type2 ? `${prefixCls}--${type2}` : null,
props.fill ? `${prefixCls}--${fill}` : null,
{
[`${prefixCls}--${size}`]: size,
[`${prefixCls}--${shape}`]: shape,
[`${prefixCls}--block`]: block,
[`${prefixCls}--disabled`]: disabled,
[`${prefixCls}--loading`]: loading,
[`${prefixCls}--icon`]: loading && !children || icon && !children,
[`${prefixCls}--plain`]: plain
}
),
style: { ...getStyle(), ...style2 },
onClick: (e) => handleClick2(e)
},
/* @__PURE__ */ React.createElement("div", { className: "nut-button__warp" }, loading && iconPosition === "left" ? /* @__PURE__ */ React.createElement(Hr, { className: "nut-icon-loading" }) : null, !loading && iconPosition === "left" && icon ? icon : null, children && /* @__PURE__ */ React.createElement("div", { className: icon || loading ? `nut-button-text nut-button-text-${iconPosition}` : "" }, children), loading && iconPosition === "right" ? /* @__PURE__ */ React.createElement(Hr, { className: "nut-icon-loading" }) : null, !loading && iconPosition === "right" && icon ? icon : null)
)
);
}
);
Button.displayName = "NutButton";
const defaultProps$1v = {
...ComponentDefaults,
openPress: false,
avatar: null,
title: null,
description: null,
extra: null,
radius: "0px",
align: "flex-start",
onClick: (event) => {
}
};
const classPrefix$o = "nut-cell";
const Cell = (props) => {
const {
children,
onClick,
openPress,
avatar,
title,
description,
extra,
radius,
align,
className,
style: style2,
...rest
} = {
...defaultProps$1v,
...props
};
const handleClick2 = (event) => {
onClick(event);
};
const baseStyle = {
...style2,
// borderRadius: Number.isNaN(Number(radius)) ? String(radius) : `${radius}px`,
alignItems: align
};
const styles = title || description ? {} : {
flex: 1
};
return /* @__PURE__ */ React.createElement(
"div",
{
className: classnamesExports(classPrefix$o, className, {
[`${classPrefix$o}--has__press`]: openPress
}),
onClick: (event) => handleClick2(event),
style: baseStyle,
...rest
},
children || /* @__PURE__ */ React.createElement(React.Fragment, null, avatar ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$o}__avatar` }, avatar) : null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$o}__left ${extra ? classPrefix$o + "__has-extra" : ""}` }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$o}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$o}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React.createElement(
"div",
{
className: `${classPrefix$o}__extra`,
style: styles
},
extra
) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$o}__divider` }))
);
};
Cell.defaultProps = defaultProps$1v;
Cell.displayName = "NutCell";
const defaultProps$1u = {
...ComponentDefaults,
openPress: false,
title: "",
description: "",
divider: true
};
const classPrefix$n = "nut-cell-group";
const CellGroup = (props) => {
const { children, className, style: style2, title, openPress, description, divider, ...rest } = {
...defaultProps$1u,
...props
};
return /* @__PURE__ */ React.createElement("div", { className: classnamesExports(classPrefix$n, className, {
[`${classPrefix$n}--has__press`]: openPress
}), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$n}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$n}__description` }, description) : null, /* @__PURE__ */ React.createElement(
"div",
{
className: `${classPrefix$n}__wrap ${divider ? `${classPrefix$n}__wrap--divider` : ""} ${description ? `${classPrefix$n}__wrap--has-description` : ""}`
},
children
));
};
CellGroup.defaultProps = defaultProps$1u;
CellGroup.displayName = "NutCellGroup";
var INFINITY = 1 / 0;
var symbolTag = "[object Symbol]";
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23", rsComboSymbolsRange = "\\u20d0-\\u20f0", rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
var rsApos = "['’]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")", rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
var reApos = RegExp(rsApos, "g");
var reComboMark = RegExp(rsCombo, "g");
var reUnicodeWord = RegExp([
rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")",
rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr,
rsUpper + "+" + rsOptUpperContr,
rsDigits,
rsEmoji
].join("|"), "g");
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
var deburredLetters = {
// Latin-1 Supplement block.
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"Ç": "C",
"ç": "c",
"Ð": "D",
"ð": "d",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"Ñ": "N",
"ñ": "n",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"Ý": "Y",
"ý": "y",
"ÿ": "y",
"Æ": "Ae",
"æ": "ae",
"Þ": "Th",
"þ": "th",
"ß": "ss",
// Latin Extended-A block.
"Ā": "A",
"Ă": "A",
"Ą": "A",
"ā": "a",
"ă": "a",
"ą": "a",
"Ć": "C",
"Ĉ": "C",
"Ċ": "C",
"Č": "C",
"ć": "c",
"ĉ": "c",
"ċ": "c",
"č": "c",
"Ď": "D",
"Đ": "D",
"ď": "d",
"đ": "d",
"Ē": "E",
"Ĕ": "E",
"Ė": "E",
"Ę": "E",
"Ě": "E",
"ē": "e",
"ĕ": "e",
"ė": "e",
"ę": "e",
"ě": "e",
"Ĝ": "G",
"Ğ": "G",
"Ġ": "G",
"Ģ": "G",
"ĝ": "g",
"ğ": "g",
"ġ": "g",
"ģ": "g",
"Ĥ": "H",
"Ħ": "H",
"ĥ": "h",
"ħ": "h",
"Ĩ": "I",
"Ī": "I",
"Ĭ": "I",
"Į": "I",
"İ": "I",
"ĩ": "i",
"ī": "i",
"ĭ": "i",
"į": "i",
"ı": "i",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"ĸ": "k",
"Ĺ": "L",
"Ļ": "L",
"Ľ": "L",
"Ŀ": "L",
"Ł": "L",
"ĺ": "l",
"ļ": "l",
"ľ": "l",
"ŀ": "l",
"ł": "l",
"Ń": "N",
"Ņ": "N",
"Ň": "N",
"Ŋ": "N",
"ń": "n",
"ņ": "n",
"ň": "n",
"ŋ": "n",
"Ō": "O",
"Ŏ": "O",
"Ő": "O",
"ō": "o",
"ŏ": "o",
"ő": "o",
"Ŕ": "R",
"Ŗ": "R",
"Ř": "R",
"ŕ": "r",
"ŗ": "r",
"ř": "r",
"Ś": "S",
"Ŝ": "S",
"Ş": "S",
"Š": "S",
"ś": "s",
"ŝ": "s",
"ş": "s",
"š": "s",
"Ţ": "T",
"Ť": "T",
"Ŧ": "T",
"ţ": "t",
"ť": "t",
"ŧ": "t",
"Ũ": "U",
"Ū": "U",
"Ŭ": "U",
"Ů": "U",
"Ű": "U",
"Ų": "U",
"ũ": "u",
"ū": "u",
"ŭ": "u",
"ů": "u",
"ű": "u",
"ų": "u",
"Ŵ": "W",
"ŵ": "w",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Ź": "Z",
"Ż": "Z",
"Ž": "Z",
"ź": "z",
"ż": "z",
"ž": "z",
"IJ": "IJ",
"ij": "ij",
"Œ": "Oe",
"œ": "oe",
"ʼn": "'n",
"ſ": "ss"
};
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root = freeGlobal || freeSelf || Function("return this")();
function arrayReduce(array2, iteratee, accumulator, initAccum) {
var index = -1, length = array2 ? array2.length : 0;
if (initAccum && length) {
accumulator = array2[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array2[index], index, array2);
}
return accumulator;
}
function asciiWords(string2) {
return string2.match(reAsciiWord) || [];
}
function basePropertyOf(object2) {
return function(key) {
return object2 == null ? void 0 : object2[key];
};
}
var deburrLetter = basePropertyOf(deburredLetters);
function hasUnicodeWord(string2) {
return reHasUnicodeWord.test(string2);
}
function unicodeWords(string2) {
return string2.match(reUnicodeWord) || [];
}
var objectProto = Object.prototype;
var objectToString = objectProto.toString;
var Symbol$1 = root.Symbol;
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
function baseToString(value) {
if (typeof value == "string") {
return value;
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : "";
}
var result = value + "";
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
}
function createCompounder(callback) {
return function(string2) {
return arrayReduce(words(deburr(string2).replace(reApos, "")), callback, "");
};
}
function isObjectLike(value) {
return !!value && typeof value == "object";
}
function isSymbol(value) {
return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
}
function toString(value) {
return value == null ? "" : baseToString(value);
}
function deburr(string2) {
string2 = toString(string2);
return string2 && string2.replace(reLatin, deburrLetter).replace(reComboMark, "");
}
var kebabCase = createCompounder(function(result, word, index) {
return result + (index ? "-" : "") + word.toLowerCase();
});
function words(string2, pattern2, guard) {
string2 = toString(string2);
pattern2 = guard ? void 0 : pattern2;
if (pattern2 === void 0) {
return hasUnicodeWord(string2) ? unicodeWords(string2) : asciiWords(string2);
}
return string2.match(pattern2) || [];
}
var lodash_kebabcase = kebabCase;
const zhCN = {
save: "保存",
confirm: "确定",
cancel: "取消",
done: "完成",
next: "下一步",
noData: "没有数据哦~",
placeholder: "请输入内容",
select: "请选择",
video: {
errorTip: "视频加载失败",
clickRetry: "点击重试"
},
fixednav: {
activeText: "收起导航",
inactiveText: "快速导航"
},
infiniteloading: {
pullRefreshText: "松开刷新",
loadText: "加载中……",
loadMoreText: "哎呀,这里是底部了啦"
},
pagination: {
prev: "上一页",
next: "下一页"
},
range: {
rangeText: "不在该区间内"
},
calendaritem: {
weekdays: ["日", "一", "二", "三", "四", "五", "六"],
end: "结束",
start: "开始",
confirm: "确定",
title: "日历选择",
rangeTextStart: "请选择开始时间",
rangeTextEnd: "请选择结束时间",
monthTitle: (year, month) => `${year}年${Number(month) < 10 ? `0${Number(month)}` : month}月`,
today: "今天",
loadPreviousMonth: "加载上一个月",
noEarlierMonth: "没有更早月份"
},
shortpassword: {
title: "请输入密码",
description: "您使用了虚拟资产,请进行验证",
tips: "忘记密码"
},
uploader: {
ready: "准备完成",
readyUpload: "准备上传",
waitingUpload: "等待上传",
uploading: "上传中...",
success: "上传成功",
error: "上传失败",
deleteWord: "用户阻止了删除!"
},
countdown: {
day: "天",
hour: "时",
minute: "分",
second: "秒"
},
address: {
selectRegion: "请选择地址",
deliveryTo: "配送至",
chooseAnotherAddress: "选择其他地址"
},
signature: {
reSign: "重签",
unsupported: "对不起,当前浏览器不支持Canvas,无法使用本控件!"
},
ecard: {
chooseText: "请选择电子卡面值",
otherValueText: "其他面值",
placeholder: "请输入1-5000整数"
},
timeselect: {
pickupTime: "取件时间"
},
sku: {
buyNow: "立即购买",
buyNumber: "购买数量",
addToCard: "加入购物车"
},
skuheader: {
skuId: "商品编号"
},
addresslist: {
addAddress: "新建地址"
},
comment: {
complaintsText: "我要投诉",
additionalReview: (day) => `购买${day}天后追评`,
additionalImages: (length) => `${length}张追评图片`
},
searchbar: {
basePlaceholder: "上京东,购好物",
text: "文本",
test: "测试",
title1: "基础用法",
title2: "搜索框形状及最大长度",
title3: "搜索框内外背景设置",
title4: "搜索框文本设置",
title5: "自定义图标设置",
title6: "数据改变监听"
},
audio: {
back: "快退",
forward: "快进",
pause: "暂停",
start: "开始",
mute: "静音",
tips: "onPlayEnd事件在loop=false时才会触发"
},
datepicker: {
year: "年",
month: "月",
day: "日",
hour: "时",
min: "分",
seconds: "秒"
},
pullToRefresh: {
pullingText: "下拉刷新",
canReleaseText: "松开刷新",
refreshingText: "加载中...",
completeText: "刷新成功"
},
watermark: {
errorCanvasTips: "当前环境不支持Canvas"
}
};
const defaultProps$1t = {
locale: zhCN
};
const defaultConfigRef = {
current: {
locale: zhCN
}
};
const getDefaultConfig = () => {
return defaultConfigRef.current;
};
const ConfigContext = React.createContext(null);
const useConfig = () => {
return React.useContext(ConfigContext) ?? getDefaultConfig();
};
function convertThemeVarsToCSSVars(themeVars) {
const cssVars = {};
Object.keys(themeVars).forEach((key) => {
cssVars[`--${lodash_kebabcase(key)}`] = themeVars[key];
});
return cssVars;
}
const ConfigProvider = (props) => {
const { children, ...config2 } = { ...defaultProps$1t, ...props };
const parentConfig = useConfig();
const theme = config2.theme || {};
const style2 = React.useMemo(
() => convertThemeVarsToCSSVars(theme),
[theme]
);
return /* @__PURE__ */ React.createElement(
ConfigContext.Provider,
{
value: {
...parentConfig,
...config2
}
},
/* @__PURE__ */ React.createElement("div", { style: style2 }, children)
);
};
ConfigProvider.defaultProps = defaultProps$1t;
ConfigProvider.displayName = "NutConfigProvider";
const pxCheck = (value) => {
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
};
const isObject = (val) => val !== null && typeof val === "object";
const isFunction = (val) => typeof val === "function";
const isPromise = (val) => {
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
};
const defaultProps$1s = {
...ComponentDefaults,
fixed: false,
size: "middle",
type: "circle",
text: "加载中...",
textPosition: "vertical",
showText: false,
loadingImage: null,
strokeWidth: 8,
radius: 0,
strokeLinecap: "round",
color: "#2C68FF",
background: "#F5F5F5",
clockwise: true
};
const classPrefix$m = `nut-loading`;
const Loading = (props) => {
const {
children,
className,
fixed,
size,
type: type2,
text,
textPosition,
showText,
loadingImage,
radius,
clockwise,
strokeWidth,
color,
background,
style: style2,
strokeLinecap,
...restProps
} = {
...defaultProps$1s,
...props
};
const [statusList, setStatusList] = React.useState([0.2, 0.6, 1]);
const timerId = React.useRef(-1);
const duration = 1e3;
React.useEffect(() => {
if (type2 === "dot" && statusList.length) {
const interval = duration / statusList.length;
timerId.current = setInterval(
() => {
const newList = [...statusList];
const item = newList.pop();
item && newList.unshift(item);
setStatusList(newList);
},
interval
);
}
return () => {
if (timerId.current >= 0) {
clearInterval(timerId.current);
}
};
}, [type2, statusList, duration]);
const percent = type2 === "gradientCircle" ? 50 : 25;
const radiusMap = {
small: 8,
middle: 12,
large: 16
};
const classes = classnamesExports(className, classPrefix$m, {
[`${classPrefix$m}--${size}`]: true,
[`${classPrefix$m}--${textPosition}`]: true,
[`${classPrefix$m}--fixed`]: fixed
});
const refRandomId = Math.random().toStrin