@nutui/nutui-react-taro 2.0.0-alpha.13 → 2.0.0-alpha.14

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 (130) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/esm/ActionSheet/style/style.css +1 -1
  3. package/dist/esm/Address/style/style.css +1 -1
  4. package/dist/esm/Audio.js +3 -3
  5. package/dist/esm/Barrage/style/style.css +1 -1
  6. package/dist/esm/Barrage.js +2 -3
  7. package/dist/esm/Calendar/style/style.css +1 -1
  8. package/dist/esm/Cascader/style/style.css +1 -1
  9. package/dist/esm/CircleProgress.js +2 -2
  10. package/dist/esm/DatePicker/style/style.css +1 -1
  11. package/dist/esm/DatePicker.js +3 -3
  12. package/dist/esm/Ellipsis.js +2 -2
  13. package/dist/esm/ImagePreview/style/style.css +1 -1
  14. package/dist/esm/Menu.js +1 -1
  15. package/dist/esm/MenuItem.js +2 -2
  16. package/dist/esm/NoticeBar.js +2 -2
  17. package/dist/esm/NumberKeyboard/style/style.css +1 -1
  18. package/dist/esm/Picker/style/style.css +1 -1
  19. package/dist/esm/Picker.js +2 -2
  20. package/dist/esm/Popover/style/index.js +1 -1
  21. package/dist/esm/Popover/style/style.css +1 -1
  22. package/dist/esm/Popover.js +9 -3
  23. package/dist/esm/Popup/style/style.css +1 -1
  24. package/dist/esm/Range.js +2 -2
  25. package/dist/esm/ShortPassword/style/style.css +1 -1
  26. package/dist/esm/SideNavBar/style/style.css +1 -1
  27. package/dist/esm/SideNavBar.js +3 -3
  28. package/dist/esm/SideNavBarItem/style/style.css +1 -1
  29. package/dist/esm/SideNavBarItem.js +1 -1
  30. package/dist/esm/Signature.js +1 -1
  31. package/dist/esm/Sticky.js +2 -2
  32. package/dist/esm/SubSideNavBar/style/style.css +1 -1
  33. package/dist/esm/SubSideNavBar.js +2 -2
  34. package/dist/esm/Swipe.js +2 -2
  35. package/dist/esm/TextArea/style/style.css +1 -1
  36. package/dist/esm/TimeSelect/style/style.css +1 -1
  37. package/dist/esm/Uploader.js +2 -2
  38. package/dist/esm/{audio.taro-bbd39f93.js → audio.taro-73011657.js} +3 -3
  39. package/dist/esm/{barrage.taro-c8cb9864.js → barrage.taro-e87bc58e.js} +32 -32
  40. package/dist/esm/{circleprogress.taro-7149e09d.js → circleprogress.taro-9064d69c.js} +1 -1
  41. package/dist/esm/{datepicker.taro-65dbeceb.js → datepicker.taro-6304d59d.js} +1 -1
  42. package/dist/esm/{ellipsis.taro-f423affa.js → ellipsis.taro-5653d0b2.js} +12 -12
  43. package/dist/esm/{index-e3184f19.js → index-0a89a47b.js} +7 -1
  44. package/dist/esm/{menu.taro-cd0fef41.js → menu.taro-40d36e0a.js} +3 -3
  45. package/dist/esm/{menuitem.taro-6076bffa.js → menuitem.taro-6aa35a00.js} +1 -1
  46. package/dist/esm/{noticebar.taro-2f02b2ad.js → noticebar.taro-8d496dd6.js} +1 -1
  47. package/dist/esm/nutui-react.es.js +21 -21
  48. package/dist/esm/{picker.taro-0570ec32.js → picker.taro-8ba4624c.js} +44 -40
  49. package/dist/esm/popover.taro-ba6c323a.js +229 -0
  50. package/dist/esm/{range.taro-615e193a.js → range.taro-a1d1ad25.js} +1 -1
  51. package/dist/esm/{sidenavbar.taro-9f210df4.js → sidenavbar.taro-1aefdd3c.js} +13 -10
  52. package/dist/esm/sidenavbaritem.taro-7d805f92.js +13 -0
  53. package/dist/esm/{signature.taro-c57469aa.js → signature.taro-6e75a1ac.js} +1 -1
  54. package/dist/esm/{sticky.taro-f8ae8d5e.js → sticky.taro-6bc62a96.js} +2 -2
  55. package/dist/esm/{subsidenavbar.taro-abe07673.js → subsidenavbar.taro-47bb6e74.js} +10 -9
  56. package/dist/esm/{swipe.taro-de80fcd8.js → swipe.taro-966af6d3.js} +1 -1
  57. package/dist/esm/types/src/packages/barrage/barrage.d.ts +6 -7
  58. package/dist/esm/types/src/packages/barrage/barrage.taro.d.ts +6 -7
  59. package/dist/esm/types/src/packages/barrage/index.d.ts +1 -0
  60. package/dist/esm/types/src/packages/barrage/index.taro.d.ts +1 -0
  61. package/dist/esm/types/src/packages/button/button.d.ts +1 -0
  62. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
  63. package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -1
  64. package/dist/esm/types/src/packages/menu/menu.taro.d.ts +1 -1
  65. package/dist/esm/types/src/packages/picker/doc.en.d.ts +9 -9
  66. package/dist/esm/types/src/packages/popover/demo.d.ts +3 -2
  67. package/dist/esm/types/src/packages/popover/demo.taro.d.ts +2 -2
  68. package/dist/esm/types/src/packages/popover/index.d.ts +1 -0
  69. package/dist/esm/types/src/packages/popover/index.taro.d.ts +1 -0
  70. package/dist/esm/types/src/packages/popover/popover.d.ts +20 -9
  71. package/dist/esm/types/src/packages/popover/popover.taro.d.ts +20 -10
  72. package/dist/esm/types/src/packages/sidenavbar/index.d.ts +1 -0
  73. package/dist/esm/types/src/packages/sidenavbar/index.taro.d.ts +1 -0
  74. package/dist/esm/types/src/packages/sidenavbar/sidenavbar.d.ts +5 -9
  75. package/dist/esm/types/src/packages/sidenavbar/sidenavbar.taro.d.ts +5 -9
  76. package/dist/esm/types/src/packages/sidenavbaritem/index.d.ts +1 -0
  77. package/dist/esm/types/src/packages/sidenavbaritem/index.taro.d.ts +1 -0
  78. package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.d.ts +3 -3
  79. package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -3
  80. package/dist/esm/types/src/packages/subsidenavbar/index.d.ts +1 -0
  81. package/dist/esm/types/src/packages/subsidenavbar/index.taro.d.ts +1 -0
  82. package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.d.ts +3 -3
  83. package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.taro.d.ts +3 -3
  84. package/dist/esm/types/src/utils/index.d.ts +1 -0
  85. package/dist/esm/types/src/utils/use-click-away.d.ts +3 -0
  86. package/dist/esm/{uploader.taro-7e38fc37.js → uploader.taro-fbd05e20.js} +1 -1
  87. package/dist/esm/use-client-rect-2bb6c562.js +40 -0
  88. package/dist/locales/base.js +1 -1
  89. package/dist/locales/en-US.js +1 -1
  90. package/dist/locales/id-ID.js +1 -1
  91. package/dist/locales/tr-TR.js +1 -1
  92. package/dist/locales/zh-CN.js +1 -1
  93. package/dist/locales/zh-TW.js +1 -1
  94. package/dist/locales/zh-UG.js +1 -1
  95. package/dist/nutui.react.es.js +466 -324
  96. package/dist/nutui.react.umd.js +466 -324
  97. package/dist/packages/barrage/barrage.scss +0 -13
  98. package/dist/packages/popover/popover.scss +158 -230
  99. package/dist/packages/popup/popup.scss +36 -0
  100. package/dist/packages/sidenavbar/sidenavbar.scss +10 -16
  101. package/dist/packages/sidenavbaritem/sidenavbaritem.scss +7 -19
  102. package/dist/packages/subsidenavbar/subsidenavbar.scss +10 -19
  103. package/dist/style.css +1 -1
  104. package/dist/style.mjs +1 -1
  105. package/dist/styles/variables-jmapp.scss +35 -47
  106. package/dist/styles/variables.scss +45 -57
  107. package/dist/types/packages/barrage/barrage.taro.d.ts +32 -9
  108. package/dist/types/packages/barrage/index.taro.d.ts +1 -0
  109. package/dist/types/packages/configprovider/types.d.ts +1 -1
  110. package/dist/types/packages/input/input.taro.d.ts +1 -1
  111. package/dist/types/packages/menu/menu.taro.d.ts +5 -1
  112. package/dist/types/packages/popover/index.taro.d.ts +1 -0
  113. package/dist/types/packages/popover/popover.taro.d.ts +99 -13
  114. package/dist/types/packages/sidenavbar/index.taro.d.ts +1 -0
  115. package/dist/types/packages/sidenavbar/sidenavbar.taro.d.ts +33 -13
  116. package/dist/types/packages/sidenavbaritem/index.taro.d.ts +1 -0
  117. package/dist/types/packages/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -3
  118. package/dist/types/packages/subsidenavbar/index.taro.d.ts +1 -0
  119. package/dist/types/packages/subsidenavbar/subsidenavbar.taro.d.ts +3 -3
  120. package/dist/types/utils/index.d.ts +1 -0
  121. package/package.json +1 -1
  122. package/dist/esm/popover.taro-ad483372.js +0 -162
  123. package/dist/esm/sidenavbaritem.taro-32a45ce6.js +0 -12
  124. package/dist/esm/types/src/packages/popover/Trigger.d.ts +0 -19
  125. package/dist/esm/types/src/packages/sidenavbar/type.d.ts +0 -34
  126. package/dist/esm/use-client-rect-f317804e.js +0 -10
  127. package/dist/types/packages/popover/Trigger.d.ts +0 -19
  128. /package/dist/esm/{offsetContext-f32a9246.js → context-f32a9246.js} +0 -0
  129. /package/dist/esm/types/src/packages/sidenavbar/{offsetContext.d.ts → context.d.ts} +0 -0
  130. /package/dist/types/packages/sidenavbar/{offsetContext.d.ts → context.d.ts} +0 -0
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  /*!
8
- * @nutui/nutui-react-taro v2.0.0-alpha.13 Wed May 31 2023 15:00:24 GMT+0800 (China Standard Time)
8
+ * @nutui/nutui-react-taro v2.0.0-alpha.14 Fri Jun 02 2023 17:13:52 GMT+0800 (China Standard Time)
9
9
  * (c) 2023 @jdf2e.
10
10
  * Released under the MIT License.
11
11
  */
