@nutui/nutui-react-taro 2.5.2 → 2.6.0

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 (83) hide show
  1. package/CHANGELOG.md +19 -5
  2. package/dist/esm/ActionSheet.js +1 -1
  3. package/dist/esm/Address.js +1 -1
  4. package/dist/esm/Audio.js +1 -1
  5. package/dist/esm/AvatarCropper.js +1 -1
  6. package/dist/esm/Calendar.js +1 -1
  7. package/dist/esm/Cascader.js +1 -1
  8. package/dist/esm/DatePicker.js +1 -1
  9. package/dist/esm/Dialog.js +1 -1
  10. package/dist/esm/FixedNav.js +1 -1
  11. package/dist/esm/Form/style/style.css +1 -1
  12. package/dist/esm/ImagePreview/style/style.css +1 -1
  13. package/dist/esm/ImagePreview.js +1 -1
  14. package/dist/esm/Input.js +1 -1
  15. package/dist/esm/Menu.js +1 -1
  16. package/dist/esm/MenuItem.js +1 -1
  17. package/dist/esm/NumberKeyboard.js +1 -1
  18. package/dist/esm/Overlay.js +1 -1
  19. package/dist/esm/Picker.js +1 -1
  20. package/dist/esm/Popover.js +1 -1
  21. package/dist/esm/Popup.js +1 -1
  22. package/dist/esm/PullToRefresh.js +1 -1
  23. package/dist/esm/Range.js +1 -1
  24. package/dist/esm/ShortPassword.js +1 -1
  25. package/dist/esm/SideNavBar.js +1 -1
  26. package/dist/esm/Swipe.js +1 -1
  27. package/dist/esm/Swiper/style/index.js +0 -1
  28. package/dist/esm/Swiper/style/style.css +1 -1
  29. package/dist/esm/TimeSelect.js +1 -1
  30. package/dist/esm/Toast.js +1 -1
  31. package/dist/esm/Tour.js +1 -1
  32. package/dist/esm/{actionsheet.taro-C5BqWoML.js → actionsheet.taro-Dpjoa3xo.js} +1 -1
  33. package/dist/esm/{address.taro-CQmN9x1W.js → address.taro-C7tIIp3x.js} +2 -2
  34. package/dist/esm/{audio.taro-BEskw47C.js → audio.taro-2hRKQ2Lk.js} +1 -1
  35. package/dist/esm/{avatarcropper.taro-CsVKBnvS.js → avatarcropper.taro-Dd4pAR3N.js} +1 -1
  36. package/dist/esm/{calendar.taro-DbHJEx4G.js → calendar.taro-DEsLc-lS.js} +1 -1
  37. package/dist/esm/{cascader.taro-7Xhq98L4.js → cascader.taro-CFcAyFL-.js} +1 -1
  38. package/dist/esm/{datepicker.taro-FiLalMAA.js → datepicker.taro-Bgq3ZNDe.js} +1 -1
  39. package/dist/esm/{dialog.taro-B8Usf0kl.js → dialog.taro-x_jRYew5.js} +1 -1
  40. package/dist/esm/{fixednav.taro-WTBxWxOo.js → fixednav.taro-CJUDQcX1.js} +1 -1
  41. package/dist/esm/{imagepreview.taro-Bb1TkBCV.js → imagepreview.taro-BMlwAhT0.js} +1 -1
  42. package/dist/esm/{input.taro-Dh6zXTLQ.js → input.taro-CAZ-rRMH.js} +2 -1
  43. package/dist/esm/{menu.taro-BAiJPGR7.js → menu.taro-J7oZoaGM.js} +1 -1
  44. package/dist/esm/{menuitem.taro-oLv6ZYC5.js → menuitem.taro-CaI5vTha.js} +1 -1
  45. package/dist/esm/{numberkeyboard.taro-B9rMgy7D.js → numberkeyboard.taro-DjxjkImT.js} +1 -1
  46. package/dist/esm/nutui-react.es.js +26 -26
  47. package/dist/esm/{overlay.taro-BaBu-3-F.js → overlay.taro--1Kf1D7C.js} +1 -1
  48. package/dist/esm/{picker.taro-Cmng9GW9.js → picker.taro-DR2HAkv6.js} +3 -3
  49. package/dist/esm/{popover.taro-BG0msyw5.js → popover.taro-MnR5htLt.js} +1 -1
  50. package/dist/esm/{popup.taro-Iy_WQZ-m.js → popup.taro-B7_iPgl4.js} +1 -1
  51. package/dist/esm/{pulltorefresh.taro-DfVmOGuo.js → pulltorefresh.taro-Ck1i2xRr.js} +1 -1
  52. package/dist/esm/{range.taro-GsWDprz5.js → range.taro-CsC41L60.js} +1 -1
  53. package/dist/esm/{shortpassword.taro-BXsxku33.js → shortpassword.taro-GkcE-e__.js} +1 -1
  54. package/dist/esm/{sidenavbar.taro-eK5vaZPR.js → sidenavbar.taro-5d-6iiNq.js} +1 -1
  55. package/dist/esm/{swipe.taro-aEnunftO.js → swipe.taro-CavqgBEb.js} +1 -1
  56. package/dist/esm/{timeselect.taro-BXq4APSJ.js → timeselect.taro-DkdpBJlT.js} +1 -1
  57. package/dist/esm/{toast.taro-BVXqvjNJ.js → toast.taro-B0YEmeDn.js} +1 -1
  58. package/dist/esm/{tour.taro-BqlNfxdD.js → tour.taro-CdX6pugO.js} +1 -1
  59. package/dist/esm/{use-touch-OfEaR5qi.js → use-touch-BeiLHDO9.js} +13 -3
  60. package/dist/locales/base.js +1 -1
  61. package/dist/locales/en-US.js +1 -1
  62. package/dist/locales/id-ID.js +1 -1
  63. package/dist/locales/tr-TR.js +1 -1
  64. package/dist/locales/zh-CN.js +1 -1
  65. package/dist/locales/zh-TW.js +1 -1
  66. package/dist/locales/zh-UG.js +1 -1
  67. package/dist/nutui.react.es.js +18 -20
  68. package/dist/nutui.react.umd.js +18 -20
  69. package/dist/packages/form/form.scss +0 -3
  70. package/dist/packages/swiper/swiper.scss +30 -16
  71. package/dist/style.css +1 -1
  72. package/dist/style.mjs +1 -1
  73. package/dist/types/packages/input/input.taro.d.ts +1 -1
  74. package/dist/types/packages/swiper/effects/default.d.ts +11 -0
  75. package/dist/types/packages/swiper/effects/focus.d.ts +21 -0
  76. package/dist/types/packages/swiper/index.d.ts +4 -2
  77. package/dist/types/packages/swiper/swiper.d.ts +12 -15
  78. package/dist/types/packages/swiper/types.d.ts +6 -0
  79. package/dist/types/packages/swiperitem/swiperitem.d.ts +8 -4
  80. package/dist/types/utils/use-ref-state.d.ts +3 -0
  81. package/dist/types/utils/use-touch.d.ts +3 -1
  82. package/package.json +1 -1
  83. package/dist/types/packages/picker/doc.en.d.ts +0 -145
