@nutui/nutui-react-taro 3.0.8 → 3.0.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/CHANGELOG.md +13 -14
  2. package/dist/cjs/hooks/index.d.ts +14 -0
  3. package/dist/cjs/hooks/index.js +19 -0
  4. package/dist/cjs/hooks/{use-custom-event.js → taro/use-custom-event.js} +1 -1
  5. package/dist/cjs/hooks/{use-lock-scoll-taro.js → taro/use-lock-scoll.js} +1 -1
  6. package/dist/cjs/hooks/use-memo.d.ts +1 -1
  7. package/dist/cjs/hooks/use-memo.js +1 -1
  8. package/dist/cjs/hooks/use-refs.d.ts +1 -1
  9. package/dist/cjs/hooks/use-refs.js +1 -1
  10. package/dist/cjs/hooks/use-uuid.d.ts +1 -1
  11. package/dist/cjs/hooks/use-uuid.js +1 -1
  12. package/dist/cjs/hooks/use-watch.d.ts +2 -2
  13. package/dist/cjs/hooks/use-watch.js +2 -3
  14. package/dist/cjs/packages/address/address.d.ts +1 -1
  15. package/dist/cjs/packages/avatar/avatar.js +6 -6
  16. package/dist/cjs/packages/avatarcropper/avatarcropper.js +1 -1
  17. package/dist/cjs/packages/badge/badge.js +5 -5
  18. package/dist/cjs/packages/barrage/barrage.js +3 -3
  19. package/dist/cjs/packages/button/button.js +3 -3
  20. package/dist/cjs/packages/cell/cell.js +2 -2
  21. package/dist/cjs/packages/col/col.js +3 -3
  22. package/dist/cjs/packages/collapseitem/collapseitem.js +4 -4
  23. package/dist/cjs/packages/configprovider/configprovider.js +2 -2
  24. package/dist/cjs/packages/countdown/countdown.js +2 -2
  25. package/dist/cjs/packages/dialog/dialog.js +5 -5
  26. package/dist/cjs/packages/drag/drag.js +5 -5
  27. package/dist/cjs/packages/elevator/elevator.js +4 -4
  28. package/dist/cjs/packages/ellipsis/ellipsis.js +4 -4
  29. package/dist/cjs/packages/griditem/griditem.js +4 -4
  30. package/dist/cjs/packages/hoverbutton/hoverbutton.js +2 -2
  31. package/dist/cjs/packages/hoverbuttonitem/hoverbuttonitem.js +2 -2
  32. package/dist/cjs/packages/image/image.js +2 -2
  33. package/dist/cjs/packages/indicator/indicator.js +2 -2
  34. package/dist/cjs/packages/infiniteloading/infiniteloading.js +2 -2
  35. package/dist/cjs/packages/lottie/lottiemp.js +3 -3
  36. package/dist/cjs/packages/menuitem/menuitem.js +4 -4
  37. package/dist/cjs/packages/noticebar/noticebar.js +4 -4
  38. package/dist/cjs/packages/notify/notify.js +5 -5
  39. package/dist/cjs/packages/nutui.react.build.d.ts +2 -0
  40. package/dist/cjs/packages/nutui.react.build.js +2 -0
  41. package/dist/cjs/packages/nutui.react.d.ts +2 -0
  42. package/dist/cjs/packages/nutui.react.js +2 -0
  43. package/dist/cjs/packages/overlay/overlay.js +2 -2
  44. package/dist/cjs/packages/pagination/pagination.js +3 -3
  45. package/dist/cjs/packages/picker/picker.js +2 -2
  46. package/dist/cjs/packages/pickerview/pickerroller.js +7 -7
  47. package/dist/cjs/packages/popover/popover.js +15 -15
  48. package/dist/cjs/packages/popup/popup.js +4 -4
  49. package/dist/cjs/packages/price/price.js +2 -2
  50. package/dist/cjs/packages/progress/progress.js +13 -13
  51. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +4 -4
  52. package/dist/cjs/packages/range/range.js +13 -13
  53. package/dist/cjs/packages/rate/rate.js +4 -4
  54. package/dist/cjs/packages/sidebar/sidebar.js +2 -2
  55. package/dist/cjs/packages/sticky/sticky.js +7 -7
  56. package/dist/cjs/packages/swipe/swipe.js +10 -10
  57. package/dist/cjs/packages/swiper/swiper.js +4 -4
  58. package/dist/cjs/packages/tabs/tabs.js +2 -2
  59. package/dist/cjs/packages/toast/toast.js +3 -3
  60. package/dist/cjs/packages/tour/tour.js +2 -2
  61. package/dist/cjs/packages/trendarrow/trendarrow.js +3 -3
  62. package/dist/cjs/packages/virtuallist/virtuallist.js +1 -1
  63. package/dist/cjs/utils/clamp.d.ts +1 -0
  64. package/dist/cjs/utils/clamp.js +13 -0
  65. package/dist/cjs/utils/event-mocker.d.ts +21 -0
  66. package/dist/cjs/utils/index.d.ts +34 -6
  67. package/dist/cjs/utils/index.js +35 -54
  68. package/dist/cjs/utils/interceptor.js +2 -2
  69. package/dist/cjs/utils/is-function.d.ts +1 -0
  70. package/dist/cjs/utils/is-function.js +14 -0
  71. package/dist/cjs/utils/is-object.d.ts +1 -0
  72. package/dist/cjs/utils/is-object.js +14 -0
  73. package/dist/cjs/utils/is-promise.d.ts +1 -0
  74. package/dist/cjs/utils/is-promise.js +15 -0
  75. package/dist/cjs/utils/lru.d.ts +1 -1
  76. package/dist/cjs/utils/lru.js +1 -1
  77. package/dist/cjs/utils/merge.d.ts +0 -1
  78. package/dist/cjs/utils/merge.js +0 -4
  79. package/dist/cjs/utils/prevent-default.d.ts +1 -0
  80. package/dist/cjs/utils/prevent-default.js +18 -0
  81. package/dist/cjs/utils/raf.d.ts +0 -1
  82. package/dist/cjs/utils/raf.js +3 -6
  83. package/dist/{es/utils → cjs/utils/taro}/add-color-for-harmony.d.ts +1 -2
  84. package/dist/cjs/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +5 -11
  85. package/dist/cjs/utils/taro/get-rect-by-id.d.ts +1 -0
  86. package/dist/cjs/{hooks/use-taro-rect.js → utils/taro/get-rect-by-id.js} +3 -3
  87. package/dist/cjs/utils/{get-rect-by-taro.d.ts → taro/get-rect.d.ts} +1 -1
  88. package/dist/cjs/utils/{get-rect-by-taro.js → taro/get-rect.js} +9 -10
  89. package/dist/cjs/utils/taro/px-transform.d.ts +1 -0
  90. package/dist/cjs/utils/{px-transform.js → taro/px-transform.js} +3 -3
  91. package/dist/cjs/utils/upper-case-first.d.ts +1 -0
  92. package/dist/cjs/utils/upper-case-first.js +17 -0
  93. package/dist/es/hooks/index.d.ts +14 -0
  94. package/dist/es/hooks/index.js +14 -0
  95. package/dist/es/hooks/{use-custom-event.js → taro/use-custom-event.js} +1 -1
  96. package/dist/es/hooks/{use-lock-scoll-taro.js → taro/use-lock-scoll.js} +1 -1
  97. package/dist/es/hooks/use-memo.d.ts +1 -1
  98. package/dist/es/hooks/use-memo.js +1 -1
  99. package/dist/es/hooks/use-refs.d.ts +1 -1
  100. package/dist/es/hooks/use-refs.js +1 -1
  101. package/dist/es/hooks/use-uuid.d.ts +1 -1
  102. package/dist/es/hooks/use-uuid.js +1 -1
  103. package/dist/es/hooks/use-watch.d.ts +2 -2
  104. package/dist/es/hooks/use-watch.js +1 -2
  105. package/dist/es/packages/address/address.d.ts +1 -1
  106. package/dist/es/packages/avatar/avatar.js +2 -2
  107. package/dist/es/packages/avatarcropper/avatarcropper.js +1 -1
  108. package/dist/es/packages/badge/badge.js +2 -2
  109. package/dist/es/packages/barrage/barrage.js +3 -3
  110. package/dist/es/packages/button/button.js +1 -1
  111. package/dist/es/packages/cell/cell.js +1 -1
  112. package/dist/es/packages/col/col.js +1 -1
  113. package/dist/es/packages/collapseitem/collapseitem.js +3 -3
  114. package/dist/es/packages/configprovider/configprovider.js +1 -1
  115. package/dist/es/packages/countdown/countdown.js +1 -1
  116. package/dist/es/packages/dialog/dialog.js +3 -3
  117. package/dist/es/packages/drag/drag.js +4 -4
  118. package/dist/es/packages/elevator/elevator.js +2 -2
  119. package/dist/es/packages/ellipsis/ellipsis.js +4 -4
  120. package/dist/es/packages/griditem/griditem.js +1 -1
  121. package/dist/es/packages/hoverbutton/hoverbutton.js +1 -1
  122. package/dist/es/packages/hoverbuttonitem/hoverbuttonitem.js +1 -1
  123. package/dist/es/packages/image/image.js +1 -1
  124. package/dist/es/packages/indicator/indicator.js +1 -1
  125. package/dist/es/packages/infiniteloading/infiniteloading.js +1 -1
  126. package/dist/es/packages/lottie/lottiemp.js +2 -2
  127. package/dist/es/packages/menuitem/menuitem.js +4 -4
  128. package/dist/es/packages/noticebar/noticebar.js +4 -4
  129. package/dist/es/packages/notify/notify.js +3 -3
  130. package/dist/es/packages/nutui.react.build.d.ts +2 -0
  131. package/dist/es/packages/nutui.react.build.js +2 -0
  132. package/dist/es/packages/overlay/overlay.js +1 -1
  133. package/dist/es/packages/pagination/pagination.js +1 -1
  134. package/dist/es/packages/picker/picker.js +1 -1
  135. package/dist/es/packages/pickerview/pickerroller.js +4 -4
  136. package/dist/es/packages/popover/popover.js +6 -6
  137. package/dist/es/packages/popup/popup.js +2 -2
  138. package/dist/es/packages/price/price.js +1 -1
  139. package/dist/es/packages/progress/progress.js +3 -3
  140. package/dist/es/packages/pulltorefresh/pulltorefresh.js +2 -2
  141. package/dist/es/packages/range/range.js +5 -5
  142. package/dist/es/packages/rate/rate.js +3 -3
  143. package/dist/es/packages/sidebar/sidebar.js +1 -1
  144. package/dist/es/packages/sticky/sticky.js +6 -6
  145. package/dist/es/packages/swipe/swipe.js +7 -7
  146. package/dist/es/packages/swiper/swiper.js +1 -1
  147. package/dist/es/packages/tabs/tabs.js +1 -1
  148. package/dist/es/packages/toast/toast.js +2 -2
  149. package/dist/es/packages/tour/tour.js +2 -2
  150. package/dist/es/packages/trendarrow/trendarrow.js +1 -1
  151. package/dist/es/packages/virtuallist/virtuallist.js +1 -1
  152. package/dist/es/utils/clamp.d.ts +1 -0
  153. package/dist/es/utils/clamp.js +3 -0
  154. package/dist/es/utils/event-mocker.d.ts +21 -0
  155. package/dist/es/utils/index.d.ts +34 -6
  156. package/dist/es/utils/index.js +34 -29
  157. package/dist/es/utils/interceptor.js +1 -1
  158. package/dist/es/utils/is-function.d.ts +1 -0
  159. package/dist/es/utils/is-function.js +4 -0
  160. package/dist/es/utils/is-object.d.ts +1 -0
  161. package/dist/es/utils/is-object.js +4 -0
  162. package/dist/es/utils/is-promise.d.ts +1 -0
  163. package/dist/es/utils/is-promise.js +5 -0
  164. package/dist/es/utils/lru.d.ts +1 -1
  165. package/dist/es/utils/lru.js +1 -2
  166. package/dist/es/utils/merge.d.ts +0 -1
  167. package/dist/es/utils/merge.js +0 -1
  168. package/dist/es/utils/prevent-default.d.ts +1 -0
  169. package/dist/es/utils/prevent-default.js +8 -0
  170. package/dist/es/utils/raf.d.ts +0 -1
  171. package/dist/es/utils/raf.js +1 -1
  172. package/dist/{cjs/utils → es/utils/taro}/add-color-for-harmony.d.ts +1 -2
  173. package/dist/es/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +2 -3
  174. package/dist/es/utils/taro/get-rect-by-id.d.ts +1 -0
  175. package/dist/es/{hooks/use-taro-rect.js → utils/taro/get-rect-by-id.js} +1 -1
  176. package/dist/es/utils/{get-rect-by-taro.d.ts → taro/get-rect.d.ts} +1 -1
  177. package/dist/es/utils/{get-rect-by-taro.js → taro/get-rect.js} +4 -4
  178. package/dist/es/utils/taro/px-transform.d.ts +1 -0
  179. package/dist/es/utils/{px-transform.js → taro/px-transform.js} +2 -2
  180. package/dist/es/utils/upper-case-first.d.ts +1 -0
  181. package/dist/es/utils/upper-case-first.js +7 -0
  182. package/dist/nutui.react.umd.js +506 -217
  183. package/dist/style.css +1 -1
  184. package/dist/style.scss +48 -48
  185. package/package.json +1 -1
  186. package/dist/cjs/hooks/use-taro-rect.d.ts +0 -1
  187. package/dist/cjs/utils/px-transform.d.ts +0 -1
  188. package/dist/es/hooks/use-taro-rect.d.ts +0 -1
  189. package/dist/es/utils/px-transform.d.ts +0 -1
  190. /package/dist/cjs/hooks/{use-custom-event.d.ts → taro/use-custom-event.d.ts} +0 -0
  191. /package/dist/cjs/hooks/{use-lock-scoll-taro.d.ts → taro/use-lock-scoll.d.ts} +0 -0
  192. /package/dist/cjs/utils/{test/event.js → event-mocker.js} +0 -0
  193. /package/dist/cjs/{hooks/use-client-rect.d.ts → utils/get-rect.d.ts} +0 -0
  194. /package/dist/cjs/{hooks/use-client-rect.js → utils/get-rect.js} +0 -0
  195. /package/dist/cjs/utils/{get-system-info.d.ts → taro/get-system-info.d.ts} +0 -0
  196. /package/dist/cjs/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
  197. /package/dist/cjs/utils/{platform-taro.d.ts → taro/platform.d.ts} +0 -0
  198. /package/dist/cjs/utils/{platform-taro.js → taro/platform.js} +0 -0
  199. /package/dist/es/hooks/{use-custom-event.d.ts → taro/use-custom-event.d.ts} +0 -0
  200. /package/dist/es/hooks/{use-lock-scoll-taro.d.ts → taro/use-lock-scoll.d.ts} +0 -0
  201. /package/dist/es/utils/{test/event.js → event-mocker.js} +0 -0
  202. /package/dist/es/{hooks/use-client-rect.d.ts → utils/get-rect.d.ts} +0 -0
  203. /package/dist/es/{hooks/use-client-rect.js → utils/get-rect.js} +0 -0
  204. /package/dist/es/utils/{get-system-info.d.ts → taro/get-system-info.d.ts} +0 -0
  205. /package/dist/es/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
  206. /package/dist/es/utils/{platform-taro.d.ts → taro/platform.d.ts} +0 -0
  207. /package/dist/es/utils/{platform-taro.js → taro/platform.js} +0 -0
