@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.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react-taro v2.0.0-alpha.
|
|
11
|
+
* @nutui/nutui-react-taro v2.0.0-alpha.4 Fri May 05 2023 16:38:12 GMT+0800 (China Standard Time)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -2813,7 +2813,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2813
2813
|
onClick: (event) => {
|
|
2814
2814
|
}
|
|
2815
2815
|
};
|
|
2816
|
-
const classPrefix$
|
|
2816
|
+
const classPrefix$9 = "nut-cell";
|
|
2817
2817
|
const Cell = (props) => {
|
|
2818
2818
|
const {
|
|
2819
2819
|
children,
|
|
@@ -2844,24 +2844,24 @@ var __publicField = (obj, key, value) => {
|
|
|
2844
2844
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2845
2845
|
"div",
|
|
2846
2846
|
{
|
|
2847
|
-
className: classNames(classPrefix$
|
|
2847
|
+
className: classNames(classPrefix$9, className),
|
|
2848
2848
|
onClick: (event) => handleClick(event),
|
|
2849
2849
|
style: baseStyle,
|
|
2850
2850
|
...rest,
|
|
2851
2851
|
children: children || /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
2852
|
-
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$
|
|
2853
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2854
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2852
|
+
title || description ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix$9}__left`, children: [
|
|
2853
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__title`, children: title }) : null,
|
|
2854
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__description`, children: description }) : null
|
|
2855
2855
|
] }) : null,
|
|
2856
2856
|
extra ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2857
2857
|
"div",
|
|
2858
2858
|
{
|
|
2859
|
-
className: `${classPrefix$
|
|
2859
|
+
className: `${classPrefix$9}__extra`,
|
|
2860
2860
|
style: styles,
|
|
2861
2861
|
children: extra
|
|
2862
2862
|
}
|
|
2863
2863
|
) : null,
|
|
2864
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2864
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$9}__divider` })
|
|
2865
2865
|
] })
|
|
2866
2866
|
}
|
|
2867
2867
|
);
|
|
@@ -2873,16 +2873,16 @@ var __publicField = (obj, key, value) => {
|
|
|
2873
2873
|
title: "",
|
|
2874
2874
|
description: ""
|
|
2875
2875
|
};
|
|
2876
|
-
const classPrefix$
|
|
2876
|
+
const classPrefix$8 = "nut-cell-group";
|
|
2877
2877
|
const CellGroup = (props) => {
|
|
2878
2878
|
const { children, className, style, title, description, ...rest } = {
|
|
2879
2879
|
...defaultProps$1r,
|
|
2880
2880
|
...props
|
|
2881
2881
|
};
|
|
2882
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$
|
|
2883
|
-
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2884
|
-
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2885
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$
|
|
2882
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$8, className), ...rest, children: [
|
|
2883
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$8}__title`, children: title }) : null,
|
|
2884
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$8}__description`, children: description }) : null,
|
|
2885
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix$8}__wrap`, children })
|
|
2886
2886
|
] });
|
|
2887
2887
|
};
|
|
2888
2888
|
CellGroup.defaultProps = defaultProps$1r;
|
|
@@ -3577,21 +3577,21 @@ var __publicField = (obj, key, value) => {
|
|
|
3577
3577
|
contentPosition: "center",
|
|
3578
3578
|
direction: "horizontal"
|
|
3579
3579
|
};
|
|
3580
|
-
const classPrefix$
|
|
3580
|
+
const classPrefix$7 = `nut-divider`;
|
|
3581
3581
|
const Divider = (props) => {
|
|
3582
3582
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
3583
3583
|
...defaultProps$1n,
|
|
3584
3584
|
...props
|
|
3585
3585
|
};
|
|
3586
3586
|
const classes = direction === "horizontal" ? classNames({
|
|
3587
|
-
[`${classPrefix$
|
|
3588
|
-
[`${classPrefix$
|
|
3589
|
-
[`${classPrefix$
|
|
3590
|
-
[`${classPrefix$
|
|
3591
|
-
[`${classPrefix$
|
|
3587
|
+
[`${classPrefix$7}`]: true,
|
|
3588
|
+
[`${classPrefix$7}__center`]: children,
|
|
3589
|
+
[`${classPrefix$7}__left`]: contentPosition === "left",
|
|
3590
|
+
[`${classPrefix$7}__right`]: contentPosition === "right",
|
|
3591
|
+
[`${classPrefix$7}__hairline`]: true
|
|
3592
3592
|
}) : classNames({
|
|
3593
|
-
[`${classPrefix$
|
|
3594
|
-
[`${classPrefix$
|
|
3593
|
+
[`${classPrefix$7}`]: true,
|
|
3594
|
+
[`${classPrefix$7}__vertical`]: direction === "vertical"
|
|
3595
3595
|
});
|
|
3596
3596
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
|
|
3597
3597
|
};
|
|
@@ -3755,7 +3755,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3755
3755
|
};
|
|
3756
3756
|
Layout.defaultProps = defaultProps$1k;
|
|
3757
3757
|
Layout.displayName = "NutLayout";
|
|
3758
|
-
const classPrefix$
|
|
3758
|
+
const classPrefix$6 = "nut-row";
|
|
3759
3759
|
const defaultProps$1j = {
|
|
3760
3760
|
...ComponentDefaults,
|
|
3761
3761
|
type: "",
|
|
@@ -3790,7 +3790,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3790
3790
|
${getClass("justify", justify)}
|
|
3791
3791
|
${getClass("align", align)}
|
|
3792
3792
|
${getClass("flex", wrap)}
|
|
3793
|
-
${classPrefix$
|
|
3793
|
+
${classPrefix$6}
|
|
3794
3794
|
`;
|
|
3795
3795
|
};
|
|
3796
3796
|
const parentRow = {
|
|
@@ -3866,7 +3866,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3866
3866
|
position: "top",
|
|
3867
3867
|
zIndex: 2e3
|
|
3868
3868
|
};
|
|
3869
|
-
const classPrefix$
|
|
3869
|
+
const classPrefix$5 = "nut-sticky";
|
|
3870
3870
|
const Sticky = (props) => {
|
|
3871
3871
|
const {
|
|
3872
3872
|
position,
|
|
@@ -3968,7 +3968,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3968
3968
|
{
|
|
3969
3969
|
ref: rootRef,
|
|
3970
3970
|
style: rootStyle,
|
|
3971
|
-
className: classNames(classPrefix$
|
|
3971
|
+
className: classNames(classPrefix$5, className),
|
|
3972
3972
|
...rest,
|
|
3973
3973
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3974
3974
|
"div",
|
|
@@ -6508,288 +6508,189 @@ var __publicField = (obj, key, value) => {
|
|
|
6508
6508
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-subsidenavbar__content", children })
|
|
6509
6509
|
] });
|
|
6510
6510
|
};
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
set exports(v) {
|
|
6517
|
-
classnameExports = v;
|
|
6518
|
-
}
|
|
6519
|
-
};
|
|
6520
|
-
var classname_production_min = {};
|
|
6521
|
-
var hasRequiredClassname_production_min;
|
|
6522
|
-
function requireClassname_production_min() {
|
|
6523
|
-
if (hasRequiredClassname_production_min)
|
|
6524
|
-
return classname_production_min;
|
|
6525
|
-
hasRequiredClassname_production_min = 1;
|
|
6526
|
-
function r2(r3) {
|
|
6527
|
-
function t2(t3, i, a2, o) {
|
|
6528
|
-
var f = i ? e + t3 + r3.e + i : e + t3, v = f;
|
|
6529
|
-
if (a2) {
|
|
6530
|
-
var s = " " + v + r3.m;
|
|
6531
|
-
for (var u in a2)
|
|
6532
|
-
if (a2.hasOwnProperty(u)) {
|
|
6533
|
-
var p = a2[u];
|
|
6534
|
-
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
6535
|
-
}
|
|
6536
|
-
}
|
|
6537
|
-
if (void 0 !== o)
|
|
6538
|
-
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
6539
|
-
var l = o[y2];
|
|
6540
|
-
if (l && "string" == typeof l.valueOf())
|
|
6541
|
-
for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
6542
|
-
var h = g[d];
|
|
6543
|
-
h !== f && (v += " " + h);
|
|
6544
|
-
}
|
|
6545
|
-
}
|
|
6546
|
-
return v;
|
|
6547
|
-
}
|
|
6548
|
-
var e = r3.n || "", n = r3.v || r3.m;
|
|
6549
|
-
return function(r4, e2) {
|
|
6550
|
-
return function(n2, i, a2) {
|
|
6551
|
-
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);
|
|
6552
|
-
};
|
|
6553
|
-
};
|
|
6511
|
+
function usePropsValue({
|
|
6512
|
+
value,
|
|
6513
|
+
defaultValue,
|
|
6514
|
+
finalValue,
|
|
6515
|
+
onChange = (value2) => {
|
|
6554
6516
|
}
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
if (
|
|
6564
|
-
return
|
|
6565
|
-
hasRequiredClassname_development = 1;
|
|
6566
|
-
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
6567
|
-
function withNaming(preset) {
|
|
6568
|
-
var nameSpace = preset.n || "";
|
|
6569
|
-
var modValueDelimiter = preset.v || preset.m;
|
|
6570
|
-
function stringify(b2, e, m, mix) {
|
|
6571
|
-
var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
|
|
6572
|
-
var className = entityName;
|
|
6573
|
-
if (m) {
|
|
6574
|
-
var modPrefix = " " + className + preset.m;
|
|
6575
|
-
for (var k in m) {
|
|
6576
|
-
if (m.hasOwnProperty(k)) {
|
|
6577
|
-
var modVal = m[k];
|
|
6578
|
-
if (modVal === true) {
|
|
6579
|
-
className += modPrefix + k;
|
|
6580
|
-
} else if (modVal) {
|
|
6581
|
-
className += modPrefix + k + modValueDelimiter + modVal;
|
|
6582
|
-
}
|
|
6583
|
-
}
|
|
6584
|
-
}
|
|
6585
|
-
}
|
|
6586
|
-
if (mix !== void 0) {
|
|
6587
|
-
mix = Array.isArray(mix) ? mix : [mix];
|
|
6588
|
-
for (var i = 0, len = mix.length; i < len; i++) {
|
|
6589
|
-
var value = mix[i];
|
|
6590
|
-
if (!value || typeof value.valueOf() !== "string")
|
|
6591
|
-
continue;
|
|
6592
|
-
var mixes = value.valueOf().split(" ");
|
|
6593
|
-
for (var j = 0; j < mixes.length; j++) {
|
|
6594
|
-
var val = mixes[j];
|
|
6595
|
-
if (val !== entityName) {
|
|
6596
|
-
className += " " + val;
|
|
6597
|
-
}
|
|
6598
|
-
}
|
|
6599
|
-
}
|
|
6600
|
-
}
|
|
6601
|
-
return className;
|
|
6602
|
-
}
|
|
6603
|
-
return function cnGenerator(b2, e) {
|
|
6604
|
-
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
6605
|
-
if (typeof elemOrMods === "string") {
|
|
6606
|
-
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
6607
|
-
return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
|
|
6608
|
-
}
|
|
6609
|
-
return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
6610
|
-
}
|
|
6611
|
-
return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
|
|
6612
|
-
};
|
|
6613
|
-
};
|
|
6517
|
+
}) {
|
|
6518
|
+
const [uncontrolled, setUncontrolled] = React.useState(
|
|
6519
|
+
defaultValue !== void 0 ? defaultValue : finalValue
|
|
6520
|
+
);
|
|
6521
|
+
const handleUncontrolledChange = (val) => {
|
|
6522
|
+
setUncontrolled(val);
|
|
6523
|
+
onChange == null ? void 0 : onChange(val);
|
|
6524
|
+
};
|
|
6525
|
+
if (value !== void 0) {
|
|
6526
|
+
return [value, onChange];
|
|
6614
6527
|
}
|
|
6615
|
-
|
|
6616
|
-
e: "-",
|
|
6617
|
-
m: "_"
|
|
6618
|
-
});
|
|
6619
|
-
classname_development.cn = cn2;
|
|
6620
|
-
classname_development.withNaming = withNaming;
|
|
6621
|
-
return classname_development;
|
|
6528
|
+
return [uncontrolled, handleUncontrolledChange];
|
|
6622
6529
|
}
|
|
6623
|
-
(function(module2) {
|
|
6624
|
-
if (process.env.NODE_ENV === "production") {
|
|
6625
|
-
module2.exports = requireClassname_production_min();
|
|
6626
|
-
} else {
|
|
6627
|
-
module2.exports = requireClassname_development();
|
|
6628
|
-
}
|
|
6629
|
-
})(classname);
|
|
6630
|
-
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
6631
6530
|
const defaultProps$1a = {
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
style: {},
|
|
6640
|
-
onSwitch: (child, activeVisible) => {
|
|
6641
|
-
}
|
|
6531
|
+
...ComponentDefaults,
|
|
6532
|
+
value: "",
|
|
6533
|
+
dot: false,
|
|
6534
|
+
max: 99,
|
|
6535
|
+
top: "0",
|
|
6536
|
+
right: "5",
|
|
6537
|
+
color: ""
|
|
6642
6538
|
};
|
|
6643
|
-
const
|
|
6644
|
-
const {
|
|
6645
|
-
children,
|
|
6646
|
-
visible,
|
|
6647
|
-
activeVisible,
|
|
6648
|
-
bottom,
|
|
6649
|
-
size,
|
|
6650
|
-
activeColor,
|
|
6651
|
-
unactiveColor,
|
|
6652
|
-
safeAreaInsetBottom,
|
|
6653
|
-
className,
|
|
6654
|
-
style,
|
|
6655
|
-
onSwitch
|
|
6656
|
-
} = {
|
|
6539
|
+
const Badge = (props) => {
|
|
6540
|
+
const { className, style, value, max, children, dot, top, right, color } = {
|
|
6657
6541
|
...defaultProps$1a,
|
|
6658
6542
|
...props
|
|
6659
6543
|
};
|
|
6660
|
-
const
|
|
6661
|
-
const
|
|
6662
|
-
const
|
|
6663
|
-
|
|
6664
|
-
|
|
6544
|
+
const classPrefix2 = "nut-badge";
|
|
6545
|
+
const classes = classNames(classPrefix2, className);
|
|
6546
|
+
const contentClasses = classNames(
|
|
6547
|
+
{ [`${classPrefix2}__dot`]: dot },
|
|
6548
|
+
`${classPrefix2}__content`,
|
|
6549
|
+
`${classPrefix2}__sup`
|
|
6550
|
+
);
|
|
6551
|
+
function content() {
|
|
6552
|
+
if (dot || typeof value === "object")
|
|
6553
|
+
return null;
|
|
6554
|
+
if (typeof value === "number" && typeof max === "number") {
|
|
6555
|
+
return max < value ? `${max}+` : value;
|
|
6665
6556
|
}
|
|
6557
|
+
return value;
|
|
6558
|
+
}
|
|
6559
|
+
const getStyle = () => {
|
|
6560
|
+
const style2 = {};
|
|
6561
|
+
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
6562
|
+
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
6563
|
+
style2.background = color;
|
|
6564
|
+
return style2;
|
|
6666
6565
|
};
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
}
|
|
6671
|
-
}
|
|
6672
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6673
|
-
"div",
|
|
6674
|
-
{
|
|
6675
|
-
className: [
|
|
6676
|
-
`${b2()}`,
|
|
6677
|
-
bottom ? `${b2("bottom")}` : "",
|
|
6678
|
-
safeAreaInsetBottom ? `${b2("bottom")} ${b2("safebottom")}` : "",
|
|
6679
|
-
className
|
|
6680
|
-
].join(" "),
|
|
6681
|
-
style,
|
|
6682
|
-
children: React.Children.map(children, (child, idx) => {
|
|
6683
|
-
if (!React.isValidElement(child)) {
|
|
6684
|
-
return null;
|
|
6685
|
-
}
|
|
6686
|
-
const childProps = {
|
|
6687
|
-
...child.props,
|
|
6688
|
-
active: idx === selectIndex,
|
|
6689
|
-
index: idx,
|
|
6690
|
-
unactiveColor,
|
|
6691
|
-
activeColor,
|
|
6692
|
-
size,
|
|
6693
|
-
handleClick: () => {
|
|
6694
|
-
handleClick(idx);
|
|
6695
|
-
onSwitch(child, idx);
|
|
6696
|
-
}
|
|
6697
|
-
};
|
|
6698
|
-
return React.cloneElement(child, childProps);
|
|
6699
|
-
})
|
|
6700
|
-
}
|
|
6701
|
-
);
|
|
6566
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, children: [
|
|
6567
|
+
typeof value === "object" && value && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__icon`, children: value }),
|
|
6568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
|
|
6569
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
6570
|
+
] });
|
|
6702
6571
|
};
|
|
6703
|
-
|
|
6704
|
-
|
|
6572
|
+
Badge.defaultProps = defaultProps$1a;
|
|
6573
|
+
Badge.displayName = "NutBadge";
|
|
6705
6574
|
const defaultProps$19 = {
|
|
6706
6575
|
...ComponentDefaults,
|
|
6707
|
-
|
|
6708
|
-
className: "",
|
|
6709
|
-
tabTitle: "",
|
|
6576
|
+
title: "",
|
|
6710
6577
|
icon: null,
|
|
6711
|
-
href: "",
|
|
6712
|
-
to: "",
|
|
6713
|
-
num: "",
|
|
6714
6578
|
active: false,
|
|
6715
|
-
activeColor: "",
|
|
6716
|
-
unactiveColor: "",
|
|
6717
6579
|
index: 0,
|
|
6718
6580
|
handleClick: (idx) => {
|
|
6719
6581
|
}
|
|
6720
6582
|
};
|
|
6721
6583
|
const TabbarItem = (props) => {
|
|
6722
6584
|
const {
|
|
6723
|
-
dot,
|
|
6724
6585
|
className,
|
|
6725
6586
|
style,
|
|
6726
|
-
|
|
6587
|
+
title,
|
|
6727
6588
|
icon,
|
|
6728
|
-
href,
|
|
6729
|
-
to: to2,
|
|
6730
|
-
num,
|
|
6731
6589
|
active,
|
|
6732
6590
|
activeColor,
|
|
6733
|
-
|
|
6591
|
+
inactiveColor,
|
|
6734
6592
|
index,
|
|
6735
|
-
handleClick
|
|
6593
|
+
handleClick,
|
|
6594
|
+
...rest
|
|
6736
6595
|
} = {
|
|
6737
6596
|
...defaultProps$19,
|
|
6738
6597
|
...props
|
|
6739
6598
|
};
|
|
6740
|
-
const
|
|
6741
|
-
const
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
}
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
url: to2
|
|
6750
|
-
});
|
|
6751
|
-
}
|
|
6752
|
-
}, [active, href, to2]);
|
|
6753
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
6599
|
+
const classPrefix2 = "nut-tabbar-item";
|
|
6600
|
+
const tabbarItemClass = classNames(className, classPrefix2, {
|
|
6601
|
+
[`${classPrefix2}-active`]: active
|
|
6602
|
+
});
|
|
6603
|
+
const boxPrefix = `${classPrefix2}__icon-box`;
|
|
6604
|
+
const titleClass = classNames(boxPrefix, `${boxPrefix}-nav`, {
|
|
6605
|
+
[`${boxPrefix}-large`]: !icon
|
|
6606
|
+
});
|
|
6607
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6754
6608
|
"div",
|
|
6755
6609
|
{
|
|
6756
|
-
className:
|
|
6610
|
+
className: tabbarItemClass,
|
|
6757
6611
|
style: {
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
},
|
|
6761
|
-
onClick: () => {
|
|
6762
|
-
handleClick(index);
|
|
6612
|
+
color: active ? activeColor : inactiveColor,
|
|
6613
|
+
...style
|
|
6763
6614
|
},
|
|
6615
|
+
onClick: () => handleClick(index),
|
|
6616
|
+
children: icon ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6617
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: boxPrefix, children: icon }) }),
|
|
6618
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: titleClass, children: title })
|
|
6619
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: titleClass, children: title }) })
|
|
6620
|
+
}
|
|
6621
|
+
);
|
|
6622
|
+
};
|
|
6623
|
+
const defaultProps$18 = {
|
|
6624
|
+
...ComponentDefaults,
|
|
6625
|
+
defaultValue: 0,
|
|
6626
|
+
fixed: false,
|
|
6627
|
+
inactiveColor: "",
|
|
6628
|
+
activeColor: "",
|
|
6629
|
+
safeArea: false,
|
|
6630
|
+
onSwitch: (value) => {
|
|
6631
|
+
}
|
|
6632
|
+
};
|
|
6633
|
+
const Tabbar = (props) => {
|
|
6634
|
+
const {
|
|
6635
|
+
children,
|
|
6636
|
+
defaultValue,
|
|
6637
|
+
value,
|
|
6638
|
+
fixed,
|
|
6639
|
+
activeColor,
|
|
6640
|
+
inactiveColor,
|
|
6641
|
+
safeArea,
|
|
6642
|
+
className,
|
|
6643
|
+
style,
|
|
6644
|
+
onSwitch
|
|
6645
|
+
} = {
|
|
6646
|
+
...defaultProps$18,
|
|
6647
|
+
...props
|
|
6648
|
+
};
|
|
6649
|
+
const classPrefix2 = "nut-tabbar";
|
|
6650
|
+
const [selectIndex, setSelectIndex] = usePropsValue({
|
|
6651
|
+
value,
|
|
6652
|
+
defaultValue,
|
|
6653
|
+
finalValue: 0,
|
|
6654
|
+
onChange: onSwitch
|
|
6655
|
+
});
|
|
6656
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
6657
|
+
"div",
|
|
6658
|
+
{
|
|
6659
|
+
className: classNames(classPrefix2, className, {
|
|
6660
|
+
[`${classPrefix2}__fixed`]: fixed
|
|
6661
|
+
}),
|
|
6662
|
+
style,
|
|
6764
6663
|
children: [
|
|
6765
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
6766
|
-
!
|
|
6767
|
-
|
|
6768
|
-
num && num >= 100 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${bIcon("tips", [bIcon("nums")])}`, children: "99+" })
|
|
6769
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${bIcon("tips", [bIcon("dot")])}` }),
|
|
6770
|
-
icon || null
|
|
6771
|
-
] }),
|
|
6772
|
-
tabTitle && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6773
|
-
"div",
|
|
6774
|
-
{
|
|
6775
|
-
className: bIcon({ "nav-word": true }, [
|
|
6776
|
-
bIcon({ "big-word": !icon })
|
|
6777
|
-
]),
|
|
6778
|
-
children: tabTitle
|
|
6664
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__wrap`, children: React.Children.map(children, (child, idx) => {
|
|
6665
|
+
if (!React.isValidElement(child)) {
|
|
6666
|
+
return null;
|
|
6779
6667
|
}
|
|
6780
|
-
|
|
6668
|
+
const childProps = {
|
|
6669
|
+
...child.props,
|
|
6670
|
+
active: idx === selectIndex,
|
|
6671
|
+
index: idx,
|
|
6672
|
+
inactiveColor,
|
|
6673
|
+
activeColor,
|
|
6674
|
+
handleClick: setSelectIndex
|
|
6675
|
+
};
|
|
6676
|
+
return React.cloneElement(child, childProps);
|
|
6677
|
+
}) }),
|
|
6678
|
+
(fixed || safeArea) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__safe-area` })
|
|
6781
6679
|
]
|
|
6782
6680
|
}
|
|
6783
6681
|
);
|
|
6784
6682
|
};
|
|
6785
|
-
|
|
6683
|
+
Tabbar.defaultProps = defaultProps$18;
|
|
6684
|
+
Tabbar.displayName = "NutTabbar";
|
|
6685
|
+
Tabbar.Item = TabbarItem;
|
|
6686
|
+
const defaultProps$17 = {
|
|
6786
6687
|
title: "",
|
|
6787
6688
|
value: "",
|
|
6788
6689
|
disabled: false
|
|
6789
6690
|
};
|
|
6790
6691
|
const TabPane = (props) => {
|
|
6791
6692
|
const { children, autoHeightClassName, className, disabled } = {
|
|
6792
|
-
...defaultProps$
|
|
6693
|
+
...defaultProps$17,
|
|
6793
6694
|
...props
|
|
6794
6695
|
};
|
|
6795
6696
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -6803,26 +6704,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6803
6704
|
);
|
|
6804
6705
|
return children ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, children: !disabled && children }) : null;
|
|
6805
6706
|
};
|
|
6806
|
-
|
|
6807
|
-
value,
|
|
6808
|
-
defaultValue,
|
|
6809
|
-
finalValue,
|
|
6810
|
-
onChange = (value2) => {
|
|
6811
|
-
}
|
|
6812
|
-
}) {
|
|
6813
|
-
const [uncontrolled, setUncontrolled] = React.useState(
|
|
6814
|
-
defaultValue !== void 0 ? defaultValue : finalValue
|
|
6815
|
-
);
|
|
6816
|
-
const handleUncontrolledChange = (val) => {
|
|
6817
|
-
setUncontrolled(val);
|
|
6818
|
-
onChange == null ? void 0 : onChange(val);
|
|
6819
|
-
};
|
|
6820
|
-
if (value !== void 0) {
|
|
6821
|
-
return [value, onChange];
|
|
6822
|
-
}
|
|
6823
|
-
return [uncontrolled, handleUncontrolledChange];
|
|
6824
|
-
}
|
|
6825
|
-
const defaultProps$17 = {
|
|
6707
|
+
const defaultProps$16 = {
|
|
6826
6708
|
...ComponentDefaults,
|
|
6827
6709
|
tabStyle: {},
|
|
6828
6710
|
activeColor: "",
|
|
@@ -6831,7 +6713,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6831
6713
|
duration: 300,
|
|
6832
6714
|
autoHeight: false
|
|
6833
6715
|
};
|
|
6834
|
-
const classPrefix$
|
|
6716
|
+
const classPrefix$4 = "nut-tabs";
|
|
6835
6717
|
const Tabs = (props) => {
|
|
6836
6718
|
const {
|
|
6837
6719
|
activeColor,
|
|
@@ -6848,7 +6730,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6848
6730
|
autoHeight,
|
|
6849
6731
|
...rest
|
|
6850
6732
|
} = {
|
|
6851
|
-
...defaultProps$
|
|
6733
|
+
...defaultProps$16,
|
|
6852
6734
|
...props
|
|
6853
6735
|
};
|
|
6854
6736
|
const [value, setValue] = usePropsValue({
|
|
@@ -6878,14 +6760,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6878
6760
|
};
|
|
6879
6761
|
const titles = React.useRef(getTitles());
|
|
6880
6762
|
const classes = classNames(
|
|
6881
|
-
classPrefix$
|
|
6882
|
-
`${classPrefix$
|
|
6763
|
+
classPrefix$4,
|
|
6764
|
+
`${classPrefix$4}--${direction}`,
|
|
6883
6765
|
className
|
|
6884
6766
|
);
|
|
6885
|
-
const classesTitle = classNames(`${classPrefix$
|
|
6886
|
-
[`${classPrefix$
|
|
6887
|
-
[`${classPrefix$
|
|
6888
|
-
[`${classPrefix$
|
|
6767
|
+
const classesTitle = classNames(`${classPrefix$4}__titles`, {
|
|
6768
|
+
[`${classPrefix$4}__titles--${activeType}`]: activeType,
|
|
6769
|
+
[`${classPrefix$4}__titles--scrollable`]: true,
|
|
6770
|
+
[`${classPrefix$4}__titles--${align}`]: align
|
|
6889
6771
|
});
|
|
6890
6772
|
const tabsActiveStyle = {
|
|
6891
6773
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -6931,7 +6813,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6931
6813
|
onClick: (e) => {
|
|
6932
6814
|
tabChange(item);
|
|
6933
6815
|
},
|
|
6934
|
-
className: classNames(`${classPrefix$
|
|
6816
|
+
className: classNames(`${classPrefix$4}__titles-item`, {
|
|
6935
6817
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
6936
6818
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
6937
6819
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -6940,14 +6822,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6940
6822
|
activeType === "line" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6941
6823
|
components.View,
|
|
6942
6824
|
{
|
|
6943
|
-
className: `${classPrefix$
|
|
6825
|
+
className: `${classPrefix$4}__titles-item__line`,
|
|
6944
6826
|
style: tabsActiveStyle
|
|
6945
6827
|
}
|
|
6946
6828
|
),
|
|
6947
6829
|
activeType === "smile" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6948
6830
|
components.View,
|
|
6949
6831
|
{
|
|
6950
|
-
className: `${classPrefix$
|
|
6832
|
+
className: `${classPrefix$4}__titles-item__smile`,
|
|
6951
6833
|
style: tabsActiveStyle,
|
|
6952
6834
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(a$h, { color: activeColor, width: 40, height: 20 })
|
|
6953
6835
|
}
|
|
@@ -6959,7 +6841,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6959
6841
|
{
|
|
6960
6842
|
ellipsis: true
|
|
6961
6843
|
},
|
|
6962
|
-
`${classPrefix$
|
|
6844
|
+
`${classPrefix$4}__titles-item__text`
|
|
6963
6845
|
),
|
|
6964
6846
|
children: item.title
|
|
6965
6847
|
}
|
|
@@ -6971,27 +6853,147 @@ var __publicField = (obj, key, value) => {
|
|
|
6971
6853
|
})
|
|
6972
6854
|
}
|
|
6973
6855
|
),
|
|
6974
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(components.View, { className: `${classPrefix$
|
|
6856
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(components.View, { className: `${classPrefix$4}__content__wrap`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(components.View, { className: `${classPrefix$4}__content`, style: contentStyle, children: React.Children.map(children, (child, idx) => {
|
|
6975
6857
|
if (!React.isValidElement(child)) {
|
|
6976
6858
|
return null;
|
|
6977
6859
|
}
|
|
6978
|
-
let childProps = {
|
|
6979
|
-
...child.props,
|
|
6980
|
-
active: value === child.props.value
|
|
6860
|
+
let childProps = {
|
|
6861
|
+
...child.props,
|
|
6862
|
+
active: value === child.props.value
|
|
6863
|
+
};
|
|
6864
|
+
if (String(value) !== String(child.props.value || idx) && autoHeight) {
|
|
6865
|
+
childProps = {
|
|
6866
|
+
...childProps,
|
|
6867
|
+
autoHeightClassName: "inactive"
|
|
6868
|
+
};
|
|
6869
|
+
}
|
|
6870
|
+
return React.cloneElement(child, childProps);
|
|
6871
|
+
}) }) })
|
|
6872
|
+
] });
|
|
6873
|
+
};
|
|
6874
|
+
Tabs.defaultProps = defaultProps$16;
|
|
6875
|
+
Tabs.displayName = "NutTabs";
|
|
6876
|
+
Tabs.TabPane = TabPane;
|
|
6877
|
+
var classnameExports = {};
|
|
6878
|
+
var classname = {
|
|
6879
|
+
get exports() {
|
|
6880
|
+
return classnameExports;
|
|
6881
|
+
},
|
|
6882
|
+
set exports(v) {
|
|
6883
|
+
classnameExports = v;
|
|
6884
|
+
}
|
|
6885
|
+
};
|
|
6886
|
+
var classname_production_min = {};
|
|
6887
|
+
var hasRequiredClassname_production_min;
|
|
6888
|
+
function requireClassname_production_min() {
|
|
6889
|
+
if (hasRequiredClassname_production_min)
|
|
6890
|
+
return classname_production_min;
|
|
6891
|
+
hasRequiredClassname_production_min = 1;
|
|
6892
|
+
function r2(r3) {
|
|
6893
|
+
function t2(t3, i, a2, o) {
|
|
6894
|
+
var f = i ? e + t3 + r3.e + i : e + t3, v = f;
|
|
6895
|
+
if (a2) {
|
|
6896
|
+
var s = " " + v + r3.m;
|
|
6897
|
+
for (var u in a2)
|
|
6898
|
+
if (a2.hasOwnProperty(u)) {
|
|
6899
|
+
var p = a2[u];
|
|
6900
|
+
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
6901
|
+
}
|
|
6902
|
+
}
|
|
6903
|
+
if (void 0 !== o)
|
|
6904
|
+
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
6905
|
+
var l = o[y2];
|
|
6906
|
+
if (l && "string" == typeof l.valueOf())
|
|
6907
|
+
for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
6908
|
+
var h = g[d];
|
|
6909
|
+
h !== f && (v += " " + h);
|
|
6910
|
+
}
|
|
6911
|
+
}
|
|
6912
|
+
return v;
|
|
6913
|
+
}
|
|
6914
|
+
var e = r3.n || "", n = r3.v || r3.m;
|
|
6915
|
+
return function(r4, e2) {
|
|
6916
|
+
return function(n2, i, a2) {
|
|
6917
|
+
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);
|
|
6981
6918
|
};
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6919
|
+
};
|
|
6920
|
+
}
|
|
6921
|
+
Object.defineProperty(classname_production_min, "__esModule", { value: true });
|
|
6922
|
+
var t = r2({ e: "-", m: "_" });
|
|
6923
|
+
classname_production_min.cn = t, classname_production_min.withNaming = r2;
|
|
6924
|
+
return classname_production_min;
|
|
6925
|
+
}
|
|
6926
|
+
var classname_development = {};
|
|
6927
|
+
var hasRequiredClassname_development;
|
|
6928
|
+
function requireClassname_development() {
|
|
6929
|
+
if (hasRequiredClassname_development)
|
|
6930
|
+
return classname_development;
|
|
6931
|
+
hasRequiredClassname_development = 1;
|
|
6932
|
+
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
6933
|
+
function withNaming(preset) {
|
|
6934
|
+
var nameSpace = preset.n || "";
|
|
6935
|
+
var modValueDelimiter = preset.v || preset.m;
|
|
6936
|
+
function stringify(b2, e, m, mix) {
|
|
6937
|
+
var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
|
|
6938
|
+
var className = entityName;
|
|
6939
|
+
if (m) {
|
|
6940
|
+
var modPrefix = " " + className + preset.m;
|
|
6941
|
+
for (var k in m) {
|
|
6942
|
+
if (m.hasOwnProperty(k)) {
|
|
6943
|
+
var modVal = m[k];
|
|
6944
|
+
if (modVal === true) {
|
|
6945
|
+
className += modPrefix + k;
|
|
6946
|
+
} else if (modVal) {
|
|
6947
|
+
className += modPrefix + k + modValueDelimiter + modVal;
|
|
6948
|
+
}
|
|
6949
|
+
}
|
|
6950
|
+
}
|
|
6987
6951
|
}
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6952
|
+
if (mix !== void 0) {
|
|
6953
|
+
mix = Array.isArray(mix) ? mix : [mix];
|
|
6954
|
+
for (var i = 0, len = mix.length; i < len; i++) {
|
|
6955
|
+
var value = mix[i];
|
|
6956
|
+
if (!value || typeof value.valueOf() !== "string")
|
|
6957
|
+
continue;
|
|
6958
|
+
var mixes = value.valueOf().split(" ");
|
|
6959
|
+
for (var j = 0; j < mixes.length; j++) {
|
|
6960
|
+
var val = mixes[j];
|
|
6961
|
+
if (val !== entityName) {
|
|
6962
|
+
className += " " + val;
|
|
6963
|
+
}
|
|
6964
|
+
}
|
|
6965
|
+
}
|
|
6966
|
+
}
|
|
6967
|
+
return className;
|
|
6968
|
+
}
|
|
6969
|
+
return function cnGenerator(b2, e) {
|
|
6970
|
+
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
6971
|
+
if (typeof elemOrMods === "string") {
|
|
6972
|
+
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
6973
|
+
return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
|
|
6974
|
+
}
|
|
6975
|
+
return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
6976
|
+
}
|
|
6977
|
+
return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
|
|
6978
|
+
};
|
|
6979
|
+
};
|
|
6980
|
+
}
|
|
6981
|
+
var cn2 = withNaming({
|
|
6982
|
+
e: "-",
|
|
6983
|
+
m: "_"
|
|
6984
|
+
});
|
|
6985
|
+
classname_development.cn = cn2;
|
|
6986
|
+
classname_development.withNaming = withNaming;
|
|
6987
|
+
return classname_development;
|
|
6988
|
+
}
|
|
6989
|
+
(function(module2) {
|
|
6990
|
+
if (process.env.NODE_ENV === "production") {
|
|
6991
|
+
module2.exports = requireClassname_production_min();
|
|
6992
|
+
} else {
|
|
6993
|
+
module2.exports = requireClassname_development();
|
|
6994
|
+
}
|
|
6995
|
+
})(classname);
|
|
6996
|
+
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
6995
6997
|
const defaultConfigRef = {
|
|
6996
6998
|
current: {
|
|
6997
6999
|
locale: zhCN
|
|
@@ -7004,7 +7006,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7004
7006
|
const useConfig = () => {
|
|
7005
7007
|
return React.useContext(ConfigContext) ?? getDefaultConfig();
|
|
7006
7008
|
};
|
|
7007
|
-
const defaultProps$
|
|
7009
|
+
const defaultProps$15 = {
|
|
7008
7010
|
type: "custom",
|
|
7009
7011
|
existAddress: [],
|
|
7010
7012
|
defaultIcon: null,
|
|
@@ -7026,7 +7028,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7026
7028
|
onClose,
|
|
7027
7029
|
onSwitchModule,
|
|
7028
7030
|
...rest
|
|
7029
|
-
} = { ...defaultProps$
|
|
7031
|
+
} = { ...defaultProps$15, ...props };
|
|
7030
7032
|
const b2 = cn("address");
|
|
7031
7033
|
const selectedExist = (item) => {
|
|
7032
7034
|
const copyExistAdd = existAddress;
|
|
@@ -7068,7 +7070,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7068
7070
|
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 }) })
|
|
7069
7071
|
] });
|
|
7070
7072
|
};
|
|
7071
|
-
const defaultProps$
|
|
7073
|
+
const defaultProps$14 = {
|
|
7072
7074
|
modelValue: [],
|
|
7073
7075
|
type: "custom",
|
|
7074
7076
|
province: [],
|
|
@@ -7093,7 +7095,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7093
7095
|
onClose,
|
|
7094
7096
|
...rest
|
|
7095
7097
|
} = {
|
|
7096
|
-
...defaultProps$
|
|
7098
|
+
...defaultProps$14,
|
|
7097
7099
|
...props
|
|
7098
7100
|
};
|
|
7099
7101
|
const b2 = cn("address");
|
|
@@ -7257,28 +7259,28 @@ var __publicField = (obj, key, value) => {
|
|
|
7257
7259
|
nextAreaList(item);
|
|
7258
7260
|
};
|
|
7259
7261
|
React.useEffect(() => {
|
|
7260
|
-
const { province: province2 } = { ...defaultProps$
|
|
7262
|
+
const { province: province2 } = { ...defaultProps$14, ...props };
|
|
7261
7263
|
setRegionList({
|
|
7262
7264
|
...regionList,
|
|
7263
7265
|
province: isCustom2() ? transformData(province2) : province2
|
|
7264
7266
|
});
|
|
7265
7267
|
}, [province]);
|
|
7266
7268
|
React.useEffect(() => {
|
|
7267
|
-
const { city: city2 } = { ...defaultProps$
|
|
7269
|
+
const { city: city2 } = { ...defaultProps$14, ...props };
|
|
7268
7270
|
setRegionList({
|
|
7269
7271
|
...regionList,
|
|
7270
7272
|
city: isCustom2() ? transformData(city2) : city2
|
|
7271
7273
|
});
|
|
7272
7274
|
}, [city]);
|
|
7273
7275
|
React.useEffect(() => {
|
|
7274
|
-
const { country: country2 } = { ...defaultProps$
|
|
7276
|
+
const { country: country2 } = { ...defaultProps$14, ...props };
|
|
7275
7277
|
setRegionList({
|
|
7276
7278
|
...regionList,
|
|
7277
7279
|
country: isCustom2() ? transformData(country2) : country2
|
|
7278
7280
|
});
|
|
7279
7281
|
}, [country]);
|
|
7280
7282
|
React.useEffect(() => {
|
|
7281
|
-
const { town: town2 } = { ...defaultProps$
|
|
7283
|
+
const { town: town2 } = { ...defaultProps$14, ...props };
|
|
7282
7284
|
setRegionList({
|
|
7283
7285
|
...regionList,
|
|
7284
7286
|
town: isCustom2() ? transformData(town2) : town2
|
|
@@ -7351,7 +7353,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7351
7353
|
) })
|
|
7352
7354
|
] });
|
|
7353
7355
|
};
|
|
7354
|
-
const defaultProps$
|
|
7356
|
+
const defaultProps$13 = {
|
|
7355
7357
|
...ComponentDefaults,
|
|
7356
7358
|
modelValue: false,
|
|
7357
7359
|
modelSelect: [],
|
|
@@ -7402,7 +7404,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7402
7404
|
className,
|
|
7403
7405
|
...rest
|
|
7404
7406
|
} = {
|
|
7405
|
-
...defaultProps$
|
|
7407
|
+
...defaultProps$13,
|
|
7406
7408
|
...props
|
|
7407
7409
|
};
|
|
7408
7410
|
const b2 = cn("address");
|
|
@@ -7560,7 +7562,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7560
7562
|
}
|
|
7561
7563
|
) });
|
|
7562
7564
|
};
|
|
7563
|
-
Address.defaultProps = defaultProps$
|
|
7565
|
+
Address.defaultProps = defaultProps$13;
|
|
7564
7566
|
Address.displayName = "NutAddress";
|
|
7565
7567
|
const Utils = {
|
|
7566
7568
|
/**
|
|
@@ -7693,7 +7695,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7693
7695
|
}
|
|
7694
7696
|
}
|
|
7695
7697
|
const requestAniFrame$1 = requestAniFrame();
|
|
7696
|
-
const defaultProps$
|
|
7698
|
+
const defaultProps$12 = {
|
|
7697
7699
|
type: "one",
|
|
7698
7700
|
isAutoBackFill: false,
|
|
7699
7701
|
poppable: true,
|
|
@@ -7745,7 +7747,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7745
7747
|
onUpdate,
|
|
7746
7748
|
onSelected,
|
|
7747
7749
|
onYearMonthChange
|
|
7748
|
-
} = { ...defaultProps$
|
|
7750
|
+
} = { ...defaultProps$12, ...props };
|
|
7749
7751
|
const weeks = locale.calendaritem.weekdays;
|
|
7750
7752
|
const [yearMonthTitle, setYearMonthTitle] = React.useState("");
|
|
7751
7753
|
const [monthsData, setMonthsData] = React.useState([]);
|
|
@@ -8350,9 +8352,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8350
8352
|
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 }) }) : ""
|
|
8351
8353
|
] }) });
|
|
8352
8354
|
});
|
|
8353
|
-
CalendarItem.defaultProps = defaultProps$
|
|
8355
|
+
CalendarItem.defaultProps = defaultProps$12;
|
|
8354
8356
|
CalendarItem.displayName = "NutCalendarItem";
|
|
8355
|
-
const defaultProps$
|
|
8357
|
+
const defaultProps$11 = {
|
|
8356
8358
|
type: "one",
|
|
8357
8359
|
isAutoBackFill: false,
|
|
8358
8360
|
poppable: true,
|
|
@@ -8408,7 +8410,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8408
8410
|
onChoose,
|
|
8409
8411
|
onSelected,
|
|
8410
8412
|
onYearMonthChange
|
|
8411
|
-
} = { ...defaultProps$
|
|
8413
|
+
} = { ...defaultProps$11, ...props };
|
|
8412
8414
|
const calendarRef = React.useRef(null);
|
|
8413
8415
|
const close = () => {
|
|
8414
8416
|
onClose && onClose();
|
|
@@ -8478,9 +8480,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8478
8480
|
}
|
|
8479
8481
|
) : renderItem() });
|
|
8480
8482
|
});
|
|
8481
|
-
Calendar.defaultProps = defaultProps$
|
|
8483
|
+
Calendar.defaultProps = defaultProps$11;
|
|
8482
8484
|
Calendar.displayName = "NutCalendar";
|
|
8483
|
-
const defaultProps$
|
|
8485
|
+
const defaultProps$10 = {
|
|
8484
8486
|
data: {
|
|
8485
8487
|
text: "",
|
|
8486
8488
|
value: "",
|
|
@@ -8497,7 +8499,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8497
8499
|
};
|
|
8498
8500
|
const InternalCascaderItem = (props, ref) => {
|
|
8499
8501
|
const { data, checked, checkedIcon, chooseItem, activeColor } = {
|
|
8500
|
-
...defaultProps$
|
|
8502
|
+
...defaultProps$10,
|
|
8501
8503
|
...props
|
|
8502
8504
|
};
|
|
8503
8505
|
const b2 = cn("cascader-item");
|
|
@@ -8536,7 +8538,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8536
8538
|
);
|
|
8537
8539
|
};
|
|
8538
8540
|
const CascaderItem = React.forwardRef(InternalCascaderItem);
|
|
8539
|
-
CascaderItem.defaultProps = defaultProps$
|
|
8541
|
+
CascaderItem.defaultProps = defaultProps$10;
|
|
8540
8542
|
CascaderItem.displayName = "NutCascaderItem";
|
|
8541
8543
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
8542
8544
|
const {
|
|
@@ -8674,7 +8676,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8674
8676
|
}
|
|
8675
8677
|
}
|
|
8676
8678
|
const Tree$1 = Tree;
|
|
8677
|
-
const defaultProps
|
|
8679
|
+
const defaultProps$$ = {
|
|
8678
8680
|
className: "",
|
|
8679
8681
|
style: {},
|
|
8680
8682
|
activeColor: "",
|
|
@@ -8725,7 +8727,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8725
8727
|
onClose,
|
|
8726
8728
|
onChange,
|
|
8727
8729
|
onPathChange
|
|
8728
|
-
} = { ...defaultProps
|
|
8730
|
+
} = { ...defaultProps$$, ...props };
|
|
8729
8731
|
const [tabvalue, setTabvalue] = React.useState("c1");
|
|
8730
8732
|
const [optionsData, setOptionsData] = React.useState([]);
|
|
8731
8733
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
@@ -8999,11 +9001,11 @@ var __publicField = (obj, key, value) => {
|
|
|
8999
9001
|
) : renderItem() });
|
|
9000
9002
|
};
|
|
9001
9003
|
const Cascader = React.forwardRef(InternalCascader);
|
|
9002
|
-
Cascader.defaultProps = defaultProps
|
|
9004
|
+
Cascader.defaultProps = defaultProps$$;
|
|
9003
9005
|
Cascader.displayName = "NutCascader";
|
|
9004
9006
|
const CheckboxGroupContext = React.createContext(null);
|
|
9005
9007
|
const Context = CheckboxGroupContext;
|
|
9006
|
-
const defaultProps
|
|
9008
|
+
const defaultProps$_ = {
|
|
9007
9009
|
disabled: false,
|
|
9008
9010
|
checkedValue: [],
|
|
9009
9011
|
max: void 0,
|
|
@@ -9015,7 +9017,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9015
9017
|
};
|
|
9016
9018
|
const CheckboxGroup = React.forwardRef(
|
|
9017
9019
|
(props, ref) => {
|
|
9018
|
-
const { children } = { ...defaultProps
|
|
9020
|
+
const { children } = { ...defaultProps$_, ...props };
|
|
9019
9021
|
const b2 = cn("checkboxgroup");
|
|
9020
9022
|
const {
|
|
9021
9023
|
className,
|
|
@@ -9101,9 +9103,9 @@ var __publicField = (obj, key, value) => {
|
|
|
9101
9103
|
);
|
|
9102
9104
|
}
|
|
9103
9105
|
);
|
|
9104
|
-
CheckboxGroup.defaultProps = defaultProps
|
|
9106
|
+
CheckboxGroup.defaultProps = defaultProps$_;
|
|
9105
9107
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
9106
|
-
const defaultProps$
|
|
9108
|
+
const defaultProps$Z = {
|
|
9107
9109
|
...ComponentDefaults,
|
|
9108
9110
|
checked: false,
|
|
9109
9111
|
disabled: false,
|
|
@@ -9119,7 +9121,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9119
9121
|
};
|
|
9120
9122
|
const Checkbox = (props) => {
|
|
9121
9123
|
const { children } = {
|
|
9122
|
-
...defaultProps$
|
|
9124
|
+
...defaultProps$Z,
|
|
9123
9125
|
...props
|
|
9124
9126
|
};
|
|
9125
9127
|
const b2 = cn("checkbox");
|
|
@@ -9211,7 +9213,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9211
9213
|
}
|
|
9212
9214
|
);
|
|
9213
9215
|
};
|
|
9214
|
-
Checkbox.defaultProps = defaultProps$
|
|
9216
|
+
Checkbox.defaultProps = defaultProps$Z;
|
|
9215
9217
|
Checkbox.displayName = "NutCheckBox";
|
|
9216
9218
|
Checkbox.Group = CheckboxGroup;
|
|
9217
9219
|
const MIN_DISTANCE = 10;
|
|
@@ -9760,7 +9762,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9760
9762
|
const Picker = React.forwardRef(InternalPicker);
|
|
9761
9763
|
const Picker$1 = Picker;
|
|
9762
9764
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
9763
|
-
const defaultProps$
|
|
9765
|
+
const defaultProps$Y = {
|
|
9764
9766
|
modelValue: null,
|
|
9765
9767
|
visible: false,
|
|
9766
9768
|
title: "",
|
|
@@ -9791,7 +9793,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9791
9793
|
style,
|
|
9792
9794
|
...rest
|
|
9793
9795
|
} = {
|
|
9794
|
-
...defaultProps$
|
|
9796
|
+
...defaultProps$Y,
|
|
9795
9797
|
...props
|
|
9796
9798
|
};
|
|
9797
9799
|
const { locale } = useConfig$1();
|
|
@@ -10069,10 +10071,10 @@ var __publicField = (obj, key, value) => {
|
|
|
10069
10071
|
}
|
|
10070
10072
|
);
|
|
10071
10073
|
};
|
|
10072
|
-
DatePicker.defaultProps = defaultProps$
|
|
10074
|
+
DatePicker.defaultProps = defaultProps$Y;
|
|
10073
10075
|
DatePicker.displayName = "NutDatePicker";
|
|
10074
10076
|
const FormItemContext = React.createContext({});
|
|
10075
|
-
const defaultProps$
|
|
10077
|
+
const defaultProps$X = {
|
|
10076
10078
|
...ComponentDefaults,
|
|
10077
10079
|
name: "",
|
|
10078
10080
|
label: "",
|
|
@@ -10121,7 +10123,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10121
10123
|
showErrorLine,
|
|
10122
10124
|
showErrorMessage
|
|
10123
10125
|
} = {
|
|
10124
|
-
...defaultProps$
|
|
10126
|
+
...defaultProps$X,
|
|
10125
10127
|
...this.props
|
|
10126
10128
|
};
|
|
10127
10129
|
const item = ((_a = this.context.errList) == null ? void 0 : _a.length) > 0 && ((_b = this.context.errList) == null ? void 0 : _b.filter((item2) => {
|
|
@@ -10182,7 +10184,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10182
10184
|
return this.renderLayout(returnChildNode);
|
|
10183
10185
|
}
|
|
10184
10186
|
}
|
|
10185
|
-
__publicField(FormItem, "defaultProps", defaultProps$
|
|
10187
|
+
__publicField(FormItem, "defaultProps", defaultProps$X);
|
|
10186
10188
|
__publicField(FormItem, "contextType", FormItemContext);
|
|
10187
10189
|
class FormStore {
|
|
10188
10190
|
constructor() {
|
|
@@ -10306,7 +10308,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10306
10308
|
}
|
|
10307
10309
|
return [formRef.current];
|
|
10308
10310
|
};
|
|
10309
|
-
const defaultProps$
|
|
10311
|
+
const defaultProps$W = {
|
|
10310
10312
|
...ComponentDefaults,
|
|
10311
10313
|
className: "",
|
|
10312
10314
|
style: void 0,
|
|
@@ -10333,7 +10335,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10333
10335
|
starPositon,
|
|
10334
10336
|
...rest
|
|
10335
10337
|
} = {
|
|
10336
|
-
...defaultProps$
|
|
10338
|
+
...defaultProps$W,
|
|
10337
10339
|
...props
|
|
10338
10340
|
};
|
|
10339
10341
|
console.log("46 dddd");
|
|
@@ -10357,383 +10359,223 @@ var __publicField = (obj, key, value) => {
|
|
|
10357
10359
|
}
|
|
10358
10360
|
);
|
|
10359
10361
|
};
|
|
10360
|
-
Form.defaultProps = defaultProps$
|
|
10362
|
+
Form.defaultProps = defaultProps$W;
|
|
10361
10363
|
Form.displayName = "NutForm";
|
|
10362
10364
|
Form.Item = FormItem;
|
|
10363
|
-
function trimExtraChar(value, char, regExp) {
|
|
10364
|
-
const index = value.indexOf(char);
|
|
10365
|
-
if (index === -1) {
|
|
10366
|
-
return value;
|
|
10367
|
-
}
|
|
10368
|
-
if (char === "-" && index !== 0) {
|
|
10369
|
-
return value.slice(0, index);
|
|
10370
|
-
}
|
|
10371
|
-
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
10372
|
-
}
|
|
10373
|
-
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
10374
|
-
if (allowDot) {
|
|
10375
|
-
value = trimExtraChar(value, ".", /\./g);
|
|
10376
|
-
} else {
|
|
10377
|
-
value = value.split(".")[0];
|
|
10378
|
-
}
|
|
10379
|
-
if (allowMinus) {
|
|
10380
|
-
value = trimExtraChar(value, "-", /-/g);
|
|
10381
|
-
} else {
|
|
10382
|
-
value = value.replace(/-/, "");
|
|
10383
|
-
}
|
|
10384
|
-
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
10385
|
-
return value.replace(regExp, "");
|
|
10386
|
-
}
|
|
10387
|
-
const defaultProps$
|
|
10388
|
-
...ComponentDefaults,
|
|
10389
|
-
type: "text",
|
|
10390
|
-
name: "",
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
slotButton: null,
|
|
10419
|
-
slotInput: null
|
|
10420
|
-
};
|
|
10421
|
-
const Input = React.forwardRef((props, ref) => {
|
|
10422
|
-
const { locale } = useConfig$1();
|
|
10423
|
-
const {
|
|
10424
|
-
children,
|
|
10425
|
-
type,
|
|
10426
|
-
name,
|
|
10427
|
-
defaultValue,
|
|
10428
|
-
placeholder,
|
|
10429
|
-
label,
|
|
10430
|
-
labelClass,
|
|
10431
|
-
labelWidth,
|
|
10432
|
-
labelAlign,
|
|
10433
|
-
colon,
|
|
10434
|
-
inputAlign,
|
|
10435
|
-
center,
|
|
10436
|
-
required,
|
|
10437
|
-
disabled,
|
|
10438
|
-
readonly,
|
|
10439
|
-
error,
|
|
10440
|
-
maxlength,
|
|
10441
|
-
leftIcon,
|
|
10442
|
-
rightIcon,
|
|
10443
|
-
clearable,
|
|
10444
|
-
clearIcon,
|
|
10445
|
-
clearSize,
|
|
10446
|
-
border,
|
|
10447
|
-
formatTrigger,
|
|
10448
|
-
rules,
|
|
10449
|
-
errorMessage,
|
|
10450
|
-
errorMessageAlign,
|
|
10451
|
-
showWordLimit,
|
|
10452
|
-
autofocus,
|
|
10453
|
-
style,
|
|
10454
|
-
className,
|
|
10455
|
-
rows,
|
|
10456
|
-
slotButton,
|
|
10457
|
-
slotInput,
|
|
10458
|
-
onChange,
|
|
10459
|
-
onBlur,
|
|
10460
|
-
onFocus,
|
|
10461
|
-
onClear,
|
|
10462
|
-
formatter,
|
|
10463
|
-
keypress,
|
|
10464
|
-
onClickInput,
|
|
10465
|
-
onClickLeftIcon,
|
|
10466
|
-
onClickRightIcon,
|
|
10467
|
-
onClick,
|
|
10468
|
-
...rest
|
|
10469
|
-
} = {
|
|
10470
|
-
...defaultProps$W,
|
|
10471
|
-
...props
|
|
10472
|
-
};
|
|
10473
|
-
const inputPlaceholder = placeholder || locale.placeholder;
|
|
10474
|
-
const [inputValue, SetInputValue] = React.useState("");
|
|
10475
|
-
const [active, SetActive] = React.useState(false);
|
|
10476
|
-
const [classes, setClasses] = React.useState("");
|
|
10477
|
-
const getModelValue = () => String(inputValue ?? "");
|
|
10478
|
-
const inputRef = React.useRef(null);
|
|
10479
|
-
React.useEffect(() => {
|
|
10480
|
-
setClasses(inputClass);
|
|
10481
|
-
SetInputValue(defaultValue);
|
|
10482
|
-
}, [defaultValue]);
|
|
10483
|
-
React.useEffect(() => {
|
|
10484
|
-
if (inputValue) {
|
|
10485
|
-
updateValue(getModelValue());
|
|
10486
|
-
resetValidation();
|
|
10487
|
-
}
|
|
10488
|
-
}, [inputValue]);
|
|
10489
|
-
React.useImperativeHandle(ref, () => {
|
|
10490
|
-
return inputRef.current;
|
|
10491
|
-
});
|
|
10492
|
-
const inputClass = React.useCallback(() => {
|
|
10493
|
-
const prefixCls2 = "nut-input";
|
|
10494
|
-
return [
|
|
10495
|
-
prefixCls2,
|
|
10496
|
-
`${center ? "center" : ""}`,
|
|
10497
|
-
`${disabled ? `${prefixCls2}-disabled` : ""}`,
|
|
10498
|
-
`${required ? `${prefixCls2}-required` : ""}`,
|
|
10499
|
-
`${error ? `${prefixCls2}-error` : ""}`,
|
|
10500
|
-
`${border ? `${prefixCls2}-border` : ""}`,
|
|
10501
|
-
`${slotButton || rightIcon ? `${prefixCls2}-right-mark` : ""}`
|
|
10502
|
-
].filter(Boolean).join(" ");
|
|
10503
|
-
}, [disabled, required, error, border, slotButton, rightIcon, center]);
|
|
10504
|
-
React.useEffect(() => {
|
|
10505
|
-
setClasses(inputClass);
|
|
10506
|
-
}, [disabled, required, error, border, slotButton, rightIcon, center]);
|
|
10507
|
-
const updateValue = (value, trigger = "onChange") => {
|
|
10508
|
-
var _a;
|
|
10509
|
-
let val = value;
|
|
10510
|
-
if (type === "digit" || type === "tel") {
|
|
10511
|
-
val = formatNumber(val, false, false);
|
|
10512
|
-
}
|
|
10513
|
-
if (type === "number") {
|
|
10514
|
-
val = formatNumber(val, true, true);
|
|
10515
|
-
}
|
|
10516
|
-
if (type === "tel" && !formatter) {
|
|
10517
|
-
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}$/;
|
|
10518
|
-
const regNumber = /[^-0-9]/g;
|
|
10519
|
-
val = !regTel.test(val) && val.length > 11 ? val.substring(0, 11) : val.replace(regNumber, "");
|
|
10520
|
-
}
|
|
10521
|
-
if (formatter && trigger === formatTrigger) {
|
|
10522
|
-
val = formatter(val);
|
|
10523
|
-
}
|
|
10524
|
-
if (((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) !== val) {
|
|
10525
|
-
inputRef.current.value = val;
|
|
10526
|
-
}
|
|
10527
|
-
SetInputValue(val);
|
|
10528
|
-
};
|
|
10529
|
-
const handleFocus = (event) => {
|
|
10530
|
-
const val = event.target.value;
|
|
10531
|
-
SetActive(true);
|
|
10532
|
-
onFocus && onFocus(val, event);
|
|
10533
|
-
};
|
|
10534
|
-
const handleInput = (event) => {
|
|
10535
|
-
let val = event.target.value;
|
|
10536
|
-
if (maxlength && val.length > Number(maxlength)) {
|
|
10537
|
-
val = val.slice(0, Number(maxlength));
|
|
10538
|
-
}
|
|
10539
|
-
updateValue(val, "onChange");
|
|
10540
|
-
onChange && onChange(val, event);
|
|
10541
|
-
};
|
|
10542
|
-
const handleBlur = (event) => {
|
|
10543
|
-
setTimeout(() => {
|
|
10544
|
-
SetActive(false);
|
|
10545
|
-
}, 200);
|
|
10546
|
-
let val = event.target.value;
|
|
10547
|
-
if (maxlength && val.length > Number(maxlength)) {
|
|
10548
|
-
val = val.slice(0, Number(maxlength));
|
|
10549
|
-
}
|
|
10550
|
-
updateValue(val, "onBlur");
|
|
10551
|
-
onBlur && onBlur(val, event);
|
|
10552
|
-
};
|
|
10553
|
-
const handleClickInput = (event) => {
|
|
10554
|
-
onClickInput && onClickInput(event);
|
|
10555
|
-
};
|
|
10556
|
-
const handleClickLeftIcon = (event) => {
|
|
10557
|
-
onClickLeftIcon && onClickLeftIcon(event);
|
|
10558
|
-
};
|
|
10559
|
-
const handleClickRightIcon = (event) => {
|
|
10560
|
-
onClickRightIcon && onClickRightIcon(event);
|
|
10561
|
-
};
|
|
10562
|
-
const resetValidation = () => {
|
|
10563
|
-
};
|
|
10564
|
-
const inputType = (type2) => {
|
|
10565
|
-
if (type2 === "number") {
|
|
10566
|
-
return "text";
|
|
10567
|
-
}
|
|
10568
|
-
if (type2 === "digit") {
|
|
10569
|
-
return "tel";
|
|
10570
|
-
}
|
|
10571
|
-
return type2;
|
|
10572
|
-
};
|
|
10573
|
-
const handleClear = (event) => {
|
|
10574
|
-
updateValue("");
|
|
10575
|
-
onClear && onClear("", event);
|
|
10576
|
-
};
|
|
10577
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10578
|
-
"div",
|
|
10579
|
-
{
|
|
10580
|
-
className: `${classes} ${className || ""}`,
|
|
10365
|
+
function trimExtraChar(value, char, regExp) {
|
|
10366
|
+
const index = value.indexOf(char);
|
|
10367
|
+
if (index === -1) {
|
|
10368
|
+
return value;
|
|
10369
|
+
}
|
|
10370
|
+
if (char === "-" && index !== 0) {
|
|
10371
|
+
return value.slice(0, index);
|
|
10372
|
+
}
|
|
10373
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
10374
|
+
}
|
|
10375
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
10376
|
+
if (allowDot) {
|
|
10377
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
10378
|
+
} else {
|
|
10379
|
+
value = value.split(".")[0];
|
|
10380
|
+
}
|
|
10381
|
+
if (allowMinus) {
|
|
10382
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
10383
|
+
} else {
|
|
10384
|
+
value = value.replace(/-/, "");
|
|
10385
|
+
}
|
|
10386
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
10387
|
+
return value.replace(regExp, "");
|
|
10388
|
+
}
|
|
10389
|
+
const defaultProps$V = {
|
|
10390
|
+
...ComponentDefaults,
|
|
10391
|
+
type: "text",
|
|
10392
|
+
name: "",
|
|
10393
|
+
placeholder: "",
|
|
10394
|
+
confirmType: "done",
|
|
10395
|
+
align: "left",
|
|
10396
|
+
required: false,
|
|
10397
|
+
disabled: false,
|
|
10398
|
+
readOnly: false,
|
|
10399
|
+
maxLength: 9999,
|
|
10400
|
+
clearable: false,
|
|
10401
|
+
clearIcon: null,
|
|
10402
|
+
formatTrigger: "onChange",
|
|
10403
|
+
autoFocus: false
|
|
10404
|
+
};
|
|
10405
|
+
const Input = React.forwardRef(
|
|
10406
|
+
(props, ref) => {
|
|
10407
|
+
const { locale } = useConfig$1();
|
|
10408
|
+
const {
|
|
10409
|
+
type,
|
|
10410
|
+
name,
|
|
10411
|
+
placeholder,
|
|
10412
|
+
align,
|
|
10413
|
+
disabled,
|
|
10414
|
+
readOnly,
|
|
10415
|
+
maxLength,
|
|
10416
|
+
clearable,
|
|
10417
|
+
clearIcon,
|
|
10418
|
+
formatTrigger,
|
|
10419
|
+
autoFocus,
|
|
10581
10420
|
style,
|
|
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
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10421
|
+
className,
|
|
10422
|
+
onChange,
|
|
10423
|
+
onFocus,
|
|
10424
|
+
onBlur,
|
|
10425
|
+
onClear,
|
|
10426
|
+
formatter,
|
|
10427
|
+
onClick,
|
|
10428
|
+
confirmType,
|
|
10429
|
+
defaultValue,
|
|
10430
|
+
value: _value,
|
|
10431
|
+
...rest
|
|
10432
|
+
} = {
|
|
10433
|
+
...defaultProps$V,
|
|
10434
|
+
...props
|
|
10435
|
+
};
|
|
10436
|
+
const [value, setValue] = usePropsValue({
|
|
10437
|
+
value: props.value,
|
|
10438
|
+
defaultValue: props.defaultValue,
|
|
10439
|
+
finalValue: "",
|
|
10440
|
+
onChange
|
|
10441
|
+
});
|
|
10442
|
+
const inputRef = React.useRef(null);
|
|
10443
|
+
const [active, setActive] = React.useState(false);
|
|
10444
|
+
React.useImperativeHandle(ref, () => {
|
|
10445
|
+
return {
|
|
10446
|
+
clear: () => {
|
|
10447
|
+
setValue("");
|
|
10448
|
+
},
|
|
10449
|
+
focus: () => {
|
|
10450
|
+
var _a;
|
|
10451
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
10452
|
+
},
|
|
10453
|
+
blur: () => {
|
|
10454
|
+
var _a;
|
|
10455
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
10456
|
+
},
|
|
10457
|
+
get nativeElement() {
|
|
10458
|
+
return inputRef.current;
|
|
10459
|
+
}
|
|
10460
|
+
};
|
|
10461
|
+
});
|
|
10462
|
+
const inputClass = React.useCallback(() => {
|
|
10463
|
+
const classPrefix2 = "nut-input";
|
|
10464
|
+
return [classPrefix2, `${disabled ? `${classPrefix2}-disabled` : ""}`].filter(Boolean).join(" ");
|
|
10465
|
+
}, [disabled]);
|
|
10466
|
+
const [, updateState] = React.useState();
|
|
10467
|
+
const forceUpdate = React.useCallback(() => updateState({}), []);
|
|
10468
|
+
const updateValue = (value2, trigger = "onChange") => {
|
|
10469
|
+
let val = value2;
|
|
10470
|
+
if (Taro.getEnv() === Taro.ENV_TYPE.WEB) {
|
|
10471
|
+
if (type === "number") {
|
|
10472
|
+
val = formatNumber(val, false, true);
|
|
10473
|
+
}
|
|
10474
|
+
if (type === "digit") {
|
|
10475
|
+
val = formatNumber(val, true, true);
|
|
10476
|
+
}
|
|
10477
|
+
}
|
|
10478
|
+
if (formatter && trigger === formatTrigger) {
|
|
10479
|
+
val = formatter(val);
|
|
10480
|
+
}
|
|
10481
|
+
setValue(val);
|
|
10482
|
+
const eventHandler = props[trigger];
|
|
10483
|
+
if (eventHandler && typeof eventHandler === "function") {
|
|
10484
|
+
eventHandler(val);
|
|
10485
|
+
}
|
|
10486
|
+
forceUpdate();
|
|
10487
|
+
};
|
|
10488
|
+
const handleFocus = (event) => {
|
|
10489
|
+
const val = event.target.value;
|
|
10490
|
+
onFocus && onFocus(val);
|
|
10491
|
+
setActive(true);
|
|
10492
|
+
};
|
|
10493
|
+
const handleInput = (value2) => {
|
|
10494
|
+
updateValue(value2, "onChange");
|
|
10495
|
+
};
|
|
10496
|
+
const handleBlur = (event) => {
|
|
10497
|
+
const val = event.target.value;
|
|
10498
|
+
updateValue(val, "onBlur");
|
|
10499
|
+
setTimeout(() => {
|
|
10500
|
+
setActive(false);
|
|
10501
|
+
}, 50);
|
|
10502
|
+
};
|
|
10503
|
+
const inputType = (type2) => {
|
|
10504
|
+
if (Taro.getEnv() === Taro.ENV_TYPE.WEB) {
|
|
10505
|
+
if (type2 === "digit") {
|
|
10506
|
+
return "text";
|
|
10507
|
+
}
|
|
10508
|
+
if (type2 === "number") {
|
|
10509
|
+
return "tel";
|
|
10510
|
+
}
|
|
10511
|
+
} else if (type2 === "password") {
|
|
10512
|
+
return "text";
|
|
10513
|
+
}
|
|
10514
|
+
return type2;
|
|
10515
|
+
};
|
|
10516
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
10517
|
+
components.View,
|
|
10518
|
+
{
|
|
10519
|
+
className: `${inputClass()} ${className || ""}`,
|
|
10520
|
+
style,
|
|
10521
|
+
onClick: (e) => {
|
|
10522
|
+
onClick && onClick(e);
|
|
10523
|
+
},
|
|
10524
|
+
children: [
|
|
10525
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10526
|
+
components.Input,
|
|
10527
|
+
{
|
|
10528
|
+
...rest,
|
|
10529
|
+
name,
|
|
10530
|
+
className: "nut-input-native",
|
|
10531
|
+
ref: inputRef,
|
|
10532
|
+
style: { textAlign: align },
|
|
10533
|
+
type: inputType(type),
|
|
10534
|
+
password: type === "password",
|
|
10535
|
+
maxlength: maxLength,
|
|
10536
|
+
placeholder: placeholder || locale.placeholder,
|
|
10537
|
+
disabled: disabled || readOnly,
|
|
10538
|
+
value,
|
|
10539
|
+
focus: autoFocus,
|
|
10540
|
+
confirmType,
|
|
10541
|
+
onBlur: (e) => {
|
|
10542
|
+
handleBlur(e);
|
|
10543
|
+
},
|
|
10544
|
+
onFocus: (e) => {
|
|
10545
|
+
handleFocus(e);
|
|
10546
|
+
},
|
|
10547
|
+
onInput: (e) => {
|
|
10548
|
+
handleInput(e.currentTarget.value);
|
|
10710
10549
|
}
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
"/",
|
|
10716
|
-
maxlength
|
|
10717
|
-
] }) : null
|
|
10718
|
-
] }),
|
|
10719
|
-
errorMessage ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10720
|
-
"div",
|
|
10550
|
+
}
|
|
10551
|
+
),
|
|
10552
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10553
|
+
components.View,
|
|
10721
10554
|
{
|
|
10722
|
-
className: "nut-input-error-message",
|
|
10723
10555
|
style: {
|
|
10724
|
-
|
|
10556
|
+
display: clearable && !readOnly && active && value.length > 0 ? "flex" : "none",
|
|
10557
|
+
alignItems: "center"
|
|
10558
|
+
},
|
|
10559
|
+
onClick: (e) => {
|
|
10560
|
+
e.stopPropagation();
|
|
10561
|
+
if (!disabled) {
|
|
10562
|
+
setTimeout(() => {
|
|
10563
|
+
setValue("");
|
|
10564
|
+
onClear && onClear("");
|
|
10565
|
+
}, 50);
|
|
10566
|
+
}
|
|
10725
10567
|
},
|
|
10726
|
-
children:
|
|
10568
|
+
children: clearIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(r$c, { className: "nut-input-clear" })
|
|
10727
10569
|
}
|
|
10728
|
-
)
|
|
10729
|
-
]
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
Input.defaultProps = defaultProps$
|
|
10570
|
+
)
|
|
10571
|
+
]
|
|
10572
|
+
}
|
|
10573
|
+
);
|
|
10574
|
+
}
|
|
10575
|
+
);
|
|
10576
|
+
Input.defaultProps = defaultProps$V;
|
|
10735
10577
|
Input.displayName = "NutInput";
|
|
10736
|
-
const defaultProps$
|
|
10578
|
+
const defaultProps$U = {
|
|
10737
10579
|
...ComponentDefaults,
|
|
10738
10580
|
disabled: false,
|
|
10739
10581
|
min: 1,
|
|
@@ -10745,7 +10587,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10745
10587
|
digits: 0,
|
|
10746
10588
|
async: false
|
|
10747
10589
|
};
|
|
10748
|
-
const classPrefix$
|
|
10590
|
+
const classPrefix$3 = `nut-inputnumber`;
|
|
10749
10591
|
const InputNumber = (props) => {
|
|
10750
10592
|
const {
|
|
10751
10593
|
children,
|
|
@@ -10770,7 +10612,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10770
10612
|
onChange,
|
|
10771
10613
|
...restProps
|
|
10772
10614
|
} = {
|
|
10773
|
-
...defaultProps$
|
|
10615
|
+
...defaultProps$U,
|
|
10774
10616
|
...props
|
|
10775
10617
|
};
|
|
10776
10618
|
const inputRef = React.useRef("");
|
|
@@ -10788,8 +10630,8 @@ var __publicField = (obj, key, value) => {
|
|
|
10788
10630
|
}, []);
|
|
10789
10631
|
const classes = classNames(
|
|
10790
10632
|
{
|
|
10791
|
-
[`${classPrefix$
|
|
10792
|
-
[`${classPrefix$
|
|
10633
|
+
[`${classPrefix$3}`]: true,
|
|
10634
|
+
[`${classPrefix$3}--disabled`]: disabled
|
|
10793
10635
|
},
|
|
10794
10636
|
className
|
|
10795
10637
|
);
|
|
@@ -10961,9 +10803,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10961
10803
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-input-add", children: /* @__PURE__ */ jsxRuntimeExports.jsx(a$8, { className: iconAddClasses, onClick: addNumber }) })
|
|
10962
10804
|
] });
|
|
10963
10805
|
};
|
|
10964
|
-
InputNumber.defaultProps = defaultProps$
|
|
10806
|
+
InputNumber.defaultProps = defaultProps$U;
|
|
10965
10807
|
InputNumber.displayName = "NutInputNumber";
|
|
10966
|
-
const defaultProps$
|
|
10808
|
+
const defaultProps$T = {
|
|
10967
10809
|
...ComponentDefaults,
|
|
10968
10810
|
activeColor: "",
|
|
10969
10811
|
closeOnClickOverlay: true,
|
|
@@ -10982,7 +10824,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10982
10824
|
activeColor,
|
|
10983
10825
|
...rest
|
|
10984
10826
|
} = {
|
|
10985
|
-
...defaultProps$
|
|
10827
|
+
...defaultProps$T,
|
|
10986
10828
|
...props
|
|
10987
10829
|
};
|
|
10988
10830
|
const menuRef = React.useRef(null);
|
|
@@ -11106,9 +10948,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11106
10948
|
}
|
|
11107
10949
|
);
|
|
11108
10950
|
};
|
|
11109
|
-
Menu.defaultProps = defaultProps$
|
|
10951
|
+
Menu.defaultProps = defaultProps$T;
|
|
11110
10952
|
Menu.displayName = "NutMenu";
|
|
11111
|
-
const defaultProps$
|
|
10953
|
+
const defaultProps$S = {
|
|
11112
10954
|
...ComponentDefaults,
|
|
11113
10955
|
columns: 1,
|
|
11114
10956
|
direction: "down",
|
|
@@ -11138,7 +10980,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11138
10980
|
parent,
|
|
11139
10981
|
index
|
|
11140
10982
|
} = {
|
|
11141
|
-
...defaultProps$
|
|
10983
|
+
...defaultProps$S,
|
|
11142
10984
|
...props
|
|
11143
10985
|
};
|
|
11144
10986
|
const [_showPopup, setShowPopup] = React.useState(show);
|
|
@@ -11296,9 +11138,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11296
11138
|
)
|
|
11297
11139
|
] });
|
|
11298
11140
|
});
|
|
11299
|
-
MenuItem.defaultProps = defaultProps$
|
|
11141
|
+
MenuItem.defaultProps = defaultProps$S;
|
|
11300
11142
|
MenuItem.displayName = "NutMenuItem";
|
|
11301
|
-
const defaultProps$
|
|
11143
|
+
const defaultProps$R = {
|
|
11302
11144
|
confirmText: "",
|
|
11303
11145
|
title: "",
|
|
11304
11146
|
visible: false,
|
|
@@ -11530,14 +11372,14 @@ var __publicField = (obj, key, value) => {
|
|
|
11530
11372
|
}
|
|
11531
11373
|
) });
|
|
11532
11374
|
};
|
|
11533
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
11375
|
+
NumberKeyboard.defaultProps = defaultProps$R;
|
|
11534
11376
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
11535
11377
|
const radioContext = {
|
|
11536
11378
|
onChange: (val) => {
|
|
11537
11379
|
}
|
|
11538
11380
|
};
|
|
11539
11381
|
const RadioContext = React.createContext(radioContext);
|
|
11540
|
-
const defaultProps$
|
|
11382
|
+
const defaultProps$Q = {
|
|
11541
11383
|
value: null,
|
|
11542
11384
|
textPosition: "right",
|
|
11543
11385
|
onChange: (value) => {
|
|
@@ -11547,7 +11389,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11547
11389
|
};
|
|
11548
11390
|
const RadioGroup = React.forwardRef(
|
|
11549
11391
|
(props, ref) => {
|
|
11550
|
-
const { children } = { ...defaultProps$
|
|
11392
|
+
const { children } = { ...defaultProps$Q, ...props };
|
|
11551
11393
|
cn("RadioGroup");
|
|
11552
11394
|
const {
|
|
11553
11395
|
className,
|
|
@@ -11624,9 +11466,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11624
11466
|
);
|
|
11625
11467
|
}
|
|
11626
11468
|
);
|
|
11627
|
-
RadioGroup.defaultProps = defaultProps$
|
|
11469
|
+
RadioGroup.defaultProps = defaultProps$Q;
|
|
11628
11470
|
RadioGroup.displayName = "NutRadioGroup";
|
|
11629
|
-
const defaultProps$
|
|
11471
|
+
const defaultProps$P = {
|
|
11630
11472
|
...ComponentDefaults,
|
|
11631
11473
|
className: "",
|
|
11632
11474
|
style: {},
|
|
@@ -11643,7 +11485,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11643
11485
|
};
|
|
11644
11486
|
const Radio = (props) => {
|
|
11645
11487
|
const { children } = {
|
|
11646
|
-
...defaultProps$
|
|
11488
|
+
...defaultProps$P,
|
|
11647
11489
|
...props
|
|
11648
11490
|
};
|
|
11649
11491
|
const {
|
|
@@ -11736,10 +11578,10 @@ var __publicField = (obj, key, value) => {
|
|
|
11736
11578
|
}
|
|
11737
11579
|
);
|
|
11738
11580
|
};
|
|
11739
|
-
Radio.defaultProps = defaultProps$
|
|
11581
|
+
Radio.defaultProps = defaultProps$P;
|
|
11740
11582
|
Radio.displayName = "NutRadio";
|
|
11741
11583
|
Radio.RadioGroup = RadioGroup;
|
|
11742
|
-
const defaultProps$
|
|
11584
|
+
const defaultProps$O = {
|
|
11743
11585
|
id: "",
|
|
11744
11586
|
style: {},
|
|
11745
11587
|
icon: null,
|
|
@@ -11794,7 +11636,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11794
11636
|
visible,
|
|
11795
11637
|
onClose,
|
|
11796
11638
|
...rest
|
|
11797
|
-
} = { ...defaultProps$
|
|
11639
|
+
} = { ...defaultProps$O, ...props };
|
|
11798
11640
|
let timer;
|
|
11799
11641
|
const [openState, SetOpenState] = React.useState(false);
|
|
11800
11642
|
React.useEffect(() => {
|
|
@@ -11885,9 +11727,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11885
11727
|
}
|
|
11886
11728
|
) : null });
|
|
11887
11729
|
};
|
|
11888
|
-
Toast.defaultProps = defaultProps$
|
|
11730
|
+
Toast.defaultProps = defaultProps$O;
|
|
11889
11731
|
Toast.displayName = "NutToast";
|
|
11890
|
-
const defaultProps$
|
|
11732
|
+
const defaultProps$N = {
|
|
11891
11733
|
range: false,
|
|
11892
11734
|
hiddenRange: false,
|
|
11893
11735
|
hiddenTag: false,
|
|
@@ -11923,8 +11765,8 @@ var __publicField = (obj, key, value) => {
|
|
|
11923
11765
|
minDesc,
|
|
11924
11766
|
maxDesc,
|
|
11925
11767
|
curValueDesc
|
|
11926
|
-
} = { ...defaultProps$
|
|
11927
|
-
let { min, max, step } = { ...defaultProps$
|
|
11768
|
+
} = { ...defaultProps$N, ...props };
|
|
11769
|
+
let { min, max, step } = { ...defaultProps$N, ...props };
|
|
11928
11770
|
min = Number(min);
|
|
11929
11771
|
max = Number(max);
|
|
11930
11772
|
step = Number(step);
|
|
@@ -12280,9 +12122,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12280
12122
|
)
|
|
12281
12123
|
] });
|
|
12282
12124
|
};
|
|
12283
|
-
Range.defaultProps = defaultProps$
|
|
12125
|
+
Range.defaultProps = defaultProps$N;
|
|
12284
12126
|
Range.displayName = "NutRange";
|
|
12285
|
-
const defaultProps$
|
|
12127
|
+
const defaultProps$M = {
|
|
12286
12128
|
...ComponentDefaults,
|
|
12287
12129
|
count: 5,
|
|
12288
12130
|
min: 0,
|
|
@@ -12307,7 +12149,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12307
12149
|
allowHalf,
|
|
12308
12150
|
onChange
|
|
12309
12151
|
} = {
|
|
12310
|
-
...defaultProps$
|
|
12152
|
+
...defaultProps$M,
|
|
12311
12153
|
...props
|
|
12312
12154
|
};
|
|
12313
12155
|
const classPrefix2 = "nut-rate";
|
|
@@ -12392,9 +12234,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12392
12234
|
}
|
|
12393
12235
|
);
|
|
12394
12236
|
};
|
|
12395
|
-
Rate.defaultProps = defaultProps$
|
|
12237
|
+
Rate.defaultProps = defaultProps$M;
|
|
12396
12238
|
Rate.displayName = "NutRate";
|
|
12397
|
-
const defaultProps$
|
|
12239
|
+
const defaultProps$L = {
|
|
12398
12240
|
...ComponentDefaults,
|
|
12399
12241
|
placeholder: "",
|
|
12400
12242
|
shape: "square",
|
|
@@ -12442,7 +12284,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12442
12284
|
onClickRightinIcon,
|
|
12443
12285
|
onClickRightoutIcon
|
|
12444
12286
|
} = {
|
|
12445
|
-
...defaultProps$
|
|
12287
|
+
...defaultProps$L,
|
|
12446
12288
|
...props
|
|
12447
12289
|
};
|
|
12448
12290
|
const alignClass = `${align}`;
|
|
@@ -12628,9 +12470,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12628
12470
|
}
|
|
12629
12471
|
);
|
|
12630
12472
|
};
|
|
12631
|
-
SearchBar.defaultProps = defaultProps$
|
|
12473
|
+
SearchBar.defaultProps = defaultProps$L;
|
|
12632
12474
|
SearchBar.displayName = "NutSearchBar";
|
|
12633
|
-
const defaultProps$
|
|
12475
|
+
const defaultProps$K = {
|
|
12634
12476
|
...ComponentDefaults,
|
|
12635
12477
|
title: "",
|
|
12636
12478
|
description: "",
|
|
@@ -12793,9 +12635,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12793
12635
|
}
|
|
12794
12636
|
) });
|
|
12795
12637
|
};
|
|
12796
|
-
ShortPassword.defaultProps = defaultProps$
|
|
12638
|
+
ShortPassword.defaultProps = defaultProps$K;
|
|
12797
12639
|
ShortPassword.displayName = "NutShortPassword";
|
|
12798
|
-
const defaultProps$
|
|
12640
|
+
const defaultProps$J = {
|
|
12799
12641
|
canvasId: "spcanvas",
|
|
12800
12642
|
type: "png",
|
|
12801
12643
|
lineWidth: 2,
|
|
@@ -12817,7 +12659,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12817
12659
|
onClear,
|
|
12818
12660
|
...rest
|
|
12819
12661
|
} = {
|
|
12820
|
-
...defaultProps$
|
|
12662
|
+
...defaultProps$J,
|
|
12821
12663
|
...props
|
|
12822
12664
|
};
|
|
12823
12665
|
const b2 = cn("signature");
|
|
@@ -12981,9 +12823,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12981
12823
|
)
|
|
12982
12824
|
] });
|
|
12983
12825
|
};
|
|
12984
|
-
Signature.defaultProps = defaultProps$
|
|
12826
|
+
Signature.defaultProps = defaultProps$J;
|
|
12985
12827
|
Signature.displayName = "NutSignature";
|
|
12986
|
-
const defaultProps$
|
|
12828
|
+
const defaultProps$I = {
|
|
12987
12829
|
...ComponentDefaults,
|
|
12988
12830
|
disabled: false,
|
|
12989
12831
|
activeText: "",
|
|
@@ -13000,7 +12842,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13000
12842
|
style,
|
|
13001
12843
|
onChange
|
|
13002
12844
|
} = {
|
|
13003
|
-
...defaultProps$
|
|
12845
|
+
...defaultProps$I,
|
|
13004
12846
|
...props
|
|
13005
12847
|
};
|
|
13006
12848
|
const classPrefix2 = "nut-switch";
|
|
@@ -13022,9 +12864,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13022
12864
|
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 }) })
|
|
13023
12865
|
] }) });
|
|
13024
12866
|
};
|
|
13025
|
-
Switch.defaultProps = defaultProps$
|
|
12867
|
+
Switch.defaultProps = defaultProps$I;
|
|
13026
12868
|
Switch.displayName = "NutSwitch";
|
|
13027
|
-
const defaultProps$
|
|
12869
|
+
const defaultProps$H = {
|
|
13028
12870
|
defaultValue: "",
|
|
13029
12871
|
textAlign: "left",
|
|
13030
12872
|
limitshow: false,
|
|
@@ -13052,7 +12894,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13052
12894
|
onChange,
|
|
13053
12895
|
onBlur,
|
|
13054
12896
|
onFocus
|
|
13055
|
-
} = { ...defaultProps$
|
|
12897
|
+
} = { ...defaultProps$H, ...props };
|
|
13056
12898
|
const textareaBem = cn("textarea");
|
|
13057
12899
|
const [inputValue, SetInputValue] = React.useState("");
|
|
13058
12900
|
const compositingRef = React.useRef(false);
|
|
@@ -13147,9 +12989,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13147
12989
|
}
|
|
13148
12990
|
);
|
|
13149
12991
|
};
|
|
13150
|
-
TextArea.defaultProps = defaultProps$
|
|
12992
|
+
TextArea.defaultProps = defaultProps$H;
|
|
13151
12993
|
TextArea.displayName = "NutTextArea";
|
|
13152
|
-
const defaultProps$
|
|
12994
|
+
const defaultProps$G = {
|
|
13153
12995
|
...ComponentDefaults,
|
|
13154
12996
|
percent: 0,
|
|
13155
12997
|
showText: false,
|
|
@@ -13168,7 +13010,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13168
13010
|
children,
|
|
13169
13011
|
...rest
|
|
13170
13012
|
} = {
|
|
13171
|
-
...defaultProps$
|
|
13013
|
+
...defaultProps$G,
|
|
13172
13014
|
...props
|
|
13173
13015
|
};
|
|
13174
13016
|
const classPrefix2 = "nut-progress";
|
|
@@ -13205,7 +13047,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13205
13047
|
}
|
|
13206
13048
|
) }) }) });
|
|
13207
13049
|
};
|
|
13208
|
-
Progress.defaultProps = defaultProps$
|
|
13050
|
+
Progress.defaultProps = defaultProps$G;
|
|
13209
13051
|
Progress.displayName = "NutProgress";
|
|
13210
13052
|
class UploadOptions {
|
|
13211
13053
|
constructor() {
|
|
@@ -13350,7 +13192,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13350
13192
|
done();
|
|
13351
13193
|
}
|
|
13352
13194
|
};
|
|
13353
|
-
const defaultProps$
|
|
13195
|
+
const defaultProps$F = {
|
|
13354
13196
|
...ComponentDefaults,
|
|
13355
13197
|
url: "",
|
|
13356
13198
|
maxCount: 1,
|
|
@@ -13438,7 +13280,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13438
13280
|
beforeXhrUpload,
|
|
13439
13281
|
beforeDelete,
|
|
13440
13282
|
...restProps
|
|
13441
|
-
} = { ...defaultProps$
|
|
13283
|
+
} = { ...defaultProps$F, ...props };
|
|
13442
13284
|
const [fileList, setFileList] = React.useState(defaultValue || []);
|
|
13443
13285
|
const [uploadQueue, setUploadQueue] = React.useState([]);
|
|
13444
13286
|
React.useEffect(() => {
|
|
@@ -13801,9 +13643,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13801
13643
|
] });
|
|
13802
13644
|
};
|
|
13803
13645
|
const Uploader = React.forwardRef(InternalUploader);
|
|
13804
|
-
Uploader.defaultProps = defaultProps$
|
|
13646
|
+
Uploader.defaultProps = defaultProps$F;
|
|
13805
13647
|
Uploader.displayName = "NutUploader";
|
|
13806
|
-
const defaultProps$
|
|
13648
|
+
const defaultProps$E = {
|
|
13807
13649
|
cancelText: "",
|
|
13808
13650
|
optionTag: "name",
|
|
13809
13651
|
optionSubTag: "subname",
|
|
@@ -13837,7 +13679,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13837
13679
|
className,
|
|
13838
13680
|
style,
|
|
13839
13681
|
...rest
|
|
13840
|
-
} = { ...defaultProps$
|
|
13682
|
+
} = { ...defaultProps$E, ...props };
|
|
13841
13683
|
const b2 = cn("actionsheet");
|
|
13842
13684
|
const isHighlight = (item) => {
|
|
13843
13685
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -13882,52 +13724,8 @@ var __publicField = (obj, key, value) => {
|
|
|
13882
13724
|
}
|
|
13883
13725
|
);
|
|
13884
13726
|
};
|
|
13885
|
-
ActionSheet.defaultProps = defaultProps$
|
|
13727
|
+
ActionSheet.defaultProps = defaultProps$E;
|
|
13886
13728
|
ActionSheet.displayName = "NutActionSheet";
|
|
13887
|
-
const defaultProps$E = {
|
|
13888
|
-
...ComponentDefaults,
|
|
13889
|
-
value: "",
|
|
13890
|
-
dot: false,
|
|
13891
|
-
max: 99,
|
|
13892
|
-
top: "0",
|
|
13893
|
-
right: "5",
|
|
13894
|
-
color: ""
|
|
13895
|
-
};
|
|
13896
|
-
const Badge = (props) => {
|
|
13897
|
-
const { className, style, value, max, children, dot, top, right, color } = {
|
|
13898
|
-
...defaultProps$E,
|
|
13899
|
-
...props
|
|
13900
|
-
};
|
|
13901
|
-
const classPrefix2 = "nut-badge";
|
|
13902
|
-
const classes = classNames(classPrefix2, className);
|
|
13903
|
-
const contentClasses = classNames(
|
|
13904
|
-
{ [`${classPrefix2}__dot`]: dot },
|
|
13905
|
-
`${classPrefix2}__content`,
|
|
13906
|
-
`${classPrefix2}__sup`
|
|
13907
|
-
);
|
|
13908
|
-
function content() {
|
|
13909
|
-
if (dot || typeof value === "object")
|
|
13910
|
-
return null;
|
|
13911
|
-
if (typeof value === "number" && typeof max === "number") {
|
|
13912
|
-
return max < value ? `${max}+` : value;
|
|
13913
|
-
}
|
|
13914
|
-
return value;
|
|
13915
|
-
}
|
|
13916
|
-
const getStyle = () => {
|
|
13917
|
-
const style2 = {};
|
|
13918
|
-
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
13919
|
-
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
13920
|
-
style2.background = color;
|
|
13921
|
-
return style2;
|
|
13922
|
-
};
|
|
13923
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style, children: [
|
|
13924
|
-
typeof value === "object" && value && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__icon`, children: value }),
|
|
13925
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
|
|
13926
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
13927
|
-
] });
|
|
13928
|
-
};
|
|
13929
|
-
Badge.defaultProps = defaultProps$E;
|
|
13930
|
-
Badge.displayName = "NutBadge";
|
|
13931
13729
|
const Content = (props) => {
|
|
13932
13730
|
const { visible, title, footer, footerDirection, onClick, children } = props;
|
|
13933
13731
|
const classPrefix2 = "nut-dialog";
|
|
@@ -20318,7 +20116,7 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20318
20116
|
onClick: (event) => {
|
|
20319
20117
|
}
|
|
20320
20118
|
};
|
|
20321
|
-
const classPrefix$
|
|
20119
|
+
const classPrefix$2 = `nut-animate`;
|
|
20322
20120
|
const Animate = (props) => {
|
|
20323
20121
|
const { className, type, action, loop: loop2, onClick, children, ...rest } = {
|
|
20324
20122
|
...defaultProps$s,
|
|
@@ -20327,7 +20125,7 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20327
20125
|
const [clicked, setClicked] = React.useState(false);
|
|
20328
20126
|
const classes = classNames({
|
|
20329
20127
|
"nut-ani-container": true,
|
|
20330
|
-
[`${classPrefix$
|
|
20128
|
+
[`${classPrefix$2}-${type}`]: action === "initial" || clicked ? type : false,
|
|
20331
20129
|
loop: loop2
|
|
20332
20130
|
});
|
|
20333
20131
|
const cls = classNames(classes, className);
|
|
@@ -20683,22 +20481,24 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20683
20481
|
AvatarGroup.defaultProps = defaultProps$o;
|
|
20684
20482
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
20685
20483
|
const defaultProps$n = {
|
|
20484
|
+
...ComponentDefaults,
|
|
20686
20485
|
strokeWidth: 5,
|
|
20687
20486
|
radius: 50,
|
|
20688
20487
|
strokeLinecap: "round",
|
|
20689
|
-
|
|
20690
|
-
|
|
20488
|
+
color: "#fa2c19",
|
|
20489
|
+
background: "#e5e9f2",
|
|
20691
20490
|
clockwise: true
|
|
20692
20491
|
};
|
|
20492
|
+
const classPrefix$1 = `nut-circleprogress`;
|
|
20693
20493
|
const CircleProgress = (props) => {
|
|
20694
20494
|
const {
|
|
20695
20495
|
children,
|
|
20696
|
-
|
|
20496
|
+
percent,
|
|
20697
20497
|
className,
|
|
20698
20498
|
radius,
|
|
20699
|
-
|
|
20499
|
+
background,
|
|
20700
20500
|
clockwise,
|
|
20701
|
-
|
|
20501
|
+
color,
|
|
20702
20502
|
strokeWidth,
|
|
20703
20503
|
style,
|
|
20704
20504
|
strokeLinecap,
|
|
@@ -20707,45 +20507,39 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20707
20507
|
...defaultProps$n,
|
|
20708
20508
|
...props
|
|
20709
20509
|
};
|
|
20710
|
-
const [oldValue, setOldValue] = React.useState(
|
|
20711
|
-
const
|
|
20712
|
-
const classes = classNames(className, b2(""));
|
|
20510
|
+
const [oldValue, setOldValue] = React.useState(percent);
|
|
20511
|
+
const classes = classNames(className, classPrefix$1);
|
|
20713
20512
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
20513
|
+
const animateIdRef = React.useRef(0);
|
|
20714
20514
|
const styles = {
|
|
20715
20515
|
height: `${Number(radius) * 2}px`,
|
|
20716
20516
|
width: `${Number(radius) * 2}px`,
|
|
20717
20517
|
...style
|
|
20718
20518
|
};
|
|
20719
20519
|
React.useEffect(() => {
|
|
20720
|
-
let rafId;
|
|
20721
20520
|
const startTime = Date.now();
|
|
20722
20521
|
const startRate = Number(oldValue);
|
|
20723
|
-
const endRate = Number(
|
|
20522
|
+
const endRate = Number(percent);
|
|
20724
20523
|
const duration = Math.abs((startRate - endRate) * 1e3 / 100);
|
|
20725
20524
|
const animate = () => {
|
|
20726
20525
|
const now = Date.now();
|
|
20727
|
-
const
|
|
20728
|
-
const rate =
|
|
20526
|
+
const progress = Math.min((now - startTime) / duration, 1);
|
|
20527
|
+
const rate = progress * (endRate - startRate) + startRate;
|
|
20729
20528
|
setOldValue(Math.min(Math.max(+rate, 0), 100));
|
|
20730
20529
|
if (endRate > startRate ? rate < endRate : rate > endRate) {
|
|
20731
|
-
|
|
20530
|
+
animateIdRef.current = window.requestAnimationFrame(animate);
|
|
20732
20531
|
}
|
|
20733
20532
|
};
|
|
20734
|
-
|
|
20735
|
-
|
|
20736
|
-
|
|
20737
|
-
rafId = window.requestAnimationFrame(animate);
|
|
20738
|
-
}, [progress]);
|
|
20739
|
-
const cancelAnimationFrame2 = function(id) {
|
|
20740
|
-
clearTimeout(id);
|
|
20741
|
-
};
|
|
20533
|
+
animateIdRef.current = window.requestAnimationFrame(animate);
|
|
20534
|
+
return () => window.cancelAnimationFrame(animateIdRef.current);
|
|
20535
|
+
}, [percent]);
|
|
20742
20536
|
const stop2 = () => {
|
|
20743
|
-
if (!isObject(
|
|
20537
|
+
if (!isObject(props.color)) {
|
|
20744
20538
|
return [];
|
|
20745
20539
|
}
|
|
20746
|
-
const
|
|
20747
|
-
const colorArr = Object.keys(
|
|
20748
|
-
(a2,
|
|
20540
|
+
const color2 = props.color;
|
|
20541
|
+
const colorArr = Object.keys(color2).sort(
|
|
20542
|
+
(a2, b2) => parseFloat(a2) - parseFloat(b2)
|
|
20749
20543
|
);
|
|
20750
20544
|
const stopArr = [];
|
|
20751
20545
|
colorArr.map((item) => {
|
|
@@ -20754,15 +20548,15 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20754
20548
|
value: ""
|
|
20755
20549
|
};
|
|
20756
20550
|
obj.key = item;
|
|
20757
|
-
obj.value =
|
|
20551
|
+
obj.value = color2[item];
|
|
20758
20552
|
stopArr.push(obj);
|
|
20759
20553
|
});
|
|
20760
20554
|
return stopArr;
|
|
20761
20555
|
};
|
|
20762
|
-
const transColor = (
|
|
20763
|
-
return
|
|
20556
|
+
const transColor = (color2) => {
|
|
20557
|
+
return color2 && color2.replace("#", "%23");
|
|
20764
20558
|
};
|
|
20765
|
-
const format = (
|
|
20559
|
+
const format = (progress) => Math.min(Math.max(+progress, 0), 100);
|
|
20766
20560
|
const circleStyle = () => {
|
|
20767
20561
|
const stopArr = stop2();
|
|
20768
20562
|
const stopDom = [];
|
|
@@ -20776,17 +20570,17 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20776
20570
|
});
|
|
20777
20571
|
}
|
|
20778
20572
|
const perimeter = 283;
|
|
20779
|
-
const
|
|
20780
|
-
const offset = perimeter * Number(format(parseFloat(
|
|
20573
|
+
const progress = +oldValue;
|
|
20574
|
+
const offset = perimeter * Number(format(parseFloat(progress.toFixed(1)))) / 100;
|
|
20781
20575
|
const isWise = props.clockwise ? 1 : 0;
|
|
20782
|
-
const
|
|
20576
|
+
const color2 = isObject(props.color) ? `url(%23${refRandomId})` : transColor(props.color);
|
|
20783
20577
|
const d = `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
|
|
20784
20578
|
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`;
|
|
20785
20579
|
const path = `%3Cpath d='${d}' stroke-width='${strokeWidth}' stroke='${transColor(
|
|
20786
|
-
props.
|
|
20580
|
+
props.background
|
|
20787
20581
|
)}' fill='none'/%3E`;
|
|
20788
20582
|
const path1 = `%3Cpath d='${d}' stroke-width='${strokeWidth}' stroke-dasharray='${offset},${perimeter}' stroke-linecap='round' stroke='${transColor(
|
|
20789
|
-
|
|
20583
|
+
color2
|
|
20790
20584
|
)}' fill='none'/%3E`;
|
|
20791
20585
|
return {
|
|
20792
20586
|
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")`,
|
|
@@ -20796,10 +20590,7 @@ This message will only show in development mode. It won't appear in production.
|
|
|
20796
20590
|
};
|
|
20797
20591
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes, style: styles, ...restProps, children: [
|
|
20798
20592
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: circleStyle() }),
|
|
20799
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-circleprogress-text", children
|
|
20800
|
-
progress,
|
|
20801
|
-
"%"
|
|
20802
|
-
] }) })
|
|
20593
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-circleprogress-text", children })
|
|
20803
20594
|
] });
|
|
20804
20595
|
};
|
|
20805
20596
|
CircleProgress.defaultProps = defaultProps$n;
|