@@ -1958,7 +1958,7 @@ const defaultProps$1t = {
1958
1958
  onClick: (event) => {
1959
1959
  }
1960
1960
  };
1961
- const classPrefix$k = "nut-cell";
1961
+ const classPrefix$m = "nut-cell";
1962
1962
  const Cell = (props) => {
1963
1963
  const {
1964
1964
  children,
@@ -1989,19 +1989,19 @@ const Cell = (props) => {
1989
1989
  return /* @__PURE__ */ React.createElement(
1990
1990
  "div",
1991
1991
  {
1992
- className: classNames(classPrefix$k, className),
1992
+ className: classNames(classPrefix$m, className),
1993
1993
  onClick: (event) => handleClick(event),
1994
1994
  style: baseStyle,
1995
1995
  ...rest
1996
1996
  },
1997
- children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$k}__left` }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$k}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$k}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React.createElement(
1997
+ children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__left` }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React.createElement(
1998
1998
  "div",
1999
1999
  {
2000
- className: `${classPrefix$k}__extra`,
2000
+ className: `${classPrefix$m}__extra`,
2001
2001
  style: styles
2002
2002
  },
2003
2003
  extra
2004
- ) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$k}__divider` }))
2004
+ ) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__divider` }))
2005
2005
  );
2006
2006
  };
2007
2007
  Cell.defaultProps = defaultProps$1t;
@@ -2012,16 +2012,16 @@ const defaultProps$1s = {
2012
2012
  description: "",
2013
2013
  divider: true
2014
2014
  };
2015
- const classPrefix$j = "nut-cell-group";
2015
+ const classPrefix$l = "nut-cell-group";
2016
2016
  const CellGroup = (props) => {
2017
2017
  const { children, className, style, title, description, divider, ...rest } = {
2018
2018
  ...defaultProps$1s,
2019
2019
  ...props
2020
2020
  };
2021
- return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$j, className), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$j}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$j}__description` }, description) : null, /* @__PURE__ */ React.createElement(
2021
+ return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$l, className), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$l}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$l}__description` }, description) : null, /* @__PURE__ */ React.createElement(
2022
2022
  "div",
2023
2023
  {
2024
- className: `${classPrefix$j}__wrap ${divider ? `${classPrefix$j}__wrap--divider` : ""}`
2024
+ className: `${classPrefix$l}__wrap ${divider ? `${classPrefix$l}__wrap--divider` : ""}`
2025
2025
  },
2026
2026
  children
2027
2027
  ));
@@ -2716,21 +2716,21 @@ const defaultProps$1o = {
2716
2716
  contentPosition: "center",
2717
2717
  direction: "horizontal"
2718
2718
  };
2719
- const classPrefix$i = `nut-divider`;
2719
+ const classPrefix$k = `nut-divider`;
2720
2720
  const Divider = (props) => {
2721
2721
  const { children, contentPosition, style, className, direction, ...rest } = {
2722
2722
  ...defaultProps$1o,
2723
2723
  ...props
2724
2724
  };
2725
2725
  const classes = direction === "horizontal" ? classNames({
2726
- [`${classPrefix$i}`]: true,
2727
- [`${classPrefix$i}__center`]: children,
2728
- [`${classPrefix$i}__left`]: contentPosition === "left",
2729
- [`${classPrefix$i}__right`]: contentPosition === "right",
2730
- [`${classPrefix$i}__hairline`]: true
2726
+ [`${classPrefix$k}`]: true,
2727
+ [`${classPrefix$k}__center`]: children,
2728
+ [`${classPrefix$k}__left`]: contentPosition === "left",
2729
+ [`${classPrefix$k}__right`]: contentPosition === "right",
2730
+ [`${classPrefix$k}__hairline`]: true
2731
2731
  }) : classNames({
2732
- [`${classPrefix$i}`]: true,
2733
- [`${classPrefix$i}__vertical`]: direction === "vertical"
2732
+ [`${classPrefix$k}`]: true,
2733
+ [`${classPrefix$k}__vertical`]: direction === "vertical"
2734
2734
  });
2735
2735
  return /* @__PURE__ */ React.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
2736
2736
  };
@@ -2891,7 +2891,7 @@ const Layout = (props) => {
2891
2891
  };
2892
2892
  Layout.defaultProps = defaultProps$1l;
2893
2893
  Layout.displayName = "NutLayout";
2894
- const classPrefix$h = "nut-row";
2894
+ const classPrefix$j = "nut-row";
2895
2895
  const defaultProps$1k = {
2896
2896
  ...ComponentDefaults,
2897
2897
  type: "",
@@ -2926,7 +2926,7 @@ const Row = (props) => {
2926
2926
  ${getClass("justify", justify)}
2927
2927
  ${getClass("align", align)}
2928
2928
  ${getClass("flex", wrap)}
2929
- ${classPrefix$h}
2929
+ ${classPrefix$j}
2930
2930
  `;
2931
2931
  };
2932
2932
  const parentRow = {
@@ -2969,6 +2969,35 @@ function useWatch(dep, callback, config2 = { immediate: false }) {
2969
2969
  stop.current = true;
2970
2970
  };
2971
2971
  }
2972
+ function isWindow(val) {
2973
+ return val === window;
2974
+ }
2975
+ const getRect = (elementRef) => {
2976
+ const element = elementRef;
2977
+ if (isWindow(element)) {
2978
+ const width = element.innerWidth;
2979
+ const height = element.innerHeight;
2980
+ return {
2981
+ top: 0,
2982
+ left: 0,
2983
+ right: width,
2984
+ bottom: height,
2985
+ width,
2986
+ height
2987
+ };
2988
+ }
2989
+ if (element && element.getBoundingClientRect) {
2990
+ return element.getBoundingClientRect();
2991
+ }
2992
+ return {
2993
+ top: 0,
2994
+ left: 0,
2995
+ right: 0,
2996
+ bottom: 0,
2997
+ width: 0,
2998
+ height: 0
2999
+ };
3000
+ };
2972
3001
  const getRectByTaro = async (element) => {
2973
3002
  if (element) {
2974
3003
  const res = await element.getBoundingClientRect();
@@ -3002,7 +3031,7 @@ const defaultProps$1j = {
3002
3031
  position: "top",
3003
3032
  zIndex: 2e3
3004
3033
  };
3005
- const classPrefix$g = "nut-sticky";
3034
+ const classPrefix$i = "nut-sticky";
3006
3035
  const Sticky = (props) => {
3007
3036
  const {
3008
3037
  position,
@@ -3078,7 +3107,7 @@ const Sticky = (props) => {
3078
3107
  setFixed(windowHeight - threshold < curRootRect.bottom);
3079
3108
  }
3080
3109
  } else {
3081
- console.log("getRectByTaro获取失败", { stickyRect, curRootRect });
3110
+ console.warn("getRectByTaro获取失败", { stickyRect, curRootRect });
3082
3111
  }
3083
3112
  };
3084
3113
  const getElement = useCallback(() => {
@@ -3104,7 +3133,7 @@ const Sticky = (props) => {
3104
3133
  {
3105
3134
  ref: rootRef,
3106
3135
  style: rootStyle,
3107
- className: classNames(classPrefix$g, className),
3136
+ className: classNames(classPrefix$i, className),
3108
3137
  ...rest
3109
3138
  },
3110
3139
  /* @__PURE__ */ React.createElement(
@@ -5484,11 +5513,12 @@ Popup.defaultProps = defaultProps$1e;
5484
5513
  Popup.displayName = "NutPopup";
5485
5514
  const OffsetContext = createContext(20);
5486
5515
  const defaultProps$1d = {
5487
- showhead: false,
5516
+ ...ComponentDefaults,
5488
5517
  position: "left",
5489
5518
  width: "80%"
5490
5519
  };
5491
5520
  const SideNavBar = (props) => {
5521
+ const classPrefix2 = "nut-sidenavbar";
5492
5522
  const {
5493
5523
  title,
5494
5524
  visible,
@@ -5496,14 +5526,13 @@ const SideNavBar = (props) => {
5496
5526
  position,
5497
5527
  children,
5498
5528
  className,
5499
- showhead,
5500
5529
  onClose,
5501
5530
  ...rest
5502
5531
  } = {
5503
5532
  ...defaultProps$1d,
5504
5533
  ...props
5505
5534
  };
5506
- const offset = props.offset ? Number(props.offset) : 20;
5535
+ const indent = props.indent ? Number(props.indent) : 20;
5507
5536
  const [sidenavbarShow, setSidenavbarShow] = useState(true);
5508
5537
  const handleClick = () => {
5509
5538
  setSidenavbarShow(!sidenavbarShow);
@@ -5516,49 +5545,43 @@ const SideNavBar = (props) => {
5516
5545
  position,
5517
5546
  onClose
5518
5547
  },
5519
- /* @__PURE__ */ React.createElement(
5548
+ /* @__PURE__ */ React.createElement("div", { className: classNames(className, classPrefix2), ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, /* @__PURE__ */ React.createElement(
5520
5549
  "div",
5521
5550
  {
5522
- className: className ? `${className} nut-sidenavbar` : "nut-sidenavbar",
5523
- ...rest
5551
+ className: `${classPrefix2}__list ${sidenavbarShow ? "sidenavbar-show" : "sidenavbar-hide"}`,
5552
+ onClick: handleClick
5524
5553
  },
5525
- /* @__PURE__ */ React.createElement("div", { className: "nut-sidenavbar__content" }, /* @__PURE__ */ React.createElement(
5554
+ /* @__PURE__ */ React.createElement(
5526
5555
  "div",
5527
5556
  {
5528
- className: `nut-sidenavbar__list ${sidenavbarShow ? "nutShow" : "nutHide"}`,
5529
- onClick: handleClick
5557
+ className: `${classPrefix2}__title ${classPrefix2}-border-bt`,
5558
+ style: { paddingLeft: `${indent}px` }
5530
5559
  },
5560
+ title,
5531
5561
  /* @__PURE__ */ React.createElement(
5532
- "div",
5562
+ "i",
5533
5563
  {
5534
- className: "nut-sidenavbar__title border-bt ",
5535
- style: { paddingLeft: `${offset}px` }
5536
- },
5537
- title,
5538
- /* @__PURE__ */ React.createElement(
5539
- "i",
5540
- {
5541
- className: `arrow-icon ${sidenavbarShow ? "arrow-up" : "arrow-down"}`
5542
- }
5543
- )
5544
- ),
5545
- /* @__PURE__ */ React.createElement(OffsetContext.Provider, { value: offset }, /* @__PURE__ */ React.createElement("div", { className: "nut-sidenavbar__content" }, children))
5546
- ))
5547
- )
5564
+ className: `arrow-icon ${sidenavbarShow ? "arrow-up" : "arrow-down"}`
5565
+ }
5566
+ )
5567
+ ),
5568
+ /* @__PURE__ */ React.createElement(OffsetContext.Provider, { value: indent }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, children))
5569
+ )))
5548
5570
  );
5549
5571
  };
5550
5572
  SideNavBar.defaultProps = defaultProps$1d;
5551
5573
  SideNavBar.displayName = "NutSideNavBar";
5552
5574
  const SideNavBarItem = (props) => {
5553
- const { title, key, children, onClick, ...rest } = props;
5575
+ const classPrefix2 = "nut-subsidenavbar";
5576
+ const { title, value, children, onClick, ...rest } = props;
5554
5577
  const clickFn = (e) => {
5555
5578
  e.stopPropagation();
5556
- onClick && onClick({ title, key });
5579
+ onClick && onClick({ title, value });
5557
5580
  };
5558
5581
  return /* @__PURE__ */ React.createElement(
5559
5582
  "div",
5560
5583
  {
5561
- className: "nut-subsidenavbar__item border-bt",
5584
+ className: `${classPrefix2}__item ${classPrefix2}-border-bt`,
5562
5585
  onClick: clickFn,
5563
5586
  ...rest
5564
5587
  },
@@ -5569,7 +5592,8 @@ const defaultProps$1c = {
5569
5592
  open: true
5570
5593
  };
5571
5594
  const SubSideNavBar = (props) => {
5572
- const { title, key, children, onClick, open, ...rest } = {
5595
+ const classPrefix2 = "nut-subsidenavbar";
5596
+ const { title, value, children, onClick, open, ...rest } = {
5573
5597
  ...defaultProps$1c,
5574
5598
  ...props
5575
5599
  };
@@ -5579,7 +5603,7 @@ const SubSideNavBar = (props) => {
5579
5603
  const setListLevel = useCallback(
5580
5604
  (nodeList, level = 1) => {
5581
5605
  const titleClass = nodeList[0].className;
5582
- if (titleClass.includes("nut-subsidenavbar__title")) {
5606
+ if (titleClass.includes(`${classPrefix2}__title`)) {
5583
5607
  const left = offset * (level + 1);
5584
5608
  nodeList[0].style.paddingLeft = `${left}px`;
5585
5609
  }
@@ -5588,11 +5612,11 @@ const SubSideNavBar = (props) => {
5588
5612
  );
5589
5613
  childNodes.forEach((item) => {
5590
5614
  const itemClass = item.className;
5591
- if (itemClass.includes("nut-subsidenavbar__item")) {
5615
+ if (itemClass.includes(`${classPrefix2}__item`)) {
5592
5616
  const left = offset * (level + 2);
5593
5617
  item.style.paddingLeft = `${left}px`;
5594
5618
  }
5595
- if (itemClass.includes("nut-subsidenavbar__list")) {
5619
+ if (itemClass.includes(`${classPrefix2}__list`)) {
5596
5620
  let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
5597
5621
  level2 += 1;
5598
5622
  item.setAttribute("level", level2.toString());
@@ -5606,7 +5630,7 @@ const SubSideNavBar = (props) => {
5606
5630
  e.stopPropagation();
5607
5631
  setSubShow(!subShow);
5608
5632
  const isShow = !subShow;
5609
- onClick && onClick({ title, key, isShow });
5633
+ onClick && onClick({ title, value, isShow });
5610
5634
  };
5611
5635
  useEffect(() => {
5612
5636
  var _a, _b;
@@ -5614,9 +5638,9 @@ const SubSideNavBar = (props) => {
5614
5638
  (_b = listRef.current) == null ? void 0 : _b.setAttribute("level", "1");
5615
5639
  childNodes && setListLevel(childNodes);
5616
5640
  }, [setListLevel]);
5617
- const divClass = subShow ? "nut-subsidenavbar__list nutShow" : "nut-subsidenavbar__list nutHide";
5641
+ const divClass = subShow ? `${classPrefix2}__list sidenavbar-show` : `${classPrefix2}__list sidenavbar-hide`;
5618
5642
  const iconClass = subShow ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
5619
- return /* @__PURE__ */ React.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React.createElement("div", { className: "nut-subsidenavbar__title border-bt" }, title, " ", /* @__PURE__ */ React.createElement("i", { className: iconClass })), /* @__PURE__ */ React.createElement("div", { className: "nut-subsidenavbar__content" }, children));
5643
+ return /* @__PURE__ */ React.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__title ${classPrefix2}-border-bt` }, title, " ", /* @__PURE__ */ React.createElement("i", { className: iconClass })), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, children));
5620
5644
  };
