@nutui/nutui-react-taro 2.3.1 → 2.3.3

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 +27 -0
  2. package/dist/esm/ActionSheet/style/style.css +1 -1
  3. package/dist/esm/ActionSheet.js +4 -4
  4. package/dist/esm/Address/style/style.css +1 -1
  5. package/dist/esm/Address.js +6 -6
  6. package/dist/esm/Audio/style/style.css +1 -1
  7. package/dist/esm/Audio.js +3 -3
  8. package/dist/esm/AvatarCropper.js +2 -2
  9. package/dist/esm/Button/style/style.css +1 -1
  10. package/dist/esm/Calendar/style/style.css +1 -1
  11. package/dist/esm/Calendar.js +5 -5
  12. package/dist/esm/CalendarItem.js +1 -1
  13. package/dist/esm/Cascader/style/style.css +1 -1
  14. package/dist/esm/Cascader.js +5 -5
  15. package/dist/esm/Checkbox/style/style.css +1 -1
  16. package/dist/esm/CountDown.js +2 -1
  17. package/dist/esm/DatePicker/style/style.css +1 -1
  18. package/dist/esm/DatePicker.js +6 -5
  19. package/dist/esm/Dialog/style/style.css +1 -1
  20. package/dist/esm/Dialog.js +3 -3
  21. package/dist/esm/Empty.js +1 -1
  22. package/dist/esm/FixedNav.js +3 -3
  23. package/dist/esm/Form.js +1 -0
  24. package/dist/esm/ImagePreview/style/style.css +1 -1
  25. package/dist/esm/ImagePreview.js +4 -4
  26. package/dist/esm/InfiniteLoading.js +1 -1
  27. package/dist/esm/InputNumber.js +1 -1
  28. package/dist/esm/Menu/style/style.css +1 -1
  29. package/dist/esm/Menu.js +4 -4
  30. package/dist/esm/MenuItem/style/style.css +1 -1
  31. package/dist/esm/MenuItem.js +3 -3
  32. package/dist/esm/NumberKeyboard/style/style.css +1 -1
  33. package/dist/esm/NumberKeyboard.js +4 -4
  34. package/dist/esm/Overlay.js +2 -2
  35. package/dist/esm/Picker/style/style.css +1 -1
  36. package/dist/esm/Picker.js +4 -4
  37. package/dist/esm/Popover/style/style.css +1 -1
  38. package/dist/esm/Popover.js +4 -4
  39. package/dist/esm/Popup/style/style.css +1 -1
  40. package/dist/esm/Popup.js +3 -3
  41. package/dist/esm/PullToRefresh.js +3 -2
  42. package/dist/esm/Radio/style/style.css +1 -1
  43. package/dist/esm/Range.js +2 -2
  44. package/dist/esm/ShortPassword/style/style.css +1 -1
  45. package/dist/esm/ShortPassword.js +4 -4
  46. package/dist/esm/SideNavBar/style/style.css +1 -1
  47. package/dist/esm/SideNavBar.js +4 -4
  48. package/dist/esm/Swipe.js +2 -2
  49. package/dist/esm/Tabbar.js +2 -2
  50. package/dist/esm/TabbarItem.js +1 -1
  51. package/dist/esm/Table/style/style.css +1 -1
  52. package/dist/esm/Table.js +1 -1
  53. package/dist/esm/Tabs.js +1 -1
  54. package/dist/esm/TimeSelect/style/style.css +1 -1
  55. package/dist/esm/TimeSelect.js +4 -4
  56. package/dist/esm/Toast.js +3 -3
  57. package/dist/esm/Tour/style/style.css +1 -1
  58. package/dist/esm/Tour.js +5 -5
  59. package/dist/esm/{actionsheet.taro-1SIVktd6.js → actionsheet.taro-gfhQciJ4.js} +1 -1
  60. package/dist/esm/{address.taro-0oHDMjvi.js → address.taro-sTqrtuxC.js} +2 -2
  61. package/dist/esm/{audio.taro-TwVp1boF.js → audio.taro-Z23xRUZF.js} +1 -1
  62. package/dist/esm/{avatarcropper.taro-xTaDqZuh.js → avatarcropper.taro-H77gHZmo.js} +1 -1
  63. package/dist/esm/{calendar.taro-UTNDbfde.js → calendar.taro-Kf91Qo5t.js} +2 -2
  64. package/dist/esm/{calendaritem.taro-22chQZnN.js → calendaritem.taro-G5BaVw8e.js} +9 -3
  65. package/dist/esm/{cascader.taro-TXNqGqoz.js → cascader.taro-DYMZD6ik.js} +20 -6
  66. package/dist/esm/{countdown.taro-_7iZfeff.js → countdown.taro-rJngrZUZ.js} +1 -7
  67. package/dist/esm/{datepicker.taro-XBRswbnv.js → datepicker.taro-7xNSgNRT.js} +53 -73
  68. package/dist/esm/{dialog.taro-8KQTLwUg.js → dialog.taro-UQN2mJZR.js} +1 -1
  69. package/dist/esm/{empty.taro-9bGPftO1.js → empty.taro-CE-H96el.js} +212 -220
  70. package/dist/esm/{fixednav.taro-Y7yk8THh.js → fixednav.taro-7OfzwFBE.js} +2 -2
  71. package/dist/esm/{imagepreview.taro-RbAHvSoF.js → imagepreview.taro-DKFWoFNy.js} +1 -1
  72. package/dist/esm/{infiniteloading.taro-cQRDXtbb.js → infiniteloading.taro-eSS7cIsT.js} +2 -2
  73. package/dist/esm/{inputnumber.taro-XcwIk4rB.js → inputnumber.taro-7QptygT3.js} +2 -2
  74. package/dist/esm/{menu.taro-EytwZPzh.js → menu.taro-ODwHYGFM.js} +1 -1
  75. package/dist/esm/{menuitem.taro-nLVATeRi.js → menuitem.taro-9nyTDLpt.js} +1 -1
  76. package/dist/esm/{numberkeyboard.taro-5LPPRBFw.js → numberkeyboard.taro-gJhSoXsl.js} +1 -1
  77. package/dist/esm/nutui-react.es.js +36 -35
  78. package/dist/esm/{overlay.taro-Iqz9hm-3.js → overlay.taro-HsGeVyPh.js} +1 -1
  79. package/dist/esm/pad-zero-iY-0-oys.js +10 -0
  80. package/dist/esm/{picker.taro-77giqVEH.js → picker.taro-pRzPNgyZ.js} +4 -4
  81. package/dist/esm/{popover.taro-dXJi9liV.js → popover.taro-N1dZfUxf.js} +1 -1
  82. package/dist/esm/{popup.taro-KqkDIedA.js → popup.taro-2FdJu1kg.js} +1 -1
  83. package/dist/esm/{pulltorefresh.taro-oRUwveUX.js → pulltorefresh.taro-h0P58sPG.js} +13 -19
  84. package/dist/esm/{range.taro-708Gnv2w.js → range.taro-S6WTiP1X.js} +1 -1
  85. package/dist/esm/{shortpassword.taro-641T08nE.js → shortpassword.taro-uFeVULsY.js} +1 -1
  86. package/dist/esm/{sidenavbar.taro-jJvAbDgx.js → sidenavbar.taro-J5SEKQIh.js} +1 -1
  87. package/dist/esm/{swipe.taro-AVgWtTnP.js → swipe.taro-p2ONOq1o.js} +1 -1
  88. package/dist/esm/{tabbar.taro-lM7-vxOz.js → tabbar.taro-QE0rjSKE.js} +13 -13
  89. package/dist/esm/{tabbaritem.taro-Q5uY6b9_.js → tabbaritem.taro-t9C07OYX.js} +23 -8
  90. package/dist/esm/table.taro-Zyemar_o.js +184 -0
  91. package/dist/esm/{tabs.taro-HezOZhRs.js → tabs.taro-uXbRqGVo.js} +22 -7
  92. package/dist/esm/{timeselect.taro-HE0xZtNu.js → timeselect.taro-7FWR9oaJ.js} +1 -1
  93. package/dist/esm/{toast.taro-eCBeePr8.js → toast.taro-xnEQSCDJ.js} +2 -2
  94. package/dist/esm/{tour.taro-omnaIavI.js → tour.taro-_3C-szH1.js} +1 -1
  95. package/dist/esm/types/src/packages/address/address.d.ts +1 -1
  96. package/dist/esm/types/src/packages/address/address.taro.d.ts +1 -1
  97. package/dist/esm/types/src/packages/address/existRender.d.ts +1 -1
  98. package/dist/esm/types/src/packages/address/existRender.taro.d.ts +1 -1
  99. package/dist/esm/types/src/packages/animate/animate.d.ts +1 -1
  100. package/dist/esm/types/src/packages/animate/animate.taro.d.ts +1 -1
  101. package/dist/esm/types/src/packages/animate/index.d.ts +1 -1
  102. package/dist/esm/types/src/packages/animate/index.taro.d.ts +1 -1
  103. package/dist/esm/types/src/packages/calendar/calendar.d.ts +1 -1
  104. package/dist/esm/types/src/packages/calendar/calendar.taro.d.ts +1 -1
  105. package/dist/esm/types/src/packages/calendar/utils.d.ts +1 -1
  106. package/dist/esm/types/src/packages/calendaritem/calendaritem.d.ts +1 -1
  107. package/dist/esm/types/src/packages/calendaritem/calendaritem.taro.d.ts +1 -1
  108. package/dist/esm/types/src/packages/cascader/cascader.d.ts +4 -0
  109. package/dist/esm/types/src/packages/cascader/cascader.taro.d.ts +4 -0
  110. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +1 -1
  111. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +1 -1
  112. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
  113. package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +2 -6
  114. package/dist/esm/types/src/packages/fixednav/fixednav.taro.d.ts +2 -6
  115. package/dist/esm/types/src/packages/fixednav/index.d.ts +2 -1
  116. package/dist/esm/types/src/packages/fixednav/index.taro.d.ts +2 -1
  117. package/dist/esm/types/src/packages/fixednav/types.d.ts +12 -0
  118. package/dist/esm/types/src/packages/pulltorefresh/pulltorefresh.d.ts +1 -0
  119. package/dist/esm/types/src/packages/pulltorefresh/pulltorefresh.taro.d.ts +1 -0
  120. package/dist/esm/types/src/packages/radiogroup/radiogroup.d.ts +1 -1
  121. package/dist/esm/types/src/packages/radiogroup/radiogroup.taro.d.ts +1 -1
  122. package/dist/esm/types/src/packages/tabbar/context.d.ts +9 -0
  123. package/dist/esm/types/src/packages/tabbar/index.d.ts +1 -0
  124. package/dist/esm/types/src/packages/tabbar/index.taro.d.ts +1 -0
  125. package/dist/esm/types/src/packages/tabbaritem/tabbaritem.d.ts +0 -5
  126. package/dist/esm/types/src/packages/tabbaritem/tabbaritem.taro.d.ts +0 -5
  127. package/dist/esm/types/src/packages/table/types.d.ts +2 -0
  128. package/dist/esm/types/src/packages/table/useTableSticky.d.ts +8 -0
  129. package/dist/esm/types/src/packages/virtuallist/utils.d.ts +1 -1
  130. package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +1 -1
  131. package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +1 -1
  132. package/dist/esm/types/src/utils/is-date.d.ts +1 -0
  133. package/dist/esm/types/src/utils/pad-zero.d.ts +1 -0
  134. package/dist/esm/types/src/utils/use-touch.d.ts +2 -0
  135. package/dist/esm/{use-touch-DODa8svc.js → use-touch-BUFdkOSA.js} +7 -0
  136. package/dist/locales/base.js +1 -1
  137. package/dist/locales/en-US.js +1 -1
  138. package/dist/locales/id-ID.js +1 -1
  139. package/dist/locales/tr-TR.js +1 -1
  140. package/dist/locales/zh-CN.js +1 -1
  141. package/dist/locales/zh-TW.js +1 -1
  142. package/dist/locales/zh-UG.js +1 -1
  143. package/dist/nutui.react.es.js +1537 -1476
  144. package/dist/nutui.react.umd.js +1546 -1485
  145. package/dist/packages/cascader/cascader.scss +1 -6
  146. package/dist/packages/checkbox/checkbox.scss +3 -0
  147. package/dist/packages/menuitem/menuitem.scss +1 -1
  148. package/dist/packages/popup/popup.scss +2 -2
  149. package/dist/packages/table/table.scss +82 -9
  150. package/dist/style.css +1 -1
  151. package/dist/style.mjs +1 -1
  152. package/dist/styles/variables-jmapp.scss +9 -2
  153. package/dist/styles/variables.scss +10 -3
  154. package/dist/types/packages/address/address.d.ts +1 -1
  155. package/dist/types/packages/address/address.taro.d.ts +1 -1
  156. package/dist/types/packages/address/existRender.d.ts +1 -1
  157. package/dist/types/packages/address/existRender.taro.d.ts +1 -1
  158. package/dist/types/packages/animate/animate.d.ts +1 -1
  159. package/dist/types/packages/animate/animate.taro.d.ts +1 -1
  160. package/dist/types/packages/animate/index.d.ts +1 -1
  161. package/dist/types/packages/animate/index.taro.d.ts +1 -1
  162. package/dist/types/packages/calendar/calendar.d.ts +1 -1
  163. package/dist/types/packages/calendar/calendar.taro.d.ts +1 -1
  164. package/dist/types/packages/calendar/utils.d.ts +1 -1
  165. package/dist/types/packages/calendaritem/calendaritem.d.ts +1 -1
  166. package/dist/types/packages/calendaritem/calendaritem.taro.d.ts +1 -1
  167. package/dist/types/packages/cascader/cascader.d.ts +4 -0
  168. package/dist/types/packages/cascader/cascader.taro.d.ts +4 -0
  169. package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +1 -1
  170. package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +1 -1
  171. package/dist/types/packages/configprovider/types.d.ts +1 -1
  172. package/dist/types/packages/fixednav/fixednav.d.ts +2 -6
  173. package/dist/types/packages/fixednav/fixednav.taro.d.ts +2 -6
  174. package/dist/types/packages/fixednav/index.d.ts +2 -1
  175. package/dist/types/packages/fixednav/index.taro.d.ts +2 -1
  176. package/dist/types/packages/fixednav/types.d.ts +12 -0
  177. package/dist/types/packages/pulltorefresh/pulltorefresh.d.ts +1 -0
  178. package/dist/types/packages/pulltorefresh/pulltorefresh.taro.d.ts +7 -2
  179. package/dist/types/packages/radiogroup/radiogroup.d.ts +1 -1
  180. package/dist/types/packages/radiogroup/radiogroup.taro.d.ts +1 -1
  181. package/dist/types/packages/tabbar/context.d.ts +9 -0
  182. package/dist/types/packages/tabbar/index.d.ts +1 -0
  183. package/dist/types/packages/tabbar/index.taro.d.ts +1 -0
  184. package/dist/types/packages/tabbaritem/tabbaritem.d.ts +0 -5
  185. package/dist/types/packages/tabbaritem/tabbaritem.taro.d.ts +0 -5
  186. package/dist/types/packages/table/types.d.ts +2 -0
  187. package/dist/types/packages/table/useTableSticky.d.ts +8 -0
  188. package/dist/types/packages/virtuallist/utils.d.ts +1 -1
  189. package/dist/types/packages/virtuallist/virtuallist.d.ts +1 -1
  190. package/dist/types/packages/virtuallist/virtuallist.taro.d.ts +1 -1
  191. package/dist/types/utils/is-date.d.ts +1 -0
  192. package/dist/types/utils/pad-zero.d.ts +1 -0
  193. package/dist/types/utils/use-touch.d.ts +2 -0
  194. package/package.json +2 -2
  195. package/dist/esm/table.taro-NO-C8ayh.js +0 -109
  196. /package/dist/esm/types/src/packages/address/{type.d.ts → types.d.ts} +0 -0
  197. /package/dist/esm/types/src/packages/animate/{type.d.ts → types.d.ts} +0 -0
  198. /package/dist/esm/types/src/packages/calendar/{type.d.ts → types.d.ts} +0 -0
  199. /package/dist/esm/types/src/packages/checkboxgroup/{type.d.ts → types.d.ts} +0 -0
  200. /package/dist/esm/types/src/packages/radiogroup/{type.d.ts → types.d.ts} +0 -0
  201. /package/dist/esm/types/src/packages/virtuallist/{type.d.ts → types.d.ts} +0 -0
  202. /package/dist/types/packages/address/{type.d.ts → types.d.ts} +0 -0
  203. /package/dist/types/packages/animate/{type.d.ts → types.d.ts} +0 -0
  204. /package/dist/types/packages/calendar/{type.d.ts → types.d.ts} +0 -0
  205. /package/dist/types/packages/checkboxgroup/{type.d.ts → types.d.ts} +0 -0
  206. /package/dist/types/packages/radiogroup/{type.d.ts → types.d.ts} +0 -0
  207. /package/dist/types/packages/virtuallist/{type.d.ts → types.d.ts} +0 -0