@@ -3,10 +3,10 @@ import React__default, { useState, useRef, useEffect, useImperativeHandle } from
3
3
  import classNames from "classnames";
4
4
  import Taro from "@tarojs/taro";
5
5
  import { View, PickerView, PickerViewColumn } from "@tarojs/components";
6
- import { P as Popup } from "./popup.taro-Iy_WQZ-m.js";
7
- import { u as useTouch } from "./use-touch-OfEaR5qi.js";
6
+ import { P as Popup } from "./popup.taro-B7_iPgl4.js";
7
+ import { u as useTouch } from "./use-touch-BeiLHDO9.js";
8
8
  import { g as getRectByTaro } from "./get-rect-by-taro-CSN0TGnD.js";
9
- import { p as passiveSupported } from "./overlay.taro-BaBu-3-F.js";
9
+ import { p as passiveSupported } from "./overlay.taro--1Kf1D7C.js";
10
10
  import { u as useRefs } from "./use-refs-BeEmziIR.js";
11
11
  import { u as useConfig } from "./configprovider.taro-CyU_tvNJ.js";
12
12
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
@@ -2,7 +2,7 @@ import { _ as __rest, a as __awaiter } from "./tslib.es6-BZ8i9Q6l.js";
2
2
  import React__default, { useRef, useState, useEffect } from "react";
