@nutui/nutui-react 1.2.2 → 1.2.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Address.js +76 -28
- package/dist/esm/Badge.js +4 -4
- package/dist/esm/Col.js +6 -2
- package/dist/esm/Collapse.js +1 -0
- package/dist/esm/CollapseItem.js +15 -14
- package/dist/esm/Empty.js +2 -2
- package/dist/esm/FixedNav.js +3 -3
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popover.js +19 -35
- package/dist/esm/Popup.js +54 -30
- package/dist/esm/Radio.js +24 -4
- package/dist/esm/Row.js +9 -3
- package/dist/esm/SideNavBar/style/index.js +2 -0
- package/dist/esm/SideNavBar.js +65 -0
- package/dist/esm/SideNavBarItem/style/index.js +2 -0
- package/dist/esm/SideNavBarItem.js +32 -0
- package/dist/esm/SubSideNavBar/style/index.js +2 -0
- package/dist/esm/SubSideNavBar.js +94 -0
- package/dist/esm/Swiper.js +36 -11
- package/dist/esm/SwiperItem.js +1 -15
- package/dist/esm/Table/style/index.js +2 -0
- package/dist/esm/Table.js +154 -0
- package/dist/esm/nutui-react.es.js +4 -0
- package/dist/esm/offsetContext-0e3d04b3.js +19 -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 +1254 -683
- package/dist/nutui.react.umd.js +15 -15
- package/dist/packages/address/address.scss +9 -2
- package/dist/packages/sidenavbar/sidenavbar.scss +69 -0
- package/dist/packages/sidenavbaritem/sidenavbaritem.scss +8 -0
- package/dist/packages/subsidenavbar/subsidenavbar.scss +23 -0
- package/dist/packages/swiper/swiper.scss +3 -0
- package/dist/packages/table/table.scss +81 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +4 -0
- package/dist/styles/variables.scss +12 -3
- package/dist/types/address/__test__/address.spec.d.ts +1 -0
- package/dist/types/address/address.d.ts +4 -27
- package/dist/types/address/customRender.d.ts +3 -7
- package/dist/types/address/existRender.d.ts +1 -1
- package/dist/types/address/type.d.ts +40 -0
- package/dist/types/badge/badge.d.ts +2 -1
- package/dist/types/card/card.d.ts +4 -4
- package/dist/types/cellgroup/cellgroup.d.ts +1 -0
- package/dist/types/col/col.d.ts +4 -1
- package/dist/types/collapse/collapse.d.ts +2 -1
- package/dist/types/fixednav/__tests__/fixednav.spec.d.ts +1 -0
- package/dist/types/fixednav/fixednav.d.ts +5 -5
- package/dist/types/input/input.d.ts +3 -3
- package/dist/types/layout/__tests__/layout.spec.d.ts +1 -0
- package/dist/types/navbar/navbar.d.ts +1 -0
- package/dist/types/nutui.react.d.ts +5 -1
- package/dist/types/picker/__tests__/picker.spec.d.ts +1 -0
- package/dist/types/popover/Trigger.d.ts +2 -4
- package/dist/types/popover/popover.d.ts +1 -0
- package/dist/types/popup/__tests__/popup.spec.d.ts +1 -0
- package/dist/types/popup/popup.d.ts +2 -0
- package/dist/types/row/row.d.ts +4 -1
- package/dist/types/sidenavbar/__test__/sidenavbar.spec.d.ts +1 -0
- package/dist/types/sidenavbar/demo.d.ts +3 -0
- package/dist/types/sidenavbar/index.d.ts +2 -0
- package/dist/types/sidenavbar/offsetContext.d.ts +2 -0
- package/dist/types/sidenavbar/sidenavbar.d.ts +3 -0
- package/dist/types/sidenavbar/type.d.ts +34 -0
- package/dist/types/sidenavbar/utils.d.ts +3 -0
- package/dist/types/sidenavbaritem/__test__/sidenavbaritem.spec.d.ts +1 -0
- package/dist/types/sidenavbaritem/index.d.ts +2 -0
- package/dist/types/sidenavbaritem/sidenavbaritem.d.ts +3 -0
- package/dist/types/skeleton/skeleton.d.ts +1 -0
- package/dist/types/subsidenavbar/__test__/subsidenavbar.spec.d.ts +1 -0
- package/dist/types/subsidenavbar/index.d.ts +2 -0
- package/dist/types/subsidenavbar/subsidenavbar.d.ts +3 -0
- package/dist/types/swiper/__tests__/swiper.spec.d.ts +1 -0
- package/dist/types/swiper/swiper.d.ts +1 -0
- package/dist/types/tabbar/tabbar.d.ts +1 -0
- package/dist/types/table/__test__/table.spec.d.ts +1 -0
- package/dist/types/table/demo.d.ts +3 -0
- package/dist/types/table/index.d.ts +2 -0
- package/dist/types/table/table.d.ts +3 -0
- package/dist/types/table/types.d.ts +19 -0
- package/dist/types/tabpane/tabpane.d.ts +2 -1
- package/dist/types/tabs/tabs.d.ts +1 -0
- package/dist/types/tag/tag.d.ts +2 -1
- package/dist/types/timeselect/__test__/timeselect.spec.d.ts +1 -0
- package/package.json +8 -8
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.2.
|
|
2
|
+
* @nutui/nutui-react v1.2.3-beta.1 Wed Aug 17 2022 09:35:38 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useImperativeHandle, useLayoutEffect
|
|
7
|
+
import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useImperativeHandle, useLayoutEffect, forwardRef, useMemo, memo } from "react";
|
|
8
8
|
import * as ReactDOM from "react-dom";
|
|
9
|
-
import ReactDOM__default, { unstable_batchedUpdates } from "react-dom";
|
|
9
|
+
import ReactDOM__default, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
10
10
|
var classname = { exports: {} };
|
|
11
11
|
var classname_production_min = {};
|
|
12
12
|
function r$1(r2) {
|
|
@@ -45,7 +45,7 @@ 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$1a = {
|
|
49
49
|
name: "",
|
|
50
50
|
size: "",
|
|
51
51
|
classPrefix: "nutui-icon",
|
|
@@ -73,13 +73,13 @@ const Icon = (props) => {
|
|
|
73
73
|
click,
|
|
74
74
|
...rest
|
|
75
75
|
} = {
|
|
76
|
-
...defaultProps$
|
|
76
|
+
...defaultProps$1a,
|
|
77
77
|
...props
|
|
78
78
|
};
|
|
79
79
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
80
80
|
const type = isImage ? "img" : tag;
|
|
81
81
|
const b2 = cn("icon");
|
|
82
|
-
const
|
|
82
|
+
const handleClick2 = (e2) => {
|
|
83
83
|
if (props.click) {
|
|
84
84
|
props.click(e2);
|
|
85
85
|
}
|
|
@@ -89,25 +89,29 @@ const Icon = (props) => {
|
|
|
89
89
|
return { src: name };
|
|
90
90
|
return {};
|
|
91
91
|
};
|
|
92
|
-
return React__default.createElement(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
return React__default.createElement(
|
|
93
|
+
type,
|
|
94
|
+
{
|
|
95
|
+
className: isImage ? `${className || ""} ${b2("img")}` : `${className || ""} ${fontClassName} ${b2(null, [
|
|
96
|
+
classPrefix
|
|
97
|
+
])} nut-icon-${name} `,
|
|
98
|
+
style: {
|
|
99
|
+
color,
|
|
100
|
+
fontSize: pxCheck$2(size),
|
|
101
|
+
width: pxCheck$2(size),
|
|
102
|
+
height: pxCheck$2(size),
|
|
103
|
+
...style
|
|
104
|
+
},
|
|
105
|
+
...rest,
|
|
106
|
+
onClick: handleClick2,
|
|
107
|
+
...hasSrc()
|
|
102
108
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
...hasSrc()
|
|
106
|
-
}, children);
|
|
109
|
+
children
|
|
110
|
+
);
|
|
107
111
|
};
|
|
108
|
-
Icon.defaultProps = defaultProps$
|
|
112
|
+
Icon.defaultProps = defaultProps$1a;
|
|
109
113
|
Icon.displayName = "NutIcon";
|
|
110
|
-
const defaultProps$
|
|
114
|
+
const defaultProps$19 = {
|
|
111
115
|
className: "",
|
|
112
116
|
color: "",
|
|
113
117
|
shape: "round",
|
|
@@ -140,7 +144,7 @@ const Button = (props) => {
|
|
|
140
144
|
style,
|
|
141
145
|
...rest
|
|
142
146
|
} = {
|
|
143
|
-
...defaultProps$
|
|
147
|
+
...defaultProps$19,
|
|
144
148
|
...props
|
|
145
149
|
};
|
|
146
150
|
const getStyle = useCallback(() => {
|
|
@@ -194,7 +198,7 @@ const Button = (props) => {
|
|
|
194
198
|
classes,
|
|
195
199
|
getStyle
|
|
196
200
|
]);
|
|
197
|
-
const
|
|
201
|
+
const handleClick2 = (e2) => {
|
|
198
202
|
if (!loading && !disabled && onClick) {
|
|
199
203
|
onClick(e2);
|
|
200
204
|
}
|
|
@@ -203,7 +207,7 @@ const Button = (props) => {
|
|
|
203
207
|
className: `${btnName} ${className}`,
|
|
204
208
|
style: { ...btnStyle, ...style },
|
|
205
209
|
...rest,
|
|
206
|
-
onClick: (e2) =>
|
|
210
|
+
onClick: (e2) => handleClick2(e2)
|
|
207
211
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
208
212
|
className: "nut-button__warp",
|
|
209
213
|
style: getStyle()
|
|
@@ -213,7 +217,7 @@ const Button = (props) => {
|
|
|
213
217
|
name: icon
|
|
214
218
|
}) : "", children));
|
|
215
219
|
};
|
|
216
|
-
Button.defaultProps = defaultProps$
|
|
220
|
+
Button.defaultProps = defaultProps$19;
|
|
217
221
|
Button.displayName = "NutButton";
|
|
218
222
|
function _setPrototypeOf(o, p2) {
|
|
219
223
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
@@ -241,7 +245,9 @@ var factoryWithThrowingShims = function() {
|
|
|
241
245
|
if (secret === ReactPropTypesSecret) {
|
|
242
246
|
return;
|
|
243
247
|
}
|
|
244
|
-
var err = new Error(
|
|
248
|
+
var err = new Error(
|
|
249
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
250
|
+
);
|
|
245
251
|
err.name = "Invariant Violation";
|
|
246
252
|
throw err;
|
|
247
253
|
}
|
|
@@ -1429,7 +1435,7 @@ var useContext = React__default.useContext;
|
|
|
1429
1435
|
function useHistory() {
|
|
1430
1436
|
return useContext(historyContext);
|
|
1431
1437
|
}
|
|
1432
|
-
const defaultProps$
|
|
1438
|
+
const defaultProps$18 = {
|
|
1433
1439
|
title: null,
|
|
1434
1440
|
subTitle: null,
|
|
1435
1441
|
desc: "",
|
|
@@ -1469,12 +1475,12 @@ const Cell = (props) => {
|
|
|
1469
1475
|
linkSlot,
|
|
1470
1476
|
...rest
|
|
1471
1477
|
} = {
|
|
1472
|
-
...defaultProps$
|
|
1478
|
+
...defaultProps$18,
|
|
1473
1479
|
...props
|
|
1474
1480
|
};
|
|
1475
1481
|
const b2 = cn("cell");
|
|
1476
1482
|
const history = useHistory();
|
|
1477
|
-
const
|
|
1483
|
+
const handleClick2 = (event) => {
|
|
1478
1484
|
click(event);
|
|
1479
1485
|
if (to2 && history) {
|
|
1480
1486
|
history[replace ? "replace" : "push"](to2);
|
|
@@ -1490,8 +1496,11 @@ const Cell = (props) => {
|
|
|
1490
1496
|
flex: 1
|
|
1491
1497
|
};
|
|
1492
1498
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1493
|
-
className: `${b2(
|
|
1494
|
-
|
|
1499
|
+
className: `${b2(
|
|
1500
|
+
{ clickable: !!(isLink || to2), center, large: size === "large" },
|
|
1501
|
+
[className]
|
|
1502
|
+
)} `,
|
|
1503
|
+
onClick: (event) => handleClick2(event),
|
|
1495
1504
|
style: baseStyle,
|
|
1496
1505
|
...rest
|
|
1497
1506
|
}, children || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, icon || iconSlot ? /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -1515,9 +1524,9 @@ const Cell = (props) => {
|
|
|
1515
1524
|
className: b2("link")
|
|
1516
1525
|
}) : linkSlot));
|
|
1517
1526
|
};
|
|
1518
|
-
Cell.defaultProps = defaultProps$
|
|
1527
|
+
Cell.defaultProps = defaultProps$18;
|
|
1519
1528
|
Cell.displayName = "NutCell";
|
|
1520
|
-
const defaultProps$
|
|
1529
|
+
const defaultProps$17 = {
|
|
1521
1530
|
title: "",
|
|
1522
1531
|
desc: "",
|
|
1523
1532
|
titleSlot: null,
|
|
@@ -1526,7 +1535,7 @@ const defaultProps$14 = {
|
|
|
1526
1535
|
};
|
|
1527
1536
|
const CellGroup = (props) => {
|
|
1528
1537
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1529
|
-
...defaultProps$
|
|
1538
|
+
...defaultProps$17,
|
|
1530
1539
|
...props
|
|
1531
1540
|
};
|
|
1532
1541
|
const b2 = cn("cell-group");
|
|
@@ -1540,7 +1549,7 @@ const CellGroup = (props) => {
|
|
|
1540
1549
|
className: b2("wrap")
|
|
1541
1550
|
}, children));
|
|
1542
1551
|
};
|
|
1543
|
-
CellGroup.defaultProps = defaultProps$
|
|
1552
|
+
CellGroup.defaultProps = defaultProps$17;
|
|
1544
1553
|
CellGroup.displayName = "NutCellGroup";
|
|
1545
1554
|
var classnames = { exports: {} };
|
|
1546
1555
|
/*!
|
|
@@ -1628,12 +1637,16 @@ const Overlay = (props) => {
|
|
|
1628
1637
|
};
|
|
1629
1638
|
}, []);
|
|
1630
1639
|
const b2 = cn("overlay");
|
|
1631
|
-
const classes = classNames(
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1640
|
+
const classes = classNames(
|
|
1641
|
+
{
|
|
1642
|
+
"overlay-fade-leave-active": !renderRef.current && !visible,
|
|
1643
|
+
"overlay-fade-enter-active": visible,
|
|
1644
|
+
"first-render": renderRef.current && !visible,
|
|
1645
|
+
"hidden-render": !visible
|
|
1646
|
+
},
|
|
1647
|
+
overlayClass,
|
|
1648
|
+
b2("")
|
|
1649
|
+
);
|
|
1637
1650
|
const styles = {
|
|
1638
1651
|
zIndex,
|
|
1639
1652
|
animationDuration: `${props.duration}s`,
|
|
@@ -1646,7 +1659,7 @@ const Overlay = (props) => {
|
|
|
1646
1659
|
document.body.classList.remove("nut-overflow-hidden");
|
|
1647
1660
|
}
|
|
1648
1661
|
};
|
|
1649
|
-
const
|
|
1662
|
+
const handleClick2 = (e2) => {
|
|
1650
1663
|
if (closeOnClickOverlay) {
|
|
1651
1664
|
props.onClick && props.onClick(e2);
|
|
1652
1665
|
renderRef.current = false;
|
|
@@ -1660,7 +1673,7 @@ const Overlay = (props) => {
|
|
|
1660
1673
|
className: classes,
|
|
1661
1674
|
style: styles,
|
|
1662
1675
|
...rest,
|
|
1663
|
-
onClick:
|
|
1676
|
+
onClick: handleClick2
|
|
1664
1677
|
}, children));
|
|
1665
1678
|
};
|
|
1666
1679
|
Overlay.defaultProps = defaultOverlayProps;
|
|
@@ -1695,6 +1708,9 @@ var config$1 = {
|
|
|
1695
1708
|
disabled: false
|
|
1696
1709
|
};
|
|
1697
1710
|
var TransitionGroupContext = React__default.createContext(null);
|
|
1711
|
+
var forceReflow = function forceReflow2(node) {
|
|
1712
|
+
return node.scrollTop;
|
|
1713
|
+
};
|
|
1698
1714
|
var UNMOUNTED = "unmounted";
|
|
1699
1715
|
var EXITED = "exited";
|
|
1700
1716
|
var ENTERING = "entering";
|
|
@@ -1783,6 +1799,11 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1783
1799
|
if (nextStatus !== null) {
|
|
1784
1800
|
this.cancelNextCallback();
|
|
1785
1801
|
if (nextStatus === ENTERING) {
|
|
1802
|
+
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
1803
|
+
var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
|
|
1804
|
+
if (node)
|
|
1805
|
+
forceReflow(node);
|
|
1806
|
+
}
|
|
1786
1807
|
this.performEnter(mounting);
|
|
1787
1808
|
} else {
|
|
1788
1809
|
this.performExit();
|
|
@@ -2040,7 +2061,8 @@ var CSSTransition = /* @__PURE__ */ function(_React$Component) {
|
|
|
2040
2061
|
className += " " + doneClassName;
|
|
2041
2062
|
}
|
|
2042
2063
|
if (phase === "active") {
|
|
2043
|
-
|
|
2064
|
+
if (node)
|
|
2065
|
+
forceReflow(node);
|
|
2044
2066
|
}
|
|
2045
2067
|
if (className) {
|
|
2046
2068
|
this.appliedClasses[type][phase] = className;
|
|
@@ -2080,7 +2102,7 @@ CSSTransition.defaultProps = {
|
|
|
2080
2102
|
};
|
|
2081
2103
|
CSSTransition.propTypes = {};
|
|
2082
2104
|
var CSSTransition$1 = CSSTransition;
|
|
2083
|
-
const defaultProps$
|
|
2105
|
+
const defaultProps$16 = {
|
|
2084
2106
|
position: "center",
|
|
2085
2107
|
transition: "",
|
|
2086
2108
|
style: {},
|
|
@@ -2089,6 +2111,7 @@ const defaultProps$13 = {
|
|
|
2089
2111
|
closeIconPosition: "top-right",
|
|
2090
2112
|
closeIcon: "close",
|
|
2091
2113
|
destroyOnClose: true,
|
|
2114
|
+
teleport: null,
|
|
2092
2115
|
overlay: true,
|
|
2093
2116
|
round: false,
|
|
2094
2117
|
onOpen: () => {
|
|
@@ -2112,8 +2135,10 @@ const Popup = (props) => {
|
|
|
2112
2135
|
const {
|
|
2113
2136
|
children,
|
|
2114
2137
|
visible,
|
|
2138
|
+
overlay,
|
|
2115
2139
|
closeOnClickOverlay,
|
|
2116
2140
|
overlayStyle,
|
|
2141
|
+
overlayClass,
|
|
2117
2142
|
zIndex,
|
|
2118
2143
|
lockScroll,
|
|
2119
2144
|
duration,
|
|
@@ -2127,6 +2152,7 @@ const Popup = (props) => {
|
|
|
2127
2152
|
popClass,
|
|
2128
2153
|
className,
|
|
2129
2154
|
destroyOnClose,
|
|
2155
|
+
teleport,
|
|
2130
2156
|
onOpen,
|
|
2131
2157
|
onClose,
|
|
2132
2158
|
onClickOverlay,
|
|
@@ -2152,12 +2178,15 @@ const Popup = (props) => {
|
|
|
2152
2178
|
...style,
|
|
2153
2179
|
...baseStyle
|
|
2154
2180
|
};
|
|
2155
|
-
const classes = classNames(
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2181
|
+
const classes = classNames(
|
|
2182
|
+
{
|
|
2183
|
+
round,
|
|
2184
|
+
[`popup-${position}`]: true,
|
|
2185
|
+
[`${popClass}`]: true,
|
|
2186
|
+
[`${className}`]: true
|
|
2187
|
+
},
|
|
2188
|
+
b2("")
|
|
2189
|
+
);
|
|
2161
2190
|
const closeClasses = classNames({
|
|
2162
2191
|
"nutui-popup__close-icon": true,
|
|
2163
2192
|
[`nutui-popup__close-icon--${closeIconPosition}`]: true
|
|
@@ -2202,6 +2231,49 @@ const Popup = (props) => {
|
|
|
2202
2231
|
const onHandleClosed = (e2) => {
|
|
2203
2232
|
onClosed && onClosed(e2);
|
|
2204
2233
|
};
|
|
2234
|
+
const resolveContainer = (getContainer) => {
|
|
2235
|
+
const container = typeof getContainer === "function" ? getContainer() : getContainer;
|
|
2236
|
+
return container || document.body;
|
|
2237
|
+
};
|
|
2238
|
+
const renderToContainer = (getContainer, node) => {
|
|
2239
|
+
if (getContainer) {
|
|
2240
|
+
const container = resolveContainer(getContainer);
|
|
2241
|
+
return createPortal(node, container);
|
|
2242
|
+
}
|
|
2243
|
+
return node;
|
|
2244
|
+
};
|
|
2245
|
+
const renderPop = () => {
|
|
2246
|
+
return /* @__PURE__ */ React__default.createElement(CSSTransition$1, {
|
|
2247
|
+
classNames: transitionName,
|
|
2248
|
+
unmountOnExit: true,
|
|
2249
|
+
timeout: 500,
|
|
2250
|
+
in: innerVisible,
|
|
2251
|
+
onEntered: onHandleOpened,
|
|
2252
|
+
onExited: onHandleClosed
|
|
2253
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2254
|
+
style: popStyles,
|
|
2255
|
+
className: classes,
|
|
2256
|
+
onClick: onHandleClick
|
|
2257
|
+
}, showChildren ? children : "", closeable ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2258
|
+
className: closeClasses,
|
|
2259
|
+
onClick: onHandleClickCloseIcon
|
|
2260
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
2261
|
+
name: closeIcon,
|
|
2262
|
+
size: "12px"
|
|
2263
|
+
})) : ""));
|
|
2264
|
+
};
|
|
2265
|
+
const renderNode = () => {
|
|
2266
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, overlay ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Overlay, {
|
|
2267
|
+
style: overlayStyles,
|
|
2268
|
+
overlayClass,
|
|
2269
|
+
visible: innerVisible,
|
|
2270
|
+
closeOnClickOverlay,
|
|
2271
|
+
zIndex,
|
|
2272
|
+
lockScroll,
|
|
2273
|
+
duration,
|
|
2274
|
+
onClick: onHandleClickOverlay
|
|
2275
|
+
}), renderPop()) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderPop()));
|
|
2276
|
+
};
|
|
2205
2277
|
useEffect(() => {
|
|
2206
2278
|
visible && open();
|
|
2207
2279
|
!visible && close();
|
|
@@ -2209,34 +2281,9 @@ const Popup = (props) => {
|
|
|
2209
2281
|
useEffect(() => {
|
|
2210
2282
|
setTransitionName(transition || `popup-slide-${position}`);
|
|
2211
2283
|
}, [position]);
|
|
2212
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null,
|
|
2213
|
-
style: overlayStyles,
|
|
2214
|
-
visible: innerVisible,
|
|
2215
|
-
closeOnClickOverlay,
|
|
2216
|
-
zIndex,
|
|
2217
|
-
lockScroll,
|
|
2218
|
-
duration,
|
|
2219
|
-
onClick: onHandleClickOverlay
|
|
2220
|
-
}), /* @__PURE__ */ React__default.createElement(CSSTransition$1, {
|
|
2221
|
-
classNames: transitionName,
|
|
2222
|
-
unmountOnExit: true,
|
|
2223
|
-
timeout: 500,
|
|
2224
|
-
in: innerVisible,
|
|
2225
|
-
onEntered: onHandleOpened,
|
|
2226
|
-
onExited: onHandleClosed
|
|
2227
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2228
|
-
style: popStyles,
|
|
2229
|
-
className: classes,
|
|
2230
|
-
onClick: onHandleClick
|
|
2231
|
-
}, showChildren ? children : "", closeable ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2232
|
-
className: closeClasses,
|
|
2233
|
-
onClick: onHandleClickCloseIcon
|
|
2234
|
-
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
2235
|
-
name: closeIcon,
|
|
2236
|
-
size: "12px"
|
|
2237
|
-
})) : "")));
|
|
2284
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderToContainer(teleport, renderNode()));
|
|
2238
2285
|
};
|
|
2239
|
-
Popup.defaultProps = defaultProps$
|
|
2286
|
+
Popup.defaultProps = defaultProps$16;
|
|
2240
2287
|
Popup.displayName = "NutPopup";
|
|
2241
2288
|
const zhCN = {
|
|
2242
2289
|
save: "\u4FDD\u5B58",
|
|
@@ -2341,7 +2388,7 @@ const zhCN = {
|
|
|
2341
2388
|
title6: "\u6570\u636E\u6539\u53D8\u76D1\u542C"
|
|
2342
2389
|
}
|
|
2343
2390
|
};
|
|
2344
|
-
const defaultProps$
|
|
2391
|
+
const defaultProps$15 = {
|
|
2345
2392
|
locale: zhCN
|
|
2346
2393
|
};
|
|
2347
2394
|
const defaultConfigRef = {
|
|
@@ -2358,7 +2405,7 @@ const useConfig = () => {
|
|
|
2358
2405
|
};
|
|
2359
2406
|
const ConfigContext = createContext(null);
|
|
2360
2407
|
const ConfigProvider = (props) => {
|
|
2361
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
2408
|
+
const { children, ...config2 } = { ...defaultProps$15, ...props };
|
|
2362
2409
|
const parentConfig = useConfig();
|
|
2363
2410
|
return /* @__PURE__ */ React__default.createElement(ConfigContext.Provider, {
|
|
2364
2411
|
value: {
|
|
@@ -2367,25 +2414,25 @@ const ConfigProvider = (props) => {
|
|
|
2367
2414
|
}
|
|
2368
2415
|
}, children);
|
|
2369
2416
|
};
|
|
2370
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
2417
|
+
ConfigProvider.defaultProps = defaultProps$15;
|
|
2371
2418
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2372
|
-
const defaultProps$
|
|
2419
|
+
const defaultProps$14 = {};
|
|
2373
2420
|
const Layout = (props) => {
|
|
2374
|
-
({ ...defaultProps$
|
|
2421
|
+
({ ...defaultProps$14, ...props });
|
|
2375
2422
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2376
2423
|
className: "nut-layout"
|
|
2377
2424
|
}, "Layout");
|
|
2378
2425
|
};
|
|
2379
|
-
Layout.defaultProps = defaultProps$
|
|
2426
|
+
Layout.defaultProps = defaultProps$14;
|
|
2380
2427
|
Layout.displayName = "NutLayout";
|
|
2381
2428
|
const DataContext$2 = createContext({});
|
|
2382
|
-
const defaultProps$
|
|
2429
|
+
const defaultProps$13 = {
|
|
2383
2430
|
span: "24",
|
|
2384
2431
|
offset: "0",
|
|
2385
2432
|
gutter: "0"
|
|
2386
2433
|
};
|
|
2387
2434
|
const Col = (props) => {
|
|
2388
|
-
const { span, offset, children } = { ...defaultProps$
|
|
2435
|
+
const { span, offset, children, onClick } = { ...defaultProps$13, ...props };
|
|
2389
2436
|
const [colName, setColName] = useState("");
|
|
2390
2437
|
const [colStyle, setColStyle] = useState({});
|
|
2391
2438
|
const { gutter } = useContext$1(DataContext$2);
|
|
@@ -2405,12 +2452,15 @@ const Col = (props) => {
|
|
|
2405
2452
|
}, [span, offset, gutter]);
|
|
2406
2453
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2407
2454
|
className: `${colName}`,
|
|
2408
|
-
style: { ...colStyle }
|
|
2455
|
+
style: { ...colStyle },
|
|
2456
|
+
onClick: (e2) => {
|
|
2457
|
+
onClick && onClick(e2, "col");
|
|
2458
|
+
}
|
|
2409
2459
|
}, children);
|
|
2410
2460
|
};
|
|
2411
|
-
Col.defaultProps = defaultProps$
|
|
2461
|
+
Col.defaultProps = defaultProps$13;
|
|
2412
2462
|
Col.displayName = "NutCol";
|
|
2413
|
-
const defaultProps
|
|
2463
|
+
const defaultProps$12 = {
|
|
2414
2464
|
type: "",
|
|
2415
2465
|
justify: "start",
|
|
2416
2466
|
align: "flex-start",
|
|
@@ -2418,13 +2468,15 @@ const defaultProps$$ = {
|
|
|
2418
2468
|
gutter: "0"
|
|
2419
2469
|
};
|
|
2420
2470
|
const Row = (props) => {
|
|
2421
|
-
const { children, type, justify, align, wrap, gutter } = {
|
|
2422
|
-
...defaultProps
|
|
2471
|
+
const { children, type, justify, align, wrap, gutter, onClick } = {
|
|
2472
|
+
...defaultProps$12,
|
|
2423
2473
|
...props
|
|
2424
2474
|
};
|
|
2425
2475
|
const prefixCls = "nut-row";
|
|
2426
2476
|
const getClass = (prefix2, type2) => {
|
|
2427
|
-
|
|
2477
|
+
const classType = type2 ? `nut-row-${prefix2}-${type2}` : "";
|
|
2478
|
+
const className = prefix2 ? classType : `nut-row-${type2}`;
|
|
2479
|
+
return className;
|
|
2428
2480
|
};
|
|
2429
2481
|
const getClasses = () => {
|
|
2430
2482
|
return `
|
|
@@ -2440,13 +2492,20 @@ const Row = (props) => {
|
|
|
2440
2492
|
};
|
|
2441
2493
|
return /* @__PURE__ */ React__default.createElement(DataContext$2.Provider, {
|
|
2442
2494
|
value: parentRow
|
|
2443
|
-
}, React__default.createElement(
|
|
2444
|
-
|
|
2445
|
-
|
|
2495
|
+
}, React__default.createElement(
|
|
2496
|
+
"div",
|
|
2497
|
+
{
|
|
2498
|
+
className: getClasses(),
|
|
2499
|
+
onClick: (e2) => {
|
|
2500
|
+
onClick && onClick(e2, "row");
|
|
2501
|
+
}
|
|
2502
|
+
},
|
|
2503
|
+
children
|
|
2504
|
+
));
|
|
2446
2505
|
};
|
|
2447
|
-
Row.defaultProps = defaultProps
|
|
2506
|
+
Row.defaultProps = defaultProps$12;
|
|
2448
2507
|
Row.displayName = "NutRow";
|
|
2449
|
-
const defaultProps$
|
|
2508
|
+
const defaultProps$11 = {
|
|
2450
2509
|
contentPosition: "center",
|
|
2451
2510
|
dashed: false,
|
|
2452
2511
|
hairline: true,
|
|
@@ -2463,7 +2522,7 @@ const Divider = (props) => {
|
|
|
2463
2522
|
direction,
|
|
2464
2523
|
...rest
|
|
2465
2524
|
} = {
|
|
2466
|
-
...defaultProps$
|
|
2525
|
+
...defaultProps$11,
|
|
2467
2526
|
...props
|
|
2468
2527
|
};
|
|
2469
2528
|
const dividerBem = cn("divider");
|
|
@@ -2484,9 +2543,9 @@ const Divider = (props) => {
|
|
|
2484
2543
|
...rest
|
|
2485
2544
|
}, children);
|
|
2486
2545
|
};
|
|
2487
|
-
Divider.defaultProps = defaultProps$
|
|
2546
|
+
Divider.defaultProps = defaultProps$11;
|
|
2488
2547
|
Divider.displayName = "NutDivider";
|
|
2489
|
-
const defaultProps$
|
|
2548
|
+
const defaultProps$10 = {
|
|
2490
2549
|
title: "",
|
|
2491
2550
|
desc: "",
|
|
2492
2551
|
leftShow: true,
|
|
@@ -2519,7 +2578,7 @@ const NavBar = (props) => {
|
|
|
2519
2578
|
onClickBack,
|
|
2520
2579
|
onClickRight
|
|
2521
2580
|
} = {
|
|
2522
|
-
...defaultProps$
|
|
2581
|
+
...defaultProps$10,
|
|
2523
2582
|
...props
|
|
2524
2583
|
};
|
|
2525
2584
|
const b2 = cn("navbar");
|
|
@@ -2584,12 +2643,12 @@ const NavBar = (props) => {
|
|
|
2584
2643
|
className: `${b2("")}--placeholder`
|
|
2585
2644
|
}, renderWrapper()) : renderWrapper());
|
|
2586
2645
|
};
|
|
2587
|
-
NavBar.defaultProps = defaultProps$
|
|
2646
|
+
NavBar.defaultProps = defaultProps$10;
|
|
2588
2647
|
NavBar.displayName = "NutNavBar";
|
|
2589
|
-
const defaultProps
|
|
2648
|
+
const defaultProps$$ = {
|
|
2590
2649
|
fixednavClass: "nut-fixednav",
|
|
2591
|
-
activeText: "
|
|
2592
|
-
unActiveText: "
|
|
2650
|
+
activeText: "",
|
|
2651
|
+
unActiveText: "",
|
|
2593
2652
|
type: "right",
|
|
2594
2653
|
position: {
|
|
2595
2654
|
top: "auto",
|
|
@@ -2612,11 +2671,16 @@ const FixedNav = (props) => {
|
|
|
2612
2671
|
slotList,
|
|
2613
2672
|
slotBtn,
|
|
2614
2673
|
...rest
|
|
2615
|
-
} = { ...defaultProps
|
|
2674
|
+
} = { ...defaultProps$$, ...props };
|
|
2616
2675
|
const b2 = cn("fixednav");
|
|
2617
|
-
const classes = classNames(
|
|
2618
|
-
|
|
2619
|
-
|
|
2676
|
+
const classes = classNames(
|
|
2677
|
+
{
|
|
2678
|
+
active: visible
|
|
2679
|
+
},
|
|
2680
|
+
type,
|
|
2681
|
+
fixednavClass,
|
|
2682
|
+
b2("")
|
|
2683
|
+
);
|
|
2620
2684
|
const onSelectCb = (event, item) => {
|
|
2621
2685
|
onSelected(item, event);
|
|
2622
2686
|
};
|
|
@@ -2656,11 +2720,11 @@ const FixedNav = (props) => {
|
|
|
2656
2720
|
color: "#fff"
|
|
2657
2721
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
2658
2722
|
className: "text"
|
|
2659
|
-
}, visible ? locale.fixednav.activeText
|
|
2723
|
+
}, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
|
|
2660
2724
|
};
|
|
2661
|
-
FixedNav.defaultProps = defaultProps
|
|
2725
|
+
FixedNav.defaultProps = defaultProps$$;
|
|
2662
2726
|
FixedNav.displayName = "NutFixedNav";
|
|
2663
|
-
const defaultProps$
|
|
2727
|
+
const defaultProps$_ = {
|
|
2664
2728
|
visible: 0,
|
|
2665
2729
|
bottom: false,
|
|
2666
2730
|
size: 20,
|
|
@@ -2685,12 +2749,12 @@ const Tabbar = (props) => {
|
|
|
2685
2749
|
style,
|
|
2686
2750
|
tabSwitch
|
|
2687
2751
|
} = {
|
|
2688
|
-
...defaultProps$
|
|
2752
|
+
...defaultProps$_,
|
|
2689
2753
|
...props
|
|
2690
2754
|
};
|
|
2691
2755
|
const b2 = cn("tabbar");
|
|
2692
2756
|
const [selectIndex, setSelectIndex] = useState(visible);
|
|
2693
|
-
const
|
|
2757
|
+
const handleClick2 = (idx) => {
|
|
2694
2758
|
setSelectIndex(idx);
|
|
2695
2759
|
};
|
|
2696
2760
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -2713,16 +2777,16 @@ const Tabbar = (props) => {
|
|
|
2713
2777
|
activeColor,
|
|
2714
2778
|
size,
|
|
2715
2779
|
handleClick: () => {
|
|
2716
|
-
|
|
2780
|
+
handleClick2(idx);
|
|
2717
2781
|
tabSwitch(child, idx);
|
|
2718
2782
|
}
|
|
2719
2783
|
};
|
|
2720
2784
|
return React__default.cloneElement(child, childProps);
|
|
2721
2785
|
}));
|
|
2722
2786
|
};
|
|
2723
|
-
Tabbar.defaultProps = defaultProps$
|
|
2787
|
+
Tabbar.defaultProps = defaultProps$_;
|
|
2724
2788
|
Tabbar.displayName = "NutTabbar";
|
|
2725
|
-
const defaultProps$
|
|
2789
|
+
const defaultProps$Z = {
|
|
2726
2790
|
dot: false,
|
|
2727
2791
|
size: "",
|
|
2728
2792
|
classPrefix: "nutui-iconfont",
|
|
@@ -2752,9 +2816,9 @@ const TabbarItem = (props) => {
|
|
|
2752
2816
|
activeColor,
|
|
2753
2817
|
unactiveColor,
|
|
2754
2818
|
index: index2,
|
|
2755
|
-
handleClick
|
|
2819
|
+
handleClick: handleClick2
|
|
2756
2820
|
} = {
|
|
2757
|
-
...defaultProps$
|
|
2821
|
+
...defaultProps$Z,
|
|
2758
2822
|
...props
|
|
2759
2823
|
};
|
|
2760
2824
|
const b2 = cn("tabbar-item");
|
|
@@ -2775,7 +2839,7 @@ const TabbarItem = (props) => {
|
|
|
2775
2839
|
color: active ? activeColor : unactiveColor
|
|
2776
2840
|
},
|
|
2777
2841
|
onClick: () => {
|
|
2778
|
-
|
|
2842
|
+
handleClick2(index2);
|
|
2779
2843
|
}
|
|
2780
2844
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2781
2845
|
className: `${bIcon()}`
|
|
@@ -2796,7 +2860,7 @@ const TabbarItem = (props) => {
|
|
|
2796
2860
|
}, tabTitle)));
|
|
2797
2861
|
};
|
|
2798
2862
|
const elevatorContext = createContext({});
|
|
2799
|
-
const defaultProps$
|
|
2863
|
+
const defaultProps$Y = {
|
|
2800
2864
|
height: "200px",
|
|
2801
2865
|
acceptKey: "title",
|
|
2802
2866
|
indexList: [],
|
|
@@ -2819,7 +2883,7 @@ const Elevator = (props) => {
|
|
|
2819
2883
|
children,
|
|
2820
2884
|
...rest
|
|
2821
2885
|
} = {
|
|
2822
|
-
...defaultProps$
|
|
2886
|
+
...defaultProps$Y,
|
|
2823
2887
|
...props
|
|
2824
2888
|
};
|
|
2825
2889
|
const b2 = cn("elevator");
|
|
@@ -2837,7 +2901,9 @@ const Elevator = (props) => {
|
|
|
2837
2901
|
y2: 0
|
|
2838
2902
|
});
|
|
2839
2903
|
const [scrollY, setScrollY] = useState(0);
|
|
2840
|
-
const [currentData, setCurrentData] = useState(
|
|
2904
|
+
const [currentData, setCurrentData] = useState(
|
|
2905
|
+
{}
|
|
2906
|
+
);
|
|
2841
2907
|
const [currentKey, setCurrentKey] = useState("");
|
|
2842
2908
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
2843
2909
|
const [codeIndex, setCodeIndex] = useState(0);
|
|
@@ -3009,9 +3075,9 @@ const Elevator = (props) => {
|
|
|
3009
3075
|
}, item[acceptKey]);
|
|
3010
3076
|
}))));
|
|
3011
3077
|
};
|
|
3012
|
-
Elevator.defaultProps = defaultProps$
|
|
3078
|
+
Elevator.defaultProps = defaultProps$Y;
|
|
3013
3079
|
Elevator.displayName = "NutElevator";
|
|
3014
|
-
const defaultProps$
|
|
3080
|
+
const defaultProps$X = {
|
|
3015
3081
|
defaultValue: 1,
|
|
3016
3082
|
mode: "multi",
|
|
3017
3083
|
prevText: "",
|
|
@@ -3028,7 +3094,7 @@ const defaultProps$U = {
|
|
|
3028
3094
|
};
|
|
3029
3095
|
const Pagination = (props) => {
|
|
3030
3096
|
const { locale } = useConfig();
|
|
3031
|
-
({ ...defaultProps$
|
|
3097
|
+
({ ...defaultProps$X, ...props });
|
|
3032
3098
|
const {
|
|
3033
3099
|
modelValue,
|
|
3034
3100
|
mode,
|
|
@@ -3145,7 +3211,7 @@ const Pagination = (props) => {
|
|
|
3145
3211
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
3146
3212
|
}, nextText || locale.pagination.next));
|
|
3147
3213
|
};
|
|
3148
|
-
Pagination.defaultProps = defaultProps$
|
|
3214
|
+
Pagination.defaultProps = defaultProps$X;
|
|
3149
3215
|
Pagination.displayName = "NutPagination";
|
|
3150
3216
|
class Title {
|
|
3151
3217
|
constructor() {
|
|
@@ -3155,7 +3221,7 @@ class Title {
|
|
|
3155
3221
|
this.index = 0;
|
|
3156
3222
|
}
|
|
3157
3223
|
}
|
|
3158
|
-
const defaultProps$
|
|
3224
|
+
const defaultProps$W = {
|
|
3159
3225
|
value: 0,
|
|
3160
3226
|
color: "",
|
|
3161
3227
|
background: "",
|
|
@@ -3190,7 +3256,7 @@ const Tabs = (props) => {
|
|
|
3190
3256
|
className,
|
|
3191
3257
|
autoHeight,
|
|
3192
3258
|
...rest
|
|
3193
|
-
} = { ...defaultProps$
|
|
3259
|
+
} = { ...defaultProps$W, ...props };
|
|
3194
3260
|
const [currentItem, setCurrentItem] = useState({ index: 0 });
|
|
3195
3261
|
const titles = useRef([]);
|
|
3196
3262
|
useEffect(() => {
|
|
@@ -3217,11 +3283,14 @@ const Tabs = (props) => {
|
|
|
3217
3283
|
}, [children]);
|
|
3218
3284
|
const b2 = cn("tabs");
|
|
3219
3285
|
const classes = classNames(direction, b2(""), className);
|
|
3220
|
-
const classesTitle = classNames(
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3286
|
+
const classesTitle = classNames(
|
|
3287
|
+
{
|
|
3288
|
+
[type]: type,
|
|
3289
|
+
scrollable: titleScroll,
|
|
3290
|
+
[size]: size
|
|
3291
|
+
},
|
|
3292
|
+
`${b2("")}__titles`
|
|
3293
|
+
);
|
|
3225
3294
|
const titleStyle = {
|
|
3226
3295
|
marginLeft: pxCheck$1(titleGutter),
|
|
3227
3296
|
marginRight: pxCheck$1(titleGutter)
|
|
@@ -3253,10 +3322,13 @@ const Tabs = (props) => {
|
|
|
3253
3322
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3254
3323
|
style: titleStyle,
|
|
3255
3324
|
onClick: (e2) => tabChange(item),
|
|
3256
|
-
className: classNames(
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3325
|
+
className: classNames(
|
|
3326
|
+
{
|
|
3327
|
+
active: String(item.paneKey) === String(value),
|
|
3328
|
+
disabled: item.disabled
|
|
3329
|
+
},
|
|
3330
|
+
`${b2("")}__titles-item`
|
|
3331
|
+
),
|
|
3260
3332
|
key: item.paneKey
|
|
3261
3333
|
}, type === "line" && /* @__PURE__ */ React__default.createElement("div", {
|
|
3262
3334
|
className: `${b2("")}__titles-item__line`,
|
|
@@ -3268,9 +3340,12 @@ const Tabs = (props) => {
|
|
|
3268
3340
|
color,
|
|
3269
3341
|
name: "joy-smile"
|
|
3270
3342
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3271
|
-
className: classNames(
|
|
3272
|
-
|
|
3273
|
-
|
|
3343
|
+
className: classNames(
|
|
3344
|
+
{
|
|
3345
|
+
ellipsis: ellipsis && !titleScroll && direction === "horizontal"
|
|
3346
|
+
},
|
|
3347
|
+
`${b2("")}__titles-item__text`
|
|
3348
|
+
)
|
|
3274
3349
|
}, item.title));
|
|
3275
3350
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3276
3351
|
className: `${b2("")}__content`,
|
|
@@ -3293,9 +3368,9 @@ const Tabs = (props) => {
|
|
|
3293
3368
|
return React__default.cloneElement(child, childProps);
|
|
3294
3369
|
})));
|
|
3295
3370
|
};
|
|
3296
|
-
Tabs.defaultProps = defaultProps$
|
|
3371
|
+
Tabs.defaultProps = defaultProps$W;
|
|
3297
3372
|
Tabs.displayName = "NutTabs";
|
|
3298
|
-
const defaultProps$
|
|
3373
|
+
const defaultProps$V = {
|
|
3299
3374
|
title: "",
|
|
3300
3375
|
paneKey: "",
|
|
3301
3376
|
activeKey: "",
|
|
@@ -3303,18 +3378,22 @@ const defaultProps$S = {
|
|
|
3303
3378
|
};
|
|
3304
3379
|
const TabPane = (props) => {
|
|
3305
3380
|
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
3306
|
-
...defaultProps$
|
|
3381
|
+
...defaultProps$V,
|
|
3307
3382
|
...props
|
|
3308
3383
|
};
|
|
3309
3384
|
const b2 = cn("tabpane");
|
|
3310
|
-
const classes = classNames(
|
|
3311
|
-
|
|
3312
|
-
|
|
3385
|
+
const classes = classNames(
|
|
3386
|
+
{
|
|
3387
|
+
active: paneKey === activeKey
|
|
3388
|
+
},
|
|
3389
|
+
b2(""),
|
|
3390
|
+
autoHeightClassName
|
|
3391
|
+
);
|
|
3313
3392
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3314
3393
|
className: classes
|
|
3315
3394
|
}, children);
|
|
3316
3395
|
};
|
|
3317
|
-
const defaultProps$
|
|
3396
|
+
const defaultProps$U = {
|
|
3318
3397
|
size: 3,
|
|
3319
3398
|
current: 1,
|
|
3320
3399
|
block: false,
|
|
@@ -3334,25 +3413,30 @@ const Indicator = (props) => {
|
|
|
3334
3413
|
vertical,
|
|
3335
3414
|
...rest
|
|
3336
3415
|
} = {
|
|
3337
|
-
...defaultProps$
|
|
3416
|
+
...defaultProps$U,
|
|
3338
3417
|
...props
|
|
3339
3418
|
};
|
|
3340
3419
|
const b2 = cn("indicator");
|
|
3341
|
-
const classes = classNames(
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3420
|
+
const classes = classNames(
|
|
3421
|
+
{
|
|
3422
|
+
[`${b2("block")}`]: block,
|
|
3423
|
+
[`${b2("align")}__${align}`]: block && align,
|
|
3424
|
+
[`${b2("vertical")}`]: vertical
|
|
3425
|
+
},
|
|
3426
|
+
b2("")
|
|
3427
|
+
);
|
|
3346
3428
|
const renderEles = () => {
|
|
3347
3429
|
const childs = [];
|
|
3348
3430
|
for (let item = 1; item <= size; item++) {
|
|
3349
|
-
childs.push(
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3431
|
+
childs.push(
|
|
3432
|
+
item === current ? /* @__PURE__ */ React__default.createElement("div", {
|
|
3433
|
+
key: item,
|
|
3434
|
+
className: b2("number")
|
|
3435
|
+
}, fillZero && item < 10 ? `0${item}` : item) : /* @__PURE__ */ React__default.createElement("div", {
|
|
3436
|
+
key: item,
|
|
3437
|
+
className: b2("dot")
|
|
3438
|
+
})
|
|
3439
|
+
);
|
|
3356
3440
|
}
|
|
3357
3441
|
return childs;
|
|
3358
3442
|
};
|
|
@@ -3363,8 +3447,146 @@ const Indicator = (props) => {
|
|
|
3363
3447
|
...rest
|
|
3364
3448
|
}, renderEles());
|
|
3365
3449
|
};
|
|
3366
|
-
Indicator.defaultProps = defaultProps$
|
|
3450
|
+
Indicator.defaultProps = defaultProps$U;
|
|
3367
3451
|
Indicator.displayName = "NutIndicator";
|
|
3452
|
+
const handleClick = (e2) => {
|
|
3453
|
+
e2.stopPropagation();
|
|
3454
|
+
const isIcon = e2.target.className.includes("arrow-icon");
|
|
3455
|
+
const isTitle = e2.target.className.includes("__title") || isIcon;
|
|
3456
|
+
const currentClass = e2.currentTarget.className;
|
|
3457
|
+
const isShow = currentClass.includes("nutShow");
|
|
3458
|
+
const arrowIcon = e2.currentTarget.querySelector(".arrow-icon");
|
|
3459
|
+
const iconClass = arrowIcon.className;
|
|
3460
|
+
if (isTitle) {
|
|
3461
|
+
e2.currentTarget.className = isShow ? currentClass.replace("nutShow", "nutHide") : currentClass.replace("nutHide", "nutShow");
|
|
3462
|
+
arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
|
|
3463
|
+
}
|
|
3464
|
+
};
|
|
3465
|
+
const OffsetContext = createContext(20);
|
|
3466
|
+
const defaultProps$T = {
|
|
3467
|
+
showhead: false,
|
|
3468
|
+
position: "left",
|
|
3469
|
+
width: "80%"
|
|
3470
|
+
};
|
|
3471
|
+
const SideNavBar = (props) => {
|
|
3472
|
+
useConfig();
|
|
3473
|
+
const {
|
|
3474
|
+
title,
|
|
3475
|
+
visible,
|
|
3476
|
+
width,
|
|
3477
|
+
position,
|
|
3478
|
+
children,
|
|
3479
|
+
className,
|
|
3480
|
+
showhead,
|
|
3481
|
+
handleClose,
|
|
3482
|
+
...rest
|
|
3483
|
+
} = {
|
|
3484
|
+
...defaultProps$T,
|
|
3485
|
+
...props
|
|
3486
|
+
};
|
|
3487
|
+
const offset = props.offset ? Number(props.offset) : 20;
|
|
3488
|
+
return /* @__PURE__ */ React__default.createElement(Popup, {
|
|
3489
|
+
visible,
|
|
3490
|
+
style: { width, height: "100%" },
|
|
3491
|
+
position,
|
|
3492
|
+
onClose: handleClose
|
|
3493
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3494
|
+
className: className ? `${className} nut-sidenavbar` : "nut-sidenavbar",
|
|
3495
|
+
...rest
|
|
3496
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3497
|
+
className: "nut-sidenavbar__content"
|
|
3498
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3499
|
+
className: "nut-sidenavbar__list nutShow",
|
|
3500
|
+
onClick: handleClick
|
|
3501
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3502
|
+
className: "nut-sidenavbar__title border-bt ",
|
|
3503
|
+
style: { paddingLeft: `${offset}px` }
|
|
3504
|
+
}, title, " ", /* @__PURE__ */ React__default.createElement("i", {
|
|
3505
|
+
className: "arrow-icon arrow-down"
|
|
3506
|
+
})), /* @__PURE__ */ React__default.createElement(OffsetContext.Provider, {
|
|
3507
|
+
value: offset
|
|
3508
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3509
|
+
className: "nut-sidenavbar__content"
|
|
3510
|
+
}, children))))));
|
|
3511
|
+
};
|
|
3512
|
+
SideNavBar.defaultProps = defaultProps$T;
|
|
3513
|
+
SideNavBar.displayName = "NutSideNavBar";
|
|
3514
|
+
const defaultProps$S = {
|
|
3515
|
+
open: true
|
|
3516
|
+
};
|
|
3517
|
+
const SubSideNavBar = (props) => {
|
|
3518
|
+
const { title, ikey, children, titleClick, open, ...rest } = {
|
|
3519
|
+
...defaultProps$S,
|
|
3520
|
+
...props
|
|
3521
|
+
};
|
|
3522
|
+
const offset = useContext$1(OffsetContext);
|
|
3523
|
+
console.log("offset>>>>>>>", offset);
|
|
3524
|
+
const listRef = useRef(null);
|
|
3525
|
+
const setListLevel = useCallback(
|
|
3526
|
+
(nodeList, level = 1) => {
|
|
3527
|
+
const titleClass = nodeList[0].className;
|
|
3528
|
+
if (titleClass.includes("nut-subsidenavbar__title")) {
|
|
3529
|
+
const left = offset * (level + 1);
|
|
3530
|
+
nodeList[0].style.paddingLeft = `${left}px`;
|
|
3531
|
+
}
|
|
3532
|
+
const childNodes = nodeList[1] && nodeList[1].children && Array.from(nodeList[1].children).filter(
|
|
3533
|
+
(item) => item.nodeType !== 3 && item.nodeType !== 8
|
|
3534
|
+
);
|
|
3535
|
+
childNodes.forEach((item) => {
|
|
3536
|
+
const itemClass = item.className;
|
|
3537
|
+
if (itemClass.includes("nut-subsidenavbar__item")) {
|
|
3538
|
+
const left = offset * (level + 2);
|
|
3539
|
+
item.style.paddingLeft = `${left}px`;
|
|
3540
|
+
}
|
|
3541
|
+
if (itemClass.includes("nut-subsidenavbar__list")) {
|
|
3542
|
+
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
3543
|
+
level2 += 1;
|
|
3544
|
+
item.setAttribute("level", level2.toString());
|
|
3545
|
+
item.children && setListLevel(item.children, level2);
|
|
3546
|
+
}
|
|
3547
|
+
});
|
|
3548
|
+
},
|
|
3549
|
+
[offset]
|
|
3550
|
+
);
|
|
3551
|
+
const clickFn = (e2) => {
|
|
3552
|
+
handleClick(e2);
|
|
3553
|
+
const currentClass = e2.currentTarget.className;
|
|
3554
|
+
const isShow = currentClass.includes("nutShow");
|
|
3555
|
+
titleClick && titleClick({ title, ikey, isShow });
|
|
3556
|
+
};
|
|
3557
|
+
useEffect(() => {
|
|
3558
|
+
var _a, _b;
|
|
3559
|
+
const childNodes = (_a = listRef.current) == null ? void 0 : _a.children;
|
|
3560
|
+
(_b = listRef.current) == null ? void 0 : _b.setAttribute("level", "1");
|
|
3561
|
+
childNodes && setListLevel(childNodes);
|
|
3562
|
+
}, [setListLevel]);
|
|
3563
|
+
const divClass = open ? "nut-subsidenavbar__list nutShow" : "nut-subsidenavbar__list nutHide";
|
|
3564
|
+
const iconClass = open ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
|
|
3565
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3566
|
+
className: divClass,
|
|
3567
|
+
ref: listRef,
|
|
3568
|
+
onClick: clickFn,
|
|
3569
|
+
...rest
|
|
3570
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3571
|
+
className: "nut-subsidenavbar__title border-bt"
|
|
3572
|
+
}, title, " ", /* @__PURE__ */ React__default.createElement("i", {
|
|
3573
|
+
className: iconClass
|
|
3574
|
+
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3575
|
+
className: "nut-subsidenavbar__content"
|
|
3576
|
+
}, children));
|
|
3577
|
+
};
|
|
3578
|
+
const SideNavBarItem = (props) => {
|
|
3579
|
+
const { title, ikey, children, click, ...rest } = props;
|
|
3580
|
+
const clickFn = (e2) => {
|
|
3581
|
+
e2.stopPropagation();
|
|
3582
|
+
click && click({ title, ikey });
|
|
3583
|
+
};
|
|
3584
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3585
|
+
className: "nut-subsidenavbar__item border-bt",
|
|
3586
|
+
onClick: clickFn,
|
|
3587
|
+
...rest
|
|
3588
|
+
}, title);
|
|
3589
|
+
};
|
|
3368
3590
|
const MIN_DISTANCE = 10;
|
|
3369
3591
|
function getDirection(x2, y2) {
|
|
3370
3592
|
if (x2 > y2 && x2 > MIN_DISTANCE) {
|
|
@@ -3650,7 +3872,7 @@ var Toast = {
|
|
|
3650
3872
|
}
|
|
3651
3873
|
}
|
|
3652
3874
|
};
|
|
3653
|
-
const defaultProps$
|
|
3875
|
+
const defaultProps$R = {
|
|
3654
3876
|
range: false,
|
|
3655
3877
|
hiddenRange: false,
|
|
3656
3878
|
hiddenTag: false,
|
|
@@ -3684,7 +3906,7 @@ const Range = (props) => {
|
|
|
3684
3906
|
change,
|
|
3685
3907
|
dragStart,
|
|
3686
3908
|
dragEnd
|
|
3687
|
-
} = { ...defaultProps$
|
|
3909
|
+
} = { ...defaultProps$R, ...props };
|
|
3688
3910
|
const [buttonIndex, SetButtonIndex] = useState(0);
|
|
3689
3911
|
const [initValue, SetInitValue] = useState();
|
|
3690
3912
|
const [dragStatus, SetDragStatus] = useState("start");
|
|
@@ -3724,23 +3946,26 @@ const Range = (props) => {
|
|
|
3724
3946
|
const prefixCls = "nut-range-container";
|
|
3725
3947
|
return [prefixCls, `${vertical ? `${prefixCls}-vertical` : ""}`, className].filter(Boolean).join(" ");
|
|
3726
3948
|
}, [vertical, className]);
|
|
3727
|
-
const markClassName = useCallback(
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3949
|
+
const markClassName = useCallback(
|
|
3950
|
+
(mark) => {
|
|
3951
|
+
const classPrefix = "nut-range-mark";
|
|
3952
|
+
let lowerBound = Number(min);
|
|
3953
|
+
let upperBound = Number(max);
|
|
3954
|
+
if (range) {
|
|
3955
|
+
const [left, right] = modelValue;
|
|
3956
|
+
lowerBound = left;
|
|
3957
|
+
upperBound = right;
|
|
3958
|
+
} else {
|
|
3959
|
+
upperBound = modelValue;
|
|
3960
|
+
}
|
|
3961
|
+
const isActive = mark <= upperBound && mark >= lowerBound;
|
|
3962
|
+
return [
|
|
3963
|
+
`${classPrefix}-text`,
|
|
3964
|
+
`${isActive ? `${classPrefix}-text-active` : ""}`
|
|
3965
|
+
].filter(Boolean).join(" ");
|
|
3966
|
+
},
|
|
3967
|
+
[range, modelValue, min, max]
|
|
3968
|
+
);
|
|
3744
3969
|
const [rangeName, setRangeName] = useState(classes());
|
|
3745
3970
|
const [containerName, setContainerName] = useState(containerClasses());
|
|
3746
3971
|
useEffect(() => {
|
|
@@ -4013,7 +4238,7 @@ const Range = (props) => {
|
|
|
4013
4238
|
className: "max"
|
|
4014
4239
|
}, +max) : null);
|
|
4015
4240
|
};
|
|
4016
|
-
Range.defaultProps = defaultProps$
|
|
4241
|
+
Range.defaultProps = defaultProps$R;
|
|
4017
4242
|
Range.displayName = "NutRange";
|
|
4018
4243
|
const Utils = {
|
|
4019
4244
|
isLeapYear(y2) {
|
|
@@ -4107,7 +4332,7 @@ function requestAniFrame() {
|
|
|
4107
4332
|
};
|
|
4108
4333
|
}
|
|
4109
4334
|
var requestAniFrame$1 = requestAniFrame();
|
|
4110
|
-
const defaultProps$
|
|
4335
|
+
const defaultProps$Q = {
|
|
4111
4336
|
type: "one",
|
|
4112
4337
|
isAutoBackFill: false,
|
|
4113
4338
|
poppable: true,
|
|
@@ -4136,7 +4361,7 @@ const CalendarItem = (props) => {
|
|
|
4136
4361
|
onChoose,
|
|
4137
4362
|
onUpdate,
|
|
4138
4363
|
onClose
|
|
4139
|
-
} = { ...defaultProps$
|
|
4364
|
+
} = { ...defaultProps$Q, ...props };
|
|
4140
4365
|
const weeks = locale.calendaritem.weekdays;
|
|
4141
4366
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
4142
4367
|
const [unLoadPrev, setUnLoadPrev] = useState(false);
|
|
@@ -4167,10 +4392,13 @@ const CalendarItem = (props) => {
|
|
|
4167
4392
|
const months = useRef(null);
|
|
4168
4393
|
const monthsPanel = useRef(null);
|
|
4169
4394
|
const b2 = cn("calendar");
|
|
4170
|
-
const classes = classNames(
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4395
|
+
const classes = classNames(
|
|
4396
|
+
{
|
|
4397
|
+
[`${b2("")}-tile`]: !poppable,
|
|
4398
|
+
[`${b2("")}-nofooter`]: !!isAutoBackFill
|
|
4399
|
+
},
|
|
4400
|
+
b2("")
|
|
4401
|
+
);
|
|
4174
4402
|
const headerClasses = classNames({
|
|
4175
4403
|
[`${b2("")}-header`]: true,
|
|
4176
4404
|
[`${b2("")}-header-tile`]: !poppable
|
|
@@ -4189,7 +4417,11 @@ const CalendarItem = (props) => {
|
|
|
4189
4417
|
return Utils.isEqual(state.currDate[1], currDate);
|
|
4190
4418
|
};
|
|
4191
4419
|
const getCurrDate = (day, month, isRange) => {
|
|
4192
|
-
return isRange ? `${month.curData[3]}-${month.curData[4]}-${Utils.getNumTwoBit(
|
|
4420
|
+
return isRange ? `${month.curData[3]}-${month.curData[4]}-${Utils.getNumTwoBit(
|
|
4421
|
+
+day.day
|
|
4422
|
+
)}` : `${month.curData[0]}-${month.curData[1]}-${Utils.getNumTwoBit(
|
|
4423
|
+
+day.day
|
|
4424
|
+
)}`;
|
|
4193
4425
|
};
|
|
4194
4426
|
const getClass = (day, month, isRange) => {
|
|
4195
4427
|
const currDate = getCurrDate(day, month, isRange);
|
|
@@ -4310,10 +4542,19 @@ const CalendarItem = (props) => {
|
|
|
4310
4542
|
]
|
|
4311
4543
|
};
|
|
4312
4544
|
if (type2 == "next") {
|
|
4313
|
-
if (!state.endData || !Utils.compareDate(
|
|
4545
|
+
if (!state.endData || !Utils.compareDate(
|
|
4546
|
+
`${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(
|
|
4547
|
+
state.endData[0],
|
|
4548
|
+
state.endData[1]
|
|
4549
|
+
)}`,
|
|
4550
|
+
`${curData[0]}-${curData[1]}-${curData[2]}`
|
|
4551
|
+
)) {
|
|
4314
4552
|
state.monthsData.push(monthInfo);
|
|
4315
4553
|
}
|
|
4316
|
-
} else if (!state.startData || !Utils.compareDate(
|
|
4554
|
+
} else if (!state.startData || !Utils.compareDate(
|
|
4555
|
+
`${curData[0]}-${curData[1]}-${curData[2]}`,
|
|
4556
|
+
`${state.startData[0]}-${state.startData[1]}-01`
|
|
4557
|
+
)) {
|
|
4317
4558
|
state.monthsData.unshift(monthInfo);
|
|
4318
4559
|
} else {
|
|
4319
4560
|
setUnLoadPrev(true);
|
|
@@ -4465,10 +4706,23 @@ const CalendarItem = (props) => {
|
|
|
4465
4706
|
getMonth(getCurrData("next"), "next");
|
|
4466
4707
|
} while (i++ < 4);
|
|
4467
4708
|
if (state.isRange) {
|
|
4468
|
-
chooseDay(
|
|
4469
|
-
|
|
4709
|
+
chooseDay(
|
|
4710
|
+
{ day: state.defaultData[2], type: "curr" },
|
|
4711
|
+
state.monthsData[0],
|
|
4712
|
+
true
|
|
4713
|
+
);
|
|
4714
|
+
chooseDay(
|
|
4715
|
+
{ day: state.defaultData[5], type: "curr" },
|
|
4716
|
+
state.monthsData[0],
|
|
4717
|
+
true,
|
|
4718
|
+
true
|
|
4719
|
+
);
|
|
4470
4720
|
} else {
|
|
4471
|
-
chooseDay(
|
|
4721
|
+
chooseDay(
|
|
4722
|
+
{ day: state.defaultData[2], type: "curr" },
|
|
4723
|
+
state.monthsData[0],
|
|
4724
|
+
true
|
|
4725
|
+
);
|
|
4472
4726
|
}
|
|
4473
4727
|
};
|
|
4474
4728
|
useEffect(() => {
|
|
@@ -4532,9 +4786,9 @@ const CalendarItem = (props) => {
|
|
|
4532
4786
|
onClick: confirm2
|
|
4533
4787
|
}, locale.confirm)) : ""));
|
|
4534
4788
|
};
|
|
4535
|
-
CalendarItem.defaultProps = defaultProps$
|
|
4789
|
+
CalendarItem.defaultProps = defaultProps$Q;
|
|
4536
4790
|
CalendarItem.displayName = "NutCalendarItem";
|
|
4537
|
-
const defaultProps$
|
|
4791
|
+
const defaultProps$P = {
|
|
4538
4792
|
type: "one",
|
|
4539
4793
|
isAutoBackFill: false,
|
|
4540
4794
|
poppable: true,
|
|
@@ -4562,7 +4816,7 @@ const Calendar = (props) => {
|
|
|
4562
4816
|
endDate,
|
|
4563
4817
|
onClose,
|
|
4564
4818
|
onChoose
|
|
4565
|
-
} = { ...defaultProps$
|
|
4819
|
+
} = { ...defaultProps$P, ...props };
|
|
4566
4820
|
const close = () => {
|
|
4567
4821
|
onClose && onClose();
|
|
4568
4822
|
};
|
|
@@ -4605,95 +4859,99 @@ const Calendar = (props) => {
|
|
|
4605
4859
|
onChoose: choose
|
|
4606
4860
|
}));
|
|
4607
4861
|
};
|
|
4608
|
-
Calendar.defaultProps = defaultProps$
|
|
4862
|
+
Calendar.defaultProps = defaultProps$P;
|
|
4609
4863
|
Calendar.displayName = "NutCalendar";
|
|
4610
|
-
const defaultProps$
|
|
4864
|
+
const defaultProps$O = {
|
|
4611
4865
|
disabled: false,
|
|
4612
4866
|
checkedValue: [],
|
|
4613
4867
|
max: void 0,
|
|
4614
4868
|
onChange: (value) => {
|
|
4615
4869
|
}
|
|
4616
4870
|
};
|
|
4617
|
-
const CheckboxGroup = React__default.forwardRef(
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4871
|
+
const CheckboxGroup = React__default.forwardRef(
|
|
4872
|
+
(props, ref) => {
|
|
4873
|
+
const { children } = { ...defaultProps$O, ...props };
|
|
4874
|
+
const b2 = cn("checkboxgroup");
|
|
4875
|
+
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
4876
|
+
const [innerDisabled, setInnerDisabled] = useState(disabled);
|
|
4877
|
+
const [innerValue, setInnerValue] = useState(checkedValue);
|
|
4878
|
+
useImperativeHandle(ref, () => ({
|
|
4879
|
+
toggleAll(state) {
|
|
4880
|
+
if (state === false) {
|
|
4881
|
+
setInnerValue([]);
|
|
4882
|
+
} else {
|
|
4883
|
+
const childrenLabel = [];
|
|
4884
|
+
React__default.Children.map(children, (child) => {
|
|
4885
|
+
const childProps = child.props;
|
|
4886
|
+
console.log(child);
|
|
4887
|
+
childrenLabel.push(childProps.label || child.children);
|
|
4888
|
+
});
|
|
4889
|
+
setInnerValue(childrenLabel);
|
|
4890
|
+
}
|
|
4891
|
+
},
|
|
4892
|
+
toggleReverse() {
|
|
4628
4893
|
const childrenLabel = [];
|
|
4629
4894
|
React__default.Children.map(children, (child) => {
|
|
4630
4895
|
const childProps = child.props;
|
|
4631
|
-
console.log(child);
|
|
4632
4896
|
childrenLabel.push(childProps.label || child.children);
|
|
4633
4897
|
});
|
|
4634
|
-
|
|
4898
|
+
const reverse = childrenLabel.filter(
|
|
4899
|
+
(c6) => (innerValue == null ? void 0 : innerValue.findIndex((v2) => v2 === c6)) === -1
|
|
4900
|
+
);
|
|
4901
|
+
setInnerValue(reverse);
|
|
4635
4902
|
}
|
|
4636
|
-
}
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
if (innerValue) {
|
|
4655
|
-
let clippedValue = [];
|
|
4656
|
-
if (state) {
|
|
4657
|
-
clippedValue = [...innerValue, label];
|
|
4658
|
-
} else {
|
|
4659
|
-
innerValue == null ? void 0 : innerValue.splice(innerValue == null ? void 0 : innerValue.indexOf(label), 1);
|
|
4660
|
-
clippedValue = [...innerValue];
|
|
4903
|
+
}));
|
|
4904
|
+
useEffect(() => {
|
|
4905
|
+
setInnerDisabled(disabled);
|
|
4906
|
+
setInnerValue(checkedValue);
|
|
4907
|
+
}, [disabled, checkedValue]);
|
|
4908
|
+
function handleChildChange(state, label) {
|
|
4909
|
+
if (max !== void 0 && innerValue && innerValue.length > max)
|
|
4910
|
+
return;
|
|
4911
|
+
if (innerValue) {
|
|
4912
|
+
let clippedValue = [];
|
|
4913
|
+
if (state) {
|
|
4914
|
+
clippedValue = [...innerValue, label];
|
|
4915
|
+
} else {
|
|
4916
|
+
innerValue == null ? void 0 : innerValue.splice(innerValue == null ? void 0 : innerValue.indexOf(label), 1);
|
|
4917
|
+
clippedValue = [...innerValue];
|
|
4918
|
+
}
|
|
4919
|
+
setInnerValue(clippedValue);
|
|
4920
|
+
onChange && onChange(clippedValue);
|
|
4661
4921
|
}
|
|
4662
|
-
setInnerValue(clippedValue);
|
|
4663
|
-
onChange && onChange(clippedValue);
|
|
4664
4922
|
}
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
return
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4923
|
+
function validateChildChecked(child) {
|
|
4924
|
+
if (!innerValue)
|
|
4925
|
+
return false;
|
|
4926
|
+
return (innerValue == null ? void 0 : innerValue.indexOf(child.props.label || child.children)) > -1;
|
|
4927
|
+
}
|
|
4928
|
+
function getParentVals() {
|
|
4929
|
+
return innerValue;
|
|
4930
|
+
}
|
|
4931
|
+
function cloneChildren() {
|
|
4932
|
+
return React__default.Children.map(children, (child) => {
|
|
4933
|
+
const childChecked = validateChildChecked(child);
|
|
4934
|
+
if (child.type.displayName !== "NutCheckBox") {
|
|
4935
|
+
return React__default.cloneElement(child);
|
|
4936
|
+
}
|
|
4937
|
+
return React__default.cloneElement(child, {
|
|
4938
|
+
disabled: innerDisabled,
|
|
4939
|
+
checked: childChecked,
|
|
4940
|
+
onChange: handleChildChange,
|
|
4941
|
+
getParentVals,
|
|
4942
|
+
max
|
|
4943
|
+
});
|
|
4686
4944
|
});
|
|
4687
|
-
}
|
|
4945
|
+
}
|
|
4946
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4947
|
+
className: `${b2()} ${className || ""}`,
|
|
4948
|
+
...rest
|
|
4949
|
+
}, cloneChildren());
|
|
4688
4950
|
}
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
...rest
|
|
4692
|
-
}, cloneChildren());
|
|
4693
|
-
});
|
|
4694
|
-
CheckboxGroup.defaultProps = defaultProps$N;
|
|
4951
|
+
);
|
|
4952
|
+
CheckboxGroup.defaultProps = defaultProps$O;
|
|
4695
4953
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
4696
|
-
const defaultProps$
|
|
4954
|
+
const defaultProps$N = {
|
|
4697
4955
|
checked: false,
|
|
4698
4956
|
disabled: false,
|
|
4699
4957
|
textPosition: "right",
|
|
@@ -4707,7 +4965,7 @@ const defaultProps$M = {
|
|
|
4707
4965
|
}
|
|
4708
4966
|
};
|
|
4709
4967
|
const Checkbox = (props) => {
|
|
4710
|
-
const { children } = { ...defaultProps$
|
|
4968
|
+
const { children } = { ...defaultProps$N, ...props };
|
|
4711
4969
|
const b2 = cn("checkbox");
|
|
4712
4970
|
const {
|
|
4713
4971
|
iconName,
|
|
@@ -4772,7 +5030,7 @@ const Checkbox = (props) => {
|
|
|
4772
5030
|
className: `${b2("label", { disabled: innerDisabled })} `
|
|
4773
5031
|
}, children || label);
|
|
4774
5032
|
};
|
|
4775
|
-
const
|
|
5033
|
+
const handleClick2 = () => {
|
|
4776
5034
|
if (!disabled) {
|
|
4777
5035
|
const latest = !innerChecked;
|
|
4778
5036
|
if (max !== void 0 && latest && getParentVals().length >= max)
|
|
@@ -4784,10 +5042,10 @@ const Checkbox = (props) => {
|
|
|
4784
5042
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4785
5043
|
className: `${b2({ reverse: textPosition === "left" })} ${className || ""}`,
|
|
4786
5044
|
...rest,
|
|
4787
|
-
onClick:
|
|
5045
|
+
onClick: handleClick2
|
|
4788
5046
|
}, renderIcon(), renderLabel());
|
|
4789
5047
|
};
|
|
4790
|
-
Checkbox.defaultProps = defaultProps$
|
|
5048
|
+
Checkbox.defaultProps = defaultProps$N;
|
|
4791
5049
|
Checkbox.displayName = "NutCheckBox";
|
|
4792
5050
|
Checkbox.Group = CheckboxGroup;
|
|
4793
5051
|
const InternalPickerSlot = (props, ref) => {
|
|
@@ -4951,12 +5209,12 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
4951
5209
|
transform: `rotate3d(1, 0, 0, ${-rotation * (index2 + 1)}deg) translate3d(0px, 0px, 104px)`
|
|
4952
5210
|
},
|
|
4953
5211
|
key: item.value ? item.value : index2
|
|
4954
|
-
}, item.text ? item.text : item);
|
|
5212
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item));
|
|
4955
5213
|
}), !threeDimensional && listData.map((item, index2) => {
|
|
4956
5214
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4957
5215
|
className: "nut-picker-roller-item-tile",
|
|
4958
5216
|
key: item.value ? item.value : index2
|
|
4959
|
-
}, item.text ? item.text : item);
|
|
5217
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item));
|
|
4960
5218
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
4961
5219
|
className: "nut-picker-mask"
|
|
4962
5220
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -5010,7 +5268,9 @@ const InternalPicker = (props, ref) => {
|
|
|
5010
5268
|
const optins = [];
|
|
5011
5269
|
columnsList.map((column, index2) => {
|
|
5012
5270
|
let currOptions = [];
|
|
5013
|
-
currOptions = column.filter(
|
|
5271
|
+
currOptions = column.filter(
|
|
5272
|
+
(item) => item.value === chooseValueData[index2]
|
|
5273
|
+
);
|
|
5014
5274
|
if (currOptions[0]) {
|
|
5015
5275
|
optins.push(currOptions[0]);
|
|
5016
5276
|
} else {
|
|
@@ -5043,7 +5303,10 @@ const InternalPicker = (props, ref) => {
|
|
|
5043
5303
|
} else {
|
|
5044
5304
|
setchooseValueData((data) => {
|
|
5045
5305
|
const cdata = [...data];
|
|
5046
|
-
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
5306
|
+
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
5307
|
+
option,
|
|
5308
|
+
"value"
|
|
5309
|
+
) ? option.value : "";
|
|
5047
5310
|
return cdata;
|
|
5048
5311
|
});
|
|
5049
5312
|
}
|
|
@@ -5085,7 +5348,9 @@ const InternalPicker = (props, ref) => {
|
|
|
5085
5348
|
while (cursor && cursor.children) {
|
|
5086
5349
|
const options2 = cursor.children;
|
|
5087
5350
|
const value = defaultValues[columnIndex2];
|
|
5088
|
-
let index2 = options2.findIndex(
|
|
5351
|
+
let index2 = options2.findIndex(
|
|
5352
|
+
(columnItem) => columnItem.value === value
|
|
5353
|
+
);
|
|
5089
5354
|
if (index2 === -1)
|
|
5090
5355
|
index2 = 0;
|
|
5091
5356
|
cursor = cursor.children[index2];
|
|
@@ -5098,8 +5363,8 @@ const InternalPicker = (props, ref) => {
|
|
|
5098
5363
|
const data = [];
|
|
5099
5364
|
const normalData = normalListData();
|
|
5100
5365
|
setColumnsList(normalData);
|
|
5101
|
-
normalData.map((item) => {
|
|
5102
|
-
data.push(item[0].value);
|
|
5366
|
+
normalData.length > 0 && normalData.map((item) => {
|
|
5367
|
+
item[0] && data.push(item[0].value);
|
|
5103
5368
|
return item;
|
|
5104
5369
|
});
|
|
5105
5370
|
if (!defaultValueData && chooseValueData.length === 0) {
|
|
@@ -5142,7 +5407,7 @@ const InternalPicker = (props, ref) => {
|
|
|
5142
5407
|
};
|
|
5143
5408
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
5144
5409
|
const currentYear = new Date().getFullYear();
|
|
5145
|
-
const defaultProps$
|
|
5410
|
+
const defaultProps$M = {
|
|
5146
5411
|
modelValue: null,
|
|
5147
5412
|
visible: false,
|
|
5148
5413
|
title: "",
|
|
@@ -5172,7 +5437,7 @@ const DatePicker = (props) => {
|
|
|
5172
5437
|
style,
|
|
5173
5438
|
...rest
|
|
5174
5439
|
} = {
|
|
5175
|
-
...defaultProps$
|
|
5440
|
+
...defaultProps$M,
|
|
5176
5441
|
...props
|
|
5177
5442
|
};
|
|
5178
5443
|
const [show, setShow] = useState(false);
|
|
@@ -5294,25 +5559,38 @@ const DatePicker = (props) => {
|
|
|
5294
5559
|
return result;
|
|
5295
5560
|
};
|
|
5296
5561
|
const updateChooseValueCustmer = (index2, selectedValue, cacheValueData) => {
|
|
5297
|
-
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
5562
|
+
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
5563
|
+
type.toLocaleLowerCase()
|
|
5564
|
+
)) {
|
|
5298
5565
|
const formatDate = [];
|
|
5299
5566
|
selectedValue.forEach((item) => {
|
|
5300
5567
|
formatDate.push(item);
|
|
5301
5568
|
});
|
|
5302
5569
|
if (type.toLocaleLowerCase() === "month-day" && formatDate.length < 3) {
|
|
5303
|
-
formatDate.unshift(
|
|
5570
|
+
formatDate.unshift(
|
|
5571
|
+
new Date(modelValue || minDate || maxDate).getFullYear()
|
|
5572
|
+
);
|
|
5304
5573
|
}
|
|
5305
5574
|
if (type.toLocaleLowerCase() === "year-month" && formatDate.length < 3) {
|
|
5306
5575
|
formatDate.push(new Date(modelValue || minDate || maxDate).getDate());
|
|
5307
5576
|
}
|
|
5308
5577
|
const year = Number(formatDate[0]);
|
|
5309
5578
|
const month = Number(formatDate[1]) - 1;
|
|
5310
|
-
const day = Math.min(
|
|
5579
|
+
const day = Math.min(
|
|
5580
|
+
Number(formatDate[2]),
|
|
5581
|
+
getMonthEndDay(Number(formatDate[0]), Number(formatDate[1]))
|
|
5582
|
+
);
|
|
5311
5583
|
let date = null;
|
|
5312
5584
|
if (type.toLocaleLowerCase() === "date" || type.toLocaleLowerCase() === "month-day" || type.toLocaleLowerCase() === "year-month") {
|
|
5313
5585
|
date = new Date(year, month, day);
|
|
5314
5586
|
} else if (type.toLocaleLowerCase() === "datetime") {
|
|
5315
|
-
date = new Date(
|
|
5587
|
+
date = new Date(
|
|
5588
|
+
year,
|
|
5589
|
+
month,
|
|
5590
|
+
day,
|
|
5591
|
+
Number(formatDate[3]),
|
|
5592
|
+
Number(formatDate[4])
|
|
5593
|
+
);
|
|
5316
5594
|
} else if (type.toLocaleLowerCase() === "datehour") {
|
|
5317
5595
|
date = new Date(year, month, day, Number(formatDate[3]));
|
|
5318
5596
|
}
|
|
@@ -5385,7 +5663,13 @@ const DatePicker = (props) => {
|
|
|
5385
5663
|
};
|
|
5386
5664
|
const columns = (date) => {
|
|
5387
5665
|
const val = ranges(date).map((res, columnIndex) => {
|
|
5388
|
-
return generateValue(
|
|
5666
|
+
return generateValue(
|
|
5667
|
+
res.range[0],
|
|
5668
|
+
res.range[1],
|
|
5669
|
+
getDateIndex(res.type),
|
|
5670
|
+
res.type,
|
|
5671
|
+
columnIndex
|
|
5672
|
+
);
|
|
5389
5673
|
});
|
|
5390
5674
|
return val || [];
|
|
5391
5675
|
};
|
|
@@ -5418,9 +5702,9 @@ const DatePicker = (props) => {
|
|
|
5418
5702
|
ref: pickerRef
|
|
5419
5703
|
}));
|
|
5420
5704
|
};
|
|
5421
|
-
DatePicker.defaultProps = defaultProps$
|
|
5705
|
+
DatePicker.defaultProps = defaultProps$M;
|
|
5422
5706
|
DatePicker.displayName = "NutDatePicker";
|
|
5423
|
-
const defaultProps$
|
|
5707
|
+
const defaultProps$L = {
|
|
5424
5708
|
disabled: false,
|
|
5425
5709
|
buttonSize: "",
|
|
5426
5710
|
min: 1,
|
|
@@ -5458,7 +5742,7 @@ const InputNumber = (props) => {
|
|
|
5458
5742
|
focus,
|
|
5459
5743
|
...restProps
|
|
5460
5744
|
} = {
|
|
5461
|
-
...defaultProps$
|
|
5745
|
+
...defaultProps$L,
|
|
5462
5746
|
...props
|
|
5463
5747
|
};
|
|
5464
5748
|
const [inputValue, setInputValue] = useState(modelValue);
|
|
@@ -5466,9 +5750,13 @@ const InputNumber = (props) => {
|
|
|
5466
5750
|
setInputValue(modelValue);
|
|
5467
5751
|
}, [modelValue]);
|
|
5468
5752
|
const b2 = cn("inputnumber");
|
|
5469
|
-
const classes = classNames(
|
|
5470
|
-
|
|
5471
|
-
|
|
5753
|
+
const classes = classNames(
|
|
5754
|
+
{
|
|
5755
|
+
[`${b2("")}--disabled`]: disabled
|
|
5756
|
+
},
|
|
5757
|
+
className,
|
|
5758
|
+
b2("")
|
|
5759
|
+
);
|
|
5472
5760
|
const styles = {
|
|
5473
5761
|
height: pxCheck(buttonSize),
|
|
5474
5762
|
...style
|
|
@@ -5579,7 +5867,7 @@ const InputNumber = (props) => {
|
|
|
5579
5867
|
click: addNumber
|
|
5580
5868
|
}));
|
|
5581
5869
|
};
|
|
5582
|
-
InputNumber.defaultProps = defaultProps$
|
|
5870
|
+
InputNumber.defaultProps = defaultProps$L;
|
|
5583
5871
|
InputNumber.displayName = "NutInputNumber";
|
|
5584
5872
|
function trimExtraChar(value, char, regExp) {
|
|
5585
5873
|
const index2 = value.indexOf(char);
|
|
@@ -5605,7 +5893,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
5605
5893
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
5606
5894
|
return value.replace(regExp, "");
|
|
5607
5895
|
}
|
|
5608
|
-
const defaultProps$
|
|
5896
|
+
const defaultProps$K = {
|
|
5609
5897
|
type: "text",
|
|
5610
5898
|
defaultValue: "",
|
|
5611
5899
|
placeholder: "",
|
|
@@ -5688,14 +5976,14 @@ const Input = (props) => {
|
|
|
5688
5976
|
clickRightIcon,
|
|
5689
5977
|
click,
|
|
5690
5978
|
...rest
|
|
5691
|
-
} = { ...defaultProps$
|
|
5979
|
+
} = { ...defaultProps$K, ...props };
|
|
5692
5980
|
locale.placeholder = placeholder || locale.placeholder;
|
|
5693
5981
|
const [inputValue, SetInputValue] = useState("");
|
|
5694
5982
|
const [active, SetActive] = useState(false);
|
|
5695
5983
|
const [classes, setClasses] = useState("");
|
|
5696
5984
|
const getModelValue = () => String(inputValue != null ? inputValue : "");
|
|
5697
5985
|
const inputRef = useRef(null);
|
|
5698
|
-
useLayoutEffect
|
|
5986
|
+
useLayoutEffect(() => {
|
|
5699
5987
|
updateValue(getModelValue(), formatTrigger);
|
|
5700
5988
|
});
|
|
5701
5989
|
useEffect(() => {
|
|
@@ -5895,60 +6183,62 @@ const Input = (props) => {
|
|
|
5895
6183
|
}
|
|
5896
6184
|
}, errorMessage) : null)));
|
|
5897
6185
|
};
|
|
5898
|
-
Input.defaultProps = defaultProps$
|
|
6186
|
+
Input.defaultProps = defaultProps$K;
|
|
5899
6187
|
Input.displayName = "NutInput";
|
|
5900
6188
|
const radioContext = {
|
|
5901
6189
|
onChange: (val) => {
|
|
5902
6190
|
}
|
|
5903
6191
|
};
|
|
5904
6192
|
var RadioContext = React__default.createContext(radioContext);
|
|
5905
|
-
const defaultProps$
|
|
6193
|
+
const defaultProps$J = {
|
|
5906
6194
|
value: null,
|
|
5907
6195
|
textPosition: "right",
|
|
5908
6196
|
onChange: (value) => {
|
|
5909
6197
|
},
|
|
5910
6198
|
direction: "vertical"
|
|
5911
6199
|
};
|
|
5912
|
-
const RadioGroup = React__default.forwardRef(
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
6200
|
+
const RadioGroup = React__default.forwardRef(
|
|
6201
|
+
(props, ref) => {
|
|
6202
|
+
const { children } = { ...defaultProps$J, ...props };
|
|
6203
|
+
cn("RadioGroup");
|
|
6204
|
+
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
6205
|
+
const [val2State, setVal2State] = useState(value);
|
|
6206
|
+
useEffect(() => {
|
|
6207
|
+
setVal2State(value);
|
|
6208
|
+
}, [value]);
|
|
6209
|
+
function validateChildChecked(child) {
|
|
6210
|
+
if (val2State === null)
|
|
6211
|
+
return false;
|
|
6212
|
+
return val2State === child.props.value;
|
|
6213
|
+
}
|
|
6214
|
+
function cloneChildren() {
|
|
6215
|
+
return React__default.Children.map(children, (child, index2) => {
|
|
6216
|
+
const childChecked = validateChildChecked(child);
|
|
6217
|
+
if (child.type.displayName !== "NutRadio") {
|
|
6218
|
+
return React__default.cloneElement(child);
|
|
6219
|
+
}
|
|
6220
|
+
return React__default.cloneElement(child, {
|
|
6221
|
+
textPosition,
|
|
6222
|
+
checked: childChecked
|
|
6223
|
+
});
|
|
5934
6224
|
});
|
|
5935
|
-
});
|
|
5936
|
-
}
|
|
5937
|
-
return /* @__PURE__ */ React__default.createElement(RadioContext.Provider, {
|
|
5938
|
-
value: {
|
|
5939
|
-
onChange: (val) => {
|
|
5940
|
-
setVal2State(val);
|
|
5941
|
-
onChange && onChange(val);
|
|
5942
|
-
}
|
|
5943
6225
|
}
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
6226
|
+
return /* @__PURE__ */ React__default.createElement(RadioContext.Provider, {
|
|
6227
|
+
value: {
|
|
6228
|
+
onChange: (val) => {
|
|
6229
|
+
setVal2State(val);
|
|
6230
|
+
onChange && onChange(val);
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6234
|
+
className: `nut-radiogroup nut-radiogroup--${props.direction}`,
|
|
6235
|
+
...rest
|
|
6236
|
+
}, cloneChildren()));
|
|
6237
|
+
}
|
|
6238
|
+
);
|
|
6239
|
+
RadioGroup.defaultProps = defaultProps$J;
|
|
5950
6240
|
RadioGroup.displayName = "NutRadioGroup";
|
|
5951
|
-
const defaultProps$
|
|
6241
|
+
const defaultProps$I = {
|
|
5952
6242
|
disabled: false,
|
|
5953
6243
|
checked: false,
|
|
5954
6244
|
shape: "round",
|
|
@@ -5961,7 +6251,7 @@ const defaultProps$H = {
|
|
|
5961
6251
|
}
|
|
5962
6252
|
};
|
|
5963
6253
|
const Radio = (props) => {
|
|
5964
|
-
const { children } = { ...defaultProps$
|
|
6254
|
+
const { children } = { ...defaultProps$I, ...props };
|
|
5965
6255
|
const {
|
|
5966
6256
|
className,
|
|
5967
6257
|
disabled,
|
|
@@ -5996,7 +6286,13 @@ const Radio = (props) => {
|
|
|
5996
6286
|
}, children);
|
|
5997
6287
|
};
|
|
5998
6288
|
const color = () => {
|
|
5999
|
-
|
|
6289
|
+
if (disabledStatement) {
|
|
6290
|
+
return "nut-radio__icon--disable";
|
|
6291
|
+
}
|
|
6292
|
+
if (checkedStatement) {
|
|
6293
|
+
return "nut-radio__icon";
|
|
6294
|
+
}
|
|
6295
|
+
return "nut-radio__icon--unchecked";
|
|
6000
6296
|
};
|
|
6001
6297
|
const renderIcon = () => {
|
|
6002
6298
|
const { iconName: iconName2, iconSize: iconSize2, iconActiveName: iconActiveName2 } = props;
|
|
@@ -6006,24 +6302,33 @@ const Radio = (props) => {
|
|
|
6006
6302
|
className: color()
|
|
6007
6303
|
});
|
|
6008
6304
|
};
|
|
6009
|
-
const
|
|
6010
|
-
if (
|
|
6305
|
+
const renderRadioItem = () => {
|
|
6306
|
+
if (shape === "button") {
|
|
6307
|
+
return renderButton();
|
|
6308
|
+
}
|
|
6309
|
+
if (reverseState) {
|
|
6310
|
+
return [renderLabel(), renderIcon()];
|
|
6311
|
+
}
|
|
6312
|
+
return [renderIcon(), renderLabel()];
|
|
6313
|
+
};
|
|
6314
|
+
const handleClick2 = (e2) => {
|
|
6315
|
+
if (disabledStatement || checkedStatement)
|
|
6011
6316
|
return;
|
|
6012
6317
|
setCheckedStatement(!checkedStatement);
|
|
6013
|
-
|
|
6318
|
+
onChange && onChange(e2);
|
|
6014
6319
|
context2 && context2.onChange(valueStatement);
|
|
6015
6320
|
};
|
|
6016
6321
|
const reverseState = textPosition === "left";
|
|
6017
6322
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6018
6323
|
className: `nut-radio ${className}`,
|
|
6019
|
-
onClick:
|
|
6324
|
+
onClick: handleClick2,
|
|
6020
6325
|
...rest
|
|
6021
|
-
},
|
|
6326
|
+
}, renderRadioItem());
|
|
6022
6327
|
};
|
|
6023
|
-
Radio.defaultProps = defaultProps$
|
|
6328
|
+
Radio.defaultProps = defaultProps$I;
|
|
6024
6329
|
Radio.displayName = "NutRadio";
|
|
6025
6330
|
Radio.RadioGroup = RadioGroup;
|
|
6026
|
-
const defaultProps$
|
|
6331
|
+
const defaultProps$H = {
|
|
6027
6332
|
count: 5,
|
|
6028
6333
|
modelValue: 0,
|
|
6029
6334
|
minimizeValue: 0,
|
|
@@ -6052,7 +6357,7 @@ const Rate = (props) => {
|
|
|
6052
6357
|
allowHalf,
|
|
6053
6358
|
spacing,
|
|
6054
6359
|
change
|
|
6055
|
-
} = { ...defaultProps$
|
|
6360
|
+
} = { ...defaultProps$H, ...props };
|
|
6056
6361
|
const b2 = cn("rate");
|
|
6057
6362
|
const bi = cn("rate-item");
|
|
6058
6363
|
const [countArray, setCountArray] = useState([1, 2, 3, 4, 5]);
|
|
@@ -6109,16 +6414,18 @@ const Rate = (props) => {
|
|
|
6109
6414
|
size: iconSize,
|
|
6110
6415
|
name: checkedIcon
|
|
6111
6416
|
}), allowHalf && score < n2 - 1 && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6112
|
-
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
6417
|
+
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
6418
|
+
"icon--half"
|
|
6419
|
+
)}`,
|
|
6113
6420
|
color: voidColor,
|
|
6114
6421
|
size: iconSize,
|
|
6115
6422
|
name: uncheckedIcon
|
|
6116
6423
|
}));
|
|
6117
6424
|
}));
|
|
6118
6425
|
};
|
|
6119
|
-
Rate.defaultProps = defaultProps$
|
|
6426
|
+
Rate.defaultProps = defaultProps$H;
|
|
6120
6427
|
Rate.displayName = "NutRate";
|
|
6121
|
-
const defaultProps$
|
|
6428
|
+
const defaultProps$G = {
|
|
6122
6429
|
title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
6123
6430
|
desc: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1",
|
|
6124
6431
|
tips: "\u5FD8\u8BB0\u5BC6\u7801",
|
|
@@ -6278,9 +6585,9 @@ const ShortPassword = (props) => {
|
|
|
6278
6585
|
onClick: () => sure()
|
|
6279
6586
|
}, locale.confirm)) : null)));
|
|
6280
6587
|
};
|
|
6281
|
-
ShortPassword.defaultProps = defaultProps$
|
|
6588
|
+
ShortPassword.defaultProps = defaultProps$G;
|
|
6282
6589
|
ShortPassword.displayName = "NutShortPassword";
|
|
6283
|
-
const defaultProps$
|
|
6590
|
+
const defaultProps$F = {
|
|
6284
6591
|
defaultValue: "",
|
|
6285
6592
|
textAlign: "left",
|
|
6286
6593
|
limitshow: false,
|
|
@@ -6308,7 +6615,7 @@ const TextArea = (props) => {
|
|
|
6308
6615
|
onChange,
|
|
6309
6616
|
onBlur,
|
|
6310
6617
|
onFocus
|
|
6311
|
-
} = { ...defaultProps$
|
|
6618
|
+
} = { ...defaultProps$F, ...props };
|
|
6312
6619
|
const textareaBem = cn("textarea");
|
|
6313
6620
|
const [inputValue, SetInputValue] = useState("");
|
|
6314
6621
|
useEffect(() => {
|
|
@@ -6372,7 +6679,7 @@ const TextArea = (props) => {
|
|
|
6372
6679
|
className: textareaBem("limit")
|
|
6373
6680
|
}, inputValue.length, "/", maxlength < 0 ? 0 : maxlength) : null);
|
|
6374
6681
|
};
|
|
6375
|
-
TextArea.defaultProps = defaultProps$
|
|
6682
|
+
TextArea.defaultProps = defaultProps$F;
|
|
6376
6683
|
TextArea.displayName = "NutTextArea";
|
|
6377
6684
|
class UploadOptions {
|
|
6378
6685
|
constructor() {
|
|
@@ -6395,10 +6702,14 @@ class Upload {
|
|
|
6395
6702
|
const xhr = new XMLHttpRequest();
|
|
6396
6703
|
xhr.timeout = options2.timeout;
|
|
6397
6704
|
if (xhr.upload) {
|
|
6398
|
-
xhr.upload.addEventListener(
|
|
6399
|
-
|
|
6400
|
-
(
|
|
6401
|
-
|
|
6705
|
+
xhr.upload.addEventListener(
|
|
6706
|
+
"progress",
|
|
6707
|
+
(e2) => {
|
|
6708
|
+
var _a2;
|
|
6709
|
+
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
6710
|
+
},
|
|
6711
|
+
false
|
|
6712
|
+
);
|
|
6402
6713
|
xhr.onreadystatechange = () => {
|
|
6403
6714
|
var _a2, _b;
|
|
6404
6715
|
if (xhr.readyState === 4) {
|
|
@@ -6421,7 +6732,7 @@ class Upload {
|
|
|
6421
6732
|
}
|
|
6422
6733
|
}
|
|
6423
6734
|
}
|
|
6424
|
-
const defaultProps$
|
|
6735
|
+
const defaultProps$E = {
|
|
6425
6736
|
url: "",
|
|
6426
6737
|
maximum: 1,
|
|
6427
6738
|
uploadIcon: "photograph",
|
|
@@ -6496,7 +6807,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6496
6807
|
beforeUpload,
|
|
6497
6808
|
beforeDelete,
|
|
6498
6809
|
...restProps
|
|
6499
|
-
} = { ...defaultProps$
|
|
6810
|
+
} = { ...defaultProps$E, ...props };
|
|
6500
6811
|
const [fileList, setFileList] = useState([]);
|
|
6501
6812
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
6502
6813
|
useEffect(() => {
|
|
@@ -6597,9 +6908,11 @@ const InternalUploader = (props, ref) => {
|
|
|
6597
6908
|
if (props.autoUpload) {
|
|
6598
6909
|
task.upload();
|
|
6599
6910
|
} else {
|
|
6600
|
-
uploadQueue.push(
|
|
6601
|
-
resolve
|
|
6602
|
-
|
|
6911
|
+
uploadQueue.push(
|
|
6912
|
+
new Promise((resolve, reject) => {
|
|
6913
|
+
resolve(task);
|
|
6914
|
+
})
|
|
6915
|
+
);
|
|
6603
6916
|
setUploadQueue(uploadQueue);
|
|
6604
6917
|
}
|
|
6605
6918
|
};
|
|
@@ -6668,10 +6981,12 @@ const InternalUploader = (props, ref) => {
|
|
|
6668
6981
|
const $el = event.target;
|
|
6669
6982
|
const { files } = $el;
|
|
6670
6983
|
if (beforeUpload) {
|
|
6671
|
-
beforeUpload(new Array().slice.call(files)).then(
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6984
|
+
beforeUpload(new Array().slice.call(files)).then(
|
|
6985
|
+
(f2) => {
|
|
6986
|
+
const _files = filterFiles(new Array().slice.call(f2));
|
|
6987
|
+
readFile(_files);
|
|
6988
|
+
}
|
|
6989
|
+
);
|
|
6675
6990
|
} else {
|
|
6676
6991
|
const _files = filterFiles(new Array().slice.call(files));
|
|
6677
6992
|
readFile(_files);
|
|
@@ -6785,9 +7100,9 @@ const InternalUploader = (props, ref) => {
|
|
|
6785
7100
|
})));
|
|
6786
7101
|
};
|
|
6787
7102
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
6788
|
-
Uploader.defaultProps = defaultProps$
|
|
7103
|
+
Uploader.defaultProps = defaultProps$E;
|
|
6789
7104
|
Uploader.displayName = "NutUploader";
|
|
6790
|
-
const defaultProps$
|
|
7105
|
+
const defaultProps$D = {
|
|
6791
7106
|
placeholder: "",
|
|
6792
7107
|
shape: "square",
|
|
6793
7108
|
disabled: false,
|
|
@@ -6834,7 +7149,7 @@ const SearchBar = (props) => {
|
|
|
6834
7149
|
onClickRightinIcon,
|
|
6835
7150
|
onClickRightoutIcon
|
|
6836
7151
|
} = {
|
|
6837
|
-
...defaultProps$
|
|
7152
|
+
...defaultProps$D,
|
|
6838
7153
|
...props
|
|
6839
7154
|
};
|
|
6840
7155
|
const alignClass = `${align}`;
|
|
@@ -6971,9 +7286,9 @@ const SearchBar = (props) => {
|
|
|
6971
7286
|
className: `${searchbarBem("content")}`
|
|
6972
7287
|
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
6973
7288
|
};
|
|
6974
|
-
SearchBar.defaultProps = defaultProps$
|
|
7289
|
+
SearchBar.defaultProps = defaultProps$D;
|
|
6975
7290
|
SearchBar.displayName = "NutSearchBar";
|
|
6976
|
-
const defaultProps$
|
|
7291
|
+
const defaultProps$C = {
|
|
6977
7292
|
confirmText: "",
|
|
6978
7293
|
title: "",
|
|
6979
7294
|
visible: false,
|
|
@@ -7053,12 +7368,23 @@ const NumberKeyboard = (props) => {
|
|
|
7053
7368
|
}
|
|
7054
7369
|
if (customKeys.length === 1) {
|
|
7055
7370
|
if (props.title && props.type !== "rightColumn") {
|
|
7056
|
-
keys.push(
|
|
7371
|
+
keys.push(
|
|
7372
|
+
{ id: customKeys[0], type: "custom" },
|
|
7373
|
+
{ id: 0, type: "number" },
|
|
7374
|
+
{ id: "delete", type: "delete" }
|
|
7375
|
+
);
|
|
7057
7376
|
} else {
|
|
7058
|
-
keys.push(
|
|
7377
|
+
keys.push(
|
|
7378
|
+
{ id: 0, type: "number" },
|
|
7379
|
+
{ id: customKeys[0], type: "custom" }
|
|
7380
|
+
);
|
|
7059
7381
|
}
|
|
7060
7382
|
} else if (customKeys.length === 2) {
|
|
7061
|
-
keys.push(
|
|
7383
|
+
keys.push(
|
|
7384
|
+
{ id: customKeys[0], type: "custom" },
|
|
7385
|
+
{ id: 0, type: "number" },
|
|
7386
|
+
{ id: customKeys[1], type: "custom" }
|
|
7387
|
+
);
|
|
7062
7388
|
}
|
|
7063
7389
|
return keys;
|
|
7064
7390
|
};
|
|
@@ -7160,9 +7486,9 @@ const NumberKeyboard = (props) => {
|
|
|
7160
7486
|
})
|
|
7161
7487
|
}, confirmText || locale.done))) : null))));
|
|
7162
7488
|
};
|
|
7163
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
7489
|
+
NumberKeyboard.defaultProps = defaultProps$C;
|
|
7164
7490
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
7165
|
-
const defaultProps$
|
|
7491
|
+
const defaultProps$B = {
|
|
7166
7492
|
cancelTxt: "",
|
|
7167
7493
|
optionTag: "name",
|
|
7168
7494
|
optionSubTag: "subname",
|
|
@@ -7195,7 +7521,7 @@ const ActionSheet = (props) => {
|
|
|
7195
7521
|
className,
|
|
7196
7522
|
style,
|
|
7197
7523
|
...rest
|
|
7198
|
-
} = { ...defaultProps$
|
|
7524
|
+
} = { ...defaultProps$B, ...props };
|
|
7199
7525
|
const b2 = cn("actionsheet");
|
|
7200
7526
|
const isHighlight = (item) => {
|
|
7201
7527
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -7239,9 +7565,9 @@ const ActionSheet = (props) => {
|
|
|
7239
7565
|
onClick: () => cancelActionSheet()
|
|
7240
7566
|
}, cancelTxt)));
|
|
7241
7567
|
};
|
|
7242
|
-
ActionSheet.defaultProps = defaultProps$
|
|
7568
|
+
ActionSheet.defaultProps = defaultProps$B;
|
|
7243
7569
|
ActionSheet.displayName = "NutActionSheet";
|
|
7244
|
-
const defaultProps$
|
|
7570
|
+
const defaultProps$A = {
|
|
7245
7571
|
bottom: 20,
|
|
7246
7572
|
right: 10,
|
|
7247
7573
|
elId: "body",
|
|
@@ -7264,7 +7590,7 @@ const BackTop = (props) => {
|
|
|
7264
7590
|
style,
|
|
7265
7591
|
onClick
|
|
7266
7592
|
} = {
|
|
7267
|
-
...defaultProps$
|
|
7593
|
+
...defaultProps$A,
|
|
7268
7594
|
...props
|
|
7269
7595
|
};
|
|
7270
7596
|
const [backTop, SetBackTop] = useState(false);
|
|
@@ -7353,7 +7679,7 @@ const BackTop = (props) => {
|
|
|
7353
7679
|
name: "top"
|
|
7354
7680
|
}));
|
|
7355
7681
|
};
|
|
7356
|
-
BackTop.defaultProps = defaultProps$
|
|
7682
|
+
BackTop.defaultProps = defaultProps$A;
|
|
7357
7683
|
BackTop.displayName = "NutBackTop";
|
|
7358
7684
|
function clamp(v2, min, max) {
|
|
7359
7685
|
return Math.max(min, Math.min(v2, max));
|
|
@@ -8617,9 +8943,9 @@ let findTimeout = (time) => ~(~timeouts.findIndex((t2) => t2.time > time) || ~ti
|
|
|
8617
8943
|
raf.cancel = (fn) => {
|
|
8618
8944
|
onStartQueue.delete(fn);
|
|
8619
8945
|
onFrameQueue.delete(fn);
|
|
8946
|
+
onFinishQueue.delete(fn);
|
|
8620
8947
|
updateQueue.delete(fn);
|
|
8621
8948
|
writeQueue.delete(fn);
|
|
8622
|
-
onFinishQueue.delete(fn);
|
|
8623
8949
|
};
|
|
8624
8950
|
raf.sync = (fn) => {
|
|
8625
8951
|
sync = true;
|
|
@@ -8697,14 +9023,15 @@ function update() {
|
|
|
8697
9023
|
eachSafely(timeouts.splice(0, count), (t2) => t2.handler());
|
|
8698
9024
|
pendingCount -= count;
|
|
8699
9025
|
}
|
|
9026
|
+
if (!pendingCount) {
|
|
9027
|
+
stop();
|
|
9028
|
+
return;
|
|
9029
|
+
}
|
|
8700
9030
|
onStartQueue.flush();
|
|
8701
9031
|
updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
|
|
8702
9032
|
onFrameQueue.flush();
|
|
8703
9033
|
writeQueue.flush();
|
|
8704
9034
|
onFinishQueue.flush();
|
|
8705
|
-
if (!pendingCount) {
|
|
8706
|
-
stop();
|
|
8707
|
-
}
|
|
8708
9035
|
}
|
|
8709
9036
|
function makeQueue() {
|
|
8710
9037
|
let next = /* @__PURE__ */ new Set();
|
|
@@ -9386,10 +9713,10 @@ function deprecateDirectCall() {
|
|
|
9386
9713
|
function isAnimatedString(value) {
|
|
9387
9714
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
|
|
9388
9715
|
}
|
|
9389
|
-
const
|
|
9716
|
+
const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
|
|
9390
9717
|
const useIsMounted = () => {
|
|
9391
9718
|
const isMounted = useRef(false);
|
|
9392
|
-
|
|
9719
|
+
useIsomorphicLayoutEffect(() => {
|
|
9393
9720
|
isMounted.current = true;
|
|
9394
9721
|
return () => {
|
|
9395
9722
|
isMounted.current = false;
|
|
@@ -9671,7 +9998,7 @@ const withAnimated = (Component2, host2) => {
|
|
|
9671
9998
|
};
|
|
9672
9999
|
const observer = new PropsObserver(callback, deps);
|
|
9673
10000
|
const observerRef = useRef();
|
|
9674
|
-
|
|
10001
|
+
useIsomorphicLayoutEffect(() => {
|
|
9675
10002
|
observerRef.current = observer;
|
|
9676
10003
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
9677
10004
|
return () => {
|
|
@@ -11407,7 +11734,7 @@ function useSprings(length, props, deps) {
|
|
|
11407
11734
|
const context2 = useContext$1(SpringContext);
|
|
11408
11735
|
const prevContext = usePrev(context2);
|
|
11409
11736
|
const hasContext = context2 !== prevContext && hasProps(context2);
|
|
11410
|
-
|
|
11737
|
+
useIsomorphicLayoutEffect(() => {
|
|
11411
11738
|
layoutId.current++;
|
|
11412
11739
|
state.ctrls = ctrls.current;
|
|
11413
11740
|
const {
|
|
@@ -11756,7 +12083,7 @@ const host = createHost(primitives, {
|
|
|
11756
12083
|
}
|
|
11757
12084
|
});
|
|
11758
12085
|
const animated = host.animated;
|
|
11759
|
-
const defaultProps$
|
|
12086
|
+
const defaultProps$z = {
|
|
11760
12087
|
attract: false,
|
|
11761
12088
|
direction: void 0,
|
|
11762
12089
|
boundary: {
|
|
@@ -11769,7 +12096,7 @@ const defaultProps$y = {
|
|
|
11769
12096
|
};
|
|
11770
12097
|
const Drag = (props) => {
|
|
11771
12098
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
11772
|
-
...defaultProps$
|
|
12099
|
+
...defaultProps$z,
|
|
11773
12100
|
...props
|
|
11774
12101
|
};
|
|
11775
12102
|
const b2 = cn("drag");
|
|
@@ -11795,26 +12122,29 @@ const Drag = (props) => {
|
|
|
11795
12122
|
middleLine.current = clientWidth - offsetWidth - offsetLeft - (clientWidth - offsetWidth) / 2;
|
|
11796
12123
|
}
|
|
11797
12124
|
};
|
|
11798
|
-
const bind = useDrag(
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
if (
|
|
11802
|
-
if (
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
12125
|
+
const bind = useDrag(
|
|
12126
|
+
({ down, last, offset: [x2, y2] }) => {
|
|
12127
|
+
api.start({ x: x2, y: y2, immediate: down });
|
|
12128
|
+
if (last) {
|
|
12129
|
+
if (props.direction != "y" && props.attract) {
|
|
12130
|
+
if (x2 < middleLine.current) {
|
|
12131
|
+
api.start({ x: boundaryState.left, y: y2, immediate: down });
|
|
12132
|
+
} else {
|
|
12133
|
+
api.start({
|
|
12134
|
+
x: boundaryState.right,
|
|
12135
|
+
y: y2,
|
|
12136
|
+
immediate: down
|
|
12137
|
+
});
|
|
12138
|
+
}
|
|
11810
12139
|
}
|
|
11811
12140
|
}
|
|
12141
|
+
},
|
|
12142
|
+
{
|
|
12143
|
+
from: () => [currstyle.x.get(), currstyle.y.get()],
|
|
12144
|
+
axis: direction,
|
|
12145
|
+
bounds: boundaryState
|
|
11812
12146
|
}
|
|
11813
|
-
|
|
11814
|
-
from: () => [currstyle.x.get(), currstyle.y.get()],
|
|
11815
|
-
axis: direction,
|
|
11816
|
-
bounds: boundaryState
|
|
11817
|
-
});
|
|
12147
|
+
);
|
|
11818
12148
|
useEffect(() => {
|
|
11819
12149
|
getInfo();
|
|
11820
12150
|
}, [myDrag]);
|
|
@@ -11828,7 +12158,7 @@ const Drag = (props) => {
|
|
|
11828
12158
|
...bind()
|
|
11829
12159
|
}, children));
|
|
11830
12160
|
};
|
|
11831
|
-
Drag.defaultProps = defaultProps$
|
|
12161
|
+
Drag.defaultProps = defaultProps$z;
|
|
11832
12162
|
Drag.displayName = "NutDrag";
|
|
11833
12163
|
const Content = (props) => {
|
|
11834
12164
|
const {
|
|
@@ -11854,12 +12184,12 @@ const Content = (props) => {
|
|
|
11854
12184
|
})
|
|
11855
12185
|
}, footer);
|
|
11856
12186
|
}
|
|
11857
|
-
const
|
|
12187
|
+
const handleClick2 = () => {
|
|
11858
12188
|
onClickSelf && onClickSelf();
|
|
11859
12189
|
};
|
|
11860
12190
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
11861
12191
|
className: "nut-dialog__outer",
|
|
11862
|
-
onClick:
|
|
12192
|
+
onClick: handleClick2
|
|
11863
12193
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
11864
12194
|
className: "nut-dialog",
|
|
11865
12195
|
style: { display: visible ? "flex" : "none" }
|
|
@@ -11885,7 +12215,7 @@ const DialogWrap = (props) => {
|
|
|
11885
12215
|
onClosed,
|
|
11886
12216
|
onCancel
|
|
11887
12217
|
} = props;
|
|
11888
|
-
const
|
|
12218
|
+
const handleClick2 = (e2) => {
|
|
11889
12219
|
if (closeOnClickOverlay && visible && e2.target === e2.currentTarget) {
|
|
11890
12220
|
onClosed == null ? void 0 : onClosed();
|
|
11891
12221
|
onCancel == null ? void 0 : onCancel();
|
|
@@ -11907,7 +12237,7 @@ const DialogWrap = (props) => {
|
|
|
11907
12237
|
appear: true
|
|
11908
12238
|
}, /* @__PURE__ */ React__default.createElement(Mask, null)) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
11909
12239
|
className: classNames("nut-dialog__wrap", className),
|
|
11910
|
-
onClick:
|
|
12240
|
+
onClick: handleClick2,
|
|
11911
12241
|
style: wrapStyle
|
|
11912
12242
|
}, /* @__PURE__ */ React__default.createElement(Content, {
|
|
11913
12243
|
...props,
|
|
@@ -11968,12 +12298,15 @@ function confirm(config2, renderFunc) {
|
|
|
11968
12298
|
}
|
|
11969
12299
|
if (ret && ret.then) {
|
|
11970
12300
|
renderFunction(dialogConfig);
|
|
11971
|
-
ret.then(
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
12301
|
+
ret.then(
|
|
12302
|
+
() => {
|
|
12303
|
+
onCancel(true);
|
|
12304
|
+
},
|
|
12305
|
+
(e2) => {
|
|
12306
|
+
console.error(e2);
|
|
12307
|
+
renderFunction(dialogConfig);
|
|
12308
|
+
}
|
|
12309
|
+
);
|
|
11977
12310
|
}
|
|
11978
12311
|
if (!ret) {
|
|
11979
12312
|
onCancel(true);
|
|
@@ -12020,7 +12353,7 @@ function confirm(config2, renderFunc) {
|
|
|
12020
12353
|
update: update2
|
|
12021
12354
|
};
|
|
12022
12355
|
}
|
|
12023
|
-
const defaultProps$
|
|
12356
|
+
const defaultProps$y = {
|
|
12024
12357
|
okText: "",
|
|
12025
12358
|
cancelText: "",
|
|
12026
12359
|
mask: true,
|
|
@@ -12111,9 +12444,9 @@ Dialog.confirm = (props) => {
|
|
|
12111
12444
|
});
|
|
12112
12445
|
};
|
|
12113
12446
|
});
|
|
12114
|
-
Dialog.defaultProps = defaultProps$
|
|
12447
|
+
Dialog.defaultProps = defaultProps$y;
|
|
12115
12448
|
Dialog.displayName = "NutDialog";
|
|
12116
|
-
const defaultProps$
|
|
12449
|
+
const defaultProps$x = {
|
|
12117
12450
|
hasMore: true,
|
|
12118
12451
|
threshold: 200,
|
|
12119
12452
|
containerId: "",
|
|
@@ -12147,7 +12480,7 @@ const Infiniteloading = (props) => {
|
|
|
12147
12480
|
scrollChange,
|
|
12148
12481
|
...restProps
|
|
12149
12482
|
} = {
|
|
12150
|
-
...defaultProps$
|
|
12483
|
+
...defaultProps$x,
|
|
12151
12484
|
...props
|
|
12152
12485
|
};
|
|
12153
12486
|
const [isInfiniting, setIsInfiniting] = useState(false);
|
|
@@ -12162,7 +12495,9 @@ const Infiniteloading = (props) => {
|
|
|
12162
12495
|
const b2 = cn("infiniteloading");
|
|
12163
12496
|
const classes = classNames(className, b2());
|
|
12164
12497
|
useEffect(() => {
|
|
12165
|
-
const parentElement = getParentElement(
|
|
12498
|
+
const parentElement = getParentElement(
|
|
12499
|
+
scroller.current
|
|
12500
|
+
);
|
|
12166
12501
|
scrollEl.current = useWindow ? window : parentElement;
|
|
12167
12502
|
scrollEl.current.addEventListener("scroll", handleScroll, useCapture);
|
|
12168
12503
|
return () => {
|
|
@@ -12304,7 +12639,7 @@ const Infiniteloading = (props) => {
|
|
|
12304
12639
|
className: "tips"
|
|
12305
12640
|
}, locale.infiniteloading.loadMoreText || loadMoreTxt)));
|
|
12306
12641
|
};
|
|
12307
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
12642
|
+
Infiniteloading.defaultProps = defaultProps$x;
|
|
12308
12643
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
12309
12644
|
class Notification extends React.PureComponent {
|
|
12310
12645
|
constructor(props) {
|
|
@@ -12463,7 +12798,7 @@ var Notify = {
|
|
|
12463
12798
|
}
|
|
12464
12799
|
}
|
|
12465
12800
|
};
|
|
12466
|
-
const defaultProps$
|
|
12801
|
+
const defaultProps$w = {
|
|
12467
12802
|
isAsync: false,
|
|
12468
12803
|
checked: false,
|
|
12469
12804
|
disable: false,
|
|
@@ -12486,7 +12821,7 @@ const Switch = (props) => {
|
|
|
12486
12821
|
className,
|
|
12487
12822
|
style
|
|
12488
12823
|
} = {
|
|
12489
|
-
...defaultProps$
|
|
12824
|
+
...defaultProps$w,
|
|
12490
12825
|
...props
|
|
12491
12826
|
};
|
|
12492
12827
|
const [value, setValue] = useState(false);
|
|
@@ -12526,10 +12861,10 @@ const Switch = (props) => {
|
|
|
12526
12861
|
className: `${b2("label")} close`
|
|
12527
12862
|
}, inactiveText))));
|
|
12528
12863
|
};
|
|
12529
|
-
Switch.defaultProps = defaultProps$
|
|
12864
|
+
Switch.defaultProps = defaultProps$w;
|
|
12530
12865
|
Switch.displayName = "NutSwitch";
|
|
12531
12866
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
12532
|
-
const defaultProps$
|
|
12867
|
+
const defaultProps$v = {
|
|
12533
12868
|
strokeWidth: 5,
|
|
12534
12869
|
radius: 50,
|
|
12535
12870
|
strokeLinecap: "round",
|
|
@@ -12552,7 +12887,7 @@ const CircleProgress = (props) => {
|
|
|
12552
12887
|
strokeLinecap,
|
|
12553
12888
|
...restProps
|
|
12554
12889
|
} = {
|
|
12555
|
-
...defaultProps$
|
|
12890
|
+
...defaultProps$v,
|
|
12556
12891
|
...props
|
|
12557
12892
|
};
|
|
12558
12893
|
const b2 = cn("circleprogress");
|
|
@@ -12586,7 +12921,9 @@ const CircleProgress = (props) => {
|
|
|
12586
12921
|
return;
|
|
12587
12922
|
}
|
|
12588
12923
|
const color = circleColor;
|
|
12589
|
-
const colorArr = Object.keys(color).sort(
|
|
12924
|
+
const colorArr = Object.keys(color).sort(
|
|
12925
|
+
(a, b22) => parseFloat(a) - parseFloat(b22)
|
|
12926
|
+
);
|
|
12590
12927
|
const stopArr = [];
|
|
12591
12928
|
colorArr.map((item) => {
|
|
12592
12929
|
const obj = {
|
|
@@ -12636,9 +12973,9 @@ const CircleProgress = (props) => {
|
|
|
12636
12973
|
className: "nut-circleprogress-text"
|
|
12637
12974
|
}, children || /* @__PURE__ */ React__default.createElement("div", null, progress, "%")));
|
|
12638
12975
|
};
|
|
12639
|
-
CircleProgress.defaultProps = defaultProps$
|
|
12976
|
+
CircleProgress.defaultProps = defaultProps$v;
|
|
12640
12977
|
CircleProgress.displayName = "NutCircleProgress";
|
|
12641
|
-
const defaultProps$
|
|
12978
|
+
const defaultProps$u = {
|
|
12642
12979
|
direction: "across",
|
|
12643
12980
|
list: [],
|
|
12644
12981
|
standTime: 1e3,
|
|
@@ -12676,7 +13013,7 @@ const NoticeBar = (props) => {
|
|
|
12676
13013
|
rightIcon,
|
|
12677
13014
|
close,
|
|
12678
13015
|
click
|
|
12679
|
-
} = { ...defaultProps$
|
|
13016
|
+
} = { ...defaultProps$u, ...props };
|
|
12680
13017
|
const wrap = useRef(null);
|
|
12681
13018
|
const content = useRef(null);
|
|
12682
13019
|
const [showNoticeBar, SetShowNoticeBar] = useState(true);
|
|
@@ -12751,7 +13088,7 @@ const NoticeBar = (props) => {
|
|
|
12751
13088
|
}
|
|
12752
13089
|
});
|
|
12753
13090
|
};
|
|
12754
|
-
const
|
|
13091
|
+
const handleClick2 = (event) => {
|
|
12755
13092
|
click && click(event);
|
|
12756
13093
|
};
|
|
12757
13094
|
const onClickIcon = (event) => {
|
|
@@ -12768,7 +13105,10 @@ const NoticeBar = (props) => {
|
|
|
12768
13105
|
};
|
|
12769
13106
|
const startRollEasy = () => {
|
|
12770
13107
|
showhorseLamp();
|
|
12771
|
-
const timerCurr = window.setInterval(
|
|
13108
|
+
const timerCurr = window.setInterval(
|
|
13109
|
+
showhorseLamp,
|
|
13110
|
+
~~(height / speed / 4) * 1e3 + Number(standTime)
|
|
13111
|
+
);
|
|
12772
13112
|
SetTimer(timerCurr);
|
|
12773
13113
|
};
|
|
12774
13114
|
const showhorseLamp = () => {
|
|
@@ -12836,7 +13176,7 @@ const NoticeBar = (props) => {
|
|
|
12836
13176
|
}, showNoticeBar && direction == "across" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
12837
13177
|
className: noticebarClass,
|
|
12838
13178
|
style: barStyle,
|
|
12839
|
-
onClick:
|
|
13179
|
+
onClick: handleClick2
|
|
12840
13180
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12841
13181
|
className: "left-icon",
|
|
12842
13182
|
style: { backgroundImage: `url(${leftIcon || ""})` }
|
|
@@ -12889,16 +13229,16 @@ const NoticeBar = (props) => {
|
|
|
12889
13229
|
size: "11px"
|
|
12890
13230
|
}) : null))) : null);
|
|
12891
13231
|
};
|
|
12892
|
-
NoticeBar.defaultProps = defaultProps$
|
|
13232
|
+
NoticeBar.defaultProps = defaultProps$u;
|
|
12893
13233
|
NoticeBar.displayName = "NutNoticeBar";
|
|
12894
13234
|
const DataContext$1 = createContext({});
|
|
12895
|
-
const defaultProps$
|
|
13235
|
+
const defaultProps$t = {
|
|
12896
13236
|
current: 0,
|
|
12897
13237
|
direction: "horizontal",
|
|
12898
13238
|
progressDot: false
|
|
12899
13239
|
};
|
|
12900
13240
|
const Steps = (props) => {
|
|
12901
|
-
const propSteps = { ...defaultProps$
|
|
13241
|
+
const propSteps = { ...defaultProps$t, ...props };
|
|
12902
13242
|
const {
|
|
12903
13243
|
children,
|
|
12904
13244
|
current,
|
|
@@ -12912,20 +13252,28 @@ const Steps = (props) => {
|
|
|
12912
13252
|
propSteps
|
|
12913
13253
|
};
|
|
12914
13254
|
const b2 = cn("steps");
|
|
12915
|
-
const classes = classNames(
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
13255
|
+
const classes = classNames(
|
|
13256
|
+
{
|
|
13257
|
+
[`${b2("")}-${direction}`]: true,
|
|
13258
|
+
[`${b2("")}-dot`]: !!props.progressDot
|
|
13259
|
+
},
|
|
13260
|
+
className,
|
|
13261
|
+
b2("")
|
|
13262
|
+
);
|
|
12919
13263
|
return /* @__PURE__ */ React__default.createElement(DataContext$1.Provider, {
|
|
12920
13264
|
value: parentSteps
|
|
12921
|
-
}, React__default.createElement(
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
13265
|
+
}, React__default.createElement(
|
|
13266
|
+
"div",
|
|
13267
|
+
{
|
|
13268
|
+
className: classes,
|
|
13269
|
+
...restProps
|
|
13270
|
+
},
|
|
13271
|
+
children
|
|
13272
|
+
));
|
|
12925
13273
|
};
|
|
12926
|
-
Steps.defaultProps = defaultProps$
|
|
13274
|
+
Steps.defaultProps = defaultProps$t;
|
|
12927
13275
|
Steps.displayName = "NutSteps";
|
|
12928
|
-
const defaultProps$
|
|
13276
|
+
const defaultProps$s = {
|
|
12929
13277
|
title: "",
|
|
12930
13278
|
content: "",
|
|
12931
13279
|
activeIndex: 0,
|
|
@@ -12946,7 +13294,7 @@ const Step = (props) => {
|
|
|
12946
13294
|
renderContent,
|
|
12947
13295
|
...restProps
|
|
12948
13296
|
} = {
|
|
12949
|
-
...defaultProps$
|
|
13297
|
+
...defaultProps$s,
|
|
12950
13298
|
...props
|
|
12951
13299
|
};
|
|
12952
13300
|
const parent = useContext$1(DataContext$1);
|
|
@@ -12964,9 +13312,13 @@ const Step = (props) => {
|
|
|
12964
13312
|
}
|
|
12965
13313
|
};
|
|
12966
13314
|
const b2 = cn("step");
|
|
12967
|
-
const classes = classNames(
|
|
12968
|
-
|
|
12969
|
-
|
|
13315
|
+
const classes = classNames(
|
|
13316
|
+
{
|
|
13317
|
+
[`${b2("")}-${getCurrentStatus()}`]: true
|
|
13318
|
+
},
|
|
13319
|
+
className,
|
|
13320
|
+
b2("")
|
|
13321
|
+
);
|
|
12970
13322
|
const renderIconClass = () => {
|
|
12971
13323
|
if (!dot && icon) {
|
|
12972
13324
|
return "nut-step-icon is-icon";
|
|
@@ -13003,10 +13355,10 @@ const Step = (props) => {
|
|
|
13003
13355
|
className: "nut-step-content"
|
|
13004
13356
|
}, renderContent())));
|
|
13005
13357
|
};
|
|
13006
|
-
Step.defaultProps = defaultProps$
|
|
13358
|
+
Step.defaultProps = defaultProps$s;
|
|
13007
13359
|
Step.displayName = "NutStep";
|
|
13008
13360
|
const DataContext = createContext({});
|
|
13009
|
-
const defaultProps$
|
|
13361
|
+
const defaultProps$r = {
|
|
13010
13362
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
13011
13363
|
height: 0,
|
|
13012
13364
|
duration: 500,
|
|
@@ -13019,11 +13371,12 @@ const defaultProps$q = {
|
|
|
13019
13371
|
touchable: true,
|
|
13020
13372
|
isPreventDefault: true,
|
|
13021
13373
|
isStopPropagation: true,
|
|
13374
|
+
isCenter: false,
|
|
13022
13375
|
className: ""
|
|
13023
13376
|
};
|
|
13024
13377
|
const DISTANCE = 5;
|
|
13025
13378
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
13026
|
-
const propSwiper = { ...defaultProps$
|
|
13379
|
+
const propSwiper = { ...defaultProps$r, ...props };
|
|
13027
13380
|
const {
|
|
13028
13381
|
children,
|
|
13029
13382
|
direction,
|
|
@@ -13037,6 +13390,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13037
13390
|
isPreventDefault,
|
|
13038
13391
|
isStopPropagation,
|
|
13039
13392
|
autoPlay,
|
|
13393
|
+
isCenter,
|
|
13040
13394
|
...rest
|
|
13041
13395
|
} = propSwiper;
|
|
13042
13396
|
const container = useRef(null);
|
|
@@ -13186,7 +13540,6 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13186
13540
|
props.onChange && props.onChange((targetActive + childCount) % childCount);
|
|
13187
13541
|
}
|
|
13188
13542
|
active = targetActive;
|
|
13189
|
-
offset2 = targetOffset;
|
|
13190
13543
|
setActive(targetActive);
|
|
13191
13544
|
setOffset(targetOffset);
|
|
13192
13545
|
getStyle(targetOffset);
|
|
@@ -13259,7 +13612,15 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13259
13612
|
});
|
|
13260
13613
|
const getStyle = (moveOffset = offset) => {
|
|
13261
13614
|
const target = innerRef.current;
|
|
13262
|
-
|
|
13615
|
+
let _offset = 0;
|
|
13616
|
+
if (!isCenter) {
|
|
13617
|
+
_offset = moveOffset;
|
|
13618
|
+
} else {
|
|
13619
|
+
const _size = isVertical ? height : width;
|
|
13620
|
+
const val = isVertical ? rect.height - _size : rect.width - _size;
|
|
13621
|
+
_offset = moveOffset + (active === childCount - 1 && !props.loop ? -val / 2 : val / 2);
|
|
13622
|
+
}
|
|
13623
|
+
target.style.transform = `translate3D${!isVertical ? `(${_offset}px,0,0)` : `(0,${_offset}px,0)`}`;
|
|
13263
13624
|
target.style.transitionDuration = `${_swiper.current.moving ? 0 : props.duration}ms`;
|
|
13264
13625
|
target.style[isVertical ? "height" : "width"] = `${Number(size) * childCount}px`;
|
|
13265
13626
|
target.style[isVertical ? "width" : "height"] = `${isVertical ? width : height}px`;
|
|
@@ -13296,7 +13657,11 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13296
13657
|
if (isShouldMove && touch.stateDirection === props.direction) {
|
|
13297
13658
|
const offset2 = isVertical ? touch.offsetY : touch.offsetX;
|
|
13298
13659
|
if (props.loop) {
|
|
13299
|
-
|
|
13660
|
+
if (offset2 > 0) {
|
|
13661
|
+
pace = touch.delta > 0 ? -1 : 1;
|
|
13662
|
+
} else {
|
|
13663
|
+
pace = 0;
|
|
13664
|
+
}
|
|
13300
13665
|
} else {
|
|
13301
13666
|
pace = -Math[touch.delta > 0 ? "ceil" : "floor"](touch.delta / size);
|
|
13302
13667
|
}
|
|
@@ -13365,18 +13730,23 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13365
13730
|
target.removeEventListener("touchend", onTouchEnd, false);
|
|
13366
13731
|
};
|
|
13367
13732
|
});
|
|
13368
|
-
|
|
13369
|
-
|
|
13733
|
+
useEffect(() => {
|
|
13734
|
+
return () => {
|
|
13735
|
+
stopAutoPlay();
|
|
13736
|
+
};
|
|
13737
|
+
}, []);
|
|
13738
|
+
const itemStyle = (index2) => {
|
|
13739
|
+
const style = {};
|
|
13370
13740
|
const _direction = propSwiper.direction || direction;
|
|
13371
13741
|
const _size = size;
|
|
13372
13742
|
if (_size) {
|
|
13373
|
-
|
|
13743
|
+
style[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
|
|
13374
13744
|
}
|
|
13375
13745
|
const offset2 = childOffset[index2];
|
|
13376
13746
|
if (offset2) {
|
|
13377
|
-
|
|
13747
|
+
style.transform = `translate3D${_direction === "horizontal" ? `(${offset2}px,0,0)` : `(0,${offset2}px,0)`}`;
|
|
13378
13748
|
}
|
|
13379
|
-
return
|
|
13749
|
+
return style;
|
|
13380
13750
|
};
|
|
13381
13751
|
React__default.useImperativeHandle(ref, () => ({
|
|
13382
13752
|
to: to2,
|
|
@@ -13395,7 +13765,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13395
13765
|
}, React__default.Children.map(childs, (child, index2) => {
|
|
13396
13766
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13397
13767
|
className: b2("item-wrapper"),
|
|
13398
|
-
style:
|
|
13768
|
+
style: itemStyle(index2),
|
|
13399
13769
|
key: index2
|
|
13400
13770
|
}, child);
|
|
13401
13771
|
})), propSwiper.paginationVisible && !("pageContent" in propSwiper) ? /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -13405,30 +13775,28 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
13405
13775
|
})
|
|
13406
13776
|
}, React__default.Children.map(childs, (item, index2) => {
|
|
13407
13777
|
return /* @__PURE__ */ React__default.createElement("i", {
|
|
13408
|
-
style: {
|
|
13409
|
-
backgroundColor:
|
|
13410
|
-
},
|
|
13778
|
+
style: (active + childCount) % childCount === index2 ? {
|
|
13779
|
+
backgroundColor: propSwiper.paginationColor
|
|
13780
|
+
} : void 0,
|
|
13781
|
+
className: classNames({
|
|
13782
|
+
[`${b2("pagination-item")}`]: true,
|
|
13783
|
+
active: (active + childCount) % childCount === index2
|
|
13784
|
+
}),
|
|
13411
13785
|
key: index2
|
|
13412
13786
|
});
|
|
13413
13787
|
})) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
|
|
13414
13788
|
});
|
|
13415
|
-
Swiper.defaultProps = defaultProps$
|
|
13789
|
+
Swiper.defaultProps = defaultProps$r;
|
|
13416
13790
|
Swiper.displayName = "NutSwiper";
|
|
13417
|
-
const defaultProps$
|
|
13791
|
+
const defaultProps$q = {
|
|
13418
13792
|
direction: "horizontal"
|
|
13419
13793
|
};
|
|
13420
13794
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
13421
|
-
const _props = { ...defaultProps$
|
|
13795
|
+
const _props = { ...defaultProps$q, ...props };
|
|
13422
13796
|
const { children, direction, size } = _props;
|
|
13423
13797
|
const parent = useContext$1(DataContext);
|
|
13424
|
-
const [offset, setOffset] = useState(0);
|
|
13425
13798
|
const b2 = cn("swiper-item");
|
|
13426
13799
|
const classes = classNames(b2(""));
|
|
13427
|
-
useImperativeHandle(ref, () => ({
|
|
13428
|
-
changeOffset: (num) => {
|
|
13429
|
-
setOffset(num);
|
|
13430
|
-
}
|
|
13431
|
-
}));
|
|
13432
13800
|
const style = () => {
|
|
13433
13801
|
const style2 = {};
|
|
13434
13802
|
const _direction = (parent == null ? void 0 : parent.propSwiper.direction) || direction;
|
|
@@ -13443,10 +13811,10 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
13443
13811
|
style: style()
|
|
13444
13812
|
}, children);
|
|
13445
13813
|
});
|
|
13446
|
-
SwiperItem.defaultProps = defaultProps$
|
|
13814
|
+
SwiperItem.defaultProps = defaultProps$q;
|
|
13447
13815
|
SwiperItem.displayName = "NutSwiperItem";
|
|
13448
13816
|
const AvatarContext = createContext({});
|
|
13449
|
-
const defaultProps$
|
|
13817
|
+
const defaultProps$p = {
|
|
13450
13818
|
size: "",
|
|
13451
13819
|
icon: "",
|
|
13452
13820
|
bgColor: "#eee",
|
|
@@ -13473,7 +13841,7 @@ const Avatar = (props) => {
|
|
|
13473
13841
|
onError,
|
|
13474
13842
|
...rest
|
|
13475
13843
|
} = {
|
|
13476
|
-
...defaultProps$
|
|
13844
|
+
...defaultProps$p,
|
|
13477
13845
|
...props
|
|
13478
13846
|
};
|
|
13479
13847
|
const [maxSum, setMaxSum] = useState(0);
|
|
@@ -13553,9 +13921,9 @@ const Avatar = (props) => {
|
|
|
13553
13921
|
className: "text"
|
|
13554
13922
|
}, ((_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)}`)));
|
|
13555
13923
|
};
|
|
13556
|
-
Avatar.defaultProps = defaultProps$
|
|
13924
|
+
Avatar.defaultProps = defaultProps$p;
|
|
13557
13925
|
Avatar.displayName = "NutAvatar";
|
|
13558
|
-
const defaultProps$
|
|
13926
|
+
const defaultProps$o = {
|
|
13559
13927
|
maxContent: "",
|
|
13560
13928
|
maxCount: "",
|
|
13561
13929
|
maxBgColor: "#eee",
|
|
@@ -13567,7 +13935,7 @@ const defaultProps$n = {
|
|
|
13567
13935
|
};
|
|
13568
13936
|
const AvatarGroup = (props) => {
|
|
13569
13937
|
useConfig();
|
|
13570
|
-
const propAvatarGroup = { ...defaultProps$
|
|
13938
|
+
const propAvatarGroup = { ...defaultProps$o, ...props };
|
|
13571
13939
|
const { className, style, children } = propAvatarGroup;
|
|
13572
13940
|
const avatarGroupRef = useRef(null);
|
|
13573
13941
|
const b2 = cn("avatar-group");
|
|
@@ -13584,9 +13952,9 @@ const AvatarGroup = (props) => {
|
|
|
13584
13952
|
ref: avatarGroupRef
|
|
13585
13953
|
}, children));
|
|
13586
13954
|
};
|
|
13587
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
13955
|
+
AvatarGroup.defaultProps = defaultProps$o;
|
|
13588
13956
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
13589
|
-
const defaultProps$
|
|
13957
|
+
const defaultProps$n = {
|
|
13590
13958
|
price: 0,
|
|
13591
13959
|
needSymbol: true,
|
|
13592
13960
|
symbol: "¥",
|
|
@@ -13604,7 +13972,7 @@ const Price = (props) => {
|
|
|
13604
13972
|
className,
|
|
13605
13973
|
...rest
|
|
13606
13974
|
} = {
|
|
13607
|
-
...defaultProps$
|
|
13975
|
+
...defaultProps$n,
|
|
13608
13976
|
...props
|
|
13609
13977
|
};
|
|
13610
13978
|
const b2 = cn("price");
|
|
@@ -13657,9 +14025,9 @@ const Price = (props) => {
|
|
|
13657
14025
|
className: `${b2("small")}`
|
|
13658
14026
|
}, formatDecimal(price)));
|
|
13659
14027
|
};
|
|
13660
|
-
Price.defaultProps = defaultProps$
|
|
14028
|
+
Price.defaultProps = defaultProps$n;
|
|
13661
14029
|
Price.displayName = "NutPrice";
|
|
13662
|
-
const defaultProps$
|
|
14030
|
+
const defaultProps$m = {
|
|
13663
14031
|
value: "",
|
|
13664
14032
|
dot: false,
|
|
13665
14033
|
max: 1e4,
|
|
@@ -13671,19 +14039,19 @@ const defaultProps$l = {
|
|
|
13671
14039
|
};
|
|
13672
14040
|
const Badge = (props) => {
|
|
13673
14041
|
const { children, dot, top, right, zIndex, color, icons } = {
|
|
13674
|
-
...defaultProps$
|
|
14042
|
+
...defaultProps$m,
|
|
13675
14043
|
...props
|
|
13676
14044
|
};
|
|
13677
|
-
|
|
14045
|
+
function content() {
|
|
13678
14046
|
if (dot)
|
|
13679
|
-
return;
|
|
14047
|
+
return void 0;
|
|
13680
14048
|
const { value } = props;
|
|
13681
14049
|
const { max } = props;
|
|
13682
14050
|
if (typeof value === "number" && typeof max === "number") {
|
|
13683
14051
|
return max < value ? `${max}+` : value;
|
|
13684
14052
|
}
|
|
13685
14053
|
return value;
|
|
13686
|
-
}
|
|
14054
|
+
}
|
|
13687
14055
|
const getStyle = () => {
|
|
13688
14056
|
const style = {};
|
|
13689
14057
|
style.top = `${top}px`;
|
|
@@ -13694,7 +14062,7 @@ const Badge = (props) => {
|
|
|
13694
14062
|
};
|
|
13695
14063
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13696
14064
|
className: "nut-badge"
|
|
13697
|
-
}, icons
|
|
14065
|
+
}, icons !== "" && /* @__PURE__ */ React__default.createElement("div", {
|
|
13698
14066
|
className: "slot-icons"
|
|
13699
14067
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
13700
14068
|
className: "_icon",
|
|
@@ -13706,9 +14074,9 @@ const Badge = (props) => {
|
|
|
13706
14074
|
style: getStyle()
|
|
13707
14075
|
}, content()));
|
|
13708
14076
|
};
|
|
13709
|
-
Badge.defaultProps = defaultProps$
|
|
14077
|
+
Badge.defaultProps = defaultProps$m;
|
|
13710
14078
|
Badge.displayName = "NutBadge";
|
|
13711
|
-
const defaultProps$
|
|
14079
|
+
const defaultProps$l = {
|
|
13712
14080
|
type: "default",
|
|
13713
14081
|
color: "",
|
|
13714
14082
|
textColor: "",
|
|
@@ -13736,7 +14104,7 @@ const Tag = (props) => {
|
|
|
13736
14104
|
onClick,
|
|
13737
14105
|
onClose
|
|
13738
14106
|
} = {
|
|
13739
|
-
...defaultProps$
|
|
14107
|
+
...defaultProps$l,
|
|
13740
14108
|
...props
|
|
13741
14109
|
};
|
|
13742
14110
|
const [btnName, setBtnName] = useState("");
|
|
@@ -13764,7 +14132,7 @@ const Tag = (props) => {
|
|
|
13764
14132
|
${mark ? `${prefixCls2}--mark` : ""}
|
|
13765
14133
|
${closeable ? `${prefixCls2}--close` : ""}`;
|
|
13766
14134
|
};
|
|
13767
|
-
const
|
|
14135
|
+
const handleClick2 = (e2) => {
|
|
13768
14136
|
if (props.onClick) {
|
|
13769
14137
|
props.onClick(e2);
|
|
13770
14138
|
}
|
|
@@ -13787,7 +14155,7 @@ const Tag = (props) => {
|
|
|
13787
14155
|
return /* @__PURE__ */ React__default.createElement("div", null, closeable ? isTagShow && /* @__PURE__ */ React__default.createElement("div", {
|
|
13788
14156
|
className: `${btnName}`,
|
|
13789
14157
|
style: getStyle(),
|
|
13790
|
-
onClick: (e2) =>
|
|
14158
|
+
onClick: (e2) => handleClick2(e2)
|
|
13791
14159
|
}, children && /* @__PURE__ */ React__default.createElement("span", {
|
|
13792
14160
|
className: "text"
|
|
13793
14161
|
}, children), /* @__PURE__ */ React__default.createElement(Icon, {
|
|
@@ -13803,12 +14171,12 @@ const Tag = (props) => {
|
|
|
13803
14171
|
})) : /* @__PURE__ */ React__default.createElement("div", {
|
|
13804
14172
|
className: `${btnName}`,
|
|
13805
14173
|
style: getStyle(),
|
|
13806
|
-
onClick: (e2) =>
|
|
14174
|
+
onClick: (e2) => handleClick2(e2)
|
|
13807
14175
|
}, children && /* @__PURE__ */ React__default.createElement("span", {
|
|
13808
14176
|
className: "text"
|
|
13809
14177
|
}, children)));
|
|
13810
14178
|
};
|
|
13811
|
-
Tag.defaultProps = defaultProps$
|
|
14179
|
+
Tag.defaultProps = defaultProps$l;
|
|
13812
14180
|
Tag.displayName = "NutTag";
|
|
13813
14181
|
function fillRef(ref, node) {
|
|
13814
14182
|
if (typeof ref === "function") {
|
|
@@ -13825,9 +14193,6 @@ function composeRef(...refs) {
|
|
|
13825
14193
|
};
|
|
13826
14194
|
}
|
|
13827
14195
|
class Trigger extends React__default.Component {
|
|
13828
|
-
constructor(props) {
|
|
13829
|
-
super(props);
|
|
13830
|
-
}
|
|
13831
14196
|
fireEvents(type, e2) {
|
|
13832
14197
|
const childCallback = this.props.children.props[type];
|
|
13833
14198
|
if (childCallback) {
|
|
@@ -13867,7 +14232,7 @@ const getEleAttr = (ele) => {
|
|
|
13867
14232
|
}
|
|
13868
14233
|
return null;
|
|
13869
14234
|
};
|
|
13870
|
-
const defaultProps$
|
|
14235
|
+
const defaultProps$k = {
|
|
13871
14236
|
list: [],
|
|
13872
14237
|
theme: "light",
|
|
13873
14238
|
location: "bottom",
|
|
@@ -13888,7 +14253,7 @@ const Popover = (props) => {
|
|
|
13888
14253
|
onClick,
|
|
13889
14254
|
...reset
|
|
13890
14255
|
} = {
|
|
13891
|
-
...defaultProps$
|
|
14256
|
+
...defaultProps$k,
|
|
13892
14257
|
...props
|
|
13893
14258
|
};
|
|
13894
14259
|
const goodItem = useRef(null);
|
|
@@ -13905,19 +14270,19 @@ const Popover = (props) => {
|
|
|
13905
14270
|
const [popoverContent, setPopoverContent] = useState("");
|
|
13906
14271
|
const [popoverArrow, setPopoverArrow] = useState("");
|
|
13907
14272
|
useEffect(() => {
|
|
13908
|
-
setClasses(
|
|
13909
|
-
setPopoverContent(
|
|
13910
|
-
setPopoverArrow(
|
|
14273
|
+
setClasses(classesSelf());
|
|
14274
|
+
setPopoverContent(popoverContentSelf());
|
|
14275
|
+
setPopoverArrow(popoverArrowSelf());
|
|
13911
14276
|
}, [list, theme]);
|
|
13912
14277
|
const getStyle = () => {
|
|
13913
14278
|
const style2 = {};
|
|
13914
|
-
if (location
|
|
14279
|
+
if (location === "top") {
|
|
13915
14280
|
style2.bottom = elHeight + 20;
|
|
13916
14281
|
style2.left = 0;
|
|
13917
|
-
} else if (location
|
|
14282
|
+
} else if (location === "right") {
|
|
13918
14283
|
style2.top = 0;
|
|
13919
14284
|
style2.right = -elWidth - 20;
|
|
13920
|
-
} else if (location
|
|
14285
|
+
} else if (location === "left") {
|
|
13921
14286
|
style2.top = 0;
|
|
13922
14287
|
style2.left = -elWidth - 20;
|
|
13923
14288
|
} else {
|
|
@@ -13932,13 +14297,13 @@ const Popover = (props) => {
|
|
|
13932
14297
|
};
|
|
13933
14298
|
const getArrowStyle = () => {
|
|
13934
14299
|
const style2 = {};
|
|
13935
|
-
if (location
|
|
14300
|
+
if (location === "top") {
|
|
13936
14301
|
style2.bottom = -20;
|
|
13937
14302
|
style2.left = elWidth / 2;
|
|
13938
|
-
} else if (location
|
|
14303
|
+
} else if (location === "right") {
|
|
13939
14304
|
style2.top = 20;
|
|
13940
14305
|
style2.left = -20;
|
|
13941
|
-
} else if (location
|
|
14306
|
+
} else if (location === "left") {
|
|
13942
14307
|
style2.top = 20;
|
|
13943
14308
|
style2.right = -20;
|
|
13944
14309
|
} else {
|
|
@@ -13951,22 +14316,22 @@ const Popover = (props) => {
|
|
|
13951
14316
|
style2.right += "px";
|
|
13952
14317
|
return style2;
|
|
13953
14318
|
};
|
|
13954
|
-
const
|
|
14319
|
+
const classesSelf = () => {
|
|
13955
14320
|
const prefixCls = "nut-popover";
|
|
13956
14321
|
return `${prefixCls}
|
|
13957
14322
|
${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
13958
14323
|
};
|
|
13959
|
-
const
|
|
14324
|
+
const popoverContentSelf = () => {
|
|
13960
14325
|
const prefixCls = "popoverContent";
|
|
13961
14326
|
return `${prefixCls}
|
|
13962
14327
|
${location ? `${prefixCls}--${location}` : ""}`;
|
|
13963
14328
|
};
|
|
13964
|
-
const
|
|
14329
|
+
const popoverArrowSelf = () => {
|
|
13965
14330
|
const prefixCls = "popoverArrow";
|
|
13966
14331
|
return `${prefixCls}
|
|
13967
14332
|
${location ? `${prefixCls}--${location}` : ""}`;
|
|
13968
14333
|
};
|
|
13969
|
-
const
|
|
14334
|
+
const handleClick2 = (e2) => {
|
|
13970
14335
|
if (props.onClick) {
|
|
13971
14336
|
props.onClick(e2);
|
|
13972
14337
|
}
|
|
@@ -13978,7 +14343,7 @@ const Popover = (props) => {
|
|
|
13978
14343
|
}, /* @__PURE__ */ React__default.createElement(Trigger, {
|
|
13979
14344
|
forwardedRef: goodItem
|
|
13980
14345
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13981
|
-
onClick: (e2) =>
|
|
14346
|
+
onClick: (e2) => handleClick2(e2)
|
|
13982
14347
|
}, Array.isArray(children) ? children[0] : children, visible ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13983
14348
|
className: `${popoverContent}`,
|
|
13984
14349
|
style: getStyle()
|
|
@@ -13997,9 +14362,9 @@ const Popover = (props) => {
|
|
|
13997
14362
|
}, item.name));
|
|
13998
14363
|
})) : null)));
|
|
13999
14364
|
};
|
|
14000
|
-
Popover.defaultProps = defaultProps$
|
|
14365
|
+
Popover.defaultProps = defaultProps$k;
|
|
14001
14366
|
Popover.displayName = "NutPopover";
|
|
14002
|
-
const defaultProps$
|
|
14367
|
+
const defaultProps$j = {
|
|
14003
14368
|
width: "100px",
|
|
14004
14369
|
height: "100px",
|
|
14005
14370
|
row: 1,
|
|
@@ -14027,7 +14392,7 @@ const Skeleton = (props) => {
|
|
|
14027
14392
|
avatarShape,
|
|
14028
14393
|
...restProps
|
|
14029
14394
|
} = {
|
|
14030
|
-
...defaultProps$
|
|
14395
|
+
...defaultProps$j,
|
|
14031
14396
|
...props
|
|
14032
14397
|
};
|
|
14033
14398
|
const b2 = cn("skeleton");
|
|
@@ -14082,9 +14447,9 @@ const Skeleton = (props) => {
|
|
|
14082
14447
|
});
|
|
14083
14448
|
})))));
|
|
14084
14449
|
};
|
|
14085
|
-
Skeleton.defaultProps = defaultProps$
|
|
14450
|
+
Skeleton.defaultProps = defaultProps$j;
|
|
14086
14451
|
Skeleton.displayName = "NutSkeleton";
|
|
14087
|
-
const defaultProps$
|
|
14452
|
+
const defaultProps$i = {
|
|
14088
14453
|
showPlainText: false,
|
|
14089
14454
|
showDays: false,
|
|
14090
14455
|
paused: false,
|
|
@@ -14107,7 +14472,7 @@ const CountDown = (props) => {
|
|
|
14107
14472
|
onUpdate,
|
|
14108
14473
|
children,
|
|
14109
14474
|
...rest
|
|
14110
|
-
} = { ...defaultProps$
|
|
14475
|
+
} = { ...defaultProps$i, ...props };
|
|
14111
14476
|
const b2 = cn("countdown");
|
|
14112
14477
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
14113
14478
|
const stateRef = useRef({
|
|
@@ -14254,9 +14619,9 @@ const CountDown = (props) => {
|
|
|
14254
14619
|
className: b2("block")
|
|
14255
14620
|
}, resttime.s))));
|
|
14256
14621
|
};
|
|
14257
|
-
CountDown.defaultProps = defaultProps$
|
|
14622
|
+
CountDown.defaultProps = defaultProps$i;
|
|
14258
14623
|
CountDown.displayName = "NutCountDown";
|
|
14259
|
-
const defaultProps$
|
|
14624
|
+
const defaultProps$h = {
|
|
14260
14625
|
activeName: ["0"],
|
|
14261
14626
|
accordion: false,
|
|
14262
14627
|
icon: "",
|
|
@@ -14267,75 +14632,78 @@ const defaultProps$g = {
|
|
|
14267
14632
|
function areEqual(prevProps, nextProps) {
|
|
14268
14633
|
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
14269
14634
|
}
|
|
14270
|
-
const Collapse = memo(
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14275
|
-
|
|
14276
|
-
rotate,
|
|
14277
|
-
iconSize,
|
|
14278
|
-
iconColor,
|
|
14279
|
-
change
|
|
14280
|
-
} = {
|
|
14281
|
-
...defaultProps$g,
|
|
14282
|
-
...props
|
|
14283
|
-
};
|
|
14284
|
-
const childrenDom = React__default.Children.toArray(children);
|
|
14285
|
-
const [defaultOpenIndex, setDefaultOpenIndex] = useState([]);
|
|
14286
|
-
const handleActiveName = () => {
|
|
14287
|
-
let activeArr = [];
|
|
14288
|
-
if (!Array.isArray(activeName)) {
|
|
14289
|
-
activeArr.push(activeName.toString());
|
|
14290
|
-
} else {
|
|
14291
|
-
if (accordion && activeName.length > 1) {
|
|
14292
|
-
console.warn("\u624B\u98CE\u7434\u6A21\u5F0F\u4E0D\u652F\u6301\u4F20\u9012\u591A\u4E2A\u6253\u5F00\u9875\u7B7E");
|
|
14293
|
-
}
|
|
14294
|
-
const activeNameStr = activeName.map((item) => {
|
|
14295
|
-
return item.toString();
|
|
14296
|
-
});
|
|
14297
|
-
activeArr = [...activeNameStr];
|
|
14298
|
-
}
|
|
14299
|
-
return activeArr;
|
|
14300
|
-
};
|
|
14301
|
-
const colBem = cn("collapse");
|
|
14302
|
-
useEffect(() => {
|
|
14303
|
-
const activeArr = handleActiveName();
|
|
14304
|
-
setDefaultOpenIndex(activeArr);
|
|
14305
|
-
}, [activeName]);
|
|
14306
|
-
const onToggle = (isOpen, name) => {
|
|
14307
|
-
let newOpenIndex = [...defaultOpenIndex];
|
|
14308
|
-
if (isOpen) {
|
|
14309
|
-
const removeIndex = newOpenIndex.findIndex((value) => {
|
|
14310
|
-
return value === name;
|
|
14311
|
-
});
|
|
14312
|
-
newOpenIndex.splice(removeIndex, 1);
|
|
14313
|
-
} else {
|
|
14314
|
-
if (accordion) {
|
|
14315
|
-
newOpenIndex = [name];
|
|
14316
|
-
} else {
|
|
14317
|
-
newOpenIndex.push(name);
|
|
14318
|
-
}
|
|
14319
|
-
}
|
|
14320
|
-
setDefaultOpenIndex(newOpenIndex);
|
|
14321
|
-
change && change(!isOpen, name);
|
|
14322
|
-
};
|
|
14323
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14324
|
-
className: colBem()
|
|
14325
|
-
}, childrenDom.map((item) => {
|
|
14326
|
-
return React__default.cloneElement(item, {
|
|
14327
|
-
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
14328
|
-
onToggle: (isOpen, name) => onToggle(isOpen, name),
|
|
14635
|
+
const Collapse = memo(
|
|
14636
|
+
(props) => {
|
|
14637
|
+
const {
|
|
14638
|
+
children,
|
|
14639
|
+
activeName,
|
|
14640
|
+
accordion,
|
|
14329
14641
|
icon,
|
|
14330
14642
|
rotate,
|
|
14331
14643
|
iconSize,
|
|
14332
|
-
iconColor
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
14644
|
+
iconColor,
|
|
14645
|
+
change
|
|
14646
|
+
} = {
|
|
14647
|
+
...defaultProps$h,
|
|
14648
|
+
...props
|
|
14649
|
+
};
|
|
14650
|
+
const childrenDom = React__default.Children.toArray(children);
|
|
14651
|
+
const [defaultOpenIndex, setDefaultOpenIndex] = useState([]);
|
|
14652
|
+
const handleActiveName = () => {
|
|
14653
|
+
let activeArr = [];
|
|
14654
|
+
if (!Array.isArray(activeName)) {
|
|
14655
|
+
activeArr.push(activeName.toString());
|
|
14656
|
+
} else {
|
|
14657
|
+
if (accordion && activeName.length > 1) {
|
|
14658
|
+
console.warn("\u624B\u98CE\u7434\u6A21\u5F0F\u4E0D\u652F\u6301\u4F20\u9012\u591A\u4E2A\u6253\u5F00\u9875\u7B7E");
|
|
14659
|
+
}
|
|
14660
|
+
const activeNameStr = activeName.map((item) => {
|
|
14661
|
+
return item.toString();
|
|
14662
|
+
});
|
|
14663
|
+
activeArr = [...activeNameStr];
|
|
14664
|
+
}
|
|
14665
|
+
return activeArr;
|
|
14666
|
+
};
|
|
14667
|
+
const colBem = cn("collapse");
|
|
14668
|
+
useEffect(() => {
|
|
14669
|
+
const activeArr = handleActiveName();
|
|
14670
|
+
setDefaultOpenIndex(activeArr);
|
|
14671
|
+
}, [activeName]);
|
|
14672
|
+
const onToggle = (isOpen, name) => {
|
|
14673
|
+
let newOpenIndex = [...defaultOpenIndex];
|
|
14674
|
+
if (isOpen) {
|
|
14675
|
+
const removeIndex = newOpenIndex.findIndex((value) => {
|
|
14676
|
+
return value === name;
|
|
14677
|
+
});
|
|
14678
|
+
newOpenIndex.splice(removeIndex, 1);
|
|
14679
|
+
} else {
|
|
14680
|
+
if (accordion) {
|
|
14681
|
+
newOpenIndex = [name];
|
|
14682
|
+
} else {
|
|
14683
|
+
newOpenIndex.push(name);
|
|
14684
|
+
}
|
|
14685
|
+
}
|
|
14686
|
+
setDefaultOpenIndex(newOpenIndex);
|
|
14687
|
+
change && change(!isOpen, name);
|
|
14688
|
+
};
|
|
14689
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14690
|
+
className: colBem()
|
|
14691
|
+
}, childrenDom.map((item) => {
|
|
14692
|
+
return React__default.cloneElement(item, {
|
|
14693
|
+
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
14694
|
+
onToggle: (isOpen, name) => onToggle(isOpen, name),
|
|
14695
|
+
icon,
|
|
14696
|
+
rotate,
|
|
14697
|
+
iconSize,
|
|
14698
|
+
iconColor
|
|
14699
|
+
});
|
|
14700
|
+
}));
|
|
14701
|
+
},
|
|
14702
|
+
areEqual
|
|
14703
|
+
);
|
|
14704
|
+
Collapse.defaultProps = defaultProps$h;
|
|
14337
14705
|
Collapse.displayName = "NutCollapse";
|
|
14338
|
-
const defaultProps$
|
|
14706
|
+
const defaultProps$g = {
|
|
14339
14707
|
title: "",
|
|
14340
14708
|
name: "",
|
|
14341
14709
|
isOpen: false,
|
|
@@ -14369,7 +14737,7 @@ const CollapseItem = (props) => {
|
|
|
14369
14737
|
iconColor,
|
|
14370
14738
|
...rest
|
|
14371
14739
|
} = {
|
|
14372
|
-
...defaultProps$
|
|
14740
|
+
...defaultProps$g,
|
|
14373
14741
|
...props
|
|
14374
14742
|
};
|
|
14375
14743
|
const [domHeight, setDomHeight] = useState(-1);
|
|
@@ -14383,18 +14751,23 @@ const CollapseItem = (props) => {
|
|
|
14383
14751
|
setCurrHeight("auto");
|
|
14384
14752
|
setUpdate(!update2);
|
|
14385
14753
|
}, [children]);
|
|
14386
|
-
const measuredRef = useCallback(
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14754
|
+
const measuredRef = useCallback(
|
|
14755
|
+
(node) => {
|
|
14756
|
+
if (node !== null) {
|
|
14757
|
+
setDomHeight(node.getBoundingClientRect().height);
|
|
14758
|
+
}
|
|
14759
|
+
},
|
|
14760
|
+
[update2]
|
|
14761
|
+
);
|
|
14391
14762
|
useEffect(() => {
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14763
|
+
setTimeout(() => {
|
|
14764
|
+
if (domHeight !== -1) {
|
|
14765
|
+
isOpen ? setCurrHeight(`${domHeight}px`) : setCurrHeight("0px");
|
|
14766
|
+
}
|
|
14767
|
+
const newIconStyle = isOpen ? { transform: `translateY(-50%) rotate(${rotate}deg)` } : { transform: "translateY(-50%)" };
|
|
14768
|
+
setIconStyle(newIconStyle);
|
|
14769
|
+
}, 10);
|
|
14770
|
+
}, [isOpen, domHeight, rotate]);
|
|
14398
14771
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14399
14772
|
className: colBem(),
|
|
14400
14773
|
...rest
|
|
@@ -14407,13 +14780,13 @@ const CollapseItem = (props) => {
|
|
|
14407
14780
|
}
|
|
14408
14781
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14409
14782
|
className: colBem("title")
|
|
14410
|
-
}, titleIcon && titleIconPosition
|
|
14783
|
+
}, titleIcon && titleIconPosition === "left" && /* @__PURE__ */ React__default.createElement("b", {
|
|
14411
14784
|
className: colBem("title-icon-left")
|
|
14412
14785
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
14413
14786
|
name: titleIcon,
|
|
14414
14787
|
size: titleIconSize,
|
|
14415
14788
|
color: disabled ? "#C2C2C2" : titleIconColor
|
|
14416
|
-
})), title, titleIcon && titleIconPosition
|
|
14789
|
+
})), title, titleIcon && titleIconPosition === "right" && /* @__PURE__ */ React__default.createElement("b", {
|
|
14417
14790
|
className: colBem("title-icon-right")
|
|
14418
14791
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
14419
14792
|
name: titleIcon,
|
|
@@ -14438,9 +14811,9 @@ const CollapseItem = (props) => {
|
|
|
14438
14811
|
className: colBem("content-text")
|
|
14439
14812
|
}, children)));
|
|
14440
14813
|
};
|
|
14441
|
-
CollapseItem.defaultProps = defaultProps$
|
|
14814
|
+
CollapseItem.defaultProps = defaultProps$g;
|
|
14442
14815
|
CollapseItem.displayName = "NutCollapseItem";
|
|
14443
|
-
const defaultProps$
|
|
14816
|
+
const defaultProps$f = {
|
|
14444
14817
|
maxLen: 0,
|
|
14445
14818
|
endNumber: "",
|
|
14446
14819
|
delaySpeed: 300,
|
|
@@ -14458,7 +14831,7 @@ const CountUp = (props) => {
|
|
|
14458
14831
|
thousands,
|
|
14459
14832
|
...reset
|
|
14460
14833
|
} = {
|
|
14461
|
-
...defaultProps$
|
|
14834
|
+
...defaultProps$f,
|
|
14462
14835
|
...props
|
|
14463
14836
|
};
|
|
14464
14837
|
const b2 = cn("countup");
|
|
@@ -14474,8 +14847,12 @@ const CountUp = (props) => {
|
|
|
14474
14847
|
const numerArr = getShowNumber();
|
|
14475
14848
|
const setNumberTransform = () => {
|
|
14476
14849
|
if (countupRef.current) {
|
|
14477
|
-
const numberItems = countupRef.current.querySelectorAll(
|
|
14478
|
-
|
|
14850
|
+
const numberItems = countupRef.current.querySelectorAll(
|
|
14851
|
+
".nut-countup__number"
|
|
14852
|
+
);
|
|
14853
|
+
const numberFilterArr = numerArr.filter(
|
|
14854
|
+
(item) => !Number.isNaN(Number(item))
|
|
14855
|
+
);
|
|
14479
14856
|
Object.keys(numberItems).forEach((key) => {
|
|
14480
14857
|
const elem = numberItems[Number(key)];
|
|
14481
14858
|
const idx = Number(numberFilterArr[Number(key)]);
|
|
@@ -14524,9 +14901,9 @@ const CountUp = (props) => {
|
|
|
14524
14901
|
}, item));
|
|
14525
14902
|
})));
|
|
14526
14903
|
};
|
|
14527
|
-
CountUp.defaultProps = defaultProps$
|
|
14904
|
+
CountUp.defaultProps = defaultProps$f;
|
|
14528
14905
|
CountUp.displayName = "NutCountUp";
|
|
14529
|
-
const defaultProps$
|
|
14906
|
+
const defaultProps$e = {};
|
|
14530
14907
|
class AnimatingNumbers extends Component {
|
|
14531
14908
|
constructor(props) {
|
|
14532
14909
|
super(props);
|
|
@@ -14538,7 +14915,7 @@ class AnimatingNumbers extends Component {
|
|
|
14538
14915
|
});
|
|
14539
14916
|
}
|
|
14540
14917
|
}
|
|
14541
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
14918
|
+
AnimatingNumbers.defaultProps = defaultProps$e;
|
|
14542
14919
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
14543
14920
|
AnimatingNumbers.CountUp = CountUp;
|
|
14544
14921
|
AnimatingNumbers.CountUp = CountUp;
|
|
@@ -14547,7 +14924,7 @@ const defaultStatus = {
|
|
|
14547
14924
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
14548
14925
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
14549
14926
|
};
|
|
14550
|
-
const defaultProps$
|
|
14927
|
+
const defaultProps$d = {
|
|
14551
14928
|
description: "\u65E0\u5185\u5BB9",
|
|
14552
14929
|
image: "empty",
|
|
14553
14930
|
imageSize: "",
|
|
@@ -14555,9 +14932,9 @@ const defaultProps$c = {
|
|
|
14555
14932
|
};
|
|
14556
14933
|
const Empty = (props) => {
|
|
14557
14934
|
const { locale } = useConfig();
|
|
14558
|
-
defaultProps$
|
|
14935
|
+
defaultProps$d.description = locale.noData || defaultProps$d.description;
|
|
14559
14936
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
14560
|
-
...defaultProps$
|
|
14937
|
+
...defaultProps$d,
|
|
14561
14938
|
...props
|
|
14562
14939
|
};
|
|
14563
14940
|
const [imgStyle, setImgStyle] = useState({});
|
|
@@ -14592,14 +14969,14 @@ const Empty = (props) => {
|
|
|
14592
14969
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14593
14970
|
className: `${b2()} ${className}`,
|
|
14594
14971
|
...rest
|
|
14595
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14972
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
14596
14973
|
className: b2("image"),
|
|
14597
14974
|
style: imgStyle
|
|
14598
14975
|
}, imageNode), typeof description === "string" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
14599
14976
|
className: b2("description")
|
|
14600
|
-
}, description) : { description }, children);
|
|
14977
|
+
}, description) : { description }, children));
|
|
14601
14978
|
};
|
|
14602
|
-
Empty.defaultProps = defaultProps$
|
|
14979
|
+
Empty.defaultProps = defaultProps$d;
|
|
14603
14980
|
Empty.displayName = "NutEmpty";
|
|
14604
14981
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
14605
14982
|
let index2 = 0;
|
|
@@ -14712,7 +15089,7 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
14712
15089
|
}
|
|
14713
15090
|
});
|
|
14714
15091
|
};
|
|
14715
|
-
const defaultProps$
|
|
15092
|
+
const defaultProps$c = {};
|
|
14716
15093
|
const VirtualList = (props) => {
|
|
14717
15094
|
const {
|
|
14718
15095
|
sourceData = [],
|
|
@@ -14871,8 +15248,131 @@ const VirtualList = (props) => {
|
|
|
14871
15248
|
}) : data);
|
|
14872
15249
|
}))));
|
|
14873
15250
|
};
|
|
14874
|
-
VirtualList.defaultProps = defaultProps$
|
|
15251
|
+
VirtualList.defaultProps = defaultProps$c;
|
|
14875
15252
|
VirtualList.displayName = "NutVirtualList";
|
|
15253
|
+
const defaultProps$b = {
|
|
15254
|
+
className: "",
|
|
15255
|
+
style: {},
|
|
15256
|
+
columns: [],
|
|
15257
|
+
data: [],
|
|
15258
|
+
bordered: true,
|
|
15259
|
+
striped: false,
|
|
15260
|
+
noData: "\u65E0\u6570\u636E"
|
|
15261
|
+
};
|
|
15262
|
+
const Table = (props) => {
|
|
15263
|
+
const { locale } = useConfig();
|
|
15264
|
+
defaultProps$b.noData = locale.noData;
|
|
15265
|
+
const {
|
|
15266
|
+
children,
|
|
15267
|
+
className,
|
|
15268
|
+
style,
|
|
15269
|
+
columns,
|
|
15270
|
+
data,
|
|
15271
|
+
bordered,
|
|
15272
|
+
summary,
|
|
15273
|
+
striped,
|
|
15274
|
+
noData,
|
|
15275
|
+
onSorter,
|
|
15276
|
+
...rest
|
|
15277
|
+
} = {
|
|
15278
|
+
...defaultProps$b,
|
|
15279
|
+
...props
|
|
15280
|
+
};
|
|
15281
|
+
const [curData, setCurData] = useState(data);
|
|
15282
|
+
useEffect(() => {
|
|
15283
|
+
if (data && String(data) !== String(curData)) {
|
|
15284
|
+
setCurData(data);
|
|
15285
|
+
}
|
|
15286
|
+
}, [data]);
|
|
15287
|
+
const b2 = cn("table");
|
|
15288
|
+
const classes = classNames({});
|
|
15289
|
+
const cls = classNames(b2(), classes, className);
|
|
15290
|
+
const handleSorterClick = (item) => {
|
|
15291
|
+
if (item.sorter) {
|
|
15292
|
+
onSorter && onSorter(item, curData);
|
|
15293
|
+
if (typeof item.sorter === "function") {
|
|
15294
|
+
setCurData(curData.sort(item.sorter));
|
|
15295
|
+
} else {
|
|
15296
|
+
setCurData(item.sorter === "default" ? curData.sort() : curData);
|
|
15297
|
+
}
|
|
15298
|
+
}
|
|
15299
|
+
};
|
|
15300
|
+
const cellClasses = (item) => {
|
|
15301
|
+
return {
|
|
15302
|
+
"nut-table__main__head__tr--border": props.bordered,
|
|
15303
|
+
[`nut-table__main__head__tr--align${item.align ? item.align : ""}`]: true
|
|
15304
|
+
};
|
|
15305
|
+
};
|
|
15306
|
+
const getColumnItem = (value) => {
|
|
15307
|
+
return columns.filter((item) => item.key === value)[0];
|
|
15308
|
+
};
|
|
15309
|
+
const renderHeadCells = () => {
|
|
15310
|
+
return columns.map((item, index2) => {
|
|
15311
|
+
return /* @__PURE__ */ React__default.createElement("span", {
|
|
15312
|
+
className: classNames(
|
|
15313
|
+
"nut-table__main__head__tr__th",
|
|
15314
|
+
cellClasses(item)
|
|
15315
|
+
),
|
|
15316
|
+
key: item.key,
|
|
15317
|
+
onClick: () => handleSorterClick(item)
|
|
15318
|
+
}, item.title, item.sorter && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
15319
|
+
name: "down-arrow",
|
|
15320
|
+
size: "12px"
|
|
15321
|
+
}));
|
|
15322
|
+
});
|
|
15323
|
+
};
|
|
15324
|
+
const sortDataItem = () => {
|
|
15325
|
+
return columns.map((columns2) => {
|
|
15326
|
+
return [columns2.key, columns2.render];
|
|
15327
|
+
});
|
|
15328
|
+
};
|
|
15329
|
+
const renderBodyTds = (item) => {
|
|
15330
|
+
return sortDataItem().map(([value, render], index2) => {
|
|
15331
|
+
return /* @__PURE__ */ React__default.createElement("span", {
|
|
15332
|
+
className: classNames(
|
|
15333
|
+
"nut-table__main__body__tr__td",
|
|
15334
|
+
cellClasses(getColumnItem(value))
|
|
15335
|
+
),
|
|
15336
|
+
key: value
|
|
15337
|
+
}, typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ React__default.createElement("div", null, render ? render(item) : item[value](item)) : item[value]);
|
|
15338
|
+
});
|
|
15339
|
+
};
|
|
15340
|
+
const renderBoyTrs = () => {
|
|
15341
|
+
return curData.map((item, index2) => {
|
|
15342
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15343
|
+
className: "nut-table__main__body__tr",
|
|
15344
|
+
key: index2
|
|
15345
|
+
}, renderBodyTds(item));
|
|
15346
|
+
});
|
|
15347
|
+
};
|
|
15348
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15349
|
+
className: cls,
|
|
15350
|
+
style,
|
|
15351
|
+
...rest
|
|
15352
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15353
|
+
className: classNames("nut-table__main", {
|
|
15354
|
+
"nut-table__main--striped": striped
|
|
15355
|
+
})
|
|
15356
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15357
|
+
className: "nut-table__main__head"
|
|
15358
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15359
|
+
className: "nut-table__main__head__tr"
|
|
15360
|
+
}, renderHeadCells())), /* @__PURE__ */ React__default.createElement("div", {
|
|
15361
|
+
className: "nut-table__main__body"
|
|
15362
|
+
}, renderBoyTrs())), summary && /* @__PURE__ */ React__default.createElement("div", {
|
|
15363
|
+
className: "nut-table__summary"
|
|
15364
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
15365
|
+
className: "nut-table__summary__text"
|
|
15366
|
+
}, summary)), curData.length === 0 && /* @__PURE__ */ React__default.createElement("div", {
|
|
15367
|
+
className: "nut-table__nodata"
|
|
15368
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15369
|
+
className: "nut-table__nodata"
|
|
15370
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15371
|
+
className: "nut-table__nodata__text"
|
|
15372
|
+
}, noData))));
|
|
15373
|
+
};
|
|
15374
|
+
Table.defaultProps = defaultProps$b;
|
|
15375
|
+
Table.displayName = "NutTable";
|
|
14876
15376
|
const defaultProps$a = {
|
|
14877
15377
|
source: {
|
|
14878
15378
|
type: {},
|
|
@@ -15131,7 +15631,8 @@ const ExistRender = (props) => {
|
|
|
15131
15631
|
}, existAddress.map((item, index2) => {
|
|
15132
15632
|
return /* @__PURE__ */ React__default.createElement("li", {
|
|
15133
15633
|
className: b2("exist-item"),
|
|
15134
|
-
key: index2
|
|
15634
|
+
key: index2
|
|
15635
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15135
15636
|
onClick: () => selectedExist(item)
|
|
15136
15637
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
15137
15638
|
className: b2("exist-item-icon"),
|
|
@@ -15148,7 +15649,7 @@ const ExistRender = (props) => {
|
|
|
15148
15649
|
className: "exist-item-info-phone"
|
|
15149
15650
|
}, item.phone)), /* @__PURE__ */ React__default.createElement("div", {
|
|
15150
15651
|
className: "exist-item-info-bottom"
|
|
15151
|
-
}, /* @__PURE__ */ React__default.createElement("div", null, item.provinceName + item.cityName + item.countyName + item.townName + item.addressDetail))));
|
|
15652
|
+
}, /* @__PURE__ */ React__default.createElement("div", null, item.provinceName + item.cityName + item.countyName + item.townName + item.addressDetail)))));
|
|
15152
15653
|
}))), isShowCustomAddress && /* @__PURE__ */ React__default.createElement("div", {
|
|
15153
15654
|
className: b2("choose-other"),
|
|
15154
15655
|
onClick: switchModule
|
|
@@ -15157,6 +15658,7 @@ const ExistRender = (props) => {
|
|
|
15157
15658
|
}, locale.address.chooseAnotherAddress || customAndExistTitle)));
|
|
15158
15659
|
};
|
|
15159
15660
|
const defaultProps$7 = {
|
|
15661
|
+
modelValue: [],
|
|
15160
15662
|
type: "custom",
|
|
15161
15663
|
province: [],
|
|
15162
15664
|
city: [],
|
|
@@ -15169,6 +15671,7 @@ const CustomRender = (props) => {
|
|
|
15169
15671
|
const {
|
|
15170
15672
|
children,
|
|
15171
15673
|
type,
|
|
15674
|
+
modelValue,
|
|
15172
15675
|
height,
|
|
15173
15676
|
province,
|
|
15174
15677
|
city,
|
|
@@ -15201,7 +15704,9 @@ const CustomRender = (props) => {
|
|
|
15201
15704
|
return [];
|
|
15202
15705
|
data.forEach((item) => {
|
|
15203
15706
|
if (!item.title) {
|
|
15204
|
-
console.error(
|
|
15707
|
+
console.error(
|
|
15708
|
+
"[NutUI] <Address> \u8BF7\u68C0\u67E5\u6570\u7EC4\u9009\u9879\u7684 title \u503C\u662F\u5426\u6709\u8BBE\u7F6E ,title \u4E3A\u5FC5\u586B\u9879 ."
|
|
15709
|
+
);
|
|
15205
15710
|
}
|
|
15206
15711
|
});
|
|
15207
15712
|
const newData = [];
|
|
@@ -15209,7 +15714,9 @@ const CustomRender = (props) => {
|
|
|
15209
15714
|
return a.title.localeCompare(b22.title);
|
|
15210
15715
|
});
|
|
15211
15716
|
data.forEach((item) => {
|
|
15212
|
-
const index2 = newData.findIndex(
|
|
15717
|
+
const index2 = newData.findIndex(
|
|
15718
|
+
(value) => value.title === item.title
|
|
15719
|
+
);
|
|
15213
15720
|
if (index2 <= -1) {
|
|
15214
15721
|
newData.push({
|
|
15215
15722
|
title: item.title,
|
|
@@ -15231,9 +15738,7 @@ const CustomRender = (props) => {
|
|
|
15231
15738
|
town: isCustom2() ? transformData(town) : town
|
|
15232
15739
|
});
|
|
15233
15740
|
const [selectedRegion, setSelectedRegion] = useState({
|
|
15234
|
-
province: {
|
|
15235
|
-
name: ""
|
|
15236
|
-
},
|
|
15741
|
+
province: { name: "" },
|
|
15237
15742
|
city: { name: "" },
|
|
15238
15743
|
country: { name: "" },
|
|
15239
15744
|
town: { name: "" }
|
|
@@ -15265,26 +15770,28 @@ const CustomRender = (props) => {
|
|
|
15265
15770
|
const calBack = {
|
|
15266
15771
|
next: "",
|
|
15267
15772
|
value: "",
|
|
15268
|
-
custom: tabName[tabIndex]
|
|
15269
|
-
selectedRegion: {}
|
|
15270
|
-
};
|
|
15271
|
-
setSelectedRegion({
|
|
15272
|
-
...selectedRegion,
|
|
15273
|
-
[tabName[tabIndex]]: item
|
|
15274
|
-
});
|
|
15275
|
-
calBack.selectedRegion = {
|
|
15276
|
-
...selectedRegion,
|
|
15277
|
-
[tabName[tabIndex]]: item
|
|
15773
|
+
custom: tabName[tabIndex]
|
|
15278
15774
|
};
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15775
|
+
const bbselectedRegion = selectedRegion ? { ...selectedRegion } : null;
|
|
15776
|
+
if (bbselectedRegion) {
|
|
15777
|
+
setSelectedRegion({
|
|
15778
|
+
...bbselectedRegion,
|
|
15779
|
+
[tabName[tabIndex]]: item
|
|
15780
|
+
});
|
|
15284
15781
|
calBack.selectedRegion = {
|
|
15285
|
-
...
|
|
15286
|
-
[tabName[
|
|
15782
|
+
...bbselectedRegion,
|
|
15783
|
+
[tabName[tabIndex]]: item
|
|
15287
15784
|
};
|
|
15785
|
+
for (let i = tabIndex; i < tabIndex - 1; i++) {
|
|
15786
|
+
setSelectedRegion({
|
|
15787
|
+
...bbselectedRegion,
|
|
15788
|
+
[tabName[i + 1]]: null
|
|
15789
|
+
});
|
|
15790
|
+
calBack.selectedRegion = {
|
|
15791
|
+
...bbselectedRegion,
|
|
15792
|
+
[tabName[i + 1]]: {}
|
|
15793
|
+
};
|
|
15794
|
+
}
|
|
15288
15795
|
}
|
|
15289
15796
|
if (tabIndex < 4) {
|
|
15290
15797
|
if (tabIndex === 3) {
|
|
@@ -15307,6 +15814,39 @@ const CustomRender = (props) => {
|
|
|
15307
15814
|
}
|
|
15308
15815
|
onTabClick && onTabClick(key);
|
|
15309
15816
|
};
|
|
15817
|
+
const initCustomSelected = () => {
|
|
15818
|
+
if (modelValue.length > 0) {
|
|
15819
|
+
let tagIndex = 0;
|
|
15820
|
+
const selectedRegionC = selectedRegion && Object.assign(selectedRegion);
|
|
15821
|
+
for (let index2 = 0; index2 < modelValue.length; index2++) {
|
|
15822
|
+
if (regionList[tabName[index2]].length === 0) {
|
|
15823
|
+
tagIndex = index2 - 1;
|
|
15824
|
+
setTabIndex(index2 - 1);
|
|
15825
|
+
break;
|
|
15826
|
+
} else {
|
|
15827
|
+
const val = modelValue[index2];
|
|
15828
|
+
const arr = regionList[tabName[index2]];
|
|
15829
|
+
if (privateType === "custom") {
|
|
15830
|
+
selectedRegionC[[tabName[index2]]] = arr.filter(
|
|
15831
|
+
(item) => item.id === val
|
|
15832
|
+
)[0];
|
|
15833
|
+
} else if (privateType === "custom2") {
|
|
15834
|
+
const sumArr = [];
|
|
15835
|
+
arr.forEach((item) => {
|
|
15836
|
+
sumArr.push(...item.list);
|
|
15837
|
+
});
|
|
15838
|
+
selectedRegionC[[tabName[index2]]] = sumArr.filter(
|
|
15839
|
+
(item) => item.id === val
|
|
15840
|
+
)[0];
|
|
15841
|
+
}
|
|
15842
|
+
tagIndex = index2;
|
|
15843
|
+
setSelectedRegion(selectedRegionC);
|
|
15844
|
+
}
|
|
15845
|
+
}
|
|
15846
|
+
setTabIndex(tagIndex);
|
|
15847
|
+
lineAnimation(tagIndex);
|
|
15848
|
+
}
|
|
15849
|
+
};
|
|
15310
15850
|
const handleElevatorItem = (key, item) => {
|
|
15311
15851
|
nextAreaList(item);
|
|
15312
15852
|
};
|
|
@@ -15338,18 +15878,30 @@ const CustomRender = (props) => {
|
|
|
15338
15878
|
town: isCustom2() ? transformData(town2) : town2
|
|
15339
15879
|
});
|
|
15340
15880
|
}, [town]);
|
|
15881
|
+
useEffect(() => {
|
|
15882
|
+
initCustomSelected();
|
|
15883
|
+
}, [modelValue]);
|
|
15341
15884
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15342
15885
|
className: b2("custom")
|
|
15343
15886
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15344
15887
|
className: b2("region-tab")
|
|
15345
|
-
}, Object.keys(selectedRegion).map(
|
|
15346
|
-
|
|
15347
|
-
|
|
15348
|
-
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
|
|
15352
|
-
|
|
15888
|
+
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
15889
|
+
(key, index2) => {
|
|
15890
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15891
|
+
className: `${b2("tab-item")} ${index2 === tabIndex ? "active" : ""}`,
|
|
15892
|
+
key: index2,
|
|
15893
|
+
ref: mapRef[key],
|
|
15894
|
+
onClick: () => changeRegionTab(
|
|
15895
|
+
selectedRegion[key],
|
|
15896
|
+
index2,
|
|
15897
|
+
key
|
|
15898
|
+
)
|
|
15899
|
+
}, index2 <= tabIndex && /* @__PURE__ */ React__default.createElement("div", null, getTabName(
|
|
15900
|
+
selectedRegion[key],
|
|
15901
|
+
index2
|
|
15902
|
+
)));
|
|
15903
|
+
}
|
|
15904
|
+
), /* @__PURE__ */ React__default.createElement("div", {
|
|
15353
15905
|
className: b2("tab-line"),
|
|
15354
15906
|
ref: regionLine,
|
|
15355
15907
|
style: { left: `${lineDistance}px` }
|
|
@@ -15357,18 +15909,23 @@ const CustomRender = (props) => {
|
|
|
15357
15909
|
className: b2("region-con")
|
|
15358
15910
|
}, /* @__PURE__ */ React__default.createElement("ul", {
|
|
15359
15911
|
className: b2("region-group")
|
|
15360
|
-
}, regionList[tabName[tabIndex]].map(
|
|
15361
|
-
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15912
|
+
}, regionList[tabName[tabIndex]].map(
|
|
15913
|
+
(item, index2) => {
|
|
15914
|
+
return /* @__PURE__ */ React__default.createElement("li", {
|
|
15915
|
+
key: index2,
|
|
15916
|
+
className: b2("region-item")
|
|
15917
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15918
|
+
onClick: () => {
|
|
15919
|
+
nextAreaList(item);
|
|
15920
|
+
}
|
|
15921
|
+
}, selectedRegion && selectedRegion[tabName[tabIndex]].id === item.id && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
15922
|
+
className: b2("region-item--icon"),
|
|
15923
|
+
name: "Check",
|
|
15924
|
+
color: "#FA2C19",
|
|
15925
|
+
size: "13px"
|
|
15926
|
+
}), item.name));
|
|
15927
|
+
}
|
|
15928
|
+
))), privateType === "custom2" && /* @__PURE__ */ React__default.createElement("div", {
|
|
15372
15929
|
className: b2("elevator-group")
|
|
15373
15930
|
}, /* @__PURE__ */ React__default.createElement(Elevator, {
|
|
15374
15931
|
height,
|
|
@@ -15378,6 +15935,7 @@ const CustomRender = (props) => {
|
|
|
15378
15935
|
};
|
|
15379
15936
|
const defaultProps$6 = {
|
|
15380
15937
|
modelValue: false,
|
|
15938
|
+
modelSelect: [],
|
|
15381
15939
|
type: "custom",
|
|
15382
15940
|
customAddressTitle: "\u8BF7\u9009\u62E9\u6240\u5728\u5730\u533A",
|
|
15383
15941
|
province: [],
|
|
@@ -15398,6 +15956,7 @@ const Address = (props) => {
|
|
|
15398
15956
|
const { locale } = useConfig();
|
|
15399
15957
|
const {
|
|
15400
15958
|
modelValue,
|
|
15959
|
+
modelSelect,
|
|
15401
15960
|
children,
|
|
15402
15961
|
type,
|
|
15403
15962
|
height,
|
|
@@ -15445,8 +16004,7 @@ const Address = (props) => {
|
|
|
15445
16004
|
const callbackParams = {
|
|
15446
16005
|
next: item.next,
|
|
15447
16006
|
value: item.value,
|
|
15448
|
-
custom: item.custom
|
|
15449
|
-
selectedRegion: {}
|
|
16007
|
+
custom: item.custom
|
|
15450
16008
|
};
|
|
15451
16009
|
setSelectedRegion({
|
|
15452
16010
|
...item.selectedRegion
|
|
@@ -15454,7 +16012,6 @@ const Address = (props) => {
|
|
|
15454
16012
|
onChange && onChange(callbackParams);
|
|
15455
16013
|
};
|
|
15456
16014
|
const selectedExist = (prevExistAdd, item, copyExistAdd) => {
|
|
15457
|
-
console.log(prevExistAdd, item, copyExistAdd);
|
|
15458
16015
|
setSelectedExistAddress(item);
|
|
15459
16016
|
onSelected && onSelected(prevExistAdd, item, copyExistAdd);
|
|
15460
16017
|
handClose();
|
|
@@ -15466,7 +16023,6 @@ const Address = (props) => {
|
|
|
15466
16023
|
[tabName[i]]: {}
|
|
15467
16024
|
});
|
|
15468
16025
|
}
|
|
15469
|
-
console.log(selectedRegion);
|
|
15470
16026
|
};
|
|
15471
16027
|
const closeFun = () => {
|
|
15472
16028
|
const resCopy = {
|
|
@@ -15475,7 +16031,11 @@ const Address = (props) => {
|
|
|
15475
16031
|
...selectedRegion
|
|
15476
16032
|
};
|
|
15477
16033
|
const res = {
|
|
15478
|
-
data: {
|
|
16034
|
+
data: {
|
|
16035
|
+
addressIdStr: "",
|
|
16036
|
+
addressStr: "",
|
|
16037
|
+
...selectedRegion
|
|
16038
|
+
},
|
|
15479
16039
|
type: privateType
|
|
15480
16040
|
};
|
|
15481
16041
|
if (privateType === "custom" || privateType === "custom2") {
|
|
@@ -15547,6 +16107,7 @@ const Address = (props) => {
|
|
|
15547
16107
|
style: { ...style },
|
|
15548
16108
|
...rest
|
|
15549
16109
|
}, headerRender(), (privateType === "custom" || privateType === "custom2") && /* @__PURE__ */ React__default.createElement(CustomRender, {
|
|
16110
|
+
modelValue: modelSelect,
|
|
15550
16111
|
type: privateType,
|
|
15551
16112
|
province,
|
|
15552
16113
|
city,
|
|
@@ -15870,7 +16431,9 @@ const TimeDetail = (props) => {
|
|
|
15870
16431
|
const b2 = cn("timedetail");
|
|
15871
16432
|
const [renderData, setRenderData] = useState([]);
|
|
15872
16433
|
useEffect(() => {
|
|
15873
|
-
const currentData = times.find(
|
|
16434
|
+
const currentData = times.find(
|
|
16435
|
+
(timesItem) => String(timesItem.key) === String(currentKey)
|
|
16436
|
+
);
|
|
15874
16437
|
const renderData2 = currentData ? currentData.list : [];
|
|
15875
16438
|
setRenderData(renderData2);
|
|
15876
16439
|
}, [times, currentKey]);
|
|
@@ -15879,7 +16442,9 @@ const TimeDetail = (props) => {
|
|
|
15879
16442
|
};
|
|
15880
16443
|
const getDetailClass = (item) => {
|
|
15881
16444
|
let initClass = "nut-timedetail__item";
|
|
15882
|
-
const curTimeData = currentTime.find(
|
|
16445
|
+
const curTimeData = currentTime.find(
|
|
16446
|
+
(item2) => String(item2.key) === String(currentKey)
|
|
16447
|
+
);
|
|
15883
16448
|
if (curTimeData && curTimeData.list && curTimeData.list.includes(item)) {
|
|
15884
16449
|
initClass += " nut-timedetail__item-active";
|
|
15885
16450
|
}
|
|
@@ -15927,12 +16492,14 @@ const TimeSelect = (props) => {
|
|
|
15927
16492
|
...props
|
|
15928
16493
|
};
|
|
15929
16494
|
const [activeKey, setActiveKey] = useState(currentKey);
|
|
15930
|
-
const [activeTime, setActiveTime] = useState(
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
16495
|
+
const [activeTime, setActiveTime] = useState(
|
|
16496
|
+
currentTime.length ? currentTime : [
|
|
16497
|
+
{
|
|
16498
|
+
key: currentKey,
|
|
16499
|
+
list: []
|
|
16500
|
+
}
|
|
16501
|
+
]
|
|
16502
|
+
);
|
|
15936
16503
|
const [popVisible, setPopVisible] = useState(visible);
|
|
15937
16504
|
const popStyle = {
|
|
15938
16505
|
width: "100%",
|
|
@@ -15952,7 +16519,9 @@ const TimeSelect = (props) => {
|
|
|
15952
16519
|
break;
|
|
15953
16520
|
}
|
|
15954
16521
|
}
|
|
15955
|
-
const curTimeIndex = curTimeData.list.findIndex(
|
|
16522
|
+
const curTimeIndex = curTimeData.list.findIndex(
|
|
16523
|
+
(item) => String(item) === String(time)
|
|
16524
|
+
);
|
|
15956
16525
|
if (curTimeIndex === -1) {
|
|
15957
16526
|
curTimeData.list.push(time);
|
|
15958
16527
|
} else {
|
|
@@ -15968,7 +16537,9 @@ const TimeSelect = (props) => {
|
|
|
15968
16537
|
if (String(pannelKey) !== String(activeKey)) {
|
|
15969
16538
|
setActiveKey == null ? void 0 : setActiveKey(pannelKey);
|
|
15970
16539
|
if (multiple) {
|
|
15971
|
-
const curTimeDataIndex = activeTime.findIndex(
|
|
16540
|
+
const curTimeDataIndex = activeTime.findIndex(
|
|
16541
|
+
(item) => String(item.key) === String(pannelKey)
|
|
16542
|
+
);
|
|
15972
16543
|
if (curTimeDataIndex === -1) {
|
|
15973
16544
|
resultTimeData.push({
|
|
15974
16545
|
key: pannelKey,
|
|
@@ -16028,4 +16599,4 @@ const TimeSelect = (props) => {
|
|
|
16028
16599
|
};
|
|
16029
16600
|
TimeSelect.defaultProps = defaultProps;
|
|
16030
16601
|
TimeSelect.displayName = "NutTimeSelect";
|
|
16031
|
-
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, NumberKeyboard, Overlay, Pagination, Picker, Popover, Popup, Price, Progress, Radio, RadioGroup, Range, Rate, Row, SearchBar, ShortPassword, Signature, Skeleton, Step, Steps, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };
|
|
16602
|
+
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, NumberKeyboard, Overlay, Pagination, Picker, Popover, Popup, Price, Progress, Radio, RadioGroup, Range, Rate, Row, SearchBar, ShortPassword, SideNavBar, SideNavBarItem, Signature, Skeleton, Step, Steps, SubSideNavBar, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Table, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };
|