@nutui/nutui-react-taro 3.0.19-cpp.15 → 3.0.19-cpp.17
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/dist/cjs/packages/checkbox/checkbox.js +10 -2
- package/dist/cjs/packages/dialog/style/dialog.scss +4 -6
- package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +4 -6
- package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +4 -6
- package/dist/cjs/packages/tabs/tabs.js +8 -0
- package/dist/cjs/packages/textarea/textarea.js +3 -1
- package/dist/cjs/types/spec/checkbox/base.d.ts +1 -0
- package/dist/cjs/types/spec/textarea/base.d.ts +1 -0
- package/dist/es/packages/checkbox/checkbox.js +11 -3
- package/dist/es/packages/dialog/style/dialog.scss +4 -6
- package/dist/es/packages/dialog/style-jmapp/dialog.scss +4 -6
- package/dist/es/packages/dialog/style-jrkf/dialog.scss +4 -6
- package/dist/es/packages/tabs/tabs.js +8 -0
- package/dist/es/packages/textarea/textarea.js +3 -1
- package/dist/es/types/spec/checkbox/base.d.ts +1 -0
- package/dist/es/types/spec/textarea/base.d.ts +1 -0
- package/dist/nutui.react.umd.js +19 -3
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +27 -27
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +30 -30
- package/dist/style.css +1 -1
- package/dist/style.scss +27 -27
- package/dist/styles/variables-jmapp.scss +32 -8
- package/dist/styles/variables-jrkf.scss +32 -8
- package/dist/styles/variables.scss +32 -8
- package/package.json +1 -1
|
@@ -29,12 +29,13 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
29
29
|
icon: null,
|
|
30
30
|
activeIcon: null,
|
|
31
31
|
indeterminateIcon: null,
|
|
32
|
+
timeout: 300,
|
|
32
33
|
onChange: function onChange(value) {}
|
|
33
34
|
});
|
|
34
35
|
var classPrefix = 'nut-checkbox';
|
|
35
36
|
var Checkbox = function Checkbox(props) {
|
|
36
37
|
var children = (0, _object_spread._)({}, defaultProps, props).children;
|
|
37
|
-
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, others = (0, _object_without_properties._)(props, [
|
|
38
|
+
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, timeout = props.timeout, others = (0, _object_without_properties._)(props, [
|
|
38
39
|
"icon",
|
|
39
40
|
"label",
|
|
40
41
|
"className",
|
|
@@ -46,7 +47,8 @@ var Checkbox = function Checkbox(props) {
|
|
|
46
47
|
"disabled",
|
|
47
48
|
"onChange",
|
|
48
49
|
"indeterminate",
|
|
49
|
-
"indeterminateIcon"
|
|
50
|
+
"indeterminateIcon",
|
|
51
|
+
"timeout"
|
|
50
52
|
]);
|
|
51
53
|
// eslint-disable-next-line prefer-const
|
|
52
54
|
var labelPosition = others.labelPosition, rest = (0, _object_without_properties._)(others, [
|
|
@@ -140,9 +142,15 @@ var Checkbox = function Checkbox(props) {
|
|
|
140
142
|
className: (0, _classnames.default)("".concat(classPrefix, "-label "), (0, _define_property._)({}, "".concat(classPrefix, "-label-disabled"), innerDisabled))
|
|
141
143
|
}, children || label);
|
|
142
144
|
};
|
|
145
|
+
var loadingRef = (0, _react.useRef)(false);
|
|
143
146
|
var handleClick = function handleClick() {
|
|
144
147
|
// 禁用的时候直接返回
|
|
145
148
|
if (disabled) return;
|
|
149
|
+
if (loadingRef.current) return;
|
|
150
|
+
loadingRef.current = true;
|
|
151
|
+
setTimeout(function() {
|
|
152
|
+
loadingRef.current = false;
|
|
153
|
+
}, timeout);
|
|
146
154
|
// 先转换状态
|
|
147
155
|
var latestChecked = !innerChecked;
|
|
148
156
|
setChecked(latestChecked);
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&-ok-container{
|
|
144
|
+
&-ok-container {
|
|
145
145
|
position: relative;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
148
|
width: 100%;
|
|
149
149
|
justify-content: space-around;
|
|
150
150
|
|
|
151
|
-
.nut-dialog-footer-ok-badge{
|
|
151
|
+
.nut-dialog-footer-ok-badge {
|
|
152
152
|
position: absolute;
|
|
153
153
|
right: 0;
|
|
154
154
|
top: $dialog-footer-badge-top;
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
font-size: $dialog-footer-badge-fontsize;
|
|
162
162
|
color: $dialog-footer-badge-color-ok;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
&-ok {
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
.nut-button-children {
|
|
171
170
|
font-weight: $font-weight-medium;
|
|
172
171
|
}
|
|
173
|
-
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
&-block {
|
|
@@ -179,14 +177,14 @@
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
&-cancel-container{
|
|
180
|
+
&-cancel-container {
|
|
183
181
|
position: relative;
|
|
184
182
|
display: flex;
|
|
185
183
|
align-items: center;
|
|
186
184
|
width: 100%;
|
|
187
185
|
justify-content: space-around;
|
|
188
186
|
|
|
189
|
-
.nut-dialog-footer-cancel-badge{
|
|
187
|
+
.nut-dialog-footer-cancel-badge {
|
|
190
188
|
position: absolute;
|
|
191
189
|
right: $dialog-footer-cancel-margin-right;
|
|
192
190
|
top: $dialog-footer-badge-top;
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&-ok-container{
|
|
144
|
+
&-ok-container {
|
|
145
145
|
position: relative;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
148
|
width: 100%;
|
|
149
149
|
justify-content: space-around;
|
|
150
150
|
|
|
151
|
-
.nut-dialog-footer-ok-badge{
|
|
151
|
+
.nut-dialog-footer-ok-badge {
|
|
152
152
|
position: absolute;
|
|
153
153
|
right: 0;
|
|
154
154
|
top: $dialog-footer-badge-top;
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
font-size: $dialog-footer-badge-fontsize;
|
|
162
162
|
color: $dialog-footer-badge-color-ok;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
&-ok {
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
.nut-button-children {
|
|
171
170
|
font-weight: $font-weight-medium;
|
|
172
171
|
}
|
|
173
|
-
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
&-block {
|
|
@@ -179,14 +177,14 @@
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
&-cancel-container{
|
|
180
|
+
&-cancel-container {
|
|
183
181
|
position: relative;
|
|
184
182
|
display: flex;
|
|
185
183
|
align-items: center;
|
|
186
184
|
width: 100%;
|
|
187
185
|
justify-content: space-around;
|
|
188
186
|
|
|
189
|
-
.nut-dialog-footer-cancel-badge{
|
|
187
|
+
.nut-dialog-footer-cancel-badge {
|
|
190
188
|
position: absolute;
|
|
191
189
|
right: $dialog-footer-cancel-margin-right;
|
|
192
190
|
top: $dialog-footer-badge-top;
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&-ok-container{
|
|
144
|
+
&-ok-container {
|
|
145
145
|
position: relative;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
148
|
width: 100%;
|
|
149
149
|
justify-content: space-around;
|
|
150
150
|
|
|
151
|
-
.nut-dialog-footer-ok-badge{
|
|
151
|
+
.nut-dialog-footer-ok-badge {
|
|
152
152
|
position: absolute;
|
|
153
153
|
right: 0;
|
|
154
154
|
top: $dialog-footer-badge-top;
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
font-size: $dialog-footer-badge-fontsize;
|
|
162
162
|
color: $dialog-footer-badge-color-ok;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
&-ok {
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
.nut-button-children {
|
|
171
170
|
font-weight: $font-weight-medium;
|
|
172
171
|
}
|
|
173
|
-
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
&-block {
|
|
@@ -179,14 +177,14 @@
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
&-cancel-container{
|
|
180
|
+
&-cancel-container {
|
|
183
181
|
position: relative;
|
|
184
182
|
display: flex;
|
|
185
183
|
align-items: center;
|
|
186
184
|
width: 100%;
|
|
187
185
|
justify-content: space-around;
|
|
188
186
|
|
|
189
|
-
.nut-dialog-footer-cancel-badge{
|
|
187
|
+
.nut-dialog-footer-cancel-badge {
|
|
190
188
|
position: absolute;
|
|
191
189
|
right: $dialog-footer-cancel-margin-right;
|
|
192
190
|
top: $dialog-footer-badge-top;
|
|
@@ -27,6 +27,7 @@ var _useforceupdate = require("../../hooks/use-force-update");
|
|
|
27
27
|
var _raf = /*#__PURE__*/ _interop_require_default._(require("../../utils/raf"));
|
|
28
28
|
var _useuuid = require("../../hooks/use-uuid");
|
|
29
29
|
var _configprovider = require("../configprovider/configprovider");
|
|
30
|
+
var _platform = require("../../utils/taro/platform");
|
|
30
31
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
31
32
|
tabStyle: {},
|
|
32
33
|
activeColor: '',
|
|
@@ -162,6 +163,13 @@ var Tabs = function Tabs(props) {
|
|
|
162
163
|
return String(t.value) === String(value);
|
|
163
164
|
});
|
|
164
165
|
index = index < 0 ? 0 : index;
|
|
166
|
+
// 适配 安卓 处理,临时方案,hack
|
|
167
|
+
if ((0, _platform.td)()) {
|
|
168
|
+
return {
|
|
169
|
+
transform: direction === 'horizontal' ? "translate3d(".concat(rtl ? '' : '-').concat(index * 50, "%, 0, 0)") : "translate3d( 0, -".concat(index * 50, "%, 0)"),
|
|
170
|
+
transitionDuration: "".concat(duration, "ms")
|
|
171
|
+
};
|
|
172
|
+
}
|
|
165
173
|
return {
|
|
166
174
|
transform: direction === 'horizontal' ? "translate3d(".concat(rtl ? '' : '-').concat(index * 100, "%, 0, 0)") : "translate3d( 0, -".concat(index * 100, "%, 0)"),
|
|
167
175
|
transitionDuration: "".concat(duration, "ms")
|
|
@@ -34,7 +34,7 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
34
34
|
});
|
|
35
35
|
var TextArea = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
|
|
36
36
|
var locale = (0, _index.useConfig)().locale;
|
|
37
|
-
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, [
|
|
37
|
+
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, viewId = _ref.viewId, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = (0, _object_without_properties._)(_ref, [
|
|
38
38
|
"className",
|
|
39
39
|
"value",
|
|
40
40
|
"defaultValue",
|
|
@@ -48,6 +48,7 @@ var TextArea = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
|
|
|
48
48
|
"style",
|
|
49
49
|
"plain",
|
|
50
50
|
"status",
|
|
51
|
+
"viewId",
|
|
51
52
|
"onChange",
|
|
52
53
|
"onBlur",
|
|
53
54
|
"onFocus"
|
|
@@ -109,6 +110,7 @@ var TextArea = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
|
|
|
109
110
|
});
|
|
110
111
|
var _obj;
|
|
111
112
|
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
113
|
+
id: viewId,
|
|
112
114
|
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)
|
|
113
115
|
}, /*#__PURE__*/ _react.default.createElement(_components.Textarea, (0, _object_spread_props._)((0, _object_spread._)({}, rest), {
|
|
114
116
|
ref: textareaRef,
|
|
@@ -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, { useContext, useEffect, useState } from "react";
|
|
6
|
+
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
7
7
|
import { CheckDisabled, Checked, CheckNormal } from "@nutui/icons-react-taro";
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
import { View } from "@tarojs/components";
|
|
@@ -17,12 +17,13 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
17
17
|
icon: null,
|
|
18
18
|
activeIcon: null,
|
|
19
19
|
indeterminateIcon: null,
|
|
20
|
+
timeout: 300,
|
|
20
21
|
onChange: function(value) {}
|
|
21
22
|
});
|
|
22
23
|
var classPrefix = 'nut-checkbox';
|
|
23
24
|
export var Checkbox = function(props) {
|
|
24
25
|
var children = _object_spread({}, defaultProps, props).children;
|
|
25
|
-
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, others = _object_without_properties(props, [
|
|
26
|
+
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, timeout = props.timeout, others = _object_without_properties(props, [
|
|
26
27
|
"icon",
|
|
27
28
|
"label",
|
|
28
29
|
"className",
|
|
@@ -34,7 +35,8 @@ export var Checkbox = function(props) {
|
|
|
34
35
|
"disabled",
|
|
35
36
|
"onChange",
|
|
36
37
|
"indeterminate",
|
|
37
|
-
"indeterminateIcon"
|
|
38
|
+
"indeterminateIcon",
|
|
39
|
+
"timeout"
|
|
38
40
|
]);
|
|
39
41
|
// eslint-disable-next-line prefer-const
|
|
40
42
|
var labelPosition = others.labelPosition, rest = _object_without_properties(others, [
|
|
@@ -128,9 +130,15 @@ export var Checkbox = function(props) {
|
|
|
128
130
|
className: classNames("".concat(classPrefix, "-label "), _define_property({}, "".concat(classPrefix, "-label-disabled"), innerDisabled))
|
|
129
131
|
}, children || label);
|
|
130
132
|
};
|
|
133
|
+
var loadingRef = useRef(false);
|
|
131
134
|
var handleClick = function() {
|
|
132
135
|
// 禁用的时候直接返回
|
|
133
136
|
if (disabled) return;
|
|
137
|
+
if (loadingRef.current) return;
|
|
138
|
+
loadingRef.current = true;
|
|
139
|
+
setTimeout(function() {
|
|
140
|
+
loadingRef.current = false;
|
|
141
|
+
}, timeout);
|
|
134
142
|
// 先转换状态
|
|
135
143
|
var latestChecked = !innerChecked;
|
|
136
144
|
setChecked(latestChecked);
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&-ok-container{
|
|
144
|
+
&-ok-container {
|
|
145
145
|
position: relative;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
148
|
width: 100%;
|
|
149
149
|
justify-content: space-around;
|
|
150
150
|
|
|
151
|
-
.nut-dialog-footer-ok-badge{
|
|
151
|
+
.nut-dialog-footer-ok-badge {
|
|
152
152
|
position: absolute;
|
|
153
153
|
right: 0;
|
|
154
154
|
top: $dialog-footer-badge-top;
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
font-size: $dialog-footer-badge-fontsize;
|
|
162
162
|
color: $dialog-footer-badge-color-ok;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
&-ok {
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
.nut-button-children {
|
|
171
170
|
font-weight: $font-weight-medium;
|
|
172
171
|
}
|
|
173
|
-
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
&-block {
|
|
@@ -179,14 +177,14 @@
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
&-cancel-container{
|
|
180
|
+
&-cancel-container {
|
|
183
181
|
position: relative;
|
|
184
182
|
display: flex;
|
|
185
183
|
align-items: center;
|
|
186
184
|
width: 100%;
|
|
187
185
|
justify-content: space-around;
|
|
188
186
|
|
|
189
|
-
.nut-dialog-footer-cancel-badge{
|
|
187
|
+
.nut-dialog-footer-cancel-badge {
|
|
190
188
|
position: absolute;
|
|
191
189
|
right: $dialog-footer-cancel-margin-right;
|
|
192
190
|
top: $dialog-footer-badge-top;
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&-ok-container{
|
|
144
|
+
&-ok-container {
|
|
145
145
|
position: relative;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
148
|
width: 100%;
|
|
149
149
|
justify-content: space-around;
|
|
150
150
|
|
|
151
|
-
.nut-dialog-footer-ok-badge{
|
|
151
|
+
.nut-dialog-footer-ok-badge {
|
|
152
152
|
position: absolute;
|
|
153
153
|
right: 0;
|
|
154
154
|
top: $dialog-footer-badge-top;
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
font-size: $dialog-footer-badge-fontsize;
|
|
162
162
|
color: $dialog-footer-badge-color-ok;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
&-ok {
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
.nut-button-children {
|
|
171
170
|
font-weight: $font-weight-medium;
|
|
172
171
|
}
|
|
173
|
-
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
&-block {
|
|
@@ -179,14 +177,14 @@
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
&-cancel-container{
|
|
180
|
+
&-cancel-container {
|
|
183
181
|
position: relative;
|
|
184
182
|
display: flex;
|
|
185
183
|
align-items: center;
|
|
186
184
|
width: 100%;
|
|
187
185
|
justify-content: space-around;
|
|
188
186
|
|
|
189
|
-
.nut-dialog-footer-cancel-badge{
|
|
187
|
+
.nut-dialog-footer-cancel-badge {
|
|
190
188
|
position: absolute;
|
|
191
189
|
right: $dialog-footer-cancel-margin-right;
|
|
192
190
|
top: $dialog-footer-badge-top;
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&-ok-container{
|
|
144
|
+
&-ok-container {
|
|
145
145
|
position: relative;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
148
|
width: 100%;
|
|
149
149
|
justify-content: space-around;
|
|
150
150
|
|
|
151
|
-
.nut-dialog-footer-ok-badge{
|
|
151
|
+
.nut-dialog-footer-ok-badge {
|
|
152
152
|
position: absolute;
|
|
153
153
|
right: 0;
|
|
154
154
|
top: $dialog-footer-badge-top;
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
font-size: $dialog-footer-badge-fontsize;
|
|
162
162
|
color: $dialog-footer-badge-color-ok;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
&-ok {
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
.nut-button-children {
|
|
171
170
|
font-weight: $font-weight-medium;
|
|
172
171
|
}
|
|
173
|
-
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
&-block {
|
|
@@ -179,14 +177,14 @@
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
&-cancel-container{
|
|
180
|
+
&-cancel-container {
|
|
183
181
|
position: relative;
|
|
184
182
|
display: flex;
|
|
185
183
|
align-items: center;
|
|
186
184
|
width: 100%;
|
|
187
185
|
justify-content: space-around;
|
|
188
186
|
|
|
189
|
-
.nut-dialog-footer-cancel-badge{
|
|
187
|
+
.nut-dialog-footer-cancel-badge {
|
|
190
188
|
position: absolute;
|
|
191
189
|
right: $dialog-footer-cancel-margin-right;
|
|
192
190
|
top: $dialog-footer-badge-top;
|
|
@@ -15,6 +15,7 @@ import { useForceUpdate } from "../../hooks/use-force-update";
|
|
|
15
15
|
import raf from "../../utils/raf";
|
|
16
16
|
import { useUuid } from "../../hooks/use-uuid";
|
|
17
17
|
import { useRtl } from "../configprovider/configprovider";
|
|
18
|
+
import { td } from "../../utils/taro/platform";
|
|
18
19
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19
20
|
tabStyle: {},
|
|
20
21
|
activeColor: '',
|
|
@@ -150,6 +151,13 @@ export var Tabs = function(props) {
|
|
|
150
151
|
return String(t.value) === String(value);
|
|
151
152
|
});
|
|
152
153
|
index = index < 0 ? 0 : index;
|
|
154
|
+
// 适配 安卓 处理,临时方案,hack
|
|
155
|
+
if (td()) {
|
|
156
|
+
return {
|
|
157
|
+
transform: direction === 'horizontal' ? "translate3d(".concat(rtl ? '' : '-').concat(index * 50, "%, 0, 0)") : "translate3d( 0, -".concat(index * 50, "%, 0)"),
|
|
158
|
+
transitionDuration: "".concat(duration, "ms")
|
|
159
|
+
};
|
|
160
|
+
}
|
|
153
161
|
return {
|
|
154
162
|
transform: direction === 'horizontal' ? "translate3d(".concat(rtl ? '' : '-').concat(index * 100, "%, 0, 0)") : "translate3d( 0, -".concat(index * 100, "%, 0)"),
|
|
155
163
|
transitionDuration: "".concat(duration, "ms")
|
|
@@ -22,7 +22,7 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
22
22
|
});
|
|
23
23
|
export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
24
24
|
var locale = useConfig().locale;
|
|
25
|
-
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, [
|
|
25
|
+
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, viewId = _ref.viewId, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
|
|
26
26
|
"className",
|
|
27
27
|
"value",
|
|
28
28
|
"defaultValue",
|
|
@@ -36,6 +36,7 @@ export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
36
36
|
"style",
|
|
37
37
|
"plain",
|
|
38
38
|
"status",
|
|
39
|
+
"viewId",
|
|
39
40
|
"onChange",
|
|
40
41
|
"onBlur",
|
|
41
42
|
"onFocus"
|
|
@@ -97,6 +98,7 @@ export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
97
98
|
});
|
|
98
99
|
var _obj;
|
|
99
100
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(View, {
|
|
101
|
+
id: viewId,
|
|
100
102
|
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)
|
|
101
103
|
}, /*#__PURE__*/ React.createElement(Textarea, _object_spread_props(_object_spread({}, rest), {
|
|
102
104
|
ref: textareaRef,
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -4303,6 +4303,12 @@
|
|
|
4303
4303
|
return String(t.value) === String(value2);
|
|
4304
4304
|
});
|
|
4305
4305
|
index2 = index2 < 0 ? 0 : index2;
|
|
4306
|
+
if (td()) {
|
|
4307
|
+
return {
|
|
4308
|
+
transform: direction === "horizontal" ? "translate3d(".concat(rtl ? "" : "-").concat(index2 * 50, "%, 0, 0)") : "translate3d( 0, -".concat(index2 * 50, "%, 0)"),
|
|
4309
|
+
transitionDuration: "".concat(duration, "ms")
|
|
4310
|
+
};
|
|
4311
|
+
}
|
|
4306
4312
|
return {
|
|
4307
4313
|
transform: direction === "horizontal" ? "translate3d(".concat(rtl ? "" : "-").concat(index2 * 100, "%, 0, 0)") : "translate3d( 0, -".concat(index2 * 100, "%, 0)"),
|
|
4308
4314
|
transitionDuration: "".concat(duration, "ms")
|
|
@@ -6907,13 +6913,14 @@
|
|
|
6907
6913
|
icon: null,
|
|
6908
6914
|
activeIcon: null,
|
|
6909
6915
|
indeterminateIcon: null,
|
|
6916
|
+
timeout: 300,
|
|
6910
6917
|
onChange: function(value2) {
|
|
6911
6918
|
}
|
|
6912
6919
|
});
|
|
6913
6920
|
var classPrefix$j = "nut-checkbox";
|
|
6914
6921
|
var Checkbox = function(props) {
|
|
6915
6922
|
var children = _object_spread({}, defaultProps$14, props).children;
|
|
6916
|
-
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value2 = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, others = _object_without_properties(props, [
|
|
6923
|
+
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value2 = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, timeout = props.timeout, others = _object_without_properties(props, [
|
|
6917
6924
|
"icon",
|
|
6918
6925
|
"label",
|
|
6919
6926
|
"className",
|
|
@@ -6925,7 +6932,8 @@
|
|
|
6925
6932
|
"disabled",
|
|
6926
6933
|
"onChange",
|
|
6927
6934
|
"indeterminate",
|
|
6928
|
-
"indeterminateIcon"
|
|
6935
|
+
"indeterminateIcon",
|
|
6936
|
+
"timeout"
|
|
6929
6937
|
]);
|
|
6930
6938
|
var labelPosition = others.labelPosition, rest = _object_without_properties(others, [
|
|
6931
6939
|
"labelPosition"
|
|
@@ -7017,8 +7025,14 @@
|
|
|
7017
7025
|
className: classNames("".concat(classPrefix$j, "-label "), _define_property({}, "".concat(classPrefix$j, "-label-disabled"), innerDisabled))
|
|
7018
7026
|
}, children || label);
|
|
7019
7027
|
};
|
|
7028
|
+
var loadingRef = React.useRef(false);
|
|
7020
7029
|
var handleClick = function() {
|
|
7021
7030
|
if (disabled) return;
|
|
7031
|
+
if (loadingRef.current) return;
|
|
7032
|
+
loadingRef.current = true;
|
|
7033
|
+
setTimeout(function() {
|
|
7034
|
+
loadingRef.current = false;
|
|
7035
|
+
}, timeout);
|
|
7022
7036
|
var latestChecked = !innerChecked;
|
|
7023
7037
|
setChecked(latestChecked);
|
|
7024
7038
|
};
|
|
@@ -14163,7 +14177,7 @@
|
|
|
14163
14177
|
});
|
|
14164
14178
|
var TextArea = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
14165
14179
|
var locale = useConfig().locale;
|
|
14166
|
-
var _ref = _object_spread({}, defaultProps$L, props), className = _ref.className, value2 = _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, [
|
|
14180
|
+
var _ref = _object_spread({}, defaultProps$L, props), className = _ref.className, value2 = _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, viewId = _ref.viewId, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
|
|
14167
14181
|
"className",
|
|
14168
14182
|
"value",
|
|
14169
14183
|
"defaultValue",
|
|
@@ -14177,6 +14191,7 @@
|
|
|
14177
14191
|
"style",
|
|
14178
14192
|
"plain",
|
|
14179
14193
|
"status",
|
|
14194
|
+
"viewId",
|
|
14180
14195
|
"onChange",
|
|
14181
14196
|
"onBlur",
|
|
14182
14197
|
"onFocus"
|
|
@@ -14238,6 +14253,7 @@
|
|
|
14238
14253
|
});
|
|
14239
14254
|
var _obj;
|
|
14240
14255
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(components.View, {
|
|
14256
|
+
id: viewId,
|
|
14241
14257
|
className: classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix2, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix2, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix2, "-plain"), plain), _define_property(_obj, "".concat(classPrefix2, "-container"), !plain), _define_property(_obj, "".concat(classPrefix2, "-").concat(status), status), _obj), className)
|
|
14242
14258
|
}, /* @__PURE__ */ React.createElement(components.Textarea, _object_spread_props(_object_spread({}, rest), {
|
|
14243
14259
|
ref: textareaRef,
|