@nutui/nutui-react 1.2.3-beta.1 → 1.2.3-beta.2
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/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 +628 -407
- package/dist/nutui.react.umd.js +8 -8
- package/dist/style.es.js +1 -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/demo.d.ts +1 -0
- 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 +5 -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.1 Wed Aug 17 2022 09:35:38 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
|
|
@@ -6573,10 +6702,14 @@ class Upload {
|
|
|
6573
6702
|
const xhr = new XMLHttpRequest();
|
|
6574
6703
|
xhr.timeout = options2.timeout;
|
|
6575
6704
|
if (xhr.upload) {
|
|
6576
|
-
xhr.upload.addEventListener(
|
|
6577
|
-
|
|
6578
|
-
(
|
|
6579
|
-
|
|
6705
|
+
xhr.upload.addEventListener(
|
|
6706
|
+
"progress",
|
|
6707
|
+
(e2) => {
|
|
6708
|
+
var _a2;
|
|
6709
|
+
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
6710
|
+
},
|
|
6711
|
+
false
|
|
6712
|
+
);
|
|
6580
6713
|
xhr.onreadystatechange = () => {
|
|
6581
6714
|
var _a2, _b;
|
|
6582
6715
|
if (xhr.readyState === 4) {
|
|
@@ -6775,9 +6908,11 @@ const InternalUploader = (props, ref) => {
|
|
|
6775
6908
|
if (props.autoUpload) {
|
|
6776
6909
|
task.upload();
|
|
6777
6910
|
} else {
|
|
6778
|
-
uploadQueue.push(
|
|
6779
|
-
resolve
|
|
6780
|
-
|
|
6911
|
+
uploadQueue.push(
|
|
6912
|
+
new Promise((resolve, reject) => {
|
|
6913
|
+
resolve(task);
|
|
6914
|
+
})
|
|
6915
|
+
);
|
|
6781
6916
|
setUploadQueue(uploadQueue);
|
|
6782
6917
|
}
|
|
6783
6918
|
};
|
|
@@ -6846,10 +6981,12 @@ const InternalUploader = (props, ref) => {
|
|
|
6846
6981
|
const $el = event.target;
|
|
6847
6982
|
const { files } = $el;
|
|
6848
6983
|
if (beforeUpload) {
|
|
6849
|
-
beforeUpload(new Array().slice.call(files)).then(
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6984
|
+
beforeUpload(new Array().slice.call(files)).then(
|
|
6985
|
+
(f2) => {
|
|
6986
|
+
const _files = filterFiles(new Array().slice.call(f2));
|
|
6987
|
+
readFile(_files);
|
|
6988
|
+
}
|
|
6989
|
+
);
|
|
6853
6990
|
} else {
|
|
6854
6991
|
const _files = filterFiles(new Array().slice.call(files));
|
|
6855
6992
|
readFile(_files);
|
|
@@ -7231,12 +7368,23 @@ const NumberKeyboard = (props) => {
|
|
|
7231
7368
|
}
|
|
7232
7369
|
if (customKeys.length === 1) {
|
|
7233
7370
|
if (props.title && props.type !== "rightColumn") {
|
|
7234
|
-
keys.push(
|
|
7371
|
+
keys.push(
|
|
7372
|
+
{ id: customKeys[0], type: "custom" },
|
|
7373
|
+
{ id: 0, type: "number" },
|
|
7374
|
+
{ id: "delete", type: "delete" }
|
|
7375
|
+
);
|
|
7235
7376
|
} else {
|
|
7236
|
-
keys.push(
|
|
7377
|
+
keys.push(
|
|
7378
|
+
{ id: 0, type: "number" },
|
|
7379
|
+
{ id: customKeys[0], type: "custom" }
|
|
7380
|
+
);
|
|
7237
7381
|
}
|
|
7238
7382
|
} else if (customKeys.length === 2) {
|
|
7239
|
-
keys.push(
|
|
7383
|
+
keys.push(
|
|
7384
|
+
{ id: customKeys[0], type: "custom" },
|
|
7385
|
+
{ id: 0, type: "number" },
|
|
7386
|
+
{ id: customKeys[1], type: "custom" }
|
|
7387
|
+
);
|
|
7240
7388
|
}
|
|
7241
7389
|
return keys;
|
|
7242
7390
|
};
|
|
@@ -8795,9 +8943,9 @@ let findTimeout = (time) => ~(~timeouts.findIndex((t2) => t2.time > time) || ~ti
|
|
|
8795
8943
|
raf.cancel = (fn) => {
|
|
8796
8944
|
onStartQueue.delete(fn);
|
|
8797
8945
|
onFrameQueue.delete(fn);
|
|
8946
|
+
onFinishQueue.delete(fn);
|
|
8798
8947
|
updateQueue.delete(fn);
|
|
8799
8948
|
writeQueue.delete(fn);
|
|
8800
|
-
onFinishQueue.delete(fn);
|
|
8801
8949
|
};
|
|
8802
8950
|
raf.sync = (fn) => {
|
|
8803
8951
|
sync = true;
|
|
@@ -8875,14 +9023,15 @@ function update() {
|
|
|
8875
9023
|
eachSafely(timeouts.splice(0, count), (t2) => t2.handler());
|
|
8876
9024
|
pendingCount -= count;
|
|
8877
9025
|
}
|
|
9026
|
+
if (!pendingCount) {
|
|
9027
|
+
stop();
|
|
9028
|
+
return;
|
|
9029
|
+
}
|
|
8878
9030
|
onStartQueue.flush();
|
|
8879
9031
|
updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
|
|
8880
9032
|
onFrameQueue.flush();
|
|
8881
9033
|
writeQueue.flush();
|
|
8882
9034
|
onFinishQueue.flush();
|
|
8883
|
-
if (!pendingCount) {
|
|
8884
|
-
stop();
|
|
8885
|
-
}
|
|
8886
9035
|
}
|
|
8887
9036
|
function makeQueue() {
|
|
8888
9037
|
let next = /* @__PURE__ */ new Set();
|
|
@@ -9564,10 +9713,10 @@ function deprecateDirectCall() {
|
|
|
9564
9713
|
function isAnimatedString(value) {
|
|
9565
9714
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
|
|
9566
9715
|
}
|
|
9567
|
-
const
|
|
9716
|
+
const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
|
|
9568
9717
|
const useIsMounted = () => {
|
|
9569
9718
|
const isMounted = useRef(false);
|
|
9570
|
-
|
|
9719
|
+
useIsomorphicLayoutEffect(() => {
|
|
9571
9720
|
isMounted.current = true;
|
|
9572
9721
|
return () => {
|
|
9573
9722
|
isMounted.current = false;
|
|
@@ -9849,7 +9998,7 @@ const withAnimated = (Component2, host2) => {
|
|
|
9849
9998
|
};
|
|
9850
9999
|
const observer = new PropsObserver(callback, deps);
|
|
9851
10000
|
const observerRef = useRef();
|
|
9852
|
-
|
|
10001
|
+
useIsomorphicLayoutEffect(() => {
|
|
9853
10002
|
observerRef.current = observer;
|
|
9854
10003
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
9855
10004
|
return () => {
|
|
@@ -11585,7 +11734,7 @@ function useSprings(length, props, deps) {
|
|
|
11585
11734
|
const context2 = useContext$1(SpringContext);
|
|
11586
11735
|
const prevContext = usePrev(context2);
|
|
11587
11736
|
const hasContext = context2 !== prevContext && hasProps(context2);
|
|
11588
|
-
|
|
11737
|
+
useIsomorphicLayoutEffect(() => {
|
|
11589
11738
|
layoutId.current++;
|
|
11590
11739
|
state.ctrls = ctrls.current;
|
|
11591
11740
|
const {
|
|
@@ -11973,26 +12122,29 @@ const Drag = (props) => {
|
|
|
11973
12122
|
middleLine.current = clientWidth - offsetWidth - offsetLeft - (clientWidth - offsetWidth) / 2;
|
|
11974
12123
|
}
|
|
11975
12124
|
};
|
|
11976
|
-
const bind = useDrag(
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
if (
|
|
11980
|
-
if (
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
12125
|
+
const bind = useDrag(
|
|
12126
|
+
({ down, last, offset: [x2, y2] }) => {
|
|
12127
|
+
api.start({ x: x2, y: y2, immediate: down });
|
|
12128
|
+
if (last) {
|
|
12129
|
+
if (props.direction != "y" && props.attract) {
|
|
12130
|
+
if (x2 < middleLine.current) {
|
|
12131
|
+
api.start({ x: boundaryState.left, y: y2, immediate: down });
|
|
12132
|
+
} else {
|
|
12133
|
+
api.start({
|
|
12134
|
+
x: boundaryState.right,
|
|
12135
|
+
y: y2,
|
|
12136
|
+
immediate: down
|
|
12137
|
+
});
|
|
12138
|
+
}
|
|
11988
12139
|
}
|
|
11989
12140
|
}
|
|
12141
|
+
},
|
|
12142
|
+
{
|
|
12143
|
+
from: () => [currstyle.x.get(), currstyle.y.get()],
|
|
12144
|
+
axis: direction,
|
|
12145
|
+
bounds: boundaryState
|
|
11990
12146
|
}
|
|
11991
|
-
|
|
11992
|
-
from: () => [currstyle.x.get(), currstyle.y.get()],
|
|
11993
|
-
axis: direction,
|
|
11994
|
-
bounds: boundaryState
|
|
11995
|
-
});
|
|
12147
|
+
);
|
|
11996
12148
|
useEffect(() => {
|
|
11997
12149
|
getInfo();
|
|
11998
12150
|
}, [myDrag]);
|
|
@@ -12146,12 +12298,15 @@ function confirm(config2, renderFunc) {
|
|
|
12146
12298
|
}
|
|
12147
12299
|
if (ret && ret.then) {
|
|
12148
12300
|
renderFunction(dialogConfig);
|
|
12149
|
-
ret.then(
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12301
|
+
ret.then(
|
|
12302
|
+
() => {
|
|
12303
|
+
onCancel(true);
|
|
12304
|
+
},
|
|
12305
|
+
(e2) => {
|
|
12306
|
+
console.error(e2);
|
|
12307
|
+
renderFunction(dialogConfig);
|
|
12308
|
+
}
|
|
12309
|
+
);
|
|
12155
12310
|
}
|
|
12156
12311
|
if (!ret) {
|
|
12157
12312
|
onCancel(true);
|
|
@@ -12340,7 +12495,9 @@ const Infiniteloading = (props) => {
|
|
|
12340
12495
|
const b2 = cn("infiniteloading");
|
|
12341
12496
|
const classes = classNames(className, b2());
|
|
12342
12497
|
useEffect(() => {
|
|
12343
|
-
const parentElement = getParentElement(
|
|
12498
|
+
const parentElement = getParentElement(
|
|
12499
|
+
scroller.current
|
|
12500
|
+
);
|
|
12344
12501
|
scrollEl.current = useWindow ? window : parentElement;
|
|
12345
12502
|
scrollEl.current.addEventListener("scroll", handleScroll, useCapture);
|
|
12346
12503
|
return () => {
|
|
@@ -12764,7 +12921,9 @@ const CircleProgress = (props) => {
|
|
|
12764
12921
|
return;
|
|
12765
12922
|
}
|
|
12766
12923
|
const color = circleColor;
|
|
12767
|
-
const colorArr = Object.keys(color).sort(
|
|
12924
|
+
const colorArr = Object.keys(color).sort(
|
|
12925
|
+
(a, b22) => parseFloat(a) - parseFloat(b22)
|
|
12926
|
+
);
|
|
12768
12927
|
const stopArr = [];
|
|
12769
12928
|
colorArr.map((item) => {
|
|
12770
12929
|
const obj = {
|
|
@@ -12946,7 +13105,10 @@ const NoticeBar = (props) => {
|
|
|
12946
13105
|
};
|
|
12947
13106
|
const startRollEasy = () => {
|
|
12948
13107
|
showhorseLamp();
|
|
12949
|
-
const timerCurr = window.setInterval(
|
|
13108
|
+
const timerCurr = window.setInterval(
|
|
13109
|
+
showhorseLamp,
|
|
13110
|
+
~~(height / speed / 4) * 1e3 + Number(standTime)
|
|
13111
|
+
);
|
|
12950
13112
|
SetTimer(timerCurr);
|
|
12951
13113
|
};
|
|
12952
13114
|
const showhorseLamp = () => {
|
|
@@ -13090,16 +13252,24 @@ const Steps = (props) => {
|
|
|
13090
13252
|
propSteps
|
|
13091
13253
|
};
|
|
13092
13254
|
const b2 = cn("steps");
|
|
13093
|
-
const classes = classNames(
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13255
|
+
const classes = classNames(
|
|
13256
|
+
{
|
|
13257
|
+
[`${b2("")}-${direction}`]: true,
|
|
13258
|
+
[`${b2("")}-dot`]: !!props.progressDot
|
|
13259
|
+
},
|
|
13260
|
+
className,
|
|
13261
|
+
b2("")
|
|
13262
|
+
);
|
|
13097
13263
|
return /* @__PURE__ */ React__default.createElement(DataContext$1.Provider, {
|
|
13098
13264
|
value: parentSteps
|
|
13099
|
-
}, React__default.createElement(
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13265
|
+
}, React__default.createElement(
|
|
13266
|
+
"div",
|
|
13267
|
+
{
|
|
13268
|
+
className: classes,
|
|
13269
|
+
...restProps
|
|
13270
|
+
},
|
|
13271
|
+
children
|
|
13272
|
+
));
|
|
13103
13273
|
};
|
|
13104
13274
|
Steps.defaultProps = defaultProps$t;
|
|
13105
13275
|
Steps.displayName = "NutSteps";
|
|
@@ -13142,9 +13312,13 @@ const Step = (props) => {
|
|
|
13142
13312
|
}
|
|
13143
13313
|
};
|
|
13144
13314
|
const b2 = cn("step");
|
|
13145
|
-
const classes = classNames(
|
|
13146
|
-
|
|
13147
|
-
|
|
13315
|
+
const classes = classNames(
|
|
13316
|
+
{
|
|
13317
|
+
[`${b2("")}-${getCurrentStatus()}`]: true
|
|
13318
|
+
},
|
|
13319
|
+
className,
|
|
13320
|
+
b2("")
|
|
13321
|
+
);
|
|
13148
13322
|
const renderIconClass = () => {
|
|
13149
13323
|
if (!dot && icon) {
|
|
13150
13324
|
return "nut-step-icon is-icon";
|
|
@@ -14458,72 +14632,75 @@ const defaultProps$h = {
|
|
|
14458
14632
|
function areEqual(prevProps, nextProps) {
|
|
14459
14633
|
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
14460
14634
|
}
|
|
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),
|
|
14635
|
+
const Collapse = memo(
|
|
14636
|
+
(props) => {
|
|
14637
|
+
const {
|
|
14638
|
+
children,
|
|
14639
|
+
activeName,
|
|
14640
|
+
accordion,
|
|
14520
14641
|
icon,
|
|
14521
14642
|
rotate,
|
|
14522
14643
|
iconSize,
|
|
14523
|
-
iconColor
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14644
|
+
iconColor,
|
|
14645
|
+
change
|
|
14646
|
+
} = {
|
|
14647
|
+
...defaultProps$h,
|
|
14648
|
+
...props
|
|
14649
|
+
};
|
|
14650
|
+
const childrenDom = React__default.Children.toArray(children);
|
|
14651
|
+
const [defaultOpenIndex, setDefaultOpenIndex] = useState([]);
|
|
14652
|
+
const handleActiveName = () => {
|
|
14653
|
+
let activeArr = [];
|
|
14654
|
+
if (!Array.isArray(activeName)) {
|
|
14655
|
+
activeArr.push(activeName.toString());
|
|
14656
|
+
} else {
|
|
14657
|
+
if (accordion && activeName.length > 1) {
|
|
14658
|
+
console.warn("\u624B\u98CE\u7434\u6A21\u5F0F\u4E0D\u652F\u6301\u4F20\u9012\u591A\u4E2A\u6253\u5F00\u9875\u7B7E");
|
|
14659
|
+
}
|
|
14660
|
+
const activeNameStr = activeName.map((item) => {
|
|
14661
|
+
return item.toString();
|
|
14662
|
+
});
|
|
14663
|
+
activeArr = [...activeNameStr];
|
|
14664
|
+
}
|
|
14665
|
+
return activeArr;
|
|
14666
|
+
};
|
|
14667
|
+
const colBem = cn("collapse");
|
|
14668
|
+
useEffect(() => {
|
|
14669
|
+
const activeArr = handleActiveName();
|
|
14670
|
+
setDefaultOpenIndex(activeArr);
|
|
14671
|
+
}, [activeName]);
|
|
14672
|
+
const onToggle = (isOpen, name) => {
|
|
14673
|
+
let newOpenIndex = [...defaultOpenIndex];
|
|
14674
|
+
if (isOpen) {
|
|
14675
|
+
const removeIndex = newOpenIndex.findIndex((value) => {
|
|
14676
|
+
return value === name;
|
|
14677
|
+
});
|
|
14678
|
+
newOpenIndex.splice(removeIndex, 1);
|
|
14679
|
+
} else {
|
|
14680
|
+
if (accordion) {
|
|
14681
|
+
newOpenIndex = [name];
|
|
14682
|
+
} else {
|
|
14683
|
+
newOpenIndex.push(name);
|
|
14684
|
+
}
|
|
14685
|
+
}
|
|
14686
|
+
setDefaultOpenIndex(newOpenIndex);
|
|
14687
|
+
change && change(!isOpen, name);
|
|
14688
|
+
};
|
|
14689
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14690
|
+
className: colBem()
|
|
14691
|
+
}, childrenDom.map((item) => {
|
|
14692
|
+
return React__default.cloneElement(item, {
|
|
14693
|
+
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
14694
|
+
onToggle: (isOpen, name) => onToggle(isOpen, name),
|
|
14695
|
+
icon,
|
|
14696
|
+
rotate,
|
|
14697
|
+
iconSize,
|
|
14698
|
+
iconColor
|
|
14699
|
+
});
|
|
14700
|
+
}));
|
|
14701
|
+
},
|
|
14702
|
+
areEqual
|
|
14703
|
+
);
|
|
14527
14704
|
Collapse.defaultProps = defaultProps$h;
|
|
14528
14705
|
Collapse.displayName = "NutCollapse";
|
|
14529
14706
|
const defaultProps$g = {
|
|
@@ -14574,18 +14751,23 @@ const CollapseItem = (props) => {
|
|
|
14574
14751
|
setCurrHeight("auto");
|
|
14575
14752
|
setUpdate(!update2);
|
|
14576
14753
|
}, [children]);
|
|
14577
|
-
const measuredRef = useCallback(
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14754
|
+
const measuredRef = useCallback(
|
|
14755
|
+
(node) => {
|
|
14756
|
+
if (node !== null) {
|
|
14757
|
+
setDomHeight(node.getBoundingClientRect().height);
|
|
14758
|
+
}
|
|
14759
|
+
},
|
|
14760
|
+
[update2]
|
|
14761
|
+
);
|
|
14582
14762
|
useEffect(() => {
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
14588
|
-
|
|
14763
|
+
setTimeout(() => {
|
|
14764
|
+
if (domHeight !== -1) {
|
|
14765
|
+
isOpen ? setCurrHeight(`${domHeight}px`) : setCurrHeight("0px");
|
|
14766
|
+
}
|
|
14767
|
+
const newIconStyle = isOpen ? { transform: `translateY(-50%) rotate(${rotate}deg)` } : { transform: "translateY(-50%)" };
|
|
14768
|
+
setIconStyle(newIconStyle);
|
|
14769
|
+
}, 10);
|
|
14770
|
+
}, [isOpen, domHeight, rotate]);
|
|
14589
14771
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14590
14772
|
className: colBem(),
|
|
14591
14773
|
...rest
|
|
@@ -14665,8 +14847,12 @@ const CountUp = (props) => {
|
|
|
14665
14847
|
const numerArr = getShowNumber();
|
|
14666
14848
|
const setNumberTransform = () => {
|
|
14667
14849
|
if (countupRef.current) {
|
|
14668
|
-
const numberItems = countupRef.current.querySelectorAll(
|
|
14669
|
-
|
|
14850
|
+
const numberItems = countupRef.current.querySelectorAll(
|
|
14851
|
+
".nut-countup__number"
|
|
14852
|
+
);
|
|
14853
|
+
const numberFilterArr = numerArr.filter(
|
|
14854
|
+
(item) => !Number.isNaN(Number(item))
|
|
14855
|
+
);
|
|
14670
14856
|
Object.keys(numberItems).forEach((key) => {
|
|
14671
14857
|
const elem = numberItems[Number(key)];
|
|
14672
14858
|
const idx = Number(numberFilterArr[Number(key)]);
|
|
@@ -15123,7 +15309,10 @@ const Table = (props) => {
|
|
|
15123
15309
|
const renderHeadCells = () => {
|
|
15124
15310
|
return columns.map((item, index2) => {
|
|
15125
15311
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
15126
|
-
className: classNames(
|
|
15312
|
+
className: classNames(
|
|
15313
|
+
"nut-table__main__head__tr__th",
|
|
15314
|
+
cellClasses(item)
|
|
15315
|
+
),
|
|
15127
15316
|
key: item.key,
|
|
15128
15317
|
onClick: () => handleSorterClick(item)
|
|
15129
15318
|
}, item.title, item.sorter && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
@@ -15140,7 +15329,10 @@ const Table = (props) => {
|
|
|
15140
15329
|
const renderBodyTds = (item) => {
|
|
15141
15330
|
return sortDataItem().map(([value, render], index2) => {
|
|
15142
15331
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
15143
|
-
className: classNames(
|
|
15332
|
+
className: classNames(
|
|
15333
|
+
"nut-table__main__body__tr__td",
|
|
15334
|
+
cellClasses(getColumnItem(value))
|
|
15335
|
+
),
|
|
15144
15336
|
key: value
|
|
15145
15337
|
}, typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ React__default.createElement("div", null, render ? render(item) : item[value](item)) : item[value]);
|
|
15146
15338
|
});
|
|
@@ -15512,7 +15704,9 @@ const CustomRender = (props) => {
|
|
|
15512
15704
|
return [];
|
|
15513
15705
|
data.forEach((item) => {
|
|
15514
15706
|
if (!item.title) {
|
|
15515
|
-
console.error(
|
|
15707
|
+
console.error(
|
|
15708
|
+
"[NutUI] <Address> \u8BF7\u68C0\u67E5\u6570\u7EC4\u9009\u9879\u7684 title \u503C\u662F\u5426\u6709\u8BBE\u7F6E ,title \u4E3A\u5FC5\u586B\u9879 ."
|
|
15709
|
+
);
|
|
15516
15710
|
}
|
|
15517
15711
|
});
|
|
15518
15712
|
const newData = [];
|
|
@@ -15520,7 +15714,9 @@ const CustomRender = (props) => {
|
|
|
15520
15714
|
return a.title.localeCompare(b22.title);
|
|
15521
15715
|
});
|
|
15522
15716
|
data.forEach((item) => {
|
|
15523
|
-
const index2 = newData.findIndex(
|
|
15717
|
+
const index2 = newData.findIndex(
|
|
15718
|
+
(value) => value.title === item.title
|
|
15719
|
+
);
|
|
15524
15720
|
if (index2 <= -1) {
|
|
15525
15721
|
newData.push({
|
|
15526
15722
|
title: item.title,
|
|
@@ -15631,13 +15827,17 @@ const CustomRender = (props) => {
|
|
|
15631
15827
|
const val = modelValue[index2];
|
|
15632
15828
|
const arr = regionList[tabName[index2]];
|
|
15633
15829
|
if (privateType === "custom") {
|
|
15634
|
-
selectedRegionC[[tabName[index2]]] = arr.filter(
|
|
15830
|
+
selectedRegionC[[tabName[index2]]] = arr.filter(
|
|
15831
|
+
(item) => item.id === val
|
|
15832
|
+
)[0];
|
|
15635
15833
|
} else if (privateType === "custom2") {
|
|
15636
15834
|
const sumArr = [];
|
|
15637
15835
|
arr.forEach((item) => {
|
|
15638
15836
|
sumArr.push(...item.list);
|
|
15639
15837
|
});
|
|
15640
|
-
selectedRegionC[[tabName[index2]]] = sumArr.filter(
|
|
15838
|
+
selectedRegionC[[tabName[index2]]] = sumArr.filter(
|
|
15839
|
+
(item) => item.id === val
|
|
15840
|
+
)[0];
|
|
15641
15841
|
}
|
|
15642
15842
|
tagIndex = index2;
|
|
15643
15843
|
setSelectedRegion(selectedRegionC);
|
|
@@ -15685,14 +15885,23 @@ const CustomRender = (props) => {
|
|
|
15685
15885
|
className: b2("custom")
|
|
15686
15886
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15687
15887
|
className: b2("region-tab")
|
|
15688
|
-
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15888
|
+
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
15889
|
+
(key, index2) => {
|
|
15890
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15891
|
+
className: `${b2("tab-item")} ${index2 === tabIndex ? "active" : ""}`,
|
|
15892
|
+
key: index2,
|
|
15893
|
+
ref: mapRef[key],
|
|
15894
|
+
onClick: () => changeRegionTab(
|
|
15895
|
+
selectedRegion[key],
|
|
15896
|
+
index2,
|
|
15897
|
+
key
|
|
15898
|
+
)
|
|
15899
|
+
}, index2 <= tabIndex && /* @__PURE__ */ React__default.createElement("div", null, getTabName(
|
|
15900
|
+
selectedRegion[key],
|
|
15901
|
+
index2
|
|
15902
|
+
)));
|
|
15903
|
+
}
|
|
15904
|
+
), /* @__PURE__ */ React__default.createElement("div", {
|
|
15696
15905
|
className: b2("tab-line"),
|
|
15697
15906
|
ref: regionLine,
|
|
15698
15907
|
style: { left: `${lineDistance}px` }
|
|
@@ -15700,21 +15909,23 @@ const CustomRender = (props) => {
|
|
|
15700
15909
|
className: b2("region-con")
|
|
15701
15910
|
}, /* @__PURE__ */ React__default.createElement("ul", {
|
|
15702
15911
|
className: b2("region-group")
|
|
15703
|
-
}, regionList[tabName[tabIndex]].map(
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15710
|
-
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
|
|
15912
|
+
}, regionList[tabName[tabIndex]].map(
|
|
15913
|
+
(item, index2) => {
|
|
15914
|
+
return /* @__PURE__ */ React__default.createElement("li", {
|
|
15915
|
+
key: index2,
|
|
15916
|
+
className: b2("region-item")
|
|
15917
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15918
|
+
onClick: () => {
|
|
15919
|
+
nextAreaList(item);
|
|
15920
|
+
}
|
|
15921
|
+
}, selectedRegion && selectedRegion[tabName[tabIndex]].id === item.id && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
15922
|
+
className: b2("region-item--icon"),
|
|
15923
|
+
name: "Check",
|
|
15924
|
+
color: "#FA2C19",
|
|
15925
|
+
size: "13px"
|
|
15926
|
+
}), item.name));
|
|
15927
|
+
}
|
|
15928
|
+
))), privateType === "custom2" && /* @__PURE__ */ React__default.createElement("div", {
|
|
15718
15929
|
className: b2("elevator-group")
|
|
15719
15930
|
}, /* @__PURE__ */ React__default.createElement(Elevator, {
|
|
15720
15931
|
height,
|
|
@@ -16220,7 +16431,9 @@ const TimeDetail = (props) => {
|
|
|
16220
16431
|
const b2 = cn("timedetail");
|
|
16221
16432
|
const [renderData, setRenderData] = useState([]);
|
|
16222
16433
|
useEffect(() => {
|
|
16223
|
-
const currentData = times.find(
|
|
16434
|
+
const currentData = times.find(
|
|
16435
|
+
(timesItem) => String(timesItem.key) === String(currentKey)
|
|
16436
|
+
);
|
|
16224
16437
|
const renderData2 = currentData ? currentData.list : [];
|
|
16225
16438
|
setRenderData(renderData2);
|
|
16226
16439
|
}, [times, currentKey]);
|
|
@@ -16229,7 +16442,9 @@ const TimeDetail = (props) => {
|
|
|
16229
16442
|
};
|
|
16230
16443
|
const getDetailClass = (item) => {
|
|
16231
16444
|
let initClass = "nut-timedetail__item";
|
|
16232
|
-
const curTimeData = currentTime.find(
|
|
16445
|
+
const curTimeData = currentTime.find(
|
|
16446
|
+
(item2) => String(item2.key) === String(currentKey)
|
|
16447
|
+
);
|
|
16233
16448
|
if (curTimeData && curTimeData.list && curTimeData.list.includes(item)) {
|
|
16234
16449
|
initClass += " nut-timedetail__item-active";
|
|
16235
16450
|
}
|
|
@@ -16277,12 +16492,14 @@ const TimeSelect = (props) => {
|
|
|
16277
16492
|
...props
|
|
16278
16493
|
};
|
|
16279
16494
|
const [activeKey, setActiveKey] = useState(currentKey);
|
|
16280
|
-
const [activeTime, setActiveTime] = useState(
|
|
16281
|
-
|
|
16282
|
-
|
|
16283
|
-
|
|
16284
|
-
|
|
16285
|
-
|
|
16495
|
+
const [activeTime, setActiveTime] = useState(
|
|
16496
|
+
currentTime.length ? currentTime : [
|
|
16497
|
+
{
|
|
16498
|
+
key: currentKey,
|
|
16499
|
+
list: []
|
|
16500
|
+
}
|
|
16501
|
+
]
|
|
16502
|
+
);
|
|
16286
16503
|
const [popVisible, setPopVisible] = useState(visible);
|
|
16287
16504
|
const popStyle = {
|
|
16288
16505
|
width: "100%",
|
|
@@ -16302,7 +16519,9 @@ const TimeSelect = (props) => {
|
|
|
16302
16519
|
break;
|
|
16303
16520
|
}
|
|
16304
16521
|
}
|
|
16305
|
-
const curTimeIndex = curTimeData.list.findIndex(
|
|
16522
|
+
const curTimeIndex = curTimeData.list.findIndex(
|
|
16523
|
+
(item) => String(item) === String(time)
|
|
16524
|
+
);
|
|
16306
16525
|
if (curTimeIndex === -1) {
|
|
16307
16526
|
curTimeData.list.push(time);
|
|
16308
16527
|
} else {
|
|
@@ -16318,7 +16537,9 @@ const TimeSelect = (props) => {
|
|
|
16318
16537
|
if (String(pannelKey) !== String(activeKey)) {
|
|
16319
16538
|
setActiveKey == null ? void 0 : setActiveKey(pannelKey);
|
|
16320
16539
|
if (multiple) {
|
|
16321
|
-
const curTimeDataIndex = activeTime.findIndex(
|
|
16540
|
+
const curTimeDataIndex = activeTime.findIndex(
|
|
16541
|
+
(item) => String(item.key) === String(pannelKey)
|
|
16542
|
+
);
|
|
16322
16543
|
if (curTimeDataIndex === -1) {
|
|
16323
16544
|
resultTimeData.push({
|
|
16324
16545
|
key: pannelKey,
|