3
3
  import classNames from "classnames";
4
4
  import Taro, { createSelectorQuery } from "@tarojs/taro";
5
- import { P as Popup } from "./popup.taro-Iy_WQZ-m.js";
5
+ import { P as Popup } from "./popup.taro-B7_iPgl4.js";
6
6
  import { a as getRect, g as getRectByTaro } from "./get-rect-by-taro-CSN0TGnD.js";
7
7
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
8
8
  import { a as useRtl } from "./configprovider.taro-CyU_tvNJ.js";
@@ -4,7 +4,7 @@ import { CSSTransition } from "react-transition-group";
4
4
  import classNames from "classnames";
5
5
  import { Close } from "@nutui/icons-react-taro";
6
6
  import { View } from "@tarojs/components";
7
- import { d as defaultOverlayProps, u as useLockScrollTaro, O as Overlay } from "./overlay.taro-BaBu-3-F.js";
7
+ import { d as defaultOverlayProps, u as useLockScrollTaro, O as Overlay } from "./overlay.taro--1Kf1D7C.js";
8
8
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
9
9
  const defaultProps = Object.assign(Object.assign(Object.assign({}, ComponentDefaults), { position: "center", transition: "", overlayStyle: {}, overlayClassName: "", closeable: false, closeIconPosition: "top-right", closeIcon: "close", destroyOnClose: false, portal: null, overlay: true, round: false, onOpen: () => {
10
10
  }, onClose: () => {
@@ -5,7 +5,7 @@ import { View } from "@tarojs/components";
5
5
  import { Loading, More } from "@nutui/icons-react-taro";
6
6
  import Taro from "@tarojs/taro";
7
7
  import { u as useConfig } from "./configprovider.taro-CyU_tvNJ.js";
8
- import { u as useTouch } from "./use-touch-OfEaR5qi.js";
8
+ import { u as useTouch } from "./use-touch-BeiLHDO9.js";
9
9
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
10
10
  function bound(position, min, max) {
11
11
  let ret = position;
@@ -2,7 +2,7 @@ import { a as __awaiter } from "./tslib.es6-BZ8i9Q6l.js";
2
2
  import React__default, { useState, useRef, useEffect, useCallback } from "react";
3
3
  import classNames from "classnames";
4
4
  import { View } from "@tarojs/components";
5
- import { u as useTouch } from "./use-touch-OfEaR5qi.js";
5
+ import { u as useTouch } from "./use-touch-BeiLHDO9.js";
6
6
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
7
7
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
8
8
  import { g as getRectByTaro } from "./get-rect-by-taro-CSN0TGnD.js";
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-BZ8i9Q6l.js";
2
2
  import React__default, { useMemo, useImperativeHandle, useEffect } from "react";
3
3
  import { Tips } from "@nutui/icons-react-taro";
4
4
  import classNames from "classnames";
5
- import { P as Popup } from "./popup.taro-Iy_WQZ-m.js";
5
+ import { P as Popup } from "./popup.taro-B7_iPgl4.js";
6
6
  import { u as useConfig } from "./configprovider.taro-CyU_tvNJ.js";
7
7
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
8
8
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
@@ -1,7 +1,7 @@
1
1
  import { _ as __rest } from "./tslib.es6-BZ8i9Q6l.js";
2
2
  import React__default, { useState } from "react";
3
3
  import classNames from "classnames";
4
- import { P as Popup } from "./popup.taro-Iy_WQZ-m.js";
4
+ import { P as Popup } from "./popup.taro-B7_iPgl4.js";
5
5
  import { O as OffsetContext } from "./context-4T-L2x0_.js";
6
6
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
7
7
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { position: "left", width: "80%" });
@@ -3,7 +3,7 @@ import React__default, { forwardRef, useRef, useState, useImperativeHandle, useE
3
3
  import classNames from "classnames";
4
4
  import { View } from "@tarojs/components";
5
5
  import { useReady, nextTick } from "@tarojs/taro";
6
- import { u as useTouch } from "./use-touch-OfEaR5qi.js";
6
+ import { u as useTouch } from "./use-touch-BeiLHDO9.js";
7
7
  import { g as getRectByTaro } from "./get-rect-by-taro-CSN0TGnD.js";
8
8
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
9
9
  function preventDefault(event, isStopPropagation) {
@@ -1,7 +1,7 @@
1
1
  import { _ as __rest } from "./tslib.es6-BZ8i9Q6l.js";
2
2
  import React__default, { useState } from "react";
3
3
  import classNames from "classnames";
4
- import { P as Popup } from "./popup.taro-Iy_WQZ-m.js";
4
+ import { P as Popup } from "./popup.taro-B7_iPgl4.js";
5
5
  import { T as TimeDetail } from "./timedetail.taro-x6Zey1xi.js";
6
6
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
7
7
  import { u as useConfig } from "./configprovider.taro-CyU_tvNJ.js";
@@ -1,7 +1,7 @@
1
1
  import React__default, { useRef, useEffect } from "react";
2
2
  import classNames from "classnames";
3
3
  import { Success, Failure, Tips, Loading } from "@nutui/icons-react-taro";
4
- import { O as Overlay } from "./overlay.taro-BaBu-3-F.js";
4
+ import { O as Overlay } from "./overlay.taro--1Kf1D7C.js";
5
5
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
6
6
  import { b as useParams, u as useCustomEvent, a as useCustomEventsPath, c as customEvents } from "./use-custom-event-DuP4onEm.js";
7
7
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-BZ8i9Q6l.js";
2
2
  import React__default, { useState, useEffect } from "react";
3
3
  import { Close } from "@nutui/icons-react-taro";
4
4
  import classNames from "classnames";
5
- import { P as Popover } from "./popover.taro-BG0msyw5.js";
5
+ import { P as Popover } from "./popover.taro-MnR5htLt.js";
6
6
  import Taro, { createSelectorQuery } from "@tarojs/taro";
7
7
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
8
8
  import { useConfig } from "./ConfigProvider.js";
@@ -18,16 +18,20 @@ function useTouch() {
18
18
  const offsetX = useRef(0);
19
19
  const offsetY = useRef(0);
20
20
  const direction = useRef("");
21
- const touchTime = useRef(null);
21
+ const last = useRef(false);
22
+ const velocity = useRef(0);
23
+ const touchTime = useRef(Date.now());
22
24
  const isVertical = () => direction.current === "vertical";
23
25
  const isHorizontal = () => direction.current === "horizontal";
24
26
  const reset = () => {
25
- touchTime.current = null;
27
+ touchTime.current = Date.now();
26
28
  deltaX.current = 0;
27
29
  deltaY.current = 0;
28
30
  offsetX.current = 0;
29
31
  offsetY.current = 0;
32
+ delta.current = 0;
30
33
  direction.current = "";
34
+ last.current = false;
31
35
  };
32
36
  const start = (event) => {
33
37
  reset();
@@ -46,7 +50,12 @@ function useTouch() {
46
50
  direction.current = getDirection(offsetX.current, offsetY.current);
47
51
  }
48
52
  };
53
+ const end = (event) => {
54
+ last.current = true;
55
+ velocity.current = Math.sqrt(Math.pow(deltaX.current, 2) + Math.pow(deltaY.current, 2)) / (Date.now() - touchTime.current);
56
+ };
49
57
  return {
58
+ end,
50
59
  move,
51
60
  start,
52
61
  reset,
@@ -60,7 +69,8 @@ function useTouch() {
60
69
  offsetY,
61
70
  direction,
62
71
  isVertical,
63
- isHorizontal
72
+ isHorizontal,
73
+ last
64
74
  };
65
75
  }
66
76
  export {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:06:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:36 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.5.2 Wed Apr 03 2024 18:05:52 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:09 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -3348,16 +3348,20 @@ function useTouch() {
3348
3348
  const offsetX = useRef(0);
3349
3349
  const offsetY = useRef(0);
3350
3350
  const direction = useRef("");
3351
- const touchTime = useRef(null);
3351
+ const last = useRef(false);
3352
+ const velocity = useRef(0);
3353
+ const touchTime = useRef(Date.now());
3352
3354
  const isVertical = () => direction.current === "vertical";
3353
3355
  const isHorizontal = () => direction.current === "horizontal";
3354
3356
  const reset = () => {
3355
- touchTime.current = null;
3357
+ touchTime.current = Date.now();
3356
3358
  deltaX.current = 0;
3357
3359
  deltaY.current = 0;
3358
3360
  offsetX.current = 0;
3359
3361
  offsetY.current = 0;
3362
+ delta.current = 0;
3360
3363
  direction.current = "";
3364
+ last.current = false;
3361
3365
  };
3362
3366
  const start = (event) => {
3363
3367
  reset();
@@ -3376,7 +3380,12 @@ function useTouch() {
3376
3380
  direction.current = getDirection(offsetX.current, offsetY.current);
3377
3381
  }
3378
3382
  };
3383
+ const end = (event) => {
3384
+ last.current = true;
3385
+ velocity.current = Math.sqrt(deltaX.current ** 2 + deltaY.current ** 2) / (Date.now() - touchTime.current);
3386
+ };
3379
3387
  return {
3388
+ end,
3380
3389
  move,
3381
3390
  start,
3382
3391
  reset,
@@ -3390,7 +3399,8 @@ function useTouch() {
3390
3399
  offsetY,
3391
3400
  direction,
3392
3401
  isVertical,
3393
- isHorizontal
3402
+ isHorizontal,
3403
+ last
3394
3404
  };
3395
3405
  }
3396
3406
  const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
@@ -3414,19 +3424,6 @@ function getScrollParent(el, root2 = defaultRoot) {
3414
3424
  }
3415
3425
  return root2;
3416
3426
  }
3417
- let passiveSupported = false;
3418
- if (canUseDom) {
3419
- try {
3420
- const opts = Object.defineProperty({}, "passive", {
3421
- get() {
3422
- passiveSupported = true;
3423
- }
3424
- });
3425
- window.addEventListener("test-passive-supported", null, opts);
3426
- } catch (e2) {
3427
- console.log(e2);
3428
- }
3429
- }
3430
3427
  let totalLockCount = 0;
3431
3428
  const BODY_LOCK_CLASS = "nut-overflow-hidden";
3432
3429
  function getScrollableElement(el) {
@@ -3475,7 +3472,7 @@ function useLockScroll(rootRef, shouldLock) {
3475
3472
  document.addEventListener(
3476
3473
  "touchmove",
3477
3474
  onTouchMove,
3478
- passiveSupported ? { passive: false } : false
3475
+ false
3479
3476
  );
3480
3477
  if (!totalLockCount) {
3481
3478
  document.body.classList.add(BODY_LOCK_CLASS);
@@ -8046,7 +8043,7 @@ const InternalPickerPanel = (props, ref) => {
8046
8043
  moving: moving.current
8047
8044
  }));
8048
8045
  useEffect(() => {
8049
- const eventOptions = passiveSupported ? { passive: false, once: true } : false;
8046
+ const eventOptions = false;
8050
8047
  const element = pickerPanelRef.current;
8051
8048
  element.addEventListener("touchstart", touchStart, eventOptions);
8052
8049
  element.addEventListener("touchmove", touchMove, eventOptions);
@@ -10394,7 +10391,8 @@ const Input = forwardRef(
10394
10391
  const val = event.target.value;
10395
10392
  onFocus && onFocus(val);
10396
10393
  } else {
10397
- onFocus == null ? void 0 : onFocus(value);
10394
+ const height = (event.detail || {}).height;
10395
+ onFocus == null ? void 0 : onFocus(value, height);
10398
10396
  }
10399
10397
  setActive(true);
10400
10398
  };
@@ -2,7 +2,7 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("@tarojs/taro"), require("@tarojs/components"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "@tarojs/taro", "@tarojs/components", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.Taro, global2.components, global2.ReactDOM));
3
3
  })(this, function(exports2, React, Taro, components, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react-taro v2.5.2 Wed Apr 03 2024 18:05:52 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:09 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -3364,16 +3364,20 @@
3364
3364
  const offsetX = React.useRef(0);
3365
3365
  const offsetY = React.useRef(0);
3366
3366
  const direction = React.useRef("");
3367
- const touchTime = React.useRef(null);
3367
+ const last = React.useRef(false);
3368
+ const velocity = React.useRef(0);
3369
+ const touchTime = React.useRef(Date.now());
3368
3370
  const isVertical = () => direction.current === "vertical";
3369
3371
  const isHorizontal = () => direction.current === "horizontal";
3370
3372
  const reset = () => {
3371
- touchTime.current = null;
3373
+ touchTime.current = Date.now();
3372
3374
  deltaX.current = 0;
3373
3375
  deltaY.current = 0;
3374
3376
  offsetX.current = 0;
3375
3377
  offsetY.current = 0;
3378
+ delta.current = 0;
3376
3379
  direction.current = "";
3380
+ last.current = false;
3377
3381
  };
3378
3382
  const start = (event) => {
3379
3383
  reset();
@@ -3392,7 +3396,12 @@
3392
3396
  direction.current = getDirection(offsetX.current, offsetY.current);
3393
3397
  }
3394
3398
  };
3399
+ const end = (event) => {
3400
+ last.current = true;
3401
+ velocity.current = Math.sqrt(deltaX.current ** 2 + deltaY.current ** 2) / (Date.now() - touchTime.current);
3402
+ };
3395
3403
  return {
3404
+ end,
3396
3405
  move,
3397
3406
  start,
3398
3407
  reset,
@@ -3406,7 +3415,8 @@
3406
3415
  offsetY,
3407
3416
  direction,
3408
3417
  isVertical,
3409
- isHorizontal
3418
+ isHorizontal,
3419
+ last
3410
3420
  };
3411
3421
  }
3412
3422
  const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
@@ -3430,19 +3440,6 @@
3430
3440
  }
3431
3441
  return root2;
3432
3442
  }
3433
- let passiveSupported = false;
3434
- if (canUseDom) {
3435
- try {
3436
- const opts = Object.defineProperty({}, "passive", {
3437
- get() {
3438
- passiveSupported = true;
3439
- }
3440
- });
3441
- window.addEventListener("test-passive-supported", null, opts);
3442
- } catch (e2) {
3443
- console.log(e2);
3444
- }
3445
- }
3446
3443
  let totalLockCount = 0;
3447
3444
  const BODY_LOCK_CLASS = "nut-overflow-hidden";
3448
3445
  function getScrollableElement(el) {
@@ -3491,7 +3488,7 @@
3491
3488
  document.addEventListener(
3492
3489
  "touchmove",
3493
3490
  onTouchMove,
3494
- passiveSupported ? { passive: false } : false
3491
+ false
3495
3492
  );
3496
3493
  if (!totalLockCount) {
3497
3494
  document.body.classList.add(BODY_LOCK_CLASS);
@@ -8062,7 +8059,7 @@
8062
8059
  moving: moving.current
8063
8060
  }));
8064
8061
  React.useEffect(() => {
8065
- const eventOptions = passiveSupported ? { passive: false, once: true } : false;
8062
+ const eventOptions = false;
8066
8063
  const element = pickerPanelRef.current;
8067
8064
  element.addEventListener("touchstart", touchStart, eventOptions);
8068
8065
  element.addEventListener("touchmove", touchMove, eventOptions);
@@ -10410,7 +10407,8 @@
10410
10407
  const val = event.target.value;
10411
10408
  onFocus && onFocus(val);
10412
10409
  } else {
10413
- onFocus == null ? void 0 : onFocus(value);
10410
+ const height = (event.detail || {}).height;
10411
+ onFocus == null ? void 0 : onFocus(value, height);
10414
10412
  }
10415
10413
  setActive(true);
10416
10414
  };
@@ -1,7 +1,6 @@
1
1
 
2
2
  .form-layout-right .nut-form-item-label {
3
3
  text-align: right;
4
- font-size: 14px;
5
4
  padding-right: 24px;
6
5
  white-space: nowrap;
7
6
  }
@@ -9,7 +8,6 @@
9
8
  .form-layout-left .nut-form-item-label {
10
9
  position: relative;
11
10
  text-align: left;
12
- font-size: 14px;
13
11
  padding-left: 12px;
14
12
  white-space: nowrap;
15
13
 
@@ -30,7 +28,6 @@
30
28
  .form-layout-top .nut-form-item-label {
31
29
  padding-bottom: 4px;
32
30
  display: block;
33
- font-size: 14px;
34
31
  padding-right: 24px;
35
32
  }
36
33
 
@@ -1,22 +1,10 @@
1
1
 
2
2
  .nut-swiper {
3
- position: relative;
4
- z-index: 1;
5
- display: flex;
6
- transition-property: transform;
7
- box-sizing: content-box;
3
+ width: 100%;
4
+ height: 100%;
8
5
  overflow: hidden;
9
-
10
- &-inner {
11
- display: flex;
12
- height: 100%;
13
- }
14
-
15
- &-vertical {
16
- -webkit-box-orient: vertical;
17
- -webkit-box-direction: normal;
18
- flex-direction: column;
19
- }
6
+ touch-action: none;
7
+ position: relative;
20
8
 
21
9
  &-indicator {
22
10
  display: flex;
@@ -38,6 +26,32 @@
38
26
  z-index: 1;
39
27
  }
40
28
  }
29
+ .nut-swiper-inner {
30
+ width: 100%;
31
+ height: 100%;
32
+ display: flex;
33
+ position: relative;
34
+ &-horizontal {
35
+ transform: translateX(var(--swiper-offset));
36
+ }
37
+
38
+ &-vertical {
39
+ transform: translateY(var(--swiper-offset));
40
+ flex-direction: column;
41
+ }
42
+ }
43
+
44
+ .nut-swiper-slide {
45
+ width: 100%;
46
+ height: 100%;
47
+ position: relative;
48
+ flex-shrink: 0;
49
+ }
50
+
51
+ .nut-swiper-item {
52
+ width: 100%;
53
+ height: 100%;
54
+ }
41
55
 
42
56
  [dir='rtl'] .nut-swiper,
43
57
  .nut-rtl .nut-swiper {