@nutui/nutui-react 2.0.0-alpha.3 → 2.0.0-alpha.4
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 +9 -0
- package/dist/esm/Badge.js +4 -66
- package/dist/esm/CircleProgress.js +20 -25
- package/dist/esm/Input.js +87 -193
- package/dist/esm/Tabbar.js +29 -33
- package/dist/esm/TabbarItem.js +5 -75
- package/dist/esm/badge2.js +69 -0
- package/dist/esm/tabbaritem2.js +61 -0
- 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 +630 -837
- package/dist/nutui.react.umd.js +630 -837
- package/dist/packages/badge/badge.scss +0 -1
- package/dist/packages/circleprogress/circleprogress.scss +0 -9
- package/dist/packages/input/input.scss +13 -180
- package/dist/packages/tabbar/tabbar.scss +16 -23
- package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +12 -16
- package/dist/styles/variables.scss +12 -16
- package/dist/types/index.d.ts +46 -80
- package/package.json +1 -1
package/dist/nutui.react.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a;
|
|
8
8
|
/*!
|
|
9
|
-
* @nutui/nutui-react v2.0.0-alpha.
|
|
9
|
+
* @nutui/nutui-react v2.0.0-alpha.4 Fri May 05 2023 16:12:43 GMT+0800 (China Standard Time)
|
|
10
10
|
* (c) 2023 @jdf2e.
|
|
11
11
|
* Released under the MIT License.
|
|
12
12
|
*/
|
|
@@ -3285,7 +3285,7 @@ const defaultProps$1q = {
|
|
|
3285
3285
|
onClick: (event) => {
|
|
3286
3286
|
}
|
|
3287
3287
|
};
|
|
3288
|
-
const classPrefix$
|
|
3288
|
+
const classPrefix$a = "nut-cell";
|
|
3289
3289
|
const Cell = (props) => {
|
|
3290
3290
|
const {
|
|
3291
3291
|
children,
|
|
@@ -3316,24 +3316,24 @@ const Cell = (props) => {
|
|
|
3316
3316
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3317
3317
|
"div",
|
|
3318
3318
|
{
|
|
3319
|
-
className: classNames(classPrefix$
|
|
3319
|
+
className: classNames(classPrefix$a, className),
|
|
3320
3320
|
onClick: (event) => handleClick2(event),
|
|
3321
3321
|
style: baseStyle,
|
|
3322
3322
|
...rest,
|
|
3323
3323
|
children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
3324
|
-
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$
|
|
3325
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3326
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3324
|
+
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$a}__left`, children: [
|
|
3325
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__title`, children: title }) : null,
|
|
3326
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__description`, children: description }) : null
|
|
3327
3327
|
] }) : null,
|
|
3328
3328
|
extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3329
3329
|
"div",
|
|
3330
3330
|
{
|
|
3331
|
-
className: `${classPrefix$
|
|
3331
|
+
className: `${classPrefix$a}__extra`,
|
|
3332
3332
|
style: styles,
|
|
3333
3333
|
children: extra
|
|
3334
3334
|
}
|
|
3335
3335
|
) : null,
|
|
3336
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3336
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$a}__divider` })
|
|
3337
3337
|
] })
|
|
3338
3338
|
}
|
|
3339
3339
|
);
|
|
@@ -3345,16 +3345,16 @@ const defaultProps$1p = {
|
|
|
3345
3345
|
title: "",
|
|
3346
3346
|
description: ""
|
|
3347
3347
|
};
|
|
3348
|
-
const classPrefix$
|
|
3348
|
+
const classPrefix$9 = "nut-cell-group";
|
|
3349
3349
|
const CellGroup = (props) => {
|
|
3350
3350
|
const { children, className, style, title, description, ...rest } = {
|
|
3351
3351
|
...defaultProps$1p,
|
|
3352
3352
|
...props
|
|
3353
3353
|
};
|
|
3354
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$
|
|
3355
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3356
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3357
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
3354
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$9, className), ...rest, children: [
|
|
3355
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__title`, children: title }) : null,
|
|
3356
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__description`, children: description }) : null,
|
|
3357
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__wrap`, children })
|
|
3358
3358
|
] });
|
|
3359
3359
|
};
|
|
3360
3360
|
CellGroup.defaultProps = defaultProps$1p;
|
|
@@ -3829,7 +3829,7 @@ const defaultProps$1n = {
|
|
|
3829
3829
|
loading: true,
|
|
3830
3830
|
lazy: false
|
|
3831
3831
|
};
|
|
3832
|
-
const classPrefix$
|
|
3832
|
+
const classPrefix$8 = "nut-image";
|
|
3833
3833
|
const Image$1 = (props) => {
|
|
3834
3834
|
const {
|
|
3835
3835
|
className,
|
|
@@ -3945,7 +3945,7 @@ const Image$1 = (props) => {
|
|
|
3945
3945
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
3946
3946
|
"div",
|
|
3947
3947
|
{
|
|
3948
|
-
className: classNames(classPrefix$
|
|
3948
|
+
className: classNames(classPrefix$8, className),
|
|
3949
3949
|
style: containerStyle,
|
|
3950
3950
|
onClick: (e) => {
|
|
3951
3951
|
imageClick(e);
|
|
@@ -4113,21 +4113,21 @@ const defaultProps$1l = {
|
|
|
4113
4113
|
contentPosition: "center",
|
|
4114
4114
|
direction: "horizontal"
|
|
4115
4115
|
};
|
|
4116
|
-
const classPrefix$
|
|
4116
|
+
const classPrefix$7 = `nut-divider`;
|
|
4117
4117
|
const Divider = (props) => {
|
|
4118
4118
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
4119
4119
|
...defaultProps$1l,
|
|
4120
4120
|
...props
|
|
4121
4121
|
};
|
|
4122
4122
|
const classes = direction === "horizontal" ? classNames({
|
|
4123
|
-
[`${classPrefix$
|
|
4124
|
-
[`${classPrefix$
|
|
4125
|
-
[`${classPrefix$
|
|
4126
|
-
[`${classPrefix$
|
|
4127
|
-
[`${classPrefix$
|
|
4123
|
+
[`${classPrefix$7}`]: true,
|
|
4124
|
+
[`${classPrefix$7}__center`]: children,
|
|
4125
|
+
[`${classPrefix$7}__left`]: contentPosition === "left",
|
|
4126
|
+
[`${classPrefix$7}__right`]: contentPosition === "right",
|
|
4127
|
+
[`${classPrefix$7}__hairline`]: true
|
|
4128
4128
|
}) : classNames({
|
|
4129
|
-
[`${classPrefix$
|
|
4130
|
-
[`${classPrefix$
|
|
4129
|
+
[`${classPrefix$7}`]: true,
|
|
4130
|
+
[`${classPrefix$7}__vertical`]: direction === "vertical"
|
|
4131
4131
|
});
|
|
4132
4132
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
|
|
4133
4133
|
};
|
|
@@ -4288,7 +4288,7 @@ const Layout = (props) => {
|
|
|
4288
4288
|
};
|
|
4289
4289
|
Layout.defaultProps = defaultProps$1i;
|
|
4290
4290
|
Layout.displayName = "NutLayout";
|
|
4291
|
-
const classPrefix$
|
|
4291
|
+
const classPrefix$6 = "nut-row";
|
|
4292
4292
|
const defaultProps$1h = {
|
|
4293
4293
|
...ComponentDefaults,
|
|
4294
4294
|
type: "",
|
|
@@ -4323,7 +4323,7 @@ const Row = (props) => {
|
|
|
4323
4323
|
${getClass("justify", justify)}
|
|
4324
4324
|
${getClass("align", align)}
|
|
4325
4325
|
${getClass("flex", wrap)}
|
|
4326
|
-
${classPrefix$
|
|
4326
|
+
${classPrefix$6}
|
|
4327
4327
|
`;
|
|
4328
4328
|
};
|
|
4329
4329
|
const parentRow = {
|
|
@@ -4422,7 +4422,7 @@ const defaultProps$1g = {
|
|
|
4422
4422
|
threshold: 0,
|
|
4423
4423
|
zIndex: 2e3
|
|
4424
4424
|
};
|
|
4425
|
-
const classPrefix$
|
|
4425
|
+
const classPrefix$5 = "nut-sticky";
|
|
4426
4426
|
const Sticky = (props) => {
|
|
4427
4427
|
const {
|
|
4428
4428
|
position,
|
|
@@ -4544,7 +4544,7 @@ const Sticky = (props) => {
|
|
|
4544
4544
|
{
|
|
4545
4545
|
ref: rootRef,
|
|
4546
4546
|
style: { ...style, ...rootStyle },
|
|
4547
|
-
className: classNames(classPrefix$
|
|
4547
|
+
className: classNames(classPrefix$5, className),
|
|
4548
4548
|
...rest,
|
|
4549
4549
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle, children })
|
|
4550
4550
|
}
|
|
@@ -12221,280 +12221,189 @@ const SubSideNavBar = (props) => {
|
|
|
12221
12221
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-subsidenavbar__content", children })
|
|
12222
12222
|
] });
|
|
12223
12223
|
};
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
set exports(v) {
|
|
12230
|
-
classnameExports = v;
|
|
12231
|
-
}
|
|
12232
|
-
};
|
|
12233
|
-
var classname_production_min = {};
|
|
12234
|
-
var hasRequiredClassname_production_min;
|
|
12235
|
-
function requireClassname_production_min() {
|
|
12236
|
-
if (hasRequiredClassname_production_min)
|
|
12237
|
-
return classname_production_min;
|
|
12238
|
-
hasRequiredClassname_production_min = 1;
|
|
12239
|
-
function r(r2) {
|
|
12240
|
-
function t2(t3, i, a2, o) {
|
|
12241
|
-
var f = i ? e + t3 + r2.e + i : e + t3, v = f;
|
|
12242
|
-
if (a2) {
|
|
12243
|
-
var s = " " + v + r2.m;
|
|
12244
|
-
for (var u in a2)
|
|
12245
|
-
if (a2.hasOwnProperty(u)) {
|
|
12246
|
-
var p = a2[u];
|
|
12247
|
-
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
12248
|
-
}
|
|
12249
|
-
}
|
|
12250
|
-
if (void 0 !== o)
|
|
12251
|
-
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
12252
|
-
var l2 = o[y2];
|
|
12253
|
-
if (l2 && "string" == typeof l2.valueOf())
|
|
12254
|
-
for (var g = l2.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
12255
|
-
var h = g[d];
|
|
12256
|
-
h !== f && (v += " " + h);
|
|
12257
|
-
}
|
|
12258
|
-
}
|
|
12259
|
-
return v;
|
|
12260
|
-
}
|
|
12261
|
-
var e = r2.n || "", n = r2.v || r2.m;
|
|
12262
|
-
return function(r3, e2) {
|
|
12263
|
-
return function(n2, i, a2) {
|
|
12264
|
-
return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r3, n2, void 0, i) : t2(r3, n2, i, a2) : t2(r3, e2, n2, i);
|
|
12265
|
-
};
|
|
12266
|
-
};
|
|
12224
|
+
function usePropsValue({
|
|
12225
|
+
value,
|
|
12226
|
+
defaultValue,
|
|
12227
|
+
finalValue,
|
|
12228
|
+
onChange = (value2) => {
|
|
12267
12229
|
}
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
if (
|
|
12277
|
-
return
|
|
12278
|
-
hasRequiredClassname_development = 1;
|
|
12279
|
-
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
12280
|
-
function withNaming(preset) {
|
|
12281
|
-
var nameSpace = preset.n || "";
|
|
12282
|
-
var modValueDelimiter = preset.v || preset.m;
|
|
12283
|
-
function stringify(b, e, m, mix) {
|
|
12284
|
-
var entityName = e ? nameSpace + b + preset.e + e : nameSpace + b;
|
|
12285
|
-
var className = entityName;
|
|
12286
|
-
if (m) {
|
|
12287
|
-
var modPrefix = " " + className + preset.m;
|
|
12288
|
-
for (var k2 in m) {
|
|
12289
|
-
if (m.hasOwnProperty(k2)) {
|
|
12290
|
-
var modVal = m[k2];
|
|
12291
|
-
if (modVal === true) {
|
|
12292
|
-
className += modPrefix + k2;
|
|
12293
|
-
} else if (modVal) {
|
|
12294
|
-
className += modPrefix + k2 + modValueDelimiter + modVal;
|
|
12295
|
-
}
|
|
12296
|
-
}
|
|
12297
|
-
}
|
|
12298
|
-
}
|
|
12299
|
-
if (mix !== void 0) {
|
|
12300
|
-
mix = Array.isArray(mix) ? mix : [mix];
|
|
12301
|
-
for (var i = 0, len = mix.length; i < len; i++) {
|
|
12302
|
-
var value = mix[i];
|
|
12303
|
-
if (!value || typeof value.valueOf() !== "string")
|
|
12304
|
-
continue;
|
|
12305
|
-
var mixes = value.valueOf().split(" ");
|
|
12306
|
-
for (var j = 0; j < mixes.length; j++) {
|
|
12307
|
-
var val = mixes[j];
|
|
12308
|
-
if (val !== entityName) {
|
|
12309
|
-
className += " " + val;
|
|
12310
|
-
}
|
|
12311
|
-
}
|
|
12312
|
-
}
|
|
12313
|
-
}
|
|
12314
|
-
return className;
|
|
12315
|
-
}
|
|
12316
|
-
return function cnGenerator(b, e) {
|
|
12317
|
-
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
12318
|
-
if (typeof elemOrMods === "string") {
|
|
12319
|
-
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
12320
|
-
return stringify(b, elemOrMods, void 0, elemModsOrBlockMix);
|
|
12321
|
-
}
|
|
12322
|
-
return stringify(b, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
12323
|
-
}
|
|
12324
|
-
return stringify(b, e, elemOrMods, elemModsOrBlockMix);
|
|
12325
|
-
};
|
|
12326
|
-
};
|
|
12230
|
+
}) {
|
|
12231
|
+
const [uncontrolled, setUncontrolled] = useState(
|
|
12232
|
+
defaultValue !== void 0 ? defaultValue : finalValue
|
|
12233
|
+
);
|
|
12234
|
+
const handleUncontrolledChange = (val) => {
|
|
12235
|
+
setUncontrolled(val);
|
|
12236
|
+
onChange == null ? void 0 : onChange(val);
|
|
12237
|
+
};
|
|
12238
|
+
if (value !== void 0) {
|
|
12239
|
+
return [value, onChange];
|
|
12327
12240
|
}
|
|
12328
|
-
|
|
12329
|
-
e: "-",
|
|
12330
|
-
m: "_"
|
|
12331
|
-
});
|
|
12332
|
-
classname_development.cn = cn2;
|
|
12333
|
-
classname_development.withNaming = withNaming;
|
|
12334
|
-
return classname_development;
|
|
12241
|
+
return [uncontrolled, handleUncontrolledChange];
|
|
12335
12242
|
}
|
|
12336
|
-
(function(module) {
|
|
12337
|
-
if (process.env.NODE_ENV === "production") {
|
|
12338
|
-
module.exports = requireClassname_production_min();
|
|
12339
|
-
} else {
|
|
12340
|
-
module.exports = requireClassname_development();
|
|
12341
|
-
}
|
|
12342
|
-
})(classname);
|
|
12343
|
-
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
12344
12243
|
const defaultProps$18 = {
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
style: {},
|
|
12353
|
-
onSwitch: (child, activeVisible) => {
|
|
12354
|
-
}
|
|
12244
|
+
...ComponentDefaults,
|
|
12245
|
+
value: "",
|
|
12246
|
+
dot: false,
|
|
12247
|
+
max: 99,
|
|
12248
|
+
top: "0",
|
|
12249
|
+
right: "5",
|
|
12250
|
+
color: ""
|
|
12355
12251
|
};
|
|
12356
|
-
const
|
|
12357
|
-
const {
|
|
12358
|
-
children,
|
|
12359
|
-
visible,
|
|
12360
|
-
activeVisible,
|
|
12361
|
-
bottom,
|
|
12362
|
-
size,
|
|
12363
|
-
activeColor,
|
|
12364
|
-
unactiveColor,
|
|
12365
|
-
safeAreaInsetBottom,
|
|
12366
|
-
className,
|
|
12367
|
-
style,
|
|
12368
|
-
onSwitch
|
|
12369
|
-
} = {
|
|
12252
|
+
const Badge = (props) => {
|
|
12253
|
+
const { className, style, value, max, children, dot, top, right, color } = {
|
|
12370
12254
|
...defaultProps$18,
|
|
12371
12255
|
...props
|
|
12372
12256
|
};
|
|
12373
|
-
const
|
|
12374
|
-
const
|
|
12375
|
-
const
|
|
12376
|
-
|
|
12377
|
-
|
|
12257
|
+
const classPrefix2 = "nut-badge";
|
|
12258
|
+
const classes = classNames(classPrefix2, className);
|
|
12259
|
+
const contentClasses = classNames(
|
|
12260
|
+
{ [`${classPrefix2}__dot`]: dot },
|
|
12261
|
+
`${classPrefix2}__content`,
|
|
12262
|
+
`${classPrefix2}__sup`
|
|
12263
|
+
);
|
|
12264
|
+
function content() {
|
|
12265
|
+
if (dot || typeof value === "object")
|
|
12266
|
+
return null;
|
|
12267
|
+
if (typeof value === "number" && typeof max === "number") {
|
|
12268
|
+
return max < value ? `${max}+` : value;
|
|
12378
12269
|
}
|
|
12270
|
+
return value;
|
|
12271
|
+
}
|
|
12272
|
+
const getStyle = () => {
|
|
12273
|
+
const style2 = {};
|
|
12274
|
+
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
12275
|
+
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
12276
|
+
style2.background = color;
|
|
12277
|
+
return style2;
|
|
12379
12278
|
};
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
}
|
|
12384
|
-
}
|
|
12385
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12386
|
-
"div",
|
|
12387
|
-
{
|
|
12388
|
-
className: [
|
|
12389
|
-
`${b()}`,
|
|
12390
|
-
bottom ? `${b("bottom")}` : "",
|
|
12391
|
-
safeAreaInsetBottom ? `${b("bottom")} ${b("safebottom")}` : "",
|
|
12392
|
-
className
|
|
12393
|
-
].join(" "),
|
|
12394
|
-
style,
|
|
12395
|
-
children: React__default.Children.map(children, (child, idx) => {
|
|
12396
|
-
if (!React__default.isValidElement(child)) {
|
|
12397
|
-
return null;
|
|
12398
|
-
}
|
|
12399
|
-
const childProps = {
|
|
12400
|
-
...child.props,
|
|
12401
|
-
active: idx === selectIndex,
|
|
12402
|
-
index: idx,
|
|
12403
|
-
unactiveColor,
|
|
12404
|
-
activeColor,
|
|
12405
|
-
size,
|
|
12406
|
-
handleClick: () => {
|
|
12407
|
-
handleClick2(idx);
|
|
12408
|
-
onSwitch(child, idx);
|
|
12409
|
-
}
|
|
12410
|
-
};
|
|
12411
|
-
return React__default.cloneElement(child, childProps);
|
|
12412
|
-
})
|
|
12413
|
-
}
|
|
12414
|
-
);
|
|
12279
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, children: [
|
|
12280
|
+
typeof value === "object" && value && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__icon`, children: value }),
|
|
12281
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
|
|
12282
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
12283
|
+
] });
|
|
12415
12284
|
};
|
|
12416
|
-
|
|
12417
|
-
|
|
12285
|
+
Badge.defaultProps = defaultProps$18;
|
|
12286
|
+
Badge.displayName = "NutBadge";
|
|
12418
12287
|
const defaultProps$17 = {
|
|
12419
12288
|
...ComponentDefaults,
|
|
12420
|
-
|
|
12421
|
-
className: "",
|
|
12422
|
-
tabTitle: "",
|
|
12289
|
+
title: "",
|
|
12423
12290
|
icon: null,
|
|
12424
|
-
href: "",
|
|
12425
|
-
num: "",
|
|
12426
12291
|
active: false,
|
|
12427
|
-
activeColor: "",
|
|
12428
|
-
unactiveColor: "",
|
|
12429
12292
|
index: 0,
|
|
12430
12293
|
handleClick: (idx) => {
|
|
12431
12294
|
}
|
|
12432
12295
|
};
|
|
12433
12296
|
const TabbarItem = (props) => {
|
|
12434
12297
|
const {
|
|
12435
|
-
dot,
|
|
12436
12298
|
className,
|
|
12437
12299
|
style,
|
|
12438
|
-
|
|
12300
|
+
title,
|
|
12439
12301
|
icon,
|
|
12440
|
-
href,
|
|
12441
|
-
num,
|
|
12442
12302
|
active,
|
|
12443
12303
|
activeColor,
|
|
12444
|
-
|
|
12304
|
+
inactiveColor,
|
|
12445
12305
|
index,
|
|
12446
|
-
handleClick: handleClick2
|
|
12306
|
+
handleClick: handleClick2,
|
|
12307
|
+
...rest
|
|
12447
12308
|
} = {
|
|
12448
12309
|
...defaultProps$17,
|
|
12449
12310
|
...props
|
|
12450
12311
|
};
|
|
12451
|
-
const
|
|
12452
|
-
const
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12312
|
+
const classPrefix2 = "nut-tabbar-item";
|
|
12313
|
+
const tabbarItemClass = classNames(className, classPrefix2, {
|
|
12314
|
+
[`${classPrefix2}-active`]: active
|
|
12315
|
+
});
|
|
12316
|
+
const boxPrefix = `${classPrefix2}__icon-box`;
|
|
12317
|
+
const titleClass = classNames(boxPrefix, `${boxPrefix}-nav`, {
|
|
12318
|
+
[`${boxPrefix}-large`]: !icon
|
|
12319
|
+
});
|
|
12320
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12459
12321
|
"div",
|
|
12460
12322
|
{
|
|
12461
|
-
className:
|
|
12323
|
+
className: tabbarItemClass,
|
|
12462
12324
|
style: {
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
},
|
|
12466
|
-
onClick: () => {
|
|
12467
|
-
handleClick2(index);
|
|
12325
|
+
color: active ? activeColor : inactiveColor,
|
|
12326
|
+
...style
|
|
12468
12327
|
},
|
|
12328
|
+
onClick: () => handleClick2(index),
|
|
12329
|
+
children: icon ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12330
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: boxPrefix, children: icon }) }),
|
|
12331
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: titleClass, children: title })
|
|
12332
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: titleClass, children: title }) })
|
|
12333
|
+
}
|
|
12334
|
+
);
|
|
12335
|
+
};
|
|
12336
|
+
const defaultProps$16 = {
|
|
12337
|
+
...ComponentDefaults,
|
|
12338
|
+
defaultValue: 0,
|
|
12339
|
+
fixed: false,
|
|
12340
|
+
inactiveColor: "",
|
|
12341
|
+
activeColor: "",
|
|
12342
|
+
safeArea: false,
|
|
12343
|
+
onSwitch: (value) => {
|
|
12344
|
+
}
|
|
12345
|
+
};
|
|
12346
|
+
const Tabbar = (props) => {
|
|
12347
|
+
const {
|
|
12348
|
+
children,
|
|
12349
|
+
defaultValue,
|
|
12350
|
+
value,
|
|
12351
|
+
fixed,
|
|
12352
|
+
activeColor,
|
|
12353
|
+
inactiveColor,
|
|
12354
|
+
safeArea,
|
|
12355
|
+
className,
|
|
12356
|
+
style,
|
|
12357
|
+
onSwitch
|
|
12358
|
+
} = {
|
|
12359
|
+
...defaultProps$16,
|
|
12360
|
+
...props
|
|
12361
|
+
};
|
|
12362
|
+
const classPrefix2 = "nut-tabbar";
|
|
12363
|
+
const [selectIndex, setSelectIndex] = usePropsValue({
|
|
12364
|
+
value,
|
|
12365
|
+
defaultValue,
|
|
12366
|
+
finalValue: 0,
|
|
12367
|
+
onChange: onSwitch
|
|
12368
|
+
});
|
|
12369
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12370
|
+
"div",
|
|
12371
|
+
{
|
|
12372
|
+
className: classNames(classPrefix2, className, {
|
|
12373
|
+
[`${classPrefix2}__fixed`]: fixed
|
|
12374
|
+
}),
|
|
12375
|
+
style,
|
|
12469
12376
|
children: [
|
|
12470
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
12471
|
-
!
|
|
12472
|
-
|
|
12473
|
-
num && num >= 100 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${bIcon("tips", [bIcon("nums")])}`, children: "99+" })
|
|
12474
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${bIcon("tips", [bIcon("dot")])}` }),
|
|
12475
|
-
icon || null
|
|
12476
|
-
] }),
|
|
12477
|
-
tabTitle && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12478
|
-
"div",
|
|
12479
|
-
{
|
|
12480
|
-
className: bIcon({ "nav-word": true }, [
|
|
12481
|
-
bIcon({ "big-word": !icon })
|
|
12482
|
-
]),
|
|
12483
|
-
children: tabTitle
|
|
12377
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__wrap`, children: React__default.Children.map(children, (child, idx) => {
|
|
12378
|
+
if (!React__default.isValidElement(child)) {
|
|
12379
|
+
return null;
|
|
12484
12380
|
}
|
|
12485
|
-
|
|
12381
|
+
const childProps = {
|
|
12382
|
+
...child.props,
|
|
12383
|
+
active: idx === selectIndex,
|
|
12384
|
+
index: idx,
|
|
12385
|
+
inactiveColor,
|
|
12386
|
+
activeColor,
|
|
12387
|
+
handleClick: setSelectIndex
|
|
12388
|
+
};
|
|
12389
|
+
return React__default.cloneElement(child, childProps);
|
|
12390
|
+
}) }),
|
|
12391
|
+
(fixed || safeArea) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__safe-area` })
|
|
12486
12392
|
]
|
|
12487
12393
|
}
|
|
12488
12394
|
);
|
|
12489
12395
|
};
|
|
12490
|
-
|
|
12396
|
+
Tabbar.defaultProps = defaultProps$16;
|
|
12397
|
+
Tabbar.displayName = "NutTabbar";
|
|
12398
|
+
Tabbar.Item = TabbarItem;
|
|
12399
|
+
const defaultProps$15 = {
|
|
12491
12400
|
title: "",
|
|
12492
12401
|
value: "",
|
|
12493
12402
|
disabled: false
|
|
12494
12403
|
};
|
|
12495
12404
|
const TabPane = (props) => {
|
|
12496
12405
|
const { children, autoHeightClassName, className, disabled } = {
|
|
12497
|
-
...defaultProps$
|
|
12406
|
+
...defaultProps$15,
|
|
12498
12407
|
...props
|
|
12499
12408
|
};
|
|
12500
12409
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -12521,26 +12430,7 @@ function requestAniFrame() {
|
|
|
12521
12430
|
}
|
|
12522
12431
|
}
|
|
12523
12432
|
const requestAniFrame$1 = requestAniFrame();
|
|
12524
|
-
|
|
12525
|
-
value,
|
|
12526
|
-
defaultValue,
|
|
12527
|
-
finalValue,
|
|
12528
|
-
onChange = (value2) => {
|
|
12529
|
-
}
|
|
12530
|
-
}) {
|
|
12531
|
-
const [uncontrolled, setUncontrolled] = useState(
|
|
12532
|
-
defaultValue !== void 0 ? defaultValue : finalValue
|
|
12533
|
-
);
|
|
12534
|
-
const handleUncontrolledChange = (val) => {
|
|
12535
|
-
setUncontrolled(val);
|
|
12536
|
-
onChange == null ? void 0 : onChange(val);
|
|
12537
|
-
};
|
|
12538
|
-
if (value !== void 0) {
|
|
12539
|
-
return [value, onChange];
|
|
12540
|
-
}
|
|
12541
|
-
return [uncontrolled, handleUncontrolledChange];
|
|
12542
|
-
}
|
|
12543
|
-
const defaultProps$15 = {
|
|
12433
|
+
const defaultProps$14 = {
|
|
12544
12434
|
...ComponentDefaults,
|
|
12545
12435
|
tabStyle: {},
|
|
12546
12436
|
activeColor: "",
|
|
@@ -12549,7 +12439,7 @@ const defaultProps$15 = {
|
|
|
12549
12439
|
duration: 300,
|
|
12550
12440
|
autoHeight: false
|
|
12551
12441
|
};
|
|
12552
|
-
const classPrefix$
|
|
12442
|
+
const classPrefix$4 = "nut-tabs";
|
|
12553
12443
|
const Tabs = (props) => {
|
|
12554
12444
|
const {
|
|
12555
12445
|
activeColor,
|
|
@@ -12566,7 +12456,7 @@ const Tabs = (props) => {
|
|
|
12566
12456
|
autoHeight,
|
|
12567
12457
|
...rest
|
|
12568
12458
|
} = {
|
|
12569
|
-
...defaultProps$
|
|
12459
|
+
...defaultProps$14,
|
|
12570
12460
|
...props
|
|
12571
12461
|
};
|
|
12572
12462
|
const [value, setValue] = usePropsValue({
|
|
@@ -12628,14 +12518,14 @@ const Tabs = (props) => {
|
|
|
12628
12518
|
};
|
|
12629
12519
|
const titles = useRef(getTitles());
|
|
12630
12520
|
const classes = classNames(
|
|
12631
|
-
classPrefix$
|
|
12632
|
-
`${classPrefix$
|
|
12521
|
+
classPrefix$4,
|
|
12522
|
+
`${classPrefix$4}--${direction}`,
|
|
12633
12523
|
className
|
|
12634
12524
|
);
|
|
12635
|
-
const classesTitle = classNames(`${classPrefix$
|
|
12636
|
-
[`${classPrefix$
|
|
12637
|
-
[`${classPrefix$
|
|
12638
|
-
[`${classPrefix$
|
|
12525
|
+
const classesTitle = classNames(`${classPrefix$4}__titles`, {
|
|
12526
|
+
[`${classPrefix$4}__titles--${activeType}`]: activeType,
|
|
12527
|
+
[`${classPrefix$4}__titles--scrollable`]: true,
|
|
12528
|
+
[`${classPrefix$4}__titles--${align}`]: align
|
|
12639
12529
|
});
|
|
12640
12530
|
const tabsActiveStyle = {
|
|
12641
12531
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -12664,7 +12554,7 @@ const Tabs = (props) => {
|
|
|
12664
12554
|
onClick: (e) => {
|
|
12665
12555
|
tabChange(item);
|
|
12666
12556
|
},
|
|
12667
|
-
className: classNames(`${classPrefix$
|
|
12557
|
+
className: classNames(`${classPrefix$4}__titles-item`, {
|
|
12668
12558
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
12669
12559
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
12670
12560
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -12674,14 +12564,14 @@ const Tabs = (props) => {
|
|
|
12674
12564
|
activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12675
12565
|
"div",
|
|
12676
12566
|
{
|
|
12677
|
-
className: `${classPrefix$
|
|
12567
|
+
className: `${classPrefix$4}__titles-item__line`,
|
|
12678
12568
|
style: tabsActiveStyle
|
|
12679
12569
|
}
|
|
12680
12570
|
),
|
|
12681
12571
|
activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12682
12572
|
"div",
|
|
12683
12573
|
{
|
|
12684
|
-
className: `${classPrefix$
|
|
12574
|
+
className: `${classPrefix$4}__titles-item__smile`,
|
|
12685
12575
|
style: tabsActiveStyle,
|
|
12686
12576
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(x$7, { color: activeColor, width: 40, height: 20 })
|
|
12687
12577
|
}
|
|
@@ -12693,7 +12583,7 @@ const Tabs = (props) => {
|
|
|
12693
12583
|
{
|
|
12694
12584
|
ellipsis: true
|
|
12695
12585
|
},
|
|
12696
|
-
`${classPrefix$
|
|
12586
|
+
`${classPrefix$4}__titles-item__text`
|
|
12697
12587
|
),
|
|
12698
12588
|
children: item.title
|
|
12699
12589
|
}
|
|
@@ -12703,28 +12593,148 @@ const Tabs = (props) => {
|
|
|
12703
12593
|
item.value
|
|
12704
12594
|
);
|
|
12705
12595
|
}) }),
|
|
12706
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
12596
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$4}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$4}__content`, style: contentStyle, children: React__default.Children.map(children, (child, idx) => {
|
|
12707
12597
|
if (!React__default.isValidElement(child)) {
|
|
12708
12598
|
return null;
|
|
12709
12599
|
}
|
|
12710
|
-
let childProps = {
|
|
12711
|
-
...child.props,
|
|
12712
|
-
active: value === child.props.value
|
|
12600
|
+
let childProps = {
|
|
12601
|
+
...child.props,
|
|
12602
|
+
active: value === child.props.value
|
|
12603
|
+
};
|
|
12604
|
+
if (String(value) !== String(child.props.value || idx) && autoHeight) {
|
|
12605
|
+
childProps = {
|
|
12606
|
+
...childProps,
|
|
12607
|
+
autoHeightClassName: "inactive"
|
|
12608
|
+
};
|
|
12609
|
+
}
|
|
12610
|
+
return React__default.cloneElement(child, childProps);
|
|
12611
|
+
}) }) })
|
|
12612
|
+
] });
|
|
12613
|
+
};
|
|
12614
|
+
Tabs.defaultProps = defaultProps$14;
|
|
12615
|
+
Tabs.displayName = "NutTabs";
|
|
12616
|
+
Tabs.TabPane = TabPane;
|
|
12617
|
+
var classnameExports = {};
|
|
12618
|
+
var classname = {
|
|
12619
|
+
get exports() {
|
|
12620
|
+
return classnameExports;
|
|
12621
|
+
},
|
|
12622
|
+
set exports(v) {
|
|
12623
|
+
classnameExports = v;
|
|
12624
|
+
}
|
|
12625
|
+
};
|
|
12626
|
+
var classname_production_min = {};
|
|
12627
|
+
var hasRequiredClassname_production_min;
|
|
12628
|
+
function requireClassname_production_min() {
|
|
12629
|
+
if (hasRequiredClassname_production_min)
|
|
12630
|
+
return classname_production_min;
|
|
12631
|
+
hasRequiredClassname_production_min = 1;
|
|
12632
|
+
function r(r2) {
|
|
12633
|
+
function t2(t3, i, a2, o) {
|
|
12634
|
+
var f = i ? e + t3 + r2.e + i : e + t3, v = f;
|
|
12635
|
+
if (a2) {
|
|
12636
|
+
var s = " " + v + r2.m;
|
|
12637
|
+
for (var u in a2)
|
|
12638
|
+
if (a2.hasOwnProperty(u)) {
|
|
12639
|
+
var p = a2[u];
|
|
12640
|
+
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
12641
|
+
}
|
|
12642
|
+
}
|
|
12643
|
+
if (void 0 !== o)
|
|
12644
|
+
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
12645
|
+
var l2 = o[y2];
|
|
12646
|
+
if (l2 && "string" == typeof l2.valueOf())
|
|
12647
|
+
for (var g = l2.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
12648
|
+
var h = g[d];
|
|
12649
|
+
h !== f && (v += " " + h);
|
|
12650
|
+
}
|
|
12651
|
+
}
|
|
12652
|
+
return v;
|
|
12653
|
+
}
|
|
12654
|
+
var e = r2.n || "", n = r2.v || r2.m;
|
|
12655
|
+
return function(r3, e2) {
|
|
12656
|
+
return function(n2, i, a2) {
|
|
12657
|
+
return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r3, n2, void 0, i) : t2(r3, n2, i, a2) : t2(r3, e2, n2, i);
|
|
12713
12658
|
};
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12659
|
+
};
|
|
12660
|
+
}
|
|
12661
|
+
Object.defineProperty(classname_production_min, "__esModule", { value: true });
|
|
12662
|
+
var t = r({ e: "-", m: "_" });
|
|
12663
|
+
classname_production_min.cn = t, classname_production_min.withNaming = r;
|
|
12664
|
+
return classname_production_min;
|
|
12665
|
+
}
|
|
12666
|
+
var classname_development = {};
|
|
12667
|
+
var hasRequiredClassname_development;
|
|
12668
|
+
function requireClassname_development() {
|
|
12669
|
+
if (hasRequiredClassname_development)
|
|
12670
|
+
return classname_development;
|
|
12671
|
+
hasRequiredClassname_development = 1;
|
|
12672
|
+
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
12673
|
+
function withNaming(preset) {
|
|
12674
|
+
var nameSpace = preset.n || "";
|
|
12675
|
+
var modValueDelimiter = preset.v || preset.m;
|
|
12676
|
+
function stringify(b, e, m, mix) {
|
|
12677
|
+
var entityName = e ? nameSpace + b + preset.e + e : nameSpace + b;
|
|
12678
|
+
var className = entityName;
|
|
12679
|
+
if (m) {
|
|
12680
|
+
var modPrefix = " " + className + preset.m;
|
|
12681
|
+
for (var k2 in m) {
|
|
12682
|
+
if (m.hasOwnProperty(k2)) {
|
|
12683
|
+
var modVal = m[k2];
|
|
12684
|
+
if (modVal === true) {
|
|
12685
|
+
className += modPrefix + k2;
|
|
12686
|
+
} else if (modVal) {
|
|
12687
|
+
className += modPrefix + k2 + modValueDelimiter + modVal;
|
|
12688
|
+
}
|
|
12689
|
+
}
|
|
12690
|
+
}
|
|
12719
12691
|
}
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12692
|
+
if (mix !== void 0) {
|
|
12693
|
+
mix = Array.isArray(mix) ? mix : [mix];
|
|
12694
|
+
for (var i = 0, len = mix.length; i < len; i++) {
|
|
12695
|
+
var value = mix[i];
|
|
12696
|
+
if (!value || typeof value.valueOf() !== "string")
|
|
12697
|
+
continue;
|
|
12698
|
+
var mixes = value.valueOf().split(" ");
|
|
12699
|
+
for (var j = 0; j < mixes.length; j++) {
|
|
12700
|
+
var val = mixes[j];
|
|
12701
|
+
if (val !== entityName) {
|
|
12702
|
+
className += " " + val;
|
|
12703
|
+
}
|
|
12704
|
+
}
|
|
12705
|
+
}
|
|
12706
|
+
}
|
|
12707
|
+
return className;
|
|
12708
|
+
}
|
|
12709
|
+
return function cnGenerator(b, e) {
|
|
12710
|
+
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
12711
|
+
if (typeof elemOrMods === "string") {
|
|
12712
|
+
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
12713
|
+
return stringify(b, elemOrMods, void 0, elemModsOrBlockMix);
|
|
12714
|
+
}
|
|
12715
|
+
return stringify(b, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
12716
|
+
}
|
|
12717
|
+
return stringify(b, e, elemOrMods, elemModsOrBlockMix);
|
|
12718
|
+
};
|
|
12719
|
+
};
|
|
12720
|
+
}
|
|
12721
|
+
var cn2 = withNaming({
|
|
12722
|
+
e: "-",
|
|
12723
|
+
m: "_"
|
|
12724
|
+
});
|
|
12725
|
+
classname_development.cn = cn2;
|
|
12726
|
+
classname_development.withNaming = withNaming;
|
|
12727
|
+
return classname_development;
|
|
12728
|
+
}
|
|
12729
|
+
(function(module) {
|
|
12730
|
+
if (process.env.NODE_ENV === "production") {
|
|
12731
|
+
module.exports = requireClassname_production_min();
|
|
12732
|
+
} else {
|
|
12733
|
+
module.exports = requireClassname_development();
|
|
12734
|
+
}
|
|
12735
|
+
})(classname);
|
|
12736
|
+
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
12737
|
+
const defaultProps$13 = {
|
|
12728
12738
|
type: "custom",
|
|
12729
12739
|
existAddress: [],
|
|
12730
12740
|
defaultIcon: null,
|
|
@@ -12746,7 +12756,7 @@ const ExistRender = (props) => {
|
|
|
12746
12756
|
onClose,
|
|
12747
12757
|
onSwitchModule,
|
|
12748
12758
|
...rest
|
|
12749
|
-
} = { ...defaultProps$
|
|
12759
|
+
} = { ...defaultProps$13, ...props };
|
|
12750
12760
|
const b = cn("address");
|
|
12751
12761
|
const selectedExist = (item) => {
|
|
12752
12762
|
const copyExistAdd = existAddress;
|
|
@@ -12788,7 +12798,7 @@ const ExistRender = (props) => {
|
|
|
12788
12798
|
isShowCustomAddress && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("choose-other"), onClick: onSwitch, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b("choose-other-btn"), children: customAndExistTitle || locale.address.chooseAnotherAddress }) })
|
|
12789
12799
|
] });
|
|
12790
12800
|
};
|
|
12791
|
-
const defaultProps$
|
|
12801
|
+
const defaultProps$12 = {
|
|
12792
12802
|
modelValue: [],
|
|
12793
12803
|
type: "custom",
|
|
12794
12804
|
province: [],
|
|
@@ -12813,7 +12823,7 @@ const CustomRender = (props) => {
|
|
|
12813
12823
|
onClose,
|
|
12814
12824
|
...rest
|
|
12815
12825
|
} = {
|
|
12816
|
-
...defaultProps$
|
|
12826
|
+
...defaultProps$12,
|
|
12817
12827
|
...props
|
|
12818
12828
|
};
|
|
12819
12829
|
const b = cn("address");
|
|
@@ -12982,28 +12992,28 @@ const CustomRender = (props) => {
|
|
|
12982
12992
|
nextAreaList(item);
|
|
12983
12993
|
};
|
|
12984
12994
|
useEffect(() => {
|
|
12985
|
-
const { province: province2 } = { ...defaultProps$
|
|
12995
|
+
const { province: province2 } = { ...defaultProps$12, ...props };
|
|
12986
12996
|
setRegionList({
|
|
12987
12997
|
...regionList,
|
|
12988
12998
|
province: isCustom2() ? transformData(province2) : province2
|
|
12989
12999
|
});
|
|
12990
13000
|
}, [province]);
|
|
12991
13001
|
useEffect(() => {
|
|
12992
|
-
const { city: city2 } = { ...defaultProps$
|
|
13002
|
+
const { city: city2 } = { ...defaultProps$12, ...props };
|
|
12993
13003
|
setRegionList({
|
|
12994
13004
|
...regionList,
|
|
12995
13005
|
city: isCustom2() ? transformData(city2) : city2
|
|
12996
13006
|
});
|
|
12997
13007
|
}, [city]);
|
|
12998
13008
|
useEffect(() => {
|
|
12999
|
-
const { country: country2 } = { ...defaultProps$
|
|
13009
|
+
const { country: country2 } = { ...defaultProps$12, ...props };
|
|
13000
13010
|
setRegionList({
|
|
13001
13011
|
...regionList,
|
|
13002
13012
|
country: isCustom2() ? transformData(country2) : country2
|
|
13003
13013
|
});
|
|
13004
13014
|
}, [country]);
|
|
13005
13015
|
useEffect(() => {
|
|
13006
|
-
const { town: town2 } = { ...defaultProps$
|
|
13016
|
+
const { town: town2 } = { ...defaultProps$12, ...props };
|
|
13007
13017
|
setRegionList({
|
|
13008
13018
|
...regionList,
|
|
13009
13019
|
town: isCustom2() ? transformData(town2) : town2
|
|
@@ -13078,7 +13088,7 @@ const CustomRender = (props) => {
|
|
|
13078
13088
|
) })
|
|
13079
13089
|
] });
|
|
13080
13090
|
};
|
|
13081
|
-
const defaultProps$
|
|
13091
|
+
const defaultProps$11 = {
|
|
13082
13092
|
...ComponentDefaults,
|
|
13083
13093
|
modelValue: false,
|
|
13084
13094
|
modelSelect: [],
|
|
@@ -13129,7 +13139,7 @@ const Address = (props) => {
|
|
|
13129
13139
|
className,
|
|
13130
13140
|
...rest
|
|
13131
13141
|
} = {
|
|
13132
|
-
...defaultProps$
|
|
13142
|
+
...defaultProps$11,
|
|
13133
13143
|
...props
|
|
13134
13144
|
};
|
|
13135
13145
|
const b = cn("address");
|
|
@@ -13287,7 +13297,7 @@ const Address = (props) => {
|
|
|
13287
13297
|
}
|
|
13288
13298
|
) });
|
|
13289
13299
|
};
|
|
13290
|
-
Address.defaultProps = defaultProps$
|
|
13300
|
+
Address.defaultProps = defaultProps$11;
|
|
13291
13301
|
Address.displayName = "NutAddress";
|
|
13292
13302
|
const Utils = {
|
|
13293
13303
|
/**
|
|
@@ -13407,7 +13417,7 @@ const Utils = {
|
|
|
13407
13417
|
return false;
|
|
13408
13418
|
}
|
|
13409
13419
|
};
|
|
13410
|
-
const defaultProps$
|
|
13420
|
+
const defaultProps$10 = {
|
|
13411
13421
|
type: "one",
|
|
13412
13422
|
isAutoBackFill: false,
|
|
13413
13423
|
poppable: true,
|
|
@@ -13459,7 +13469,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
13459
13469
|
onUpdate,
|
|
13460
13470
|
onSelected,
|
|
13461
13471
|
onYearMonthChange
|
|
13462
|
-
} = { ...defaultProps$
|
|
13472
|
+
} = { ...defaultProps$10, ...props };
|
|
13463
13473
|
const weeks = locale.calendaritem.weekdays;
|
|
13464
13474
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
13465
13475
|
const [monthsData, setMonthsData] = useState([]);
|
|
@@ -14055,9 +14065,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
14055
14065
|
poppable && !isAutoBackFill ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-calendar-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "calendar-confirm-btn", onClick: confirm2, children: confirmText || locale.confirm }) }) : ""
|
|
14056
14066
|
] }) });
|
|
14057
14067
|
});
|
|
14058
|
-
CalendarItem.defaultProps = defaultProps$
|
|
14068
|
+
CalendarItem.defaultProps = defaultProps$10;
|
|
14059
14069
|
CalendarItem.displayName = "NutCalendarItem";
|
|
14060
|
-
const defaultProps
|
|
14070
|
+
const defaultProps$$ = {
|
|
14061
14071
|
type: "one",
|
|
14062
14072
|
isAutoBackFill: false,
|
|
14063
14073
|
poppable: true,
|
|
@@ -14112,7 +14122,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
14112
14122
|
onChoose,
|
|
14113
14123
|
onSelected,
|
|
14114
14124
|
onYearMonthChange
|
|
14115
|
-
} = { ...defaultProps
|
|
14125
|
+
} = { ...defaultProps$$, ...props };
|
|
14116
14126
|
const calendarRef = useRef(null);
|
|
14117
14127
|
const close = () => {
|
|
14118
14128
|
onClose && onClose();
|
|
@@ -14182,9 +14192,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
14182
14192
|
}
|
|
14183
14193
|
) : renderItem() });
|
|
14184
14194
|
});
|
|
14185
|
-
Calendar.defaultProps = defaultProps
|
|
14195
|
+
Calendar.defaultProps = defaultProps$$;
|
|
14186
14196
|
Calendar.displayName = "NutCalendar";
|
|
14187
|
-
const defaultProps
|
|
14197
|
+
const defaultProps$_ = {
|
|
14188
14198
|
data: {
|
|
14189
14199
|
text: "",
|
|
14190
14200
|
value: "",
|
|
@@ -14201,7 +14211,7 @@ const defaultProps$$ = {
|
|
|
14201
14211
|
};
|
|
14202
14212
|
const InternalCascaderItem = (props, ref) => {
|
|
14203
14213
|
const { data, checked, checkedIcon, chooseItem, activeColor } = {
|
|
14204
|
-
...defaultProps
|
|
14214
|
+
...defaultProps$_,
|
|
14205
14215
|
...props
|
|
14206
14216
|
};
|
|
14207
14217
|
const b = cn("cascader-item");
|
|
@@ -14240,7 +14250,7 @@ const InternalCascaderItem = (props, ref) => {
|
|
|
14240
14250
|
);
|
|
14241
14251
|
};
|
|
14242
14252
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
14243
|
-
CascaderItem.defaultProps = defaultProps
|
|
14253
|
+
CascaderItem.defaultProps = defaultProps$_;
|
|
14244
14254
|
CascaderItem.displayName = "NutCascaderItem";
|
|
14245
14255
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
14246
14256
|
const {
|
|
@@ -14378,7 +14388,7 @@ class Tree {
|
|
|
14378
14388
|
}
|
|
14379
14389
|
}
|
|
14380
14390
|
const Tree$1 = Tree;
|
|
14381
|
-
const defaultProps$
|
|
14391
|
+
const defaultProps$Z = {
|
|
14382
14392
|
className: "",
|
|
14383
14393
|
style: {},
|
|
14384
14394
|
activeColor: "",
|
|
@@ -14429,7 +14439,7 @@ const InternalCascader = (props, ref) => {
|
|
|
14429
14439
|
onClose,
|
|
14430
14440
|
onChange,
|
|
14431
14441
|
onPathChange
|
|
14432
|
-
} = { ...defaultProps$
|
|
14442
|
+
} = { ...defaultProps$Z, ...props };
|
|
14433
14443
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
14434
14444
|
const [optionsData, setOptionsData] = useState([]);
|
|
14435
14445
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
@@ -14704,11 +14714,11 @@ const InternalCascader = (props, ref) => {
|
|
|
14704
14714
|
) : renderItem() });
|
|
14705
14715
|
};
|
|
14706
14716
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
14707
|
-
Cascader.defaultProps = defaultProps$
|
|
14717
|
+
Cascader.defaultProps = defaultProps$Z;
|
|
14708
14718
|
Cascader.displayName = "NutCascader";
|
|
14709
14719
|
const CheckboxGroupContext = createContext(null);
|
|
14710
14720
|
const Context = CheckboxGroupContext;
|
|
14711
|
-
const defaultProps$
|
|
14721
|
+
const defaultProps$Y = {
|
|
14712
14722
|
disabled: false,
|
|
14713
14723
|
max: void 0,
|
|
14714
14724
|
textPosition: "right",
|
|
@@ -14719,7 +14729,7 @@ const defaultProps$Z = {
|
|
|
14719
14729
|
};
|
|
14720
14730
|
const CheckboxGroup = React__default.forwardRef(
|
|
14721
14731
|
(props, ref) => {
|
|
14722
|
-
const { children } = { ...defaultProps$
|
|
14732
|
+
const { children } = { ...defaultProps$Y, ...props };
|
|
14723
14733
|
const b = cn("checkboxgroup");
|
|
14724
14734
|
const {
|
|
14725
14735
|
className,
|
|
@@ -14808,9 +14818,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
14808
14818
|
);
|
|
14809
14819
|
}
|
|
14810
14820
|
);
|
|
14811
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
14821
|
+
CheckboxGroup.defaultProps = defaultProps$Y;
|
|
14812
14822
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
14813
|
-
const defaultProps$
|
|
14823
|
+
const defaultProps$X = {
|
|
14814
14824
|
...ComponentDefaults,
|
|
14815
14825
|
disabled: false,
|
|
14816
14826
|
textPosition: "right",
|
|
@@ -14825,7 +14835,7 @@ const defaultProps$Y = {
|
|
|
14825
14835
|
};
|
|
14826
14836
|
const Checkbox = (props) => {
|
|
14827
14837
|
const { children } = {
|
|
14828
|
-
...defaultProps$
|
|
14838
|
+
...defaultProps$X,
|
|
14829
14839
|
...props
|
|
14830
14840
|
};
|
|
14831
14841
|
const b = cn("checkbox");
|
|
@@ -14923,7 +14933,7 @@ const Checkbox = (props) => {
|
|
|
14923
14933
|
}
|
|
14924
14934
|
);
|
|
14925
14935
|
};
|
|
14926
|
-
Checkbox.defaultProps = defaultProps$
|
|
14936
|
+
Checkbox.defaultProps = defaultProps$X;
|
|
14927
14937
|
Checkbox.displayName = "NutCheckBox";
|
|
14928
14938
|
Checkbox.Group = CheckboxGroup;
|
|
14929
14939
|
const MIN_DISTANCE = 10;
|
|
@@ -15430,7 +15440,7 @@ const InternalPicker = (props, ref) => {
|
|
|
15430
15440
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
15431
15441
|
const Picker$1 = Picker;
|
|
15432
15442
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
15433
|
-
const defaultProps$
|
|
15443
|
+
const defaultProps$W = {
|
|
15434
15444
|
modelValue: null,
|
|
15435
15445
|
visible: false,
|
|
15436
15446
|
title: "",
|
|
@@ -15461,7 +15471,7 @@ const DatePicker = (props) => {
|
|
|
15461
15471
|
style,
|
|
15462
15472
|
...rest
|
|
15463
15473
|
} = {
|
|
15464
|
-
...defaultProps$
|
|
15474
|
+
...defaultProps$W,
|
|
15465
15475
|
...props
|
|
15466
15476
|
};
|
|
15467
15477
|
const { locale } = useConfig();
|
|
@@ -15738,7 +15748,7 @@ const DatePicker = (props) => {
|
|
|
15738
15748
|
}
|
|
15739
15749
|
);
|
|
15740
15750
|
};
|
|
15741
|
-
DatePicker.defaultProps = defaultProps$
|
|
15751
|
+
DatePicker.defaultProps = defaultProps$W;
|
|
15742
15752
|
DatePicker.displayName = "NutDatePicker";
|
|
15743
15753
|
const FormItemContext = createContext({});
|
|
15744
15754
|
function _extends() {
|
|
@@ -16929,7 +16939,7 @@ const useForm = (form) => {
|
|
|
16929
16939
|
}
|
|
16930
16940
|
return [formRef.current];
|
|
16931
16941
|
};
|
|
16932
|
-
const defaultProps$
|
|
16942
|
+
const defaultProps$V = {
|
|
16933
16943
|
...ComponentDefaults,
|
|
16934
16944
|
name: "",
|
|
16935
16945
|
label: "",
|
|
@@ -16991,7 +17001,7 @@ class FormItem extends React__default.Component {
|
|
|
16991
17001
|
showErrorLine,
|
|
16992
17002
|
showErrorMessage
|
|
16993
17003
|
} = {
|
|
16994
|
-
...defaultProps$
|
|
17004
|
+
...defaultProps$V,
|
|
16995
17005
|
...this.props
|
|
16996
17006
|
};
|
|
16997
17007
|
const item = ((_a2 = this.context.errList) == null ? void 0 : _a2.length) > 0 && ((_b = this.context.errList) == null ? void 0 : _b.filter((item2) => {
|
|
@@ -17058,9 +17068,9 @@ class FormItem extends React__default.Component {
|
|
|
17058
17068
|
return this.renderLayout(returnChildNode);
|
|
17059
17069
|
}
|
|
17060
17070
|
}
|
|
17061
|
-
__publicField(FormItem, "defaultProps", defaultProps$
|
|
17071
|
+
__publicField(FormItem, "defaultProps", defaultProps$V);
|
|
17062
17072
|
__publicField(FormItem, "contextType", FormItemContext);
|
|
17063
|
-
const defaultProps$
|
|
17073
|
+
const defaultProps$U = {
|
|
17064
17074
|
...ComponentDefaults,
|
|
17065
17075
|
className: "",
|
|
17066
17076
|
style: void 0,
|
|
@@ -17088,7 +17098,7 @@ const Form = (props) => {
|
|
|
17088
17098
|
form,
|
|
17089
17099
|
...rest
|
|
17090
17100
|
} = {
|
|
17091
|
-
...defaultProps$
|
|
17101
|
+
...defaultProps$U,
|
|
17092
17102
|
...props
|
|
17093
17103
|
};
|
|
17094
17104
|
let formInstance = {};
|
|
@@ -17112,392 +17122,225 @@ const Form = (props) => {
|
|
|
17112
17122
|
e.preventDefault();
|
|
17113
17123
|
submit();
|
|
17114
17124
|
},
|
|
17115
|
-
onReset: (e) => {
|
|
17116
|
-
e.preventDefault();
|
|
17117
|
-
resetFields();
|
|
17118
|
-
},
|
|
17119
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CellGroup, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemContext.Provider, { value: formInstance, children }) })
|
|
17120
|
-
}
|
|
17121
|
-
);
|
|
17122
|
-
};
|
|
17123
|
-
Form.defaultProps = defaultProps$V;
|
|
17124
|
-
Form.displayName = "NutForm";
|
|
17125
|
-
Form.Item = FormItem;
|
|
17126
|
-
Form.useForm = useForm;
|
|
17127
|
-
function trimExtraChar(value, char, regExp) {
|
|
17128
|
-
const index = value.indexOf(char);
|
|
17129
|
-
if (index === -1) {
|
|
17130
|
-
return value;
|
|
17131
|
-
}
|
|
17132
|
-
if (char === "-" && index !== 0) {
|
|
17133
|
-
return value.slice(0, index);
|
|
17134
|
-
}
|
|
17135
|
-
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
17136
|
-
}
|
|
17137
|
-
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
17138
|
-
if (allowDot) {
|
|
17139
|
-
value = trimExtraChar(value, ".", /\./g);
|
|
17140
|
-
} else {
|
|
17141
|
-
value = value.split(".")[0];
|
|
17142
|
-
}
|
|
17143
|
-
if (allowMinus) {
|
|
17144
|
-
value = trimExtraChar(value, "-", /-/g);
|
|
17145
|
-
} else {
|
|
17146
|
-
value = value.replace(/-/, "");
|
|
17147
|
-
}
|
|
17148
|
-
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
17149
|
-
return value.replace(regExp, "");
|
|
17150
|
-
}
|
|
17151
|
-
const defaultProps$U = {
|
|
17152
|
-
...ComponentDefaults,
|
|
17153
|
-
type: "text",
|
|
17154
|
-
name: "",
|
|
17155
|
-
defaultValue: "",
|
|
17156
|
-
placeholder: "",
|
|
17157
|
-
label: "",
|
|
17158
|
-
labelClass: "",
|
|
17159
|
-
labelWidth: "80",
|
|
17160
|
-
labelAlign: "left",
|
|
17161
|
-
colon: false,
|
|
17162
|
-
inputAlign: "left",
|
|
17163
|
-
center: false,
|
|
17164
|
-
required: false,
|
|
17165
|
-
disabled: false,
|
|
17166
|
-
readonly: false,
|
|
17167
|
-
error: false,
|
|
17168
|
-
maxlength: "9999",
|
|
17169
|
-
leftIcon: null,
|
|
17170
|
-
rightIcon: null,
|
|
17171
|
-
clearable: false,
|
|
17172
|
-
clearIcon: null,
|
|
17173
|
-
clearSize: "14",
|
|
17174
|
-
border: true,
|
|
17175
|
-
formatTrigger: "onChange",
|
|
17176
|
-
rules: [],
|
|
17177
|
-
rows: null,
|
|
17178
|
-
errorMessage: "",
|
|
17179
|
-
errorMessageAlign: "",
|
|
17180
|
-
showWordLimit: false,
|
|
17181
|
-
autofocus: false,
|
|
17182
|
-
slotButton: null,
|
|
17183
|
-
slotInput: null
|
|
17184
|
-
};
|
|
17185
|
-
const Input = forwardRef((props, ref) => {
|
|
17186
|
-
const { locale } = useConfig();
|
|
17187
|
-
const {
|
|
17188
|
-
children,
|
|
17189
|
-
type: type4,
|
|
17190
|
-
name,
|
|
17191
|
-
defaultValue,
|
|
17192
|
-
placeholder,
|
|
17193
|
-
label,
|
|
17194
|
-
labelClass,
|
|
17195
|
-
labelWidth,
|
|
17196
|
-
labelAlign,
|
|
17197
|
-
colon,
|
|
17198
|
-
inputAlign,
|
|
17199
|
-
center,
|
|
17200
|
-
required: required4,
|
|
17201
|
-
disabled,
|
|
17202
|
-
readonly,
|
|
17203
|
-
error,
|
|
17204
|
-
maxlength,
|
|
17205
|
-
leftIcon,
|
|
17206
|
-
rightIcon,
|
|
17207
|
-
clearable,
|
|
17208
|
-
clearIcon,
|
|
17209
|
-
clearSize,
|
|
17210
|
-
border,
|
|
17211
|
-
formatTrigger,
|
|
17212
|
-
rules: rules2,
|
|
17213
|
-
errorMessage,
|
|
17214
|
-
errorMessageAlign,
|
|
17215
|
-
showWordLimit,
|
|
17216
|
-
autofocus,
|
|
17217
|
-
style,
|
|
17218
|
-
className,
|
|
17219
|
-
rows,
|
|
17220
|
-
slotButton,
|
|
17221
|
-
slotInput,
|
|
17222
|
-
onChange,
|
|
17223
|
-
onBlur,
|
|
17224
|
-
onFocus,
|
|
17225
|
-
onClear,
|
|
17226
|
-
formatter,
|
|
17227
|
-
keypress,
|
|
17228
|
-
onClickInput,
|
|
17229
|
-
onClickLeftIcon,
|
|
17230
|
-
onClickRightIcon,
|
|
17231
|
-
onClick,
|
|
17232
|
-
...rest
|
|
17233
|
-
} = {
|
|
17234
|
-
...defaultProps$U,
|
|
17235
|
-
...props
|
|
17236
|
-
};
|
|
17237
|
-
const inputPlaceholder = placeholder || locale.placeholder;
|
|
17238
|
-
const [inputValue, SetInputValue] = useState("");
|
|
17239
|
-
const [active, SetActive] = useState(false);
|
|
17240
|
-
const [classes, setClasses] = useState("");
|
|
17241
|
-
const getModelValue = () => String(inputValue ?? "");
|
|
17242
|
-
const inputRef = useRef(null);
|
|
17243
|
-
useEffect(() => {
|
|
17244
|
-
setClasses(inputClass);
|
|
17245
|
-
SetInputValue(defaultValue);
|
|
17246
|
-
}, [defaultValue]);
|
|
17247
|
-
useEffect(() => {
|
|
17248
|
-
if (inputValue) {
|
|
17249
|
-
updateValue(getModelValue());
|
|
17250
|
-
resetValidation();
|
|
17251
|
-
}
|
|
17252
|
-
}, [inputValue]);
|
|
17253
|
-
useImperativeHandle(ref, () => {
|
|
17254
|
-
return inputRef.current;
|
|
17255
|
-
});
|
|
17256
|
-
const inputClass = useCallback(() => {
|
|
17257
|
-
const prefixCls2 = "nut-input";
|
|
17258
|
-
return [
|
|
17259
|
-
prefixCls2,
|
|
17260
|
-
`${center ? "center" : ""}`,
|
|
17261
|
-
`${disabled ? `${prefixCls2}-disabled` : ""}`,
|
|
17262
|
-
`${required4 ? `${prefixCls2}-required` : ""}`,
|
|
17263
|
-
`${error ? `${prefixCls2}-error` : ""}`,
|
|
17264
|
-
`${border ? `${prefixCls2}-border` : ""}`,
|
|
17265
|
-
`${slotButton || rightIcon ? `${prefixCls2}-right-mark` : ""}`
|
|
17266
|
-
].filter(Boolean).join(" ");
|
|
17267
|
-
}, [disabled, required4, error, border, slotButton, rightIcon, center]);
|
|
17268
|
-
useEffect(() => {
|
|
17269
|
-
setClasses(inputClass);
|
|
17270
|
-
}, [disabled, required4, error, border, slotButton, rightIcon, center]);
|
|
17271
|
-
const updateValue = (value, trigger = "onChange", event) => {
|
|
17272
|
-
var _a2;
|
|
17273
|
-
let val = value;
|
|
17274
|
-
if (type4 === "digit" || type4 === "tel") {
|
|
17275
|
-
val = formatNumber(val, false, false);
|
|
17276
|
-
}
|
|
17277
|
-
if (type4 === "number") {
|
|
17278
|
-
val = formatNumber(val, true, true);
|
|
17279
|
-
}
|
|
17280
|
-
if (type4 === "tel" && !formatter) {
|
|
17281
|
-
const regTel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
|
17282
|
-
const regNumber = /[^-0-9]/g;
|
|
17283
|
-
val = !regTel.test(val) && val.length > 11 ? val.substring(0, 11) : val.replace(regNumber, "");
|
|
17284
|
-
}
|
|
17285
|
-
if (formatter && trigger === formatTrigger) {
|
|
17286
|
-
val = formatter(val);
|
|
17287
|
-
}
|
|
17288
|
-
if (((_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.value) !== val) {
|
|
17289
|
-
inputRef.current.value = val;
|
|
17290
|
-
}
|
|
17291
|
-
SetInputValue(val);
|
|
17292
|
-
};
|
|
17293
|
-
const handleFocus = (event) => {
|
|
17294
|
-
const val = event.target.value;
|
|
17295
|
-
SetActive(true);
|
|
17296
|
-
onFocus && onFocus(val, event);
|
|
17297
|
-
};
|
|
17298
|
-
const handleInput = (event) => {
|
|
17299
|
-
let val = event.target.value;
|
|
17300
|
-
if (maxlength && val.length > Number(maxlength)) {
|
|
17301
|
-
val = val.slice(0, Number(maxlength));
|
|
17302
|
-
}
|
|
17303
|
-
updateValue(val, "onChange");
|
|
17304
|
-
onChange && onChange(val, event);
|
|
17305
|
-
};
|
|
17306
|
-
const handleBlur = (event) => {
|
|
17307
|
-
setTimeout(() => {
|
|
17308
|
-
SetActive(false);
|
|
17309
|
-
}, 200);
|
|
17310
|
-
let val = event.target.value;
|
|
17311
|
-
if (maxlength && val.length > Number(maxlength)) {
|
|
17312
|
-
val = val.slice(0, Number(maxlength));
|
|
17313
|
-
}
|
|
17314
|
-
updateValue(val, "onBlur");
|
|
17315
|
-
onBlur && onBlur(val, event);
|
|
17316
|
-
};
|
|
17317
|
-
const handleClickInput = (event) => {
|
|
17318
|
-
onClickInput && onClickInput(event);
|
|
17319
|
-
};
|
|
17320
|
-
const handleClickLeftIcon = (event) => {
|
|
17321
|
-
onClickLeftIcon && onClickLeftIcon(event);
|
|
17322
|
-
};
|
|
17323
|
-
const handleClickRightIcon = (event) => {
|
|
17324
|
-
onClickRightIcon && onClickRightIcon(event);
|
|
17325
|
-
};
|
|
17326
|
-
const resetValidation = () => {
|
|
17327
|
-
};
|
|
17328
|
-
const inputType = (type22) => {
|
|
17329
|
-
if (type22 === "number") {
|
|
17330
|
-
return "text";
|
|
17331
|
-
}
|
|
17332
|
-
if (type22 === "digit") {
|
|
17333
|
-
return "tel";
|
|
17125
|
+
onReset: (e) => {
|
|
17126
|
+
e.preventDefault();
|
|
17127
|
+
resetFields();
|
|
17128
|
+
},
|
|
17129
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CellGroup, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemContext.Provider, { value: formInstance, children }) })
|
|
17334
17130
|
}
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17131
|
+
);
|
|
17132
|
+
};
|
|
17133
|
+
Form.defaultProps = defaultProps$U;
|
|
17134
|
+
Form.displayName = "NutForm";
|
|
17135
|
+
Form.Item = FormItem;
|
|
17136
|
+
Form.useForm = useForm;
|
|
17137
|
+
function trimExtraChar(value, char, regExp) {
|
|
17138
|
+
const index = value.indexOf(char);
|
|
17139
|
+
if (index === -1) {
|
|
17140
|
+
return value;
|
|
17141
|
+
}
|
|
17142
|
+
if (char === "-" && index !== 0) {
|
|
17143
|
+
return value.slice(0, index);
|
|
17144
|
+
}
|
|
17145
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
17146
|
+
}
|
|
17147
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
17148
|
+
if (allowDot) {
|
|
17149
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
17150
|
+
} else {
|
|
17151
|
+
value = value.split(".")[0];
|
|
17152
|
+
}
|
|
17153
|
+
if (allowMinus) {
|
|
17154
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
17155
|
+
} else {
|
|
17156
|
+
value = value.replace(/-/, "");
|
|
17157
|
+
}
|
|
17158
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
17159
|
+
return value.replace(regExp, "");
|
|
17160
|
+
}
|
|
17161
|
+
const defaultProps$T = {
|
|
17162
|
+
...ComponentDefaults,
|
|
17163
|
+
type: "text",
|
|
17164
|
+
name: "",
|
|
17165
|
+
placeholder: "",
|
|
17166
|
+
confirmType: "done",
|
|
17167
|
+
align: "left",
|
|
17168
|
+
required: false,
|
|
17169
|
+
disabled: false,
|
|
17170
|
+
readOnly: false,
|
|
17171
|
+
maxLength: 9999,
|
|
17172
|
+
clearable: false,
|
|
17173
|
+
clearIcon: null,
|
|
17174
|
+
formatTrigger: "onChange",
|
|
17175
|
+
autoFocus: false
|
|
17176
|
+
};
|
|
17177
|
+
const Input = forwardRef(
|
|
17178
|
+
(props, ref) => {
|
|
17179
|
+
const { locale } = useConfig();
|
|
17180
|
+
const {
|
|
17181
|
+
type: type4,
|
|
17182
|
+
name,
|
|
17183
|
+
placeholder,
|
|
17184
|
+
align,
|
|
17185
|
+
disabled,
|
|
17186
|
+
readOnly,
|
|
17187
|
+
maxLength,
|
|
17188
|
+
clearable,
|
|
17189
|
+
clearIcon,
|
|
17190
|
+
formatTrigger,
|
|
17191
|
+
autoFocus,
|
|
17345
17192
|
style,
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17363
|
-
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
|
|
17370
|
-
|
|
17371
|
-
)
|
|
17372
|
-
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
)
|
|
17383
|
-
|
|
17384
|
-
|
|
17385
|
-
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17390
|
-
|
|
17391
|
-
|
|
17392
|
-
|
|
17393
|
-
|
|
17394
|
-
|
|
17395
|
-
|
|
17396
|
-
|
|
17397
|
-
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17410
|
-
|
|
17411
|
-
|
|
17412
|
-
|
|
17413
|
-
|
|
17414
|
-
|
|
17415
|
-
|
|
17416
|
-
|
|
17417
|
-
|
|
17418
|
-
|
|
17419
|
-
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17423
|
-
|
|
17424
|
-
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
|
|
17428
|
-
|
|
17429
|
-
|
|
17430
|
-
|
|
17431
|
-
|
|
17432
|
-
|
|
17433
|
-
|
|
17434
|
-
|
|
17435
|
-
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
|
|
17440
|
-
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
|
|
17444
|
-
|
|
17445
|
-
|
|
17446
|
-
|
|
17447
|
-
|
|
17448
|
-
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
|
|
17452
|
-
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
|
|
17456
|
-
|
|
17457
|
-
|
|
17458
|
-
|
|
17459
|
-
|
|
17460
|
-
|
|
17461
|
-
|
|
17462
|
-
|
|
17463
|
-
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
children: rightIcon
|
|
17193
|
+
className,
|
|
17194
|
+
onChange,
|
|
17195
|
+
onFocus,
|
|
17196
|
+
onClear,
|
|
17197
|
+
formatter,
|
|
17198
|
+
onClick,
|
|
17199
|
+
confirmType,
|
|
17200
|
+
defaultValue,
|
|
17201
|
+
value: _value,
|
|
17202
|
+
...rest
|
|
17203
|
+
} = {
|
|
17204
|
+
...defaultProps$T,
|
|
17205
|
+
...props
|
|
17206
|
+
};
|
|
17207
|
+
const [value, setValue] = usePropsValue({
|
|
17208
|
+
value: props.value,
|
|
17209
|
+
defaultValue: props.defaultValue,
|
|
17210
|
+
finalValue: "",
|
|
17211
|
+
onChange
|
|
17212
|
+
});
|
|
17213
|
+
const inputRef = useRef(null);
|
|
17214
|
+
const composingRef = useRef(false);
|
|
17215
|
+
const [active, setActive] = useState(false);
|
|
17216
|
+
useImperativeHandle(ref, () => {
|
|
17217
|
+
return {
|
|
17218
|
+
clear: () => {
|
|
17219
|
+
setValue("");
|
|
17220
|
+
},
|
|
17221
|
+
focus: () => {
|
|
17222
|
+
var _a2;
|
|
17223
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
17224
|
+
},
|
|
17225
|
+
blur: () => {
|
|
17226
|
+
var _a2;
|
|
17227
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.blur();
|
|
17228
|
+
},
|
|
17229
|
+
get nativeElement() {
|
|
17230
|
+
return inputRef.current;
|
|
17231
|
+
}
|
|
17232
|
+
};
|
|
17233
|
+
});
|
|
17234
|
+
const inputClass = useCallback(() => {
|
|
17235
|
+
const classPrefix2 = "nut-input";
|
|
17236
|
+
return [classPrefix2, `${disabled ? `${classPrefix2}-disabled` : ""}`].filter(Boolean).join(" ");
|
|
17237
|
+
}, [disabled]);
|
|
17238
|
+
const updateValue = (value2, trigger = "onChange") => {
|
|
17239
|
+
let val = value2;
|
|
17240
|
+
if (type4 === "number") {
|
|
17241
|
+
val = formatNumber(val, false, true);
|
|
17242
|
+
}
|
|
17243
|
+
if (type4 === "digit") {
|
|
17244
|
+
val = formatNumber(val, true, true);
|
|
17245
|
+
}
|
|
17246
|
+
if (formatter && trigger === formatTrigger) {
|
|
17247
|
+
val = formatter(val);
|
|
17248
|
+
}
|
|
17249
|
+
setValue(val);
|
|
17250
|
+
const eventHandler = props[trigger];
|
|
17251
|
+
if (eventHandler && typeof eventHandler === "function") {
|
|
17252
|
+
eventHandler(val);
|
|
17253
|
+
}
|
|
17254
|
+
};
|
|
17255
|
+
const handleFocus = (event) => {
|
|
17256
|
+
const val = event.target.value;
|
|
17257
|
+
onFocus && onFocus(val);
|
|
17258
|
+
setActive(true);
|
|
17259
|
+
};
|
|
17260
|
+
const handleInput = (value2) => {
|
|
17261
|
+
updateValue(value2, "onChange");
|
|
17262
|
+
};
|
|
17263
|
+
const handleBlur = (event) => {
|
|
17264
|
+
const val = event.target.value;
|
|
17265
|
+
updateValue(val, "onBlur");
|
|
17266
|
+
setActive(false);
|
|
17267
|
+
};
|
|
17268
|
+
const inputType = (type22) => {
|
|
17269
|
+
if (type22 === "digit") {
|
|
17270
|
+
return "text";
|
|
17271
|
+
}
|
|
17272
|
+
if (type22 === "number") {
|
|
17273
|
+
return "tel";
|
|
17274
|
+
}
|
|
17275
|
+
return type22;
|
|
17276
|
+
};
|
|
17277
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
17278
|
+
"div",
|
|
17279
|
+
{
|
|
17280
|
+
className: `${inputClass()} ${className || ""}`,
|
|
17281
|
+
style,
|
|
17282
|
+
onClick: (e) => {
|
|
17283
|
+
onClick && onClick(e);
|
|
17284
|
+
},
|
|
17285
|
+
children: [
|
|
17286
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17287
|
+
"input",
|
|
17288
|
+
{
|
|
17289
|
+
...rest,
|
|
17290
|
+
name,
|
|
17291
|
+
className: "nut-input-native",
|
|
17292
|
+
ref: inputRef,
|
|
17293
|
+
style: { textAlign: align },
|
|
17294
|
+
type: inputType(type4),
|
|
17295
|
+
maxLength,
|
|
17296
|
+
placeholder: placeholder || locale.placeholder,
|
|
17297
|
+
disabled,
|
|
17298
|
+
readOnly,
|
|
17299
|
+
value,
|
|
17300
|
+
autoFocus,
|
|
17301
|
+
enterKeyHint: confirmType,
|
|
17302
|
+
onBlur: (e) => {
|
|
17303
|
+
handleBlur(e);
|
|
17304
|
+
},
|
|
17305
|
+
onFocus: (e) => {
|
|
17306
|
+
handleFocus(e);
|
|
17307
|
+
},
|
|
17308
|
+
onChange: (e) => {
|
|
17309
|
+
handleInput(e.currentTarget.value);
|
|
17310
|
+
},
|
|
17311
|
+
onCompositionStart: (e) => {
|
|
17312
|
+
var _a2;
|
|
17313
|
+
composingRef.current = true;
|
|
17314
|
+
(_a2 = props.onCompositionStart) == null ? void 0 : _a2.call(props, e);
|
|
17315
|
+
},
|
|
17316
|
+
onCompositionEnd: (e) => {
|
|
17317
|
+
var _a2;
|
|
17318
|
+
composingRef.current = false;
|
|
17319
|
+
(_a2 = props.onCompositionEnd) == null ? void 0 : _a2.call(props, e);
|
|
17474
17320
|
}
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
"/",
|
|
17480
|
-
maxlength
|
|
17481
|
-
] }) : null
|
|
17482
|
-
] }),
|
|
17483
|
-
errorMessage ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17484
|
-
"div",
|
|
17321
|
+
}
|
|
17322
|
+
),
|
|
17323
|
+
clearable && !readOnly && active && value.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17324
|
+
"span",
|
|
17485
17325
|
{
|
|
17486
|
-
|
|
17487
|
-
|
|
17488
|
-
|
|
17326
|
+
style: { display: "flex", alignItems: "center" },
|
|
17327
|
+
onClick: () => {
|
|
17328
|
+
if (!disabled) {
|
|
17329
|
+
setValue("");
|
|
17330
|
+
onClear && onClear("");
|
|
17331
|
+
}
|
|
17489
17332
|
},
|
|
17490
|
-
children:
|
|
17333
|
+
children: clearIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(x$4, { className: "nut-input-clear" })
|
|
17491
17334
|
}
|
|
17492
|
-
) :
|
|
17493
|
-
]
|
|
17494
|
-
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
Input.defaultProps = defaultProps$
|
|
17335
|
+
) : null
|
|
17336
|
+
]
|
|
17337
|
+
}
|
|
17338
|
+
);
|
|
17339
|
+
}
|
|
17340
|
+
);
|
|
17341
|
+
Input.defaultProps = defaultProps$T;
|
|
17499
17342
|
Input.displayName = "NutInput";
|
|
17500
|
-
const defaultProps$
|
|
17343
|
+
const defaultProps$S = {
|
|
17501
17344
|
...ComponentDefaults,
|
|
17502
17345
|
disabled: false,
|
|
17503
17346
|
min: 1,
|
|
@@ -17509,7 +17352,7 @@ const defaultProps$T = {
|
|
|
17509
17352
|
digits: 0,
|
|
17510
17353
|
async: false
|
|
17511
17354
|
};
|
|
17512
|
-
const classPrefix$
|
|
17355
|
+
const classPrefix$3 = `nut-inputnumber`;
|
|
17513
17356
|
const InputNumber = (props) => {
|
|
17514
17357
|
const {
|
|
17515
17358
|
children,
|
|
@@ -17534,7 +17377,7 @@ const InputNumber = (props) => {
|
|
|
17534
17377
|
onChange,
|
|
17535
17378
|
...restProps
|
|
17536
17379
|
} = {
|
|
17537
|
-
...defaultProps$
|
|
17380
|
+
...defaultProps$S,
|
|
17538
17381
|
...props
|
|
17539
17382
|
};
|
|
17540
17383
|
const inputRef = useRef("");
|
|
@@ -17552,8 +17395,8 @@ const InputNumber = (props) => {
|
|
|
17552
17395
|
}, []);
|
|
17553
17396
|
const classes = classNames(
|
|
17554
17397
|
{
|
|
17555
|
-
[`${classPrefix$
|
|
17556
|
-
[`${classPrefix$
|
|
17398
|
+
[`${classPrefix$3}`]: true,
|
|
17399
|
+
[`${classPrefix$3}--disabled`]: disabled
|
|
17557
17400
|
},
|
|
17558
17401
|
className
|
|
17559
17402
|
);
|
|
@@ -17735,9 +17578,9 @@ const InputNumber = (props) => {
|
|
|
17735
17578
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(y$3, { className: iconAddClasses, onClick: (e) => addNumber(e) }) })
|
|
17736
17579
|
] });
|
|
17737
17580
|
};
|
|
17738
|
-
InputNumber.defaultProps = defaultProps$
|
|
17581
|
+
InputNumber.defaultProps = defaultProps$S;
|
|
17739
17582
|
InputNumber.displayName = "NutInputNumber";
|
|
17740
|
-
const defaultProps$
|
|
17583
|
+
const defaultProps$R = {
|
|
17741
17584
|
...ComponentDefaults,
|
|
17742
17585
|
activeColor: "",
|
|
17743
17586
|
closeOnOverlayClick: true,
|
|
@@ -17756,7 +17599,7 @@ const Menu = (props) => {
|
|
|
17756
17599
|
activeColor,
|
|
17757
17600
|
...rest
|
|
17758
17601
|
} = {
|
|
17759
|
-
...defaultProps$
|
|
17602
|
+
...defaultProps$R,
|
|
17760
17603
|
...props
|
|
17761
17604
|
};
|
|
17762
17605
|
const menuRef = useRef(null);
|
|
@@ -17880,9 +17723,9 @@ const Menu = (props) => {
|
|
|
17880
17723
|
}
|
|
17881
17724
|
);
|
|
17882
17725
|
};
|
|
17883
|
-
Menu.defaultProps = defaultProps$
|
|
17726
|
+
Menu.defaultProps = defaultProps$R;
|
|
17884
17727
|
Menu.displayName = "NutMenu";
|
|
17885
|
-
const defaultProps$
|
|
17728
|
+
const defaultProps$Q = {
|
|
17886
17729
|
...ComponentDefaults,
|
|
17887
17730
|
columns: 1,
|
|
17888
17731
|
direction: "down",
|
|
@@ -17912,7 +17755,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17912
17755
|
parent,
|
|
17913
17756
|
index
|
|
17914
17757
|
} = {
|
|
17915
|
-
...defaultProps$
|
|
17758
|
+
...defaultProps$Q,
|
|
17916
17759
|
...props
|
|
17917
17760
|
};
|
|
17918
17761
|
const [_showPopup, setShowPopup] = useState(show);
|
|
@@ -18066,9 +17909,9 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
18066
17909
|
)
|
|
18067
17910
|
] });
|
|
18068
17911
|
});
|
|
18069
|
-
MenuItem.defaultProps = defaultProps$
|
|
17912
|
+
MenuItem.defaultProps = defaultProps$Q;
|
|
18070
17913
|
MenuItem.displayName = "NutMenuItem";
|
|
18071
|
-
const defaultProps$
|
|
17914
|
+
const defaultProps$P = {
|
|
18072
17915
|
confirmText: "",
|
|
18073
17916
|
title: "",
|
|
18074
17917
|
visible: false,
|
|
@@ -18300,14 +18143,14 @@ const NumberKeyboard = (props) => {
|
|
|
18300
18143
|
}
|
|
18301
18144
|
) });
|
|
18302
18145
|
};
|
|
18303
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
18146
|
+
NumberKeyboard.defaultProps = defaultProps$P;
|
|
18304
18147
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
18305
18148
|
const radioContext = {
|
|
18306
18149
|
onChange: (val) => {
|
|
18307
18150
|
}
|
|
18308
18151
|
};
|
|
18309
18152
|
const RadioContext = React__default.createContext(radioContext);
|
|
18310
|
-
const defaultProps$
|
|
18153
|
+
const defaultProps$O = {
|
|
18311
18154
|
value: null,
|
|
18312
18155
|
textPosition: "right",
|
|
18313
18156
|
onChange: (value) => {
|
|
@@ -18317,7 +18160,7 @@ const defaultProps$P = {
|
|
|
18317
18160
|
};
|
|
18318
18161
|
const RadioGroup = React__default.forwardRef(
|
|
18319
18162
|
(props, ref) => {
|
|
18320
|
-
const { children } = { ...defaultProps$
|
|
18163
|
+
const { children } = { ...defaultProps$O, ...props };
|
|
18321
18164
|
cn("RadioGroup");
|
|
18322
18165
|
const {
|
|
18323
18166
|
className,
|
|
@@ -18394,9 +18237,9 @@ const RadioGroup = React__default.forwardRef(
|
|
|
18394
18237
|
);
|
|
18395
18238
|
}
|
|
18396
18239
|
);
|
|
18397
|
-
RadioGroup.defaultProps = defaultProps$
|
|
18240
|
+
RadioGroup.defaultProps = defaultProps$O;
|
|
18398
18241
|
RadioGroup.displayName = "NutRadioGroup";
|
|
18399
|
-
const defaultProps$
|
|
18242
|
+
const defaultProps$N = {
|
|
18400
18243
|
...ComponentDefaults,
|
|
18401
18244
|
className: "",
|
|
18402
18245
|
style: {},
|
|
@@ -18413,7 +18256,7 @@ const defaultProps$O = {
|
|
|
18413
18256
|
};
|
|
18414
18257
|
const Radio = (props) => {
|
|
18415
18258
|
const { children } = {
|
|
18416
|
-
...defaultProps$
|
|
18259
|
+
...defaultProps$N,
|
|
18417
18260
|
...props
|
|
18418
18261
|
};
|
|
18419
18262
|
const {
|
|
@@ -18513,7 +18356,7 @@ const Radio = (props) => {
|
|
|
18513
18356
|
}
|
|
18514
18357
|
);
|
|
18515
18358
|
};
|
|
18516
|
-
Radio.defaultProps = defaultProps$
|
|
18359
|
+
Radio.defaultProps = defaultProps$N;
|
|
18517
18360
|
Radio.displayName = "NutRadio";
|
|
18518
18361
|
Radio.RadioGroup = RadioGroup;
|
|
18519
18362
|
const fullClone = {
|
|
@@ -18779,7 +18622,7 @@ const Toast = {
|
|
|
18779
18622
|
}
|
|
18780
18623
|
}
|
|
18781
18624
|
};
|
|
18782
|
-
const defaultProps$
|
|
18625
|
+
const defaultProps$M = {
|
|
18783
18626
|
range: false,
|
|
18784
18627
|
hiddenRange: false,
|
|
18785
18628
|
hiddenTag: false,
|
|
@@ -18815,8 +18658,8 @@ const Range = (props) => {
|
|
|
18815
18658
|
minDesc,
|
|
18816
18659
|
maxDesc,
|
|
18817
18660
|
curValueDesc
|
|
18818
|
-
} = { ...defaultProps$
|
|
18819
|
-
let { min, max, step } = { ...defaultProps$
|
|
18661
|
+
} = { ...defaultProps$M, ...props };
|
|
18662
|
+
let { min, max, step } = { ...defaultProps$M, ...props };
|
|
18820
18663
|
min = Number(min);
|
|
18821
18664
|
max = Number(max);
|
|
18822
18665
|
step = Number(step);
|
|
@@ -19155,9 +18998,9 @@ const Range = (props) => {
|
|
|
19155
18998
|
!hiddenRange ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max", children: maxDesc || +max }) : null
|
|
19156
18999
|
] });
|
|
19157
19000
|
};
|
|
19158
|
-
Range.defaultProps = defaultProps$
|
|
19001
|
+
Range.defaultProps = defaultProps$M;
|
|
19159
19002
|
Range.displayName = "NutRange";
|
|
19160
|
-
const defaultProps$
|
|
19003
|
+
const defaultProps$L = {
|
|
19161
19004
|
...ComponentDefaults,
|
|
19162
19005
|
count: 5,
|
|
19163
19006
|
min: 0,
|
|
@@ -19182,7 +19025,7 @@ const Rate = (props) => {
|
|
|
19182
19025
|
allowHalf,
|
|
19183
19026
|
onChange
|
|
19184
19027
|
} = {
|
|
19185
|
-
...defaultProps$
|
|
19028
|
+
...defaultProps$L,
|
|
19186
19029
|
...props
|
|
19187
19030
|
};
|
|
19188
19031
|
const classPrefix2 = "nut-rate";
|
|
@@ -19267,9 +19110,9 @@ const Rate = (props) => {
|
|
|
19267
19110
|
}
|
|
19268
19111
|
);
|
|
19269
19112
|
};
|
|
19270
|
-
Rate.defaultProps = defaultProps$
|
|
19113
|
+
Rate.defaultProps = defaultProps$L;
|
|
19271
19114
|
Rate.displayName = "NutRate";
|
|
19272
|
-
const defaultProps$
|
|
19115
|
+
const defaultProps$K = {
|
|
19273
19116
|
...ComponentDefaults,
|
|
19274
19117
|
placeholder: "",
|
|
19275
19118
|
shape: "square",
|
|
@@ -19317,7 +19160,7 @@ const SearchBar = (props) => {
|
|
|
19317
19160
|
onClickRightinIcon,
|
|
19318
19161
|
onClickRightoutIcon
|
|
19319
19162
|
} = {
|
|
19320
|
-
...defaultProps$
|
|
19163
|
+
...defaultProps$K,
|
|
19321
19164
|
...props
|
|
19322
19165
|
};
|
|
19323
19166
|
const alignClass = `${align}`;
|
|
@@ -19500,9 +19343,9 @@ const SearchBar = (props) => {
|
|
|
19500
19343
|
}
|
|
19501
19344
|
);
|
|
19502
19345
|
};
|
|
19503
|
-
SearchBar.defaultProps = defaultProps$
|
|
19346
|
+
SearchBar.defaultProps = defaultProps$K;
|
|
19504
19347
|
SearchBar.displayName = "NutSearchBar";
|
|
19505
|
-
const defaultProps$
|
|
19348
|
+
const defaultProps$J = {
|
|
19506
19349
|
...ComponentDefaults,
|
|
19507
19350
|
title: "",
|
|
19508
19351
|
description: "",
|
|
@@ -19666,9 +19509,9 @@ const ShortPassword = (props) => {
|
|
|
19666
19509
|
}
|
|
19667
19510
|
) });
|
|
19668
19511
|
};
|
|
19669
|
-
ShortPassword.defaultProps = defaultProps$
|
|
19512
|
+
ShortPassword.defaultProps = defaultProps$J;
|
|
19670
19513
|
ShortPassword.displayName = "NutShortPassword";
|
|
19671
|
-
const defaultProps$
|
|
19514
|
+
const defaultProps$I = {
|
|
19672
19515
|
type: "png",
|
|
19673
19516
|
lineWidth: 2,
|
|
19674
19517
|
strokeStyle: "#000",
|
|
@@ -19689,7 +19532,7 @@ const Signature = (props) => {
|
|
|
19689
19532
|
onClear,
|
|
19690
19533
|
...rest
|
|
19691
19534
|
} = {
|
|
19692
|
-
...defaultProps$
|
|
19535
|
+
...defaultProps$I,
|
|
19693
19536
|
...props
|
|
19694
19537
|
};
|
|
19695
19538
|
const b = cn("signature");
|
|
@@ -19803,9 +19646,9 @@ const Signature = (props) => {
|
|
|
19803
19646
|
)
|
|
19804
19647
|
] });
|
|
19805
19648
|
};
|
|
19806
|
-
Signature.defaultProps = defaultProps$
|
|
19649
|
+
Signature.defaultProps = defaultProps$I;
|
|
19807
19650
|
Signature.displayName = "NutSignature";
|
|
19808
|
-
const defaultProps$
|
|
19651
|
+
const defaultProps$H = {
|
|
19809
19652
|
...ComponentDefaults,
|
|
19810
19653
|
disabled: false,
|
|
19811
19654
|
activeText: "",
|
|
@@ -19822,7 +19665,7 @@ const Switch = (props) => {
|
|
|
19822
19665
|
style,
|
|
19823
19666
|
onChange
|
|
19824
19667
|
} = {
|
|
19825
|
-
...defaultProps$
|
|
19668
|
+
...defaultProps$H,
|
|
19826
19669
|
...props
|
|
19827
19670
|
};
|
|
19828
19671
|
const classPrefix2 = "nut-switch";
|
|
@@ -19844,9 +19687,9 @@ const Switch = (props) => {
|
|
|
19844
19687
|
activeText && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__label open`, children: activeText }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__label close`, children: inactiveText }) })
|
|
19845
19688
|
] }) });
|
|
19846
19689
|
};
|
|
19847
|
-
Switch.defaultProps = defaultProps$
|
|
19690
|
+
Switch.defaultProps = defaultProps$H;
|
|
19848
19691
|
Switch.displayName = "NutSwitch";
|
|
19849
|
-
const defaultProps$
|
|
19692
|
+
const defaultProps$G = {
|
|
19850
19693
|
defaultValue: "",
|
|
19851
19694
|
textAlign: "left",
|
|
19852
19695
|
limitshow: false,
|
|
@@ -19874,7 +19717,7 @@ const TextArea = (props) => {
|
|
|
19874
19717
|
onChange,
|
|
19875
19718
|
onBlur,
|
|
19876
19719
|
onFocus
|
|
19877
|
-
} = { ...defaultProps$
|
|
19720
|
+
} = { ...defaultProps$G, ...props };
|
|
19878
19721
|
const textareaBem = cn("textarea");
|
|
19879
19722
|
const [inputValue, SetInputValue] = useState("");
|
|
19880
19723
|
const textareaRef = useRef(null);
|
|
@@ -19989,9 +19832,9 @@ const TextArea = (props) => {
|
|
|
19989
19832
|
}
|
|
19990
19833
|
);
|
|
19991
19834
|
};
|
|
19992
|
-
TextArea.defaultProps = defaultProps$
|
|
19835
|
+
TextArea.defaultProps = defaultProps$G;
|
|
19993
19836
|
TextArea.displayName = "NutTextArea";
|
|
19994
|
-
const defaultProps$
|
|
19837
|
+
const defaultProps$F = {
|
|
19995
19838
|
...ComponentDefaults,
|
|
19996
19839
|
percent: 0,
|
|
19997
19840
|
showText: false,
|
|
@@ -20010,7 +19853,7 @@ const Progress = (props) => {
|
|
|
20010
19853
|
children,
|
|
20011
19854
|
...rest
|
|
20012
19855
|
} = {
|
|
20013
|
-
...defaultProps$
|
|
19856
|
+
...defaultProps$F,
|
|
20014
19857
|
...props
|
|
20015
19858
|
};
|
|
20016
19859
|
const classPrefix2 = "nut-progress";
|
|
@@ -20047,7 +19890,7 @@ const Progress = (props) => {
|
|
|
20047
19890
|
}
|
|
20048
19891
|
) }) }) });
|
|
20049
19892
|
};
|
|
20050
|
-
Progress.defaultProps = defaultProps$
|
|
19893
|
+
Progress.defaultProps = defaultProps$F;
|
|
20051
19894
|
Progress.displayName = "NutProgress";
|
|
20052
19895
|
class UploadOptions {
|
|
20053
19896
|
constructor() {
|
|
@@ -20144,7 +19987,7 @@ const funcInterceptor = (interceptor, {
|
|
|
20144
19987
|
done();
|
|
20145
19988
|
}
|
|
20146
19989
|
};
|
|
20147
|
-
const defaultProps$
|
|
19990
|
+
const defaultProps$E = {
|
|
20148
19991
|
...ComponentDefaults,
|
|
20149
19992
|
url: "",
|
|
20150
19993
|
maxCount: 1,
|
|
@@ -20226,7 +20069,7 @@ const InternalUploader = (props, ref) => {
|
|
|
20226
20069
|
beforeXhrUpload,
|
|
20227
20070
|
beforeDelete,
|
|
20228
20071
|
...restProps
|
|
20229
|
-
} = { ...defaultProps$
|
|
20072
|
+
} = { ...defaultProps$E, ...props };
|
|
20230
20073
|
const [fileList, setFileList] = useState(defaultValue || []);
|
|
20231
20074
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
20232
20075
|
useEffect(() => {
|
|
@@ -20597,9 +20440,9 @@ const InternalUploader = (props, ref) => {
|
|
|
20597
20440
|
] });
|
|
20598
20441
|
};
|
|
20599
20442
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
20600
|
-
Uploader.defaultProps = defaultProps$
|
|
20443
|
+
Uploader.defaultProps = defaultProps$E;
|
|
20601
20444
|
Uploader.displayName = "NutUploader";
|
|
20602
|
-
const defaultProps$
|
|
20445
|
+
const defaultProps$D = {
|
|
20603
20446
|
cancelText: "",
|
|
20604
20447
|
optionTag: "name",
|
|
20605
20448
|
optionSubTag: "subname",
|
|
@@ -20633,7 +20476,7 @@ const ActionSheet = (props) => {
|
|
|
20633
20476
|
className,
|
|
20634
20477
|
style,
|
|
20635
20478
|
...rest
|
|
20636
|
-
} = { ...defaultProps$
|
|
20479
|
+
} = { ...defaultProps$D, ...props };
|
|
20637
20480
|
const b = cn("actionsheet");
|
|
20638
20481
|
const isHighlight = (item) => {
|
|
20639
20482
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "$dark1";
|
|
@@ -20678,52 +20521,8 @@ const ActionSheet = (props) => {
|
|
|
20678
20521
|
}
|
|
20679
20522
|
);
|
|
20680
20523
|
};
|
|
20681
|
-
ActionSheet.defaultProps = defaultProps$
|
|
20524
|
+
ActionSheet.defaultProps = defaultProps$D;
|
|
20682
20525
|
ActionSheet.displayName = "NutActionSheet";
|
|
20683
|
-
const defaultProps$D = {
|
|
20684
|
-
...ComponentDefaults,
|
|
20685
|
-
value: "",
|
|
20686
|
-
dot: false,
|
|
20687
|
-
max: 99,
|
|
20688
|
-
top: "0",
|
|
20689
|
-
right: "5",
|
|
20690
|
-
color: ""
|
|
20691
|
-
};
|
|
20692
|
-
const Badge = (props) => {
|
|
20693
|
-
const { className, style, value, max, children, dot, top, right, color } = {
|
|
20694
|
-
...defaultProps$D,
|
|
20695
|
-
...props
|
|
20696
|
-
};
|
|
20697
|
-
const classPrefix2 = "nut-badge";
|
|
20698
|
-
const classes = classNames(classPrefix2, className);
|
|
20699
|
-
const contentClasses = classNames(
|
|
20700
|
-
{ [`${classPrefix2}__dot`]: dot },
|
|
20701
|
-
`${classPrefix2}__content`,
|
|
20702
|
-
`${classPrefix2}__sup`
|
|
20703
|
-
);
|
|
20704
|
-
function content() {
|
|
20705
|
-
if (dot || typeof value === "object")
|
|
20706
|
-
return null;
|
|
20707
|
-
if (typeof value === "number" && typeof max === "number") {
|
|
20708
|
-
return max < value ? `${max}+` : value;
|
|
20709
|
-
}
|
|
20710
|
-
return value;
|
|
20711
|
-
}
|
|
20712
|
-
const getStyle = () => {
|
|
20713
|
-
const style2 = {};
|
|
20714
|
-
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
20715
|
-
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
20716
|
-
style2.background = color;
|
|
20717
|
-
return style2;
|
|
20718
|
-
};
|
|
20719
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, children: [
|
|
20720
|
-
typeof value === "object" && value && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__icon`, children: value }),
|
|
20721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
|
|
20722
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
20723
|
-
] });
|
|
20724
|
-
};
|
|
20725
|
-
Badge.defaultProps = defaultProps$D;
|
|
20726
|
-
Badge.displayName = "NutBadge";
|
|
20727
20526
|
function ConfirmDialog(props) {
|
|
20728
20527
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { ...props, children: props.content });
|
|
20729
20528
|
}
|
|
@@ -22731,7 +22530,7 @@ const defaultProps$s = {
|
|
|
22731
22530
|
onClick: (event) => {
|
|
22732
22531
|
}
|
|
22733
22532
|
};
|
|
22734
|
-
const classPrefix$
|
|
22533
|
+
const classPrefix$2 = `nut-animate`;
|
|
22735
22534
|
const Animate = (props) => {
|
|
22736
22535
|
const { className, type: type4, action, loop: loop2, onClick, children, ...rest } = {
|
|
22737
22536
|
...defaultProps$s,
|
|
@@ -22740,7 +22539,7 @@ const Animate = (props) => {
|
|
|
22740
22539
|
const [clicked, setClicked] = useState(false);
|
|
22741
22540
|
const classes = classNames({
|
|
22742
22541
|
"nut-ani-container": true,
|
|
22743
|
-
[`${classPrefix$
|
|
22542
|
+
[`${classPrefix$2}-${type4}`]: action === "initial" || clicked ? type4 : false,
|
|
22744
22543
|
loop: loop2
|
|
22745
22544
|
});
|
|
22746
22545
|
const cls = classNames(classes, className);
|
|
@@ -23137,24 +22936,26 @@ const AvatarGroup = (props) => {
|
|
|
23137
22936
|
AvatarGroup.defaultProps = defaultProps$o;
|
|
23138
22937
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
23139
22938
|
const defaultProps$n = {
|
|
22939
|
+
...ComponentDefaults,
|
|
23140
22940
|
strokeWidth: 5,
|
|
23141
22941
|
radius: 50,
|
|
23142
22942
|
strokeLinecap: "round",
|
|
23143
|
-
|
|
23144
|
-
|
|
22943
|
+
color: "#fa2c19",
|
|
22944
|
+
background: "#e5e9f2",
|
|
23145
22945
|
clockwise: true
|
|
23146
22946
|
};
|
|
22947
|
+
const classPrefix$1 = `nut-circleprogress`;
|
|
23147
22948
|
const CircleProgress = (props) => {
|
|
23148
22949
|
var _a2;
|
|
23149
22950
|
const {
|
|
23150
22951
|
children,
|
|
23151
|
-
|
|
22952
|
+
percent,
|
|
23152
22953
|
className,
|
|
23153
22954
|
radius,
|
|
23154
|
-
pathColor,
|
|
23155
22955
|
clockwise,
|
|
23156
|
-
circleColor,
|
|
23157
22956
|
strokeWidth,
|
|
22957
|
+
color,
|
|
22958
|
+
background,
|
|
23158
22959
|
style,
|
|
23159
22960
|
strokeLinecap,
|
|
23160
22961
|
...restProps
|
|
@@ -23162,8 +22963,7 @@ const CircleProgress = (props) => {
|
|
|
23162
22963
|
...defaultProps$n,
|
|
23163
22964
|
...props
|
|
23164
22965
|
};
|
|
23165
|
-
const
|
|
23166
|
-
const classes = classNames(className, b(""));
|
|
22966
|
+
const classes = classNames(className, classPrefix$1);
|
|
23167
22967
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
23168
22968
|
const styles = {
|
|
23169
22969
|
height: `${Number(radius) * 2}px`,
|
|
@@ -23171,13 +22971,13 @@ const CircleProgress = (props) => {
|
|
|
23171
22971
|
...style
|
|
23172
22972
|
};
|
|
23173
22973
|
const pathStyle = {
|
|
23174
|
-
stroke:
|
|
22974
|
+
stroke: background
|
|
23175
22975
|
};
|
|
23176
22976
|
const hoverStyle = () => {
|
|
23177
22977
|
const perimeter = 283;
|
|
23178
|
-
const offset = perimeter * Number(
|
|
22978
|
+
const offset = perimeter * Number(percent) / 100;
|
|
23179
22979
|
return {
|
|
23180
|
-
stroke: isObject(
|
|
22980
|
+
stroke: isObject(color) ? `url(#${refRandomId})` : color,
|
|
23181
22981
|
strokeDasharray: `${offset}px ${perimeter}px`
|
|
23182
22982
|
};
|
|
23183
22983
|
};
|
|
@@ -23185,16 +22985,13 @@ const CircleProgress = (props) => {
|
|
|
23185
22985
|
const isWise = clockwise ? 1 : 0;
|
|
23186
22986
|
return `M 50 50 m -45 0 a 45 45 0 1 ${isWise} 90 0 a 45 45 0 1 ${isWise} -90 0`;
|
|
23187
22987
|
};
|
|
23188
|
-
const hoverColor = () => {
|
|
23189
|
-
return isObject(circleColor) ? `url(#${refRandomId})` : circleColor;
|
|
23190
|
-
};
|
|
23191
22988
|
const stop2 = () => {
|
|
23192
|
-
if (!isObject(
|
|
22989
|
+
if (!isObject(props.color)) {
|
|
23193
22990
|
return;
|
|
23194
22991
|
}
|
|
23195
|
-
const
|
|
23196
|
-
const colorArr = Object.keys(
|
|
23197
|
-
(a2,
|
|
22992
|
+
const color2 = props.color;
|
|
22993
|
+
const colorArr = Object.keys(color2).sort(
|
|
22994
|
+
(a2, b) => parseFloat(a2) - parseFloat(b)
|
|
23198
22995
|
);
|
|
23199
22996
|
const stopArr = [];
|
|
23200
22997
|
colorArr.map((item) => {
|
|
@@ -23203,7 +23000,7 @@ const CircleProgress = (props) => {
|
|
|
23203
23000
|
value: ""
|
|
23204
23001
|
};
|
|
23205
23002
|
obj.key = item;
|
|
23206
|
-
obj.value =
|
|
23003
|
+
obj.value = color2[item];
|
|
23207
23004
|
stopArr.push(obj);
|
|
23208
23005
|
});
|
|
23209
23006
|
return stopArr;
|
|
@@ -23217,8 +23014,8 @@ const CircleProgress = (props) => {
|
|
|
23217
23014
|
"path",
|
|
23218
23015
|
{
|
|
23219
23016
|
className: "nut-circleprogress-path",
|
|
23220
|
-
style: pathStyle,
|
|
23221
23017
|
d: path(),
|
|
23018
|
+
style: pathStyle,
|
|
23222
23019
|
fill: "none",
|
|
23223
23020
|
strokeWidth
|
|
23224
23021
|
}
|
|
@@ -23230,17 +23027,13 @@ const CircleProgress = (props) => {
|
|
|
23230
23027
|
style: hoverStyle(),
|
|
23231
23028
|
d: path(),
|
|
23232
23029
|
fill: "none",
|
|
23233
|
-
stroke: hoverColor(),
|
|
23234
23030
|
strokeLinecap,
|
|
23235
23031
|
transform: "rotate(90,50,50)",
|
|
23236
23032
|
strokeWidth
|
|
23237
23033
|
}
|
|
23238
23034
|
)
|
|
23239
23035
|
] }),
|
|
23240
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-circleprogress-text", children
|
|
23241
|
-
progress,
|
|
23242
|
-
"%"
|
|
23243
|
-
] }) })
|
|
23036
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-circleprogress-text", children })
|
|
23244
23037
|
] });
|
|
23245
23038
|
};
|
|
23246
23039
|
CircleProgress.defaultProps = defaultProps$n;
|