@@ -0,0 +1,12 @@
1
+ import { Key, ReactNode } from 'react';
2
+ export type FixedNavDirection = 'right' | 'left';
3
+ export type FixedNavPosition = {
4
+ top?: string;
5
+ bottom?: string;
6
+ };
7
+ export interface FixedNavItem {
8
+ id: Key;
9
+ num?: number;
10
+ text: ReactNode;
11
+ icon: ReactNode;
12
+ }
@@ -11,6 +11,7 @@ export interface PullToRefreshProps extends BasicComponent {
11
11
  headHeight: number;
12
12
  threshold: number;
13
13
  disabled: boolean;
14
+ renderIcon: (status: PullStatus) => ReactNode;
14
15
  renderText: (status: PullStatus) => ReactNode;
15
16
  }
16
17
  export declare const PullToRefresh: FunctionComponent<Partial<PullToRefreshProps>>;
@@ -12,6 +12,7 @@ export interface PullToRefreshProps extends BasicComponent {
12
12
  threshold: number;
13
13
  disabled: boolean;
14
14
  scrollTop: number;
15
+ renderIcon: (status: PullStatus) => ReactNode;
15
16
  renderText: (status: PullStatus) => ReactNode;
16
17
  }
17
18
  export declare const PullToRefresh: FunctionComponent<Partial<PullToRefreshProps>>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RadioGroupOptionType } from './type';
