@nutui/nutui-react-taro 2.6.8 → 2.6.9

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 (66) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/esm/ActionSheet.js +1 -1
  3. package/dist/esm/Address.js +1 -1
  4. package/dist/esm/Calendar.js +1 -1
  5. package/dist/esm/Cascader.js +1 -1
  6. package/dist/esm/DatePicker.js +1 -1
  7. package/dist/esm/Dialog.js +1 -1
  8. package/dist/esm/Drag/style/style.css +1 -1
  9. package/dist/esm/Drag.js +1 -1
  10. package/dist/esm/FixedNav.js +1 -1
  11. package/dist/esm/Form.js +1 -1
  12. package/dist/esm/ImagePreview.js +1 -1
  13. package/dist/esm/Menu.js +1 -1
  14. package/dist/esm/MenuItem.js +1 -1
  15. package/dist/esm/NumberKeyboard.js +1 -1
  16. package/dist/esm/Overlay.js +1 -1
  17. package/dist/esm/Picker.js +1 -1
  18. package/dist/esm/Popover.js +1 -1
  19. package/dist/esm/Popup.js +1 -1
  20. package/dist/esm/SearchBar.js +1 -1
  21. package/dist/esm/ShortPassword.js +1 -1
  22. package/dist/esm/SideNavBar.js +1 -1
  23. package/dist/esm/Sticky.js +1 -1
  24. package/dist/esm/TimeSelect.js +1 -1
  25. package/dist/esm/Toast.js +1 -1
  26. package/dist/esm/Tour.js +1 -1
  27. package/dist/esm/{actionsheet.taro-CQzUaPSP.js → actionsheet.taro-Cla34tFO.js} +1 -1
  28. package/dist/esm/{address.taro-D7DEQdo8.js → address.taro-D0tjP5C1.js} +2 -2
  29. package/dist/esm/{calendar.taro-B3D8xMB3.js → calendar.taro-CDZqFYlk.js} +1 -1
  30. package/dist/esm/{cascader.taro-BOifacJL.js → cascader.taro-c6WPcYsc.js} +1 -1
  31. package/dist/esm/{datepicker.taro-DzZmcesp.js → datepicker.taro-CcP4XLtj.js} +1 -1
  32. package/dist/esm/{dialog.taro-BNVpTbBx.js → dialog.taro-jZ6_EUiF.js} +1 -1
  33. package/dist/esm/{drag.taro-D6xGnWqk.js → drag.taro-CBNVFciU.js} +10 -5
  34. package/dist/esm/{fixednav.taro-bmuCveIB.js → fixednav.taro-CewDiT-u.js} +1 -1
  35. package/dist/esm/{get-scroll-parent-9ZDWApX2.js → get-scroll-parent-DB1VRg11.js} +1 -0
  36. package/dist/esm/{imagepreview.taro-CytOhJpv.js → imagepreview.taro-CBT7aS3-.js} +1 -1
  37. package/dist/esm/{menu.taro-70-DLJx5.js → menu.taro-DkKY62ym.js} +1 -1
  38. package/dist/esm/{menuitem.taro-jJWuQbQt.js → menuitem.taro-CKjl8_Cl.js} +1 -1
  39. package/dist/esm/{numberkeyboard.taro-Cx3igTDN.js → numberkeyboard.taro-CFJtMOew.js} +1 -1
  40. package/dist/esm/nutui-react.es.js +23 -23
  41. package/dist/esm/{overlay.taro-Bu45p46Z.js → overlay.taro-BJ3twlP0.js} +16 -2
  42. package/dist/esm/{picker.taro-va25oy1i.js → picker.taro-D3G6mJ-I.js} +3 -2
  43. package/dist/esm/{popover.taro-D1Jnx8Xp.js → popover.taro-Dve2UnRF.js} +1 -1
  44. package/dist/esm/{popup.taro-C_nam_bX.js → popup.taro-cT6cbAxw.js} +1 -1
  45. package/dist/esm/{searchbar.taro-B31m8apz.js → searchbar.taro-BptyG-eR.js} +1 -0
  46. package/dist/esm/{shortpassword.taro-Bn5n4rrx.js → shortpassword.taro-BVp4BrTs.js} +1 -1
  47. package/dist/esm/{sidenavbar.taro-BgKUZ--g.js → sidenavbar.taro-DGnJgxEe.js} +1 -1
  48. package/dist/esm/{sticky.taro-BtxnArYZ.js → sticky.taro-CqiMtDv9.js} +1 -1
  49. package/dist/esm/{timeselect.taro-DtyB_UVM.js → timeselect.taro-C64SUiXS.js} +1 -1
  50. package/dist/esm/{toast.taro-C-jP8orA.js → toast.taro-CSqE0aIO.js} +1 -1
  51. package/dist/esm/{tour.taro-D_J_gGVX.js → tour.taro-DegQCG1T.js} +1 -1
  52. package/dist/locales/base.js +1 -1
  53. package/dist/locales/en-US.js +1 -1
  54. package/dist/locales/id-ID.js +1 -1
  55. package/dist/locales/tr-TR.js +1 -1
  56. package/dist/locales/zh-CN.js +1 -1
  57. package/dist/locales/zh-TW.js +1 -1
  58. package/dist/locales/zh-UG.js +1 -1
  59. package/dist/nutui.react.es.js +25 -7
  60. package/dist/nutui.react.umd.js +25 -7
  61. package/dist/packages/drag/drag.scss +7 -3
  62. package/dist/style.css +1 -1
  63. package/dist/style.mjs +1 -1
  64. package/dist/types/packages/searchbar/searchbar.d.ts +1 -1
  65. package/dist/types/packages/searchbar/searchbar.taro.d.ts +1 -1
  66. package/package.json +1 -1
