@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.
- package/CHANGELOG.md +8 -9
- package/dist/cjs/packages/address/style/address.scss +2 -2
- package/dist/cjs/packages/address/style/style.css +2 -2
- package/dist/cjs/packages/address/style-jmapp/address.scss +2 -2
- package/dist/cjs/packages/address/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/address/style-jrkf/address.scss +2 -2
- package/dist/cjs/packages/address/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/button/style/button.scss +3 -3
- package/dist/cjs/packages/button/style/style.css +3 -3
- package/dist/cjs/packages/button/style-jmapp/button.scss +3 -3
- package/dist/cjs/packages/button/style-jmapp/style.css +3 -3
- package/dist/cjs/packages/button/style-jrkf/button.scss +3 -3
- package/dist/cjs/packages/button/style-jrkf/style.css +3 -3
- package/dist/cjs/packages/collapseitem/style/collapseitem.scss +2 -2
- package/dist/cjs/packages/collapseitem/style/style.css +2 -2
- package/dist/cjs/packages/collapseitem/style-jmapp/collapseitem.scss +2 -2
- package/dist/cjs/packages/collapseitem/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/collapseitem/style-jrkf/collapseitem.scss +2 -2
- package/dist/cjs/packages/collapseitem/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/dialog/style/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style/style.css +1 -1
- package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/loading/loading.js +0 -4
- package/dist/cjs/packages/numberkeyboard/style/numberkeyboard.scss +2 -2
- package/dist/cjs/packages/numberkeyboard/style/style.css +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jmapp/numberkeyboard.scss +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jrkf/numberkeyboard.scss +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/steps/style/steps.scss +1 -1
- package/dist/cjs/packages/steps/style/style.css +1 -1
- package/dist/cjs/packages/steps/style-jmapp/steps.scss +1 -1
- package/dist/cjs/packages/steps/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/steps/style-jrkf/steps.scss +1 -1
- package/dist/cjs/packages/steps/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/swiper/swiper.js +52 -43
- package/dist/cjs/packages/tabbaritem/style/style.css +4 -4
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +4 -4
- package/dist/cjs/packages/tabbaritem/style-jmapp/style.css +4 -4
- package/dist/cjs/packages/tabbaritem/style-jmapp/tabbaritem.scss +4 -4
- package/dist/cjs/packages/tabbaritem/style-jrkf/style.css +4 -4
- package/dist/cjs/packages/tabbaritem/style-jrkf/tabbaritem.scss +4 -4
- package/dist/cjs/packages/tabs/style/style.css +2 -2
- package/dist/cjs/packages/tabs/style/tabs.scss +2 -2
- package/dist/cjs/packages/tabs/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/tabs/style-jmapp/tabs.scss +2 -2
- package/dist/cjs/packages/tabs/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/tabs/style-jrkf/tabs.scss +2 -2
- package/dist/cjs/packages/textarea/textarea.d.ts +2 -2
- package/dist/cjs/packages/textarea/textarea.js +25 -8
- package/dist/cjs/packages/toast/style/style.css +2 -2
- package/dist/cjs/packages/toast/style/toast.scss +2 -2
- package/dist/cjs/packages/toast/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/toast/style-jmapp/toast.scss +2 -2
- package/dist/cjs/packages/toast/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/toast/style-jrkf/toast.scss +2 -2
- package/dist/cjs/packages/uploader/style/style.css +1 -0
- package/dist/cjs/packages/uploader/style/uploader.scss +1 -0
- package/dist/cjs/packages/uploader/style-jmapp/style.css +1 -0
- package/dist/cjs/packages/uploader/style-jmapp/uploader.scss +1 -0
- package/dist/cjs/packages/uploader/style-jrkf/style.css +1 -0
- package/dist/cjs/packages/uploader/style-jrkf/uploader.scss +1 -0
- package/dist/cjs/types/spec/lottie/taro.d.ts +1 -0
- package/dist/cjs/types/spec/swiper/base.d.ts +4 -0
- package/dist/cjs/types/spec/swiper/taro.d.ts +4 -0
- package/dist/cjs/utils/index.d.ts +0 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/index.taro.js +0 -1
- package/dist/cjs/utils/taro/platform.d.ts +1 -0
- package/dist/cjs/utils/taro/platform.js +8 -0
- package/dist/cjs/utils/taro/px-transform.js +1 -1
- package/dist/es/packages/address/style/address.scss +2 -2
- package/dist/es/packages/address/style/style.css +2 -2
- package/dist/es/packages/address/style-jmapp/address.scss +2 -2
- package/dist/es/packages/address/style-jmapp/style.css +2 -2
- package/dist/es/packages/address/style-jrkf/address.scss +2 -2
- package/dist/es/packages/address/style-jrkf/style.css +2 -2
- package/dist/es/packages/button/style/button.scss +3 -3
- package/dist/es/packages/button/style/style.css +3 -3
- package/dist/es/packages/button/style-jmapp/button.scss +3 -3
- package/dist/es/packages/button/style-jmapp/style.css +3 -3
- package/dist/es/packages/button/style-jrkf/button.scss +3 -3
- package/dist/es/packages/button/style-jrkf/style.css +3 -3
- package/dist/es/packages/collapseitem/style/collapseitem.scss +2 -2
- package/dist/es/packages/collapseitem/style/style.css +2 -2
- package/dist/es/packages/collapseitem/style-jmapp/collapseitem.scss +2 -2
- package/dist/es/packages/collapseitem/style-jmapp/style.css +2 -2
- package/dist/es/packages/collapseitem/style-jrkf/collapseitem.scss +2 -2
- package/dist/es/packages/collapseitem/style-jrkf/style.css +2 -2
- package/dist/es/packages/dialog/style/dialog.scss +1 -1
- package/dist/es/packages/dialog/style/style.css +1 -1
- package/dist/es/packages/dialog/style-jmapp/dialog.scss +1 -1
- package/dist/es/packages/dialog/style-jmapp/style.css +1 -1
- package/dist/es/packages/dialog/style-jrkf/dialog.scss +1 -1
- package/dist/es/packages/dialog/style-jrkf/style.css +1 -1
- package/dist/es/packages/loading/loading.js +0 -4
- package/dist/es/packages/numberkeyboard/style/numberkeyboard.scss +2 -2
- package/dist/es/packages/numberkeyboard/style/style.css +2 -2
- package/dist/es/packages/numberkeyboard/style-jmapp/numberkeyboard.scss +2 -2
- package/dist/es/packages/numberkeyboard/style-jmapp/style.css +2 -2
- package/dist/es/packages/numberkeyboard/style-jrkf/numberkeyboard.scss +2 -2
- package/dist/es/packages/numberkeyboard/style-jrkf/style.css +2 -2
- package/dist/es/packages/steps/style/steps.scss +1 -1
- package/dist/es/packages/steps/style/style.css +1 -1
- package/dist/es/packages/steps/style-jmapp/steps.scss +1 -1
- package/dist/es/packages/steps/style-jmapp/style.css +1 -1
- package/dist/es/packages/steps/style-jrkf/steps.scss +1 -1
- package/dist/es/packages/steps/style-jrkf/style.css +1 -1
- package/dist/es/packages/swiper/swiper.js +53 -44
- package/dist/es/packages/tabbaritem/style/style.css +4 -4
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +4 -4
- package/dist/es/packages/tabbaritem/style-jmapp/style.css +4 -4
- package/dist/es/packages/tabbaritem/style-jmapp/tabbaritem.scss +4 -4
- package/dist/es/packages/tabbaritem/style-jrkf/style.css +4 -4
- package/dist/es/packages/tabbaritem/style-jrkf/tabbaritem.scss +4 -4
- package/dist/es/packages/tabs/style/style.css +2 -2
- package/dist/es/packages/tabs/style/tabs.scss +2 -2
- package/dist/es/packages/tabs/style-jmapp/style.css +2 -2
- package/dist/es/packages/tabs/style-jmapp/tabs.scss +2 -2
- package/dist/es/packages/tabs/style-jrkf/style.css +2 -2
- package/dist/es/packages/tabs/style-jrkf/tabs.scss +2 -2
- package/dist/es/packages/textarea/textarea.d.ts +2 -2
- package/dist/es/packages/textarea/textarea.js +26 -9
- package/dist/es/packages/toast/style/style.css +2 -2
- package/dist/es/packages/toast/style/toast.scss +2 -2
- package/dist/es/packages/toast/style-jmapp/style.css +2 -2
- package/dist/es/packages/toast/style-jmapp/toast.scss +2 -2
- package/dist/es/packages/toast/style-jrkf/style.css +2 -2
- package/dist/es/packages/toast/style-jrkf/toast.scss +2 -2
- package/dist/es/packages/uploader/style/style.css +1 -0
- package/dist/es/packages/uploader/style/uploader.scss +1 -0
- package/dist/es/packages/uploader/style-jmapp/style.css +1 -0
- package/dist/es/packages/uploader/style-jmapp/uploader.scss +1 -0
- package/dist/es/packages/uploader/style-jrkf/style.css +1 -0
- package/dist/es/packages/uploader/style-jrkf/uploader.scss +1 -0
- package/dist/es/types/spec/input/base.d.ts +4 -1
- package/dist/es/types/spec/lottie/taro.d.ts +1 -0
- package/dist/es/types/spec/swiper/base.d.ts +5 -1
- package/dist/es/types/spec/swiper/taro.d.ts +4 -0
- package/dist/es/utils/index.d.ts +0 -1
- package/dist/es/utils/index.js +0 -1
- package/dist/es/utils/index.taro.js +0 -1
- package/dist/es/utils/taro/platform.d.ts +1 -0
- package/dist/es/utils/taro/platform.js +5 -0
- package/dist/es/utils/taro/px-transform.js +3 -2
- package/dist/nutui.react.umd.js +79 -152
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +30 -30
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +39 -39
- package/dist/style.css +1 -1
- package/dist/style.scss +39 -39
- package/package.json +1 -1
- package/dist/cjs/utils/camel-case.d.ts +0 -1
- package/dist/cjs/utils/camel-case.js +0 -106
- package/dist/es/utils/camel-case.d.ts +0 -1
- 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
|
-
|
|
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,
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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,
|
|
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 =
|
|
106
|
+
var runTimeSwiper = (0, _react.useCallback)(function() {
|
|
109
107
|
var durationNumber = typeof duration === 'string' ? parseInt(duration) : duration;
|
|
110
|
-
var d =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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)(
|
|
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:
|
|
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
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { WebTextAreaProps } from "../../types";
|
|
3
|
-
export declare const TextArea:
|
|
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 =
|
|
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),
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
},
|
|
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);
|
|
@@ -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);
|
|
@@ -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);
|