2
+ import { RadioGroupOptionType } from './types';
3
3
  type Position = 'left' | 'right';
4
4
  type Direction = 'horizontal' | 'vertical';
5
5
  export interface RadioGroupProps {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RadioGroupOptionType } from './type';
2
+ import { RadioGroupOptionType } from './types';
3
3
  type Position = 'left' | 'right';
4
4
  type Direction = 'horizontal' | 'vertical';
5
5
  export interface RadioGroupProps {
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface TabbarContext {
3
+ selectIndex: number;
4
+ inactiveColor: string;
5
+ activeColor: string;
6
+ handleClick: (value: number) => void;
7
+ }
8
+ declare const _default: React.Context<TabbarContext | null>;
9
+ export default _default;
@@ -1,3 +1,4 @@
1
1
  import { Tabbar } from './tabbar';
2
+ export type { TabbarContext } from './context';
2
3
  export type { TabbarProps } from './tabbar';
3
4
  export default Tabbar;
@@ -1,3 +1,4 @@
1
1
  import { Tabbar } from './tabbar.taro';
2
+ export type { TabbarContext } from './context';
2
3
  export type { TabbarProps } from './tabbar.taro';
3
4
  export default Tabbar;
@@ -3,15 +3,10 @@ import { BasicComponent } from '@/utils/typings';
3
3
  export interface TabbarItemProps extends BasicComponent {
4
4
  title: ReactNode;
5
5
  icon: ReactNode;
6
- active: boolean;
7
- activeColor: string;
8
- inactiveColor: string;
9
- index: number;
10
6
  value: ReactNode;
11
7
  dot: boolean;
12
8
  max: number;
13
9
  top: string;
14
10
  right: string;
15
- handleClick: (idx: number) => void;
16
11
  }
17
12
  export declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
@@ -3,15 +3,10 @@ import { BasicComponent } from '@/utils/typings';
3
3
  export interface TabbarItemProps extends BasicComponent {
4
4
  title: ReactNode;
5
5
  icon: ReactNode;
6
- active: boolean;
7
- activeColor: string;
8
- inactiveColor: string;
9
- index: number;
10
6
  value: ReactNode;
11
7
  dot: boolean;
12
8
  max: number;
13
9
  top: string;
14
10
  right: string;
15
- handleClick: (idx: number) => void;
16
11
  }
17
12
  export declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
@@ -17,4 +17,6 @@ export interface TableColumnProps {
17
17
  align?: string;
18
18
  sorter?: ((a: any, b: any) => number) | boolean | string;
19
19
  render?: (rowData: any, rowIndex: number) => string | React.ReactNode;
20
+ fixed?: 'left' | 'right';
21
+ width?: number;
20
22
  }
@@ -0,0 +1,8 @@
1
+ import { TableColumnProps } from './types';
2
+ export default function useTableSticky(columns: Array<TableColumnProps>): {
3
+ isSticky: boolean;
4
+ stickyLeftWidth: number;
5
+ stickyRightWidth: number;
6
+ getStickyClass: (key: string) => any;
7
+ getStickyStyle: (key: string) => any;
8
+ };
@@ -1,4 +1,4 @@
1
- import { PositionType, Data } from './type';
1
+ import { PositionType, Data } from './types';
2
2
  declare const initPositinoCache: (reaItemSize: number, length?: number) => PositionType[];
3
3
  declare const getListTotalSize: (positions: Array<PositionType>, horizontal: true | false) => number;
4
4
  declare const binarySearch: (positionsList: Array<PositionType>, horizontal: true | false, value?: number) => number;
@@ -1,5 +1,5 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
- import type { Data } from './type';
2
+ import type { Data } from './types';
3
3
  import { BasicComponent } from '@/utils/typings';
4
4
  export interface VirtualListProps extends BasicComponent {
5
5
  list: Array<Data>;
@@ -1,5 +1,5 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
- import { Data } from './type';
2
+ import { Data } from './types';
3
3
  import { BasicComponent } from '@/utils/typings';
4
4
  export interface VirtualListProps extends BasicComponent {
5
5
  list: Array<Data>;
@@ -0,0 +1 @@
1
+ export declare const isDate: (val: Date) => val is Date;
@@ -0,0 +1 @@
1
+ export declare const padZero: (num: number | string, targetLength?: number) => string;
@@ -4,10 +4,12 @@ export declare function useTouch(): {
4
4
  move: (event: React.TouchEvent<HTMLElement>) => void;
5
5
  start: (event: React.TouchEvent<HTMLElement>) => void;
6
6
  reset: () => void;
7
+ touchTime: React.MutableRefObject<number | null>;
7
8
  startX: React.MutableRefObject<number>;
8
9
  startY: React.MutableRefObject<number>;
9
10
  deltaX: React.MutableRefObject<number>;
10
11
  deltaY: React.MutableRefObject<number>;
12
+ delta: React.MutableRefObject<number>;
11
13
  offsetX: React.MutableRefObject<number>;
12
14
  offsetY: React.MutableRefObject<number>;
13
15
  direction: React.MutableRefObject<Direction>;
@@ -14,12 +14,15 @@ function useTouch() {
14
14
  const startY = useRef(0);
15
15
  const deltaX = useRef(0);
16
16
  const deltaY = useRef(0);
17
+ const delta = useRef(0);
17
18
  const offsetX = useRef(0);
18
19
  const offsetY = useRef(0);
19
20
  const direction = useRef("");
21
+ const touchTime = useRef(null);
20
22
  const isVertical = () => direction.current === "vertical";
21
23
  const isHorizontal = () => direction.current === "horizontal";
22
24
  const reset = () => {
25
+ touchTime.current = null;
23
26
  deltaX.current = 0;
24
27
  deltaY.current = 0;
25
28
  offsetX.current = 0;
@@ -28,6 +31,7 @@ function useTouch() {
28
31
  };
29
32
  const start = (event) => {
30
33
  reset();
34
+ touchTime.current = Date.now();
31
35
  startX.current = event.touches[0].clientX;
32
36
  startY.current = event.touches[0].clientY;
33
37
  };
@@ -37,6 +41,7 @@ function useTouch() {
37
41
  deltaY.current = touch.clientY - startY.current;
38
42
  offsetX.current = Math.abs(deltaX.current);
39
43
  offsetY.current = Math.abs(deltaY.current);
44
+ delta.current = isVertical() ? deltaY.current : deltaX.current;
40
45
  if (!direction.current) {
41
46
  direction.current = getDirection(offsetX.current, offsetY.current);
42
47
  }
@@ -45,10 +50,12 @@ function useTouch() {
45
50
  move,
46
51
  start,
47
52
  reset,
53
+ touchTime,
48
54
  startX,
49
55
  startY,
50
56
  deltaX,
51
57
  deltaY,
58
+ delta,
52
59
  offsetX,
53
60
  offsetY,
54
61
  direction,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.1 Wed Dec 13 2023 16:29:43 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.3 Fri Dec 22 2023 17:48:10 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */