@nutui/nutui-react-taro 1.3.3 → 1.3.4

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 (168) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +3 -2
  3. package/dist/esm/ActionSheet.js +3 -3
  4. package/dist/esm/Address.js +3 -3
  5. package/dist/esm/Audio.js +6 -7
  6. package/dist/esm/Avatar.js +2 -2
  7. package/dist/esm/BackTop.js +2 -2
  8. package/dist/esm/Badge.js +2 -2
  9. package/dist/esm/Barrage.js +2 -2
  10. package/dist/esm/Button.js +2 -2
  11. package/dist/esm/Calendar.js +3 -3
  12. package/dist/esm/Card.js +3 -3
  13. package/dist/esm/Cascader.js +4 -4
  14. package/dist/esm/Cell.js +2 -2
  15. package/dist/esm/Checkbox.js +2 -2
  16. package/dist/esm/CircleProgress.js +2 -2
  17. package/dist/esm/CollapseItem.js +2 -2
  18. package/dist/esm/DatePicker.js +4 -4
  19. package/dist/esm/Dialog.js +3 -3
  20. package/dist/esm/FixedNav.js +2 -2
  21. package/dist/esm/GridItem.js +2 -2
  22. package/dist/esm/ImagePreview.js +5 -5
  23. package/dist/esm/Infiniteloading.js +4 -2
  24. package/dist/esm/Input.js +2 -2
  25. package/dist/esm/InputNumber.js +2 -2
  26. package/dist/esm/Menu.js +2 -2
  27. package/dist/esm/MenuItem.js +2 -2
  28. package/dist/esm/NavBar.js +2 -2
  29. package/dist/esm/NoticeBar.js +2 -2
  30. package/dist/esm/Notify.js +2 -3
  31. package/dist/esm/NumberKeyboard.js +3 -3
  32. package/dist/esm/Picker.js +3 -3
  33. package/dist/esm/Popover.js +2 -2
  34. package/dist/esm/Popup.js +2 -2
  35. package/dist/esm/Progress.js +2 -2
  36. package/dist/esm/PullToRefresh.js +2 -2
  37. package/dist/esm/Radio.js +2 -2
  38. package/dist/esm/Range.js +3 -5
  39. package/dist/esm/Rate.js +2 -2
  40. package/dist/esm/SearchBar.js +2 -2
  41. package/dist/esm/ShortPassword.js +3 -3
  42. package/dist/esm/SideNavBar.js +3 -3
  43. package/dist/esm/Signature.js +3 -3
  44. package/dist/esm/Skeleton.js +3 -3
  45. package/dist/esm/Step.js +2 -2
  46. package/dist/esm/Sticky/style/index.js +2 -0
  47. package/dist/esm/Sticky.js +5 -0
  48. package/dist/esm/Swiper.js +3 -3
  49. package/dist/esm/TabbarItem.js +2 -2
  50. package/dist/esm/Table.js +2 -2
  51. package/dist/esm/Tabs.js +2 -2
  52. package/dist/esm/Tag.js +2 -2
  53. package/dist/esm/TimeSelect.js +3 -3
  54. package/dist/esm/Toast.js +2 -4
  55. package/dist/esm/Uploader.js +8 -4
  56. package/dist/esm/{actionsheet.taro-08b7eab2.js → actionsheet.taro-360d8d34.js} +1 -1
  57. package/dist/esm/{address.taro-5f8dbfc3.js → address.taro-7540c626.js} +8 -6
  58. package/dist/esm/{audio.taro-327472dc.js → audio.taro-ab2528b2.js} +105 -148
  59. package/dist/esm/{avatar.taro-766690a4.js → avatar.taro-ec620cdd.js} +5 -3
  60. package/dist/esm/{backtop.taro-c414da6c.js → backtop.taro-aa8b2bc5.js} +5 -3
  61. package/dist/esm/{badge.taro-351d0088.js → badge.taro-38684262.js} +5 -3
  62. package/dist/esm/{barrage.taro-efac8422.js → barrage.taro-d86c367a.js} +3 -10
  63. package/dist/esm/{button.taro-7074924f.js → button.taro-a9ebb937.js} +7 -5
  64. package/dist/esm/{calendar.taro-156a74c0.js → calendar.taro-438940bd.js} +1 -1
  65. package/dist/esm/{card.taro-f81f1b5c.js → card.taro-1bc35ebe.js} +1 -1
  66. package/dist/esm/{cascader.taro-39402f43.js → cascader.taro-35387092.js} +2 -2
  67. package/dist/esm/{cell.taro-075998e0.js → cell.taro-a4c3bb7b.js} +7 -5
  68. package/dist/esm/{checkbox.taro-62677b5e.js → checkbox.taro-104557c1.js} +2 -2
  69. package/dist/esm/{circleprogress.taro-1a38e1c6.js → circleprogress.taro-3c89a157.js} +85 -51
  70. package/dist/esm/{collapseitem-246e1699.js → collapseitem-75843a5e.js} +13 -9
  71. package/dist/esm/{datepicker.taro-e0e58f39.js → datepicker.taro-1acec61f.js} +1 -1
  72. package/dist/esm/{dialog.taro-7e9249e7.js → dialog.taro-54c67e08.js} +8 -6
  73. package/dist/esm/{fixednav.taro-9ee2dbea.js → fixednav.taro-582322a1.js} +5 -3
  74. package/dist/esm/{griditem.taro-a2ad1edd.js → griditem.taro-866cd288.js} +5 -3
  75. package/dist/esm/{imagepreview.taro-99659d6a.js → imagepreview.taro-3f1c7638.js} +2 -2
  76. package/dist/esm/{infiniteloading.taro-aa47eb1e.js → infiniteloading.taro-9701755f.js} +84 -113
  77. package/dist/esm/{input.taro-32fac7f7.js → input.taro-2453d7c4.js} +9 -7
  78. package/dist/esm/{inputnumber.taro-83d108b3.js → inputnumber.taro-0cf7c1b7.js} +7 -5
  79. package/dist/esm/{menu.taro-8330048e.js → menu.taro-9345dcfd.js} +5 -3
  80. package/dist/esm/{menuitem.taro-818c9e83.js → menuitem.taro-fc0961b7.js} +31 -14
  81. package/dist/esm/{navbar.taro-05d293bb.js → navbar.taro-c931c078.js} +7 -5
  82. package/dist/esm/{noticebar.taro-6845f9ab.js → noticebar.taro-1fa04a96.js} +9 -7
  83. package/dist/esm/{notify.taro-22b8f4cd.js → notify.taro-0d9cfb07.js} +38 -5
  84. package/dist/esm/{numberkeyboard.taro-6ff18124.js → numberkeyboard.taro-53c350b8.js} +1 -1
  85. package/dist/esm/nutui-react.es.js +54 -53
  86. package/dist/esm/{picker.taro-a3f311a0.js → picker.taro-6a4dad23.js} +1 -1
  87. package/dist/esm/{popover.taro-604c3116.js → popover.taro-eddd0bd2.js} +5 -3
  88. package/dist/esm/{popup.taro-d74c3422.js → popup.taro-33d0bbc8.js} +5 -3
  89. package/dist/esm/{progress.taro-57e1a455.js → progress.taro-623bc807.js} +5 -3
  90. package/dist/esm/{pulltorefresh.taro-8846f019.js → pulltorefresh.taro-e66c78ad.js} +0 -0
  91. package/dist/esm/{radio.taro-64546f70.js → radio.taro-95d43860.js} +5 -3
  92. package/dist/esm/{range.taro-ef3b30f0.js → range.taro-141a0163.js} +35 -12
  93. package/dist/esm/{rate.taro-0119c0e9.js → rate.taro-5077b962.js} +7 -5
  94. package/dist/esm/{searchbar.taro-2fff1f66.js → searchbar.taro-f134fb96.js} +5 -3
  95. package/dist/esm/{shortpassword.taro-d39e038d.js → shortpassword.taro-2e96ca22.js} +6 -4
  96. package/dist/esm/{sidenavbar.taro-48b136b4.js → sidenavbar.taro-87f056cd.js} +1 -1
  97. package/dist/esm/{signature.taro-3dbc7030.js → signature.taro-a9286cd1.js} +1 -1
  98. package/dist/esm/{skeleton.taro-112de52a.js → skeleton.taro-b9ff84b9.js} +1 -1
  99. package/dist/esm/{step.taro-8c2ba0bb.js → step.taro-f1057500.js} +5 -3
  100. package/dist/esm/sticky.taro-30d4e453.js +23 -0
  101. package/dist/esm/{swiper.taro-448cd0ad.js → swiper.taro-58ed323b.js} +4 -4
  102. package/dist/esm/{tabbaritem.taro-8c0a0a3b.js → tabbaritem.taro-94cd62c2.js} +5 -3
  103. package/dist/esm/{table.taro-04f9ec51.js → table.taro-7ac89a6c.js} +5 -3
  104. package/dist/esm/{tabs.taro-7bb22cb5.js → tabs.taro-86186dff.js} +12 -13
  105. package/dist/esm/{tag.taro-81dcc92d.js → tag.taro-95d7f5c2.js} +5 -3
  106. package/dist/esm/{timeselect.taro-5b6ed203.js → timeselect.taro-73796bfc.js} +1 -1
  107. package/dist/esm/toast.taro-cd22a0d7.js +167 -0
  108. package/dist/esm/types/src/packages/audio/audio.taro.d.ts +13 -14
  109. package/dist/esm/types/src/packages/button/demo.d.ts +1 -0
  110. package/dist/esm/types/src/packages/collapseitem/collapseitem.d.ts +1 -0
  111. package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
  112. package/dist/esm/types/src/packages/drag/drag.taro.d.ts +1 -1
  113. package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +1 -1
  114. package/dist/esm/types/src/packages/fixednav/fixednav.taro.d.ts +1 -1
  115. package/dist/esm/types/src/packages/griditem/griditem.d.ts +1 -1
  116. package/dist/esm/types/src/packages/griditem/griditem.taro.d.ts +1 -1
  117. package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +3 -3
  118. package/dist/esm/types/src/packages/infiniteloading/infiniteloading.taro.d.ts +4 -6
  119. package/dist/esm/types/src/packages/input/input.d.ts +1 -1
  120. package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -1
  121. package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -1
  122. package/dist/esm/types/src/packages/menuitem/menuitem.taro.d.ts +1 -1
  123. package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
  124. package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
  125. package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
  126. package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
  127. package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
  128. package/dist/esm/types/src/packages/popover/popover.d.ts +1 -1
  129. package/dist/esm/types/src/packages/popover/popover.taro.d.ts +1 -1
  130. package/dist/esm/types/src/packages/progress/progress.d.ts +1 -1
  131. package/dist/esm/types/src/packages/progress/progress.taro.d.ts +1 -1
  132. package/dist/esm/types/src/packages/radio/radio.d.ts +1 -1
  133. package/dist/esm/types/src/packages/radio/radio.taro.d.ts +1 -1
  134. package/dist/esm/types/src/packages/sticky/__test__/sticky.spec.d.ts +1 -0
  135. package/dist/esm/types/src/packages/sticky/demo.d.ts +3 -0
  136. package/dist/esm/types/src/packages/sticky/index.d.ts +2 -0
  137. package/dist/esm/types/src/packages/sticky/index.taro.d.ts +2 -0
  138. package/dist/esm/types/src/packages/sticky/sticky.d.ts +13 -0
  139. package/dist/esm/types/src/packages/sticky/sticky.taro.d.ts +4 -0
  140. package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -1
  141. package/dist/esm/types/src/packages/tabs/tabs.taro.d.ts +1 -1
  142. package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
  143. package/dist/esm/types/src/packages/toast/toast.taro.d.ts +11 -17
  144. package/dist/esm/types/src/packages/uploader/demo.d.ts +1 -0
  145. package/dist/esm/types/src/packages/uploader/upload.d.ts +4 -0
  146. package/dist/esm/types/src/packages/uploader/uploader.d.ts +16 -12
  147. package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +39 -19
  148. package/dist/esm/types/src/utils/date.d.ts +1 -1
  149. package/dist/esm/types/src/utils/useWatch.d.ts +6 -0
  150. package/dist/esm/{uploader.taro-4fd5dd3c.js → uploader.taro-6184abe7.js} +181 -131
  151. package/dist/locales/base.js +1 -1
  152. package/dist/locales/en-US.js +1 -1
  153. package/dist/locales/id-ID.js +1 -1
  154. package/dist/locales/zh-CN.js +1 -1
  155. package/dist/locales/zh-TW.js +1 -1
  156. package/dist/nutui.react.es.js +1357 -1235
  157. package/dist/nutui.react.umd.js +1356 -1233
  158. package/dist/packages/barrage/barrage.scss +7 -2
  159. package/dist/packages/circleprogress/circleprogress.scss +3 -0
  160. package/dist/packages/sticky/sticky.scss +0 -0
  161. package/dist/style.css +1 -1
  162. package/dist/style.es.js +1 -1
  163. package/dist/styles/themes/default.scss +1 -0
  164. package/dist/types/index.d.ts +75 -64
  165. package/dist/types/nutui.taro.react.build.ts +3 -1
  166. package/package.json +10 -5
  167. package/dist/esm/render-4a3856cb.js +0 -32
  168. package/dist/esm/toast.taro-d4ecd6af.js +0 -300
@@ -1,13 +1,28 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.3.3-beta.2 Wed Sep 14 2022 14:26:26 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v1.3.4-beta.0 Wed Sep 21 2022 14:34:17 GMT+0800 (China Standard Time)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import * as React from "react";
7
7
  import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useLayoutEffect, forwardRef, useMemo, useImperativeHandle, memo } from "react";
8
- import Taro, { useReady } from "@tarojs/taro";
8
+ import Taro, { useReady, nextTick, createSelectorQuery } from "@tarojs/taro";
9
9
  import * as ReactDOM from "react-dom";
10
10
  import ReactDOM__default, { createPortal, unstable_batchedUpdates } from "react-dom";
11
+ function getAugmentedNamespace(n2) {
12
+ if (n2.__esModule)
13
+ return n2;
14
+ var a = Object.defineProperty({}, "__esModule", { value: true });
15
+ Object.keys(n2).forEach(function(k2) {
16
+ var d2 = Object.getOwnPropertyDescriptor(n2, k2);
17
+ Object.defineProperty(a, k2, d2.get ? d2 : {
18
+ enumerable: true,
19
+ get: function() {
20
+ return n2[k2];
21
+ }
22
+ });
23
+ });
24
+ return a;
25
+ }
11
26
  var classname = { exports: {} };
12
27
  var classname_production_min = {};
13
28
  function r$1(r2) {
@@ -46,7 +61,7 @@ classname_production_min.cn = e$1, classname_production_min.withNaming = r$1;
46
61
  classname.exports = classname_production_min;
47
62
  }
48
63
  const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
49
- const defaultProps$1o = {
64
+ const defaultProps$1q = {
50
65
  name: "",
51
66
  size: "",
52
67
  classPrefix: "nut-icon",
@@ -74,7 +89,7 @@ function Icon$1(props) {
74
89
  onClick,
75
90
  ...rest
76
91
  } = {
77
- ...defaultProps$1o,
92
+ ...defaultProps$1q,
78
93
  ...props
79
94
  };
80
95
  const isImage = name ? name.indexOf("/") !== -1 : false;
@@ -108,13 +123,13 @@ function Icon$1(props) {
108
123
  children
109
124
  );
110
125
  }
111
- Icon$1.defaultProps = defaultProps$1o;
126
+ Icon$1.defaultProps = defaultProps$1q;
112
127
  Icon$1.displayName = "NutIcon";
113
128
  const ComponentDefaults = {
114
129
  iconClassPrefix: "nut-icon",
115
130
  iconFontClassName: "nutui-iconfont"
116
131
  };
117
- const defaultProps$1n = {
132
+ const defaultProps$1p = {
118
133
  ...ComponentDefaults,
119
134
  className: "",
120
135
  color: "",
@@ -146,9 +161,11 @@ const Button$1 = (props) => {
146
161
  onClick,
147
162
  className,
148
163
  style,
164
+ iconClassPrefix,
165
+ iconFontClassName,
149
166
  ...rest
150
167
  } = {
151
- ...defaultProps$1n,
168
+ ...defaultProps$1p,
152
169
  ...props
153
170
  };
154
171
  const getStyle = useCallback(() => {
@@ -216,16 +233,16 @@ const Button$1 = (props) => {
216
233
  className: "nut-button__warp",
217
234
  style: getStyle()
218
235
  }, loading && /* @__PURE__ */ React__default.createElement(Icon$1, {
219
- classPrefix: props.iconClassPrefix,
220
- fontClassName: props.iconFontClassName,
236
+ classPrefix: iconClassPrefix,
237
+ fontClassName: iconFontClassName,
221
238
  name: "loading"
222
239
  }), !loading && icon ? /* @__PURE__ */ React__default.createElement(Icon$1, {
223
- classPrefix: props.iconClassPrefix,
224
- fontClassName: props.iconFontClassName,
240
+ classPrefix: iconClassPrefix,
241
+ fontClassName: iconFontClassName,
225
242
  name: icon
226
243
  }) : "", children));
227
244
  };
228
- Button$1.defaultProps = defaultProps$1n;
245
+ Button$1.defaultProps = defaultProps$1p;
229
246
  Button$1.displayName = "NutButton";
230
247
  function _setPrototypeOf(o, p2) {
231
248
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
@@ -996,7 +1013,7 @@ var reactIs_production_min = {};
996
1013
  * This source code is licensed under the MIT license found in the
997
1014
  * LICENSE file in the root directory of this source tree.
998
1015
  */
999
- var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
1016
+ var b$1 = "function" === typeof Symbol && Symbol.for, c = b$1 ? Symbol.for("react.element") : 60103, d = b$1 ? Symbol.for("react.portal") : 60106, e = b$1 ? Symbol.for("react.fragment") : 60107, f = b$1 ? Symbol.for("react.strict_mode") : 60108, g = b$1 ? Symbol.for("react.profiler") : 60114, h = b$1 ? Symbol.for("react.provider") : 60109, k = b$1 ? Symbol.for("react.context") : 60110, l = b$1 ? Symbol.for("react.async_mode") : 60111, m = b$1 ? Symbol.for("react.concurrent_mode") : 60111, n = b$1 ? Symbol.for("react.forward_ref") : 60112, p = b$1 ? Symbol.for("react.suspense") : 60113, q = b$1 ? Symbol.for("react.suspense_list") : 60120, r = b$1 ? Symbol.for("react.memo") : 60115, t = b$1 ? Symbol.for("react.lazy") : 60116, v = b$1 ? Symbol.for("react.block") : 60121, w = b$1 ? Symbol.for("react.fundamental") : 60117, x = b$1 ? Symbol.for("react.responder") : 60118, y = b$1 ? Symbol.for("react.scope") : 60119;
1000
1017
  function z(a) {
1001
1018
  if ("object" === typeof a && null !== a) {
1002
1019
  var u = a.$$typeof;
@@ -1443,7 +1460,7 @@ var useContext = React__default.useContext;
1443
1460
  function useHistory() {
1444
1461
  return useContext(historyContext);
1445
1462
  }
1446
- const defaultProps$1m = {
1463
+ const defaultProps$1o = {
1447
1464
  ...ComponentDefaults,
1448
1465
  title: null,
1449
1466
  subTitle: null,
@@ -1482,9 +1499,11 @@ const Cell = (props) => {
1482
1499
  className,
1483
1500
  iconSlot,
1484
1501
  linkSlot,
1502
+ iconClassPrefix,
1503
+ iconFontClassName,
1485
1504
  ...rest
1486
1505
  } = {
1487
- ...defaultProps$1m,
1506
+ ...defaultProps$1o,
1488
1507
  ...props
1489
1508
  };
1490
1509
  const b2 = cn("cell");
@@ -1519,8 +1538,8 @@ const Cell = (props) => {
1519
1538
  }, children || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, icon || iconSlot ? /* @__PURE__ */ React__default.createElement("div", {
1520
1539
  className: b2("icon")
1521
1540
  }, iconSlot || (icon ? /* @__PURE__ */ React__default.createElement(Icon$1, {
1522
- classPrefix: props.iconClassPrefix,
1523
- fontClassName: props.iconFontClassName,
1541
+ classPrefix: iconClassPrefix,
1542
+ fontClassName: iconFontClassName,
1524
1543
  name: icon,
1525
1544
  className: "icon"
1526
1545
  }) : null)) : null, title || subTitle ? /* @__PURE__ */ React__default.createElement("div", {
@@ -1535,15 +1554,15 @@ const Cell = (props) => {
1535
1554
  }),
1536
1555
  style: styles
1537
1556
  }, desc) : null, !linkSlot && (isLink || to2) ? /* @__PURE__ */ React__default.createElement(Icon$1, {
1538
- classPrefix: props.iconClassPrefix,
1539
- fontClassName: props.iconFontClassName,
1557
+ classPrefix: iconClassPrefix,
1558
+ fontClassName: iconFontClassName,
1540
1559
  name: "right",
1541
1560
  className: b2("link")
1542
1561
  }) : linkSlot));
1543
1562
  };
1544
- Cell.defaultProps = defaultProps$1m;
1563
+ Cell.defaultProps = defaultProps$1o;
1545
1564
  Cell.displayName = "NutCell";
1546
- const defaultProps$1l = {
1565
+ const defaultProps$1n = {
1547
1566
  title: "",
1548
1567
  desc: "",
1549
1568
  titleSlot: null,
@@ -1552,7 +1571,7 @@ const defaultProps$1l = {
1552
1571
  };
1553
1572
  const CellGroup = (props) => {
1554
1573
  const { children, classPrefix, title, desc, titleSlot, descSlot } = {
1555
- ...defaultProps$1l,
1574
+ ...defaultProps$1n,
1556
1575
  ...props
1557
1576
  };
1558
1577
  const b2 = cn("cell-group");
@@ -1566,13 +1585,13 @@ const CellGroup = (props) => {
1566
1585
  className: b2("wrap")
1567
1586
  }, children));
1568
1587
  };
1569
- CellGroup.defaultProps = defaultProps$1l;
1588
+ CellGroup.defaultProps = defaultProps$1n;
1570
1589
  CellGroup.displayName = "NutCellGroup";
1571
1590
  var classnames = { exports: {} };
1572
1591
  /*!
1573
- Copyright (c) 2018 Jed Watson.
1574
- Licensed under the MIT License (MIT), see
1575
- http://jedwatson.github.io/classnames
1592
+ Copyright (c) 2018 Jed Watson.
1593
+ Licensed under the MIT License (MIT), see
1594
+ http://jedwatson.github.io/classnames
1576
1595
  */
1577
1596
  (function(module) {
1578
1597
  (function() {
@@ -1594,14 +1613,14 @@ var classnames = { exports: {} };
1594
1613
  }
1595
1614
  }
1596
1615
  } else if (argType === "object") {
1597
- if (arg.toString === Object.prototype.toString) {
1598
- for (var key in arg) {
1599
- if (hasOwn.call(arg, key) && arg[key]) {
1600
- classes.push(key);
1601
- }
1602
- }
1603
- } else {
1616
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
1604
1617
  classes.push(arg.toString());
1618
+ continue;
1619
+ }
1620
+ for (var key in arg) {
1621
+ if (hasOwn.call(arg, key) && arg[key]) {
1622
+ classes.push(key);
1623
+ }
1605
1624
  }
1606
1625
  }
1607
1626
  }
@@ -2119,7 +2138,7 @@ CSSTransition.defaultProps = {
2119
2138
  };
2120
2139
  CSSTransition.propTypes = {};
2121
2140
  var CSSTransition$1 = CSSTransition;
2122
- const defaultProps$1k = {
2141
+ const defaultProps$1m = {
2123
2142
  ...ComponentDefaults,
2124
2143
  position: "center",
2125
2144
  transition: "",
@@ -2177,7 +2196,9 @@ const Popup = (props) => {
2177
2196
  onClickCloseIcon,
2178
2197
  onOpened,
2179
2198
  onClosed,
2180
- onClick
2199
+ onClick,
2200
+ iconClassPrefix,
2201
+ iconFontClassName
2181
2202
  } = props;
2182
2203
  const [index2, setIndex] = useState(zIndex || _zIndex);
2183
2204
  const [innerVisible, setInnerVisible] = useState(visible);
@@ -2276,8 +2297,8 @@ const Popup = (props) => {
2276
2297
  className: closeClasses,
2277
2298
  onClick: onHandleClickCloseIcon
2278
2299
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
2279
- classPrefix: props.iconClassPrefix,
2280
- fontClassName: props.iconFontClassName,
2300
+ classPrefix: iconClassPrefix,
2301
+ fontClassName: iconFontClassName,
2281
2302
  name: closeIcon,
2282
2303
  size: "12px"
2283
2304
  })) : ""));
@@ -2303,7 +2324,7 @@ const Popup = (props) => {
2303
2324
  }, [position]);
2304
2325
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderToContainer(teleport, renderNode()));
2305
2326
  };
2306
- Popup.defaultProps = defaultProps$1k;
2327
+ Popup.defaultProps = defaultProps$1m;
2307
2328
  Popup.displayName = "NutPopup";
2308
2329
  const zhCN = {
2309
2330
  save: "\u4FDD\u5B58",
@@ -2430,7 +2451,7 @@ const zhCN = {
2430
2451
  completeText: "\u5237\u65B0\u6210\u529F"
2431
2452
  }
2432
2453
  };
