@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
@@ -26,7 +26,7 @@ var defaultProps = {
26
26
  indicator: false,
27
27
  loop: false,
28
28
  duration: 3000,
29
- autoPlay: false,
29
+ autoplay: false,
30
30
  defaultValue: 0,
31
31
  touchable: true,
32
32
  effect: undefined
@@ -44,29 +44,44 @@ var Swiper = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
44
44
  return current;
45
45
  };
46
46
  var classPrefix = 'nut-swiper';
47
- var _$_object_spread = (0, _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;
47
+ var _$_object_spread = (0, _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;
48
48
  var isVertical = direction === 'vertical';
49
49
  var count = (0, _react.useMemo)(function() {
50
50
  var c = 0;
51
- _react.default.Children.map(children, function(child, index) {
51
+ _react.default.Children.map(children, function() {
52
52
  c += 1;
53
53
  });
54
54
  return c;
55
55
  }, [
56
56
  children
57
57
  ]);
58
+ var timeoutRef = (0, _react.useRef)(null);
59
+ var _useState = (0, _sliced_to_array._)((0, _react.useState)(false), 2), dragging = _useState[0], setDragging = _useState[1];
60
+ var _useRefState = (0, _sliced_to_array._)((0, _userefstate.useRefState)(defaultValue), 2), innerValue = _useRefState[0], setInnerValue = _useRefState[1];
61
+ var stageRef = (0, _react.useRef)(null);
62
+ var swiperRef = (0, _react.useRef)(null);
63
+ var _useSpring = (0, _sliced_to_array._)((0, _web.useSpring)(function() {
64
+ return {
65
+ x: !isVertical ? innerValue.current * 100 * -1 : 0,
66
+ y: isVertical ? innerValue.current * 100 * -1 : 0,
67
+ s: 0,
68
+ reset: function reset() {},
69
+ config: {
70
+ tension: 200,
71
+ friction: 30
72
+ }
73
+ };
74
+ }), 2), springs = _useSpring[0], api = _useSpring[1];
58
75
  var getSlideSize = function getSlideSize() {
59
76
  if (props.slideSize) return props.slideSize;
60
77
  if (stageRef.current) {
61
- if (isVertical) return stageRef.current.offsetHeight;
62
- return stageRef.current.offsetWidth;
78
+ return isVertical ? stageRef.current.offsetHeight : stageRef.current.offsetWidth;
63
79
  }
64
80
  return 0;
65
81
  };
66
82
  var getSwiperSize = function getSwiperSize() {
67
83
  if (swiperRef.current) {
68
- if (isVertical) return swiperRef.current.offsetHeight;
69
- return swiperRef.current.offsetWidth;
84
+ return isVertical ? swiperRef.current.offsetHeight : swiperRef.current.offsetWidth;
70
85
  }
71
86
  return 0;
72
87
  };
@@ -79,51 +94,48 @@ var Swiper = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
79
94
  }
80
95
  return v;
81
96
  };
82
- var timeoutRef = (0, _react.useRef)(null);
83
- var _useState = (0, _sliced_to_array._)((0, _react.useState)(false), 2), dragging = _useState[0], setDragging = _useState[1];
84
- var _useRefState = (0, _sliced_to_array._)((0, _userefstate.useRefState)(defaultValue), 2), current = _useRefState[0], setCurrent = _useRefState[1];
85
- var stageRef = (0, _react.useRef)(null);
86
- var swiperRef = (0, _react.useRef)(null);
87
- var _useSpring = (0, _sliced_to_array._)((0, _web.useSpring)(function() {
88
- return {
89
- x: !isVertical ? current.current * 100 * -1 : 0,
90
- y: isVertical ? current.current * 100 * -1 : 0,
91
- s: 0,
92
- reset: function reset() {},
93
- config: {
94
- tension: 200,
95
- friction: 30
96
- }
97
- };
98
- }), 2), springs = _useSpring[0], api = _useSpring[1];
99
97
  (0, _react.useEffect)(function() {
100
98
  var _obj;
101
- api.start((_obj = {}, (0, _define_property._)(_obj, isVertical ? 'y' : 'x', boundIndex(current.current) * -1 * 100), (0, _define_property._)(_obj, "immediate", true), _obj));
99
+ api.start((_obj = {}, (0, _define_property._)(_obj, isVertical ? 'y' : 'x', boundIndex(innerValue.current) * -1 * 100), (0, _define_property._)(_obj, "immediate", true), _obj));
102
100
  }, [
103
101
  swiperRef.current
104
102
  ]);
105
103
  var swiperDirection = (0, _react.useRef)(1);
106
- var _useList = (0, _sliced_to_array._)((0, _focus.useList)(effect, count, current), 2), transforms = _useList[0], setTransforms = _useList[1];
104
+ var _useList = (0, _sliced_to_array._)((0, _focus.useList)(effect, count, innerValue), 2), transforms = _useList[0], setTransforms = _useList[1];
107
105
  // 自动播放
108
- var runTimeSwiper = function runTimeSwiper1() {
106
+ var runTimeSwiper = (0, _react.useCallback)(function() {
109
107
  var durationNumber = typeof duration === 'string' ? parseInt(duration) : duration;
110
- var d = typeof autoPlay === 'number' ? autoPlay : durationNumber;
108
+ var d = durationNumber;
109
+ // 优先使用明确设置的数值型自动播放间隔
110
+ if (typeof props.autoPlay === 'number') {
111
+ d = props.autoPlay;
112
+ } else if (typeof autoplay === 'number') {
113
+ d = autoplay;
114
+ }
111
115
  timeoutRef.current = window.setTimeout(function() {
112
116
  next();
113
117
  runTimeSwiper();
114
118
  }, d);
115
- };
119
+ }, [
120
+ props.autoPlay,
121
+ autoplay,
122
+ duration
123
+ ]);
116
124
  (0, _react.useEffect)(function() {
117
- if (!autoPlay || dragging) return;
125
+ // 兼容旧版的 autoPlay 属性
126
+ var shouldAutoplay = props.autoPlay || autoplay;
127
+ if (!shouldAutoplay || dragging) return;
128
+ // if (!autoplay || dragging) return
118
129
  runTimeSwiper();
119
130
  return function() {
120
131
  if (timeoutRef.current) window.clearTimeout(timeoutRef.current);
121
132
  };
122
133
  }, [
123
- autoPlay,
134
+ autoplay,
124
135
  duration,
125
136
  dragging,
126
- count
137
+ count,
138
+ runTimeSwiper
127
139
  ]);
128
140
  var to = function to(index) {
129
141
  var immediate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -133,7 +145,7 @@ var Swiper = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
133
145
  var cycleIndex = index % count;
134
146
  targetIndex = cycleIndex < 0 ? cycleIndex + count : cycleIndex;
135
147
  }
136
- setCurrent(targetIndex);
148
+ setInnerValue(targetIndex);
137
149
  (_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, targetIndex);
138
150
  if (effect) {
139
151
  (0, _focus.updateTransform)(transforms, setTransforms, effect, targetIndex);
@@ -199,13 +211,10 @@ var Swiper = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
199
211
  bounds: function bounds() {
200
212
  if (loop) return {};
201
213
  var slideSize = getSlideSize();
202
- if (isVertical) {
203
- return {
204
- top: 0,
205
- bottom: (count - 1) * slideSize
206
- };
207
- }
208
- return {
214
+ return isVertical ? {
215
+ top: 0,
216
+ bottom: (count - 1) * slideSize
217
+ } : {
209
218
  left: 0,
210
219
  right: (count - 1) * slideSize
211
220
  };
@@ -219,13 +228,13 @@ var Swiper = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
219
228
  }
220
229
  });
221
230
  var renderIndicator = function renderIndicator() {
222
- if (/*#__PURE__*/ _react.default.isValidElement(indicator)) return indicator;
223
231
  if (!indicator) return null;
232
+ if (/*#__PURE__*/ _react.default.isValidElement(indicator)) return indicator;
224
233
  var _obj;
225
234
  return /*#__PURE__*/ _react.default.createElement("div", {
226
235
  className: (0, _classnames.default)((_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-indicator"), true), (0, _define_property._)(_obj, "".concat(classPrefix, "-indicator-vertical"), isVertical), (0, _define_property._)(_obj, "".concat(classPrefix, "-indicator-horizontal"), !isVertical), _obj))
227
236
  }, /*#__PURE__*/ _react.default.createElement(_indicator.default, {
228
- current: (0, _userefstate.getRefValue)(current),
237
+ current: (0, _userefstate.getRefValue)(innerValue),
229
238
  total: count,
230
239
  direction: direction
231
240
  }));
@@ -246,7 +255,7 @@ var Swiper = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
246
255
  count: count,
247
256
  isVertical: isVertical,
248
257
  effect: effect,
249
- current: current,
258
+ current: innerValue,
250
259
  swiperDirection: swiperDirection,
251
260
  dragging: dragging,
252
261
  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>>;
@@ -25,14 +25,13 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
25
25
  showCount: false,
26
26
  rows: 2,
27
27
  maxLength: 140,
28
- placeholder: '',
29
28
  readOnly: false,
30
29
  disabled: false,
31
30
  autoSize: false,
32
31
  plain: false,
33
32
  status: 'default'
34
33
  });
35
- var TextArea = function TextArea(props) {
34
+ var TextArea = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
36
35
  var locale = (0, _configprovider.useConfig)().locale;
37
36
  var _ref = (0, _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 = (0, _object_without_properties._)(_ref, [
38
37
  "className",
@@ -67,13 +66,13 @@ var TextArea = function TextArea(props) {
67
66
  defaultValue: defaultValue,
68
67
  finalValue: format(defaultValue),
69
68
  onChange: onChange
70
- }), 2), inputValue = _usePropsValue[0], setInputValue = _usePropsValue[1];
69
+ }), 2), innerValue = _usePropsValue[0], setInnerValue = _usePropsValue[1];
71
70
  (0, _react.useEffect)(function() {
72
71
  if (autoSize) setContentHeight();
73
72
  }, [
74
73
  autoSize,
75
74
  defaultValue,
76
- inputValue
75
+ innerValue
77
76
  ]);
78
77
  var setContentHeight = function setContentHeight() {
79
78
  var textarea = textareaRef.current;
@@ -88,7 +87,7 @@ var TextArea = function TextArea(props) {
88
87
  var handleChange = function handleChange(event) {
89
88
  var text = event.target;
90
89
  var value = compositionRef.current ? text.value : format(text.value);
91
- setInputValue(value);
90
+ setInnerValue(value);
92
91
  };
93
92
  var isDisabled = function isDisabled() {
94
93
  return disabled || readOnly;
@@ -101,6 +100,24 @@ var TextArea = function TextArea(props) {
101
100
  if (isDisabled()) return;
102
101
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
103
102
  };
103
+ (0, _react.useImperativeHandle)(ref, function() {
104
+ return {
105
+ clear: function clear() {
106
+ return setInnerValue('');
107
+ },
108
+ focus: function focus() {
109
+ var _textareaRef_current;
110
+ return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.focus();
111
+ },
112
+ blur: function blur() {
113
+ var _textareaRef_current;
114
+ return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.blur();
115
+ },
116
+ get nativeElement () {
117
+ return textareaRef.current;
118
+ }
119
+ };
120
+ });
104
121
  var _obj;
105
122
  return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement("div", {
106
123
  className: (0, _classnames.default)(classPrefix, (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-disabled"), disabled), (0, _define_property._)(_obj, "".concat(classPrefix, "-readonly"), readOnly), (0, _define_property._)(_obj, "".concat(classPrefix, "-rtl"), rtl), (0, _define_property._)(_obj, "".concat(classPrefix, "-plain"), plain), (0, _define_property._)(_obj, "".concat(classPrefix, "-container"), !plain), (0, _define_property._)(_obj, "".concat(classPrefix, "-").concat(status), status), _obj), className)
@@ -110,7 +127,7 @@ var TextArea = function TextArea(props) {
110
127
  style: style,
111
128
  disabled: disabled,
112
129
  readOnly: readOnly,
113
- value: inputValue,
130
+ value: innerValue,
114
131
  onChange: handleChange,
115
132
  onBlur: handleBlur,
116
133
  onFocus: handleFocus,
@@ -125,6 +142,6 @@ var TextArea = function TextArea(props) {
125
142
  placeholder: placeholder !== undefined ? placeholder : locale.placeholder
126
143
  })), showCount && /*#__PURE__*/ _react.default.createElement("div", {
127
144
  className: (0, _classnames.default)("".concat(classPrefix, "-limit"), (0, _define_property._)({}, "".concat(classPrefix, "-limit-disabled"), disabled))
128
- }, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)));
129
- };
145
+ }, innerValue.length, "/", maxLength < 0 ? 0 : maxLength)));
146
+ });
130
147
  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;
@@ -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;