@@ -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-D1Jnx8Xp.js";
5
+ import { P as Popover } from "./popover.taro-Dve2UnRF.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";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:57 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:55 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.6.8 Fri May 31 2024 16:03:24 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:28 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -3423,6 +3423,19 @@ function getScrollParent(el, root2 = defaultRoot) {
3423
3423
  }
3424
3424
  return root2;
3425
3425
  }
3426
+ let passiveSupported = false;
3427
+ if (canUseDom) {
3428
+ try {
3429
+ const opts = Object.defineProperty({}, "passive", {
3430
+ get() {
3431
+ passiveSupported = true;
3432
+ }
3433
+ });
3434
+ window.addEventListener("test-passive-supported", null, opts);
3435
+ } catch (e2) {
3436
+ console.log(e2);
3437
+ }
3438
+ }
3426
3439
  let totalLockCount = 0;
3427
3440
  const BODY_LOCK_CLASS = "nut-overflow-hidden";
3428
3441
  function getScrollableElement(el) {
@@ -3471,7 +3484,7 @@ function useLockScroll(rootRef, shouldLock) {
3471
3484
  document.addEventListener(
3472
3485
  "touchmove",
3473
3486
  onTouchMove,
3474
- false
3487
+ passiveSupported ? { passive: false } : false
3475
3488
  );
3476
3489
  if (!totalLockCount) {
3477
3490
  document.body.classList.add(BODY_LOCK_CLASS);
@@ -8029,7 +8042,7 @@ const InternalPickerPanel = (props, ref) => {
8029
8042
  moving: moving.current
8030
8043
  }));
8031
8044
  useEffect(() => {
8032
- const eventOptions = false;
8045
+ const eventOptions = passiveSupported ? { passive: false, once: true } : false;
8033
8046
  const element = pickerPanelRef.current;
8034
8047
  element.addEventListener("touchstart", touchStart, eventOptions);
8035
8048
  element.addEventListener("touchmove", touchMove, eventOptions);
@@ -10081,7 +10094,7 @@ const Form = React__default.forwardRef(
10081
10094
  resetFields();
10082
10095
  }
10083
10096
  },
10084
- /* @__PURE__ */ React__default.createElement(Cell.Group, { divider }, /* @__PURE__ */ React__default.createElement(Context.Provider, { value: formInstance }, children), footer ? /* @__PURE__ */ React__default.createElement(Cell, null, footer) : null)
10097
+ /* @__PURE__ */ React__default.createElement(Cell.Group, { divider }, /* @__PURE__ */ React__default.createElement(Context.Provider, { value: formInstance }, children), footer ? /* @__PURE__ */ React__default.createElement(Cell, { className: `${classPrefix2}-footer` }, footer) : null)
10085
10098
  );
10086
10099
  }