2433
- const defaultProps$1j = {
2454
+ const defaultProps$1l = {
2434
2455
  locale: zhCN
2435
2456
  };
2436
2457
  const defaultConfigRef$1 = {
@@ -2447,7 +2468,7 @@ const useConfig$1 = () => {
2447
2468
  };
2448
2469
  const ConfigContext$1 = createContext(null);
2449
2470
  const ConfigProvider = (props) => {
2450
- const { children, ...config2 } = { ...defaultProps$1j, ...props };
2471
+ const { children, ...config2 } = { ...defaultProps$1l, ...props };
2451
2472
  const parentConfig = useConfig$1();
2452
2473
  return /* @__PURE__ */ React__default.createElement(ConfigContext$1.Provider, {
2453
2474
  value: {
@@ -2456,25 +2477,25 @@ const ConfigProvider = (props) => {
2456
2477
  }
2457
2478
  }, children);
2458
2479
  };
2459
- ConfigProvider.defaultProps = defaultProps$1j;
2480
+ ConfigProvider.defaultProps = defaultProps$1l;
2460
2481
  ConfigProvider.displayName = "NutConfigProvider";
2461
- const defaultProps$1i = {};
2482
+ const defaultProps$1k = {};
2462
2483
  const Layout = (props) => {
2463
- ({ ...defaultProps$1i, ...props });
2484
+ ({ ...defaultProps$1k, ...props });
2464
2485
  return /* @__PURE__ */ React__default.createElement("div", {
2465
2486
  className: "nut-layout"
2466
2487
  }, "Layout");
2467
2488
  };
2468
- Layout.defaultProps = defaultProps$1i;
2489
+ Layout.defaultProps = defaultProps$1k;
2469
2490
  Layout.displayName = "NutLayout";
2470
2491
  const DataContext$2 = createContext({});
2471
- const defaultProps$1h = {
2492
+ const defaultProps$1j = {
2472
2493
  span: "24",
2473
2494
  offset: "0",
2474
2495
  gutter: "0"
2475
2496
  };
2476
2497
  const Col = (props) => {
2477
- const { span, offset, children, onClick } = { ...defaultProps$1h, ...props };
2498
+ const { span, offset, children, onClick } = { ...defaultProps$1j, ...props };
2478
2499
  const [colName, setColName] = useState("");
2479
2500
  const [colStyle, setColStyle] = useState({});
2480
2501
  const { gutter } = useContext$1(DataContext$2);
@@ -2500,9 +2521,9 @@ const Col = (props) => {
2500
2521
  }
2501
2522
  }, children);
2502
2523
  };
2503
- Col.defaultProps = defaultProps$1h;
2524
+ Col.defaultProps = defaultProps$1j;
2504
2525
  Col.displayName = "NutCol";
2505
- const defaultProps$1g = {
2526
+ const defaultProps$1i = {
2506
2527
  type: "",
2507
2528
  justify: "start",
2508
2529
  align: "flex-start",
@@ -2511,7 +2532,7 @@ const defaultProps$1g = {
2511
2532
  };
2512
2533
  const Row = (props) => {
2513
2534
  const { children, type, justify, align, wrap, gutter, onClick } = {
2514
- ...defaultProps$1g,
2535
+ ...defaultProps$1i,
2515
2536
  ...props
2516
2537
  };
2517
2538
  const prefixCls = "nut-row";
@@ -2545,9 +2566,9 @@ const Row = (props) => {
2545
2566
  children
2546
2567
  ));
2547
2568
  };
2548
- Row.defaultProps = defaultProps$1g;
2569
+ Row.defaultProps = defaultProps$1i;
2549
2570
  Row.displayName = "NutRow";
2550
- const defaultProps$1f = {
2571
+ const defaultProps$1h = {
2551
2572
  contentPosition: "center",
2552
2573
  dashed: false,
2553
2574
  hairline: true,
@@ -2564,7 +2585,7 @@ const Divider = (props) => {
2564
2585
  direction,
2565
2586
  ...rest
2566
2587
  } = {
2567
- ...defaultProps$1f,
2588
+ ...defaultProps$1h,
2568
2589
  ...props
2569
2590
  };
2570
2591
  const dividerBem = cn("divider");
@@ -2585,9 +2606,9 @@ const Divider = (props) => {
2585
2606
  ...rest
2586
2607
  }, children);
2587
2608
  };
2588
- Divider.defaultProps = defaultProps$1f;
2609
+ Divider.defaultProps = defaultProps$1h;
2589
2610
  Divider.displayName = "NutDivider";
2590
- const defaultProps$1e = {
2611
+ const defaultProps$1g = {
2591
2612
  columnNum: 4,
2592
2613
  border: true,
2593
2614
  gutter: 0,
@@ -2614,7 +2635,7 @@ const Grid = (props) => {
2614
2635
  iconColor,
2615
2636
  className,
2616
2637
  ...rest
2617
- } = { ...defaultProps$1e, ...props };
2638
+ } = { ...defaultProps$1g, ...props };
2618
2639
  const childrenDom = React__default.Children.toArray(children);
2619
2640
  const pxCheck2 = (value) => {
2620
2641
  return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
@@ -2653,9 +2674,9 @@ const Grid = (props) => {
2653
2674
  });
2654
2675
  }));
2655
2676
  };
2656
- Grid.defaultProps = defaultProps$1e;
2677
+ Grid.defaultProps = defaultProps$1g;
2657
2678
  Grid.displayName = "NutGrid";
2658
- const defaultProps$1d = {
2679
+ const defaultProps$1f = {
2659
2680
  ...ComponentDefaults,
2660
2681
  text: "",
2661
2682
  icon: "",
@@ -2689,8 +2710,13 @@ const GridItem = (props) => {
2689
2710
  center,
2690
2711
  reverse,
2691
2712
  direction,
2713
+ iconClassPrefix,
2714
+ iconFontClassName,
2692
2715
  ...rest
2693
- } = { ...defaultProps$1d, ...props };
2716
+ } = {
2717
+ ...defaultProps$1f,
2718
+ ...props
2719
+ };
2694
2720
  const b2 = cn("grid-item");
2695
2721
  const pxCheck2 = (value) => {
2696
2722
  return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
@@ -2723,8 +2749,8 @@ const GridItem = (props) => {
2723
2749
  }, /* @__PURE__ */ React__default.createElement("div", {
2724
2750
  className: contentClass()
2725
2751
  }, icon && isIconName() ? /* @__PURE__ */ React__default.createElement(Icon$1, {
2726
- classPrefix: props.iconClassPrefix,
2727
- fontClassName: props.iconFontClassName,
2752
+ classPrefix: iconClassPrefix,
2753
+ fontClassName: iconFontClassName,
2728
2754
  name: icon,
2729
2755
  size: iconSize || parentIconSize,
2730
2756
  color: iconColor || parentIconColor
@@ -2732,9 +2758,32 @@ const GridItem = (props) => {
2732
2758
  className: "nut-grid-item__text"
2733
2759
  }, text), children && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children)));
2734
2760
  };
2735
- GridItem.defaultProps = defaultProps$1d;
2761
+ GridItem.defaultProps = defaultProps$1f;
2736
2762
  GridItem.displayName = "NutGridItem";
2737
- const defaultProps$1c = {
2763
+ const defaultConfigRef = {
2764
+ current: {
2765
+ locale: zhCN
2766
+ }
2767
+ };
2768
+ const getDefaultConfig = () => {
2769
+ return defaultConfigRef.current;
2770
+ };
2771
+ const useConfig = () => {
2772
+ var _a;
2773
+ return (_a = useContext$1(ConfigContext)) != null ? _a : getDefaultConfig();
2774
+ };
2775
+ const ConfigContext = createContext(null);
2776
+ const defaultProps$1e = {};
2777
+ const Sticky = (props) => {
2778
+ useConfig();
2779
+ ({ ...defaultProps$1e, ...props });
2780
+ return /* @__PURE__ */ React__default.createElement("div", {
2781
+ className: "nut-sticky"
2782
+ }, "Sticky");
2783
+ };
2784
+ Sticky.defaultProps = defaultProps$1e;
2785
+ Sticky.displayName = "NutSticky";
2786
+ const defaultProps$1d = {
2738
2787
  ...ComponentDefaults,
2739
2788
  title: "",
2740
2789
  desc: "",
@@ -2766,9 +2815,11 @@ const NavBar = (props) => {
2766
2815
  onClickTitle,
2767
2816
  onClickIcon,
2768
2817
  onClickBack,
2769
- onClickRight
2818
+ onClickRight,
2819
+ iconClassPrefix,
2820
+ iconFontClassName
2770
2821
  } = {
2771
- ...defaultProps$1c,
2822
+ ...defaultProps$1d,
2772
2823
  ...props
2773
2824
  };
2774
2825
  const b2 = cn("navbar");
@@ -2791,8 +2842,8 @@ const NavBar = (props) => {
2791
2842
  className: `${b2("left")}`,
2792
2843
  onClick: (e2) => onClickBack(e2)
2793
2844
  }, leftShow && /* @__PURE__ */ React__default.createElement(Icon$1, {
2794
- classPrefix: props.iconClassPrefix,
2795
- fontClassName: props.iconFontClassName,
2845
+ classPrefix: iconClassPrefix,
2846
+ fontClassName: iconFontClassName,
2796
2847
  name: "left",
2797
2848
  color: "#979797"
2798
2849
  }), leftText && /* @__PURE__ */ React__default.createElement("div", {
@@ -2808,8 +2859,8 @@ const NavBar = (props) => {
2808
2859
  }, title), titIcon && /* @__PURE__ */ React__default.createElement("div", {
2809
2860
  onClick: (e2) => onClickIcon(e2)
2810
2861
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
2811
- classPrefix: props.iconClassPrefix,
2812
- fontClassName: props.iconFontClassName,
2862
+ classPrefix: iconClassPrefix,
2863
+ fontClassName: iconFontClassName,
2813
2864
  name: titIcon
2814
2865
  })), slot.content);
2815
2866
  };
@@ -2837,9 +2888,9 @@ const NavBar = (props) => {
2837
2888
  className: `${b2("")}--placeholder`
2838
2889
  }, renderWrapper()) : renderWrapper());
2839
2890
  };
2840
- NavBar.defaultProps = defaultProps$1c;
2891
+ NavBar.defaultProps = defaultProps$1d;
2841
2892
  NavBar.displayName = "NutNavBar";
