@nutui/nutui-react 3.0.12 → 3.0.13-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 (160) hide show
  1. package/CHANGELOG.md +8 -9
  2. package/dist/cjs/packages/address/style/address.scss +2 -2
  3. package/dist/cjs/packages/address/style/style.css +2 -2
  4. package/dist/cjs/packages/address/style-jmapp/address.scss +2 -2
  5. package/dist/cjs/packages/address/style-jmapp/style.css +2 -2
  6. package/dist/cjs/packages/address/style-jrkf/address.scss +2 -2
  7. package/dist/cjs/packages/address/style-jrkf/style.css +2 -2
  8. package/dist/cjs/packages/button/style/button.scss +3 -3
  9. package/dist/cjs/packages/button/style/style.css +3 -3
  10. package/dist/cjs/packages/button/style-jmapp/button.scss +3 -3
  11. package/dist/cjs/packages/button/style-jmapp/style.css +3 -3
  12. package/dist/cjs/packages/button/style-jrkf/button.scss +3 -3
  13. package/dist/cjs/packages/button/style-jrkf/style.css +3 -3
  14. package/dist/cjs/packages/collapseitem/style/collapseitem.scss +2 -2
  15. package/dist/cjs/packages/collapseitem/style/style.css +2 -2
  16. package/dist/cjs/packages/collapseitem/style-jmapp/collapseitem.scss +2 -2
  17. package/dist/cjs/packages/collapseitem/style-jmapp/style.css +2 -2
  18. package/dist/cjs/packages/collapseitem/style-jrkf/collapseitem.scss +2 -2
  19. package/dist/cjs/packages/collapseitem/style-jrkf/style.css +2 -2
  20. package/dist/cjs/packages/dialog/style/dialog.scss +1 -1
  21. package/dist/cjs/packages/dialog/style/style.css +1 -1
  22. package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +1 -1
  23. package/dist/cjs/packages/dialog/style-jmapp/style.css +1 -1
  24. package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +1 -1
  25. package/dist/cjs/packages/dialog/style-jrkf/style.css +1 -1
  26. package/dist/cjs/packages/loading/loading.js +0 -4
  27. package/dist/cjs/packages/numberkeyboard/style/numberkeyboard.scss +2 -2
  28. package/dist/cjs/packages/numberkeyboard/style/style.css +2 -2
  29. package/dist/cjs/packages/numberkeyboard/style-jmapp/numberkeyboard.scss +2 -2
  30. package/dist/cjs/packages/numberkeyboard/style-jmapp/style.css +2 -2
  31. package/dist/cjs/packages/numberkeyboard/style-jrkf/numberkeyboard.scss +2 -2
  32. package/dist/cjs/packages/numberkeyboard/style-jrkf/style.css +2 -2
  33. package/dist/cjs/packages/steps/style/steps.scss +1 -1
  34. package/dist/cjs/packages/steps/style/style.css +1 -1
  35. package/dist/cjs/packages/steps/style-jmapp/steps.scss +1 -1
  36. package/dist/cjs/packages/steps/style-jmapp/style.css +1 -1
  37. package/dist/cjs/packages/steps/style-jrkf/steps.scss +1 -1
  38. package/dist/cjs/packages/steps/style-jrkf/style.css +1 -1
  39. package/dist/cjs/packages/swiper/swiper.js +52 -43
  40. package/dist/cjs/packages/tabbaritem/style/style.css +4 -4
  41. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +4 -4
  42. package/dist/cjs/packages/tabbaritem/style-jmapp/style.css +4 -4
  43. package/dist/cjs/packages/tabbaritem/style-jmapp/tabbaritem.scss +4 -4
  44. package/dist/cjs/packages/tabbaritem/style-jrkf/style.css +4 -4
  45. package/dist/cjs/packages/tabbaritem/style-jrkf/tabbaritem.scss +4 -4
  46. package/dist/cjs/packages/tabs/style/style.css +2 -2
  47. package/dist/cjs/packages/tabs/style/tabs.scss +2 -2
  48. package/dist/cjs/packages/tabs/style-jmapp/style.css +2 -2
  49. package/dist/cjs/packages/tabs/style-jmapp/tabs.scss +2 -2
  50. package/dist/cjs/packages/tabs/style-jrkf/style.css +2 -2
  51. package/dist/cjs/packages/tabs/style-jrkf/tabs.scss +2 -2
  52. package/dist/cjs/packages/textarea/textarea.d.ts +2 -2
  53. package/dist/cjs/packages/textarea/textarea.js +25 -8
  54. package/dist/cjs/packages/toast/style/style.css +2 -2
  55. package/dist/cjs/packages/toast/style/toast.scss +2 -2
  56. package/dist/cjs/packages/toast/style-jmapp/style.css +2 -2
  57. package/dist/cjs/packages/toast/style-jmapp/toast.scss +2 -2
  58. package/dist/cjs/packages/toast/style-jrkf/style.css +2 -2
  59. package/dist/cjs/packages/toast/style-jrkf/toast.scss +2 -2
  60. package/dist/cjs/packages/uploader/style/style.css +1 -0
  61. package/dist/cjs/packages/uploader/style/uploader.scss +1 -0
  62. package/dist/cjs/packages/uploader/style-jmapp/style.css +1 -0
  63. package/dist/cjs/packages/uploader/style-jmapp/uploader.scss +1 -0
  64. package/dist/cjs/packages/uploader/style-jrkf/style.css +1 -0
  65. package/dist/cjs/packages/uploader/style-jrkf/uploader.scss +1 -0
  66. package/dist/cjs/types/spec/lottie/taro.d.ts +1 -0
  67. package/dist/cjs/types/spec/swiper/base.d.ts +4 -0
  68. package/dist/cjs/types/spec/swiper/taro.d.ts +4 -0
  69. package/dist/cjs/utils/index.d.ts +0 -1
  70. package/dist/cjs/utils/index.js +0 -1
  71. package/dist/cjs/utils/index.taro.js +0 -1
  72. package/dist/cjs/utils/taro/platform.d.ts +1 -0
  73. package/dist/cjs/utils/taro/platform.js +8 -0
  74. package/dist/cjs/utils/taro/px-transform.js +1 -1
  75. package/dist/es/packages/address/style/address.scss +2 -2
  76. package/dist/es/packages/address/style/style.css +2 -2
  77. package/dist/es/packages/address/style-jmapp/address.scss +2 -2
  78. package/dist/es/packages/address/style-jmapp/style.css +2 -2
  79. package/dist/es/packages/address/style-jrkf/address.scss +2 -2
  80. package/dist/es/packages/address/style-jrkf/style.css +2 -2
  81. package/dist/es/packages/button/style/button.scss +3 -3
  82. package/dist/es/packages/button/style/style.css +3 -3
  83. package/dist/es/packages/button/style-jmapp/button.scss +3 -3
  84. package/dist/es/packages/button/style-jmapp/style.css +3 -3
  85. package/dist/es/packages/button/style-jrkf/button.scss +3 -3
  86. package/dist/es/packages/button/style-jrkf/style.css +3 -3
  87. package/dist/es/packages/collapseitem/style/collapseitem.scss +2 -2
  88. package/dist/es/packages/collapseitem/style/style.css +2 -2
  89. package/dist/es/packages/collapseitem/style-jmapp/collapseitem.scss +2 -2
  90. package/dist/es/packages/collapseitem/style-jmapp/style.css +2 -2
  91. package/dist/es/packages/collapseitem/style-jrkf/collapseitem.scss +2 -2
  92. package/dist/es/packages/collapseitem/style-jrkf/style.css +2 -2
  93. package/dist/es/packages/dialog/style/dialog.scss +1 -1
  94. package/dist/es/packages/dialog/style/style.css +1 -1
  95. package/dist/es/packages/dialog/style-jmapp/dialog.scss +1 -1
  96. package/dist/es/packages/dialog/style-jmapp/style.css +1 -1
  97. package/dist/es/packages/dialog/style-jrkf/dialog.scss +1 -1
  98. package/dist/es/packages/dialog/style-jrkf/style.css +1 -1
  99. package/dist/es/packages/loading/loading.js +0 -4
  100. package/dist/es/packages/numberkeyboard/style/numberkeyboard.scss +2 -2
  101. package/dist/es/packages/numberkeyboard/style/style.css +2 -2
  102. package/dist/es/packages/numberkeyboard/style-jmapp/numberkeyboard.scss +2 -2
  103. package/dist/es/packages/numberkeyboard/style-jmapp/style.css +2 -2
  104. package/dist/es/packages/numberkeyboard/style-jrkf/numberkeyboard.scss +2 -2
  105. package/dist/es/packages/numberkeyboard/style-jrkf/style.css +2 -2
  106. package/dist/es/packages/steps/style/steps.scss +1 -1
  107. package/dist/es/packages/steps/style/style.css +1 -1
  108. package/dist/es/packages/steps/style-jmapp/steps.scss +1 -1
  109. package/dist/es/packages/steps/style-jmapp/style.css +1 -1
  110. package/dist/es/packages/steps/style-jrkf/steps.scss +1 -1
  111. package/dist/es/packages/steps/style-jrkf/style.css +1 -1
  112. package/dist/es/packages/swiper/swiper.js +53 -44
  113. package/dist/es/packages/tabbaritem/style/style.css +4 -4
  114. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +4 -4
  115. package/dist/es/packages/tabbaritem/style-jmapp/style.css +4 -4
  116. package/dist/es/packages/tabbaritem/style-jmapp/tabbaritem.scss +4 -4
  117. package/dist/es/packages/tabbaritem/style-jrkf/style.css +4 -4
  118. package/dist/es/packages/tabbaritem/style-jrkf/tabbaritem.scss +4 -4
  119. package/dist/es/packages/tabs/style/style.css +2 -2
  120. package/dist/es/packages/tabs/style/tabs.scss +2 -2
  121. package/dist/es/packages/tabs/style-jmapp/style.css +2 -2
  122. package/dist/es/packages/tabs/style-jmapp/tabs.scss +2 -2
  123. package/dist/es/packages/tabs/style-jrkf/style.css +2 -2
  124. package/dist/es/packages/tabs/style-jrkf/tabs.scss +2 -2
  125. package/dist/es/packages/textarea/textarea.d.ts +2 -2
  126. package/dist/es/packages/textarea/textarea.js +26 -9
  127. package/dist/es/packages/toast/style/style.css +2 -2
  128. package/dist/es/packages/toast/style/toast.scss +2 -2
  129. package/dist/es/packages/toast/style-jmapp/style.css +2 -2
  130. package/dist/es/packages/toast/style-jmapp/toast.scss +2 -2
  131. package/dist/es/packages/toast/style-jrkf/style.css +2 -2
  132. package/dist/es/packages/toast/style-jrkf/toast.scss +2 -2
  133. package/dist/es/packages/uploader/style/style.css +1 -0
  134. package/dist/es/packages/uploader/style/uploader.scss +1 -0
  135. package/dist/es/packages/uploader/style-jmapp/style.css +1 -0
  136. package/dist/es/packages/uploader/style-jmapp/uploader.scss +1 -0
  137. package/dist/es/packages/uploader/style-jrkf/style.css +1 -0
  138. package/dist/es/packages/uploader/style-jrkf/uploader.scss +1 -0
  139. package/dist/es/types/spec/input/base.d.ts +4 -1
  140. package/dist/es/types/spec/lottie/taro.d.ts +1 -0
  141. package/dist/es/types/spec/swiper/base.d.ts +5 -1
  142. package/dist/es/types/spec/swiper/taro.d.ts +4 -0
  143. package/dist/es/utils/index.d.ts +0 -1
  144. package/dist/es/utils/index.js +0 -1
  145. package/dist/es/utils/index.taro.js +0 -1
  146. package/dist/es/utils/taro/platform.d.ts +1 -0
  147. package/dist/es/utils/taro/platform.js +5 -0
  148. package/dist/es/utils/taro/px-transform.js +3 -2
  149. package/dist/nutui.react.umd.js +79 -152
  150. package/dist/style-jmapp.css +1 -1
  151. package/dist/style-jmapp.scss +30 -30
  152. package/dist/style-jrkf.css +1 -1
  153. package/dist/style-jrkf.scss +39 -39
  154. package/dist/style.css +1 -1
  155. package/dist/style.scss +39 -39
  156. package/package.json +1 -1
  157. package/dist/cjs/utils/camel-case.d.ts +0 -1
  158. package/dist/cjs/utils/camel-case.js +0 -106
  159. package/dist/es/utils/camel-case.d.ts +0 -1
  160. package/dist/es/utils/camel-case.js +0 -96
@@ -1,7 +1,7 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
2
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
3
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
4
- import React, { useEffect, useMemo, useRef, useState } from "react";
4
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { useDrag } from "@use-gesture/react";
6
6
  import { useSpring } from "@react-spring/web";
7
7
  import classNames from "classnames";
@@ -14,7 +14,7 @@ var defaultProps = {
14
14
  indicator: false,
15
15
  loop: false,
16
16
  duration: 3000,
17
- autoPlay: false,
17
+ autoplay: false,
18
18
  defaultValue: 0,
19
19
  touchable: true,
20
20
  effect: undefined
@@ -32,29 +32,44 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
32
32
  return current;
33
33
  };
34
34
  var classPrefix = 'nut-swiper';
35
- var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop = _$_object_spread.loop, effect = _$_object_spread.effect, autoPlay = _$_object_spread.autoPlay, touchable = _$_object_spread.touchable, defaultValue = _$_object_spread.defaultValue, duration = _$_object_spread.duration, style = _$_object_spread.style, className = _$_object_spread.className;
35
+ var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop = _$_object_spread.loop, effect = _$_object_spread.effect, autoplay = _$_object_spread.autoplay, touchable = _$_object_spread.touchable, defaultValue = _$_object_spread.defaultValue, duration = _$_object_spread.duration, style = _$_object_spread.style, className = _$_object_spread.className;
36
36
  var isVertical = direction === 'vertical';
37
37
  var count = useMemo(function() {
38
38
  var c = 0;
39
- React.Children.map(children, function(child, index) {
39
+ React.Children.map(children, function() {
40
40
  c += 1;
41
41
  });
42
42
  return c;
43
43
  }, [
44
44
  children
45
45
  ]);
46
+ var timeoutRef = useRef(null);
47
+ var _useState = _sliced_to_array(useState(false), 2), dragging = _useState[0], setDragging = _useState[1];
48
+ var _useRefState = _sliced_to_array(useRefState(defaultValue), 2), innerValue = _useRefState[0], setInnerValue = _useRefState[1];
49
+ var stageRef = useRef(null);
50
+ var swiperRef = useRef(null);
51
+ var _useSpring = _sliced_to_array(useSpring(function() {
52
+ return {
53
+ x: !isVertical ? innerValue.current * 100 * -1 : 0,
54
+ y: isVertical ? innerValue.current * 100 * -1 : 0,
55
+ s: 0,
56
+ reset: function() {},
57
+ config: {
58
+ tension: 200,
59
+ friction: 30
60
+ }
61
+ };
62
+ }), 2), springs = _useSpring[0], api = _useSpring[1];
46
63
  var getSlideSize = function() {
47
64
  if (props.slideSize) return props.slideSize;
48
65
  if (stageRef.current) {
49
- if (isVertical) return stageRef.current.offsetHeight;
50
- return stageRef.current.offsetWidth;
66
+ return isVertical ? stageRef.current.offsetHeight : stageRef.current.offsetWidth;
51
67
  }
52
68
  return 0;
53
69
  };
54
70
  var getSwiperSize = function() {
55
71
  if (swiperRef.current) {
56
- if (isVertical) return swiperRef.current.offsetHeight;
57
- return swiperRef.current.offsetWidth;
72
+ return isVertical ? swiperRef.current.offsetHeight : swiperRef.current.offsetWidth;
58
73
  }
59
74
  return 0;
60
75
  };
@@ -67,51 +82,48 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
67
82
  }
68
83
  return v;
69
84
  };
70
- var timeoutRef = useRef(null);
71
- var _useState = _sliced_to_array(useState(false), 2), dragging = _useState[0], setDragging = _useState[1];
72
- var _useRefState = _sliced_to_array(useRefState(defaultValue), 2), current = _useRefState[0], setCurrent = _useRefState[1];
73
- var stageRef = useRef(null);
74
- var swiperRef = useRef(null);
75
- var _useSpring = _sliced_to_array(useSpring(function() {
76
- return {
77
- x: !isVertical ? current.current * 100 * -1 : 0,
78
- y: isVertical ? current.current * 100 * -1 : 0,
79
- s: 0,
80
- reset: function() {},
81
- config: {
82
- tension: 200,
83
- friction: 30
84
- }
85
- };
86
- }), 2), springs = _useSpring[0], api = _useSpring[1];
87
85
  useEffect(function() {
88
86
  var _obj;
89
- api.start((_obj = {}, _define_property(_obj, isVertical ? 'y' : 'x', boundIndex(current.current) * -1 * 100), _define_property(_obj, "immediate", true), _obj));
87
+ api.start((_obj = {}, _define_property(_obj, isVertical ? 'y' : 'x', boundIndex(innerValue.current) * -1 * 100), _define_property(_obj, "immediate", true), _obj));
90
88
  }, [
91
89
  swiperRef.current
92
90
  ]);
93
91
  var swiperDirection = useRef(1);
94
- var _useList = _sliced_to_array(useList(effect, count, current), 2), transforms = _useList[0], setTransforms = _useList[1];
92
+ var _useList = _sliced_to_array(useList(effect, count, innerValue), 2), transforms = _useList[0], setTransforms = _useList[1];
95
93
  // 自动播放
96
- var runTimeSwiper = function() {
94
+ var runTimeSwiper = useCallback(function() {
97
95
  var durationNumber = typeof duration === 'string' ? parseInt(duration) : duration;
98
- var d = typeof autoPlay === 'number' ? autoPlay : durationNumber;
96
+ var d = durationNumber;
97
+ // 优先使用明确设置的数值型自动播放间隔
98
+ if (typeof props.autoPlay === 'number') {
99
+ d = props.autoPlay;
100
+ } else if (typeof autoplay === 'number') {
101
+ d = autoplay;
102
+ }
99
103
  timeoutRef.current = window.setTimeout(function() {
100
104
  next();
101
105
  runTimeSwiper();
102
106
  }, d);
103
- };
107
+ }, [
108
+ props.autoPlay,
109
+ autoplay,
110
+ duration
111
+ ]);
104
112
  useEffect(function() {
105
- if (!autoPlay || dragging) return;
113
+ // 兼容旧版的 autoPlay 属性
114
+ var shouldAutoplay = props.autoPlay || autoplay;
115
+ if (!shouldAutoplay || dragging) return;
116
+ // if (!autoplay || dragging) return
106
117
  runTimeSwiper();
107
118
  return function() {
108
119
  if (timeoutRef.current) window.clearTimeout(timeoutRef.current);
109
120
  };
110
121
  }, [
111
- autoPlay,
122
+ autoplay,
112
123
  duration,
113
124
  dragging,
114
- count
125
+ count,
126
+ runTimeSwiper
115
127
  ]);
116
128
  var to = function(index) {
117
129
  var immediate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -121,7 +133,7 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
121
133
  var cycleIndex = index % count;
122
134
  targetIndex = cycleIndex < 0 ? cycleIndex + count : cycleIndex;
123
135
  }
124
- setCurrent(targetIndex);
136
+ setInnerValue(targetIndex);
125
137
  (_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, targetIndex);
126
138
  if (effect) {
127
139
  updateTransform(transforms, setTransforms, effect, targetIndex);
@@ -188,13 +200,10 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
188
200
  bounds: function() {
189
201
  if (loop) return {};
190
202
  var slideSize = getSlideSize();
191
- if (isVertical) {
192
- return {
193
- top: 0,
194
- bottom: (count - 1) * slideSize
195
- };
196
- }
197
- return {
203
+ return isVertical ? {
204
+ top: 0,
205
+ bottom: (count - 1) * slideSize
206
+ } : {
198
207
  left: 0,
199
208
  right: (count - 1) * slideSize
200
209
  };
@@ -208,13 +217,13 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
208
217
  }
209
218
  });
210
219
  var renderIndicator = function() {
211
- if (/*#__PURE__*/ React.isValidElement(indicator)) return indicator;
212
220
  if (!indicator) return null;
221
+ if (/*#__PURE__*/ React.isValidElement(indicator)) return indicator;
213
222
  var _obj;
214
223
  return /*#__PURE__*/ React.createElement("div", {
215
224
  className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-indicator"), true), _define_property(_obj, "".concat(classPrefix, "-indicator-vertical"), isVertical), _define_property(_obj, "".concat(classPrefix, "-indicator-horizontal"), !isVertical), _obj))
216
225
  }, /*#__PURE__*/ React.createElement(Indicator, {
217
- current: getRefValue(current),
226
+ current: getRefValue(innerValue),
218
227
  total: count,
219
228
  direction: direction
220
229
  }));
@@ -235,7 +244,7 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
235
244
  count: count,
236
245
  isVertical: isVertical,
237
246
  effect: effect,
238
- current: current,
247
+ current: innerValue,
239
248
  swiperDirection: swiperDirection,
240
249
  dragging: dragging,
241
250
  transforms: transforms
@@ -15,10 +15,10 @@
15
15
  width: 24px;
16
16
  height: 24px;
17
17
  font-size: 24px;
18
- /* #ifdef harmony*/
18
+ /* #ifdef harmony dynamic*/
19
19
  color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
20
20
  /* #endif*/
21
- /* #ifndef harmony*/
21
+ /* #ifndef harmony dynamic*/
22
22
  color: inherit;
23
23
  /* #endif*/
24
24
  }
@@ -49,10 +49,10 @@
49
49
  }
50
50
  .nut-tabbar-item-active .nut-tabbar-item-text,
51
51
  .nut-tabbar-item-active .nut-icon {
52
- /* #ifdef harmony*/
52
+ /* #ifdef harmony dynamic*/
53
53
  color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
54
54
  /* #endif*/
55
- /* #ifndef harmony*/
55
+ /* #ifndef harmony dynamic*/
56
56
  color: inherit;
57
57
  /* #endif*/
58
58
  }
@@ -11,10 +11,10 @@
11
11
  width: 24px;
12
12
  height: 24px;
13
13
  font-size: 24px;
14
- /* #ifdef harmony*/
14
+ /* #ifdef harmony dynamic*/
15
15
  color: $tabbar-inactive-color;
16
16
  /* #endif*/
17
- /* #ifndef harmony*/
17
+ /* #ifndef harmony dynamic*/
18
18
  color: inherit;
19
19
  /* #endif*/
20
20
  }
@@ -52,10 +52,10 @@
52
52
 
53
53
  .nut-tabbar-item-text,
54
54
  .nut-icon {
55
- /* #ifdef harmony*/
55
+ /* #ifdef harmony dynamic*/
56
56
  color: $tabbar-active-color;
57
57
  /* #endif*/
58
- /* #ifndef harmony*/
58
+ /* #ifndef harmony dynamic*/
59
59
  color: inherit;
60
60
  /* #endif*/
61
61
  }
@@ -15,10 +15,10 @@
15
15
  width: 24px;
16
16
  height: 24px;
17
17
  font-size: 24px;
18
- /* #ifdef harmony*/
18
+ /* #ifdef harmony dynamic*/
19
19
  color: var(--nutui-tabbar-inactive-color, var(--nutui-color-text));
20
20
  /* #endif*/
21
- /* #ifndef harmony*/
21
+ /* #ifndef harmony dynamic*/
22
22
  color: inherit;
23
23
  /* #endif*/
24
24
  }
@@ -49,10 +49,10 @@
49
49
  }
50
50
  .nut-tabbar-item-active .nut-tabbar-item-text,
51
51
  .nut-tabbar-item-active .nut-icon {
52
- /* #ifdef harmony*/
52
+ /* #ifdef harmony dynamic*/
53
53
  color: var(--nutui-tabbar-active-color, var(--nutui-color-primary));
54
54
  /* #endif*/
55
- /* #ifndef harmony*/
55
+ /* #ifndef harmony dynamic*/
56
56
  color: inherit;
57
57
  /* #endif*/
58
58
  }
@@ -11,10 +11,10 @@
11
11
  width: 24px;
12
12
  height: 24px;
13
13
  font-size: 24px;
14
- /* #ifdef harmony*/
14
+ /* #ifdef harmony dynamic*/
15
15
  color: $tabbar-inactive-color;
16
16
  /* #endif*/
17
- /* #ifndef harmony*/
17
+ /* #ifndef harmony dynamic*/
18
18
  color: inherit;
19
19
  /* #endif*/
20
20
  }
@@ -52,10 +52,10 @@
52
52
 
53
53
  .nut-tabbar-item-text,
54
54
  .nut-icon {
55
- /* #ifdef harmony*/
55
+ /* #ifdef harmony dynamic*/
56
56
  color: $tabbar-active-color;
57
57
  /* #endif*/
58
- /* #ifndef harmony*/
58
+ /* #ifndef harmony dynamic*/
59
59
  color: inherit;
60
60
  /* #endif*/
61
61
  }
@@ -15,10 +15,10 @@
15
15
  width: 24px;
16
16
  height: 24px;
17
17
  font-size: 24px;
18
- /* #ifdef harmony*/
18
+ /* #ifdef harmony dynamic*/
19
19
  color: var(--nutui-tabbar-inactive-color, var(--nutui-color-text));
20
20
  /* #endif*/
21
- /* #ifndef harmony*/
21
+ /* #ifndef harmony dynamic*/
22
22
  color: inherit;
23
23
  /* #endif*/
24
24
  }
@@ -49,10 +49,10 @@
49
49
  }
50
50
  .nut-tabbar-item-active .nut-tabbar-item-text,
51
51
  .nut-tabbar-item-active .nut-icon {
52
- /* #ifdef harmony*/
52
+ /* #ifdef harmony dynamic*/
53
53
  color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff6666));
54
54
  /* #endif*/
55
- /* #ifndef harmony*/
55
+ /* #ifndef harmony dynamic*/
56
56
  color: inherit;
57
57
  /* #endif*/
58
58
  }
@@ -11,10 +11,10 @@
11
11
  width: 24px;
12
12
  height: 24px;
13
13
  font-size: 24px;
14
- /* #ifdef harmony*/
14
+ /* #ifdef harmony dynamic*/
15
15
  color: $tabbar-inactive-color;
16
16
  /* #endif*/
17
- /* #ifndef harmony*/
17
+ /* #ifndef harmony dynamic*/
18
18
  color: inherit;
19
19
  /* #endif*/
20
20
  }
@@ -52,10 +52,10 @@
52
52
 
53
53
  .nut-tabbar-item-text,
54
54
  .nut-icon {
55
- /* #ifdef harmony*/
55
+ /* #ifdef harmony dynamic*/
56
56
  color: $tabbar-active-color;
57
57
  /* #endif*/
58
- /* #ifndef harmony*/
58
+ /* #ifndef harmony dynamic*/
59
59
  color: inherit;
60
60
  /* #endif*/
61
61
  }
@@ -170,10 +170,10 @@
170
170
 