10087
10100
  );
@@ -12030,6 +12043,7 @@ const SearchBar = (props) => {
12030
12043
  }
12031
12044
  setValue("");
12032
12045
  forceFocus();
12046
+ onChange && (onChange == null ? void 0 : onChange(""));
12033
12047
  onClear && onClear(event);
12034
12048
  };
12035
12049
  const onKeypress = (e2) => {
@@ -13623,17 +13637,20 @@ const Drag = (props) => {
13623
13637
  const translateX = useRef(0);
13624
13638
  const translateY = useRef(0);
13625
13639
  const middleLine = useRef(0);
13626
- const getInfo = () => {
13640
+ const getInfo = async () => {
13641
+ var _a;
13627
13642
  const el = myDrag.current;
13628
13643
  if (el) {
13629
13644
  const { top, left: left2, bottom, right: right2 } = boundary;
13630
13645
  const { screenWidth, windowHeight } = getSystemInfoSync();
13646
+ const { width, height } = await getRectByTaro(dragRef.current);
13647
+ (_a = dragRef.current) == null ? void 0 : _a.getBoundingClientRect();
13631
13648
  createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
13632
13649
  setBoundaryState({
13633
13650
  top: -rec.top + top,
13634
13651
  left: -rec.left + left2,
13635
- bottom: windowHeight - rec.height - rec.top - bottom,
13636
- right: screenWidth - rec.width - rec.left - right2
13652
+ bottom: windowHeight - rec.top - bottom - Math.ceil(height),
13653
+ right: screenWidth - rec.left - right2 - Math.ceil(width)
13637
13654
  });
13638
13655
  middleLine.current = screenWidth - rec.width - rec.left - (screenWidth - rec.width) / 2;
13639
13656
  }).exec();
@@ -13696,6 +13713,7 @@ const Drag = (props) => {
13696
13713
  /* @__PURE__ */ React__default.createElement(
13697
13714
  "div",
13698
13715
  {
13716
+ className: `${classPrefix2}-inner`,
13699
13717
  onTouchStart: (event) => touchStart(event),
13700
13718
  ref: dragRef,
13701
13719
  onTouchMove: touchMove,
@@ -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.6.8 Fri May 31 2024 16:03:24 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react-taro v2.6.9 Fri Jun 14 2024 17:06:28 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -3439,6 +3439,19 @@
3439
3439
  }
3440
3440
  return root2;
3441
3441
  }
3442
+ let passiveSupported = false;
3443
+ if (canUseDom) {
3444
+ try {
3445
+ const opts = Object.defineProperty({}, "passive", {
3446
+ get() {
3447
+ passiveSupported = true;
3448
+ }
3449
+ });
3450
+ window.addEventListener("test-passive-supported", null, opts);
3451
+ } catch (e2) {
3452
+ console.log(e2);
3453
+ }
3454
+ }
3442
3455
  let totalLockCount = 0;
3443
3456
  const BODY_LOCK_CLASS = "nut-overflow-hidden";
3444
3457
  function getScrollableElement(el) {
@@ -3487,7 +3500,7 @@
3487
3500
  document.addEventListener(
3488
3501
  "touchmove",
3489
3502
  onTouchMove,
3490
- false
3503
+ passiveSupported ? { passive: false } : false
3491
3504
  );
3492
3505
  if (!totalLockCount) {
3493
3506
  document.body.classList.add(BODY_LOCK_CLASS);
@@ -8045,7 +8058,7 @@
8045
8058
  moving: moving.current
8046
8059
  }));
8047
8060
  React.useEffect(() => {
8048
- const eventOptions = false;
8061
+ const eventOptions = passiveSupported ? { passive: false, once: true } : false;
8049
8062
  const element = pickerPanelRef.current;
8050
8063
  element.addEventListener("touchstart", touchStart, eventOptions);
8051
8064
  element.addEventListener("touchmove", touchMove, eventOptions);
@@ -10097,7 +10110,7 @@
10097
10110
  resetFields();
10098
10111
  }
10099
10112
  },
10100
- /* @__PURE__ */ React.createElement(Cell.Group, { divider }, /* @__PURE__ */ React.createElement(Context.Provider, { value: formInstance }, children), footer ? /* @__PURE__ */ React.createElement(Cell, null, footer) : null)
10113
+ /* @__PURE__ */ React.createElement(Cell.Group, { divider }, /* @__PURE__ */ React.createElement(Context.Provider, { value: formInstance }, children), footer ? /* @__PURE__ */ React.createElement(Cell, { className: `${classPrefix2}-footer` }, footer) : null)
10101
10114
  );
10102
10115
  }
10103
10116
  );