2842
- const defaultProps$1b = {
2893
+ const defaultProps$1c = {
2843
2894
  ...ComponentDefaults,
2844
2895
  fixednavClass: "nut-fixednav",
2845
2896
  activeText: "",
@@ -2865,8 +2916,13 @@ const FixedNav = (props) => {
2865
2916
  type,
2866
2917
  slotList,
2867
2918
  slotBtn,
2919
+ iconClassPrefix,
2920
+ iconFontClassName,
2868
2921
  ...rest
2869
- } = { ...defaultProps$1b, ...props };
2922
+ } = {
2923
+ ...defaultProps$1c,
2924
+ ...props
2925
+ };
2870
2926
  const b2 = cn("fixednav");
2871
2927
  const classes = classNames(
2872
2928
  {
@@ -2911,17 +2967,17 @@ const FixedNav = (props) => {
2911
2967
  className: "nut-fixednav__btn",
2912
2968
  onClick: () => onUpdateValue()
2913
2969
  }, slotBtn || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Icon$1, {
2914
- classPrefix: props.iconClassPrefix,
2915
- fontClassName: props.iconFontClassName,
2970
+ classPrefix: iconClassPrefix,
2971
+ fontClassName: iconFontClassName,
2916
2972
  name: "left",
2917
2973
  color: "#fff"
2918
2974
  }), /* @__PURE__ */ React__default.createElement("div", {
2919
2975
  className: "text"
2920
2976
  }, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
2921
2977
  };
2922
- FixedNav.defaultProps = defaultProps$1b;
2978
+ FixedNav.defaultProps = defaultProps$1c;
2923
2979
  FixedNav.displayName = "NutFixedNav";
2924
- const defaultProps$1a = {
2980
+ const defaultProps$1b = {
2925
2981
  visible: 0,
2926
2982
  bottom: false,
2927
2983
  size: 20,
@@ -2946,7 +3002,7 @@ const Tabbar = (props) => {
2946
3002
  style,
2947
3003
  tabSwitch
2948
3004
  } = {
2949
- ...defaultProps$1a,
3005
+ ...defaultProps$1b,
2950
3006
  ...props
2951
3007
  };
2952
3008
  const b2 = cn("tabbar");
@@ -2981,9 +3037,9 @@ const Tabbar = (props) => {
2981
3037
  return React__default.cloneElement(child, childProps);
2982
3038
  }));
2983
3039
  };
2984
- Tabbar.defaultProps = defaultProps$1a;
3040
+ Tabbar.defaultProps = defaultProps$1b;
2985
3041
  Tabbar.displayName = "NutTabbar";
2986
- const defaultProps$19 = {
3042
+ const defaultProps$1a = {
2987
3043
  ...ComponentDefaults,
2988
3044
  dot: false,
2989
3045
  size: "",
@@ -3014,9 +3070,11 @@ const TabbarItem = (props) => {
3014
3070
  activeColor,
3015
3071
  unactiveColor,
3016
3072
  index: index2,
3017
- handleClick: handleClick2
3073
+ handleClick: handleClick2,
3074
+ iconClassPrefix,
3075
+ iconFontClassName
3018
3076
  } = {
3019
- ...defaultProps$19,
3077
+ ...defaultProps$1a,
3020
3078
  ...props
3021
3079
  };
3022
3080
  const b2 = cn("tabbar-item");
@@ -3048,8 +3106,8 @@ const TabbarItem = (props) => {
3048
3106
  }, "99+")) : /* @__PURE__ */ React__default.createElement("div", {
3049
3107
  className: `${bIcon("dot")}`
3050
3108
  }), icon && /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon$1, {
3051
- classPrefix: props.iconClassPrefix,
3052
- fontClassName: props.iconFontClassName,
3109
+ classPrefix: iconClassPrefix,
3110
+ fontClassName: iconFontClassName,
3053
3111
  size,
3054
3112
  name: icon
3055
3113
  })), /* @__PURE__ */ React__default.createElement("div", {
@@ -3161,10 +3219,14 @@ function capitalize(string) {
3161
3219
  return "";
3162
3220
  return string[0].toUpperCase() + string.slice(1);
3163
3221
  }
3222
+ const actionsWithoutCaptureSupported = ["enter", "leave"];
3223
+ function hasCapture(capture = false, actionKey) {
3224
+ return capture && !actionsWithoutCaptureSupported.includes(actionKey);
3225
+ }
3164
3226
  function toHandlerProp(device, action = "", capture = false) {
3165
3227
  const deviceProps = EVENT_TYPE_MAP[device];
3166
3228
  const actionKey = deviceProps ? deviceProps[action] || action : action;
3167
- return "on" + capitalize(device) + capitalize(actionKey) + (capture ? "Capture" : "");
3229
+ return "on" + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? "Capture" : "");
3168
3230
  }
3169
3231
  const pointerCaptureEvents = ["gotpointercapture", "lostpointercapture"];
3170
3232
  function parseProp(prop) {
@@ -3190,6 +3252,13 @@ function toDomEventType(device, action = "") {
3190
3252
  function isTouch(event) {
3191
3253
  return "touches" in event;
3192
3254
  }
3255
+ function getPointerType(event) {
3256
+ if (isTouch(event))
3257
+ return "touch";
3258
+ if ("pointerType" in event)
3259
+ return event.pointerType;
3260
+ return "mouse";
3261
+ }
3193
3262
  function getCurrentTargetTouchList(event) {
3194
3263
  return Array.from(event.touches).filter((e2) => {
3195
3264
  var _event$currentTarget, _event$currentTarget$;
@@ -3419,6 +3488,8 @@ class Engine {
3419
3488
  const _absoluteDelta = state._delta.map(Math.abs);
3420
3489
  V.addTo(state._distance, _absoluteDelta);
3421
3490
  }
3491
+ if (this.axisIntent)
3492
+ this.axisIntent(event);
3422
3493
  const [_m0, _m1] = state._movement;
3423
3494
  const [t0, t1] = config2.threshold;
3424
3495
  const {
@@ -3448,8 +3519,8 @@ class Engine {
3448
3519
  movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;
3449
3520
  movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;
3450
3521
  }
3451
- if (this.intent)
3452
- this.intent(movement);
3522
+ if (this.restrictToAxis && !state._blocked)
3523
+ this.restrictToAxis(movement);
3453
3524
  const previousOffset = state.offset;
3454
3525
  const gestureIsActive = state._active && !state._blocked || state.active;
3455
3526
  if (gestureIsActive) {
@@ -3506,23 +3577,16 @@ class Engine {
3506
3577
  this.timeoutStore.clean();
3507
3578
  }
3508
3579
  }
3509
- function selectAxis([dx, dy]) {
3510
- const d2 = Math.abs(dx) - Math.abs(dy);
3511
- if (d2 > 0)
3580
+ function selectAxis([dx, dy], threshold) {
3581
+ const absDx = Math.abs(dx);
3582
+ const absDy = Math.abs(dy);
3583
+ if (absDx > absDy && absDx > threshold) {
3512
3584
  return "x";
3513
- if (d2 < 0)
3585
+ }
3586
+ if (absDy > absDx && absDy > threshold) {
3514
3587
  return "y";
3515
- return void 0;
3516
- }
3517
- function restrictVectorToAxis(v2, axis) {
3518
- switch (axis) {
3519
- case "x":
3520
- v2[1] = 0;
3521
- break;
3522
- case "y":
3523
- v2[0] = 0;
3524
- break;
3525
3588
  }
3589
+ return void 0;
3526
3590
  }
3527
3591
  class CoordinatesEngine extends Engine {
3528
3592
  constructor(...args) {
@@ -3543,13 +3607,25 @@ class CoordinatesEngine extends Engine {
3543
3607
  computeMovement() {
3544
3608
  this.state.movement = V.sub(this.state.offset, this.state.lastOffset);
3545
3609
  }
3546
- intent(v2) {
3547
- this.state.axis = this.state.axis || selectAxis(v2);
3548
- this.state._blocked = (this.config.lockDirection || !!this.config.axis) && !this.state.axis || !!this.config.axis && this.config.axis !== this.state.axis;
3549
- if (this.state._blocked)
3550
- return;
3610
+ axisIntent(event) {
3611
+ const state = this.state;
3612
+ const config2 = this.config;
3613
+ if (!state.axis && event) {
3614
+ const threshold = typeof config2.axisThreshold === "object" ? config2.axisThreshold[getPointerType(event)] : config2.axisThreshold;
3615
+ state.axis = selectAxis(state._movement, threshold);
3616
+ }
3617
+ state._blocked = (config2.lockDirection || !!config2.axis) && !state.axis || !!config2.axis && config2.axis !== state.axis;
3618
+ }
3619
+ restrictToAxis(v2) {
3551
3620
  if (this.config.axis || this.config.lockDirection) {
3552
- restrictVectorToAxis(v2, this.state.axis);
3621
+ switch (this.state.axis) {
3622
+ case "x":
3623
+ v2[1] = 0;
3624
+ break;
3625
+ case "y":
3626
+ v2[0] = 0;
3627
+ break;
3628
+ }
3553
3629
  }
3554
3630
  }
3555
3631
  }
@@ -3559,6 +3635,9 @@ const commonConfigResolver = {
3559
3635
  enabled(value = true) {
3560
3636
  return value;
3561
3637
  },
3638
+ eventOptions(value, _k, config2) {
3639
+ return _objectSpread2(_objectSpread2({}, config2.shared.eventOptions), value);
3640
+ },
3562
3641
  preventDefault(value = false) {
3563
3642
  return value;
3564
3643
  },
@@ -3590,6 +3669,7 @@ const commonConfigResolver = {
3590
3669
  return V.toVector(value, 0);
3591
3670
  }
3592
3671
  };
3672
+ const DEFAULT_AXIS_THRESHOLD = 0;
3593
3673
  const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
3594
3674
  axis(_v, _k, {
3595
3675
  axis
@@ -3598,6 +3678,9 @@ const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfig
3598
3678
  if (!this.lockDirection)
3599
3679
  return axis;
3600
3680
  },
3681
+ axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {
3682
+ return value;
3683
+ },
3601
3684
  bounds(value = {}) {
3602
3685
  if (typeof value === "function") {
3603
3686
  return (state) => coordinatesConfigResolver.bounds(value(state));
@@ -3681,11 +3764,11 @@ class DragEngine extends CoordinatesEngine {
3681
3764
  const state = this.state;
3682
3765
  if (event.buttons != null && (Array.isArray(config2.pointerButtons) ? !config2.pointerButtons.includes(event.buttons) : config2.pointerButtons !== -1 && config2.pointerButtons !== event.buttons))
3683
3766
  return;
3684
- this.ctrl.setEventIds(event);
3767
+ const ctrlIds = this.ctrl.setEventIds(event);
3685
3768
  if (config2.pointerCapture) {
3686
3769
  event.target.setPointerCapture(event.pointerId);
3687
3770
  }
3688
- if (state._pointerActive)
3771
+ if (ctrlIds && ctrlIds.size > 1 && state._pointerActive)
3689
3772
  return;
3690
3773
  this.start(event);
3691
3774
  this.setupPointer(event);
@@ -3693,10 +3776,15 @@ class DragEngine extends CoordinatesEngine {
3693
3776
  state._pointerActive = true;
3694
3777
  this.computeValues(pointerValues(event));
3695
3778
  this.computeInitial();
3696
- if (config2.preventScroll) {
3779
+ if (config2.preventScrollAxis && getPointerType(event) !== "mouse") {
3780
+ state._active = false;
3697
3781
  this.setupScrollPrevention(event);
3698
3782
  } else if (config2.delay > 0) {
3699
3783
  this.setupDelayTrigger(event);
3784
+ if (config2.triggerAllEvents) {
3785
+ this.compute(event);
3786
+ this.emit();
3787
+ }
3700
3788
  } else {
3701
3789
  this.startPointerDrag(event);
3702
3790
  }
@@ -3728,13 +3816,13 @@ class DragEngine extends CoordinatesEngine {
3728
3816
  }
3729
3817
  V.addTo(state._movement, state._delta);
3730
3818
  this.compute(event);
3731
- if (state._delayed) {
3819
+ if (state._delayed && state.intentional) {
3732
3820
  this.timeoutStore.remove("dragDelay");
3733
3821
  state.active = false;
3734
3822
  this.startPointerDrag(event);
3735
3823
  return;
3736
3824
  }
3737
- if (config2.preventScroll && !state._preventScroll) {
3825
+ if (config2.preventScrollAxis && !state._preventScroll) {
3738
3826
  if (state.axis) {
3739
3827
  if (state.axis === config2.preventScrollAxis || config2.preventScrollAxis === "xy") {
3740
3828
  state._active = false;
@@ -3762,7 +3850,7 @@ class DragEngine extends CoordinatesEngine {
3762
3850
  }
3763
3851
  const state = this.state;
3764
3852
  const config2 = this.config;
3765
- if (!state._pointerActive)
3853
+ if (!state._active || !state._pointerActive)
3766
3854
  return;
3767
3855
  const id = pointerId(event);
3768
3856
  if (state._pointerId !== void 0 && id !== state._pointerId)
@@ -3791,14 +3879,14 @@ class DragEngine extends CoordinatesEngine {
3791
3879
  this.emit();
3792
3880
  }
3793
3881
  pointerClick(event) {
3794
- if (!this.state.tap) {
3882
+ if (!this.state.tap && event.detail > 0) {
3795
3883
  event.preventDefault();
3796
3884
  event.stopPropagation();
3797
3885
  }
3798
3886
  }
3799
3887
  setupPointer(event) {
3800
3888
  const config2 = this.config;
3801
- let device = config2.device;
3889
+ const device = config2.device;
3802
3890
  if (config2.pointerLock) {
3803
3891
  event.currentTarget.requestPointerLock();
3804
3892
  }
@@ -3819,29 +3907,29 @@ class DragEngine extends CoordinatesEngine {
3819
3907
  }
3820
3908
  }
3821
3909
  setupScrollPrevention(event) {
3910
+ this.state._preventScroll = false;
3822
3911
  persistEvent(event);
3823
- this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
3824
- passive: false
3825
- });
3826
- this.eventStore.add(this.sharedConfig.window, "touch", "end", this.clean.bind(this), {
3827
- passive: false
3828
- });
3829
- this.eventStore.add(this.sharedConfig.window, "touch", "cancel", this.clean.bind(this), {
3912
+ const remove = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
3830
3913
  passive: false
3831
3914
  });
3832
- this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScroll, event);
3915
+ this.eventStore.add(this.sharedConfig.window, "touch", "end", remove);
3916
+ this.eventStore.add(this.sharedConfig.window, "touch", "cancel", remove);
3917
+ this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);
3833
3918
  }
3834
3919
  setupDelayTrigger(event) {
3835
3920
  this.state._delayed = true;
3836
- this.timeoutStore.add("dragDelay", this.startPointerDrag.bind(this), this.config.delay, event);
3921
+ this.timeoutStore.add("dragDelay", () => {
3922
+ this.state._step = [0, 0];
3923
+ this.startPointerDrag(event);
3924
+ }, this.config.delay);
3837
3925
  }
3838
3926
  keyDown(event) {
3839
3927
  const deltaFn = KEYS_DELTA_MAP[event.key];
3840
3928
  if (deltaFn) {
3841
3929
  const state = this.state;
3842
3930
  const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1;
3843
- state._delta = deltaFn(factor);
3844
3931
  this.start(event);
3932
+ state._delta = deltaFn(factor);
3845
3933
  state._keyboardActive = true;
3846
3934
  V.addTo(state._movement, state._delta);
3847
3935
  this.compute(event);
@@ -3865,8 +3953,10 @@ class DragEngine extends CoordinatesEngine {
3865
3953
  bindFunction(device, "cancel", this.pointerUp.bind(this));
3866
3954
  bindFunction("lostPointerCapture", "", this.pointerUp.bind(this));
3867
3955
  }
3868
- bindFunction("key", "down", this.keyDown.bind(this));
3869
- bindFunction("key", "up", this.keyUp.bind(this));
3956
+ if (this.config.keys) {
3957
+ bindFunction("key", "down", this.keyDown.bind(this));
3958
+ bindFunction("key", "up", this.keyUp.bind(this));
3959
+ }
3870
3960
  if (this.config.filterTaps) {
3871
3961
  bindFunction("click", "", this.pointerClick.bind(this), {
3872
3962
  capture: true,
@@ -3911,6 +4001,11 @@ const DEFAULT_DRAG_DELAY = 180;
3911
4001
  const DEFAULT_SWIPE_VELOCITY = 0.5;
3912
4002
  const DEFAULT_SWIPE_DISTANCE = 50;
3913
4003
  const DEFAULT_SWIPE_DURATION = 250;
4004
+ const DEFAULT_DRAG_AXIS_THRESHOLD = {
4005
+ mouse: 0,
4006
+ touch: 0,
4007
+ pen: 8
4008
+ };
3914
4009
  const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
3915
4010
  device(_v, _k, {
3916
4011
  pointer: {
@@ -3930,15 +4025,13 @@ const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigRe
3930
4025
  return "touch";
3931
4026
  return "mouse";
3932
4027
  },
3933
- preventScroll(value = false, _k, {
3934
- preventScrollAxis = "y"
4028
+ preventScrollAxis(value, _k, {
4029
+ preventScroll
3935
4030
  }) {
3936
- this.preventScrollAxis = preventScrollAxis;
3937
- if (!SUPPORT.touchscreen)
3938
- return false;
3939
- if (typeof value === "number")
3940
- return value;
3941
- return value ? DEFAULT_PREVENT_SCROLL_DELAY : false;
4031
+ this.preventScrollDelay = typeof preventScroll === "number" ? preventScroll : preventScroll || preventScroll === void 0 && value ? DEFAULT_PREVENT_SCROLL_DELAY : void 0;
4032
+ if (!SUPPORT.touchscreen || preventScroll === false)
4033
+ return void 0;
4034
+ return value ? value : preventScroll !== void 0 ? "y" : void 0;
3942
4035
  },
3943
4036
  pointerCapture(_v, _k, {
3944
4037
  pointer: {
@@ -3949,6 +4042,9 @@ const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigRe
3949
4042
  this.pointerButtons = buttons;
3950
4043
  return !this.pointerLock && this.device === "pointer" && capture;
3951
4044
  },
4045
+ keys(value = true) {
4046
+ return value;
4047
+ },
3952
4048
  threshold(value, _k, {
3953
4049
  filterTaps = false,
3954
4050
  tapsThreshold = 3,
@@ -3979,10 +4075,15 @@ const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigRe
3979
4075
  default:
3980
4076
  return value;
3981
4077
  }
4078
+ },
4079
+ axisThreshold(value) {
4080
+ if (!value)
4081
+ return DEFAULT_DRAG_AXIS_THRESHOLD;
4082
+ return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);
3982
4083
  }
3983
4084
  });
3984
4085
  const SCALE_ANGLE_RATIO_INTENT_DEG = 30;
3985
- const PINCH_WHEEL_RATIO = 36;
4086
+ const PINCH_WHEEL_RATIO = 100;
3986
4087
  class PinchEngine extends Engine {
3987
4088
  constructor(...args) {
3988
4089
  super(...args);
@@ -4021,19 +4122,22 @@ class PinchEngine extends Engine {
4021
4122
  } = this.state;
4022
4123
  this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];
4023
4124
  }
4024
- intent(v2) {
4125
+ axisIntent() {
4025
4126
  const state = this.state;
4127
+ const [_m0, _m1] = state._movement;
4026
4128
  if (!state.axis) {
4027
- const axisMovementDifference = Math.abs(v2[0]) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(v2[1]);
4129
+ const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);
4028
4130
  if (axisMovementDifference < 0)
4029
4131
  state.axis = "angle";
4030
4132
  else if (axisMovementDifference > 0)
4031
4133
  state.axis = "scale";
4032
4134
  }
4135
+ }
4136
+ restrictToAxis(v2) {
4033
4137
  if (this.config.lockDirection) {
4034
- if (state.axis === "scale")
4138
+ if (this.state.axis === "scale")
4035
4139
  v2[1] = 0;
4036
- else if (state.axis === "angle")
4140
+ else if (this.state.axis === "angle")
4037
4141
  v2[0] = 0;
4038
4142
  }
4039
4143
  }
@@ -4184,7 +4288,8 @@ class PinchEngine extends Engine {
4184
4288
  this.emit();
4185
4289
  }
4186
4290
  wheel(event) {
4187
- if (!event.ctrlKey)
4291
+ const modifierKey = this.config.modifierKey;
4292
+ if (modifierKey && !event[modifierKey])
4188
4293
  return;
4189
4294
  if (!this.state._active)
4190
4295
  this.wheelStart(event);
@@ -4224,11 +4329,10 @@ class PinchEngine extends Engine {
4224
4329
  bindFunction(device, "change", this[device + "Move"].bind(this));
4225
4330
  bindFunction(device, "end", this[device + "End"].bind(this));
4226
4331
  bindFunction(device, "cancel", this[device + "End"].bind(this));
4227
- } else {
4228
- bindFunction("wheel", "", this.wheel.bind(this), {
4229
- passive: false
4230
- });
4231
4332
  }
4333
+ bindFunction("wheel", "", this.wheel.bind(this), {
4334
+ passive: false
4335
+ });
4232
4336
  }
4233
4337
  }
4234
4338
  const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
@@ -4276,6 +4380,11 @@ const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolv
4276
4380
  this.lockDirection = config2.axis === "lock";
4277
4381
  const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0);
4278
4382
  return threshold;
4383
+ },
4384
+ modifierKey(value) {
4385
+ if (value === void 0)
4386
+ return "ctrlKey";
4387
+ return value;
4279
4388
  }
4280
4389
  });
4281
4390
  class MoveEngine extends CoordinatesEngine {
@@ -4583,19 +4692,27 @@ function parse(config2, gestureKey) {
4583
4692
  return _config;
4584
4693
  }
4585
4694
  class EventStore {
4586
- constructor(ctrl) {
4587
- _defineProperty(this, "_listeners", []);
4695
+ constructor(ctrl, gestureKey) {
4696
+ _defineProperty(this, "_listeners", /* @__PURE__ */ new Set());
4588
4697
  this._ctrl = ctrl;
4698
+ this._gestureKey = gestureKey;
4589
4699
  }
4590
4700
  add(element, device, action, handler, options2) {
4701
+ const listeners = this._listeners;
4591
4702
  const type = toDomEventType(device, action);
4592
- const eventOptions = _objectSpread2(_objectSpread2({}, this._ctrl.config.shared.eventOptions), options2);
4703
+ const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};
4704
+ const eventOptions = _objectSpread2(_objectSpread2({}, _options), options2);
4593
4705
  element.addEventListener(type, handler, eventOptions);
4594
- this._listeners.push(() => element.removeEventListener(type, handler, eventOptions));
4706
+ const remove = () => {
4707
+ element.removeEventListener(type, handler, eventOptions);
4708
+ listeners.delete(remove);
4709
+ };
4710
+ listeners.add(remove);
4711
+ return remove;
4595
4712
  }
4596
4713
  clean() {
4597
4714
  this._listeners.forEach((remove) => remove());
4598
- this._listeners = [];
4715
+ this._listeners.clear();
4599
4716
  }
4600
4717
  }
4601
4718
  class TimeoutStore {
@@ -4639,11 +4756,13 @@ class Controller$1 {
4639
4756
  setEventIds(event) {
4640
4757
  if (isTouch(event)) {
4641
4758
  this.touchIds = new Set(touchIds(event));
4759
+ return this.touchIds;
4642
4760
  } else if ("pointerId" in event) {
4643
4761
  if (event.type === "pointerup" || event.type === "pointercancel")
4644
4762
  this.pointerIds.delete(event.pointerId);
4645
4763
  else if (event.type === "pointerdown")
4646
4764
  this.pointerIds.add(event.pointerId);
4765
+ return this.pointerIds;
4647
4766
  }
4648
4767
  }
4649
4768
  applyHandlers(handlers, nativeHandlers) {
@@ -4667,7 +4786,6 @@ class Controller$1 {
4667
4786
  }
4668
4787
  bind(...args) {
4669
4788
  const sharedConfig = this.config.shared;
4670
- const eventOptions = sharedConfig.eventOptions;
4671
4789
  const props = {};
4672
4790
  let target;
4673
4791
  if (sharedConfig.target) {
@@ -4675,16 +4793,18 @@ class Controller$1 {
4675
4793
  if (!target)
4676
4794
  return;
4677
4795
  }
4678
- const bindFunction = bindToProps(props, eventOptions, !!target);
4679
4796
  if (sharedConfig.enabled) {
4680
4797
  for (const gestureKey of this.gestures) {
4681
- if (this.config[gestureKey].enabled) {
4798
+ const gestureConfig = this.config[gestureKey];
4799
+ const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);
4800
+ if (gestureConfig.enabled) {
4682
4801
  const Engine2 = EngineMap.get(gestureKey);
4683
4802
  new Engine2(this, args, gestureKey).bind(bindFunction);
4684
4803
  }
4685
4804
  }
4805
+ const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);
4686
4806
  for (const eventKey in this.nativeHandlers) {
4687
- bindFunction(eventKey, "", (event) => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
4807
+ nativeBindFunction(eventKey, "", (event) => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
4688
4808
  event,
4689
4809
  args
4690
4810
  })), void 0, true);
@@ -4710,7 +4830,7 @@ class Controller$1 {
4710
4830
  }
4711
4831
  function setupGesture(ctrl, gestureKey) {
4712
4832
  ctrl.gestures.add(gestureKey);
4713
- ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl);
4833
+ ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);
4714
4834
  ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();
4715
4835
  }
4716
4836
  function resolveGestures(ctrl, internalHandlers) {
@@ -4801,26 +4921,26 @@ function useRecognizers(handlers, config2 = {}, gestureKey, nativeHandlers) {
4801
4921
  }
4802
4922
  return void 0;
4803
4923
  }
4804
- function useDrag(handler, config2 = {}) {
4924
+ function useDrag(handler, config2) {
4805
4925
  registerAction(dragAction);
4806
4926
  return useRecognizers({
4807
4927
  drag: handler
4808
- }, config2, "drag");
4928
+ }, config2 || {}, "drag");
4809
4929
  }
4810
4930
  function createUseGesture(actions) {
4811
4931
  actions.forEach(registerAction);
4812
- return function useGesture2(_handlers, _config = {}) {
4932
+ return function useGesture2(_handlers, _config) {
4813
4933
  const {
4814
4934
  handlers,
4815
4935
  nativeHandlers,
4816
4936
  config: config2
4817
- } = parseMergedHandlers(_handlers, _config);
4937
+ } = parseMergedHandlers(_handlers, _config || {});
4818
4938
  return useRecognizers(handlers, config2, void 0, nativeHandlers);
4819
4939
  };
4820
4940
  }
4821
- function useGesture(handlers, config2 = {}) {
4941
+ function useGesture(handlers, config2) {
4822
4942
  const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);
4823
- return hook(handlers, config2);
4943
+ return hook(handlers, config2 || {});
4824
4944
  }
4825
4945
  let updateQueue = makeQueue();
4826
4946
  const raf = (fn) => schedule(fn, updateQueue);
@@ -5463,7 +5583,7 @@ function findRange(input, inputRange) {
5463
5583
  return i - 1;
5464
5584
  }
5465
5585
  function _extends$2() {
5466
- _extends$2 = Object.assign || function(target) {
5586
+ _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
5467
5587
  for (var i = 1; i < arguments.length; i++) {
5468
5588
  var source = arguments[i];
5469
5589
  for (var key in source) {
@@ -5876,7 +5996,7 @@ function getAnimatedType(value) {
5876
5996
  return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue;
5877
5997
  }
5878
5998
  function _extends$1() {
5879
- _extends$1 = Object.assign || function(target) {
5999
+ _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
5880
6000
  for (var i = 1; i < arguments.length; i++) {
5881
6001
  var source = arguments[i];
5882
6002
  for (var key in source) {
@@ -5995,7 +6115,7 @@ const createHost = (components, {
5995
6115
  };
5996
6116
  const getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null;
5997
6117
  function _extends() {
5998
- _extends = Object.assign || function(target) {
6118
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
5999
6119
  for (var i = 1; i < arguments.length; i++) {
6000
6120
  var source = arguments[i];
6001
6121
  for (var key in source) {
@@ -6628,6 +6748,7 @@ class SpringValue extends FrameValue {
6628
6748
  const from = anim.fromValues[i];
6629
6749
  const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i] : config2.velocity;
6630
6750
  let velocity;
6751
+ const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
6631
6752
  if (!is.und(config2.duration)) {
6632
6753
  let p2 = 1;
6633
6754
  if (config2.duration > 0) {
@@ -6649,11 +6770,10 @@ class SpringValue extends FrameValue {
6649
6770
  const decay = config2.decay === true ? 0.998 : config2.decay;
6650
6771
  const e2 = Math.exp(-(1 - decay) * elapsed);
6651
6772
  position = from + v0 / (1 - decay) * (1 - e2);
6652
- finished = Math.abs(node2.lastPosition - position) < 0.1;
6773
+ finished = Math.abs(node2.lastPosition - position) <= precision;
6653
6774
  velocity = v0 * e2;
6654
6775
  } else {
6655
6776
  velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity;
6656
- const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
6657
6777
  const restVelocity = config2.restVelocity || precision / 10;
6658
6778
  const bounceFactor = config2.clamp ? 0 : config2.bounce;
6659
6779
  const canBounce = !is.und(bounceFactor);
@@ -7996,7 +8116,7 @@ const host = createHost(primitives, {
7996
8116
  });
7997
8117
  const animated = host.animated;
7998
8118
  const elevatorContext$1 = createContext({});
7999
- const defaultProps$18 = {
8119
+ const defaultProps$19 = {
8000
8120
  height: "200px",
8001
8121
  acceptKey: "title",
8002
8122
  indexList: [],
@@ -8019,7 +8139,7 @@ const Elevator$1 = (props) => {
8019
8139
  children,
8020
8140
  ...rest
8021
8141
  } = {
8022
- ...defaultProps$18,
8142
+ ...defaultProps$19,
8023
8143
  ...props
8024
8144
  };
8025
8145
  const b2 = cn("elevator");
@@ -8207,9 +8327,9 @@ const Elevator$1 = (props) => {
8207
8327
  }, item[acceptKey]);
8208
8328
  }))));
8209
8329
  };
8210
- Elevator$1.defaultProps = defaultProps$18;
8330
+ Elevator$1.defaultProps = defaultProps$19;
8211
8331
  Elevator$1.displayName = "NutElevator";
8212
- const defaultProps$17 = {
8332
+ const defaultProps$18 = {
8213
8333
  defaultValue: 1,
8214
8334
  mode: "multi",
8215
8335
  prevText: "",
@@ -8226,7 +8346,7 @@ const defaultProps$17 = {
8226
8346
  };
8227
8347
  const Pagination = (props) => {
8228
8348
  const { locale } = useConfig$1();
8229
- ({ ...defaultProps$17, ...props });
8349
+ ({ ...defaultProps$18, ...props });
8230
8350
  const {
8231
8351
  modelValue,
8232
8352
  mode,
@@ -8343,7 +8463,7 @@ const Pagination = (props) => {
8343
8463
  onClick: (e2) => selectPage(Number(currentPage) + 1, true)
8344
8464
  }, nextText || locale.pagination.next));
8345
8465
  };
8346
- Pagination.defaultProps = defaultProps$17;
8466
+ Pagination.defaultProps = defaultProps$18;
8347
8467
  Pagination.displayName = "NutPagination";
8348
8468
  class Title {
8349
8469
  constructor() {
@@ -8353,7 +8473,7 @@ class Title {
8353
8473
  this.index = 0;
8354
8474
  }
8355
8475
  }
8356
- const defaultProps$16 = {
8476
+ const defaultProps$17 = {
8357
8477
  ...ComponentDefaults,
8358
8478
  value: 0,
8359
8479
  color: "",
@@ -8388,23 +8508,28 @@ const Tabs = (props) => {
8388
8508
  onChange,
8389
8509
  className,
8390
8510
  autoHeight,
8511
+ iconClassPrefix,
8512
+ iconFontClassName,
8391
8513
  ...rest
8392
- } = { ...defaultProps$16, ...props };
8514
+ } = {
8515
+ ...defaultProps$17,
8516
+ ...props
8517
+ };
8393
8518
  const [currentItem, setCurrentItem] = useState({ index: 0 });
8394
8519
  const titles = useRef([]);
8395
8520
  useEffect(() => {
8396
8521
  let currentIndex = 0;
8397
8522
  titles.current = [];
8398
8523
  React__default.Children.forEach(children, (child, idx) => {
8399
- var _a, _b, _c, _d, _e;
8400
8524
  if (!React__default.isValidElement(child)) {
8401
8525
  return null;
8402
8526
  }
8403
8527
  const title = new Title();
8404
- if (((_a = child == null ? void 0 : child.props) == null ? void 0 : _a.title) || ((_b = child == null ? void 0 : child.props) == null ? void 0 : _b.paneKey)) {
8405
- title.title = (_c = child.props) == null ? void 0 : _c.title;
8406
- title.paneKey = ((_d = child.props) == null ? void 0 : _d.paneKey) || idx;
8407
- title.disabled = (_e = child.props) == null ? void 0 : _e.disabled;
8528
+ const childProps = child == null ? void 0 : child.props;
8529
+ if ((childProps == null ? void 0 : childProps.title) || (childProps == null ? void 0 : childProps.paneKey)) {
8530
+ title.title = childProps == null ? void 0 : childProps.title;
8531
+ title.paneKey = (childProps == null ? void 0 : childProps.paneKey) || idx;
8532
+ title.disabled = childProps == null ? void 0 : childProps.disabled;
8408
8533
  title.index = idx;
8409
8534
  if (title.paneKey === value) {
8410
8535
  currentIndex = idx;
@@ -8470,8 +8595,8 @@ const Tabs = (props) => {
8470
8595
  className: `${b2("")}__titles-item__smile`,
8471
8596
  style: tabsActiveStyle
8472
8597
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
8473
- classPrefix: props.iconClassPrefix,
8474
- fontClassName: props.iconFontClassName,
8598
+ classPrefix: iconClassPrefix,
8599
+ fontClassName: iconFontClassName,
8475
8600
  color,
8476
8601
  name: "joy-smile"
8477
8602
  })), /* @__PURE__ */ React__default.createElement("div", {
@@ -8503,9 +8628,9 @@ const Tabs = (props) => {
8503
8628
  return React__default.cloneElement(child, childProps);
8504
8629
  })));
8505
8630
  };
8506
- Tabs.defaultProps = defaultProps$16;
8631
+ Tabs.defaultProps = defaultProps$17;
8507
8632
  Tabs.displayName = "NutTabs";
8508
- const defaultProps$15 = {
8633
+ const defaultProps$16 = {
8509
8634
  title: "",
8510
8635
  paneKey: "",
8511
8636
  activeKey: "",
@@ -8513,7 +8638,7 @@ const defaultProps$15 = {
8513
8638
  };
8514
8639
  const TabPane = (props) => {
8515
8640
  const { children, paneKey, activeKey, autoHeightClassName } = {
8516
- ...defaultProps$15,
8641
+ ...defaultProps$16,
8517
8642
  ...props
8518
8643
  };
8519
8644
  const b2 = cn("tabpane");
@@ -8528,7 +8653,7 @@ const TabPane = (props) => {
8528
8653
  className: classes
8529
8654
  }, children);
8530
8655
  };
8531
- const defaultProps$14 = {
8656
+ const defaultProps$15 = {
8532
8657
  size: 3,
8533
8658
  current: 1,
8534
8659
  block: false,
@@ -8548,7 +8673,7 @@ const Indicator = (props) => {
8548
8673
  vertical,
8549
8674
  ...rest
8550
8675
  } = {
8551
- ...defaultProps$14,
8676
+ ...defaultProps$15,
8552
8677
  ...props
8553
8678
  };
8554
8679
  const b2 = cn("indicator");
@@ -8582,7 +8707,7 @@ const Indicator = (props) => {
8582
8707
  ...rest
8583
8708
  }, renderEles());
8584
8709
  };
8585
- Indicator.defaultProps = defaultProps$14;
8710
+ Indicator.defaultProps = defaultProps$15;
8586
8711
  Indicator.displayName = "NutIndicator";
8587
8712
  const handleClick = (e2) => {
8588
8713
  e2.stopPropagation();
@@ -8598,7 +8723,7 @@ const handleClick = (e2) => {
8598
8723
  }
8599
8724
  };
8600
8725
  const OffsetContext = createContext(20);
8601
- const defaultProps$13 = {
8726
+ const defaultProps$14 = {
8602
8727
  showhead: false,
8603
8728
  position: "left",
8604
8729
  width: "80%"
@@ -8616,7 +8741,7 @@ const SideNavBar = (props) => {
8616
8741
  handleClose,
8617
8742
  ...rest
8618
8743
  } = {
8619
- ...defaultProps$13,
8744
+ ...defaultProps$14,
8620
8745
  ...props
8621
8746
  };
8622
8747
  const offset = props.offset ? Number(props.offset) : 20;
@@ -8644,14 +8769,14 @@ const SideNavBar = (props) => {
8644
8769
  className: "nut-sidenavbar__content"
8645
8770
  }, children))))));
8646
8771
  };
8647
- SideNavBar.defaultProps = defaultProps$13;
8772
+ SideNavBar.defaultProps = defaultProps$14;
8648
8773
  SideNavBar.displayName = "NutSideNavBar";
8649
- const defaultProps$12 = {
8774
+ const defaultProps$13 = {
8650
8775
  open: true
8651
8776
  };
8652
8777
  const SubSideNavBar = (props) => {
8653
8778
  const { title, ikey, children, titleClick, open, ...rest } = {
8654
- ...defaultProps$12,
8779
+ ...defaultProps$13,
8655
8780
  ...props
8656
8781
  };
8657
8782
  const offset = useContext$1(OffsetContext);
@@ -8722,7 +8847,7 @@ const SideNavBarItem = (props) => {
8722
8847
  ...rest
8723
8848
  }, title);
8724
8849
  };
8725
- const defaultProps$11 = {
8850
+ const defaultProps$12 = {
8726
8851
  ...ComponentDefaults,
8727
8852
  className: "",
8728
8853
  style: {},
@@ -8741,9 +8866,11 @@ const Menu = (props) => {
8741
8866
  closeOnClickOverlay,
8742
8867
  children,
8743
8868
  activeColor,
8869
+ iconClassPrefix,
8870
+ iconFontClassName,
8744
8871
  ...rest
8745
8872
  } = {
8746
- ...defaultProps$11,
8873
+ ...defaultProps$12,
8747
8874
  ...props
8748
8875
  };
8749
8876
  const parentRef = useRef(null);
@@ -8830,17 +8957,17 @@ const Menu = (props) => {
8830
8957
  }, /* @__PURE__ */ React__default.createElement("div", {
8831
8958
  className: "nut-menu__title-text"
8832
8959
  }, finallyTitle()), /* @__PURE__ */ React__default.createElement(Icon$1, {
8833
- classPrefix: props.iconClassPrefix,
8834
- fontClassName: props.iconFontClassName,
8960
+ classPrefix: iconClassPrefix,
8961
+ fontClassName: iconFontClassName,
8835
8962
  className: "nut-menu__title-icon",
8836
8963
  size: "10",
8837
8964
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
8838
8965
  })));
8839
8966
  })), cloneChildren());
8840
8967
  };
8841
- Menu.defaultProps = defaultProps$11;
8968
+ Menu.defaultProps = defaultProps$12;
8842
8969
  Menu.displayName = "NutMenu";
8843
- const defaultProps$10 = {
8970
+ const defaultProps$11 = {
8844
8971
  ...ComponentDefaults,
8845
8972
  className: "",
8846
8973
  style: {},
@@ -8855,7 +8982,7 @@ const defaultProps$10 = {
8855
8982
  };
8856
8983
  const MenuItem = (props) => {
8857
8984
  useConfig$1();
8858
- const mergedProps = { ...defaultProps$10, ...props };
8985
+ const mergedProps = { ...defaultProps$11, ...props };
8859
8986
  const {
8860
8987
  className,
8861
8988
  style,
@@ -8863,16 +8990,16 @@ const MenuItem = (props) => {
8863
8990
  value,
8864
8991
  columns,
8865
8992
  title,
8866
- iconClassPrefix,
8867
- fontClassName,
8868
8993
  optionsIcon,
8869
8994
  direction,
8870
8995
  onChange,
8871
8996
  activeTitleClass,
8872
8997
  inactiveTitleClass,
8873
- children
8998
+ children,
8999
+ iconClassPrefix,
9000
+ iconFontClassName
8874
9001
  } = {
8875
- ...defaultProps$10,
9002
+ ...defaultProps$11,
8876
9003
  ...props
8877
9004
  };
8878
9005
  const { activeColor, showPopup, parent, orderKey } = mergedProps;
@@ -8906,13 +9033,12 @@ const MenuItem = (props) => {
8906
9033
  height: 0
8907
9034
  });
8908
9035
  const getParentOffset = () => {
8909
- setTimeout(() => {
9036
+ setTimeout(async () => {
8910
9037
  const p2 = parent.parent().current;
8911
- p2.getBoundingClientRect().then((rect2) => {
8912
- setPosition({
8913
- height: rect2.height,
8914
- top: rect2.top
8915
- });
9038
+ const rect = await p2.getBoundingClientRect();
9039
+ setPosition({
9040
+ height: rect.height,
9041
+ top: rect.top
8916
9042
  });
8917
9043
  });
8918
9044
  };
@@ -8979,8 +9105,8 @@ const MenuItem = (props) => {
8979
9105
  handleClick2(item);
8980
9106
  }
8981
9107
  }, item.value === _value ? /* @__PURE__ */ React__default.createElement(Icon$1, {
8982
- classPrefix: props.iconClassPrefix,
8983
- fontClassName: props.iconFontClassName,
9108
+ classPrefix: iconClassPrefix,
9109
+ fontClassName: iconFontClassName,
8984
9110
  className: getIconCName(item.value, value),
8985
9111
  name: optionsIcon,
8986
9112
  color: activeColor
@@ -8992,7 +9118,7 @@ const MenuItem = (props) => {
8992
9118
  }, item.text));
8993
9119
  }), children))));
8994
9120
  };
8995
- MenuItem.defaultProps = defaultProps$10;
9121
+ MenuItem.defaultProps = defaultProps$11;
8996
9122
  MenuItem.displayName = "NutMenuItem";
8997
9123
  const MIN_DISTANCE = 10;
8998
9124
  function getDirection(x2, y2) {
@@ -9092,7 +9218,7 @@ const getRectByTaro = async (element) => {
9092
9218
  const res = await element.getBoundingClientRect();
9093
9219
  return res;
9094
9220
  };
9095
- const defaultProps$$ = {
9221
+ const defaultProps$10 = {
9096
9222
  name: "",
9097
9223
  size: "",
9098
9224
  classPrefix: "nut-icon",
@@ -9120,7 +9246,7 @@ function Icon(props) {
9120
9246
  onClick,
9121
9247
  ...rest
9122
9248
  } = {
9123
- ...defaultProps$$,
9249
+ ...defaultProps$10,
9124
9250
  ...props
9125
9251
  };
9126
9252
  const isImage = name ? name.indexOf("/") !== -1 : false;
@@ -9154,230 +9280,144 @@ function Icon(props) {
9154
9280
  children
9155
9281
  );
9156
9282
  }
9157
- Icon.defaultProps = defaultProps$$;
9283
+ Icon.defaultProps = defaultProps$10;
9158
9284
  Icon.displayName = "NutIcon";
9159
- let createRoot;
9160
- try {
9161
- const mainVersion = Number((ReactDOM.version || "").split(".")[0]);
9162
- if (mainVersion >= 18 && ReactDOM.createRoot) {
9163
- createRoot = ReactDOM.createRoot;
9164
- }
9165
- } catch (e2) {
9166
- console.log(e2);
9167
- }
9168
- function legacyRender(node, container) {
9169
- ReactDOM.render(node, container);
9170
- }
9171
- function concurrentRender(node, container) {
9172
- const root = ReactDOM.createRoot(container);
9173
- root.render(node);
9174
- }
9175
- function render(node, container) {
9176
- if (createRoot) {
9177
- concurrentRender(node, container);
9178
- return;
9179
- }
9180
- legacyRender(node, container);
9181
- }
9182
- class Notification$1 extends React.PureComponent {
9183
- constructor(props) {
9184
- super(props);
9185
- this.close = this.close.bind(this);
9186
- this.startCloseTimer = this.startCloseTimer.bind(this);
9187
- this.clearCloseTimer = this.clearCloseTimer.bind(this);
9188
- this.close = this.close.bind(this);
9189
- this.clickCover = this.clickCover.bind(this);
9190
- }
9191
- close() {
9192
- this.clearCloseTimer();
9193
- this.props.onClose();
9194
- }
9195
- startCloseTimer() {
9196
- const { duration } = this.props;
9197
- if (duration) {
9198
- this.closeTimer = window.setTimeout(() => {
9199
- this.close();
9200
- }, duration * 1e3);
9201
- }
9285
+ const defaultProps$$ = {
9286
+ id: "",
9287
+ style: {},
9288
+ icon: null,
9289
+ iconSize: "20",
9290
+ msg: "",
9291
+ bottom: "30px",
9292
+ duration: 2,
9293
+ center: true,
9294
+ type: "text",
9295
+ title: "",
9296
+ customClass: "",
9297
+ size: "base",
9298
+ textAlignCenter: true,
9299
+ bgColor: "rgba(0, 0, 0, .8)",
9300
+ cover: false,
9301
+ coverColor: "rgba(0, 0, 0, 0)",
9302
+ closeOnClickOverlay: false,
9303
+ visible: false,
9304
+ onClose: () => {
9202
9305
  }
9203
- clearCloseTimer() {
9204
- if (this.closeTimer) {
9205
- clearTimeout(this.closeTimer);
9206
- this.closeTimer = -1;
9306
+ };
9307
+ const Toast = (props) => {
9308
+ const {
9309
+ children,
9310
+ id,
9311
+ style,
9312
+ icon,
9313
+ iconSize,
9314
+ msg,
9315
+ bottom,
9316
+ duration,
9317
+ center,
9318
+ type,
9319
+ title,
9320
+ customClass,
9321
+ size,
9322
+ textAlignCenter,
9323
+ bgColor,
9324
+ cover,
9325
+ coverColor,
9326
+ closeOnClickOverlay,
9327
+ visible,
9328
+ onClose,
9329
+ ...rest
9330
+ } = { ...defaultProps$$, ...props };
9331
+ let timer;
9332
+ const [openState, SetOpenState] = useState(false);
9333
+ useEffect(() => {
9334
+ if (visible) {
9335
+ SetOpenState(true);
9336
+ show();
9337
+ } else {
9338
+ hide();
9207
9339
  }
9208
- }
9209
- clickCover() {
9210
- const { closeOnClickOverlay } = this.props;
9340
+ }, [visible]);
9341
+ const clearTimer = () => {
9342
+ if (timer) {
9343
+ clearTimeout(timer);
9344
+ timer = null;
9345
+ }
9346
+ };
9347
+ const hide = () => {
9348
+ SetOpenState(false);
9349
+ onClose();
9350
+ };
9351
+ const show = () => {
9352
+ clearTimer();
9353
+ if (duration) {
9354
+ timer = setTimeout(() => {
9355
+ hide();
9356
+ }, duration * 1e3);
9357
+ }
9358
+ };
9359
+ const clickCover = () => {
9211
9360
  if (closeOnClickOverlay) {
9212
- this.close();
9361
+ hide();
9213
9362
  }
9214
- }
9215
- componentDidMount() {
9216
- this.startCloseTimer();
9217
- }
9218
- componentWillUnmount() {
9219
- this.clearCloseTimer();
9220
- }
9221
- render() {
9222
- const {
9223
- id,
9224
- style,
9225
- icon,
9226
- iconSize,
9227
- title,
9228
- msg,
9229
- bottom,
9230
- center,
9231
- bgColor,
9232
- coverColor,
9233
- textAlignCenter,
9234
- size,
9235
- customClass,
9236
- cover,
9237
- type
9238
- } = this.props;
9239
- const toastBem = cn("toast");
9240
- const classes = classNames({
9241
- "nut-toast-center": center,
9242
- "nut-toast-has-icon": icon,
9243
- "nut-toast-cover": cover,
9244
- "nut-toast-loading": type === "loading",
9245
- [`${customClass}`]: true,
9246
- [`nut-toast-${size}`]: true
9247
- });
9248
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
9249
- className: `${toastBem()} ${classes}`,
9250
- id: `toast-${id}`,
9251
- style: {
9252
- bottom: center ? "auto" : `${bottom}`,
9253
- backgroundColor: cover ? coverColor : "",
9254
- ...style
9255
- },
9256
- onClick: () => {
9257
- this.clickCover();
9258
- }
9259
- }, /* @__PURE__ */ React.createElement("div", {
9260
- className: toastBem("inner"),
9261
- style: {
9262
- textAlign: textAlignCenter ? "center" : "left",
9263
- backgroundColor: bgColor
9264
- }
9265
- }, icon ? /* @__PURE__ */ React.createElement("p", {
9266
- className: toastBem("icon-wrapper")
9267
- }, /* @__PURE__ */ React.createElement(Icon, {
9268
- name: icon || "",
9269
- color: "#ffffff",
9270
- size: iconSize
9271
- })) : null, title ? /* @__PURE__ */ React.createElement("div", {
9272
- className: "nut-toast-title"
9273
- }, title) : null, /* @__PURE__ */ React.createElement("span", {
9274
- className: toastBem("text")
9275
- }, msg))));
9276
- }
9277
- }
9278
- Notification$1.newInstance = (properties, callback) => {
9279
- const element = document.createElement("div");
9280
- if (properties.id) {
9281
- element.setAttribute("id", `${properties.id}`);
9282
- }
9283
- document.body.appendChild(element);
9284
- let called = false;
9285
- function ref(instance) {
9286
- if (called) {
9287
- return;
9363
+ };
9364
+ const toastBem = cn("toast");
9365
+ const hasIcon = () => {
9366
+ if (type !== "text") {
9367
+ return true;
9288
9368
  }
9289
- called = true;
9290
- callback({
9291
- component: instance,
9292
- destroy() {
9293
- ReactDOM.unmountComponentAtNode(element);
9294
- element && element.parentNode && element.parentNode.removeChild(element);
9295
- }
9296
- });
9297
- }
9298
- render(/* @__PURE__ */ React.createElement(Notification$1, {
9299
- ...properties,
9300
- ref
9301
- }), element);
9302
- };
9303
- let messageInstance$1 = null;
9304
- const options$1 = {
9305
- msg: "",
9306
- id: "",
9307
- duration: 1.5,
9308
- center: true,
9309
- type: "text",
9310
- customClass: "",
9311
- bottom: 30,
9312
- size: "base",
9313
- icon: "",
9314
- textAlignCenter: true,
9315
- loadingRotate: true,
9316
- bgColor: "rgba(0, 0, 0, .8)",
9317
- onClose: () => {
9318
- },
9319
- cover: false,
9320
- coverColor: "rgba(0, 0, 0, 0)",
9321
- closeOnClickOverlay: false
9322
- };
9323
- function getInstance$1(props, callback) {
9324
- if (messageInstance$1) {
9325
- messageInstance$1.destroy();
9326
- messageInstance$1 = null;
9327
- }
9328
- Notification$1.newInstance(props, (notification) => {
9329
- return callback && callback(notification);
9330
- });
9331
- }
9332
- function notice$1(opts) {
9333
- function close() {
9334
- if (messageInstance$1) {
9335
- messageInstance$1.destroy();
9336
- messageInstance$1 = null;
9369
+ return !!icon;
9370
+ };
9371
+ const iconName = () => {
9372
+ if (icon) {
9373
+ return icon;
9337
9374
  }
9338
- }
9339
- const opts2 = { ...options$1, ...opts, onClose: close };
9340
- getInstance$1(opts2, (notification) => {
9341
- messageInstance$1 = notification;
9375
+ return {
9376
+ success: "success",
9377
+ fail: "failure",
9378
+ warn: "tips",
9379
+ loading: "loading"
9380
+ }[type];
9381
+ };
9382
+ const classes = classNames({
9383
+ "nut-toast-center": center,
9384
+ "nut-toast-has-icon": icon,
9385
+ "nut-toast-cover": cover,
9386
+ "nut-toast-loading": type === "loading",
9387
+ [`${customClass}`]: true,
9388
+ [`nut-toast-${size}`]: true
9342
9389
  });
9343
- }
9344
- const errorMsg$1 = (msg) => {
9345
- if (!msg) {
9346
- console.warn("[NutUI Toast]: msg cannot be null");
9347
- }
9348
- };
9349
- var Toast = {
9350
- text(msg, option = {}) {
9351
- errorMsg$1(msg);
9352
- return notice$1({ msg, type: "text", ...option });
9353
- },
9354
- success(msg, option = {}) {
9355
- errorMsg$1(msg);
9356
- return notice$1({ msg, icon: "success", type: "success", ...option });
9357
- },
9358
- fail(msg, option = {}) {
9359
- errorMsg$1(msg);
9360
- return notice$1({ msg, icon: "failure", type: "fail", ...option });
9361
- },
9362
- loading(msg, option = {}) {
9363
- errorMsg$1(msg);
9364
- return notice$1({ msg, icon: "loading", type: "loading", ...option });
9365
- },
9366
- warn(msg, option = {}) {
9367
- errorMsg$1(msg);
9368
- return notice$1({ msg, icon: "tips", type: "warn", ...option });
9369
- },
9370
- customIcon(msg, option = {}) {
9371
- errorMsg$1(msg);
9372
- return notice$1({ msg, ...option });
9373
- },
9374
- hide() {
9375
- if (messageInstance$1) {
9376
- messageInstance$1.destroy();
9377
- messageInstance$1 = null;
9390
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, openState ? /* @__PURE__ */ React__default.createElement("div", {
9391
+ className: `${toastBem()} ${classes}`,
9392
+ id,
9393
+ style: {
9394
+ bottom: center ? "auto" : `${bottom}`,
9395
+ backgroundColor: cover ? coverColor : "",
9396
+ ...style
9397
+ },
9398
+ onClick: () => {
9399
+ clickCover();
9378
9400
  }
9379
- }
9380
- };
9401
+ }, /* @__PURE__ */ React__default.createElement("div", {
9402
+ className: toastBem("inner"),
9403
+ style: {
9404
+ textAlign: textAlignCenter ? "center" : "left",
9405
+ backgroundColor: bgColor
9406
+ }
9407
+ }, hasIcon() ? /* @__PURE__ */ React__default.createElement("p", {
9408
+ className: toastBem("icon-wrapper")
9409
+ }, /* @__PURE__ */ React__default.createElement(Icon, {
9410
+ name: iconName(),
9411
+ color: "#ffffff",
9412
+ size: iconSize
9413
+ })) : null, title ? /* @__PURE__ */ React__default.createElement("div", {
9414
+ className: "nut-toast-title"
9415
+ }, title) : null, /* @__PURE__ */ React__default.createElement("span", {
9416
+ className: toastBem("text")
9417
+ }, msg))) : null);
9418
+ };
9419
+ Toast.defaultProps = defaultProps$$;
9420
+ Toast.displayName = "NutInput";
9381
9421
  const defaultProps$_ = {
9382
9422
  range: false,
9383
9423
  hiddenRange: false,
@@ -9420,11 +9460,17 @@ const Range = (props) => {
9420
9460
  const touch = useTouch();
9421
9461
  const root = useRef(null);
9422
9462
  const [marksList, SetMarksList] = useState([]);
9463
+ const [show, SetShow] = useState(false);
9464
+ const [toastMsg, SetToastMsg] = useState("");
9465
+ const toastShow = (msg) => {
9466
+ SetToastMsg(msg);
9467
+ SetShow(true);
9468
+ };
9423
9469
  useEffect(() => {
9424
9470
  if (modelValue) {
9425
9471
  if (!range && (modelValue < min || modelValue > max)) {
9426
9472
  SetInitValue(0);
9427
- Toast.text(`${modelValue} ${locale.range.rangeText}`);
9473
+ toastShow(`${modelValue} ${locale.range.rangeText}`);
9428
9474
  return;
9429
9475
  }
9430
9476
  SetInitValue(modelValue);
@@ -9743,7 +9789,14 @@ const Range = (props) => {
9743
9789
  className: "number"
9744
9790
  }, curValue()) : null)))), !hiddenRange ? /* @__PURE__ */ React__default.createElement("div", {
9745
9791
  className: "max"
9746
- }, +max) : null);
9792
+ }, +max) : null, /* @__PURE__ */ React__default.createElement(Toast, {
9793
+ type: "text",
9794
+ visible: show,
9795
+ msg: toastMsg,
9796
+ onClose: () => {
9797
+ SetShow(false);
9798
+ }
9799
+ }));
9747
9800
  };
9748
9801
  Range.defaultProps = defaultProps$_;
9749
9802
  Range.displayName = "NutRange";
@@ -10472,7 +10525,10 @@ const defaultProps$W = {
10472
10525
  }
10473
10526
  };
10474
10527
  const Checkbox = (props) => {
10475
- const { children } = { ...defaultProps$W, ...props };
10528
+ const { children } = {
10529
+ ...defaultProps$W,
10530
+ ...props
10531
+ };
10476
10532
  const b2 = cn("checkbox");
10477
10533
  const {
10478
10534
  iconName,
@@ -10513,8 +10569,8 @@ const Checkbox = (props) => {
10513
10569
  };
10514
10570
  const renderIcon = () => {
10515
10571
  return /* @__PURE__ */ React__default.createElement(Icon$1, {
10516
- classPrefix: props.iconClassPrefix,
10517
- fontClassName: props.iconFontClassName,
10572
+ classPrefix: iconClassPrefix,
10573
+ fontClassName: iconFontClassName,
10518
10574
  name: getIconName(),
10519
10575
  size: iconSize,
10520
10576
  className: color()
@@ -10811,7 +10867,7 @@ const InternalPicker = (props, ref) => {
10811
10867
  const [refs, setRefs] = useRefs();
10812
10868
  const [columnsList, setColumnsList] = useState([]);
10813
10869
  const b2 = cn("picker");
10814
- let isConfirmEvent = useRef(false);
10870
+ const isConfirmEvent = useRef(false);
10815
10871
  useEffect(() => {
10816
10872
  if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
10817
10873
  const data = [...defaultValueData];
@@ -11333,6 +11389,8 @@ const InputNumber = (props) => {
11333
11389
  overlimit,
11334
11390
  blur,
11335
11391
  focus,
11392
+ iconClassPrefix,
11393
+ iconFontClassName,
11336
11394
  ...restProps
11337
11395
  } = {
11338
11396
  ...defaultProps$U,
@@ -11437,8 +11495,8 @@ const InputNumber = (props) => {
11437
11495
  style: styles,
11438
11496
  ...restProps
11439
11497
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
11440
- classPrefix: props.iconClassPrefix,
11441
- fontClassName: props.iconFontClassName,
11498
+ classPrefix: iconClassPrefix,
11499
+ fontClassName: iconFontClassName,
11442
11500
  className: iconMinusClasses,
11443
11501
  size: buttonSize,
11444
11502
  name: "minus",
@@ -11455,8 +11513,8 @@ const InputNumber = (props) => {
11455
11513
  onBlur: burValue,
11456
11514
  onFocus: focusValue
11457
11515
  }), /* @__PURE__ */ React__default.createElement(Icon$1, {
11458
- classPrefix: props.iconClassPrefix,
11459
- fontClassName: props.iconFontClassName,
11516
+ classPrefix: iconClassPrefix,
11517
+ fontClassName: iconFontClassName,
11460
11518
  className: iconAddClasses,
11461
11519
  size: buttonSize,
11462
11520
  name: "plus",
@@ -11572,8 +11630,13 @@ const Input = (props) => {
11572
11630
  clickLeftIcon,
11573
11631
  clickRightIcon,
11574
11632
  click,
11633
+ iconClassPrefix,
11634
+ iconFontClassName,
11575
11635
  ...rest
11576
- } = { ...defaultProps$T, ...props };
11636
+ } = {
11637
+ ...defaultProps$T,
11638
+ ...props
11639
+ };
11577
11640
  locale.placeholder = placeholder || locale.placeholder;
11578
11641
  const [inputValue, SetInputValue] = useState("");
11579
11642
  const [active, SetActive] = useState(false);
@@ -11701,8 +11764,8 @@ const Input = (props) => {
11701
11764
  onClickLeftIcon(e2);
11702
11765
  }
11703
11766
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
11704
- classPrefix: props.iconClassPrefix,
11705
- fontClassName: props.iconFontClassName,
11767
+ classPrefix: iconClassPrefix,
11768
+ fontClassName: iconFontClassName,
11706
11769
  name: leftIcon,
11707
11770
  size: leftIconSize
11708
11771
  })) : null, /* @__PURE__ */ React__default.createElement("div", {
@@ -11760,8 +11823,8 @@ const Input = (props) => {
11760
11823
  onInput(e2);
11761
11824
  }
11762
11825
  }), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default.createElement(Icon$1, {
11763
- classPrefix: props.iconClassPrefix,
11764
- fontClassName: props.iconFontClassName,
11826
+ classPrefix: iconClassPrefix,
11827
+ fontClassName: iconFontClassName,
11765
11828
  className: "nut-input-clear",
11766
11829
  name: clearIcon,
11767
11830
  size: clearSize,
@@ -11774,8 +11837,8 @@ const Input = (props) => {
11774
11837
  onClickRightIcon(e2);
11775
11838
  }
11776
11839
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
11777
- classPrefix: props.iconClassPrefix,
11778
- fontClassName: props.iconFontClassName,
11840
+ classPrefix: iconClassPrefix,
11841
+ fontClassName: iconFontClassName,
11779
11842
  name: rightIcon,
11780
11843
  size: rightIconSize
11781
11844
  })) : null, slotButton ? /* @__PURE__ */ React__default.createElement("div", {
@@ -11860,7 +11923,10 @@ const defaultProps$R = {
11860
11923
  }
11861
11924
  };
11862
11925
  const Radio = (props) => {
11863
- const { children } = { ...defaultProps$R, ...props };
11926
+ const { children } = {
11927
+ ...defaultProps$R,
11928
+ ...props
11929
+ };
11864
11930
  const {
11865
11931
  className,
11866
11932
  disabled,
@@ -11872,6 +11938,8 @@ const Radio = (props) => {
11872
11938
  iconActiveName,
11873
11939
  iconSize,
11874
11940
  onChange,
11941
+ iconClassPrefix,
11942
+ iconFontClassName,
11875
11943
  ...rest
11876
11944
  } = props;
11877
11945
  const componentName = "nut-radio";
@@ -11906,8 +11974,8 @@ const Radio = (props) => {
11906
11974
  const renderIcon = () => {
11907
11975
  const { iconName: iconName2, iconSize: iconSize2, iconActiveName: iconActiveName2 } = props;
11908
11976
  return /* @__PURE__ */ React__default.createElement(Icon$1, {
11909
- classPrefix: props.iconClassPrefix,
11910
- fontClassName: props.iconFontClassName,
11977
+ classPrefix: iconClassPrefix,
11978
+ fontClassName: iconFontClassName,
11911
11979
  name: checkedStatement ? iconActiveName2 : iconName2,
11912
11980
  size: iconSize2,
11913
11981
  className: color()
@@ -11968,8 +12036,13 @@ const Rate = (props) => {
11968
12036
  readonly,
11969
12037
  allowHalf,
11970
12038
  spacing,
11971
- onChange
11972
- } = { ...defaultProps$Q, ...props };
12039
+ onChange,
12040
+ iconClassPrefix,
12041
+ iconFontClassName
12042
+ } = {
12043
+ ...defaultProps$Q,
12044
+ ...props
12045
+ };
11973
12046
  const b2 = cn("rate");
11974
12047
  const bi = cn("rate-item");
11975
12048
  const [countArray, setCountArray] = useState([1, 2, 3, 4, 5]);
@@ -12018,15 +12091,15 @@ const Rate = (props) => {
12018
12091
  onClick: (event) => onClick(event, n2),
12019
12092
  style: { marginRight: pxCheck2(spacing) }
12020
12093
  }, /* @__PURE__ */ React__default.createElement(Icon, {
12021
- classPrefix: props.iconClassPrefix,
12022
- fontClassName: props.iconFontClassName,
12094
+ classPrefix: iconClassPrefix,
12095
+ fontClassName: iconFontClassName,
12023
12096
  size: iconSize,
12024
12097
  className: `${bi("icon")} ${disabled || n2 > score ? bi("icon--disabled") : ""}`,
12025
12098
  name: n2 <= score ? checkedIcon : uncheckedIcon,
12026
12099
  color: n2 <= score ? activeColor : voidColor
12027
12100
  }), allowHalf && score > n2 - 1 && /* @__PURE__ */ React__default.createElement(Icon, {
12028
- classPrefix: props.iconClassPrefix,
12029
- fontClassName: props.iconFontClassName,
12101
+ classPrefix: iconClassPrefix,
12102
+ fontClassName: iconFontClassName,
12030
12103
  onClick: (event) => onHalfClick(event, n2),
12031
12104
  className: `${bi("icon")} ${bi("icon--half")}`,
12032
12105
  color: n2 <= score ? activeColor : voidColor,
@@ -12082,6 +12155,8 @@ const ShortPassword = (props) => {
12082
12155
  onCancel,
12083
12156
  onClose,
12084
12157
  onComplete,
12158
+ iconClassPrefix,
12159
+ iconFontClassName,
12085
12160
  ...reset
12086
12161
  } = props;
12087
12162
  const b2 = cn("shortpassword");
@@ -12186,8 +12261,8 @@ const ShortPassword = (props) => {
12186
12261
  }, errorMsg2), tips || locale.shortpassword.tips ? /* @__PURE__ */ React__default.createElement("div", {
12187
12262
  className: b2("message__forget")
12188
12263
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12189
- classPrefix: props.iconClassPrefix,
12190
- fontClassName: props.iconFontClassName,
12264
+ classPrefix: iconClassPrefix,
12265
+ fontClassName: iconFontClassName,
12191
12266
  className: "icon",
12192
12267
  size: "11px",
12193
12268
  name: "tips"
@@ -12302,138 +12377,306 @@ const TextArea = (props) => {
12302
12377
  };
12303
12378
  TextArea.defaultProps = defaultProps$O;
12304
12379
  TextArea.displayName = "NutTextArea";
12305
- class UploadOptions {
12306
- constructor() {
12307
- this.url = "";
12308
- this.name = "file";
12309
- this.method = "post";
12310
- this.xhrState = 200;
12311
- this.timeout = 30 * 1e3;
12312
- this.headers = {};
12313
- this.withCredentials = false;
12314
- }
12315
- }
12316
- class Upload {
12317
- constructor(options2) {
12318
- this.options = options2;
12319
- }
12320
- upload() {
12321
- var _a;
12322
- const { options: options2 } = this;
12323
- const xhr = new XMLHttpRequest();
12324
- xhr.timeout = options2.timeout;
12325
- if (xhr.upload) {
12326
- xhr.upload.addEventListener(
12327
- "progress",
12328
- (e2) => {
12329
- var _a2;
12330
- (_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
12331
- },
12332
- false
12333
- );
12334
- xhr.onreadystatechange = () => {
12335
- var _a2, _b;
12336
- if (xhr.readyState === 4) {
12337
- if (xhr.status === options2.xhrState) {
12338
- (_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, xhr.responseText, options2);
12339
- } else {
12340
- (_b = options2.onFailure) == null ? void 0 : _b.call(options2, xhr.responseText, options2);
12341
- }
12342
- }
12343
- };
12344
- xhr.withCredentials = options2.withCredentials;
12345
- xhr.open(options2.method, options2.url, true);
12346
- for (const [key, value] of Object.entries(options2.headers)) {
12347
- xhr.setRequestHeader(key, value);
12348
- }
12349
- (_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
12350
- xhr.send(options2.formData);
12351
- } else {
12352
- console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
12353
- }
12354
- }
12355
- }
12356
12380
  const defaultProps$N = {
12357
12381
  ...ComponentDefaults,
12358
- url: "",
12359
- maximum: 1,
12360
- uploadIcon: "photograph",
12361
- uploadIconSize: "",
12362
- listType: "picture",
12363
- name: "file",
12364
- accept: "*",
12365
- disabled: false,
12366
- autoUpload: true,
12367
- multiple: false,
12368
- maximize: Number.MAX_VALUE,
12369
- data: {},
12370
- headers: {},
12371
- method: "post",
12372
- defaultImg: "",
12373
- xhrState: 200,
12374
- timeout: 1e3 * 30,
12375
- withCredentials: false,
12376
- clearInput: false,
12377
- isPreview: true,
12378
- isDeletable: true,
12379
- capture: false,
12380
- beforeDelete: (file, files) => {
12381
- return true;
12382
- }
12383
- };
12384
- class FileItem {
12385
- constructor() {
12386
- this.status = "ready";
12387
- this.message = "\u51C6\u5907\u4E2D..";
12388
- this.uid = new Date().getTime().toString();
12389
- this.formData = new FormData();
12390
- }
12391
- }
12392
- const InternalUploader = (props, ref) => {
12393
- const { locale } = useConfig$1();
12394
- const {
12395
- children,
12396
- uploadIcon,
12397
- uploadIconSize,
12398
- name,
12399
- accept,
12382
+ className: "",
12383
+ style: {},
12384
+ isShowPercentage: true,
12385
+ percentage: 0,
12386
+ fillColor: "#f3f3f3",
12387
+ strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
12388
+ strokeWidth: "",
12389
+ textColor: "",
12390
+ textWidth: "",
12391
+ showText: true,
12392
+ textInside: false,
12393
+ textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
12394
+ textType: "text",
12395
+ status: false,
12396
+ iconName: "checked",
12397
+ iconColor: "#439422",
12398
+ iconSize: "16px",
12399
+ rounded: true,
12400
+ children: void 0
12401
+ };
12402
+ const Progress = (props) => {
12403
+ const {
12404
+ className,
12405
+ style,
12406
+ isShowPercentage,
12407
+ percentage,
12408
+ fillColor,
12409
+ strokeColor,
12410
+ strokeWidth,
12411
+ size,
12412
+ textColor,
12413
+ textWidth,
12414
+ showText,
12415
+ textInside,
12416
+ textBackground,
12417
+ textType,
12418
+ status,
12419
+ iconName,
12420
+ iconColor,
12421
+ iconSize,
12422
+ rounded,
12423
+ children,
12424
+ iconClassPrefix,
12425
+ iconFontClassName,
12426
+ ...rest
12427
+ } = {
12428
+ ...defaultProps$N,
12429
+ ...props
12430
+ };
12431
+ const b2 = cn("progress");
12432
+ const classes = classNames(b2(""));
12433
+ const classesOuter = classNames({
12434
+ [`${b2("")}-outer`]: true,
12435
+ [`${b2("")}-${size || "base"}`]: true
12436
+ });
12437
+ const classesInner = classNames({
12438
+ [`${b2("")}-inner`]: true,
12439
+ [`${b2("")}-active`]: status
12440
+ });
12441
+ const classesText = classNames({
12442
+ [`${b2("")}-text`]: true
12443
+ });
12444
+ const classesInsideText = classNames({
12445
+ [`${b2("")}-text`]: true,
12446
+ [`${b2("")}-insidetext`]: true
12447
+ });
12448
+ const classesTextInner = classNames({
12449
+ [`${b2("")}-text__inner`]: true
12450
+ });
12451
+ const stylesOuter = {
12452
+ height: `${strokeWidth}px`,
12453
+ borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
12454
+ background: `${fillColor}`
12455
+ };
12456
+ const stylesInner = {
12457
+ width: `${percentage}%`,
12458
+ borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
12459
+ background: `${strokeColor}`
12460
+ };
12461
+ const stylesInsideText = {
12462
+ width: `${textWidth}px`,
12463
+ left: `${percentage}%`,
12464
+ background: textBackground || strokeColor
12465
+ };
12466
+ const stylesInsideIcon = {
12467
+ width: `${textWidth}px`,
12468
+ left: `${percentage}%`
12469
+ };
12470
+ const stylesText = {
12471
+ width: `${textWidth}px`
12472
+ };
12473
+ return /* @__PURE__ */ React__default.createElement("div", {
12474
+ className: `${classes} ${className}`,
12475
+ style,
12476
+ ...rest
12477
+ }, /* @__PURE__ */ React__default.createElement("div", {
12478
+ className: classesOuter,
12479
+ style: stylesOuter
12480
+ }, /* @__PURE__ */ React__default.createElement("div", {
12481
+ className: classesInner,
12482
+ style: stylesInner
12483
+ }, showText && textInside && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children ? /* @__PURE__ */ React__default.createElement("div", {
12484
+ className: classesInsideText,
12485
+ style: stylesInsideIcon
12486
+ }, children) : /* @__PURE__ */ React__default.createElement("div", {
12487
+ className: classesInsideText,
12488
+ style: stylesInsideText
12489
+ }, /* @__PURE__ */ React__default.createElement("span", {
12490
+ className: classesTextInner,
12491
+ style: { color: textColor || "#fff" }
12492
+ }, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default.createElement("div", {
12493
+ className: classesText,
12494
+ style: stylesText
12495
+ }, textType === "text" && /* @__PURE__ */ React__default.createElement("span", {
12496
+ className: classesTextInner,
12497
+ style: { color: textColor || "#333" }
12498
+ }, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default.createElement(Icon, {
12499
+ classPrefix: iconClassPrefix,
12500
+ fontClassName: iconFontClassName,
12501
+ size: iconSize,
12502
+ name: iconName,
12503
+ color: iconColor
12504
+ })));
12505
+ };
12506
+ Progress.defaultProps = defaultProps$N;
12507
+ Progress.displayName = "NutProgress";
12508
+ class UploadOptions {
12509
+ constructor() {
12510
+ this.url = "";
12511
+ this.name = "file";
12512
+ this.fileType = "image";
12513
+ this.method = "post";
12514
+ this.xhrState = 200;
12515
+ this.timeout = 30 * 1e3;
12516
+ this.headers = {};
12517
+ this.withCredentials = false;
12518
+ }
12519
+ }
12520
+ class Upload {
12521
+ constructor(options2) {
12522
+ this.options = options2;
12523
+ }
12524
+ upload() {
12525
+ var _a;
12526
+ const { options: options2 } = this;
12527
+ const xhr = new XMLHttpRequest();
12528
+ xhr.timeout = options2.timeout;
12529
+ if (xhr.upload) {
12530
+ xhr.upload.addEventListener(
12531
+ "progress",
12532
+ (e2) => {
12533
+ var _a2;
12534
+ (_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
12535
+ },
12536
+ false
12537
+ );
12538
+ xhr.onreadystatechange = () => {
12539
+ var _a2, _b;
12540
+ if (xhr.readyState === 4) {
12541
+ if (xhr.status === options2.xhrState) {
12542
+ (_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, xhr.responseText, options2);
12543
+ } else {
12544
+ (_b = options2.onFailure) == null ? void 0 : _b.call(options2, xhr.responseText, options2);
12545
+ }
12546
+ }
12547
+ };
12548
+ xhr.withCredentials = options2.withCredentials;
12549
+ xhr.open(options2.method, options2.url, true);
12550
+ for (const [key, value] of Object.entries(options2.headers)) {
12551
+ xhr.setRequestHeader(key, value);
12552
+ }
12553
+ (_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
12554
+ if (options2.beforeXhrUpload) {
12555
+ options2.beforeXhrUpload(xhr, options2);
12556
+ } else {
12557
+ xhr.send(options2.formData);
12558
+ }
12559
+ } else {
12560
+ console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
12561
+ }
12562
+ }
12563
+ uploadTaro(uploadFile, env) {
12564
+ var _a;
12565
+ const options2 = this.options;
12566
+ if (env === "WEB") {
12567
+ this.upload();
12568
+ } else if (options2.beforeXhrUpload) {
12569
+ options2.beforeXhrUpload(uploadFile, options2);
12570
+ } else {
12571
+ const uploadTask = uploadFile({
12572
+ url: options2.url,
12573
+ filePath: options2.taroFilePath,
12574
+ fileType: options2.fileType,
12575
+ header: {
12576
+ "Content-Type": "multipart/form-data",
12577
+ ...options2.headers
12578
+ },
12579
+ formData: options2.formData,
12580
+ name: options2.name,
12581
+ success(response) {
12582
+ var _a2, _b;
12583
+ if (options2.xhrState == response.statusCode) {
12584
+ (_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, response, options2);
12585
+ } else {
12586
+ (_b = options2.onFailure) == null ? void 0 : _b.call(options2, response, options2);
12587
+ }
12588
+ },
12589
+ fail(e2) {
12590
+ var _a2;
12591
+ (_a2 = options2.onFailure) == null ? void 0 : _a2.call(options2, e2, options2);
12592
+ }
12593
+ });
12594
+ (_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
12595
+ uploadTask.progress(
12596
+ (res) => {
12597
+ var _a2;
12598
+ (_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, res, options2);
12599
+ }
12600
+ );
12601
+ }
12602
+ }
12603
+ }
12604
+ const defaultProps$M = {
12605
+ ...ComponentDefaults,
12606
+ url: "",
12607
+ maximum: 9,
12608
+ sizeType: ["original", "compressed"],
12609
+ sourceType: ["album", "camera"],
12610
+ uploadIcon: "photograph",
12611
+ uploadIconSize: "",
12612
+ listType: "picture",
12613
+ name: "file",
12614
+ disabled: false,
12615
+ autoUpload: true,
12616
+ maximize: Number.MAX_VALUE,
12617
+ data: {},
12618
+ headers: {},
12619
+ method: "post",
12620
+ defaultImg: "",
12621
+ xhrState: 200,
12622
+ timeout: 1e3 * 30,
12623
+ isPreview: true,
12624
+ isDeletable: true,
12625
+ onBeforeDelete: (file, files) => {
12626
+ return true;
12627
+ }
12628
+ };
12629
+ class FileItem {
12630
+ constructor() {
12631
+ this.status = "ready";
12632
+ this.message = "\u51C6\u5907\u4E2D..";
12633
+ this.uid = new Date().getTime().toString();
12634
+ this.percentage = 0;
12635
+ this.formData = {};
12636
+ }
12637
+ }
12638
+ const InternalUploader = (props, ref) => {
12639
+ const { locale } = useConfig$1();
12640
+ const {
12641
+ children,
12642
+ uploadIcon,
12643
+ uploadIconSize,
12644
+ name,
12400
12645
  defaultFileList,
12401
12646
  listType,
12402
12647
  disabled,
12403
- multiple,
12404
12648
  url,
12405
12649
  defaultImg,
12406
12650
  headers,
12407
12651
  timeout,
12408
12652
  method,
12409
12653
  xhrState,
12410
- withCredentials,
12411
12654
  data,
12412
12655
  isPreview,
12413
12656
  isDeletable,
12414
12657
  maximum,
12415
- capture,
12416
12658
  maximize,
12417
12659
  className,
12418
12660
  autoUpload,
12419
- clearInput,
12420
- start: start2,
12421
- removeImage,
12422
- change,
12423
- fileItemClick,
12424
- progress,
12425
- success,
12426
- update: update2,
12427
- failure,
12428
- oversize,
12429
- beforeUpload,
12430
- beforeDelete,
12661
+ sizeType,
12662
+ sourceType,
12663
+ onStart,
12664
+ onRemove,
12665
+ onChange,
12666
+ onFileItemClick,
12667
+ onProgress,
12668
+ onSuccess,
12669
+ onUpdate,
12670
+ onFailure,
12671
+ onOversize,
12672
+ onBeforeUpload,
12673
+ onBeforeXhrUpload,
12674
+ onBeforeDelete,
12431
12675
  ...restProps
12432
- } = { ...defaultProps$N, ...props };
12676
+ } = { ...defaultProps$M, ...props };
12433
12677
  const [fileList, setFileList] = useState([]);
12434
12678
  const [uploadQueue, setUploadQueue] = useState([]);
12435
12679
  useEffect(() => {
12436
- console.log("defaultFileList", defaultFileList);
12437
12680
  if (defaultFileList) {
12438
12681
  setFileList(defaultFileList);
12439
12682
  }
@@ -12443,7 +12686,7 @@ const InternalUploader = (props, ref) => {
12443
12686
  useImperativeHandle(ref, () => ({
12444
12687
  submit: () => {
12445
12688
  Promise.all(uploadQueue).then((res) => {
12446
- res.forEach((i) => i.upload());
12689
+ res.forEach((i) => i.uploadTaro(Taro.uploadFile, Taro.getEnv()));
12447
12690
  });
12448
12691
  }
12449
12692
  }));
@@ -12455,21 +12698,29 @@ const InternalUploader = (props, ref) => {
12455
12698
  setUploadQueue([]);
12456
12699
  }
12457
12700
  };
12458
- const clearInputValue = (el) => {
12459
- el.value = "";
12701
+ const chooseImage = () => {
12702
+ if (disabled) {
12703
+ return;
12704
+ }
12705
+ Taro.chooseImage({
12706
+ count: maximum * 1 - fileList.length,
12707
+ sizeType,
12708
+ sourceType,
12709
+ success: onChangeFn
12710
+ });
12460
12711
  };
12461
12712
  const executeUpload = (fileItem, index2) => {
12462
12713
  const uploadOption = new UploadOptions();
12714
+ uploadOption.name = name;
12463
12715
  uploadOption.url = url;
12464
- for (const [key, value] of Object.entries(data)) {
12465
- fileItem.formData.append(key, value);
12466
- }
12716
+ uploadOption.fileType = fileItem.type;
12467
12717
  uploadOption.formData = fileItem.formData;
12468
12718
  uploadOption.timeout = timeout * 1;
12469
12719
  uploadOption.method = method;
12470
12720
  uploadOption.xhrState = xhrState;
12471
12721
  uploadOption.headers = headers;
12472
- uploadOption.withCredentials = withCredentials;
12722
+ uploadOption.taroFilePath = fileItem.path;
12723
+ uploadOption.beforeXhrUpload = onBeforeXhrUpload;
12473
12724
  uploadOption.onStart = (option) => {
12474
12725
  clearUploadQueue(index2);
12475
12726
  setFileList((fileList2) => {
@@ -12481,7 +12732,7 @@ const InternalUploader = (props, ref) => {
12481
12732
  });
12482
12733
  return [...fileList2];
12483
12734
  });
12484
- start2 && start2(option);
12735
+ onStart && onStart(option);
12485
12736
  };
12486
12737
  uploadOption.onProgress = (e2, option) => {
12487
12738
  setFileList((fileList2) => {
@@ -12489,15 +12740,16 @@ const InternalUploader = (props, ref) => {
12489
12740
  if (item.uid === fileItem.uid) {
12490
12741
  item.status = "uploading";
12491
12742
  item.message = locale.uploader.uploading;
12743
+ item.percentage = e2.progress;
12744
+ onProgress && onProgress({ e: e2, option, percentage: item.percentage });
12492
12745
  }
12493
12746
  });
12494
12747
  return [...fileList2];
12495
12748
  });
12496
- progress && progress({ e: e2, option });
12497
12749
  };
12498
12750
  uploadOption.onSuccess = (responseText, option) => {
12499
12751
  setFileList((fileList2) => {
12500
- update2 && update2(fileList2);
12752
+ onUpdate && onUpdate(fileList2);
12501
12753
  fileList2.map((item) => {
12502
12754
  if (item.uid === fileItem.uid) {
12503
12755
  item.status = "success";
@@ -12506,7 +12758,7 @@ const InternalUploader = (props, ref) => {
12506
12758
  });
12507
12759
  return [...fileList2];
12508
12760
  });
12509
- success && success({
12761
+ onSuccess && onSuccess({
12510
12762
  responseText,
12511
12763
  option
12512
12764
  });
@@ -12521,14 +12773,14 @@ const InternalUploader = (props, ref) => {
12521
12773
  });
12522
12774
  return [...fileList2];
12523
12775
  });
12524
- failure && failure({
12776
+ onFailure && onFailure({
12525
12777
  responseText,
12526
12778
  option
12527
12779
  });
12528
12780
  };
12529
12781
  const task = new Upload(uploadOption);
12530
12782
  if (props.autoUpload) {
12531
- task.upload();
12783
+ task.uploadTaro(Taro.uploadFile, Taro.getEnv());
12532
12784
  } else {
12533
12785
  uploadQueue.push(
12534
12786
  new Promise((resolve, reject) => {
@@ -12539,111 +12791,95 @@ const InternalUploader = (props, ref) => {
12539
12791
  }
12540
12792
  };
12541
12793
  const readFile = (files) => {
12794
+ const imgReg = /\.(png|jpeg|jpg|webp|gif)$/i;
12542
12795
  files.forEach((file, index2) => {
12543
- const formData = new FormData();
12544
- formData.append(name, file);
12796
+ var _a, _b;
12797
+ console.log("file", file);
12798
+ let fileType = file.type;
12545
12799
  const fileItem = new FileItem();
12546
- fileItem.name = file.name;
12800
+ if (!fileType && imgReg.test(file.path)) {
12801
+ fileType = "image";
12802
+ }
12803
+ fileItem.path = file.path;
12804
+ fileItem.name = file.path;
12547
12805
  fileItem.status = "ready";
12548
- fileItem.type = file.type;
12549
- fileItem.formData = formData;
12550
- fileItem.uid = file.lastModified + fileItem.uid;
12551
12806
  fileItem.message = locale.uploader.readyUpload;
12552
- executeUpload(fileItem, index2);
12553
- if (isPreview && file.type.includes("image")) {
12554
- const reader = new FileReader();
12555
- reader.onload = (event) => {
12556
- fileItem.url = event.target.result;
12557
- fileList.push(fileItem);
12558
- setFileList([...fileList]);
12559
- };
12560
- reader.readAsDataURL(file);
12807
+ fileItem.type = fileType;
12808
+ if (Taro.getEnv() == "WEB") {
12809
+ const formData = new FormData();
12810
+ for (const [key, value] of Object.entries(data)) {
12811
+ formData.append(key, value);
12812
+ }
12813
+ formData.append(name, file.originalFileObj);
12814
+ fileItem.name = (_a = file.originalFileObj) == null ? void 0 : _a.name;
12815
+ fileItem.type = (_b = file.originalFileObj) == null ? void 0 : _b.type;
12816
+ fileItem.formData = formData;
12561
12817
  } else {
12562
- fileList.push(fileItem);
12563
- setFileList([...fileList]);
12818
+ fileItem.formData = data;
12564
12819
  }
12820
+ if (isPreview) {
12821
+ fileItem.url = file.path;
12822
+ }
12823
+ fileList.push(fileItem);
12824
+ setFileList([...fileList]);
12825
+ executeUpload(fileItem, index2);
12565
12826
  });
12566
12827
  };
12567
12828
  const filterFiles = (files) => {
12568
12829
  const maximum2 = props.maximum * 1;
12830
+ const maximize2 = props.maximize * 1;
12569
12831
  const oversizes = new Array();
12570
12832
  const filterFile = files.filter((file) => {
12571
- if (file.size > maximize) {
12833
+ if (file.size > maximize2) {
12572
12834
  oversizes.push(file);
12573
12835
  return false;
12574
12836
  }
12575
12837
  return true;
12576
12838
  });
12577
12839
  if (oversizes.length) {
12578
- oversize && oversize(files);
12579
- }
12580
- if (filterFile.length > maximum2) {
12581
- filterFile.splice(maximum2, filterFile.length - maximum2);
12840
+ onOversize && onOversize(files);
12582
12841
  }
12583
- if (fileList.length !== 0) {
12584
- const index2 = maximum2 - fileList.length;
12585
- filterFile.splice(index2, filterFile.length - index2);
12842
+ let currentFileLength = filterFile.length + fileList.length;
12843
+ if (currentFileLength > maximum2) {
12844
+ filterFile.splice(filterFile.length - (currentFileLength - maximum2));
12586
12845
  }
12587
12846
  return filterFile;
12588
12847
  };
12589
12848
  const onDelete = (file, index2) => {
12590
12849
  clearUploadQueue(index2);
12591
- if (beforeDelete && beforeDelete(file, fileList)) {
12850
+ if (onBeforeDelete && onBeforeDelete(file, fileList)) {
12592
12851
  fileList.splice(index2, 1);
12593
- removeImage && removeImage(file, fileList);
12852
+ onRemove && onRemove(file, fileList);
12594
12853
  setFileList([...fileList]);
12595
12854
  } else {
12596
12855
  console.log(locale.uploader.deleteWord);
12597
12856
  }
12598
12857
  };
12599
- const fileChange = (event) => {
12600
- if (disabled) {
12601
- return;
12602
- }
12603
- const $el = event.target;
12604
- const { files } = $el;
12605
- if (beforeUpload) {
12606
- beforeUpload(new Array().slice.call(files)).then(
12607
- (f2) => {
12608
- const _files = filterFiles(new Array().slice.call(f2));
12609
- readFile(_files);
12610
- }
12611
- );
12858
+ const onChangeFn = (res) => {
12859
+ const { tempFiles } = res;
12860
+ if (onBeforeUpload) {
12861
+ onBeforeUpload(tempFiles).then((f2) => {
12862
+ const _files = filterFiles(f2);
12863
+ readFile(_files);
12864
+ });
12612
12865
  } else {
12613
- const _files = filterFiles(new Array().slice.call(files));
12866
+ const _files = filterFiles(tempFiles);
12614
12867
  readFile(_files);
12615
12868
  }
12616
- props.change && props.change({ fileList, event });
12617
- if (clearInput) {
12618
- clearInputValue($el);
12619
- }
12869
+ onChange && onChange({ fileList });
12620
12870
  };
12621
12871
  const handleItemClick = (file) => {
12622
- fileItemClick && fileItemClick(file);
12872
+ onFileItemClick && onFileItemClick(file);
12623
12873
  };
12624
12874
  return /* @__PURE__ */ React__default.createElement("div", {
12625
12875
  className: classes,
12626
12876
  ...restProps
12627
12877
  }, children && /* @__PURE__ */ React__default.createElement("div", {
12628
12878
  className: "nut-uploader__slot"
12629
- }, /* @__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", {
12879
+ }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default.createElement(Button$1, {
12630
12880
  className: "nut-uploader__input",
12631
- type: "file",
12632
- capture: "user",
12633
- name,
12634
- accept,
12635
- disabled,
12636
- multiple,
12637
- onChange: fileChange
12638
- }) : /* @__PURE__ */ React__default.createElement("input", {
12639
- className: "nut-uploader__input",
12640
- type: "file",
12641
- name,
12642
- accept,
12643
- disabled,
12644
- multiple,
12645
- onChange: fileChange
12646
- })))), fileList.length !== 0 && fileList.map((item, index2) => {
12881
+ onClick: chooseImage
12882
+ }))), fileList.length !== 0 && fileList.map((item, index2) => {
12647
12883
  return /* @__PURE__ */ React__default.createElement("div", {
12648
12884
  className: `nut-uploader__preview ${listType}`,
12649
12885
  key: item.uid
@@ -12655,20 +12891,20 @@ const InternalUploader = (props, ref) => {
12655
12891
  className: "nut-uploader__preview__progress__msg"
12656
12892
  }, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default.createElement("div", {
12657
12893
  className: "nut-uploader__preview__progress"
12658
- }, /* @__PURE__ */ React__default.createElement(Icon, {
12894
+ }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12659
12895
  classPrefix: props.iconClassPrefix,
12660
12896
  fontClassName: props.iconFontClassName,
12661
12897
  color: "#fff",
12662
12898
  name: `${item.status == "error" ? "failure" : "loading"}`
12663
12899
  }), /* @__PURE__ */ React__default.createElement("div", {
12664
12900
  className: "nut-uploader__preview__progress__msg"
12665
- }, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon, {
12901
+ }, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon$1, {
12666
12902
  classPrefix: props.iconClassPrefix,
12667
12903
  fontClassName: props.iconFontClassName,
12668
12904
  color: "rgba(0,0,0,0.6)",
12669
12905
  className: "close",
12670
12906
  name: "failure",
12671
- click: () => onDelete(item, index2)
12907
+ onClick: () => onDelete(item, index2)
12672
12908
  }), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
12673
12909
  className: "nut-uploader__preview-img__c",
12674
12910
  src: item.url,
@@ -12682,7 +12918,7 @@ const InternalUploader = (props, ref) => {
12682
12918
  }, /* @__PURE__ */ React__default.createElement("div", {
12683
12919
  onClick: () => handleItemClick(item),
12684
12920
  className: "nut-uploader__preview-img__file__name"
12685
- }, /* @__PURE__ */ React__default.createElement(Icon, {
12921
+ }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12686
12922
  classPrefix: props.iconClassPrefix,
12687
12923
  fontClassName: props.iconFontClassName,
12688
12924
  color: "#808080",
@@ -12694,49 +12930,40 @@ const InternalUploader = (props, ref) => {
12694
12930
  }, /* @__PURE__ */ React__default.createElement("div", {
12695
12931
  className: `nut-uploader__preview-img__file__name ${item.status}`,
12696
12932
  onClick: () => handleItemClick(item)
12697
- }, /* @__PURE__ */ React__default.createElement(Icon, {
12933
+ }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12698
12934
  classPrefix: props.iconClassPrefix,
12699
12935
  fontClassName: props.iconFontClassName,
12700
12936
  name: "link"
12701
- }), "\xA0", item.name), /* @__PURE__ */ React__default.createElement(Icon, {
12937
+ }), "\xA0", item.name), /* @__PURE__ */ React__default.createElement(Icon$1, {
12702
12938
  classPrefix: props.iconClassPrefix,
12703
12939
  fontClassName: props.iconFontClassName,
12704
12940
  color: "#808080",
12705
12941
  className: "nut-uploader__preview-img__file__del",
12706
12942
  name: "del",
12707
- click: () => onDelete(item, index2)
12943
+ onClick: () => onDelete(item, index2)
12944
+ }), item.status === "uploading" && /* @__PURE__ */ React__default.createElement(Progress, {
12945
+ size: "small",
12946
+ percentage: item.percentage,
12947
+ strokeColor: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)",
12948
+ showText: false
12708
12949
  })));
12709
12950
  }), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
12710
12951
  className: `nut-uploader__upload ${listType}`
12711
- }, /* @__PURE__ */ React__default.createElement(Icon, {
12952
+ }, /* @__PURE__ */ React__default.createElement(Icon$1, {
12712
12953
  classPrefix: props.iconClassPrefix,
12713
12954
  fontClassName: props.iconFontClassName,
12714
12955
  size: uploadIconSize,
12715
12956
  color: "#808080",
12716
12957
  name: uploadIcon
12717
- }), capture ? /* @__PURE__ */ React__default.createElement("input", {
12718
- className: "nut-uploader__input",
12719
- type: "file",
12720
- capture: "user",
12721
- name,
12722
- accept,
12723
- disabled,
12724
- multiple,
12725
- onChange: fileChange
12726
- }) : /* @__PURE__ */ React__default.createElement("input", {
12958
+ }), /* @__PURE__ */ React__default.createElement(Button$1, {
12727
12959
  className: "nut-uploader__input",
12728
- type: "file",
12729
- name,
12730
- accept,
12731
- disabled,
12732
- multiple,
12733
- onChange: fileChange
12960
+ onClick: chooseImage
12734
12961
  })));
12735
12962
  };
12736
12963
  const Uploader = React__default.forwardRef(InternalUploader);
12737
- Uploader.defaultProps = defaultProps$N;
12964
+ Uploader.defaultProps = defaultProps$M;
12738
12965
  Uploader.displayName = "NutUploader";
12739
- const defaultProps$M = {
12966
+ const defaultProps$L = {
12740
12967
  data: {
12741
12968
  text: "",
12742
12969
  value: "",
@@ -12751,7 +12978,7 @@ const defaultProps$M = {
12751
12978
  };
12752
12979
  const InternalCascaderItem = (props) => {
12753
12980
  const { data, checked, chooseItem } = {
12754
- ...defaultProps$M,
12981
+ ...defaultProps$L,
12755
12982
  ...props
12756
12983
  };
12757
12984
  const b2 = cn("cascader-item");
@@ -12787,7 +13014,7 @@ const InternalCascaderItem = (props) => {
12787
13014
  }));
12788
13015
  };
12789
13016
  const CascaderItem = React__default.forwardRef(InternalCascaderItem);
12790
- CascaderItem.defaultProps = defaultProps$M;
13017
+ CascaderItem.defaultProps = defaultProps$L;
12791
13018
  CascaderItem.displayName = "NutCascaderItem";
12792
13019
  const formatTree = (tree, parent, config2) => tree.map((node) => {
12793
13020
  const {
@@ -12921,7 +13148,7 @@ class Tree {
12921
13148
  return pathNodes;
12922
13149
  }
12923
13150
  }
12924
- const defaultProps$L = {
13151
+ const defaultProps$K = {
12925
13152
  className: "",
12926
13153
  style: {},
12927
13154
  visible: false,
@@ -12966,7 +13193,7 @@ const InternalCascader = (props) => {
12966
13193
  onClose,
12967
13194
  onChange,
12968
13195
  onPathChange
12969
- } = { ...defaultProps$L, ...props };
13196
+ } = { ...defaultProps$K, ...props };
12970
13197
  const [tabvalue, setTabvalue] = useState("c1");
12971
13198
  const [optiosData, setOptiosData] = useState([]);
12972
13199
  const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
@@ -13222,9 +13449,9 @@ const InternalCascader = (props) => {
13222
13449
  })))));
13223
13450
  };
13224
13451
  const Cascader = React__default.forwardRef(InternalCascader);
13225
- Cascader.defaultProps = defaultProps$L;
13452
+ Cascader.defaultProps = defaultProps$K;
13226
13453
  Cascader.displayName = "NutCascader";
13227
- const defaultProps$K = {
13454
+ const defaultProps$J = {
13228
13455
  ...ComponentDefaults,
13229
13456
  placeholder: "",
13230
13457
  shape: "square",
@@ -13270,9 +13497,11 @@ const SearchBar = (props) => {
13270
13497
  onClickLeftinIcon,
13271
13498
  onClickLeftoutIcon,
13272
13499
  onClickRightinIcon,
13273
- onClickRightoutIcon
13500
+ onClickRightoutIcon,
13501
+ iconClassPrefix,
13502
+ iconFontClassName
13274
13503
  } = {
13275
- ...defaultProps$K,
13504
+ ...defaultProps$J,
13276
13505
  ...props
13277
13506
  };
13278
13507
  const alignClass = `${align}`;
@@ -13370,8 +13599,8 @@ const SearchBar = (props) => {
13370
13599
  className: `${searchbarBem("clear")} ${rightinIcon ? "pos-right" : ""}`,
13371
13600
  onClick: (e2) => clearaVal(e2)
13372
13601
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
13373
- classPrefix: props.iconClassPrefix,
13374
- fontClassName: props.iconFontClassName,
13602
+ classPrefix: iconClassPrefix,
13603
+ fontClassName: iconFontClassName,
13375
13604
  name: "circle-close",
13376
13605
  size: "12",
13377
13606
  color: "#555"
@@ -13411,9 +13640,9 @@ const SearchBar = (props) => {
13411
13640
  className: `${searchbarBem("content")}`
13412
13641
  }, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
13413
13642
  };
13414
- SearchBar.defaultProps = defaultProps$K;
13643
+ SearchBar.defaultProps = defaultProps$J;
13415
13644
  SearchBar.displayName = "NutSearchBar";
13416
- const defaultProps$J = {
13645
+ const defaultProps$I = {
13417
13646
  confirmText: "",
13418
13647
  title: "",
13419
13648
  visible: false,
@@ -13611,9 +13840,9 @@ const NumberKeyboard = (props) => {
13611
13840
  })
13612
13841
  }, confirmText || locale.done))) : null))));
13613
13842
  };
13614
- NumberKeyboard.defaultProps = defaultProps$J;
13843
+ NumberKeyboard.defaultProps = defaultProps$I;
13615
13844
  NumberKeyboard.displayName = "NutNumberKeyboard";
13616
- const defaultProps$I = {
13845
+ const defaultProps$H = {
13617
13846
  cancelTxt: "",
13618
13847
  optionTag: "name",
13619
13848
  optionSubTag: "subname",
@@ -13647,7 +13876,7 @@ const ActionSheet = (props) => {
13647
13876
  className,
13648
13877
  style,
13649
13878
  ...rest
13650
- } = { ...defaultProps$I, ...props };
13879
+ } = { ...defaultProps$H, ...props };
13651
13880
  const b2 = cn("actionsheet");
13652
13881
  const isHighlight = (item) => {
13653
13882
  return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
@@ -13691,9 +13920,9 @@ const ActionSheet = (props) => {
13691
13920
  onClick: () => cancelActionSheet()
13692
13921
  }, cancelTxt)));
13693
13922
  };
13694
- ActionSheet.defaultProps = defaultProps$I;
13923
+ ActionSheet.defaultProps = defaultProps$H;
13695
13924
  ActionSheet.displayName = "NutActionSheet";
13696
- const defaultProps$H = {
13925
+ const defaultProps$G = {
13697
13926
  ...ComponentDefaults,
13698
13927
  bottom: 20,
13699
13928
  right: 10,
@@ -13715,9 +13944,11 @@ const BackTop = (props) => {
13715
13944
  className,
13716
13945
  duration,
13717
13946
  style,
13718
- onClick
13947
+ onClick,
13948
+ iconClassPrefix,
13949
+ iconFontClassName
13719
13950
  } = {
13720
- ...defaultProps$H,
13951
+ ...defaultProps$G,
13721
13952
  ...props
13722
13953
  };
13723
13954
  const [backTop, SetBackTop] = useState(false);
@@ -13801,16 +14032,16 @@ const BackTop = (props) => {
13801
14032
  goTop(e2);
13802
14033
  }
13803
14034
  }, children || /* @__PURE__ */ React__default.createElement(Icon$1, {
13804
- classPrefix: props.iconClassPrefix,
13805
- fontClassName: props.iconFontClassName,
14035
+ classPrefix: iconClassPrefix,
14036
+ fontClassName: iconFontClassName,
13806
14037
  size: "19px",
13807
14038
  className: "nut-backtop-main",
13808
14039
  name: "top"
13809
14040
  }));
13810
14041
  };
13811
- BackTop.defaultProps = defaultProps$H;
14042
+ BackTop.defaultProps = defaultProps$G;
13812
14043
  BackTop.displayName = "NutBackTop";
13813
- const defaultProps$G = {
14044
+ const defaultProps$F = {
13814
14045
  attract: false,
13815
14046
  direction: void 0,
13816
14047
  boundary: {
@@ -13823,7 +14054,7 @@ const defaultProps$G = {
13823
14054
  };
13824
14055
  const Drag = (props) => {
13825
14056
  const { attract, direction, boundary, children, className, style, ...reset } = {
13826
- ...defaultProps$G,
14057
+ ...defaultProps$F,
13827
14058
  ...props
13828
14059
  };
13829
14060
  const b2 = cn("drag");
@@ -13885,7 +14116,7 @@ const Drag = (props) => {
13885
14116
  ...bind()
13886
14117
  }, children));
13887
14118
  };
13888
- Drag.defaultProps = defaultProps$G;
14119
+ Drag.defaultProps = defaultProps$F;
13889
14120
  Drag.displayName = "NutDrag";
13890
14121
  const Content = (props) => {
13891
14122
  const {
@@ -13984,7 +14215,7 @@ const DialogWrapper = (props) => {
13984
14215
  }));
13985
14216
  };
13986
14217
  DialogWrapper.displayName = "NutDialogWrapper";
13987
- const defaultProps$F = {
14218
+ const defaultProps$E = {
13988
14219
  ...ComponentDefaults,
13989
14220
  className: "",
13990
14221
  color: "",
@@ -14016,9 +14247,11 @@ const Button = (props) => {
14016
14247
  onClick,
14017
14248
  className,
14018
14249
  style,
14250
+ iconClassPrefix,
14251
+ iconFontClassName,
14019
14252
  ...rest
14020
14253
  } = {
14021
- ...defaultProps$F,
14254
+ ...defaultProps$E,
14022
14255
  ...props
14023
14256
  };
14024
14257
  const getStyle = useCallback(() => {
@@ -14086,18 +14319,18 @@ const Button = (props) => {
14086
14319
  className: "nut-button__warp",
14087
14320
  style: getStyle()
14088
14321
  }, loading && /* @__PURE__ */ React__default.createElement(Icon, {
14089
- classPrefix: props.iconClassPrefix,
14090
- fontClassName: props.iconFontClassName,
14322
+ classPrefix: iconClassPrefix,
14323
+ fontClassName: iconFontClassName,
14091
14324
  name: "loading"
14092
14325
  }), !loading && icon ? /* @__PURE__ */ React__default.createElement(Icon, {
14093
- classPrefix: props.iconClassPrefix,
14094
- fontClassName: props.iconFontClassName,
14326
+ classPrefix: iconClassPrefix,
14327
+ fontClassName: iconFontClassName,
14095
14328
  name: icon
14096
14329
  }) : "", children));
14097
14330
  };
14098
- Button.defaultProps = defaultProps$F;
14331
+ Button.defaultProps = defaultProps$E;
14099
14332
  Button.displayName = "NutButton";
14100
- const defaultProps$E = {
14333
+ const defaultProps$D = {
14101
14334
  okText: "\u786E\u8BA4",
14102
14335
  cancelText: "\u53D6\u6D88",
14103
14336
  mask: true,
@@ -14188,7 +14421,7 @@ Dialog$1.confirm = (props) => {
14188
14421
  });
14189
14422
  };
14190
14423
  });
14191
- Dialog$1.defaultProps = defaultProps$E;
14424
+ Dialog$1.defaultProps = defaultProps$D;
14192
14425
  Dialog$1.displayName = "NutDialog";
14193
14426
  function ConfirmDialog(props) {
14194
14427
  return /* @__PURE__ */ React__default.createElement(Dialog$1, {
@@ -14286,7 +14519,7 @@ function confirm(config2, renderFunc) {
14286
14519
  update: update2
14287
14520
  };
14288
14521
  }
14289
- const defaultProps$D = {
14522
+ const defaultProps$C = {
14290
14523
  okText: "",
14291
14524
  cancelText: "",
14292
14525
  mask: true,
@@ -14377,15 +14610,18 @@ Dialog.confirm = (props) => {
14377
14610
  });
14378
14611
  };
14379
14612
  });
14380
- Dialog.defaultProps = defaultProps$D;
14613
+ Dialog.defaultProps = defaultProps$C;
14381
14614
  Dialog.displayName = "NutDialog";
14382
- const defaultProps$C = {
14615
+ var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14616
+ __proto__: null
14617
+ }, Symbol.toStringTag, { value: "Module" }));
14618
+ var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index_cjs$1);
14619
+ var index_cjs = require$$0;
14620
+ const defaultProps$B = {
14383
14621
  ...ComponentDefaults,
14384
14622
  hasMore: true,
14385
- threshold: 200,
14623
+ upperThreshold: 40,
14386
14624
  containerId: "",
14387
- useWindow: true,
14388
- useCapture: false,
14389
14625
  isOpenRefresh: false,
14390
14626
  pullIcon: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png",
14391
14627
  pullTxt: "\u677E\u5F00\u5237\u65B0",
@@ -14398,10 +14634,8 @@ const Infiniteloading = (props) => {
14398
14634
  const {
14399
14635
  children,
14400
14636
  hasMore,
14401
- threshold,
14637
+ upperThreshold,
14402
14638
  containerId,
14403
- useWindow,
14404
- useCapture,
14405
14639
  isOpenRefresh,
14406
14640
  pullIcon,
14407
14641
  pullTxt,
@@ -14409,144 +14643,118 @@ const Infiniteloading = (props) => {
14409
14643
  loadTxt,
14410
14644
  loadMoreTxt,
14411
14645
  className,
14412
- refresh,
14413
- loadMore,
14414
- scrollChange,
14415
- ...restProps
14646
+ onRefresh,
14647
+ onLoadMore,
14648
+ onScrollChange,
14649
+ iconClassPrefix,
14650
+ iconFontClassName
14416
14651
  } = {
14417
- ...defaultProps$C,
14652
+ ...defaultProps$B,
14418
14653
  ...props
14419
14654
  };
14420
14655
  const [isInfiniting, setIsInfiniting] = useState(false);
14421
- const scroller = useRef(null);
14656
+ const [topDisScoll, setTopDisScoll] = useState(0);
14422
14657
  const refreshTop = useRef(null);
14423
- const scrollEl = useRef(window);
14658
+ const scrollHeight = useRef(0);
14659
+ const scrollTop = useRef(0);
14660
+ const direction = useRef("down");
14424
14661
  const isTouching = useRef(false);
14425
- const beforeScrollTop = useRef(0);
14426
- const refreshMaxH = useRef(0);
14427
14662
  const y2 = useRef(0);
14663
+ const refreshMaxH = useRef(0);
14428
14664
  const distance = useRef(0);
14429
14665
  const b2 = cn("infiniteloading");
14430
14666
  const classes = classNames(className, b2());
14431
14667
  useEffect(() => {
14432
- const parentElement = getParentElement(
14433
- scroller.current
14434
- );
14435
- scrollEl.current = useWindow ? window : parentElement;
14436
- scrollEl.current.addEventListener("scroll", handleScroll, useCapture);
14437
- return () => {
14438
- scrollEl.current.removeEventListener("scroll", handleScroll, useCapture);
14439
- };
14668
+ refreshMaxH.current = upperThreshold;
14669
+ setTimeout(() => {
14670
+ getScrollHeight();
14671
+ }, 200);
14440
14672
  }, [hasMore, isInfiniting]);
14441
- useEffect(() => {
14442
- const element = scroller.current;
14443
- element.addEventListener("touchmove", touchMove, { passive: false });
14444
- return () => {
14445
- element.removeEventListener("touchmove", touchMove, {
14446
- passive: false
14447
- });
14448
- };
14449
- }, []);
14673
+ const getScrollHeight = () => {
14674
+ const parentElement = getParentElement("scroller");
14675
+ parentElement.boundingClientRect((rect) => {
14676
+ scrollHeight.current = rect.height;
14677
+ }).exec();
14678
+ };
14450
14679
  const getStyle = () => {
14451
14680
  return {
14452
- height: distance.current < 0 ? `0px` : `${distance.current}px`,
14453
- transition: isTouching.current ? `height 0s cubic-bezier(0.25,0.1,0.25,1)` : `height 0.2s cubic-bezier(0.25,0.1,0.25,1)`
14681
+ height: topDisScoll < 0 ? `0px` : `${topDisScoll}px`,
14682
+ transition: `height 0.2s cubic-bezier(0.25,0.1,0.25,1)`
14454
14683
  };
14455
14684
  };
14456
14685
  const getParentElement = (el) => {
14457
- return containerId ? document.querySelector(`#${containerId}`) : el && el.parentNode;
14458
- };
14459
- const handleScroll = () => {
14460
- requestAniFrame2()(() => {
14461
- if (!isScrollAtBottom() || !hasMore || isInfiniting) {
14462
- return false;
14463
- }
14464
- setIsInfiniting(true);
14465
- loadMore && loadMore(infiniteDone);
14466
- });
14686
+ return Taro.createSelectorQuery().select(
14687
+ containerId ? `#${containerId} #${el}` : `#${el}`
14688
+ );
14467
14689
  };
14468
14690
  const infiniteDone = () => {
14469
14691
  setIsInfiniting(false);
14470
14692
  };
14471
14693
  const refreshDone = () => {
14472
14694
  distance.current = 0;
14473
- refreshTop.current.style.height = `${distance.current}px`;
14695
+ setTopDisScoll(0);
14474
14696
  isTouching.current = false;
14475
14697
  };
14698
+ const scrollAction2 = (e2) => {
14699
+ if (e2.detail.scrollTop <= 0) {
14700
+ e2.detail.scrollTop = 0;
14701
+ } else if (e2.detail.scrollTop >= scrollHeight.current) {
14702
+ e2.detail.scrollTop = scrollHeight.current;
14703
+ }
14704
+ if (e2.detail.scrollTop > scrollTop.current || e2.detail.scrollTop >= scrollHeight.current) {
14705
+ direction.current = "down";
14706
+ } else {
14707
+ direction.current = "up";
14708
+ }
14709
+ scrollTop.current = e2.detail.scrollTop;
14710
+ onScrollChange && onScrollChange(e2.detail.scrollTop);
14711
+ };
14712
+ const lower = () => {
14713
+ if (direction.current == "up" || !hasMore || isInfiniting) {
14714
+ return false;
14715
+ }
14716
+ setIsInfiniting(true);
14717
+ onLoadMore && onLoadMore(infiniteDone);
14718
+ };
14476
14719
  const touchStart = (event) => {
14477
- if (beforeScrollTop.current === 0 && !isTouching.current && isOpenRefresh) {
14720
+ if (scrollTop.current == 0 && !isTouching.current && isOpenRefresh) {
14478
14721
  y2.current = event.touches[0].pageY;
14479
14722
  isTouching.current = true;
14480
- const childHeight = refreshTop.current.firstElementChild.offsetHeight;
14481
- refreshMaxH.current = Math.floor(childHeight * 1 + 10);
14482
14723
  }
14483
14724
  };
14484
14725
  const touchMove = (event) => {
14485
14726
  distance.current = event.touches[0].pageY - y2.current;
14486
14727
  if (distance.current > 0 && isTouching.current) {
14487
14728
  event.preventDefault();
14729
+ setTopDisScoll(distance.current);
14488
14730
  if (distance.current >= refreshMaxH.current) {
14489
14731
  distance.current = refreshMaxH.current;
14490
- refreshTop.current.style.height = `${distance.current}px`;
14491
- } else {
14492
- refreshTop.current.style.height = `${distance.current}px`;
14732
+ setTopDisScoll(refreshMaxH.current);
14493
14733
  }
14494
14734
  } else {
14495
14735
  distance.current = 0;
14496
- refreshTop.current.style.height = `${distance.current}px`;
14736
+ setTopDisScoll(0);
14497
14737
  isTouching.current = false;
14498
14738
  }
14499
14739
  };
14500
14740
  const touchEnd = () => {
14501
14741
  if (distance.current < refreshMaxH.current) {
14502
14742
  distance.current = 0;
14503
- refreshTop.current.style.height = `${distance.current}px`;
14743
+ setTopDisScoll(0);
14504
14744
  } else {
14505
- refresh && refresh(refreshDone);
14745
+ onRefresh && onRefresh(refreshDone);
14506
14746
  }
14507
14747
  };
14508
- const requestAniFrame2 = () => {
14509
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
14510
- window.setTimeout(callback, 1e3 / 60);
14511
- };
14512
- };
14513
- const getWindowScrollTop = () => {
14514
- return window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
14515
- };
14516
- const calculateTopPosition = (el) => {
14517
- return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
14518
- };
14519
- const isScrollAtBottom = () => {
14520
- let offsetDistance = 0;
14521
- let resScrollTop = 0;
14522
- let direction = "down";
14523
- const windowScrollTop = getWindowScrollTop();
14524
- if (useWindow) {
14525
- if (scroller.current) {
14526
- offsetDistance = calculateTopPosition(scroller.current) + scroller.current.offsetHeight - windowScrollTop - window.innerHeight;
14527
- }
14528
- resScrollTop = windowScrollTop;
14529
- } else {
14530
- const { scrollHeight, clientHeight, scrollTop } = scrollEl.current;
14531
- offsetDistance = scrollHeight - clientHeight - scrollTop;
14532
- resScrollTop = scrollTop;
14533
- }
14534
- if (beforeScrollTop.current > resScrollTop) {
14535
- direction = "up";
14536
- } else {
14537
- direction = "down";
14538
- }
14539
- beforeScrollTop.current = resScrollTop;
14540
- scrollChange && scrollChange(resScrollTop);
14541
- return offsetDistance <= threshold && direction == "down";
14542
- };
14543
- return /* @__PURE__ */ React__default.createElement("div", {
14748
+ return /* @__PURE__ */ React__default.createElement(index_cjs.ScrollView, {
14544
14749
  className: classes,
14545
- ref: scroller,
14750
+ scrollY: true,
14751
+ id: "scroller",
14752
+ style: { height: "100%" },
14753
+ onScroll: scrollAction2,
14754
+ onScrollToLower: lower,
14546
14755
  onTouchStart: touchStart,
14547
14756
  onTouchMove: touchMove,
14548
- onTouchEnd: touchEnd,
14549
- ...restProps
14757
+ onTouchEnd: touchEnd
14550
14758
  }, /* @__PURE__ */ React__default.createElement("div", {
14551
14759
  className: "nut-infinite-top",
14552
14760
  ref: refreshTop,
@@ -14554,31 +14762,60 @@ const Infiniteloading = (props) => {
14554
14762
  }, /* @__PURE__ */ React__default.createElement("div", {
14555
14763
  className: "top-box"
14556
14764
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
14557
- classPrefix: props.iconClassPrefix,
14558
- fontClassName: props.iconFontClassName,
14765
+ classPrefix: iconClassPrefix,
14766
+ fontClassName: iconFontClassName,
14559
14767
  className: "top-img",
14560
14768
  name: pullIcon
14561
14769
  }), /* @__PURE__ */ React__default.createElement("span", {
14562
14770
  className: "top-text"
14563
- }, locale.infiniteloading.pullRefreshText || pullTxt))), /* @__PURE__ */ React__default.createElement("div", {
14771
+ }, pullTxt || locale.infiniteloading.pullRefreshText))), /* @__PURE__ */ React__default.createElement("div", {
14564
14772
  className: "nut-infinite-container"
14565
14773
  }, children), /* @__PURE__ */ React__default.createElement("div", {
14566
14774
  className: "nut-infinite-bottom"
14567
14775
  }, isInfiniting ? /* @__PURE__ */ React__default.createElement("div", {
14568
14776
  className: "bottom-box"
14569
14777
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
14570
- classPrefix: props.iconClassPrefix,
14571
- fontClassName: props.iconFontClassName,
14778
+ classPrefix: iconClassPrefix,
14779
+ fontClassName: iconFontClassName,
14572
14780
  className: "bottom-img",
14573
14781
  name: loadIcon
14574
14782
  }), /* @__PURE__ */ React__default.createElement("div", {
14575
14783
  className: "bottom-text"
14576
- }, locale.infiniteloading.loadText || loadTxt)) : !hasMore && /* @__PURE__ */ React__default.createElement("div", {
14784
+ }, loadTxt || locale.infiniteloading.loadText)) : !hasMore && /* @__PURE__ */ React__default.createElement("div", {
14577
14785
  className: "tips"
14578
- }, locale.infiniteloading.loadMoreText || loadMoreTxt)));
14786
+ }, loadMoreTxt || locale.infiniteloading.loadMoreText)));
14579
14787
  };
14580
- Infiniteloading.defaultProps = defaultProps$C;
14788
+ Infiniteloading.defaultProps = defaultProps$B;
14581
14789
  Infiniteloading.displayName = "NutInfiniteloading";
14790
+ let createRoot;
14791
+ const { version } = ReactDOM;
14792
+ const reactDOMClone = {
14793
+ ...ReactDOM
14794
+ };
14795
+ try {
14796
+ const mainVersion = Number((version || "").split(".")[0]);
14797
+ if (mainVersion >= 18) {
14798
+ createRoot = reactDOMClone.createRoot;
14799
+ }
14800
+ } catch (e2) {
14801
+ console.log(e2);
14802
+ }
14803
+ function legacyRender(node, container) {
14804
+ ReactDOM.render(node, container);
14805
+ }
14806
+ function concurrentRender(node, container) {
14807
+ if (createRoot) {
14808
+ const root = createRoot(container);
14809
+ root.render(node);
14810
+ }
14811
+ }
14812
+ function render(node, container) {
14813
+ if (createRoot) {
14814
+ concurrentRender(node, container);
14815
+ return;
14816
+ }
14817
+ legacyRender(node, container);
14818
+ }
14582
14819
  class Notification extends React.PureComponent {
14583
14820
  constructor(props) {
14584
14821
  super(props);
@@ -14754,7 +14991,7 @@ var Notify = {
14754
14991
  }
14755
14992
  }
14756
14993
  };
14757
- const defaultProps$B = {
14994
+ const defaultProps$A = {
14758
14995
  isAsync: false,
14759
14996
  checked: false,
14760
14997
  disable: false,
@@ -14777,7 +15014,7 @@ const Switch = (props) => {
14777
15014
  className,
14778
15015
  style
14779
15016
  } = {
14780
- ...defaultProps$B,
15017
+ ...defaultProps$A,
14781
15018
  ...props
14782
15019
  };
14783
15020
  const [value, setValue] = useState(false);
@@ -14817,7 +15054,7 @@ const Switch = (props) => {
14817
15054
  className: `${b2("label")} close`
14818
15055
  }, inactiveText))));
14819
15056
  };
14820
- Switch.defaultProps = defaultProps$B;
15057
+ Switch.defaultProps = defaultProps$A;
14821
15058
  Switch.displayName = "NutSwitch";
14822
15059
  function preventDefault(event, isStopPropagation) {
14823
15060
  if (typeof event.cancelable !== "boolean" || event.cancelable) {
@@ -14827,7 +15064,7 @@ function preventDefault(event, isStopPropagation) {
14827
15064
  event.stopPropagation();
14828
15065
  }
14829
15066
  }
14830
- const defaultProps$A = {
15067
+ const defaultProps$z = {
14831
15068
  name: "",
14832
15069
  leftWidth: 0,
14833
15070
  rightWidth: 0
@@ -14835,7 +15072,7 @@ const defaultProps$A = {
14835
15072
  const Swipe = forwardRef((props, instanceRef) => {
14836
15073
  const swipeBem = cn("swipe");
14837
15074
  const touch = useTouch();
14838
- const { children, className, style } = { ...defaultProps$A, ...props };
15075
+ const { children, className, style } = { ...defaultProps$z, ...props };
14839
15076
  const root = useRef();
14840
15077
  const opened = useRef(false);
14841
15078
  const lockClick = useRef(false);
@@ -15001,7 +15238,7 @@ const Swipe = forwardRef((props, instanceRef) => {
15001
15238
  style: wrapperStyle
15002
15239
  }, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef)));
15003
15240
  });
15004
- Swipe.defaultProps = defaultProps$A;
15241
+ Swipe.defaultProps = defaultProps$z;
15005
15242
  Swipe.displayName = "NutSwipe";
15006
15243
  const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
15007
15244
  const defaultRoot = canUseDom ? window : void 0;
@@ -15060,7 +15297,7 @@ if (canUseDom) {
15060
15297
  console.log(e2);
15061
15298
  }
15062
15299
  }
15063
- const defaultProps$z = {
15300
+ const defaultProps$y = {
15064
15301
  pullingText: "",
15065
15302
  canReleaseText: "",
15066
15303
  refreshingText: "",
@@ -15075,7 +15312,7 @@ const defaultProps$z = {
15075
15312
  const PullToRefresh = (p2) => {
15076
15313
  const { locale } = useConfig$1();
15077
15314
  const props = {
15078
- ...defaultProps$z,
15315
+ ...defaultProps$y,
15079
15316
  ...p2,
15080
15317
  ...{
15081
15318
  pullingText: p2.pullingText || locale.pullToRefresh.pullingText,
@@ -15214,19 +15451,18 @@ const PullToRefresh = (p2) => {
15214
15451
  className: "nut-pulltorefresh-content"
15215
15452
  }, props.children));
15216
15453
  };
15217
- PullToRefresh.defaultProps = defaultProps$z;
15454
+ PullToRefresh.defaultProps = defaultProps$y;
15218
15455
  PullToRefresh.displayName = "NutPullToRefresh";
15219
15456
  const isObject = (val) => val !== null && typeof val === "object";
15220
- const defaultProps$y = {
15457
+ const defaultProps$x = {
15221
15458
  strokeWidth: 5,
15222
15459
  radius: 50,
15223
15460
  strokeLinecap: "round",
15224
- circleColor: "",
15225
- pathColor: "",
15461
+ circleColor: "#fa2c19",
15462
+ pathColor: "#e5e9f2",
15226
15463
  clockwise: true
15227
15464
  };
15228
15465
  const CircleProgress = (props) => {
15229
- var _a;
15230
15466
  const {
15231
15467
  children,
15232
15468
  progress,
@@ -15240,38 +15476,55 @@ const CircleProgress = (props) => {
15240
15476
  strokeLinecap,
15241
15477
  ...restProps
15242
15478
  } = {
15243
- ...defaultProps$y,
15479
+ ...defaultProps$x,
15244
15480
  ...props
15245
15481
  };
15482
+ const [oldValue, setOldValue] = useState(progress);
15246
15483
  const b2 = cn("circleprogress");
15247
15484
  const classes = classNames(className, b2(""));
15248
15485
  const refRandomId = Math.random().toString(36).slice(-8);
15486
+ let lastTime = 0;
15249
15487
  const styles = {
15250
15488
  height: `${Number(radius) * 2}px`,
15251
15489
  width: `${Number(radius) * 2}px`,
15252
15490
  ...style
15253
15491
  };
15254
- const pathStyle = {
15255
- stroke: pathColor
15256
- };
15257
- const hoverStyle = () => {
15258
- const perimeter = 283;
15259
- const offset = perimeter * Number(progress) / 100;
15260
- return {
15261
- stroke: isObject(circleColor) ? `url(#${refRandomId})` : circleColor,
15262
- strokeDasharray: `${offset}px ${perimeter}px`
15492
+ useEffect(() => {
15493
+ let rafId;
15494
+ const startTime = Date.now();
15495
+ const startRate = Number(oldValue);
15496
+ const endRate = Number(progress);
15497
+ const duration = Math.abs((startRate - endRate) * 1e3 / 100);
15498
+ const animate = () => {
15499
+ const now = Date.now();
15500
+ const progress2 = Math.min((now - startTime) / duration, 1);
15501
+ const rate = progress2 * (endRate - startRate) + startRate;
15502
+ setOldValue(Math.min(Math.max(+rate, 0), 100));
15503
+ if (endRate > startRate ? rate < endRate : rate > endRate) {
15504
+ rafId = requestAnimationFrame2(animate);
15505
+ }
15263
15506
  };
15264
- };
15265
- const path = () => {
15266
- const isWise = clockwise ? 1 : 0;
15267
- return `M 50 50 m -45 0 a 45 45 0 1 ${isWise} 90 0 a 45 45 0 1 ${isWise} -90 0`;
15268
- };
15269
- const hoverColor = () => {
15270
- return isObject(circleColor) ? `url(#${refRandomId})` : circleColor;
15507
+ if (rafId) {
15508
+ cancelAnimationFrame2(rafId);
15509
+ }
15510
+ rafId = requestAnimationFrame2(animate);
15511
+ }, [progress]);
15512
+ const requestAnimationFrame2 = function(callback) {
15513
+ const currTime = new Date().getTime();
15514
+ const timeToCall = Math.max(0, 16.7 - (currTime - lastTime));
15515
+ lastTime = currTime + timeToCall;
15516
+ const id = setTimeout(function() {
15517
+ callback();
15518
+ }, timeToCall);
15519
+ lastTime = currTime + timeToCall;
15520
+ return id;
15521
+ };
15522
+ const cancelAnimationFrame2 = function(id) {
15523
+ clearTimeout(id);
15271
15524
  };
15272
15525
  const stop2 = () => {
15273
15526
  if (!isObject(circleColor)) {
15274
- return;
15527
+ return [];
15275
15528
  }
15276
15529
  const color = circleColor;
15277
15530
  const colorArr = Object.keys(color).sort(
@@ -15289,46 +15542,54 @@ const CircleProgress = (props) => {
15289
15542
  });
15290
15543
  return stopArr;
15291
15544
  };
15545
+ const transColor = (color) => {
15546
+ return color && color.replace("#", "%23");
15547
+ };
15548
+ const format = (progress2) => Math.min(Math.max(+progress2, 0), 100);
15549
+ const circleStyle = () => {
15550
+ const stopArr = stop2();
15551
+ const stopDom = [];
15552
+ if (stopArr) {
15553
+ stopArr.map((item) => {
15554
+ let obj = "";
15555
+ obj = `%3Cstop offset='${item.key}' stop-color='${transColor(
15556
+ item.value
15557
+ )}'/%3E`;
15558
+ stopDom.push(obj);
15559
+ });
15560
+ }
15561
+ const perimeter = 283;
15562
+ const progress2 = +oldValue;
15563
+ const offset = perimeter * Number(format(parseFloat(progress2.toFixed(1)))) / 100;
15564
+ const isWise = props.clockwise ? 1 : 0;
15565
+ const color = isObject(circleColor) ? `url(%23${refRandomId})` : transColor(circleColor);
15566
+ const d2 = `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
15567
+ const pa = `%3Cdefs%3E%3ClinearGradient id='${refRandomId}' x1='100%25' y1='0%25' x2='0%25' y2='0%25'%3E${stopDom}%3C/linearGradient%3E%3C/defs%3E`;
15568
+ const path = `%3Cpath d='${d2}' stroke-width='${strokeWidth}' stroke='${transColor(
15569
+ props.pathColor
15570
+ )}' fill='none'/%3E`;
15571
+ const path1 = `%3Cpath d='${d2}' stroke-width='${strokeWidth}' stroke-dasharray='${offset},${perimeter}' stroke-linecap='round' stroke='${transColor(
15572
+ color
15573
+ )}' fill='none'/%3E`;
15574
+ return {
15575
+ background: `url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E${pa}${path}${path1}%3C/svg%3E")`,
15576
+ width: "100%",
15577
+ height: "100%"
15578
+ };
15579
+ };
15292
15580
  return /* @__PURE__ */ React__default.createElement("div", {
15293
15581
  className: classes,
15294
15582
  style: styles,
15295
15583
  ...restProps
15296
- }, /* @__PURE__ */ React__default.createElement("svg", {
15297
- viewBox: "0 0 100 100"
15298
- }, /* @__PURE__ */ React__default.createElement("defs", null, /* @__PURE__ */ React__default.createElement("linearGradient", {
15299
- id: refRandomId,
15300
- x1: "100%",
15301
- y1: "0%",
15302
- x2: "0%",
15303
- y2: "0%"
15304
- }, (_a = stop2()) == null ? void 0 : _a.map((item, index2) => {
15305
- return /* @__PURE__ */ React__default.createElement("stop", {
15306
- key: index2,
15307
- offset: item.key,
15308
- stopColor: item.value
15309
- });
15310
- }))), /* @__PURE__ */ React__default.createElement("path", {
15311
- className: "nut-circleprogress-path",
15312
- style: pathStyle,
15313
- d: path(),
15314
- fill: "none",
15315
- strokeWidth
15316
- }), /* @__PURE__ */ React__default.createElement("path", {
15317
- className: "nut-circleprogress-hover",
15318
- style: hoverStyle(),
15319
- d: path(),
15320
- fill: "none",
15321
- stroke: hoverColor(),
15322
- strokeLinecap,
15323
- transform: "rotate(90,50,50)",
15324
- strokeWidth
15325
- })), /* @__PURE__ */ React__default.createElement("div", {
15584
+ }, /* @__PURE__ */ React__default.createElement("div", {
15585
+ style: circleStyle()
15586
+ }), /* @__PURE__ */ React__default.createElement("div", {
15326
15587
  className: "nut-circleprogress-text"
15327
15588
  }, children || /* @__PURE__ */ React__default.createElement("div", null, progress, "%")));
15328
15589
  };
15329
- CircleProgress.defaultProps = defaultProps$y;
15590
+ CircleProgress.defaultProps = defaultProps$x;
15330
15591
  CircleProgress.displayName = "NutCircleProgress";
15331
- const defaultProps$x = {
15592
+ const defaultProps$w = {
15332
15593
  ...ComponentDefaults,
15333
15594
  direction: "across",
15334
15595
  list: [],
@@ -15366,8 +15627,13 @@ const NoticeBar = (props) => {
15366
15627
  speed,
15367
15628
  rightIcon,
15368
15629
  close,
15369
- click
15370
- } = { ...defaultProps$x, ...props };
15630
+ click,
15631
+ iconClassPrefix,
15632
+ iconFontClassName
15633
+ } = {
15634
+ ...defaultProps$w,
15635
+ ...props
15636
+ };
15371
15637
  const wrap = useRef(null);
15372
15638
  const content = useRef(null);
15373
15639
  const [showNoticeBar, SetShowNoticeBar] = useState(true);
@@ -15560,8 +15826,8 @@ const NoticeBar = (props) => {
15560
15826
  className: "left-icon",
15561
15827
  style: { backgroundImage: `url(${iconBg() || ""})` }
15562
15828
  }, !iconBg() ? /* @__PURE__ */ React__default.createElement(Icon$1, {
15563
- classPrefix: props.iconClassPrefix,
15564
- fontClassName: props.iconFontClassName,
15829
+ classPrefix: iconClassPrefix,
15830
+ fontClassName: iconFontClassName,
15565
15831
  name: "notice",
15566
15832
  size: "16",
15567
15833
  color
@@ -15577,8 +15843,8 @@ const NoticeBar = (props) => {
15577
15843
  className: "right-icon",
15578
15844
  onClick: onClickIcon
15579
15845
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
15580
- classPrefix: props.iconClassPrefix,
15581
- fontClassName: props.iconFontClassName,
15846
+ classPrefix: iconClassPrefix,
15847
+ fontClassName: iconFontClassName,
15582
15848
  name: rightIcon || "close",
15583
15849
  color
15584
15850
  })) : null) : null, scrollList.current.length > 0 && direction === "vertical" ? /* @__PURE__ */ React__default.createElement("div", {
@@ -15607,23 +15873,23 @@ const NoticeBar = (props) => {
15607
15873
  handleClickIcon();
15608
15874
  }
15609
15875
  }, rightIcon || (closeMode ? /* @__PURE__ */ React__default.createElement(Icon$1, {
15610
- classPrefix: props.iconClassPrefix,
15611
- fontClassName: props.iconFontClassName,
15876
+ classPrefix: iconClassPrefix,
15877
+ fontClassName: iconFontClassName,
15612
15878
  name: "cross",
15613
15879
  color,
15614
15880
  size: "11px"
15615
15881
  }) : null))) : null);
15616
15882
  };
15617
- NoticeBar.defaultProps = defaultProps$x;
15883
+ NoticeBar.defaultProps = defaultProps$w;
15618
15884
  NoticeBar.displayName = "NutNoticeBar";
15619
15885
  const DataContext$1 = createContext({});
15620
- const defaultProps$w = {
15886
+ const defaultProps$v = {
15621
15887
  current: 0,
15622
15888
  direction: "horizontal",
15623
15889
  progressDot: false
15624
15890
  };
15625
15891
  const Steps = (props) => {
15626
- const propSteps = { ...defaultProps$w, ...props };
15892
+ const propSteps = { ...defaultProps$v, ...props };
15627
15893
  const {
15628
15894
  children,
15629
15895
  current,
@@ -15656,9 +15922,9 @@ const Steps = (props) => {
15656
15922
  children
15657
15923
  ));
15658
15924
  };
15659
- Steps.defaultProps = defaultProps$w;
15925
+ Steps.defaultProps = defaultProps$v;
15660
15926
  Steps.displayName = "NutSteps";
15661
- const defaultProps$v = {
15927
+ const defaultProps$u = {
15662
15928
  ...ComponentDefaults,
15663
15929
  title: "",
15664
15930
  content: "",
@@ -15678,9 +15944,11 @@ const Step = (props) => {
15678
15944
  size,
15679
15945
  className,
15680
15946
  renderContent,
15947
+ iconClassPrefix,
15948
+ iconFontClassName,
15681
15949
  ...restProps
15682
15950
  } = {
15683
- ...defaultProps$v,
15951
+ ...defaultProps$u,
15684
15952
  ...props
15685
15953
  };
15686
15954
  const parent = useContext$1(DataContext$1);
@@ -15725,8 +15993,8 @@ const Step = (props) => {
15725
15993
  }), /* @__PURE__ */ React__default.createElement("div", {
15726
15994
  className: renderIconClass()
15727
15995
  }, icon ? /* @__PURE__ */ React__default.createElement(Icon$1, {
15728
- classPrefix: props.iconClassPrefix,
15729
- fontClassName: props.iconFontClassName,
15996
+ classPrefix: iconClassPrefix,
15997
+ fontClassName: iconFontClassName,
15730
15998
  className: "nut-step-icon-inner",
15731
15999
  color: iconColor,
15732
16000
  name: icon,
@@ -15743,10 +16011,10 @@ const Step = (props) => {
15743
16011
  className: "nut-step-content"
15744
16012
  }, renderContent())));
15745
16013
  };
15746
- Step.defaultProps = defaultProps$v;
16014
+ Step.defaultProps = defaultProps$u;
15747
16015
  Step.displayName = "NutStep";
15748
16016
  const DataContext = createContext({});
15749
- const defaultProps$u = {
16017
+ const defaultProps$t = {
15750
16018
  width: typeof window === "object" ? window.innerWidth : 375,
15751
16019
  height: 0,
15752
16020
  duration: 500,
@@ -15764,7 +16032,7 @@ const defaultProps$u = {
15764
16032
  };
15765
16033
  const DISTANCE = 5;
15766
16034
  const Swiper = React__default.forwardRef((props, ref) => {
15767
- const propSwiper = { ...defaultProps$u, ...props };
16035
+ const propSwiper = { ...defaultProps$t, ...props };
15768
16036
  const {
15769
16037
  children,
15770
16038
  direction,
@@ -16070,7 +16338,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
16070
16338
  }, [active]);
16071
16339
  const queryRect = (element) => {
16072
16340
  return new Promise((resolve) => {
16073
- const query = Taro.createSelectorQuery();
16341
+ const query = createSelectorQuery();
16074
16342
  query.select(`#${element.id}`) && query.select(`#${element.id}`).boundingClientRect();
16075
16343
  query.exec(function(res) {
16076
16344
  resolve(res[0]);
@@ -16123,7 +16391,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
16123
16391
  };
16124
16392
  }, []);
16125
16393
  useReady(() => {
16126
- Taro.nextTick(() => {
16394
+ nextTick(() => {
16127
16395
  init();
16128
16396
  });
16129
16397
  });
@@ -16151,7 +16419,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
16151
16419
  className: `${classes} ${className}`,
16152
16420
  ref: container,
16153
16421
  ...rest,
16154
- id: "container-" + refRandomId,
16422
+ id: `container-${refRandomId}`,
16155
16423
  onTouchStart,
16156
16424
  onTouchMove,
16157
16425
  onTouchEnd,
@@ -16183,13 +16451,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
16183
16451
  });
16184
16452
  })) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
16185
16453
  });
16186
- Swiper.defaultProps = defaultProps$u;
16454
+ Swiper.defaultProps = defaultProps$t;
16187
16455
  Swiper.displayName = "NutSwiper";
16188
- const defaultProps$t = {
16456
+ const defaultProps$s = {
16189
16457
  direction: "horizontal"
16190
16458
  };
16191
16459
  const SwiperItem = React__default.forwardRef((props, ref) => {
16192
- const _props = { ...defaultProps$t, ...props };
16460
+ const _props = { ...defaultProps$s, ...props };
16193
16461
  const { children, direction, size } = _props;
16194
16462
  const parent = useContext$1(DataContext);
16195
16463
  const b2 = cn("swiper-item");
@@ -16208,10 +16476,10 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
16208
16476
  style: style()
16209
16477
  }, children);
16210
16478
  });
16211
- SwiperItem.defaultProps = defaultProps$t;
16479
+ SwiperItem.defaultProps = defaultProps$s;
16212
16480
  SwiperItem.displayName = "NutSwiperItem";
16213
16481
  const AvatarContext = createContext({});
16214
- const defaultProps$s = {
16482
+ const defaultProps$r = {
16215
16483
  ...ComponentDefaults,
16216
16484
  size: "",
16217
16485
  icon: "",
@@ -16237,9 +16505,11 @@ const Avatar = (props) => {
16237
16505
  style,
16238
16506
  activeAvatar,
16239
16507
  onError,
16508
+ iconClassPrefix,
16509
+ iconFontClassName,
16240
16510
  ...rest
16241
16511
  } = {
16242
- ...defaultProps$s,
16512
+ ...defaultProps$r,
16243
16513
  ...props
16244
16514
  };
16245
16515
  const [maxSum, setMaxSum] = useState(0);
@@ -16316,8 +16586,8 @@ const Avatar = (props) => {
16316
16586
  alt,
16317
16587
  onError: errorEvent
16318
16588
  }), icon && /* @__PURE__ */ React__default.createElement(Icon$1, {
16319
- classPrefix: props.iconClassPrefix,
16320
- fontClassName: props.iconFontClassName,
16589
+ classPrefix: iconClassPrefix,
16590
+ fontClassName: iconFontClassName,
16321
16591
  className: "icon",
16322
16592
  name: iconStyles
16323
16593
  }), children && /* @__PURE__ */ React__default.createElement("span", {
@@ -16326,22 +16596,9 @@ const Avatar = (props) => {
16326
16596
  className: "text"
16327
16597
  }, ((_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent) ? (_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxContent : `+ ${avatarIndex - ((_o = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _o.maxCount)}`)));
16328
16598
  };
16329
- Avatar.defaultProps = defaultProps$s;
16599
+ Avatar.defaultProps = defaultProps$r;
16330
16600
  Avatar.displayName = "NutAvatar";
16331
- const defaultConfigRef = {
16332
- current: {
16333
- locale: zhCN
16334
- }
16335
- };
16336
- const getDefaultConfig = () => {
16337
- return defaultConfigRef.current;
16338
- };
16339
- const useConfig = () => {
16340
- var _a;
16341
- return (_a = useContext$1(ConfigContext)) != null ? _a : getDefaultConfig();
16342
- };
16343
- const ConfigContext = createContext(null);
16344
- const defaultProps$r = {
16601
+ const defaultProps$q = {
16345
16602
  maxContent: "",
16346
16603
  maxCount: "",
16347
16604
  maxBgColor: "#eee",
@@ -16353,7 +16610,7 @@ const defaultProps$r = {
16353
16610
  };
16354
16611
  const AvatarGroup = (props) => {
16355
16612
  useConfig();
16356
- const propAvatarGroup = { ...defaultProps$r, ...props };
16613
+ const propAvatarGroup = { ...defaultProps$q, ...props };
16357
16614
  const { className, style, children } = propAvatarGroup;
16358
16615
  const avatarGroupRef = useRef(null);
16359
16616
  const b2 = cn("avatar-group");
@@ -16370,9 +16627,9 @@ const AvatarGroup = (props) => {
16370
16627
  ref: avatarGroupRef
16371
16628
  }, children));
16372
16629
  };
16373
- AvatarGroup.defaultProps = defaultProps$r;
16630
+ AvatarGroup.defaultProps = defaultProps$q;
16374
16631
  AvatarGroup.displayName = "NutAvatarGroup";
16375
- const defaultProps$q = {
16632
+ const defaultProps$p = {
16376
16633
  price: 0,
16377
16634
  needSymbol: true,
16378
16635
  symbol: "&yen;",
@@ -16390,7 +16647,7 @@ const Price = (props) => {
16390
16647
  className,
16391
16648
  ...rest
16392
16649
  } = {
16393
- ...defaultProps$q,
16650
+ ...defaultProps$p,
16394
16651
  ...props
16395
16652
  };
16396
16653
  const b2 = cn("price");
@@ -16453,9 +16710,9 @@ const Price = (props) => {
16453
16710
  className: `${b2("small")}`
16454
16711
  }, formatDecimal(price)));
16455
16712
  };
16456
- Price.defaultProps = defaultProps$q;
16713
+ Price.defaultProps = defaultProps$p;
16457
16714
  Price.displayName = "NutPrice";
16458
- const defaultProps$p = {
16715
+ const defaultProps$o = {
16459
16716
  ...ComponentDefaults,
16460
16717
  value: "",
16461
16718
  dot: false,
@@ -16467,8 +16724,18 @@ const defaultProps$p = {
16467
16724
  icons: ""
16468
16725
  };
16469
16726
  const Badge = (props) => {
16470
- const { children, dot, top, right, zIndex, color, icons } = {
16471
- ...defaultProps$p,
16727
+ const {
16728
+ children,
16729
+ dot,
16730
+ top,
16731
+ right,
16732
+ zIndex,
16733
+ color,
16734
+ icons,
16735
+ iconClassPrefix,
16736
+ iconFontClassName
16737
+ } = {
16738
+ ...defaultProps$o,
16472
16739
  ...props
16473
16740
  };
16474
16741
  function content() {
@@ -16494,8 +16761,8 @@ const Badge = (props) => {
16494
16761
  }, icons !== "" && /* @__PURE__ */ React__default.createElement("div", {
16495
16762
  className: "slot-icons"
16496
16763
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
16497
- classPrefix: props.iconClassPrefix,
16498
- fontClassName: props.iconFontClassName,
16764
+ classPrefix: iconClassPrefix,
16765
+ fontClassName: iconFontClassName,
16499
16766
  className: "_icon",
16500
16767
  name: icons,
16501
16768
  color: "#ffffff",
@@ -16505,9 +16772,9 @@ const Badge = (props) => {
16505
16772
  style: getStyle()
16506
16773
  }, content()));
16507
16774
  };
16508
- Badge.defaultProps = defaultProps$p;
16775
+ Badge.defaultProps = defaultProps$o;
16509
16776
  Badge.displayName = "NutBadge";
16510
- const defaultProps$o = {
16777
+ const defaultProps$n = {
16511
16778
  ...ComponentDefaults,
16512
16779
  type: "default",
16513
16780
  color: "",
@@ -16534,9 +16801,11 @@ const Tag = (props) => {
16534
16801
  closeable,
16535
16802
  textColor,
16536
16803
  onClick,
16537
- onClose
16804
+ onClose,
16805
+ iconClassPrefix,
16806
+ iconFontClassName
16538
16807
  } = {
16539
- ...defaultProps$o,
16808
+ ...defaultProps$n,
16540
16809
  ...props
16541
16810
  };
16542
16811
  const [btnName, setBtnName] = useState("");
@@ -16591,8 +16860,8 @@ const Tag = (props) => {
16591
16860
  }, children && /* @__PURE__ */ React__default.createElement("span", {
16592
16861
  className: "text"
16593
16862
  }, children), /* @__PURE__ */ React__default.createElement(Icon$1, {
16594
- classPrefix: props.iconClassPrefix,
16595
- fontClassName: props.iconFontClassName,
16863
+ classPrefix: iconClassPrefix,
16864
+ fontClassName: iconFontClassName,
16596
16865
  className: "_icon",
16597
16866
  name: "close",
16598
16867
  size: "12",
@@ -16610,7 +16879,7 @@ const Tag = (props) => {
16610
16879
  className: "text"
16611
16880
  }, children)));
16612
16881
  };
16613
- Tag.defaultProps = defaultProps$o;
16882
+ Tag.defaultProps = defaultProps$n;
16614
16883
  Tag.displayName = "NutTag";
16615
16884
  function fillRef(ref, node) {
16616
16885
  if (typeof ref === "function") {
@@ -16654,7 +16923,7 @@ class Trigger extends React__default.Component {
16654
16923
  return trigger;
16655
16924
  }
16656
16925
  }
16657
- const defaultProps$n = {
16926
+ const defaultProps$m = {
16658
16927
  ...ComponentDefaults,
16659
16928
  list: [],
16660
16929
  theme: "light",
@@ -16679,9 +16948,11 @@ const Popover = (props) => {
16679
16948
  style,
16680
16949
  onClick,
16681
16950
  onChoose,
16951
+ iconClassPrefix,
16952
+ iconFontClassName,
16682
16953
  ...reset
16683
16954
  } = {
16684
- ...defaultProps$n,
16955
+ ...defaultProps$m,
16685
16956
  ...props
16686
16957
  };
16687
16958
  const goodItem = useRef(null);
@@ -16763,8 +17034,8 @@ const Popover = (props) => {
16763
17034
  handleChoose(item, i);
16764
17035
  }
16765
17036
  }, item.icon ? /* @__PURE__ */ React__default.createElement(Icon$1, {
16766
- classPrefix: props.iconClassPrefix,
16767
- fontClassName: props.iconFontClassName,
17037
+ classPrefix: iconClassPrefix,
17038
+ fontClassName: iconFontClassName,
16768
17039
  className: "popover-menu-item-img",
16769
17040
  name: item.icon
16770
17041
  }) : "", /* @__PURE__ */ React__default.createElement("div", {
@@ -16776,9 +17047,9 @@ const Popover = (props) => {
16776
17047
  style: { background: "transparent" }
16777
17048
  }) : "");
16778
17049
  };
16779
- Popover.defaultProps = defaultProps$n;
17050
+ Popover.defaultProps = defaultProps$m;
16780
17051
  Popover.displayName = "NutPopover";
16781
- const defaultProps$m = {
17052
+ const defaultProps$l = {
16782
17053
  width: "100px",
16783
17054
  height: "100px",
16784
17055
  row: 1,
@@ -16806,7 +17077,7 @@ const Skeleton = (props) => {
16806
17077
  avatarShape,
16807
17078
  ...restProps
16808
17079
  } = {
16809
- ...defaultProps$m,
17080
+ ...defaultProps$l,
16810
17081
  ...props
16811
17082
  };
16812
17083
  const b2 = cn("skeleton");
@@ -16861,9 +17132,9 @@ const Skeleton = (props) => {
16861
17132
  });
16862
17133
  })))));
16863
17134
  };
16864
- Skeleton.defaultProps = defaultProps$m;
17135
+ Skeleton.defaultProps = defaultProps$l;
16865
17136
  Skeleton.displayName = "NutSkeleton";
16866
- const defaultProps$l = {
17137
+ const defaultProps$k = {
16867
17138
  paused: false,
16868
17139
  startTime: Date.now(),
16869
17140
  endTime: Date.now(),
@@ -16890,7 +17161,7 @@ const InternalCountDown = (props, ref) => {
16890
17161
  onUpdate,
16891
17162
  children,
16892
17163
  ...rest
16893
- } = { ...defaultProps$l, ...props };
17164
+ } = { ...defaultProps$k, ...props };
16894
17165
  const b2 = cn("countdown");
16895
17166
  const [restTimeStamp, setRestTime] = useState(0);
16896
17167
  const stateRef = useRef({
@@ -17086,9 +17357,9 @@ const InternalCountDown = (props, ref) => {
17086
17357
  }));
17087
17358
  };
17088
17359
  const CountDown = React__default.forwardRef(InternalCountDown);
17089
- CountDown.defaultProps = defaultProps$l;
17360
+ CountDown.defaultProps = defaultProps$k;
17090
17361
  CountDown.displayName = "NutCountDown";
17091
- const defaultProps$k = {
17362
+ const defaultProps$j = {
17092
17363
  activeName: ["0"],
17093
17364
  accordion: false,
17094
17365
  icon: "",
@@ -17111,7 +17382,7 @@ const Collapse = memo(
17111
17382
  iconColor,
17112
17383
  change
17113
17384
  } = {
17114
- ...defaultProps$k,
17385
+ ...defaultProps$j,
17115
17386
  ...props
17116
17387
  };
17117
17388
  const childrenDom = React__default.Children.toArray(children);
@@ -17168,9 +17439,9 @@ const Collapse = memo(
17168
17439
  },
17169
17440
  areEqual
17170
17441
  );
17171
- Collapse.defaultProps = defaultProps$k;
17442
+ Collapse.defaultProps = defaultProps$j;
17172
17443
  Collapse.displayName = "NutCollapse";
17173
- const defaultProps$j = {
17444
+ const defaultProps$i = {
17174
17445
  ...ComponentDefaults,
17175
17446
  title: "",
17176
17447
  name: "",
@@ -17184,7 +17455,8 @@ const defaultProps$j = {
17184
17455
  titleIcon: "",
17185
17456
  titleIconColor: "",
17186
17457
  titleIconPosition: "",
17187
- titleIconSize: ""
17458
+ titleIconSize: "",
17459
+ childnull: true
17188
17460
  };
17189
17461
  const CollapseItem = (props) => {
17190
17462
  const {
@@ -17203,9 +17475,12 @@ const CollapseItem = (props) => {
17203
17475
  titleIconSize,
17204
17476
  iconSize,
17205
17477
  iconColor,
17478
+ childnull,
17479
+ iconClassPrefix,
17480
+ iconFontClassName,
17206
17481
  ...rest
17207
17482
  } = {
17208
- ...defaultProps$j,
17483
+ ...defaultProps$i,
17209
17484
  ...props
17210
17485
  };
17211
17486
  const [domHeight, setDomHeight] = useState(-1);
@@ -17251,16 +17526,16 @@ const CollapseItem = (props) => {
17251
17526
  }, titleIcon && titleIconPosition === "left" && /* @__PURE__ */ React__default.createElement("b", {
17252
17527
  className: colBem("title-icon-left")
17253
17528
  }, /* @__PURE__ */ React__default.createElement(Icon, {
17254
- classPrefix: props.iconClassPrefix,
17255
- fontClassName: props.iconFontClassName,
17529
+ classPrefix: iconClassPrefix,
17530
+ fontClassName: iconFontClassName,
17256
17531
  name: titleIcon,
17257
17532
  size: titleIconSize,
17258
17533
  color: disabled ? "#C2C2C2" : titleIconColor
17259
17534
  })), title, titleIcon && titleIconPosition === "right" && /* @__PURE__ */ React__default.createElement("b", {
17260
17535
  className: colBem("title-icon-right")
17261
17536
  }, /* @__PURE__ */ React__default.createElement(Icon, {
17262
- classPrefix: props.iconClassPrefix,
17263
- fontClassName: props.iconFontClassName,
17537
+ classPrefix: iconClassPrefix,
17538
+ fontClassName: iconFontClassName,
17264
17539
  name: titleIcon,
17265
17540
  size: titleIconSize,
17266
17541
  color: disabled ? "#C2C2C2" : titleIconColor
@@ -17272,12 +17547,12 @@ const CollapseItem = (props) => {
17272
17547
  className: colBem("icon"),
17273
17548
  style: iconStyle
17274
17549
  }, /* @__PURE__ */ React__default.createElement(Icon, {
17275
- classPrefix: props.iconClassPrefix,
17276
- fontClassName: props.iconFontClassName,
17550
+ classPrefix: iconClassPrefix,
17551
+ fontClassName: iconFontClassName,
17277
17552
  name: icon,
17278
17553
  size: iconSize,
17279
17554
  color: disabled ? "#C2C2C2" : iconColor
17280
- })))), /* @__PURE__ */ React__default.createElement("div", {
17555
+ })))), childnull && /* @__PURE__ */ React__default.createElement("div", {
17281
17556
  className: colBem("content"),
17282
17557
  style: { height: currHeight },
17283
17558
  ref: measuredRef
@@ -17285,9 +17560,9 @@ const CollapseItem = (props) => {
17285
17560
  className: colBem("content-text")
17286
17561
  }, children)));
17287
17562
  };
17288
- CollapseItem.defaultProps = defaultProps$j;
17563
+ CollapseItem.defaultProps = defaultProps$i;
17289
17564
  CollapseItem.displayName = "NutCollapseItem";
17290
- const defaultProps$i = {
17565
+ const defaultProps$h = {
17291
17566
  maxLen: 0,
17292
17567
  endNumber: "",
17293
17568
  delaySpeed: 300,
@@ -17305,7 +17580,7 @@ const CountUp = (props) => {
17305
17580
  thousands,
17306
17581
  ...reset
17307
17582
  } = {
17308
- ...defaultProps$i,
17583
+ ...defaultProps$h,
17309
17584
  ...props
17310
17585
  };
17311
17586
  const b2 = cn("countup");
@@ -17374,9 +17649,9 @@ const CountUp = (props) => {
17374
17649
  }, item));
17375
17650
  })));
17376
17651
  };
17377
- CountUp.defaultProps = defaultProps$i;
17652
+ CountUp.defaultProps = defaultProps$h;
17378
17653
  CountUp.displayName = "NutCountUp";
17379
- const defaultProps$h = {};
17654
+ const defaultProps$g = {};
17380
17655
  class AnimatingNumbers extends Component {
17381
17656
  constructor(props) {
17382
17657
  super(props);
@@ -17388,7 +17663,7 @@ class AnimatingNumbers extends Component {
17388
17663
  });
17389
17664
  }
17390
17665
  }
17391
- AnimatingNumbers.defaultProps = defaultProps$h;
17666
+ AnimatingNumbers.defaultProps = defaultProps$g;
17392
17667
  AnimatingNumbers.displayName = "NutAnimatingNumbers";
17393
17668
  AnimatingNumbers.CountUp = CountUp;
17394
17669
  const defaultStatus = {
@@ -17396,7 +17671,7 @@ const defaultStatus = {
17396
17671
  error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
17397
17672
  network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
17398
17673
  };
17399
- const defaultProps$g = {
17674
+ const defaultProps$f = {
17400
17675
  description: "\u65E0\u5185\u5BB9",
17401
17676
  image: "empty",
17402
17677
  imageSize: "",
@@ -17404,9 +17679,9 @@ const defaultProps$g = {
17404
17679
  };
17405
17680
  const Empty = (props) => {
17406
17681
  const { locale } = useConfig$1();
17407
- defaultProps$g.description = locale.noData || defaultProps$g.description;
17682
+ defaultProps$f.description = locale.noData || defaultProps$f.description;
17408
17683
  const { image, imageSize, description, children, className, ...rest } = {
17409
- ...defaultProps$g,
17684
+ ...defaultProps$f,
17410
17685
  ...props
17411
17686
  };
17412
17687
  const [imgStyle, setImgStyle] = useState({});
@@ -17448,7 +17723,7 @@ const Empty = (props) => {
17448
17723
  className: b2("description")
17449
17724
  }, description) : { description }, children));
17450
17725
  };
17451
- Empty.defaultProps = defaultProps$g;
17726
+ Empty.defaultProps = defaultProps$f;
17452
17727
  Empty.displayName = "NutEmpty";
17453
17728
  const initPositinoCache = (reaItemSize, length = 0) => {
17454
17729
  let index2 = 0;
@@ -17561,7 +17836,7 @@ const updateItemSize = (positions, items, sizeKey) => {
17561
17836
  }
17562
17837
  });
17563
17838
  };
17564
- const defaultProps$f = {};
17839
+ const defaultProps$e = {};
17565
17840
  const VirtualList = (props) => {
17566
17841
  const {
17567
17842
  sourceData = [],
@@ -17720,9 +17995,9 @@ const VirtualList = (props) => {
17720
17995
  }) : data);
17721
17996
  }))));
17722
17997
  };
17723
- VirtualList.defaultProps = defaultProps$f;
17998
+ VirtualList.defaultProps = defaultProps$e;
17724
17999
  VirtualList.displayName = "NutVirtualList";
17725
- const defaultProps$e = {
18000
+ const defaultProps$d = {
17726
18001
  ...ComponentDefaults,
17727
18002
  className: "",
17728
18003
  style: {},
@@ -17734,7 +18009,7 @@ const defaultProps$e = {
17734
18009
  };
17735
18010
  const Table = (props) => {
17736
18011
  const { locale } = useConfig$1();
17737
- defaultProps$e.noData = locale.noData;
18012
+ defaultProps$d.noData = locale.noData;
17738
18013
  const {
17739
18014
  children,
17740
18015
  className,
@@ -17746,9 +18021,11 @@ const Table = (props) => {
17746
18021
  striped,
17747
18022
  noData,
17748
18023
  onSorter,
18024
+ iconClassPrefix,
18025
+ iconFontClassName,
17749
18026
  ...rest
17750
18027
  } = {
17751
- ...defaultProps$e,
18028
+ ...defaultProps$d,
17752
18029
  ...props
17753
18030
  };
17754
18031
  const [curData, setCurData] = useState(data);
@@ -17789,8 +18066,8 @@ const Table = (props) => {
17789
18066
  key: item.key,
17790
18067
  onClick: () => handleSorterClick(item)
17791
18068
  }, item.title, item.sorter && /* @__PURE__ */ React__default.createElement(Icon$1, {
17792
- classPrefix: props.iconClassPrefix,
17793
- fontClassName: props.iconFontClassName,
18069
+ classPrefix: iconClassPrefix,
18070
+ fontClassName: iconFontClassName,
17794
18071
  name: "down-arrow",
17795
18072
  size: "12px"
17796
18073
  }));
@@ -17846,9 +18123,9 @@ const Table = (props) => {
17846
18123
  className: "nut-table__nodata__text"
17847
18124
  }, noData))));
17848
18125
  };
17849
- Table.defaultProps = defaultProps$e;
18126
+ Table.defaultProps = defaultProps$d;
17850
18127
  Table.displayName = "NutTable";
17851
- const defaultProps$d = {
18128
+ const defaultProps$c = {
17852
18129
  source: {
17853
18130
  type: {},
17854
18131
  src: ""
@@ -17873,7 +18150,7 @@ const Video = (props) => {
17873
18150
  playend,
17874
18151
  ...restProps
17875
18152
  } = {
17876
- ...defaultProps$d,
18153
+ ...defaultProps$c,
17877
18154
  ...props
17878
18155
  };
17879
18156
  const rootRef = useRef(null);
@@ -17927,152 +18204,29 @@ const Video = (props) => {
17927
18204
  kind: "captions"
17928
18205
  })));
17929
18206
  };
17930
- Video.defaultProps = defaultProps$d;
18207
+ Video.defaultProps = defaultProps$c;
17931
18208
  Video.displayName = "NutVideo";
17932
- const defaultProps$c = {
17933
- ...ComponentDefaults,
17934
- className: "",
17935
- style: {},
17936
- isShowPercentage: true,
17937
- percentage: 0,
17938
- fillColor: "#f3f3f3",
17939
- strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
17940
- strokeWidth: "",
17941
- textColor: "",
17942
- textWidth: "",
17943
- showText: true,
17944
- textInside: false,
17945
- textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
17946
- textType: "text",
17947
- status: false,
17948
- iconName: "checked",
17949
- iconColor: "#439422",
17950
- iconSize: "16px",
17951
- rounded: true,
17952
- children: void 0
17953
- };
17954
- const Progress = (props) => {
17955
- const {
17956
- className,
17957
- style,
17958
- isShowPercentage,
17959
- percentage,
17960
- fillColor,
17961
- strokeColor,
17962
- strokeWidth,
17963
- size,
17964
- textColor,
17965
- textWidth,
17966
- showText,
17967
- textInside,
17968
- textBackground,
17969
- textType,
17970
- status,
17971
- iconName,
17972
- iconColor,
17973
- iconSize,
17974
- rounded,
17975
- children,
17976
- ...rest
17977
- } = { ...defaultProps$c, ...props };
17978
- const b2 = cn("progress");
17979
- const classes = classNames(b2(""));
17980
- const classesOuter = classNames({
17981
- [`${b2("")}-outer`]: true,
17982
- [`${b2("")}-${size || "base"}`]: true
17983
- });
17984
- const classesInner = classNames({
17985
- [`${b2("")}-inner`]: true,
17986
- [`${b2("")}-active`]: status
17987
- });
17988
- const classesText = classNames({
17989
- [`${b2("")}-text`]: true
17990
- });
17991
- const classesInsideText = classNames({
17992
- [`${b2("")}-text`]: true,
17993
- [`${b2("")}-insidetext`]: true
17994
- });
17995
- const classesTextInner = classNames({
17996
- [`${b2("")}-text__inner`]: true
17997
- });
17998
- const stylesOuter = {
17999
- height: `${strokeWidth}px`,
18000
- borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
18001
- background: `${fillColor}`
18002
- };
18003
- const stylesInner = {
18004
- width: `${percentage}%`,
18005
- borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
18006
- background: `${strokeColor}`
18007
- };
18008
- const stylesInsideText = {
18009
- width: `${textWidth}px`,
18010
- left: `${percentage}%`,
18011
- background: textBackground || strokeColor
18012
- };
18013
- const stylesInsideIcon = {
18014
- width: `${textWidth}px`,
18015
- left: `${percentage}%`
18016
- };
18017
- const stylesText = {
18018
- width: `${textWidth}px`
18019
- };
18020
- return /* @__PURE__ */ React__default.createElement("div", {
18021
- className: `${classes} ${className}`,
18022
- style,
18023
- ...rest
18024
- }, /* @__PURE__ */ React__default.createElement("div", {
18025
- className: classesOuter,
18026
- style: stylesOuter
18027
- }, /* @__PURE__ */ React__default.createElement("div", {
18028
- className: classesInner,
18029
- style: stylesInner
18030
- }, showText && textInside && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children ? /* @__PURE__ */ React__default.createElement("div", {
18031
- className: classesInsideText,
18032
- style: stylesInsideIcon
18033
- }, children) : /* @__PURE__ */ React__default.createElement("div", {
18034
- className: classesInsideText,
18035
- style: stylesInsideText
18036
- }, /* @__PURE__ */ React__default.createElement("span", {
18037
- className: classesTextInner,
18038
- style: { color: textColor || "#fff" }
18039
- }, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default.createElement("div", {
18040
- className: classesText,
18041
- style: stylesText
18042
- }, textType === "text" && /* @__PURE__ */ React__default.createElement("span", {
18043
- className: classesTextInner,
18044
- style: { color: textColor || "#333" }
18045
- }, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default.createElement(Icon, {
18046
- classPrefix: props.iconClassPrefix,
18047
- fontClassName: props.iconFontClassName,
18048
- size: iconSize,
18049
- name: iconName,
18050
- color: iconColor
18051
- })));
18052
- };
18053
- Progress.defaultProps = defaultProps$c;
18054
- Progress.displayName = "NutProgress";
18209
+ const b = cn("audio");
18210
+ const warn = console.warn;
18055
18211
  const defaultProps$b = {
18056
18212
  ...ComponentDefaults,
18057
18213
  className: "",
18058
18214
  url: "",
18059
18215
  style: {},
18060
- muted: false,
18061
18216
  autoplay: false,
18062
18217
  loop: false,
18063
- preload: "auto",
18064
18218
  type: "progress",
18065
- onFastBack: (e2) => {
18219
+ onFastBack: (ctx2) => {
18066
18220
  },
18067
- onForward: (e2) => {
18221
+ onForward: (ctx2) => {
18068
18222
  },
18069
- onPause: (e2) => {
18223
+ onPause: (ctx2) => {
18070
18224
  },
18071
- onPlayEnd: (e2) => {
18225
+ onPlay: (ctx2) => {
18072
18226
  },
18073
- onMute: (e2) => {
18227
+ onPlayEnd: (ctx2) => {
18074
18228
  },
18075
- onCanPlay: (e2) => {
18229
+ onCanPlay: (ctx2) => {
18076
18230
  }
18077
18231
  };
18078
18232
  const Audio = (props) => {
@@ -18081,130 +18235,134 @@ const Audio = (props) => {
18081
18235
  className,
18082
18236
  url,
18083
18237
  style,
18084
- muted,
18085
18238
  autoplay,
18086
18239
  loop: loop2,
18087
- preload,
18088
18240
  type,
18089
18241
  onFastBack,
18090
18242
  onForward,
18091
18243
  onPause,
18244
+ onPlay,
18092
18245
  onPlayEnd,
18093
- onMute,
18094
18246
  onCanPlay,
18095
18247
  children,
18248
+ iconClassPrefix,
18249
+ iconFontClassName,
18096
18250
  ...rest
18097
18251
  } = {
18098
18252
  ...defaultProps$b,
18099
18253
  ...props
18100
18254
  };
18101
18255
  const [playing, setPlaying] = useState(false);
18256
+ const [totalSeconds, setTotalSeconds] = useState(0);
18102
18257
  const [percent, setPercent] = useState(0);
18103
18258
  const [isCanPlay, setIsCanPlay] = useState(false);
18104
18259
  const [currentDuration, setCurrentDuration] = useState("00:00:00");
18105
- const AudioRef = useRef(null);
18106
18260
  const statusRef = useRef({
18107
18261
  currentTime: 0,
18108
18262
  currentDuration: "00:00:00",
18109
- percent: 0,
18110
- duration: "00:00:00",
18111
- second: 0,
18112
- hanMuted: props.muted,
18113
- playing: props.autoplay,
18114
- handPlaying: false
18263
+ percent: 0
18115
18264
  });
18116
- const b2 = cn("audio");
18117
- const warn = console.warn;
18118
- const handleEnded = (e2) => {
18265
+ const audioRef = useRef(Taro.createInnerAudioContext());
18266
+ const audioCtx = audioRef.current;
18267
+ audioCtx.src = url;
18268
+ audioCtx.autoplay = autoplay || false;
18269
+ audioCtx.loop = loop2 || false;
18270
+ audioCtx.onPause(() => {
18271
+ props.onPause && props.onPause(audioCtx);
18272
+ });
18273
+ audioCtx.onEnded(() => {
18119
18274
  if (props.loop) {
18120
18275
  warn(locale.audio.tips || "onPlayEnd\u4E8B\u4EF6\u5728loop=false\u65F6\u624D\u4F1A\u89E6\u53D1");
18121
18276
  } else {
18122
- props.onPlayEnd && props.onPlayEnd(e2);
18277
+ props.onPlayEnd && props.onPlayEnd(audioCtx);
18123
18278
  }
18124
- };
18125
- function watch() {
18126
- if (AudioRef && AudioRef.current) {
18127
- const current = AudioRef.current;
18128
- current.addEventListener("play", () => {
18129
- setPlaying(true);
18130
- });
18279
+ });
18280
+ audioCtx.onPlay(() => {
18281
+ const { duration } = audioCtx;
18282
+ setTotalSeconds(Math.floor(duration));
18283
+ props.onPlay && props.onPlay(audioCtx);
18284
+ });
18285
+ audioCtx.onCanplay(() => {
18286
+ const intervalID = setInterval(function() {
18287
+ if (audioCtx.duration !== 0) {
18288
+ setTotalSeconds(audioCtx.duration);
18289
+ clearInterval(intervalID);
18290
+ }
18291
+ }, 500);
18292
+ setIsCanPlay(true);
18293
+ props.onCanPlay && props.onCanPlay(audioCtx);
18294
+ });
18295
+ audioCtx.onTimeUpdate(() => {
18296
+ const time = parseInt(`${audioCtx.currentTime}`);
18297
+ const formated = formatSeconds(`${time}`);
18298
+ statusRef.current.currentDuration = formated;
18299
+ setPercent(time / totalSeconds * 100);
18300
+ setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
18301
+ });
18302
+ audioCtx.onError((res) => {
18303
+ console.log("code", res.errCode);
18304
+ console.log("message", res.errMsg);
18305
+ });
18306
+ function formatSeconds(value) {
18307
+ if (!value) {
18308
+ return "00:00:00";
18131
18309
  }
18310
+ const time = parseInt(value);
18311
+ const hours = Math.floor(time / 3600);
18312
+ const minutes = Math.floor((time - hours * 3600) / 60);
18313
+ const secondss = time - hours * 3600 - minutes * 60;
18314
+ let result = "";
18315
+ result += `${`0${hours.toString()}`.slice(-2)}:`;
18316
+ result += `${`0${minutes.toString()}`.slice(-2)}:`;
18317
+ result += `0${secondss.toString()}`.slice(-2);
18318
+ return result;
18132
18319
  }
18133
- useEffect(() => {
18134
- watch();
18135
- }, []);
18136
- useEffect(() => {
18137
- }, [currentDuration]);
18320
+ const handleBack = () => {
18321
+ const currentTime = Math.floor(audioCtx.currentTime);
18322
+ statusRef.current.currentTime = Math.max(currentTime - 1, 0);
18323
+ setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
18324
+ audioCtx.seek(statusRef.current.currentTime);
18325
+ props.onFastBack && props.onFastBack(audioCtx);
18326
+ };
18327
+ const handleForward = () => {
18328
+ const currentTime = Math.floor(audioCtx.currentTime);
18329
+ statusRef.current.currentTime = Math.min(currentTime + 1, audioCtx.duration);
18330
+ setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
18331
+ audioCtx.seek(statusRef.current.currentTime);
18332
+ props.onForward && props.onForward(audioCtx);
18333
+ };
18138
18334
  const handleStatusChange = () => {
18139
18335
  setPlaying(!playing);
18140
- if (playing) {
18141
- AudioRef && AudioRef.current && AudioRef.current.pause();
18336
+ if (!playing) {
18337
+ audioCtx.play();
18142
18338
  } else {
18143
- AudioRef && AudioRef.current && AudioRef.current.play();
18339
+ audioCtx.pause();
18144
18340
  }
18145
18341
  };
18146
18342
  const renderIcon = () => {
18147
18343
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
18148
- className: b2("icon")
18344
+ className: b("icon")
18149
18345
  }, /* @__PURE__ */ React__default.createElement("div", {
18150
- className: `${b2("icon-box")} ${playing ? b2("icon-play") : b2("icon-stop")}`,
18346
+ className: `${b("icon-box")} ${playing ? b("icon-play") : b("icon-stop")}`,
18151
18347
  onClick: handleStatusChange
18152
18348
  }, playing ? /* @__PURE__ */ React__default.createElement(Icon$1, {
18153
- classPrefix: props.iconClassPrefix,
18154
- fontClassName: props.iconFontClassName,
18349
+ classPrefix: iconClassPrefix,
18350
+ fontClassName: iconFontClassName,
18155
18351
  name: "service",
18156
18352
  className: "nut-icon-loading"
18157
18353
  }) : /* @__PURE__ */ React__default.createElement(Icon$1, {
18158
- classPrefix: props.iconClassPrefix,
18159
- fontClassName: props.iconFontClassName,
18354
+ classPrefix: iconClassPrefix,
18355
+ fontClassName: iconFontClassName,
18160
18356
  name: "service"
18161
18357
  }))));
18162
18358
  };
18163
- const handleBack = () => {
18164
- if (statusRef.current.currentTime > 0 && AudioRef.current) {
18165
- statusRef.current.currentTime--;
18166
- AudioRef.current.currentTime = statusRef.current.currentTime;
18167
- props.onFastBack && props.onFastBack(AudioRef.current);
18168
- }
18169
- };
18170
- const handleForward = () => {
18171
- if (AudioRef.current) {
18172
- statusRef.current.currentTime++;
18173
- AudioRef.current.currentTime = statusRef.current.currentTime;
18174
- props.onForward && props.onForward(AudioRef.current);
18175
- }
18176
- };
18177
- const handleMute = () => {
18178
- if (AudioRef.current) {
18179
- AudioRef.current.muted = !AudioRef.current.muted;
18180
- props.onMute && props.onMute(AudioRef.current);
18181
- }
18182
- };
18183
- const handlePause = (e2) => {
18184
- setPlaying(false);
18185
- props.onPause && props.onPause(e2);
18186
- };
18187
- const formatSeconds = (value) => {
18188
- if (!value) {
18189
- return "00:00:00";
18190
- }
18191
- const time = parseInt(value);
18192
- const hours = Math.floor(time / 3600);
18193
- const minutes = Math.floor((time - hours * 3600) / 60);
18194
- const seconds = time - hours * 3600 - minutes * 60;
18195
- let result = "";
18196
- result += `${`0${hours.toString()}`.slice(-2)}:`;
18197
- result += `${`0${minutes.toString()}`.slice(-2)}:`;
18198
- result += `0${seconds.toString()}`.slice(-2);
18199
- return result;
18200
- };
18201
18359
  const renderProgerss = () => {
18202
18360
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
18203
- className: b2("progress")
18361
+ className: b("progress")
18204
18362
  }, /* @__PURE__ */ React__default.createElement("div", {
18205
18363
  className: "time"
18206
18364
  }, currentDuration), /* @__PURE__ */ React__default.createElement("div", {
18207
- className: b2("progress-bar-wrapper")
18365
+ className: b("progress-bar-wrapper")
18208
18366
  }, /* @__PURE__ */ React__default.createElement(Range, {
18209
18367
  modelValue: percent,
18210
18368
  hiddenTag: true,
@@ -18213,7 +18371,7 @@ const Audio = (props) => {
18213
18371
  "active-color": "#fa2c19"
18214
18372
  })), /* @__PURE__ */ React__default.createElement("div", {
18215
18373
  className: "time"
18216
- }, AudioRef.current ? formatSeconds(`${statusRef.current.second}`) : "00:00:00")), /* @__PURE__ */ React__default.createElement("div", {
18374
+ }, formatSeconds(`${totalSeconds}`) || "00:00:00")), /* @__PURE__ */ React__default.createElement("div", {
18217
18375
  className: isCanPlay ? "custom-button-group" : "custom-button-group-disable"
18218
18376
  }, /* @__PURE__ */ React__default.createElement(Button$1, {
18219
18377
  type: "primary",
@@ -18229,15 +18387,11 @@ const Audio = (props) => {
18229
18387
  type: "primary",
18230
18388
  size: "small",
18231
18389
  onClick: handleForward
18232
- }, locale.audio.forward || "\u5FEB\u8FDB"), /* @__PURE__ */ React__default.createElement(Button$1, {
18233
- type: AudioRef.current && AudioRef.current.muted ? "default" : "primary",
18234
- size: "small",
18235
- onClick: handleMute
18236
- }, locale.audio.mute || "\u9759\u97F3")));
18390
+ }, locale.audio.forward || "\u5FEB\u8FDB")));
18237
18391
  };
18238
18392
  const renderNone = () => {
18239
18393
  return /* @__PURE__ */ React__default.createElement("div", {
18240
- className: b2("none-container"),
18394
+ className: b("none-container"),
18241
18395
  onClick: handleStatusChange
18242
18396
  }, children);
18243
18397
  };
@@ -18253,43 +18407,11 @@ const Audio = (props) => {
18253
18407
  return null;
18254
18408
  }
18255
18409
  };
18256
- const handleCanplay = (e2) => {
18257
- setIsCanPlay(true);
18258
- if (props.autoplay && !playing) {
18259
- AudioRef && AudioRef.current && AudioRef.current.play();
18260
- }
18261
- if (AudioRef.current) {
18262
- statusRef.current.second = AudioRef.current.duration || 0;
18263
- props.onCanPlay && props.onCanPlay(e2);
18264
- }
18265
- };
18266
- const onTimeupdate = (e2) => {
18267
- const time = parseInt(e2.target.currentTime);
18268
- const formated = formatSeconds(`${time}`);
18269
- statusRef.current.currentDuration = formated;
18270
- setPercent(time / statusRef.current.second * 100);
18271
- setCurrentDuration(formated);
18272
- statusRef.current.currentTime = time;
18273
- };
18274
18410
  return /* @__PURE__ */ React__default.createElement("div", {
18275
- className: `${b2()} ${className}`,
18411
+ className: `${b()} ${className}`,
18276
18412
  style,
18277
18413
  ...rest
18278
- }, renderAudio(), /* @__PURE__ */ React__default.createElement("audio", {
18279
- className: "audioMain",
18280
- controls: type === "controls",
18281
- ref: AudioRef,
18282
- src: url,
18283
- muted,
18284
- preload,
18285
- loop: loop2,
18286
- onPause: (e2) => handlePause(e2),
18287
- onEnded: (e2) => handleEnded(e2),
18288
- onCanPlay: (e2) => handleCanplay(e2),
18289
- onTimeUpdate: (e2) => onTimeupdate(e2)
18290
- }, /* @__PURE__ */ React__default.createElement("track", {
18291
- kind: "captions"
18292
- })));
18414
+ }, renderAudio());
18293
18415
  };
18294
18416
  Audio.defaultProps = defaultProps$b;
18295
18417
  Audio.displayName = "NutAudio";
@@ -19106,8 +19228,13 @@ const Address = (props) => {
19106
19228
  onTabChecked,
19107
19229
  style,
19108
19230
  className,
19231
+ iconClassPrefix,
19232
+ iconFontClassName,
19109
19233
  ...rest
19110
- } = { ...defaultProps$6, ...props };
19234
+ } = {
19235
+ ...defaultProps$6,
19236
+ ...props
19237
+ };
19111
19238
  const b2 = cn("address");
19112
19239
  const [privateType, setPrivateType] = useState(type);
19113
19240
  const [tabName] = useState(["province", "city", "country", "town"]);
@@ -19200,8 +19327,8 @@ const Address = (props) => {
19200
19327
  className: "arrow-back",
19201
19328
  onClick: onSwitchModule
19202
19329
  }, privateType === "custom" && backBtnIcon && /* @__PURE__ */ React__default.createElement(Icon$1, {
19203
- classPrefix: props.iconClassPrefix,
19204
- fontClassName: props.iconFontClassName,
19330
+ classPrefix: iconClassPrefix,
19331
+ fontClassName: iconFontClassName,
19205
19332
  name: backBtnIcon,
19206
19333
  color: "#cccccc"
19207
19334
  })), /* @__PURE__ */ React__default.createElement("div", {
@@ -19209,8 +19336,8 @@ const Address = (props) => {
19209
19336
  }, privateType === "custom" ? locale.address.selectRegion || customAddressTitle : locale.address.deliveryTo || existAddressTitle), /* @__PURE__ */ React__default.createElement("div", {
19210
19337
  onClick: () => handClose()
19211
19338
  }, closeBtnIcon && /* @__PURE__ */ React__default.createElement(Icon$1, {
19212
- classPrefix: props.iconClassPrefix,
19213
- fontClassName: props.iconFontClassName,
19339
+ classPrefix: iconClassPrefix,
19340
+ fontClassName: iconFontClassName,
19214
19341
  name: closeBtnIcon,
19215
19342
  color: "#cccccc",
19216
19343
  size: "18px"
@@ -19287,7 +19414,6 @@ const InternalBarrage = (props, ref) => {
19287
19414
  };
19288
19415
  const barrageBody = useRef(null);
19289
19416
  const barrageContainer = useRef(null);
19290
- const barrageCWidth = useRef(0);
19291
19417
  const timer = useRef(0);
19292
19418
  const index2 = useRef(0);
19293
19419
  const b2 = cn("barrage");
@@ -19299,10 +19425,7 @@ const InternalBarrage = (props, ref) => {
19299
19425
  }
19300
19426
  }));
19301
19427
  useEffect(() => {
19302
- if (barrageBody.current) {
19303
- barrageCWidth.current = barrageBody.current.offsetWidth;
19304
- run();
19305
- }
19428
+ run();
19306
19429
  return () => {
19307
19430
  clearInterval(timer.current);
19308
19431
  };
@@ -19321,12 +19444,11 @@ const InternalBarrage = (props, ref) => {
19321
19444
  el.classList.add("barrage-item");
19322
19445
  barrageContainer.current.appendChild(el);
19323
19446
  Taro.createSelectorQuery().select(".barrage-item").boundingClientRect((res) => {
19324
- res == null ? void 0 : res.width;
19447
+ console.log("res", res);
19325
19448
  const height = res == null ? void 0 : res.height;
19326
19449
  el.classList.add("move");
19327
19450
  el.style.animationDuration = `${speeds}ms`;
19328
19451
  el.style.top = `${_index % rows * (height + top) + 20}px`;
19329
- el.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
19330
19452
  el.dataset.index = `${_index}`;
19331
19453
  el.addEventListener("animationend", () => {
19332
19454
  barrageContainer.current.removeChild(el);
@@ -19729,4 +19851,4 @@ const TimeSelect = (props) => {
19729
19851
  };
19730
19852
  TimeSelect.defaultProps = defaultProps;
19731
19853
  TimeSelect.displayName = "NutTimeSelect";
19732
- export { ActionSheet, Address, AnimatingNumbers, Audio, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button$1 as Button, Calendar, CalendarItem, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator$1 as Elevator, Empty, FixedNav, Grid, GridItem, Icon$1 as Icon, ImagePreview, Indicator, Infiniteloading, Input, InputNumber, Layout, Menu, MenuItem, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Picker, Popover, Popup, Price, Progress, PullToRefresh, Radio, RadioGroup, Range, Rate, Row, SearchBar, ShortPassword, SideNavBar, SideNavBarItem, Signature, Skeleton, Step, Steps, SubSideNavBar, Swipe, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Table, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };
19854
+ export { ActionSheet, Address, AnimatingNumbers, Audio, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button$1 as Button, Calendar, CalendarItem, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator$1 as Elevator, Empty, FixedNav, Grid, GridItem, Icon$1 as Icon, ImagePreview, Indicator, Infiniteloading, Input, InputNumber, Layout, Menu, MenuItem, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Picker, Popover, Popup, Price, Progress, PullToRefresh, Radio, RadioGroup, Range, Rate, Row, SearchBar, ShortPassword, SideNavBar, SideNavBarItem, Signature, Skeleton, Step, Steps, Sticky, SubSideNavBar, Swipe, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Table, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };