@nutui/nutui-react-taro 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/CircleProgress.js +2 -3
- package/dist/esm/Input.js +4 -1
- package/dist/esm/Tabbar.js +6 -3
- package/dist/esm/TabbarItem.js +3 -4
- package/dist/esm/{circleprogress.taro-d8973ae9.js → circleprogress.taro-d4943109.js} +21 -27
- package/dist/esm/input.taro-1aca4a45.js +167 -0
- package/dist/esm/nutui-react.es.js +5 -5
- package/dist/esm/tabbar.taro-48413fb8.js +51 -0
- package/dist/esm/tabbaritem.taro-5afa3562.js +37 -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 +642 -851
- package/dist/nutui.react.umd.js +640 -849
- 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 +48 -84
- package/package.json +1 -1
- package/dist/esm/input.taro-f4e067f7.js +0 -237
- package/dist/esm/tabbar.taro-eefd0f8e.js +0 -59
- package/dist/esm/tabbaritem.taro-7a97e645.js +0 -55
package/dist/nutui.react.mjs
CHANGED
|
@@ -5,14 +5,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v2.0.0-alpha.
|
|
8
|
+
* @nutui/nutui-react-taro v2.0.0-alpha.4 Fri May 05 2023 16:38:12 GMT+0800 (China Standard Time)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import React__default, { useCallback, createContext, useMemo, useContext, useState, useEffect, useRef, isValidElement, useImperativeHandle, forwardRef, useLayoutEffect, Component, memo } from "react";
|
|
14
|
-
import { View, ScrollView, Image as Image$2 } from "@tarojs/components";
|
|
15
|
-
import Taro, { getEnv, usePageScroll, getSystemInfoSync, pageScrollTo, nextTick, createSelectorQuery, canvasToTempFilePath, uploadFile, chooseMedia, chooseImage, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas } from "@tarojs/taro";
|
|
14
|
+
import { View, ScrollView, Input as Input$1, Image as Image$2 } from "@tarojs/components";
|
|
15
|
+
import Taro, { getEnv, usePageScroll, getSystemInfoSync, pageScrollTo, nextTick, createSelectorQuery, ENV_TYPE, canvasToTempFilePath, uploadFile, chooseMedia, chooseImage, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas } from "@tarojs/taro";
|
|
16
16
|
import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
17
17
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
18
18
|
var jsxRuntimeExports = {};
|
|
@@ -2797,7 +2797,7 @@ const defaultProps$1s = {
|
|
|
2797
2797
|
onClick: (event) => {
|
|
2798
2798
|
}
|
|
2799
2799
|
};
|
|
2800
|
-
const classPrefix$
|
|
2800
|
+
const classPrefix$9 = "nut-cell";
|
|
2801
2801
|
const Cell = (props) => {
|
|
2802
2802
|
const {
|
|
2803
2803
|
children,
|
|
@@ -2828,24 +2828,24 @@ const Cell = (props) => {
|
|
|
2828
2828
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2829
2829
|
"div",
|
|
2830
2830
|
{
|
|
2831
|
-
className: classNames(classPrefix$
|
|
2831
|
+
className: classNames(classPrefix$9, className),
|
|
2832
2832
|
onClick: (event) => handleClick(event),
|
|
2833
2833
|
style: baseStyle,
|
|
2834
2834
|
...rest,
|
|
2835
2835
|
children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
2836
|
-
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$
|
|
2837
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2838
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2836
|
+
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$9}__left`, children: [
|
|
2837
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__title`, children: title }) : null,
|
|
2838
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__description`, children: description }) : null
|
|
2839
2839
|
] }) : null,
|
|
2840
2840
|
extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2841
2841
|
"div",
|
|
2842
2842
|
{
|
|
2843
|
-
className: `${classPrefix$
|
|
2843
|
+
className: `${classPrefix$9}__extra`,
|
|
2844
2844
|
style: styles,
|
|
2845
2845
|
children: extra
|
|
2846
2846
|
}
|
|
2847
2847
|
) : null,
|
|
2848
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2848
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__divider` })
|
|
2849
2849
|
] })
|
|
2850
2850
|
}
|
|
2851
2851
|
);
|
|
@@ -2857,16 +2857,16 @@ const defaultProps$1r = {
|
|
|
2857
2857
|
title: "",
|
|
2858
2858
|
description: ""
|
|
2859
2859
|
};
|
|
2860
|
-
const classPrefix$
|
|
2860
|
+
const classPrefix$8 = "nut-cell-group";
|
|
2861
2861
|
const CellGroup = (props) => {
|
|
2862
2862
|
const { children, className, style, title, description, ...rest } = {
|
|
2863
2863
|
...defaultProps$1r,
|
|
2864
2864
|
...props
|
|
2865
2865
|
};
|
|
2866
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$
|
|
2867
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2868
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2869
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2866
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$8, className), ...rest, children: [
|
|
2867
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$8}__title`, children: title }) : null,
|
|
2868
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$8}__description`, children: description }) : null,
|
|
2869
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$8}__wrap`, children })
|
|
2870
2870
|
] });
|
|
2871
2871
|
};
|
|
2872
2872
|
CellGroup.defaultProps = defaultProps$1r;
|
|
@@ -3561,21 +3561,21 @@ const defaultProps$1n = {
|
|
|
3561
3561
|
contentPosition: "center",
|
|
3562
3562
|
direction: "horizontal"
|
|
3563
3563
|
};
|
|
3564
|
-
const classPrefix$
|
|
3564
|
+
const classPrefix$7 = `nut-divider`;
|
|
3565
3565
|
const Divider = (props) => {
|
|
3566
3566
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
3567
3567
|
...defaultProps$1n,
|
|
3568
3568
|
...props
|
|
3569
3569
|
};
|
|
3570
3570
|
const classes = direction === "horizontal" ? classNames({
|
|
3571
|
-
[`${classPrefix$
|
|
3572
|
-
[`${classPrefix$
|
|
3573
|
-
[`${classPrefix$
|
|
3574
|
-
[`${classPrefix$
|
|
3575
|
-
[`${classPrefix$
|
|
3571
|
+
[`${classPrefix$7}`]: true,
|
|
3572
|
+
[`${classPrefix$7}__center`]: children,
|
|
3573
|
+
[`${classPrefix$7}__left`]: contentPosition === "left",
|
|
3574
|
+
[`${classPrefix$7}__right`]: contentPosition === "right",
|
|
3575
|
+
[`${classPrefix$7}__hairline`]: true
|
|
3576
3576
|
}) : classNames({
|
|
3577
|
-
[`${classPrefix$
|
|
3578
|
-
[`${classPrefix$
|
|
3577
|
+
[`${classPrefix$7}`]: true,
|
|
3578
|
+
[`${classPrefix$7}__vertical`]: direction === "vertical"
|
|
3579
3579
|
});
|
|
3580
3580
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
|
|
3581
3581
|
};
|
|
@@ -3739,7 +3739,7 @@ const Layout = (props) => {
|
|
|
3739
3739
|
};
|
|
3740
3740
|
Layout.defaultProps = defaultProps$1k;
|
|
3741
3741
|
Layout.displayName = "NutLayout";
|
|
3742
|
-
const classPrefix$
|
|
3742
|
+
const classPrefix$6 = "nut-row";
|
|
3743
3743
|
const defaultProps$1j = {
|
|
3744
3744
|
...ComponentDefaults,
|
|
3745
3745
|
type: "",
|
|
@@ -3774,7 +3774,7 @@ const Row = (props) => {
|
|
|
3774
3774
|
${getClass("justify", justify)}
|
|
3775
3775
|
${getClass("align", align)}
|
|
3776
3776
|
${getClass("flex", wrap)}
|
|
3777
|
-
${classPrefix$
|
|
3777
|
+
${classPrefix$6}
|
|
3778
3778
|
`;
|
|
3779
3779
|
};
|
|
3780
3780
|
const parentRow = {
|
|
@@ -3850,7 +3850,7 @@ const defaultProps$1i = {
|
|
|
3850
3850
|
position: "top",
|
|
3851
3851
|
zIndex: 2e3
|
|
3852
3852
|
};
|
|
3853
|
-
const classPrefix$
|
|
3853
|
+
const classPrefix$5 = "nut-sticky";
|
|
3854
3854
|
const Sticky = (props) => {
|
|
3855
3855
|
const {
|
|
3856
3856
|
position,
|
|
@@ -3952,7 +3952,7 @@ const Sticky = (props) => {
|
|
|
3952
3952
|
{
|
|
3953
3953
|
ref: rootRef,
|
|
3954
3954
|
style: rootStyle,
|
|
3955
|
-
className: classNames(classPrefix$
|
|
3955
|
+
className: classNames(classPrefix$5, className),
|
|
3956
3956
|
...rest,
|
|
3957
3957
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3958
3958
|
"div",
|
|
@@ -6492,288 +6492,189 @@ const SubSideNavBar = (props) => {
|
|
|
6492
6492
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-subsidenavbar__content", children })
|
|
6493
6493
|
] });
|
|
6494
6494
|
};
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
set exports(v) {
|
|
6501
|
-
classnameExports = v;
|
|
6502
|
-
}
|
|
6503
|
-
};
|
|
6504
|
-
var classname_production_min = {};
|
|
6505
|
-
var hasRequiredClassname_production_min;
|
|
6506
|
-
function requireClassname_production_min() {
|
|
6507
|
-
if (hasRequiredClassname_production_min)
|
|
6508
|
-
return classname_production_min;
|
|
6509
|
-
hasRequiredClassname_production_min = 1;
|
|
6510
|
-
function r2(r3) {
|
|
6511
|
-
function t2(t3, i, a2, o) {
|
|
6512
|
-
var f = i ? e + t3 + r3.e + i : e + t3, v = f;
|
|
6513
|
-
if (a2) {
|
|
6514
|
-
var s = " " + v + r3.m;
|
|
6515
|
-
for (var u in a2)
|
|
6516
|
-
if (a2.hasOwnProperty(u)) {
|
|
6517
|
-
var p = a2[u];
|
|
6518
|
-
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
6519
|
-
}
|
|
6520
|
-
}
|
|
6521
|
-
if (void 0 !== o)
|
|
6522
|
-
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
6523
|
-
var l = o[y2];
|
|
6524
|
-
if (l && "string" == typeof l.valueOf())
|
|
6525
|
-
for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
6526
|
-
var h = g[d];
|
|
6527
|
-
h !== f && (v += " " + h);
|
|
6528
|
-
}
|
|
6529
|
-
}
|
|
6530
|
-
return v;
|
|
6531
|
-
}
|
|
6532
|
-
var e = r3.n || "", n = r3.v || r3.m;
|
|
6533
|
-
return function(r4, e2) {
|
|
6534
|
-
return function(n2, i, a2) {
|
|
6535
|
-
return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r4, n2, void 0, i) : t2(r4, n2, i, a2) : t2(r4, e2, n2, i);
|
|
6536
|
-
};
|
|
6537
|
-
};
|
|
6495
|
+
function usePropsValue({
|
|
6496
|
+
value,
|
|
6497
|
+
defaultValue,
|
|
6498
|
+
finalValue,
|
|
6499
|
+
onChange = (value2) => {
|
|
6538
6500
|
}
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
if (
|
|
6548
|
-
return
|
|
6549
|
-
hasRequiredClassname_development = 1;
|
|
6550
|
-
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
6551
|
-
function withNaming(preset) {
|
|
6552
|
-
var nameSpace = preset.n || "";
|
|
6553
|
-
var modValueDelimiter = preset.v || preset.m;
|
|
6554
|
-
function stringify(b2, e, m, mix) {
|
|
6555
|
-
var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
|
|
6556
|
-
var className = entityName;
|
|
6557
|
-
if (m) {
|
|
6558
|
-
var modPrefix = " " + className + preset.m;
|
|
6559
|
-
for (var k in m) {
|
|
6560
|
-
if (m.hasOwnProperty(k)) {
|
|
6561
|
-
var modVal = m[k];
|
|
6562
|
-
if (modVal === true) {
|
|
6563
|
-
className += modPrefix + k;
|
|
6564
|
-
} else if (modVal) {
|
|
6565
|
-
className += modPrefix + k + modValueDelimiter + modVal;
|
|
6566
|
-
}
|
|
6567
|
-
}
|
|
6568
|
-
}
|
|
6569
|
-
}
|
|
6570
|
-
if (mix !== void 0) {
|
|
6571
|
-
mix = Array.isArray(mix) ? mix : [mix];
|
|
6572
|
-
for (var i = 0, len = mix.length; i < len; i++) {
|
|
6573
|
-
var value = mix[i];
|
|
6574
|
-
if (!value || typeof value.valueOf() !== "string")
|
|
6575
|
-
continue;
|
|
6576
|
-
var mixes = value.valueOf().split(" ");
|
|
6577
|
-
for (var j = 0; j < mixes.length; j++) {
|
|
6578
|
-
var val = mixes[j];
|
|
6579
|
-
if (val !== entityName) {
|
|
6580
|
-
className += " " + val;
|
|
6581
|
-
}
|
|
6582
|
-
}
|
|
6583
|
-
}
|
|
6584
|
-
}
|
|
6585
|
-
return className;
|
|
6586
|
-
}
|
|
6587
|
-
return function cnGenerator(b2, e) {
|
|
6588
|
-
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
6589
|
-
if (typeof elemOrMods === "string") {
|
|
6590
|
-
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
6591
|
-
return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
|
|
6592
|
-
}
|
|
6593
|
-
return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
6594
|
-
}
|
|
6595
|
-
return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
|
|
6596
|
-
};
|
|
6597
|
-
};
|
|
6501
|
+
}) {
|
|
6502
|
+
const [uncontrolled, setUncontrolled] = useState(
|
|
6503
|
+
defaultValue !== void 0 ? defaultValue : finalValue
|
|
6504
|
+
);
|
|
6505
|
+
const handleUncontrolledChange = (val) => {
|
|
6506
|
+
setUncontrolled(val);
|
|
6507
|
+
onChange == null ? void 0 : onChange(val);
|
|
6508
|
+
};
|
|
6509
|
+
if (value !== void 0) {
|
|
6510
|
+
return [value, onChange];
|
|
6598
6511
|
}
|
|
6599
|
-
|
|
6600
|
-
e: "-",
|
|
6601
|
-
m: "_"
|
|
6602
|
-
});
|
|
6603
|
-
classname_development.cn = cn2;
|
|
6604
|
-
classname_development.withNaming = withNaming;
|
|
6605
|
-
return classname_development;
|
|
6512
|
+
return [uncontrolled, handleUncontrolledChange];
|
|
6606
6513
|
}
|
|
6607
|
-
(function(module) {
|
|
6608
|
-
if (process.env.NODE_ENV === "production") {
|
|
6609
|
-
module.exports = requireClassname_production_min();
|
|
6610
|
-
} else {
|
|
6611
|
-
module.exports = requireClassname_development();
|
|
6612
|
-
}
|
|
6613
|
-
})(classname);
|
|
6614
|
-
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
6615
6514
|
const defaultProps$1a = {
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
style: {},
|
|
6624
|
-
onSwitch: (child, activeVisible) => {
|
|
6625
|
-
}
|
|
6515
|
+
...ComponentDefaults,
|
|
6516
|
+
value: "",
|
|
6517
|
+
dot: false,
|
|
6518
|
+
max: 99,
|
|
6519
|
+
top: "0",
|
|
6520
|
+
right: "5",
|
|
6521
|
+
color: ""
|
|
6626
6522
|
};
|
|
6627
|
-
const
|
|
6628
|
-
const {
|
|
6629
|
-
children,
|
|
6630
|
-
visible,
|
|
6631
|
-
activeVisible,
|
|
6632
|
-
bottom,
|
|
6633
|
-
size,
|
|
6634
|
-
activeColor,
|
|
6635
|
-
unactiveColor,
|
|
6636
|
-
safeAreaInsetBottom,
|
|
6637
|
-
className,
|
|
6638
|
-
style,
|
|
6639
|
-
onSwitch
|
|
6640
|
-
} = {
|
|
6523
|
+
const Badge = (props) => {
|
|
6524
|
+
const { className, style, value, max, children, dot, top, right, color } = {
|
|
6641
6525
|
...defaultProps$1a,
|
|
6642
6526
|
...props
|
|
6643
6527
|
};
|
|
6644
|
-
const
|
|
6645
|
-
const
|
|
6646
|
-
const
|
|
6647
|
-
|
|
6648
|
-
|
|
6528
|
+
const classPrefix2 = "nut-badge";
|
|
6529
|
+
const classes = classNames(classPrefix2, className);
|
|
6530
|
+
const contentClasses = classNames(
|
|
6531
|
+
{ [`${classPrefix2}__dot`]: dot },
|
|
6532
|
+
`${classPrefix2}__content`,
|
|
6533
|
+
`${classPrefix2}__sup`
|
|
6534
|
+
);
|
|
6535
|
+
function content() {
|
|
6536
|
+
if (dot || typeof value === "object")
|
|
6537
|
+
return null;
|
|
6538
|
+
if (typeof value === "number" && typeof max === "number") {
|
|
6539
|
+
return max < value ? `${max}+` : value;
|
|
6649
6540
|
}
|
|
6541
|
+
return value;
|
|
6542
|
+
}
|
|
6543
|
+
const getStyle = () => {
|
|
6544
|
+
const style2 = {};
|
|
6545
|
+
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
6546
|
+
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
6547
|
+
style2.background = color;
|
|
6548
|
+
return style2;
|
|
6650
6549
|
};
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
}
|
|
6655
|
-
}
|
|
6656
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6657
|
-
"div",
|
|
6658
|
-
{
|
|
6659
|
-
className: [
|
|
6660
|
-
`${b2()}`,
|
|
6661
|
-
bottom ? `${b2("bottom")}` : "",
|
|
6662
|
-
safeAreaInsetBottom ? `${b2("bottom")} ${b2("safebottom")}` : "",
|
|
6663
|
-
className
|
|
6664
|
-
].join(" "),
|
|
6665
|
-
style,
|
|
6666
|
-
children: React__default.Children.map(children, (child, idx) => {
|
|
6667
|
-
if (!React__default.isValidElement(child)) {
|
|
6668
|
-
return null;
|
|
6669
|
-
}
|
|
6670
|
-
const childProps = {
|
|
6671
|
-
...child.props,
|
|
6672
|
-
active: idx === selectIndex,
|
|
6673
|
-
index: idx,
|
|
6674
|
-
unactiveColor,
|
|
6675
|
-
activeColor,
|
|
6676
|
-
size,
|
|
6677
|
-
handleClick: () => {
|
|
6678
|
-
handleClick(idx);
|
|
6679
|
-
onSwitch(child, idx);
|
|
6680
|
-
}
|
|
6681
|
-
};
|
|
6682
|
-
return React__default.cloneElement(child, childProps);
|
|
6683
|
-
})
|
|
6684
|
-
}
|
|
6685
|
-
);
|
|
6550
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, children: [
|
|
6551
|
+
typeof value === "object" && value && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__icon`, children: value }),
|
|
6552
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
|
|
6553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
6554
|
+
] });
|
|
6686
6555
|
};
|
|
6687
|
-
|
|
6688
|
-
|
|
6556
|
+
Badge.defaultProps = defaultProps$1a;
|
|
6557
|
+
Badge.displayName = "NutBadge";
|
|
6689
6558
|
const defaultProps$19 = {
|
|
6690
6559
|
...ComponentDefaults,
|
|
6691
|
-
|
|
6692
|
-
className: "",
|
|
6693
|
-
tabTitle: "",
|
|
6560
|
+
title: "",
|
|
6694
6561
|
icon: null,
|
|
6695
|
-
href: "",
|
|
6696
|
-
to: "",
|
|
6697
|
-
num: "",
|
|
6698
6562
|
active: false,
|
|
6699
|
-
activeColor: "",
|
|
6700
|
-
unactiveColor: "",
|
|
6701
6563
|
index: 0,
|
|
6702
6564
|
handleClick: (idx) => {
|
|
6703
6565
|
}
|
|
6704
6566
|
};
|
|
6705
6567
|
const TabbarItem = (props) => {
|
|
6706
6568
|
const {
|
|
6707
|
-
dot,
|
|
6708
6569
|
className,
|
|
6709
6570
|
style,
|
|
6710
|
-
|
|
6571
|
+
title,
|
|
6711
6572
|
icon,
|
|
6712
|
-
href,
|
|
6713
|
-
to: to2,
|
|
6714
|
-
num,
|
|
6715
6573
|
active,
|
|
6716
6574
|
activeColor,
|
|
6717
|
-
|
|
6575
|
+
inactiveColor,
|
|
6718
6576
|
index,
|
|
6719
|
-
handleClick
|
|
6577
|
+
handleClick,
|
|
6578
|
+
...rest
|
|
6720
6579
|
} = {
|
|
6721
6580
|
...defaultProps$19,
|
|
6722
6581
|
...props
|
|
6723
6582
|
};
|
|
6724
|
-
const
|
|
6725
|
-
const
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
}
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
url: to2
|
|
6734
|
-
});
|
|
6735
|
-
}
|
|
6736
|
-
}, [active, href, to2]);
|
|
6737
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
6583
|
+
const classPrefix2 = "nut-tabbar-item";
|
|
6584
|
+
const tabbarItemClass = classNames(className, classPrefix2, {
|
|
6585
|
+
[`${classPrefix2}-active`]: active
|
|
6586
|
+
});
|
|
6587
|
+
const boxPrefix = `${classPrefix2}__icon-box`;
|
|
6588
|
+
const titleClass = classNames(boxPrefix, `${boxPrefix}-nav`, {
|
|
6589
|
+
[`${boxPrefix}-large`]: !icon
|
|
6590
|
+
});
|
|
6591
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6738
6592
|
"div",
|
|
6739
6593
|
{
|
|
6740
|
-
className:
|
|
6594
|
+
className: tabbarItemClass,
|
|
6741
6595
|
style: {
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
},
|
|
6745
|
-
onClick: () => {
|
|
6746
|
-
handleClick(index);
|
|
6596
|
+
color: active ? activeColor : inactiveColor,
|
|
6597
|
+
...style
|
|
6747
6598
|
},
|
|
6599
|
+
onClick: () => handleClick(index),
|
|
6600
|
+
children: icon ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6601
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: boxPrefix, children: icon }) }),
|
|
6602
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: titleClass, children: title })
|
|
6603
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: titleClass, children: title }) })
|
|
6604
|
+
}
|
|
6605
|
+
);
|
|
6606
|
+
};
|
|
6607
|
+
const defaultProps$18 = {
|
|
6608
|
+
...ComponentDefaults,
|
|
6609
|
+
defaultValue: 0,
|
|
6610
|
+
fixed: false,
|
|
6611
|
+
inactiveColor: "",
|
|
6612
|
+
activeColor: "",
|
|
6613
|
+
safeArea: false,
|
|
6614
|
+
onSwitch: (value) => {
|
|
6615
|
+
}
|
|
6616
|
+
};
|
|
6617
|
+
const Tabbar = (props) => {
|
|
6618
|
+
const {
|
|
6619
|
+
children,
|
|
6620
|
+
defaultValue,
|
|
6621
|
+
value,
|
|
6622
|
+
fixed,
|
|
6623
|
+
activeColor,
|
|
6624
|
+
inactiveColor,
|
|
6625
|
+
safeArea,
|
|
6626
|
+
className,
|
|
6627
|
+
style,
|
|
6628
|
+
onSwitch
|
|
6629
|
+
} = {
|
|
6630
|
+
...defaultProps$18,
|
|
6631
|
+
...props
|
|
6632
|
+
};
|
|
6633
|
+
const classPrefix2 = "nut-tabbar";
|
|
6634
|
+
const [selectIndex, setSelectIndex] = usePropsValue({
|
|
6635
|
+
value,
|
|
6636
|
+
defaultValue,
|
|
6637
|
+
finalValue: 0,
|
|
6638
|
+
onChange: onSwitch
|
|
6639
|
+
});
|
|
6640
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
6641
|
+
"div",
|
|
6642
|
+
{
|
|
6643
|
+
className: classNames(classPrefix2, className, {
|
|
6644
|
+
[`${classPrefix2}__fixed`]: fixed
|
|
6645
|
+
}),
|
|
6646
|
+
style,
|
|
6748
6647
|
children: [
|
|
6749
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
6750
|
-
!
|
|
6751
|
-
|
|
6752
|
-
num && num >= 100 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${bIcon("tips", [bIcon("nums")])}`, children: "99+" })
|
|
6753
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${bIcon("tips", [bIcon("dot")])}` }),
|
|
6754
|
-
icon || null
|
|
6755
|
-
] }),
|
|
6756
|
-
tabTitle && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6757
|
-
"div",
|
|
6758
|
-
{
|
|
6759
|
-
className: bIcon({ "nav-word": true }, [
|
|
6760
|
-
bIcon({ "big-word": !icon })
|
|
6761
|
-
]),
|
|
6762
|
-
children: tabTitle
|
|
6648
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__wrap`, children: React__default.Children.map(children, (child, idx) => {
|
|
6649
|
+
if (!React__default.isValidElement(child)) {
|
|
6650
|
+
return null;
|
|
6763
6651
|
}
|
|
6764
|
-
|
|
6652
|
+
const childProps = {
|
|
6653
|
+
...child.props,
|
|
6654
|
+
active: idx === selectIndex,
|
|
6655
|
+
index: idx,
|
|
6656
|
+
inactiveColor,
|
|
6657
|
+
activeColor,
|
|
6658
|
+
handleClick: setSelectIndex
|
|
6659
|
+
};
|
|
6660
|
+
return React__default.cloneElement(child, childProps);
|
|
6661
|
+
}) }),
|
|
6662
|
+
(fixed || safeArea) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__safe-area` })
|
|
6765
6663
|
]
|
|
6766
6664
|
}
|
|
6767
6665
|
);
|
|
6768
6666
|
};
|
|
6769
|
-
|
|
6667
|
+
Tabbar.defaultProps = defaultProps$18;
|
|
6668
|
+
Tabbar.displayName = "NutTabbar";
|
|
6669
|
+
Tabbar.Item = TabbarItem;
|
|
6670
|
+
const defaultProps$17 = {
|
|
6770
6671
|
title: "",
|
|
6771
6672
|
value: "",
|
|
6772
6673
|
disabled: false
|
|
6773
6674
|
};
|
|
6774
6675
|
const TabPane = (props) => {
|
|
6775
6676
|
const { children, autoHeightClassName, className, disabled } = {
|
|
6776
|
-
...defaultProps$
|
|
6677
|
+
...defaultProps$17,
|
|
6777
6678
|
...props
|
|
6778
6679
|
};
|
|
6779
6680
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -6787,26 +6688,7 @@ const TabPane = (props) => {
|
|
|
6787
6688
|
);
|
|
6788
6689
|
return children ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, children: !disabled && children }) : null;
|
|
6789
6690
|
};
|
|
6790
|
-
|
|
6791
|
-
value,
|
|
6792
|
-
defaultValue,
|
|
6793
|
-
finalValue,
|
|
6794
|
-
onChange = (value2) => {
|
|
6795
|
-
}
|
|
6796
|
-
}) {
|
|
6797
|
-
const [uncontrolled, setUncontrolled] = useState(
|
|
6798
|
-
defaultValue !== void 0 ? defaultValue : finalValue
|
|
6799
|
-
);
|
|
6800
|
-
const handleUncontrolledChange = (val) => {
|
|
6801
|
-
setUncontrolled(val);
|
|
6802
|
-
onChange == null ? void 0 : onChange(val);
|
|
6803
|
-
};
|
|
6804
|
-
if (value !== void 0) {
|
|
6805
|
-
return [value, onChange];
|
|
6806
|
-
}
|
|
6807
|
-
return [uncontrolled, handleUncontrolledChange];
|
|
6808
|
-
}
|
|
6809
|
-
const defaultProps$17 = {
|
|
6691
|
+
const defaultProps$16 = {
|
|
6810
6692
|
...ComponentDefaults,
|
|
6811
6693
|
tabStyle: {},
|
|
6812
6694
|
activeColor: "",
|
|
@@ -6815,7 +6697,7 @@ const defaultProps$17 = {
|
|
|
6815
6697
|
duration: 300,
|
|
6816
6698
|
autoHeight: false
|
|
6817
6699
|
};
|
|
6818
|
-
const classPrefix$
|
|
6700
|
+
const classPrefix$4 = "nut-tabs";
|
|
6819
6701
|
const Tabs = (props) => {
|
|
6820
6702
|
const {
|
|
6821
6703
|
activeColor,
|
|
@@ -6832,7 +6714,7 @@ const Tabs = (props) => {
|
|
|
6832
6714
|
autoHeight,
|
|
6833
6715
|
...rest
|
|
6834
6716
|
} = {
|
|
6835
|
-
...defaultProps$
|
|
6717
|
+
...defaultProps$16,
|
|
6836
6718
|
...props
|
|
6837
6719
|
};
|
|
6838
6720
|
const [value, setValue] = usePropsValue({
|
|
@@ -6862,14 +6744,14 @@ const Tabs = (props) => {
|
|
|
6862
6744
|
};
|
|
6863
6745
|
const titles = useRef(getTitles());
|
|
6864
6746
|
const classes = classNames(
|
|
6865
|
-
classPrefix$
|
|
6866
|
-
`${classPrefix$
|
|
6747
|
+
classPrefix$4,
|
|
6748
|
+
`${classPrefix$4}--${direction}`,
|
|
6867
6749
|
className
|
|
6868
6750
|
);
|
|
6869
|
-
const classesTitle = classNames(`${classPrefix$
|
|
6870
|
-
[`${classPrefix$
|
|
6871
|
-
[`${classPrefix$
|
|
6872
|
-
[`${classPrefix$
|
|
6751
|
+
const classesTitle = classNames(`${classPrefix$4}__titles`, {
|
|
6752
|
+
[`${classPrefix$4}__titles--${activeType}`]: activeType,
|
|
6753
|
+
[`${classPrefix$4}__titles--scrollable`]: true,
|
|
6754
|
+
[`${classPrefix$4}__titles--${align}`]: align
|
|
6873
6755
|
});
|
|
6874
6756
|
const tabsActiveStyle = {
|
|
6875
6757
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -6915,7 +6797,7 @@ const Tabs = (props) => {
|
|
|
6915
6797
|
onClick: (e) => {
|
|
6916
6798
|
tabChange(item);
|
|
6917
6799
|
},
|
|
6918
|
-
className: classNames(`${classPrefix$
|
|
6800
|
+
className: classNames(`${classPrefix$4}__titles-item`, {
|
|
6919
6801
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
6920
6802
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
6921
6803
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -6924,14 +6806,14 @@ const Tabs = (props) => {
|
|
|
6924
6806
|
activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6925
6807
|
View,
|
|
6926
6808
|
{
|
|
6927
|
-
className: `${classPrefix$
|
|
6809
|
+
className: `${classPrefix$4}__titles-item__line`,
|
|
6928
6810
|
style: tabsActiveStyle
|
|
6929
6811
|
}
|
|
6930
6812
|
),
|
|
6931
6813
|
activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6932
6814
|
View,
|
|
6933
6815
|
{
|
|
6934
|
-
className: `${classPrefix$
|
|
6816
|
+
className: `${classPrefix$4}__titles-item__smile`,
|
|
6935
6817
|
style: tabsActiveStyle,
|
|
6936
6818
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(a$h, { color: activeColor, width: 40, height: 20 })
|
|
6937
6819
|
}
|
|
@@ -6943,7 +6825,7 @@ const Tabs = (props) => {
|
|
|
6943
6825
|
{
|
|
6944
6826
|
ellipsis: true
|
|
6945
6827
|
},
|
|
6946
|
-
`${classPrefix$
|
|
6828
|
+
`${classPrefix$4}__titles-item__text`
|
|
6947
6829
|
),
|
|
6948
6830
|
children: item.title
|
|
6949
6831
|
}
|
|
@@ -6955,27 +6837,147 @@ const Tabs = (props) => {
|
|
|
6955
6837
|
})
|
|
6956
6838
|
}
|
|
6957
6839
|
),
|
|
6958
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: `${classPrefix$
|
|
6840
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: `${classPrefix$4}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: `${classPrefix$4}__content`, style: contentStyle, children: React__default.Children.map(children, (child, idx) => {
|
|
6959
6841
|
if (!React__default.isValidElement(child)) {
|
|
6960
6842
|
return null;
|
|
6961
6843
|
}
|
|
6962
|
-
let childProps = {
|
|
6963
|
-
...child.props,
|
|
6964
|
-
active: value === child.props.value
|
|
6844
|
+
let childProps = {
|
|
6845
|
+
...child.props,
|
|
6846
|
+
active: value === child.props.value
|
|
6847
|
+
};
|
|
6848
|
+
if (String(value) !== String(child.props.value || idx) && autoHeight) {
|
|
6849
|
+
childProps = {
|
|
6850
|
+
...childProps,
|
|
6851
|
+
autoHeightClassName: "inactive"
|
|
6852
|
+
};
|
|
6853
|
+
}
|
|
6854
|
+
return React__default.cloneElement(child, childProps);
|
|
6855
|
+
}) }) })
|
|
6856
|
+
] });
|
|
6857
|
+
};
|
|
6858
|
+
Tabs.defaultProps = defaultProps$16;
|
|
6859
|
+
Tabs.displayName = "NutTabs";
|
|
6860
|
+
Tabs.TabPane = TabPane;
|
|
6861
|
+
var classnameExports = {};
|
|
6862
|
+
var classname = {
|
|
6863
|
+
get exports() {
|
|
6864
|
+
return classnameExports;
|
|
6865
|
+
},
|
|
6866
|
+
set exports(v) {
|
|
6867
|
+
classnameExports = v;
|
|
6868
|
+
}
|
|
6869
|
+
};
|
|
6870
|
+
var classname_production_min = {};
|
|
6871
|
+
var hasRequiredClassname_production_min;
|
|
6872
|
+
function requireClassname_production_min() {
|
|
6873
|
+
if (hasRequiredClassname_production_min)
|
|
6874
|
+
return classname_production_min;
|
|
6875
|
+
hasRequiredClassname_production_min = 1;
|
|
6876
|
+
function r2(r3) {
|
|
6877
|
+
function t2(t3, i, a2, o) {
|
|
6878
|
+
var f = i ? e + t3 + r3.e + i : e + t3, v = f;
|
|
6879
|
+
if (a2) {
|
|
6880
|
+
var s = " " + v + r3.m;
|
|
6881
|
+
for (var u in a2)
|
|
6882
|
+
if (a2.hasOwnProperty(u)) {
|
|
6883
|
+
var p = a2[u];
|
|
6884
|
+
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
6885
|
+
}
|
|
6886
|
+
}
|
|
6887
|
+
if (void 0 !== o)
|
|
6888
|
+
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
6889
|
+
var l = o[y2];
|
|
6890
|
+
if (l && "string" == typeof l.valueOf())
|
|
6891
|
+
for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
6892
|
+
var h = g[d];
|
|
6893
|
+
h !== f && (v += " " + h);
|
|
6894
|
+
}
|
|
6895
|
+
}
|
|
6896
|
+
return v;
|
|
6897
|
+
}
|
|
6898
|
+
var e = r3.n || "", n = r3.v || r3.m;
|
|
6899
|
+
return function(r4, e2) {
|
|
6900
|
+
return function(n2, i, a2) {
|
|
6901
|
+
return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r4, n2, void 0, i) : t2(r4, n2, i, a2) : t2(r4, e2, n2, i);
|
|
6965
6902
|
};
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6903
|
+
};
|
|
6904
|
+
}
|
|
6905
|
+
Object.defineProperty(classname_production_min, "__esModule", { value: true });
|
|
6906
|
+
var t = r2({ e: "-", m: "_" });
|
|
6907
|
+
classname_production_min.cn = t, classname_production_min.withNaming = r2;
|
|
6908
|
+
return classname_production_min;
|
|
6909
|
+
}
|
|
6910
|
+
var classname_development = {};
|
|
6911
|
+
var hasRequiredClassname_development;
|
|
6912
|
+
function requireClassname_development() {
|
|
6913
|
+
if (hasRequiredClassname_development)
|
|
6914
|
+
return classname_development;
|
|
6915
|
+
hasRequiredClassname_development = 1;
|
|
6916
|
+
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
6917
|
+
function withNaming(preset) {
|
|
6918
|
+
var nameSpace = preset.n || "";
|
|
6919
|
+
var modValueDelimiter = preset.v || preset.m;
|
|
6920
|
+
function stringify(b2, e, m, mix) {
|
|
6921
|
+
var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
|
|
6922
|
+
var className = entityName;
|
|
6923
|
+
if (m) {
|
|
6924
|
+
var modPrefix = " " + className + preset.m;
|
|
6925
|
+
for (var k in m) {
|
|
6926
|
+
if (m.hasOwnProperty(k)) {
|
|
6927
|
+
var modVal = m[k];
|
|
6928
|
+
if (modVal === true) {
|
|
6929
|
+
className += modPrefix + k;
|
|
6930
|
+
} else if (modVal) {
|
|
6931
|
+
className += modPrefix + k + modValueDelimiter + modVal;
|
|
6932
|
+
}
|
|
6933
|
+
}
|
|
6934
|
+
}
|
|
6971
6935
|
}
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6936
|
+
if (mix !== void 0) {
|
|
6937
|
+
mix = Array.isArray(mix) ? mix : [mix];
|
|
6938
|
+
for (var i = 0, len = mix.length; i < len; i++) {
|
|
6939
|
+
var value = mix[i];
|
|
6940
|
+
if (!value || typeof value.valueOf() !== "string")
|
|
6941
|
+
continue;
|
|
6942
|
+
var mixes = value.valueOf().split(" ");
|
|
6943
|
+
for (var j = 0; j < mixes.length; j++) {
|
|
6944
|
+
var val = mixes[j];
|
|
6945
|
+
if (val !== entityName) {
|
|
6946
|
+
className += " " + val;
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
}
|
|
6950
|
+
}
|
|
6951
|
+
return className;
|
|
6952
|
+
}
|
|
6953
|
+
return function cnGenerator(b2, e) {
|
|
6954
|
+
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
6955
|
+
if (typeof elemOrMods === "string") {
|
|
6956
|
+
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
6957
|
+
return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
|
|
6958
|
+
}
|
|
6959
|
+
return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
6960
|
+
}
|
|
6961
|
+
return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
|
|
6962
|
+
};
|
|
6963
|
+
};
|
|
6964
|
+
}
|
|
6965
|
+
var cn2 = withNaming({
|
|
6966
|
+
e: "-",
|
|
6967
|
+
m: "_"
|
|
6968
|
+
});
|
|
6969
|
+
classname_development.cn = cn2;
|
|
6970
|
+
classname_development.withNaming = withNaming;
|
|
6971
|
+
return classname_development;
|
|
6972
|
+
}
|
|
6973
|
+
(function(module) {
|
|
6974
|
+
if (process.env.NODE_ENV === "production") {
|
|
6975
|
+
module.exports = requireClassname_production_min();
|
|
6976
|
+
} else {
|
|
6977
|
+
module.exports = requireClassname_development();
|
|
6978
|
+
}
|
|
6979
|
+
})(classname);
|
|
6980
|
+
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
6979
6981
|
const defaultConfigRef = {
|
|
6980
6982
|
current: {
|
|
6981
6983
|
locale: zhCN
|
|
@@ -6988,7 +6990,7 @@ const ConfigContext = createContext(null);
|
|
|
6988
6990
|
const useConfig = () => {
|
|
6989
6991
|
return useContext(ConfigContext) ?? getDefaultConfig();
|
|
6990
6992
|
};
|
|
6991
|
-
const defaultProps$
|
|
6993
|
+
const defaultProps$15 = {
|
|
6992
6994
|
type: "custom",
|
|
6993
6995
|
existAddress: [],
|
|
6994
6996
|
defaultIcon: null,
|
|
@@ -7010,7 +7012,7 @@ const ExistRender = (props) => {
|
|
|
7010
7012
|
onClose,
|
|
7011
7013
|
onSwitchModule,
|
|
7012
7014
|
...rest
|
|
7013
|
-
} = { ...defaultProps$
|
|
7015
|
+
} = { ...defaultProps$15, ...props };
|
|
7014
7016
|
const b2 = cn("address");
|
|
7015
7017
|
const selectedExist = (item) => {
|
|
7016
7018
|
const copyExistAdd = existAddress;
|
|
@@ -7052,7 +7054,7 @@ const ExistRender = (props) => {
|
|
|
7052
7054
|
isShowCustomAddress && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("choose-other"), onClick: onSwitch, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("choose-other-btn"), children: customAndExistTitle || locale.address.chooseAnotherAddress }) })
|
|
7053
7055
|
] });
|
|
7054
7056
|
};
|
|
7055
|
-
const defaultProps$
|
|
7057
|
+
const defaultProps$14 = {
|
|
7056
7058
|
modelValue: [],
|
|
7057
7059
|
type: "custom",
|
|
7058
7060
|
province: [],
|
|
@@ -7077,7 +7079,7 @@ const CustomRender = (props) => {
|
|
|
7077
7079
|
onClose,
|
|
7078
7080
|
...rest
|
|
7079
7081
|
} = {
|
|
7080
|
-
...defaultProps$
|
|
7082
|
+
...defaultProps$14,
|
|
7081
7083
|
...props
|
|
7082
7084
|
};
|
|
7083
7085
|
const b2 = cn("address");
|
|
@@ -7241,28 +7243,28 @@ const CustomRender = (props) => {
|
|
|
7241
7243
|
nextAreaList(item);
|
|
7242
7244
|
};
|
|
7243
7245
|
useEffect(() => {
|
|
7244
|
-
const { province: province2 } = { ...defaultProps$
|
|
7246
|
+
const { province: province2 } = { ...defaultProps$14, ...props };
|
|
7245
7247
|
setRegionList({
|
|
7246
7248
|
...regionList,
|
|
7247
7249
|
province: isCustom2() ? transformData(province2) : province2
|
|
7248
7250
|
});
|
|
7249
7251
|
}, [province]);
|
|
7250
7252
|
useEffect(() => {
|
|
7251
|
-
const { city: city2 } = { ...defaultProps$
|
|
7253
|
+
const { city: city2 } = { ...defaultProps$14, ...props };
|
|
7252
7254
|
setRegionList({
|
|
7253
7255
|
...regionList,
|
|
7254
7256
|
city: isCustom2() ? transformData(city2) : city2
|
|
7255
7257
|
});
|
|
7256
7258
|
}, [city]);
|
|
7257
7259
|
useEffect(() => {
|
|
7258
|
-
const { country: country2 } = { ...defaultProps$
|
|
7260
|
+
const { country: country2 } = { ...defaultProps$14, ...props };
|
|
7259
7261
|
setRegionList({
|
|
7260
7262
|
...regionList,
|
|
7261
7263
|
country: isCustom2() ? transformData(country2) : country2
|
|
7262
7264
|
});
|
|
7263
7265
|
}, [country]);
|
|
7264
7266
|
useEffect(() => {
|
|
7265
|
-
const { town: town2 } = { ...defaultProps$
|
|
7267
|
+
const { town: town2 } = { ...defaultProps$14, ...props };
|
|
7266
7268
|
setRegionList({
|
|
7267
7269
|
...regionList,
|
|
7268
7270
|
town: isCustom2() ? transformData(town2) : town2
|
|
@@ -7335,7 +7337,7 @@ const CustomRender = (props) => {
|
|
|
7335
7337
|
) })
|
|
7336
7338
|
] });
|
|
7337
7339
|
};
|
|
7338
|
-
const defaultProps$
|
|
7340
|
+
const defaultProps$13 = {
|
|
7339
7341
|
...ComponentDefaults,
|
|
7340
7342
|
modelValue: false,
|
|
7341
7343
|
modelSelect: [],
|
|
@@ -7386,7 +7388,7 @@ const Address = (props) => {
|
|
|
7386
7388
|
className,
|
|
7387
7389
|
...rest
|
|
7388
7390
|
} = {
|
|
7389
|
-
...defaultProps$
|
|
7391
|
+
...defaultProps$13,
|
|
7390
7392
|
...props
|
|
7391
7393
|
};
|
|
7392
7394
|
const b2 = cn("address");
|
|
@@ -7544,7 +7546,7 @@ const Address = (props) => {
|
|
|
7544
7546
|
}
|
|
7545
7547
|
) });
|
|
7546
7548
|
};
|
|
7547
|
-
Address.defaultProps = defaultProps$
|
|
7549
|
+
Address.defaultProps = defaultProps$13;
|
|
7548
7550
|
Address.displayName = "NutAddress";
|
|
7549
7551
|
const Utils = {
|
|
7550
7552
|
/**
|
|
@@ -7677,7 +7679,7 @@ function requestAniFrame() {
|
|
|
7677
7679
|
}
|
|
7678
7680
|
}
|
|
7679
7681
|
const requestAniFrame$1 = requestAniFrame();
|
|
7680
|
-
const defaultProps$
|
|
7682
|
+
const defaultProps$12 = {
|
|
7681
7683
|
type: "one",
|
|
7682
7684
|
isAutoBackFill: false,
|
|
7683
7685
|
poppable: true,
|
|
@@ -7729,7 +7731,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
7729
7731
|
onUpdate,
|
|
7730
7732
|
onSelected,
|
|
7731
7733
|
onYearMonthChange
|
|
7732
|
-
} = { ...defaultProps$
|
|
7734
|
+
} = { ...defaultProps$12, ...props };
|
|
7733
7735
|
const weeks = locale.calendaritem.weekdays;
|
|
7734
7736
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
7735
7737
|
const [monthsData, setMonthsData] = useState([]);
|
|
@@ -8334,9 +8336,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
8334
8336
|
poppable && !isAutoBackFill ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-calendar-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "calendar-confirm-btn", onClick: confirm, children: confirmText || locale.confirm }) }) : ""
|
|
8335
8337
|
] }) });
|
|
8336
8338
|
});
|
|
8337
|
-
CalendarItem.defaultProps = defaultProps$
|
|
8339
|
+
CalendarItem.defaultProps = defaultProps$12;
|
|
8338
8340
|
CalendarItem.displayName = "NutCalendarItem";
|
|
8339
|
-
const defaultProps$
|
|
8341
|
+
const defaultProps$11 = {
|
|
8340
8342
|
type: "one",
|
|
8341
8343
|
isAutoBackFill: false,
|
|
8342
8344
|
poppable: true,
|
|
@@ -8392,7 +8394,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
8392
8394
|
onChoose,
|
|
8393
8395
|
onSelected,
|
|
8394
8396
|
onYearMonthChange
|
|
8395
|
-
} = { ...defaultProps$
|
|
8397
|
+
} = { ...defaultProps$11, ...props };
|
|
8396
8398
|
const calendarRef = useRef(null);
|
|
8397
8399
|
const close = () => {
|
|
8398
8400
|
onClose && onClose();
|
|
@@ -8462,9 +8464,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
8462
8464
|
}
|
|
8463
8465
|
) : renderItem() });
|
|
8464
8466
|
});
|
|
8465
|
-
Calendar.defaultProps = defaultProps$
|
|
8467
|
+
Calendar.defaultProps = defaultProps$11;
|
|
8466
8468
|
Calendar.displayName = "NutCalendar";
|
|
8467
|
-
const defaultProps$
|
|
8469
|
+
const defaultProps$10 = {
|
|
8468
8470
|
data: {
|
|
8469
8471
|
text: "",
|
|
8470
8472
|
value: "",
|
|
@@ -8481,7 +8483,7 @@ const defaultProps$11 = {
|
|
|
8481
8483
|
};
|
|
8482
8484
|
const InternalCascaderItem = (props, ref) => {
|
|
8483
8485
|
const { data, checked, checkedIcon, chooseItem, activeColor } = {
|
|
8484
|
-
...defaultProps$
|
|
8486
|
+
...defaultProps$10,
|
|
8485
8487
|
...props
|
|
8486
8488
|
};
|
|
8487
8489
|
const b2 = cn("cascader-item");
|
|
@@ -8520,7 +8522,7 @@ const InternalCascaderItem = (props, ref) => {
|
|
|
8520
8522
|
);
|
|
8521
8523
|
};
|
|
8522
8524
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
8523
|
-
CascaderItem.defaultProps = defaultProps$
|
|
8525
|
+
CascaderItem.defaultProps = defaultProps$10;
|
|
8524
8526
|
CascaderItem.displayName = "NutCascaderItem";
|
|
8525
8527
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
8526
8528
|
const {
|
|
@@ -8658,7 +8660,7 @@ class Tree {
|
|
|
8658
8660
|
}
|
|
8659
8661
|
}
|
|
8660
8662
|
const Tree$1 = Tree;
|
|
8661
|
-
const defaultProps
|
|
8663
|
+
const defaultProps$$ = {
|
|
8662
8664
|
className: "",
|
|
8663
8665
|
style: {},
|
|
8664
8666
|
activeColor: "",
|
|
@@ -8709,7 +8711,7 @@ const InternalCascader = (props, ref) => {
|
|
|
8709
8711
|
onClose,
|
|
8710
8712
|
onChange,
|
|
8711
8713
|
onPathChange
|
|
8712
|
-
} = { ...defaultProps
|
|
8714
|
+
} = { ...defaultProps$$, ...props };
|
|
8713
8715
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
8714
8716
|
const [optionsData, setOptionsData] = useState([]);
|
|
8715
8717
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
@@ -8983,11 +8985,11 @@ const InternalCascader = (props, ref) => {
|
|
|
8983
8985
|
) : renderItem() });
|
|
8984
8986
|
};
|
|
8985
8987
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
8986
|
-
Cascader.defaultProps = defaultProps
|
|
8988
|
+
Cascader.defaultProps = defaultProps$$;
|
|
8987
8989
|
Cascader.displayName = "NutCascader";
|
|
8988
8990
|
const CheckboxGroupContext = createContext(null);
|
|
8989
8991
|
const Context = CheckboxGroupContext;
|
|
8990
|
-
const defaultProps
|
|
8992
|
+
const defaultProps$_ = {
|
|
8991
8993
|
disabled: false,
|
|
8992
8994
|
checkedValue: [],
|
|
8993
8995
|
max: void 0,
|
|
@@ -8999,7 +9001,7 @@ const defaultProps$$ = {
|
|
|
8999
9001
|
};
|
|
9000
9002
|
const CheckboxGroup = React__default.forwardRef(
|
|
9001
9003
|
(props, ref) => {
|
|
9002
|
-
const { children } = { ...defaultProps
|
|
9004
|
+
const { children } = { ...defaultProps$_, ...props };
|
|
9003
9005
|
const b2 = cn("checkboxgroup");
|
|
9004
9006
|
const {
|
|
9005
9007
|
className,
|
|
@@ -9085,9 +9087,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
9085
9087
|
);
|
|
9086
9088
|
}
|
|
9087
9089
|
);
|
|
9088
|
-
CheckboxGroup.defaultProps = defaultProps
|
|
9090
|
+
CheckboxGroup.defaultProps = defaultProps$_;
|
|
9089
9091
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
9090
|
-
const defaultProps$
|
|
9092
|
+
const defaultProps$Z = {
|
|
9091
9093
|
...ComponentDefaults,
|
|
9092
9094
|
checked: false,
|
|
9093
9095
|
disabled: false,
|
|
@@ -9103,7 +9105,7 @@ const defaultProps$_ = {
|
|
|
9103
9105
|
};
|
|
9104
9106
|
const Checkbox = (props) => {
|
|
9105
9107
|
const { children } = {
|
|
9106
|
-
...defaultProps$
|
|
9108
|
+
...defaultProps$Z,
|
|
9107
9109
|
...props
|
|
9108
9110
|
};
|
|
9109
9111
|
const b2 = cn("checkbox");
|
|
@@ -9195,7 +9197,7 @@ const Checkbox = (props) => {
|
|
|
9195
9197
|
}
|
|
9196
9198
|
);
|
|
9197
9199
|
};
|
|
9198
|
-
Checkbox.defaultProps = defaultProps$
|
|
9200
|
+
Checkbox.defaultProps = defaultProps$Z;
|
|
9199
9201
|
Checkbox.displayName = "NutCheckBox";
|
|
9200
9202
|
Checkbox.Group = CheckboxGroup;
|
|
9201
9203
|
const MIN_DISTANCE = 10;
|
|
@@ -9744,7 +9746,7 @@ const InternalPicker = (props, ref) => {
|
|
|
9744
9746
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
9745
9747
|
const Picker$1 = Picker;
|
|
9746
9748
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
9747
|
-
const defaultProps$
|
|
9749
|
+
const defaultProps$Y = {
|
|
9748
9750
|
modelValue: null,
|
|
9749
9751
|
visible: false,
|
|
9750
9752
|
title: "",
|
|
@@ -9775,7 +9777,7 @@ const DatePicker = (props) => {
|
|
|
9775
9777
|
style,
|
|
9776
9778
|
...rest
|
|
9777
9779
|
} = {
|
|
9778
|
-
...defaultProps$
|
|
9780
|
+
...defaultProps$Y,
|
|
9779
9781
|
...props
|
|
9780
9782
|
};
|
|
9781
9783
|
const { locale } = useConfig$1();
|
|
@@ -10053,10 +10055,10 @@ const DatePicker = (props) => {
|
|
|
10053
10055
|
}
|
|
10054
10056
|
);
|
|
10055
10057
|
};
|
|
10056
|
-
DatePicker.defaultProps = defaultProps$
|
|
10058
|
+
DatePicker.defaultProps = defaultProps$Y;
|
|
10057
10059
|
DatePicker.displayName = "NutDatePicker";
|
|
10058
10060
|
const FormItemContext = createContext({});
|
|
10059
|
-
const defaultProps$
|
|
10061
|
+
const defaultProps$X = {
|
|
10060
10062
|
...ComponentDefaults,
|
|
10061
10063
|
name: "",
|
|
10062
10064
|
label: "",
|
|
@@ -10105,7 +10107,7 @@ class FormItem extends React__default.Component {
|
|
|
10105
10107
|
showErrorLine,
|
|
10106
10108
|
showErrorMessage
|
|
10107
10109
|
} = {
|
|
10108
|
-
...defaultProps$
|
|
10110
|
+
...defaultProps$X,
|
|
10109
10111
|
...this.props
|
|
10110
10112
|
};
|
|
10111
10113
|
const item = ((_a = this.context.errList) == null ? void 0 : _a.length) > 0 && ((_b = this.context.errList) == null ? void 0 : _b.filter((item2) => {
|
|
@@ -10166,7 +10168,7 @@ class FormItem extends React__default.Component {
|
|
|
10166
10168
|
return this.renderLayout(returnChildNode);
|
|
10167
10169
|
}
|
|
10168
10170
|
}
|
|
10169
|
-
__publicField(FormItem, "defaultProps", defaultProps$
|
|
10171
|
+
__publicField(FormItem, "defaultProps", defaultProps$X);
|
|
10170
10172
|
__publicField(FormItem, "contextType", FormItemContext);
|
|
10171
10173
|
class FormStore {
|
|
10172
10174
|
constructor() {
|
|
@@ -10290,7 +10292,7 @@ const useForm = (form) => {
|
|
|
10290
10292
|
}
|
|
10291
10293
|
return [formRef.current];
|
|
10292
10294
|
};
|
|
10293
|
-
const defaultProps$
|
|
10295
|
+
const defaultProps$W = {
|
|
10294
10296
|
...ComponentDefaults,
|
|
10295
10297
|
className: "",
|
|
10296
10298
|
style: void 0,
|
|
@@ -10317,7 +10319,7 @@ const Form = (props) => {
|
|
|
10317
10319
|
starPositon,
|
|
10318
10320
|
...rest
|
|
10319
10321
|
} = {
|
|
10320
|
-
...defaultProps$
|
|
10322
|
+
...defaultProps$W,
|
|
10321
10323
|
...props
|
|
10322
10324
|
};
|
|
10323
10325
|
console.log("46 dddd");
|
|
@@ -10341,383 +10343,223 @@ const Form = (props) => {
|
|
|
10341
10343
|
}
|
|
10342
10344
|
);
|
|
10343
10345
|
};
|
|
10344
|
-
Form.defaultProps = defaultProps$
|
|
10346
|
+
Form.defaultProps = defaultProps$W;
|
|
10345
10347
|
Form.displayName = "NutForm";
|
|
10346
10348
|
Form.Item = FormItem;
|
|
10347
|
-
function trimExtraChar(value, char, regExp) {
|
|
10348
|
-
const index = value.indexOf(char);
|
|
10349
|
-
if (index === -1) {
|
|
10350
|
-
return value;
|
|
10351
|
-
}
|
|
10352
|
-
if (char === "-" && index !== 0) {
|
|
10353
|
-
return value.slice(0, index);
|
|
10354
|
-
}
|
|
10355
|
-
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
10356
|
-
}
|
|
10357
|
-
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
10358
|
-
if (allowDot) {
|
|
10359
|
-
value = trimExtraChar(value, ".", /\./g);
|
|
10360
|
-
} else {
|
|
10361
|
-
value = value.split(".")[0];
|
|
10362
|
-
}
|
|
10363
|
-
if (allowMinus) {
|
|
10364
|
-
value = trimExtraChar(value, "-", /-/g);
|
|
10365
|
-
} else {
|
|
10366
|
-
value = value.replace(/-/, "");
|
|
10367
|
-
}
|
|
10368
|
-
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
10369
|
-
return value.replace(regExp, "");
|
|
10370
|
-
}
|
|
10371
|
-
const defaultProps$
|
|
10372
|
-
...ComponentDefaults,
|
|
10373
|
-
type: "text",
|
|
10374
|
-
name: "",
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
slotButton: null,
|
|
10403
|
-
slotInput: null
|
|
10404
|
-
};
|
|
10405
|
-
const Input = forwardRef((props, ref) => {
|
|
10406
|
-
const { locale } = useConfig$1();
|
|
10407
|
-
const {
|
|
10408
|
-
children,
|
|
10409
|
-
type,
|
|
10410
|
-
name,
|
|
10411
|
-
defaultValue,
|
|
10412
|
-
placeholder,
|
|
10413
|
-
label,
|
|
10414
|
-
labelClass,
|
|
10415
|
-
labelWidth,
|
|
10416
|
-
labelAlign,
|
|
10417
|
-
colon,
|
|
10418
|
-
inputAlign,
|
|
10419
|
-
center,
|
|
10420
|
-
required,
|
|
10421
|
-
disabled,
|
|
10422
|
-
readonly,
|
|
10423
|
-
error,
|
|
10424
|
-
maxlength,
|
|
10425
|
-
leftIcon,
|
|
10426
|
-
rightIcon,
|
|
10427
|
-
clearable,
|
|
10428
|
-
clearIcon,
|
|
10429
|
-
clearSize,
|
|
10430
|
-
border,
|
|
10431
|
-
formatTrigger,
|
|
10432
|
-
rules,
|
|
10433
|
-
errorMessage,
|
|
10434
|
-
errorMessageAlign,
|
|
10435
|
-
showWordLimit,
|
|
10436
|
-
autofocus,
|
|
10437
|
-
style,
|
|
10438
|
-
className,
|
|
10439
|
-
rows,
|
|
10440
|
-
slotButton,
|
|
10441
|
-
slotInput,
|
|
10442
|
-
onChange,
|
|
10443
|
-
onBlur,
|
|
10444
|
-
onFocus,
|
|
10445
|
-
onClear,
|
|
10446
|
-
formatter,
|
|
10447
|
-
keypress,
|
|
10448
|
-
onClickInput,
|
|
10449
|
-
onClickLeftIcon,
|
|
10450
|
-
onClickRightIcon,
|
|
10451
|
-
onClick,
|
|
10452
|
-
...rest
|
|
10453
|
-
} = {
|
|
10454
|
-
...defaultProps$W,
|
|
10455
|
-
...props
|
|
10456
|
-
};
|
|
10457
|
-
const inputPlaceholder = placeholder || locale.placeholder;
|
|
10458
|
-
const [inputValue, SetInputValue] = useState("");
|
|
10459
|
-
const [active, SetActive] = useState(false);
|
|
10460
|
-
const [classes, setClasses] = useState("");
|
|
10461
|
-
const getModelValue = () => String(inputValue ?? "");
|
|
10462
|
-
const inputRef = useRef(null);
|
|
10463
|
-
useEffect(() => {
|
|
10464
|
-
setClasses(inputClass);
|
|
10465
|
-
SetInputValue(defaultValue);
|
|
10466
|
-
}, [defaultValue]);
|
|
10467
|
-
useEffect(() => {
|
|
10468
|
-
if (inputValue) {
|
|
10469
|
-
updateValue(getModelValue());
|
|
10470
|
-
resetValidation();
|
|
10471
|
-
}
|
|
10472
|
-
}, [inputValue]);
|
|
10473
|
-
useImperativeHandle(ref, () => {
|
|
10474
|
-
return inputRef.current;
|
|
10475
|
-
});
|
|
10476
|
-
const inputClass = useCallback(() => {
|
|
10477
|
-
const prefixCls2 = "nut-input";
|
|
10478
|
-
return [
|
|
10479
|
-
prefixCls2,
|
|
10480
|
-
`${center ? "center" : ""}`,
|
|
10481
|
-
`${disabled ? `${prefixCls2}-disabled` : ""}`,
|
|
10482
|
-
`${required ? `${prefixCls2}-required` : ""}`,
|
|
10483
|
-
`${error ? `${prefixCls2}-error` : ""}`,
|
|
10484
|
-
`${border ? `${prefixCls2}-border` : ""}`,
|
|
10485
|
-
`${slotButton || rightIcon ? `${prefixCls2}-right-mark` : ""}`
|
|
10486
|
-
].filter(Boolean).join(" ");
|
|
10487
|
-
}, [disabled, required, error, border, slotButton, rightIcon, center]);
|
|
10488
|
-
useEffect(() => {
|
|
10489
|
-
setClasses(inputClass);
|
|
10490
|
-
}, [disabled, required, error, border, slotButton, rightIcon, center]);
|
|
10491
|
-
const updateValue = (value, trigger = "onChange") => {
|
|
10492
|
-
var _a;
|
|
10493
|
-
let val = value;
|
|
10494
|
-
if (type === "digit" || type === "tel") {
|
|
10495
|
-
val = formatNumber(val, false, false);
|
|
10496
|
-
}
|
|
10497
|
-
if (type === "number") {
|
|
10498
|
-
val = formatNumber(val, true, true);
|
|
10499
|
-
}
|
|
10500
|
-
if (type === "tel" && !formatter) {
|
|
10501
|
-
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}$/;
|
|
10502
|
-
const regNumber = /[^-0-9]/g;
|
|
10503
|
-
val = !regTel.test(val) && val.length > 11 ? val.substring(0, 11) : val.replace(regNumber, "");
|
|
10504
|
-
}
|
|
10505
|
-
if (formatter && trigger === formatTrigger) {
|
|
10506
|
-
val = formatter(val);
|
|
10507
|
-
}
|
|
10508
|
-
if (((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) !== val) {
|
|
10509
|
-
inputRef.current.value = val;
|
|
10510
|
-
}
|
|
10511
|
-
SetInputValue(val);
|
|
10512
|
-
};
|
|
10513
|
-
const handleFocus = (event) => {
|
|
10514
|
-
const val = event.target.value;
|
|
10515
|
-
SetActive(true);
|
|
10516
|
-
onFocus && onFocus(val, event);
|
|
10517
|
-
};
|
|
10518
|
-
const handleInput = (event) => {
|
|
10519
|
-
let val = event.target.value;
|
|
10520
|
-
if (maxlength && val.length > Number(maxlength)) {
|
|
10521
|
-
val = val.slice(0, Number(maxlength));
|
|
10522
|
-
}
|
|
10523
|
-
updateValue(val, "onChange");
|
|
10524
|
-
onChange && onChange(val, event);
|
|
10525
|
-
};
|
|
10526
|
-
const handleBlur = (event) => {
|
|
10527
|
-
setTimeout(() => {
|
|
10528
|
-
SetActive(false);
|
|
10529
|
-
}, 200);
|
|
10530
|
-
let val = event.target.value;
|
|
10531
|
-
if (maxlength && val.length > Number(maxlength)) {
|
|
10532
|
-
val = val.slice(0, Number(maxlength));
|
|
10533
|
-
}
|
|
10534
|
-
updateValue(val, "onBlur");
|
|
10535
|
-
onBlur && onBlur(val, event);
|
|
10536
|
-
};
|
|
10537
|
-
const handleClickInput = (event) => {
|
|
10538
|
-
onClickInput && onClickInput(event);
|
|
10539
|
-
};
|
|
10540
|
-
const handleClickLeftIcon = (event) => {
|
|
10541
|
-
onClickLeftIcon && onClickLeftIcon(event);
|
|
10542
|
-
};
|
|
10543
|
-
const handleClickRightIcon = (event) => {
|
|
10544
|
-
onClickRightIcon && onClickRightIcon(event);
|
|
10545
|
-
};
|
|
10546
|
-
const resetValidation = () => {
|
|
10547
|
-
};
|
|
10548
|
-
const inputType = (type2) => {
|
|
10549
|
-
if (type2 === "number") {
|
|
10550
|
-
return "text";
|
|
10551
|
-
}
|
|
10552
|
-
if (type2 === "digit") {
|
|
10553
|
-
return "tel";
|
|
10554
|
-
}
|
|
10555
|
-
return type2;
|
|
10556
|
-
};
|
|
10557
|
-
const handleClear = (event) => {
|
|
10558
|
-
updateValue("");
|
|
10559
|
-
onClear && onClear("", event);
|
|
10560
|
-
};
|
|
10561
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10562
|
-
"div",
|
|
10563
|
-
{
|
|
10564
|
-
className: `${classes} ${className || ""}`,
|
|
10349
|
+
function trimExtraChar(value, char, regExp) {
|
|
10350
|
+
const index = value.indexOf(char);
|
|
10351
|
+
if (index === -1) {
|
|
10352
|
+
return value;
|
|
10353
|
+
}
|
|
10354
|
+
if (char === "-" && index !== 0) {
|
|
10355
|
+
return value.slice(0, index);
|
|
10356
|
+
}
|
|
10357
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
10358
|
+
}
|
|
10359
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
10360
|
+
if (allowDot) {
|
|
10361
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
10362
|
+
} else {
|
|
10363
|
+
value = value.split(".")[0];
|
|
10364
|
+
}
|
|
10365
|
+
if (allowMinus) {
|
|
10366
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
10367
|
+
} else {
|
|
10368
|
+
value = value.replace(/-/, "");
|
|
10369
|
+
}
|
|
10370
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
10371
|
+
return value.replace(regExp, "");
|
|
10372
|
+
}
|
|
10373
|
+
const defaultProps$V = {
|
|
10374
|
+
...ComponentDefaults,
|
|
10375
|
+
type: "text",
|
|
10376
|
+
name: "",
|
|
10377
|
+
placeholder: "",
|
|
10378
|
+
confirmType: "done",
|
|
10379
|
+
align: "left",
|
|
10380
|
+
required: false,
|
|
10381
|
+
disabled: false,
|
|
10382
|
+
readOnly: false,
|
|
10383
|
+
maxLength: 9999,
|
|
10384
|
+
clearable: false,
|
|
10385
|
+
clearIcon: null,
|
|
10386
|
+
formatTrigger: "onChange",
|
|
10387
|
+
autoFocus: false
|
|
10388
|
+
};
|
|
10389
|
+
const Input = forwardRef(
|
|
10390
|
+
(props, ref) => {
|
|
10391
|
+
const { locale } = useConfig$1();
|
|
10392
|
+
const {
|
|
10393
|
+
type,
|
|
10394
|
+
name,
|
|
10395
|
+
placeholder,
|
|
10396
|
+
align,
|
|
10397
|
+
disabled,
|
|
10398
|
+
readOnly,
|
|
10399
|
+
maxLength,
|
|
10400
|
+
clearable,
|
|
10401
|
+
clearIcon,
|
|
10402
|
+
formatTrigger,
|
|
10403
|
+
autoFocus,
|
|
10565
10404
|
style,
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10405
|
+
className,
|
|
10406
|
+
onChange,
|
|
10407
|
+
onFocus,
|
|
10408
|
+
onBlur,
|
|
10409
|
+
onClear,
|
|
10410
|
+
formatter,
|
|
10411
|
+
onClick,
|
|
10412
|
+
confirmType,
|
|
10413
|
+
defaultValue,
|
|
10414
|
+
value: _value,
|
|
10415
|
+
...rest
|
|
10416
|
+
} = {
|
|
10417
|
+
...defaultProps$V,
|
|
10418
|
+
...props
|
|
10419
|
+
};
|
|
10420
|
+
const [value, setValue] = usePropsValue({
|
|
10421
|
+
value: props.value,
|
|
10422
|
+
defaultValue: props.defaultValue,
|
|
10423
|
+
finalValue: "",
|
|
10424
|
+
onChange
|
|
10425
|
+
});
|
|
10426
|
+
const inputRef = useRef(null);
|
|
10427
|
+
const [active, setActive] = useState(false);
|
|
10428
|
+
useImperativeHandle(ref, () => {
|
|
10429
|
+
return {
|
|
10430
|
+
clear: () => {
|
|
10431
|
+
setValue("");
|
|
10432
|
+
},
|
|
10433
|
+
focus: () => {
|
|
10434
|
+
var _a;
|
|
10435
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
10436
|
+
},
|
|
10437
|
+
blur: () => {
|
|
10438
|
+
var _a;
|
|
10439
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
10440
|
+
},
|
|
10441
|
+
get nativeElement() {
|
|
10442
|
+
return inputRef.current;
|
|
10443
|
+
}
|
|
10444
|
+
};
|
|
10445
|
+
});
|
|
10446
|
+
const inputClass = useCallback(() => {
|
|
10447
|
+
const classPrefix2 = "nut-input";
|
|
10448
|
+
return [classPrefix2, `${disabled ? `${classPrefix2}-disabled` : ""}`].filter(Boolean).join(" ");
|
|
10449
|
+
}, [disabled]);
|
|
10450
|
+
const [, updateState] = React__default.useState();
|
|
10451
|
+
const forceUpdate = React__default.useCallback(() => updateState({}), []);
|
|
10452
|
+
const updateValue = (value2, trigger = "onChange") => {
|
|
10453
|
+
let val = value2;
|
|
10454
|
+
if (getEnv() === ENV_TYPE.WEB) {
|
|
10455
|
+
if (type === "number") {
|
|
10456
|
+
val = formatNumber(val, false, true);
|
|
10457
|
+
}
|
|
10458
|
+
if (type === "digit") {
|
|
10459
|
+
val = formatNumber(val, true, true);
|
|
10460
|
+
}
|
|
10461
|
+
}
|
|
10462
|
+
if (formatter && trigger === formatTrigger) {
|
|
10463
|
+
val = formatter(val);
|
|
10464
|
+
}
|
|
10465
|
+
setValue(val);
|
|
10466
|
+
const eventHandler = props[trigger];
|
|
10467
|
+
if (eventHandler && typeof eventHandler === "function") {
|
|
10468
|
+
eventHandler(val);
|
|
10469
|
+
}
|
|
10470
|
+
forceUpdate();
|
|
10471
|
+
};
|
|
10472
|
+
const handleFocus = (event) => {
|
|
10473
|
+
const val = event.target.value;
|
|
10474
|
+
onFocus && onFocus(val);
|
|
10475
|
+
setActive(true);
|
|
10476
|
+
};
|
|
10477
|
+
const handleInput = (value2) => {
|
|
10478
|
+
updateValue(value2, "onChange");
|
|
10479
|
+
};
|
|
10480
|
+
const handleBlur = (event) => {
|
|
10481
|
+
const val = event.target.value;
|
|
10482
|
+
updateValue(val, "onBlur");
|
|
10483
|
+
setTimeout(() => {
|
|
10484
|
+
setActive(false);
|
|
10485
|
+
}, 50);
|
|
10486
|
+
};
|
|
10487
|
+
const inputType = (type2) => {
|
|
10488
|
+
if (getEnv() === ENV_TYPE.WEB) {
|
|
10489
|
+
if (type2 === "digit") {
|
|
10490
|
+
return "text";
|
|
10491
|
+
}
|
|
10492
|
+
if (type2 === "number") {
|
|
10493
|
+
return "tel";
|
|
10494
|
+
}
|
|
10495
|
+
} else if (type2 === "password") {
|
|
10496
|
+
return "text";
|
|
10497
|
+
}
|
|
10498
|
+
return type2;
|
|
10499
|
+
};
|
|
10500
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
10501
|
+
View,
|
|
10502
|
+
{
|
|
10503
|
+
className: `${inputClass()} ${className || ""}`,
|
|
10504
|
+
style,
|
|
10505
|
+
onClick: (e) => {
|
|
10506
|
+
onClick && onClick(e);
|
|
10507
|
+
},
|
|
10508
|
+
children: [
|
|
10509
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10510
|
+
Input$1,
|
|
10511
|
+
{
|
|
10512
|
+
...rest,
|
|
10513
|
+
name,
|
|
10514
|
+
className: "nut-input-native",
|
|
10515
|
+
ref: inputRef,
|
|
10516
|
+
style: { textAlign: align },
|
|
10517
|
+
type: inputType(type),
|
|
10518
|
+
password: type === "password",
|
|
10519
|
+
maxlength: maxLength,
|
|
10520
|
+
placeholder: placeholder || locale.placeholder,
|
|
10521
|
+
disabled: disabled || readOnly,
|
|
10522
|
+
value,
|
|
10523
|
+
focus: autoFocus,
|
|
10524
|
+
confirmType,
|
|
10525
|
+
onBlur: (e) => {
|
|
10526
|
+
handleBlur(e);
|
|
10527
|
+
},
|
|
10528
|
+
onFocus: (e) => {
|
|
10529
|
+
handleFocus(e);
|
|
10530
|
+
},
|
|
10531
|
+
onInput: (e) => {
|
|
10532
|
+
handleInput(e.currentTarget.value);
|
|
10694
10533
|
}
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
"/",
|
|
10700
|
-
maxlength
|
|
10701
|
-
] }) : null
|
|
10702
|
-
] }),
|
|
10703
|
-
errorMessage ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10704
|
-
"div",
|
|
10534
|
+
}
|
|
10535
|
+
),
|
|
10536
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10537
|
+
View,
|
|
10705
10538
|
{
|
|
10706
|
-
className: "nut-input-error-message",
|
|
10707
10539
|
style: {
|
|
10708
|
-
|
|
10540
|
+
display: clearable && !readOnly && active && value.length > 0 ? "flex" : "none",
|
|
10541
|
+
alignItems: "center"
|
|
10542
|
+
},
|
|
10543
|
+
onClick: (e) => {
|
|
10544
|
+
e.stopPropagation();
|
|
10545
|
+
if (!disabled) {
|
|
10546
|
+
setTimeout(() => {
|
|
10547
|
+
setValue("");
|
|
10548
|
+
onClear && onClear("");
|
|
10549
|
+
}, 50);
|
|
10550
|
+
}
|
|
10709
10551
|
},
|
|
10710
|
-
children:
|
|
10552
|
+
children: clearIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(r$c, { className: "nut-input-clear" })
|
|
10711
10553
|
}
|
|
10712
|
-
)
|
|
10713
|
-
]
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
Input.defaultProps = defaultProps$
|
|
10554
|
+
)
|
|
10555
|
+
]
|
|
10556
|
+
}
|
|
10557
|
+
);
|
|
10558
|
+
}
|
|
10559
|
+
);
|
|
10560
|
+
Input.defaultProps = defaultProps$V;
|
|
10719
10561
|
Input.displayName = "NutInput";
|
|
10720
|
-
const defaultProps$
|
|
10562
|
+
const defaultProps$U = {
|
|
10721
10563
|
...ComponentDefaults,
|
|
10722
10564
|
disabled: false,
|
|
10723
10565
|
min: 1,
|
|
@@ -10729,7 +10571,7 @@ const defaultProps$V = {
|
|
|
10729
10571
|
digits: 0,
|
|
10730
10572
|
async: false
|
|
10731
10573
|
};
|
|
10732
|
-
const classPrefix$
|
|
10574
|
+
const classPrefix$3 = `nut-inputnumber`;
|
|
10733
10575
|
const InputNumber = (props) => {
|
|
10734
10576
|
const {
|
|
10735
10577
|
children,
|
|
@@ -10754,7 +10596,7 @@ const InputNumber = (props) => {
|
|
|
10754
10596
|
onChange,
|
|
10755
10597
|
...restProps
|
|
10756
10598
|
} = {
|
|
10757
|
-
...defaultProps$
|
|
10599
|
+
...defaultProps$U,
|
|
10758
10600
|
...props
|
|
10759
10601
|
};
|
|
10760
10602
|
const inputRef = useRef("");
|
|
@@ -10772,8 +10614,8 @@ const InputNumber = (props) => {
|
|
|
10772
10614
|
}, []);
|
|
10773
10615
|
const classes = classNames(
|
|
10774
10616
|
{
|
|
10775
|
-
[`${classPrefix$
|
|
10776
|
-
[`${classPrefix$
|
|
10617
|
+
[`${classPrefix$3}`]: true,
|
|
10618
|
+
[`${classPrefix$3}--disabled`]: disabled
|
|
10777
10619
|
},
|
|
10778
10620
|
className
|
|
10779
10621
|
);
|
|
@@ -10945,9 +10787,9 @@ const InputNumber = (props) => {
|
|
|
10945
10787
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(a$8, { className: iconAddClasses, onClick: addNumber }) })
|
|
10946
10788
|
] });
|
|
10947
10789
|
};
|
|
10948
|
-
InputNumber.defaultProps = defaultProps$
|
|
10790
|
+
InputNumber.defaultProps = defaultProps$U;
|
|
10949
10791
|
InputNumber.displayName = "NutInputNumber";
|
|
10950
|
-
const defaultProps$
|
|
10792
|
+
const defaultProps$T = {
|
|
10951
10793
|
...ComponentDefaults,
|
|
10952
10794
|
activeColor: "",
|
|
10953
10795
|
closeOnClickOverlay: true,
|
|
@@ -10966,7 +10808,7 @@ const Menu = (props) => {
|
|
|
10966
10808
|
activeColor,
|
|
10967
10809
|
...rest
|
|
10968
10810
|
} = {
|
|
10969
|
-
...defaultProps$
|
|
10811
|
+
...defaultProps$T,
|
|
10970
10812
|
...props
|
|
10971
10813
|
};
|
|
10972
10814
|
const menuRef = useRef(null);
|
|
@@ -11090,9 +10932,9 @@ const Menu = (props) => {
|
|
|
11090
10932
|
}
|
|
11091
10933
|
);
|
|
11092
10934
|
};
|
|
11093
|
-
Menu.defaultProps = defaultProps$
|
|
10935
|
+
Menu.defaultProps = defaultProps$T;
|
|
11094
10936
|
Menu.displayName = "NutMenu";
|
|
11095
|
-
const defaultProps$
|
|
10937
|
+
const defaultProps$S = {
|
|
11096
10938
|
...ComponentDefaults,
|
|
11097
10939
|
columns: 1,
|
|
11098
10940
|
direction: "down",
|
|
@@ -11122,7 +10964,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
11122
10964
|
parent,
|
|
11123
10965
|
index
|
|
11124
10966
|
} = {
|
|
11125
|
-
...defaultProps$
|
|
10967
|
+
...defaultProps$S,
|
|
11126
10968
|
...props
|
|
11127
10969
|
};
|
|
11128
10970
|
const [_showPopup, setShowPopup] = useState(show);
|
|
@@ -11280,9 +11122,9 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
11280
11122
|
)
|
|
11281
11123
|
] });
|
|
11282
11124
|
});
|
|
11283
|
-
MenuItem.defaultProps = defaultProps$
|
|
11125
|
+
MenuItem.defaultProps = defaultProps$S;
|
|
11284
11126
|
MenuItem.displayName = "NutMenuItem";
|
|
11285
|
-
const defaultProps$
|
|
11127
|
+
const defaultProps$R = {
|
|
11286
11128
|
confirmText: "",
|
|
11287
11129
|
title: "",
|
|
11288
11130
|
visible: false,
|
|
@@ -11514,14 +11356,14 @@ const NumberKeyboard = (props) => {
|
|
|
11514
11356
|
}
|
|
11515
11357
|
) });
|
|
11516
11358
|
};
|
|
11517
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
11359
|
+
NumberKeyboard.defaultProps = defaultProps$R;
|
|
11518
11360
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
11519
11361
|
const radioContext = {
|
|
11520
11362
|
onChange: (val) => {
|
|
11521
11363
|
}
|
|
11522
11364
|
};
|
|
11523
11365
|
const RadioContext = React__default.createContext(radioContext);
|
|
11524
|
-
const defaultProps$
|
|
11366
|
+
const defaultProps$Q = {
|
|
11525
11367
|
value: null,
|
|
11526
11368
|
textPosition: "right",
|
|
11527
11369
|
onChange: (value) => {
|
|
@@ -11531,7 +11373,7 @@ const defaultProps$R = {
|
|
|
11531
11373
|
};
|
|
11532
11374
|
const RadioGroup = React__default.forwardRef(
|
|
11533
11375
|
(props, ref) => {
|
|
11534
|
-
const { children } = { ...defaultProps$
|
|
11376
|
+
const { children } = { ...defaultProps$Q, ...props };
|
|
11535
11377
|
cn("RadioGroup");
|
|
11536
11378
|
const {
|
|
11537
11379
|
className,
|
|
@@ -11608,9 +11450,9 @@ const RadioGroup = React__default.forwardRef(
|
|
|
11608
11450
|
);
|
|
11609
11451
|
}
|
|
11610
11452
|
);
|
|
11611
|
-
RadioGroup.defaultProps = defaultProps$
|
|
11453
|
+
RadioGroup.defaultProps = defaultProps$Q;
|
|
11612
11454
|
RadioGroup.displayName = "NutRadioGroup";
|
|
11613
|
-
const defaultProps$
|
|
11455
|
+
const defaultProps$P = {
|
|
11614
11456
|
...ComponentDefaults,
|
|
11615
11457
|
className: "",
|
|
11616
11458
|
style: {},
|
|
@@ -11627,7 +11469,7 @@ const defaultProps$Q = {
|
|
|
11627
11469
|
};
|
|
11628
11470
|
const Radio = (props) => {
|
|
11629
11471
|
const { children } = {
|
|
11630
|
-
...defaultProps$
|
|
11472
|
+
...defaultProps$P,
|
|
11631
11473
|
...props
|
|
11632
11474
|
};
|
|
11633
11475
|
const {
|
|
@@ -11720,10 +11562,10 @@ const Radio = (props) => {
|
|
|
11720
11562
|
}
|
|
11721
11563
|
);
|
|
11722
11564
|
};
|
|
11723
|
-
Radio.defaultProps = defaultProps$
|
|
11565
|
+
Radio.defaultProps = defaultProps$P;
|
|
11724
11566
|
Radio.displayName = "NutRadio";
|
|
11725
11567
|
Radio.RadioGroup = RadioGroup;
|
|
11726
|
-
const defaultProps$
|
|
11568
|
+
const defaultProps$O = {
|
|
11727
11569
|
id: "",
|
|
11728
11570
|
style: {},
|
|
11729
11571
|
icon: null,
|
|
@@ -11778,7 +11620,7 @@ const Toast = (props) => {
|
|
|
11778
11620
|
visible,
|
|
11779
11621
|
onClose,
|
|
11780
11622
|
...rest
|
|
11781
|
-
} = { ...defaultProps$
|
|
11623
|
+
} = { ...defaultProps$O, ...props };
|
|
11782
11624
|
let timer;
|
|
11783
11625
|
const [openState, SetOpenState] = useState(false);
|
|
11784
11626
|
useEffect(() => {
|
|
@@ -11869,9 +11711,9 @@ const Toast = (props) => {
|
|
|
11869
11711
|
}
|
|
11870
11712
|
) : null });
|
|
11871
11713
|
};
|
|
11872
|
-
Toast.defaultProps = defaultProps$
|
|
11714
|
+
Toast.defaultProps = defaultProps$O;
|
|
11873
11715
|
Toast.displayName = "NutToast";
|
|
11874
|
-
const defaultProps$
|
|
11716
|
+
const defaultProps$N = {
|
|
11875
11717
|
range: false,
|
|
11876
11718
|
hiddenRange: false,
|
|
11877
11719
|
hiddenTag: false,
|
|
@@ -11907,8 +11749,8 @@ const Range = (props) => {
|
|
|
11907
11749
|
minDesc,
|
|
11908
11750
|
maxDesc,
|
|
11909
11751
|
curValueDesc
|
|
11910
|
-
} = { ...defaultProps$
|
|
11911
|
-
let { min, max, step } = { ...defaultProps$
|
|
11752
|
+
} = { ...defaultProps$N, ...props };
|
|
11753
|
+
let { min, max, step } = { ...defaultProps$N, ...props };
|
|
11912
11754
|
min = Number(min);
|
|
11913
11755
|
max = Number(max);
|
|
11914
11756
|
step = Number(step);
|
|
@@ -12264,9 +12106,9 @@ const Range = (props) => {
|
|
|
12264
12106
|
)
|
|
12265
12107
|
] });
|
|
12266
12108
|
};
|
|
12267
|
-
Range.defaultProps = defaultProps$
|
|
12109
|
+
Range.defaultProps = defaultProps$N;
|
|
12268
12110
|
Range.displayName = "NutRange";
|
|
12269
|
-
const defaultProps$
|
|
12111
|
+
const defaultProps$M = {
|
|
12270
12112
|
...ComponentDefaults,
|
|
12271
12113
|
count: 5,
|
|
12272
12114
|
min: 0,
|
|
@@ -12291,7 +12133,7 @@ const Rate = (props) => {
|
|
|
12291
12133
|
allowHalf,
|
|
12292
12134
|
onChange
|
|
12293
12135
|
} = {
|
|
12294
|
-
...defaultProps$
|
|
12136
|
+
...defaultProps$M,
|
|
12295
12137
|
...props
|
|
12296
12138
|
};
|
|
12297
12139
|
const classPrefix2 = "nut-rate";
|
|
@@ -12376,9 +12218,9 @@ const Rate = (props) => {
|
|
|
12376
12218
|
}
|
|
12377
12219
|
);
|
|
12378
12220
|
};
|
|
12379
|
-
Rate.defaultProps = defaultProps$
|
|
12221
|
+
Rate.defaultProps = defaultProps$M;
|
|
12380
12222
|
Rate.displayName = "NutRate";
|
|
12381
|
-
const defaultProps$
|
|
12223
|
+
const defaultProps$L = {
|
|
12382
12224
|
...ComponentDefaults,
|
|
12383
12225
|
placeholder: "",
|
|
12384
12226
|
shape: "square",
|
|
@@ -12426,7 +12268,7 @@ const SearchBar = (props) => {
|
|
|
12426
12268
|
onClickRightinIcon,
|
|
12427
12269
|
onClickRightoutIcon
|
|
12428
12270
|
} = {
|
|
12429
|
-
...defaultProps$
|
|
12271
|
+
...defaultProps$L,
|
|
12430
12272
|
...props
|
|
12431
12273
|
};
|
|
12432
12274
|
const alignClass = `${align}`;
|
|
@@ -12612,9 +12454,9 @@ const SearchBar = (props) => {
|
|
|
12612
12454
|
}
|
|
12613
12455
|
);
|
|
12614
12456
|
};
|
|
12615
|
-
SearchBar.defaultProps = defaultProps$
|
|
12457
|
+
SearchBar.defaultProps = defaultProps$L;
|
|
12616
12458
|
SearchBar.displayName = "NutSearchBar";
|
|
12617
|
-
const defaultProps$
|
|
12459
|
+
const defaultProps$K = {
|
|
12618
12460
|
...ComponentDefaults,
|
|
12619
12461
|
title: "",
|
|
12620
12462
|
description: "",
|
|
@@ -12777,9 +12619,9 @@ const ShortPassword = (props) => {
|
|
|
12777
12619
|
}
|
|
12778
12620
|
) });
|
|
12779
12621
|
};
|
|
12780
|
-
ShortPassword.defaultProps = defaultProps$
|
|
12622
|
+
ShortPassword.defaultProps = defaultProps$K;
|
|
12781
12623
|
ShortPassword.displayName = "NutShortPassword";
|
|
12782
|
-
const defaultProps$
|
|
12624
|
+
const defaultProps$J = {
|
|
12783
12625
|
canvasId: "spcanvas",
|
|
12784
12626
|
type: "png",
|
|
12785
12627
|
lineWidth: 2,
|
|
@@ -12801,7 +12643,7 @@ const Signature = (props) => {
|
|
|
12801
12643
|
onClear,
|
|
12802
12644
|
...rest
|
|
12803
12645
|
} = {
|
|
12804
|
-
...defaultProps$
|
|
12646
|
+
...defaultProps$J,
|
|
12805
12647
|
...props
|
|
12806
12648
|
};
|
|
12807
12649
|
const b2 = cn("signature");
|
|
@@ -12965,9 +12807,9 @@ const Signature = (props) => {
|
|
|
12965
12807
|
)
|
|
12966
12808
|
] });
|
|
12967
12809
|
};
|
|
12968
|
-
Signature.defaultProps = defaultProps$
|
|
12810
|
+
Signature.defaultProps = defaultProps$J;
|
|
12969
12811
|
Signature.displayName = "NutSignature";
|
|
12970
|
-
const defaultProps$
|
|
12812
|
+
const defaultProps$I = {
|
|
12971
12813
|
...ComponentDefaults,
|
|
12972
12814
|
disabled: false,
|
|
12973
12815
|
activeText: "",
|
|
@@ -12984,7 +12826,7 @@ const Switch = (props) => {
|
|
|
12984
12826
|
style,
|
|
12985
12827
|
onChange
|
|
12986
12828
|
} = {
|
|
12987
|
-
...defaultProps$
|
|
12829
|
+
...defaultProps$I,
|
|
12988
12830
|
...props
|
|
12989
12831
|
};
|
|
12990
12832
|
const classPrefix2 = "nut-switch";
|
|
@@ -13006,9 +12848,9 @@ const Switch = (props) => {
|
|
|
13006
12848
|
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 }) })
|
|
13007
12849
|
] }) });
|
|
13008
12850
|
};
|
|
13009
|
-
Switch.defaultProps = defaultProps$
|
|
12851
|
+
Switch.defaultProps = defaultProps$I;
|
|
13010
12852
|
Switch.displayName = "NutSwitch";
|
|
13011
|
-
const defaultProps$
|
|
12853
|
+
const defaultProps$H = {
|
|
13012
12854
|
defaultValue: "",
|
|
13013
12855
|
textAlign: "left",
|
|
13014
12856
|
limitshow: false,
|
|
@@ -13036,7 +12878,7 @@ const TextArea = (props) => {
|
|
|
13036
12878
|
onChange,
|
|
13037
12879
|
onBlur,
|
|
13038
12880
|
onFocus
|
|
13039
|
-
} = { ...defaultProps$
|
|
12881
|
+
} = { ...defaultProps$H, ...props };
|
|
13040
12882
|
const textareaBem = cn("textarea");
|
|
13041
12883
|
const [inputValue, SetInputValue] = useState("");
|
|
13042
12884
|
const compositingRef = useRef(false);
|
|
@@ -13131,9 +12973,9 @@ const TextArea = (props) => {
|
|
|
13131
12973
|
}
|
|
13132
12974
|
);
|
|
13133
12975
|
};
|
|
13134
|
-
TextArea.defaultProps = defaultProps$
|
|
12976
|
+
TextArea.defaultProps = defaultProps$H;
|
|
13135
12977
|
TextArea.displayName = "NutTextArea";
|
|
13136
|
-
const defaultProps$
|
|
12978
|
+
const defaultProps$G = {
|
|
13137
12979
|
...ComponentDefaults,
|
|
13138
12980
|
percent: 0,
|
|
13139
12981
|
showText: false,
|
|
@@ -13152,7 +12994,7 @@ const Progress = (props) => {
|
|
|
13152
12994
|
children,
|
|
13153
12995
|
...rest
|
|
13154
12996
|
} = {
|
|
13155
|
-
...defaultProps$
|
|
12997
|
+
...defaultProps$G,
|
|
13156
12998
|
...props
|
|
13157
12999
|
};
|
|
13158
13000
|
const classPrefix2 = "nut-progress";
|
|
@@ -13189,7 +13031,7 @@ const Progress = (props) => {
|
|
|
13189
13031
|
}
|
|
13190
13032
|
) }) }) });
|
|
13191
13033
|
};
|
|
13192
|
-
Progress.defaultProps = defaultProps$
|
|
13034
|
+
Progress.defaultProps = defaultProps$G;
|
|
13193
13035
|
Progress.displayName = "NutProgress";
|
|
13194
13036
|
class UploadOptions {
|
|
13195
13037
|
constructor() {
|
|
@@ -13334,7 +13176,7 @@ const funcInterceptor = (interceptor, {
|
|
|
13334
13176
|
done();
|
|
13335
13177
|
}
|
|
13336
13178
|
};
|
|
13337
|
-
const defaultProps$
|
|
13179
|
+
const defaultProps$F = {
|
|
13338
13180
|
...ComponentDefaults,
|
|
13339
13181
|
url: "",
|
|
13340
13182
|
maxCount: 1,
|
|
@@ -13422,7 +13264,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13422
13264
|
beforeXhrUpload,
|
|
13423
13265
|
beforeDelete,
|
|
13424
13266
|
...restProps
|
|
13425
|
-
} = { ...defaultProps$
|
|
13267
|
+
} = { ...defaultProps$F, ...props };
|
|
13426
13268
|
const [fileList, setFileList] = useState(defaultValue || []);
|
|
13427
13269
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
13428
13270
|
useEffect(() => {
|
|
@@ -13785,9 +13627,9 @@ const InternalUploader = (props, ref) => {
|
|
|
13785
13627
|
] });
|
|
13786
13628
|
};
|
|
13787
13629
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
13788
|
-
Uploader.defaultProps = defaultProps$
|
|
13630
|
+
Uploader.defaultProps = defaultProps$F;
|
|
13789
13631
|
Uploader.displayName = "NutUploader";
|
|
13790
|
-
const defaultProps$
|
|
13632
|
+
const defaultProps$E = {
|
|
13791
13633
|
cancelText: "",
|
|
13792
13634
|
optionTag: "name",
|
|
13793
13635
|
optionSubTag: "subname",
|
|
@@ -13821,7 +13663,7 @@ const ActionSheet = (props) => {
|
|
|
13821
13663
|
className,
|
|
13822
13664
|
style,
|
|
13823
13665
|
...rest
|
|
13824
|
-
} = { ...defaultProps$
|
|
13666
|
+
} = { ...defaultProps$E, ...props };
|
|
13825
13667
|
const b2 = cn("actionsheet");
|
|
13826
13668
|
const isHighlight = (item) => {
|
|
13827
13669
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -13866,52 +13708,8 @@ const ActionSheet = (props) => {
|
|
|
13866
13708
|
}
|
|
13867
13709
|
);
|
|
13868
13710
|
};
|
|
13869
|
-
ActionSheet.defaultProps = defaultProps$
|
|
13711
|
+
ActionSheet.defaultProps = defaultProps$E;
|
|
13870
13712
|
ActionSheet.displayName = "NutActionSheet";
|
|
13871
|
-
const defaultProps$E = {
|
|
13872
|
-
...ComponentDefaults,
|
|
13873
|
-
value: "",
|
|
13874
|
-
dot: false,
|
|
13875
|
-
max: 99,
|
|
13876
|
-
top: "0",
|
|
13877
|
-
right: "5",
|
|
13878
|
-
color: ""
|
|
13879
|
-
};
|
|
13880
|
-
const Badge = (props) => {
|
|
13881
|
-
const { className, style, value, max, children, dot, top, right, color } = {
|
|
13882
|
-
...defaultProps$E,
|
|
13883
|
-
...props
|
|
13884
|
-
};
|
|
13885
|
-
const classPrefix2 = "nut-badge";
|
|
13886
|
-
const classes = classNames(classPrefix2, className);
|
|
13887
|
-
const contentClasses = classNames(
|
|
13888
|
-
{ [`${classPrefix2}__dot`]: dot },
|
|
13889
|
-
`${classPrefix2}__content`,
|
|
13890
|
-
`${classPrefix2}__sup`
|
|
13891
|
-
);
|
|
13892
|
-
function content() {
|
|
13893
|
-
if (dot || typeof value === "object")
|
|
13894
|
-
return null;
|
|
13895
|
-
if (typeof value === "number" && typeof max === "number") {
|
|
13896
|
-
return max < value ? `${max}+` : value;
|
|
13897
|
-
}
|
|
13898
|
-
return value;
|
|
13899
|
-
}
|
|
13900
|
-
const getStyle = () => {
|
|
13901
|
-
const style2 = {};
|
|
13902
|
-
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
13903
|
-
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
13904
|
-
style2.background = color;
|
|
13905
|
-
return style2;
|
|
13906
|
-
};
|
|
13907
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, children: [
|
|
13908
|
-
typeof value === "object" && value && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__icon`, children: value }),
|
|
13909
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
|
|
13910
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
13911
|
-
] });
|
|
13912
|
-
};
|
|
13913
|
-
Badge.defaultProps = defaultProps$E;
|
|
13914
|
-
Badge.displayName = "NutBadge";
|
|
13915
13713
|
const Content = (props) => {
|
|
13916
13714
|
const { visible, title, footer, footerDirection, onClick, children } = props;
|
|
13917
13715
|
const classPrefix2 = "nut-dialog";
|
|
@@ -20302,7 +20100,7 @@ const defaultProps$s = {
|
|
|
20302
20100
|
onClick: (event) => {
|
|
20303
20101
|
}
|
|
20304
20102
|
};
|
|
20305
|
-
const classPrefix$
|
|
20103
|
+
const classPrefix$2 = `nut-animate`;
|
|
20306
20104
|
const Animate = (props) => {
|
|
20307
20105
|
const { className, type, action, loop: loop2, onClick, children, ...rest } = {
|
|
20308
20106
|
...defaultProps$s,
|
|
@@ -20311,7 +20109,7 @@ const Animate = (props) => {
|
|
|
20311
20109
|
const [clicked, setClicked] = useState(false);
|
|
20312
20110
|
const classes = classNames({
|
|
20313
20111
|
"nut-ani-container": true,
|
|
20314
|
-
[`${classPrefix$
|
|
20112
|
+
[`${classPrefix$2}-${type}`]: action === "initial" || clicked ? type : false,
|
|
20315
20113
|
loop: loop2
|
|
20316
20114
|
});
|
|
20317
20115
|
const cls = classNames(classes, className);
|
|
@@ -20667,22 +20465,24 @@ const AvatarGroup = (props) => {
|
|
|
20667
20465
|
AvatarGroup.defaultProps = defaultProps$o;
|
|
20668
20466
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
20669
20467
|
const defaultProps$n = {
|
|
20468
|
+
...ComponentDefaults,
|
|
20670
20469
|
strokeWidth: 5,
|
|
20671
20470
|
radius: 50,
|
|
20672
20471
|
strokeLinecap: "round",
|
|
20673
|
-
|
|
20674
|
-
|
|
20472
|
+
color: "#fa2c19",
|
|
20473
|
+
background: "#e5e9f2",
|
|
20675
20474
|
clockwise: true
|
|
20676
20475
|
};
|
|
20476
|
+
const classPrefix$1 = `nut-circleprogress`;
|
|
20677
20477
|
const CircleProgress = (props) => {
|
|
20678
20478
|
const {
|
|
20679
20479
|
children,
|
|
20680
|
-
|
|
20480
|
+
percent,
|
|
20681
20481
|
className,
|
|
20682
20482
|
radius,
|
|
20683
|
-
|
|
20483
|
+
background,
|
|
20684
20484
|
clockwise,
|
|
20685
|
-
|
|
20485
|
+
color,
|
|
20686
20486
|
strokeWidth,
|
|
20687
20487
|
style,
|
|
20688
20488
|
strokeLinecap,
|
|
@@ -20691,45 +20491,39 @@ const CircleProgress = (props) => {
|
|
|
20691
20491
|
...defaultProps$n,
|
|
20692
20492
|
...props
|
|
20693
20493
|
};
|
|
20694
|
-
const [oldValue, setOldValue] = useState(
|
|
20695
|
-
const
|
|
20696
|
-
const classes = classNames(className, b2(""));
|
|
20494
|
+
const [oldValue, setOldValue] = useState(percent);
|
|
20495
|
+
const classes = classNames(className, classPrefix$1);
|
|
20697
20496
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
20497
|
+
const animateIdRef = useRef(0);
|
|
20698
20498
|
const styles = {
|
|
20699
20499
|
height: `${Number(radius) * 2}px`,
|
|
20700
20500
|
width: `${Number(radius) * 2}px`,
|
|
20701
20501
|
...style
|
|
20702
20502
|
};
|
|
20703
20503
|
useEffect(() => {
|
|
20704
|
-
let rafId;
|
|
20705
20504
|
const startTime = Date.now();
|
|
20706
20505
|
const startRate = Number(oldValue);
|
|
20707
|
-
const endRate = Number(
|
|
20506
|
+
const endRate = Number(percent);
|
|
20708
20507
|
const duration = Math.abs((startRate - endRate) * 1e3 / 100);
|
|
20709
20508
|
const animate = () => {
|
|
20710
20509
|
const now = Date.now();
|
|
20711
|
-
const
|
|
20712
|
-
const rate =
|
|
20510
|
+
const progress = Math.min((now - startTime) / duration, 1);
|
|
20511
|
+
const rate = progress * (endRate - startRate) + startRate;
|
|
20713
20512
|
setOldValue(Math.min(Math.max(+rate, 0), 100));
|
|
20714
20513
|
if (endRate > startRate ? rate < endRate : rate > endRate) {
|
|
20715
|
-
|
|
20514
|
+
animateIdRef.current = window.requestAnimationFrame(animate);
|
|
20716
20515
|
}
|
|
20717
20516
|
};
|
|
20718
|
-
|
|
20719
|
-
|
|
20720
|
-
|
|
20721
|
-
rafId = window.requestAnimationFrame(animate);
|
|
20722
|
-
}, [progress]);
|
|
20723
|
-
const cancelAnimationFrame2 = function(id) {
|
|
20724
|
-
clearTimeout(id);
|
|
20725
|
-
};
|
|
20517
|
+
animateIdRef.current = window.requestAnimationFrame(animate);
|
|
20518
|
+
return () => window.cancelAnimationFrame(animateIdRef.current);
|
|
20519
|
+
}, [percent]);
|
|
20726
20520
|
const stop2 = () => {
|
|
20727
|
-
if (!isObject(
|
|
20521
|
+
if (!isObject(props.color)) {
|
|
20728
20522
|
return [];
|
|
20729
20523
|
}
|
|
20730
|
-
const
|
|
20731
|
-
const colorArr = Object.keys(
|
|
20732
|
-
(a2,
|
|
20524
|
+
const color2 = props.color;
|
|
20525
|
+
const colorArr = Object.keys(color2).sort(
|
|
20526
|
+
(a2, b2) => parseFloat(a2) - parseFloat(b2)
|
|
20733
20527
|
);
|
|
20734
20528
|
const stopArr = [];
|
|
20735
20529
|
colorArr.map((item) => {
|
|
@@ -20738,15 +20532,15 @@ const CircleProgress = (props) => {
|
|
|
20738
20532
|
value: ""
|
|
20739
20533
|
};
|
|
20740
20534
|
obj.key = item;
|
|
20741
|
-
obj.value =
|
|
20535
|
+
obj.value = color2[item];
|
|
20742
20536
|
stopArr.push(obj);
|
|
20743
20537
|
});
|
|
20744
20538
|
return stopArr;
|
|
20745
20539
|
};
|
|
20746
|
-
const transColor = (
|
|
20747
|
-
return
|
|
20540
|
+
const transColor = (color2) => {
|
|
20541
|
+
return color2 && color2.replace("#", "%23");
|
|
20748
20542
|
};
|
|
20749
|
-
const format = (
|
|
20543
|
+
const format = (progress) => Math.min(Math.max(+progress, 0), 100);
|
|
20750
20544
|
const circleStyle = () => {
|
|
20751
20545
|
const stopArr = stop2();
|
|
20752
20546
|
const stopDom = [];
|
|
@@ -20760,17 +20554,17 @@ const CircleProgress = (props) => {
|
|
|
20760
20554
|
});
|
|
20761
20555
|
}
|
|
20762
20556
|
const perimeter = 283;
|
|
20763
|
-
const
|
|
20764
|
-
const offset = perimeter * Number(format(parseFloat(
|
|
20557
|
+
const progress = +oldValue;
|
|
20558
|
+
const offset = perimeter * Number(format(parseFloat(progress.toFixed(1)))) / 100;
|
|
20765
20559
|
const isWise = props.clockwise ? 1 : 0;
|
|
20766
|
-
const
|
|
20560
|
+
const color2 = isObject(props.color) ? `url(%23${refRandomId})` : transColor(props.color);
|
|
20767
20561
|
const d = `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
|
|
20768
20562
|
const pa = `%3Cdefs%3E%3ClinearGradient id='${refRandomId}' x1='100%25' y1='0%25' x2='0%25' y2='0%25'%3E${stopDom}%3C/linearGradient%3E%3C/defs%3E`;
|
|
20769
20563
|
const path = `%3Cpath d='${d}' stroke-width='${strokeWidth}' stroke='${transColor(
|
|
20770
|
-
props.
|
|
20564
|
+
props.background
|
|
20771
20565
|
)}' fill='none'/%3E`;
|
|
20772
20566
|
const path1 = `%3Cpath d='${d}' stroke-width='${strokeWidth}' stroke-dasharray='${offset},${perimeter}' stroke-linecap='round' stroke='${transColor(
|
|
20773
|
-
|
|
20567
|
+
color2
|
|
20774
20568
|
)}' fill='none'/%3E`;
|
|
20775
20569
|
return {
|
|
20776
20570
|
background: `url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E${pa}${path}${path1}%3C/svg%3E")`,
|
|
@@ -20780,10 +20574,7 @@ const CircleProgress = (props) => {
|
|
|
20780
20574
|
};
|
|
20781
20575
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style: styles, ...restProps, children: [
|
|
20782
20576
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: circleStyle() }),
|
|
20783
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-circleprogress-text", children
|
|
20784
|
-
progress,
|
|
20785
|
-
"%"
|
|
20786
|
-
] }) })
|
|
20577
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-circleprogress-text", children })
|
|
20787
20578
|
] });
|
|
20788
20579
|
};
|
|
20789
20580
|
CircleProgress.defaultProps = defaultProps$n;
|