@nutui/nutui-react 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/esm/AnimatingNumbers.js +9 -11
- package/dist/esm/BackTop.js +8 -6
- package/dist/esm/Checkbox.js +54 -8
- package/dist/esm/CheckboxGroup.js +26 -4
- package/dist/esm/Elevator.js +129 -36
- package/dist/esm/Icon.js +5 -3
- package/dist/esm/Input.js +252 -57
- package/dist/esm/NavBar/style/index.js +1 -1
- package/dist/esm/NavBar.js +89 -32
- package/dist/esm/Step.js +20 -3
- package/dist/esm/TabPane.js +3 -2
- package/dist/esm/Tabs.js +13 -3
- package/dist/esm/Video/style/index.js +2 -0
- package/dist/esm/Video.js +97 -0
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +770 -321
- package/dist/nutui.react.umd.js +18 -18
- package/dist/packages/animatingnumbers/animatingnumbers.scss +0 -2
- package/dist/packages/animatingnumbers/countup.scss +10 -10
- package/dist/packages/backtop/backtop.scss +8 -0
- package/dist/packages/checkbox/checkbox.scss +21 -3
- package/dist/packages/col/col.scss +1 -1
- package/dist/packages/elevator/elevator.scss +71 -39
- package/dist/packages/input/input.scss +131 -3
- package/dist/packages/navbar/navbar.scss +114 -21
- package/dist/packages/price/price.scss +0 -1
- package/dist/packages/row/row.scss +14 -0
- package/dist/packages/tabpane/tabpane.scss +5 -0
- package/dist/packages/video/video.scss +18 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/styles/variables.scss +94 -4
- package/dist/types/animatingnumbers/__tests__/animatingnumbers.spec.d.ts +1 -0
- package/dist/types/backtop/backtop.d.ts +4 -4
- package/dist/types/checkbox/checkbox.d.ts +4 -0
- package/dist/types/checkbox/demo.d.ts +1 -0
- package/dist/types/checkboxgroup/checkboxgroup.d.ts +1 -0
- package/dist/types/elevator/__tests__/elevator.spec.d.ts +1 -0
- package/dist/types/elevator/elevator.d.ts +6 -1
- package/dist/types/icon/icon.d.ts +1 -0
- package/dist/types/input/input.d.ts +42 -5
- package/dist/types/navbar/navbar.d.ts +9 -4
- package/dist/types/nutui.react.d.ts +2 -1
- package/dist/types/tabpane/tabpane.d.ts +1 -0
- package/dist/types/tabs/__test__/tabs.spec.d.ts +1 -0
- package/dist/types/tabs/tabs.d.ts +1 -0
- package/dist/types/video/__tests__/video.spec.d.ts +1 -0
- package/dist/types/video/demo.d.ts +4 -0
- package/dist/types/video/index.d.ts +2 -0
- package/dist/types/video/video.d.ts +21 -0
- package/package.json +2 -2
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.1 Wed Aug 03 2022 16:26:41 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, forwardRef, useMemo, memo } from "react";
|
|
7
|
+
import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useImperativeHandle, useLayoutEffect as useLayoutEffect$1, forwardRef, useMemo, memo } from "react";
|
|
8
8
|
import * as ReactDOM from "react-dom";
|
|
9
9
|
import ReactDOM__default, { unstable_batchedUpdates } from "react-dom";
|
|
10
10
|
var classname = { exports: {} };
|
|
@@ -45,10 +45,11 @@ classname_production_min.cn = e$1, classname_production_min.withNaming = r$1;
|
|
|
45
45
|
classname.exports = classname_production_min;
|
|
46
46
|
}
|
|
47
47
|
const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
48
|
-
const defaultProps$
|
|
48
|
+
const defaultProps$14 = {
|
|
49
49
|
name: "",
|
|
50
50
|
size: "",
|
|
51
|
-
classPrefix: "nutui-
|
|
51
|
+
classPrefix: "nutui-icon",
|
|
52
|
+
fontClassName: "nutui-iconfont",
|
|
52
53
|
color: "",
|
|
53
54
|
tag: "i",
|
|
54
55
|
click: (e2) => {
|
|
@@ -67,11 +68,12 @@ const Icon = (props) => {
|
|
|
67
68
|
tag,
|
|
68
69
|
children,
|
|
69
70
|
className,
|
|
71
|
+
fontClassName,
|
|
70
72
|
style,
|
|
71
73
|
click,
|
|
72
74
|
...rest
|
|
73
75
|
} = {
|
|
74
|
-
...defaultProps$
|
|
76
|
+
...defaultProps$14,
|
|
75
77
|
...props
|
|
76
78
|
};
|
|
77
79
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -88,7 +90,9 @@ const Icon = (props) => {
|
|
|
88
90
|
return {};
|
|
89
91
|
};
|
|
90
92
|
return React__default.createElement(type, {
|
|
91
|
-
className: isImage ? `${className || ""} ${b2("img")}` : `${className || ""} ${b2(null, [
|
|
93
|
+
className: isImage ? `${className || ""} ${b2("img")}` : `${className || ""} ${fontClassName} ${b2(null, [
|
|
94
|
+
classPrefix
|
|
95
|
+
])} nut-icon-${name} `,
|
|
92
96
|
style: {
|
|
93
97
|
color,
|
|
94
98
|
fontSize: pxCheck$2(size),
|
|
@@ -101,9 +105,9 @@ const Icon = (props) => {
|
|
|
101
105
|
...hasSrc()
|
|
102
106
|
}, children);
|
|
103
107
|
};
|
|
104
|
-
Icon.defaultProps = defaultProps$
|
|
108
|
+
Icon.defaultProps = defaultProps$14;
|
|
105
109
|
Icon.displayName = "NutIcon";
|
|
106
|
-
const defaultProps$
|
|
110
|
+
const defaultProps$13 = {
|
|
107
111
|
className: "",
|
|
108
112
|
color: "",
|
|
109
113
|
shape: "round",
|
|
@@ -136,7 +140,7 @@ const Button = (props) => {
|
|
|
136
140
|
style,
|
|
137
141
|
...rest
|
|
138
142
|
} = {
|
|
139
|
-
...defaultProps$
|
|
143
|
+
...defaultProps$13,
|
|
140
144
|
...props
|
|
141
145
|
};
|
|
142
146
|
const getStyle = useCallback(() => {
|
|
@@ -209,7 +213,7 @@ const Button = (props) => {
|
|
|
209
213
|
name: icon
|
|
210
214
|
}) : "", children));
|
|
211
215
|
};
|
|
212
|
-
Button.defaultProps = defaultProps$
|
|
216
|
+
Button.defaultProps = defaultProps$13;
|
|
213
217
|
Button.displayName = "NutButton";
|
|
214
218
|
function _setPrototypeOf(o, p2) {
|
|
215
219
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
@@ -1425,7 +1429,7 @@ var useContext = React__default.useContext;
|
|
|
1425
1429
|
function useHistory() {
|
|
1426
1430
|
return useContext(historyContext);
|
|
1427
1431
|
}
|
|
1428
|
-
const defaultProps$
|
|
1432
|
+
const defaultProps$12 = {
|
|
1429
1433
|
title: null,
|
|
1430
1434
|
subTitle: null,
|
|
1431
1435
|
desc: "",
|
|
@@ -1465,7 +1469,7 @@ const Cell = (props) => {
|
|
|
1465
1469
|
linkSlot,
|
|
1466
1470
|
...rest
|
|
1467
1471
|
} = {
|
|
1468
|
-
...defaultProps$
|
|
1472
|
+
...defaultProps$12,
|
|
1469
1473
|
...props
|
|
1470
1474
|
};
|
|
1471
1475
|
const b2 = cn("cell");
|
|
@@ -1511,9 +1515,9 @@ const Cell = (props) => {
|
|
|
1511
1515
|
className: b2("link")
|
|
1512
1516
|
}) : linkSlot));
|
|
1513
1517
|
};
|
|
1514
|
-
Cell.defaultProps = defaultProps$
|
|
1518
|
+
Cell.defaultProps = defaultProps$12;
|
|
1515
1519
|
Cell.displayName = "NutCell";
|
|
1516
|
-
const defaultProps$
|
|
1520
|
+
const defaultProps$11 = {
|
|
1517
1521
|
title: "",
|
|
1518
1522
|
desc: "",
|
|
1519
1523
|
titleSlot: null,
|
|
@@ -1522,7 +1526,7 @@ const defaultProps$10 = {
|
|
|
1522
1526
|
};
|
|
1523
1527
|
const CellGroup = (props) => {
|
|
1524
1528
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1525
|
-
...defaultProps$
|
|
1529
|
+
...defaultProps$11,
|
|
1526
1530
|
...props
|
|
1527
1531
|
};
|
|
1528
1532
|
const b2 = cn("cell-group");
|
|
@@ -1536,7 +1540,7 @@ const CellGroup = (props) => {
|
|
|
1536
1540
|
className: b2("wrap")
|
|
1537
1541
|
}, children));
|
|
1538
1542
|
};
|
|
1539
|
-
CellGroup.defaultProps = defaultProps$
|
|
1543
|
+
CellGroup.defaultProps = defaultProps$11;
|
|
1540
1544
|
CellGroup.displayName = "NutCellGroup";
|
|
1541
1545
|
var classnames = { exports: {} };
|
|
1542
1546
|
/*!
|
|
@@ -2076,7 +2080,7 @@ CSSTransition.defaultProps = {
|
|
|
2076
2080
|
};
|
|
2077
2081
|
CSSTransition.propTypes = {};
|
|
2078
2082
|
var CSSTransition$1 = CSSTransition;
|
|
2079
|
-
const defaultProps
|
|
2083
|
+
const defaultProps$10 = {
|
|
2080
2084
|
position: "center",
|
|
2081
2085
|
transition: "",
|
|
2082
2086
|
style: {},
|
|
@@ -2232,7 +2236,7 @@ const Popup = (props) => {
|
|
|
2232
2236
|
size: "12px"
|
|
2233
2237
|
})) : "")));
|
|
2234
2238
|
};
|
|
2235
|
-
Popup.defaultProps = defaultProps
|
|
2239
|
+
Popup.defaultProps = defaultProps$10;
|
|
2236
2240
|
Popup.displayName = "NutPopup";
|
|
2237
2241
|
const zhCN = {
|
|
2238
2242
|
save: "\u4FDD\u5B58",
|
|
@@ -2326,7 +2330,7 @@ const zhCN = {
|
|
|
2326
2330
|
additionalImages: (length) => `${length}\u5F20\u8FFD\u8BC4\u56FE\u7247`
|
|
2327
2331
|
}
|
|
2328
2332
|
};
|
|
2329
|
-
const defaultProps
|
|
2333
|
+
const defaultProps$$ = {
|
|
2330
2334
|
locale: zhCN
|
|
2331
2335
|
};
|
|
2332
2336
|
const defaultConfigRef = {
|
|
@@ -2343,7 +2347,7 @@ const useConfig = () => {
|
|
|
2343
2347
|
};
|
|
2344
2348
|
const ConfigContext = createContext(null);
|
|
2345
2349
|
const ConfigProvider = (props) => {
|
|
2346
|
-
const { children, ...config2 } = { ...defaultProps
|
|
2350
|
+
const { children, ...config2 } = { ...defaultProps$$, ...props };
|
|
2347
2351
|
const parentConfig = useConfig();
|
|
2348
2352
|
return /* @__PURE__ */ React__default.createElement(ConfigContext.Provider, {
|
|
2349
2353
|
value: {
|
|
@@ -2352,25 +2356,25 @@ const ConfigProvider = (props) => {
|
|
|
2352
2356
|
}
|
|
2353
2357
|
}, children);
|
|
2354
2358
|
};
|
|
2355
|
-
ConfigProvider.defaultProps = defaultProps
|
|
2359
|
+
ConfigProvider.defaultProps = defaultProps$$;
|
|
2356
2360
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2357
|
-
const defaultProps$
|
|
2361
|
+
const defaultProps$_ = {};
|
|
2358
2362
|
const Layout = (props) => {
|
|
2359
|
-
({ ...defaultProps$
|
|
2363
|
+
({ ...defaultProps$_, ...props });
|
|
2360
2364
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2361
2365
|
className: "nut-layout"
|
|
2362
2366
|
}, "Layout");
|
|
2363
2367
|
};
|
|
2364
|
-
Layout.defaultProps = defaultProps$
|
|
2368
|
+
Layout.defaultProps = defaultProps$_;
|
|
2365
2369
|
Layout.displayName = "NutLayout";
|
|
2366
2370
|
const DataContext$2 = createContext({});
|
|
2367
|
-
const defaultProps$
|
|
2371
|
+
const defaultProps$Z = {
|
|
2368
2372
|
span: "24",
|
|
2369
2373
|
offset: "0",
|
|
2370
2374
|
gutter: "0"
|
|
2371
2375
|
};
|
|
2372
2376
|
const Col = (props) => {
|
|
2373
|
-
const { span, offset, children } = { ...defaultProps$
|
|
2377
|
+
const { span, offset, children } = { ...defaultProps$Z, ...props };
|
|
2374
2378
|
const [colName, setColName] = useState("");
|
|
2375
2379
|
const [colStyle, setColStyle] = useState({});
|
|
2376
2380
|
const { gutter } = useContext$1(DataContext$2);
|
|
@@ -2393,9 +2397,9 @@ const Col = (props) => {
|
|
|
2393
2397
|
style: { ...colStyle }
|
|
2394
2398
|
}, children);
|
|
2395
2399
|
};
|
|
2396
|
-
Col.defaultProps = defaultProps$
|
|
2400
|
+
Col.defaultProps = defaultProps$Z;
|
|
2397
2401
|
Col.displayName = "NutCol";
|
|
2398
|
-
const defaultProps$
|
|
2402
|
+
const defaultProps$Y = {
|
|
2399
2403
|
type: "",
|
|
2400
2404
|
justify: "start",
|
|
2401
2405
|
align: "flex-start",
|
|
@@ -2404,7 +2408,7 @@ const defaultProps$X = {
|
|
|
2404
2408
|
};
|
|
2405
2409
|
const Row = (props) => {
|
|
2406
2410
|
const { children, type, justify, align, wrap, gutter } = {
|
|
2407
|
-
...defaultProps$
|
|
2411
|
+
...defaultProps$Y,
|
|
2408
2412
|
...props
|
|
2409
2413
|
};
|
|
2410
2414
|
const prefixCls = "nut-row";
|
|
@@ -2429,9 +2433,9 @@ const Row = (props) => {
|
|
|
2429
2433
|
className: getClasses()
|
|
2430
2434
|
}, children));
|
|
2431
2435
|
};
|
|
2432
|
-
Row.defaultProps = defaultProps$
|
|
2436
|
+
Row.defaultProps = defaultProps$Y;
|
|
2433
2437
|
Row.displayName = "NutRow";
|
|
2434
|
-
const defaultProps$
|
|
2438
|
+
const defaultProps$X = {
|
|
2435
2439
|
contentPosition: "center",
|
|
2436
2440
|
dashed: false,
|
|
2437
2441
|
hairline: true,
|
|
@@ -2447,7 +2451,7 @@ const Divider = (props) => {
|
|
|
2447
2451
|
className,
|
|
2448
2452
|
direction
|
|
2449
2453
|
} = {
|
|
2450
|
-
...defaultProps$
|
|
2454
|
+
...defaultProps$X,
|
|
2451
2455
|
...props
|
|
2452
2456
|
};
|
|
2453
2457
|
const dividerBem = cn("divider");
|
|
@@ -2467,58 +2471,109 @@ const Divider = (props) => {
|
|
|
2467
2471
|
style: styles
|
|
2468
2472
|
}, children);
|
|
2469
2473
|
};
|
|
2470
|
-
Divider.defaultProps = defaultProps$
|
|
2474
|
+
Divider.defaultProps = defaultProps$X;
|
|
2471
2475
|
Divider.displayName = "NutDivider";
|
|
2472
|
-
const defaultProps$
|
|
2476
|
+
const defaultProps$W = {
|
|
2473
2477
|
title: "",
|
|
2474
2478
|
desc: "",
|
|
2475
|
-
leftShow:
|
|
2476
|
-
icon: "",
|
|
2479
|
+
leftShow: true,
|
|
2477
2480
|
titIcon: "",
|
|
2478
|
-
className: ""
|
|
2481
|
+
className: "",
|
|
2482
|
+
leftText: "",
|
|
2483
|
+
fixed: false,
|
|
2484
|
+
safeAreaInsetTop: false,
|
|
2485
|
+
border: false,
|
|
2486
|
+
placeholder: false,
|
|
2487
|
+
zIndex: 10,
|
|
2488
|
+
style: {}
|
|
2479
2489
|
};
|
|
2480
2490
|
const NavBar = (props) => {
|
|
2481
2491
|
const {
|
|
2482
2492
|
desc,
|
|
2483
|
-
icon,
|
|
2484
2493
|
title,
|
|
2485
2494
|
titIcon,
|
|
2486
2495
|
leftShow,
|
|
2487
2496
|
className,
|
|
2488
2497
|
style,
|
|
2498
|
+
leftText,
|
|
2499
|
+
fixed,
|
|
2500
|
+
safeAreaInsetTop,
|
|
2501
|
+
border,
|
|
2502
|
+
placeholder,
|
|
2503
|
+
zIndex,
|
|
2489
2504
|
onClickTitle,
|
|
2490
2505
|
onClickIcon,
|
|
2491
2506
|
onClickBack,
|
|
2492
|
-
|
|
2507
|
+
onClickRight
|
|
2493
2508
|
} = {
|
|
2494
|
-
...defaultProps$
|
|
2509
|
+
...defaultProps$W,
|
|
2495
2510
|
...props
|
|
2496
2511
|
};
|
|
2497
2512
|
const b2 = cn("navbar");
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2513
|
+
const children = Array.isArray(props.children) ? props.children : [props.children];
|
|
2514
|
+
const slot = children.reduce((slot2, item) => {
|
|
2515
|
+
const data = slot2;
|
|
2516
|
+
if (item && item.props) {
|
|
2517
|
+
data[item.props.slot] = item;
|
|
2518
|
+
}
|
|
2519
|
+
return data;
|
|
2520
|
+
}, {});
|
|
2521
|
+
const styles = () => {
|
|
2522
|
+
return {
|
|
2523
|
+
...style,
|
|
2524
|
+
zIndex
|
|
2525
|
+
};
|
|
2526
|
+
};
|
|
2527
|
+
const renderLeft = () => {
|
|
2528
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2529
|
+
className: `${b2("left")}`,
|
|
2530
|
+
onClick: (e2) => onClickBack(e2)
|
|
2531
|
+
}, leftShow && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
2532
|
+
name: "left",
|
|
2533
|
+
color: "#979797"
|
|
2534
|
+
}), leftText && /* @__PURE__ */ React__default.createElement("div", {
|
|
2535
|
+
className: `${b2("text")}`
|
|
2536
|
+
}, leftText), slot.left);
|
|
2537
|
+
};
|
|
2538
|
+
const renderContent = () => {
|
|
2539
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2540
|
+
className: `${b2("title")}`
|
|
2541
|
+
}, title && /* @__PURE__ */ React__default.createElement("div", {
|
|
2542
|
+
className: "title",
|
|
2543
|
+
onClick: (e2) => onClickTitle(e2)
|
|
2544
|
+
}, title), titIcon && /* @__PURE__ */ React__default.createElement("div", {
|
|
2545
|
+
onClick: (e2) => onClickIcon(e2)
|
|
2546
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
2547
|
+
name: titIcon
|
|
2548
|
+
})), slot.content);
|
|
2549
|
+
};
|
|
2550
|
+
const renderRight = () => {
|
|
2551
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2552
|
+
className: `${b2("right")}`,
|
|
2553
|
+
onClick: (e2) => onClickRight(e2)
|
|
2554
|
+
}, desc && /* @__PURE__ */ React__default.createElement("div", {
|
|
2555
|
+
className: `${b2("text")}`
|
|
2556
|
+
}, desc), slot.right);
|
|
2557
|
+
};
|
|
2558
|
+
const renderWrapper = () => {
|
|
2559
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2560
|
+
className: cls,
|
|
2561
|
+
style: styles()
|
|
2562
|
+
}, renderLeft(), renderContent(), renderRight());
|
|
2563
|
+
};
|
|
2564
|
+
const classes = classNames({
|
|
2565
|
+
[`nut-navbar--border`]: border,
|
|
2566
|
+
[`nut-navbar--fixed`]: fixed,
|
|
2567
|
+
[`nut-navbar--safe-area-inset-top`]: safeAreaInsetTop
|
|
2568
|
+
});
|
|
2569
|
+
const cls = classNames(b2(""), classes, className);
|
|
2570
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2571
|
+
className: `${b2("")}--placeholder`
|
|
2572
|
+
}, renderWrapper()) : renderWrapper());
|
|
2518
2573
|
};
|
|
2519
|
-
NavBar.defaultProps = defaultProps$
|
|
2574
|
+
NavBar.defaultProps = defaultProps$W;
|
|
2520
2575
|
NavBar.displayName = "NutNavBar";
|
|
2521
|
-
const defaultProps$
|
|
2576
|
+
const defaultProps$V = {
|
|
2522
2577
|
fixednavClass: "nut-fixednav",
|
|
2523
2578
|
activeText: "\u6536\u8D77\u5BFC\u822A",
|
|
2524
2579
|
unActiveText: "\u5FEB\u901F\u5BFC\u822A",
|
|
@@ -2544,7 +2599,7 @@ const FixedNav = (props) => {
|
|
|
2544
2599
|
slotList,
|
|
2545
2600
|
slotBtn,
|
|
2546
2601
|
...rest
|
|
2547
|
-
} = { ...defaultProps$
|
|
2602
|
+
} = { ...defaultProps$V, ...props };
|
|
2548
2603
|
const b2 = cn("fixednav");
|
|
2549
2604
|
const classes = classNames({
|
|
2550
2605
|
active: visible
|
|
@@ -2590,9 +2645,9 @@ const FixedNav = (props) => {
|
|
|
2590
2645
|
className: "text"
|
|
2591
2646
|
}, visible ? locale.fixednav.activeText || activeText : locale.fixednav.unActiveText || unActiveText))));
|
|
2592
2647
|
};
|
|
2593
|
-
FixedNav.defaultProps = defaultProps$
|
|
2648
|
+
FixedNav.defaultProps = defaultProps$V;
|
|
2594
2649
|
FixedNav.displayName = "NutFixedNav";
|
|
2595
|
-
const defaultProps$
|
|
2650
|
+
const defaultProps$U = {
|
|
2596
2651
|
visible: 0,
|
|
2597
2652
|
bottom: false,
|
|
2598
2653
|
type: "",
|
|
@@ -2615,7 +2670,7 @@ const Tabbar = (props) => {
|
|
|
2615
2670
|
style,
|
|
2616
2671
|
tabSwitch
|
|
2617
2672
|
} = {
|
|
2618
|
-
...defaultProps$
|
|
2673
|
+
...defaultProps$U,
|
|
2619
2674
|
...props
|
|
2620
2675
|
};
|
|
2621
2676
|
const b2 = cn("tabbar");
|
|
@@ -2644,9 +2699,9 @@ const Tabbar = (props) => {
|
|
|
2644
2699
|
return React__default.cloneElement(child, childProps);
|
|
2645
2700
|
}));
|
|
2646
2701
|
};
|
|
2647
|
-
Tabbar.defaultProps = defaultProps$
|
|
2702
|
+
Tabbar.defaultProps = defaultProps$U;
|
|
2648
2703
|
Tabbar.displayName = "NutTabbar";
|
|
2649
|
-
const defaultProps$
|
|
2704
|
+
const defaultProps$T = {
|
|
2650
2705
|
tabTitle: "",
|
|
2651
2706
|
icon: "",
|
|
2652
2707
|
href: "",
|
|
@@ -2672,7 +2727,7 @@ const TabbarItem = (props) => {
|
|
|
2672
2727
|
index: index2,
|
|
2673
2728
|
handleClick
|
|
2674
2729
|
} = {
|
|
2675
|
-
...defaultProps$
|
|
2730
|
+
...defaultProps$T,
|
|
2676
2731
|
...props
|
|
2677
2732
|
};
|
|
2678
2733
|
const b2 = cn("tabbar-item");
|
|
@@ -2710,10 +2765,14 @@ const TabbarItem = (props) => {
|
|
|
2710
2765
|
])
|
|
2711
2766
|
}, tabTitle)));
|
|
2712
2767
|
};
|
|
2713
|
-
const
|
|
2768
|
+
const elevatorContext = createContext({});
|
|
2769
|
+
const defaultProps$S = {
|
|
2714
2770
|
height: "200px",
|
|
2715
2771
|
acceptKey: "title",
|
|
2716
2772
|
indexList: [],
|
|
2773
|
+
isSticky: false,
|
|
2774
|
+
spaceHeight: 23,
|
|
2775
|
+
titleHeight: 35,
|
|
2717
2776
|
className: ""
|
|
2718
2777
|
};
|
|
2719
2778
|
const Elevator = (props) => {
|
|
@@ -2721,37 +2780,44 @@ const Elevator = (props) => {
|
|
|
2721
2780
|
height,
|
|
2722
2781
|
acceptKey,
|
|
2723
2782
|
indexList,
|
|
2783
|
+
isSticky,
|
|
2784
|
+
spaceHeight,
|
|
2785
|
+
titleHeight,
|
|
2724
2786
|
className,
|
|
2725
2787
|
clickItem,
|
|
2726
2788
|
clickIndex,
|
|
2789
|
+
children,
|
|
2727
2790
|
...rest
|
|
2728
2791
|
} = {
|
|
2729
|
-
...defaultProps$
|
|
2792
|
+
...defaultProps$S,
|
|
2730
2793
|
...props
|
|
2731
2794
|
};
|
|
2732
2795
|
const b2 = cn("elevator");
|
|
2733
|
-
const spaceHeight = 23;
|
|
2734
2796
|
const listview = useRef(null);
|
|
2735
2797
|
const initData = {
|
|
2736
2798
|
anchorIndex: 0,
|
|
2737
2799
|
listHeight: [],
|
|
2738
|
-
listGroup: []
|
|
2800
|
+
listGroup: [],
|
|
2801
|
+
scrollY: 0,
|
|
2802
|
+
diff: -1,
|
|
2803
|
+
fixedTop: 0
|
|
2739
2804
|
};
|
|
2740
2805
|
const touchState = useRef({
|
|
2741
2806
|
y1: 0,
|
|
2742
2807
|
y2: 0
|
|
2743
2808
|
});
|
|
2809
|
+
const [scrollY, setScrollY] = useState(0);
|
|
2810
|
+
const [currentData, setCurrentData] = useState({});
|
|
2811
|
+
const [currentKey, setCurrentKey] = useState("");
|
|
2744
2812
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
2813
|
+
const [codeIndex, setCodeIndex] = useState(0);
|
|
2745
2814
|
const [scrollStart, setScrollStart] = useState(false);
|
|
2746
2815
|
const state = useRef(initData);
|
|
2747
2816
|
const resetScrollState = () => {
|
|
2748
|
-
state.current.anchorIndex = 0;
|
|
2749
|
-
setCurrentIndex(0);
|
|
2750
2817
|
setScrollStart(false);
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
};
|
|
2818
|
+
};
|
|
2819
|
+
const clientHeight = () => {
|
|
2820
|
+
return listview.current ? listview.current.clientHeight : 0;
|
|
2755
2821
|
};
|
|
2756
2822
|
const getData = (el, name) => {
|
|
2757
2823
|
const prefix2 = "data-";
|
|
@@ -2773,21 +2839,24 @@ const Elevator = (props) => {
|
|
|
2773
2839
|
if (!state.current.listHeight.length) {
|
|
2774
2840
|
calculateHeight();
|
|
2775
2841
|
}
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2842
|
+
let cacheIndex = index2;
|
|
2843
|
+
if (index2 < 0) {
|
|
2844
|
+
cacheIndex = 0;
|
|
2845
|
+
}
|
|
2846
|
+
if (index2 > state.current.listHeight.length - 2) {
|
|
2847
|
+
cacheIndex = state.current.listHeight.length - 2;
|
|
2848
|
+
}
|
|
2849
|
+
setCodeIndex(cacheIndex);
|
|
2781
2850
|
if (listview.current) {
|
|
2782
|
-
listview.current.scrollTo(0, state.current.listHeight[
|
|
2851
|
+
listview.current.scrollTo(0, state.current.listHeight[cacheIndex]);
|
|
2783
2852
|
}
|
|
2784
2853
|
};
|
|
2785
2854
|
const touchMove = (e2) => {
|
|
2786
2855
|
const firstTouch = e2.touches[0];
|
|
2787
2856
|
touchState.current.y2 = firstTouch.pageY;
|
|
2788
|
-
const delta = (touchState.current.y2 - touchState.current.y1) / spaceHeight
|
|
2857
|
+
const delta = (touchState.current.y2 - touchState.current.y1) / spaceHeight || 0;
|
|
2789
2858
|
const cacheIndex = state.current.anchorIndex + delta;
|
|
2790
|
-
|
|
2859
|
+
setCodeIndex(cacheIndex);
|
|
2791
2860
|
scrollTo(cacheIndex);
|
|
2792
2861
|
};
|
|
2793
2862
|
const touchEnd = () => {
|
|
@@ -2799,7 +2868,7 @@ const Elevator = (props) => {
|
|
|
2799
2868
|
const firstTouch = e2.touches[0];
|
|
2800
2869
|
touchState.current.y1 = firstTouch.pageY;
|
|
2801
2870
|
state.current.anchorIndex = +index2;
|
|
2802
|
-
|
|
2871
|
+
setCodeIndex((codeIndex2) => codeIndex2 + index2);
|
|
2803
2872
|
scrollTo(index2);
|
|
2804
2873
|
const target = e2.currentTarget;
|
|
2805
2874
|
target.removeEventListener("touchend", touchEnd, false);
|
|
@@ -2807,6 +2876,8 @@ const Elevator = (props) => {
|
|
|
2807
2876
|
};
|
|
2808
2877
|
const handleClickItem = (key, item) => {
|
|
2809
2878
|
clickItem && clickItem(key, item);
|
|
2879
|
+
setCurrentData(item);
|
|
2880
|
+
setCurrentKey(key);
|
|
2810
2881
|
};
|
|
2811
2882
|
const handleClickIndex = (key) => {
|
|
2812
2883
|
clickIndex && clickIndex(key);
|
|
@@ -2821,34 +2892,77 @@ const Elevator = (props) => {
|
|
|
2821
2892
|
});
|
|
2822
2893
|
}
|
|
2823
2894
|
};
|
|
2895
|
+
const listViewScroll = (e2) => {
|
|
2896
|
+
const { listHeight } = state.current;
|
|
2897
|
+
if (!listHeight.length) {
|
|
2898
|
+
calculateHeight();
|
|
2899
|
+
}
|
|
2900
|
+
const target = e2.target;
|
|
2901
|
+
const { scrollTop } = target;
|
|
2902
|
+
state.current.scrollY = scrollTop;
|
|
2903
|
+
setScrollY(scrollTop);
|
|
2904
|
+
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
2905
|
+
const height1 = listHeight[i];
|
|
2906
|
+
const height2 = listHeight[i + 1];
|
|
2907
|
+
if (state.current.scrollY >= height1 && state.current.scrollY < height2) {
|
|
2908
|
+
setCurrentIndex(i);
|
|
2909
|
+
state.current.diff = height2 - state.current.scrollY;
|
|
2910
|
+
return;
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
setCurrentIndex(listHeight.length - 2);
|
|
2914
|
+
};
|
|
2824
2915
|
useEffect(() => {
|
|
2825
2916
|
if (listview.current) {
|
|
2826
2917
|
setListGroup();
|
|
2918
|
+
listview.current.addEventListener("scroll", listViewScroll);
|
|
2919
|
+
}
|
|
2920
|
+
}, [listview]);
|
|
2921
|
+
useEffect(() => {
|
|
2922
|
+
const { listHeight, diff, scrollY: scrollY2 } = state.current;
|
|
2923
|
+
let fixedTop = diff > 0 && diff < titleHeight ? diff - titleHeight : 0;
|
|
2924
|
+
if (scrollY2 + clientHeight() === listHeight[listHeight.length - 1]) {
|
|
2925
|
+
if (fixedTop !== 0) {
|
|
2926
|
+
fixedTop = 0;
|
|
2927
|
+
}
|
|
2827
2928
|
}
|
|
2828
|
-
|
|
2929
|
+
if (state.current.fixedTop === fixedTop)
|
|
2930
|
+
return;
|
|
2931
|
+
state.current.fixedTop = fixedTop;
|
|
2932
|
+
}, [state.current.diff, titleHeight]);
|
|
2829
2933
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2830
2934
|
className: `${b2()} ${className}`,
|
|
2831
2935
|
...rest
|
|
2832
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2936
|
+
}, isSticky && scrollY > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2937
|
+
className: b2("list__fixed")
|
|
2938
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
2939
|
+
className: "fixed-title"
|
|
2940
|
+
}, indexList[currentIndex][acceptKey])) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
2833
2941
|
className: b2("list"),
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2942
|
+
style: { height: Number.isNaN(+height) ? height : `${height}px` }
|
|
2943
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2944
|
+
className: b2("list__inner"),
|
|
2945
|
+
ref: listview
|
|
2946
|
+
}, indexList.map((item, idx) => {
|
|
2837
2947
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2838
2948
|
className: b2("list__item"),
|
|
2839
|
-
key:
|
|
2949
|
+
key: idx
|
|
2840
2950
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2841
2951
|
className: b2("list__item__code")
|
|
2842
2952
|
}, item[acceptKey]), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.list.map((subitem) => {
|
|
2843
2953
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2844
|
-
className: b2("list__item__name"
|
|
2954
|
+
className: b2("list__item__name", {
|
|
2955
|
+
highcolor: currentData.id === subitem.id && currentKey === item[acceptKey]
|
|
2956
|
+
}),
|
|
2845
2957
|
key: subitem.id,
|
|
2846
2958
|
onClick: () => handleClickItem(item[acceptKey], subitem)
|
|
2847
|
-
},
|
|
2959
|
+
}, children ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(elevatorContext.Provider, {
|
|
2960
|
+
value: subitem
|
|
2961
|
+
}, children)) : subitem.name);
|
|
2848
2962
|
})));
|
|
2849
|
-
})), indexList.length && scrollStart ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2850
|
-
className: b2("code", { current: true })
|
|
2851
|
-
},
|
|
2963
|
+
}))), indexList.length && scrollStart ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2964
|
+
className: b2("code--current", { current: true })
|
|
2965
|
+
}, indexList[codeIndex][acceptKey]) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
2852
2966
|
className: b2("bars"),
|
|
2853
2967
|
onTouchStart: (event) => touchStart(event),
|
|
2854
2968
|
onTouchMove: (event) => touchMove(event)
|
|
@@ -2856,16 +2970,18 @@ const Elevator = (props) => {
|
|
|
2856
2970
|
className: b2("bars__inner")
|
|
2857
2971
|
}, indexList.map((item, index2) => {
|
|
2858
2972
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2859
|
-
className: b2("bars__inner__item"
|
|
2973
|
+
className: b2("bars__inner__item", {
|
|
2974
|
+
active: item[acceptKey] === indexList[currentIndex][acceptKey]
|
|
2975
|
+
}),
|
|
2860
2976
|
"data-index": index2,
|
|
2861
|
-
key:
|
|
2977
|
+
key: index2,
|
|
2862
2978
|
onClick: () => handleClickIndex(item[acceptKey])
|
|
2863
2979
|
}, item[acceptKey]);
|
|
2864
2980
|
}))));
|
|
2865
2981
|
};
|
|
2866
|
-
Elevator.defaultProps = defaultProps$
|
|
2982
|
+
Elevator.defaultProps = defaultProps$S;
|
|
2867
2983
|
Elevator.displayName = "NutElevator";
|
|
2868
|
-
const defaultProps$
|
|
2984
|
+
const defaultProps$R = {
|
|
2869
2985
|
defaultValue: 1,
|
|
2870
2986
|
mode: "multi",
|
|
2871
2987
|
prevText: "",
|
|
@@ -2882,7 +2998,7 @@ const defaultProps$Q = {
|
|
|
2882
2998
|
};
|
|
2883
2999
|
const Pagination = (props) => {
|
|
2884
3000
|
const { locale } = useConfig();
|
|
2885
|
-
({ ...defaultProps$
|
|
3001
|
+
({ ...defaultProps$R, ...props });
|
|
2886
3002
|
const {
|
|
2887
3003
|
modelValue,
|
|
2888
3004
|
mode,
|
|
@@ -2999,7 +3115,7 @@ const Pagination = (props) => {
|
|
|
2999
3115
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
3000
3116
|
}, nextText || locale.pagination.next));
|
|
3001
3117
|
};
|
|
3002
|
-
Pagination.defaultProps = defaultProps$
|
|
3118
|
+
Pagination.defaultProps = defaultProps$R;
|
|
3003
3119
|
Pagination.displayName = "NutPagination";
|
|
3004
3120
|
class Title {
|
|
3005
3121
|
constructor() {
|
|
@@ -3009,7 +3125,7 @@ class Title {
|
|
|
3009
3125
|
this.index = 0;
|
|
3010
3126
|
}
|
|
3011
3127
|
}
|
|
3012
|
-
const defaultProps$
|
|
3128
|
+
const defaultProps$Q = {
|
|
3013
3129
|
value: 0,
|
|
3014
3130
|
color: "",
|
|
3015
3131
|
background: "",
|
|
@@ -3019,7 +3135,8 @@ const defaultProps$P = {
|
|
|
3019
3135
|
ellipsis: true,
|
|
3020
3136
|
animatedTime: 300,
|
|
3021
3137
|
titleGutter: 0,
|
|
3022
|
-
size: "normal"
|
|
3138
|
+
size: "normal",
|
|
3139
|
+
autoHeight: false
|
|
3023
3140
|
};
|
|
3024
3141
|
const pxCheck$1 = (value) => {
|
|
3025
3142
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -3041,8 +3158,9 @@ const Tabs = (props) => {
|
|
|
3041
3158
|
onClick,
|
|
3042
3159
|
onChange,
|
|
3043
3160
|
className,
|
|
3161
|
+
autoHeight,
|
|
3044
3162
|
...rest
|
|
3045
|
-
} = { ...defaultProps$
|
|
3163
|
+
} = { ...defaultProps$Q, ...props };
|
|
3046
3164
|
const [currentItem, setCurrentItem] = useState({ index: 0 });
|
|
3047
3165
|
const titles = useRef([]);
|
|
3048
3166
|
useEffect(() => {
|
|
@@ -3105,7 +3223,10 @@ const Tabs = (props) => {
|
|
|
3105
3223
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3106
3224
|
style: titleStyle,
|
|
3107
3225
|
onClick: (e2) => tabChange(item),
|
|
3108
|
-
className: classNames({
|
|
3226
|
+
className: classNames({
|
|
3227
|
+
active: String(item.paneKey) === String(value),
|
|
3228
|
+
disabled: item.disabled
|
|
3229
|
+
}, `${b2("")}__titles-item`),
|
|
3109
3230
|
key: item.paneKey
|
|
3110
3231
|
}, type === "line" && /* @__PURE__ */ React__default.createElement("div", {
|
|
3111
3232
|
className: `${b2("")}__titles-item__line`,
|
|
@@ -3125,38 +3246,45 @@ const Tabs = (props) => {
|
|
|
3125
3246
|
className: `${b2("")}__content`,
|
|
3126
3247
|
style: contentStyle
|
|
3127
3248
|
}, React__default.Children.map(children, (child, idx) => {
|
|
3249
|
+
var _a;
|
|
3128
3250
|
if (!React__default.isValidElement(child)) {
|
|
3129
3251
|
return null;
|
|
3130
3252
|
}
|
|
3131
|
-
|
|
3253
|
+
let childProps = {
|
|
3132
3254
|
...child.props,
|
|
3133
3255
|
activeKey: value
|
|
3134
3256
|
};
|
|
3257
|
+
if (String(value) !== String(((_a = child.props) == null ? void 0 : _a.paneKey) || idx) && autoHeight) {
|
|
3258
|
+
childProps = {
|
|
3259
|
+
...childProps,
|
|
3260
|
+
autoHeightClassName: "inactive"
|
|
3261
|
+
};
|
|
3262
|
+
}
|
|
3135
3263
|
return React__default.cloneElement(child, childProps);
|
|
3136
3264
|
})));
|
|
3137
3265
|
};
|
|
3138
|
-
Tabs.defaultProps = defaultProps$
|
|
3266
|
+
Tabs.defaultProps = defaultProps$Q;
|
|
3139
3267
|
Tabs.displayName = "NutTabs";
|
|
3140
|
-
const defaultProps$
|
|
3268
|
+
const defaultProps$P = {
|
|
3141
3269
|
title: "",
|
|
3142
3270
|
paneKey: "",
|
|
3143
3271
|
activeKey: "",
|
|
3144
3272
|
disabled: false
|
|
3145
3273
|
};
|
|
3146
3274
|
const TabPane = (props) => {
|
|
3147
|
-
const { children, paneKey, activeKey } = {
|
|
3148
|
-
...defaultProps$
|
|
3275
|
+
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
3276
|
+
...defaultProps$P,
|
|
3149
3277
|
...props
|
|
3150
3278
|
};
|
|
3151
3279
|
const b2 = cn("tabpane");
|
|
3152
3280
|
const classes = classNames({
|
|
3153
3281
|
active: paneKey === activeKey
|
|
3154
|
-
}, b2(""));
|
|
3282
|
+
}, b2(""), autoHeightClassName);
|
|
3155
3283
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3156
3284
|
className: classes
|
|
3157
3285
|
}, children);
|
|
3158
3286
|
};
|
|
3159
|
-
const defaultProps$
|
|
3287
|
+
const defaultProps$O = {
|
|
3160
3288
|
size: 3,
|
|
3161
3289
|
current: 1,
|
|
3162
3290
|
block: false,
|
|
@@ -3176,7 +3304,7 @@ const Indicator = (props) => {
|
|
|
3176
3304
|
vertical,
|
|
3177
3305
|
...rest
|
|
3178
3306
|
} = {
|
|
3179
|
-
...defaultProps$
|
|
3307
|
+
...defaultProps$O,
|
|
3180
3308
|
...props
|
|
3181
3309
|
};
|
|
3182
3310
|
const b2 = cn("indicator");
|
|
@@ -3205,7 +3333,7 @@ const Indicator = (props) => {
|
|
|
3205
3333
|
...rest
|
|
3206
3334
|
}, renderEles());
|
|
3207
3335
|
};
|
|
3208
|
-
Indicator.defaultProps = defaultProps$
|
|
3336
|
+
Indicator.defaultProps = defaultProps$O;
|
|
3209
3337
|
Indicator.displayName = "NutIndicator";
|
|
3210
3338
|
const MIN_DISTANCE = 10;
|
|
3211
3339
|
function getDirection(x2, y2) {
|
|
@@ -3486,7 +3614,7 @@ var Toast = {
|
|
|
3486
3614
|
}
|
|
3487
3615
|
}
|
|
3488
3616
|
};
|
|
3489
|
-
const defaultProps$
|
|
3617
|
+
const defaultProps$N = {
|
|
3490
3618
|
range: false,
|
|
3491
3619
|
hiddenRange: false,
|
|
3492
3620
|
hiddenTag: false,
|
|
@@ -3516,7 +3644,7 @@ const Range = (props) => {
|
|
|
3516
3644
|
change,
|
|
3517
3645
|
dragStart,
|
|
3518
3646
|
dragEnd
|
|
3519
|
-
} = { ...defaultProps$
|
|
3647
|
+
} = { ...defaultProps$N, ...props };
|
|
3520
3648
|
const [buttonIndex, SetButtonIndex] = useState(0);
|
|
3521
3649
|
const [initValue, SetInitValue] = useState();
|
|
3522
3650
|
const [dragStatus, SetDragStatus] = useState("start");
|
|
@@ -3725,7 +3853,7 @@ const Range = (props) => {
|
|
|
3725
3853
|
className: "max"
|
|
3726
3854
|
}, +max) : null);
|
|
3727
3855
|
};
|
|
3728
|
-
Range.defaultProps = defaultProps$
|
|
3856
|
+
Range.defaultProps = defaultProps$N;
|
|
3729
3857
|
Range.displayName = "NutRange";
|
|
3730
3858
|
const Utils = {
|
|
3731
3859
|
isLeapYear(y2) {
|
|
@@ -3819,7 +3947,7 @@ function requestAniFrame() {
|
|
|
3819
3947
|
};
|
|
3820
3948
|
}
|
|
3821
3949
|
var requestAniFrame$1 = requestAniFrame();
|
|
3822
|
-
const defaultProps$
|
|
3950
|
+
const defaultProps$M = {
|
|
3823
3951
|
type: "one",
|
|
3824
3952
|
isAutoBackFill: false,
|
|
3825
3953
|
poppable: true,
|
|
@@ -3848,7 +3976,7 @@ const CalendarItem = (props) => {
|
|
|
3848
3976
|
onChoose,
|
|
3849
3977
|
onUpdate,
|
|
3850
3978
|
onClose
|
|
3851
|
-
} = { ...defaultProps$
|
|
3979
|
+
} = { ...defaultProps$M, ...props };
|
|
3852
3980
|
const weeks = locale.calendaritem.weekdays;
|
|
3853
3981
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
3854
3982
|
const [unLoadPrev, setUnLoadPrev] = useState(false);
|
|
@@ -4244,9 +4372,9 @@ const CalendarItem = (props) => {
|
|
|
4244
4372
|
onClick: confirm2
|
|
4245
4373
|
}, locale.confirm)) : ""));
|
|
4246
4374
|
};
|
|
4247
|
-
CalendarItem.defaultProps = defaultProps$
|
|
4375
|
+
CalendarItem.defaultProps = defaultProps$M;
|
|
4248
4376
|
CalendarItem.displayName = "NutCalendarItem";
|
|
4249
|
-
const defaultProps$
|
|
4377
|
+
const defaultProps$L = {
|
|
4250
4378
|
type: "one",
|
|
4251
4379
|
isAutoBackFill: false,
|
|
4252
4380
|
poppable: true,
|
|
@@ -4274,7 +4402,7 @@ const Calendar = (props) => {
|
|
|
4274
4402
|
endDate,
|
|
4275
4403
|
onClose,
|
|
4276
4404
|
onChoose
|
|
4277
|
-
} = { ...defaultProps$
|
|
4405
|
+
} = { ...defaultProps$L, ...props };
|
|
4278
4406
|
const close = () => {
|
|
4279
4407
|
onClose && onClose();
|
|
4280
4408
|
};
|
|
@@ -4317,33 +4445,43 @@ const Calendar = (props) => {
|
|
|
4317
4445
|
onChoose: choose
|
|
4318
4446
|
}));
|
|
4319
4447
|
};
|
|
4320
|
-
Calendar.defaultProps = defaultProps$
|
|
4448
|
+
Calendar.defaultProps = defaultProps$L;
|
|
4321
4449
|
Calendar.displayName = "NutCalendar";
|
|
4322
|
-
const defaultProps$
|
|
4450
|
+
const defaultProps$K = {
|
|
4323
4451
|
disabled: false,
|
|
4324
4452
|
checkedValue: [],
|
|
4453
|
+
max: void 0,
|
|
4325
4454
|
onChange: (value) => {
|
|
4326
4455
|
}
|
|
4327
4456
|
};
|
|
4328
4457
|
const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
4329
|
-
const { children } = { ...defaultProps$
|
|
4458
|
+
const { children } = { ...defaultProps$K, ...props };
|
|
4330
4459
|
const b2 = cn("checkboxgroup");
|
|
4331
|
-
const { className, disabled, onChange, checkedValue, ...rest } = props;
|
|
4460
|
+
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
4332
4461
|
const [innerDisabled, setInnerDisabled] = useState(disabled);
|
|
4333
4462
|
const [innerValue, setInnerValue] = useState(checkedValue);
|
|
4334
4463
|
useImperativeHandle(ref, () => ({
|
|
4335
4464
|
toggleAll(state) {
|
|
4336
|
-
console.log(state);
|
|
4337
4465
|
if (state === false) {
|
|
4338
4466
|
setInnerValue([]);
|
|
4339
4467
|
} else {
|
|
4340
4468
|
const childrenLabel = [];
|
|
4341
4469
|
React__default.Children.map(children, (child) => {
|
|
4342
4470
|
const childProps = child.props;
|
|
4471
|
+
console.log(child);
|
|
4343
4472
|
childrenLabel.push(childProps.label || child.children);
|
|
4344
4473
|
});
|
|
4345
4474
|
setInnerValue(childrenLabel);
|
|
4346
4475
|
}
|
|
4476
|
+
},
|
|
4477
|
+
toggleReverse() {
|
|
4478
|
+
const childrenLabel = [];
|
|
4479
|
+
React__default.Children.map(children, (child) => {
|
|
4480
|
+
const childProps = child.props;
|
|
4481
|
+
childrenLabel.push(childProps.label || child.children);
|
|
4482
|
+
});
|
|
4483
|
+
const reverse = childrenLabel.filter((c6) => (innerValue == null ? void 0 : innerValue.findIndex((v2) => v2 === c6)) === -1);
|
|
4484
|
+
setInnerValue(reverse);
|
|
4347
4485
|
}
|
|
4348
4486
|
}));
|
|
4349
4487
|
useEffect(() => {
|
|
@@ -4351,6 +4489,8 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
|
4351
4489
|
setInnerValue(checkedValue);
|
|
4352
4490
|
}, [disabled, checkedValue]);
|
|
4353
4491
|
function handleChildChange(state, label) {
|
|
4492
|
+
if (max !== void 0 && innerValue && innerValue.length > max)
|
|
4493
|
+
return;
|
|
4354
4494
|
if (innerValue) {
|
|
4355
4495
|
let clippedValue = [];
|
|
4356
4496
|
if (state) {
|
|
@@ -4368,6 +4508,9 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
|
4368
4508
|
return false;
|
|
4369
4509
|
return (innerValue == null ? void 0 : innerValue.indexOf(child.props.label || child.children)) > -1;
|
|
4370
4510
|
}
|
|
4511
|
+
function getParentVals() {
|
|
4512
|
+
return innerValue;
|
|
4513
|
+
}
|
|
4371
4514
|
function cloneChildren() {
|
|
4372
4515
|
return React__default.Children.map(children, (child) => {
|
|
4373
4516
|
const childChecked = validateChildChecked(child);
|
|
@@ -4377,7 +4520,9 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
|
4377
4520
|
return React__default.cloneElement(child, {
|
|
4378
4521
|
disabled: innerDisabled,
|
|
4379
4522
|
checked: childChecked,
|
|
4380
|
-
onChange: handleChildChange
|
|
4523
|
+
onChange: handleChildChange,
|
|
4524
|
+
getParentVals,
|
|
4525
|
+
max
|
|
4381
4526
|
});
|
|
4382
4527
|
});
|
|
4383
4528
|
}
|
|
@@ -4386,20 +4531,23 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
|
4386
4531
|
...rest
|
|
4387
4532
|
}, cloneChildren());
|
|
4388
4533
|
});
|
|
4389
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
4534
|
+
CheckboxGroup.defaultProps = defaultProps$K;
|
|
4390
4535
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
4391
|
-
const defaultProps$
|
|
4536
|
+
const defaultProps$J = {
|
|
4392
4537
|
checked: false,
|
|
4393
4538
|
disabled: false,
|
|
4394
4539
|
textPosition: "right",
|
|
4395
4540
|
iconSize: 18,
|
|
4396
4541
|
iconName: "check-normal",
|
|
4397
4542
|
iconActiveName: "checked",
|
|
4543
|
+
iconClassPrefix: "nut-icon",
|
|
4544
|
+
iconFontClassName: "nutui-iconfont",
|
|
4545
|
+
iconIndeterminateName: "check-disabled",
|
|
4398
4546
|
onChange: (state, label) => {
|
|
4399
4547
|
}
|
|
4400
4548
|
};
|
|
4401
4549
|
const Checkbox = (props) => {
|
|
4402
|
-
const { children } = { ...defaultProps$
|
|
4550
|
+
const { children } = { ...defaultProps$J, ...props };
|
|
4403
4551
|
const b2 = cn("checkbox");
|
|
4404
4552
|
const {
|
|
4405
4553
|
iconName,
|
|
@@ -4411,34 +4559,67 @@ const Checkbox = (props) => {
|
|
|
4411
4559
|
checked,
|
|
4412
4560
|
disabled,
|
|
4413
4561
|
onChange,
|
|
4562
|
+
indeterminate,
|
|
4563
|
+
iconClassPrefix,
|
|
4564
|
+
iconFontClassName,
|
|
4565
|
+
iconIndeterminateName,
|
|
4566
|
+
getParentVals,
|
|
4567
|
+
max,
|
|
4414
4568
|
...rest
|
|
4415
4569
|
} = props;
|
|
4416
4570
|
const [innerChecked, setInnerChecked] = useState(checked);
|
|
4417
4571
|
const [innerDisabled, setDisabled] = useState(disabled);
|
|
4572
|
+
const [_indeterminate, setIndeterminate] = useState(indeterminate);
|
|
4418
4573
|
useEffect(() => {
|
|
4419
4574
|
setInnerChecked(checked);
|
|
4420
4575
|
setDisabled(disabled);
|
|
4421
4576
|
}, [disabled, checked]);
|
|
4577
|
+
useEffect(() => {
|
|
4578
|
+
setIndeterminate(indeterminate);
|
|
4579
|
+
}, [indeterminate]);
|
|
4580
|
+
const getIconName = () => {
|
|
4581
|
+
if (!innerChecked) {
|
|
4582
|
+
return iconName;
|
|
4583
|
+
}
|
|
4584
|
+
if (_indeterminate) {
|
|
4585
|
+
return iconIndeterminateName;
|
|
4586
|
+
}
|
|
4587
|
+
return iconActiveName;
|
|
4588
|
+
};
|
|
4422
4589
|
const renderIcon = () => {
|
|
4423
4590
|
return /* @__PURE__ */ React__default.createElement(Icon, {
|
|
4424
|
-
name:
|
|
4591
|
+
name: getIconName(),
|
|
4425
4592
|
size: iconSize,
|
|
4426
|
-
|
|
4593
|
+
className: color(),
|
|
4594
|
+
classPrefix: iconClassPrefix,
|
|
4595
|
+
fontClassName: iconFontClassName
|
|
4427
4596
|
});
|
|
4428
4597
|
};
|
|
4429
4598
|
const color = () => {
|
|
4430
|
-
|
|
4599
|
+
if (innerDisabled) {
|
|
4600
|
+
return "nut-checkbox__icon--disable";
|
|
4601
|
+
}
|
|
4602
|
+
if (innerChecked) {
|
|
4603
|
+
if (_indeterminate) {
|
|
4604
|
+
return "nut-checkbox__icon--indeterminate";
|
|
4605
|
+
}
|
|
4606
|
+
return "nut-checkbox__icon";
|
|
4607
|
+
}
|
|
4608
|
+
return "nut-checkbox__icon--unchecked";
|
|
4431
4609
|
};
|
|
4432
4610
|
const renderLabel = () => {
|
|
4433
4611
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
4434
4612
|
className: `${b2("label", { disabled: innerDisabled })} `
|
|
4435
|
-
},
|
|
4613
|
+
}, children || label);
|
|
4436
4614
|
};
|
|
4437
4615
|
const handleClick = () => {
|
|
4438
|
-
if (disabled)
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4616
|
+
if (!disabled) {
|
|
4617
|
+
const latest = !innerChecked;
|
|
4618
|
+
if (max !== void 0 && latest && getParentVals().length >= max)
|
|
4619
|
+
return;
|
|
4620
|
+
onChange && onChange(latest, label || children);
|
|
4621
|
+
setInnerChecked(latest);
|
|
4622
|
+
}
|
|
4442
4623
|
};
|
|
4443
4624
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4444
4625
|
className: `${b2({ reverse: textPosition === "left" })} ${className || ""}`,
|
|
@@ -4446,7 +4627,7 @@ const Checkbox = (props) => {
|
|
|
4446
4627
|
onClick: handleClick
|
|
4447
4628
|
}, renderIcon(), renderLabel());
|
|
4448
4629
|
};
|
|
4449
|
-
Checkbox.defaultProps = defaultProps$
|
|
4630
|
+
Checkbox.defaultProps = defaultProps$J;
|
|
4450
4631
|
Checkbox.displayName = "NutCheckBox";
|
|
4451
4632
|
Checkbox.Group = CheckboxGroup;
|
|
4452
4633
|
const InternalPickerSlot = (props, ref) => {
|
|
@@ -4759,7 +4940,7 @@ const InternalPicker = (props, ref) => {
|
|
|
4759
4940
|
};
|
|
4760
4941
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
4761
4942
|
const currentYear = new Date().getFullYear();
|
|
4762
|
-
const defaultProps$
|
|
4943
|
+
const defaultProps$I = {
|
|
4763
4944
|
modelValue: new Date(),
|
|
4764
4945
|
visible: false,
|
|
4765
4946
|
title: "",
|
|
@@ -4786,7 +4967,7 @@ const DatePicker = (props) => {
|
|
|
4786
4967
|
style,
|
|
4787
4968
|
...rest
|
|
4788
4969
|
} = {
|
|
4789
|
-
...defaultProps$
|
|
4970
|
+
...defaultProps$I,
|
|
4790
4971
|
...props
|
|
4791
4972
|
};
|
|
4792
4973
|
const [show, setShow] = useState(false);
|
|
@@ -5021,9 +5202,9 @@ const DatePicker = (props) => {
|
|
|
5021
5202
|
ref: pickerRef
|
|
5022
5203
|
}));
|
|
5023
5204
|
};
|
|
5024
|
-
DatePicker.defaultProps = defaultProps$
|
|
5205
|
+
DatePicker.defaultProps = defaultProps$I;
|
|
5025
5206
|
DatePicker.displayName = "NutDatePicker";
|
|
5026
|
-
const defaultProps$
|
|
5207
|
+
const defaultProps$H = {
|
|
5027
5208
|
disabled: false,
|
|
5028
5209
|
buttonSize: "",
|
|
5029
5210
|
min: 1,
|
|
@@ -5061,7 +5242,7 @@ const InputNumber = (props) => {
|
|
|
5061
5242
|
focus,
|
|
5062
5243
|
...restProps
|
|
5063
5244
|
} = {
|
|
5064
|
-
...defaultProps$
|
|
5245
|
+
...defaultProps$H,
|
|
5065
5246
|
...props
|
|
5066
5247
|
};
|
|
5067
5248
|
const [inputValue, setInputValue] = useState(modelValue);
|
|
@@ -5182,7 +5363,7 @@ const InputNumber = (props) => {
|
|
|
5182
5363
|
click: addNumber
|
|
5183
5364
|
}));
|
|
5184
5365
|
};
|
|
5185
|
-
InputNumber.defaultProps = defaultProps$
|
|
5366
|
+
InputNumber.defaultProps = defaultProps$H;
|
|
5186
5367
|
InputNumber.displayName = "NutInputNumber";
|
|
5187
5368
|
function trimExtraChar(value, char, regExp) {
|
|
5188
5369
|
const index2 = value.indexOf(char);
|
|
@@ -5198,7 +5379,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
5198
5379
|
if (allowDot) {
|
|
5199
5380
|
value = trimExtraChar(value, ".", /\./g);
|
|
5200
5381
|
} else {
|
|
5201
|
-
value = value.
|
|
5382
|
+
value = value.split(".")[0];
|
|
5202
5383
|
}
|
|
5203
5384
|
if (allowMinus) {
|
|
5204
5385
|
value = trimExtraChar(value, "-", /-/g);
|
|
@@ -5208,130 +5389,304 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
5208
5389
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
5209
5390
|
return value.replace(regExp, "");
|
|
5210
5391
|
}
|
|
5211
|
-
const defaultProps$
|
|
5392
|
+
const defaultProps$G = {
|
|
5212
5393
|
type: "text",
|
|
5213
5394
|
defaultValue: "",
|
|
5214
5395
|
placeholder: "",
|
|
5215
5396
|
label: "",
|
|
5216
|
-
|
|
5397
|
+
labelClass: "",
|
|
5398
|
+
labelWidth: "80",
|
|
5399
|
+
labelAlign: "left",
|
|
5400
|
+
colon: false,
|
|
5401
|
+
inputAlign: "left",
|
|
5402
|
+
center: false,
|
|
5403
|
+
required: false,
|
|
5217
5404
|
disabled: false,
|
|
5218
5405
|
readonly: false,
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5406
|
+
error: false,
|
|
5407
|
+
maxlength: "9999",
|
|
5408
|
+
leftIcon: "",
|
|
5409
|
+
leftIconSize: "",
|
|
5410
|
+
rightIcon: "",
|
|
5411
|
+
rightIconSize: "",
|
|
5412
|
+
clearable: false,
|
|
5413
|
+
clearIcon: "mask-close",
|
|
5414
|
+
clearSize: "14",
|
|
5415
|
+
border: true,
|
|
5416
|
+
formatTrigger: "onChange",
|
|
5417
|
+
rules: [],
|
|
5418
|
+
rows: null,
|
|
5419
|
+
errorMessage: "",
|
|
5420
|
+
errorMessageAlign: "",
|
|
5421
|
+
showWordLimit: false,
|
|
5422
|
+
autofocus: false,
|
|
5423
|
+
slotButton: null,
|
|
5424
|
+
slotInput: null
|
|
5222
5425
|
};
|
|
5223
5426
|
const Input = (props) => {
|
|
5224
5427
|
const { locale } = useConfig();
|
|
5225
5428
|
const {
|
|
5429
|
+
children,
|
|
5226
5430
|
type,
|
|
5227
5431
|
defaultValue,
|
|
5228
5432
|
placeholder,
|
|
5229
5433
|
label,
|
|
5230
|
-
|
|
5434
|
+
labelClass,
|
|
5435
|
+
labelWidth,
|
|
5436
|
+
labelAlign,
|
|
5437
|
+
colon,
|
|
5438
|
+
inputAlign,
|
|
5439
|
+
center,
|
|
5440
|
+
required,
|
|
5231
5441
|
disabled,
|
|
5232
5442
|
readonly,
|
|
5233
|
-
|
|
5234
|
-
|
|
5443
|
+
error,
|
|
5444
|
+
maxlength,
|
|
5445
|
+
leftIcon,
|
|
5446
|
+
leftIconSize,
|
|
5447
|
+
rightIcon,
|
|
5448
|
+
rightIconSize,
|
|
5235
5449
|
clearable,
|
|
5450
|
+
clearIcon,
|
|
5451
|
+
clearSize,
|
|
5452
|
+
border,
|
|
5453
|
+
formatTrigger,
|
|
5454
|
+
rules,
|
|
5455
|
+
errorMessage,
|
|
5456
|
+
errorMessageAlign,
|
|
5457
|
+
showWordLimit,
|
|
5458
|
+
autofocus,
|
|
5236
5459
|
style,
|
|
5237
5460
|
className,
|
|
5461
|
+
rows,
|
|
5462
|
+
slotButton,
|
|
5463
|
+
slotInput,
|
|
5238
5464
|
change,
|
|
5239
5465
|
blur,
|
|
5240
5466
|
focus,
|
|
5241
|
-
clear
|
|
5242
|
-
|
|
5467
|
+
clear,
|
|
5468
|
+
formatter,
|
|
5469
|
+
keypress,
|
|
5470
|
+
clickInput,
|
|
5471
|
+
clickLeftIcon,
|
|
5472
|
+
clickRightIcon,
|
|
5473
|
+
click,
|
|
5474
|
+
...rest
|
|
5475
|
+
} = { ...defaultProps$G, ...props };
|
|
5243
5476
|
locale.placeholder = placeholder || locale.placeholder;
|
|
5244
|
-
const inputBem = cn("input");
|
|
5245
5477
|
const [inputValue, SetInputValue] = useState("");
|
|
5246
5478
|
const [active, SetActive] = useState(false);
|
|
5479
|
+
const [classes, setClasses] = useState("");
|
|
5480
|
+
const getModelValue = () => String(inputValue != null ? inputValue : "");
|
|
5481
|
+
const inputRef = useRef(null);
|
|
5482
|
+
useLayoutEffect$1(() => {
|
|
5483
|
+
updateValue(getModelValue(), formatTrigger);
|
|
5484
|
+
});
|
|
5247
5485
|
useEffect(() => {
|
|
5486
|
+
setClasses(inputClass);
|
|
5248
5487
|
if (defaultValue) {
|
|
5249
5488
|
SetInputValue(defaultValue);
|
|
5250
5489
|
}
|
|
5251
5490
|
}, [defaultValue]);
|
|
5252
|
-
|
|
5253
|
-
|
|
5491
|
+
useEffect(() => {
|
|
5492
|
+
if (inputValue) {
|
|
5493
|
+
updateValue(getModelValue());
|
|
5494
|
+
resetValidation();
|
|
5495
|
+
}
|
|
5496
|
+
}, [inputValue]);
|
|
5497
|
+
const inputClass = useCallback(() => {
|
|
5498
|
+
const prefixCls = "nut-input";
|
|
5499
|
+
return [
|
|
5500
|
+
prefixCls,
|
|
5501
|
+
`${center ? "center" : ""}`,
|
|
5502
|
+
`${disabled ? `${prefixCls}-disabled` : ""}`,
|
|
5503
|
+
`${required ? `${prefixCls}-required` : ""}`,
|
|
5504
|
+
`${error ? `${prefixCls}-error` : ""}`,
|
|
5505
|
+
`${border ? `${prefixCls}-border` : ""}`
|
|
5506
|
+
].filter(Boolean).join(" ");
|
|
5507
|
+
}, [disabled, required, error, border]);
|
|
5508
|
+
const updateValue = (value, trigger = "onChange") => {
|
|
5509
|
+
var _a;
|
|
5510
|
+
let val = value;
|
|
5254
5511
|
if (type === "digit") {
|
|
5255
|
-
val = formatNumber(val,
|
|
5512
|
+
val = formatNumber(val, false, false);
|
|
5256
5513
|
}
|
|
5257
5514
|
if (type === "number") {
|
|
5258
|
-
val = formatNumber(val,
|
|
5515
|
+
val = formatNumber(val, true, true);
|
|
5259
5516
|
}
|
|
5260
|
-
if (
|
|
5261
|
-
val = val
|
|
5517
|
+
if (formatter && trigger === formatTrigger) {
|
|
5518
|
+
val = formatter(val);
|
|
5519
|
+
}
|
|
5520
|
+
if (((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) !== val) {
|
|
5521
|
+
inputRef.current.value = val;
|
|
5262
5522
|
}
|
|
5263
|
-
change && change(val, event);
|
|
5264
5523
|
SetInputValue(val);
|
|
5265
5524
|
};
|
|
5266
|
-
const
|
|
5525
|
+
const onFocus = (event) => {
|
|
5267
5526
|
const val = event.target.value;
|
|
5268
5527
|
SetActive(true);
|
|
5269
|
-
|
|
5270
|
-
|
|
5528
|
+
focus && focus(val, event);
|
|
5529
|
+
};
|
|
5530
|
+
const onInput = (event) => {
|
|
5531
|
+
let val = event.target.value;
|
|
5532
|
+
if (maxlength && val.length > Number(maxlength)) {
|
|
5533
|
+
val = val.slice(0, Number(maxlength));
|
|
5271
5534
|
}
|
|
5535
|
+
updateValue(val);
|
|
5536
|
+
change && change(val, event);
|
|
5272
5537
|
};
|
|
5273
|
-
const
|
|
5538
|
+
const onBlur = (event) => {
|
|
5274
5539
|
setTimeout(() => {
|
|
5275
5540
|
SetActive(false);
|
|
5276
|
-
},
|
|
5277
|
-
|
|
5278
|
-
if (
|
|
5279
|
-
|
|
5541
|
+
}, 200);
|
|
5542
|
+
let val = event.target.value;
|
|
5543
|
+
if (maxlength && val.length > Number(maxlength)) {
|
|
5544
|
+
val = val.slice(0, Number(maxlength));
|
|
5280
5545
|
}
|
|
5546
|
+
updateValue(getModelValue(), "onBlur");
|
|
5547
|
+
blur && blur(val, event);
|
|
5281
5548
|
};
|
|
5282
|
-
const
|
|
5283
|
-
|
|
5284
|
-
|
|
5549
|
+
const onClickInput = (event) => {
|
|
5550
|
+
clickInput && clickInput(event);
|
|
5551
|
+
};
|
|
5552
|
+
const onClickLeftIcon = (event) => {
|
|
5553
|
+
clickLeftIcon && clickLeftIcon(event);
|
|
5554
|
+
};
|
|
5555
|
+
const onClickRightIcon = (event) => {
|
|
5556
|
+
clickRightIcon && clickRightIcon(event);
|
|
5557
|
+
};
|
|
5558
|
+
const resetValidation = () => {
|
|
5559
|
+
};
|
|
5560
|
+
const inputType = (type2) => {
|
|
5561
|
+
if (type2 === "number") {
|
|
5562
|
+
return "text";
|
|
5563
|
+
}
|
|
5564
|
+
if (type2 === "digit") {
|
|
5565
|
+
return "tel";
|
|
5285
5566
|
}
|
|
5286
|
-
|
|
5567
|
+
return type2;
|
|
5287
5568
|
};
|
|
5288
|
-
const
|
|
5289
|
-
|
|
5569
|
+
const handleClear = (event) => {
|
|
5570
|
+
updateValue("");
|
|
5571
|
+
clear && clear("", event);
|
|
5290
5572
|
};
|
|
5291
5573
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
5292
|
-
className: `${
|
|
5574
|
+
className: `${classes} ${className || ""}`,
|
|
5575
|
+
style,
|
|
5576
|
+
...rest,
|
|
5577
|
+
onClick: (e2) => {
|
|
5578
|
+
click && click(e2);
|
|
5579
|
+
}
|
|
5580
|
+
}, slotInput ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
5581
|
+
className: `nut-input-label ${labelClass}`,
|
|
5582
|
+
style: { width: `${labelWidth}px`, textAlign: labelAlign }
|
|
5583
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5584
|
+
className: "label-string"
|
|
5585
|
+
}, label, colon ? ":" : "")), /* @__PURE__ */ React__default.createElement("div", {
|
|
5586
|
+
className: "nut-input-value"
|
|
5587
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5588
|
+
className: "nut-input-inner",
|
|
5589
|
+
onClick: (e2) => {
|
|
5590
|
+
onClickInput(e2);
|
|
5591
|
+
}
|
|
5592
|
+
}, slotInput))) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, leftIcon && leftIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5593
|
+
className: "nut-input-left-icon",
|
|
5594
|
+
onClick: (e2) => {
|
|
5595
|
+
onClickLeftIcon(e2);
|
|
5596
|
+
}
|
|
5597
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
5598
|
+
name: leftIcon,
|
|
5599
|
+
size: leftIconSize
|
|
5600
|
+
})) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
5601
|
+
className: `nut-input-label ${labelClass}`,
|
|
5602
|
+
style: { width: `${labelWidth}px`, textAlign: labelAlign }
|
|
5293
5603
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5294
|
-
className: inputBem("label")
|
|
5295
|
-
}, requireShow ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5296
|
-
className: inputBem("require")
|
|
5297
|
-
}, "*") : null, label ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5298
5604
|
className: "label-string"
|
|
5299
|
-
}, label
|
|
5605
|
+
}, label, colon ? ":" : "")), /* @__PURE__ */ React__default.createElement("div", {
|
|
5606
|
+
className: "nut-input-value"
|
|
5607
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5608
|
+
className: "nut-input-inner",
|
|
5609
|
+
onClick: (e2) => {
|
|
5610
|
+
onClickInput(e2);
|
|
5611
|
+
}
|
|
5612
|
+
}, type === "textarea" ? /* @__PURE__ */ React__default.createElement("textarea", {
|
|
5300
5613
|
className: "input-text",
|
|
5301
|
-
|
|
5302
|
-
|
|
5614
|
+
ref: inputRef,
|
|
5615
|
+
style: {
|
|
5616
|
+
textAlign: inputAlign,
|
|
5617
|
+
height: `${Number(rows) * 24}px`
|
|
5618
|
+
},
|
|
5619
|
+
maxLength: maxlength,
|
|
5620
|
+
placeholder: placeholder || locale.placeholder,
|
|
5303
5621
|
disabled,
|
|
5304
5622
|
readOnly: readonly,
|
|
5305
5623
|
value: inputValue,
|
|
5306
|
-
|
|
5307
|
-
maxLength,
|
|
5624
|
+
autoFocus: autofocus,
|
|
5308
5625
|
onBlur: (e2) => {
|
|
5309
|
-
|
|
5626
|
+
onBlur(e2);
|
|
5310
5627
|
},
|
|
5311
5628
|
onFocus: (e2) => {
|
|
5312
|
-
|
|
5629
|
+
onFocus(e2);
|
|
5313
5630
|
},
|
|
5314
|
-
|
|
5315
|
-
|
|
5631
|
+
onInput: (e2) => {
|
|
5632
|
+
onInput(e2);
|
|
5316
5633
|
}
|
|
5317
|
-
})
|
|
5318
|
-
|
|
5319
|
-
|
|
5634
|
+
}) : /* @__PURE__ */ React__default.createElement("input", {
|
|
5635
|
+
className: "input-text",
|
|
5636
|
+
ref: inputRef,
|
|
5637
|
+
style: { textAlign: inputAlign },
|
|
5638
|
+
type: inputType(type),
|
|
5639
|
+
maxLength: maxlength,
|
|
5640
|
+
placeholder: placeholder || locale.placeholder,
|
|
5641
|
+
disabled,
|
|
5642
|
+
readOnly: readonly,
|
|
5643
|
+
value: inputValue,
|
|
5644
|
+
autoFocus: autofocus,
|
|
5645
|
+
onBlur: (e2) => {
|
|
5646
|
+
onBlur(e2);
|
|
5320
5647
|
},
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5648
|
+
onFocus: (e2) => {
|
|
5649
|
+
onFocus(e2);
|
|
5650
|
+
},
|
|
5651
|
+
onInput: (e2) => {
|
|
5652
|
+
onInput(e2);
|
|
5653
|
+
}
|
|
5654
|
+
}), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
5655
|
+
className: "nut-input-clear",
|
|
5656
|
+
name: clearIcon,
|
|
5657
|
+
size: clearSize,
|
|
5658
|
+
click: (e2) => {
|
|
5659
|
+
handleClear(e2);
|
|
5660
|
+
}
|
|
5661
|
+
}) : null, rightIcon && rightIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5662
|
+
className: "nut-input-right-icon",
|
|
5663
|
+
onClick: (e2) => {
|
|
5664
|
+
onClickRightIcon(e2);
|
|
5665
|
+
}
|
|
5666
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
5667
|
+
name: rightIcon,
|
|
5668
|
+
size: rightIconSize
|
|
5669
|
+
})) : null, slotButton ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5670
|
+
className: "nut-input-button"
|
|
5671
|
+
}, slotButton) : null), showWordLimit && maxlength ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5672
|
+
className: "nut-input-word-limit"
|
|
5673
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
5674
|
+
className: "nut-input-word-num"
|
|
5675
|
+
}, inputValue ? inputValue.length : 0), "/", maxlength) : null, errorMessage ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5676
|
+
className: "nut-input-error-message",
|
|
5677
|
+
style: {
|
|
5678
|
+
textAlign: errorMessageAlign
|
|
5679
|
+
}
|
|
5680
|
+
}, errorMessage) : null)));
|
|
5326
5681
|
};
|
|
5327
|
-
Input.defaultProps = defaultProps$
|
|
5682
|
+
Input.defaultProps = defaultProps$G;
|
|
5328
5683
|
Input.displayName = "NutInput";
|
|
5329
5684
|
const radioContext = {
|
|
5330
5685
|
onChange: (val) => {
|
|
5331
5686
|
}
|
|
5332
5687
|
};
|
|
5333
5688
|
var RadioContext = React__default.createContext(radioContext);
|
|
5334
|
-
const defaultProps$
|
|
5689
|
+
const defaultProps$F = {
|
|
5335
5690
|
value: null,
|
|
5336
5691
|
textPosition: "right",
|
|
5337
5692
|
onChange: (value) => {
|
|
@@ -5339,7 +5694,7 @@ const defaultProps$E = {
|
|
|
5339
5694
|
direction: "vertical"
|
|
5340
5695
|
};
|
|
5341
5696
|
const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
5342
|
-
const { children } = { ...defaultProps$
|
|
5697
|
+
const { children } = { ...defaultProps$F, ...props };
|
|
5343
5698
|
cn("RadioGroup");
|
|
5344
5699
|
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
5345
5700
|
const [val2State, setVal2State] = useState(value);
|
|
@@ -5375,9 +5730,9 @@ const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
|
5375
5730
|
...rest
|
|
5376
5731
|
}, cloneChildren()));
|
|
5377
5732
|
});
|
|
5378
|
-
RadioGroup.defaultProps = defaultProps$
|
|
5733
|
+
RadioGroup.defaultProps = defaultProps$F;
|
|
5379
5734
|
RadioGroup.displayName = "NutRadioGroup";
|
|
5380
|
-
const defaultProps$
|
|
5735
|
+
const defaultProps$E = {
|
|
5381
5736
|
disabled: false,
|
|
5382
5737
|
checked: false,
|
|
5383
5738
|
shape: "round",
|
|
@@ -5390,7 +5745,7 @@ const defaultProps$D = {
|
|
|
5390
5745
|
}
|
|
5391
5746
|
};
|
|
5392
5747
|
const Radio = (props) => {
|
|
5393
|
-
const { children } = { ...defaultProps$
|
|
5748
|
+
const { children } = { ...defaultProps$E, ...props };
|
|
5394
5749
|
const {
|
|
5395
5750
|
className,
|
|
5396
5751
|
disabled,
|
|
@@ -5449,10 +5804,10 @@ const Radio = (props) => {
|
|
|
5449
5804
|
...rest
|
|
5450
5805
|
}, props.shape == "button" ? renderButton() : reverseState ? [renderLabel(), renderIcon()] : [renderIcon(), renderLabel()]);
|
|
5451
5806
|
};
|
|
5452
|
-
Radio.defaultProps = defaultProps$
|
|
5807
|
+
Radio.defaultProps = defaultProps$E;
|
|
5453
5808
|
Radio.displayName = "NutRadio";
|
|
5454
5809
|
Radio.RadioGroup = RadioGroup;
|
|
5455
|
-
const defaultProps$
|
|
5810
|
+
const defaultProps$D = {
|
|
5456
5811
|
count: 5,
|
|
5457
5812
|
modelValue: 0,
|
|
5458
5813
|
minimizeValue: 0,
|
|
@@ -5481,7 +5836,7 @@ const Rate = (props) => {
|
|
|
5481
5836
|
allowHalf,
|
|
5482
5837
|
spacing,
|
|
5483
5838
|
change
|
|
5484
|
-
} = { ...defaultProps$
|
|
5839
|
+
} = { ...defaultProps$D, ...props };
|
|
5485
5840
|
const b2 = cn("rate");
|
|
5486
5841
|
const bi = cn("rate-item");
|
|
5487
5842
|
const [countArray, setCountArray] = useState([1, 2, 3, 4, 5]);
|
|
@@ -5545,9 +5900,9 @@ const Rate = (props) => {
|
|
|
5545
5900
|
}));
|
|
5546
5901
|
}));
|
|
5547
5902
|
};
|
|
5548
|
-
Rate.defaultProps = defaultProps$
|
|
5903
|
+
Rate.defaultProps = defaultProps$D;
|
|
5549
5904
|
Rate.displayName = "NutRate";
|
|
5550
|
-
const defaultProps$
|
|
5905
|
+
const defaultProps$C = {
|
|
5551
5906
|
title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
5552
5907
|
desc: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1",
|
|
5553
5908
|
tips: "\u5FD8\u8BB0\u5BC6\u7801",
|
|
@@ -5707,9 +6062,9 @@ const ShortPassword = (props) => {
|
|
|
5707
6062
|
onClick: () => sure()
|
|
5708
6063
|
}, locale.confirm)) : null)));
|
|
5709
6064
|
};
|
|
5710
|
-
ShortPassword.defaultProps = defaultProps$
|
|
6065
|
+
ShortPassword.defaultProps = defaultProps$C;
|
|
5711
6066
|
ShortPassword.displayName = "NutShortPassword";
|
|
5712
|
-
const defaultProps$
|
|
6067
|
+
const defaultProps$B = {
|
|
5713
6068
|
defaultValue: "",
|
|
5714
6069
|
textAlign: "left",
|
|
5715
6070
|
limitshow: false,
|
|
@@ -5737,7 +6092,7 @@ const TextArea = (props) => {
|
|
|
5737
6092
|
onChange,
|
|
5738
6093
|
onBlur,
|
|
5739
6094
|
onFocus
|
|
5740
|
-
} = { ...defaultProps$
|
|
6095
|
+
} = { ...defaultProps$B, ...props };
|
|
5741
6096
|
const textareaBem = cn("textarea");
|
|
5742
6097
|
const [inputValue, SetInputValue] = useState("");
|
|
5743
6098
|
useEffect(() => {
|
|
@@ -5801,7 +6156,7 @@ const TextArea = (props) => {
|
|
|
5801
6156
|
className: textareaBem("limit")
|
|
5802
6157
|
}, inputValue.length, "/", maxlength < 0 ? 0 : maxlength) : null);
|
|
5803
6158
|
};
|
|
5804
|
-
TextArea.defaultProps = defaultProps$
|
|
6159
|
+
TextArea.defaultProps = defaultProps$B;
|
|
5805
6160
|
TextArea.displayName = "NutTextArea";
|
|
5806
6161
|
class UploadOptions {
|
|
5807
6162
|
constructor() {
|
|
@@ -5850,7 +6205,7 @@ class Upload {
|
|
|
5850
6205
|
}
|
|
5851
6206
|
}
|
|
5852
6207
|
}
|
|
5853
|
-
const defaultProps$
|
|
6208
|
+
const defaultProps$A = {
|
|
5854
6209
|
url: "",
|
|
5855
6210
|
maximum: 1,
|
|
5856
6211
|
uploadIcon: "photograph",
|
|
@@ -5925,7 +6280,7 @@ const InternalUploader = (props, ref) => {
|
|
|
5925
6280
|
beforeUpload,
|
|
5926
6281
|
beforeDelete,
|
|
5927
6282
|
...restProps
|
|
5928
|
-
} = { ...defaultProps$
|
|
6283
|
+
} = { ...defaultProps$A, ...props };
|
|
5929
6284
|
const [fileList, setFileList] = useState([]);
|
|
5930
6285
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
5931
6286
|
useEffect(() => {
|
|
@@ -6214,9 +6569,9 @@ const InternalUploader = (props, ref) => {
|
|
|
6214
6569
|
})));
|
|
6215
6570
|
};
|
|
6216
6571
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
6217
|
-
Uploader.defaultProps = defaultProps$
|
|
6572
|
+
Uploader.defaultProps = defaultProps$A;
|
|
6218
6573
|
Uploader.displayName = "NutUploader";
|
|
6219
|
-
const defaultProps$
|
|
6574
|
+
const defaultProps$z = {
|
|
6220
6575
|
cancelTxt: "",
|
|
6221
6576
|
optionTag: "name",
|
|
6222
6577
|
optionSubTag: "subname",
|
|
@@ -6249,7 +6604,7 @@ const ActionSheet = (props) => {
|
|
|
6249
6604
|
className,
|
|
6250
6605
|
style,
|
|
6251
6606
|
...rest
|
|
6252
|
-
} = { ...defaultProps$
|
|
6607
|
+
} = { ...defaultProps$z, ...props };
|
|
6253
6608
|
const b2 = cn("actionsheet");
|
|
6254
6609
|
const isHighlight = (item) => {
|
|
6255
6610
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -6293,12 +6648,12 @@ const ActionSheet = (props) => {
|
|
|
6293
6648
|
onClick: () => cancelActionSheet()
|
|
6294
6649
|
}, cancelTxt)));
|
|
6295
6650
|
};
|
|
6296
|
-
ActionSheet.defaultProps = defaultProps$
|
|
6651
|
+
ActionSheet.defaultProps = defaultProps$z;
|
|
6297
6652
|
ActionSheet.displayName = "NutActionSheet";
|
|
6298
|
-
const defaultProps$
|
|
6653
|
+
const defaultProps$y = {
|
|
6299
6654
|
bottom: 20,
|
|
6300
6655
|
right: 10,
|
|
6301
|
-
elId: "",
|
|
6656
|
+
elId: "body",
|
|
6302
6657
|
distance: 200,
|
|
6303
6658
|
zIndex: 10,
|
|
6304
6659
|
isAnimation: true,
|
|
@@ -6316,9 +6671,9 @@ const BackTop = (props) => {
|
|
|
6316
6671
|
className,
|
|
6317
6672
|
duration,
|
|
6318
6673
|
style,
|
|
6319
|
-
|
|
6674
|
+
onClick
|
|
6320
6675
|
} = {
|
|
6321
|
-
...defaultProps$
|
|
6676
|
+
...defaultProps$y,
|
|
6322
6677
|
...props
|
|
6323
6678
|
};
|
|
6324
6679
|
const [backTop, SetBackTop] = useState(false);
|
|
@@ -6357,11 +6712,11 @@ const BackTop = (props) => {
|
|
|
6357
6712
|
};
|
|
6358
6713
|
const scrollAnimation = () => {
|
|
6359
6714
|
let cid = requestAniFrame2()(function fn() {
|
|
6360
|
-
const t2 = duration - Math.max(0, startTime - +new Date() + duration);
|
|
6715
|
+
const t2 = duration - Math.max(0, startTime - +new Date() + duration / 2);
|
|
6361
6716
|
const y2 = t2 * -scrollTop / duration + scrollTop;
|
|
6362
6717
|
scroll(y2);
|
|
6363
6718
|
cid = requestAniFrame2()(fn);
|
|
6364
|
-
if (t2
|
|
6719
|
+
if (t2 === duration || y2 === 0) {
|
|
6365
6720
|
window.cancelAnimationFrame(cid);
|
|
6366
6721
|
}
|
|
6367
6722
|
});
|
|
@@ -6385,7 +6740,7 @@ const BackTop = (props) => {
|
|
|
6385
6740
|
(_b = scrollEl.current) == null ? void 0 : _b.removeEventListener("resize", scrollListener, false);
|
|
6386
6741
|
}
|
|
6387
6742
|
const goTop = (e2) => {
|
|
6388
|
-
|
|
6743
|
+
onClick && onClick(e2);
|
|
6389
6744
|
const otime = +new Date();
|
|
6390
6745
|
startTime = otime;
|
|
6391
6746
|
isAnimation && duration > 0 ? scrollAnimation() : scroll();
|
|
@@ -6398,14 +6753,16 @@ const BackTop = (props) => {
|
|
|
6398
6753
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6399
6754
|
className: `nut-backtop ${backTop ? "show" : ""} ${className || ""}`,
|
|
6400
6755
|
style: { ...backTopClass, ...style },
|
|
6401
|
-
onClick:
|
|
6756
|
+
onClick: (e2) => {
|
|
6757
|
+
goTop(e2);
|
|
6758
|
+
}
|
|
6402
6759
|
}, children || /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6403
6760
|
size: "19px",
|
|
6404
6761
|
className: "nut-backtop-main",
|
|
6405
6762
|
name: "top"
|
|
6406
6763
|
}));
|
|
6407
6764
|
};
|
|
6408
|
-
BackTop.defaultProps = defaultProps$
|
|
6765
|
+
BackTop.defaultProps = defaultProps$y;
|
|
6409
6766
|
BackTop.displayName = "NutBackTop";
|
|
6410
6767
|
function clamp(v2, min, max) {
|
|
6411
6768
|
return Math.max(min, Math.min(v2, max));
|
|
@@ -10808,7 +11165,7 @@ const host = createHost(primitives, {
|
|
|
10808
11165
|
}
|
|
10809
11166
|
});
|
|
10810
11167
|
const animated = host.animated;
|
|
10811
|
-
const defaultProps$
|
|
11168
|
+
const defaultProps$x = {
|
|
10812
11169
|
attract: false,
|
|
10813
11170
|
direction: void 0,
|
|
10814
11171
|
boundary: {
|
|
@@ -10821,7 +11178,7 @@ const defaultProps$w = {
|
|
|
10821
11178
|
};
|
|
10822
11179
|
const Drag = (props) => {
|
|
10823
11180
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
10824
|
-
...defaultProps$
|
|
11181
|
+
...defaultProps$x,
|
|
10825
11182
|
...props
|
|
10826
11183
|
};
|
|
10827
11184
|
const b2 = cn("drag");
|
|
@@ -10880,7 +11237,7 @@ const Drag = (props) => {
|
|
|
10880
11237
|
...bind()
|
|
10881
11238
|
}, children));
|
|
10882
11239
|
};
|
|
10883
|
-
Drag.defaultProps = defaultProps$
|
|
11240
|
+
Drag.defaultProps = defaultProps$x;
|
|
10884
11241
|
Drag.displayName = "NutDrag";
|
|
10885
11242
|
const Content = (props) => {
|
|
10886
11243
|
const {
|
|
@@ -11072,7 +11429,7 @@ function confirm(config2, renderFunc) {
|
|
|
11072
11429
|
update: update2
|
|
11073
11430
|
};
|
|
11074
11431
|
}
|
|
11075
|
-
const defaultProps$
|
|
11432
|
+
const defaultProps$w = {
|
|
11076
11433
|
okText: "",
|
|
11077
11434
|
cancelText: "",
|
|
11078
11435
|
mask: true,
|
|
@@ -11163,9 +11520,9 @@ Dialog.confirm = (props) => {
|
|
|
11163
11520
|
});
|
|
11164
11521
|
};
|
|
11165
11522
|
});
|
|
11166
|
-
Dialog.defaultProps = defaultProps$
|
|
11523
|
+
Dialog.defaultProps = defaultProps$w;
|
|
11167
11524
|
Dialog.displayName = "NutDialog";
|
|
11168
|
-
const defaultProps$
|
|
11525
|
+
const defaultProps$v = {
|
|
11169
11526
|
hasMore: true,
|
|
11170
11527
|
threshold: 200,
|
|
11171
11528
|
containerId: "",
|
|
@@ -11199,7 +11556,7 @@ const Infiniteloading = (props) => {
|
|
|
11199
11556
|
scrollChange,
|
|
11200
11557
|
...restProps
|
|
11201
11558
|
} = {
|
|
11202
|
-
...defaultProps$
|
|
11559
|
+
...defaultProps$v,
|
|
11203
11560
|
...props
|
|
11204
11561
|
};
|
|
11205
11562
|
const [isInfiniting, setIsInfiniting] = useState(false);
|
|
@@ -11356,7 +11713,7 @@ const Infiniteloading = (props) => {
|
|
|
11356
11713
|
className: "tips"
|
|
11357
11714
|
}, locale.infiniteloading.loadMoreText || loadMoreTxt)));
|
|
11358
11715
|
};
|
|
11359
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
11716
|
+
Infiniteloading.defaultProps = defaultProps$v;
|
|
11360
11717
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
11361
11718
|
class Notification extends React.PureComponent {
|
|
11362
11719
|
constructor(props) {
|
|
@@ -11515,7 +11872,7 @@ var Notify = {
|
|
|
11515
11872
|
}
|
|
11516
11873
|
}
|
|
11517
11874
|
};
|
|
11518
|
-
const defaultProps$
|
|
11875
|
+
const defaultProps$u = {
|
|
11519
11876
|
isAsync: false,
|
|
11520
11877
|
checked: false,
|
|
11521
11878
|
disable: false,
|
|
@@ -11538,7 +11895,7 @@ const Switch = (props) => {
|
|
|
11538
11895
|
className,
|
|
11539
11896
|
style
|
|
11540
11897
|
} = {
|
|
11541
|
-
...defaultProps$
|
|
11898
|
+
...defaultProps$u,
|
|
11542
11899
|
...props
|
|
11543
11900
|
};
|
|
11544
11901
|
const [value, setValue] = useState(false);
|
|
@@ -11578,10 +11935,10 @@ const Switch = (props) => {
|
|
|
11578
11935
|
className: `${b2("label")} close`
|
|
11579
11936
|
}, inactiveText))));
|
|
11580
11937
|
};
|
|
11581
|
-
Switch.defaultProps = defaultProps$
|
|
11938
|
+
Switch.defaultProps = defaultProps$u;
|
|
11582
11939
|
Switch.displayName = "NutSwitch";
|
|
11583
11940
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
11584
|
-
const defaultProps$
|
|
11941
|
+
const defaultProps$t = {
|
|
11585
11942
|
strokeWidth: 5,
|
|
11586
11943
|
radius: 50,
|
|
11587
11944
|
strokeLinecap: "round",
|
|
@@ -11604,7 +11961,7 @@ const CircleProgress = (props) => {
|
|
|
11604
11961
|
strokeLinecap,
|
|
11605
11962
|
...restProps
|
|
11606
11963
|
} = {
|
|
11607
|
-
...defaultProps$
|
|
11964
|
+
...defaultProps$t,
|
|
11608
11965
|
...props
|
|
11609
11966
|
};
|
|
11610
11967
|
const b2 = cn("circleprogress");
|
|
@@ -11688,9 +12045,9 @@ const CircleProgress = (props) => {
|
|
|
11688
12045
|
className: "nut-circleprogress-text"
|
|
11689
12046
|
}, children || /* @__PURE__ */ React__default.createElement("div", null, progress, "%")));
|
|
11690
12047
|
};
|
|
11691
|
-
CircleProgress.defaultProps = defaultProps$
|
|
12048
|
+
CircleProgress.defaultProps = defaultProps$t;
|
|
11692
12049
|
CircleProgress.displayName = "NutCircleProgress";
|
|
11693
|
-
const defaultProps$
|
|
12050
|
+
const defaultProps$s = {
|
|
11694
12051
|
direction: "across",
|
|
11695
12052
|
list: [],
|
|
11696
12053
|
standTime: 1e3,
|
|
@@ -11728,7 +12085,7 @@ const NoticeBar = (props) => {
|
|
|
11728
12085
|
rightIcon,
|
|
11729
12086
|
close,
|
|
11730
12087
|
click
|
|
11731
|
-
} = { ...defaultProps$
|
|
12088
|
+
} = { ...defaultProps$s, ...props };
|
|
11732
12089
|
const wrap = useRef(null);
|
|
11733
12090
|
const content = useRef(null);
|
|
11734
12091
|
const [showNoticeBar, SetShowNoticeBar] = useState(true);
|
|
@@ -11941,16 +12298,16 @@ const NoticeBar = (props) => {
|
|
|
11941
12298
|
size: "11px"
|
|
11942
12299
|
}) : null))) : null);
|
|
11943
12300
|
};
|
|
11944
|
-
NoticeBar.defaultProps = defaultProps$
|
|
12301
|
+
NoticeBar.defaultProps = defaultProps$s;
|
|
11945
12302
|
NoticeBar.displayName = "NutNoticeBar";
|
|
11946
12303
|
const DataContext$1 = createContext({});
|
|
11947
|
-
const defaultProps$
|
|
12304
|
+
const defaultProps$r = {
|
|
11948
12305
|
current: 0,
|
|
11949
12306
|
direction: "horizontal",
|
|
11950
12307
|
progressDot: false
|
|
11951
12308
|
};
|
|
11952
12309
|
const Steps = (props) => {
|
|
11953
|
-
const propSteps = { ...defaultProps$
|
|
12310
|
+
const propSteps = { ...defaultProps$r, ...props };
|
|
11954
12311
|
const {
|
|
11955
12312
|
children,
|
|
11956
12313
|
current,
|
|
@@ -11975,9 +12332,9 @@ const Steps = (props) => {
|
|
|
11975
12332
|
...restProps
|
|
11976
12333
|
}, children));
|
|
11977
12334
|
};
|
|
11978
|
-
Steps.defaultProps = defaultProps$
|
|
12335
|
+
Steps.defaultProps = defaultProps$r;
|
|
11979
12336
|
Steps.displayName = "NutSteps";
|
|
11980
|
-
const defaultProps$
|
|
12337
|
+
const defaultProps$q = {
|
|
11981
12338
|
title: "",
|
|
11982
12339
|
content: "",
|
|
11983
12340
|
activeIndex: 0,
|
|
@@ -11998,7 +12355,7 @@ const Step = (props) => {
|
|
|
11998
12355
|
renderContent,
|
|
11999
12356
|
...restProps
|
|
12000
12357
|
} = {
|
|
12001
|
-
...defaultProps$
|
|
12358
|
+
...defaultProps$q,
|
|
12002
12359
|
...props
|
|
12003
12360
|
};
|
|
12004
12361
|
const parent = useContext$1(DataContext$1);
|
|
@@ -12010,13 +12367,24 @@ const Step = (props) => {
|
|
|
12010
12367
|
return index2 === +parent.propSteps.current ? "process" : "wait";
|
|
12011
12368
|
};
|
|
12012
12369
|
const handleClickStep = () => {
|
|
12013
|
-
var _a;
|
|
12014
|
-
(_a = parent.propSteps) == null ? void 0 : _a.clickStep
|
|
12370
|
+
var _a, _b;
|
|
12371
|
+
if ((_a = parent.propSteps) == null ? void 0 : _a.clickStep) {
|
|
12372
|
+
(_b = parent.propSteps) == null ? void 0 : _b.clickStep(activeIndex);
|
|
12373
|
+
}
|
|
12015
12374
|
};
|
|
12016
12375
|
const b2 = cn("step");
|
|
12017
12376
|
const classes = classNames({
|
|
12018
12377
|
[`${b2("")}-${getCurrentStatus()}`]: true
|
|
12019
12378
|
}, className, b2(""));
|
|
12379
|
+
const renderIconClass = () => {
|
|
12380
|
+
if (!dot && icon) {
|
|
12381
|
+
return "nut-step-icon is-icon";
|
|
12382
|
+
}
|
|
12383
|
+
if (!dot && !icon) {
|
|
12384
|
+
return "nut-step-icon is-text";
|
|
12385
|
+
}
|
|
12386
|
+
return "nut-step-icon";
|
|
12387
|
+
};
|
|
12020
12388
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12021
12389
|
className: classes,
|
|
12022
12390
|
...restProps,
|
|
@@ -12026,13 +12394,13 @@ const Step = (props) => {
|
|
|
12026
12394
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12027
12395
|
className: "nut-step-line"
|
|
12028
12396
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
12029
|
-
className:
|
|
12397
|
+
className: renderIconClass()
|
|
12030
12398
|
}, icon ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
12031
12399
|
className: "nut-step-icon-inner",
|
|
12032
12400
|
color: iconColor,
|
|
12033
12401
|
name: icon,
|
|
12034
12402
|
size
|
|
12035
|
-
}) : dot
|
|
12403
|
+
}) : !dot && /* @__PURE__ */ React__default.createElement("span", {
|
|
12036
12404
|
className: "nut-step-inner"
|
|
12037
12405
|
}, activeIndex))), /* @__PURE__ */ React__default.createElement("div", {
|
|
12038
12406
|
className: "nut-step-main"
|
|
@@ -12044,10 +12412,10 @@ const Step = (props) => {
|
|
|
12044
12412
|
className: "nut-step-content"
|
|
12045
12413
|
}, renderContent())));
|
|
12046
12414
|
};
|
|
12047
|
-
Step.defaultProps = defaultProps$
|
|
12415
|
+
Step.defaultProps = defaultProps$q;
|
|
12048
12416
|
Step.displayName = "NutStep";
|
|
12049
12417
|
const DataContext = createContext({});
|
|
12050
|
-
const defaultProps$
|
|
12418
|
+
const defaultProps$p = {
|
|
12051
12419
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
12052
12420
|
height: 0,
|
|
12053
12421
|
duration: 500,
|
|
@@ -12064,7 +12432,7 @@ const defaultProps$o = {
|
|
|
12064
12432
|
};
|
|
12065
12433
|
const DISTANCE = 5;
|
|
12066
12434
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
12067
|
-
const propSwiper = { ...defaultProps$
|
|
12435
|
+
const propSwiper = { ...defaultProps$p, ...props };
|
|
12068
12436
|
const {
|
|
12069
12437
|
children,
|
|
12070
12438
|
direction,
|
|
@@ -12453,13 +12821,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12453
12821
|
});
|
|
12454
12822
|
})) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
|
|
12455
12823
|
});
|
|
12456
|
-
Swiper.defaultProps = defaultProps$
|
|
12824
|
+
Swiper.defaultProps = defaultProps$p;
|
|
12457
12825
|
Swiper.displayName = "NutSwiper";
|
|
12458
|
-
const defaultProps$
|
|
12826
|
+
const defaultProps$o = {
|
|
12459
12827
|
direction: "horizontal"
|
|
12460
12828
|
};
|
|
12461
12829
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
12462
|
-
const _props = { ...defaultProps$
|
|
12830
|
+
const _props = { ...defaultProps$o, ...props };
|
|
12463
12831
|
const { children, direction, size } = _props;
|
|
12464
12832
|
const parent = useContext$1(DataContext);
|
|
12465
12833
|
const [offset, setOffset] = useState(0);
|
|
@@ -12484,10 +12852,10 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
12484
12852
|
style: style()
|
|
12485
12853
|
}, children);
|
|
12486
12854
|
});
|
|
12487
|
-
SwiperItem.defaultProps = defaultProps$
|
|
12855
|
+
SwiperItem.defaultProps = defaultProps$o;
|
|
12488
12856
|
SwiperItem.displayName = "NutSwiperItem";
|
|
12489
12857
|
const AvatarContext = createContext({});
|
|
12490
|
-
const defaultProps$
|
|
12858
|
+
const defaultProps$n = {
|
|
12491
12859
|
size: "",
|
|
12492
12860
|
icon: "",
|
|
12493
12861
|
bgColor: "#eee",
|
|
@@ -12514,7 +12882,7 @@ const Avatar = (props) => {
|
|
|
12514
12882
|
onError,
|
|
12515
12883
|
...rest
|
|
12516
12884
|
} = {
|
|
12517
|
-
...defaultProps$
|
|
12885
|
+
...defaultProps$n,
|
|
12518
12886
|
...props
|
|
12519
12887
|
};
|
|
12520
12888
|
const [maxSum, setMaxSum] = useState(0);
|
|
@@ -12594,9 +12962,9 @@ const Avatar = (props) => {
|
|
|
12594
12962
|
className: "text"
|
|
12595
12963
|
}, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}`)));
|
|
12596
12964
|
};
|
|
12597
|
-
Avatar.defaultProps = defaultProps$
|
|
12965
|
+
Avatar.defaultProps = defaultProps$n;
|
|
12598
12966
|
Avatar.displayName = "NutAvatar";
|
|
12599
|
-
const defaultProps$
|
|
12967
|
+
const defaultProps$m = {
|
|
12600
12968
|
maxContent: "",
|
|
12601
12969
|
maxCount: "",
|
|
12602
12970
|
maxBgColor: "#eee",
|
|
@@ -12608,7 +12976,7 @@ const defaultProps$l = {
|
|
|
12608
12976
|
};
|
|
12609
12977
|
const AvatarGroup = (props) => {
|
|
12610
12978
|
useConfig();
|
|
12611
|
-
const propAvatarGroup = { ...defaultProps$
|
|
12979
|
+
const propAvatarGroup = { ...defaultProps$m, ...props };
|
|
12612
12980
|
const { className, style, children } = propAvatarGroup;
|
|
12613
12981
|
const avatarGroupRef = useRef(null);
|
|
12614
12982
|
const b2 = cn("avatar-group");
|
|
@@ -12625,9 +12993,9 @@ const AvatarGroup = (props) => {
|
|
|
12625
12993
|
ref: avatarGroupRef
|
|
12626
12994
|
}, children));
|
|
12627
12995
|
};
|
|
12628
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
12996
|
+
AvatarGroup.defaultProps = defaultProps$m;
|
|
12629
12997
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
12630
|
-
const defaultProps$
|
|
12998
|
+
const defaultProps$l = {
|
|
12631
12999
|
price: 0,
|
|
12632
13000
|
needSymbol: true,
|
|
12633
13001
|
symbol: "¥",
|
|
@@ -12645,7 +13013,7 @@ const Price = (props) => {
|
|
|
12645
13013
|
className,
|
|
12646
13014
|
...rest
|
|
12647
13015
|
} = {
|
|
12648
|
-
...defaultProps$
|
|
13016
|
+
...defaultProps$l,
|
|
12649
13017
|
...props
|
|
12650
13018
|
};
|
|
12651
13019
|
const b2 = cn("price");
|
|
@@ -12698,9 +13066,9 @@ const Price = (props) => {
|
|
|
12698
13066
|
className: `${b2("small")}`
|
|
12699
13067
|
}, formatDecimal(price)));
|
|
12700
13068
|
};
|
|
12701
|
-
Price.defaultProps = defaultProps$
|
|
13069
|
+
Price.defaultProps = defaultProps$l;
|
|
12702
13070
|
Price.displayName = "NutPrice";
|
|
12703
|
-
const defaultProps$
|
|
13071
|
+
const defaultProps$k = {
|
|
12704
13072
|
value: "",
|
|
12705
13073
|
dot: false,
|
|
12706
13074
|
max: 1e4,
|
|
@@ -12712,7 +13080,7 @@ const defaultProps$j = {
|
|
|
12712
13080
|
};
|
|
12713
13081
|
const Badge = (props) => {
|
|
12714
13082
|
const { children, dot, top, right, zIndex, color, icons } = {
|
|
12715
|
-
...defaultProps$
|
|
13083
|
+
...defaultProps$k,
|
|
12716
13084
|
...props
|
|
12717
13085
|
};
|
|
12718
13086
|
const content = () => {
|
|
@@ -12747,9 +13115,9 @@ const Badge = (props) => {
|
|
|
12747
13115
|
style: getStyle()
|
|
12748
13116
|
}, content()));
|
|
12749
13117
|
};
|
|
12750
|
-
Badge.defaultProps = defaultProps$
|
|
13118
|
+
Badge.defaultProps = defaultProps$k;
|
|
12751
13119
|
Badge.displayName = "NutBadge";
|
|
12752
|
-
const defaultProps$
|
|
13120
|
+
const defaultProps$j = {
|
|
12753
13121
|
type: "default",
|
|
12754
13122
|
color: "",
|
|
12755
13123
|
textColor: "",
|
|
@@ -12776,7 +13144,7 @@ const Tag = (props) => {
|
|
|
12776
13144
|
isShow,
|
|
12777
13145
|
onClick
|
|
12778
13146
|
} = {
|
|
12779
|
-
...defaultProps$
|
|
13147
|
+
...defaultProps$j,
|
|
12780
13148
|
...props
|
|
12781
13149
|
};
|
|
12782
13150
|
const [btnName, setBtnName] = useState("");
|
|
@@ -12842,7 +13210,7 @@ const Tag = (props) => {
|
|
|
12842
13210
|
className: "text"
|
|
12843
13211
|
}, children)));
|
|
12844
13212
|
};
|
|
12845
|
-
Tag.defaultProps = defaultProps$
|
|
13213
|
+
Tag.defaultProps = defaultProps$j;
|
|
12846
13214
|
Tag.displayName = "NutTag";
|
|
12847
13215
|
function fillRef(ref, node) {
|
|
12848
13216
|
if (typeof ref === "function") {
|
|
@@ -12901,7 +13269,7 @@ const getEleAttr = (ele) => {
|
|
|
12901
13269
|
}
|
|
12902
13270
|
return null;
|
|
12903
13271
|
};
|
|
12904
|
-
const defaultProps$
|
|
13272
|
+
const defaultProps$i = {
|
|
12905
13273
|
list: [],
|
|
12906
13274
|
theme: "light",
|
|
12907
13275
|
location: "bottom",
|
|
@@ -12922,7 +13290,7 @@ const Popover = (props) => {
|
|
|
12922
13290
|
onClick,
|
|
12923
13291
|
...reset
|
|
12924
13292
|
} = {
|
|
12925
|
-
...defaultProps$
|
|
13293
|
+
...defaultProps$i,
|
|
12926
13294
|
...props
|
|
12927
13295
|
};
|
|
12928
13296
|
const goodItem = useRef(null);
|
|
@@ -13031,9 +13399,9 @@ const Popover = (props) => {
|
|
|
13031
13399
|
}, item.name));
|
|
13032
13400
|
})) : null)));
|
|
13033
13401
|
};
|
|
13034
|
-
Popover.defaultProps = defaultProps$
|
|
13402
|
+
Popover.defaultProps = defaultProps$i;
|
|
13035
13403
|
Popover.displayName = "NutPopover";
|
|
13036
|
-
const defaultProps$
|
|
13404
|
+
const defaultProps$h = {
|
|
13037
13405
|
width: "100px",
|
|
13038
13406
|
height: "100px",
|
|
13039
13407
|
row: 1,
|
|
@@ -13061,7 +13429,7 @@ const Skeleton = (props) => {
|
|
|
13061
13429
|
avatarShape,
|
|
13062
13430
|
...restProps
|
|
13063
13431
|
} = {
|
|
13064
|
-
...defaultProps$
|
|
13432
|
+
...defaultProps$h,
|
|
13065
13433
|
...props
|
|
13066
13434
|
};
|
|
13067
13435
|
const b2 = cn("skeleton");
|
|
@@ -13116,9 +13484,9 @@ const Skeleton = (props) => {
|
|
|
13116
13484
|
});
|
|
13117
13485
|
})))));
|
|
13118
13486
|
};
|
|
13119
|
-
Skeleton.defaultProps = defaultProps$
|
|
13487
|
+
Skeleton.defaultProps = defaultProps$h;
|
|
13120
13488
|
Skeleton.displayName = "NutSkeleton";
|
|
13121
|
-
const defaultProps$
|
|
13489
|
+
const defaultProps$g = {
|
|
13122
13490
|
showPlainText: false,
|
|
13123
13491
|
showDays: false,
|
|
13124
13492
|
paused: false,
|
|
@@ -13141,7 +13509,7 @@ const CountDown = (props) => {
|
|
|
13141
13509
|
onUpdate,
|
|
13142
13510
|
children,
|
|
13143
13511
|
...rest
|
|
13144
|
-
} = { ...defaultProps$
|
|
13512
|
+
} = { ...defaultProps$g, ...props };
|
|
13145
13513
|
const b2 = cn("countdown");
|
|
13146
13514
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
13147
13515
|
const stateRef = useRef({
|
|
@@ -13288,9 +13656,9 @@ const CountDown = (props) => {
|
|
|
13288
13656
|
className: b2("block")
|
|
13289
13657
|
}, resttime.s))));
|
|
13290
13658
|
};
|
|
13291
|
-
CountDown.defaultProps = defaultProps$
|
|
13659
|
+
CountDown.defaultProps = defaultProps$g;
|
|
13292
13660
|
CountDown.displayName = "NutCountDown";
|
|
13293
|
-
const defaultProps$
|
|
13661
|
+
const defaultProps$f = {
|
|
13294
13662
|
activeName: ["0"],
|
|
13295
13663
|
accordion: false,
|
|
13296
13664
|
icon: "",
|
|
@@ -13312,7 +13680,7 @@ const Collapse = memo((props) => {
|
|
|
13312
13680
|
iconColor,
|
|
13313
13681
|
change
|
|
13314
13682
|
} = {
|
|
13315
|
-
...defaultProps$
|
|
13683
|
+
...defaultProps$f,
|
|
13316
13684
|
...props
|
|
13317
13685
|
};
|
|
13318
13686
|
const childrenDom = React__default.Children.toArray(children);
|
|
@@ -13367,9 +13735,9 @@ const Collapse = memo((props) => {
|
|
|
13367
13735
|
});
|
|
13368
13736
|
}));
|
|
13369
13737
|
}, areEqual);
|
|
13370
|
-
Collapse.defaultProps = defaultProps$
|
|
13738
|
+
Collapse.defaultProps = defaultProps$f;
|
|
13371
13739
|
Collapse.displayName = "NutCollapse";
|
|
13372
|
-
const defaultProps$
|
|
13740
|
+
const defaultProps$e = {
|
|
13373
13741
|
title: "",
|
|
13374
13742
|
name: "",
|
|
13375
13743
|
isOpen: false,
|
|
@@ -13403,7 +13771,7 @@ const CollapseItem = (props) => {
|
|
|
13403
13771
|
iconColor,
|
|
13404
13772
|
...rest
|
|
13405
13773
|
} = {
|
|
13406
|
-
...defaultProps$
|
|
13774
|
+
...defaultProps$e,
|
|
13407
13775
|
...props
|
|
13408
13776
|
};
|
|
13409
13777
|
const [domHeight, setDomHeight] = useState(-1);
|
|
@@ -13472,9 +13840,9 @@ const CollapseItem = (props) => {
|
|
|
13472
13840
|
className: colBem("content-text")
|
|
13473
13841
|
}, children)));
|
|
13474
13842
|
};
|
|
13475
|
-
CollapseItem.defaultProps = defaultProps$
|
|
13843
|
+
CollapseItem.defaultProps = defaultProps$e;
|
|
13476
13844
|
CollapseItem.displayName = "NutCollapseItem";
|
|
13477
|
-
const defaultProps$
|
|
13845
|
+
const defaultProps$d = {
|
|
13478
13846
|
maxLen: 0,
|
|
13479
13847
|
endNumber: "",
|
|
13480
13848
|
delaySpeed: 300,
|
|
@@ -13492,7 +13860,7 @@ const CountUp = (props) => {
|
|
|
13492
13860
|
thousands,
|
|
13493
13861
|
...reset
|
|
13494
13862
|
} = {
|
|
13495
|
-
...defaultProps$
|
|
13863
|
+
...defaultProps$d,
|
|
13496
13864
|
...props
|
|
13497
13865
|
};
|
|
13498
13866
|
const b2 = cn("countup");
|
|
@@ -13509,18 +13877,16 @@ const CountUp = (props) => {
|
|
|
13509
13877
|
const setNumberTransform = () => {
|
|
13510
13878
|
if (countupRef.current) {
|
|
13511
13879
|
const numberItems = countupRef.current.querySelectorAll(".nut-countup__number");
|
|
13512
|
-
const numberFilterArr = numerArr.filter((item) => !isNaN(item));
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
if ((idx || idx == 0) && elem) {
|
|
13519
|
-
const transform = `translate(0, -${(idx == 0 ? 10 : idx) * 5}%)`;
|
|
13880
|
+
const numberFilterArr = numerArr.filter((item) => !Number.isNaN(Number(item)));
|
|
13881
|
+
Object.keys(numberItems).forEach((key) => {
|
|
13882
|
+
const elem = numberItems[Number(key)];
|
|
13883
|
+
const idx = Number(numberFilterArr[Number(key)]);
|
|
13884
|
+
if ((idx || idx === 0) && elem) {
|
|
13885
|
+
const transform = `translate(0, -${(idx === 0 ? 10 : idx) * 5}%)`;
|
|
13520
13886
|
elem.style.transform = transform;
|
|
13521
13887
|
elem.style.webkitTransform = transform;
|
|
13522
13888
|
}
|
|
13523
|
-
}
|
|
13889
|
+
});
|
|
13524
13890
|
}
|
|
13525
13891
|
};
|
|
13526
13892
|
const numberEaseStyle = {
|
|
@@ -13544,9 +13910,11 @@ const CountUp = (props) => {
|
|
|
13544
13910
|
className: b2("list")
|
|
13545
13911
|
}, numerArr.map((item, idx) => {
|
|
13546
13912
|
return /* @__PURE__ */ React__default.createElement("li", {
|
|
13547
|
-
className: `${b2("listitem", {
|
|
13913
|
+
className: `${b2("listitem", {
|
|
13914
|
+
number: !Number.isNaN(Number(item))
|
|
13915
|
+
})}`,
|
|
13548
13916
|
key: idx
|
|
13549
|
-
}, !isNaN(item) ? /* @__PURE__ */ React__default.createElement("span", {
|
|
13917
|
+
}, !Number.isNaN(Number(item)) ? /* @__PURE__ */ React__default.createElement("span", {
|
|
13550
13918
|
className: b2("number"),
|
|
13551
13919
|
style: numberEaseStyle
|
|
13552
13920
|
}, [...numbers, ...numbers].map((number, subidx) => {
|
|
@@ -13558,9 +13926,9 @@ const CountUp = (props) => {
|
|
|
13558
13926
|
}, item));
|
|
13559
13927
|
})));
|
|
13560
13928
|
};
|
|
13561
|
-
CountUp.defaultProps = defaultProps$
|
|
13929
|
+
CountUp.defaultProps = defaultProps$d;
|
|
13562
13930
|
CountUp.displayName = "NutCountUp";
|
|
13563
|
-
const defaultProps$
|
|
13931
|
+
const defaultProps$c = {};
|
|
13564
13932
|
class AnimatingNumbers extends Component {
|
|
13565
13933
|
constructor(props) {
|
|
13566
13934
|
super(props);
|
|
@@ -13572,7 +13940,7 @@ class AnimatingNumbers extends Component {
|
|
|
13572
13940
|
});
|
|
13573
13941
|
}
|
|
13574
13942
|
}
|
|
13575
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
13943
|
+
AnimatingNumbers.defaultProps = defaultProps$c;
|
|
13576
13944
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
13577
13945
|
AnimatingNumbers.CountUp = CountUp;
|
|
13578
13946
|
AnimatingNumbers.CountUp = CountUp;
|
|
@@ -13581,7 +13949,7 @@ const defaultStatus = {
|
|
|
13581
13949
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
13582
13950
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
13583
13951
|
};
|
|
13584
|
-
const defaultProps$
|
|
13952
|
+
const defaultProps$b = {
|
|
13585
13953
|
description: "\u65E0\u5185\u5BB9",
|
|
13586
13954
|
image: "empty",
|
|
13587
13955
|
imageSize: "",
|
|
@@ -13589,9 +13957,9 @@ const defaultProps$a = {
|
|
|
13589
13957
|
};
|
|
13590
13958
|
const Empty = (props) => {
|
|
13591
13959
|
const { locale } = useConfig();
|
|
13592
|
-
defaultProps$
|
|
13960
|
+
defaultProps$b.description = locale.noData || defaultProps$b.description;
|
|
13593
13961
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
13594
|
-
...defaultProps$
|
|
13962
|
+
...defaultProps$b,
|
|
13595
13963
|
...props
|
|
13596
13964
|
};
|
|
13597
13965
|
const [imgStyle, setImgStyle] = useState({});
|
|
@@ -13633,7 +14001,7 @@ const Empty = (props) => {
|
|
|
13633
14001
|
className: b2("description")
|
|
13634
14002
|
}, description) : { description }, children);
|
|
13635
14003
|
};
|
|
13636
|
-
Empty.defaultProps = defaultProps$
|
|
14004
|
+
Empty.defaultProps = defaultProps$b;
|
|
13637
14005
|
Empty.displayName = "NutEmpty";
|
|
13638
14006
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
13639
14007
|
let index2 = 0;
|
|
@@ -13746,7 +14114,7 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
13746
14114
|
}
|
|
13747
14115
|
});
|
|
13748
14116
|
};
|
|
13749
|
-
const defaultProps$
|
|
14117
|
+
const defaultProps$a = {};
|
|
13750
14118
|
const VirtualList = (props) => {
|
|
13751
14119
|
const {
|
|
13752
14120
|
sourceData = [],
|
|
@@ -13905,8 +14273,89 @@ const VirtualList = (props) => {
|
|
|
13905
14273
|
}) : data);
|
|
13906
14274
|
}))));
|
|
13907
14275
|
};
|
|
13908
|
-
VirtualList.defaultProps = defaultProps$
|
|
14276
|
+
VirtualList.defaultProps = defaultProps$a;
|
|
13909
14277
|
VirtualList.displayName = "NutVirtualList";
|
|
14278
|
+
const defaultProps$9 = {
|
|
14279
|
+
source: {
|
|
14280
|
+
type: {},
|
|
14281
|
+
src: ""
|
|
14282
|
+
},
|
|
14283
|
+
options: {
|
|
14284
|
+
controls: true,
|
|
14285
|
+
muted: false,
|
|
14286
|
+
autoplay: false,
|
|
14287
|
+
poster: "",
|
|
14288
|
+
playsinline: false,
|
|
14289
|
+
loop: false
|
|
14290
|
+
}
|
|
14291
|
+
};
|
|
14292
|
+
const Video = (props) => {
|
|
14293
|
+
const {
|
|
14294
|
+
children,
|
|
14295
|
+
source,
|
|
14296
|
+
options: options2,
|
|
14297
|
+
className,
|
|
14298
|
+
play,
|
|
14299
|
+
pause,
|
|
14300
|
+
playend,
|
|
14301
|
+
...restProps
|
|
14302
|
+
} = {
|
|
14303
|
+
...defaultProps$9,
|
|
14304
|
+
...props
|
|
14305
|
+
};
|
|
14306
|
+
const rootRef = useRef(null);
|
|
14307
|
+
const b2 = cn("video");
|
|
14308
|
+
const classes = classNames(className, b2(""));
|
|
14309
|
+
useEffect(() => {
|
|
14310
|
+
init();
|
|
14311
|
+
}, []);
|
|
14312
|
+
const init = () => {
|
|
14313
|
+
if (rootRef.current) {
|
|
14314
|
+
const videoRef = rootRef.current;
|
|
14315
|
+
if (options2.autoplay) {
|
|
14316
|
+
setTimeout(() => {
|
|
14317
|
+
videoRef.play();
|
|
14318
|
+
}, 200);
|
|
14319
|
+
}
|
|
14320
|
+
if (options2.playsinline) {
|
|
14321
|
+
videoRef.setAttribute("playsinline", String(options2.playsinline));
|
|
14322
|
+
videoRef.setAttribute("webkit-playsinline", String(options2.playsinline));
|
|
14323
|
+
videoRef.setAttribute("x5-video-player-type", "h5-page");
|
|
14324
|
+
videoRef.setAttribute("x5-video-player-fullscreen", "false");
|
|
14325
|
+
}
|
|
14326
|
+
videoRef.addEventListener("play", () => {
|
|
14327
|
+
play && play(videoRef);
|
|
14328
|
+
});
|
|
14329
|
+
videoRef.addEventListener("pause", () => {
|
|
14330
|
+
pause && pause(videoRef);
|
|
14331
|
+
});
|
|
14332
|
+
videoRef.addEventListener("ended", () => {
|
|
14333
|
+
videoRef.currentTime = 0;
|
|
14334
|
+
playend && playend(videoRef);
|
|
14335
|
+
});
|
|
14336
|
+
}
|
|
14337
|
+
};
|
|
14338
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14339
|
+
className: classes,
|
|
14340
|
+
...restProps
|
|
14341
|
+
}, /* @__PURE__ */ React__default.createElement("video", {
|
|
14342
|
+
className: "nut-video-player",
|
|
14343
|
+
muted: options2.muted,
|
|
14344
|
+
autoPlay: options2.autoplay,
|
|
14345
|
+
loop: options2.loop,
|
|
14346
|
+
poster: options2.poster,
|
|
14347
|
+
controls: options2.controls,
|
|
14348
|
+
ref: rootRef,
|
|
14349
|
+
src: source.src
|
|
14350
|
+
}, /* @__PURE__ */ React__default.createElement("source", {
|
|
14351
|
+
src: source.src,
|
|
14352
|
+
type: source.type
|
|
14353
|
+
}), /* @__PURE__ */ React__default.createElement("track", {
|
|
14354
|
+
kind: "captions"
|
|
14355
|
+
})));
|
|
14356
|
+
};
|
|
14357
|
+
Video.defaultProps = defaultProps$9;
|
|
14358
|
+
Video.displayName = "NutVideo";
|
|
13910
14359
|
const defaultProps$8 = {
|
|
13911
14360
|
type: "custom",
|
|
13912
14361
|
existAddress: [],
|
|
@@ -14859,4 +15308,4 @@ const TimeSelect = (props) => {
|
|
|
14859
15308
|
};
|
|
14860
15309
|
TimeSelect.defaultProps = defaultProps;
|
|
14861
15310
|
TimeSelect.displayName = "NutTimeSelect";
|
|
14862
|
-
export { ActionSheet, Address, AnimatingNumbers, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button, Calendar, CalendarItem, Card, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator, Empty, FixedNav, Icon, Indicator, Infiniteloading, Input, InputNumber, Layout, NavBar, NoticeBar, Notify, Overlay, Pagination, Picker, Popover, Popup, Price, Radio, RadioGroup, Range, Rate, Row, ShortPassword, Signature, Skeleton, Step, Steps, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, VirtualList };
|
|
15311
|
+
export { ActionSheet, Address, AnimatingNumbers, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button, Calendar, CalendarItem, Card, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator, Empty, FixedNav, Icon, Indicator, Infiniteloading, Input, InputNumber, Layout, NavBar, NoticeBar, Notify, Overlay, Pagination, Picker, Popover, Popup, Price, Radio, RadioGroup, Range, Rate, Row, ShortPassword, Signature, Skeleton, Step, Steps, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };
|