5621
5645
  function usePropsValue({
5622
5646
  value,
@@ -5818,7 +5842,7 @@ const defaultProps$17 = {
5818
5842
  duration: 300,
5819
5843
  autoHeight: false
5820
5844
  };
5821
- const classPrefix$f = "nut-tabs";
5845
+ const classPrefix$h = "nut-tabs";
5822
5846
  const Tabs = (props) => {
5823
5847
  const {
5824
5848
  activeColor,
@@ -5880,14 +5904,14 @@ const Tabs = (props) => {
5880
5904
  }
5881
5905
  }, [children]);
5882
5906
  const classes = classNames(
5883
- classPrefix$f,
5884
- `${classPrefix$f}--${direction}`,
5907
+ classPrefix$h,
5908
+ `${classPrefix$h}--${direction}`,
5885
5909
  className
5886
5910
  );
5887
- const classesTitle = classNames(`${classPrefix$f}__titles`, {
5888
- [`${classPrefix$f}__titles--${activeType}`]: activeType,
5889
- [`${classPrefix$f}__titles--scrollable`]: true,
5890
- [`${classPrefix$f}__titles--${align}`]: align
5911
+ const classesTitle = classNames(`${classPrefix$h}__titles`, {
5912
+ [`${classPrefix$h}__titles--${activeType}`]: activeType,
5913
+ [`${classPrefix$h}__titles--scrollable`]: true,
5914
+ [`${classPrefix$h}__titles--${align}`]: align
5891
5915
  });
5892
5916
  const tabsActiveStyle = {
5893
5917
  color: activeType === "smile" ? activeColor : "",
@@ -5933,7 +5957,7 @@ const Tabs = (props) => {
5933
5957
  onClick: (e) => {
5934
5958
  tabChange(item);
5935
5959
  },
5936
- className: classNames(`${classPrefix$f}__titles-item`, {
5960
+ className: classNames(`${classPrefix$h}__titles-item`, {
5937
5961
  [`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
5938
5962
  [`nut-tabs__titles-item--disabled`]: item.disabled,
5939
5963
  [`nut-tabs__titles-item--${align}`]: align
@@ -5943,14 +5967,14 @@ const Tabs = (props) => {
5943
5967
  activeType === "line" && /* @__PURE__ */ React.createElement(
5944
5968
  View,
5945
5969
  {
5946
- className: `${classPrefix$f}__titles-item__line`,
5970
+ className: `${classPrefix$h}__titles-item__line`,
5947
5971
  style: tabsActiveStyle
5948
5972
  }
5949
5973
  ),
5950
5974
  activeType === "smile" && /* @__PURE__ */ React.createElement(
5951
5975
  View,
5952
5976
  {
5953
- className: `${classPrefix$f}__titles-item__smile`,
5977
+ className: `${classPrefix$h}__titles-item__smile`,
5954
5978
  style: tabsActiveStyle
5955
5979
  },
5956
5980
  /* @__PURE__ */ React.createElement(a$j, { color: activeColor, width: 40, height: 20 })
@@ -5962,14 +5986,14 @@ const Tabs = (props) => {
5962
5986
  {
5963
5987
  ellipsis: true
5964
5988
  },
5965
- `${classPrefix$f}__titles-item__text`
5989
+ `${classPrefix$h}__titles-item__text`
5966
5990
  )
5967
5991
  },
5968
5992
  item.title
5969
5993
  )
5970
5994
  );
5971
5995
  })
5972
- ), /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$f}__content__wrap` }, /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$f}__content`, style: contentStyle }, React.Children.map(children, (child, idx) => {
5996
+ ), /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$h}__content__wrap` }, /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$h}__content`, style: contentStyle }, React.Children.map(children, (child, idx) => {
5973
5997
  if (!React.isValidElement(child)) {
5974
5998
  return null;
5975
5999
  }
@@ -8070,7 +8094,7 @@ const defaultProps$$ = {
8070
8094
  },
8071
8095
  options: []
8072
8096
  };
8073
- const classPrefix$e = "nut-checkboxgroup";
8097
+ const classPrefix$g = "nut-checkboxgroup";
8074
8098
  const CheckboxGroup = React.forwardRef(
8075
8099
  (props, ref) => {
8076
8100
  const { children } = { ...defaultProps$$, ...props };
@@ -8152,7 +8176,7 @@ const CheckboxGroup = React.forwardRef(
8152
8176
  /* @__PURE__ */ React.createElement(
8153
8177
  "div",
8154
8178
  {
8155
- className: classNames(classPrefix$e, className, {
8179
+ className: classNames(classPrefix$g, className, {
8156
8180
  [`nut-checkboxgroup--${props.direction}`]: props.direction
8157
8181
  }),
8158
8182
  ...rest
@@ -8174,7 +8198,7 @@ const defaultProps$_ = {
8174
8198
  onChange: (value) => {
8175
8199
  }
8176
8200
  };
8177
- const classPrefix$d = "nut-checkbox";
8201
+ const classPrefix$f = "nut-checkbox";
8178
8202
  const Checkbox = (props) => {
8179
8203
  const { children } = {
8180
8204
  ...defaultProps$_,
@@ -8236,22 +8260,22 @@ const Checkbox = (props) => {
8236
8260
  };
8237
8261
  const color = () => {
8238
8262
  if (innerDisabled) {
8239
- return `${classPrefix$d}__icon--disable`;
8263
+ return `${classPrefix$f}__icon--disable`;
8240
8264
  }
8241
8265
  if (innerChecked) {
8242
8266
  if (innerIndeterminate) {
8243
- return `${classPrefix$d}__icon--indeterminate`;
8267
+ return `${classPrefix$f}__icon--indeterminate`;
8244
8268
  }
8245
- return `${classPrefix$d}__icon`;
8269
+ return `${classPrefix$f}__icon`;
8246
8270
  }
8247
- return `${classPrefix$d}__icon--unchecked`;
8271
+ return `${classPrefix$f}__icon--unchecked`;
8248
8272
  };
8249
8273
  const renderLabel = () => {
8250
8274
  return /* @__PURE__ */ React.createElement(
8251
8275
  "span",
8252
8276
  {
8253
- className: classNames(`${classPrefix$d}__label `, {
8254
- [`${classPrefix$d}__label--disabled`]: innerDisabled
8277
+ className: classNames(`${classPrefix$f}__label `, {
8278
+ [`${classPrefix$f}__label--disabled`]: innerDisabled
8255
8279
  })
8256
8280
  },
8257
8281
  children || label
@@ -8270,8 +8294,8 @@ const Checkbox = (props) => {
8270
8294
  return /* @__PURE__ */ React.createElement(
8271
8295
  "div",
8272
8296
  {
8273
- className: classNames(classPrefix$d, className, {
8274
- [`${classPrefix$d}--reverse`]: labelPosition === "left"
8297
+ className: classNames(classPrefix$f, className, {
8298
+ [`${classPrefix$f}--reverse`]: labelPosition === "left"
8275
8299
  }),
8276
8300
  ...rest,
8277
8301
  onClick: handleClick
@@ -8620,6 +8644,7 @@ const defaultProps$Z = {
8620
8644
  const InternalPicker = (props, ref) => {
8621
8645
  const { locale } = useConfig$1();
8622
8646
  const {
8647
+ children,
8623
8648
  visible,
8624
8649
  title,
8625
8650
  options = [],
@@ -8645,6 +8670,7 @@ const InternalPicker = (props, ref) => {
8645
8670
  (_a = props.onConfirm) == null ? void 0 : _a.call(props, setSelectedOptions(), val);
8646
8671
  }
8647
8672
  });
8673
+ const [innerValue, setInnerValue] = useState(selectedValue);
8648
8674
  const [currentValue, setCurrentValue] = useState([]);
8649
8675
  const [columnIndex, setColumnIndex] = useState(0);
8650
8676
  const pickerRef = useRef(null);
@@ -8685,41 +8711,52 @@ const InternalPicker = (props, ref) => {
8685
8711
  }
8686
8712
  return "single";
8687
8713
  };
8688
- const normalListData = () => {
8714
+ const normalListData = (innerValue2) => {
8689
8715
  const type = columnsType();
8690
8716
  switch (type) {
8691
8717
  case "multiple":
8692
8718
  return options;
8693
8719
  case "cascade":
8694
- return formatCascade(options, selectedValue);
8720
+ return formatCascade(options, innerValue2);
8695
8721
  default:
8696
8722
  return [options];
8697
8723
  }
8698
8724
  };
8699
8725
  const init = () => {
8700
- const normalData = normalListData();
8726
+ const normalData = normalListData(
8727
+ innerValue
8728
+ );
8701
8729
  setColumnsList(normalData);
8702
8730
  const data = [];
8703
8731
  normalData.length > 0 && normalData.map((item) => {
8704
8732
  item[0] && data.push(item[0].value);
8705
8733
  return item;
8706
8734
  });
8707
- if (!defaultValue.length && selectedValue.length === 0) {
8708
- setSelectedValue([...data]);
8735
+ if (!innerValue.length && innerValue.length === 0) {
8736
+ setInnerValue([...data]);
8709
8737
  }
8710
8738
  };
8739
+ useEffect(() => {
8740
+ setInnerValue(innerValue !== selectedValue ? selectedValue : innerValue);
8741
+ }, [visible]);
8742
+ useEffect(() => {
8743
+ if (visible) {
8744
+ init();
8745
+ }
8746
+ }, [options, visible]);
8711
8747
  useEffect(() => {
8712
8748
  if (!visible) {
8713
8749
  return;
8714
8750
  }
8715
- init();
8716
- }, [options, visible]);
8751
+ Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
8752
+ onChange && onChange(setSelectedOptions(), innerValue, columnIndex);
8753
+ }, [innerValue, columnsList, visible]);
8717
8754
  const setSelectedOptions = () => {
8718
8755
  const options2 = [];
8719
8756
  let currOptions = [];
8720
8757
  columnsList.forEach((columnOptions, index) => {
8721
8758
  currOptions = columnOptions.filter(
8722
- (item) => item.value === selectedValue[index]
8759
+ (item) => item.value === innerValue[index]
8723
8760
  );
8724
8761
  if (currOptions[0]) {
8725
8762
  options2.push(currOptions[0]);
@@ -8731,8 +8768,8 @@ const InternalPicker = (props, ref) => {
8731
8768
  };
8732
8769
  const defaultValuesConvert = () => {
8733
8770
  const defaultIndexs = [];
8734
- if (selectedValue.length > 0) {
8735
- selectedValue.forEach((value, index) => {
8771
+ if (innerValue.length > 0) {
8772
+ innerValue.forEach((value, index) => {
8736
8773
  var _a;
8737
8774
  for (let i = 0; i < ((_a = columnsList == null ? void 0 : columnsList[index]) == null ? void 0 : _a.length); i++) {
8738
8775
  if (columnsList[index][i].value === value) {
@@ -8749,37 +8786,30 @@ const InternalPicker = (props, ref) => {
8749
8786
  }
8750
8787
  return defaultIndexs;
8751
8788
  };
8752
- useEffect(() => {
8753
- if (!visible) {
8754
- return;
8755
- }
8756
- Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
8757
- onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
8758
- if (isConfirmEvent.current) {
8759
- isConfirmEvent.current = false;
8760
- onConfirm && onConfirm(setSelectedOptions(), selectedValue);
8761
- }
8762
- }, [selectedValue, columnsList, visible]);
8763
8789
  const chooseItem = (columnOptions, columnIndex2) => {
8764
8790
  var _a, _b;
8791
+ const values = [];
8792
+ const start = columnIndex2;
8765
8793
  if (columnOptions && Object.keys(columnOptions).length) {
8766
- if (selectedValue[columnIndex2] !== columnOptions.value) {
8794
+ if (values[columnIndex2] !== columnOptions.value) {
8767
8795
  if (columnsType() === "cascade") {
8768
- selectedValue[columnIndex2] = columnOptions.value || "";
8769
- setSelectedValue([...selectedValue]);
8796
+ values[columnIndex2] = columnOptions.value || "";
8770
8797
  while ((_a = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a[0]) {
8771
- selectedValue[columnIndex2 + 1] = columnOptions.children[0].value;
8772
- setSelectedValue([...selectedValue]);
8798
+ values[columnIndex2 + 1] = columnOptions.children[0].value;
8773
8799
  columnIndex2++;
8774
8800
  columnOptions = columnOptions.children[0];
8775
8801
  }
8776
8802
  if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
8777
- selectedValue[columnIndex2 + 1] = "";
8778
- setSelectedValue([...selectedValue]);
8803
+ values[columnIndex2 + 1] = "";
8779
8804
  }
8780
- setColumnsList(normalListData());
8805
+ const combineResult = [
8806
+ ...innerValue.slice(0, start),
8807
+ ...values.splice(start)
8808
+ ];
8809
+ setInnerValue(combineResult);
8810
+ setColumnsList(normalListData(combineResult));
8781
8811
  } else {
8782
- setSelectedValue((data) => {
8812
+ setInnerValue((data) => {
8783
8813
  const cdata = [...data];
8784
8814
  cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
8785
8815
  columnOptions,
@@ -8793,16 +8823,16 @@ const InternalPicker = (props, ref) => {
8793
8823
  }
8794
8824
  };
8795
8825
  const confirm = () => {
8796
- let movings = false;
8826
+ let moving = false;
8797
8827
  refs.forEach((ref2) => {
8798
8828
  if (ref2.moving)
8799
- movings = true;
8829
+ moving = true;
8800
8830
  ref2.stopMomentum();
8801
8831
  });
8802
- if (movings) {
8832
+ if (moving) {
8803
8833
  isConfirmEvent.current = true;
8804
8834
  } else {
8805
- onConfirm && onConfirm(setSelectedOptions(), selectedValue);
8835
+ setSelectedValue(innerValue);
8806
8836
  closePicker();
8807
8837
  }
8808
8838
  setTimeout(() => {
@@ -8810,8 +8840,8 @@ const InternalPicker = (props, ref) => {
8810
8840
  }, 0);
8811
8841
  };
8812
8842
  const closePicker = () => {
8813
- onClose && onClose(setSelectedOptions(), selectedValue);
8814
- afterClose && afterClose(setSelectedOptions(), selectedValue, pickerRef);
8843
+ onClose && onClose(setSelectedOptions(), innerValue);
8844
+ afterClose && afterClose(setSelectedOptions(), innerValue, pickerRef);
8815
8845
  };
8816
8846
  const renderTitleBar = () => {
8817
8847
  return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__control` }, /* @__PURE__ */ React.createElement(
@@ -8823,7 +8853,7 @@ const InternalPicker = (props, ref) => {
8823
8853
  locale.cancel
8824
8854
  ), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__title` }, title || ""), /* @__PURE__ */ React.createElement("span", { className: `${classPrefix2}__confirm-btn`, onClick: confirm }, locale.confirm));
8825
8855
  };
8826
- const [pickingStatus, setPickingStatus] = useState(false);
8856
+ const [, setPickingStatus] = useState(false);
8827
8857
  const pickerStart = () => {
8828
8858
  setPickingStatus(true);
8829
8859
  };
@@ -8854,12 +8884,12 @@ const InternalPicker = (props, ref) => {
8854
8884
  closePicker();
8855
8885
  }
8856
8886
  },
8857
- /* @__PURE__ */ React.createElement(View, { className: classes, style, ...rest, catchMove: true }, renderTitleBar(), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
8887
+ /* @__PURE__ */ React.createElement(View, { className: classes, style, ...rest, catchMove: true }, renderTitleBar(), children, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
8858
8888
  return /* @__PURE__ */ React.createElement(
8859
8889
  PickerPanel$1,
8860
8890
  {
8861
8891
  ref: setRefs(index),
8862
- defaultValue: selectedValue == null ? void 0 : selectedValue[index],
8892
+ defaultValue: innerValue == null ? void 0 : innerValue[index],
8863
8893
  options: item,
8864
8894
  threeDimensional,
8865
8895
  chooseItem: (value, index2) => chooseItem(value, index2),
@@ -9709,7 +9739,7 @@ const defaultProps$U = {
9709
9739
  digits: 0,
9710
9740
  async: false
9711
9741
  };
9712
- const classPrefix$c = `nut-inputnumber`;
9742
+ const classPrefix$e = `nut-inputnumber`;
9713
9743
  const InputNumber = (props) => {
9714
9744
  const {
9715
9745
  children,
@@ -9752,8 +9782,8 @@ const InputNumber = (props) => {
9752
9782
  }, []);
9753
9783
  const classes = classNames(
9754
9784
  {
9755
- [`${classPrefix$c}`]: true,
9756
- [`${classPrefix$c}--disabled`]: disabled
9785
+ [`${classPrefix$e}`]: true,
9786
+ [`${classPrefix$e}--disabled`]: disabled
9757
9787
  },
9758
9788
  className
9759
9789
  );
@@ -9926,7 +9956,7 @@ InputNumber.displayName = "NutInputNumber";
9926
9956
  const defaultProps$T = {
9927
9957
  ...ComponentDefaults,
9928
9958
  activeColor: "",
9929
- closeOnClickOverlay: true,
9959
+ closeOnOverlayClick: true,
9930
9960
  scrollFixed: false,
9931
9961
  lockScroll: true,
9932
9962
  icon: null
@@ -9937,7 +9967,7 @@ const Menu = (props) => {
9937
9967
  icon,
9938
9968
  scrollFixed,
9939
9969
  lockScroll,
9940
- closeOnClickOverlay,
9970
+ closeOnOverlayClick,
9941
9971
  children,
9942
9972
  activeColor,
9943
9973
  ...rest
@@ -9986,7 +10016,7 @@ const Menu = (props) => {
9986
10016
  index,
9987
10017
  activeColor,
9988
10018
  parent: {
9989
- closeOnClickOverlay,
10019
+ closeOnOverlayClick,
9990
10020
  lockScroll,
9991
10021
  toggleMenuItem,
9992
10022
  updateTitle,
@@ -10399,7 +10429,7 @@ const defaultProps$Q = {
10399
10429
  direction: "vertical",
10400
10430
  options: []
10401
10431
  };
10402
- const classPrefix$b = "nut-radiogroup";
10432
+ const classPrefix$d = "nut-radiogroup";
10403
10433
  const RadioGroup = React.forwardRef(
10404
10434
  (props, ref) => {
10405
10435
  const {
@@ -10455,8 +10485,8 @@ const RadioGroup = React.forwardRef(
10455
10485
  /* @__PURE__ */ React.createElement(
10456
10486
  "div",
10457
10487
  {
10458
- className: classNames(classPrefix$b, className, {
10459
- [`${classPrefix$b}--${props.direction}`]: props.direction
10488
+ className: classNames(classPrefix$d, className, {
10489
+ [`${classPrefix$d}--${props.direction}`]: props.direction
10460
10490
  }),
10461
10491
  ...rest
10462
10492
  },
@@ -11326,7 +11356,7 @@ const Signature = (props) => {
11326
11356
  onConfirm && onConfirm(res2.tempFilePath);
11327
11357
  },
11328
11358
  fail: (res2) => {
11329
- console.log("保存失败");
11359
+ console.warn("保存失败");
11330
11360
  }
11331
11361
  });
11332
11362
  });
@@ -11762,6 +11792,14 @@ const isFunction = (val) => typeof val === "function";
11762
11792
  const isPromise = (val) => {
11763
11793
  return isObject(val) && isFunction(val.then) && isFunction(val.catch);
11764
11794
  };
11795
+ const upperCaseFirst = (str) => {
11796
+ var str = str.toLowerCase();
11797
+ str = str.replace(
11798
+ /\b\w+\b/g,
11799
+ (word) => word.substring(0, 1).toUpperCase() + word.substring(1)
11800
+ );
11801
+ return str;
11802
+ };
11765
11803
  const funcInterceptor = (interceptor, {
11766
11804
  args = [],
11767
11805
  done,
@@ -12589,7 +12627,7 @@ const defaultProps$C = {
12589
12627
  imageSize: "",
12590
12628
  status: "empty"
12591
12629
  };
12592
- const classPrefix$a = `nut-empty`;
12630
+ const classPrefix$c = `nut-empty`;
12593
12631
  const Empty = (props) => {
12594
12632
  const { locale } = useConfig$1();
12595
12633
  defaultProps$C.description = locale.noData || defaultProps$C.description;
@@ -12625,7 +12663,7 @@ const Empty = (props) => {
12625
12663
  };
12626
12664
  });
12627
12665
  }, [imageSize]);
12628
- return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$a} ${className}`, ...rest }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$a}__image`, style: imgStyle }, imageNode), typeof description === "string" ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$a}__description` }, description) : description, children));
12666
+ return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$c} ${className}`, ...rest }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$c}__image`, style: imgStyle }, imageNode), typeof description === "string" ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$c}__description` }, description) : description, children));
12629
12667
  };
12630
12668
  Empty.defaultProps = defaultProps$C;
12631
12669
  Empty.displayName = "NutEmpty";
@@ -13191,7 +13229,7 @@ const defaultProps$z = {
13191
13229
  onClick: () => {
13192
13230
  }
13193
13231
  };
13194
- const classPrefix$9 = "nut-notify";
13232
+ const classPrefix$b = "nut-notify";
13195
13233
  const Notify = (props) => {
13196
13234
  const {
13197
13235
  id,
@@ -13242,10 +13280,10 @@ const Notify = (props) => {
13242
13280
  onClose();
13243
13281
  };
13244
13282
  const classes = classNames({
13245
- [`${classPrefix$9}--popup-top`]: position === "top",
13246
- [`${classPrefix$9}--popup-bottom`]: position === "bottom",
13247
- [`${classPrefix$9}`]: true,
13248
- [`${classPrefix$9}--${type}`]: true
13283
+ [`${classPrefix$b}--popup-top`]: position === "top",
13284
+ [`${classPrefix$b}--popup-bottom`]: position === "bottom",
13285
+ [`${classPrefix$b}`]: true,
13286
+ [`${classPrefix$b}--${type}`]: true
13249
13287
  });
13250
13288
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13251
13289
  CSSTransition$1,
@@ -13271,165 +13309,264 @@ const Notify = (props) => {
13271
13309
  };
13272
13310
  Notify.defaultProps = defaultProps$z;
13273
13311
  Notify.displayName = "NutNotify";
13274
- function fillRef(ref, node) {
13275
- if (typeof ref === "function") {
13276
- ref(node);
13277
- } else if (typeof ref === "object" && ref && "current" in ref) {
13278
- ref.current = node;
13279
- }
13280
- }
13281
- function composeRef(...refs) {
13282
- return (node) => {
13283
- refs.forEach((ref) => {
13284
- fillRef(ref, node);
13285
- });
13286
- };
13287
- }
13288
- class Trigger extends React.Component {
13289
- fireEvents(type, e) {
13290
- const childCallback = this.props.children.props[type];
13291
- if (childCallback) {
13292
- childCallback(e);
13293
- }
13294
- const callback = this.props[type];
13295
- if (callback) {
13296
- callback(e);
13297
- }
13298
- }
13299
- render() {
13300
- const { children, className = "" } = this.props;
13301
- const child = React.Children.only(children);
13302
- const newChildProps = {
13303
- key: "trigger"
13304
- };
13305
- if (child && child.props && child.props.className) {
13306
- newChildProps.className = className;
13307
- }
13308
- const cloneProps = {
13309
- ...newChildProps
13310
- };
13311
- cloneProps.ref = composeRef(this.props.forwardedRef, child.ref);
13312
- const trigger = React.cloneElement(child, cloneProps);
13313
- return trigger;
13314
- }
13315
- }
13316
13312
  const defaultProps$y = {
13317
13313
  ...ComponentDefaults,
13318
13314
  list: [],
13319
- theme: "light",
13320
13315
  location: "bottom",
13321
13316
  visible: false,
13322
- offset: 20,
13317
+ offset: [0, 12],
13318
+ targetId: "",
13323
13319
  className: "",
13324
- onClick: (e) => {
13320
+ background: "",
13321
+ color: "",
13322
+ showArrow: true,
13323
+ duration: 0.3,
13324
+ overlay: false,
13325
+ overlayClassName: "",
13326
+ overlayStyle: {},
13327
+ closeOnClickOutside: true,
13328
+ closeOnClickAction: true,
13329
+ closeOnOverlayClick: true,
13330
+ onClick: () => {
13325
13331
  },
13326
- onChoose: (item, index) => {
13332
+ onOpen: () => {
13333
+ },
13334
+ onClose: () => {
13335
+ },
13336
+ onSelect: (item, index) => {
13327
13337
  }
13328
13338
  };
13339
+ const classPrefix$a = `nut-popover`;
13329
13340
  const Popover = (props) => {
13330
13341
  const {
13331
13342
  children,
13332
13343
  list,
13333
- theme,
13334
13344
  location,
13335
13345
  visible,
13336
13346
  offset,
13347
+ targetId,
13348
+ overlay,
13349
+ overlayStyle,
13350
+ overlayClassName,
13351
+ closeOnClickOutside,
13352
+ closeOnClickAction,
13353
+ closeOnOverlayClick,
13337
13354
  className,
13355
+ showArrow,
13338
13356
  style,
13357
+ background,
13358
+ color,
13339
13359
  onClick,
13340
- onChoose,
13360
+ onOpen,
13361
+ onClose,
13362
+ onSelect,
13341
13363
  ...reset
13342
13364
  } = {
13343
13365
  ...defaultProps$y,
13344
13366
  ...props
13345
13367
  };
13346
- const goodItem = useRef(null);
13347
- setTimeout(async () => {
13348
- if (goodItem.current) {
13349
- const res = await getRectByTaro(goodItem.current);
13350
- setElWidth(res == null ? void 0 : res.width);
13351
- setElHeight(res == null ? void 0 : res.height);
13352
- }
13353
- });
13354
- const [classes, setClasses] = useState("");
13368
+ const popoverRef = useRef(null);
13369
+ const popoverContentRef = useRef(null);
13370
+ const [showPopup, setShowPopup] = useState(false);
13355
13371
  const [elWidth, setElWidth] = useState(0);
13356
13372
  const [elHeight, setElHeight] = useState(0);
13357
- const [popoverContent, setPopoverContent] = useState("");
13358
- const [popoverArrow, setPopoverArrow] = useState("");
13373
+ const [rootPosition, setRootPosition] = useState();
13359
13374
  useEffect(() => {
13360
- setClasses(classesSelf());
13361
- setPopoverContent(popoverContentSelf());
13362
- setPopoverArrow(popoverArrowSelf());
13363
- }, [list, theme]);
13364
- const getStyle = () => {
13365
- const offNumer = Number(offset) ? Number(offset) : 0;
13366
- const style2 = {};
13367
- if (location.includes("top")) {
13368
- style2.bottom = `${elHeight + offNumer}px`;
13369
- } else if (location.includes("right")) {
13370
- style2.left = `${elWidth + offNumer}px`;
13371
- } else if (location.includes("left")) {
13372
- style2.right = `${elWidth + offNumer}px`;
13373
- } else {
13374
- style2.top = `${elHeight + offNumer}px`;
13375
+ setShowPopup(visible);
13376
+ if (visible) {
13377
+ setTimeout(() => {
13378
+ getContentWidth();
13379
+ }, 0);
13375
13380
  }
13376
- return style2;
13381
+ }, [visible]);
13382
+ const getContentWidth = async () => {
13383
+ let rect;
13384
+ if (targetId) {
13385
+ if (Taro.getEnv() == Taro.ENV_TYPE.WEB) {
13386
+ rect = getRect(document.querySelector(`#${targetId}`));
13387
+ } else {
13388
+ rect = await getRectTaro(targetId);
13389
+ }
13390
+ } else {
13391
+ rect = await getRectByTaro(popoverRef.current);
13392
+ }
13393
+ setRootPosition({
13394
+ width: rect.width,
13395
+ height: rect.height,
13396
+ left: rect.left,
13397
+ top: rect.top,
13398
+ right: rect.right
13399
+ });
13400
+ setTimeout(() => {
13401
+ getPopoverContentW();
13402
+ }, 300);
13377
13403
  };
13378
- const classesSelf = () => {
13379
- const prefixCls2 = "nut-popover";
13380
- return `${prefixCls2} ${theme ? `${prefixCls2}--${theme}` : ""}`;
13404
+ const getRectTaro = async (targetId2) => {
13405
+ return new Promise((resolve) => {
13406
+ const query = Taro.createSelectorQuery();
13407
+ query.select(`#${targetId2}`) && query.select(`#${targetId2}`).boundingClientRect();
13408
+ query.exec(function(res) {
13409
+ resolve(res[0]);
13410
+ });
13411
+ });
13381
13412
  };
13382
- const popoverContentSelf = () => {
13383
- const prefixCls2 = "popover-content";
13384
- return `${prefixCls2}-show ${prefixCls2} ${location ? `${prefixCls2}--${location}` : ""}`;
13413
+ const getPopoverContentW = async () => {
13414
+ let rectContent = await getRectByTaro(popoverContentRef.current);
13415
+ setElWidth(rectContent.width);
13416
+ setElHeight(rectContent.height);
13385
13417
  };
13386
- const filter = () => {
13387
- const ms = ["top", "bottom", "left", "right"];
13388
- return ms.filter((m) => location.includes(m))[0];
13418
+ const clickAway = () => {
13419
+ if (closeOnClickOutside) {
13420
+ props.onClick && props.onClick();
13421
+ onClose && onClose();
13422
+ }
13389
13423
  };
13390
- const popoverArrowSelf = () => {
13391
- const prefixCls2 = "popover-arrow";
13392
- return `${prefixCls2} ${prefixCls2}-${filter()} ${location ? `${prefixCls2}--${location}` : ""}`;
13424
+ const classes = classNames(
13425
+ {
13426
+ [`${classPrefix$a}`]: true
13427
+ },
13428
+ className
13429
+ );
13430
+ const customStyle = () => {
13431
+ const styles = {};
13432
+ if (background) {
13433
+ styles.background = background;
13434
+ }
13435
+ if (color) {
13436
+ styles.color = color;
13437
+ }
13438
+ return styles;
13393
13439
  };
13394
- const handleClick = (e) => {
13395
- if (props.onClick) {
13396
- props.onClick(e);
13440
+ const popoverArrow = () => {
13441
+ const prefixCls2 = "nut-popover-arrow";
13442
+ const loca = location;
13443
+ const direction = loca.split("-")[0];
13444
+ return `${prefixCls2} ${prefixCls2}-${direction} ${prefixCls2}--${loca}`;
13445
+ };
13446
+ const popoverArrowStyle = () => {
13447
+ const styles = {};
13448
+ const { background: background2 } = props;
13449
+ const direction = location.split("-")[0];
13450
+ if (background2) {
13451
+ styles[`border${upperCaseFirst(direction)}Color`] = background2;
13397
13452
  }
13453
+ return styles;
13398
13454
  };
13399
- const handleChoose = (item, index) => {
13455
+ const getRootPosition = () => {
13456
+ let styles = {};
13457
+ if (!rootPosition) {
13458
+ styles.visibility = "hidden";
13459
+ return styles;
13460
+ }
13461
+ const contentWidth = elWidth;
13462
+ const contentHeight = elHeight;
13463
+ const { width, height, left, top, right } = rootPosition;
13464
+ const direction = location.split("-")[0];
13465
+ const skew = location.split("-")[1];
13466
+ let cross = 0;
13467
+ let parallel = 0;
13468
+ if (Array.isArray(offset) && offset.length == 2) {
13469
+ cross += +offset[1];
13470
+ parallel += +offset[0];
13471
+ }
13472
+ if (width) {
13473
+ if (["bottom", "top"].includes(direction)) {
13474
+ const h = direction == "bottom" ? height + cross : -(contentHeight + cross);
13475
+ styles.top = `${top + h}px`;
13476
+ if (!skew) {
13477
+ styles.left = `${-(contentWidth - width) / 2 + left + parallel}px`;
13478
+ }
13479
+ if (skew == "start") {
13480
+ styles.left = `${left + parallel}px`;
13481
+ }
13482
+ if (skew == "end") {
13483
+ styles.left = `${right + parallel}px`;
13484
+ }
13485
+ }
13486
+ if (["left", "right"].includes(direction)) {
13487
+ const contentW = direction == "left" ? -(contentWidth + cross) : width + cross;
13488
+ styles.left = `${left + contentW}px`;
13489
+ if (!skew) {
13490
+ styles.top = `${top - contentHeight / 2 + height / 2 - 4 + parallel}px`;
13491
+ }
13492
+ if (skew == "start") {
13493
+ styles.top = `${top + parallel}px`;
13494
+ }
13495
+ if (skew == "end") {
13496
+ styles.top = `${top + height + parallel}px`;
13497
+ }
13498
+ }
13499
+ }
13500
+ if (elWidth === 0) {
13501
+ styles.visibility = "hidden";
13502
+ } else {
13503
+ styles.visibility = "initial";
13504
+ }
13505
+ return styles;
13506
+ };
13507
+ const handleSelect = (item, index) => {
13400
13508
  if (!item.disabled) {
13401
- onChoose(item, index);
13509
+ onSelect(item, index);
13510
+ }
13511
+ if (closeOnClickAction) {
13512
+ props.onClick && props.onClick();
13513
+ onClose && onClose();
13402
13514
  }
13403
13515
  };
13404
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13516
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, !targetId && /* @__PURE__ */ React.createElement(
13405
13517
  "div",
13406
13518
  {
13407
- className: `${classes} ${className}`,
13408
- style: { ...style },
13409
- ...reset
13519
+ className: "nut-popover-wrapper",
13520
+ ref: popoverRef,
13521
+ onClick: () => {
13522
+ props.onClick && props.onClick();
13523
+ if (!visible) {
13524
+ onOpen && onOpen();
13525
+ } else {
13526
+ onClose && onClose();
13527
+ }
13528
+ },
13529
+ style
13530
+ },
13531
+ Array.isArray(children) ? children[0] : children
13532
+ ), /* @__PURE__ */ React.createElement("div", { className: classes, style: getRootPosition(), ...reset }, /* @__PURE__ */ React.createElement(
13533
+ Popup,
13534
+ {
13535
+ className: `nut-popover-content nut-popover-content--${location}`,
13536
+ style: customStyle(),
13537
+ position: "default",
13538
+ overlay,
13539
+ overlayStyle,
13540
+ overlayClassName,
13541
+ closeOnOverlayClick,
13542
+ visible: showPopup
13410
13543
  },
13411
- /* @__PURE__ */ React.createElement(Trigger, { forwardedRef: goodItem }, /* @__PURE__ */ React.createElement("div", { onClick: (e) => handleClick(e) }, Array.isArray(children) ? children[0] : children, visible ? /* @__PURE__ */ React.createElement("div", { className: `${popoverContent}`, style: getStyle() }, /* @__PURE__ */ React.createElement("div", { className: `${popoverArrow}` }), Array.isArray(children) ? children[1] : "", /* @__PURE__ */ React.createElement("div", null, list.map((item, i) => {
13544
+ /* @__PURE__ */ React.createElement("div", { className: "nut-popover-content-group", ref: popoverContentRef }, showArrow && /* @__PURE__ */ React.createElement("div", { className: popoverArrow(), style: popoverArrowStyle() }), Array.isArray(children) ? children[1] : "", list.map((item, index) => {
13412
13545
  return /* @__PURE__ */ React.createElement(
13413
13546
  "div",
13414
13547
  {
13415
- key: item.name,
13416
- className: `popover-menu-item ${item.disabled ? "disabled" : ""}`,
13417
- onClick: () => {
13418
- handleChoose(item, i);
13419
- }
13548
+ className: classNames(
13549
+ {
13550
+ "nut-popover-menu-item": true,
13551
+ "nut-popover-menu-disabled": item.disabled
13552
+ },
13553
+ item.className
13554
+ ),
13555
+ key: item.key,
13556
+ onClick: () => handleSelect(item, index)
13420
13557
  },
13421
13558
  item.icon ? item.icon : null,
13422
- /* @__PURE__ */ React.createElement("div", { className: "popover-menu-item-name" }, item.name)
13559
+ /* @__PURE__ */ React.createElement("div", { className: "nut-popover-menu-item-name" }, item.name)
13423
13560
  );
13424
- }))) : null))
13425
- ), visible ? /* @__PURE__ */ React.createElement(
13426
- Overlay$1,
13561
+ }))
13562
+ ), showPopup && /* @__PURE__ */ React.createElement(
13563
+ "div",
13427
13564
  {
13428
- visible,
13429
- onClick: (e) => handleClick(e),
13430
- style: { background: "transparent" }
13565
+ className: "nut-popover-content-bg",
13566
+ onClick: clickAway,
13567
+ onTouchMove: clickAway
13431
13568
  }
13432
- ) : null);
13569
+ )));
13433
13570
  };
13434
13571
  Popover.defaultProps = defaultProps$y;
13435
13572
  Popover.displayName = "NutPopover";
@@ -13589,7 +13726,7 @@ const defaultProps$w = {
13589
13726
  src: "",
13590
13727
  alt: ""
13591
13728
  };
13592
- const classPrefix$8 = `nut-avatar`;
13729
+ const classPrefix$9 = `nut-avatar`;
13593
13730
  const Avatar = (props) => {
13594
13731
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
13595
13732
  const {
@@ -13621,7 +13758,7 @@ const Avatar = (props) => {
13621
13758
  [`nut-avatar-${((_a = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a.size) || size || "normal"}`]: true,
13622
13759
  [`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
13623
13760
  });
13624
- const cls = classNames(classPrefix$8, classes, className);
13761
+ const cls = classNames(classPrefix$9, classes, className);
13625
13762
  const styles = {
13626
13763
  width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
13627
13764
  height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
@@ -14042,7 +14179,7 @@ const defaultProps$t = {
14042
14179
  }
14043
14180
  // 未实现
14044
14181
  };
14045
- const classPrefix$7 = "nut-toast";
14182
+ const classPrefix$8 = "nut-toast";
14046
14183
  const Toast = (props) => {
14047
14184
  const {
14048
14185
  children,
@@ -14123,21 +14260,21 @@ const Toast = (props) => {
14123
14260
  {
14124
14261
  visible: openState,
14125
14262
  style,
14126
- className: `${classPrefix$7}__overlay-default ${className}`,
14263
+ className: `${classPrefix$8}__overlay-default ${className}`,
14127
14264
  closeOnOverlayClick,
14128
14265
  onClick: () => {
14129
14266
  clickCover();
14130
14267
  }
14131
14268
  },
14132
- /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$7} ${classes}`, id }, /* @__PURE__ */ React.createElement(
14269
+ /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$8} ${classes}`, id }, /* @__PURE__ */ React.createElement(
14133
14270
  "div",
14134
14271
  {
14135
- className: `${classPrefix$7}__inner ${classPrefix$7}-${position} ${contentClassName}`,
14272
+ className: `${classPrefix$8}__inner ${classPrefix$8}-${position} ${contentClassName}`,
14136
14273
  style: contentStyle
14137
14274
  },
14138
- hasIcon() ? /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$7}__icon-wrapper` }, iconName()) : null,
14139
- title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$7}-title` }, title) : null,
14140
- /* @__PURE__ */ React.createElement("span", { className: `${classPrefix$7}-text` }, msg)
14275
+ hasIcon() ? /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$8}__icon-wrapper` }, iconName()) : null,
14276
+ title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$8}-title` }, title) : null,
14277
+ /* @__PURE__ */ React.createElement("span", { className: `${classPrefix$8}-text` }, msg)
14141
14278
  ))
14142
14279
  ) : null);
14143
14280
  };
@@ -14151,7 +14288,7 @@ const defaultProps$s = {
14151
14288
  onClick: (event) => {
14152
14289
  }
14153
14290
  };
14154
- const classPrefix$6 = `nut-animate`;
14291
+ const classPrefix$7 = `nut-animate`;
14155
14292
  const Animate = (props) => {
14156
14293
  const { className, type, action, loop, onClick, children, ...rest } = {
14157
14294
  ...defaultProps$s,
@@ -14160,7 +14297,7 @@ const Animate = (props) => {
14160
14297
  const [clicked, setClicked] = useState(false);
14161
14298
  const classes = classNames({
14162
14299
  "nut-ani-container": true,
14163
- [`${classPrefix$6}-${type}`]: action === "initial" || clicked ? type : false,
14300
+ [`${classPrefix$7}-${type}`]: action === "initial" || clicked ? type : false,
14164
14301
  loop
14165
14302
  });
14166
14303
  const cls = classNames(classes, className);
@@ -14382,8 +14519,8 @@ const Audio = (props) => {
14382
14519
  setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
14383
14520
  });
14384
14521
  audioCtx.onError((res) => {
14385
- console.log("code", res.errCode);
14386
- console.log("message", res.errMsg);
14522
+ console.warn("code", res.errCode);
14523
+ console.warn("message", res.errMsg);
14387
14524
  });
14388
14525
  function formatSeconds(value) {
14389
14526
  if (!value) {
@@ -14499,12 +14636,12 @@ const defaultProps$o = {
14499
14636
  gap: "-8",
14500
14637
  level: "left"
14501
14638
  };
14502
- const classPrefix$5 = `nut-avatar-group`;
14639
+ const classPrefix$6 = `nut-avatar-group`;
14503
14640
  const AvatarGroup = (props) => {
14504
14641
  const propAvatarGroup = { ...defaultProps$o, ...props };
14505
14642
  const { className, style, children } = propAvatarGroup;
14506
14643
  const avatarGroupRef = useRef(null);
14507
- const cls = classNames(classPrefix$5, className);
14644
+ const cls = classNames(classPrefix$6, className);
14508
14645
  const parentAvatar = {
14509
14646
  propAvatarGroup,
14510
14647
  avatarGroupRef
@@ -14522,7 +14659,7 @@ const defaultProps$n = {
14522
14659
  background: "#e5e9f2",
14523
14660
  clockwise: true
14524
14661
  };
14525
- const classPrefix$4 = `nut-circleprogress`;
14662
+ const classPrefix$5 = `nut-circleprogress`;
14526
14663
  const CircleProgress = (props) => {
14527
14664
  const {
14528
14665
  children,
@@ -14541,7 +14678,7 @@ const CircleProgress = (props) => {
14541
14678
  ...props
14542
14679
  };
14543
14680
  const [oldValue, setOldValue] = useState(percent);
14544
- const classes = classNames(className, classPrefix$4);
14681
+ const classes = classNames(className, classPrefix$5);
14545
14682
  const refRandomId = Math.random().toString(36).slice(-8);
14546
14683
  const animateIdRef = useRef(0);
14547
14684
  const styles = {
@@ -14684,7 +14821,7 @@ const CollapseItem = (props) => {
14684
14821
  const [wrapperHeight, setWrapperHeight] = useState(
14685
14822
  () => expanded ? "auto" : "0px"
14686
14823
  );
14687
- const getRect = (selector) => {
14824
+ const getRect2 = (selector) => {
14688
14825
  return new Promise((resolve) => {
14689
14826
  Taro.createSelectorQuery().select(selector).boundingClientRect().exec((rect = []) => {
14690
14827
  resolve(rect[0]);
@@ -14693,7 +14830,7 @@ const CollapseItem = (props) => {
14693
14830
  };
14694
14831
  useEffect(() => {
14695
14832
  setTimeout(() => {
14696
- getRect(target).then((res) => {
14833
+ getRect2(target).then((res) => {
14697
14834
  if (res == null ? void 0 : res.height) {
14698
14835
  setCurrentHeight(`${res.height}px`);
14699
14836
  }
@@ -14702,7 +14839,7 @@ const CollapseItem = (props) => {
14702
14839
  }, [children]);
14703
14840
  useEffect(() => {
14704
14841
  setTimeout(() => {
14705
- getRect(target).then((res) => {
14842
+ getRect2(target).then((res) => {
14706
14843
  if (res == null ? void 0 : res.height) {
14707
14844
  setCurrentHeight(`${res.height}px`);
14708
14845
  }
@@ -15099,7 +15236,7 @@ const defaultProps$j = {
15099
15236
  lineHeight: "20",
15100
15237
  width: "auto"
15101
15238
  };
15102
- const classPrefix$3 = `nut-ellipsis`;
15239
+ const classPrefix$4 = `nut-ellipsis`;
15103
15240
  const Ellipsis = (props) => {
15104
15241
  var _a, _b, _c, _d;
15105
15242
  const {
@@ -15117,7 +15254,7 @@ const Ellipsis = (props) => {
15117
15254
  onChange,
15118
15255
  ...rest
15119
15256
  } = { ...defaultProps$j, ...props };
15120
- let maxHeight = 0;
15257
+ const maxHeight = useRef(0);
15121
15258
  const [exceeded, setExceeded] = useState(false);
15122
15259
  const [expanded, setExpanded] = useState(false);
15123
15260
  const ellipsis = useRef({
@@ -15128,8 +15265,8 @@ const Ellipsis = (props) => {
15128
15265
  const rootContain = useRef(null);
15129
15266
  const symbolContain = useRef(null);
15130
15267
  const [contentCopy, setContentCopy] = useState(content);
15131
- let lineH = 0;
15132
- let originHeight = 0;
15268
+ const lineH = useRef(0);
15269
+ const originHeight = useRef(0);
15133
15270
  const refRandomId = Math.random().toString(36).slice(-8);
15134
15271
  const widthRef = useRef("auto");
15135
15272
  let widthBase = [14, 10, 7, 8.4, 10];
@@ -15139,9 +15276,9 @@ const Ellipsis = (props) => {
15139
15276
  const letterUpperReg = /^[A-Z]+$/;
15140
15277
  const letterLowerReg = /^[a-z]+$/;
15141
15278
  const classes = classNames(
15142
- classPrefix$3,
15279
+ classPrefix$4,
15143
15280
  className,
15144
- width ? `${classPrefix$3}-width` : ""
15281
+ width ? `${classPrefix$4}-width` : ""
15145
15282
  );
15146
15283
  const init = () => {
15147
15284
  setExceeded(false);
@@ -15153,7 +15290,10 @@ const Ellipsis = (props) => {
15153
15290
  });
15154
15291
  };
15155
15292
  useReady(() => init());
15156
- useEffect(() => init(), [content]);
15293
+ useEffect(
15294
+ () => init(),
15295
+ [content, lineH.current, maxHeight.current, originHeight.current]
15296
+ );
15157
15297
  const getSymbolInfo = async () => {
15158
15298
  const refe = await getRectByTaro(symbolContain == null ? void 0 : symbolContain.current);
15159
15299
  symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
@@ -15181,13 +15321,13 @@ const Ellipsis = (props) => {
15181
15321
  (res) => {
15182
15322
  if (!res)
15183
15323
  return;
15184
- lineH = pxToNumber(
15324
+ lineH.current = pxToNumber(
15185
15325
  res.lineHeight === "normal" ? lineHeight : res.lineHeight
15186
15326
  );
15187
- maxHeight = Math.floor(
15188
- lineH * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom)
15327
+ maxHeight.current = Math.floor(
15328
+ lineH.current * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom)
15189
15329
  );
15190
- originHeight = pxToNumber(res.height);
15330
+ originHeight.current = pxToNumber(res.height);
15191
15331
  widthRef.current = res.width;
15192
15332
  const bsize = pxToNumber(res.fontSize);
15193
15333
  widthBase = [
@@ -15203,10 +15343,12 @@ const Ellipsis = (props) => {
15203
15343
  };
15204
15344
  const calcEllipse = async () => {
15205
15345
  const refe = await getRectByTaro(rootContain.current);
15206
- if (refe.height <= maxHeight) {
15346
+ if (refe.height <= maxHeight.current) {
15207
15347
  setExceeded(false);
15208
15348
  } else {
15209
- const rowNum = Math.floor(content.length / (originHeight / lineH - 1));
15349
+ const rowNum = Math.floor(
15350
+ content.length / (originHeight.current / lineH.current - 1)
15351
+ );
15210
15352
  if (direction === "middle") {
15211
15353
  const end = content.length;
15212
15354
  ellipsis.current.leading = tailorContent(
@@ -15235,7 +15377,7 @@ const Ellipsis = (props) => {
15235
15377
  const verifyEllipsis = async () => {
15236
15378
  var _a2, _b2, _c2, _d2, _e, _f;
15237
15379
  const refe = await getRectByTaro(rootContain.current);
15238
- if (refe && refe.height && refe.height > maxHeight) {
15380
+ if (refe && refe.height && refe.height > maxHeight.current) {
15239
15381
  if (direction === "end") {
15240
15382
  ellipsis.current.leading = (_c2 = (_a2 = ellipsis.current) == null ? void 0 : _a2.leading) == null ? void 0 : _c2.slice(
15241
15383
  0,
@@ -15402,14 +15544,14 @@ const defaultProps$i = {
15402
15544
  current: 0,
15403
15545
  direction: "horizontal"
15404
15546
  };
15405
- const classPrefix$2 = `nut-indicator`;
15547
+ const classPrefix$3 = `nut-indicator`;
15406
15548
  const Indicator = (props) => {
15407
15549
  const { total, current, children, className, direction, ...rest } = {
15408
15550
  ...defaultProps$i,
15409
15551
  ...props
15410
15552
  };
15411
15553
  const classes = classNames({
15412
- [`${classPrefix$2}__vertical`]: direction === "vertical"
15554
+ [`${classPrefix$3}__vertical`]: direction === "vertical"
15413
15555
  });
15414
15556
  const renderElement = () => {
15415
15557
  const childs = [];
@@ -15419,9 +15561,9 @@ const Indicator = (props) => {
15419
15561
  "div",
15420
15562
  {
15421
15563
  key: item,
15422
- className: `${classPrefix$2}__dot ${classPrefix$2}__active`
15564
+ className: `${classPrefix$3}__dot ${classPrefix$3}__active`
15423
15565
  }
15424
- ) : /* @__PURE__ */ React.createElement("div", { key: item, className: `${classPrefix$2}__dot` })
15566
+ ) : /* @__PURE__ */ React.createElement("div", { key: item, className: `${classPrefix$3}__dot` })
15425
15567
  );
15426
15568
  }
15427
15569
  return childs;
@@ -15437,7 +15579,7 @@ const defaultProps$h = {
15437
15579
  loop: false,
15438
15580
  defaultValue: 0
15439
15581
  };
15440
- const classPrefix$1 = "nut-swiper";
15582
+ const classPrefix$2 = "nut-swiper";
15441
15583
  const Swiper = forwardRef((props, ref) => {
15442
15584
  const {
15443
15585
  width,
@@ -15468,8 +15610,8 @@ const Swiper = forwardRef((props, ref) => {
15468
15610
  "div",
15469
15611
  {
15470
15612
  className: classNames({
15471
- [`${classPrefix$1}__indicator`]: true,
15472
- [`${classPrefix$1}__indicator-vertical`]: direction === "vertical"
15613
+ [`${classPrefix$2}__indicator`]: true,
15614
+ [`${classPrefix$2}__indicator-vertical`]: direction === "vertical"
15473
15615
  })
15474
15616
  },
15475
15617
  /* @__PURE__ */ React.createElement(
@@ -15511,7 +15653,7 @@ const Swiper = forwardRef((props, ref) => {
15511
15653
  return /* @__PURE__ */ React.createElement(
15512
15654
  View,
15513
15655
  {
15514
- className: classNames(classPrefix$1, className),
15656
+ className: classNames(classPrefix$2, className),
15515
15657
  style: {
15516
15658
  width: !width ? "100%" : `${width}px`,
15517
15659
  height: !height ? "150px" : `${height}px`
@@ -16578,7 +16720,7 @@ const defaultProps$7 = {
16578
16720
  loop: false
16579
16721
  }
16580
16722
  };
16581
- const classPrefix = `nut-video`;
16723
+ const classPrefix$1 = `nut-video`;
16582
16724
  const Video = (props) => {
16583
16725
  const {
16584
16726
  children,
@@ -16593,7 +16735,7 @@ const Video = (props) => {
16593
16735
  ...defaultProps$7,
16594
16736
  ...props
16595
16737
  };
16596
- const classes = classNames(className, classPrefix);
16738
+ const classes = classNames(className, classPrefix$1);
16597
16739
  return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, /* @__PURE__ */ React.createElement(
16598
16740
  Video$1,
16599
16741
  {
@@ -16613,38 +16755,38 @@ const Video = (props) => {
16613
16755
  Video.defaultProps = defaultProps$7;
16614
16756
  Video.displayName = "NutVideo";
16615
16757
  const defaultProps$6 = {
16616
- barrageList: [],
16617
- frequency: 500,
16758
+ ...ComponentDefaults,
16759
+ list: [],
16760
+ interval: 500,
16618
16761
  loop: true,
16619
- speeds: 3e3,
16762
+ duration: 3e3,
16620
16763
  rows: 3,
16621
- top: 10
16764
+ gapY: 10
16622
16765
  };
16766
+ const classPrefix = `nut-barrage`;
16623
16767
  const InternalBarrage = (props, ref) => {
16624
16768
  const {
16625
16769
  className,
16626
- frequency,
16770
+ interval,
16627
16771
  loop,
16628
- barrageList,
16629
- speeds,
16772
+ list,
16773
+ duration,
16630
16774
  rows,
16631
- top,
16775
+ gapY,
16632
16776
  ...restProps
16633
16777
  } = {
16634
16778
  ...defaultProps$6,
16635
16779
  ...props
16636
16780
  };
16637
16781
  const [styleList, setStyleList] = useState([]);
16638
- const [baItemList, setBaItemList] = useState(barrageList);
16639
- const barrageListSet = useRef(barrageList);
16782
+ const [baItemList, setBaItemList] = useState(list);
16783
+ const barrageListSet = useRef(list);
16640
16784
  const barrageBody = useRef(null);
16641
16785
  const barrageContainer = useRef(null);
16642
16786
  const timeId = useRef((/* @__PURE__ */ new Date()).getTime());
16643
16787
  const timer = useRef(0);
16644
- useRef(0);
16645
- const b2 = cn("barrage");
16646
- const classes = classNames(className, b2(""), {
16647
- [`nut-barrage__body${timeId.current}`]: true
16788
+ const classes = classNames(className, classPrefix, {
16789
+ [`${classPrefix}__body${timeId.current}`]: true
16648
16790
  });
16649
16791
  useImperativeHandle(ref, () => ({
16650
16792
  add: (word) => {
@@ -16653,53 +16795,53 @@ const InternalBarrage = (props, ref) => {
16653
16795
  }
16654
16796
  }));
16655
16797
  useEffect(() => {
16656
- barrageListSet.current = [...barrageList];
16798
+ barrageListSet.current = [...list];
16657
16799
  run();
16658
16800
  return () => {
16659
16801
  clearInterval(timer.current);
16660
16802
  };
16661
- }, [barrageList]);
16803
+ }, [list]);
16662
16804
  const run = () => {
16663
16805
  setBaItemList(barrageListSet.current);
16664
- barrageListSet.current.forEach((item, index2) => {
16665
- getNode(index2);
16806
+ barrageListSet.current.forEach((item, index) => {
16807
+ getNode(index);
16666
16808
  });
16667
16809
  };
16668
- const getNode = (index2) => {
16810
+ const getNode = (index) => {
16669
16811
  const query = createSelectorQuery();
16670
16812
  setTimeout(() => {
16671
16813
  let width = 100;
16672
- query.select(".nut-barrage__body" + timeId.current).boundingClientRect((rec) => {
16814
+ query.select(`.${classPrefix}__body` + timeId.current).boundingClientRect((rec) => {
16673
16815
  width = rec.width || 300;
16674
16816
  });
16675
- query.select(".nut-barrage__item" + index2).boundingClientRect((recs) => {
16817
+ query.select(`.${classPrefix}__item` + index).boundingClientRect((recs) => {
16676
16818
  let height = recs.height;
16677
- let nodeTop = index2 % rows * (height + top) + 20 + "px";
16678
- styleInfo(index2, nodeTop, width);
16819
+ let nodeTop = index % rows * (height + gapY) + 20 + "px";
16820
+ styleInfo(index, nodeTop, width);
16679
16821
  }).exec();
16680
16822
  }, 500);
16681
16823
  };
16682
- const styleInfo = (index2, nodeTop, width) => {
16683
- let timeIndex = index2 - rows > 0 ? index2 - rows : 0;
16684
- let list = styleList;
16685
- let time = list[timeIndex] ? Number(list[timeIndex]["--time"]) : 0;
16824
+ const styleInfo = (index, nodeTop, width) => {
16825
+ let timeIndex = index - rows > 0 ? index - rows : 0;
16826
+ let list2 = styleList;
16827
+ let time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
16686
16828
  let obj = {
16687
16829
  top: nodeTop,
16688
- "--time": `${frequency * index2 + time}`,
16689
- animationDuration: `${speeds}ms`,
16830
+ "--time": `${interval * index + time}`,
16831
+ animationDuration: `${duration}ms`,
16690
16832
  animationIterationCount: `${loop ? "infinite" : 1}`,
16691
- animationDelay: `${frequency * index2 + time}ms`,
16833
+ animationDelay: `${interval * index + time}ms`,
16692
16834
  "--move-distance": `-${width}px`
16693
16835
  };
16694
- list.push(obj);
16695
- setStyleList([...list]);
16836
+ list2.push(obj);
16837
+ setStyleList([...list2]);
16696
16838
  };
16697
- return /* @__PURE__ */ React.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index2) => {
16839
+ return /* @__PURE__ */ React.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
16698
16840
  return /* @__PURE__ */ React.createElement(
16699
16841
  "div",
16700
16842
  {
16701
- className: `barrage-item nut-barrage__item${index2} move`,
16702
- style: styleList[index2]
16843
+ className: `barrage-item ${classPrefix}__item${index} move`,
16844
+ style: styleList[index]
16703
16845
  },
16704
16846
  item.length > 8 ? item.substr(0, 8) + "..." : item
16705
16847
  );