@nutui/nutui-react-taro 1.3.2-beta.0 → 1.3.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/DatePicker.js +8 -5
- package/dist/esm/Picker.js +5 -4
- package/dist/esm/datepicker.taro-318e9561.js +364 -0
- package/dist/esm/nutui-react.es.js +3 -4
- package/dist/esm/{picker.taro-6b663b69.js → picker.taro-62ce13e0.js} +14 -1
- 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 +365 -1034
- package/dist/nutui.react.umd.js +366 -1035
- package/dist/style.es.js +1 -1
- package/dist/types/picker/pickerSlot.taro.d.ts +1 -1
- package/package.json +1 -1
- package/dist/esm/datepicker.taro-440e6da6.js +0 -923
- package/dist/esm/useRefs-032cf186.js +0 -313
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.2-beta.
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.2-beta.1 Wed Sep 07 2022 14:19:34 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
classname.exports = classname_production_min;
|
|
74
74
|
}
|
|
75
75
|
const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
76
|
-
const defaultProps$
|
|
76
|
+
const defaultProps$1o = {
|
|
77
77
|
name: "",
|
|
78
78
|
size: "",
|
|
79
79
|
classPrefix: "nut-icon",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
onClick,
|
|
102
102
|
...rest
|
|
103
103
|
} = {
|
|
104
|
-
...defaultProps$
|
|
104
|
+
...defaultProps$1o,
|
|
105
105
|
...props
|
|
106
106
|
};
|
|
107
107
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
children
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
Icon$1.defaultProps = defaultProps$
|
|
138
|
+
Icon$1.defaultProps = defaultProps$1o;
|
|
139
139
|
Icon$1.displayName = "NutIcon";
|
|
140
|
-
const defaultProps$
|
|
140
|
+
const defaultProps$1n = {
|
|
141
141
|
className: "",
|
|
142
142
|
color: "",
|
|
143
143
|
shape: "round",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
style,
|
|
171
171
|
...rest
|
|
172
172
|
} = {
|
|
173
|
-
...defaultProps$
|
|
173
|
+
...defaultProps$1n,
|
|
174
174
|
...props
|
|
175
175
|
};
|
|
176
176
|
const getStyle = React.useCallback(() => {
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
name: icon
|
|
244
244
|
}) : "", children));
|
|
245
245
|
};
|
|
246
|
-
Button$1.defaultProps = defaultProps$
|
|
246
|
+
Button$1.defaultProps = defaultProps$1n;
|
|
247
247
|
Button$1.displayName = "NutButton";
|
|
248
248
|
function _setPrototypeOf(o, p2) {
|
|
249
249
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
@@ -1461,7 +1461,7 @@
|
|
|
1461
1461
|
function useHistory() {
|
|
1462
1462
|
return useContext(historyContext);
|
|
1463
1463
|
}
|
|
1464
|
-
const defaultProps$
|
|
1464
|
+
const defaultProps$1m = {
|
|
1465
1465
|
title: null,
|
|
1466
1466
|
subTitle: null,
|
|
1467
1467
|
desc: "",
|
|
@@ -1501,7 +1501,7 @@
|
|
|
1501
1501
|
linkSlot,
|
|
1502
1502
|
...rest
|
|
1503
1503
|
} = {
|
|
1504
|
-
...defaultProps$
|
|
1504
|
+
...defaultProps$1m,
|
|
1505
1505
|
...props
|
|
1506
1506
|
};
|
|
1507
1507
|
const b2 = cn("cell");
|
|
@@ -1554,9 +1554,9 @@
|
|
|
1554
1554
|
className: b2("link")
|
|
1555
1555
|
}) : linkSlot));
|
|
1556
1556
|
};
|
|
1557
|
-
Cell.defaultProps = defaultProps$
|
|
1557
|
+
Cell.defaultProps = defaultProps$1m;
|
|
1558
1558
|
Cell.displayName = "NutCell";
|
|
1559
|
-
const defaultProps$
|
|
1559
|
+
const defaultProps$1l = {
|
|
1560
1560
|
title: "",
|
|
1561
1561
|
desc: "",
|
|
1562
1562
|
titleSlot: null,
|
|
@@ -1565,7 +1565,7 @@
|
|
|
1565
1565
|
};
|
|
1566
1566
|
const CellGroup = (props) => {
|
|
1567
1567
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1568
|
-
...defaultProps$
|
|
1568
|
+
...defaultProps$1l,
|
|
1569
1569
|
...props
|
|
1570
1570
|
};
|
|
1571
1571
|
const b2 = cn("cell-group");
|
|
@@ -1579,7 +1579,7 @@
|
|
|
1579
1579
|
className: b2("wrap")
|
|
1580
1580
|
}, children));
|
|
1581
1581
|
};
|
|
1582
|
-
CellGroup.defaultProps = defaultProps$
|
|
1582
|
+
CellGroup.defaultProps = defaultProps$1l;
|
|
1583
1583
|
CellGroup.displayName = "NutCellGroup";
|
|
1584
1584
|
var classnames = { exports: {} };
|
|
1585
1585
|
/*!
|
|
@@ -1629,7 +1629,7 @@
|
|
|
1629
1629
|
})();
|
|
1630
1630
|
})(classnames);
|
|
1631
1631
|
var classNames = classnames.exports;
|
|
1632
|
-
const defaultOverlayProps
|
|
1632
|
+
const defaultOverlayProps = {
|
|
1633
1633
|
zIndex: 2e3,
|
|
1634
1634
|
duration: 0.3,
|
|
1635
1635
|
overlayClass: "",
|
|
@@ -1638,7 +1638,7 @@
|
|
|
1638
1638
|
lockScroll: true,
|
|
1639
1639
|
overlayStyle: {}
|
|
1640
1640
|
};
|
|
1641
|
-
const Overlay
|
|
1641
|
+
const Overlay = (props) => {
|
|
1642
1642
|
const {
|
|
1643
1643
|
children,
|
|
1644
1644
|
zIndex,
|
|
@@ -1650,7 +1650,7 @@
|
|
|
1650
1650
|
overlayStyle,
|
|
1651
1651
|
...rest
|
|
1652
1652
|
} = {
|
|
1653
|
-
...defaultOverlayProps
|
|
1653
|
+
...defaultOverlayProps,
|
|
1654
1654
|
...props
|
|
1655
1655
|
};
|
|
1656
1656
|
const [show, setShow] = React.useState(visible);
|
|
@@ -1706,8 +1706,8 @@
|
|
|
1706
1706
|
onClick: handleClick2
|
|
1707
1707
|
}, children));
|
|
1708
1708
|
};
|
|
1709
|
-
Overlay
|
|
1710
|
-
Overlay
|
|
1709
|
+
Overlay.defaultProps = defaultOverlayProps;
|
|
1710
|
+
Overlay.displayName = "NutOverlay";
|
|
1711
1711
|
function hasClass(element, className) {
|
|
1712
1712
|
if (element.classList)
|
|
1713
1713
|
return !!className && element.classList.contains(className);
|
|
@@ -2132,7 +2132,7 @@
|
|
|
2132
2132
|
};
|
|
2133
2133
|
CSSTransition.propTypes = {};
|
|
2134
2134
|
var CSSTransition$1 = CSSTransition;
|
|
2135
|
-
const defaultProps$
|
|
2135
|
+
const defaultProps$1k = {
|
|
2136
2136
|
position: "center",
|
|
2137
2137
|
transition: "",
|
|
2138
2138
|
style: {},
|
|
@@ -2158,10 +2158,10 @@
|
|
|
2158
2158
|
},
|
|
2159
2159
|
onClickCloseIcon: (e2) => {
|
|
2160
2160
|
},
|
|
2161
|
-
...defaultOverlayProps
|
|
2161
|
+
...defaultOverlayProps
|
|
2162
2162
|
};
|
|
2163
|
-
let _zIndex
|
|
2164
|
-
const Popup
|
|
2163
|
+
let _zIndex = 2e3;
|
|
2164
|
+
const Popup = (props) => {
|
|
2165
2165
|
const {
|
|
2166
2166
|
children,
|
|
2167
2167
|
visible,
|
|
@@ -2191,7 +2191,7 @@
|
|
|
2191
2191
|
onClosed,
|
|
2192
2192
|
onClick
|
|
2193
2193
|
} = props;
|
|
2194
|
-
const [index2, setIndex] = React.useState(zIndex || _zIndex
|
|
2194
|
+
const [index2, setIndex] = React.useState(zIndex || _zIndex);
|
|
2195
2195
|
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
2196
2196
|
const [showChildren, setShowChildren] = React.useState(true);
|
|
2197
2197
|
const [transitionName, setTransitionName] = React.useState("");
|
|
@@ -2224,7 +2224,7 @@
|
|
|
2224
2224
|
const open = () => {
|
|
2225
2225
|
if (!innerVisible) {
|
|
2226
2226
|
setInnerVisible(true);
|
|
2227
|
-
setIndex(++_zIndex
|
|
2227
|
+
setIndex(++_zIndex);
|
|
2228
2228
|
}
|
|
2229
2229
|
if (destroyOnClose) {
|
|
2230
2230
|
setShowChildren(true);
|
|
@@ -2293,7 +2293,7 @@
|
|
|
2293
2293
|
})) : ""));
|
|
2294
2294
|
};
|
|
2295
2295
|
const renderNode = () => {
|
|
2296
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, overlay ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Overlay
|
|
2296
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, overlay ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
2297
2297
|
style: overlayStyles,
|
|
2298
2298
|
overlayClass,
|
|
2299
2299
|
visible: innerVisible,
|
|
@@ -2313,8 +2313,8 @@
|
|
|
2313
2313
|
}, [position]);
|
|
2314
2314
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderToContainer(teleport, renderNode()));
|
|
2315
2315
|
};
|
|
2316
|
-
Popup
|
|
2317
|
-
Popup
|
|
2316
|
+
Popup.defaultProps = defaultProps$1k;
|
|
2317
|
+
Popup.displayName = "NutPopup";
|
|
2318
2318
|
const zhCN = {
|
|
2319
2319
|
save: "\u4FDD\u5B58",
|
|
2320
2320
|
confirm: "\u786E\u8BA4",
|
|
@@ -2440,7 +2440,7 @@
|
|
|
2440
2440
|
completeText: "\u5237\u65B0\u6210\u529F"
|
|
2441
2441
|
}
|
|
2442
2442
|
};
|
|
2443
|
-
const defaultProps$
|
|
2443
|
+
const defaultProps$1j = {
|
|
2444
2444
|
locale: zhCN
|
|
2445
2445
|
};
|
|
2446
2446
|
const defaultConfigRef$1 = {
|
|
@@ -2457,7 +2457,7 @@
|
|
|
2457
2457
|
};
|
|
2458
2458
|
const ConfigContext$1 = React.createContext(null);
|
|
2459
2459
|
const ConfigProvider = (props) => {
|
|
2460
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
2460
|
+
const { children, ...config2 } = { ...defaultProps$1j, ...props };
|
|
2461
2461
|
const parentConfig = useConfig$1();
|
|
2462
2462
|
return /* @__PURE__ */ React__default["default"].createElement(ConfigContext$1.Provider, {
|
|
2463
2463
|
value: {
|
|
@@ -2466,25 +2466,25 @@
|
|
|
2466
2466
|
}
|
|
2467
2467
|
}, children);
|
|
2468
2468
|
};
|
|
2469
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
2469
|
+
ConfigProvider.defaultProps = defaultProps$1j;
|
|
2470
2470
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2471
|
-
const defaultProps$
|
|
2471
|
+
const defaultProps$1i = {};
|
|
2472
2472
|
const Layout = (props) => {
|
|
2473
|
-
({ ...defaultProps$
|
|
2473
|
+
({ ...defaultProps$1i, ...props });
|
|
2474
2474
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2475
2475
|
className: "nut-layout"
|
|
2476
2476
|
}, "Layout");
|
|
2477
2477
|
};
|
|
2478
|
-
Layout.defaultProps = defaultProps$
|
|
2478
|
+
Layout.defaultProps = defaultProps$1i;
|
|
2479
2479
|
Layout.displayName = "NutLayout";
|
|
2480
2480
|
const DataContext$2 = React.createContext({});
|
|
2481
|
-
const defaultProps$
|
|
2481
|
+
const defaultProps$1h = {
|
|
2482
2482
|
span: "24",
|
|
2483
2483
|
offset: "0",
|
|
2484
2484
|
gutter: "0"
|
|
2485
2485
|
};
|
|
2486
2486
|
const Col = (props) => {
|
|
2487
|
-
const { span, offset, children, onClick } = { ...defaultProps$
|
|
2487
|
+
const { span, offset, children, onClick } = { ...defaultProps$1h, ...props };
|
|
2488
2488
|
const [colName, setColName] = React.useState("");
|
|
2489
2489
|
const [colStyle, setColStyle] = React.useState({});
|
|
2490
2490
|
const { gutter } = React.useContext(DataContext$2);
|
|
@@ -2510,9 +2510,9 @@
|
|
|
2510
2510
|
}
|
|
2511
2511
|
}, children);
|
|
2512
2512
|
};
|
|
2513
|
-
Col.defaultProps = defaultProps$
|
|
2513
|
+
Col.defaultProps = defaultProps$1h;
|
|
2514
2514
|
Col.displayName = "NutCol";
|
|
2515
|
-
const defaultProps$
|
|
2515
|
+
const defaultProps$1g = {
|
|
2516
2516
|
type: "",
|
|
2517
2517
|
justify: "start",
|
|
2518
2518
|
align: "flex-start",
|
|
@@ -2521,7 +2521,7 @@
|
|
|
2521
2521
|
};
|
|
2522
2522
|
const Row = (props) => {
|
|
2523
2523
|
const { children, type, justify, align, wrap, gutter, onClick } = {
|
|
2524
|
-
...defaultProps$
|
|
2524
|
+
...defaultProps$1g,
|
|
2525
2525
|
...props
|
|
2526
2526
|
};
|
|
2527
2527
|
const prefixCls = "nut-row";
|
|
@@ -2555,9 +2555,9 @@
|
|
|
2555
2555
|
children
|
|
2556
2556
|
));
|
|
2557
2557
|
};
|
|
2558
|
-
Row.defaultProps = defaultProps$
|
|
2558
|
+
Row.defaultProps = defaultProps$1g;
|
|
2559
2559
|
Row.displayName = "NutRow";
|
|
2560
|
-
const defaultProps$
|
|
2560
|
+
const defaultProps$1f = {
|
|
2561
2561
|
contentPosition: "center",
|
|
2562
2562
|
dashed: false,
|
|
2563
2563
|
hairline: true,
|
|
@@ -2574,7 +2574,7 @@
|
|
|
2574
2574
|
direction,
|
|
2575
2575
|
...rest
|
|
2576
2576
|
} = {
|
|
2577
|
-
...defaultProps$
|
|
2577
|
+
...defaultProps$1f,
|
|
2578
2578
|
...props
|
|
2579
2579
|
};
|
|
2580
2580
|
const dividerBem = cn("divider");
|
|
@@ -2595,9 +2595,9 @@
|
|
|
2595
2595
|
...rest
|
|
2596
2596
|
}, children);
|
|
2597
2597
|
};
|
|
2598
|
-
Divider.defaultProps = defaultProps$
|
|
2598
|
+
Divider.defaultProps = defaultProps$1f;
|
|
2599
2599
|
Divider.displayName = "NutDivider";
|
|
2600
|
-
const defaultProps$
|
|
2600
|
+
const defaultProps$1e = {
|
|
2601
2601
|
columnNum: 4,
|
|
2602
2602
|
border: true,
|
|
2603
2603
|
gutter: 0,
|
|
@@ -2624,7 +2624,7 @@
|
|
|
2624
2624
|
iconColor,
|
|
2625
2625
|
className,
|
|
2626
2626
|
...rest
|
|
2627
|
-
} = { ...defaultProps$
|
|
2627
|
+
} = { ...defaultProps$1e, ...props };
|
|
2628
2628
|
const childrenDom = React__default["default"].Children.toArray(children);
|
|
2629
2629
|
const pxCheck2 = (value) => {
|
|
2630
2630
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -2663,9 +2663,9 @@
|
|
|
2663
2663
|
});
|
|
2664
2664
|
}));
|
|
2665
2665
|
};
|
|
2666
|
-
Grid.defaultProps = defaultProps$
|
|
2666
|
+
Grid.defaultProps = defaultProps$1e;
|
|
2667
2667
|
Grid.displayName = "NutGrid";
|
|
2668
|
-
const defaultProps$
|
|
2668
|
+
const defaultProps$1d = {
|
|
2669
2669
|
text: "",
|
|
2670
2670
|
icon: "",
|
|
2671
2671
|
iconSize: "",
|
|
@@ -2699,7 +2699,7 @@
|
|
|
2699
2699
|
reverse,
|
|
2700
2700
|
direction,
|
|
2701
2701
|
...rest
|
|
2702
|
-
} = { ...defaultProps$
|
|
2702
|
+
} = { ...defaultProps$1d, ...props };
|
|
2703
2703
|
const b2 = cn("grid-item");
|
|
2704
2704
|
const pxCheck2 = (value) => {
|
|
2705
2705
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -2739,9 +2739,9 @@
|
|
|
2739
2739
|
className: "nut-grid-item__text"
|
|
2740
2740
|
}, text), children && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children)));
|
|
2741
2741
|
};
|
|
2742
|
-
GridItem.defaultProps = defaultProps$
|
|
2742
|
+
GridItem.defaultProps = defaultProps$1d;
|
|
2743
2743
|
GridItem.displayName = "NutGridItem";
|
|
2744
|
-
const defaultProps$
|
|
2744
|
+
const defaultProps$1c = {
|
|
2745
2745
|
title: "",
|
|
2746
2746
|
desc: "",
|
|
2747
2747
|
leftShow: true,
|
|
@@ -2774,7 +2774,7 @@
|
|
|
2774
2774
|
onClickBack,
|
|
2775
2775
|
onClickRight
|
|
2776
2776
|
} = {
|
|
2777
|
-
...defaultProps$
|
|
2777
|
+
...defaultProps$1c,
|
|
2778
2778
|
...props
|
|
2779
2779
|
};
|
|
2780
2780
|
const b2 = cn("navbar");
|
|
@@ -2839,9 +2839,9 @@
|
|
|
2839
2839
|
className: `${b2("")}--placeholder`
|
|
2840
2840
|
}, renderWrapper()) : renderWrapper());
|
|
2841
2841
|
};
|
|
2842
|
-
NavBar.defaultProps = defaultProps$
|
|
2842
|
+
NavBar.defaultProps = defaultProps$1c;
|
|
2843
2843
|
NavBar.displayName = "NutNavBar";
|
|
2844
|
-
const defaultProps$
|
|
2844
|
+
const defaultProps$1b = {
|
|
2845
2845
|
fixednavClass: "nut-fixednav",
|
|
2846
2846
|
activeText: "",
|
|
2847
2847
|
unActiveText: "",
|
|
@@ -2867,7 +2867,7 @@
|
|
|
2867
2867
|
slotList,
|
|
2868
2868
|
slotBtn,
|
|
2869
2869
|
...rest
|
|
2870
|
-
} = { ...defaultProps$
|
|
2870
|
+
} = { ...defaultProps$1b, ...props };
|
|
2871
2871
|
const b2 = cn("fixednav");
|
|
2872
2872
|
const classes = classNames(
|
|
2873
2873
|
{
|
|
@@ -2887,7 +2887,7 @@
|
|
|
2887
2887
|
className: classes,
|
|
2888
2888
|
style: position,
|
|
2889
2889
|
...rest
|
|
2890
|
-
}, overlay && /* @__PURE__ */ React__default["default"].createElement(Overlay
|
|
2890
|
+
}, overlay && /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
2891
2891
|
visible,
|
|
2892
2892
|
zIndex: 200,
|
|
2893
2893
|
onClick: () => onUpdateValue(false)
|
|
@@ -2918,9 +2918,9 @@
|
|
|
2918
2918
|
className: "text"
|
|
2919
2919
|
}, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
|
|
2920
2920
|
};
|
|
2921
|
-
FixedNav.defaultProps = defaultProps$
|
|
2921
|
+
FixedNav.defaultProps = defaultProps$1b;
|
|
2922
2922
|
FixedNav.displayName = "NutFixedNav";
|
|
2923
|
-
const defaultProps$
|
|
2923
|
+
const defaultProps$1a = {
|
|
2924
2924
|
visible: 0,
|
|
2925
2925
|
bottom: false,
|
|
2926
2926
|
size: 20,
|
|
@@ -2945,7 +2945,7 @@
|
|
|
2945
2945
|
style,
|
|
2946
2946
|
tabSwitch
|
|
2947
2947
|
} = {
|
|
2948
|
-
...defaultProps$
|
|
2948
|
+
...defaultProps$1a,
|
|
2949
2949
|
...props
|
|
2950
2950
|
};
|
|
2951
2951
|
const b2 = cn("tabbar");
|
|
@@ -2980,9 +2980,9 @@
|
|
|
2980
2980
|
return React__default["default"].cloneElement(child, childProps);
|
|
2981
2981
|
}));
|
|
2982
2982
|
};
|
|
2983
|
-
Tabbar.defaultProps = defaultProps$
|
|
2983
|
+
Tabbar.defaultProps = defaultProps$1a;
|
|
2984
2984
|
Tabbar.displayName = "NutTabbar";
|
|
2985
|
-
const defaultProps$
|
|
2985
|
+
const defaultProps$19 = {
|
|
2986
2986
|
dot: false,
|
|
2987
2987
|
size: "",
|
|
2988
2988
|
classPrefix: "nutui-iconfont",
|
|
@@ -3014,7 +3014,7 @@
|
|
|
3014
3014
|
index: index2,
|
|
3015
3015
|
handleClick: handleClick2
|
|
3016
3016
|
} = {
|
|
3017
|
-
...defaultProps$
|
|
3017
|
+
...defaultProps$19,
|
|
3018
3018
|
...props
|
|
3019
3019
|
};
|
|
3020
3020
|
const b2 = cn("tabbar-item");
|
|
@@ -7993,7 +7993,7 @@
|
|
|
7993
7993
|
});
|
|
7994
7994
|
const animated = host.animated;
|
|
7995
7995
|
const elevatorContext$1 = React.createContext({});
|
|
7996
|
-
const defaultProps$
|
|
7996
|
+
const defaultProps$18 = {
|
|
7997
7997
|
height: "200px",
|
|
7998
7998
|
acceptKey: "title",
|
|
7999
7999
|
indexList: [],
|
|
@@ -8016,7 +8016,7 @@
|
|
|
8016
8016
|
children,
|
|
8017
8017
|
...rest
|
|
8018
8018
|
} = {
|
|
8019
|
-
...defaultProps$
|
|
8019
|
+
...defaultProps$18,
|
|
8020
8020
|
...props
|
|
8021
8021
|
};
|
|
8022
8022
|
const b2 = cn("elevator");
|
|
@@ -8204,9 +8204,9 @@
|
|
|
8204
8204
|
}, item[acceptKey]);
|
|
8205
8205
|
}))));
|
|
8206
8206
|
};
|
|
8207
|
-
Elevator$1.defaultProps = defaultProps$
|
|
8207
|
+
Elevator$1.defaultProps = defaultProps$18;
|
|
8208
8208
|
Elevator$1.displayName = "NutElevator";
|
|
8209
|
-
const defaultProps$
|
|
8209
|
+
const defaultProps$17 = {
|
|
8210
8210
|
defaultValue: 1,
|
|
8211
8211
|
mode: "multi",
|
|
8212
8212
|
prevText: "",
|
|
@@ -8223,7 +8223,7 @@
|
|
|
8223
8223
|
};
|
|
8224
8224
|
const Pagination = (props) => {
|
|
8225
8225
|
const { locale } = useConfig$1();
|
|
8226
|
-
({ ...defaultProps$
|
|
8226
|
+
({ ...defaultProps$17, ...props });
|
|
8227
8227
|
const {
|
|
8228
8228
|
modelValue,
|
|
8229
8229
|
mode,
|
|
@@ -8340,7 +8340,7 @@
|
|
|
8340
8340
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
8341
8341
|
}, nextText || locale.pagination.next));
|
|
8342
8342
|
};
|
|
8343
|
-
Pagination.defaultProps = defaultProps$
|
|
8343
|
+
Pagination.defaultProps = defaultProps$17;
|
|
8344
8344
|
Pagination.displayName = "NutPagination";
|
|
8345
8345
|
class Title {
|
|
8346
8346
|
constructor() {
|
|
@@ -8350,7 +8350,7 @@
|
|
|
8350
8350
|
this.index = 0;
|
|
8351
8351
|
}
|
|
8352
8352
|
}
|
|
8353
|
-
const defaultProps$
|
|
8353
|
+
const defaultProps$16 = {
|
|
8354
8354
|
value: 0,
|
|
8355
8355
|
color: "",
|
|
8356
8356
|
background: "",
|
|
@@ -8385,7 +8385,7 @@
|
|
|
8385
8385
|
className,
|
|
8386
8386
|
autoHeight,
|
|
8387
8387
|
...rest
|
|
8388
|
-
} = { ...defaultProps$
|
|
8388
|
+
} = { ...defaultProps$16, ...props };
|
|
8389
8389
|
const [currentItem, setCurrentItem] = React.useState({ index: 0 });
|
|
8390
8390
|
const titles = React.useRef([]);
|
|
8391
8391
|
React.useEffect(() => {
|
|
@@ -8497,9 +8497,9 @@
|
|
|
8497
8497
|
return React__default["default"].cloneElement(child, childProps);
|
|
8498
8498
|
})));
|
|
8499
8499
|
};
|
|
8500
|
-
Tabs.defaultProps = defaultProps$
|
|
8500
|
+
Tabs.defaultProps = defaultProps$16;
|
|
8501
8501
|
Tabs.displayName = "NutTabs";
|
|
8502
|
-
const defaultProps$
|
|
8502
|
+
const defaultProps$15 = {
|
|
8503
8503
|
title: "",
|
|
8504
8504
|
paneKey: "",
|
|
8505
8505
|
activeKey: "",
|
|
@@ -8507,7 +8507,7 @@
|
|
|
8507
8507
|
};
|
|
8508
8508
|
const TabPane = (props) => {
|
|
8509
8509
|
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
8510
|
-
...defaultProps$
|
|
8510
|
+
...defaultProps$15,
|
|
8511
8511
|
...props
|
|
8512
8512
|
};
|
|
8513
8513
|
const b2 = cn("tabpane");
|
|
@@ -8522,7 +8522,7 @@
|
|
|
8522
8522
|
className: classes
|
|
8523
8523
|
}, children);
|
|
8524
8524
|
};
|
|
8525
|
-
const defaultProps$
|
|
8525
|
+
const defaultProps$14 = {
|
|
8526
8526
|
size: 3,
|
|
8527
8527
|
current: 1,
|
|
8528
8528
|
block: false,
|
|
@@ -8542,7 +8542,7 @@
|
|
|
8542
8542
|
vertical,
|
|
8543
8543
|
...rest
|
|
8544
8544
|
} = {
|
|
8545
|
-
...defaultProps$
|
|
8545
|
+
...defaultProps$14,
|
|
8546
8546
|
...props
|
|
8547
8547
|
};
|
|
8548
8548
|
const b2 = cn("indicator");
|
|
@@ -8576,7 +8576,7 @@
|
|
|
8576
8576
|
...rest
|
|
8577
8577
|
}, renderEles());
|
|
8578
8578
|
};
|
|
8579
|
-
Indicator.defaultProps = defaultProps$
|
|
8579
|
+
Indicator.defaultProps = defaultProps$14;
|
|
8580
8580
|
Indicator.displayName = "NutIndicator";
|
|
8581
8581
|
const handleClick = (e2) => {
|
|
8582
8582
|
e2.stopPropagation();
|
|
@@ -8592,7 +8592,7 @@
|
|
|
8592
8592
|
}
|
|
8593
8593
|
};
|
|
8594
8594
|
const OffsetContext = React.createContext(20);
|
|
8595
|
-
const defaultProps$
|
|
8595
|
+
const defaultProps$13 = {
|
|
8596
8596
|
showhead: false,
|
|
8597
8597
|
position: "left",
|
|
8598
8598
|
width: "80%"
|
|
@@ -8610,11 +8610,11 @@
|
|
|
8610
8610
|
handleClose,
|
|
8611
8611
|
...rest
|
|
8612
8612
|
} = {
|
|
8613
|
-
...defaultProps$
|
|
8613
|
+
...defaultProps$13,
|
|
8614
8614
|
...props
|
|
8615
8615
|
};
|
|
8616
8616
|
const offset = props.offset ? Number(props.offset) : 20;
|
|
8617
|
-
return /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
8617
|
+
return /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
8618
8618
|
visible,
|
|
8619
8619
|
style: { width, height: "100%" },
|
|
8620
8620
|
position,
|
|
@@ -8638,14 +8638,14 @@
|
|
|
8638
8638
|
className: "nut-sidenavbar__content"
|
|
8639
8639
|
}, children))))));
|
|
8640
8640
|
};
|
|
8641
|
-
SideNavBar.defaultProps = defaultProps$
|
|
8641
|
+
SideNavBar.defaultProps = defaultProps$13;
|
|
8642
8642
|
SideNavBar.displayName = "NutSideNavBar";
|
|
8643
|
-
const defaultProps$
|
|
8643
|
+
const defaultProps$12 = {
|
|
8644
8644
|
open: true
|
|
8645
8645
|
};
|
|
8646
8646
|
const SubSideNavBar = (props) => {
|
|
8647
8647
|
const { title, ikey, children, titleClick, open, ...rest } = {
|
|
8648
|
-
...defaultProps$
|
|
8648
|
+
...defaultProps$12,
|
|
8649
8649
|
...props
|
|
8650
8650
|
};
|
|
8651
8651
|
const offset = React.useContext(OffsetContext);
|
|
@@ -8716,7 +8716,7 @@
|
|
|
8716
8716
|
...rest
|
|
8717
8717
|
}, title);
|
|
8718
8718
|
};
|
|
8719
|
-
const defaultProps$
|
|
8719
|
+
const defaultProps$11 = {
|
|
8720
8720
|
className: "",
|
|
8721
8721
|
style: {},
|
|
8722
8722
|
activeColor: "#F2270C",
|
|
@@ -8736,7 +8736,7 @@
|
|
|
8736
8736
|
activeColor,
|
|
8737
8737
|
...rest
|
|
8738
8738
|
} = {
|
|
8739
|
-
...defaultProps$
|
|
8739
|
+
...defaultProps$11,
|
|
8740
8740
|
...props
|
|
8741
8741
|
};
|
|
8742
8742
|
const parentRef = React.useRef(null);
|
|
@@ -8829,9 +8829,9 @@
|
|
|
8829
8829
|
})));
|
|
8830
8830
|
})), cloneChildren());
|
|
8831
8831
|
};
|
|
8832
|
-
Menu.defaultProps = defaultProps$
|
|
8832
|
+
Menu.defaultProps = defaultProps$11;
|
|
8833
8833
|
Menu.displayName = "NutMenu";
|
|
8834
|
-
const defaultProps$
|
|
8834
|
+
const defaultProps$10 = {
|
|
8835
8835
|
className: "",
|
|
8836
8836
|
style: {},
|
|
8837
8837
|
columns: 1,
|
|
@@ -8845,7 +8845,7 @@
|
|
|
8845
8845
|
};
|
|
8846
8846
|
const MenuItem = (props) => {
|
|
8847
8847
|
useConfig$1();
|
|
8848
|
-
const mergedProps = { ...defaultProps$
|
|
8848
|
+
const mergedProps = { ...defaultProps$10, ...props };
|
|
8849
8849
|
const {
|
|
8850
8850
|
className,
|
|
8851
8851
|
style,
|
|
@@ -8862,7 +8862,7 @@
|
|
|
8862
8862
|
inactiveTitleClass,
|
|
8863
8863
|
children
|
|
8864
8864
|
} = {
|
|
8865
|
-
...defaultProps$
|
|
8865
|
+
...defaultProps$10,
|
|
8866
8866
|
...props
|
|
8867
8867
|
};
|
|
8868
8868
|
const { activeColor, showPopup, parent, orderKey } = mergedProps;
|
|
@@ -8935,7 +8935,7 @@
|
|
|
8935
8935
|
})} ${className}`,
|
|
8936
8936
|
style: placeholderStyle(),
|
|
8937
8937
|
onClick: () => parent.toggleItemShow(orderKey)
|
|
8938
|
-
}), /* @__PURE__ */ React__default["default"].createElement(Overlay
|
|
8938
|
+
}), /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
8939
8939
|
overlayClass: "nut-menu__overlay",
|
|
8940
8940
|
style: getPosition(),
|
|
8941
8941
|
lockScroll: parent.lockScroll,
|
|
@@ -8982,7 +8982,7 @@
|
|
|
8982
8982
|
}, item.text));
|
|
8983
8983
|
}), children))));
|
|
8984
8984
|
};
|
|
8985
|
-
MenuItem.defaultProps = defaultProps$
|
|
8985
|
+
MenuItem.defaultProps = defaultProps$10;
|
|
8986
8986
|
MenuItem.displayName = "NutMenuItem";
|
|
8987
8987
|
const MIN_DISTANCE = 10;
|
|
8988
8988
|
function getDirection(x2, y2) {
|
|
@@ -9082,7 +9082,7 @@
|
|
|
9082
9082
|
const res = await element.getBoundingClientRect();
|
|
9083
9083
|
return res;
|
|
9084
9084
|
};
|
|
9085
|
-
const defaultProps
|
|
9085
|
+
const defaultProps$$ = {
|
|
9086
9086
|
name: "",
|
|
9087
9087
|
size: "",
|
|
9088
9088
|
classPrefix: "nut-icon",
|
|
@@ -9110,7 +9110,7 @@
|
|
|
9110
9110
|
onClick,
|
|
9111
9111
|
...rest
|
|
9112
9112
|
} = {
|
|
9113
|
-
...defaultProps
|
|
9113
|
+
...defaultProps$$,
|
|
9114
9114
|
...props
|
|
9115
9115
|
};
|
|
9116
9116
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -9144,7 +9144,7 @@
|
|
|
9144
9144
|
children
|
|
9145
9145
|
);
|
|
9146
9146
|
}
|
|
9147
|
-
Icon.defaultProps = defaultProps
|
|
9147
|
+
Icon.defaultProps = defaultProps$$;
|
|
9148
9148
|
Icon.displayName = "NutIcon";
|
|
9149
9149
|
let createRoot;
|
|
9150
9150
|
try {
|
|
@@ -9368,7 +9368,7 @@
|
|
|
9368
9368
|
}
|
|
9369
9369
|
}
|
|
9370
9370
|
};
|
|
9371
|
-
const defaultProps
|
|
9371
|
+
const defaultProps$_ = {
|
|
9372
9372
|
range: false,
|
|
9373
9373
|
hiddenRange: false,
|
|
9374
9374
|
hiddenTag: false,
|
|
@@ -9399,8 +9399,8 @@
|
|
|
9399
9399
|
change,
|
|
9400
9400
|
dragStart,
|
|
9401
9401
|
dragEnd
|
|
9402
|
-
} = { ...defaultProps
|
|
9403
|
-
let { min, max, step } = { ...defaultProps
|
|
9402
|
+
} = { ...defaultProps$_, ...props };
|
|
9403
|
+
let { min, max, step } = { ...defaultProps$_, ...props };
|
|
9404
9404
|
min = Number(min);
|
|
9405
9405
|
max = Number(max);
|
|
9406
9406
|
step = Number(step);
|
|
@@ -9735,7 +9735,7 @@
|
|
|
9735
9735
|
className: "max"
|
|
9736
9736
|
}, +max) : null);
|
|
9737
9737
|
};
|
|
9738
|
-
Range.defaultProps = defaultProps
|
|
9738
|
+
Range.defaultProps = defaultProps$_;
|
|
9739
9739
|
Range.displayName = "NutRange";
|
|
9740
9740
|
const Utils = {
|
|
9741
9741
|
isLeapYear(y2) {
|
|
@@ -9829,7 +9829,7 @@
|
|
|
9829
9829
|
};
|
|
9830
9830
|
}
|
|
9831
9831
|
var requestAniFrame$1 = requestAniFrame();
|
|
9832
|
-
const defaultProps$
|
|
9832
|
+
const defaultProps$Z = {
|
|
9833
9833
|
type: "one",
|
|
9834
9834
|
isAutoBackFill: false,
|
|
9835
9835
|
poppable: true,
|
|
@@ -9858,7 +9858,7 @@
|
|
|
9858
9858
|
onChoose,
|
|
9859
9859
|
onUpdate,
|
|
9860
9860
|
onClose
|
|
9861
|
-
} = { ...defaultProps$
|
|
9861
|
+
} = { ...defaultProps$Z, ...props };
|
|
9862
9862
|
const weeks = locale.calendaritem.weekdays;
|
|
9863
9863
|
const [yearMonthTitle, setYearMonthTitle] = React.useState("");
|
|
9864
9864
|
const [unLoadPrev, setUnLoadPrev] = React.useState(false);
|
|
@@ -10282,9 +10282,9 @@
|
|
|
10282
10282
|
onClick: confirm2
|
|
10283
10283
|
}, locale.confirm)) : ""));
|
|
10284
10284
|
};
|
|
10285
|
-
CalendarItem.defaultProps = defaultProps$
|
|
10285
|
+
CalendarItem.defaultProps = defaultProps$Z;
|
|
10286
10286
|
CalendarItem.displayName = "NutCalendarItem";
|
|
10287
|
-
const defaultProps$
|
|
10287
|
+
const defaultProps$Y = {
|
|
10288
10288
|
type: "one",
|
|
10289
10289
|
isAutoBackFill: false,
|
|
10290
10290
|
poppable: true,
|
|
@@ -10312,7 +10312,7 @@
|
|
|
10312
10312
|
endDate,
|
|
10313
10313
|
onClose,
|
|
10314
10314
|
onChoose
|
|
10315
|
-
} = { ...defaultProps$
|
|
10315
|
+
} = { ...defaultProps$Y, ...props };
|
|
10316
10316
|
const close = () => {
|
|
10317
10317
|
onClose && onClose();
|
|
10318
10318
|
};
|
|
@@ -10325,7 +10325,7 @@
|
|
|
10325
10325
|
const closePopup = () => {
|
|
10326
10326
|
close();
|
|
10327
10327
|
};
|
|
10328
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, poppable ? /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
10328
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, poppable ? /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
10329
10329
|
visible,
|
|
10330
10330
|
position: "bottom",
|
|
10331
10331
|
round: true,
|
|
@@ -10355,9 +10355,9 @@
|
|
|
10355
10355
|
onChoose: choose
|
|
10356
10356
|
}));
|
|
10357
10357
|
};
|
|
10358
|
-
Calendar.defaultProps = defaultProps$
|
|
10358
|
+
Calendar.defaultProps = defaultProps$Y;
|
|
10359
10359
|
Calendar.displayName = "NutCalendar";
|
|
10360
|
-
const defaultProps$
|
|
10360
|
+
const defaultProps$X = {
|
|
10361
10361
|
disabled: false,
|
|
10362
10362
|
checkedValue: [],
|
|
10363
10363
|
max: void 0,
|
|
@@ -10366,7 +10366,7 @@
|
|
|
10366
10366
|
};
|
|
10367
10367
|
const CheckboxGroup = React__default["default"].forwardRef(
|
|
10368
10368
|
(props, ref) => {
|
|
10369
|
-
const { children } = { ...defaultProps$
|
|
10369
|
+
const { children } = { ...defaultProps$X, ...props };
|
|
10370
10370
|
const b2 = cn("checkboxgroup");
|
|
10371
10371
|
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
10372
10372
|
const [innerDisabled, setInnerDisabled] = React.useState(disabled);
|
|
@@ -10445,9 +10445,9 @@
|
|
|
10445
10445
|
}, cloneChildren());
|
|
10446
10446
|
}
|
|
10447
10447
|
);
|
|
10448
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
10448
|
+
CheckboxGroup.defaultProps = defaultProps$X;
|
|
10449
10449
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
10450
|
-
const defaultProps$
|
|
10450
|
+
const defaultProps$W = {
|
|
10451
10451
|
checked: false,
|
|
10452
10452
|
disabled: false,
|
|
10453
10453
|
textPosition: "right",
|
|
@@ -10461,7 +10461,7 @@
|
|
|
10461
10461
|
}
|
|
10462
10462
|
};
|
|
10463
10463
|
const Checkbox = (props) => {
|
|
10464
|
-
const { children } = { ...defaultProps$
|
|
10464
|
+
const { children } = { ...defaultProps$W, ...props };
|
|
10465
10465
|
const b2 = cn("checkbox");
|
|
10466
10466
|
const {
|
|
10467
10467
|
iconName,
|
|
@@ -10541,355 +10541,95 @@
|
|
|
10541
10541
|
onClick: handleClick2
|
|
10542
10542
|
}, renderIcon(), renderLabel());
|
|
10543
10543
|
};
|
|
10544
|
-
Checkbox.defaultProps = defaultProps$
|
|
10544
|
+
Checkbox.defaultProps = defaultProps$W;
|
|
10545
10545
|
Checkbox.displayName = "NutCheckBox";
|
|
10546
10546
|
Checkbox.Group = CheckboxGroup;
|
|
10547
|
-
const
|
|
10548
|
-
zIndex: 2e3,
|
|
10549
|
-
duration: 0.3,
|
|
10550
|
-
overlayClass: "",
|
|
10551
|
-
closeOnClickOverlay: true,
|
|
10552
|
-
visible: false,
|
|
10553
|
-
lockScroll: true,
|
|
10554
|
-
overlayStyle: {}
|
|
10555
|
-
};
|
|
10556
|
-
const Overlay = (props) => {
|
|
10547
|
+
const InternalPickerSlot = (props, ref) => {
|
|
10557
10548
|
const {
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10549
|
+
keyIndex = 0,
|
|
10550
|
+
defaultValue,
|
|
10551
|
+
listData = [],
|
|
10552
|
+
threeDimensional = true,
|
|
10553
|
+
swipeDuration = 1e3,
|
|
10554
|
+
itemShow = false,
|
|
10555
|
+
chooseItem
|
|
10556
|
+
} = props;
|
|
10557
|
+
const touch = useTouch();
|
|
10558
|
+
const DEFAULT_DURATION = 200;
|
|
10559
|
+
const INERTIA_TIME = 300;
|
|
10560
|
+
const INERTIA_DISTANCE = 15;
|
|
10561
|
+
const [currIndex, setCurrIndex] = React.useState(1);
|
|
10562
|
+
const lineSpacing = React.useRef(36);
|
|
10563
|
+
const [touchTime, setTouchTime] = React.useState(0);
|
|
10564
|
+
const [touchDeg, setTouchDeg] = React.useState("0deg");
|
|
10565
|
+
const rotation = 20;
|
|
10566
|
+
const moving = React.useRef(false);
|
|
10567
|
+
let timer;
|
|
10568
|
+
const listbox = React.useRef(null);
|
|
10569
|
+
const rollerRef = React.useRef(null);
|
|
10570
|
+
const pickerSlotRef = React.useRef(null);
|
|
10571
|
+
const [startTime, setStartTime] = React.useState(0);
|
|
10572
|
+
const [startY, setStartY] = React.useState(0);
|
|
10573
|
+
const transformY = React.useRef(0);
|
|
10574
|
+
const [scrollDistance, setScrollDistance] = React.useState(0);
|
|
10575
|
+
const isHidden = (index2) => {
|
|
10576
|
+
if (index2 >= currIndex + 8 || index2 <= currIndex - 8) {
|
|
10577
|
+
return true;
|
|
10578
|
+
}
|
|
10579
|
+
return false;
|
|
10570
10580
|
};
|
|
10571
|
-
const
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
return () => {
|
|
10580
|
-
clearTimeout(intervalRef.current);
|
|
10581
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
10582
|
-
};
|
|
10583
|
-
}, []);
|
|
10584
|
-
const b2 = cn("overlay");
|
|
10585
|
-
const classes = classNames(
|
|
10586
|
-
{
|
|
10587
|
-
"overlay-fade-leave-active": !renderRef.current && !visible,
|
|
10588
|
-
"overlay-fade-enter-active": visible,
|
|
10589
|
-
"first-render": renderRef.current && !visible,
|
|
10590
|
-
"hidden-render": !visible
|
|
10591
|
-
},
|
|
10592
|
-
overlayClass,
|
|
10593
|
-
b2("")
|
|
10594
|
-
);
|
|
10595
|
-
const styles = {
|
|
10596
|
-
zIndex,
|
|
10597
|
-
animationDuration: `${props.duration}s`,
|
|
10598
|
-
...overlayStyle
|
|
10581
|
+
const setTransform = (translateY = 0, type, time = DEFAULT_DURATION, deg) => {
|
|
10582
|
+
let nTime = time;
|
|
10583
|
+
if (type !== "end") {
|
|
10584
|
+
nTime = 0;
|
|
10585
|
+
}
|
|
10586
|
+
setTouchTime(nTime);
|
|
10587
|
+
setTouchDeg(deg);
|
|
10588
|
+
setScrollDistance(translateY);
|
|
10599
10589
|
};
|
|
10600
|
-
const
|
|
10601
|
-
|
|
10602
|
-
|
|
10590
|
+
const setMove = (move, type, time) => {
|
|
10591
|
+
console.log("move");
|
|
10592
|
+
let updateMove = move + transformY.current;
|
|
10593
|
+
if (type === "end") {
|
|
10594
|
+
if (updateMove > 0) {
|
|
10595
|
+
updateMove = 0;
|
|
10596
|
+
}
|
|
10597
|
+
if (updateMove < -(listData.length - 1) * lineSpacing.current) {
|
|
10598
|
+
updateMove = -(listData.length - 1) * lineSpacing.current;
|
|
10599
|
+
}
|
|
10600
|
+
const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
|
|
10601
|
+
const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * rotation}deg`;
|
|
10602
|
+
setTransform(endMove, type, time, deg);
|
|
10603
|
+
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing.current)) + 1);
|
|
10603
10604
|
} else {
|
|
10604
|
-
|
|
10605
|
+
let deg = 0;
|
|
10606
|
+
const currentDeg = (-updateMove / lineSpacing.current + 1) * rotation;
|
|
10607
|
+
const maxDeg = (listData.length + 1) * rotation;
|
|
10608
|
+
const minDeg = 0;
|
|
10609
|
+
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
10610
|
+
if (minDeg < deg && deg < maxDeg) {
|
|
10611
|
+
setTransform(updateMove, "", void 0, `${deg}deg`);
|
|
10612
|
+
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing.current)) + 1);
|
|
10613
|
+
}
|
|
10605
10614
|
}
|
|
10606
10615
|
};
|
|
10607
|
-
const
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10616
|
+
const setChooseValue = (move) => {
|
|
10617
|
+
chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
10618
|
+
};
|
|
10619
|
+
const touchStart = (event) => {
|
|
10620
|
+
touch.start(event);
|
|
10621
|
+
setStartY(touch.deltaY);
|
|
10622
|
+
setStartTime(Date.now());
|
|
10623
|
+
transformY.current = scrollDistance;
|
|
10624
|
+
};
|
|
10625
|
+
const touchMove = (event) => {
|
|
10626
|
+
touch.move(event);
|
|
10627
|
+
if (touch.isVertical) {
|
|
10628
|
+
moving.current = true;
|
|
10629
|
+
preventDefault2(event, true);
|
|
10615
10630
|
}
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
className: classes,
|
|
10619
|
-
style: styles,
|
|
10620
|
-
...rest,
|
|
10621
|
-
onClick: handleClick2
|
|
10622
|
-
}, children));
|
|
10623
|
-
};
|
|
10624
|
-
Overlay.defaultProps = defaultOverlayProps;
|
|
10625
|
-
Overlay.displayName = "NutOverlay";
|
|
10626
|
-
const defaultProps$W = {
|
|
10627
|
-
position: "center",
|
|
10628
|
-
transition: "",
|
|
10629
|
-
style: {},
|
|
10630
|
-
popClass: "",
|
|
10631
|
-
closeable: false,
|
|
10632
|
-
closeIconPosition: "top-right",
|
|
10633
|
-
closeIcon: "close",
|
|
10634
|
-
destroyOnClose: true,
|
|
10635
|
-
teleport: null,
|
|
10636
|
-
overlay: true,
|
|
10637
|
-
round: false,
|
|
10638
|
-
onOpen: () => {
|
|
10639
|
-
},
|
|
10640
|
-
onClose: () => {
|
|
10641
|
-
},
|
|
10642
|
-
onClick: (e2) => {
|
|
10643
|
-
},
|
|
10644
|
-
onOpened: (e2) => {
|
|
10645
|
-
},
|
|
10646
|
-
onClosed: (e2) => {
|
|
10647
|
-
},
|
|
10648
|
-
onClickOverlay: (e2) => {
|
|
10649
|
-
},
|
|
10650
|
-
onClickCloseIcon: (e2) => {
|
|
10651
|
-
},
|
|
10652
|
-
...defaultOverlayProps
|
|
10653
|
-
};
|
|
10654
|
-
let _zIndex = 2e3;
|
|
10655
|
-
const Popup = (props) => {
|
|
10656
|
-
const {
|
|
10657
|
-
children,
|
|
10658
|
-
visible,
|
|
10659
|
-
overlay,
|
|
10660
|
-
closeOnClickOverlay,
|
|
10661
|
-
overlayStyle,
|
|
10662
|
-
overlayClass,
|
|
10663
|
-
zIndex,
|
|
10664
|
-
lockScroll,
|
|
10665
|
-
duration,
|
|
10666
|
-
closeable,
|
|
10667
|
-
closeIconPosition,
|
|
10668
|
-
closeIcon,
|
|
10669
|
-
style,
|
|
10670
|
-
transition,
|
|
10671
|
-
round,
|
|
10672
|
-
position,
|
|
10673
|
-
popClass,
|
|
10674
|
-
className,
|
|
10675
|
-
destroyOnClose,
|
|
10676
|
-
teleport,
|
|
10677
|
-
onOpen,
|
|
10678
|
-
onClose,
|
|
10679
|
-
onClickOverlay,
|
|
10680
|
-
onClickCloseIcon,
|
|
10681
|
-
onOpened,
|
|
10682
|
-
onClosed,
|
|
10683
|
-
onClick
|
|
10684
|
-
} = props;
|
|
10685
|
-
const [index2, setIndex] = React.useState(zIndex || _zIndex);
|
|
10686
|
-
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
10687
|
-
const [showChildren, setShowChildren] = React.useState(true);
|
|
10688
|
-
const [transitionName, setTransitionName] = React.useState("");
|
|
10689
|
-
const b2 = cn("popup");
|
|
10690
|
-
const baseStyle = {
|
|
10691
|
-
zIndex: index2,
|
|
10692
|
-
animationDuration: `${duration}s`
|
|
10693
|
-
};
|
|
10694
|
-
const overlayStyles = {
|
|
10695
|
-
...overlayStyle,
|
|
10696
|
-
...baseStyle
|
|
10697
|
-
};
|
|
10698
|
-
const popStyles = {
|
|
10699
|
-
...style,
|
|
10700
|
-
...baseStyle
|
|
10701
|
-
};
|
|
10702
|
-
const classes = classNames(
|
|
10703
|
-
{
|
|
10704
|
-
round,
|
|
10705
|
-
[`popup-${position}`]: true,
|
|
10706
|
-
[`${popClass}`]: true,
|
|
10707
|
-
[`${className}`]: true
|
|
10708
|
-
},
|
|
10709
|
-
b2("")
|
|
10710
|
-
);
|
|
10711
|
-
const closeClasses = classNames({
|
|
10712
|
-
"nutui-popup__close-icon": true,
|
|
10713
|
-
[`nutui-popup__close-icon--${closeIconPosition}`]: true
|
|
10714
|
-
});
|
|
10715
|
-
const open = () => {
|
|
10716
|
-
if (!innerVisible) {
|
|
10717
|
-
setInnerVisible(true);
|
|
10718
|
-
setIndex(++_zIndex);
|
|
10719
|
-
}
|
|
10720
|
-
if (destroyOnClose) {
|
|
10721
|
-
setShowChildren(true);
|
|
10722
|
-
}
|
|
10723
|
-
onOpen && onOpen();
|
|
10724
|
-
};
|
|
10725
|
-
const close = () => {
|
|
10726
|
-
if (innerVisible) {
|
|
10727
|
-
setInnerVisible(false);
|
|
10728
|
-
if (destroyOnClose) {
|
|
10729
|
-
setTimeout(() => {
|
|
10730
|
-
setShowChildren(false);
|
|
10731
|
-
onClose && onClose();
|
|
10732
|
-
}, Number(duration) * 1e3);
|
|
10733
|
-
}
|
|
10734
|
-
}
|
|
10735
|
-
};
|
|
10736
|
-
const onHandleClickOverlay = (e2) => {
|
|
10737
|
-
if (closeOnClickOverlay) {
|
|
10738
|
-
onClickOverlay && onClickOverlay(e2);
|
|
10739
|
-
close();
|
|
10740
|
-
}
|
|
10741
|
-
};
|
|
10742
|
-
const onHandleClick = (e2) => {
|
|
10743
|
-
onClick && onClick(e2);
|
|
10744
|
-
};
|
|
10745
|
-
const onHandleClickCloseIcon = (e2) => {
|
|
10746
|
-
onClickCloseIcon && onClickCloseIcon(e2);
|
|
10747
|
-
close();
|
|
10748
|
-
};
|
|
10749
|
-
const onHandleOpened = (e2) => {
|
|
10750
|
-
onOpened && onOpened(e2);
|
|
10751
|
-
};
|
|
10752
|
-
const onHandleClosed = (e2) => {
|
|
10753
|
-
onClosed && onClosed(e2);
|
|
10754
|
-
};
|
|
10755
|
-
const resolveContainer = (getContainer) => {
|
|
10756
|
-
const container = typeof getContainer === "function" ? getContainer() : getContainer;
|
|
10757
|
-
return container || document.body;
|
|
10758
|
-
};
|
|
10759
|
-
const renderToContainer = (getContainer, node) => {
|
|
10760
|
-
if (getContainer) {
|
|
10761
|
-
const container = resolveContainer(getContainer);
|
|
10762
|
-
return ReactDOM.createPortal(node, container);
|
|
10763
|
-
}
|
|
10764
|
-
return node;
|
|
10765
|
-
};
|
|
10766
|
-
const renderPop = () => {
|
|
10767
|
-
return /* @__PURE__ */ React__default["default"].createElement(CSSTransition$1, {
|
|
10768
|
-
classNames: transitionName,
|
|
10769
|
-
unmountOnExit: true,
|
|
10770
|
-
timeout: 500,
|
|
10771
|
-
in: innerVisible,
|
|
10772
|
-
onEntered: onHandleOpened,
|
|
10773
|
-
onExited: onHandleClosed
|
|
10774
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
10775
|
-
style: popStyles,
|
|
10776
|
-
className: classes,
|
|
10777
|
-
onClick: onHandleClick
|
|
10778
|
-
}, showChildren ? children : "", closeable ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
10779
|
-
className: closeClasses,
|
|
10780
|
-
onClick: onHandleClickCloseIcon
|
|
10781
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
10782
|
-
name: closeIcon,
|
|
10783
|
-
size: "12px"
|
|
10784
|
-
})) : ""));
|
|
10785
|
-
};
|
|
10786
|
-
const renderNode = () => {
|
|
10787
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, overlay ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
10788
|
-
style: overlayStyles,
|
|
10789
|
-
overlayClass,
|
|
10790
|
-
visible: innerVisible,
|
|
10791
|
-
closeOnClickOverlay,
|
|
10792
|
-
zIndex,
|
|
10793
|
-
lockScroll,
|
|
10794
|
-
duration,
|
|
10795
|
-
onClick: onHandleClickOverlay
|
|
10796
|
-
}), renderPop()) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderPop()));
|
|
10797
|
-
};
|
|
10798
|
-
React.useEffect(() => {
|
|
10799
|
-
visible && open();
|
|
10800
|
-
!visible && close();
|
|
10801
|
-
}, [visible]);
|
|
10802
|
-
React.useEffect(() => {
|
|
10803
|
-
setTransitionName(transition || `popup-slide-${position}`);
|
|
10804
|
-
}, [position]);
|
|
10805
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderToContainer(teleport, renderNode()));
|
|
10806
|
-
};
|
|
10807
|
-
Popup.defaultProps = defaultProps$W;
|
|
10808
|
-
Popup.displayName = "NutPopup";
|
|
10809
|
-
const InternalPickerSlot$1 = (props, ref) => {
|
|
10810
|
-
const {
|
|
10811
|
-
keyIndex = 0,
|
|
10812
|
-
defaultValue,
|
|
10813
|
-
listData = [],
|
|
10814
|
-
threeDimensional = true,
|
|
10815
|
-
swipeDuration = 1e3,
|
|
10816
|
-
chooseItem
|
|
10817
|
-
} = props;
|
|
10818
|
-
const touch = useTouch();
|
|
10819
|
-
const DEFAULT_DURATION = 200;
|
|
10820
|
-
const INERTIA_TIME = 300;
|
|
10821
|
-
const INERTIA_DISTANCE = 15;
|
|
10822
|
-
const [currIndex, setCurrIndex] = React.useState(1);
|
|
10823
|
-
const lineSpacing = 36;
|
|
10824
|
-
const [touchTime, setTouchTime] = React.useState(0);
|
|
10825
|
-
const [touchDeg, setTouchDeg] = React.useState("0deg");
|
|
10826
|
-
const rotation = 20;
|
|
10827
|
-
const moving = React.useRef(false);
|
|
10828
|
-
let timer;
|
|
10829
|
-
React.useRef(null);
|
|
10830
|
-
const rollerRef = React.useRef(null);
|
|
10831
|
-
const pickerSlotRef = React.useRef(null);
|
|
10832
|
-
const [startTime, setStartTime] = React.useState(0);
|
|
10833
|
-
const [startY, setStartY] = React.useState(0);
|
|
10834
|
-
const transformY = React.useRef(0);
|
|
10835
|
-
const [scrollDistance, setScrollDistance] = React.useState(0);
|
|
10836
|
-
const isHidden = (index2) => {
|
|
10837
|
-
if (index2 >= currIndex + 8 || index2 <= currIndex - 8) {
|
|
10838
|
-
return true;
|
|
10839
|
-
}
|
|
10840
|
-
return false;
|
|
10841
|
-
};
|
|
10842
|
-
const setTransform = (translateY = 0, type, time = DEFAULT_DURATION, deg) => {
|
|
10843
|
-
let nTime = time;
|
|
10844
|
-
if (type !== "end") {
|
|
10845
|
-
nTime = 0;
|
|
10846
|
-
}
|
|
10847
|
-
setTouchTime(nTime);
|
|
10848
|
-
setTouchDeg(deg);
|
|
10849
|
-
setScrollDistance(translateY);
|
|
10850
|
-
};
|
|
10851
|
-
const setMove = (move, type, time) => {
|
|
10852
|
-
let updateMove = move + transformY.current;
|
|
10853
|
-
if (type === "end") {
|
|
10854
|
-
if (updateMove > 0) {
|
|
10855
|
-
updateMove = 0;
|
|
10856
|
-
}
|
|
10857
|
-
if (updateMove < -(listData.length - 1) * lineSpacing) {
|
|
10858
|
-
updateMove = -(listData.length - 1) * lineSpacing;
|
|
10859
|
-
}
|
|
10860
|
-
const endMove = Math.round(updateMove / lineSpacing) * lineSpacing;
|
|
10861
|
-
const deg = `${(Math.abs(Math.round(endMove / lineSpacing)) + 1) * rotation}deg`;
|
|
10862
|
-
setTransform(endMove, type, time, deg);
|
|
10863
|
-
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing)) + 1);
|
|
10864
|
-
} else {
|
|
10865
|
-
let deg = 0;
|
|
10866
|
-
const currentDeg = (-updateMove / lineSpacing + 1) * rotation;
|
|
10867
|
-
const maxDeg = (listData.length + 1) * rotation;
|
|
10868
|
-
const minDeg = 0;
|
|
10869
|
-
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
10870
|
-
if (minDeg < deg && deg < maxDeg) {
|
|
10871
|
-
setTransform(updateMove, "", void 0, `${deg}deg`);
|
|
10872
|
-
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing)) + 1);
|
|
10873
|
-
}
|
|
10874
|
-
}
|
|
10875
|
-
};
|
|
10876
|
-
const setChooseValue = (move) => {
|
|
10877
|
-
chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing)], keyIndex);
|
|
10878
|
-
};
|
|
10879
|
-
const touchStart = (event) => {
|
|
10880
|
-
touch.start(event);
|
|
10881
|
-
setStartY(touch.deltaY);
|
|
10882
|
-
setStartTime(Date.now());
|
|
10883
|
-
transformY.current = scrollDistance;
|
|
10884
|
-
};
|
|
10885
|
-
const touchMove = (event) => {
|
|
10886
|
-
touch.move(event);
|
|
10887
|
-
if (touch.isVertical) {
|
|
10888
|
-
moving.current = true;
|
|
10889
|
-
preventDefault2(event, true);
|
|
10890
|
-
}
|
|
10891
|
-
const move = touch.deltaY - startY;
|
|
10892
|
-
setMove(move);
|
|
10631
|
+
const move = touch.deltaY - startY;
|
|
10632
|
+
setMove(move);
|
|
10893
10633
|
};
|
|
10894
10634
|
const touchEnd = (event) => {
|
|
10895
10635
|
if (!moving.current)
|
|
@@ -10931,7 +10671,7 @@
|
|
|
10931
10671
|
});
|
|
10932
10672
|
}
|
|
10933
10673
|
setCurrIndex(index2 === -1 ? 1 : index2 + 1);
|
|
10934
|
-
const move = index2 === -1 ? 0 : index2 * lineSpacing;
|
|
10674
|
+
const move = index2 === -1 ? 0 : index2 * lineSpacing.current;
|
|
10935
10675
|
type && setChooseValue(-move);
|
|
10936
10676
|
setMove(-move);
|
|
10937
10677
|
};
|
|
@@ -10948,11 +10688,17 @@
|
|
|
10948
10688
|
event.stopPropagation();
|
|
10949
10689
|
}
|
|
10950
10690
|
};
|
|
10951
|
-
const
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10691
|
+
const getReference = async () => {
|
|
10692
|
+
const refe = await getRectByTaro(listbox == null ? void 0 : listbox.current);
|
|
10693
|
+
console.log(refe);
|
|
10694
|
+
lineSpacing.current = refe.height ? refe.height : 36;
|
|
10695
|
+
modifyStatus(true);
|
|
10696
|
+
};
|
|
10697
|
+
const touchRollerStyle = () => {
|
|
10698
|
+
return {
|
|
10699
|
+
transition: `transform ${touchTime}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
10700
|
+
transform: `rotate3d(1, 0, 0, ${touchDeg})`
|
|
10701
|
+
};
|
|
10956
10702
|
};
|
|
10957
10703
|
const touchTileStyle = () => {
|
|
10958
10704
|
return {
|
|
@@ -10968,6 +10714,13 @@
|
|
|
10968
10714
|
clearTimeout(timer);
|
|
10969
10715
|
};
|
|
10970
10716
|
}, [listData]);
|
|
10717
|
+
React.useEffect(() => {
|
|
10718
|
+
if (itemShow) {
|
|
10719
|
+
setTimeout(() => {
|
|
10720
|
+
getReference();
|
|
10721
|
+
}, 200);
|
|
10722
|
+
}
|
|
10723
|
+
}, [itemShow]);
|
|
10971
10724
|
React.useImperativeHandle(ref, () => ({
|
|
10972
10725
|
stopMomentum,
|
|
10973
10726
|
moving: moving.current
|
|
@@ -10987,22 +10740,29 @@
|
|
|
10987
10740
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
10988
10741
|
className: `nut-picker-roller-item ${isHidden(index2 + 1) && "nut-picker-roller-item-hidden"}`,
|
|
10989
10742
|
style: {
|
|
10990
|
-
transform: `rotate3d(1, 0, 0, ${-rotation * (index2 + 1)}deg) translate3d(0px, 0px, 104px)
|
|
10743
|
+
transform: `rotate3d(1, 0, 0, ${-rotation * (index2 + 1)}deg) translate3d(0px, 0px, 104px)`,
|
|
10744
|
+
height: `${lineSpacing.current}px`,
|
|
10745
|
+
lineHeight: `${lineSpacing.current}px`
|
|
10991
10746
|
},
|
|
10992
10747
|
key: item.value ? item.value : index2
|
|
10993
10748
|
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.text ? item.text : item));
|
|
10994
10749
|
}), !threeDimensional && listData.map((item, index2) => {
|
|
10995
10750
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
10996
10751
|
className: "nut-picker-roller-item-tile",
|
|
10997
|
-
key: item.value ? item.value : index2
|
|
10752
|
+
key: item.value ? item.value : index2,
|
|
10753
|
+
style: {
|
|
10754
|
+
height: `${lineSpacing.current}px`,
|
|
10755
|
+
lineHeight: `${lineSpacing.current}px`
|
|
10756
|
+
}
|
|
10998
10757
|
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.text ? item.text : item));
|
|
10999
10758
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
11000
10759
|
className: "nut-picker-mask"
|
|
11001
10760
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
11002
|
-
className: "nut-picker-indicator"
|
|
10761
|
+
className: "nut-picker-indicator",
|
|
10762
|
+
ref: listbox
|
|
11003
10763
|
}));
|
|
11004
10764
|
};
|
|
11005
|
-
const PickerSlot
|
|
10765
|
+
const PickerSlot = React__default["default"].forwardRef(InternalPickerSlot);
|
|
11006
10766
|
function useRefs() {
|
|
11007
10767
|
const refs = React__default["default"].useRef([]);
|
|
11008
10768
|
const setRefs = React__default["default"].useCallback(
|
|
@@ -11017,21 +10777,8 @@
|
|
|
11017
10777
|
}, []);
|
|
11018
10778
|
return [refs.current, setRefs, reset];
|
|
11019
10779
|
}
|
|
11020
|
-
const
|
|
11021
|
-
|
|
11022
|
-
locale: zhCN
|
|
11023
|
-
}
|
|
11024
|
-
};
|
|
11025
|
-
const getDefaultConfig = () => {
|
|
11026
|
-
return defaultConfigRef.current;
|
|
11027
|
-
};
|
|
11028
|
-
const useConfig = () => {
|
|
11029
|
-
var _a;
|
|
11030
|
-
return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
11031
|
-
};
|
|
11032
|
-
const ConfigContext = React.createContext(null);
|
|
11033
|
-
const InternalPicker$1 = (props, ref) => {
|
|
11034
|
-
const { locale } = useConfig();
|
|
10780
|
+
const InternalPicker = (props, ref) => {
|
|
10781
|
+
const { locale } = useConfig$1();
|
|
11035
10782
|
const {
|
|
11036
10783
|
isVisible,
|
|
11037
10784
|
title,
|
|
@@ -11062,7 +10809,6 @@
|
|
|
11062
10809
|
}
|
|
11063
10810
|
}, [defaultValueData]);
|
|
11064
10811
|
React.useEffect(() => {
|
|
11065
|
-
console.log("\u4FEE\u6539");
|
|
11066
10812
|
onChange && onChange(columnIndex, chooseValueData, selectedOptions());
|
|
11067
10813
|
if (isConfirmEvent.current) {
|
|
11068
10814
|
isConfirmEvent.current = false;
|
|
@@ -11227,7 +10973,7 @@
|
|
|
11227
10973
|
className: b2("panel"),
|
|
11228
10974
|
ref: pickerRef
|
|
11229
10975
|
}, columnsList == null ? void 0 : columnsList.map((item, index2) => {
|
|
11230
|
-
return /* @__PURE__ */ React__default["default"].createElement(PickerSlot
|
|
10976
|
+
return /* @__PURE__ */ React__default["default"].createElement(PickerSlot, {
|
|
11231
10977
|
ref: setRefs(index2),
|
|
11232
10978
|
defaultValue: chooseValueData == null ? void 0 : chooseValueData[index2],
|
|
11233
10979
|
listData: item,
|
|
@@ -11235,11 +10981,12 @@
|
|
|
11235
10981
|
chooseItem: (value, index22) => chooseItem(value, index22),
|
|
11236
10982
|
swipeDuration,
|
|
11237
10983
|
key: index2,
|
|
11238
|
-
keyIndex: index2
|
|
10984
|
+
keyIndex: index2,
|
|
10985
|
+
itemShow: isVisible
|
|
11239
10986
|
});
|
|
11240
10987
|
}))));
|
|
11241
10988
|
};
|
|
11242
|
-
const Picker
|
|
10989
|
+
const Picker = React__default["default"].forwardRef(InternalPicker);
|
|
11243
10990
|
const currentYear = new Date().getFullYear();
|
|
11244
10991
|
const defaultProps$V = {
|
|
11245
10992
|
modelValue: null,
|
|
@@ -11525,7 +11272,7 @@
|
|
|
11525
11272
|
className: `nut-datepicker ${className || ""}`,
|
|
11526
11273
|
style,
|
|
11527
11274
|
...rest
|
|
11528
|
-
}, listData.length > 0 && /* @__PURE__ */ React__default["default"].createElement(Picker
|
|
11275
|
+
}, listData.length > 0 && /* @__PURE__ */ React__default["default"].createElement(Picker, {
|
|
11529
11276
|
isVisible: show,
|
|
11530
11277
|
listData,
|
|
11531
11278
|
onClose: onCloseDatePicker,
|
|
@@ -12135,565 +11882,136 @@
|
|
|
12135
11882
|
const renderIcon = () => {
|
|
12136
11883
|
const { iconName: iconName2, iconSize: iconSize2, iconActiveName: iconActiveName2 } = props;
|
|
12137
11884
|
return /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12138
|
-
name: checkedStatement ? iconActiveName2 : iconName2,
|
|
12139
|
-
size: iconSize2,
|
|
12140
|
-
className: color()
|
|
12141
|
-
});
|
|
12142
|
-
};
|
|
12143
|
-
const renderRadioItem = () => {
|
|
12144
|
-
if (shape === "button") {
|
|
12145
|
-
return renderButton();
|
|
12146
|
-
}
|
|
12147
|
-
if (reverseState) {
|
|
12148
|
-
return [renderLabel(), renderIcon()];
|
|
12149
|
-
}
|
|
12150
|
-
return [renderIcon(), renderLabel()];
|
|
12151
|
-
};
|
|
12152
|
-
const handleClick2 = (e2) => {
|
|
12153
|
-
if (disabledStatement || checkedStatement)
|
|
12154
|
-
return;
|
|
12155
|
-
setCheckedStatement(!checkedStatement);
|
|
12156
|
-
onChange && onChange(e2);
|
|
12157
|
-
context2 && context2.onChange(valueStatement);
|
|
12158
|
-
};
|
|
12159
|
-
const reverseState = textPosition === "left";
|
|
12160
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12161
|
-
className: `nut-radio ${className}`,
|
|
12162
|
-
onClick: handleClick2,
|
|
12163
|
-
...rest
|
|
12164
|
-
}, renderRadioItem());
|
|
12165
|
-
};
|
|
12166
|
-
Radio.defaultProps = defaultProps$R;
|
|
12167
|
-
Radio.displayName = "NutRadio";
|
|
12168
|
-
Radio.RadioGroup = RadioGroup;
|
|
12169
|
-
const defaultProps$Q = {
|
|
12170
|
-
count: 5,
|
|
12171
|
-
modelValue: 0,
|
|
12172
|
-
minimizeValue: 0,
|
|
12173
|
-
iconSize: 18,
|
|
12174
|
-
activeColor: "",
|
|
12175
|
-
voidColor: "",
|
|
12176
|
-
checkedIcon: "star-fill-n",
|
|
12177
|
-
uncheckedIcon: "star-n",
|
|
12178
|
-
disabled: false,
|
|
12179
|
-
readonly: false,
|
|
12180
|
-
allowHalf: false,
|
|
12181
|
-
spacing: 14
|
|
12182
|
-
};
|
|
12183
|
-
const Rate = (props) => {
|
|
12184
|
-
const {
|
|
12185
|
-
count,
|
|
12186
|
-
modelValue,
|
|
12187
|
-
minimizeValue,
|
|
12188
|
-
iconSize,
|
|
12189
|
-
activeColor,
|
|
12190
|
-
voidColor,
|
|
12191
|
-
checkedIcon,
|
|
12192
|
-
uncheckedIcon,
|
|
12193
|
-
disabled,
|
|
12194
|
-
readonly,
|
|
12195
|
-
allowHalf,
|
|
12196
|
-
spacing,
|
|
12197
|
-
change
|
|
12198
|
-
} = { ...defaultProps$Q, ...props };
|
|
12199
|
-
const b2 = cn("rate");
|
|
12200
|
-
const bi = cn("rate-item");
|
|
12201
|
-
const [countArray, setCountArray] = React.useState([1, 2, 3, 4, 5]);
|
|
12202
|
-
const [score, setScore] = React.useState(0);
|
|
12203
|
-
React.useEffect(() => {
|
|
12204
|
-
const tmp = [];
|
|
12205
|
-
for (let i = 1; i <= Number(count); i++) {
|
|
12206
|
-
tmp.push(i);
|
|
12207
|
-
}
|
|
12208
|
-
setCountArray(tmp);
|
|
12209
|
-
}, [count]);
|
|
12210
|
-
React.useEffect(() => {
|
|
12211
|
-
setScore(Math.max(Number(modelValue), Number(minimizeValue)));
|
|
12212
|
-
}, [modelValue]);
|
|
12213
|
-
const pxCheck2 = (value) => {
|
|
12214
|
-
return isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
12215
|
-
};
|
|
12216
|
-
const onClick = (e2, index2) => {
|
|
12217
|
-
var _a, _b;
|
|
12218
|
-
e2.preventDefault();
|
|
12219
|
-
e2.stopPropagation();
|
|
12220
|
-
if (disabled || readonly)
|
|
12221
|
-
return;
|
|
12222
|
-
let value = 0;
|
|
12223
|
-
if (index2 === 1 && score === index2)
|
|
12224
|
-
;
|
|
12225
|
-
else {
|
|
12226
|
-
value = index2;
|
|
12227
|
-
if (allowHalf) {
|
|
12228
|
-
console.log("e", e2);
|
|
12229
|
-
if ((_b = (_a = e2 == null ? void 0 : e2.target) == null ? void 0 : _a.className) == null ? void 0 : _b.includes("__icon--half")) {
|
|
12230
|
-
value -= 0.5;
|
|
12231
|
-
}
|
|
12232
|
-
}
|
|
12233
|
-
}
|
|
12234
|
-
value = Math.max(value, Number(minimizeValue));
|
|
12235
|
-
setScore(value);
|
|
12236
|
-
change && change(value);
|
|
12237
|
-
};
|
|
12238
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12239
|
-
className: b2()
|
|
12240
|
-
}, countArray.map((n2) => {
|
|
12241
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12242
|
-
className: bi(),
|
|
12243
|
-
key: n2,
|
|
12244
|
-
onClick: (event) => onClick(event, n2),
|
|
12245
|
-
style: { marginRight: pxCheck2(spacing) }
|
|
12246
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12247
|
-
size: iconSize,
|
|
12248
|
-
className: `${bi("icon")} ${disabled || n2 > score ? bi("icon--disabled") : ""}`,
|
|
12249
|
-
name: n2 <= score ? checkedIcon : uncheckedIcon,
|
|
12250
|
-
color: n2 <= score ? activeColor : voidColor
|
|
12251
|
-
}), allowHalf && score > n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12252
|
-
className: `${bi("icon")} ${bi("icon--half")}`,
|
|
12253
|
-
color: n2 <= score ? activeColor : voidColor,
|
|
12254
|
-
size: iconSize,
|
|
12255
|
-
name: checkedIcon
|
|
12256
|
-
}), allowHalf && score < n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12257
|
-
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
12258
|
-
"icon--half"
|
|
12259
|
-
)}`,
|
|
12260
|
-
color: voidColor,
|
|
12261
|
-
size: iconSize,
|
|
12262
|
-
name: uncheckedIcon
|
|
12263
|
-
}));
|
|
12264
|
-
}));
|
|
12265
|
-
};
|
|
12266
|
-
Rate.defaultProps = defaultProps$Q;
|
|
12267
|
-
Rate.displayName = "NutRate";
|
|
12268
|
-
const InternalPickerSlot = (props, ref) => {
|
|
12269
|
-
const {
|
|
12270
|
-
keyIndex = 0,
|
|
12271
|
-
defaultValue,
|
|
12272
|
-
listData = [],
|
|
12273
|
-
threeDimensional = true,
|
|
12274
|
-
swipeDuration = 1e3,
|
|
12275
|
-
itemShow = false,
|
|
12276
|
-
chooseItem
|
|
12277
|
-
} = props;
|
|
12278
|
-
const touch = useTouch();
|
|
12279
|
-
const DEFAULT_DURATION = 200;
|
|
12280
|
-
const INERTIA_TIME = 300;
|
|
12281
|
-
const INERTIA_DISTANCE = 15;
|
|
12282
|
-
const [currIndex, setCurrIndex] = React.useState(1);
|
|
12283
|
-
const lineSpacing = React.useRef(36);
|
|
12284
|
-
const [touchTime, setTouchTime] = React.useState(0);
|
|
12285
|
-
const [touchDeg, setTouchDeg] = React.useState("0deg");
|
|
12286
|
-
const rotation = 20;
|
|
12287
|
-
const moving = React.useRef(false);
|
|
12288
|
-
let timer;
|
|
12289
|
-
const listbox = React.useRef(null);
|
|
12290
|
-
const rollerRef = React.useRef(null);
|
|
12291
|
-
const pickerSlotRef = React.useRef(null);
|
|
12292
|
-
const [startTime, setStartTime] = React.useState(0);
|
|
12293
|
-
const [startY, setStartY] = React.useState(0);
|
|
12294
|
-
const transformY = React.useRef(0);
|
|
12295
|
-
const [scrollDistance, setScrollDistance] = React.useState(0);
|
|
12296
|
-
const isHidden = (index2) => {
|
|
12297
|
-
if (index2 >= currIndex + 8 || index2 <= currIndex - 8) {
|
|
12298
|
-
return true;
|
|
12299
|
-
}
|
|
12300
|
-
return false;
|
|
12301
|
-
};
|
|
12302
|
-
const setTransform = (translateY = 0, type, time = DEFAULT_DURATION, deg) => {
|
|
12303
|
-
let nTime = time;
|
|
12304
|
-
if (type !== "end") {
|
|
12305
|
-
nTime = 0;
|
|
12306
|
-
}
|
|
12307
|
-
setTouchTime(nTime);
|
|
12308
|
-
setTouchDeg(deg);
|
|
12309
|
-
setScrollDistance(translateY);
|
|
12310
|
-
};
|
|
12311
|
-
const setMove = (move, type, time) => {
|
|
12312
|
-
console.log("move");
|
|
12313
|
-
let updateMove = move + transformY.current;
|
|
12314
|
-
if (type === "end") {
|
|
12315
|
-
if (updateMove > 0) {
|
|
12316
|
-
updateMove = 0;
|
|
12317
|
-
}
|
|
12318
|
-
if (updateMove < -(listData.length - 1) * lineSpacing.current) {
|
|
12319
|
-
updateMove = -(listData.length - 1) * lineSpacing.current;
|
|
12320
|
-
}
|
|
12321
|
-
const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
|
|
12322
|
-
const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * rotation}deg`;
|
|
12323
|
-
setTransform(endMove, type, time, deg);
|
|
12324
|
-
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing.current)) + 1);
|
|
12325
|
-
} else {
|
|
12326
|
-
let deg = 0;
|
|
12327
|
-
const currentDeg = (-updateMove / lineSpacing.current + 1) * rotation;
|
|
12328
|
-
const maxDeg = (listData.length + 1) * rotation;
|
|
12329
|
-
const minDeg = 0;
|
|
12330
|
-
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
12331
|
-
if (minDeg < deg && deg < maxDeg) {
|
|
12332
|
-
setTransform(updateMove, "", void 0, `${deg}deg`);
|
|
12333
|
-
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing.current)) + 1);
|
|
12334
|
-
}
|
|
12335
|
-
}
|
|
12336
|
-
};
|
|
12337
|
-
const setChooseValue = (move) => {
|
|
12338
|
-
chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
12339
|
-
};
|
|
12340
|
-
const touchStart = (event) => {
|
|
12341
|
-
touch.start(event);
|
|
12342
|
-
setStartY(touch.deltaY);
|
|
12343
|
-
setStartTime(Date.now());
|
|
12344
|
-
transformY.current = scrollDistance;
|
|
12345
|
-
};
|
|
12346
|
-
const touchMove = (event) => {
|
|
12347
|
-
touch.move(event);
|
|
12348
|
-
if (touch.isVertical) {
|
|
12349
|
-
moving.current = true;
|
|
12350
|
-
preventDefault2(event, true);
|
|
12351
|
-
}
|
|
12352
|
-
const move = touch.deltaY - startY;
|
|
12353
|
-
setMove(move);
|
|
12354
|
-
};
|
|
12355
|
-
const touchEnd = (event) => {
|
|
12356
|
-
if (!moving.current)
|
|
12357
|
-
return;
|
|
12358
|
-
const move = touch.deltaY - startY;
|
|
12359
|
-
const moveTime = Date.now() - startTime;
|
|
12360
|
-
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
12361
|
-
const distance = momentum(move, moveTime);
|
|
12362
|
-
setMove(distance, "end", +swipeDuration);
|
|
12363
|
-
} else {
|
|
12364
|
-
setMove(move, "end");
|
|
12365
|
-
}
|
|
12366
|
-
setTimeout(() => {
|
|
12367
|
-
touch.reset();
|
|
12368
|
-
}, 0);
|
|
12369
|
-
};
|
|
12370
|
-
const momentum = (distance, duration) => {
|
|
12371
|
-
let nDistance = distance;
|
|
12372
|
-
const speed = Math.abs(nDistance / duration);
|
|
12373
|
-
nDistance = speed / 3e-3 * (nDistance < 0 ? -1 : 1);
|
|
12374
|
-
return nDistance;
|
|
12375
|
-
};
|
|
12376
|
-
const modifyStatus = (type, val) => {
|
|
12377
|
-
const value = val || defaultValue;
|
|
12378
|
-
let index2 = -1;
|
|
12379
|
-
if (value) {
|
|
12380
|
-
listData.some((item, idx) => {
|
|
12381
|
-
if (item.value === value) {
|
|
12382
|
-
index2 = idx;
|
|
12383
|
-
return true;
|
|
12384
|
-
}
|
|
12385
|
-
return false;
|
|
12386
|
-
});
|
|
12387
|
-
} else {
|
|
12388
|
-
listData.forEach((item, i) => {
|
|
12389
|
-
if (item.value === defaultValue) {
|
|
12390
|
-
index2 = i;
|
|
12391
|
-
}
|
|
12392
|
-
});
|
|
12393
|
-
}
|
|
12394
|
-
setCurrIndex(index2 === -1 ? 1 : index2 + 1);
|
|
12395
|
-
const move = index2 === -1 ? 0 : index2 * lineSpacing.current;
|
|
12396
|
-
type && setChooseValue(-move);
|
|
12397
|
-
setMove(-move);
|
|
12398
|
-
};
|
|
12399
|
-
const stopMomentum = () => {
|
|
12400
|
-
moving.current = false;
|
|
12401
|
-
setTouchTime(0);
|
|
12402
|
-
setChooseValue(scrollDistance);
|
|
12403
|
-
};
|
|
12404
|
-
const preventDefault2 = (event, isStopPropagation) => {
|
|
12405
|
-
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
12406
|
-
event.preventDefault();
|
|
12407
|
-
}
|
|
12408
|
-
if (isStopPropagation) {
|
|
12409
|
-
event.stopPropagation();
|
|
12410
|
-
}
|
|
12411
|
-
};
|
|
12412
|
-
const getReference = async () => {
|
|
12413
|
-
const refe = await getRectByTaro(listbox == null ? void 0 : listbox.current);
|
|
12414
|
-
console.log(refe);
|
|
12415
|
-
lineSpacing.current = refe.height ? refe.height : 36;
|
|
12416
|
-
modifyStatus(true);
|
|
12417
|
-
};
|
|
12418
|
-
const touchRollerStyle = () => {
|
|
12419
|
-
return {
|
|
12420
|
-
transition: `transform ${touchTime}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
12421
|
-
transform: `rotate3d(1, 0, 0, ${touchDeg})`
|
|
12422
|
-
};
|
|
12423
|
-
};
|
|
12424
|
-
const touchTileStyle = () => {
|
|
12425
|
-
return {
|
|
12426
|
-
transition: `transform ${touchTime}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
12427
|
-
transform: `translate3d(0, ${scrollDistance}px, 0)`
|
|
12428
|
-
};
|
|
12429
|
-
};
|
|
12430
|
-
React.useEffect(() => {
|
|
12431
|
-
setScrollDistance(0);
|
|
12432
|
-
transformY.current = 0;
|
|
12433
|
-
modifyStatus(false);
|
|
12434
|
-
return () => {
|
|
12435
|
-
clearTimeout(timer);
|
|
12436
|
-
};
|
|
12437
|
-
}, [listData]);
|
|
12438
|
-
React.useEffect(() => {
|
|
12439
|
-
if (itemShow) {
|
|
12440
|
-
setTimeout(() => {
|
|
12441
|
-
getReference();
|
|
12442
|
-
}, 200);
|
|
12443
|
-
}
|
|
12444
|
-
}, [itemShow]);
|
|
12445
|
-
React.useImperativeHandle(ref, () => ({
|
|
12446
|
-
stopMomentum,
|
|
12447
|
-
moving: moving.current
|
|
12448
|
-
}));
|
|
12449
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12450
|
-
className: "nut-picker-list",
|
|
12451
|
-
ref: pickerSlotRef,
|
|
12452
|
-
onTouchStart: touchStart,
|
|
12453
|
-
onTouchMove: touchMove,
|
|
12454
|
-
onTouchEnd: touchEnd
|
|
12455
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12456
|
-
className: "nut-picker-roller",
|
|
12457
|
-
ref: rollerRef,
|
|
12458
|
-
style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
|
|
12459
|
-
onTransitionEnd: stopMomentum
|
|
12460
|
-
}, threeDimensional && listData.map((item, index2) => {
|
|
12461
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12462
|
-
className: `nut-picker-roller-item ${isHidden(index2 + 1) && "nut-picker-roller-item-hidden"}`,
|
|
12463
|
-
style: {
|
|
12464
|
-
transform: `rotate3d(1, 0, 0, ${-rotation * (index2 + 1)}deg) translate3d(0px, 0px, 104px)`,
|
|
12465
|
-
height: `${lineSpacing.current}px`,
|
|
12466
|
-
lineHeight: `${lineSpacing.current}px`
|
|
12467
|
-
},
|
|
12468
|
-
key: item.value ? item.value : index2
|
|
12469
|
-
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.text ? item.text : item));
|
|
12470
|
-
}), !threeDimensional && listData.map((item, index2) => {
|
|
12471
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12472
|
-
className: "nut-picker-roller-item-tile",
|
|
12473
|
-
key: item.value ? item.value : index2,
|
|
12474
|
-
style: {
|
|
12475
|
-
height: `${lineSpacing.current}px`,
|
|
12476
|
-
lineHeight: `${lineSpacing.current}px`
|
|
12477
|
-
}
|
|
12478
|
-
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.text ? item.text : item));
|
|
12479
|
-
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12480
|
-
className: "nut-picker-mask"
|
|
12481
|
-
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12482
|
-
className: "nut-picker-indicator",
|
|
12483
|
-
ref: listbox
|
|
12484
|
-
}));
|
|
12485
|
-
};
|
|
12486
|
-
const PickerSlot = React__default["default"].forwardRef(InternalPickerSlot);
|
|
12487
|
-
const InternalPicker = (props, ref) => {
|
|
12488
|
-
const { locale } = useConfig$1();
|
|
12489
|
-
const {
|
|
12490
|
-
isVisible,
|
|
12491
|
-
title,
|
|
12492
|
-
listData = [],
|
|
12493
|
-
defaultValueData,
|
|
12494
|
-
onConfirm,
|
|
12495
|
-
onClose,
|
|
12496
|
-
onCloseUpdate,
|
|
12497
|
-
onChange,
|
|
12498
|
-
className,
|
|
12499
|
-
style,
|
|
12500
|
-
threeDimensional,
|
|
12501
|
-
swipeDuration,
|
|
12502
|
-
...rest
|
|
12503
|
-
} = props;
|
|
12504
|
-
const [chooseValueData, setchooseValueData] = React.useState([]);
|
|
12505
|
-
const [columnIndex, setcolumnIndex] = React.useState(0);
|
|
12506
|
-
const pickerRef = React.useRef(null);
|
|
12507
|
-
const [refs, setRefs] = useRefs();
|
|
12508
|
-
const [columnsList, setColumnsList] = React.useState([]);
|
|
12509
|
-
const b2 = cn("picker");
|
|
12510
|
-
let isConfirmEvent = React.useRef(false);
|
|
12511
|
-
React.useEffect(() => {
|
|
12512
|
-
if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
|
|
12513
|
-
const data = [...defaultValueData];
|
|
12514
|
-
setchooseValueData(data);
|
|
12515
|
-
setColumnsList(normalListData());
|
|
12516
|
-
}
|
|
12517
|
-
}, [defaultValueData]);
|
|
12518
|
-
React.useEffect(() => {
|
|
12519
|
-
onChange && onChange(columnIndex, chooseValueData, selectedOptions());
|
|
12520
|
-
if (isConfirmEvent.current) {
|
|
12521
|
-
isConfirmEvent.current = false;
|
|
12522
|
-
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
12523
|
-
}
|
|
12524
|
-
}, [chooseValueData]);
|
|
12525
|
-
React.useEffect(() => {
|
|
12526
|
-
init();
|
|
12527
|
-
}, [listData]);
|
|
12528
|
-
const closeActionSheet = () => {
|
|
12529
|
-
onClose && onClose(chooseValueData, selectedOptions());
|
|
12530
|
-
onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
|
|
12531
|
-
};
|
|
12532
|
-
const confirm2 = () => {
|
|
12533
|
-
let movings = false;
|
|
12534
|
-
refs.forEach((_ref) => {
|
|
12535
|
-
if (_ref.moving)
|
|
12536
|
-
movings = true;
|
|
12537
|
-
_ref.stopMomentum();
|
|
12538
|
-
});
|
|
12539
|
-
if (movings) {
|
|
12540
|
-
isConfirmEvent.current = true;
|
|
12541
|
-
} else {
|
|
12542
|
-
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
12543
|
-
}
|
|
12544
|
-
onClose && onClose(chooseValueData, selectedOptions());
|
|
12545
|
-
setTimeout(() => {
|
|
12546
|
-
isConfirmEvent.current = false;
|
|
12547
|
-
}, 0);
|
|
12548
|
-
};
|
|
12549
|
-
const selectedOptions = () => {
|
|
12550
|
-
const optins = [];
|
|
12551
|
-
columnsList.map((column, index2) => {
|
|
12552
|
-
let currOptions = [];
|
|
12553
|
-
currOptions = column.filter(
|
|
12554
|
-
(item) => item.value === chooseValueData[index2]
|
|
12555
|
-
);
|
|
12556
|
-
if (currOptions[0]) {
|
|
12557
|
-
optins.push(currOptions[0]);
|
|
12558
|
-
} else {
|
|
12559
|
-
column[0] && optins.push(column[0]);
|
|
12560
|
-
}
|
|
12561
|
-
return column;
|
|
11885
|
+
name: checkedStatement ? iconActiveName2 : iconName2,
|
|
11886
|
+
size: iconSize2,
|
|
11887
|
+
className: color()
|
|
12562
11888
|
});
|
|
12563
|
-
return optins;
|
|
12564
11889
|
};
|
|
12565
|
-
const
|
|
12566
|
-
if (
|
|
12567
|
-
|
|
12568
|
-
if (columnsType() === "cascade") {
|
|
12569
|
-
chooseValueData[columnIndex2] = option.value ? option.value : "";
|
|
12570
|
-
setchooseValueData([...chooseValueData]);
|
|
12571
|
-
let index2 = columnIndex2;
|
|
12572
|
-
let cursor = option;
|
|
12573
|
-
while (cursor && cursor.children && cursor.children[0]) {
|
|
12574
|
-
chooseValueData[index2 + 1] = cursor.children[0].value;
|
|
12575
|
-
setchooseValueData([...chooseValueData]);
|
|
12576
|
-
index2++;
|
|
12577
|
-
const cc = cursor.children[0];
|
|
12578
|
-
cursor = cc;
|
|
12579
|
-
}
|
|
12580
|
-
if (cursor && cursor.children) {
|
|
12581
|
-
chooseValueData[index2 + 1] = "";
|
|
12582
|
-
setchooseValueData([...chooseValueData]);
|
|
12583
|
-
}
|
|
12584
|
-
setColumnsList(normalListData());
|
|
12585
|
-
} else {
|
|
12586
|
-
setchooseValueData((data) => {
|
|
12587
|
-
const cdata = [...data];
|
|
12588
|
-
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
12589
|
-
option,
|
|
12590
|
-
"value"
|
|
12591
|
-
) ? option.value : "";
|
|
12592
|
-
return cdata;
|
|
12593
|
-
});
|
|
12594
|
-
}
|
|
12595
|
-
setcolumnIndex(columnIndex2);
|
|
12596
|
-
}
|
|
11890
|
+
const renderRadioItem = () => {
|
|
11891
|
+
if (shape === "button") {
|
|
11892
|
+
return renderButton();
|
|
12597
11893
|
}
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
const type = columnsType();
|
|
12601
|
-
switch (type) {
|
|
12602
|
-
case "multiple":
|
|
12603
|
-
return listData;
|
|
12604
|
-
case "cascade":
|
|
12605
|
-
return formatCascade(listData, chooseValueData);
|
|
12606
|
-
default:
|
|
12607
|
-
return [listData];
|
|
11894
|
+
if (reverseState) {
|
|
11895
|
+
return [renderLabel(), renderIcon()];
|
|
12608
11896
|
}
|
|
11897
|
+
return [renderIcon(), renderLabel()];
|
|
12609
11898
|
};
|
|
12610
|
-
const
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
-
if ("children" in firstColumn) {
|
|
12617
|
-
return "cascade";
|
|
12618
|
-
}
|
|
12619
|
-
}
|
|
12620
|
-
return "single";
|
|
11899
|
+
const handleClick2 = (e2) => {
|
|
11900
|
+
if (disabledStatement || checkedStatement)
|
|
11901
|
+
return;
|
|
11902
|
+
setCheckedStatement(!checkedStatement);
|
|
11903
|
+
onChange && onChange(e2);
|
|
11904
|
+
context2 && context2.onChange(valueStatement);
|
|
12621
11905
|
};
|
|
12622
|
-
const
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
11906
|
+
const reverseState = textPosition === "left";
|
|
11907
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
11908
|
+
className: `nut-radio ${className}`,
|
|
11909
|
+
onClick: handleClick2,
|
|
11910
|
+
...rest
|
|
11911
|
+
}, renderRadioItem());
|
|
11912
|
+
};
|
|
11913
|
+
Radio.defaultProps = defaultProps$R;
|
|
11914
|
+
Radio.displayName = "NutRadio";
|
|
11915
|
+
Radio.RadioGroup = RadioGroup;
|
|
11916
|
+
const defaultProps$Q = {
|
|
11917
|
+
count: 5,
|
|
11918
|
+
modelValue: 0,
|
|
11919
|
+
minimizeValue: 0,
|
|
11920
|
+
iconSize: 18,
|
|
11921
|
+
activeColor: "",
|
|
11922
|
+
voidColor: "",
|
|
11923
|
+
checkedIcon: "star-fill-n",
|
|
11924
|
+
uncheckedIcon: "star-n",
|
|
11925
|
+
disabled: false,
|
|
11926
|
+
readonly: false,
|
|
11927
|
+
allowHalf: false,
|
|
11928
|
+
spacing: 14
|
|
11929
|
+
};
|
|
11930
|
+
const Rate = (props) => {
|
|
11931
|
+
const {
|
|
11932
|
+
count,
|
|
11933
|
+
modelValue,
|
|
11934
|
+
minimizeValue,
|
|
11935
|
+
iconSize,
|
|
11936
|
+
activeColor,
|
|
11937
|
+
voidColor,
|
|
11938
|
+
checkedIcon,
|
|
11939
|
+
uncheckedIcon,
|
|
11940
|
+
disabled,
|
|
11941
|
+
readonly,
|
|
11942
|
+
allowHalf,
|
|
11943
|
+
spacing,
|
|
11944
|
+
change
|
|
11945
|
+
} = { ...defaultProps$Q, ...props };
|
|
11946
|
+
const b2 = cn("rate");
|
|
11947
|
+
const bi = cn("rate-item");
|
|
11948
|
+
const [countArray, setCountArray] = React.useState([1, 2, 3, 4, 5]);
|
|
11949
|
+
const [score, setScore] = React.useState(0);
|
|
11950
|
+
React.useEffect(() => {
|
|
11951
|
+
const tmp = [];
|
|
11952
|
+
for (let i = 1; i <= Number(count); i++) {
|
|
11953
|
+
tmp.push(i);
|
|
12641
11954
|
}
|
|
12642
|
-
|
|
11955
|
+
setCountArray(tmp);
|
|
11956
|
+
}, [count]);
|
|
11957
|
+
React.useEffect(() => {
|
|
11958
|
+
setScore(Math.max(Number(modelValue), Number(minimizeValue)));
|
|
11959
|
+
}, [modelValue]);
|
|
11960
|
+
const pxCheck2 = (value) => {
|
|
11961
|
+
return isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
12643
11962
|
};
|
|
12644
|
-
const
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
11963
|
+
const onClick = (e2, index2) => {
|
|
11964
|
+
var _a, _b;
|
|
11965
|
+
e2.preventDefault();
|
|
11966
|
+
e2.stopPropagation();
|
|
11967
|
+
if (disabled || readonly)
|
|
11968
|
+
return;
|
|
11969
|
+
let value = 0;
|
|
11970
|
+
if (index2 === 1 && score === index2)
|
|
11971
|
+
;
|
|
11972
|
+
else {
|
|
11973
|
+
value = index2;
|
|
11974
|
+
if (allowHalf) {
|
|
11975
|
+
console.log("e", e2);
|
|
11976
|
+
if ((_b = (_a = e2 == null ? void 0 : e2.target) == null ? void 0 : _a.className) == null ? void 0 : _b.includes("__icon--half")) {
|
|
11977
|
+
value -= 0.5;
|
|
11978
|
+
}
|
|
11979
|
+
}
|
|
12654
11980
|
}
|
|
11981
|
+
value = Math.max(value, Number(minimizeValue));
|
|
11982
|
+
setScore(value);
|
|
11983
|
+
change && change(value);
|
|
12655
11984
|
};
|
|
12656
|
-
|
|
11985
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
11986
|
+
className: b2()
|
|
11987
|
+
}, countArray.map((n2) => {
|
|
12657
11988
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12658
|
-
className:
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12662
|
-
},
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
},
|
|
12668
|
-
|
|
12669
|
-
|
|
12670
|
-
|
|
12671
|
-
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
|
|
12675
|
-
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
|
|
12679
|
-
|
|
12680
|
-
|
|
12681
|
-
ref: pickerRef
|
|
12682
|
-
}, columnsList == null ? void 0 : columnsList.map((item, index2) => {
|
|
12683
|
-
return /* @__PURE__ */ React__default["default"].createElement(PickerSlot, {
|
|
12684
|
-
ref: setRefs(index2),
|
|
12685
|
-
defaultValue: chooseValueData == null ? void 0 : chooseValueData[index2],
|
|
12686
|
-
listData: item,
|
|
12687
|
-
threeDimensional,
|
|
12688
|
-
chooseItem: (value, index22) => chooseItem(value, index22),
|
|
12689
|
-
swipeDuration,
|
|
12690
|
-
key: index2,
|
|
12691
|
-
keyIndex: index2,
|
|
12692
|
-
itemShow: isVisible
|
|
12693
|
-
});
|
|
12694
|
-
}))));
|
|
11989
|
+
className: bi(),
|
|
11990
|
+
key: n2,
|
|
11991
|
+
onClick: (event) => onClick(event, n2),
|
|
11992
|
+
style: { marginRight: pxCheck2(spacing) }
|
|
11993
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11994
|
+
size: iconSize,
|
|
11995
|
+
className: `${bi("icon")} ${disabled || n2 > score ? bi("icon--disabled") : ""}`,
|
|
11996
|
+
name: n2 <= score ? checkedIcon : uncheckedIcon,
|
|
11997
|
+
color: n2 <= score ? activeColor : voidColor
|
|
11998
|
+
}), allowHalf && score > n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11999
|
+
className: `${bi("icon")} ${bi("icon--half")}`,
|
|
12000
|
+
color: n2 <= score ? activeColor : voidColor,
|
|
12001
|
+
size: iconSize,
|
|
12002
|
+
name: checkedIcon
|
|
12003
|
+
}), allowHalf && score < n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12004
|
+
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
12005
|
+
"icon--half"
|
|
12006
|
+
)}`,
|
|
12007
|
+
color: voidColor,
|
|
12008
|
+
size: iconSize,
|
|
12009
|
+
name: uncheckedIcon
|
|
12010
|
+
}));
|
|
12011
|
+
}));
|
|
12695
12012
|
};
|
|
12696
|
-
|
|
12013
|
+
Rate.defaultProps = defaultProps$Q;
|
|
12014
|
+
Rate.displayName = "NutRate";
|
|
12697
12015
|
const defaultProps$P = {
|
|
12698
12016
|
title: "",
|
|
12699
12017
|
desc: "",
|
|
@@ -12794,7 +12112,7 @@
|
|
|
12794
12112
|
const sure = () => {
|
|
12795
12113
|
onOk && onOk(inputValue);
|
|
12796
12114
|
};
|
|
12797
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", null, /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
12115
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", null, /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
12798
12116
|
style: {
|
|
12799
12117
|
padding: "32px 24px 28px 24px",
|
|
12800
12118
|
borderRadius: "12px",
|
|
@@ -13585,7 +12903,7 @@
|
|
|
13585
12903
|
},
|
|
13586
12904
|
onPathChange: () => {
|
|
13587
12905
|
},
|
|
13588
|
-
...Popup
|
|
12906
|
+
...Popup.defaultProps
|
|
13589
12907
|
};
|
|
13590
12908
|
const InternalCascader = (props) => {
|
|
13591
12909
|
const {
|
|
@@ -13813,7 +13131,7 @@
|
|
|
13813
13131
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13814
13132
|
className: `${classes} ${className}`,
|
|
13815
13133
|
style
|
|
13816
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
13134
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
13817
13135
|
popClass: "cascadar-popup",
|
|
13818
13136
|
visible,
|
|
13819
13137
|
position: "bottom",
|
|
@@ -14178,7 +13496,7 @@
|
|
|
14178
13496
|
event.preventDefault();
|
|
14179
13497
|
setClickKeyIndex(void 0);
|
|
14180
13498
|
};
|
|
14181
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", null, /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
13499
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", null, /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
14182
13500
|
visible: show,
|
|
14183
13501
|
position: "bottom",
|
|
14184
13502
|
popClass,
|
|
@@ -14297,7 +13615,7 @@
|
|
|
14297
13615
|
onChoose && onChoose(item, index2);
|
|
14298
13616
|
}
|
|
14299
13617
|
};
|
|
14300
|
-
return /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
13618
|
+
return /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
14301
13619
|
round: true,
|
|
14302
13620
|
visible,
|
|
14303
13621
|
position: "bottom",
|
|
@@ -16940,6 +16258,19 @@
|
|
|
16940
16258
|
};
|
|
16941
16259
|
Avatar.defaultProps = defaultProps$s;
|
|
16942
16260
|
Avatar.displayName = "NutAvatar";
|
|
16261
|
+
const defaultConfigRef = {
|
|
16262
|
+
current: {
|
|
16263
|
+
locale: zhCN
|
|
16264
|
+
}
|
|
16265
|
+
};
|
|
16266
|
+
const getDefaultConfig = () => {
|
|
16267
|
+
return defaultConfigRef.current;
|
|
16268
|
+
};
|
|
16269
|
+
const useConfig = () => {
|
|
16270
|
+
var _a;
|
|
16271
|
+
return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
16272
|
+
};
|
|
16273
|
+
const ConfigContext = React.createContext(null);
|
|
16943
16274
|
const defaultProps$r = {
|
|
16944
16275
|
maxContent: "",
|
|
16945
16276
|
maxCount: "",
|
|
@@ -17360,7 +16691,7 @@
|
|
|
17360
16691
|
}) : "", /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17361
16692
|
className: "popover-menu-item-name"
|
|
17362
16693
|
}, item.name));
|
|
17363
|
-
})) : null))), visible ? /* @__PURE__ */ React__default["default"].createElement(Overlay
|
|
16694
|
+
})) : null))), visible ? /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
17364
16695
|
visible,
|
|
17365
16696
|
onClick: (e2) => handleClick2(e2),
|
|
17366
16697
|
style: { background: "transparent" }
|
|
@@ -18962,7 +18293,7 @@
|
|
|
18962
18293
|
onCloseInner();
|
|
18963
18294
|
}
|
|
18964
18295
|
};
|
|
18965
|
-
return /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
18296
|
+
return /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
18966
18297
|
visible: showPop,
|
|
18967
18298
|
popClass: "custom-pop",
|
|
18968
18299
|
style: { width: "100%" },
|
|
@@ -19738,7 +19069,7 @@
|
|
|
19738
19069
|
closeFun();
|
|
19739
19070
|
}
|
|
19740
19071
|
}, [showPopup]);
|
|
19741
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, showPopup && /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
19072
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, showPopup && /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
19742
19073
|
visible: showPopup,
|
|
19743
19074
|
position: "bottom",
|
|
19744
19075
|
onClickOverlay: clickOverlay,
|
|
@@ -20211,7 +19542,7 @@
|
|
|
20211
19542
|
React.useEffect(() => {
|
|
20212
19543
|
setPopVisible(visible);
|
|
20213
19544
|
}, [visible]);
|
|
20214
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Popup
|
|
19545
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
20215
19546
|
closeable: true,
|
|
20216
19547
|
round: true,
|
|
20217
19548
|
visible: popVisible,
|
|
@@ -20289,11 +19620,11 @@
|
|
|
20289
19620
|
exports2.NoticeBar = NoticeBar;
|
|
20290
19621
|
exports2.Notify = Notify;
|
|
20291
19622
|
exports2.NumberKeyboard = NumberKeyboard;
|
|
20292
|
-
exports2.Overlay = Overlay
|
|
19623
|
+
exports2.Overlay = Overlay;
|
|
20293
19624
|
exports2.Pagination = Pagination;
|
|
20294
19625
|
exports2.Picker = Picker;
|
|
20295
19626
|
exports2.Popover = Popover;
|
|
20296
|
-
exports2.Popup = Popup
|
|
19627
|
+
exports2.Popup = Popup;
|
|
20297
19628
|
exports2.Price = Price;
|
|
20298
19629
|
exports2.Progress = Progress;
|
|
20299
19630
|
exports2.PullToRefresh = PullToRefresh;
|