@nutui/nutui-react-taro 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/cjs/packages/badge/badge.js +4 -3
- package/dist/cjs/packages/badge/style/badge.scss +7 -8
- package/dist/cjs/packages/badge/style/style.css +13 -15
- package/dist/cjs/packages/badge/style/style.harmony.css +7 -9
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +3 -1
- package/dist/cjs/packages/datepickerview/style/style.css +3 -1
- package/dist/cjs/packages/empty/style/index.js +1 -0
- package/dist/cjs/packages/empty/style/style.css +389 -0
- package/dist/cjs/packages/fixednav/fixednav.js +3 -3
- package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/cjs/packages/fixednav/style/style.css +56 -51
- package/dist/cjs/packages/fixednav/style/style.harmony.css +43 -36
- package/dist/cjs/packages/imagepreview/imagepreview.js +58 -91
- package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/cjs/packages/imagepreview/style/style.css +2 -1
- package/dist/cjs/packages/imagepreview/style/style.harmony.css +2 -1
- package/dist/cjs/packages/indicator/indicator.js +1 -1
- package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
- package/dist/cjs/packages/lottie/index.js +5 -5
- package/dist/cjs/packages/lottie/{mp.js → lottiemp.js} +1 -1
- package/dist/cjs/packages/notify/notify.js +44 -13
- package/dist/cjs/packages/notify/style/notify.scss +39 -36
- package/dist/cjs/packages/notify/style/style.css +36 -31
- package/dist/cjs/packages/notify/style/style.harmony.css +36 -31
- package/dist/cjs/packages/nutui.react.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.js +1 -0
- package/dist/cjs/packages/picker/style/style.css +3 -1
- package/dist/cjs/packages/pickerview/pickerroller.js +81 -11
- package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/cjs/packages/pickerview/style/style.css +3 -1
- package/dist/cjs/packages/pickerview/style/style.harmony.css +3 -0
- package/dist/cjs/packages/resultpage/style/index.js +1 -0
- package/dist/cjs/packages/resultpage/style/style.css +389 -0
- package/dist/cjs/packages/searchbar/searchbar.js +8 -2
- package/dist/cjs/packages/skeleton/skeleton.js +63 -52
- package/dist/cjs/packages/skeleton/style/index.js +0 -1
- package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/cjs/packages/skeleton/style/style.css +32 -175
- package/dist/cjs/packages/skeleton/style/style.harmony.css +32 -42
- package/dist/cjs/packages/switch/style/style.css +5 -0
- package/dist/cjs/packages/switch/style/style.harmony.css +5 -0
- package/dist/cjs/packages/switch/style/switch.scss +5 -0
- package/dist/cjs/packages/switch/switch.js +22 -11
- package/dist/cjs/packages/tabbar/style/style.css +58 -54
- package/dist/cjs/packages/tabbar/style/style.harmony.css +24 -18
- package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/cjs/packages/tabbar/tabbar.js +28 -10
- package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
- package/dist/cjs/packages/tabbaritem/style/style.harmony.css +21 -21
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +38 -14
- package/dist/cjs/types/spec/badge/base.d.ts +1 -0
- package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
- package/dist/cjs/types/spec/notify/base.d.ts +7 -2
- package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
- package/dist/cjs/types/spec/switch/base.d.ts +3 -2
- package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
- package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
- package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
- package/dist/es/packages/badge/badge.js +4 -3
- package/dist/es/packages/badge/style/badge.scss +7 -8
- package/dist/es/packages/badge/style/style.css +13 -15
- package/dist/es/packages/badge/style/style.harmony.css +7 -9
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +3 -1
- package/dist/es/packages/datepickerview/style/style.css +3 -1
- package/dist/es/packages/empty/style/index.js +1 -0
- package/dist/es/packages/empty/style/style.css +389 -0
- package/dist/es/packages/fixednav/fixednav.js +4 -4
- package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/es/packages/fixednav/style/style.css +56 -51
- package/dist/es/packages/fixednav/style/style.harmony.css +43 -36
- package/dist/es/packages/imagepreview/imagepreview.js +58 -91
- package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/es/packages/imagepreview/style/style.css +2 -1
- package/dist/es/packages/imagepreview/style/style.harmony.css +2 -1
- package/dist/es/packages/indicator/indicator.js +1 -1
- package/dist/es/packages/inputnumber/inputnumber.js +2 -2
- package/dist/es/packages/lottie/index.js +3 -3
- package/dist/es/packages/lottie/{mp.js → lottiemp.js} +1 -1
- package/dist/es/packages/notify/notify.js +45 -14
- package/dist/es/packages/notify/style/notify.scss +39 -36
- package/dist/es/packages/notify/style/style.css +36 -31
- package/dist/es/packages/notify/style/style.harmony.css +36 -31
- package/dist/es/packages/picker/style/style.css +3 -1
- package/dist/es/packages/pickerview/pickerroller.js +80 -11
- package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/es/packages/pickerview/style/style.css +3 -1
- package/dist/es/packages/pickerview/style/style.harmony.css +3 -0
- package/dist/es/packages/resultpage/style/index.js +1 -0
- package/dist/es/packages/resultpage/style/style.css +389 -0
- package/dist/es/packages/searchbar/searchbar.js +7 -2
- package/dist/es/packages/skeleton/skeleton.js +62 -52
- package/dist/es/packages/skeleton/style/index.js +0 -1
- package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/es/packages/skeleton/style/style.css +32 -175
- package/dist/es/packages/skeleton/style/style.harmony.css +32 -42
- package/dist/es/packages/switch/style/style.css +5 -0
- package/dist/es/packages/switch/style/style.harmony.css +5 -0
- package/dist/es/packages/switch/style/switch.scss +5 -0
- package/dist/es/packages/switch/switch.js +21 -11
- package/dist/es/packages/tabbar/style/style.css +58 -54
- package/dist/es/packages/tabbar/style/style.harmony.css +24 -18
- package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/es/packages/tabbar/tabbar.js +27 -10
- package/dist/es/packages/tabbaritem/style/style.css +34 -36
- package/dist/es/packages/tabbaritem/style/style.harmony.css +21 -21
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/es/packages/tabbaritem/tabbaritem.js +38 -14
- package/dist/es/types/spec/badge/base.d.ts +4 -0
- package/dist/es/types/spec/indicator/base.d.ts +1 -1
- package/dist/es/types/spec/notify/base.d.ts +22 -5
- package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/es/types/spec/skeleton/base.d.ts +19 -14
- package/dist/es/types/spec/switch/base.d.ts +6 -2
- package/dist/es/types/spec/switch/h5.d.ts +1 -1
- package/dist/es/types/spec/switch/taro.d.ts +1 -4
- package/dist/es/types/spec/tabbar/base.d.ts +7 -4
- package/dist/nutui.react.umd.js +549 -395
- package/dist/style.css +1 -1
- package/dist/style.scss +51 -51
- package/dist/styles/theme-dark.scss +2 -0
- package/dist/styles/theme-default.scss +2 -0
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-jmapp.scss +24 -1
- package/dist/styles/variables-jrkf.scss +24 -1
- package/dist/styles/variables.scss +37 -38
- package/package.json +1 -1
- /package/dist/cjs/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.js → lottieweb.js} +0 -0
- /package/dist/es/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.js → lottieweb.js} +0 -0
|
@@ -8,35 +8,46 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
11
12
|
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
|
+
var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
|
|
14
|
+
var _define_property = require("@swc/helpers/_/_define_property");
|
|
12
15
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
16
|
+
var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
13
17
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
18
|
+
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
14
19
|
var _components = require("@tarojs/components");
|
|
15
20
|
var _usetouch = require("../../hooks/use-touch");
|
|
16
21
|
var _supportspassive = require("../../utils/supports-passive");
|
|
17
22
|
var _platformtaro = require("../../utils/platform-taro");
|
|
18
23
|
var _utils = require("../../utils");
|
|
19
24
|
var _utils1 = require("./utils");
|
|
25
|
+
var _useuuid = /*#__PURE__*/ _interop_require_default._(require("../../hooks/use-uuid"));
|
|
26
|
+
var _getrectbytaro = require("../../utils/get-rect-by-taro");
|
|
20
27
|
var InternalPickerRoller = function InternalPickerRoller(props, ref) {
|
|
21
28
|
var _props_keyIndex = props.keyIndex, keyIndex = _props_keyIndex === void 0 ? 0 : _props_keyIndex, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_threeDimensional = props.threeDimensional, threeDimensional = _props_threeDimensional === void 0 ? true : _props_threeDimensional, _props_duration = props.duration, duration = _props_duration === void 0 ? 1000 : _props_duration, onSelect = props.onSelect, _props_renderLabel = props.renderLabel, renderLabel = _props_renderLabel === void 0 ? function renderLabel(item) {
|
|
22
29
|
return item.label;
|
|
23
30
|
} : _props_renderLabel;
|
|
31
|
+
var classPrefix = 'nut-pickerview-roller';
|
|
32
|
+
var uuid = (0, _useuuid.default)();
|
|
24
33
|
var DEFAULT_DURATION = 200;
|
|
25
34
|
var INERTIA_TIME = 300;
|
|
26
35
|
var INERTIA_DISTANCE = 15;
|
|
27
36
|
var ROTATION = 20;
|
|
28
37
|
var touch = (0, _usetouch.useTouch)();
|
|
29
|
-
var _useState = (0, _sliced_to_array._)((0, _react.useState)(
|
|
38
|
+
var _useState = (0, _sliced_to_array._)((0, _react.useState)(0), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
|
|
30
39
|
var lineSpacing = (0, _react.useRef)(36);
|
|
31
40
|
var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(0), 2), touchTime = _useState1[0], setTouchTime = _useState1[1];
|
|
32
41
|
var _useState2 = (0, _sliced_to_array._)((0, _react.useState)('0deg'), 2), touchDeg = _useState2[0], setTouchDeg = _useState2[1];
|
|
33
42
|
var isMoving = (0, _react.useRef)(false);
|
|
34
43
|
var rollerRef = (0, _react.useRef)(null);
|
|
35
44
|
var pickerRollerRef = (0, _react.useRef)(null);
|
|
45
|
+
var placeholderRef = (0, _react.useRef)(null);
|
|
36
46
|
var _useState3 = (0, _sliced_to_array._)((0, _react.useState)(0), 2), startTime = _useState3[0], setStartTime = _useState3[1];
|
|
37
47
|
var _useState4 = (0, _sliced_to_array._)((0, _react.useState)(0), 2), startY = _useState4[0], setStartY = _useState4[1];
|
|
38
48
|
var transformY = (0, _react.useRef)(0);
|
|
39
49
|
var _useState5 = (0, _sliced_to_array._)((0, _react.useState)(0), 2), scrollDistance = _useState5[0], setScrollDistance = _useState5[1];
|
|
50
|
+
var _useState6 = (0, _sliced_to_array._)((0, _react.useState)((0, _platformtaro.web)()), 2), isGetLineSpacing = _useState6[0], setGetStatus = _useState6[1];
|
|
40
51
|
var _useStyles = (0, _utils1.useStyles)(touchTime, touchDeg, scrollDistance, lineSpacing, ROTATION), touchRollerStyle = _useStyles.touchRollerStyle, touchTiledStyle = _useStyles.touchTiledStyle, rollerStyle = _useStyles.rollerStyle;
|
|
41
52
|
var isItemHidden = function isItemHidden(index) {
|
|
42
53
|
return index >= currentIndex + 8 || index <= currentIndex - 8;
|
|
@@ -61,7 +72,7 @@ var InternalPickerRoller = function InternalPickerRoller(props, ref) {
|
|
|
61
72
|
var deg1 = Math.min(Math.max(currentDeg, 0), (options.length + 1) * ROTATION);
|
|
62
73
|
if (deg1 >= 0 && deg1 < (options.length + 1) * ROTATION) {
|
|
63
74
|
applyTransform('', "".concat(deg1, "deg"), undefined, updatedMove);
|
|
64
|
-
setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
|
|
75
|
+
deg1 > 0 && setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
};
|
|
@@ -102,7 +113,7 @@ var InternalPickerRoller = function InternalPickerRoller(props, ref) {
|
|
|
102
113
|
var index = options.findIndex(function(item) {
|
|
103
114
|
return item.value === selectedValue;
|
|
104
115
|
});
|
|
105
|
-
setCurrentIndex(index === -1 ?
|
|
116
|
+
setCurrentIndex(index === -1 ? 0 : index + 1);
|
|
106
117
|
var move = index * lineSpacing.current;
|
|
107
118
|
shouldSelect && selectValue(-move);
|
|
108
119
|
handleMove(-move);
|
|
@@ -112,16 +123,69 @@ var InternalPickerRoller = function InternalPickerRoller(props, ref) {
|
|
|
112
123
|
setTouchTime(0);
|
|
113
124
|
selectValue(scrollDistance);
|
|
114
125
|
};
|
|
126
|
+
var getReactHeight = /*#__PURE__*/ function() {
|
|
127
|
+
var _ref = (0, _async_to_generator._)(function() {
|
|
128
|
+
var placeholder, placeholderHeight, error;
|
|
129
|
+
return (0, _ts_generator._)(this, function(_state) {
|
|
130
|
+
switch(_state.label){
|
|
131
|
+
case 0:
|
|
132
|
+
_state.trys.push([
|
|
133
|
+
0,
|
|
134
|
+
2,
|
|
135
|
+
,
|
|
136
|
+
3
|
|
137
|
+
]);
|
|
138
|
+
return [
|
|
139
|
+
4,
|
|
140
|
+
(0, _getrectbytaro.getRectByTaro)(placeholderRef.current)
|
|
141
|
+
];
|
|
142
|
+
case 1:
|
|
143
|
+
placeholder = _state.sent();
|
|
144
|
+
placeholderHeight = placeholder.height || 0;
|
|
145
|
+
return [
|
|
146
|
+
2,
|
|
147
|
+
placeholderHeight
|
|
148
|
+
];
|
|
149
|
+
case 2:
|
|
150
|
+
error = _state.sent();
|
|
151
|
+
console.error('获取高度失败:', error);
|
|
152
|
+
return [
|
|
153
|
+
2,
|
|
154
|
+
0
|
|
155
|
+
];
|
|
156
|
+
case 3:
|
|
157
|
+
return [
|
|
158
|
+
2
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
return function getReactHeight() {
|
|
164
|
+
return _ref.apply(this, arguments);
|
|
165
|
+
};
|
|
166
|
+
}();
|
|
115
167
|
// lineSpacing.current CSS variable
|
|
116
168
|
(0, _react.useEffect)(function() {
|
|
117
169
|
var element = pickerRollerRef.current;
|
|
170
|
+
var currentLineSpacing;
|
|
118
171
|
if (element && (0, _platformtaro.web)()) {
|
|
119
172
|
var computedStyle = getComputedStyle(element);
|
|
120
|
-
|
|
121
|
-
|
|
173
|
+
currentLineSpacing = computedStyle.getPropertyValue('--nutui-picker-item-height');
|
|
174
|
+
if (currentLineSpacing) {
|
|
175
|
+
lineSpacing.current = parseFloat(currentLineSpacing);
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
getReactHeight().then(function(height) {
|
|
179
|
+
currentLineSpacing = height;
|
|
180
|
+
if (currentLineSpacing) {
|
|
181
|
+
lineSpacing.current = currentLineSpacing;
|
|
182
|
+
setGetStatus(true);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
122
185
|
}
|
|
123
186
|
}, [
|
|
124
|
-
pickerRollerRef.current
|
|
187
|
+
pickerRollerRef.current,
|
|
188
|
+
placeholderRef.current
|
|
125
189
|
]);
|
|
126
190
|
(0, _react.useEffect)(function() {
|
|
127
191
|
isMoving.current = false;
|
|
@@ -163,21 +227,27 @@ var InternalPickerRoller = function InternalPickerRoller(props, ref) {
|
|
|
163
227
|
className: "nut-pickerview-list",
|
|
164
228
|
ref: pickerRollerRef
|
|
165
229
|
}, /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
166
|
-
className: "
|
|
230
|
+
className: "".concat(classPrefix, "-placeholder"),
|
|
231
|
+
ref: placeholderRef,
|
|
232
|
+
id: "".concat(classPrefix, "-placeholder-").concat(uuid)
|
|
233
|
+
}), /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
234
|
+
className: classPrefix,
|
|
235
|
+
id: "".concat(classPrefix, "-").concat(uuid),
|
|
167
236
|
ref: rollerRef,
|
|
168
237
|
style: threeDimensional ? touchRollerStyle() : touchTiledStyle(),
|
|
169
238
|
onTransitionEnd: stopMomentumScroll
|
|
170
239
|
}, threeDimensional && options.map(function(item, index) {
|
|
171
240
|
var _item_value;
|
|
172
|
-
|
|
173
|
-
|
|
241
|
+
var _obj;
|
|
242
|
+
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, isGetLineSpacing ? /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
243
|
+
className: (0, _classnames.default)("".concat(classPrefix, "-item"), (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-item-hidden"), isItemHidden(index + 1)), (0, _define_property._)(_obj, "".concat(classPrefix, "-item-active"), index + 1 === currentIndex), _obj)),
|
|
174
244
|
style: rollerStyle(index),
|
|
175
245
|
key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
|
|
176
|
-
}, renderLabel(item));
|
|
246
|
+
}, renderLabel(item)) : null);
|
|
177
247
|
}), !threeDimensional && options.map(function(item, index) {
|
|
178
248
|
var _item_value;
|
|
179
249
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
180
|
-
className: "
|
|
250
|
+
className: (0, _classnames.default)("".concat(classPrefix, "-item-tiled"), (0, _define_property._)({}, "".concat(classPrefix, "-item-active"), index + 1 === currentIndex)),
|
|
181
251
|
key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
|
|
182
252
|
}, renderLabel(item));
|
|
183
253
|
})));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.nut-pickerview {
|
|
2
|
-
--nutui-picker-item-height: 36px;
|
|
3
2
|
position: relative;
|
|
4
3
|
display: flex;
|
|
5
4
|
width: 100%;
|
|
@@ -50,6 +49,9 @@
|
|
|
50
49
|
height: $picker-item-height;
|
|
51
50
|
z-index: 1;
|
|
52
51
|
transform-style: preserve-3d;
|
|
52
|
+
&-placeholder {
|
|
53
|
+
height: $picker-item-height;
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
&-roller-item {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
/* #ifndef harmony */
|
|
4
4
|
/* #endif */
|
|
5
5
|
.nut-pickerview {
|
|
6
|
-
--nutui-picker-item-height: 36px;
|
|
7
6
|
position: relative;
|
|
8
7
|
display: flex;
|
|
9
8
|
width: 100%;
|
|
@@ -49,6 +48,9 @@
|
|
|
49
48
|
z-index: 1;
|
|
50
49
|
transform-style: preserve-3d;
|
|
51
50
|
}
|
|
51
|
+
.nut-pickerview-roller-placeholder {
|
|
52
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
53
|
+
}
|
|
52
54
|
.nut-pickerview-roller-item {
|
|
53
55
|
position: absolute;
|
|
54
56
|
top: 0;
|
|
@@ -2,6 +2,395 @@
|
|
|
2
2
|
/* #endif */
|
|
3
3
|
/* #ifndef harmony */
|
|
4
4
|
/* #endif */
|
|
5
|
+
.nut-button {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
/* #ifdef harmony*/
|
|
10
|
+
width: 80px;
|
|
11
|
+
/* #endif */
|
|
12
|
+
/* #ifndef harmony*/
|
|
13
|
+
width: auto;
|
|
14
|
+
/* #endif */
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
height: var(--nutui-button-default-height, 32px);
|
|
23
|
+
font-size: var(--nutui-button-default-font-size, var(--nutui-font-size-base, 14px));
|
|
24
|
+
font-weight: var(--nutui-font-weight, 400);
|
|
25
|
+
text-align: center;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: opacity 0.2s;
|
|
28
|
+
user-select: none;
|
|
29
|
+
touch-action: manipulation;
|
|
30
|
+
-webkit-appearance: none;
|
|
31
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
32
|
+
color: var(--nutui-button-default-color, var(--nutui-color-title, #1a1a1a));
|
|
33
|
+
background: var(--nutui-button-default-background-color, transparent);
|
|
34
|
+
border-width: var(--nutui-button-border-width, 0.5px);
|
|
35
|
+
}
|
|
36
|
+
.nut-button-text {
|
|
37
|
+
margin-left: var(--nutui-button-text-icon-margin, 4px);
|
|
38
|
+
}
|
|
39
|
+
.nut-button-text-right {
|
|
40
|
+
margin-right: var(--nutui-button-text-icon-margin, 4px);
|
|
41
|
+
}
|
|
42
|
+
.nut-button-children {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
background: transparent;
|
|
46
|
+
}
|
|
47
|
+
.nut-button::before {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 50%;
|
|
50
|
+
left: 50%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
background-color: var(--nutui-color-mask, rgba(0, 0, 0, 0.7));
|
|
54
|
+
border: inherit;
|
|
55
|
+
border-color: var(--nutui-color-mask, rgba(0, 0, 0, 0.7));
|
|
56
|
+
border-radius: inherit;
|
|
57
|
+
transform: translate(-50%, -50%);
|
|
58
|
+
opacity: 0;
|
|
59
|
+
content: " ";
|
|
60
|
+
}
|
|
61
|
+
.nut-button::after {
|
|
62
|
+
border: none;
|
|
63
|
+
}
|
|
64
|
+
.nut-button:active::before {
|
|
65
|
+
opacity: 0.1;
|
|
66
|
+
}
|
|
67
|
+
.nut-button-wrap {
|
|
68
|
+
height: 100%;
|
|
69
|
+
width: 100%;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: row;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
/* #ifndef harmony */
|
|
75
|
+
background: initial;
|
|
76
|
+
/* #endif */
|
|
77
|
+
}
|
|
78
|
+
.nut-button-wrap .nut-icon {
|
|
79
|
+
font-size: var(--nutui-button-default-font-size, var(--nutui-font-size-base, 14px));
|
|
80
|
+
width: var(--nutui-button-default-font-size, var(--nutui-font-size-base, 14px));
|
|
81
|
+
height: var(--nutui-button-default-font-size, var(--nutui-font-size-base, 14px));
|
|
82
|
+
}
|
|
83
|
+
.nut-button-loading::before, .nut-button-disabled::before {
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
.nut-button-disabled {
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
color: #ffffff;
|
|
89
|
+
}
|
|
90
|
+
.nut-button.nut-button-icononly {
|
|
91
|
+
width: var(--nutui-button-default-height, 32px);
|
|
92
|
+
padding: 0;
|
|
93
|
+
}
|
|
94
|
+
.nut-button-round {
|
|
95
|
+
border-radius: var(--nutui-button-border-radius, var(--nutui-radius-s, 6px));
|
|
96
|
+
}
|
|
97
|
+
.nut-button-round-xlarge {
|
|
98
|
+
border-radius: var(--nutui-button-xlarge-border-radius, var(--nutui-radius-base, 8px));
|
|
99
|
+
}
|
|
100
|
+
.nut-button-round-large {
|
|
101
|
+
border-radius: var(--nutui-button-large-border-radius, var(--nutui-radius-base, 8px));
|
|
102
|
+
}
|
|
103
|
+
.nut-button-round-small {
|
|
104
|
+
border-radius: var(--nutui-button-small-border-radius, var(--nutui-radius-s, 6px));
|
|
105
|
+
}
|
|
106
|
+
.nut-button-round-mini {
|
|
107
|
+
border-radius: var(--nutui-button-mini-border-radius, var(--nutui-radius-xs, 4px));
|
|
108
|
+
}
|
|
109
|
+
.nut-button-default {
|
|
110
|
+
padding: var(--nutui-button-default-padding, 0px 12px);
|
|
111
|
+
border-style: solid;
|
|
112
|
+
border-color: var(--nutui-button-default-border-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
113
|
+
}
|
|
114
|
+
.nut-button-default-disabled, .nut-button-default-solid-disabled {
|
|
115
|
+
color: var(--nutui-button-primary-color, #ffffff);
|
|
116
|
+
background: var(--nutui-button-default-disabled, var(--nutui-color-text-disabled, #c2c4cc));
|
|
117
|
+
border-color: var(--nutui-button-default-disabled, var(--nutui-color-text-disabled, #c2c4cc));
|
|
118
|
+
}
|
|
119
|
+
.nut-button-default-none-disabled {
|
|
120
|
+
color: var(--nutui-button-default-disabled-color, var(--nutui-color-text-help, #888b94));
|
|
121
|
+
}
|
|
122
|
+
.nut-button-default-outline-disabled, .nut-button-default-dashed-disabled {
|
|
123
|
+
background: transparent;
|
|
124
|
+
color: var(--nutui-button-default-disabled, var(--nutui-color-text-disabled, #c2c4cc));
|
|
125
|
+
border-color: var(--nutui-button-default-disabled, var(--nutui-color-text-disabled, #c2c4cc));
|
|
126
|
+
}
|
|
127
|
+
.nut-button-normal {
|
|
128
|
+
padding: var(--nutui-button-normal-padding, 0px 12px);
|
|
129
|
+
}
|
|
130
|
+
.nut-button-xlarge {
|
|
131
|
+
height: var(--nutui-button-xlarge-height, 48px);
|
|
132
|
+
padding: var(--nutui-button-xlarge-padding, 0px 24px);
|
|
133
|
+
font-size: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
134
|
+
border-radius: var(--nutui-radius-base, 8px);
|
|
135
|
+
}
|
|
136
|
+
.nut-button-xlarge .nut-button-text {
|
|
137
|
+
margin-left: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
138
|
+
}
|
|
139
|
+
.nut-button-xlarge .nut-button-text-right {
|
|
140
|
+
margin-right: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
141
|
+
}
|
|
142
|
+
.nut-button-xlarge .nut-icon {
|
|
143
|
+
font-size: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
144
|
+
width: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
145
|
+
height: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
146
|
+
}
|
|
147
|
+
.nut-button-xlarge-children {
|
|
148
|
+
font-size: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
149
|
+
}
|
|
150
|
+
.nut-button-large {
|
|
151
|
+
height: var(--nutui-button-large-height, 40px);
|
|
152
|
+
padding: var(--nutui-button-large-padding, 0px 16px);
|
|
153
|
+
font-size: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
154
|
+
border-radius: var(--nutui-radius-s, 6px);
|
|
155
|
+
}
|
|
156
|
+
.nut-button-large .nut-button-text {
|
|
157
|
+
margin-left: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
158
|
+
}
|
|
159
|
+
.nut-button-large .nut-button-text-right {
|
|
160
|
+
margin-right: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
161
|
+
}
|
|
162
|
+
.nut-button-large .nut-icon {
|
|
163
|
+
font-size: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
164
|
+
width: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
165
|
+
height: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
166
|
+
}
|
|
167
|
+
.nut-button-large-children {
|
|
168
|
+
font-size: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
169
|
+
}
|
|
170
|
+
.nut-button-small {
|
|
171
|
+
height: var(--nutui-button-small-height, 28px);
|
|
172
|
+
padding: var(--nutui-button-small-padding, 0px 8px);
|
|
173
|
+
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
174
|
+
border-radius: var(--nutui-radius-xs, 4px);
|
|
175
|
+
}
|
|
176
|
+
.nut-button-small .nut-icon {
|
|
177
|
+
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
178
|
+
width: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
179
|
+
height: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
180
|
+
}
|
|
181
|
+
.nut-button-small-children {
|
|
182
|
+
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
183
|
+
}
|
|
184
|
+
.nut-button-mini {
|
|
185
|
+
height: var(--nutui-button-mini-height, 24px);
|
|
186
|
+
padding: var(--nutui-button-mini-padding, 0px 8px);
|
|
187
|
+
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
188
|
+
border-radius: var(--nutui-radius-xs, 4px);
|
|
189
|
+
}
|
|
190
|
+
.nut-button-mini .nut-icon {
|
|
191
|
+
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
192
|
+
width: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
193
|
+
height: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
194
|
+
}
|
|
195
|
+
.nut-button-mini-children {
|
|
196
|
+
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
197
|
+
}
|
|
198
|
+
.nut-button-primary {
|
|
199
|
+
color: var(--nutui-button-primary-color, #ffffff);
|
|
200
|
+
background-origin: border-box;
|
|
201
|
+
border-color: transparent;
|
|
202
|
+
}
|
|
203
|
+
.nut-button-primary-children {
|
|
204
|
+
color: var(--nutui-button-primary-color, #ffffff);
|
|
205
|
+
}
|
|
206
|
+
.nut-button-primary-solid {
|
|
207
|
+
background: linear-gradient(90deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%);
|
|
208
|
+
color: var(--nutui-button-primary-color, #ffffff);
|
|
209
|
+
border-color: transparent;
|
|
210
|
+
font-weight: var(--nutui-font-weight-bold, 600);
|
|
211
|
+
}
|
|
212
|
+
.nut-button-primary-solid.nut-button-small, .nut-button-primary-solid.nut-button-mini {
|
|
213
|
+
font-weight: var(--nutui-font-weight, 400);
|
|
214
|
+
}
|
|
215
|
+
.nut-button-primary-disabled, .nut-button-primary-disabled.nut-button-icononly, .nut-button-primary-solid-disabled {
|
|
216
|
+
color: var(--nutui-button-primary-color, #ffffff);
|
|
217
|
+
background: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
218
|
+
border-color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
219
|
+
}
|
|
220
|
+
.nut-button-primary-none {
|
|
221
|
+
color: var(--nutui-button-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
222
|
+
}
|
|
223
|
+
.nut-button-primary-none-disabled {
|
|
224
|
+
color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
225
|
+
}
|
|
226
|
+
.nut-button-primary-outline {
|
|
227
|
+
color: var(--nutui-button-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
228
|
+
border-color: var(--nutui-button-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
229
|
+
}
|
|
230
|
+
.nut-button-primary-outline-disabled {
|
|
231
|
+
color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
232
|
+
border-color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
233
|
+
}
|
|
234
|
+
.nut-button-primary-dashed {
|
|
235
|
+
color: var(--nutui-button-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
236
|
+
border-color: var(--nutui-button-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
237
|
+
}
|
|
238
|
+
.nut-button-primary-dashed-disabled {
|
|
239
|
+
color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
240
|
+
border-color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
241
|
+
}
|
|
242
|
+
.nut-button-primary.nut-button-solid.nut-button-normal {
|
|
243
|
+
font-weight: var(--nutui-font-weight-bold, 600);
|
|
244
|
+
}
|
|
245
|
+
.nut-button-success {
|
|
246
|
+
color: var(--nutui-button-success-color, #ffffff);
|
|
247
|
+
background: var(--nutui-button-success-background-color, var(--nutui-color-success, #00d900));
|
|
248
|
+
background-origin: border-box;
|
|
249
|
+
border-color: transparent;
|
|
250
|
+
}
|
|
251
|
+
.nut-button-success-children {
|
|
252
|
+
color: var(--nutui-button-success-color, #ffffff);
|
|
253
|
+
}
|
|
254
|
+
.nut-button-success-solid-disabled {
|
|
255
|
+
background: var(--nutui-button-success-disabled, var(--nutui-color-success-disabled, #b2f0ae));
|
|
256
|
+
border-color: var(--nutui-button-success-disabled, var(--nutui-color-success-disabled, #b2f0ae));
|
|
257
|
+
}
|
|
258
|
+
.nut-button-success-outline, .nut-button-success-dashed {
|
|
259
|
+
color: var(--nutui-button-success-border-color, var(--nutui-color-success, #00d900));
|
|
260
|
+
border-color: var(--nutui-button-success-border-color, var(--nutui-color-success, #00d900));
|
|
261
|
+
}
|
|
262
|
+
.nut-button-success-outline-disabled, .nut-button-success-dashed-disabled {
|
|
263
|
+
color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
264
|
+
border-color: var(--nutui-button-primary-disabled, var(--nutui-color-primary-disabled-special, #ffadbe));
|
|
265
|
+
}
|
|
266
|
+
.nut-button-success-none {
|
|
267
|
+
color: var(--nutui-button-success-border-color, var(--nutui-color-success, #00d900));
|
|
268
|
+
}
|
|
269
|
+
.nut-button-success-none-disabled {
|
|
270
|
+
color: var(--nutui-button-success-disabled, var(--nutui-color-success-disabled, #b2f0ae));
|
|
271
|
+
}
|
|
272
|
+
.nut-button-info {
|
|
273
|
+
color: var(--nutui-button-info-color, #ffffff);
|
|
274
|
+
background: var(--nutui-button-info-background-color, var(--nutui-color-info-background, #0073ff));
|
|
275
|
+
background-origin: border-box;
|
|
276
|
+
border-color: transparent;
|
|
277
|
+
}
|
|
278
|
+
.nut-button-info-children {
|
|
279
|
+
color: var(--nutui-button-info-color, #ffffff);
|
|
280
|
+
}
|
|
281
|
+
.nut-button-info-solid-disabled {
|
|
282
|
+
background: var(--nutui-button-info-disabled, var(--nutui-color-info-disabled, #89a6f8));
|
|
283
|
+
border-color: var(--nutui-button-info-disabled, var(--nutui-color-info-disabled, #89a6f8));
|
|
284
|
+
}
|
|
285
|
+
.nut-button-info-outline, .nut-button-info-dashed {
|
|
286
|
+
color: var(--nutui-button-info-border-color, var(--nutui-color-info, #0073ff));
|
|
287
|
+
border-color: var(--nutui-button-info-border-color, var(--nutui-color-info, #0073ff));
|
|
288
|
+
}
|
|
289
|
+
.nut-button-info-outline-disabled, .nut-button-info-dashed-disabled {
|
|
290
|
+
color: var(--nutui-button-info-disabled, var(--nutui-color-info-disabled, #89a6f8));
|
|
291
|
+
border-color: var(--nutui-button-info-disabled, var(--nutui-color-info-disabled, #89a6f8));
|
|
292
|
+
}
|
|
293
|
+
.nut-button-info-none {
|
|
294
|
+
color: var(--nutui-button-info-border-color, var(--nutui-color-info, #0073ff));
|
|
295
|
+
}
|
|
296
|
+
.nut-button-info-none-disabled {
|
|
297
|
+
color: var(--nutui-button-info-disabled, var(--nutui-color-info-disabled, #89a6f8));
|
|
298
|
+
}
|
|
299
|
+
.nut-button-danger {
|
|
300
|
+
color: var(--nutui-button-danger-color, #ffffff);
|
|
301
|
+
background: var(--nutui-button-danger-background-color, var(--nutui-color-danger, #ff0f23));
|
|
302
|
+
background-origin: border-box;
|
|
303
|
+
border-color: transparent;
|
|
304
|
+
}
|
|
305
|
+
.nut-button-danger-children {
|
|
306
|
+
color: var(--nutui-button-danger-color, #ffffff);
|
|
307
|
+
}
|
|
308
|
+
.nut-button-danger-solid-disabled {
|
|
309
|
+
background: var(--nutui-button-danger-disabled, var(--nutui-color-danger-disabled, var(--nutui-color-primary-disabled-special, #ffadbe)));
|
|
310
|
+
border-color: var(--nutui-button-danger-disabled, var(--nutui-color-danger-disabled, var(--nutui-color-primary-disabled-special, #ffadbe)));
|
|
311
|
+
}
|
|
312
|
+
.nut-button-danger-outline, .nut-button-danger-dashed {
|
|
313
|
+
color: var(--nutui-button-danger-border-color, var(--nutui-color-danger, #ff0f23));
|
|
314
|
+
border-color: var(--nutui-button-danger-border-color, var(--nutui-color-danger, #ff0f23));
|
|
315
|
+
}
|
|
316
|
+
.nut-button-danger-outline-disabled, .nut-button-danger-dashed-disabled {
|
|
317
|
+
color: var(--nutui-button-danger-disabled, var(--nutui-color-danger-disabled, var(--nutui-color-primary-disabled-special, #ffadbe)));
|
|
318
|
+
border-color: var(--nutui-button-danger-disabled, var(--nutui-color-danger-disabled, var(--nutui-color-primary-disabled-special, #ffadbe)));
|
|
319
|
+
}
|
|
320
|
+
.nut-button-danger-none {
|
|
321
|
+
color: var(--nutui-button-danger-border-color, var(--nutui-color-danger, #ff0f23));
|
|
322
|
+
}
|
|
323
|
+
.nut-button-danger-none-disabled {
|
|
324
|
+
color: var(--nutui-button-danger-disabled, var(--nutui-color-danger-disabled, var(--nutui-color-primary-disabled-special, #ffadbe)));
|
|
325
|
+
}
|
|
326
|
+
.nut-button-warning {
|
|
327
|
+
color: var(--nutui-button-warning-color, #ffffff);
|
|
328
|
+
background: var(--nutui-button-warning-background-color, var(--nutui-color-warning, #ffbf00));
|
|
329
|
+
background-origin: border-box;
|
|
330
|
+
border-color: transparent;
|
|
331
|
+
}
|
|
332
|
+
.nut-button-warning-children {
|
|
333
|
+
color: var(--nutui-button-warning-color, #ffffff);
|
|
334
|
+
}
|
|
335
|
+
.nut-button-warning-disabled, .nut-button-warning-solid-disabled {
|
|
336
|
+
color: var(--nutui-button-warning-color, #ffffff);
|
|
337
|
+
background: var(--nutui-button-warning-disabled, var(--nutui-color-warning-disabled, #fdd3b9));
|
|
338
|
+
border-color: var(--nutui-button-warning-disabled, var(--nutui-color-warning-disabled, #fdd3b9));
|
|
339
|
+
}
|
|
340
|
+
.nut-button-warning-outline, .nut-button-warning-dashed {
|
|
341
|
+
color: var(--nutui-button-warning-border-color, var(--nutui-color-warning, #ffbf00));
|
|
342
|
+
border-color: var(--nutui-button-warning-border-color, var(--nutui-color-warning, #ffbf00));
|
|
343
|
+
}
|
|
344
|
+
.nut-button-warning-outline-disabled, .nut-button-warning-dashed-disabled {
|
|
345
|
+
color: var(--nutui-button-warning-disabled, var(--nutui-color-warning-disabled, #fdd3b9));
|
|
346
|
+
border-color: var(--nutui-button-warning-disabled, var(--nutui-color-warning-disabled, #fdd3b9));
|
|
347
|
+
}
|
|
348
|
+
.nut-button-warning-none {
|
|
349
|
+
color: var(--nutui-button-warning-border-color, var(--nutui-color-warning, #ffbf00));
|
|
350
|
+
}
|
|
351
|
+
.nut-button-warning-none-disabled {
|
|
352
|
+
color: var(--nutui-button-warning-disabled, var(--nutui-color-warning-disabled, #fdd3b9));
|
|
353
|
+
}
|
|
354
|
+
.nut-button-block {
|
|
355
|
+
display: block;
|
|
356
|
+
width: 100%;
|
|
357
|
+
}
|
|
358
|
+
.nut-button-outline {
|
|
359
|
+
background: transparent;
|
|
360
|
+
border-style: solid;
|
|
361
|
+
}
|
|
362
|
+
.nut-button-dashed {
|
|
363
|
+
background: transparent;
|
|
364
|
+
border-style: dashed;
|
|
365
|
+
}
|
|
366
|
+
.nut-button-none {
|
|
367
|
+
background: transparent;
|
|
368
|
+
border-color: transparent;
|
|
369
|
+
}
|
|
370
|
+
.nut-button-loading {
|
|
371
|
+
cursor: default;
|
|
372
|
+
opacity: 0.9;
|
|
373
|
+
}
|
|
374
|
+
.nut-button-square {
|
|
375
|
+
border-radius: var(--nutui-button-square-border-radius, 0);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
[dir=rtl] .nut-button-text,
|
|
379
|
+
.nut-rtl .nut-button-text {
|
|
380
|
+
margin-left: 0;
|
|
381
|
+
margin-right: var(--nutui-button-text-icon-margin, 4px);
|
|
382
|
+
}
|
|
383
|
+
[dir=rtl] .nut-button-text.right,
|
|
384
|
+
.nut-rtl .nut-button-text.right {
|
|
385
|
+
margin-left: var(--nutui-button-text-icon-margin, 4px);
|
|
386
|
+
}
|
|
387
|
+
[dir=rtl] .nut-button::before,
|
|
388
|
+
.nut-rtl .nut-button::before {
|
|
389
|
+
left: auto;
|
|
390
|
+
right: 50%;
|
|
391
|
+
transform: translate(50%, -50%);
|
|
392
|
+
}
|
|
393
|
+
|
|
5
394
|
.nut-resultpage {
|
|
6
395
|
width: 100%;
|
|
7
396
|
display: flex;
|
|
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "SearchBar", {
|
|
|
8
8
|
return SearchBar;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
11
12
|
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
13
|
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
13
14
|
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
14
15
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
16
|
+
var _taro = /*#__PURE__*/ _interop_require_default._(require("@tarojs/taro"));
|
|
15
17
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
16
18
|
var _components = require("@tarojs/components");
|
|
17
19
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
@@ -69,7 +71,9 @@ var SearchBar = function SearchBar(props) {
|
|
|
69
71
|
outerValue
|
|
70
72
|
]);
|
|
71
73
|
(0, _react.useEffect)(function() {
|
|
72
|
-
|
|
74
|
+
if (_taro.default.getEnv() === 'WEB') {
|
|
75
|
+
autoFocus && forceFocus();
|
|
76
|
+
}
|
|
73
77
|
}, [
|
|
74
78
|
autoFocus
|
|
75
79
|
]);
|
|
@@ -77,10 +81,12 @@ var SearchBar = function SearchBar(props) {
|
|
|
77
81
|
return /*#__PURE__*/ _react.default.createElement(_components.Input, {
|
|
78
82
|
className: "".concat(classPrefix, "-input ").concat(clearable ? "".concat(classPrefix, "-input-clear") : ''),
|
|
79
83
|
ref: searchRef,
|
|
80
|
-
|
|
84
|
+
style: style,
|
|
85
|
+
value: (value || '').toString(),
|
|
81
86
|
placeholder: placeholder || locale.placeholder,
|
|
82
87
|
disabled: disabled || readOnly,
|
|
83
88
|
maxlength: maxLength,
|
|
89
|
+
autoFocus: autoFocus,
|
|
84
90
|
onInput: onInput,
|
|
85
91
|
onFocus: focus,
|
|
86
92
|
onBlur: blur,
|