@nutui/nutui-react 1.2.1-beta.0 → 1.2.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/esm/ConfigProvider.js +11 -0
- package/dist/esm/DatePicker.js +148 -106
- package/dist/esm/Icon.js +4 -72
- package/dist/esm/NumberKeyboard/style/index.js +2 -0
- package/dist/esm/NumberKeyboard.js +277 -0
- package/dist/esm/Picker.js +294 -195
- package/dist/esm/Progress/style/index.js +2 -0
- package/dist/esm/Progress.js +130 -0
- package/dist/esm/Range.js +186 -129
- package/dist/esm/SearchBar/style/index.js +2 -0
- package/dist/esm/SearchBar.js +247 -0
- package/dist/esm/Signature.js +3 -0
- package/dist/esm/Tabbar.js +6 -3
- package/dist/esm/TabbarItem.js +14 -5
- package/dist/esm/Tag.js +18 -9
- package/dist/esm/icon-62bd7379.js +72 -0
- package/dist/esm/nutui-react.es.js +3 -0
- package/dist/esm/useTouch-a2ea68c6.js +119 -0
- package/dist/locales/base.d.ts +11 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +12 -1
- package/dist/locales/id-ID.js +12 -1
- package/dist/locales/zh-CN.js +12 -1
- package/dist/locales/zh-TW.js +12 -1
- package/dist/nutui.react.es.js +1308 -590
- package/dist/nutui.react.umd.js +15 -15
- package/dist/packages/numberkeyboard/numberkeyboard.scss +106 -0
- package/dist/packages/picker/picker.scss +35 -16
- package/dist/packages/progress/progress.scss +81 -0
- package/dist/packages/range/range.scss +141 -13
- package/dist/packages/searchbar/searchbar.scss +106 -0
- package/dist/packages/signature/signature.scss +4 -4
- package/dist/packages/tabbar/tabbar.scss +10 -3
- package/dist/packages/tabbaritem/tabbaritem.scss +26 -8
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +3 -0
- package/dist/styles/variables.scss +73 -6
- package/dist/types/datepicker/__test__/datepicker.spec.d.ts +1 -0
- package/dist/types/datepicker/datepicker.d.ts +16 -5
- package/dist/types/divider/__test__/divider.spec.d.ts +1 -0
- package/dist/types/navbar/__test__/navbar.spec.d.ts +1 -0
- package/dist/types/numberkeyboard/_test_/index.spec.d.ts +1 -0
- package/dist/types/numberkeyboard/demo.d.ts +3 -0
- package/dist/types/numberkeyboard/index.d.ts +2 -0
- package/dist/types/numberkeyboard/numberkeyboard.d.ts +20 -0
- package/dist/types/nutui.react.d.ts +4 -1
- package/dist/types/picker/picker.d.ts +17 -13
- package/dist/types/picker/pickerSlot.d.ts +4 -3
- package/dist/types/progress/__tests__/progress.spec.d.ts +1 -0
- package/dist/types/progress/demo.d.ts +3 -0
- package/dist/types/progress/index.d.ts +2 -0
- package/dist/types/progress/progress.d.ts +26 -0
- package/dist/types/range/demo.d.ts +1 -0
- package/dist/types/range/range.d.ts +3 -1
- package/dist/types/searchbar/demo.d.ts +3 -0
- package/dist/types/searchbar/index.d.ts +2 -0
- package/dist/types/searchbar/searchbar.d.ts +60 -0
- package/dist/types/signature/__test__/signature.spec.d.ts +2 -0
- package/dist/types/tabbar/__tests__/tabbar.spec.d.ts +1 -0
- package/dist/types/tabbar/tabbar.d.ts +2 -2
- package/dist/types/tabbaritem/tabbaritem.d.ts +4 -1
- package/dist/types/tag/tag.d.ts +1 -1
- package/package.json +3 -2
- package/dist/packages/range/custom.scss +0 -9
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.2.1
|
|
2
|
+
* @nutui/nutui-react v1.2.1 Wed Aug 10 2022 14:06:15 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -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$17 = {
|
|
49
49
|
name: "",
|
|
50
50
|
size: "",
|
|
51
51
|
classPrefix: "nutui-icon",
|
|
@@ -73,7 +73,7 @@ const Icon = (props) => {
|
|
|
73
73
|
click,
|
|
74
74
|
...rest
|
|
75
75
|
} = {
|
|
76
|
-
...defaultProps$
|
|
76
|
+
...defaultProps$17,
|
|
77
77
|
...props
|
|
78
78
|
};
|
|
79
79
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -105,9 +105,9 @@ const Icon = (props) => {
|
|
|
105
105
|
...hasSrc()
|
|
106
106
|
}, children);
|
|
107
107
|
};
|
|
108
|
-
Icon.defaultProps = defaultProps$
|
|
108
|
+
Icon.defaultProps = defaultProps$17;
|
|
109
109
|
Icon.displayName = "NutIcon";
|
|
110
|
-
const defaultProps$
|
|
110
|
+
const defaultProps$16 = {
|
|
111
111
|
className: "",
|
|
112
112
|
color: "",
|
|
113
113
|
shape: "round",
|
|
@@ -140,7 +140,7 @@ const Button = (props) => {
|
|
|
140
140
|
style,
|
|
141
141
|
...rest
|
|
142
142
|
} = {
|
|
143
|
-
...defaultProps$
|
|
143
|
+
...defaultProps$16,
|
|
144
144
|
...props
|
|
145
145
|
};
|
|
146
146
|
const getStyle = useCallback(() => {
|
|
@@ -213,7 +213,7 @@ const Button = (props) => {
|
|
|
213
213
|
name: icon
|
|
214
214
|
}) : "", children));
|
|
215
215
|
};
|
|
216
|
-
Button.defaultProps = defaultProps$
|
|
216
|
+
Button.defaultProps = defaultProps$16;
|
|
217
217
|
Button.displayName = "NutButton";
|
|
218
218
|
function _setPrototypeOf(o, p2) {
|
|
219
219
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
@@ -1429,7 +1429,7 @@ var useContext = React__default.useContext;
|
|
|
1429
1429
|
function useHistory() {
|
|
1430
1430
|
return useContext(historyContext);
|
|
1431
1431
|
}
|
|
1432
|
-
const defaultProps$
|
|
1432
|
+
const defaultProps$15 = {
|
|
1433
1433
|
title: null,
|
|
1434
1434
|
subTitle: null,
|
|
1435
1435
|
desc: "",
|
|
@@ -1469,7 +1469,7 @@ const Cell = (props) => {
|
|
|
1469
1469
|
linkSlot,
|
|
1470
1470
|
...rest
|
|
1471
1471
|
} = {
|
|
1472
|
-
...defaultProps$
|
|
1472
|
+
...defaultProps$15,
|
|
1473
1473
|
...props
|
|
1474
1474
|
};
|
|
1475
1475
|
const b2 = cn("cell");
|
|
@@ -1515,9 +1515,9 @@ const Cell = (props) => {
|
|
|
1515
1515
|
className: b2("link")
|
|
1516
1516
|
}) : linkSlot));
|
|
1517
1517
|
};
|
|
1518
|
-
Cell.defaultProps = defaultProps$
|
|
1518
|
+
Cell.defaultProps = defaultProps$15;
|
|
1519
1519
|
Cell.displayName = "NutCell";
|
|
1520
|
-
const defaultProps$
|
|
1520
|
+
const defaultProps$14 = {
|
|
1521
1521
|
title: "",
|
|
1522
1522
|
desc: "",
|
|
1523
1523
|
titleSlot: null,
|
|
@@ -1526,7 +1526,7 @@ const defaultProps$11 = {
|
|
|
1526
1526
|
};
|
|
1527
1527
|
const CellGroup = (props) => {
|
|
1528
1528
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1529
|
-
...defaultProps$
|
|
1529
|
+
...defaultProps$14,
|
|
1530
1530
|
...props
|
|
1531
1531
|
};
|
|
1532
1532
|
const b2 = cn("cell-group");
|
|
@@ -1540,7 +1540,7 @@ const CellGroup = (props) => {
|
|
|
1540
1540
|
className: b2("wrap")
|
|
1541
1541
|
}, children));
|
|
1542
1542
|
};
|
|
1543
|
-
CellGroup.defaultProps = defaultProps$
|
|
1543
|
+
CellGroup.defaultProps = defaultProps$14;
|
|
1544
1544
|
CellGroup.displayName = "NutCellGroup";
|
|
1545
1545
|
var classnames = { exports: {} };
|
|
1546
1546
|
/*!
|
|
@@ -2080,7 +2080,7 @@ CSSTransition.defaultProps = {
|
|
|
2080
2080
|
};
|
|
2081
2081
|
CSSTransition.propTypes = {};
|
|
2082
2082
|
var CSSTransition$1 = CSSTransition;
|
|
2083
|
-
const defaultProps$
|
|
2083
|
+
const defaultProps$13 = {
|
|
2084
2084
|
position: "center",
|
|
2085
2085
|
transition: "",
|
|
2086
2086
|
style: {},
|
|
@@ -2236,7 +2236,7 @@ const Popup = (props) => {
|
|
|
2236
2236
|
size: "12px"
|
|
2237
2237
|
})) : "")));
|
|
2238
2238
|
};
|
|
2239
|
-
Popup.defaultProps = defaultProps$
|
|
2239
|
+
Popup.defaultProps = defaultProps$13;
|
|
2240
2240
|
Popup.displayName = "NutPopup";
|
|
2241
2241
|
const zhCN = {
|
|
2242
2242
|
save: "\u4FDD\u5B58",
|
|
@@ -2328,9 +2328,20 @@ const zhCN = {
|
|
|
2328
2328
|
complaintsText: "\u6211\u8981\u6295\u8BC9",
|
|
2329
2329
|
additionalReview: (day) => `\u8D2D\u4E70${day}\u5929\u540E\u8FFD\u8BC4`,
|
|
2330
2330
|
additionalImages: (length) => `${length}\u5F20\u8FFD\u8BC4\u56FE\u7247`
|
|
2331
|
+
},
|
|
2332
|
+
searchbar: {
|
|
2333
|
+
basePlaceholder: "\u4E0A\u4EAC\u4E1C\uFF0C\u8D2D\u597D\u7269",
|
|
2334
|
+
text: "\u6587\u672C",
|
|
2335
|
+
test: "\u6D4B\u8BD5",
|
|
2336
|
+
title1: "\u57FA\u7840\u7528\u6CD5",
|
|
2337
|
+
title2: "\u641C\u7D22\u6846\u5F62\u72B6\u53CA\u6700\u5927\u957F\u5EA6",
|
|
2338
|
+
title3: "\u641C\u7D22\u6846\u5185\u5916\u80CC\u666F\u8BBE\u7F6E",
|
|
2339
|
+
title4: "\u641C\u7D22\u6846\u6587\u672C\u8BBE\u7F6E",
|
|
2340
|
+
title5: "\u81EA\u5B9A\u4E49\u56FE\u6807\u8BBE\u7F6E",
|
|
2341
|
+
title6: "\u6570\u636E\u6539\u53D8\u76D1\u542C"
|
|
2331
2342
|
}
|
|
2332
2343
|
};
|
|
2333
|
-
const defaultProps
|
|
2344
|
+
const defaultProps$12 = {
|
|
2334
2345
|
locale: zhCN
|
|
2335
2346
|
};
|
|
2336
2347
|
const defaultConfigRef = {
|
|
@@ -2347,7 +2358,7 @@ const useConfig = () => {
|
|
|
2347
2358
|
};
|
|
2348
2359
|
const ConfigContext = createContext(null);
|
|
2349
2360
|
const ConfigProvider = (props) => {
|
|
2350
|
-
const { children, ...config2 } = { ...defaultProps
|
|
2361
|
+
const { children, ...config2 } = { ...defaultProps$12, ...props };
|
|
2351
2362
|
const parentConfig = useConfig();
|
|
2352
2363
|
return /* @__PURE__ */ React__default.createElement(ConfigContext.Provider, {
|
|
2353
2364
|
value: {
|
|
@@ -2356,25 +2367,25 @@ const ConfigProvider = (props) => {
|
|
|
2356
2367
|
}
|
|
2357
2368
|
}, children);
|
|
2358
2369
|
};
|
|
2359
|
-
ConfigProvider.defaultProps = defaultProps
|
|
2370
|
+
ConfigProvider.defaultProps = defaultProps$12;
|
|
2360
2371
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2361
|
-
const defaultProps$
|
|
2372
|
+
const defaultProps$11 = {};
|
|
2362
2373
|
const Layout = (props) => {
|
|
2363
|
-
({ ...defaultProps$
|
|
2374
|
+
({ ...defaultProps$11, ...props });
|
|
2364
2375
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2365
2376
|
className: "nut-layout"
|
|
2366
2377
|
}, "Layout");
|
|
2367
2378
|
};
|
|
2368
|
-
Layout.defaultProps = defaultProps$
|
|
2379
|
+
Layout.defaultProps = defaultProps$11;
|
|
2369
2380
|
Layout.displayName = "NutLayout";
|
|
2370
2381
|
const DataContext$2 = createContext({});
|
|
2371
|
-
const defaultProps$
|
|
2382
|
+
const defaultProps$10 = {
|
|
2372
2383
|
span: "24",
|
|
2373
2384
|
offset: "0",
|
|
2374
2385
|
gutter: "0"
|
|
2375
2386
|
};
|
|
2376
2387
|
const Col = (props) => {
|
|
2377
|
-
const { span, offset, children } = { ...defaultProps$
|
|
2388
|
+
const { span, offset, children } = { ...defaultProps$10, ...props };
|
|
2378
2389
|
const [colName, setColName] = useState("");
|
|
2379
2390
|
const [colStyle, setColStyle] = useState({});
|
|
2380
2391
|
const { gutter } = useContext$1(DataContext$2);
|
|
@@ -2397,9 +2408,9 @@ const Col = (props) => {
|
|
|
2397
2408
|
style: { ...colStyle }
|
|
2398
2409
|
}, children);
|
|
2399
2410
|
};
|
|
2400
|
-
Col.defaultProps = defaultProps$
|
|
2411
|
+
Col.defaultProps = defaultProps$10;
|
|
2401
2412
|
Col.displayName = "NutCol";
|
|
2402
|
-
const defaultProps
|
|
2413
|
+
const defaultProps$$ = {
|
|
2403
2414
|
type: "",
|
|
2404
2415
|
justify: "start",
|
|
2405
2416
|
align: "flex-start",
|
|
@@ -2408,7 +2419,7 @@ const defaultProps$Y = {
|
|
|
2408
2419
|
};
|
|
2409
2420
|
const Row = (props) => {
|
|
2410
2421
|
const { children, type, justify, align, wrap, gutter } = {
|
|
2411
|
-
...defaultProps
|
|
2422
|
+
...defaultProps$$,
|
|
2412
2423
|
...props
|
|
2413
2424
|
};
|
|
2414
2425
|
const prefixCls = "nut-row";
|
|
@@ -2433,9 +2444,9 @@ const Row = (props) => {
|
|
|
2433
2444
|
className: getClasses()
|
|
2434
2445
|
}, children));
|
|
2435
2446
|
};
|
|
2436
|
-
Row.defaultProps = defaultProps
|
|
2447
|
+
Row.defaultProps = defaultProps$$;
|
|
2437
2448
|
Row.displayName = "NutRow";
|
|
2438
|
-
const defaultProps$
|
|
2449
|
+
const defaultProps$_ = {
|
|
2439
2450
|
contentPosition: "center",
|
|
2440
2451
|
dashed: false,
|
|
2441
2452
|
hairline: true,
|
|
@@ -2451,7 +2462,7 @@ const Divider = (props) => {
|
|
|
2451
2462
|
className,
|
|
2452
2463
|
direction
|
|
2453
2464
|
} = {
|
|
2454
|
-
...defaultProps$
|
|
2465
|
+
...defaultProps$_,
|
|
2455
2466
|
...props
|
|
2456
2467
|
};
|
|
2457
2468
|
const dividerBem = cn("divider");
|
|
@@ -2471,9 +2482,9 @@ const Divider = (props) => {
|
|
|
2471
2482
|
style: styles
|
|
2472
2483
|
}, children);
|
|
2473
2484
|
};
|
|
2474
|
-
Divider.defaultProps = defaultProps$
|
|
2485
|
+
Divider.defaultProps = defaultProps$_;
|
|
2475
2486
|
Divider.displayName = "NutDivider";
|
|
2476
|
-
const defaultProps$
|
|
2487
|
+
const defaultProps$Z = {
|
|
2477
2488
|
title: "",
|
|
2478
2489
|
desc: "",
|
|
2479
2490
|
leftShow: true,
|
|
@@ -2506,7 +2517,7 @@ const NavBar = (props) => {
|
|
|
2506
2517
|
onClickBack,
|
|
2507
2518
|
onClickRight
|
|
2508
2519
|
} = {
|
|
2509
|
-
...defaultProps$
|
|
2520
|
+
...defaultProps$Z,
|
|
2510
2521
|
...props
|
|
2511
2522
|
};
|
|
2512
2523
|
const b2 = cn("navbar");
|
|
@@ -2571,9 +2582,9 @@ const NavBar = (props) => {
|
|
|
2571
2582
|
className: `${b2("")}--placeholder`
|
|
2572
2583
|
}, renderWrapper()) : renderWrapper());
|
|
2573
2584
|
};
|
|
2574
|
-
NavBar.defaultProps = defaultProps$
|
|
2585
|
+
NavBar.defaultProps = defaultProps$Z;
|
|
2575
2586
|
NavBar.displayName = "NutNavBar";
|
|
2576
|
-
const defaultProps$
|
|
2587
|
+
const defaultProps$Y = {
|
|
2577
2588
|
fixednavClass: "nut-fixednav",
|
|
2578
2589
|
activeText: "\u6536\u8D77\u5BFC\u822A",
|
|
2579
2590
|
unActiveText: "\u5FEB\u901F\u5BFC\u822A",
|
|
@@ -2599,7 +2610,7 @@ const FixedNav = (props) => {
|
|
|
2599
2610
|
slotList,
|
|
2600
2611
|
slotBtn,
|
|
2601
2612
|
...rest
|
|
2602
|
-
} = { ...defaultProps$
|
|
2613
|
+
} = { ...defaultProps$Y, ...props };
|
|
2603
2614
|
const b2 = cn("fixednav");
|
|
2604
2615
|
const classes = classNames({
|
|
2605
2616
|
active: visible
|
|
@@ -2645,15 +2656,15 @@ const FixedNav = (props) => {
|
|
|
2645
2656
|
className: "text"
|
|
2646
2657
|
}, visible ? locale.fixednav.activeText || activeText : locale.fixednav.unActiveText || unActiveText))));
|
|
2647
2658
|
};
|
|
2648
|
-
FixedNav.defaultProps = defaultProps$
|
|
2659
|
+
FixedNav.defaultProps = defaultProps$Y;
|
|
2649
2660
|
FixedNav.displayName = "NutFixedNav";
|
|
2650
|
-
const defaultProps$
|
|
2661
|
+
const defaultProps$X = {
|
|
2651
2662
|
visible: 0,
|
|
2652
2663
|
bottom: false,
|
|
2653
|
-
|
|
2654
|
-
size: "",
|
|
2664
|
+
size: 20,
|
|
2655
2665
|
unactiveColor: "",
|
|
2656
2666
|
activeColor: "",
|
|
2667
|
+
safeAreaInsetBottom: false,
|
|
2657
2668
|
className: "",
|
|
2658
2669
|
style: {},
|
|
2659
2670
|
tabSwitch: () => {
|
|
@@ -2664,13 +2675,15 @@ const Tabbar = (props) => {
|
|
|
2664
2675
|
children,
|
|
2665
2676
|
visible,
|
|
2666
2677
|
bottom,
|
|
2678
|
+
size,
|
|
2667
2679
|
activeColor,
|
|
2668
2680
|
unactiveColor,
|
|
2681
|
+
safeAreaInsetBottom,
|
|
2669
2682
|
className,
|
|
2670
2683
|
style,
|
|
2671
2684
|
tabSwitch
|
|
2672
2685
|
} = {
|
|
2673
|
-
...defaultProps$
|
|
2686
|
+
...defaultProps$X,
|
|
2674
2687
|
...props
|
|
2675
2688
|
};
|
|
2676
2689
|
const b2 = cn("tabbar");
|
|
@@ -2679,7 +2692,12 @@ const Tabbar = (props) => {
|
|
|
2679
2692
|
setSelectIndex(idx);
|
|
2680
2693
|
};
|
|
2681
2694
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2682
|
-
className: [
|
|
2695
|
+
className: [
|
|
2696
|
+
`${b2()}`,
|
|
2697
|
+
bottom ? `${b2("bottom")}` : "",
|
|
2698
|
+
safeAreaInsetBottom ? `${b2("safebottom")}` : "",
|
|
2699
|
+
className
|
|
2700
|
+
].join(" "),
|
|
2683
2701
|
style
|
|
2684
2702
|
}, React__default.Children.map(children, (child, idx) => {
|
|
2685
2703
|
if (!React__default.isValidElement(child)) {
|
|
@@ -2691,6 +2709,7 @@ const Tabbar = (props) => {
|
|
|
2691
2709
|
index: idx,
|
|
2692
2710
|
unactiveColor,
|
|
2693
2711
|
activeColor,
|
|
2712
|
+
size,
|
|
2694
2713
|
handleClick: () => {
|
|
2695
2714
|
handleClick(idx);
|
|
2696
2715
|
tabSwitch(child, idx);
|
|
@@ -2699,9 +2718,12 @@ const Tabbar = (props) => {
|
|
|
2699
2718
|
return React__default.cloneElement(child, childProps);
|
|
2700
2719
|
}));
|
|
2701
2720
|
};
|
|
2702
|
-
Tabbar.defaultProps = defaultProps$
|
|
2721
|
+
Tabbar.defaultProps = defaultProps$X;
|
|
2703
2722
|
Tabbar.displayName = "NutTabbar";
|
|
2704
|
-
const defaultProps$
|
|
2723
|
+
const defaultProps$W = {
|
|
2724
|
+
dot: false,
|
|
2725
|
+
size: "",
|
|
2726
|
+
classPrefix: "nutui-iconfont",
|
|
2705
2727
|
tabTitle: "",
|
|
2706
2728
|
icon: "",
|
|
2707
2729
|
href: "",
|
|
@@ -2716,6 +2738,9 @@ const defaultProps$T = {
|
|
|
2716
2738
|
};
|
|
2717
2739
|
const TabbarItem = (props) => {
|
|
2718
2740
|
const {
|
|
2741
|
+
dot,
|
|
2742
|
+
size,
|
|
2743
|
+
classPrefix,
|
|
2719
2744
|
tabTitle,
|
|
2720
2745
|
icon,
|
|
2721
2746
|
href,
|
|
@@ -2727,7 +2752,7 @@ const TabbarItem = (props) => {
|
|
|
2727
2752
|
index: index2,
|
|
2728
2753
|
handleClick
|
|
2729
2754
|
} = {
|
|
2730
|
-
...defaultProps$
|
|
2755
|
+
...defaultProps$W,
|
|
2731
2756
|
...props
|
|
2732
2757
|
};
|
|
2733
2758
|
const b2 = cn("tabbar-item");
|
|
@@ -2741,7 +2766,7 @@ const TabbarItem = (props) => {
|
|
|
2741
2766
|
if (active && to2) {
|
|
2742
2767
|
history.push(to2);
|
|
2743
2768
|
}
|
|
2744
|
-
}, [active]);
|
|
2769
|
+
}, [active, history, href, to2]);
|
|
2745
2770
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2746
2771
|
className: `${b2({ active })}`,
|
|
2747
2772
|
style: {
|
|
@@ -2752,13 +2777,16 @@ const TabbarItem = (props) => {
|
|
|
2752
2777
|
}
|
|
2753
2778
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2754
2779
|
className: `${bIcon()}`
|
|
2755
|
-
}, num && num <= 99 && /* @__PURE__ */ React__default.createElement("div", {
|
|
2780
|
+
}, !dot ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, num && num <= 99 && /* @__PURE__ */ React__default.createElement("div", {
|
|
2756
2781
|
className: `${bIcon("tips", [bIcon("num")])}`
|
|
2757
2782
|
}, num), num && num >= 100 && /* @__PURE__ */ React__default.createElement("div", {
|
|
2758
2783
|
className: `${bIcon("tips", [bIcon("nums")])}`
|
|
2759
|
-
}, "99+")
|
|
2760
|
-
|
|
2761
|
-
|
|
2784
|
+
}, "99+")) : /* @__PURE__ */ React__default.createElement("div", {
|
|
2785
|
+
className: `${bIcon("dot")}`
|
|
2786
|
+
}), icon && /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
2787
|
+
size,
|
|
2788
|
+
name: icon,
|
|
2789
|
+
classPrefix
|
|
2762
2790
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
2763
2791
|
className: bIcon({ "nav-word": true }, [
|
|
2764
2792
|
bIcon({ "big-word": !icon })
|
|
@@ -2766,7 +2794,7 @@ const TabbarItem = (props) => {
|
|
|
2766
2794
|
}, tabTitle)));
|
|
2767
2795
|
};
|
|
2768
2796
|
const elevatorContext = createContext({});
|
|
2769
|
-
const defaultProps$
|
|
2797
|
+
const defaultProps$V = {
|
|
2770
2798
|
height: "200px",
|
|
2771
2799
|
acceptKey: "title",
|
|
2772
2800
|
indexList: [],
|
|
@@ -2789,7 +2817,7 @@ const Elevator = (props) => {
|
|
|
2789
2817
|
children,
|
|
2790
2818
|
...rest
|
|
2791
2819
|
} = {
|
|
2792
|
-
...defaultProps$
|
|
2820
|
+
...defaultProps$V,
|
|
2793
2821
|
...props
|
|
2794
2822
|
};
|
|
2795
2823
|
const b2 = cn("elevator");
|
|
@@ -2979,9 +3007,9 @@ const Elevator = (props) => {
|
|
|
2979
3007
|
}, item[acceptKey]);
|
|
2980
3008
|
}))));
|
|
2981
3009
|
};
|
|
2982
|
-
Elevator.defaultProps = defaultProps$
|
|
3010
|
+
Elevator.defaultProps = defaultProps$V;
|
|
2983
3011
|
Elevator.displayName = "NutElevator";
|
|
2984
|
-
const defaultProps$
|
|
3012
|
+
const defaultProps$U = {
|
|
2985
3013
|
defaultValue: 1,
|
|
2986
3014
|
mode: "multi",
|
|
2987
3015
|
prevText: "",
|
|
@@ -2998,7 +3026,7 @@ const defaultProps$R = {
|
|
|
2998
3026
|
};
|
|
2999
3027
|
const Pagination = (props) => {
|
|
3000
3028
|
const { locale } = useConfig();
|
|
3001
|
-
({ ...defaultProps$
|
|
3029
|
+
({ ...defaultProps$U, ...props });
|
|
3002
3030
|
const {
|
|
3003
3031
|
modelValue,
|
|
3004
3032
|
mode,
|
|
@@ -3115,7 +3143,7 @@ const Pagination = (props) => {
|
|
|
3115
3143
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
3116
3144
|
}, nextText || locale.pagination.next));
|
|
3117
3145
|
};
|
|
3118
|
-
Pagination.defaultProps = defaultProps$
|
|
3146
|
+
Pagination.defaultProps = defaultProps$U;
|
|
3119
3147
|
Pagination.displayName = "NutPagination";
|
|
3120
3148
|
class Title {
|
|
3121
3149
|
constructor() {
|
|
@@ -3125,7 +3153,7 @@ class Title {
|
|
|
3125
3153
|
this.index = 0;
|
|
3126
3154
|
}
|
|
3127
3155
|
}
|
|
3128
|
-
const defaultProps$
|
|
3156
|
+
const defaultProps$T = {
|
|
3129
3157
|
value: 0,
|
|
3130
3158
|
color: "",
|
|
3131
3159
|
background: "",
|
|
@@ -3160,7 +3188,7 @@ const Tabs = (props) => {
|
|
|
3160
3188
|
className,
|
|
3161
3189
|
autoHeight,
|
|
3162
3190
|
...rest
|
|
3163
|
-
} = { ...defaultProps$
|
|
3191
|
+
} = { ...defaultProps$T, ...props };
|
|
3164
3192
|
const [currentItem, setCurrentItem] = useState({ index: 0 });
|
|
3165
3193
|
const titles = useRef([]);
|
|
3166
3194
|
useEffect(() => {
|
|
@@ -3263,9 +3291,9 @@ const Tabs = (props) => {
|
|
|
3263
3291
|
return React__default.cloneElement(child, childProps);
|
|
3264
3292
|
})));
|
|
3265
3293
|
};
|
|
3266
|
-
Tabs.defaultProps = defaultProps$
|
|
3294
|
+
Tabs.defaultProps = defaultProps$T;
|
|
3267
3295
|
Tabs.displayName = "NutTabs";
|
|
3268
|
-
const defaultProps$
|
|
3296
|
+
const defaultProps$S = {
|
|
3269
3297
|
title: "",
|
|
3270
3298
|
paneKey: "",
|
|
3271
3299
|
activeKey: "",
|
|
@@ -3273,7 +3301,7 @@ const defaultProps$P = {
|
|
|
3273
3301
|
};
|
|
3274
3302
|
const TabPane = (props) => {
|
|
3275
3303
|
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
3276
|
-
...defaultProps$
|
|
3304
|
+
...defaultProps$S,
|
|
3277
3305
|
...props
|
|
3278
3306
|
};
|
|
3279
3307
|
const b2 = cn("tabpane");
|
|
@@ -3284,7 +3312,7 @@ const TabPane = (props) => {
|
|
|
3284
3312
|
className: classes
|
|
3285
3313
|
}, children);
|
|
3286
3314
|
};
|
|
3287
|
-
const defaultProps$
|
|
3315
|
+
const defaultProps$R = {
|
|
3288
3316
|
size: 3,
|
|
3289
3317
|
current: 1,
|
|
3290
3318
|
block: false,
|
|
@@ -3304,7 +3332,7 @@ const Indicator = (props) => {
|
|
|
3304
3332
|
vertical,
|
|
3305
3333
|
...rest
|
|
3306
3334
|
} = {
|
|
3307
|
-
...defaultProps$
|
|
3335
|
+
...defaultProps$R,
|
|
3308
3336
|
...props
|
|
3309
3337
|
};
|
|
3310
3338
|
const b2 = cn("indicator");
|
|
@@ -3333,7 +3361,7 @@ const Indicator = (props) => {
|
|
|
3333
3361
|
...rest
|
|
3334
3362
|
}, renderEles());
|
|
3335
3363
|
};
|
|
3336
|
-
Indicator.defaultProps = defaultProps$
|
|
3364
|
+
Indicator.defaultProps = defaultProps$R;
|
|
3337
3365
|
Indicator.displayName = "NutIndicator";
|
|
3338
3366
|
const MIN_DISTANCE = 10;
|
|
3339
3367
|
function getDirection(x2, y2) {
|
|
@@ -3348,6 +3376,8 @@ function getDirection(x2, y2) {
|
|
|
3348
3376
|
function useTouch() {
|
|
3349
3377
|
const [startX, SetStartX] = useState(0);
|
|
3350
3378
|
const [startY, SetStartY] = useState(0);
|
|
3379
|
+
const [moveX, SetMoveX] = useState(0);
|
|
3380
|
+
const [moveY, SetMoveY] = useState(0);
|
|
3351
3381
|
const [deltaX, SetDeltaX] = useState(0);
|
|
3352
3382
|
const [deltaY, SetDeltaY] = useState(0);
|
|
3353
3383
|
const [offsetX, SetOffsetX] = useState(0);
|
|
@@ -3373,10 +3403,12 @@ function useTouch() {
|
|
|
3373
3403
|
const dY = touch.clientY - startY;
|
|
3374
3404
|
SetDeltaX(dX);
|
|
3375
3405
|
SetDeltaY(dY);
|
|
3406
|
+
SetMoveX(touch.clientX);
|
|
3407
|
+
SetMoveY(touch.clientY);
|
|
3376
3408
|
SetOffsetX(Math.abs(dX));
|
|
3377
3409
|
SetOffsetY(Math.abs(dY));
|
|
3378
3410
|
if (!direction) {
|
|
3379
|
-
SetDirection(getDirection(
|
|
3411
|
+
SetDirection(getDirection(offsetX, offsetY));
|
|
3380
3412
|
}
|
|
3381
3413
|
};
|
|
3382
3414
|
return {
|
|
@@ -3385,6 +3417,8 @@ function useTouch() {
|
|
|
3385
3417
|
reset,
|
|
3386
3418
|
startX,
|
|
3387
3419
|
startY,
|
|
3420
|
+
moveX,
|
|
3421
|
+
moveY,
|
|
3388
3422
|
deltaX,
|
|
3389
3423
|
deltaY,
|
|
3390
3424
|
offsetX,
|
|
@@ -3397,7 +3431,7 @@ function useTouch() {
|
|
|
3397
3431
|
function isWindow(val) {
|
|
3398
3432
|
return val === window;
|
|
3399
3433
|
}
|
|
3400
|
-
const
|
|
3434
|
+
const getRect = (elementRef) => {
|
|
3401
3435
|
const element = elementRef;
|
|
3402
3436
|
if (isWindow(element)) {
|
|
3403
3437
|
const width = element.innerWidth;
|
|
@@ -3614,14 +3648,16 @@ var Toast = {
|
|
|
3614
3648
|
}
|
|
3615
3649
|
}
|
|
3616
3650
|
};
|
|
3617
|
-
const defaultProps$
|
|
3651
|
+
const defaultProps$Q = {
|
|
3618
3652
|
range: false,
|
|
3619
3653
|
hiddenRange: false,
|
|
3620
3654
|
hiddenTag: false,
|
|
3621
3655
|
min: 0,
|
|
3622
3656
|
max: 100,
|
|
3623
3657
|
step: 1,
|
|
3624
|
-
modelValue: 0
|
|
3658
|
+
modelValue: 0,
|
|
3659
|
+
vertical: false,
|
|
3660
|
+
marks: {}
|
|
3625
3661
|
};
|
|
3626
3662
|
let startValue;
|
|
3627
3663
|
let currentValue;
|
|
@@ -3641,16 +3677,18 @@ const Range = (props) => {
|
|
|
3641
3677
|
step,
|
|
3642
3678
|
modelValue,
|
|
3643
3679
|
button,
|
|
3680
|
+
vertical,
|
|
3681
|
+
marks,
|
|
3644
3682
|
change,
|
|
3645
3683
|
dragStart,
|
|
3646
3684
|
dragEnd
|
|
3647
|
-
} = { ...defaultProps$
|
|
3685
|
+
} = { ...defaultProps$Q, ...props };
|
|
3648
3686
|
const [buttonIndex, SetButtonIndex] = useState(0);
|
|
3649
3687
|
const [initValue, SetInitValue] = useState();
|
|
3650
3688
|
const [dragStatus, SetDragStatus] = useState("start");
|
|
3651
3689
|
const touch = useTouch();
|
|
3652
3690
|
const root = useRef(null);
|
|
3653
|
-
const
|
|
3691
|
+
const [marksList, SetMarksList] = useState([]);
|
|
3654
3692
|
useEffect(() => {
|
|
3655
3693
|
if (modelValue) {
|
|
3656
3694
|
if (!range && (modelValue < min || modelValue > max)) {
|
|
@@ -3661,9 +3699,52 @@ const Range = (props) => {
|
|
|
3661
3699
|
SetInitValue(modelValue);
|
|
3662
3700
|
}
|
|
3663
3701
|
}, [modelValue]);
|
|
3702
|
+
useEffect(() => {
|
|
3703
|
+
if (marks) {
|
|
3704
|
+
const marksKeys = Object.keys(marks);
|
|
3705
|
+
const list = marksKeys.map(parseFloat).sort((a, b2) => a - b2).filter((point) => point >= min && point <= max);
|
|
3706
|
+
SetMarksList(list);
|
|
3707
|
+
}
|
|
3708
|
+
}, [marks]);
|
|
3664
3709
|
const scope = () => {
|
|
3665
3710
|
return Number(max) - Number(min);
|
|
3666
3711
|
};
|
|
3712
|
+
const classes = useCallback(() => {
|
|
3713
|
+
const prefixCls = "nut-range";
|
|
3714
|
+
return [
|
|
3715
|
+
prefixCls,
|
|
3716
|
+
`${disabled ? `${prefixCls}-disabled` : ""}`,
|
|
3717
|
+
`${vertical ? `${prefixCls}-vertical` : ""}`,
|
|
3718
|
+
`${!hiddenRange ? `${prefixCls}-show-number` : ""}`
|
|
3719
|
+
].filter(Boolean).join(" ");
|
|
3720
|
+
}, [disabled, vertical, hiddenRange]);
|
|
3721
|
+
const containerClasses = useCallback(() => {
|
|
3722
|
+
const prefixCls = "nut-range-container";
|
|
3723
|
+
return [prefixCls, `${vertical ? `${prefixCls}-vertical` : ""}`, className].filter(Boolean).join(" ");
|
|
3724
|
+
}, [vertical, className]);
|
|
3725
|
+
const markClassName = useCallback((mark) => {
|
|
3726
|
+
const classPrefix = "nut-range-mark";
|
|
3727
|
+
let lowerBound = Number(min);
|
|
3728
|
+
let upperBound = Number(max);
|
|
3729
|
+
if (range) {
|
|
3730
|
+
const [left, right] = modelValue;
|
|
3731
|
+
lowerBound = left;
|
|
3732
|
+
upperBound = right;
|
|
3733
|
+
} else {
|
|
3734
|
+
upperBound = modelValue;
|
|
3735
|
+
}
|
|
3736
|
+
const isActive = mark <= upperBound && mark >= lowerBound;
|
|
3737
|
+
return [
|
|
3738
|
+
`${classPrefix}-text`,
|
|
3739
|
+
`${isActive ? `${classPrefix}-text-active` : ""}`
|
|
3740
|
+
].filter(Boolean).join(" ");
|
|
3741
|
+
}, [range, modelValue, min, max]);
|
|
3742
|
+
const [rangeName, setRangeName] = useState(classes());
|
|
3743
|
+
const [containerName, setContainerName] = useState(containerClasses());
|
|
3744
|
+
useEffect(() => {
|
|
3745
|
+
setRangeName(classes());
|
|
3746
|
+
setContainerName(containerClasses());
|
|
3747
|
+
}, [classes, containerClasses]);
|
|
3667
3748
|
const wrapperStyle = () => {
|
|
3668
3749
|
return {
|
|
3669
3750
|
background: inactiveColor
|
|
@@ -3692,6 +3773,14 @@ const Range = (props) => {
|
|
|
3692
3773
|
return `0%`;
|
|
3693
3774
|
};
|
|
3694
3775
|
const barStyle = () => {
|
|
3776
|
+
if (vertical) {
|
|
3777
|
+
return {
|
|
3778
|
+
height: calcMainAxis(),
|
|
3779
|
+
top: calcOffset(),
|
|
3780
|
+
background: activeColor,
|
|
3781
|
+
transition: dragStatus ? "none" : void 0
|
|
3782
|
+
};
|
|
3783
|
+
}
|
|
3695
3784
|
return {
|
|
3696
3785
|
width: calcMainAxis(),
|
|
3697
3786
|
left: calcOffset(),
|
|
@@ -3699,6 +3788,31 @@ const Range = (props) => {
|
|
|
3699
3788
|
transition: dragStatus ? "none" : void 0
|
|
3700
3789
|
};
|
|
3701
3790
|
};
|
|
3791
|
+
const marksStyle = (mark) => {
|
|
3792
|
+
let style = {
|
|
3793
|
+
left: `${(mark - Number(min)) / scope() * 100}%`
|
|
3794
|
+
};
|
|
3795
|
+
if (vertical) {
|
|
3796
|
+
style = {
|
|
3797
|
+
top: `${(mark - Number(min)) / scope() * 100}%`
|
|
3798
|
+
};
|
|
3799
|
+
}
|
|
3800
|
+
return style;
|
|
3801
|
+
};
|
|
3802
|
+
const tickStyle = (mark) => {
|
|
3803
|
+
let lowerBound = Number(min);
|
|
3804
|
+
let upperBound = Number(max);
|
|
3805
|
+
if (range) {
|
|
3806
|
+
const [left, right] = modelValue;
|
|
3807
|
+
lowerBound = left;
|
|
3808
|
+
upperBound = right;
|
|
3809
|
+
}
|
|
3810
|
+
const isActive = mark <= upperBound && mark >= lowerBound;
|
|
3811
|
+
const style = {
|
|
3812
|
+
background: !isActive ? inactiveColor : activeColor
|
|
3813
|
+
};
|
|
3814
|
+
return style;
|
|
3815
|
+
};
|
|
3702
3816
|
const format = (value) => {
|
|
3703
3817
|
value = Math.max(+min, Math.min(value, +max));
|
|
3704
3818
|
return Math.round(value / +step) * +step;
|
|
@@ -3722,10 +3836,36 @@ const Range = (props) => {
|
|
|
3722
3836
|
if (!isSameValue(value, modelVal)) {
|
|
3723
3837
|
SetInitValue(value);
|
|
3724
3838
|
}
|
|
3725
|
-
if (end && !isSameValue(value, startValue)) {
|
|
3839
|
+
if ((marks || end) && !isSameValue(value, startValue)) {
|
|
3726
3840
|
change && change(value);
|
|
3727
3841
|
}
|
|
3728
3842
|
};
|
|
3843
|
+
const click = (event) => {
|
|
3844
|
+
if (disabled || !root.current) {
|
|
3845
|
+
return;
|
|
3846
|
+
}
|
|
3847
|
+
SetDragStatus("");
|
|
3848
|
+
const rect = getRect(root.current);
|
|
3849
|
+
let delta = event.clientX - rect.left;
|
|
3850
|
+
let total = rect.width;
|
|
3851
|
+
if (vertical) {
|
|
3852
|
+
delta = event.clientY - rect.top;
|
|
3853
|
+
total = rect.height;
|
|
3854
|
+
}
|
|
3855
|
+
const value = Number(min) + delta / total * scope();
|
|
3856
|
+
currentValue = initValue || initValue === 0 ? initValue : modelValue;
|
|
3857
|
+
if (isRange(currentValue)) {
|
|
3858
|
+
const [left, right] = currentValue;
|
|
3859
|
+
const middle = (left + right) / 2;
|
|
3860
|
+
if (value <= middle) {
|
|
3861
|
+
updateValue([value, right], true);
|
|
3862
|
+
} else {
|
|
3863
|
+
updateValue([left, value], true);
|
|
3864
|
+
}
|
|
3865
|
+
} else {
|
|
3866
|
+
updateValue(value, true);
|
|
3867
|
+
}
|
|
3868
|
+
};
|
|
3729
3869
|
const onTouchStart = (event) => {
|
|
3730
3870
|
if (disabled) {
|
|
3731
3871
|
return;
|
|
@@ -3748,10 +3888,15 @@ const Range = (props) => {
|
|
|
3748
3888
|
}
|
|
3749
3889
|
touch.move(event);
|
|
3750
3890
|
SetDragStatus("draging");
|
|
3751
|
-
const rect =
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3891
|
+
const rect = getRect(root.current);
|
|
3892
|
+
let delta = touch.deltaX;
|
|
3893
|
+
let total = rect.width;
|
|
3894
|
+
let diff = delta / total * scope();
|
|
3895
|
+
if (vertical) {
|
|
3896
|
+
delta = touch.deltaY;
|
|
3897
|
+
total = rect.height;
|
|
3898
|
+
diff = delta / total * scope();
|
|
3899
|
+
}
|
|
3755
3900
|
if (isRange(startValue)) {
|
|
3756
3901
|
currentValue[buttonIndex] = startValue[buttonIndex] + diff;
|
|
3757
3902
|
} else {
|
|
@@ -3775,29 +3920,42 @@ const Range = (props) => {
|
|
|
3775
3920
|
return value;
|
|
3776
3921
|
};
|
|
3777
3922
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3778
|
-
className:
|
|
3923
|
+
className: `${containerName}`
|
|
3779
3924
|
}, !hiddenRange ? /* @__PURE__ */ React__default.createElement("div", {
|
|
3780
3925
|
className: "min"
|
|
3781
3926
|
}, +min) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3782
3927
|
ref: root,
|
|
3783
3928
|
style: wrapperStyle(),
|
|
3784
|
-
className: `${
|
|
3785
|
-
|
|
3929
|
+
className: `${rangeName}`,
|
|
3930
|
+
onClick: (e2) => {
|
|
3931
|
+
click(e2);
|
|
3932
|
+
}
|
|
3933
|
+
}, marksList.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
3934
|
+
className: "nut-range-mark"
|
|
3935
|
+
}, marksList.map((marks2) => {
|
|
3936
|
+
return /* @__PURE__ */ React__default.createElement("span", {
|
|
3937
|
+
key: marks2,
|
|
3938
|
+
className: markClassName(marks2),
|
|
3939
|
+
style: marksStyle(marks2)
|
|
3940
|
+
}, marks2, /* @__PURE__ */ React__default.createElement("span", {
|
|
3941
|
+
className: "nut-range-tick",
|
|
3942
|
+
style: tickStyle(marks2)
|
|
3943
|
+
}));
|
|
3944
|
+
})) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3786
3945
|
className: "nut-range-bar",
|
|
3787
3946
|
style: barStyle()
|
|
3788
3947
|
}, range ? [0, 1].map((item, index2) => {
|
|
3789
3948
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3790
3949
|
role: "slider",
|
|
3791
3950
|
key: index2,
|
|
3792
|
-
className: `${index2
|
|
3793
|
-
${index2
|
|
3951
|
+
className: `${index2 === 0 ? "nut-range-button-wrapper-left" : ""}
|
|
3952
|
+
${index2 === 1 ? "nut-range-button-wrapper-right" : ""}`,
|
|
3794
3953
|
tabIndex: disabled ? -1 : 0,
|
|
3795
3954
|
"aria-valuemin": +min,
|
|
3796
3955
|
"aria-valuenow": curValue(index2),
|
|
3797
3956
|
"aria-valuemax": +max,
|
|
3798
3957
|
"aria-orientation": "horizontal",
|
|
3799
3958
|
onTouchStart: (e2) => {
|
|
3800
|
-
e2.preventDefault;
|
|
3801
3959
|
if (typeof index2 === "number") {
|
|
3802
3960
|
SetButtonIndex(index2);
|
|
3803
3961
|
}
|
|
@@ -3853,7 +4011,7 @@ const Range = (props) => {
|
|
|
3853
4011
|
className: "max"
|
|
3854
4012
|
}, +max) : null);
|
|
3855
4013
|
};
|
|
3856
|
-
Range.defaultProps = defaultProps$
|
|
4014
|
+
Range.defaultProps = defaultProps$Q;
|
|
3857
4015
|
Range.displayName = "NutRange";
|
|
3858
4016
|
const Utils = {
|
|
3859
4017
|
isLeapYear(y2) {
|
|
@@ -3947,7 +4105,7 @@ function requestAniFrame() {
|
|
|
3947
4105
|
};
|
|
3948
4106
|
}
|
|
3949
4107
|
var requestAniFrame$1 = requestAniFrame();
|
|
3950
|
-
const defaultProps$
|
|
4108
|
+
const defaultProps$P = {
|
|
3951
4109
|
type: "one",
|
|
3952
4110
|
isAutoBackFill: false,
|
|
3953
4111
|
poppable: true,
|
|
@@ -3976,7 +4134,7 @@ const CalendarItem = (props) => {
|
|
|
3976
4134
|
onChoose,
|
|
3977
4135
|
onUpdate,
|
|
3978
4136
|
onClose
|
|
3979
|
-
} = { ...defaultProps$
|
|
4137
|
+
} = { ...defaultProps$P, ...props };
|
|
3980
4138
|
const weeks = locale.calendaritem.weekdays;
|
|
3981
4139
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
3982
4140
|
const [unLoadPrev, setUnLoadPrev] = useState(false);
|
|
@@ -4372,9 +4530,9 @@ const CalendarItem = (props) => {
|
|
|
4372
4530
|
onClick: confirm2
|
|
4373
4531
|
}, locale.confirm)) : ""));
|
|
4374
4532
|
};
|
|
4375
|
-
CalendarItem.defaultProps = defaultProps$
|
|
4533
|
+
CalendarItem.defaultProps = defaultProps$P;
|
|
4376
4534
|
CalendarItem.displayName = "NutCalendarItem";
|
|
4377
|
-
const defaultProps$
|
|
4535
|
+
const defaultProps$O = {
|
|
4378
4536
|
type: "one",
|
|
4379
4537
|
isAutoBackFill: false,
|
|
4380
4538
|
poppable: true,
|
|
@@ -4402,7 +4560,7 @@ const Calendar = (props) => {
|
|
|
4402
4560
|
endDate,
|
|
4403
4561
|
onClose,
|
|
4404
4562
|
onChoose
|
|
4405
|
-
} = { ...defaultProps$
|
|
4563
|
+
} = { ...defaultProps$O, ...props };
|
|
4406
4564
|
const close = () => {
|
|
4407
4565
|
onClose && onClose();
|
|
4408
4566
|
};
|
|
@@ -4445,9 +4603,9 @@ const Calendar = (props) => {
|
|
|
4445
4603
|
onChoose: choose
|
|
4446
4604
|
}));
|
|
4447
4605
|
};
|
|
4448
|
-
Calendar.defaultProps = defaultProps$
|
|
4606
|
+
Calendar.defaultProps = defaultProps$O;
|
|
4449
4607
|
Calendar.displayName = "NutCalendar";
|
|
4450
|
-
const defaultProps$
|
|
4608
|
+
const defaultProps$N = {
|
|
4451
4609
|
disabled: false,
|
|
4452
4610
|
checkedValue: [],
|
|
4453
4611
|
max: void 0,
|
|
@@ -4455,7 +4613,7 @@ const defaultProps$K = {
|
|
|
4455
4613
|
}
|
|
4456
4614
|
};
|
|
4457
4615
|
const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
4458
|
-
const { children } = { ...defaultProps$
|
|
4616
|
+
const { children } = { ...defaultProps$N, ...props };
|
|
4459
4617
|
const b2 = cn("checkboxgroup");
|
|
4460
4618
|
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
4461
4619
|
const [innerDisabled, setInnerDisabled] = useState(disabled);
|
|
@@ -4531,9 +4689,9 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
|
4531
4689
|
...rest
|
|
4532
4690
|
}, cloneChildren());
|
|
4533
4691
|
});
|
|
4534
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
4692
|
+
CheckboxGroup.defaultProps = defaultProps$N;
|
|
4535
4693
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
4536
|
-
const defaultProps$
|
|
4694
|
+
const defaultProps$M = {
|
|
4537
4695
|
checked: false,
|
|
4538
4696
|
disabled: false,
|
|
4539
4697
|
textPosition: "right",
|
|
@@ -4547,7 +4705,7 @@ const defaultProps$J = {
|
|
|
4547
4705
|
}
|
|
4548
4706
|
};
|
|
4549
4707
|
const Checkbox = (props) => {
|
|
4550
|
-
const { children } = { ...defaultProps$
|
|
4708
|
+
const { children } = { ...defaultProps$M, ...props };
|
|
4551
4709
|
const b2 = cn("checkbox");
|
|
4552
4710
|
const {
|
|
4553
4711
|
iconName,
|
|
@@ -4627,49 +4785,31 @@ const Checkbox = (props) => {
|
|
|
4627
4785
|
onClick: handleClick
|
|
4628
4786
|
}, renderIcon(), renderLabel());
|
|
4629
4787
|
};
|
|
4630
|
-
Checkbox.defaultProps = defaultProps$
|
|
4788
|
+
Checkbox.defaultProps = defaultProps$M;
|
|
4631
4789
|
Checkbox.displayName = "NutCheckBox";
|
|
4632
4790
|
Checkbox.Group = CheckboxGroup;
|
|
4633
4791
|
const InternalPickerSlot = (props, ref) => {
|
|
4634
4792
|
const {
|
|
4635
|
-
isUpdate,
|
|
4636
4793
|
keyIndex = 0,
|
|
4637
4794
|
defaultValue,
|
|
4638
4795
|
listData = [],
|
|
4796
|
+
threeDimensional = true,
|
|
4639
4797
|
chooseItem
|
|
4640
4798
|
} = props;
|
|
4799
|
+
const touch = useTouch();
|
|
4800
|
+
const INERTIA_TIME = 300;
|
|
4801
|
+
const INERTIA_DISTANCE = 15;
|
|
4641
4802
|
const [currIndex, setCurrIndex] = useState(1);
|
|
4642
4803
|
const lineSpacing = 36;
|
|
4643
4804
|
const rotation = 20;
|
|
4644
4805
|
let timer;
|
|
4645
|
-
|
|
4806
|
+
useRef(null);
|
|
4646
4807
|
const rollerRef = useRef(null);
|
|
4647
4808
|
const pickerSlotRef = useRef(null);
|
|
4648
|
-
useState();
|
|
4649
|
-
const
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
transformY: 0,
|
|
4653
|
-
scrollDistance: 0
|
|
4654
|
-
};
|
|
4655
|
-
useImperativeHandle(ref, () => ({
|
|
4656
|
-
updateTransform: (value) => {
|
|
4657
|
-
if (value) {
|
|
4658
|
-
touchParams.transformY = 0;
|
|
4659
|
-
timer = setTimeout(() => {
|
|
4660
|
-
modifyStatus(false, value);
|
|
4661
|
-
}, 10);
|
|
4662
|
-
}
|
|
4663
|
-
}
|
|
4664
|
-
}));
|
|
4665
|
-
useEffect(() => {
|
|
4666
|
-
touchParams.transformY = 0;
|
|
4667
|
-
modifyStatus();
|
|
4668
|
-
}, [isUpdate]);
|
|
4669
|
-
useEffect(() => {
|
|
4670
|
-
touchParams.transformY = 0;
|
|
4671
|
-
modifyStatus();
|
|
4672
|
-
}, [defaultValue]);
|
|
4809
|
+
const [startTime, setStartTime] = useState(0);
|
|
4810
|
+
const [startY, setStartY] = useState(0);
|
|
4811
|
+
const transformY = useRef(0);
|
|
4812
|
+
const [scrollDistance, setScrollDistance] = useState(0);
|
|
4673
4813
|
const isHidden = (index2) => {
|
|
4674
4814
|
if (index2 >= currIndex + 8 || index2 <= currIndex - 8) {
|
|
4675
4815
|
return true;
|
|
@@ -4677,20 +4817,21 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
4677
4817
|
return false;
|
|
4678
4818
|
};
|
|
4679
4819
|
const setTransform = (translateY = 0, type, time = 1e3, deg) => {
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4820
|
+
let nTime = time;
|
|
4821
|
+
if (type !== "end") {
|
|
4822
|
+
nTime = 0;
|
|
4823
|
+
}
|
|
4824
|
+
if (threeDimensional) {
|
|
4825
|
+
rollerRef.current.style.webkitTransform = `rotate3d(1, 0, 0, ${deg})`;
|
|
4683
4826
|
} else {
|
|
4684
|
-
|
|
4685
|
-
rollerRef.current.style.webkitTransition = "";
|
|
4827
|
+
rollerRef.current.style.webkitTransform = `translate3d(0, ${translateY}px, 0)`;
|
|
4686
4828
|
}
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
touchParams.scrollDistance = translateY;
|
|
4829
|
+
rollerRef.current.style.webkitTransition = `transform ${nTime}ms cubic-bezier(0.17, 0.89, 0.45, 1)`;
|
|
4830
|
+
setScrollDistance(translateY);
|
|
4690
4831
|
};
|
|
4691
4832
|
const setMove = (move, type, time) => {
|
|
4692
|
-
let updateMove = move +
|
|
4693
|
-
if (type === "end"
|
|
4833
|
+
let updateMove = move + transformY.current;
|
|
4834
|
+
if (type === "end") {
|
|
4694
4835
|
if (updateMove > 0) {
|
|
4695
4836
|
updateMove = 0;
|
|
4696
4837
|
}
|
|
@@ -4700,118 +4841,121 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
4700
4841
|
const endMove = Math.round(updateMove / lineSpacing) * lineSpacing;
|
|
4701
4842
|
const deg = `${(Math.abs(Math.round(endMove / lineSpacing)) + 1) * rotation}deg`;
|
|
4702
4843
|
setTransform(endMove, type, time, deg);
|
|
4703
|
-
timer = setTimeout(() => {
|
|
4704
|
-
setChooseValue(endMove);
|
|
4705
|
-
}, time / 2);
|
|
4706
4844
|
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing)) + 1);
|
|
4707
4845
|
} else {
|
|
4708
|
-
let deg =
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4846
|
+
let deg = 0;
|
|
4847
|
+
const currentDeg = (-updateMove / lineSpacing + 1) * rotation;
|
|
4848
|
+
const maxDeg = (listData.length + 1) * rotation;
|
|
4849
|
+
const minDeg = 0;
|
|
4850
|
+
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
4851
|
+
if (minDeg < deg && deg < maxDeg) {
|
|
4852
|
+
setTransform(updateMove, "", void 0, `${deg}deg`);
|
|
4853
|
+
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing)) + 1);
|
|
4713
4854
|
}
|
|
4714
|
-
setTransform(updateMove, "", 0, deg);
|
|
4715
|
-
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing)) + 1);
|
|
4716
4855
|
}
|
|
4717
4856
|
};
|
|
4718
4857
|
const setChooseValue = (move) => {
|
|
4719
4858
|
chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing)], keyIndex);
|
|
4720
4859
|
};
|
|
4721
4860
|
const touchStart = (event) => {
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
touchParams.transformY = touchParams.scrollDistance;
|
|
4861
|
+
touch.start(event);
|
|
4862
|
+
setStartY(touch.deltaY);
|
|
4863
|
+
setStartTime(Date.now());
|
|
4864
|
+
transformY.current = scrollDistance;
|
|
4727
4865
|
};
|
|
4728
|
-
const touchMove = (event
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4866
|
+
const touchMove = (event) => {
|
|
4867
|
+
touch.move(event);
|
|
4868
|
+
if (touch.isVertical) {
|
|
4869
|
+
preventDefault(event, true);
|
|
4870
|
+
}
|
|
4871
|
+
const move = touch.deltaY - startY;
|
|
4733
4872
|
setMove(move);
|
|
4734
4873
|
};
|
|
4735
4874
|
const touchEnd = (event) => {
|
|
4736
|
-
|
|
4737
|
-
const
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
if (moveTime <= 300) {
|
|
4742
|
-
move *= 2;
|
|
4743
|
-
moveTime += 1e3;
|
|
4744
|
-
setMove(move, "end", moveTime);
|
|
4875
|
+
const move = touch.deltaY - startY;
|
|
4876
|
+
const moveTime = Date.now() - startTime;
|
|
4877
|
+
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
4878
|
+
const distance = momentum(move, moveTime);
|
|
4879
|
+
setMove(distance, "end", moveTime + 1e3);
|
|
4745
4880
|
} else {
|
|
4746
|
-
setMove(move, "end"
|
|
4881
|
+
setMove(move, "end");
|
|
4747
4882
|
}
|
|
4883
|
+
setTimeout(() => {
|
|
4884
|
+
touch.reset();
|
|
4885
|
+
}, 0);
|
|
4886
|
+
};
|
|
4887
|
+
const momentum = (distance, duration) => {
|
|
4888
|
+
let nDistance = distance;
|
|
4889
|
+
const speed = Math.abs(nDistance / duration);
|
|
4890
|
+
nDistance = speed / 3e-3 * (nDistance < 0 ? -1 : 1);
|
|
4891
|
+
return nDistance;
|
|
4748
4892
|
};
|
|
4749
4893
|
const modifyStatus = (type, val) => {
|
|
4750
4894
|
const value = val || defaultValue;
|
|
4751
4895
|
let index2 = -1;
|
|
4752
|
-
if (value
|
|
4896
|
+
if (value) {
|
|
4753
4897
|
listData.some((item, idx) => {
|
|
4754
|
-
if (item.value
|
|
4898
|
+
if (item.value === value) {
|
|
4755
4899
|
index2 = idx;
|
|
4756
4900
|
return true;
|
|
4757
4901
|
}
|
|
4902
|
+
return false;
|
|
4758
4903
|
});
|
|
4759
|
-
} else
|
|
4760
|
-
listData.
|
|
4761
|
-
if (item
|
|
4762
|
-
index2 =
|
|
4763
|
-
return true;
|
|
4904
|
+
} else {
|
|
4905
|
+
listData.forEach((item, i) => {
|
|
4906
|
+
if (item.value === defaultValue) {
|
|
4907
|
+
index2 = i;
|
|
4764
4908
|
}
|
|
4765
4909
|
});
|
|
4766
|
-
} else {
|
|
4767
|
-
index2 = listData.indexOf(defaultValue);
|
|
4768
4910
|
}
|
|
4769
4911
|
setCurrIndex(index2 === -1 ? 1 : index2 + 1);
|
|
4770
4912
|
const move = index2 === -1 ? 0 : index2 * lineSpacing;
|
|
4771
4913
|
type && setChooseValue(-move);
|
|
4772
4914
|
setMove(-move);
|
|
4773
4915
|
};
|
|
4916
|
+
const stopMomentum = () => {
|
|
4917
|
+
setChooseValue(scrollDistance);
|
|
4918
|
+
};
|
|
4919
|
+
const preventDefault = (event, isStopPropagation) => {
|
|
4920
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
4921
|
+
event.preventDefault();
|
|
4922
|
+
}
|
|
4923
|
+
if (isStopPropagation) {
|
|
4924
|
+
event.stopPropagation();
|
|
4925
|
+
}
|
|
4926
|
+
};
|
|
4774
4927
|
useEffect(() => {
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
(
|
|
4778
|
-
(_b = pickerSlotRef.current) == null ? void 0 : _b.addEventListener("touchmove", touchMove);
|
|
4779
|
-
(_c = pickerSlotRef.current) == null ? void 0 : _c.addEventListener("touchend", touchEnd);
|
|
4928
|
+
setScrollDistance(0);
|
|
4929
|
+
transformY.current = 0;
|
|
4930
|
+
modifyStatus(false);
|
|
4780
4931
|
return () => {
|
|
4781
|
-
var _a2, _b2, _c2;
|
|
4782
|
-
(_a2 = pickerSlotRef.current) == null ? void 0 : _a2.removeEventListener("touchstart", touchStart);
|
|
4783
|
-
(_b2 = pickerSlotRef.current) == null ? void 0 : _b2.removeEventListener("touchmove", touchMove);
|
|
4784
|
-
(_c2 = pickerSlotRef.current) == null ? void 0 : _c2.removeEventListener("touchend", touchEnd);
|
|
4785
4932
|
clearTimeout(timer);
|
|
4786
4933
|
};
|
|
4787
4934
|
}, [listData]);
|
|
4788
4935
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4789
4936
|
className: "nut-picker-list",
|
|
4790
|
-
ref: pickerSlotRef
|
|
4937
|
+
ref: pickerSlotRef,
|
|
4938
|
+
onTouchStart: touchStart,
|
|
4939
|
+
onTouchMove: touchMove,
|
|
4940
|
+
onTouchEnd: touchEnd
|
|
4791
4941
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4792
4942
|
className: "nut-picker-roller",
|
|
4793
|
-
ref: rollerRef
|
|
4794
|
-
|
|
4943
|
+
ref: rollerRef,
|
|
4944
|
+
onTransitionEnd: stopMomentum
|
|
4945
|
+
}, threeDimensional && listData.map((item, index2) => {
|
|
4795
4946
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4796
4947
|
className: `nut-picker-roller-item ${isHidden(index2 + 1) && "nut-picker-roller-item-hidden"}`,
|
|
4797
4948
|
style: {
|
|
4798
4949
|
transform: `rotate3d(1, 0, 0, ${-rotation * (index2 + 1)}deg) translate3d(0px, 0px, 104px)`
|
|
4799
4950
|
},
|
|
4800
|
-
key: item.
|
|
4801
|
-
}, item.
|
|
4802
|
-
})
|
|
4803
|
-
className: "nut-picker-content"
|
|
4804
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4805
|
-
className: "nut-picker-list-panel",
|
|
4806
|
-
ref: listRef
|
|
4807
|
-
}, listData.map((item, index2) => {
|
|
4951
|
+
key: item.value ? item.value : index2
|
|
4952
|
+
}, item.text ? item.text : item);
|
|
4953
|
+
}), !threeDimensional && listData.map((item, index2) => {
|
|
4808
4954
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4809
|
-
className: "nut-picker-item",
|
|
4810
|
-
key: item.
|
|
4811
|
-
}, item.
|
|
4812
|
-
}),
|
|
4813
|
-
className: "nut-picker-placeholder"
|
|
4814
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
4955
|
+
className: "nut-picker-roller-item-tile",
|
|
4956
|
+
key: item.value ? item.value : index2
|
|
4957
|
+
}, item.text ? item.text : item);
|
|
4958
|
+
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
4815
4959
|
className: "nut-picker-mask"
|
|
4816
4960
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
4817
4961
|
className: "nut-picker-indicator"
|
|
@@ -4824,90 +4968,147 @@ const InternalPicker = (props, ref) => {
|
|
|
4824
4968
|
isVisible,
|
|
4825
4969
|
title,
|
|
4826
4970
|
listData = [],
|
|
4827
|
-
defaultValueData
|
|
4971
|
+
defaultValueData,
|
|
4828
4972
|
onConfirm,
|
|
4829
4973
|
onClose,
|
|
4830
4974
|
onCloseUpdate,
|
|
4831
|
-
|
|
4975
|
+
onChange,
|
|
4832
4976
|
className,
|
|
4833
4977
|
style,
|
|
4978
|
+
threeDimensional,
|
|
4834
4979
|
...rest
|
|
4835
4980
|
} = props;
|
|
4836
4981
|
const [chooseValueData, setchooseValueData] = useState([]);
|
|
4837
|
-
const [
|
|
4838
|
-
const [isUpdate, setisUpdate] = useState(false);
|
|
4982
|
+
const [columnIndex, setcolumnIndex] = useState(0);
|
|
4839
4983
|
const pickerRef = useRef(null);
|
|
4840
|
-
const
|
|
4841
|
-
const pickerSlotRef2 = useRef(null);
|
|
4842
|
-
const pickerSlotRef3 = useRef(null);
|
|
4843
|
-
const refList = [pickerSlotRef1, pickerSlotRef2, pickerSlotRef3];
|
|
4844
|
-
const [isReady, setIsReady] = useState(true);
|
|
4984
|
+
const [columnsList, setColumnsList] = useState([]);
|
|
4845
4985
|
const b2 = cn("picker");
|
|
4846
4986
|
useEffect(() => {
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4987
|
+
if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
|
|
4988
|
+
const data = [...defaultValueData];
|
|
4989
|
+
setchooseValueData(data);
|
|
4990
|
+
setColumnsList(normalListData());
|
|
4991
|
+
}
|
|
4851
4992
|
}, [defaultValueData]);
|
|
4993
|
+
useEffect(() => {
|
|
4994
|
+
onChange && onChange(columnIndex, chooseValueData, selectedOptions());
|
|
4995
|
+
}, [chooseValueData]);
|
|
4852
4996
|
useEffect(() => {
|
|
4853
4997
|
init();
|
|
4854
4998
|
}, [listData]);
|
|
4855
|
-
const updateChooseValue = (index2, value, cacheValueData2) => {
|
|
4856
|
-
var _a;
|
|
4857
|
-
if (!value)
|
|
4858
|
-
return;
|
|
4859
|
-
setcacheValueData((data) => {
|
|
4860
|
-
const cache = [...cacheValueData2];
|
|
4861
|
-
cache.splice(index2, 1, value);
|
|
4862
|
-
return cache;
|
|
4863
|
-
});
|
|
4864
|
-
(_a = refList[index2].current) == null ? void 0 : _a.updateTransform(value);
|
|
4865
|
-
};
|
|
4866
|
-
useImperativeHandle(ref, () => {
|
|
4867
|
-
return { updateChooseValue };
|
|
4868
|
-
});
|
|
4869
4999
|
const closeActionSheet = () => {
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
onClose && onClose();
|
|
4873
|
-
onCloseUpdate && onCloseUpdate(chooseValueData, pickerRef);
|
|
4874
|
-
};
|
|
4875
|
-
const confirm2 = (defaultValueData2) => {
|
|
4876
|
-
const data = defaultValueData2 || cacheValueData;
|
|
4877
|
-
onConfirm && onConfirm(data);
|
|
4878
|
-
setchooseValueData([...data]);
|
|
4879
|
-
onClose && onClose();
|
|
5000
|
+
onClose && onClose(chooseValueData, selectedOptions());
|
|
5001
|
+
onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
|
|
4880
5002
|
};
|
|
4881
|
-
const
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
5003
|
+
const confirm2 = () => {
|
|
5004
|
+
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
5005
|
+
onClose && onClose(chooseValueData, selectedOptions());
|
|
5006
|
+
};
|
|
5007
|
+
const selectedOptions = () => {
|
|
5008
|
+
const optins = [];
|
|
5009
|
+
columnsList.map((column, index2) => {
|
|
5010
|
+
let currOptions = [];
|
|
5011
|
+
currOptions = column.filter((item) => item.value === chooseValueData[index2]);
|
|
5012
|
+
if (currOptions[0]) {
|
|
5013
|
+
optins.push(currOptions[0]);
|
|
5014
|
+
} else {
|
|
5015
|
+
column[0] && optins.push(column[0]);
|
|
4887
5016
|
}
|
|
4888
|
-
return
|
|
5017
|
+
return column;
|
|
4889
5018
|
});
|
|
5019
|
+
return optins;
|
|
5020
|
+
};
|
|
5021
|
+
const chooseItem = (option, columnIndex2) => {
|
|
5022
|
+
if (option && Object.keys(option).length) {
|
|
5023
|
+
if (chooseValueData[columnIndex2] !== option.value) {
|
|
5024
|
+
if (columnsType() === "cascade") {
|
|
5025
|
+
chooseValueData[columnIndex2] = option.value ? option.value : "";
|
|
5026
|
+
setchooseValueData([...chooseValueData]);
|
|
5027
|
+
let index2 = columnIndex2;
|
|
5028
|
+
let cursor = option;
|
|
5029
|
+
while (cursor && cursor.children && cursor.children[0]) {
|
|
5030
|
+
chooseValueData[index2 + 1] = cursor.children[0].value;
|
|
5031
|
+
setchooseValueData([...chooseValueData]);
|
|
5032
|
+
index2++;
|
|
5033
|
+
const cc = cursor.children[0];
|
|
5034
|
+
cursor = cc;
|
|
5035
|
+
}
|
|
5036
|
+
if (cursor && cursor.children) {
|
|
5037
|
+
chooseValueData[index2 + 1] = "";
|
|
5038
|
+
setchooseValueData([...chooseValueData]);
|
|
5039
|
+
}
|
|
5040
|
+
setColumnsList(normalListData());
|
|
5041
|
+
} else {
|
|
5042
|
+
setchooseValueData((data) => {
|
|
5043
|
+
const cdata = [...data];
|
|
5044
|
+
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(option, "value") ? option.value : "";
|
|
5045
|
+
return cdata;
|
|
5046
|
+
});
|
|
5047
|
+
}
|
|
5048
|
+
setcolumnIndex(columnIndex2);
|
|
5049
|
+
}
|
|
5050
|
+
}
|
|
5051
|
+
};
|
|
5052
|
+
const normalListData = () => {
|
|
5053
|
+
const type = columnsType();
|
|
5054
|
+
switch (type) {
|
|
5055
|
+
case "multiple":
|
|
5056
|
+
return listData;
|
|
5057
|
+
case "cascade":
|
|
5058
|
+
return formatCascade(listData, chooseValueData);
|
|
5059
|
+
default:
|
|
5060
|
+
return [listData];
|
|
5061
|
+
}
|
|
5062
|
+
};
|
|
5063
|
+
const columnsType = () => {
|
|
5064
|
+
const firstColumn = listData[0];
|
|
5065
|
+
if (firstColumn) {
|
|
5066
|
+
if (Array.isArray(firstColumn)) {
|
|
5067
|
+
return "multiple";
|
|
5068
|
+
}
|
|
5069
|
+
if ("children" in firstColumn) {
|
|
5070
|
+
return "cascade";
|
|
5071
|
+
}
|
|
5072
|
+
}
|
|
5073
|
+
return "single";
|
|
5074
|
+
};
|
|
5075
|
+
const formatCascade = (columns, defaultValues) => {
|
|
5076
|
+
const formatted = [];
|
|
5077
|
+
let cursor = {
|
|
5078
|
+
text: "",
|
|
5079
|
+
value: "",
|
|
5080
|
+
children: columns
|
|
5081
|
+
};
|
|
5082
|
+
let columnIndex2 = 0;
|
|
5083
|
+
while (cursor && cursor.children) {
|
|
5084
|
+
const options2 = cursor.children;
|
|
5085
|
+
const value = defaultValues[columnIndex2];
|
|
5086
|
+
let index2 = options2.findIndex((columnItem) => columnItem.value === value);
|
|
5087
|
+
if (index2 === -1)
|
|
5088
|
+
index2 = 0;
|
|
5089
|
+
cursor = cursor.children[index2];
|
|
5090
|
+
columnIndex2++;
|
|
5091
|
+
formatted.push(options2);
|
|
5092
|
+
}
|
|
5093
|
+
return formatted;
|
|
4890
5094
|
};
|
|
4891
5095
|
const init = () => {
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
return [...data];
|
|
4901
|
-
});
|
|
5096
|
+
const data = [];
|
|
5097
|
+
const normalData = normalListData();
|
|
5098
|
+
setColumnsList(normalData);
|
|
5099
|
+
normalData.map((item) => {
|
|
5100
|
+
data.push(item[0].value);
|
|
5101
|
+
return item;
|
|
5102
|
+
});
|
|
5103
|
+
if (!defaultValueData && chooseValueData.length === 0) {
|
|
4902
5104
|
setchooseValueData([...data]);
|
|
4903
5105
|
}
|
|
4904
|
-
setIsReady(true);
|
|
4905
5106
|
};
|
|
4906
5107
|
return /* @__PURE__ */ React__default.createElement(Popup, {
|
|
4907
5108
|
visible: isVisible,
|
|
4908
5109
|
position: "bottom",
|
|
4909
5110
|
onClose: () => {
|
|
4910
|
-
|
|
5111
|
+
closeActionSheet();
|
|
4911
5112
|
}
|
|
4912
5113
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4913
5114
|
className: `${b2()} ${className || ""}`,
|
|
@@ -4926,30 +5127,29 @@ const InternalPicker = (props, ref) => {
|
|
|
4926
5127
|
}, locale.confirm)), /* @__PURE__ */ React__default.createElement("div", {
|
|
4927
5128
|
className: b2("panel"),
|
|
4928
5129
|
ref: pickerRef
|
|
4929
|
-
},
|
|
5130
|
+
}, columnsList == null ? void 0 : columnsList.map((item, index2) => {
|
|
4930
5131
|
return /* @__PURE__ */ React__default.createElement(PickerSlot, {
|
|
4931
5132
|
defaultValue: chooseValueData == null ? void 0 : chooseValueData[index2],
|
|
4932
|
-
isUpdate,
|
|
4933
5133
|
listData: item,
|
|
5134
|
+
threeDimensional,
|
|
4934
5135
|
chooseItem: (value, index22) => chooseItem(value, index22),
|
|
4935
5136
|
key: index2,
|
|
4936
|
-
keyIndex: index2
|
|
4937
|
-
ref: refList[index2]
|
|
5137
|
+
keyIndex: index2
|
|
4938
5138
|
});
|
|
4939
5139
|
}))));
|
|
4940
5140
|
};
|
|
4941
5141
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
4942
5142
|
const currentYear = new Date().getFullYear();
|
|
4943
|
-
const defaultProps$
|
|
4944
|
-
modelValue:
|
|
5143
|
+
const defaultProps$L = {
|
|
5144
|
+
modelValue: null,
|
|
4945
5145
|
visible: false,
|
|
4946
5146
|
title: "",
|
|
4947
5147
|
type: "date",
|
|
4948
|
-
isShowChinese:
|
|
5148
|
+
isShowChinese: false,
|
|
5149
|
+
threeDimensional: true,
|
|
4949
5150
|
minuteStep: 1,
|
|
4950
5151
|
minDate: new Date(currentYear - 10, 0, 1),
|
|
4951
|
-
maxDate: new Date(currentYear + 10, 11, 31)
|
|
4952
|
-
onCloseDatePicker: () => void 0
|
|
5152
|
+
maxDate: new Date(currentYear + 10, 11, 31)
|
|
4953
5153
|
};
|
|
4954
5154
|
const DatePicker = (props) => {
|
|
4955
5155
|
const {
|
|
@@ -4961,20 +5161,26 @@ const DatePicker = (props) => {
|
|
|
4961
5161
|
modelValue,
|
|
4962
5162
|
visible,
|
|
4963
5163
|
title,
|
|
5164
|
+
formatter,
|
|
4964
5165
|
onCloseDatePicker,
|
|
4965
5166
|
onConfirmDatePicker,
|
|
5167
|
+
filter,
|
|
5168
|
+
threeDimensional,
|
|
4966
5169
|
className,
|
|
4967
5170
|
style,
|
|
4968
5171
|
...rest
|
|
4969
5172
|
} = {
|
|
4970
|
-
...defaultProps$
|
|
5173
|
+
...defaultProps$L,
|
|
4971
5174
|
...props
|
|
4972
5175
|
};
|
|
4973
5176
|
const [show, setShow] = useState(false);
|
|
4974
|
-
const [currentDate, setCurrentDate] = useState(
|
|
5177
|
+
const [currentDate, setCurrentDate] = useState(modelValue);
|
|
4975
5178
|
const [defaultValue, setDefaultValue] = useState([]);
|
|
4976
5179
|
const [listData, setListData] = useState([]);
|
|
4977
5180
|
const pickerRef = useRef(null);
|
|
5181
|
+
const isDate = (val) => {
|
|
5182
|
+
return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
|
5183
|
+
};
|
|
4978
5184
|
const zhCNType = {
|
|
4979
5185
|
day: "\u65E5",
|
|
4980
5186
|
year: "\u5E74",
|
|
@@ -4983,6 +5189,15 @@ const DatePicker = (props) => {
|
|
|
4983
5189
|
minute: "\u5206",
|
|
4984
5190
|
seconds: "\u79D2"
|
|
4985
5191
|
};
|
|
5192
|
+
const formatValue = (value) => {
|
|
5193
|
+
let cvalue = value;
|
|
5194
|
+
if (!cvalue || cvalue && !isDate(cvalue)) {
|
|
5195
|
+
cvalue = minDate;
|
|
5196
|
+
}
|
|
5197
|
+
let timestmp = Math.max(cvalue.getTime(), minDate.getTime());
|
|
5198
|
+
timestmp = Math.min(timestmp, maxDate.getTime());
|
|
5199
|
+
return new Date(timestmp);
|
|
5200
|
+
};
|
|
4986
5201
|
function getMonthEndDay(year, month) {
|
|
4987
5202
|
return new Date(year, month, 0).getDate();
|
|
4988
5203
|
}
|
|
@@ -5023,9 +5238,12 @@ const DatePicker = (props) => {
|
|
|
5023
5238
|
};
|
|
5024
5239
|
const ranges = (date) => {
|
|
5025
5240
|
const curDate = date || currentDate;
|
|
5241
|
+
console.log(11, currentDate);
|
|
5242
|
+
if (!curDate)
|
|
5243
|
+
return [];
|
|
5026
5244
|
const { maxYear, maxDate: maxDate2, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", curDate);
|
|
5027
5245
|
const { minYear, minDate: minDate2, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", curDate);
|
|
5028
|
-
|
|
5246
|
+
let result = [
|
|
5029
5247
|
{
|
|
5030
5248
|
type: "year",
|
|
5031
5249
|
range: [minYear, maxYear]
|
|
@@ -5051,160 +5269,156 @@ const DatePicker = (props) => {
|
|
|
5051
5269
|
range: [minSeconds, maxSeconds]
|
|
5052
5270
|
}
|
|
5053
5271
|
];
|
|
5054
|
-
|
|
5055
|
-
let end = 0;
|
|
5056
|
-
switch (type) {
|
|
5272
|
+
switch (type.toLocaleLowerCase()) {
|
|
5057
5273
|
case "date":
|
|
5058
|
-
|
|
5059
|
-
end = 3;
|
|
5274
|
+
result = result.slice(0, 3);
|
|
5060
5275
|
break;
|
|
5061
5276
|
case "datetime":
|
|
5062
|
-
|
|
5063
|
-
end = 5;
|
|
5277
|
+
result = result.slice(0, 5);
|
|
5064
5278
|
break;
|
|
5065
5279
|
case "time":
|
|
5066
|
-
|
|
5067
|
-
|
|
5280
|
+
result = result.slice(3, 6);
|
|
5281
|
+
break;
|
|
5282
|
+
case "year-month":
|
|
5283
|
+
result = result.slice(0, 2);
|
|
5068
5284
|
break;
|
|
5069
5285
|
case "month-day":
|
|
5070
|
-
|
|
5071
|
-
end = 3;
|
|
5286
|
+
result = result.slice(1, 3);
|
|
5072
5287
|
break;
|
|
5073
5288
|
case "datehour":
|
|
5074
|
-
|
|
5075
|
-
end = 4;
|
|
5289
|
+
result = result.slice(0, 4);
|
|
5076
5290
|
break;
|
|
5077
5291
|
}
|
|
5078
|
-
return result
|
|
5079
|
-
};
|
|
5080
|
-
const
|
|
5081
|
-
if (["date", "datetime", "
|
|
5082
|
-
const formatDate = [
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
modelValue.
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
];
|
|
5102
|
-
}
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
modelValue2.getFullYear(),
|
|
5127
|
-
resValue,
|
|
5128
|
-
modelValue2.getDate()
|
|
5129
|
-
];
|
|
5130
|
-
}
|
|
5131
|
-
setDefaultValue(val);
|
|
5132
|
-
setListData(data);
|
|
5133
|
-
setTimeout(() => {
|
|
5134
|
-
var _a;
|
|
5135
|
-
(_a = pickerRef.current) == null ? void 0 : _a.updateChooseValue(index2 + 1, data[1] ? data[1][0].toString() : "0", cacheValueData);
|
|
5136
|
-
}, 200);
|
|
5137
|
-
}, 100);
|
|
5292
|
+
return result;
|
|
5293
|
+
};
|
|
5294
|
+
const updateChooseValueCustmer = (index2, selectedValue, cacheValueData) => {
|
|
5295
|
+
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(type.toLocaleLowerCase())) {
|
|
5296
|
+
const formatDate = [];
|
|
5297
|
+
selectedValue.forEach((item) => {
|
|
5298
|
+
formatDate.push(item);
|
|
5299
|
+
});
|
|
5300
|
+
if (type.toLocaleLowerCase() === "month-day" && formatDate.length < 3) {
|
|
5301
|
+
formatDate.unshift(new Date(modelValue || minDate || maxDate).getFullYear());
|
|
5302
|
+
}
|
|
5303
|
+
if (type.toLocaleLowerCase() === "year-month" && formatDate.length < 3) {
|
|
5304
|
+
formatDate.push(new Date(modelValue || minDate || maxDate).getDate());
|
|
5305
|
+
}
|
|
5306
|
+
const year = Number(formatDate[0]);
|
|
5307
|
+
const month = Number(formatDate[1]) - 1;
|
|
5308
|
+
const day = Math.min(Number(formatDate[2]), getMonthEndDay(Number(formatDate[0]), Number(formatDate[1])));
|
|
5309
|
+
let date = null;
|
|
5310
|
+
if (type.toLocaleLowerCase() === "date" || type.toLocaleLowerCase() === "month-day" || type.toLocaleLowerCase() === "year-month") {
|
|
5311
|
+
date = new Date(year, month, day);
|
|
5312
|
+
} else if (type.toLocaleLowerCase() === "datetime") {
|
|
5313
|
+
date = new Date(year, month, day, Number(formatDate[3]), Number(formatDate[4]));
|
|
5314
|
+
} else if (type.toLocaleLowerCase() === "datehour") {
|
|
5315
|
+
date = new Date(year, month, day, Number(formatDate[3]));
|
|
5316
|
+
}
|
|
5317
|
+
const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date == null ? void 0 : date.getTime());
|
|
5318
|
+
date && isDate(date) && !isEqual2 && setCurrentDate(formatValue(date));
|
|
5319
|
+
}
|
|
5320
|
+
props.onChangeDatePicker && props.onChangeDatePicker(index2, selectedValue, cacheValueData);
|
|
5321
|
+
};
|
|
5322
|
+
const padZero = (num, targetLength = 2) => {
|
|
5323
|
+
let str = `${num}`;
|
|
5324
|
+
while (str.length < targetLength) {
|
|
5325
|
+
str = `0${str}`;
|
|
5326
|
+
}
|
|
5327
|
+
return str;
|
|
5328
|
+
};
|
|
5329
|
+
const formatterOption = (type2, value) => {
|
|
5330
|
+
let fOption = null;
|
|
5331
|
+
if (formatter) {
|
|
5332
|
+
fOption = formatter(type2, {
|
|
5333
|
+
text: padZero(value, 2),
|
|
5334
|
+
value: padZero(value, 2)
|
|
5335
|
+
});
|
|
5336
|
+
} else {
|
|
5337
|
+
const padMin = padZero(value, 2);
|
|
5338
|
+
const fatter = isShowChinese ? zhCNType[type2] : "";
|
|
5339
|
+
fOption = { text: padMin + fatter, value: padMin };
|
|
5138
5340
|
}
|
|
5341
|
+
return fOption;
|
|
5139
5342
|
};
|
|
5140
|
-
const generateValue = (min, max, val, type2) => {
|
|
5141
|
-
|
|
5142
|
-
return;
|
|
5343
|
+
const generateValue = (min, max, val, type2, columnIndex) => {
|
|
5344
|
+
let cmin = min;
|
|
5143
5345
|
const arr = [];
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
} else {
|
|
5148
|
-
arr.push(min);
|
|
5149
|
-
}
|
|
5346
|
+
let index2 = 0;
|
|
5347
|
+
while (cmin <= max) {
|
|
5348
|
+
arr.push(formatterOption(type2, cmin));
|
|
5150
5349
|
if (type2 === "minute") {
|
|
5151
|
-
|
|
5350
|
+
cmin += minuteStep;
|
|
5152
5351
|
} else {
|
|
5153
|
-
|
|
5352
|
+
cmin++;
|
|
5154
5353
|
}
|
|
5354
|
+
if (cmin <= val) {
|
|
5355
|
+
index2++;
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
defaultValue[columnIndex] = arr[index2].value;
|
|
5359
|
+
setDefaultValue([...defaultValue]);
|
|
5360
|
+
if (props.filter && props.filter(type2, arr)) {
|
|
5361
|
+
return props.filter(type2, arr);
|
|
5155
5362
|
}
|
|
5156
5363
|
return arr;
|
|
5157
5364
|
};
|
|
5158
|
-
const getDateIndex = (type2
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5365
|
+
const getDateIndex = (type2) => {
|
|
5366
|
+
if (!currentDate)
|
|
5367
|
+
return 0;
|
|
5368
|
+
let d2 = 0;
|
|
5369
|
+
if (type2 === "year") {
|
|
5370
|
+
d2 = currentDate.getFullYear();
|
|
5371
|
+
} else if (type2 === "month") {
|
|
5372
|
+
d2 = currentDate.getMonth() + 1;
|
|
5373
|
+
} else if (type2 === "day") {
|
|
5374
|
+
d2 = currentDate.getDate();
|
|
5375
|
+
} else if (type2 === "hour") {
|
|
5376
|
+
d2 = currentDate.getHours();
|
|
5377
|
+
} else if (type2 === "minute") {
|
|
5378
|
+
d2 = currentDate.getMinutes();
|
|
5379
|
+
} else if (type2 === "seconds") {
|
|
5380
|
+
d2 = currentDate.getSeconds();
|
|
5381
|
+
}
|
|
5382
|
+
return d2;
|
|
5176
5383
|
};
|
|
5177
5384
|
const columns = (date) => {
|
|
5178
|
-
const val = ranges(date).map((res) => {
|
|
5179
|
-
return generateValue(res.range[0], res.range[1], getDateIndex(res.type
|
|
5385
|
+
const val = ranges(date).map((res, columnIndex) => {
|
|
5386
|
+
return generateValue(res.range[0], res.range[1], getDateIndex(res.type), res.type, columnIndex);
|
|
5180
5387
|
});
|
|
5181
5388
|
return val || [];
|
|
5182
5389
|
};
|
|
5183
5390
|
useEffect(() => {
|
|
5184
|
-
setCurrentDate(modelValue);
|
|
5185
|
-
setListData(columns());
|
|
5186
|
-
initDefault();
|
|
5391
|
+
setCurrentDate(formatValue(modelValue));
|
|
5187
5392
|
}, []);
|
|
5393
|
+
useEffect(() => {
|
|
5394
|
+
setCurrentDate(formatValue(modelValue));
|
|
5395
|
+
}, [modelValue]);
|
|
5188
5396
|
useEffect(() => {
|
|
5189
5397
|
setShow(visible);
|
|
5190
5398
|
}, [visible]);
|
|
5399
|
+
useEffect(() => {
|
|
5400
|
+
if (currentDate) {
|
|
5401
|
+
setListData(columns());
|
|
5402
|
+
}
|
|
5403
|
+
}, [currentDate]);
|
|
5191
5404
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
5192
5405
|
className: `nut-datepicker ${className || ""}`,
|
|
5193
5406
|
style,
|
|
5194
5407
|
...rest
|
|
5195
|
-
}, /* @__PURE__ */ React__default.createElement(Picker, {
|
|
5408
|
+
}, listData.length > 0 && /* @__PURE__ */ React__default.createElement(Picker, {
|
|
5196
5409
|
isVisible: show,
|
|
5197
5410
|
listData,
|
|
5198
5411
|
onClose: onCloseDatePicker,
|
|
5199
5412
|
defaultValueData: defaultValue,
|
|
5200
|
-
onConfirm: (
|
|
5201
|
-
|
|
5413
|
+
onConfirm: (values, options2) => onConfirmDatePicker && onConfirmDatePicker(values, options2),
|
|
5414
|
+
onChange: (index2, value, list) => updateChooseValueCustmer(index2, value, list),
|
|
5415
|
+
threeDimensional,
|
|
5202
5416
|
ref: pickerRef
|
|
5203
5417
|
}));
|
|
5204
5418
|
};
|
|
5205
|
-
DatePicker.defaultProps = defaultProps$
|
|
5419
|
+
DatePicker.defaultProps = defaultProps$L;
|
|
5206
5420
|
DatePicker.displayName = "NutDatePicker";
|
|
5207
|
-
const defaultProps$
|
|
5421
|
+
const defaultProps$K = {
|
|
5208
5422
|
disabled: false,
|
|
5209
5423
|
buttonSize: "",
|
|
5210
5424
|
min: 1,
|
|
@@ -5242,7 +5456,7 @@ const InputNumber = (props) => {
|
|
|
5242
5456
|
focus,
|
|
5243
5457
|
...restProps
|
|
5244
5458
|
} = {
|
|
5245
|
-
...defaultProps$
|
|
5459
|
+
...defaultProps$K,
|
|
5246
5460
|
...props
|
|
5247
5461
|
};
|
|
5248
5462
|
const [inputValue, setInputValue] = useState(modelValue);
|
|
@@ -5363,7 +5577,7 @@ const InputNumber = (props) => {
|
|
|
5363
5577
|
click: addNumber
|
|
5364
5578
|
}));
|
|
5365
5579
|
};
|
|
5366
|
-
InputNumber.defaultProps = defaultProps$
|
|
5580
|
+
InputNumber.defaultProps = defaultProps$K;
|
|
5367
5581
|
InputNumber.displayName = "NutInputNumber";
|
|
5368
5582
|
function trimExtraChar(value, char, regExp) {
|
|
5369
5583
|
const index2 = value.indexOf(char);
|
|
@@ -5389,7 +5603,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
5389
5603
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
5390
5604
|
return value.replace(regExp, "");
|
|
5391
5605
|
}
|
|
5392
|
-
const defaultProps$
|
|
5606
|
+
const defaultProps$J = {
|
|
5393
5607
|
type: "text",
|
|
5394
5608
|
defaultValue: "",
|
|
5395
5609
|
placeholder: "",
|
|
@@ -5472,7 +5686,7 @@ const Input = (props) => {
|
|
|
5472
5686
|
clickRightIcon,
|
|
5473
5687
|
click,
|
|
5474
5688
|
...rest
|
|
5475
|
-
} = { ...defaultProps$
|
|
5689
|
+
} = { ...defaultProps$J, ...props };
|
|
5476
5690
|
locale.placeholder = placeholder || locale.placeholder;
|
|
5477
5691
|
const [inputValue, SetInputValue] = useState("");
|
|
5478
5692
|
const [active, SetActive] = useState(false);
|
|
@@ -5679,14 +5893,14 @@ const Input = (props) => {
|
|
|
5679
5893
|
}
|
|
5680
5894
|
}, errorMessage) : null)));
|
|
5681
5895
|
};
|
|
5682
|
-
Input.defaultProps = defaultProps$
|
|
5896
|
+
Input.defaultProps = defaultProps$J;
|
|
5683
5897
|
Input.displayName = "NutInput";
|
|
5684
5898
|
const radioContext = {
|
|
5685
5899
|
onChange: (val) => {
|
|
5686
5900
|
}
|
|
5687
5901
|
};
|
|
5688
5902
|
var RadioContext = React__default.createContext(radioContext);
|
|
5689
|
-
const defaultProps$
|
|
5903
|
+
const defaultProps$I = {
|
|
5690
5904
|
value: null,
|
|
5691
5905
|
textPosition: "right",
|
|
5692
5906
|
onChange: (value) => {
|
|
@@ -5694,7 +5908,7 @@ const defaultProps$F = {
|
|
|
5694
5908
|
direction: "vertical"
|
|
5695
5909
|
};
|
|
5696
5910
|
const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
5697
|
-
const { children } = { ...defaultProps$
|
|
5911
|
+
const { children } = { ...defaultProps$I, ...props };
|
|
5698
5912
|
cn("RadioGroup");
|
|
5699
5913
|
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
5700
5914
|
const [val2State, setVal2State] = useState(value);
|
|
@@ -5730,9 +5944,9 @@ const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
|
5730
5944
|
...rest
|
|
5731
5945
|
}, cloneChildren()));
|
|
5732
5946
|
});
|
|
5733
|
-
RadioGroup.defaultProps = defaultProps$
|
|
5947
|
+
RadioGroup.defaultProps = defaultProps$I;
|
|
5734
5948
|
RadioGroup.displayName = "NutRadioGroup";
|
|
5735
|
-
const defaultProps$
|
|
5949
|
+
const defaultProps$H = {
|
|
5736
5950
|
disabled: false,
|
|
5737
5951
|
checked: false,
|
|
5738
5952
|
shape: "round",
|
|
@@ -5745,7 +5959,7 @@ const defaultProps$E = {
|
|
|
5745
5959
|
}
|
|
5746
5960
|
};
|
|
5747
5961
|
const Radio = (props) => {
|
|
5748
|
-
const { children } = { ...defaultProps$
|
|
5962
|
+
const { children } = { ...defaultProps$H, ...props };
|
|
5749
5963
|
const {
|
|
5750
5964
|
className,
|
|
5751
5965
|
disabled,
|
|
@@ -5804,10 +6018,10 @@ const Radio = (props) => {
|
|
|
5804
6018
|
...rest
|
|
5805
6019
|
}, props.shape == "button" ? renderButton() : reverseState ? [renderLabel(), renderIcon()] : [renderIcon(), renderLabel()]);
|
|
5806
6020
|
};
|
|
5807
|
-
Radio.defaultProps = defaultProps$
|
|
6021
|
+
Radio.defaultProps = defaultProps$H;
|
|
5808
6022
|
Radio.displayName = "NutRadio";
|
|
5809
6023
|
Radio.RadioGroup = RadioGroup;
|
|
5810
|
-
const defaultProps$
|
|
6024
|
+
const defaultProps$G = {
|
|
5811
6025
|
count: 5,
|
|
5812
6026
|
modelValue: 0,
|
|
5813
6027
|
minimizeValue: 0,
|
|
@@ -5836,7 +6050,7 @@ const Rate = (props) => {
|
|
|
5836
6050
|
allowHalf,
|
|
5837
6051
|
spacing,
|
|
5838
6052
|
change
|
|
5839
|
-
} = { ...defaultProps$
|
|
6053
|
+
} = { ...defaultProps$G, ...props };
|
|
5840
6054
|
const b2 = cn("rate");
|
|
5841
6055
|
const bi = cn("rate-item");
|
|
5842
6056
|
const [countArray, setCountArray] = useState([1, 2, 3, 4, 5]);
|
|
@@ -5900,9 +6114,9 @@ const Rate = (props) => {
|
|
|
5900
6114
|
}));
|
|
5901
6115
|
}));
|
|
5902
6116
|
};
|
|
5903
|
-
Rate.defaultProps = defaultProps$
|
|
6117
|
+
Rate.defaultProps = defaultProps$G;
|
|
5904
6118
|
Rate.displayName = "NutRate";
|
|
5905
|
-
const defaultProps$
|
|
6119
|
+
const defaultProps$F = {
|
|
5906
6120
|
title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
5907
6121
|
desc: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1",
|
|
5908
6122
|
tips: "\u5FD8\u8BB0\u5BC6\u7801",
|
|
@@ -6062,9 +6276,9 @@ const ShortPassword = (props) => {
|
|
|
6062
6276
|
onClick: () => sure()
|
|
6063
6277
|
}, locale.confirm)) : null)));
|
|
6064
6278
|
};
|
|
6065
|
-
ShortPassword.defaultProps = defaultProps$
|
|
6279
|
+
ShortPassword.defaultProps = defaultProps$F;
|
|
6066
6280
|
ShortPassword.displayName = "NutShortPassword";
|
|
6067
|
-
const defaultProps$
|
|
6281
|
+
const defaultProps$E = {
|
|
6068
6282
|
defaultValue: "",
|
|
6069
6283
|
textAlign: "left",
|
|
6070
6284
|
limitshow: false,
|
|
@@ -6092,7 +6306,7 @@ const TextArea = (props) => {
|
|
|
6092
6306
|
onChange,
|
|
6093
6307
|
onBlur,
|
|
6094
6308
|
onFocus
|
|
6095
|
-
} = { ...defaultProps$
|
|
6309
|
+
} = { ...defaultProps$E, ...props };
|
|
6096
6310
|
const textareaBem = cn("textarea");
|
|
6097
6311
|
const [inputValue, SetInputValue] = useState("");
|
|
6098
6312
|
useEffect(() => {
|
|
@@ -6156,7 +6370,7 @@ const TextArea = (props) => {
|
|
|
6156
6370
|
className: textareaBem("limit")
|
|
6157
6371
|
}, inputValue.length, "/", maxlength < 0 ? 0 : maxlength) : null);
|
|
6158
6372
|
};
|
|
6159
|
-
TextArea.defaultProps = defaultProps$
|
|
6373
|
+
TextArea.defaultProps = defaultProps$E;
|
|
6160
6374
|
TextArea.displayName = "NutTextArea";
|
|
6161
6375
|
class UploadOptions {
|
|
6162
6376
|
constructor() {
|
|
@@ -6205,7 +6419,7 @@ class Upload {
|
|
|
6205
6419
|
}
|
|
6206
6420
|
}
|
|
6207
6421
|
}
|
|
6208
|
-
const defaultProps$
|
|
6422
|
+
const defaultProps$D = {
|
|
6209
6423
|
url: "",
|
|
6210
6424
|
maximum: 1,
|
|
6211
6425
|
uploadIcon: "photograph",
|
|
@@ -6280,7 +6494,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6280
6494
|
beforeUpload,
|
|
6281
6495
|
beforeDelete,
|
|
6282
6496
|
...restProps
|
|
6283
|
-
} = { ...defaultProps$
|
|
6497
|
+
} = { ...defaultProps$D, ...props };
|
|
6284
6498
|
const [fileList, setFileList] = useState([]);
|
|
6285
6499
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
6286
6500
|
useEffect(() => {
|
|
@@ -6460,118 +6674,493 @@ const InternalUploader = (props, ref) => {
|
|
|
6460
6674
|
const _files = filterFiles(new Array().slice.call(files));
|
|
6461
6675
|
readFile(_files);
|
|
6462
6676
|
}
|
|
6463
|
-
props.change && props.change({ fileList, event });
|
|
6464
|
-
if (clearInput) {
|
|
6465
|
-
clearInputValue($el);
|
|
6677
|
+
props.change && props.change({ fileList, event });
|
|
6678
|
+
if (clearInput) {
|
|
6679
|
+
clearInputValue($el);
|
|
6680
|
+
}
|
|
6681
|
+
};
|
|
6682
|
+
const handleItemClick = (file) => {
|
|
6683
|
+
fileItemClick && fileItemClick(file);
|
|
6684
|
+
};
|
|
6685
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6686
|
+
className: classes,
|
|
6687
|
+
...restProps
|
|
6688
|
+
}, children && /* @__PURE__ */ React__default.createElement("div", {
|
|
6689
|
+
className: "nut-uploader__slot"
|
|
6690
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, capture ? /* @__PURE__ */ React__default.createElement("input", {
|
|
6691
|
+
className: "nut-uploader__input",
|
|
6692
|
+
type: "file",
|
|
6693
|
+
capture: "user",
|
|
6694
|
+
name,
|
|
6695
|
+
accept,
|
|
6696
|
+
disabled,
|
|
6697
|
+
multiple,
|
|
6698
|
+
onChange: fileChange
|
|
6699
|
+
}) : /* @__PURE__ */ React__default.createElement("input", {
|
|
6700
|
+
className: "nut-uploader__input",
|
|
6701
|
+
type: "file",
|
|
6702
|
+
name,
|
|
6703
|
+
accept,
|
|
6704
|
+
disabled,
|
|
6705
|
+
multiple,
|
|
6706
|
+
onChange: fileChange
|
|
6707
|
+
})))), fileList.length !== 0 && fileList.map((item, index2) => {
|
|
6708
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6709
|
+
className: `nut-uploader__preview ${listType}`,
|
|
6710
|
+
key: item.uid
|
|
6711
|
+
}, listType == "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
|
|
6712
|
+
className: "nut-uploader__preview-img"
|
|
6713
|
+
}, item.status === "ready" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6714
|
+
className: "nut-uploader__preview__progress"
|
|
6715
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6716
|
+
className: "nut-uploader__preview__progress__msg"
|
|
6717
|
+
}, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default.createElement("div", {
|
|
6718
|
+
className: "nut-uploader__preview__progress"
|
|
6719
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6720
|
+
color: "#fff",
|
|
6721
|
+
name: `${item.status == "error" ? "failure" : "loading"}`
|
|
6722
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
6723
|
+
className: "nut-uploader__preview__progress__msg"
|
|
6724
|
+
}, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6725
|
+
color: "rgba(0,0,0,0.6)",
|
|
6726
|
+
className: "close",
|
|
6727
|
+
name: "failure",
|
|
6728
|
+
click: () => onDelete(item, index2)
|
|
6729
|
+
}), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
|
|
6730
|
+
className: "nut-uploader__preview-img__c",
|
|
6731
|
+
src: item.url,
|
|
6732
|
+
onClick: () => handleItemClick(item)
|
|
6733
|
+
})) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, defaultImg ? /* @__PURE__ */ React__default.createElement("img", {
|
|
6734
|
+
className: "nut-uploader__preview-img__c",
|
|
6735
|
+
src: defaultImg,
|
|
6736
|
+
onClick: () => handleItemClick(item)
|
|
6737
|
+
}) : /* @__PURE__ */ React__default.createElement("div", {
|
|
6738
|
+
className: "nut-uploader__preview-img__file"
|
|
6739
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6740
|
+
onClick: () => handleItemClick(item),
|
|
6741
|
+
className: "nut-uploader__preview-img__file__name"
|
|
6742
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6743
|
+
color: "#808080",
|
|
6744
|
+
name: "link"
|
|
6745
|
+
}), "\xA0", item.name))), /* @__PURE__ */ React__default.createElement("div", {
|
|
6746
|
+
className: "tips"
|
|
6747
|
+
}, item.name)), listType == "list" && /* @__PURE__ */ React__default.createElement("div", {
|
|
6748
|
+
className: "nut-uploader__preview-list"
|
|
6749
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6750
|
+
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
6751
|
+
onClick: () => handleItemClick(item)
|
|
6752
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6753
|
+
name: "link"
|
|
6754
|
+
}), "\xA0", item.name), /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6755
|
+
color: "#808080",
|
|
6756
|
+
className: "nut-uploader__preview-img__file__del",
|
|
6757
|
+
name: "del",
|
|
6758
|
+
click: () => onDelete(item, index2)
|
|
6759
|
+
})));
|
|
6760
|
+
}), maximum > fileList.length && listType == "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
|
|
6761
|
+
className: `nut-uploader__upload ${listType}`
|
|
6762
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6763
|
+
size: uploadIconSize,
|
|
6764
|
+
color: "#808080",
|
|
6765
|
+
name: uploadIcon
|
|
6766
|
+
}), capture ? /* @__PURE__ */ React__default.createElement("input", {
|
|
6767
|
+
className: "nut-uploader__input",
|
|
6768
|
+
type: "file",
|
|
6769
|
+
capture: "user",
|
|
6770
|
+
name,
|
|
6771
|
+
accept,
|
|
6772
|
+
disabled,
|
|
6773
|
+
multiple,
|
|
6774
|
+
onChange: fileChange
|
|
6775
|
+
}) : /* @__PURE__ */ React__default.createElement("input", {
|
|
6776
|
+
className: "nut-uploader__input",
|
|
6777
|
+
type: "file",
|
|
6778
|
+
name,
|
|
6779
|
+
accept,
|
|
6780
|
+
disabled,
|
|
6781
|
+
multiple,
|
|
6782
|
+
onChange: fileChange
|
|
6783
|
+
})));
|
|
6784
|
+
};
|
|
6785
|
+
const Uploader = React__default.forwardRef(InternalUploader);
|
|
6786
|
+
Uploader.defaultProps = defaultProps$D;
|
|
6787
|
+
Uploader.displayName = "NutUploader";
|
|
6788
|
+
const defaultProps$C = {
|
|
6789
|
+
placeholder: "",
|
|
6790
|
+
shape: "square",
|
|
6791
|
+
disabled: false,
|
|
6792
|
+
maxLength: 9999,
|
|
6793
|
+
clearable: true,
|
|
6794
|
+
align: "left",
|
|
6795
|
+
readonly: true,
|
|
6796
|
+
autoFocus: false,
|
|
6797
|
+
label: "",
|
|
6798
|
+
leftinIcon: /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6799
|
+
name: "search",
|
|
6800
|
+
size: "12"
|
|
6801
|
+
})
|
|
6802
|
+
};
|
|
6803
|
+
const SearchBar = (props) => {
|
|
6804
|
+
const searchbarBem = cn("searchbar");
|
|
6805
|
+
const { locale } = useConfig();
|
|
6806
|
+
const searchRef = useRef(null);
|
|
6807
|
+
const [value, setValue] = useState(() => props.value);
|
|
6808
|
+
const {
|
|
6809
|
+
placeholder,
|
|
6810
|
+
shape,
|
|
6811
|
+
className,
|
|
6812
|
+
disabled,
|
|
6813
|
+
maxLength,
|
|
6814
|
+
clearable,
|
|
6815
|
+
align,
|
|
6816
|
+
readOnly,
|
|
6817
|
+
autoFocus,
|
|
6818
|
+
label,
|
|
6819
|
+
actionText,
|
|
6820
|
+
leftinIcon,
|
|
6821
|
+
rightinIcon,
|
|
6822
|
+
leftoutIcon,
|
|
6823
|
+
rightoutIcon,
|
|
6824
|
+
onChange,
|
|
6825
|
+
onFocus,
|
|
6826
|
+
onBlur,
|
|
6827
|
+
onClear,
|
|
6828
|
+
onSearch,
|
|
6829
|
+
onClickInput,
|
|
6830
|
+
onClickLeftinIcon,
|
|
6831
|
+
onClickLeftoutIcon,
|
|
6832
|
+
onClickRightinIcon,
|
|
6833
|
+
onClickRightoutIcon
|
|
6834
|
+
} = {
|
|
6835
|
+
...defaultProps$C,
|
|
6836
|
+
...props
|
|
6837
|
+
};
|
|
6838
|
+
const alignClass = `${align}`;
|
|
6839
|
+
const change = (event) => {
|
|
6840
|
+
const { value: value2 } = event.target;
|
|
6841
|
+
onChange && (onChange == null ? void 0 : onChange(value2, event));
|
|
6842
|
+
setValue(value2);
|
|
6843
|
+
};
|
|
6844
|
+
const focus = (event) => {
|
|
6845
|
+
const { value: value2 } = event.target;
|
|
6846
|
+
onFocus && (onFocus == null ? void 0 : onFocus(value2, event));
|
|
6847
|
+
};
|
|
6848
|
+
const blur = (event) => {
|
|
6849
|
+
const searchSelf = searchRef.current;
|
|
6850
|
+
searchSelf && searchSelf.blur();
|
|
6851
|
+
const { value: value2 } = event.target;
|
|
6852
|
+
onBlur && (onBlur == null ? void 0 : onBlur(value2, event));
|
|
6853
|
+
};
|
|
6854
|
+
useEffect(() => {
|
|
6855
|
+
setValue(props.value);
|
|
6856
|
+
}, [props.value]);
|
|
6857
|
+
useEffect(() => {
|
|
6858
|
+
if (autoFocus) {
|
|
6859
|
+
const searchSelf = searchRef.current;
|
|
6860
|
+
searchSelf && searchSelf.focus();
|
|
6861
|
+
}
|
|
6862
|
+
}, [autoFocus]);
|
|
6863
|
+
const renderField = () => {
|
|
6864
|
+
return /* @__PURE__ */ React__default.createElement("input", {
|
|
6865
|
+
className: `${searchbarBem("input")} ${searchbarBem(alignClass)} ${shape === "round" ? searchbarBem("round") : ""} ${clearable ? searchbarBem("input-clear") : ""}`,
|
|
6866
|
+
ref: searchRef,
|
|
6867
|
+
style: { ...props.style, background: props.inputBackground },
|
|
6868
|
+
value: value || "",
|
|
6869
|
+
placeholder: placeholder || locale.placeholder,
|
|
6870
|
+
disabled,
|
|
6871
|
+
readOnly,
|
|
6872
|
+
maxLength,
|
|
6873
|
+
onChange: (e2) => change(e2),
|
|
6874
|
+
onFocus: (e2) => focus(e2),
|
|
6875
|
+
onBlur: (e2) => blur(e2),
|
|
6876
|
+
onClick: (e2) => clickInput(e2)
|
|
6877
|
+
});
|
|
6878
|
+
};
|
|
6879
|
+
const clickInput = (e2) => {
|
|
6880
|
+
onClickInput && onClickInput(e2);
|
|
6881
|
+
};
|
|
6882
|
+
const renderLeftinIcon = () => {
|
|
6883
|
+
if (!leftinIcon)
|
|
6884
|
+
return null;
|
|
6885
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6886
|
+
className: `${searchbarBem("leftin-icon")} ${searchbarBem("icon")}`,
|
|
6887
|
+
onClick: (e2) => clickLeftIcon("in-left", e2)
|
|
6888
|
+
}, leftinIcon);
|
|
6889
|
+
};
|
|
6890
|
+
const renderLeftoutIcon = () => {
|
|
6891
|
+
if (!leftoutIcon)
|
|
6892
|
+
return null;
|
|
6893
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6894
|
+
className: `${searchbarBem("leftout-icon")}`,
|
|
6895
|
+
onClick: (e2) => clickLeftIcon("out-left", e2)
|
|
6896
|
+
}, leftoutIcon);
|
|
6897
|
+
};
|
|
6898
|
+
const clickLeftIcon = (flag, event) => {
|
|
6899
|
+
if (flag === "in-left") {
|
|
6900
|
+
onClickLeftinIcon && onClickLeftinIcon(value, event);
|
|
6901
|
+
} else {
|
|
6902
|
+
onClickLeftoutIcon && onClickLeftoutIcon(value, event);
|
|
6903
|
+
}
|
|
6904
|
+
};
|
|
6905
|
+
const renderRightinIcon = () => {
|
|
6906
|
+
if (!rightinIcon)
|
|
6907
|
+
return null;
|
|
6908
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6909
|
+
className: `${searchbarBem("rightin-icon")} ${searchbarBem("icon")}`,
|
|
6910
|
+
onClick: (e2) => clickRightIcon("in-right", e2)
|
|
6911
|
+
}, rightinIcon);
|
|
6912
|
+
};
|
|
6913
|
+
const renderRightoutIcon = () => {
|
|
6914
|
+
if (!rightoutIcon)
|
|
6915
|
+
return null;
|
|
6916
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6917
|
+
className: `${searchbarBem("rightout-icon")}`,
|
|
6918
|
+
onClick: (e2) => clickRightIcon("out-right", e2)
|
|
6919
|
+
}, rightoutIcon);
|
|
6920
|
+
};
|
|
6921
|
+
const clickRightIcon = (flag, event) => {
|
|
6922
|
+
if (flag === "in-left") {
|
|
6923
|
+
onClickRightinIcon && onClickRightinIcon(value, event);
|
|
6924
|
+
} else {
|
|
6925
|
+
onClickRightoutIcon && onClickRightoutIcon(value, event);
|
|
6926
|
+
}
|
|
6927
|
+
};
|
|
6928
|
+
const handleClear = () => {
|
|
6929
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6930
|
+
className: `${searchbarBem("clear")} ${rightinIcon ? "pos-right" : ""}`,
|
|
6931
|
+
onClick: (e2) => clearaVal(e2)
|
|
6932
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6933
|
+
name: "circle-close",
|
|
6934
|
+
size: "12",
|
|
6935
|
+
color: "#555"
|
|
6936
|
+
}));
|
|
6937
|
+
};
|
|
6938
|
+
const clearaVal = (event) => {
|
|
6939
|
+
if (disabled || readOnly) {
|
|
6940
|
+
return;
|
|
6941
|
+
}
|
|
6942
|
+
setValue("");
|
|
6943
|
+
onClear && onClear(event);
|
|
6944
|
+
};
|
|
6945
|
+
const renderRightLabel = () => {
|
|
6946
|
+
if (actionText) {
|
|
6947
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6948
|
+
className: searchbarBem("action-text"),
|
|
6949
|
+
onClick: search
|
|
6950
|
+
}, actionText);
|
|
6951
|
+
}
|
|
6952
|
+
return null;
|
|
6953
|
+
};
|
|
6954
|
+
const search = () => {
|
|
6955
|
+
onSearch && onSearch(value);
|
|
6956
|
+
};
|
|
6957
|
+
const renderLabel = () => {
|
|
6958
|
+
if (label) {
|
|
6959
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6960
|
+
className: searchbarBem("label")
|
|
6961
|
+
}, label);
|
|
6962
|
+
}
|
|
6963
|
+
return null;
|
|
6964
|
+
};
|
|
6965
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6966
|
+
className: `${searchbarBem()} ${disabled ? searchbarBem("disabled") : ""} ${className || ""}`,
|
|
6967
|
+
style: { ...props.style, background: props.background }
|
|
6968
|
+
}, renderLeftoutIcon(), renderLabel(), /* @__PURE__ */ React__default.createElement("div", {
|
|
6969
|
+
className: `${searchbarBem("content")}`
|
|
6970
|
+
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
6971
|
+
};
|
|
6972
|
+
SearchBar.defaultProps = defaultProps$C;
|
|
6973
|
+
SearchBar.displayName = "NutSearchBar";
|
|
6974
|
+
const defaultProps$B = {
|
|
6975
|
+
confirmText: "",
|
|
6976
|
+
title: "",
|
|
6977
|
+
visible: false,
|
|
6978
|
+
type: "default",
|
|
6979
|
+
customKey: [],
|
|
6980
|
+
className: "",
|
|
6981
|
+
randomKeys: false,
|
|
6982
|
+
popClass: "",
|
|
6983
|
+
onClose: () => {
|
|
6984
|
+
}
|
|
6985
|
+
};
|
|
6986
|
+
const NumberKeyboard = (props) => {
|
|
6987
|
+
const { locale } = useConfig();
|
|
6988
|
+
const {
|
|
6989
|
+
title,
|
|
6990
|
+
confirmText,
|
|
6991
|
+
visible,
|
|
6992
|
+
type,
|
|
6993
|
+
customKey,
|
|
6994
|
+
randomKeys,
|
|
6995
|
+
popClass,
|
|
6996
|
+
style,
|
|
6997
|
+
className,
|
|
6998
|
+
onChange,
|
|
6999
|
+
onDelete,
|
|
7000
|
+
onClose
|
|
7001
|
+
} = props;
|
|
7002
|
+
const b2 = cn("numberkeyboard");
|
|
7003
|
+
const [show, setShow] = useState(visible);
|
|
7004
|
+
const [clickKeyIndex, setClickKeyIndex] = useState(void 0);
|
|
7005
|
+
const [keysList, setKeysList] = useState([]);
|
|
7006
|
+
useEffect(() => {
|
|
7007
|
+
setShow(visible);
|
|
7008
|
+
}, [visible]);
|
|
7009
|
+
const defaultKey = () => {
|
|
7010
|
+
let leftBottomKey = {
|
|
7011
|
+
id: "lock",
|
|
7012
|
+
type: "lock"
|
|
7013
|
+
};
|
|
7014
|
+
if (customKey) {
|
|
7015
|
+
const customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
7016
|
+
if (customKeys.length > 0) {
|
|
7017
|
+
const newCustomKey = customKeys[0];
|
|
7018
|
+
leftBottomKey = {
|
|
7019
|
+
id: newCustomKey,
|
|
7020
|
+
type: "custom"
|
|
7021
|
+
};
|
|
7022
|
+
}
|
|
7023
|
+
}
|
|
7024
|
+
return [
|
|
7025
|
+
...getBasicKeys(),
|
|
7026
|
+
leftBottomKey,
|
|
7027
|
+
{ id: 0, type: "number" },
|
|
7028
|
+
{ id: "delete", type: "delete" }
|
|
7029
|
+
];
|
|
7030
|
+
};
|
|
7031
|
+
const getBasicKeys = () => {
|
|
7032
|
+
const keys = [];
|
|
7033
|
+
for (let i = 1; i <= 9; i++) {
|
|
7034
|
+
keys.push({ id: i, type: "number" });
|
|
7035
|
+
}
|
|
7036
|
+
if (randomKeys) {
|
|
7037
|
+
return keys.sort(() => Math.random() > 0.5 ? 1 : -1);
|
|
7038
|
+
}
|
|
7039
|
+
return keys;
|
|
7040
|
+
};
|
|
7041
|
+
const genCustomKeys = () => {
|
|
7042
|
+
const keys = getBasicKeys();
|
|
7043
|
+
if (!customKey)
|
|
7044
|
+
return [];
|
|
7045
|
+
let customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
7046
|
+
if (customKeys.length > 2) {
|
|
7047
|
+
customKeys = [customKeys[0], customKeys[1]];
|
|
7048
|
+
}
|
|
7049
|
+
if (customKeys.length === 2 && props.title && props.type !== "rightColumn") {
|
|
7050
|
+
customKeys = [customKeys[0]];
|
|
7051
|
+
}
|
|
7052
|
+
if (customKeys.length === 1) {
|
|
7053
|
+
if (props.title && props.type !== "rightColumn") {
|
|
7054
|
+
keys.push({ id: customKeys[0], type: "custom" }, { id: 0, type: "number" }, { id: "delete", type: "delete" });
|
|
7055
|
+
} else {
|
|
7056
|
+
keys.push({ id: 0, type: "number" }, { id: customKeys[0], type: "custom" });
|
|
7057
|
+
}
|
|
7058
|
+
} else if (customKeys.length === 2) {
|
|
7059
|
+
keys.push({ id: customKeys[0], type: "custom" }, { id: 0, type: "number" }, { id: customKeys[1], type: "custom" });
|
|
7060
|
+
}
|
|
7061
|
+
return keys;
|
|
7062
|
+
};
|
|
7063
|
+
useEffect(() => {
|
|
7064
|
+
if (props.type === "rightColumn" || props.title !== "") {
|
|
7065
|
+
setKeysList(genCustomKeys());
|
|
7066
|
+
} else {
|
|
7067
|
+
setKeysList(defaultKey());
|
|
7068
|
+
}
|
|
7069
|
+
}, []);
|
|
7070
|
+
const onTouchstart = (item, event) => {
|
|
7071
|
+
event.stopPropagation();
|
|
7072
|
+
setClickKeyIndex(item.id);
|
|
7073
|
+
if (item.type === "number" || item.type === "custom") {
|
|
7074
|
+
onChange && onChange(item.id);
|
|
7075
|
+
}
|
|
7076
|
+
if (item.type === "lock") {
|
|
7077
|
+
onClose && onClose();
|
|
7078
|
+
}
|
|
7079
|
+
if (item.type === "delete") {
|
|
7080
|
+
onDelete && onDelete();
|
|
6466
7081
|
}
|
|
6467
7082
|
};
|
|
6468
|
-
const
|
|
6469
|
-
|
|
7083
|
+
const onTouchMove = (event) => {
|
|
7084
|
+
event.stopPropagation();
|
|
6470
7085
|
};
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
}
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
}
|
|
6486
|
-
className: "
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
7086
|
+
const onTouchEnd = (event) => {
|
|
7087
|
+
event.preventDefault();
|
|
7088
|
+
setClickKeyIndex(void 0);
|
|
7089
|
+
};
|
|
7090
|
+
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Popup, {
|
|
7091
|
+
visible: show,
|
|
7092
|
+
position: "bottom",
|
|
7093
|
+
popClass,
|
|
7094
|
+
onClickOverlay: onClose,
|
|
7095
|
+
onClickCloseIcon: onClose,
|
|
7096
|
+
overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" }
|
|
7097
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7098
|
+
className: `${b2()} ${className}`,
|
|
7099
|
+
style: { ...style }
|
|
7100
|
+
}, title ? /* @__PURE__ */ React__default.createElement("div", {
|
|
7101
|
+
className: b2("header")
|
|
7102
|
+
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
7103
|
+
className: b2("header__tit")
|
|
7104
|
+
}, title), type === "default" ? /* @__PURE__ */ React__default.createElement("span", {
|
|
7105
|
+
className: b2("header__close"),
|
|
7106
|
+
onClick: onClose
|
|
7107
|
+
}, locale.done) : null) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
7108
|
+
className: b2("body")
|
|
7109
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7110
|
+
className: b2("body__keys")
|
|
7111
|
+
}, keysList == null ? void 0 : keysList.map((item, index2) => {
|
|
6494
7112
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
className: "nut-uploader__preview__progress"
|
|
6501
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6502
|
-
className: "nut-uploader__preview__progress__msg"
|
|
6503
|
-
}, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default.createElement("div", {
|
|
6504
|
-
className: "nut-uploader__preview__progress"
|
|
6505
|
-
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6506
|
-
color: "#fff",
|
|
6507
|
-
name: `${item.status == "error" ? "failure" : "loading"}`
|
|
6508
|
-
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
6509
|
-
className: "nut-uploader__preview__progress__msg"
|
|
6510
|
-
}, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6511
|
-
color: "rgba(0,0,0,0.6)",
|
|
6512
|
-
className: "close",
|
|
6513
|
-
name: "failure",
|
|
6514
|
-
click: () => onDelete(item, index2)
|
|
6515
|
-
}), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
|
|
6516
|
-
className: "nut-uploader__preview-img__c",
|
|
6517
|
-
src: item.url,
|
|
6518
|
-
onClick: () => handleItemClick(item)
|
|
6519
|
-
})) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, defaultImg ? /* @__PURE__ */ React__default.createElement("img", {
|
|
6520
|
-
className: "nut-uploader__preview-img__c",
|
|
6521
|
-
src: defaultImg,
|
|
6522
|
-
onClick: () => handleItemClick(item)
|
|
6523
|
-
}) : /* @__PURE__ */ React__default.createElement("div", {
|
|
6524
|
-
className: "nut-uploader__preview-img__file"
|
|
6525
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6526
|
-
onClick: () => handleItemClick(item),
|
|
6527
|
-
className: "nut-uploader__preview-img__file__name"
|
|
6528
|
-
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6529
|
-
color: "#808080",
|
|
6530
|
-
name: "link"
|
|
6531
|
-
}), "\xA0", item.name))), /* @__PURE__ */ React__default.createElement("div", {
|
|
6532
|
-
className: "tips"
|
|
6533
|
-
}, item.name)), listType == "list" && /* @__PURE__ */ React__default.createElement("div", {
|
|
6534
|
-
className: "nut-uploader__preview-list"
|
|
7113
|
+
key: index2,
|
|
7114
|
+
className: classNames({
|
|
7115
|
+
"key-board-wrapper": true,
|
|
7116
|
+
"key-board-wrapper-large": item.id === 0 && type === "rightColumn" && Array.isArray(customKey) && customKey.length === 1
|
|
7117
|
+
})
|
|
6535
7118
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6536
|
-
className:
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
})
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
}),
|
|
6553
|
-
className: "
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
7119
|
+
className: classNames({
|
|
7120
|
+
key: true,
|
|
7121
|
+
active: item.id === clickKeyIndex,
|
|
7122
|
+
lock: item.type === "lock",
|
|
7123
|
+
delete: item.type === "delete"
|
|
7124
|
+
}),
|
|
7125
|
+
onTouchStart: (event) => onTouchstart(item, event),
|
|
7126
|
+
onTouchMove,
|
|
7127
|
+
onTouchEnd
|
|
7128
|
+
}, item.type === "number" || item.type === "custom" ? /* @__PURE__ */ React__default.createElement("div", null, item.id) : null, item.type === "lock" ? /* @__PURE__ */ React__default.createElement("img", {
|
|
7129
|
+
src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png",
|
|
7130
|
+
alt: ""
|
|
7131
|
+
}) : null, item.type === "delete" ? /* @__PURE__ */ React__default.createElement("img", {
|
|
7132
|
+
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
7133
|
+
alt: ""
|
|
7134
|
+
}) : null));
|
|
7135
|
+
})), type === "rightColumn" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
7136
|
+
className: b2("sidebar")
|
|
7137
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7138
|
+
className: "key-board-wrapper"
|
|
7139
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7140
|
+
className: classNames({
|
|
7141
|
+
key: true,
|
|
7142
|
+
active: clickKeyIndex === "delete"
|
|
7143
|
+
}),
|
|
7144
|
+
onTouchStart: (event) => onTouchstart({ id: "delete", type: "delete" }, event),
|
|
7145
|
+
onTouchMove,
|
|
7146
|
+
onTouchEnd
|
|
7147
|
+
}, /* @__PURE__ */ React__default.createElement("img", {
|
|
7148
|
+
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
7149
|
+
alt: ""
|
|
7150
|
+
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
7151
|
+
className: "key-board-wrapper key-board-finish",
|
|
7152
|
+
onClick: onClose
|
|
7153
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7154
|
+
className: classNames({
|
|
7155
|
+
key: true,
|
|
7156
|
+
finish: true,
|
|
7157
|
+
activeFinsh: clickKeyIndex === "finish"
|
|
7158
|
+
})
|
|
7159
|
+
}, confirmText || locale.done))) : null))));
|
|
6570
7160
|
};
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
const defaultProps$z = {
|
|
7161
|
+
NumberKeyboard.defaultProps = defaultProps$B;
|
|
7162
|
+
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
7163
|
+
const defaultProps$A = {
|
|
6575
7164
|
cancelTxt: "",
|
|
6576
7165
|
optionTag: "name",
|
|
6577
7166
|
optionSubTag: "subname",
|
|
@@ -6604,7 +7193,7 @@ const ActionSheet = (props) => {
|
|
|
6604
7193
|
className,
|
|
6605
7194
|
style,
|
|
6606
7195
|
...rest
|
|
6607
|
-
} = { ...defaultProps$
|
|
7196
|
+
} = { ...defaultProps$A, ...props };
|
|
6608
7197
|
const b2 = cn("actionsheet");
|
|
6609
7198
|
const isHighlight = (item) => {
|
|
6610
7199
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -6648,9 +7237,9 @@ const ActionSheet = (props) => {
|
|
|
6648
7237
|
onClick: () => cancelActionSheet()
|
|
6649
7238
|
}, cancelTxt)));
|
|
6650
7239
|
};
|
|
6651
|
-
ActionSheet.defaultProps = defaultProps$
|
|
7240
|
+
ActionSheet.defaultProps = defaultProps$A;
|
|
6652
7241
|
ActionSheet.displayName = "NutActionSheet";
|
|
6653
|
-
const defaultProps$
|
|
7242
|
+
const defaultProps$z = {
|
|
6654
7243
|
bottom: 20,
|
|
6655
7244
|
right: 10,
|
|
6656
7245
|
elId: "body",
|
|
@@ -6673,7 +7262,7 @@ const BackTop = (props) => {
|
|
|
6673
7262
|
style,
|
|
6674
7263
|
onClick
|
|
6675
7264
|
} = {
|
|
6676
|
-
...defaultProps$
|
|
7265
|
+
...defaultProps$z,
|
|
6677
7266
|
...props
|
|
6678
7267
|
};
|
|
6679
7268
|
const [backTop, SetBackTop] = useState(false);
|
|
@@ -6762,7 +7351,7 @@ const BackTop = (props) => {
|
|
|
6762
7351
|
name: "top"
|
|
6763
7352
|
}));
|
|
6764
7353
|
};
|
|
6765
|
-
BackTop.defaultProps = defaultProps$
|
|
7354
|
+
BackTop.defaultProps = defaultProps$z;
|
|
6766
7355
|
BackTop.displayName = "NutBackTop";
|
|
6767
7356
|
function clamp(v2, min, max) {
|
|
6768
7357
|
return Math.max(min, Math.min(v2, max));
|
|
@@ -11165,7 +11754,7 @@ const host = createHost(primitives, {
|
|
|
11165
11754
|
}
|
|
11166
11755
|
});
|
|
11167
11756
|
const animated = host.animated;
|
|
11168
|
-
const defaultProps$
|
|
11757
|
+
const defaultProps$y = {
|
|
11169
11758
|
attract: false,
|
|
11170
11759
|
direction: void 0,
|
|
11171
11760
|
boundary: {
|
|
@@ -11178,7 +11767,7 @@ const defaultProps$x = {
|
|
|
11178
11767
|
};
|
|
11179
11768
|
const Drag = (props) => {
|
|
11180
11769
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
11181
|
-
...defaultProps$
|
|
11770
|
+
...defaultProps$y,
|
|
11182
11771
|
...props
|
|
11183
11772
|
};
|
|
11184
11773
|
const b2 = cn("drag");
|
|
@@ -11237,7 +11826,7 @@ const Drag = (props) => {
|
|
|
11237
11826
|
...bind()
|
|
11238
11827
|
}, children));
|
|
11239
11828
|
};
|
|
11240
|
-
Drag.defaultProps = defaultProps$
|
|
11829
|
+
Drag.defaultProps = defaultProps$y;
|
|
11241
11830
|
Drag.displayName = "NutDrag";
|
|
11242
11831
|
const Content = (props) => {
|
|
11243
11832
|
const {
|
|
@@ -11429,7 +12018,7 @@ function confirm(config2, renderFunc) {
|
|
|
11429
12018
|
update: update2
|
|
11430
12019
|
};
|
|
11431
12020
|
}
|
|
11432
|
-
const defaultProps$
|
|
12021
|
+
const defaultProps$x = {
|
|
11433
12022
|
okText: "",
|
|
11434
12023
|
cancelText: "",
|
|
11435
12024
|
mask: true,
|
|
@@ -11520,9 +12109,9 @@ Dialog.confirm = (props) => {
|
|
|
11520
12109
|
});
|
|
11521
12110
|
};
|
|
11522
12111
|
});
|
|
11523
|
-
Dialog.defaultProps = defaultProps$
|
|
12112
|
+
Dialog.defaultProps = defaultProps$x;
|
|
11524
12113
|
Dialog.displayName = "NutDialog";
|
|
11525
|
-
const defaultProps$
|
|
12114
|
+
const defaultProps$w = {
|
|
11526
12115
|
hasMore: true,
|
|
11527
12116
|
threshold: 200,
|
|
11528
12117
|
containerId: "",
|
|
@@ -11556,7 +12145,7 @@ const Infiniteloading = (props) => {
|
|
|
11556
12145
|
scrollChange,
|
|
11557
12146
|
...restProps
|
|
11558
12147
|
} = {
|
|
11559
|
-
...defaultProps$
|
|
12148
|
+
...defaultProps$w,
|
|
11560
12149
|
...props
|
|
11561
12150
|
};
|
|
11562
12151
|
const [isInfiniting, setIsInfiniting] = useState(false);
|
|
@@ -11713,7 +12302,7 @@ const Infiniteloading = (props) => {
|
|
|
11713
12302
|
className: "tips"
|
|
11714
12303
|
}, locale.infiniteloading.loadMoreText || loadMoreTxt)));
|
|
11715
12304
|
};
|
|
11716
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
12305
|
+
Infiniteloading.defaultProps = defaultProps$w;
|
|
11717
12306
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
11718
12307
|
class Notification extends React.PureComponent {
|
|
11719
12308
|
constructor(props) {
|
|
@@ -11872,7 +12461,7 @@ var Notify = {
|
|
|
11872
12461
|
}
|
|
11873
12462
|
}
|
|
11874
12463
|
};
|
|
11875
|
-
const defaultProps$
|
|
12464
|
+
const defaultProps$v = {
|
|
11876
12465
|
isAsync: false,
|
|
11877
12466
|
checked: false,
|
|
11878
12467
|
disable: false,
|
|
@@ -11895,7 +12484,7 @@ const Switch = (props) => {
|
|
|
11895
12484
|
className,
|
|
11896
12485
|
style
|
|
11897
12486
|
} = {
|
|
11898
|
-
...defaultProps$
|
|
12487
|
+
...defaultProps$v,
|
|
11899
12488
|
...props
|
|
11900
12489
|
};
|
|
11901
12490
|
const [value, setValue] = useState(false);
|
|
@@ -11935,10 +12524,10 @@ const Switch = (props) => {
|
|
|
11935
12524
|
className: `${b2("label")} close`
|
|
11936
12525
|
}, inactiveText))));
|
|
11937
12526
|
};
|
|
11938
|
-
Switch.defaultProps = defaultProps$
|
|
12527
|
+
Switch.defaultProps = defaultProps$v;
|
|
11939
12528
|
Switch.displayName = "NutSwitch";
|
|
11940
12529
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
11941
|
-
const defaultProps$
|
|
12530
|
+
const defaultProps$u = {
|
|
11942
12531
|
strokeWidth: 5,
|
|
11943
12532
|
radius: 50,
|
|
11944
12533
|
strokeLinecap: "round",
|
|
@@ -11961,7 +12550,7 @@ const CircleProgress = (props) => {
|
|
|
11961
12550
|
strokeLinecap,
|
|
11962
12551
|
...restProps
|
|
11963
12552
|
} = {
|
|
11964
|
-
...defaultProps$
|
|
12553
|
+
...defaultProps$u,
|
|
11965
12554
|
...props
|
|
11966
12555
|
};
|
|
11967
12556
|
const b2 = cn("circleprogress");
|
|
@@ -12045,9 +12634,9 @@ const CircleProgress = (props) => {
|
|
|
12045
12634
|
className: "nut-circleprogress-text"
|
|
12046
12635
|
}, children || /* @__PURE__ */ React__default.createElement("div", null, progress, "%")));
|
|
12047
12636
|
};
|
|
12048
|
-
CircleProgress.defaultProps = defaultProps$
|
|
12637
|
+
CircleProgress.defaultProps = defaultProps$u;
|
|
12049
12638
|
CircleProgress.displayName = "NutCircleProgress";
|
|
12050
|
-
const defaultProps$
|
|
12639
|
+
const defaultProps$t = {
|
|
12051
12640
|
direction: "across",
|
|
12052
12641
|
list: [],
|
|
12053
12642
|
standTime: 1e3,
|
|
@@ -12085,7 +12674,7 @@ const NoticeBar = (props) => {
|
|
|
12085
12674
|
rightIcon,
|
|
12086
12675
|
close,
|
|
12087
12676
|
click
|
|
12088
|
-
} = { ...defaultProps$
|
|
12677
|
+
} = { ...defaultProps$t, ...props };
|
|
12089
12678
|
const wrap = useRef(null);
|
|
12090
12679
|
const content = useRef(null);
|
|
12091
12680
|
const [showNoticeBar, SetShowNoticeBar] = useState(true);
|
|
@@ -12298,16 +12887,16 @@ const NoticeBar = (props) => {
|
|
|
12298
12887
|
size: "11px"
|
|
12299
12888
|
}) : null))) : null);
|
|
12300
12889
|
};
|
|
12301
|
-
NoticeBar.defaultProps = defaultProps$
|
|
12890
|
+
NoticeBar.defaultProps = defaultProps$t;
|
|
12302
12891
|
NoticeBar.displayName = "NutNoticeBar";
|
|
12303
12892
|
const DataContext$1 = createContext({});
|
|
12304
|
-
const defaultProps$
|
|
12893
|
+
const defaultProps$s = {
|
|
12305
12894
|
current: 0,
|
|
12306
12895
|
direction: "horizontal",
|
|
12307
12896
|
progressDot: false
|
|
12308
12897
|
};
|
|
12309
12898
|
const Steps = (props) => {
|
|
12310
|
-
const propSteps = { ...defaultProps$
|
|
12899
|
+
const propSteps = { ...defaultProps$s, ...props };
|
|
12311
12900
|
const {
|
|
12312
12901
|
children,
|
|
12313
12902
|
current,
|
|
@@ -12332,9 +12921,9 @@ const Steps = (props) => {
|
|
|
12332
12921
|
...restProps
|
|
12333
12922
|
}, children));
|
|
12334
12923
|
};
|
|
12335
|
-
Steps.defaultProps = defaultProps$
|
|
12924
|
+
Steps.defaultProps = defaultProps$s;
|
|
12336
12925
|
Steps.displayName = "NutSteps";
|
|
12337
|
-
const defaultProps$
|
|
12926
|
+
const defaultProps$r = {
|
|
12338
12927
|
title: "",
|
|
12339
12928
|
content: "",
|
|
12340
12929
|
activeIndex: 0,
|
|
@@ -12355,7 +12944,7 @@ const Step = (props) => {
|
|
|
12355
12944
|
renderContent,
|
|
12356
12945
|
...restProps
|
|
12357
12946
|
} = {
|
|
12358
|
-
...defaultProps$
|
|
12947
|
+
...defaultProps$r,
|
|
12359
12948
|
...props
|
|
12360
12949
|
};
|
|
12361
12950
|
const parent = useContext$1(DataContext$1);
|
|
@@ -12412,10 +13001,10 @@ const Step = (props) => {
|
|
|
12412
13001
|
className: "nut-step-content"
|
|
12413
13002
|
}, renderContent())));
|
|
12414
13003
|
};
|
|
12415
|
-
Step.defaultProps = defaultProps$
|
|
13004
|
+
Step.defaultProps = defaultProps$r;
|
|
12416
13005
|
Step.displayName = "NutStep";
|
|
12417
13006
|
const DataContext = createContext({});
|
|
12418
|
-
const defaultProps$
|
|
13007
|
+
const defaultProps$q = {
|
|
12419
13008
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
12420
13009
|
height: 0,
|
|
12421
13010
|
duration: 500,
|
|
@@ -12432,7 +13021,7 @@ const defaultProps$p = {
|
|
|
12432
13021
|
};
|
|
12433
13022
|
const DISTANCE = 5;
|
|
12434
13023
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
12435
|
-
const propSwiper = { ...defaultProps$
|
|
13024
|
+
const propSwiper = { ...defaultProps$q, ...props };
|
|
12436
13025
|
const {
|
|
12437
13026
|
children,
|
|
12438
13027
|
direction,
|
|
@@ -12821,13 +13410,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12821
13410
|
});
|
|
12822
13411
|
})) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
|
|
12823
13412
|
});
|
|
12824
|
-
Swiper.defaultProps = defaultProps$
|
|
13413
|
+
Swiper.defaultProps = defaultProps$q;
|
|
12825
13414
|
Swiper.displayName = "NutSwiper";
|
|
12826
|
-
const defaultProps$
|
|
13415
|
+
const defaultProps$p = {
|
|
12827
13416
|
direction: "horizontal"
|
|
12828
13417
|
};
|
|
12829
13418
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
12830
|
-
const _props = { ...defaultProps$
|
|
13419
|
+
const _props = { ...defaultProps$p, ...props };
|
|
12831
13420
|
const { children, direction, size } = _props;
|
|
12832
13421
|
const parent = useContext$1(DataContext);
|
|
12833
13422
|
const [offset, setOffset] = useState(0);
|
|
@@ -12852,10 +13441,10 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
12852
13441
|
style: style()
|
|
12853
13442
|
}, children);
|
|
12854
13443
|
});
|
|
12855
|
-
SwiperItem.defaultProps = defaultProps$
|
|
13444
|
+
SwiperItem.defaultProps = defaultProps$p;
|
|
12856
13445
|
SwiperItem.displayName = "NutSwiperItem";
|
|
12857
13446
|
const AvatarContext = createContext({});
|
|
12858
|
-
const defaultProps$
|
|
13447
|
+
const defaultProps$o = {
|
|
12859
13448
|
size: "",
|
|
12860
13449
|
icon: "",
|
|
12861
13450
|
bgColor: "#eee",
|
|
@@ -12882,7 +13471,7 @@ const Avatar = (props) => {
|
|
|
12882
13471
|
onError,
|
|
12883
13472
|
...rest
|
|
12884
13473
|
} = {
|
|
12885
|
-
...defaultProps$
|
|
13474
|
+
...defaultProps$o,
|
|
12886
13475
|
...props
|
|
12887
13476
|
};
|
|
12888
13477
|
const [maxSum, setMaxSum] = useState(0);
|
|
@@ -12962,9 +13551,9 @@ const Avatar = (props) => {
|
|
|
12962
13551
|
className: "text"
|
|
12963
13552
|
}, ((_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)}`)));
|
|
12964
13553
|
};
|
|
12965
|
-
Avatar.defaultProps = defaultProps$
|
|
13554
|
+
Avatar.defaultProps = defaultProps$o;
|
|
12966
13555
|
Avatar.displayName = "NutAvatar";
|
|
12967
|
-
const defaultProps$
|
|
13556
|
+
const defaultProps$n = {
|
|
12968
13557
|
maxContent: "",
|
|
12969
13558
|
maxCount: "",
|
|
12970
13559
|
maxBgColor: "#eee",
|
|
@@ -12976,7 +13565,7 @@ const defaultProps$m = {
|
|
|
12976
13565
|
};
|
|
12977
13566
|
const AvatarGroup = (props) => {
|
|
12978
13567
|
useConfig();
|
|
12979
|
-
const propAvatarGroup = { ...defaultProps$
|
|
13568
|
+
const propAvatarGroup = { ...defaultProps$n, ...props };
|
|
12980
13569
|
const { className, style, children } = propAvatarGroup;
|
|
12981
13570
|
const avatarGroupRef = useRef(null);
|
|
12982
13571
|
const b2 = cn("avatar-group");
|
|
@@ -12993,9 +13582,9 @@ const AvatarGroup = (props) => {
|
|
|
12993
13582
|
ref: avatarGroupRef
|
|
12994
13583
|
}, children));
|
|
12995
13584
|
};
|
|
12996
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
13585
|
+
AvatarGroup.defaultProps = defaultProps$n;
|
|
12997
13586
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
12998
|
-
const defaultProps$
|
|
13587
|
+
const defaultProps$m = {
|
|
12999
13588
|
price: 0,
|
|
13000
13589
|
needSymbol: true,
|
|
13001
13590
|
symbol: "¥",
|
|
@@ -13013,7 +13602,7 @@ const Price = (props) => {
|
|
|
13013
13602
|
className,
|
|
13014
13603
|
...rest
|
|
13015
13604
|
} = {
|
|
13016
|
-
...defaultProps$
|
|
13605
|
+
...defaultProps$m,
|
|
13017
13606
|
...props
|
|
13018
13607
|
};
|
|
13019
13608
|
const b2 = cn("price");
|
|
@@ -13066,9 +13655,9 @@ const Price = (props) => {
|
|
|
13066
13655
|
className: `${b2("small")}`
|
|
13067
13656
|
}, formatDecimal(price)));
|
|
13068
13657
|
};
|
|
13069
|
-
Price.defaultProps = defaultProps$
|
|
13658
|
+
Price.defaultProps = defaultProps$m;
|
|
13070
13659
|
Price.displayName = "NutPrice";
|
|
13071
|
-
const defaultProps$
|
|
13660
|
+
const defaultProps$l = {
|
|
13072
13661
|
value: "",
|
|
13073
13662
|
dot: false,
|
|
13074
13663
|
max: 1e4,
|
|
@@ -13080,7 +13669,7 @@ const defaultProps$k = {
|
|
|
13080
13669
|
};
|
|
13081
13670
|
const Badge = (props) => {
|
|
13082
13671
|
const { children, dot, top, right, zIndex, color, icons } = {
|
|
13083
|
-
...defaultProps$
|
|
13672
|
+
...defaultProps$l,
|
|
13084
13673
|
...props
|
|
13085
13674
|
};
|
|
13086
13675
|
const content = () => {
|
|
@@ -13115,9 +13704,9 @@ const Badge = (props) => {
|
|
|
13115
13704
|
style: getStyle()
|
|
13116
13705
|
}, content()));
|
|
13117
13706
|
};
|
|
13118
|
-
Badge.defaultProps = defaultProps$
|
|
13707
|
+
Badge.defaultProps = defaultProps$l;
|
|
13119
13708
|
Badge.displayName = "NutBadge";
|
|
13120
|
-
const defaultProps$
|
|
13709
|
+
const defaultProps$k = {
|
|
13121
13710
|
type: "default",
|
|
13122
13711
|
color: "",
|
|
13123
13712
|
textColor: "",
|
|
@@ -13125,8 +13714,9 @@ const defaultProps$j = {
|
|
|
13125
13714
|
round: false,
|
|
13126
13715
|
mark: false,
|
|
13127
13716
|
closeable: false,
|
|
13128
|
-
isShow: true,
|
|
13129
13717
|
prefixCls: "nut-tag",
|
|
13718
|
+
onClose: (e2) => {
|
|
13719
|
+
},
|
|
13130
13720
|
onClick: (e2) => {
|
|
13131
13721
|
}
|
|
13132
13722
|
};
|
|
@@ -13141,13 +13731,14 @@ const Tag = (props) => {
|
|
|
13141
13731
|
mark,
|
|
13142
13732
|
closeable,
|
|
13143
13733
|
textColor,
|
|
13144
|
-
|
|
13145
|
-
|
|
13734
|
+
onClick,
|
|
13735
|
+
onClose
|
|
13146
13736
|
} = {
|
|
13147
|
-
...defaultProps$
|
|
13737
|
+
...defaultProps$k,
|
|
13148
13738
|
...props
|
|
13149
13739
|
};
|
|
13150
13740
|
const [btnName, setBtnName] = useState("");
|
|
13741
|
+
const [isTagShow, setIsTagShow] = useState(true);
|
|
13151
13742
|
useEffect(() => {
|
|
13152
13743
|
setBtnName(classes());
|
|
13153
13744
|
}, [
|
|
@@ -13159,8 +13750,8 @@ const Tag = (props) => {
|
|
|
13159
13750
|
mark,
|
|
13160
13751
|
closeable,
|
|
13161
13752
|
prefixCls,
|
|
13162
|
-
|
|
13163
|
-
|
|
13753
|
+
onClick,
|
|
13754
|
+
onClose
|
|
13164
13755
|
]);
|
|
13165
13756
|
const classes = () => {
|
|
13166
13757
|
const prefixCls2 = "nut-tag";
|
|
@@ -13191,18 +13782,23 @@ const Tag = (props) => {
|
|
|
13191
13782
|
}
|
|
13192
13783
|
return style;
|
|
13193
13784
|
};
|
|
13194
|
-
return /* @__PURE__ */ React__default.createElement("div", null, closeable ?
|
|
13785
|
+
return /* @__PURE__ */ React__default.createElement("div", null, closeable ? isTagShow && /* @__PURE__ */ React__default.createElement("div", {
|
|
13195
13786
|
className: `${btnName}`,
|
|
13196
13787
|
style: getStyle(),
|
|
13197
13788
|
onClick: (e2) => handleClick(e2)
|
|
13198
13789
|
}, children && /* @__PURE__ */ React__default.createElement("span", {
|
|
13199
13790
|
className: "text"
|
|
13200
|
-
}, children),
|
|
13791
|
+
}, children), /* @__PURE__ */ React__default.createElement(Icon, {
|
|
13201
13792
|
className: "_icon",
|
|
13202
13793
|
name: "close",
|
|
13203
13794
|
size: "12",
|
|
13204
|
-
|
|
13205
|
-
|
|
13795
|
+
click: (e2) => {
|
|
13796
|
+
setIsTagShow(false);
|
|
13797
|
+
if (props.onClose) {
|
|
13798
|
+
props.onClose(e2);
|
|
13799
|
+
}
|
|
13800
|
+
}
|
|
13801
|
+
})) : /* @__PURE__ */ React__default.createElement("div", {
|
|
13206
13802
|
className: `${btnName}`,
|
|
13207
13803
|
style: getStyle(),
|
|
13208
13804
|
onClick: (e2) => handleClick(e2)
|
|
@@ -13210,7 +13806,7 @@ const Tag = (props) => {
|
|
|
13210
13806
|
className: "text"
|
|
13211
13807
|
}, children)));
|
|
13212
13808
|
};
|
|
13213
|
-
Tag.defaultProps = defaultProps$
|
|
13809
|
+
Tag.defaultProps = defaultProps$k;
|
|
13214
13810
|
Tag.displayName = "NutTag";
|
|
13215
13811
|
function fillRef(ref, node) {
|
|
13216
13812
|
if (typeof ref === "function") {
|
|
@@ -13269,7 +13865,7 @@ const getEleAttr = (ele) => {
|
|
|
13269
13865
|
}
|
|
13270
13866
|
return null;
|
|
13271
13867
|
};
|
|
13272
|
-
const defaultProps$
|
|
13868
|
+
const defaultProps$j = {
|
|
13273
13869
|
list: [],
|
|
13274
13870
|
theme: "light",
|
|
13275
13871
|
location: "bottom",
|
|
@@ -13290,7 +13886,7 @@ const Popover = (props) => {
|
|
|
13290
13886
|
onClick,
|
|
13291
13887
|
...reset
|
|
13292
13888
|
} = {
|
|
13293
|
-
...defaultProps$
|
|
13889
|
+
...defaultProps$j,
|
|
13294
13890
|
...props
|
|
13295
13891
|
};
|
|
13296
13892
|
const goodItem = useRef(null);
|
|
@@ -13399,9 +13995,9 @@ const Popover = (props) => {
|
|
|
13399
13995
|
}, item.name));
|
|
13400
13996
|
})) : null)));
|
|
13401
13997
|
};
|
|
13402
|
-
Popover.defaultProps = defaultProps$
|
|
13998
|
+
Popover.defaultProps = defaultProps$j;
|
|
13403
13999
|
Popover.displayName = "NutPopover";
|
|
13404
|
-
const defaultProps$
|
|
14000
|
+
const defaultProps$i = {
|
|
13405
14001
|
width: "100px",
|
|
13406
14002
|
height: "100px",
|
|
13407
14003
|
row: 1,
|
|
@@ -13429,7 +14025,7 @@ const Skeleton = (props) => {
|
|
|
13429
14025
|
avatarShape,
|
|
13430
14026
|
...restProps
|
|
13431
14027
|
} = {
|
|
13432
|
-
...defaultProps$
|
|
14028
|
+
...defaultProps$i,
|
|
13433
14029
|
...props
|
|
13434
14030
|
};
|
|
13435
14031
|
const b2 = cn("skeleton");
|
|
@@ -13484,9 +14080,9 @@ const Skeleton = (props) => {
|
|
|
13484
14080
|
});
|
|
13485
14081
|
})))));
|
|
13486
14082
|
};
|
|
13487
|
-
Skeleton.defaultProps = defaultProps$
|
|
14083
|
+
Skeleton.defaultProps = defaultProps$i;
|
|
13488
14084
|
Skeleton.displayName = "NutSkeleton";
|
|
13489
|
-
const defaultProps$
|
|
14085
|
+
const defaultProps$h = {
|
|
13490
14086
|
showPlainText: false,
|
|
13491
14087
|
showDays: false,
|
|
13492
14088
|
paused: false,
|
|
@@ -13509,7 +14105,7 @@ const CountDown = (props) => {
|
|
|
13509
14105
|
onUpdate,
|
|
13510
14106
|
children,
|
|
13511
14107
|
...rest
|
|
13512
|
-
} = { ...defaultProps$
|
|
14108
|
+
} = { ...defaultProps$h, ...props };
|
|
13513
14109
|
const b2 = cn("countdown");
|
|
13514
14110
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
13515
14111
|
const stateRef = useRef({
|
|
@@ -13656,9 +14252,9 @@ const CountDown = (props) => {
|
|
|
13656
14252
|
className: b2("block")
|
|
13657
14253
|
}, resttime.s))));
|
|
13658
14254
|
};
|
|
13659
|
-
CountDown.defaultProps = defaultProps$
|
|
14255
|
+
CountDown.defaultProps = defaultProps$h;
|
|
13660
14256
|
CountDown.displayName = "NutCountDown";
|
|
13661
|
-
const defaultProps$
|
|
14257
|
+
const defaultProps$g = {
|
|
13662
14258
|
activeName: ["0"],
|
|
13663
14259
|
accordion: false,
|
|
13664
14260
|
icon: "",
|
|
@@ -13680,7 +14276,7 @@ const Collapse = memo((props) => {
|
|
|
13680
14276
|
iconColor,
|
|
13681
14277
|
change
|
|
13682
14278
|
} = {
|
|
13683
|
-
...defaultProps$
|
|
14279
|
+
...defaultProps$g,
|
|
13684
14280
|
...props
|
|
13685
14281
|
};
|
|
13686
14282
|
const childrenDom = React__default.Children.toArray(children);
|
|
@@ -13735,9 +14331,9 @@ const Collapse = memo((props) => {
|
|
|
13735
14331
|
});
|
|
13736
14332
|
}));
|
|
13737
14333
|
}, areEqual);
|
|
13738
|
-
Collapse.defaultProps = defaultProps$
|
|
14334
|
+
Collapse.defaultProps = defaultProps$g;
|
|
13739
14335
|
Collapse.displayName = "NutCollapse";
|
|
13740
|
-
const defaultProps$
|
|
14336
|
+
const defaultProps$f = {
|
|
13741
14337
|
title: "",
|
|
13742
14338
|
name: "",
|
|
13743
14339
|
isOpen: false,
|
|
@@ -13771,7 +14367,7 @@ const CollapseItem = (props) => {
|
|
|
13771
14367
|
iconColor,
|
|
13772
14368
|
...rest
|
|
13773
14369
|
} = {
|
|
13774
|
-
...defaultProps$
|
|
14370
|
+
...defaultProps$f,
|
|
13775
14371
|
...props
|
|
13776
14372
|
};
|
|
13777
14373
|
const [domHeight, setDomHeight] = useState(-1);
|
|
@@ -13840,9 +14436,9 @@ const CollapseItem = (props) => {
|
|
|
13840
14436
|
className: colBem("content-text")
|
|
13841
14437
|
}, children)));
|
|
13842
14438
|
};
|
|
13843
|
-
CollapseItem.defaultProps = defaultProps$
|
|
14439
|
+
CollapseItem.defaultProps = defaultProps$f;
|
|
13844
14440
|
CollapseItem.displayName = "NutCollapseItem";
|
|
13845
|
-
const defaultProps$
|
|
14441
|
+
const defaultProps$e = {
|
|
13846
14442
|
maxLen: 0,
|
|
13847
14443
|
endNumber: "",
|
|
13848
14444
|
delaySpeed: 300,
|
|
@@ -13860,7 +14456,7 @@ const CountUp = (props) => {
|
|
|
13860
14456
|
thousands,
|
|
13861
14457
|
...reset
|
|
13862
14458
|
} = {
|
|
13863
|
-
...defaultProps$
|
|
14459
|
+
...defaultProps$e,
|
|
13864
14460
|
...props
|
|
13865
14461
|
};
|
|
13866
14462
|
const b2 = cn("countup");
|
|
@@ -13926,9 +14522,9 @@ const CountUp = (props) => {
|
|
|
13926
14522
|
}, item));
|
|
13927
14523
|
})));
|
|
13928
14524
|
};
|
|
13929
|
-
CountUp.defaultProps = defaultProps$
|
|
14525
|
+
CountUp.defaultProps = defaultProps$e;
|
|
13930
14526
|
CountUp.displayName = "NutCountUp";
|
|
13931
|
-
const defaultProps$
|
|
14527
|
+
const defaultProps$d = {};
|
|
13932
14528
|
class AnimatingNumbers extends Component {
|
|
13933
14529
|
constructor(props) {
|
|
13934
14530
|
super(props);
|
|
@@ -13940,7 +14536,7 @@ class AnimatingNumbers extends Component {
|
|
|
13940
14536
|
});
|
|
13941
14537
|
}
|
|
13942
14538
|
}
|
|
13943
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
14539
|
+
AnimatingNumbers.defaultProps = defaultProps$d;
|
|
13944
14540
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
13945
14541
|
AnimatingNumbers.CountUp = CountUp;
|
|
13946
14542
|
AnimatingNumbers.CountUp = CountUp;
|
|
@@ -13949,7 +14545,7 @@ const defaultStatus = {
|
|
|
13949
14545
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
13950
14546
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
13951
14547
|
};
|
|
13952
|
-
const defaultProps$
|
|
14548
|
+
const defaultProps$c = {
|
|
13953
14549
|
description: "\u65E0\u5185\u5BB9",
|
|
13954
14550
|
image: "empty",
|
|
13955
14551
|
imageSize: "",
|
|
@@ -13957,9 +14553,9 @@ const defaultProps$b = {
|
|
|
13957
14553
|
};
|
|
13958
14554
|
const Empty = (props) => {
|
|
13959
14555
|
const { locale } = useConfig();
|
|
13960
|
-
defaultProps$
|
|
14556
|
+
defaultProps$c.description = locale.noData || defaultProps$c.description;
|
|
13961
14557
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
13962
|
-
...defaultProps$
|
|
14558
|
+
...defaultProps$c,
|
|
13963
14559
|
...props
|
|
13964
14560
|
};
|
|
13965
14561
|
const [imgStyle, setImgStyle] = useState({});
|
|
@@ -14001,7 +14597,7 @@ const Empty = (props) => {
|
|
|
14001
14597
|
className: b2("description")
|
|
14002
14598
|
}, description) : { description }, children);
|
|
14003
14599
|
};
|
|
14004
|
-
Empty.defaultProps = defaultProps$
|
|
14600
|
+
Empty.defaultProps = defaultProps$c;
|
|
14005
14601
|
Empty.displayName = "NutEmpty";
|
|
14006
14602
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
14007
14603
|
let index2 = 0;
|
|
@@ -14114,7 +14710,7 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
14114
14710
|
}
|
|
14115
14711
|
});
|
|
14116
14712
|
};
|
|
14117
|
-
const defaultProps$
|
|
14713
|
+
const defaultProps$b = {};
|
|
14118
14714
|
const VirtualList = (props) => {
|
|
14119
14715
|
const {
|
|
14120
14716
|
sourceData = [],
|
|
@@ -14273,9 +14869,9 @@ const VirtualList = (props) => {
|
|
|
14273
14869
|
}) : data);
|
|
14274
14870
|
}))));
|
|
14275
14871
|
};
|
|
14276
|
-
VirtualList.defaultProps = defaultProps$
|
|
14872
|
+
VirtualList.defaultProps = defaultProps$b;
|
|
14277
14873
|
VirtualList.displayName = "NutVirtualList";
|
|
14278
|
-
const defaultProps$
|
|
14874
|
+
const defaultProps$a = {
|
|
14279
14875
|
source: {
|
|
14280
14876
|
type: {},
|
|
14281
14877
|
src: ""
|
|
@@ -14300,7 +14896,7 @@ const Video = (props) => {
|
|
|
14300
14896
|
playend,
|
|
14301
14897
|
...restProps
|
|
14302
14898
|
} = {
|
|
14303
|
-
...defaultProps$
|
|
14899
|
+
...defaultProps$a,
|
|
14304
14900
|
...props
|
|
14305
14901
|
};
|
|
14306
14902
|
const rootRef = useRef(null);
|
|
@@ -14354,8 +14950,128 @@ const Video = (props) => {
|
|
|
14354
14950
|
kind: "captions"
|
|
14355
14951
|
})));
|
|
14356
14952
|
};
|
|
14357
|
-
Video.defaultProps = defaultProps$
|
|
14953
|
+
Video.defaultProps = defaultProps$a;
|
|
14358
14954
|
Video.displayName = "NutVideo";
|
|
14955
|
+
const defaultProps$9 = {
|
|
14956
|
+
className: "",
|
|
14957
|
+
style: {},
|
|
14958
|
+
isShowPercentage: true,
|
|
14959
|
+
percentage: 0,
|
|
14960
|
+
fillColor: "#f3f3f3",
|
|
14961
|
+
strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
14962
|
+
strokeWidth: "",
|
|
14963
|
+
textColor: "",
|
|
14964
|
+
textWidth: "",
|
|
14965
|
+
showText: true,
|
|
14966
|
+
textInside: false,
|
|
14967
|
+
textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
14968
|
+
textType: "text",
|
|
14969
|
+
status: false,
|
|
14970
|
+
iconName: "checked",
|
|
14971
|
+
iconColor: "#439422",
|
|
14972
|
+
iconSize: "16px",
|
|
14973
|
+
rounded: true,
|
|
14974
|
+
children: void 0
|
|
14975
|
+
};
|
|
14976
|
+
const Progress = (props) => {
|
|
14977
|
+
const {
|
|
14978
|
+
className,
|
|
14979
|
+
style,
|
|
14980
|
+
isShowPercentage,
|
|
14981
|
+
percentage,
|
|
14982
|
+
fillColor,
|
|
14983
|
+
strokeColor,
|
|
14984
|
+
strokeWidth,
|
|
14985
|
+
size,
|
|
14986
|
+
textColor,
|
|
14987
|
+
textWidth,
|
|
14988
|
+
showText,
|
|
14989
|
+
textInside,
|
|
14990
|
+
textBackground,
|
|
14991
|
+
textType,
|
|
14992
|
+
status,
|
|
14993
|
+
iconName,
|
|
14994
|
+
iconColor,
|
|
14995
|
+
iconSize,
|
|
14996
|
+
rounded,
|
|
14997
|
+
children,
|
|
14998
|
+
...rest
|
|
14999
|
+
} = { ...defaultProps$9, ...props };
|
|
15000
|
+
const b2 = cn("progress");
|
|
15001
|
+
const classes = classNames(b2(""));
|
|
15002
|
+
const classesOuter = classNames({
|
|
15003
|
+
[`${b2("")}-outer`]: true,
|
|
15004
|
+
[`${b2("")}-${size || "base"}`]: true
|
|
15005
|
+
});
|
|
15006
|
+
const classesInner = classNames({
|
|
15007
|
+
[`${b2("")}-inner`]: true,
|
|
15008
|
+
[`${b2("")}-active`]: status
|
|
15009
|
+
});
|
|
15010
|
+
const classesText = classNames({
|
|
15011
|
+
[`${b2("")}-text`]: true
|
|
15012
|
+
});
|
|
15013
|
+
const classesInsideText = classNames({
|
|
15014
|
+
[`${b2("")}-text`]: true,
|
|
15015
|
+
[`${b2("")}-insidetext`]: true
|
|
15016
|
+
});
|
|
15017
|
+
const classesTextInner = classNames({
|
|
15018
|
+
[`${b2("")}-text__inner`]: true
|
|
15019
|
+
});
|
|
15020
|
+
const stylesOuter = {
|
|
15021
|
+
height: `${strokeWidth}px`,
|
|
15022
|
+
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
15023
|
+
background: `${fillColor}`
|
|
15024
|
+
};
|
|
15025
|
+
const stylesInner = {
|
|
15026
|
+
width: `${percentage}%`,
|
|
15027
|
+
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
15028
|
+
background: `${strokeColor}`
|
|
15029
|
+
};
|
|
15030
|
+
const stylesInsideText = {
|
|
15031
|
+
width: `${textWidth}px`,
|
|
15032
|
+
left: `${percentage}%`,
|
|
15033
|
+
background: textBackground || strokeColor
|
|
15034
|
+
};
|
|
15035
|
+
const stylesInsideIcon = {
|
|
15036
|
+
width: `${textWidth}px`,
|
|
15037
|
+
left: `${percentage}%`
|
|
15038
|
+
};
|
|
15039
|
+
const stylesText = {
|
|
15040
|
+
width: `${textWidth}px`
|
|
15041
|
+
};
|
|
15042
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15043
|
+
className: `${classes} ${className}`,
|
|
15044
|
+
style,
|
|
15045
|
+
...rest
|
|
15046
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15047
|
+
className: classesOuter,
|
|
15048
|
+
style: stylesOuter
|
|
15049
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
15050
|
+
className: classesInner,
|
|
15051
|
+
style: stylesInner
|
|
15052
|
+
}, showText && textInside && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children ? /* @__PURE__ */ React__default.createElement("div", {
|
|
15053
|
+
className: classesInsideText,
|
|
15054
|
+
style: stylesInsideIcon
|
|
15055
|
+
}, children) : /* @__PURE__ */ React__default.createElement("div", {
|
|
15056
|
+
className: classesInsideText,
|
|
15057
|
+
style: stylesInsideText
|
|
15058
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
15059
|
+
className: classesTextInner,
|
|
15060
|
+
style: { color: textColor || "#fff" }
|
|
15061
|
+
}, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default.createElement("div", {
|
|
15062
|
+
className: classesText,
|
|
15063
|
+
style: stylesText
|
|
15064
|
+
}, textType === "text" && /* @__PURE__ */ React__default.createElement("span", {
|
|
15065
|
+
className: classesTextInner,
|
|
15066
|
+
style: { color: textColor || "#333" }
|
|
15067
|
+
}, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
15068
|
+
size: iconSize,
|
|
15069
|
+
name: iconName,
|
|
15070
|
+
color: iconColor
|
|
15071
|
+
})));
|
|
15072
|
+
};
|
|
15073
|
+
Progress.defaultProps = defaultProps$9;
|
|
15074
|
+
Progress.displayName = "NutProgress";
|
|
14359
15075
|
const defaultProps$8 = {
|
|
14360
15076
|
type: "custom",
|
|
14361
15077
|
existAddress: [],
|
|
@@ -15031,6 +15747,8 @@ const Signature = (props) => {
|
|
|
15031
15747
|
case "jpg":
|
|
15032
15748
|
dataurl = canvas.toDataURL("image/jpeg", 0.8);
|
|
15033
15749
|
break;
|
|
15750
|
+
default:
|
|
15751
|
+
dataurl = canvas.toDataURL("image/png");
|
|
15034
15752
|
}
|
|
15035
15753
|
clear();
|
|
15036
15754
|
props.confirm && props.confirm(canvas, dataurl);
|
|
@@ -15308,4 +16026,4 @@ const TimeSelect = (props) => {
|
|
|
15308
16026
|
};
|
|
15309
16027
|
TimeSelect.defaultProps = defaultProps;
|
|
15310
16028
|
TimeSelect.displayName = "NutTimeSelect";
|
|
15311
|
-
export { ActionSheet, Address, AnimatingNumbers, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button, Calendar, CalendarItem, Card, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator, Empty, FixedNav, Icon, Indicator, Infiniteloading, Input, InputNumber, Layout, NavBar, NoticeBar, Notify, Overlay, Pagination, Picker, Popover, Popup, Price, Radio, RadioGroup, Range, Rate, Row, ShortPassword, Signature, Skeleton, Step, Steps, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };
|
|
16029
|
+
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 };
|