@nutui/nutui-react-taro 2.7.4 → 2.7.6

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 (68) hide show
  1. package/CHANGELOG.md +28 -6
  2. package/dist/esm/Address.js +1 -1
  3. package/dist/esm/Audio.js +1 -1
  4. package/dist/esm/Barrage.js +1 -1
  5. package/dist/esm/Cascader.js +1 -1
  6. package/dist/esm/Cell/style/style.css +1 -1
  7. package/dist/esm/CellGroup/style/style.css +1 -1
  8. package/dist/esm/DatePicker.js +1 -1
  9. package/dist/esm/Drag.js +1 -1
  10. package/dist/esm/Ellipsis.js +1 -1
  11. package/dist/esm/Form/style/style.css +1 -1
  12. package/dist/esm/FormItem/style/style.css +1 -1
  13. package/dist/esm/Menu.js +1 -1
  14. package/dist/esm/MenuItem.js +1 -1
  15. package/dist/esm/NavBar.js +1 -1
  16. package/dist/esm/NoticeBar.js +1 -1
  17. package/dist/esm/Picker.js +1 -1
  18. package/dist/esm/Popover.js +1 -1
  19. package/dist/esm/Range.js +1 -1
  20. package/dist/esm/Rate.js +1 -1
  21. package/dist/esm/Sticky.js +1 -1
  22. package/dist/esm/Swipe.js +1 -1
  23. package/dist/esm/Swiper.js +1 -1
  24. package/dist/esm/Tabs.js +1 -1
  25. package/dist/esm/TextArea/style/style.css +1 -1
  26. package/dist/esm/Tour.js +1 -1
  27. package/dist/esm/Uploader.js +1 -1
  28. package/dist/esm/{address.taro-C8CsajMW.js → address.taro-BCoDZM6h.js} +1 -1
  29. package/dist/esm/{audio.taro-qK1wq4IH.js → audio.taro-DtIUjg89.js} +1 -1
  30. package/dist/esm/{barrage.taro-D2lmvcB-.js → barrage.taro-Dc2Wz_3H.js} +1 -1
  31. package/dist/esm/{cascader.taro-DRE3asjI.js → cascader.taro-BwRnRQXE.js} +1 -1
  32. package/dist/esm/{datepicker.taro-DU4OSraL.js → datepicker.taro-DicskhhH.js} +1 -1
  33. package/dist/esm/{drag.taro-BRXhy0yb.js → drag.taro-r5Lmncrq.js} +1 -1
  34. package/dist/esm/{ellipsis.taro-fvcP85Ir.js → ellipsis.taro-K9VJCTL6.js} +1 -1
  35. package/dist/esm/{get-rect-by-taro-THaHH07X.js → get-rect-by-taro-D0h6aiDr.js} +37 -0
  36. package/dist/esm/{menu.taro-BmjnA_YM.js → menu.taro-2APk--BX.js} +1 -1
  37. package/dist/esm/{menuitem.taro-DCqPC4Nu.js → menuitem.taro-BMlSqBSc.js} +1 -1
  38. package/dist/esm/{navbar.taro-HRFRDGii.js → navbar.taro-B_9Ezsny.js} +1 -1
  39. package/dist/esm/{noticebar.taro-BjKDC7We.js → noticebar.taro-B0qm66Cu.js} +1 -1
  40. package/dist/esm/nutui-react.es.js +20 -20
  41. package/dist/esm/{picker.taro-CYNZBTE4.js → picker.taro-B7EE52qf.js} +1 -1
  42. package/dist/esm/{popover.taro-o5vHvHsm.js → popover.taro-C9qhPJCb.js} +1 -1
  43. package/dist/esm/{range.taro-D4U2Q7Wx.js → range.taro-Bbs4JcXp.js} +1 -1
  44. package/dist/esm/{rate.taro-CPGkjYYu.js → rate.taro-DsDMiRHd.js} +1 -1
  45. package/dist/esm/{sticky.taro-DC98CdU7.js → sticky.taro-DtUAawu_.js} +1 -1
  46. package/dist/esm/{swipe.taro-Bsk2fnEl.js → swipe.taro-CUZSZcIh.js} +1 -1
  47. package/dist/esm/{tabs.taro-CY1VxgF-.js → tabs.taro-CnXiMR_B.js} +1 -1
  48. package/dist/esm/{tour.taro-DfOfyyte.js → tour.taro-BidQx8Fg.js} +1 -1
  49. package/dist/esm/{uploader.taro-C3hV5Aih.js → uploader.taro-BBJsHrew.js} +1 -1
  50. package/dist/locales/base.js +1 -1
  51. package/dist/locales/en-US.js +1 -1
  52. package/dist/locales/id-ID.js +1 -1
  53. package/dist/locales/tr-TR.js +1 -1
  54. package/dist/locales/zh-CN.js +1 -1
  55. package/dist/locales/zh-TW.js +1 -1
  56. package/dist/locales/zh-UG.js +1 -1
  57. package/dist/nutui.react.es.js +40 -3
  58. package/dist/nutui.react.umd.js +40 -3
  59. package/dist/packages/cellgroup/cellgroup.scss +1 -1
  60. package/dist/packages/formitem/formitem.scss +18 -1
  61. package/dist/packages/textarea/textarea.scss +3 -4
  62. package/dist/style.css +1 -1
  63. package/dist/styles/variables-jmapp.scss +5 -0
  64. package/dist/styles/variables.scss +1 -0
  65. package/dist/types/packages/configprovider/types.d.ts +1 -1
  66. package/dist/types/packages/uploader/uploader.taro.d.ts +15 -3
  67. package/dist/types/utils/lru.d.ts +8 -0
  68. package/package.json +1 -1