@@ -12046,6 +12059,7 @@
12046
12059
  }
12047
12060
  setValue("");
12048
12061
  forceFocus();
12062
+ onChange && (onChange == null ? void 0 : onChange(""));
12049
12063
  onClear && onClear(event);
12050
12064
  };
12051
12065
  const onKeypress = (e2) => {
@@ -13639,17 +13653,20 @@
13639
13653
  const translateX = React.useRef(0);
13640
13654
  const translateY = React.useRef(0);
13641
13655
  const middleLine = React.useRef(0);
13642
- const getInfo = () => {
13656
+ const getInfo = async () => {
13657
+ var _a;
13643
13658
  const el = myDrag.current;
13644
13659
  if (el) {
13645
13660
  const { top, left: left2, bottom, right: right2 } = boundary;
13646
13661
  const { screenWidth, windowHeight } = Taro.getSystemInfoSync();
13662
+ const { width, height } = await getRectByTaro(dragRef.current);
13663
+ (_a = dragRef.current) == null ? void 0 : _a.getBoundingClientRect();
13647
13664
  Taro.createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
13648
13665
  setBoundaryState({
13649
13666
  top: -rec.top + top,
13650
13667
  left: -rec.left + left2,
13651
- bottom: windowHeight - rec.height - rec.top - bottom,
13652
- right: screenWidth - rec.width - rec.left - right2
13668
+ bottom: windowHeight - rec.top - bottom - Math.ceil(height),
13669
+ right: screenWidth - rec.left - right2 - Math.ceil(width)
13653
13670
  });
13654
13671
  middleLine.current = screenWidth - rec.width - rec.left - (screenWidth - rec.width) / 2;
13655
13672
  }).exec();
@@ -13712,6 +13729,7 @@
13712
13729
  /* @__PURE__ */ React.createElement(
13713
13730
  "div",
13714
13731
  {
13732
+ className: `${classPrefix2}-inner`,
13715
13733
  onTouchStart: (event) => touchStart(event),
13716
13734
  ref: dragRef,
13717
13735
  onTouchMove: touchMove,
@@ -1,10 +1,14 @@
1
1
  .nut-drag {
2
2
  position: fixed;
3
- display: inline-flex;
4
3
  z-index: 9997 !important;
5
- width: fit-content;
6
- height: fit-content;
4
+ width: 0;
5
+ height: 0;
7
6
  touch-action: none;
8
7
  user-select: none;
9
8
  font-size: 0;
9
+ &-inner {
10
+ display: inline-flex;
11
+ width: fit-content;
12
+ height: fit-content;
13
+ }
10
14
  }