@@ -4,7 +4,7 @@ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_
4
4
  import React, { useContext } from "react";
5
5
  import classNames from "classnames";
6
6
  import { View } from "@tarojs/components";
7
- import pxTransform from "../../utils/px-transform";
7
+ import { pxTransform } from "../../utils/taro/px-transform";
8
8
  import GridContext from "../grid/context";
9
9
  var defaultProps = {
10
10
  text: '',
@@ -7,7 +7,7 @@ import { ComponentDefaults } from "../../utils/typings";
7
7
  import { useRtl } from "../configprovider/index";
8
8
  import HoverButtonItem from "../hoverbuttonitem/index";
9
9
  import SafeArea from "../safearea/index";
10
- import pxTransform from "../../utils/px-transform";
10
+ import { pxTransform } from "../../utils/taro/px-transform";
11
11
  import { UI_BOTTOM_DISTANCE } from "./utils";
12
12
  var defaultProps = _object_spread({}, ComponentDefaults);
13
13
  var classPrefix = 'nut-hoverbutton';
@@ -6,7 +6,7 @@ import React, { useMemo, useState } from "react";
6
6
  import classNames from "classnames";
7
7
  import { View } from "@tarojs/components";
8
8
  import { ComponentDefaults } from "../../utils/typings";
9
- import { harmony } from "../../utils/platform-taro";
9
+ import { harmony } from "../../utils/taro/platform";
10
10
  import { getIcon } from "./utils";
11
11
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
12
12
  icon: null,
@@ -8,7 +8,7 @@ import Taro from "@tarojs/taro";
8
8
  import { Image as TImage, View } from "@tarojs/components";
9
9
  import { Image as ImageIcon, ImageError } from "@nutui/icons-react-taro";
10
10
  import classNames from "classnames";
11
- import pxTransform from "../../utils/px-transform";
11
+ import { pxTransform } from "../../utils/taro/px-transform";
12
12
  var defaultProps = {
13
13
  src: '',
14
14
  error: true,
@@ -4,7 +4,7 @@ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_
4
4
  import React from "react";
5
5
  import classNames from "classnames";
6
6
  import { View } from "@tarojs/components";
7
- import pxTransform from "../../utils/px-transform";
7
+ import { pxTransform } from "../../utils/taro/px-transform";
8
8
  var defaultProps = {
9
9
  total: 2,
10
10
  current: 0,
@@ -10,7 +10,7 @@ import { ScrollView, View } from "@tarojs/components";
10
10
  import { createSelectorQuery } from "@tarojs/taro";
11
11
  import { useConfig } from "../configprovider/index";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
- import pxTransform from "../../utils/px-transform";
13
+ import { pxTransform } from "../../utils/taro/px-transform";
14
14
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
15
15
  type: 'default',
16
16
  hasMore: true,
@@ -1,8 +1,8 @@
1
1
  import React, { useImperativeHandle, useRef } from "react";
2
2
  import { createSelectorQuery, getEnv, useReady, useUnload } from "@tarojs/taro";
3
3
  import lottie from "@nutui/lottie-miniprogram";
4
- import { getWindowInfo } from "../../utils/get-system-info";
5
- import useUuid from "../../hooks/use-uuid";
4
+ import { getWindowInfo } from "../../utils/taro/get-system-info";
5
+ import { useUuid } from "../../hooks/use-uuid";
6
6
  export var Lottie = /*#__PURE__*/ React.forwardRef(function(props, ref) {
7
7
  var uuid = useUuid();
8
8
  var id = "nutLottie-".concat(uuid);
@@ -10,9 +10,9 @@ import { usePageScroll } from "@tarojs/taro";
10
10
  import { View } from "@tarojs/components";
11
11
  import { CSSTransition } from "react-transition-group";
12
12
  import { Check } from "@nutui/icons-react-taro";
13
- import { getWindowInfo } from "../../utils/get-system-info";
13
+ import { getWindowInfo } from "../../utils/taro/get-system-info";
14
14
  import { Overlay } from "../overlay/overlay";
15
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
15
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
16
16
  import { ComponentDefaults } from "../../utils/typings";
17
17
  import { usePropsValue } from "../../hooks/use-props-value";
18
18
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -56,7 +56,7 @@ export var MenuItem = /*#__PURE__*/ forwardRef(function(props, ref) {
56
56
  p = parent.menuRef.current;
57
57
  return [
58
58
  4,
59
- getRectByTaro(p)
59
+ getRectInMultiPlatform(p)
60
60
  ];
61
61
  case 1:
62
62
  rect = _state.sent();
@@ -85,7 +85,7 @@ export var MenuItem = /*#__PURE__*/ forwardRef(function(props, ref) {
85
85
  var updateItemOffset = useCallback(function() {
86
86
  if (!parent.lockScroll) return;
87
87
  var p = parent.menuRef.current;
88
- getRectByTaro(p).then(function(rect) {
88
+ getRectInMultiPlatform(p).then(function(rect) {
89
89
  if (rect) {
90
90
  setPosition({
91
91
  height: rect.height,
@@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useRef, useState } from "react";
8
8
  import { View } from "@tarojs/components";
9
9
  import { Close, Notice } from "@nutui/icons-react-taro";
10
10
  import classNames from "classnames";
11
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
11
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
13
  import { useRtl } from "../configprovider/index";
14
14
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -129,13 +129,13 @@ export var NoticeBar = function(props) {
129
129
  }
130
130
  return [
131
131
  4,
132
- getRectByTaro(wrapRef.current)
132
+ getRectInMultiPlatform(wrapRef.current)
133
133
  ];
134
134
  case 1:
135
135
  warpRes = _state.sent();
136
136
  return [
137
137
  4,
138
- getRectByTaro(contentRef.current)
138
+ getRectInMultiPlatform(contentRef.current)
139
139
  ];
140
140
  case 2:
141
141
  contentRes = _state.sent();
@@ -228,7 +228,7 @@ export var NoticeBar = function(props) {
228
228
  case 0:
229
229
  return [
230
230
  4,
231
- getRectByTaro(container === null || container === void 0 ? void 0 : container.current)
231
+ getRectInMultiPlatform(container === null || container === void 0 ? void 0 : container.current)
232
232
  ];
233
233
  case 1:
234
234
  rects = _state.sent();
@@ -7,10 +7,10 @@ import classNames from "classnames";
7
7
  import { CSSTransition } from "react-transition-group";
8
8
  import { View } from "@tarojs/components";
9
9
  import { Close } from "@nutui/icons-react-taro";
10
- import { web } from "../../utils/platform-taro";
11
- import pxTransform from "../../utils/px-transform";
10
+ import { web } from "../../utils/taro/platform";
11
+ import { pxTransform } from "../../utils/taro/px-transform";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
- import { customEvents, useCustomEvent, useCustomEventsPath } from "../../hooks/use-custom-event";
13
+ import { customEvents, useCustomEvent, useCustomEventsPath } from "../../hooks/taro/use-custom-event";
14
14
  import { mergeProps } from "../../utils/merge-props";
15
15
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
16
16
  id: '',
@@ -207,4 +207,6 @@ export * from "./trendarrow/index";
207
207
  import WaterMark from "./watermark/index";
208
208
  export * from "./watermark/index";
209
209
  export * from "../types";
210
+ export * from "../utils/index";
211
+ export * from "../hooks/index";
210
212
  export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Divider, Grid, GridItem, Layout, Col, Row, SafeArea, Space, Sticky, BackTop, Elevator, FixedNav, HoverButton, HoverButtonItem, NavBar, SideBar, SideBarItem, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, DatePickerView, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, PickerView, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, ResultPage, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Lottie, Pagination, Price, Progress, Segmented, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, AvatarCropper, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
@@ -207,4 +207,6 @@ export * from "./trendarrow/index";
207
207
  import WaterMark from "./watermark/index";
208
208
  export * from "./watermark/index";
209
209
  export * from "../types";
210
+ export * from "../utils/index";
211
+ export * from "../hooks/index";
210
212
  export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Divider, Grid, GridItem, Layout, Col, Row, SafeArea, Space, Sticky, BackTop, Elevator, FixedNav, HoverButton, HoverButtonItem, NavBar, SideBar, SideBarItem, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, DatePickerView, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, PickerView, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, ResultPage, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Lottie, Pagination, Price, Progress, Segmented, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, AvatarCropper, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
@@ -7,7 +7,7 @@ import { CSSTransition } from "react-transition-group";
7
7
  import classNames from "classnames";
8
8
  import { View } from "@tarojs/components";
9
9
  import { ComponentDefaults } from "../../utils/typings";
10
- import { useLockScrollTaro } from "../../hooks/use-lock-scoll-taro";
10
+ import { useLockScrollTaro } from "../../hooks/taro/use-lock-scoll";
11
11
  export var defaultOverlayProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
12
12
  zIndex: 1000,
13
13
  duration: 300,
@@ -9,7 +9,7 @@ import { View } from "@tarojs/components";
9
9
  import { useConfig } from "../configprovider/index";
10
10
  import { usePropsValue } from "../../hooks/use-props-value";
11
11
  import { ComponentDefaults } from "../../utils/typings";
12
- import addColorForHarmony from "../../utils/add-color-for-harmony";
12
+ import { addColorForHarmony } from "../../utils/taro/add-color-for-harmony";
13
13
  import { usePagination } from "../../hooks/use-pagination";
14
14
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
15
15
  defaultValue: 1,
@@ -10,7 +10,7 @@ import isEqual from "react-fast-compare";
10
10
  import PickerView from "../pickerview/index";
11
11
  import Popup from "../popup/index";
12
12
  import SafeArea from "../safearea/index";
13
- import useRefs from "../../hooks/use-refs";
13
+ import { useRefs } from "../../hooks/use-refs";
14
14
  import { useConfig } from "../configprovider/index";
15
15
  import { usePropsValue } from "../../hooks/use-props-value";
16
16
  import { ComponentDefaults } from "../../utils/typings";
@@ -7,11 +7,11 @@ import classNames from "classnames";
7
7
  import { View } from "@tarojs/components";
8
8
  import { useTouch } from "../../hooks/use-touch";
9
9
  import { passiveSupported } from "../../utils/supports-passive";
10
- import { web } from "../../utils/platform-taro";
10
+ import { web } from "../../utils/taro/platform";
11
11
  import { preventDefault } from "../../utils";
12
12
  import { momentum, useStyles } from "./utils";
13
- import useUuid from "../../hooks/use-uuid";
14
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
13
+ import { useUuid } from "../../hooks/use-uuid";
14
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
15
15
  var InternalPickerRoller = function(props, ref) {
16
16
  var _props_keyIndex = props.keyIndex, keyIndex = _props_keyIndex === void 0 ? 0 : _props_keyIndex, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_threeDimensional = props.threeDimensional, threeDimensional = _props_threeDimensional === void 0 ? true : _props_threeDimensional, _props_duration = props.duration, duration = _props_duration === void 0 ? 1000 : _props_duration, onSelect = props.onSelect, _props_renderLabel = props.renderLabel, renderLabel = _props_renderLabel === void 0 ? function(item) {
17
17
  return item.label;
@@ -125,7 +125,7 @@ var InternalPickerRoller = function(props, ref) {
125
125
  ]);
126
126
  return [
127
127
  4,
128
- getRectByTaro(placeholderRef.current)
128
+ getRectInMultiPlatform(placeholderRef.current)
129
129
  ];
130
130
  case 1:
131
131
  placeholder = _state.sent();
@@ -11,11 +11,11 @@ import { nextTick } from "@tarojs/taro";
11
11
  import { Text, View } from "@tarojs/components";
12
12
  import { ArrowRadius } from "@nutui/icons-react-taro";
13
13
  import Popup from "../popup/index";
14
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
14
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
15
15
  import { ComponentDefaults } from "../../utils/typings";
16
16
  import { useRtl } from "../configprovider/index";
17
- import pxTransform from "../../utils/px-transform";
18
- import useUuid from "../../hooks/use-uuid";
17
+ import { pxTransform } from "../../utils/taro/px-transform";
18
+ import { useUuid } from "../../hooks/use-uuid";
19
19
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
20
20
  list: [],
21
21
  theme: 'light',
@@ -88,7 +88,7 @@ export var Popover = function(props) {
88
88
  ];
89
89
  return [
90
90
  4,
91
- getRectByTaro(document.querySelector("#".concat(targetId)), targetId)
91
+ getRectInMultiPlatform(document.querySelector("#".concat(targetId)), targetId)
92
92
  ];
93
93
  case 1:
94
94
  _tmp = _state.sent();
@@ -99,7 +99,7 @@ export var Popover = function(props) {
99
99
  case 2:
100
100
  return [
101
101
  4,
102
- getRectByTaro(popoverRef.current, popoverId)
102
+ getRectInMultiPlatform(popoverRef.current, popoverId)
103
103
  ];
104
104
  case 3:
105
105
  _tmp = _state.sent();
@@ -140,7 +140,7 @@ export var Popover = function(props) {
140
140
  case 0:
141
141
  return [
142
142
  4,
143
- getRectByTaro(popoverContentRef.current)
143
+ getRectInMultiPlatform(popoverContentRef.current)
144
144
  ];
145
145
  case 1:
146
146
  rectContent = _state.sent();
@@ -10,8 +10,8 @@ import { Close } from "@nutui/icons-react-taro";
10
10
  import { View } from "@tarojs/components";
11
11
  import { defaultOverlayProps } from "../overlay/overlay";
12
12
  import Overlay from "../overlay/index";
13
- import { useLockScrollTaro } from "../../hooks/use-lock-scoll-taro";
14
- import { harmony } from "../../utils/platform-taro";
13
+ import { useLockScrollTaro } from "../../hooks/taro/use-lock-scoll";
14
+ import { harmony } from "../../utils/taro/platform";
15
15
  var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps), {
16
16
  position: 'center',
17
17
  transition: '',
@@ -6,7 +6,7 @@ import { Text, View } from "@tarojs/components";
6
6
  import classNames from "classnames";
7
7
  import { ComponentDefaults } from "../../utils/typings";
8
8
  import { useRtl } from "../configprovider/index";
9
- import { harmony } from "../../utils/platform-taro";
9
+ import { harmony } from "../../utils/taro/platform";
10
10
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
11
11
  color: 'primary',
12
12
  price: 0,
@@ -7,11 +7,11 @@ import React, { useEffect, useRef, useState } from "react";
7
7
  import classNames from "classnames";
8
8
  import Taro from "@tarojs/taro";
9
9
  import { View } from "@tarojs/components";
10
- import pxTransform from "../../utils/px-transform";
10
+ import { pxTransform } from "../../utils/taro/px-transform";
11
11
  import { ComponentDefaults } from "../../utils/typings";
12
12
  import { useRtl } from "../configprovider/index";
13
- import useUuid from "../../hooks/use-uuid";
14
- import { harmony, web } from "../../utils/platform-taro";
13
+ import { useUuid } from "../../hooks/use-uuid";
14
+ import { harmony, web } from "../../utils/taro/platform";
15
15
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
16
16
  percent: 0,
17
17
  showText: false,
@@ -14,8 +14,8 @@ import { useTouch } from "../../hooks/use-touch";
14
14
  import { rubberbandIfOutOfBounds } from "../../utils/rubberband";
15
15
  import { sleep } from "../../utils/sleep";
16
16
  import { ComponentDefaults } from "../../utils/typings";
17
- import pxTransform from "../../utils/px-transform";
18
- import { getDeviceInfo } from "../../utils/get-system-info";
17
+ import { pxTransform } from "../../utils/taro/px-transform";
18
+ import { getDeviceInfo } from "../../utils/taro/get-system-info";
19
19
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
20
20
  type: 'default',
21
21
  pullingText: '',
@@ -7,13 +7,13 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
7
7
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
8
8
  import classNames from "classnames";
9
9
  import { Text, View } from "@tarojs/components";
10
- import pxTransform from "../../utils/px-transform";
10
+ import { pxTransform } from "../../utils/taro/px-transform";
11
11
  import { useTouch } from "../../hooks/use-touch";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
13
  import { usePropsValue } from "../../hooks/use-props-value";
14
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
14
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
15
15
  import { useRtl } from "../configprovider/index";
16
- import { harmony } from "../../utils/platform-taro";
16
+ import { harmony } from "../../utils/taro/platform";
17
17
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
18
18
  range: false,
19
19
  min: 0,
@@ -242,7 +242,7 @@ export var Range = function(props) {
242
242
  setDragStatus('');
243
243
  return [
244
244
  4,
245
- getRectByTaro(root.current)
245
+ getRectInMultiPlatform(root.current)
246
246
  ];
247
247
  case 1:
248
248
  rect = _state.sent();
@@ -332,7 +332,7 @@ export var Range = function(props) {
332
332
  setDragStatus('draging');
333
333
  return [
334
334
  4,
335
- getRectByTaro(root.current)
335
+ getRectInMultiPlatform(root.current)
336
336
  ];
337
337
  case 1:
338
338
  rect = _state.sent();
@@ -9,8 +9,8 @@ import { useReady } from "@tarojs/taro";
9
9
  import { Text, View } from "@tarojs/components";
10
10
  import { ComponentDefaults } from "../../utils/typings";
11
11
  import { usePropsValue } from "../../hooks/use-props-value";
12
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
13
- import useRefs from "../../hooks/use-refs";
12
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
13
+ import { useRefs } from "../../hooks/use-refs";
14
14
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
15
15
  size: 'normal',
16
16
  showScore: false,
@@ -88,7 +88,7 @@ export var Rate = function(props) {
88
88
  var _loop = function(index) {
89
89
  var item = refs[index];
90
90
  if (item) {
91
- getRectByTaro(item).then(function(res) {
91
+ getRectInMultiPlatform(item).then(function(res) {
92
92
  rateRects.current[index] = res;
93
93
  });
94
94
  }
@@ -11,7 +11,7 @@ import { ComponentDefaults } from "../../utils/typings";
11
11
  import { usePropsValue } from "../../hooks/use-props-value";
12
12
  import { useForceUpdate } from "../../hooks/use-force-update";
13
13
  import raf from "../../utils/raf";
14
- import useUuid from "../../hooks/use-uuid";
14
+ import { useUuid } from "../../hooks/use-uuid";
15
15
  import SideBarItem from "../sidebaritem/index";
16
16
  import { mergeProps } from "../../utils/merge-props";
17
17
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -9,10 +9,10 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"
9
9
  import classNames from "classnames";
10
10
  import { getEnv, usePageScroll } from "@tarojs/taro";
11
11
  import { View } from "@tarojs/components";
12
- import { getWindowInfo } from "../../utils/get-system-info";
12
+ import { getWindowInfo } from "../../utils/taro/get-system-info";
13
13
  import { ComponentDefaults } from "../../utils/typings";
14
- import useWatch from "../../hooks/use-watch";
15
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
14
+ import { useWatch } from "../../hooks/use-watch";
15
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
16
16
  import { getScrollParent } from "../../utils/get-scroll-parent";
17
17
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
18
18
  position: 'top',
@@ -89,13 +89,13 @@ export var Sticky = function(props) {
89
89
  case 0:
90
90
  return [
91
91
  4,
92
- getRectByTaro(rootRef.current)
92
+ getRectInMultiPlatform(rootRef.current)
93
93
  ];
94
94
  case 1:
95
95
  curRootRect = _state.sent();
96
96
  return [
97
97
  4,
98
- getRectByTaro(stickyRef.current)
98
+ getRectInMultiPlatform(stickyRef.current)
99
99
  ];
100
100
  case 2:
101
101
  stickyRect = _state.sent();
@@ -119,7 +119,7 @@ export var Sticky = function(props) {
119
119
  ];
120
120
  return [
121
121
  4,
122
- getRectByTaro(container.current)
122
+ getRectInMultiPlatform(container.current)
123
123
  ];
124
124
  case 3:
125
125
  containerRect = _state.sent();
@@ -8,11 +8,11 @@ import classNames from "classnames";
8
8
  import { View } from "@tarojs/components";
9
9
  import { nextTick, useReady } from "@tarojs/taro";
10
10
  import { useTouch } from "../../hooks/use-touch";
11
- import { getRectByTaro } from "../../utils/get-rect-by-taro";
11
+ import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
12
12
  import { ComponentDefaults } from "../../utils/typings";
13
- import { harmony } from "../../utils/platform-taro";
13
+ import { harmony } from "../../utils/taro/platform";
14
14
  import { useRefState } from "../../hooks/use-ref-state";
15
- import useUuid from "../../hooks/use-uuid";
15
+ import { useUuid } from "../../hooks/use-uuid";
16
16
  function preventDefault(event, isStopPropagation) {
17
17
  if (typeof event.cancelable !== 'boolean' || event.cancelable) {
18
18
  event.preventDefault();
@@ -44,7 +44,7 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
44
44
  ];
45
45
  return [
46
46
  4,
47
- getRectByTaro(leftWrapper.current, leftId)
47
+ getRectInMultiPlatform(leftWrapper.current, leftId)
48
48
  ];
49
49
  case 1:
50
50
  leftRect = _state.sent();
@@ -61,7 +61,7 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
61
61
  ];
62
62
  return [
63
63
  4,
64
- getRectByTaro(rightWrapper.current, rightId)
64
+ getRectInMultiPlatform(rightWrapper.current, rightId)
65
65
  ];
66
66
  case 3:
67
67
  rightRect = _state.sent();
@@ -128,7 +128,7 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
128
128
  ];
129
129
  return [
130
130
  4,
131
- getRectByTaro(leftWrapper.current, leftId)
131
+ getRectInMultiPlatform(leftWrapper.current, leftId)
132
132
  ];
133
133
  case 1:
134
134
  leftRect = _state.sent();
@@ -145,7 +145,7 @@ export var Swipe = /*#__PURE__*/ forwardRef(function(props, instanceRef) {
145
145
  ];
146
146
  return [
147
147
  4,
148
- getRectByTaro(rightWrapper.current, rightId)
148
+ getRectInMultiPlatform(rightWrapper.current, rightId)
149
149
  ];
150
150
  case 3:
151
151
  rightRect = _state.sent();
@@ -7,7 +7,7 @@ import React, { Children, useEffect, useImperativeHandle, useMemo, useState } fr
7
7
  import { Swiper as TaroSwiper, SwiperItem as TSwiperItem, View } from "@tarojs/components";
8
8
  import classNames from "classnames";
9
9
  import Indicator from "../indicator/index";
10
- import pxTransform from "../../utils/px-transform";
10
+ import { pxTransform } from "../../utils/taro/px-transform";
11
11
  var defaultProps = {
12
12
  direction: 'horizontal',
13
13
  indicator: false,
@@ -13,7 +13,7 @@ import TabPane from "../tabpane/index";
13
13
  import { usePropsValue } from "../../hooks/use-props-value";
14
14
  import { useForceUpdate } from "../../hooks/use-force-update";
15
15
  import raf from "../../utils/raf";
16
- import useUuid from "../../hooks/use-uuid";
16
+ import { useUuid } from "../../hooks/use-uuid";
17
17
  import { useRtl } from "../configprovider/configprovider";
18
18
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
19
19
  tabStyle: {},
@@ -8,10 +8,10 @@ import { Text, View } from "@tarojs/components";
8
8
  import { Failure, Loading, Success, Tips } from "@nutui/icons-react-taro";
9
9
  import Overlay from "../overlay/index";
10
10
  import { defaultOverlayProps } from "../overlay/overlay";
11
- import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../hooks/use-custom-event";
11
+ import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../hooks/taro/use-custom-event";
12
12
  import { usePropsValue } from "../../hooks/use-props-value";
13
13
  import { useRtl } from "../configprovider/index";
14
- import { harmony } from "../../utils/platform-taro";
14
+ import { harmony } from "../../utils/taro/platform";
15
15
  import { mergeProps } from "../../utils/merge-props";
16
16
  var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps), {
17
17
  id: '',
@@ -6,7 +6,7 @@ import { Close } from "@nutui/icons-react-taro";
6
6
  import classNames from "classnames";
7
7
  import { View } from "@tarojs/components";
8
8
  import Popover from "../popover/index";
9
- import { getTaroRectById } from "../../hooks/use-taro-rect";
9
+ import { getRectById } from "../../utils/taro/get-rect-by-id";
10
10
  import { ComponentDefaults } from "../../utils/typings";
11
11
  import { useConfig } from "../configprovider/index";
12
12
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -62,7 +62,7 @@ export var Tour = function(props) {
62
62
  active
63
63
  ]);
64
64
  var getRootPosition = function() {
65
- getTaroRectById(list[active].target).then(function(rect) {
65
+ getRectById(list[active].target).then(function(rect) {
66
66
  setMaskRect({
67
67
  top: rect.top,
68
68
  left: rect.left,
@@ -5,7 +5,7 @@ import React, { useRef } from "react";
5
5
  import { TriangleDown, TriangleUp } from "@nutui/icons-react-taro";
6
6
  import { Text, View } from "@tarojs/components";
7
7
  import { ComponentDefaults } from "../../utils/typings";
8
- import { harmony } from "../../utils/platform-taro";
8
+ import { harmony } from "../../utils/taro/platform";
9
9
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
10
10
  value: 0,
11
11
  digits: 2,
@@ -5,7 +5,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
5
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { ScrollView, View } from "@tarojs/components";
7
7
  import classNames from "classnames";
8
- import { getWindowInfo } from "../../utils/get-system-info";
8
+ import { getWindowInfo } from "../../utils/taro/get-system-info";
9
9
  import { initPositinoCache, updateItemSize } from "./utils";
10
10
  import { ComponentDefaults } from "../../utils/typings";
11
11
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
@@ -0,0 +1 @@
1
+ export declare const clamp: (num: number, min: number, max: number) => number;
@@ -0,0 +1,3 @@
1
+ export var clamp = function(num, min, max) {
2
+ return Math.min(Math.max(num, min), max);
3
+ };
@@ -0,0 +1,21 @@
1
+ export declare function trigger(wrapper: any, eventName: string, x?: number, y?: number, options?: any): void;
2
+ export declare function sleep(delay?: number): Promise<void>;
3
+ export declare function triggerDrag(el: any, relativeX?: number, relativeY?: number): void;
4
+ /**
5
+ * 模拟触摸移动方法
6
+ * @param {HTMLElement} element 要进行触摸移动的 HTML 元素
7
+ * @param {number} startX 起始触摸点的 X 坐标
8
+ * @param {number} startY 起始触摸点的 Y 坐标
9
+ * @param {number} endX 结束触摸点的 X 坐标
10
+ * @param {number} endY 结束触摸点的 Y 坐标
11
+ * @param {number} duration 移动持续时间(毫秒)
12
+ */
13
+ export declare function simulateTouchMove(element: HTMLElement, startX: number, startY: number, endX: number, endY: number, duration: number): Promise<void>;
14
+ /**
15
+ * 模拟触摸缩放方法
16
+ * @param {HTMLElement} element 要进行缩放操作的 HTML 元素
17
+ * @param {number} startDistance 起始触摸点的距离
18
+ * @param {number} endDistance 结束触摸点的距离
19
+ * @param {number} duration 缩放持续时间(毫秒)
20
+ */
21
+ export declare function simulateTouchZoom(element: HTMLElement, startDistance: number, endDistance: number, duration: number): Promise<void>;