@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
|
@@ -9,29 +9,33 @@ Object.defineProperty(exports, "Switch", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
13
|
var _define_property = require("@swc/helpers/_/_define_property");
|
|
13
14
|
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
15
|
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
16
|
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
17
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
17
|
-
var _react = /*#__PURE__*/
|
|
18
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
18
19
|
var _components = require("@tarojs/components");
|
|
19
20
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
21
|
+
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
20
22
|
var _typings = require("../../utils/typings");
|
|
21
23
|
var _usepropsvalue = require("../../hooks/use-props-value");
|
|
22
24
|
var _index = require("../configprovider/index");
|
|
23
25
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
24
26
|
disabled: false,
|
|
25
27
|
activeText: '',
|
|
26
|
-
inactiveText: ''
|
|
28
|
+
inactiveText: '',
|
|
29
|
+
loadingIcon: /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading1, null)
|
|
27
30
|
});
|
|
28
31
|
var Switch = function Switch(props) {
|
|
29
|
-
var _ref = (0, _object_spread._)({}, defaultProps, props), checked = _ref.checked, defaultChecked = _ref.defaultChecked, disabled = _ref.disabled, activeText = _ref.activeText, inactiveText = _ref.inactiveText, className = _ref.className, style = _ref.style, onChange = _ref.onChange, rest = (0, _object_without_properties._)(_ref, [
|
|
32
|
+
var _ref = (0, _object_spread._)({}, defaultProps, props), checked = _ref.checked, defaultChecked = _ref.defaultChecked, disabled = _ref.disabled, activeText = _ref.activeText, inactiveText = _ref.inactiveText, loadingIcon = _ref.loadingIcon, className = _ref.className, style = _ref.style, onChange = _ref.onChange, rest = (0, _object_without_properties._)(_ref, [
|
|
30
33
|
"checked",
|
|
31
34
|
"defaultChecked",
|
|
32
35
|
"disabled",
|
|
33
36
|
"activeText",
|
|
34
37
|
"inactiveText",
|
|
38
|
+
"loadingIcon",
|
|
35
39
|
"className",
|
|
36
40
|
"style",
|
|
37
41
|
"onChange"
|
|
@@ -42,6 +46,12 @@ var Switch = function Switch(props) {
|
|
|
42
46
|
value: checked,
|
|
43
47
|
defaultValue: defaultChecked
|
|
44
48
|
}), 2), value = _usePropsValue[0], setValue = _usePropsValue[1];
|
|
49
|
+
(0, _react.useEffect)(function() {
|
|
50
|
+
changing && setChanging(false);
|
|
51
|
+
}, [
|
|
52
|
+
value
|
|
53
|
+
]);
|
|
54
|
+
var _useState = (0, _sliced_to_array._)((0, _react.useState)(false), 2), changing = _useState[0], setChanging = _useState[1];
|
|
45
55
|
var classes = function classes() {
|
|
46
56
|
var _obj;
|
|
47
57
|
return (0, _classnames.default)([
|
|
@@ -50,17 +60,18 @@ var Switch = function Switch(props) {
|
|
|
50
60
|
(_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-close"), !value), (0, _define_property._)(_obj, "".concat(classPrefix, "-disabled"), disabled), (0, _define_property._)(_obj, "".concat(classPrefix, "-disabled-close"), disabled && !value), _obj)
|
|
51
61
|
]);
|
|
52
62
|
};
|
|
53
|
-
var onClick = function onClick(
|
|
54
|
-
if (disabled) return;
|
|
55
|
-
|
|
63
|
+
var onClick = function onClick() {
|
|
64
|
+
if (disabled || changing) return;
|
|
65
|
+
if (props.onChange) {
|
|
66
|
+
setChanging(true);
|
|
67
|
+
props.onChange(!value);
|
|
68
|
+
}
|
|
56
69
|
setValue(!value);
|
|
57
70
|
};
|
|
58
71
|
var _obj, _obj1;
|
|
59
72
|
return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread._)({
|
|
60
73
|
className: classes(),
|
|
61
|
-
onClick:
|
|
62
|
-
return onClick(e);
|
|
63
|
-
},
|
|
74
|
+
onClick: onClick,
|
|
64
75
|
style: style
|
|
65
76
|
}, rest), /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
66
77
|
className: (0, _classnames.default)([
|
|
@@ -72,9 +83,9 @@ var Switch = function Switch(props) {
|
|
|
72
83
|
],
|
|
73
84
|
(_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-button-open-rtl"), rtl && value), (0, _define_property._)(_obj, "".concat(classPrefix, "-button-close-rtl"), rtl && !value), _obj)
|
|
74
85
|
])
|
|
75
|
-
}, !value && !activeText && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
86
|
+
}, changing && loadingIcon ? /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, loadingIcon) : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !value && !activeText && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
76
87
|
className: "".concat(classPrefix, "-close-line")
|
|
77
|
-
})), activeText && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
88
|
+
}))), activeText && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
78
89
|
className: (0, _classnames.default)("".concat(classPrefix, "-label"), (_obj1 = {}, (0, _define_property._)(_obj1, "".concat(classPrefix, "-label-open"), value), (0, _define_property._)(_obj1, "".concat(classPrefix, "-label-close"), !value), (0, _define_property._)(_obj1, "".concat(classPrefix, "-label-open-rtl"), rtl && value), (0, _define_property._)(_obj1, "".concat(classPrefix, "-label-close-rtl"), rtl && !value), (0, _define_property._)(_obj1, "".concat(classPrefix, "-label-close-disabled"), disabled && !value), _obj1))
|
|
79
90
|
}, value ? activeText : inactiveText));
|
|
80
91
|
};
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
.nut-badge {
|
|
6
6
|
position: relative;
|
|
7
7
|
display: inline-flex;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
box-sizing: content-box;
|
|
8
10
|
width: auto;
|
|
9
11
|
}
|
|
10
12
|
.nut-badge-icon {
|
|
@@ -37,13 +39,12 @@
|
|
|
37
39
|
}
|
|
38
40
|
.nut-badge-sup {
|
|
39
41
|
display: inline-flex;
|
|
40
|
-
|
|
41
|
-
height: var(--nutui-badge-height, 14px);
|
|
42
|
+
text-align: center;
|
|
42
43
|
min-width: var(--nutui-badge-min-width, 6px);
|
|
43
44
|
padding: var(--nutui-badge-padding, 1px 4px);
|
|
44
45
|
box-sizing: border-box;
|
|
45
46
|
color: var(--nutui-badge-color, #ffffff);
|
|
46
|
-
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-
|
|
47
|
+
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxxs, 9px));
|
|
47
48
|
line-height: 12px;
|
|
48
49
|
white-space: nowrap;
|
|
49
50
|
font-weight: normal;
|
|
@@ -51,14 +52,11 @@
|
|
|
51
52
|
background: var(--nutui-badge-background-color, var(--nutui-color-primary, #ff0f23));
|
|
52
53
|
z-index: 1;
|
|
53
54
|
}
|
|
55
|
+
.nut-badge-disabled {
|
|
56
|
+
background: var(--nutui-badge-background-disabled-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
57
|
+
}
|
|
54
58
|
.nut-badge-number {
|
|
55
59
|
font-family: "JD";
|
|
56
|
-
/* #ifdef harmony */
|
|
57
|
-
line-height: 12px;
|
|
58
|
-
/* #endif */
|
|
59
|
-
/* #ifndef harmony */
|
|
60
|
-
line-height: 13px;
|
|
61
|
-
/* #endif */
|
|
62
60
|
}
|
|
63
61
|
.nut-badge-one {
|
|
64
62
|
height: var(--nutui-badge-height, 14px);
|
|
@@ -82,14 +80,14 @@
|
|
|
82
80
|
height: var(--nutui-badge-dot-width, 6px);
|
|
83
81
|
}
|
|
84
82
|
.nut-badge-dot-small {
|
|
85
|
-
min-width: var(--nutui-badge-dot-width, 4px);
|
|
86
|
-
width: var(--nutui-badge-dot-width, 4px);
|
|
87
|
-
height: var(--nutui-badge-dot-width, 4px);
|
|
83
|
+
min-width: var(--nutui-badge-dot-small-width, 4px);
|
|
84
|
+
width: var(--nutui-badge-dot-small-width, 4px);
|
|
85
|
+
height: var(--nutui-badge-dot-small-width, 4px);
|
|
88
86
|
}
|
|
89
87
|
.nut-badge-dot-large {
|
|
90
|
-
min-width: var(--nutui-badge-dot-width, 8px);
|
|
91
|
-
width: var(--nutui-badge-dot-width, 8px);
|
|
92
|
-
height: var(--nutui-badge-dot-width, 8px);
|
|
88
|
+
min-width: var(--nutui-badge-dot-large-width, 8px);
|
|
89
|
+
width: var(--nutui-badge-dot-large-width, 8px);
|
|
90
|
+
height: var(--nutui-badge-dot-large-width, 8px);
|
|
93
91
|
}
|
|
94
92
|
.nut-badge-outline {
|
|
95
93
|
background: #ffffff;
|
|
@@ -102,25 +100,16 @@
|
|
|
102
100
|
.nut-tabbar-item {
|
|
103
101
|
display: flex;
|
|
104
102
|
flex-direction: column;
|
|
105
|
-
justify-content: center;
|
|
106
103
|
align-items: center;
|
|
107
104
|
flex: 1;
|
|
108
|
-
|
|
109
|
-
text-decoration: none;
|
|
105
|
+
padding: 6px 0 2px;
|
|
110
106
|
color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
|
|
111
107
|
height: 100%;
|
|
112
108
|
}
|
|
113
|
-
.nut-tabbar-item-icon
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
align-items: center;
|
|
118
|
-
position: relative;
|
|
119
|
-
}
|
|
120
|
-
.nut-tabbar-item-icon-box .nut-icon {
|
|
121
|
-
width: 22px;
|
|
122
|
-
height: 22px;
|
|
123
|
-
font-size: 22px;
|
|
109
|
+
.nut-tabbar-item .nut-icon {
|
|
110
|
+
width: 24px;
|
|
111
|
+
height: 24px;
|
|
112
|
+
font-size: 24px;
|
|
124
113
|
/* #ifdef harmony*/
|
|
125
114
|
color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
|
|
126
115
|
/* #endif*/
|
|
@@ -128,23 +117,32 @@
|
|
|
128
117
|
color: inherit;
|
|
129
118
|
/* #endif*/
|
|
130
119
|
}
|
|
131
|
-
.nut-tabbar-item-
|
|
120
|
+
.nut-tabbar-item-text {
|
|
132
121
|
display: block;
|
|
133
122
|
color: var(--nutui-color-text, #505259);
|
|
134
|
-
font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-
|
|
135
|
-
line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-
|
|
136
|
-
margin-top: var(--nutui-tabbar-text-margin-top,
|
|
123
|
+
font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xxs, 10px));
|
|
124
|
+
line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xxs, 10px));
|
|
125
|
+
margin-top: var(--nutui-tabbar-text-margin-top, 4px);
|
|
126
|
+
}
|
|
127
|
+
.nut-tabbar-item .nut-image-default {
|
|
128
|
+
width: 38px;
|
|
129
|
+
height: 38px;
|
|
130
|
+
border-radius: 38px;
|
|
131
|
+
}
|
|
132
|
+
.nut-tabbar-item-large {
|
|
133
|
+
justify-content: center;
|
|
134
|
+
padding: 0;
|
|
137
135
|
}
|
|
138
|
-
.nut-tabbar-item-
|
|
136
|
+
.nut-tabbar-item-large .nut-tabbar-item-text {
|
|
139
137
|
font-size: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
|
|
140
138
|
margin-top: 0;
|
|
141
|
-
line-height: var(--nutui-tabbar-text-
|
|
139
|
+
line-height: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
|
|
142
140
|
font-weight: var(--nutui-tabbar-text-large-font-weight, var(--nutui-font-weight, 400));
|
|
143
141
|
}
|
|
144
142
|
.nut-tabbar-item-active {
|
|
145
143
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
146
144
|
}
|
|
147
|
-
.nut-tabbar-item-active .nut-tabbar-item-
|
|
145
|
+
.nut-tabbar-item-active .nut-tabbar-item-text,
|
|
148
146
|
.nut-tabbar-item-active .nut-icon {
|
|
149
147
|
/* #ifdef harmony*/
|
|
150
148
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
@@ -157,38 +155,44 @@
|
|
|
157
155
|
.nut-tabbar {
|
|
158
156
|
border: 0px;
|
|
159
157
|
box-shadow: var(--nutui-tabbar-box-shadow, none);
|
|
160
|
-
border-bottom: var(--nutui-tabbar-border-bottom,
|
|
161
|
-
border-top: var(--nutui-tabbar-border-top,
|
|
158
|
+
border-bottom: var(--nutui-tabbar-border-bottom, 0);
|
|
159
|
+
border-top: var(--nutui-tabbar-border-top, 0);
|
|
162
160
|
width: 100%;
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-direction: column;
|
|
165
|
-
justify-content: center;
|
|
166
|
-
align-items: center;
|
|
167
|
-
box-sizing: border-box;
|
|
168
161
|
background: var(--nutui-color-background-overlay, #ffffff);
|
|
169
162
|
}
|
|
170
163
|
.nut-tabbar-wrap {
|
|
171
|
-
|
|
172
|
-
height: var(--nutui-tabbar-height, 50px);
|
|
164
|
+
height: var(--nutui-tabbar-height, 46px);
|
|
173
165
|
display: flex;
|
|
166
|
+
}
|
|
167
|
+
.nut-tabbar-wrap-3 {
|
|
168
|
+
padding: 0 16px;
|
|
169
|
+
}
|
|
170
|
+
.nut-tabbar-wrap-2 {
|
|
171
|
+
padding: 0 32px;
|
|
172
|
+
}
|
|
173
|
+
.nut-tabbar-wrap-horizontal {
|
|
174
|
+
align-items: center;
|
|
175
|
+
}
|
|
176
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item {
|
|
174
177
|
flex-direction: row;
|
|
175
178
|
justify-content: center;
|
|
176
|
-
align-items: center;
|
|
177
179
|
}
|
|
178
|
-
.nut-tabbar
|
|
179
|
-
|
|
180
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item .nut-icon {
|
|
181
|
+
width: 20px;
|
|
182
|
+
height: 20px;
|
|
183
|
+
}
|
|
184
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item .nut-tabbar-item-text {
|
|
185
|
+
margin: 0 4px 0 6px;
|
|
186
|
+
font-size: 14px;
|
|
187
|
+
}
|
|
188
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item .nut-badge-sup::after {
|
|
189
|
+
border: 0;
|
|
180
190
|
}
|
|
181
191
|
.nut-tabbar-fixed {
|
|
182
192
|
position: fixed;
|
|
183
193
|
bottom: 0px;
|
|
184
194
|
left: 0px;
|
|
185
195
|
}
|
|
186
|
-
.nut-tabbar-safe-area {
|
|
187
|
-
display: block;
|
|
188
|
-
width: 100%;
|
|
189
|
-
padding-bottom: constant(safe-area-inset-bottom);
|
|
190
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
191
|
-
}
|
|
192
196
|
|
|
193
197
|
[dir=rtl] .nut-tabbar:last-child,
|
|
194
198
|
.nut-rtl .nut-tabbar:last-child {
|
|
@@ -5,38 +5,44 @@
|
|
|
5
5
|
.nut-tabbar {
|
|
6
6
|
border: 0px;
|
|
7
7
|
box-shadow: none;
|
|
8
|
-
border-bottom:
|
|
9
|
-
border-top:
|
|
8
|
+
border-bottom: 0;
|
|
9
|
+
border-top: 0;
|
|
10
10
|
width: 100%;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
align-items: center;
|
|
15
|
-
box-sizing: border-box;
|
|
16
11
|
background: #ffffff;
|
|
17
12
|
}
|
|
18
13
|
.nut-tabbar-wrap {
|
|
19
|
-
|
|
20
|
-
height: 50px;
|
|
14
|
+
height: 46px;
|
|
21
15
|
display: flex;
|
|
16
|
+
}
|
|
17
|
+
.nut-tabbar-wrap-3 {
|
|
18
|
+
padding: 0 16px;
|
|
19
|
+
}
|
|
20
|
+
.nut-tabbar-wrap-2 {
|
|
21
|
+
padding: 0 32px;
|
|
22
|
+
}
|
|
23
|
+
.nut-tabbar-wrap-horizontal {
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item {
|
|
22
27
|
flex-direction: row;
|
|
23
28
|
justify-content: center;
|
|
24
|
-
align-items: center;
|
|
25
29
|
}
|
|
26
|
-
.nut-tabbar
|
|
27
|
-
|
|
30
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item .nut-icon {
|
|
31
|
+
width: 20px;
|
|
32
|
+
height: 20px;
|
|
33
|
+
}
|
|
34
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item .nut-tabbar-item-text {
|
|
35
|
+
margin: 0 4px 0 6px;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
}
|
|
38
|
+
.nut-tabbar-wrap-horizontal .nut-tabbar-item .nut-badge-sup::after {
|
|
39
|
+
border: 0;
|
|
28
40
|
}
|
|
29
41
|
.nut-tabbar-fixed {
|
|
30
42
|
position: fixed;
|
|
31
43
|
bottom: 0px;
|
|
32
44
|
left: 0px;
|
|
33
45
|
}
|
|
34
|
-
.nut-tabbar-safe-area {
|
|
35
|
-
display: block;
|
|
36
|
-
width: 100%;
|
|
37
|
-
padding-bottom: constant(safe-area-inset-bottom);
|
|
38
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
39
|
-
}
|
|
40
46
|
|
|
41
47
|
[dir=rtl] .nut-tabbar:last-child,
|
|
42
48
|
.nut-rtl .nut-tabbar:last-child {
|
|
@@ -4,24 +4,40 @@
|
|
|
4
4
|
border-bottom: $tabbar-border-bottom;
|
|
5
5
|
border-top: $tabbar-border-top;
|
|
6
6
|
width: 100%;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
align-items: center;
|
|
11
|
-
box-sizing: border-box;
|
|
12
7
|
background: $color-background-overlay;
|
|
13
8
|
|
|
14
9
|
&-wrap {
|
|
15
|
-
width: 100%;
|
|
16
10
|
height: $tabbar-height;
|
|
17
11
|
display: flex;
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
}
|
|
22
12
|
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
&-3 {
|
|
14
|
+
padding: 0 16px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-2 {
|
|
18
|
+
padding: 0 32px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-horizontal {
|
|
22
|
+
align-items: center;
|
|
23
|
+
.nut-tabbar-item {
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
.nut-icon {
|
|
27
|
+
width: 20px;
|
|
28
|
+
height: 20px;
|
|
29
|
+
}
|
|
30
|
+
.nut-tabbar-item-text {
|
|
31
|
+
margin: 0 4px 0 6px;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
}
|
|
34
|
+
.nut-badge-sup {
|
|
35
|
+
&::after {
|
|
36
|
+
border: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
&-fixed {
|
|
@@ -29,13 +45,6 @@
|
|
|
29
45
|
bottom: 0px;
|
|
30
46
|
left: 0px;
|
|
31
47
|
}
|
|
32
|
-
|
|
33
|
-
&-safe-area {
|
|
34
|
-
display: block;
|
|
35
|
-
width: 100%;
|
|
36
|
-
padding-bottom: constant(safe-area-inset-bottom);
|
|
37
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
38
|
-
}
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
[dir='rtl'] .nut-tabbar,
|
|
@@ -9,27 +9,30 @@ Object.defineProperty(exports, "Tabbar", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
13
|
var _define_property = require("@swc/helpers/_/_define_property");
|
|
13
14
|
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
15
|
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
16
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
16
|
-
var _react = /*#__PURE__*/
|
|
17
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
17
18
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
18
19
|
var _components = require("@tarojs/components");
|
|
19
20
|
var _typings = require("../../utils/typings");
|
|
20
21
|
var _usepropsvalue = require("../../hooks/use-props-value");
|
|
21
22
|
var _index = /*#__PURE__*/ _interop_require_default._(require("../tabbaritem/index"));
|
|
22
23
|
var _context = /*#__PURE__*/ _interop_require_default._(require("./context"));
|
|
24
|
+
var _index1 = /*#__PURE__*/ _interop_require_default._(require("../safearea/index"));
|
|
23
25
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
24
26
|
defaultValue: 0,
|
|
25
27
|
fixed: false,
|
|
26
28
|
inactiveColor: '',
|
|
27
29
|
activeColor: '',
|
|
30
|
+
direction: 'vertical',
|
|
28
31
|
safeArea: false,
|
|
29
|
-
onSwitch: function onSwitch(
|
|
32
|
+
onSwitch: function onSwitch() {}
|
|
30
33
|
});
|
|
31
34
|
var Tabbar = function Tabbar(props) {
|
|
32
|
-
var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
|
|
35
|
+
var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, direction = _$_object_spread.direction, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
|
|
33
36
|
var classPrefix = 'nut-tabbar';
|
|
34
37
|
var _usePropsValue = (0, _sliced_to_array._)((0, _usepropsvalue.usePropsValue)({
|
|
35
38
|
value: value,
|
|
@@ -37,11 +40,26 @@ var Tabbar = function Tabbar(props) {
|
|
|
37
40
|
finalValue: 0,
|
|
38
41
|
onChange: onSwitch
|
|
39
42
|
}), 2), selectIndex = _usePropsValue[0], setSelectIndex = _usePropsValue[1];
|
|
43
|
+
var sizeCls = (0, _react.useMemo)(function() {
|
|
44
|
+
var size = _react.default.Children.count(children);
|
|
45
|
+
var _obj;
|
|
46
|
+
return size > 3 ? '' : (0, _classnames.default)((_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-wrap-3"), size === 3), (0, _define_property._)(_obj, "".concat(classPrefix, "-wrap-2"), size === 2), (0, _define_property._)(_obj, "".concat(classPrefix, "-wrap-").concat(direction), size === 2 && direction !== 'vertical'), _obj));
|
|
47
|
+
}, [
|
|
48
|
+
children,
|
|
49
|
+
direction
|
|
50
|
+
]);
|
|
51
|
+
var itemDirection = (0, _react.useMemo)(function() {
|
|
52
|
+
var size = _react.default.Children.count(children);
|
|
53
|
+
return size === 2 && direction !== 'vertical' && direction;
|
|
54
|
+
}, [
|
|
55
|
+
direction,
|
|
56
|
+
children
|
|
57
|
+
]);
|
|
40
58
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
41
59
|
className: (0, _classnames.default)(classPrefix, (0, _define_property._)({}, "".concat(classPrefix, "-fixed"), fixed), className),
|
|
42
60
|
style: style
|
|
43
61
|
}, /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
44
|
-
className: "".concat(classPrefix, "-wrap")
|
|
62
|
+
className: "".concat(classPrefix, "-wrap ").concat(sizeCls)
|
|
45
63
|
}, /*#__PURE__*/ _react.default.createElement(_context.default.Provider, {
|
|
46
64
|
value: {
|
|
47
65
|
selectIndex: selectIndex,
|
|
@@ -50,12 +68,12 @@ var Tabbar = function Tabbar(props) {
|
|
|
50
68
|
handleClick: setSelectIndex
|
|
51
69
|
}
|
|
52
70
|
}, _react.default.Children.map(children, function(child, index) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}));
|
|
57
|
-
}))), (fixed || safeArea) && /*#__PURE__*/ _react.default.createElement(
|
|
58
|
-
|
|
71
|
+
return /*#__PURE__*/ _react.default.isValidElement(child) ? /*#__PURE__*/ _react.default.cloneElement(child, (0, _object_spread_props._)((0, _object_spread._)({}, child.props), {
|
|
72
|
+
index: index,
|
|
73
|
+
direction: itemDirection
|
|
74
|
+
})) : null;
|
|
75
|
+
}))), (fixed || safeArea) && /*#__PURE__*/ _react.default.createElement(_index1.default, {
|
|
76
|
+
position: "bottom"
|
|
59
77
|
}));
|
|
60
78
|
};
|
|
61
79
|
Tabbar.displayName = 'NutTabbar';
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
.nut-badge {
|
|
6
6
|
position: relative;
|
|
7
7
|
display: inline-flex;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
box-sizing: content-box;
|
|
8
10
|
width: auto;
|
|
9
11
|
}
|
|
10
12
|
.nut-badge-icon {
|
|
@@ -37,13 +39,12 @@
|
|
|
37
39
|
}
|
|
38
40
|
.nut-badge-sup {
|
|
39
41
|
display: inline-flex;
|
|
40
|
-
|
|
41
|
-
height: var(--nutui-badge-height, 14px);
|
|
42
|
+
text-align: center;
|
|
42
43
|
min-width: var(--nutui-badge-min-width, 6px);
|
|
43
44
|
padding: var(--nutui-badge-padding, 1px 4px);
|
|
44
45
|
box-sizing: border-box;
|
|
45
46
|
color: var(--nutui-badge-color, #ffffff);
|
|
46
|
-
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-
|
|
47
|
+
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxxs, 9px));
|
|
47
48
|
line-height: 12px;
|
|
48
49
|
white-space: nowrap;
|
|
49
50
|
font-weight: normal;
|
|
@@ -51,14 +52,11 @@
|
|
|
51
52
|
background: var(--nutui-badge-background-color, var(--nutui-color-primary, #ff0f23));
|
|
52
53
|
z-index: 1;
|
|
53
54
|
}
|
|
55
|
+
.nut-badge-disabled {
|
|
56
|
+
background: var(--nutui-badge-background-disabled-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
57
|
+
}
|
|
54
58
|
.nut-badge-number {
|
|
55
59
|
font-family: "JD";
|
|
56
|
-
/* #ifdef harmony */
|
|
57
|
-
line-height: 12px;
|
|
58
|
-
/* #endif */
|
|
59
|
-
/* #ifndef harmony */
|
|
60
|
-
line-height: 13px;
|
|
61
|
-
/* #endif */
|
|
62
60
|
}
|
|
63
61
|
.nut-badge-one {
|
|
64
62
|
height: var(--nutui-badge-height, 14px);
|
|
@@ -82,14 +80,14 @@
|
|
|
82
80
|
height: var(--nutui-badge-dot-width, 6px);
|
|
83
81
|
}
|
|
84
82
|
.nut-badge-dot-small {
|
|
85
|
-
min-width: var(--nutui-badge-dot-width, 4px);
|
|
86
|
-
width: var(--nutui-badge-dot-width, 4px);
|
|
87
|
-
height: var(--nutui-badge-dot-width, 4px);
|
|
83
|
+
min-width: var(--nutui-badge-dot-small-width, 4px);
|
|
84
|
+
width: var(--nutui-badge-dot-small-width, 4px);
|
|
85
|
+
height: var(--nutui-badge-dot-small-width, 4px);
|
|
88
86
|
}
|
|
89
87
|
.nut-badge-dot-large {
|
|
90
|
-
min-width: var(--nutui-badge-dot-width, 8px);
|
|
91
|
-
width: var(--nutui-badge-dot-width, 8px);
|
|
92
|
-
height: var(--nutui-badge-dot-width, 8px);
|
|
88
|
+
min-width: var(--nutui-badge-dot-large-width, 8px);
|
|
89
|
+
width: var(--nutui-badge-dot-large-width, 8px);
|
|
90
|
+
height: var(--nutui-badge-dot-large-width, 8px);
|
|
93
91
|
}
|
|
94
92
|
.nut-badge-outline {
|
|
95
93
|
background: #ffffff;
|
|
@@ -102,25 +100,16 @@
|
|
|
102
100
|
.nut-tabbar-item {
|
|
103
101
|
display: flex;
|
|
104
102
|
flex-direction: column;
|
|
105
|
-
justify-content: center;
|
|
106
103
|
align-items: center;
|
|
107
104
|
flex: 1;
|
|
108
|
-
|
|
109
|
-
text-decoration: none;
|
|
105
|
+
padding: 6px 0 2px;
|
|
110
106
|
color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
|
|
111
107
|
height: 100%;
|
|
112
108
|
}
|
|
113
|
-
.nut-tabbar-item-icon
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
align-items: center;
|
|
118
|
-
position: relative;
|
|
119
|
-
}
|
|
120
|
-
.nut-tabbar-item-icon-box .nut-icon {
|
|
121
|
-
width: 22px;
|
|
122
|
-
height: 22px;
|
|
123
|
-
font-size: 22px;
|
|
109
|
+
.nut-tabbar-item .nut-icon {
|
|
110
|
+
width: 24px;
|
|
111
|
+
height: 24px;
|
|
112
|
+
font-size: 24px;
|
|
124
113
|
/* #ifdef harmony*/
|
|
125
114
|
color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
|
|
126
115
|
/* #endif*/
|
|
@@ -128,23 +117,32 @@
|
|
|
128
117
|
color: inherit;
|
|
129
118
|
/* #endif*/
|
|
130
119
|
}
|
|
131
|
-
.nut-tabbar-item-
|
|
120
|
+
.nut-tabbar-item-text {
|
|
132
121
|
display: block;
|
|
133
122
|
color: var(--nutui-color-text, #505259);
|
|
134
|
-
font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-
|
|
135
|
-
line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-
|
|
136
|
-
margin-top: var(--nutui-tabbar-text-margin-top,
|
|
123
|
+
font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xxs, 10px));
|
|
124
|
+
line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xxs, 10px));
|
|
125
|
+
margin-top: var(--nutui-tabbar-text-margin-top, 4px);
|
|
126
|
+
}
|
|
127
|
+
.nut-tabbar-item .nut-image-default {
|
|
128
|
+
width: 38px;
|
|
129
|
+
height: 38px;
|
|
130
|
+
border-radius: 38px;
|
|
131
|
+
}
|
|
132
|
+
.nut-tabbar-item-large {
|
|
133
|
+
justify-content: center;
|
|
134
|
+
padding: 0;
|
|
137
135
|
}
|
|
138
|
-
.nut-tabbar-item-
|
|
136
|
+
.nut-tabbar-item-large .nut-tabbar-item-text {
|
|
139
137
|
font-size: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
|
|
140
138
|
margin-top: 0;
|
|
141
|
-
line-height: var(--nutui-tabbar-text-
|
|
139
|
+
line-height: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
|
|
142
140
|
font-weight: var(--nutui-tabbar-text-large-font-weight, var(--nutui-font-weight, 400));
|
|
143
141
|
}
|
|
144
142
|
.nut-tabbar-item-active {
|
|
145
143
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
146
144
|
}
|
|
147
|
-
.nut-tabbar-item-active .nut-tabbar-item-
|
|
145
|
+
.nut-tabbar-item-active .nut-tabbar-item-text,
|
|
148
146
|
.nut-tabbar-item-active .nut-icon {
|
|
149
147
|
/* #ifdef harmony*/
|
|
150
148
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|