171
171
  .nut-tabs-vertical .nut-tabs-ellipsis {
172
172
  white-space: break-spaces;
173
- /* #ifdef harmony */
173
+ /* #ifdef harmony dynamic*/
174
174
  padding-left: 12px;
175
175
  /* #endif */
176
- /* #ifndef harmony */
176
+ /* #ifndef harmony dynamic*/
177
177
  padding-left: 6px;
178
178
  /* #endif */
179
179
  width: 90px;
@@ -213,10 +213,10 @@
213
213
  .nut-tabs-vertical {
214
214
  .nut-tabs-ellipsis {
215
215
  white-space: break-spaces;
216
- /* #ifdef harmony */
216
+ /* #ifdef harmony dynamic*/
217
217
  padding-left: 12px;
218
218
  /* #endif */
219
- /* #ifndef harmony */
219
+ /* #ifndef harmony dynamic*/
220
220
  padding-left: 6px;
221
221
  /* #endif */
222
222
  width: 90px;
@@ -170,10 +170,10 @@
170
170
 
171
171
  .nut-tabs-vertical .nut-tabs-ellipsis {
172
172
  white-space: break-spaces;
173
- /* #ifdef harmony */
173
+ /* #ifdef harmony dynamic*/
174
174
  padding-left: 12px;
175
175
  /* #endif */
176
- /* #ifndef harmony */
176
+ /* #ifndef harmony dynamic*/
177
177
  padding-left: 6px;
178
178
  /* #endif */
179
179
  width: 90px;
@@ -213,10 +213,10 @@
213
213
  .nut-tabs-vertical {
214
214
  .nut-tabs-ellipsis {
215
215
  white-space: break-spaces;
216
- /* #ifdef harmony */
216
+ /* #ifdef harmony dynamic*/
217
217
  padding-left: 12px;
218
218
  /* #endif */
219
- /* #ifndef harmony */
219
+ /* #ifndef harmony dynamic*/
220
220
  padding-left: 6px;
221
221
  /* #endif */
222
222
  width: 90px;
@@ -170,10 +170,10 @@
170
170
 
171
171
  .nut-tabs-vertical .nut-tabs-ellipsis {
172
172
  white-space: break-spaces;
173
- /* #ifdef harmony */
173
+ /* #ifdef harmony dynamic*/
174
174
  padding-left: 12px;
175
175
  /* #endif */
176
- /* #ifndef harmony */
176
+ /* #ifndef harmony dynamic*/
177
177
  padding-left: 6px;
178
178
  /* #endif */
179
179
  width: 90px;
@@ -213,10 +213,10 @@
213
213
  .nut-tabs-vertical {
214
214
  .nut-tabs-ellipsis {
215
215
  white-space: break-spaces;
216
- /* #ifdef harmony */
216
+ /* #ifdef harmony dynamic*/
217
217
  padding-left: 12px;
218
218
  /* #endif */
219
- /* #ifndef harmony */
219
+ /* #ifndef harmony dynamic*/
220
220
  padding-left: 6px;
221
221
  /* #endif */
222
222
  width: 90px;
@@ -1,3 +1,3 @@
1
- import React, { FunctionComponent } from 'react';
1
+ import React from 'react';
2
2
  import { WebTextAreaProps } from "../../types";
3
- export declare const TextArea: FunctionComponent<Partial<WebTextAreaProps> & Omit<React.HTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'onBlur' | 'onFocus'>>;
3
+ export declare const TextArea: React.ForwardRefExoticComponent<Partial<WebTextAreaProps> & Omit<React.HTMLAttributes<HTMLTextAreaElement>, "onFocus" | "onBlur" | "onChange"> & React.RefAttributes<unknown>>;
@@ -3,7 +3,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
3
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
4
4
  import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
5
5
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
6
- import React, { useEffect, useRef } from "react";
6
+ import React, { useEffect, useRef, forwardRef, useImperativeHandle } from "react";
7
7
  import classNames from "classnames";
8
8
  import { useConfig, useRtl } from "../configprovider";
9
9
  import { ComponentDefaults } from "../../utils/typings";
@@ -13,14 +13,13 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
13
13
  showCount: false,
14
14
  rows: 2,
15
15
  maxLength: 140,
16
- placeholder: '',
17
16
  readOnly: false,
18
17
  disabled: false,
19
18
  autoSize: false,
20
19
  plain: false,
21
20
  status: 'default'
22
21
  });
23
- export var TextArea = function(props) {
22
+ export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
24
23
  var locale = useConfig().locale;
25
24
  var _ref = _object_spread({}, defaultProps, props), className = _ref.className, value = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
26
25
  "className",
@@ -55,13 +54,13 @@ export var TextArea = function(props) {
55
54
  defaultValue: defaultValue,
56
55
  finalValue: format(defaultValue),
57
56
  onChange: onChange
58
- }), 2), inputValue = _usePropsValue[0], setInputValue = _usePropsValue[1];
57
+ }), 2), innerValue = _usePropsValue[0], setInnerValue = _usePropsValue[1];
59
58
  useEffect(function() {
60
59
  if (autoSize) setContentHeight();
61
60
  }, [
62
61
  autoSize,
63
62
  defaultValue,
64
- inputValue
63
+ innerValue
65
64
  ]);
66
65
  var setContentHeight = function() {
67
66
  var textarea = textareaRef.current;
@@ -76,7 +75,7 @@ export var TextArea = function(props) {
76
75
  var handleChange = function(event) {
77
76
  var text = event.target;
78
77
  var value = compositionRef.current ? text.value : format(text.value);
79
- setInputValue(value);
78
+ setInnerValue(value);
80
79
  };
81
80
  var isDisabled = function() {
82
81
  return disabled || readOnly;
@@ -89,6 +88,24 @@ export var TextArea = function(props) {
89
88
  if (isDisabled()) return;
90
89
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
91
90
  };
91
+ useImperativeHandle(ref, function() {
92
+ return {
93
+ clear: function() {
94
+ return setInnerValue('');
95
+ },
96
+ focus: function() {
97
+ var _textareaRef_current;
98
+ return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.focus();
99
+ },
100
+ blur: function() {
101
+ var _textareaRef_current;
102
+ return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.blur();
103
+ },
104
+ get nativeElement () {
105
+ return textareaRef.current;
106
+ }
107
+ };
108
+ });
92
109
  var _obj;
93
110
  return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
94
111
  className: classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix, "-plain"), plain), _define_property(_obj, "".concat(classPrefix, "-container"), !plain), _define_property(_obj, "".concat(classPrefix, "-").concat(status), status), _obj), className)
@@ -98,7 +115,7 @@ export var TextArea = function(props) {
98
115
  style: style,
99
116
  disabled: disabled,
100
117
  readOnly: readOnly,
101
- value: inputValue,
118
+ value: innerValue,
102
119
  onChange: handleChange,
103
120
  onBlur: handleBlur,
104
121
  onFocus: handleFocus,
@@ -113,6 +130,6 @@ export var TextArea = function(props) {
113
130
  placeholder: placeholder !== undefined ? placeholder : locale.placeholder
114
131
  })), showCount && /*#__PURE__*/ React.createElement("div", {
115
132
  className: classNames("".concat(classPrefix, "-limit"), _define_property({}, "".concat(classPrefix, "-limit-disabled"), disabled))
116
- }, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)));
117
- };
133
+ }, innerValue.length, "/", maxLength < 0 ? 0 : maxLength)));
134
+ });
118
135
  TextArea.displayName = 'NutTextArea';