@@ -3,7 +3,7 @@ import React__default, { useRef, useEffect, useState, useMemo, useCallback } fro
3
3
  import classNames from "classnames";
4
4
  import { getEnv, usePageScroll, getSystemInfoSync } from "@tarojs/taro";
5
5
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
6
- import { g as getRectByTaro } from "./get-rect-by-taro-THaHH07X.js";
6
+ import { g as getRectByTaro } from "./get-rect-by-taro-D0h6aiDr.js";
7
7
  import { g as getScrollParent } from "./get-scroll-parent-DB1VRg11.js";
8
8
  function useWatch(dep, callback, config = { immediate: false }) {
9
9
  const { immediate } = config;
@@ -4,7 +4,7 @@ import classNames from "classnames";
4
4
  import { View } from "@tarojs/components";
5
5
  import { useReady, nextTick } from "@tarojs/taro";
6
6
  import { u as useTouch } from "./use-touch-BeiLHDO9.js";
7
- import { g as getRectByTaro } from "./get-rect-by-taro-THaHH07X.js";
7
+ import { g as getRectByTaro } from "./get-rect-by-taro-D0h6aiDr.js";
8
8
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
9
9
  function preventDefault(event, isStopPropagation) {
10
10
  if (typeof event.cancelable !== "boolean" || event.cancelable) {
@@ -152,7 +152,7 @@ const Tabs = (props) => {
152
152
  Object.assign({ className: classes }, rest),
153
153
  React__default.createElement(
154
154
  ScrollView,
155
- { enableFlex: true, scrollX: direction === "horizontal", scrollY: direction === "vertical", scrollLeft, scrollTop, showScrollbar: false, scrollWithAnimation: rtl && Taro.getEnv() !== "WEB" ? false : scrollWithAnimation.current, id: `nut-tabs-titles-${name || uuid}`, className: classesTitle, style: Object.assign({}, tabStyle) },
155
+ { enableFlex: true, scrollX: direction === "horizontal", scrollY: direction === "vertical", scrollLeft, scrollTop, enhanced: true, showScrollbar: false, scrollWithAnimation: rtl && Taro.getEnv() !== "WEB" ? false : scrollWithAnimation.current, id: `nut-tabs-titles-${name || uuid}`, className: classesTitle, style: Object.assign({}, tabStyle) },
156
156
  React__default.createElement(View, { className: "nut-tabs-list", ref: navRef }, !!title && typeof title === "function" ? title() : titles.current.map((item, index) => {
157
157
  return React__default.createElement(
158
158
  View,
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-iWu3F_1J.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-o5vHvHsm.js";
5
+ import { P as Popover } from "./popover.taro-C9qhPJCb.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";
@@ -257,7 +257,7 @@ const InternalUploader = (props, ref) => {
257
257
  document.body.appendChild(obj);
258
258
  }
259
259
  }
260
- if ((getEnv() === "WEAPP" || getEnv() === "JD") && chooseMedia) {
260
+ if (["WEAPP", "JD", "WEB"].includes(getEnv()) && chooseMedia) {
261
261
  chooseMedia({
262
262
  count: multiple ? maxCount * 1 - fileList.length : 1,
263
263
  /** 文件类型 */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:12:04 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:44:00 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.7.4 Fri Dec 20 2024 20:11:41 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:43:35 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -3945,6 +3945,35 @@ function useWatch(dep, callback, config2 = { immediate: false }) {
3945
3945
  stop.current = true;
3946
3946
  };
3947
3947
  }
3948
+ class MiniLru {
3949
+ constructor(capacity) {
3950
+ if (capacity <= 0) {
3951
+ throw new Error("Cache capacity must be a positive number");
3952
+ }
3953
+ this.cache = /* @__PURE__ */ new Map();
3954
+ this.capacity = capacity;
3955
+ }
3956
+ get(key) {
3957
+ if (this.cache.has(key)) {
3958
+ const value = this.cache.get(key);
3959
+ this.cache.delete(key);
3960
+ this.cache.set(key, value);
3961
+ return value;
3962
+ }
3963
+ return null;
3964
+ }
3965
+ set(key, value) {
3966
+ if (this.cache.has(key)) {
3967
+ this.cache.delete(key);
3968
+ } else if (this.cache.size >= this.capacity) {
3969
+ this.cache.delete(this.cache.keys().next().value);
3970
+ }
3971
+ this.cache.set(key, value);
3972
+ }
3973
+ has(key) {
3974
+ return this.cache.has(key);
3975
+ }
3976
+ }
3948
3977
  const inBrowser$1 = typeof document !== "undefined" && !!document.scripts;
3949
3978
  function isWindow(val) {
3950
3979
  return val === window;
@@ -3975,6 +4004,7 @@ const getRect = (elementRef) => {
3975
4004
  height: 0
3976
4005
  };
3977
4006
  };
4007
+ const lru = new MiniLru(10);
3978
4008
  function makeRect(width, height) {
3979
4009
  return {
3980
4010
  top: 0,
@@ -3991,7 +4021,14 @@ const getRectByTaro = async (element) => {
3991
4021
  return Promise.resolve(getRect(element));
3992
4022
  }
3993
4023
  return new Promise((resolve, reject) => {
4024
+ if (lru.has(element)) {
4025
+ resolve(lru.get(element));
4026
+ return;
4027
+ }
3994
4028
  createSelectorQuery().select(`#${element.uid}`).boundingClientRect().exec(([rects]) => {
4029
+ if (rects) {
4030
+ lru.set(element, rects);
4031
+ }
3995
4032
  resolve(rects);
3996
4033
  });
3997
4034
  });
@@ -5410,6 +5447,7 @@ const Tabs = (props) => {
5410
5447
  scrollY: direction === "vertical",
5411
5448
  scrollLeft,
5412
5449
  scrollTop,
5450
+ enhanced: true,
5413
5451
  showScrollbar: false,
5414
5452
  scrollWithAnimation: rtl && Taro.getEnv() !== "WEB" ? false : scrollWithAnimation.current,
5415
5453
  id: `nut-tabs-titles-${name || uuid}`,
@@ -13124,7 +13162,7 @@ const InternalUploader = (props, ref) => {
13124
13162
  document.body.appendChild(obj);
13125
13163
  }
13126
13164
  }
13127
- if ((getEnv() === "WEAPP" || getEnv() === "JD") && chooseMedia) {
13165
+ if (["WEAPP", "JD", "WEB"].includes(getEnv()) && chooseMedia) {
13128
13166
  chooseMedia({
13129
13167
  count: multiple ? maxCount * 1 - fileList.length : 1,
13130
13168
  /** 文件类型 */
@@ -16927,7 +16965,6 @@ const Swiper = forwardRef((props, ref) => {
16927
16965
  indicator,
16928
16966
  loop,
16929
16967
  autoPlay,
16930
- duration,
16931
16968
  direction,
16932
16969
  defaultValue,
16933
16970
  onChange,
@@ -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.7.4 Fri Dec 20 2024 20:11:41 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react-taro v2.7.6 Fri Jan 10 2025 10:43:35 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -3961,6 +3961,35 @@
3961
3961
  stop.current = true;
3962
3962
  };
3963
3963
  }
3964
+ class MiniLru {
3965
+ constructor(capacity) {
3966
+ if (capacity <= 0) {
3967
+ throw new Error("Cache capacity must be a positive number");
3968
+ }
3969
+ this.cache = /* @__PURE__ */ new Map();
3970
+ this.capacity = capacity;
3971
+ }
3972
+ get(key) {
3973
+ if (this.cache.has(key)) {
3974
+ const value = this.cache.get(key);
3975
+ this.cache.delete(key);
3976
+ this.cache.set(key, value);
3977
+ return value;
3978
+ }
3979
+ return null;
3980
+ }
3981
+ set(key, value) {
3982
+ if (this.cache.has(key)) {
3983
+ this.cache.delete(key);
3984
+ } else if (this.cache.size >= this.capacity) {
3985
+ this.cache.delete(this.cache.keys().next().value);
3986
+ }
3987
+ this.cache.set(key, value);
3988
+ }
3989
+ has(key) {
3990
+ return this.cache.has(key);
3991
+ }
3992
+ }
3964
3993
  const inBrowser$1 = typeof document !== "undefined" && !!document.scripts;
3965
3994
  function isWindow(val) {
3966
3995
  return val === window;
@@ -3991,6 +4020,7 @@
3991
4020
  height: 0
3992
4021
  };
3993
4022
  };
4023
+ const lru = new MiniLru(10);
3994
4024
  function makeRect(width, height) {
3995
4025
  return {
3996
4026
  top: 0,
@@ -4007,7 +4037,14 @@
4007
4037
  return Promise.resolve(getRect(element));
4008
4038
  }
4009
4039
  return new Promise((resolve, reject) => {
4040
+ if (lru.has(element)) {
4041
+ resolve(lru.get(element));
4042
+ return;
4043
+ }
4010
4044
  Taro.createSelectorQuery().select(`#${element.uid}`).boundingClientRect().exec(([rects]) => {
4045
+ if (rects) {
4046
+ lru.set(element, rects);
4047
+ }
4011
4048
  resolve(rects);
4012
4049
  });
4013
4050
  });
@@ -5426,6 +5463,7 @@
5426
5463
  scrollY: direction === "vertical",
5427
5464
  scrollLeft,
5428
5465
  scrollTop,
5466
+ enhanced: true,
5429
5467
  showScrollbar: false,
5430
5468
  scrollWithAnimation: rtl && Taro.getEnv() !== "WEB" ? false : scrollWithAnimation.current,
5431
5469
  id: `nut-tabs-titles-${name || uuid}`,
@@ -13140,7 +13178,7 @@
13140
13178
  document.body.appendChild(obj);
13141
13179
  }
13142
13180
  }
13143
- if ((Taro.getEnv() === "WEAPP" || Taro.getEnv() === "JD") && Taro.chooseMedia) {
13181
+ if (["WEAPP", "JD", "WEB"].includes(Taro.getEnv()) && Taro.chooseMedia) {
13144
13182
  Taro.chooseMedia({
13145
13183
  count: multiple ? maxCount * 1 - fileList.length : 1,
13146
13184
  /** 文件类型 */
@@ -16943,7 +16981,6 @@
16943
16981
  indicator,
16944
16982
  loop,
16945
16983
  autoPlay,
16946
- duration,
16947
16984
  direction,
16948
16985
  defaultValue,
16949
16986
  onChange,
@@ -50,7 +50,7 @@
50
50
 
51
51
  &:last-child {
52
52
  .nut-cell-divider {
53
- border-top: 0 !important;
53
+ border-top: 0;
54
54
  }
55
55
  }
56
56
  }
@@ -25,11 +25,12 @@
25
25
  position: absolute;
26
26
  left: -0.8em;
27
27
  }
28
+
28
29
  .nut-form-item-labeltxt {
29
30
  font-size: $form-item-label-font-size;
30
- height: 10px;
31
31
  position: relative;
32
32
  }
33
+
33
34
  &-body {
34
35
  flex: 1;
35
36
  display: flex;
@@ -60,6 +61,7 @@
60
61
 
61
62
  .nut-textarea {
62
63
  padding: 0;
64
+
63
65
  .nut-textarea-textarea {
64
66
  font: inherit;
65
67
  text-align: $form-item-body-input-text-align;
@@ -75,6 +77,16 @@
75
77
  }
76
78
  }
77
79
 
80
+ .nut-form {
81
+ .nut-cell-group {
82
+ .nut-cell-group-wrap-divider {
83
+ .nut-cell-divider {
84
+ border-top: $cell-divider-border-bottom;
85
+ }
86
+ }
87
+ }
88
+ }
89
+
78
90
  [dir='rtl'] .nut-form-item,
79
91
  .nut-rtl .nut-form-item {
80
92
  &-label {
@@ -89,21 +101,26 @@
89
101
  }
90
102
  }
91
103
  }
104
+
92
105
  &-body {
93
106
  &-slots {
94
107
  text-align: right;
108
+
95
109
  .nut-icon-ArrowRight,
96
110
  .nut-icon-ArrowLeft {
97
111
  transform: rotateY(180deg);
98
112
  }
113
+
99
114
  .nut-input-text {
100
115
  text-align: right;
101
116
  }
117
+
102
118
  .nut-textarea-textarea {
103
119
  text-align: right;
104
120
  }
105
121
  }
106
122
  }
123
+
107
124
  &-tips {
108
125
  text-align: right;
109
126
  }
@@ -1,8 +1,9 @@
1
1
  .nut-textarea {
2
+ display: flex;
3
+ flex-direction: column;
2
4
  position: relative;
3
5
  width: 100%;
4
6
  box-sizing: border-box;
5
- display: flex;
6
7
  background: $color-background-overlay;
7
8
  font-size: $textarea-font;
8
9
  padding: $textarea-padding;
@@ -16,11 +17,9 @@
16
17
  }
17
18
 
18
19
  &-limit {
19
- position: absolute;
20
- right: 15px;
21
- bottom: 12px;
22
20
  font-size: $textarea-font;
23
21
  color: $textarea-limit-color;
22
+ text-align: $textarea-limit-align;
24
23
  }
25
24
 
26
25
  &-textarea {