@nutui/nutui-react 1.2.1-beta.1 → 1.2.2-beta.1

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