@@ -27,10 +27,10 @@
27
27
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
28
28
  }
29
29
  .nut-toast-overlay-default-taro {
30
- /* #ifdef harmony */
30
+ /* #ifdef harmony dynamic*/
31
31
  background-color: rgba(0, 0, 0, 0);
32
32
  /* #endif */
33
- /* #ifndef harmony */
33
+ /* #ifndef harmony dynamic*/
34
34
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
35
35
  /* #endif */
36
36
  }
@@ -26,10 +26,10 @@
26
26
  }
27
27
 
28
28
  &-overlay-default-taro {
29
- /* #ifdef harmony */
29
+ /* #ifdef harmony dynamic*/
30
30
  background-color: rgba(0, 0, 0, 0);
31
31
  /* #endif */
32
- /* #ifndef harmony */
32
+ /* #ifndef harmony dynamic*/
33
33
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
34
34
  /* #endif */
35
35
  }
@@ -27,10 +27,10 @@
27
27
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
28
28
  }
29
29
  .nut-toast-overlay-default-taro {
30
- /* #ifdef harmony */
30
+ /* #ifdef harmony dynamic*/
31
31
  background-color: rgba(0, 0, 0, 0);
32
32
  /* #endif */
33
- /* #ifndef harmony */
33
+ /* #ifndef harmony dynamic*/
34
34
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
35
35
  /* #endif */
36
36
  }
@@ -26,10 +26,10 @@
26
26
  }
27
27
 
28
28
  &-overlay-default-taro {
29
- /* #ifdef harmony */
29
+ /* #ifdef harmony dynamic*/
30
30
  background-color: rgba(0, 0, 0, 0);
31
31
  /* #endif */
32
- /* #ifndef harmony */
32
+ /* #ifndef harmony dynamic*/
33
33
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
34
34
  /* #endif */
35
35
  }
@@ -27,10 +27,10 @@
27
27
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
28
28
  }
29
29
  .nut-toast-overlay-default-taro {
30
- /* #ifdef harmony */
30
+ /* #ifdef harmony dynamic*/
31
31
  background-color: rgba(0, 0, 0, 0);
32
32
  /* #endif */
33
- /* #ifndef harmony */
33
+ /* #ifndef harmony dynamic*/
34
34
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
35
35
  /* #endif */
36
36
  }
@@ -26,10 +26,10 @@
26
26
  }
27
27
 
28
28
  &-overlay-default-taro {
29
- /* #ifdef harmony */
29
+ /* #ifdef harmony dynamic*/
30
30
  background-color: rgba(0, 0, 0, 0);
31
31
  /* #endif */
32
- /* #ifndef harmony */
32
+ /* #ifndef harmony dynamic*/
33
33
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
34
34
  /* #endif */
35
35
  }
@@ -77,6 +77,7 @@
77
77
  height: 100%;
78
78
  background: var(--nutui-uploader-preview-progress-background, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
79
79
  border-radius: var(--nutui-uploader-image-border-radius, 4px);
80
+ z-index: 10;
80
81
  }
81
82
  .nut-uploader-preview-progress i {
82
83
  margin-bottom: var(--nutui-uploader-image-icon-margin-bottom, 6px);
@@ -86,6 +86,7 @@
86
86
  height: 100%;
87
87
  background: $uploader-preview-progress-background;
88
88
  border-radius: $uploader-image-border-radius;
89
+ z-index: 10;
89
90
 
90
91
  i {
91
92
  margin-bottom: $uploader-image-icon-margin-bottom;
@@ -77,6 +77,7 @@
77
77
  height: 100%;
78
78
  background: var(--nutui-uploader-preview-progress-background, var(--nutui-color-surface-overlay));
79
79
  border-radius: var(--nutui-uploader-image-border-radius, var(--nutui-radius-xs));
80
+ z-index: 10;
80
81
  }
81
82
  .nut-uploader-preview-progress i {
82
83
  margin-bottom: var(--nutui-uploader-image-icon-margin-bottom, 6px);
@@ -86,6 +86,7 @@
86
86
  height: 100%;
87
87
  background: $uploader-preview-progress-background;
88
88
  border-radius: $uploader-image-border-radius;
89
+ z-index: 10;
89
90
 
90
91
  i {
91
92
  margin-bottom: $uploader-image-icon-margin-bottom;