@nutui/nutui-react 1.2.3-beta.1 → 1.2.3-beta.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/dist/esm/CollapseItem.js +13 -12
- package/dist/esm/FixedNav.js +3 -3
- package/dist/esm/Infiniteloading.js +6 -5
- package/dist/esm/ShortPassword.js +22 -17
- 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/nutui.react.es.js +653 -428
- package/dist/nutui.react.umd.js +16708 -28
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +0 -1
- package/dist/types/actionsheet/demo.d.ts +1 -0
- package/dist/types/address/demo.d.ts +1 -0
- package/dist/types/animatingnumbers/demo.d.ts +1 -0
- package/dist/types/avatar/demo.d.ts +1 -0
- package/dist/types/backtop/demo.d.ts +1 -0
- package/dist/types/badge/demo.d.ts +1 -0
- package/dist/types/barrage/demo.d.ts +1 -0
- package/dist/types/button/demo.d.ts +1 -0
- package/dist/types/calendar/demo.d.ts +1 -0
- package/dist/types/card/demo.d.ts +1 -0
- package/dist/types/cell/demo.d.ts +1 -0
- package/dist/types/checkbox/demo.d.ts +1 -0
- package/dist/types/circleprogress/demo.d.ts +1 -0
- package/dist/types/collapse/demo.d.ts +1 -0
- package/dist/types/configprovider/demo.d.ts +1 -0
- package/dist/types/countdown/demo.d.ts +1 -0
- package/dist/types/datepicker/demo.d.ts +1 -0
- package/dist/types/dialog/Mask.d.ts +1 -0
- package/dist/types/dialog/demo.d.ts +1 -0
- package/dist/types/divider/demo.d.ts +1 -0
- package/dist/types/drag/demo.d.ts +1 -0
- package/dist/types/elevator/demo.d.ts +1 -0
- package/dist/types/empty/demo.d.ts +1 -0
- package/dist/types/fixednav/__tests__/fixednav.spec.d.ts +1 -0
- package/dist/types/fixednav/demo.d.ts +1 -0
- package/dist/types/icon/demo.d.ts +1 -0
- package/dist/types/indicator/demo.d.ts +1 -0
- package/dist/types/infiniteloading/demo.d.ts +1 -0
- package/dist/types/input/demo.d.ts +1 -0
- package/dist/types/inputnumber/demo.d.ts +1 -0
- package/dist/types/layout/demo.d.ts +1 -0
- package/dist/types/navbar/demo.d.ts +1 -0
- package/dist/types/noticebar/demo.d.ts +1 -0
- package/dist/types/notify/demo.d.ts +1 -0
- package/dist/types/numberkeyboard/demo.d.ts +1 -0
- package/dist/types/overlay/demo.d.ts +1 -0
- package/dist/types/pagination/demo.d.ts +1 -0
- package/dist/types/picker/demo.d.ts +1 -0
- package/dist/types/popover/demo.d.ts +1 -0
- package/dist/types/popup/demo.d.ts +1 -0
- package/dist/types/price/demo.d.ts +1 -0
- package/dist/types/progress/demo.d.ts +1 -0
- package/dist/types/radio/demo.d.ts +1 -0
- package/dist/types/range/demo.d.ts +1 -0
- package/dist/types/rate/demo.d.ts +1 -0
- package/dist/types/searchbar/demo.d.ts +1 -0
- package/dist/types/shortpassword/_test_/index.spec.d.ts +1 -0
- package/dist/types/shortpassword/demo.d.ts +1 -0
- package/dist/types/shortpassword/shortpassword.d.ts +3 -3
- package/dist/types/sidenavbar/demo.d.ts +1 -0
- package/dist/types/signature/demo.d.ts +1 -0
- package/dist/types/skeleton/demo.d.ts +1 -0
- package/dist/types/steps/demo.d.ts +1 -0
- package/dist/types/swiper/demo.d.ts +1 -0
- package/dist/types/switch/demo.d.ts +1 -0
- package/dist/types/tabbar/demo.d.ts +1 -0
- package/dist/types/table/demo.d.ts +1 -0
- package/dist/types/tabs/demo.d.ts +1 -0
- package/dist/types/tag/demo.d.ts +1 -0
- package/dist/types/textarea/demo.d.ts +1 -0
- package/dist/types/timedetail/demo.d.ts +1 -0
- package/dist/types/timepannel/demo.d.ts +1 -0
- package/dist/types/timeselect/__test__/timeselect.spec.d.ts +1 -0
- package/dist/types/timeselect/demo.d.ts +1 -0
- package/dist/types/toast/demo.d.ts +1 -0
- package/dist/types/uploader/demo.d.ts +1 -0
- package/dist/types/video/demo.d.ts +1 -0
- package/dist/types/virtuallist/demo.d.ts +1 -0
- package/package.json +12 -5
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.2.
|
|
2
|
+
* @nutui/nutui-react v1.2.3-beta.4 Fri Aug 19 2022 09:34:33 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useImperativeHandle, useLayoutEffect
|
|
7
|
+
import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useImperativeHandle, useLayoutEffect, forwardRef, useMemo, memo } from "react";
|
|
8
8
|
import * as ReactDOM from "react-dom";
|
|
9
9
|
import ReactDOM__default, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
10
10
|
var classname = { exports: {} };
|
|
@@ -89,21 +89,25 @@ const Icon = (props) => {
|
|
|
89
89
|
return { src: name };
|
|
90
90
|
return {};
|
|
91
91
|
};
|
|
92
|
-
return React__default.createElement(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
return React__default.createElement(
|
|
93
|
+
type,
|
|
94
|
+
{
|
|
95
|
+
className: isImage ? `${className || ""} ${b2("img")}` : `${className || ""} ${fontClassName} ${b2(null, [
|
|
96
|
+
classPrefix
|
|
97
|
+
])} nut-icon-${name} `,
|
|
98
|
+
style: {
|
|
99
|
+
color,
|
|
100
|
+
fontSize: pxCheck$2(size),
|
|
101
|
+
width: pxCheck$2(size),
|
|
102
|
+
height: pxCheck$2(size),
|
|
103
|
+
...style
|
|
104
|
+
},
|
|
105
|
+
...rest,
|
|
106
|
+
onClick: handleClick2,
|
|
107
|
+
...hasSrc()
|
|
102
108
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
...hasSrc()
|
|
106
|
-
}, children);
|
|
109
|
+
children
|
|
110
|
+
);
|
|
107
111
|
};
|
|
108
112
|
Icon.defaultProps = defaultProps$1a;
|
|
109
113
|
Icon.displayName = "NutIcon";
|
|
@@ -241,7 +245,9 @@ var factoryWithThrowingShims = function() {
|
|
|
241
245
|
if (secret === ReactPropTypesSecret) {
|
|
242
246
|
return;
|
|
243
247
|
}
|
|
244
|
-
var err = new Error(
|
|
248
|
+
var err = new Error(
|
|
249
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
250
|
+
);
|
|
245
251
|
err.name = "Invariant Violation";
|
|
246
252
|
throw err;
|
|
247
253
|
}
|
|
@@ -1490,7 +1496,10 @@ const Cell = (props) => {
|
|
|
1490
1496
|
flex: 1
|
|
1491
1497
|
};
|
|
1492
1498
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1493
|
-
className: `${b2(
|
|
1499
|
+
className: `${b2(
|
|
1500
|
+
{ clickable: !!(isLink || to2), center, large: size === "large" },
|
|
1501
|
+
[className]
|
|
1502
|
+
)} `,
|
|
1494
1503
|
onClick: (event) => handleClick2(event),
|
|
1495
1504
|
style: baseStyle,
|
|
1496
1505
|
...rest
|
|
@@ -1628,12 +1637,16 @@ const Overlay = (props) => {
|
|
|
1628
1637
|
};
|
|
1629
1638
|
}, []);
|
|
1630
1639
|
const b2 = cn("overlay");
|
|
1631
|
-
const classes = classNames(
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1640
|
+
const classes = classNames(
|
|
1641
|
+
{
|
|
1642
|
+
"overlay-fade-leave-active": !renderRef.current && !visible,
|
|
1643
|
+
"overlay-fade-enter-active": visible,
|
|
1644
|
+
"first-render": renderRef.current && !visible,
|
|
1645
|
+
"hidden-render": !visible
|
|
1646
|
+
},
|
|
1647
|
+
overlayClass,
|
|
1648
|
+
b2("")
|
|
1649
|
+
);
|
|
1637
1650
|
const styles = {
|
|
1638
1651
|
zIndex,
|
|
1639
1652
|
animationDuration: `${props.duration}s`,
|
|
@@ -1695,6 +1708,9 @@ var config$1 = {
|
|
|
1695
1708
|
disabled: false
|
|
1696
1709
|
};
|
|
1697
1710
|
var TransitionGroupContext = React__default.createContext(null);
|
|
1711
|
+
var forceReflow = function forceReflow2(node) {
|
|
1712
|
+
return node.scrollTop;
|
|
1713
|
+
};
|
|
1698
1714
|
var UNMOUNTED = "unmounted";
|
|
1699
1715
|
var EXITED = "exited";
|
|
1700
1716
|
var ENTERING = "entering";
|
|
@@ -1783,6 +1799,11 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1783
1799
|
if (nextStatus !== null) {
|
|
1784
1800
|
this.cancelNextCallback();
|
|
1785
1801
|
if (nextStatus === ENTERING) {
|
|
1802
|
+
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
1803
|
+
var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
|
|
1804
|
+
if (node)
|
|
1805
|
+
forceReflow(node);
|
|
1806
|
+
}
|
|
1786
1807
|
this.performEnter(mounting);
|
|
1787
1808
|
} else {
|
|
1788
1809
|
this.performExit();
|
|
@@ -2040,7 +2061,8 @@ var CSSTransition = /* @__PURE__ */ function(_React$Component) {
|
|
|
2040
2061
|
className += " " + doneClassName;
|
|
2041
2062
|
}
|
|
2042
2063
|
if (phase === "active") {
|
|
2043
|
-
|
|
2064
|
+
if (node)
|
|
2065
|
+
forceReflow(node);
|
|
2044
2066
|
}
|
|
2045
2067
|
if (className) {
|
|
2046
2068
|
this.appliedClasses[type][phase] = className;
|
|
@@ -2156,12 +2178,15 @@ const Popup = (props) => {
|
|
|
2156
2178
|
...style,
|
|
2157
2179
|
...baseStyle
|
|
2158
2180
|
};
|
|
2159
|
-
const classes = classNames(
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2181
|
+
const classes = classNames(
|
|
2182
|
+
{
|
|
2183
|
+
round,
|
|
2184
|
+
[`popup-${position}`]: true,
|
|
2185
|
+
[`${popClass}`]: true,
|
|
2186
|
+
[`${className}`]: true
|
|
2187
|
+
},
|
|
2188
|
+
b2("")
|
|
2189
|
+
);
|
|
2165
2190
|
const closeClasses = classNames({
|
|
2166
2191
|
"nutui-popup__close-icon": true,
|
|
2167
2192
|
[`nutui-popup__close-icon--${closeIconPosition}`]: true
|
|
@@ -2467,12 +2492,16 @@ const Row = (props) => {
|
|
|
2467
2492
|
};
|
|
2468
2493
|
return /* @__PURE__ */ React__default.createElement(DataContext$2.Provider, {
|
|
2469
2494
|
value: parentRow
|
|
2470
|
-
}, React__default.createElement(
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2495
|
+
}, React__default.createElement(
|
|
2496
|
+
"div",
|
|
2497
|
+
{
|
|
2498
|
+
className: getClasses(),
|
|
2499
|
+
onClick: (e2) => {
|
|
2500
|
+
onClick && onClick(e2, "row");
|
|
2501
|
+
}
|
|
2502
|
+
},
|
|
2503
|
+
children
|
|
2504
|
+
));
|
|
2476
2505
|
};
|
|
2477
2506
|
Row.defaultProps = defaultProps$12;
|
|
2478
2507
|
Row.displayName = "NutRow";
|
|
@@ -2618,8 +2647,8 @@ NavBar.defaultProps = defaultProps$10;
|
|
|
2618
2647
|
NavBar.displayName = "NutNavBar";
|
|
2619
2648
|
const defaultProps$$ = {
|
|
2620
2649
|
fixednavClass: "nut-fixednav",
|
|
2621
|
-
activeText: "
|
|
2622
|
-
unActiveText: "
|
|
2650
|
+
activeText: "",
|
|
2651
|
+
unActiveText: "",
|
|
2623
2652
|
type: "right",
|
|
2624
2653
|
position: {
|
|
2625
2654
|
top: "auto",
|
|
@@ -2644,9 +2673,14 @@ const FixedNav = (props) => {
|
|
|
2644
2673
|
...rest
|
|
2645
2674
|
} = { ...defaultProps$$, ...props };
|
|
2646
2675
|
const b2 = cn("fixednav");
|
|
2647
|
-
const classes = classNames(
|
|
2648
|
-
|
|
2649
|
-
|
|
2676
|
+
const classes = classNames(
|
|
2677
|
+
{
|
|
2678
|
+
active: visible
|
|
2679
|
+
},
|
|
2680
|
+
type,
|
|
2681
|
+
fixednavClass,
|
|
2682
|
+
b2("")
|
|
2683
|
+
);
|
|
2650
2684
|
const onSelectCb = (event, item) => {
|
|
2651
2685
|
onSelected(item, event);
|
|
2652
2686
|
};
|
|
@@ -2686,7 +2720,7 @@ const FixedNav = (props) => {
|
|
|
2686
2720
|
color: "#fff"
|
|
2687
2721
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
2688
2722
|
className: "text"
|
|
2689
|
-
}, visible ? locale.fixednav.activeText
|
|
2723
|
+
}, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
|
|
2690
2724
|
};
|
|
2691
2725
|
FixedNav.defaultProps = defaultProps$$;
|
|
2692
2726
|
FixedNav.displayName = "NutFixedNav";
|
|
@@ -2867,7 +2901,9 @@ const Elevator = (props) => {
|
|
|
2867
2901
|
y2: 0
|
|
2868
2902
|
});
|
|
2869
2903
|
const [scrollY, setScrollY] = useState(0);
|
|
2870
|
-
const [currentData, setCurrentData] = useState(
|
|
2904
|
+
const [currentData, setCurrentData] = useState(
|
|
2905
|
+
{}
|
|
2906
|
+
);
|
|
2871
2907
|
const [currentKey, setCurrentKey] = useState("");
|
|
2872
2908
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
2873
2909
|
const [codeIndex, setCodeIndex] = useState(0);
|
|
@@ -3247,11 +3283,14 @@ const Tabs = (props) => {
|
|
|
3247
3283
|
}, [children]);
|
|
3248
3284
|
const b2 = cn("tabs");
|
|
3249
3285
|
const classes = classNames(direction, b2(""), className);
|
|
3250
|
-
const classesTitle = classNames(
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3286
|
+
const classesTitle = classNames(
|
|
3287
|
+
{
|
|
3288
|
+
[type]: type,
|
|
3289
|
+
scrollable: titleScroll,
|
|
3290
|
+
[size]: size
|
|
3291
|
+
},
|
|
3292
|
+
`${b2("")}__titles`
|
|
3293
|
+
);
|
|
3255
3294
|
const titleStyle = {
|
|
3256
3295
|
marginLeft: pxCheck$1(titleGutter),
|
|
3257
3296
|
marginRight: pxCheck$1(titleGutter)
|
|
@@ -3283,10 +3322,13 @@ const Tabs = (props) => {
|
|
|
3283
3322
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3284
3323
|
style: titleStyle,
|
|
3285
3324
|
onClick: (e2) => tabChange(item),
|
|
3286
|
-
className: classNames(
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3325
|
+
className: classNames(
|
|
3326
|
+
{
|
|
3327
|
+
active: String(item.paneKey) === String(value),
|
|
3328
|
+
disabled: item.disabled
|
|
3329
|
+
},
|
|
3330
|
+
`${b2("")}__titles-item`
|
|
3331
|
+
),
|
|
3290
3332
|
key: item.paneKey
|
|
3291
3333
|
}, type === "line" && /* @__PURE__ */ React__default.createElement("div", {
|
|
3292
3334
|
className: `${b2("")}__titles-item__line`,
|
|
@@ -3298,9 +3340,12 @@ const Tabs = (props) => {
|
|
|
3298
3340
|
color,
|
|
3299
3341
|
name: "joy-smile"
|
|
3300
3342
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3301
|
-
className: classNames(
|
|
3302
|
-
|
|
3303
|
-
|
|
3343
|
+
className: classNames(
|
|
3344
|
+
{
|
|
3345
|
+
ellipsis: ellipsis && !titleScroll && direction === "horizontal"
|
|
3346
|
+
},
|
|
3347
|
+
`${b2("")}__titles-item__text`
|
|
3348
|
+
)
|
|
3304
3349
|
}, item.title));
|
|
3305
3350
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3306
3351
|
className: `${b2("")}__content`,
|
|
@@ -3337,9 +3382,13 @@ const TabPane = (props) => {
|
|
|
3337
3382
|
...props
|
|
3338
3383
|
};
|
|
3339
3384
|
const b2 = cn("tabpane");
|
|
3340
|
-
const classes = classNames(
|
|
3341
|
-
|
|
3342
|
-
|
|
3385
|
+
const classes = classNames(
|
|
3386
|
+
{
|
|
3387
|
+
active: paneKey === activeKey
|
|
3388
|
+
},
|
|
3389
|
+
b2(""),
|
|
3390
|
+
autoHeightClassName
|
|
3391
|
+
);
|
|
3343
3392
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3344
3393
|
className: classes
|
|
3345
3394
|
}, children);
|
|
@@ -3368,21 +3417,26 @@ const Indicator = (props) => {
|
|
|
3368
3417
|
...props
|
|
3369
3418
|
};
|
|
3370
3419
|
const b2 = cn("indicator");
|
|
3371
|
-
const classes = classNames(
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3420
|
+
const classes = classNames(
|
|
3421
|
+
{
|
|
3422
|
+
[`${b2("block")}`]: block,
|
|
3423
|
+
[`${b2("align")}__${align}`]: block && align,
|
|
3424
|
+
[`${b2("vertical")}`]: vertical
|
|
3425
|
+
},
|
|
3426
|
+
b2("")
|
|
3427
|
+
);
|
|
3376
3428
|
const renderEles = () => {
|
|
3377
3429
|
const childs = [];
|
|
3378
3430
|
for (let item = 1; item <= size; item++) {
|
|
3379
|
-
childs.push(
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3431
|
+
childs.push(
|
|
3432
|
+
item === current ? /* @__PURE__ */ React__default.createElement("div", {
|
|
3433
|
+
key: item,
|
|
3434
|
+
className: b2("number")
|
|
3435
|
+
}, fillZero && item < 10 ? `0${item}` : item) : /* @__PURE__ */ React__default.createElement("div", {
|
|
3436
|
+
key: item,
|
|
3437
|
+
className: b2("dot")
|
|
3438
|
+
})
|
|
3439
|
+
);
|
|
3386
3440
|
}
|
|
3387
3441
|
return childs;
|
|
3388
3442
|
};
|
|
@@ -3468,27 +3522,32 @@ const SubSideNavBar = (props) => {
|
|
|
3468
3522
|
const offset = useContext$1(OffsetContext);
|
|
3469
3523
|
console.log("offset>>>>>>>", offset);
|
|
3470
3524
|
const listRef = useRef(null);
|
|
3471
|
-
const setListLevel = useCallback(
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
const childNodes = nodeList[1] && nodeList[1].children && Array.from(nodeList[1].children).filter((item) => item.nodeType !== 3 && item.nodeType !== 8);
|
|
3478
|
-
childNodes.forEach((item) => {
|
|
3479
|
-
const itemClass = item.className;
|
|
3480
|
-
if (itemClass.includes("nut-subsidenavbar__item")) {
|
|
3481
|
-
const left = offset * (level + 2);
|
|
3482
|
-
item.style.paddingLeft = `${left}px`;
|
|
3483
|
-
}
|
|
3484
|
-
if (itemClass.includes("nut-subsidenavbar__list")) {
|
|
3485
|
-
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
3486
|
-
level2 += 1;
|
|
3487
|
-
item.setAttribute("level", level2.toString());
|
|
3488
|
-
item.children && setListLevel(item.children, level2);
|
|
3525
|
+
const setListLevel = useCallback(
|
|
3526
|
+
(nodeList, level = 1) => {
|
|
3527
|
+
const titleClass = nodeList[0].className;
|
|
3528
|
+
if (titleClass.includes("nut-subsidenavbar__title")) {
|
|
3529
|
+
const left = offset * (level + 1);
|
|
3530
|
+
nodeList[0].style.paddingLeft = `${left}px`;
|
|
3489
3531
|
}
|
|
3490
|
-
|
|
3491
|
-
|
|
3532
|
+
const childNodes = nodeList[1] && nodeList[1].children && Array.from(nodeList[1].children).filter(
|
|
3533
|
+
(item) => item.nodeType !== 3 && item.nodeType !== 8
|
|
3534
|
+
);
|
|
3535
|
+
childNodes.forEach((item) => {
|
|
3536
|
+
const itemClass = item.className;
|
|
3537
|
+
if (itemClass.includes("nut-subsidenavbar__item")) {
|
|
3538
|
+
const left = offset * (level + 2);
|
|
3539
|
+
item.style.paddingLeft = `${left}px`;
|
|
3540
|
+
}
|
|
3541
|
+
if (itemClass.includes("nut-subsidenavbar__list")) {
|
|
3542
|
+
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
3543
|
+
level2 += 1;
|
|
3544
|
+
item.setAttribute("level", level2.toString());
|
|
3545
|
+
item.children && setListLevel(item.children, level2);
|
|
3546
|
+
}
|
|
3547
|
+
});
|
|
3548
|
+
},
|
|
3549
|
+
[offset]
|
|
3550
|
+
);
|
|
3492
3551
|
const clickFn = (e2) => {
|
|
3493
3552
|
handleClick(e2);
|
|
3494
3553
|
const currentClass = e2.currentTarget.className;
|
|
@@ -3887,23 +3946,26 @@ const Range = (props) => {
|
|
|
3887
3946
|
const prefixCls = "nut-range-container";
|
|
3888
3947
|
return [prefixCls, `${vertical ? `${prefixCls}-vertical` : ""}`, className].filter(Boolean).join(" ");
|
|
3889
3948
|
}, [vertical, className]);
|
|
3890
|
-
const markClassName = useCallback(
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3949
|
+
const markClassName = useCallback(
|
|
3950
|
+
(mark) => {
|
|
3951
|
+
const classPrefix = "nut-range-mark";
|
|
3952
|
+
let lowerBound = Number(min);
|
|
3953
|
+
let upperBound = Number(max);
|
|
3954
|
+
if (range) {
|
|
3955
|
+
const [left, right] = modelValue;
|
|
3956
|
+
lowerBound = left;
|
|
3957
|
+
upperBound = right;
|
|
3958
|
+
} else {
|
|
3959
|
+
upperBound = modelValue;
|
|
3960
|
+
}
|
|
3961
|
+
const isActive = mark <= upperBound && mark >= lowerBound;
|
|
3962
|
+
return [
|
|
3963
|
+
`${classPrefix}-text`,
|
|
3964
|
+
`${isActive ? `${classPrefix}-text-active` : ""}`
|
|
3965
|
+
].filter(Boolean).join(" ");
|
|
3966
|
+
},
|
|
3967
|
+
[range, modelValue, min, max]
|
|
3968
|
+
);
|
|
3907
3969
|
const [rangeName, setRangeName] = useState(classes());
|
|
3908
3970
|
const [containerName, setContainerName] = useState(containerClasses());
|
|
3909
3971
|
useEffect(() => {
|
|
@@ -4330,10 +4392,13 @@ const CalendarItem = (props) => {
|
|
|
4330
4392
|
const months = useRef(null);
|
|
4331
4393
|
const monthsPanel = useRef(null);
|
|
4332
4394
|
const b2 = cn("calendar");
|
|
4333
|
-
const classes = classNames(
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4395
|
+
const classes = classNames(
|
|
4396
|
+
{
|
|
4397
|
+
[`${b2("")}-tile`]: !poppable,
|
|
4398
|
+
[`${b2("")}-nofooter`]: !!isAutoBackFill
|
|
4399
|
+
},
|
|
4400
|
+
b2("")
|
|
4401
|
+
);
|
|
4337
4402
|
const headerClasses = classNames({
|
|
4338
4403
|
[`${b2("")}-header`]: true,
|
|
4339
4404
|
[`${b2("")}-header-tile`]: !poppable
|
|
@@ -4352,7 +4417,11 @@ const CalendarItem = (props) => {
|
|
|
4352
4417
|
return Utils.isEqual(state.currDate[1], currDate);
|
|
4353
4418
|
};
|
|
4354
4419
|
const getCurrDate = (day, month, isRange) => {
|
|
4355
|
-
return isRange ? `${month.curData[3]}-${month.curData[4]}-${Utils.getNumTwoBit(
|
|
4420
|
+
return isRange ? `${month.curData[3]}-${month.curData[4]}-${Utils.getNumTwoBit(
|
|
4421
|
+
+day.day
|
|
4422
|
+
)}` : `${month.curData[0]}-${month.curData[1]}-${Utils.getNumTwoBit(
|
|
4423
|
+
+day.day
|
|
4424
|
+
)}`;
|
|
4356
4425
|
};
|
|
4357
4426
|
const getClass = (day, month, isRange) => {
|
|
4358
4427
|
const currDate = getCurrDate(day, month, isRange);
|
|
@@ -4473,10 +4542,19 @@ const CalendarItem = (props) => {
|
|
|
4473
4542
|
]
|
|
4474
4543
|
};
|
|
4475
4544
|
if (type2 == "next") {
|
|
4476
|
-
if (!state.endData || !Utils.compareDate(
|
|
4545
|
+
if (!state.endData || !Utils.compareDate(
|
|
4546
|
+
`${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(
|
|
4547
|
+
state.endData[0],
|
|
4548
|
+
state.endData[1]
|
|
4549
|
+
)}`,
|
|
4550
|
+
`${curData[0]}-${curData[1]}-${curData[2]}`
|
|
4551
|
+
)) {
|
|
4477
4552
|
state.monthsData.push(monthInfo);
|
|
4478
4553
|
}
|
|
4479
|
-
} else if (!state.startData || !Utils.compareDate(
|
|
4554
|
+
} else if (!state.startData || !Utils.compareDate(
|
|
4555
|
+
`${curData[0]}-${curData[1]}-${curData[2]}`,
|
|
4556
|
+
`${state.startData[0]}-${state.startData[1]}-01`
|
|
4557
|
+
)) {
|
|
4480
4558
|
state.monthsData.unshift(monthInfo);
|
|
4481
4559
|
} else {
|
|
4482
4560
|
setUnLoadPrev(true);
|
|
@@ -4628,10 +4706,23 @@ const CalendarItem = (props) => {
|
|
|
4628
4706
|
getMonth(getCurrData("next"), "next");
|
|
4629
4707
|
} while (i++ < 4);
|
|
4630
4708
|
if (state.isRange) {
|
|
4631
|
-
chooseDay(
|
|
4632
|
-
|
|
4709
|
+
chooseDay(
|
|
4710
|
+
{ day: state.defaultData[2], type: "curr" },
|
|
4711
|
+
state.monthsData[0],
|
|
4712
|
+
true
|
|
4713
|
+
);
|
|
4714
|
+
chooseDay(
|
|
4715
|
+
{ day: state.defaultData[5], type: "curr" },
|
|
4716
|
+
state.monthsData[0],
|
|
4717
|
+
true,
|
|
4718
|
+
true
|
|
4719
|
+
);
|
|
4633
4720
|
} else {
|
|
4634
|
-
chooseDay(
|
|
4721
|
+
chooseDay(
|
|
4722
|
+
{ day: state.defaultData[2], type: "curr" },
|
|
4723
|
+
state.monthsData[0],
|
|
4724
|
+
true
|
|
4725
|
+
);
|
|
4635
4726
|
}
|
|
4636
4727
|
};
|
|
4637
4728
|
useEffect(() => {
|
|
@@ -4777,83 +4868,87 @@ const defaultProps$O = {
|
|
|
4777
4868
|
onChange: (value) => {
|
|
4778
4869
|
}
|
|
4779
4870
|
};
|
|
4780
|
-
const CheckboxGroup = React__default.forwardRef(
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4871
|
+
const CheckboxGroup = React__default.forwardRef(
|
|
4872
|
+
(props, ref) => {
|
|
4873
|
+
const { children } = { ...defaultProps$O, ...props };
|
|
4874
|
+
const b2 = cn("checkboxgroup");
|
|
4875
|
+
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
4876
|
+
const [innerDisabled, setInnerDisabled] = useState(disabled);
|
|
4877
|
+
const [innerValue, setInnerValue] = useState(checkedValue);
|
|
4878
|
+
useImperativeHandle(ref, () => ({
|
|
4879
|
+
toggleAll(state) {
|
|
4880
|
+
if (state === false) {
|
|
4881
|
+
setInnerValue([]);
|
|
4882
|
+
} else {
|
|
4883
|
+
const childrenLabel = [];
|
|
4884
|
+
React__default.Children.map(children, (child) => {
|
|
4885
|
+
const childProps = child.props;
|
|
4886
|
+
console.log(child);
|
|
4887
|
+
childrenLabel.push(childProps.label || child.children);
|
|
4888
|
+
});
|
|
4889
|
+
setInnerValue(childrenLabel);
|
|
4890
|
+
}
|
|
4891
|
+
},
|
|
4892
|
+
toggleReverse() {
|
|
4791
4893
|
const childrenLabel = [];
|
|
4792
4894
|
React__default.Children.map(children, (child) => {
|
|
4793
4895
|
const childProps = child.props;
|
|
4794
|
-
console.log(child);
|
|
4795
4896
|
childrenLabel.push(childProps.label || child.children);
|
|
4796
4897
|
});
|
|
4797
|
-
|
|
4898
|
+
const reverse = childrenLabel.filter(
|
|
4899
|
+
(c6) => (innerValue == null ? void 0 : innerValue.findIndex((v2) => v2 === c6)) === -1
|
|
4900
|
+
);
|
|
4901
|
+
setInnerValue(reverse);
|
|
4798
4902
|
}
|
|
4799
|
-
}
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
if (innerValue) {
|
|
4818
|
-
let clippedValue = [];
|
|
4819
|
-
if (state) {
|
|
4820
|
-
clippedValue = [...innerValue, label];
|
|
4821
|
-
} else {
|
|
4822
|
-
innerValue == null ? void 0 : innerValue.splice(innerValue == null ? void 0 : innerValue.indexOf(label), 1);
|
|
4823
|
-
clippedValue = [...innerValue];
|
|
4903
|
+
}));
|
|
4904
|
+
useEffect(() => {
|
|
4905
|
+
setInnerDisabled(disabled);
|
|
4906
|
+
setInnerValue(checkedValue);
|
|
4907
|
+
}, [disabled, checkedValue]);
|
|
4908
|
+
function handleChildChange(state, label) {
|
|
4909
|
+
if (max !== void 0 && innerValue && innerValue.length > max)
|
|
4910
|
+
return;
|
|
4911
|
+
if (innerValue) {
|
|
4912
|
+
let clippedValue = [];
|
|
4913
|
+
if (state) {
|
|
4914
|
+
clippedValue = [...innerValue, label];
|
|
4915
|
+
} else {
|
|
4916
|
+
innerValue == null ? void 0 : innerValue.splice(innerValue == null ? void 0 : innerValue.indexOf(label), 1);
|
|
4917
|
+
clippedValue = [...innerValue];
|
|
4918
|
+
}
|
|
4919
|
+
setInnerValue(clippedValue);
|
|
4920
|
+
onChange && onChange(clippedValue);
|
|
4824
4921
|
}
|
|
4825
|
-
setInnerValue(clippedValue);
|
|
4826
|
-
onChange && onChange(clippedValue);
|
|
4827
4922
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
return
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4923
|
+
function validateChildChecked(child) {
|
|
4924
|
+
if (!innerValue)
|
|
4925
|
+
return false;
|
|
4926
|
+
return (innerValue == null ? void 0 : innerValue.indexOf(child.props.label || child.children)) > -1;
|
|
4927
|
+
}
|
|
4928
|
+
function getParentVals() {
|
|
4929
|
+
return innerValue;
|
|
4930
|
+
}
|
|
4931
|
+
function cloneChildren() {
|
|
4932
|
+
return React__default.Children.map(children, (child) => {
|
|
4933
|
+
const childChecked = validateChildChecked(child);
|
|
4934
|
+
if (child.type.displayName !== "NutCheckBox") {
|
|
4935
|
+
return React__default.cloneElement(child);
|
|
4936
|
+
}
|
|
4937
|
+
return React__default.cloneElement(child, {
|
|
4938
|
+
disabled: innerDisabled,
|
|
4939
|
+
checked: childChecked,
|
|
4940
|
+
onChange: handleChildChange,
|
|
4941
|
+
getParentVals,
|
|
4942
|
+
max
|
|
4943
|
+
});
|
|
4849
4944
|
});
|
|
4850
|
-
}
|
|
4945
|
+
}
|
|
4946
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4947
|
+
className: `${b2()} ${className || ""}`,
|
|
4948
|
+
...rest
|
|
4949
|
+
}, cloneChildren());
|
|
4851
4950
|
}
|
|
4852
|
-
|
|
4853
|
-
className: `${b2()} ${className || ""}`,
|
|
4854
|
-
...rest
|
|
4855
|
-
}, cloneChildren());
|
|
4856
|
-
});
|
|
4951
|
+
);
|
|
4857
4952
|
CheckboxGroup.defaultProps = defaultProps$O;
|
|
4858
4953
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
4859
4954
|
const defaultProps$N = {
|
|
@@ -5173,7 +5268,9 @@ const InternalPicker = (props, ref) => {
|
|
|
5173
5268
|
const optins = [];
|
|
5174
5269
|
columnsList.map((column, index2) => {
|
|
5175
5270
|
let currOptions = [];
|
|
5176
|
-
currOptions = column.filter(
|
|
5271
|
+
currOptions = column.filter(
|
|
5272
|
+
(item) => item.value === chooseValueData[index2]
|
|
5273
|
+
);
|
|
5177
5274
|
if (currOptions[0]) {
|
|
5178
5275
|
optins.push(currOptions[0]);
|
|
5179
5276
|
} else {
|
|
@@ -5206,7 +5303,10 @@ const InternalPicker = (props, ref) => {
|
|
|
5206
5303
|
} else {
|
|
5207
5304
|
setchooseValueData((data) => {
|
|
5208
5305
|
const cdata = [...data];
|
|
5209
|
-
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
5306
|
+
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
5307
|
+
option,
|
|
5308
|
+
"value"
|
|
5309
|
+
) ? option.value : "";
|
|
5210
5310
|
return cdata;
|
|
5211
5311
|
});
|
|
5212
5312
|
}
|
|
@@ -5248,7 +5348,9 @@ const InternalPicker = (props, ref) => {
|
|
|
5248
5348
|
while (cursor && cursor.children) {
|
|
5249
5349
|
const options2 = cursor.children;
|
|
5250
5350
|
const value = defaultValues[columnIndex2];
|
|
5251
|
-
let index2 = options2.findIndex(
|
|
5351
|
+
let index2 = options2.findIndex(
|
|
5352
|
+
(columnItem) => columnItem.value === value
|
|
5353
|
+
);
|
|
5252
5354
|
if (index2 === -1)
|
|
5253
5355
|
index2 = 0;
|
|
5254
5356
|
cursor = cursor.children[index2];
|
|
@@ -5457,25 +5559,38 @@ const DatePicker = (props) => {
|
|
|
5457
5559
|
return result;
|
|
5458
5560
|
};
|
|
5459
5561
|
const updateChooseValueCustmer = (index2, selectedValue, cacheValueData) => {
|
|
5460
|
-
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
5562
|
+
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
5563
|
+
type.toLocaleLowerCase()
|
|
5564
|
+
)) {
|
|
5461
5565
|
const formatDate = [];
|
|
5462
5566
|
selectedValue.forEach((item) => {
|
|
5463
5567
|
formatDate.push(item);
|
|
5464
5568
|
});
|
|
5465
5569
|
if (type.toLocaleLowerCase() === "month-day" && formatDate.length < 3) {
|
|
5466
|
-
formatDate.unshift(
|
|
5570
|
+
formatDate.unshift(
|
|
5571
|
+
new Date(modelValue || minDate || maxDate).getFullYear()
|
|
5572
|
+
);
|
|
5467
5573
|
}
|
|
5468
5574
|
if (type.toLocaleLowerCase() === "year-month" && formatDate.length < 3) {
|
|
5469
5575
|
formatDate.push(new Date(modelValue || minDate || maxDate).getDate());
|
|
5470
5576
|
}
|
|
5471
5577
|
const year = Number(formatDate[0]);
|
|
5472
5578
|
const month = Number(formatDate[1]) - 1;
|
|
5473
|
-
const day = Math.min(
|
|
5579
|
+
const day = Math.min(
|
|
5580
|
+
Number(formatDate[2]),
|
|
5581
|
+
getMonthEndDay(Number(formatDate[0]), Number(formatDate[1]))
|
|
5582
|
+
);
|
|
5474
5583
|
let date = null;
|
|
5475
5584
|
if (type.toLocaleLowerCase() === "date" || type.toLocaleLowerCase() === "month-day" || type.toLocaleLowerCase() === "year-month") {
|
|
5476
5585
|
date = new Date(year, month, day);
|
|
5477
5586
|
} else if (type.toLocaleLowerCase() === "datetime") {
|
|
5478
|
-
date = new Date(
|
|
5587
|
+
date = new Date(
|
|
5588
|
+
year,
|
|
5589
|
+
month,
|
|
5590
|
+
day,
|
|
5591
|
+
Number(formatDate[3]),
|
|
5592
|
+
Number(formatDate[4])
|
|
5593
|
+
);
|
|
5479
5594
|
} else if (type.toLocaleLowerCase() === "datehour") {
|
|
5480
5595
|
date = new Date(year, month, day, Number(formatDate[3]));
|
|
5481
5596
|
}
|
|
@@ -5548,7 +5663,13 @@ const DatePicker = (props) => {
|
|
|
5548
5663
|
};
|
|
5549
5664
|
const columns = (date) => {
|
|
5550
5665
|
const val = ranges(date).map((res, columnIndex) => {
|
|
5551
|
-
return generateValue(
|
|
5666
|
+
return generateValue(
|
|
5667
|
+
res.range[0],
|
|
5668
|
+
res.range[1],
|
|
5669
|
+
getDateIndex(res.type),
|
|
5670
|
+
res.type,
|
|
5671
|
+
columnIndex
|
|
5672
|
+
);
|
|
5552
5673
|
});
|
|
5553
5674
|
return val || [];
|
|
5554
5675
|
};
|
|
@@ -5629,9 +5750,13 @@ const InputNumber = (props) => {
|
|
|
5629
5750
|
setInputValue(modelValue);
|
|
5630
5751
|
}, [modelValue]);
|
|
5631
5752
|
const b2 = cn("inputnumber");
|
|
5632
|
-
const classes = classNames(
|
|
5633
|
-
|
|
5634
|
-
|
|
5753
|
+
const classes = classNames(
|
|
5754
|
+
{
|
|
5755
|
+
[`${b2("")}--disabled`]: disabled
|
|
5756
|
+
},
|
|
5757
|
+
className,
|
|
5758
|
+
b2("")
|
|
5759
|
+
);
|
|
5635
5760
|
const styles = {
|
|
5636
5761
|
height: pxCheck(buttonSize),
|
|
5637
5762
|
...style
|
|
@@ -5858,7 +5983,7 @@ const Input = (props) => {
|
|
|
5858
5983
|
const [classes, setClasses] = useState("");
|
|
5859
5984
|
const getModelValue = () => String(inputValue != null ? inputValue : "");
|
|
5860
5985
|
const inputRef = useRef(null);
|
|
5861
|
-
useLayoutEffect
|
|
5986
|
+
useLayoutEffect(() => {
|
|
5862
5987
|
updateValue(getModelValue(), formatTrigger);
|
|
5863
5988
|
});
|
|
5864
5989
|
useEffect(() => {
|
|
@@ -6072,43 +6197,45 @@ const defaultProps$J = {
|
|
|
6072
6197
|
},
|
|
6073
6198
|
direction: "vertical"
|
|
6074
6199
|
};
|
|
6075
|
-
const RadioGroup = React__default.forwardRef(
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6200
|
+
const RadioGroup = React__default.forwardRef(
|
|
6201
|
+
(props, ref) => {
|
|
6202
|
+
const { children } = { ...defaultProps$J, ...props };
|
|
6203
|
+
cn("RadioGroup");
|
|
6204
|
+
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
6205
|
+
const [val2State, setVal2State] = useState(value);
|
|
6206
|
+
useEffect(() => {
|
|
6207
|
+
setVal2State(value);
|
|
6208
|
+
}, [value]);
|
|
6209
|
+
function validateChildChecked(child) {
|
|
6210
|
+
if (val2State === null)
|
|
6211
|
+
return false;
|
|
6212
|
+
return val2State === child.props.value;
|
|
6213
|
+
}
|
|
6214
|
+
function cloneChildren() {
|
|
6215
|
+
return React__default.Children.map(children, (child, index2) => {
|
|
6216
|
+
const childChecked = validateChildChecked(child);
|
|
6217
|
+
if (child.type.displayName !== "NutRadio") {
|
|
6218
|
+
return React__default.cloneElement(child);
|
|
6219
|
+
}
|
|
6220
|
+
return React__default.cloneElement(child, {
|
|
6221
|
+
textPosition,
|
|
6222
|
+
checked: childChecked
|
|
6223
|
+
});
|
|
6097
6224
|
});
|
|
6098
|
-
});
|
|
6099
|
-
}
|
|
6100
|
-
return /* @__PURE__ */ React__default.createElement(RadioContext.Provider, {
|
|
6101
|
-
value: {
|
|
6102
|
-
onChange: (val) => {
|
|
6103
|
-
setVal2State(val);
|
|
6104
|
-
onChange && onChange(val);
|
|
6105
|
-
}
|
|
6106
6225
|
}
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6226
|
+
return /* @__PURE__ */ React__default.createElement(RadioContext.Provider, {
|
|
6227
|
+
value: {
|
|
6228
|
+
onChange: (val) => {
|
|
6229
|
+
setVal2State(val);
|
|
6230
|
+
onChange && onChange(val);
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6234
|
+
className: `nut-radiogroup nut-radiogroup--${props.direction}`,
|
|
6235
|
+
...rest
|
|
6236
|
+
}, cloneChildren()));
|
|
6237
|
+
}
|
|
6238
|
+
);
|
|
6112
6239
|
RadioGroup.defaultProps = defaultProps$J;
|
|
6113
6240
|
RadioGroup.displayName = "NutRadioGroup";
|
|
6114
6241
|
const defaultProps$I = {
|
|
@@ -6287,7 +6414,9 @@ const Rate = (props) => {
|
|
|
6287
6414
|
size: iconSize,
|
|
6288
6415
|
name: checkedIcon
|
|
6289
6416
|
}), allowHalf && score < n2 - 1 && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6290
|
-
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
6417
|
+
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
6418
|
+
"icon--half"
|
|
6419
|
+
)}`,
|
|
6291
6420
|
color: voidColor,
|
|
6292
6421
|
size: iconSize,
|
|
6293
6422
|
name: uncheckedIcon
|
|
@@ -6297,9 +6426,9 @@ const Rate = (props) => {
|
|
|
6297
6426
|
Rate.defaultProps = defaultProps$H;
|
|
6298
6427
|
Rate.displayName = "NutRate";
|
|
6299
6428
|
const defaultProps$G = {
|
|
6300
|
-
title: "
|
|
6301
|
-
desc: "
|
|
6302
|
-
tips: "
|
|
6429
|
+
title: "",
|
|
6430
|
+
desc: "",
|
|
6431
|
+
tips: "",
|
|
6303
6432
|
visible: false,
|
|
6304
6433
|
modelValue: "",
|
|
6305
6434
|
errorMsg: "",
|
|
@@ -6307,7 +6436,7 @@ const defaultProps$G = {
|
|
|
6307
6436
|
closeOnClickOverlay: true,
|
|
6308
6437
|
length: 6,
|
|
6309
6438
|
className: "",
|
|
6310
|
-
|
|
6439
|
+
onChange: (value) => {
|
|
6311
6440
|
},
|
|
6312
6441
|
onOk: (value) => {
|
|
6313
6442
|
},
|
|
@@ -6317,7 +6446,7 @@ const defaultProps$G = {
|
|
|
6317
6446
|
},
|
|
6318
6447
|
onTips: () => {
|
|
6319
6448
|
},
|
|
6320
|
-
|
|
6449
|
+
onComplete: (value) => {
|
|
6321
6450
|
}
|
|
6322
6451
|
};
|
|
6323
6452
|
const ShortPassword = (props) => {
|
|
@@ -6334,12 +6463,12 @@ const ShortPassword = (props) => {
|
|
|
6334
6463
|
length,
|
|
6335
6464
|
style,
|
|
6336
6465
|
className,
|
|
6337
|
-
|
|
6466
|
+
onChange,
|
|
6338
6467
|
onOk,
|
|
6339
6468
|
onTips,
|
|
6340
6469
|
onCancel,
|
|
6341
6470
|
onClose,
|
|
6342
|
-
|
|
6471
|
+
onComplete,
|
|
6343
6472
|
...reset
|
|
6344
6473
|
} = props;
|
|
6345
6474
|
const b2 = cn("shortpassword");
|
|
@@ -6354,7 +6483,7 @@ const ShortPassword = (props) => {
|
|
|
6354
6483
|
setInnerVisible(visible);
|
|
6355
6484
|
}, [visible]);
|
|
6356
6485
|
useEffect(() => {
|
|
6357
|
-
if (modelValue) {
|
|
6486
|
+
if (typeof modelValue !== "undefined") {
|
|
6358
6487
|
setInputValue(modelValue);
|
|
6359
6488
|
}
|
|
6360
6489
|
}, [modelValue]);
|
|
@@ -6365,25 +6494,28 @@ const ShortPassword = (props) => {
|
|
|
6365
6494
|
}
|
|
6366
6495
|
setInputValue(inputValue2);
|
|
6367
6496
|
if (String(inputValue2).length === comLen) {
|
|
6368
|
-
|
|
6497
|
+
onComplete && onComplete(inputValue2);
|
|
6369
6498
|
}
|
|
6370
|
-
|
|
6499
|
+
onChange && onChange(inputValue2);
|
|
6371
6500
|
};
|
|
6372
6501
|
const systemStyle = () => {
|
|
6373
6502
|
const u = navigator.userAgent;
|
|
6374
6503
|
const isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1;
|
|
6375
6504
|
const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
6505
|
+
let style2 = {};
|
|
6506
|
+
console.log(isIOS, isAndroid);
|
|
6376
6507
|
if (isIOS) {
|
|
6377
|
-
|
|
6508
|
+
style2 = {
|
|
6378
6509
|
paddingRight: "1200px"
|
|
6379
6510
|
};
|
|
6380
6511
|
}
|
|
6381
6512
|
if (isAndroid) {
|
|
6382
|
-
|
|
6513
|
+
style2 = {
|
|
6383
6514
|
opacity: 0,
|
|
6384
6515
|
zIndex: 10
|
|
6385
6516
|
};
|
|
6386
6517
|
}
|
|
6518
|
+
return style2;
|
|
6387
6519
|
};
|
|
6388
6520
|
const focus = () => {
|
|
6389
6521
|
if (textInput.current) {
|
|
@@ -6410,9 +6542,9 @@ const ShortPassword = (props) => {
|
|
|
6410
6542
|
...reset
|
|
6411
6543
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6412
6544
|
className: b2("title")
|
|
6413
|
-
}, locale.shortpassword.title
|
|
6545
|
+
}, title || locale.shortpassword.title), /* @__PURE__ */ React__default.createElement("div", {
|
|
6414
6546
|
className: b2("subtitle")
|
|
6415
|
-
}, locale.shortpassword.desc
|
|
6547
|
+
}, desc || locale.shortpassword.desc), /* @__PURE__ */ React__default.createElement("div", {
|
|
6416
6548
|
className: b2("input")
|
|
6417
6549
|
}, /* @__PURE__ */ React__default.createElement("input", {
|
|
6418
6550
|
ref: textInput,
|
|
@@ -6438,7 +6570,7 @@ const ShortPassword = (props) => {
|
|
|
6438
6570
|
className: b2("message")
|
|
6439
6571
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6440
6572
|
className: b2("message__error")
|
|
6441
|
-
}, errorMsg2), tips ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6573
|
+
}, errorMsg2), tips || locale.shortpassword.tips ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6442
6574
|
className: b2("message__forget")
|
|
6443
6575
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6444
6576
|
className: "icon",
|
|
@@ -6446,7 +6578,7 @@ const ShortPassword = (props) => {
|
|
|
6446
6578
|
name: "tips"
|
|
6447
6579
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
6448
6580
|
onClick: onTips
|
|
6449
|
-
}, locale.shortpassword.tips
|
|
6581
|
+
}, tips || locale.shortpassword.tips)) : null), !noButton ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6450
6582
|
className: b2("footer")
|
|
6451
6583
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6452
6584
|
className: b2("footer__cancel"),
|
|
@@ -6573,10 +6705,14 @@ class Upload {
|
|
|
6573
6705
|
const xhr = new XMLHttpRequest();
|
|
6574
6706
|
xhr.timeout = options2.timeout;
|
|
6575
6707
|
if (xhr.upload) {
|
|
6576
|
-
xhr.upload.addEventListener(
|
|
6577
|
-
|
|
6578
|
-
(
|
|
6579
|
-
|
|
6708
|
+
xhr.upload.addEventListener(
|
|
6709
|
+
"progress",
|
|
6710
|
+
(e2) => {
|
|
6711
|
+
var _a2;
|
|
6712
|
+
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
6713
|
+
},
|
|
6714
|
+
false
|
|
6715
|
+
);
|
|
6580
6716
|
xhr.onreadystatechange = () => {
|
|
6581
6717
|
var _a2, _b;
|
|
6582
6718
|
if (xhr.readyState === 4) {
|
|
@@ -6775,9 +6911,11 @@ const InternalUploader = (props, ref) => {
|
|
|
6775
6911
|
if (props.autoUpload) {
|
|
6776
6912
|
task.upload();
|
|
6777
6913
|
} else {
|
|
6778
|
-
uploadQueue.push(
|
|
6779
|
-
resolve
|
|
6780
|
-
|
|
6914
|
+
uploadQueue.push(
|
|
6915
|
+
new Promise((resolve, reject) => {
|
|
6916
|
+
resolve(task);
|
|
6917
|
+
})
|
|
6918
|
+
);
|
|
6781
6919
|
setUploadQueue(uploadQueue);
|
|
6782
6920
|
}
|
|
6783
6921
|
};
|
|
@@ -6846,10 +6984,12 @@ const InternalUploader = (props, ref) => {
|
|
|
6846
6984
|
const $el = event.target;
|
|
6847
6985
|
const { files } = $el;
|
|
6848
6986
|
if (beforeUpload) {
|
|
6849
|
-
beforeUpload(new Array().slice.call(files)).then(
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6987
|
+
beforeUpload(new Array().slice.call(files)).then(
|
|
6988
|
+
(f2) => {
|
|
6989
|
+
const _files = filterFiles(new Array().slice.call(f2));
|
|
6990
|
+
readFile(_files);
|
|
6991
|
+
}
|
|
6992
|
+
);
|
|
6853
6993
|
} else {
|
|
6854
6994
|
const _files = filterFiles(new Array().slice.call(files));
|
|
6855
6995
|
readFile(_files);
|
|
@@ -7231,12 +7371,23 @@ const NumberKeyboard = (props) => {
|
|
|
7231
7371
|
}
|
|
7232
7372
|
if (customKeys.length === 1) {
|
|
7233
7373
|
if (props.title && props.type !== "rightColumn") {
|
|
7234
|
-
keys.push(
|
|
7374
|
+
keys.push(
|
|
7375
|
+
{ id: customKeys[0], type: "custom" },
|
|
7376
|
+
{ id: 0, type: "number" },
|
|
7377
|
+
{ id: "delete", type: "delete" }
|
|
7378
|
+
);
|
|
7235
7379
|
} else {
|
|
7236
|
-
keys.push(
|
|
7380
|
+
keys.push(
|
|
7381
|
+
{ id: 0, type: "number" },
|
|
7382
|
+
{ id: customKeys[0], type: "custom" }
|
|
7383
|
+
);
|
|
7237
7384
|
}
|
|
7238
7385
|
} else if (customKeys.length === 2) {
|
|
7239
|
-
keys.push(
|
|
7386
|
+
keys.push(
|
|
7387
|
+
{ id: customKeys[0], type: "custom" },
|
|
7388
|
+
{ id: 0, type: "number" },
|
|
7389
|
+
{ id: customKeys[1], type: "custom" }
|
|
7390
|
+
);
|
|
7240
7391
|
}
|
|
7241
7392
|
return keys;
|
|
7242
7393
|
};
|
|
@@ -8795,9 +8946,9 @@ let findTimeout = (time) => ~(~timeouts.findIndex((t2) => t2.time > time) || ~ti
|
|
|
8795
8946
|
raf.cancel = (fn) => {
|
|
8796
8947
|
onStartQueue.delete(fn);
|
|
8797
8948
|
onFrameQueue.delete(fn);
|
|
8949
|
+
onFinishQueue.delete(fn);
|
|
8798
8950
|
updateQueue.delete(fn);
|
|
8799
8951
|
writeQueue.delete(fn);
|
|
8800
|
-
onFinishQueue.delete(fn);
|
|
8801
8952
|
};
|
|
8802
8953
|
raf.sync = (fn) => {
|
|
8803
8954
|
sync = true;
|
|
@@ -8875,14 +9026,15 @@ function update() {
|
|
|
8875
9026
|
eachSafely(timeouts.splice(0, count), (t2) => t2.handler());
|
|
8876
9027
|
pendingCount -= count;
|
|
8877
9028
|
}
|
|
9029
|
+
if (!pendingCount) {
|
|
9030
|
+
stop();
|
|
9031
|
+
return;
|
|
9032
|
+
}
|
|
8878
9033
|
onStartQueue.flush();
|
|
8879
9034
|
updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
|
|
8880
9035
|
onFrameQueue.flush();
|
|
8881
9036
|
writeQueue.flush();
|
|
8882
9037
|
onFinishQueue.flush();
|
|
8883
|
-
if (!pendingCount) {
|
|
8884
|
-
stop();
|
|
8885
|
-
}
|
|
8886
9038
|
}
|
|
8887
9039
|
function makeQueue() {
|
|
8888
9040
|
let next = /* @__PURE__ */ new Set();
|
|
@@ -9564,10 +9716,10 @@ function deprecateDirectCall() {
|
|
|
9564
9716
|
function isAnimatedString(value) {
|
|
9565
9717
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
|
|
9566
9718
|
}
|
|
9567
|
-
const
|
|
9719
|
+
const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
|
|
9568
9720
|
const useIsMounted = () => {
|
|
9569
9721
|
const isMounted = useRef(false);
|
|
9570
|
-
|
|
9722
|
+
useIsomorphicLayoutEffect(() => {
|
|
9571
9723
|
isMounted.current = true;
|
|
9572
9724
|
return () => {
|
|
9573
9725
|
isMounted.current = false;
|
|
@@ -9849,7 +10001,7 @@ const withAnimated = (Component2, host2) => {
|
|
|
9849
10001
|
};
|
|
9850
10002
|
const observer = new PropsObserver(callback, deps);
|
|
9851
10003
|
const observerRef = useRef();
|
|
9852
|
-
|
|
10004
|
+
useIsomorphicLayoutEffect(() => {
|
|
9853
10005
|
observerRef.current = observer;
|
|
9854
10006
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
9855
10007
|
return () => {
|
|
@@ -11585,7 +11737,7 @@ function useSprings(length, props, deps) {
|
|
|
11585
11737
|
const context2 = useContext$1(SpringContext);
|
|
11586
11738
|
const prevContext = usePrev(context2);
|
|
11587
11739
|
const hasContext = context2 !== prevContext && hasProps(context2);
|
|
11588
|
-
|
|
11740
|
+
useIsomorphicLayoutEffect(() => {
|
|
11589
11741
|
layoutId.current++;
|
|
11590
11742
|
state.ctrls = ctrls.current;
|
|
11591
11743
|
const {
|
|
@@ -11973,26 +12125,29 @@ const Drag = (props) => {
|
|
|
11973
12125
|
middleLine.current = clientWidth - offsetWidth - offsetLeft - (clientWidth - offsetWidth) / 2;
|
|
11974
12126
|
}
|
|
11975
12127
|
};
|
|
11976
|
-
const bind = useDrag(
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
if (
|
|
11980
|
-
if (
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
12128
|
+
const bind = useDrag(
|
|
12129
|
+
({ down, last, offset: [x2, y2] }) => {
|
|
12130
|
+
api.start({ x: x2, y: y2, immediate: down });
|
|
12131
|
+
if (last) {
|
|
12132
|
+
if (props.direction != "y" && props.attract) {
|
|
12133
|
+
if (x2 < middleLine.current) {
|
|
12134
|
+
api.start({ x: boundaryState.left, y: y2, immediate: down });
|
|
12135
|
+
} else {
|
|
12136
|
+
api.start({
|
|
12137
|
+
x: boundaryState.right,
|
|
12138
|
+
y: y2,
|
|
12139
|
+
immediate: down
|
|
12140
|
+
});
|
|
12141
|
+
}
|
|
11988
12142
|
}
|
|
11989
12143
|
}
|
|
12144
|
+
},
|
|
12145
|
+
{
|
|
12146
|
+
from: () => [currstyle.x.get(), currstyle.y.get()],
|
|
12147
|
+
axis: direction,
|
|
12148
|
+
bounds: boundaryState
|
|
11990
12149
|
}
|
|
11991
|
-
|
|
11992
|
-
from: () => [currstyle.x.get(), currstyle.y.get()],
|
|
11993
|
-
axis: direction,
|
|
11994
|
-
bounds: boundaryState
|
|
11995
|
-
});
|
|
12150
|
+
);
|
|
11996
12151
|
useEffect(() => {
|
|
11997
12152
|
getInfo();
|
|
11998
12153
|
}, [myDrag]);
|
|
@@ -12146,12 +12301,15 @@ function confirm(config2, renderFunc) {
|
|
|
12146
12301
|
}
|
|
12147
12302
|
if (ret && ret.then) {
|
|
12148
12303
|
renderFunction(dialogConfig);
|
|
12149
|
-
ret.then(
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12304
|
+
ret.then(
|
|
12305
|
+
() => {
|
|
12306
|
+
onCancel(true);
|
|
12307
|
+
},
|
|
12308
|
+
(e2) => {
|
|
12309
|
+
console.error(e2);
|
|
12310
|
+
renderFunction(dialogConfig);
|
|
12311
|
+
}
|
|
12312
|
+
);
|
|
12155
12313
|
}
|
|
12156
12314
|
if (!ret) {
|
|
12157
12315
|
onCancel(true);
|
|
@@ -12340,7 +12498,9 @@ const Infiniteloading = (props) => {
|
|
|
12340
12498
|
const b2 = cn("infiniteloading");
|
|
12341
12499
|
const classes = classNames(className, b2());
|
|
12342
12500
|
useEffect(() => {
|
|
12343
|
-
const parentElement = getParentElement(
|
|
12501
|
+
const parentElement = getParentElement(
|
|
12502
|
+
scroller.current
|
|
12503
|
+
);
|
|
12344
12504
|
scrollEl.current = useWindow ? window : parentElement;
|
|
12345
12505
|
scrollEl.current.addEventListener("scroll", handleScroll, useCapture);
|
|
12346
12506
|
return () => {
|
|
@@ -12372,6 +12532,7 @@ const Infiniteloading = (props) => {
|
|
|
12372
12532
|
}
|
|
12373
12533
|
setIsInfiniting(true);
|
|
12374
12534
|
loadMore && loadMore(infiniteDone);
|
|
12535
|
+
return true;
|
|
12375
12536
|
});
|
|
12376
12537
|
};
|
|
12377
12538
|
const infiniteDone = () => {
|
|
@@ -12415,7 +12576,7 @@ const Infiniteloading = (props) => {
|
|
|
12415
12576
|
}
|
|
12416
12577
|
};
|
|
12417
12578
|
const requestAniFrame2 = () => {
|
|
12418
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
12579
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function fn(callback) {
|
|
12419
12580
|
window.setTimeout(callback, 1e3 / 60);
|
|
12420
12581
|
};
|
|
12421
12582
|
};
|
|
@@ -12447,7 +12608,7 @@ const Infiniteloading = (props) => {
|
|
|
12447
12608
|
}
|
|
12448
12609
|
beforeScrollTop.current = resScrollTop;
|
|
12449
12610
|
scrollChange && scrollChange(resScrollTop);
|
|
12450
|
-
return offsetDistance <= threshold && direction
|
|
12611
|
+
return offsetDistance <= threshold && direction === "down";
|
|
12451
12612
|
};
|
|
12452
12613
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12453
12614
|
className: classes,
|
|
@@ -12467,7 +12628,7 @@ const Infiniteloading = (props) => {
|
|
|
12467
12628
|
name: pullIcon
|
|
12468
12629
|
}), /* @__PURE__ */ React__default.createElement("span", {
|
|
12469
12630
|
className: "top-text"
|
|
12470
|
-
}, locale.infiniteloading.pullRefreshText
|
|
12631
|
+
}, pullTxt || locale.infiniteloading.pullRefreshText))), /* @__PURE__ */ React__default.createElement("div", {
|
|
12471
12632
|
className: "nut-infinite-container"
|
|
12472
12633
|
}, children), /* @__PURE__ */ React__default.createElement("div", {
|
|
12473
12634
|
className: "nut-infinite-bottom"
|
|
@@ -12478,9 +12639,9 @@ const Infiniteloading = (props) => {
|
|
|
12478
12639
|
name: loadIcon
|
|
12479
12640
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
12480
12641
|
className: "bottom-text"
|
|
12481
|
-
}, locale.infiniteloading.loadText
|
|
12642
|
+
}, loadTxt || locale.infiniteloading.loadText)) : !hasMore && /* @__PURE__ */ React__default.createElement("div", {
|
|
12482
12643
|
className: "tips"
|
|
12483
|
-
}, locale.infiniteloading.loadMoreText
|
|
12644
|
+
}, loadMoreTxt || locale.infiniteloading.loadMoreText)));
|
|
12484
12645
|
};
|
|
12485
12646
|
Infiniteloading.defaultProps = defaultProps$x;
|
|
12486
12647
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
@@ -12764,7 +12925,9 @@ const CircleProgress = (props) => {
|
|
|
12764
12925
|
return;
|
|
12765
12926
|
}
|
|
12766
12927
|
const color = circleColor;
|
|
12767
|
-
const colorArr = Object.keys(color).sort(
|
|
12928
|
+
const colorArr = Object.keys(color).sort(
|
|
12929
|
+
(a, b22) => parseFloat(a) - parseFloat(b22)
|
|
12930
|
+
);
|
|
12768
12931
|
const stopArr = [];
|
|
12769
12932
|
colorArr.map((item) => {
|
|
12770
12933
|
const obj = {
|
|
@@ -12946,7 +13109,10 @@ const NoticeBar = (props) => {
|
|
|
12946
13109
|
};
|
|
12947
13110
|
const startRollEasy = () => {
|
|
12948
13111
|
showhorseLamp();
|
|
12949
|
-
const timerCurr = window.setInterval(
|
|
13112
|
+
const timerCurr = window.setInterval(
|
|
13113
|
+
showhorseLamp,
|
|
13114
|
+
~~(height / speed / 4) * 1e3 + Number(standTime)
|
|
13115
|
+
);
|
|
12950
13116
|
SetTimer(timerCurr);
|
|
12951
13117
|
};
|
|
12952
13118
|
const showhorseLamp = () => {
|
|
@@ -13090,16 +13256,24 @@ const Steps = (props) => {
|
|
|
13090
13256
|
propSteps
|
|
13091
13257
|
};
|
|
13092
13258
|
const b2 = cn("steps");
|
|
13093
|
-
const classes = classNames(
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13259
|
+
const classes = classNames(
|
|
13260
|
+
{
|
|
13261
|
+
[`${b2("")}-${direction}`]: true,
|
|
13262
|
+
[`${b2("")}-dot`]: !!props.progressDot
|
|
13263
|
+
},
|
|
13264
|
+
className,
|
|
13265
|
+
b2("")
|
|
13266
|
+
);
|
|
13097
13267
|
return /* @__PURE__ */ React__default.createElement(DataContext$1.Provider, {
|
|
13098
13268
|
value: parentSteps
|
|
13099
|
-
}, React__default.createElement(
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13269
|
+
}, React__default.createElement(
|
|
13270
|
+
"div",
|
|
13271
|
+
{
|
|
13272
|
+
className: classes,
|
|
13273
|
+
...restProps
|
|
13274
|
+
},
|
|
13275
|
+
children
|
|
13276
|
+
));
|
|
13103
13277
|
};
|
|
13104
13278
|
Steps.defaultProps = defaultProps$t;
|
|
13105
13279
|
Steps.displayName = "NutSteps";
|
|
@@ -13142,9 +13316,13 @@ const Step = (props) => {
|
|
|
13142
13316
|
}
|
|
13143
13317
|
};
|
|
13144
13318
|
const b2 = cn("step");
|
|
13145
|
-
const classes = classNames(
|
|
13146
|
-
|
|
13147
|
-
|
|
13319
|
+
const classes = classNames(
|
|
13320
|
+
{
|
|
13321
|
+
[`${b2("")}-${getCurrentStatus()}`]: true
|
|
13322
|
+
},
|
|
13323
|
+
className,
|
|
13324
|
+
b2("")
|
|
13325
|
+
);
|
|
13148
13326
|
const renderIconClass = () => {
|
|
13149
13327
|
if (!dot && icon) {
|
|
13150
13328
|
return "nut-step-icon is-icon";
|
|
@@ -14458,72 +14636,75 @@ const defaultProps$h = {
|
|
|
14458
14636
|
function areEqual(prevProps, nextProps) {
|
|
14459
14637
|
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
14460
14638
|
}
|
|
14461
|
-
const Collapse = memo(
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
rotate,
|
|
14468
|
-
iconSize,
|
|
14469
|
-
iconColor,
|
|
14470
|
-
change
|
|
14471
|
-
} = {
|
|
14472
|
-
...defaultProps$h,
|
|
14473
|
-
...props
|
|
14474
|
-
};
|
|
14475
|
-
const childrenDom = React__default.Children.toArray(children);
|
|
14476
|
-
const [defaultOpenIndex, setDefaultOpenIndex] = useState([]);
|
|
14477
|
-
const handleActiveName = () => {
|
|
14478
|
-
let activeArr = [];
|
|
14479
|
-
if (!Array.isArray(activeName)) {
|
|
14480
|
-
activeArr.push(activeName.toString());
|
|
14481
|
-
} else {
|
|
14482
|
-
if (accordion && activeName.length > 1) {
|
|
14483
|
-
console.warn("\u624B\u98CE\u7434\u6A21\u5F0F\u4E0D\u652F\u6301\u4F20\u9012\u591A\u4E2A\u6253\u5F00\u9875\u7B7E");
|
|
14484
|
-
}
|
|
14485
|
-
const activeNameStr = activeName.map((item) => {
|
|
14486
|
-
return item.toString();
|
|
14487
|
-
});
|
|
14488
|
-
activeArr = [...activeNameStr];
|
|
14489
|
-
}
|
|
14490
|
-
return activeArr;
|
|
14491
|
-
};
|
|
14492
|
-
const colBem = cn("collapse");
|
|
14493
|
-
useEffect(() => {
|
|
14494
|
-
const activeArr = handleActiveName();
|
|
14495
|
-
setDefaultOpenIndex(activeArr);
|
|
14496
|
-
}, [activeName]);
|
|
14497
|
-
const onToggle = (isOpen, name) => {
|
|
14498
|
-
let newOpenIndex = [...defaultOpenIndex];
|
|
14499
|
-
if (isOpen) {
|
|
14500
|
-
const removeIndex = newOpenIndex.findIndex((value) => {
|
|
14501
|
-
return value === name;
|
|
14502
|
-
});
|
|
14503
|
-
newOpenIndex.splice(removeIndex, 1);
|
|
14504
|
-
} else {
|
|
14505
|
-
if (accordion) {
|
|
14506
|
-
newOpenIndex = [name];
|
|
14507
|
-
} else {
|
|
14508
|
-
newOpenIndex.push(name);
|
|
14509
|
-
}
|
|
14510
|
-
}
|
|
14511
|
-
setDefaultOpenIndex(newOpenIndex);
|
|
14512
|
-
change && change(!isOpen, name);
|
|
14513
|
-
};
|
|
14514
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14515
|
-
className: colBem()
|
|
14516
|
-
}, childrenDom.map((item) => {
|
|
14517
|
-
return React__default.cloneElement(item, {
|
|
14518
|
-
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
14519
|
-
onToggle: (isOpen, name) => onToggle(isOpen, name),
|
|
14639
|
+
const Collapse = memo(
|
|
14640
|
+
(props) => {
|
|
14641
|
+
const {
|
|
14642
|
+
children,
|
|
14643
|
+
activeName,
|
|
14644
|
+
accordion,
|
|
14520
14645
|
icon,
|
|
14521
14646
|
rotate,
|
|
14522
14647
|
iconSize,
|
|
14523
|
-
iconColor
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14648
|
+
iconColor,
|
|
14649
|
+
change
|
|
14650
|
+
} = {
|
|
14651
|
+
...defaultProps$h,
|
|
14652
|
+
...props
|
|
14653
|
+
};
|
|
14654
|
+
const childrenDom = React__default.Children.toArray(children);
|
|
14655
|
+
const [defaultOpenIndex, setDefaultOpenIndex] = useState([]);
|
|
14656
|
+
const handleActiveName = () => {
|
|
14657
|
+
let activeArr = [];
|
|
14658
|
+
if (!Array.isArray(activeName)) {
|
|
14659
|
+
activeArr.push(activeName.toString());
|
|
14660
|
+
} else {
|
|
14661
|
+
if (accordion && activeName.length > 1) {
|
|
14662
|
+
console.warn("\u624B\u98CE\u7434\u6A21\u5F0F\u4E0D\u652F\u6301\u4F20\u9012\u591A\u4E2A\u6253\u5F00\u9875\u7B7E");
|
|
14663
|
+
}
|
|
14664
|
+
const activeNameStr = activeName.map((item) => {
|
|
14665
|
+
return item.toString();
|
|
14666
|
+
});
|
|
14667
|
+
activeArr = [...activeNameStr];
|
|
14668
|
+
}
|
|
14669
|
+
return activeArr;
|
|
14670
|
+
};
|
|
14671
|
+
const colBem = cn("collapse");
|
|
14672
|
+
useEffect(() => {
|
|
14673
|
+
const activeArr = handleActiveName();
|
|
14674
|
+
setDefaultOpenIndex(activeArr);
|
|
14675
|
+
}, [activeName]);
|
|
14676
|
+
const onToggle = (isOpen, name) => {
|
|
14677
|
+
let newOpenIndex = [...defaultOpenIndex];
|
|
14678
|
+
if (isOpen) {
|
|
14679
|
+
const removeIndex = newOpenIndex.findIndex((value) => {
|
|
14680
|
+
return value === name;
|
|
14681
|
+
});
|
|
14682
|
+
newOpenIndex.splice(removeIndex, 1);
|
|
14683
|
+
} else {
|
|
14684
|
+
if (accordion) {
|
|
14685
|
+
newOpenIndex = [name];
|
|
14686
|
+
} else {
|
|
14687
|
+
newOpenIndex.push(name);
|
|
14688
|
+
}
|
|
14689
|
+
}
|
|
14690
|
+
setDefaultOpenIndex(newOpenIndex);
|
|
14691
|
+
change && change(!isOpen, name);
|
|
14692
|
+
};
|
|
14693
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14694
|
+
className: colBem()
|
|
14695
|
+
}, childrenDom.map((item) => {
|
|
14696
|
+
return React__default.cloneElement(item, {
|
|
14697
|
+
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
14698
|
+
onToggle: (isOpen, name) => onToggle(isOpen, name),
|
|
14699
|
+
icon,
|
|
14700
|
+
rotate,
|
|
14701
|
+
iconSize,
|
|
14702
|
+
iconColor
|
|
14703
|
+
});
|
|
14704
|
+
}));
|
|
14705
|
+
},
|
|
14706
|
+
areEqual
|
|
14707
|
+
);
|
|
14527
14708
|
Collapse.defaultProps = defaultProps$h;
|
|
14528
14709
|
Collapse.displayName = "NutCollapse";
|
|
14529
14710
|
const defaultProps$g = {
|
|
@@ -14574,18 +14755,23 @@ const CollapseItem = (props) => {
|
|
|
14574
14755
|
setCurrHeight("auto");
|
|
14575
14756
|
setUpdate(!update2);
|
|
14576
14757
|
}, [children]);
|
|
14577
|
-
const measuredRef = useCallback(
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14758
|
+
const measuredRef = useCallback(
|
|
14759
|
+
(node) => {
|
|
14760
|
+
if (node !== null) {
|
|
14761
|
+
setDomHeight(node.getBoundingClientRect().height);
|
|
14762
|
+
}
|
|
14763
|
+
},
|
|
14764
|
+
[update2]
|
|
14765
|
+
);
|
|
14582
14766
|
useEffect(() => {
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
14588
|
-
|
|
14767
|
+
setTimeout(() => {
|
|
14768
|
+
if (domHeight !== -1) {
|
|
14769
|
+
isOpen ? setCurrHeight(`${domHeight}px`) : setCurrHeight("0px");
|
|
14770
|
+
}
|
|
14771
|
+
const newIconStyle = isOpen ? { transform: `translateY(-50%) rotate(${rotate}deg)` } : { transform: "translateY(-50%)" };
|
|
14772
|
+
setIconStyle(newIconStyle);
|
|
14773
|
+
}, 10);
|
|
14774
|
+
}, [isOpen, domHeight, rotate]);
|
|
14589
14775
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14590
14776
|
className: colBem(),
|
|
14591
14777
|
...rest
|
|
@@ -14665,8 +14851,12 @@ const CountUp = (props) => {
|
|
|
14665
14851
|
const numerArr = getShowNumber();
|
|
14666
14852
|
const setNumberTransform = () => {
|
|
14667
14853
|
if (countupRef.current) {
|
|
14668
|
-
const numberItems = countupRef.current.querySelectorAll(
|
|
14669
|
-
|
|
14854
|
+
const numberItems = countupRef.current.querySelectorAll(
|
|
14855
|
+
".nut-countup__number"
|
|
14856
|
+
);
|
|
14857
|
+
const numberFilterArr = numerArr.filter(
|
|
14858
|
+
(item) => !Number.isNaN(Number(item))
|
|
14859
|
+
);
|
|
14670
14860
|
Object.keys(numberItems).forEach((key) => {
|
|
14671
14861
|
const elem = numberItems[Number(key)];
|
|
14672
14862
|
const idx = Number(numberFilterArr[Number(key)]);
|
|
@@ -15123,7 +15313,10 @@ const Table = (props) => {
|
|
|
15123
15313
|
const renderHeadCells = () => {
|
|
15124
15314
|
return columns.map((item, index2) => {
|
|
15125
15315
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
15126
|
-
className: classNames(
|
|
15316
|
+
className: classNames(
|
|
15317
|
+
"nut-table__main__head__tr__th",
|
|
15318
|
+
cellClasses(item)
|
|
15319
|
+
),
|
|
15127
15320
|
key: item.key,
|
|
15128
15321
|
onClick: () => handleSorterClick(item)
|
|
15129
15322
|
}, item.title, item.sorter && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
@@ -15140,7 +15333,10 @@ const Table = (props) => {
|
|
|
15140
15333
|
const renderBodyTds = (item) => {
|
|
15141
15334
|
return sortDataItem().map(([value, render], index2) => {
|
|
15142
15335
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
15143
|
-
className: classNames(
|
|
15336
|
+
className: classNames(
|
|
15337
|
+
"nut-table__main__body__tr__td",
|
|
15338
|
+
cellClasses(getColumnItem(value))
|
|
15339
|
+
),
|
|
15144
15340
|
key: value
|
|
15145
15341
|
}, typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ React__default.createElement("div", null, render ? render(item) : item[value](item)) : item[value]);
|
|
15146
15342
|
});
|
|
@@ -15512,7 +15708,9 @@ const CustomRender = (props) => {
|
|
|
15512
15708
|
return [];
|
|
15513
15709
|
data.forEach((item) => {
|
|
15514
15710
|
if (!item.title) {
|
|
15515
|
-
console.error(
|
|
15711
|
+
console.error(
|
|
15712
|
+
"[NutUI] <Address> \u8BF7\u68C0\u67E5\u6570\u7EC4\u9009\u9879\u7684 title \u503C\u662F\u5426\u6709\u8BBE\u7F6E ,title \u4E3A\u5FC5\u586B\u9879 ."
|
|
15713
|
+
);
|
|
15516
15714
|
}
|
|
15517
15715
|
});
|
|
15518
15716
|
const newData = [];
|
|
@@ -15520,7 +15718,9 @@ const CustomRender = (props) => {
|
|
|
15520
15718
|
return a.title.localeCompare(b22.title);
|
|
15521
15719
|
});
|
|
15522
15720
|
data.forEach((item) => {
|
|
15523
|
-
const index2 = newData.findIndex(
|
|
15721
|
+
const index2 = newData.findIndex(
|
|
15722
|
+
(value) => value.title === item.title
|
|
15723
|
+
);
|
|
15524
15724
|
if (index2 <= -1) {
|
|
15525
15725
|
newData.push({
|
|
15526
15726
|
title: item.title,
|
|
@@ -15631,13 +15831,17 @@ const CustomRender = (props) => {
|
|
|
15631
15831
|
const val = modelValue[index2];
|
|
15632
15832
|
const arr = regionList[tabName[index2]];
|
|
15633
15833
|
if (privateType === "custom") {
|
|
15634
|
-
selectedRegionC[[tabName[index2]]] = arr.filter(
|
|
15834
|
+
selectedRegionC[[tabName[index2]]] = arr.filter(
|
|
15835
|
+
(item) => item.id === val
|
|
15836
|
+
)[0];
|
|
15635
15837
|
} else if (privateType === "custom2") {
|
|
15636
15838
|
const sumArr = [];
|
|
15637
15839
|
arr.forEach((item) => {
|
|
15638
15840
|
sumArr.push(...item.list);
|
|
15639
15841
|
});
|
|
15640
|
-
selectedRegionC[[tabName[index2]]] = sumArr.filter(
|
|
15842
|
+
selectedRegionC[[tabName[index2]]] = sumArr.filter(
|
|
15843
|
+
(item) => item.id === val
|
|
15844
|
+
)[0];
|
|
15641
15845
|
}
|
|
15642
15846
|
tagIndex = index2;
|
|
15643
15847
|
setSelectedRegion(selectedRegionC);
|
|
@@ -15685,14 +15889,23 @@ const CustomRender = (props) => {
|
|
|
15685
15889
|
className: b2("custom")
|
|
15686
15890
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15687
15891
|
className: b2("region-tab")
|
|
15688
|
-
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15892
|
+
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
15893
|
+
(key, index2) => {
|
|
15894
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15895
|
+
className: `${b2("tab-item")} ${index2 === tabIndex ? "active" : ""}`,
|
|
15896
|
+
key: index2,
|
|
15897
|
+
ref: mapRef[key],
|
|
15898
|
+
onClick: () => changeRegionTab(
|
|
15899
|
+
selectedRegion[key],
|
|
15900
|
+
index2,
|
|
15901
|
+
key
|
|
15902
|
+
)
|
|
15903
|
+
}, index2 <= tabIndex && /* @__PURE__ */ React__default.createElement("div", null, getTabName(
|
|
15904
|
+
selectedRegion[key],
|
|
15905
|
+
index2
|
|
15906
|
+
)));
|
|
15907
|
+
}
|
|
15908
|
+
), /* @__PURE__ */ React__default.createElement("div", {
|
|
15696
15909
|
className: b2("tab-line"),
|
|
15697
15910
|
ref: regionLine,
|
|
15698
15911
|
style: { left: `${lineDistance}px` }
|
|
@@ -15700,21 +15913,23 @@ const CustomRender = (props) => {
|
|
|
15700
15913
|
className: b2("region-con")
|
|
15701
15914
|
}, /* @__PURE__ */ React__default.createElement("ul", {
|
|
15702
15915
|
className: b2("region-group")
|
|
15703
|
-
}, regionList[tabName[tabIndex]].map(
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15710
|
-
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
|
|
15916
|
+
}, regionList[tabName[tabIndex]].map(
|
|
15917
|
+
(item, index2) => {
|
|
15918
|
+
return /* @__PURE__ */ React__default.createElement("li", {
|
|
15919
|
+
key: index2,
|
|
15920
|
+
className: b2("region-item")
|
|
15921
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15922
|
+
onClick: () => {
|
|
15923
|
+
nextAreaList(item);
|
|
15924
|
+
}
|
|
15925
|
+
}, selectedRegion && selectedRegion[tabName[tabIndex]].id === item.id && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
15926
|
+
className: b2("region-item--icon"),
|
|
15927
|
+
name: "Check",
|
|
15928
|
+
color: "#FA2C19",
|
|
15929
|
+
size: "13px"
|
|
15930
|
+
}), item.name));
|
|
15931
|
+
}
|
|
15932
|
+
))), privateType === "custom2" && /* @__PURE__ */ React__default.createElement("div", {
|
|
15718
15933
|
className: b2("elevator-group")
|
|
15719
15934
|
}, /* @__PURE__ */ React__default.createElement(Elevator, {
|
|
15720
15935
|
height,
|
|
@@ -16220,7 +16435,9 @@ const TimeDetail = (props) => {
|
|
|
16220
16435
|
const b2 = cn("timedetail");
|
|
16221
16436
|
const [renderData, setRenderData] = useState([]);
|
|
16222
16437
|
useEffect(() => {
|
|
16223
|
-
const currentData = times.find(
|
|
16438
|
+
const currentData = times.find(
|
|
16439
|
+
(timesItem) => String(timesItem.key) === String(currentKey)
|
|
16440
|
+
);
|
|
16224
16441
|
const renderData2 = currentData ? currentData.list : [];
|
|
16225
16442
|
setRenderData(renderData2);
|
|
16226
16443
|
}, [times, currentKey]);
|
|
@@ -16229,7 +16446,9 @@ const TimeDetail = (props) => {
|
|
|
16229
16446
|
};
|
|
16230
16447
|
const getDetailClass = (item) => {
|
|
16231
16448
|
let initClass = "nut-timedetail__item";
|
|
16232
|
-
const curTimeData = currentTime.find(
|
|
16449
|
+
const curTimeData = currentTime.find(
|
|
16450
|
+
(item2) => String(item2.key) === String(currentKey)
|
|
16451
|
+
);
|
|
16233
16452
|
if (curTimeData && curTimeData.list && curTimeData.list.includes(item)) {
|
|
16234
16453
|
initClass += " nut-timedetail__item-active";
|
|
16235
16454
|
}
|
|
@@ -16277,12 +16496,14 @@ const TimeSelect = (props) => {
|
|
|
16277
16496
|
...props
|
|
16278
16497
|
};
|
|
16279
16498
|
const [activeKey, setActiveKey] = useState(currentKey);
|
|
16280
|
-
const [activeTime, setActiveTime] = useState(
|
|
16281
|
-
|
|
16282
|
-
|
|
16283
|
-
|
|
16284
|
-
|
|
16285
|
-
|
|
16499
|
+
const [activeTime, setActiveTime] = useState(
|
|
16500
|
+
currentTime.length ? currentTime : [
|
|
16501
|
+
{
|
|
16502
|
+
key: currentKey,
|
|
16503
|
+
list: []
|
|
16504
|
+
}
|
|
16505
|
+
]
|
|
16506
|
+
);
|
|
16286
16507
|
const [popVisible, setPopVisible] = useState(visible);
|
|
16287
16508
|
const popStyle = {
|
|
16288
16509
|
width: "100%",
|
|
@@ -16302,7 +16523,9 @@ const TimeSelect = (props) => {
|
|
|
16302
16523
|
break;
|
|
16303
16524
|
}
|
|
16304
16525
|
}
|
|
16305
|
-
const curTimeIndex = curTimeData.list.findIndex(
|
|
16526
|
+
const curTimeIndex = curTimeData.list.findIndex(
|
|
16527
|
+
(item) => String(item) === String(time)
|
|
16528
|
+
);
|
|
16306
16529
|
if (curTimeIndex === -1) {
|
|
16307
16530
|
curTimeData.list.push(time);
|
|
16308
16531
|
} else {
|
|
@@ -16318,7 +16541,9 @@ const TimeSelect = (props) => {
|
|
|
16318
16541
|
if (String(pannelKey) !== String(activeKey)) {
|
|
16319
16542
|
setActiveKey == null ? void 0 : setActiveKey(pannelKey);
|
|
16320
16543
|
if (multiple) {
|
|
16321
|
-
const curTimeDataIndex = activeTime.findIndex(
|
|
16544
|
+
const curTimeDataIndex = activeTime.findIndex(
|
|
16545
|
+
(item) => String(item.key) === String(pannelKey)
|
|
16546
|
+
);
|
|
16322
16547
|
if (curTimeDataIndex === -1) {
|
|
16323
16548
|
resultTimeData.push({
|
|
16324
16549
|
key: pannelKey,
|