@nutui/nutui-react 3.0.5 → 3.0.7
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 +59 -1
- package/dist/cjs/packages/actionsheet/style/style.css +4 -4
- package/dist/cjs/packages/address/style/style.css +4 -4
- package/dist/cjs/packages/audio/style/style.css +4 -16
- package/dist/cjs/packages/badge/badge.js +4 -3
- package/dist/cjs/packages/badge/style/badge.scss +4 -0
- package/dist/cjs/packages/badge/style/style.css +9 -6
- package/dist/cjs/packages/button/style/button.scss +4 -20
- package/dist/cjs/packages/button/style/style.css +4 -16
- package/dist/cjs/packages/calendar/style/style.css +4 -4
- package/dist/cjs/packages/cascader/style/style.css +4 -4
- package/dist/cjs/packages/collapse/style/style.css +22 -7
- package/dist/cjs/packages/collapseitem/collapseitem.js +46 -44
- package/dist/cjs/packages/collapseitem/style/collapseitem.scss +22 -5
- package/dist/cjs/packages/collapseitem/style/style.css +22 -7
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +7 -4
- package/dist/cjs/packages/datepickerview/style/style.css +3 -0
- package/dist/cjs/packages/dialog/confirm.d.ts +2 -3
- package/dist/cjs/packages/dialog/confirm.js +4 -18
- package/dist/cjs/packages/dialog/content.d.ts +11 -3
- package/dist/cjs/packages/dialog/dialog.d.ts +1 -1
- package/dist/cjs/packages/dialog/dialog.js +98 -69
- package/dist/cjs/packages/dialog/index.d.ts +1 -1
- package/dist/cjs/packages/dialog/style/style.css +4 -16
- package/dist/cjs/packages/empty/style/style.css +4 -16
- package/dist/cjs/packages/fixednav/style/style.css +9 -6
- package/dist/cjs/packages/imagepreview/style/style.css +4 -4
- package/dist/cjs/packages/indicator/indicator.js +1 -1
- package/dist/cjs/packages/lottie/index.d.ts +1 -1
- package/dist/cjs/packages/lottie/index.js +2 -2
- package/dist/cjs/packages/notify/Notification.d.ts +3 -9
- package/dist/cjs/packages/notify/Notification.js +27 -7
- package/dist/cjs/packages/notify/notify.d.ts +0 -4
- package/dist/cjs/packages/notify/notify.js +6 -34
- package/dist/cjs/packages/notify/style/notify.scss +39 -36
- package/dist/cjs/packages/notify/style/style.css +36 -31
- package/dist/cjs/packages/numberkeyboard/style/style.css +4 -4
- package/dist/cjs/packages/picker/style/style.css +7 -4
- package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -0
- package/dist/cjs/packages/pickerview/style/style.css +3 -0
- package/dist/cjs/packages/popover/popover.js +72 -65
- package/dist/cjs/packages/popover/style/popover.scss +48 -51
- package/dist/cjs/packages/popover/style/style.css +64 -70
- package/dist/cjs/packages/popup/style/popup.scss +4 -4
- package/dist/cjs/packages/popup/style/style.css +4 -4
- package/dist/cjs/packages/resultpage/style/style.css +4 -16
- package/dist/cjs/packages/shortpassword/style/style.css +4 -4
- package/dist/cjs/packages/skeleton/skeleton.js +64 -49
- 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/switch/style/style.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 +54 -45
- 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 +30 -27
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/cjs/packages/tabpane/tabpane.js +2 -2
- package/dist/cjs/packages/timeselect/style/style.css +4 -4
- package/dist/cjs/packages/tour/style/style.css +64 -70
- package/dist/cjs/types/spec/badge/base.d.ts +1 -0
- package/dist/cjs/types/spec/dialog/base.d.ts +50 -1
- package/dist/cjs/types/spec/dialog/base.js +7 -0
- package/dist/cjs/types/spec/dialog/h5.d.ts +4 -1
- package/dist/cjs/types/spec/dialog/taro.d.ts +8 -2
- 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/popover/base.d.ts +7 -0
- 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/cjs/utils/get-rect-by-taro.js +10 -0
- package/dist/cjs/utils/lru.d.ts +8 -0
- package/dist/cjs/utils/lru.js +58 -0
- package/dist/es/packages/actionsheet/style/style.css +4 -4
- package/dist/es/packages/address/style/style.css +4 -4
- package/dist/es/packages/audio/style/style.css +4 -16
- package/dist/es/packages/badge/badge.js +4 -3
- package/dist/es/packages/badge/style/badge.scss +4 -0
- package/dist/es/packages/badge/style/style.css +9 -6
- package/dist/es/packages/button/style/button.scss +4 -20
- package/dist/es/packages/button/style/style.css +4 -16
- package/dist/es/packages/calendar/style/style.css +4 -4
- package/dist/es/packages/cascader/style/style.css +4 -4
- package/dist/es/packages/collapse/style/style.css +22 -7
- package/dist/es/packages/collapseitem/collapseitem.js +47 -45
- package/dist/es/packages/collapseitem/style/collapseitem.scss +22 -5
- package/dist/es/packages/collapseitem/style/style.css +22 -7
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +7 -4
- package/dist/es/packages/datepickerview/style/style.css +3 -0
- package/dist/es/packages/dialog/confirm.d.ts +2 -3
- package/dist/es/packages/dialog/confirm.js +1 -8
- package/dist/es/packages/dialog/content.d.ts +11 -3
- package/dist/es/packages/dialog/dialog.d.ts +1 -1
- package/dist/es/packages/dialog/dialog.js +98 -69
- package/dist/es/packages/dialog/index.d.ts +1 -1
- package/dist/es/packages/dialog/style/style.css +4 -16
- package/dist/es/packages/empty/style/style.css +4 -16
- package/dist/es/packages/fixednav/style/style.css +9 -6
- package/dist/es/packages/imagepreview/style/style.css +4 -4
- package/dist/es/packages/indicator/indicator.js +1 -1
- package/dist/es/packages/lottie/index.d.ts +1 -1
- package/dist/es/packages/lottie/index.js +1 -1
- package/dist/es/packages/notify/Notification.d.ts +3 -9
- package/dist/es/packages/notify/Notification.js +27 -7
- package/dist/es/packages/notify/notify.d.ts +0 -4
- package/dist/es/packages/notify/notify.js +6 -34
- package/dist/es/packages/notify/style/notify.scss +39 -36
- package/dist/es/packages/notify/style/style.css +36 -31
- package/dist/es/packages/numberkeyboard/style/style.css +4 -4
- package/dist/es/packages/picker/style/style.css +7 -4
- package/dist/es/packages/pickerview/style/pickerview.scss +3 -0
- package/dist/es/packages/pickerview/style/style.css +3 -0
- package/dist/es/packages/popover/popover.js +72 -65
- package/dist/es/packages/popover/style/popover.scss +48 -51
- package/dist/es/packages/popover/style/style.css +64 -70
- package/dist/es/packages/popup/style/popup.scss +4 -4
- package/dist/es/packages/popup/style/style.css +4 -4
- package/dist/es/packages/resultpage/style/style.css +4 -16
- package/dist/es/packages/shortpassword/style/style.css +4 -4
- package/dist/es/packages/skeleton/skeleton.js +63 -49
- 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/switch/style/style.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 +54 -45
- 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 +30 -27
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/es/packages/tabpane/tabpane.js +2 -2
- package/dist/es/packages/timeselect/style/style.css +4 -4
- package/dist/es/packages/tour/style/style.css +64 -70
- package/dist/es/types/spec/badge/base.d.ts +4 -0
- package/dist/es/types/spec/dialog/base.d.ts +83 -1
- package/dist/es/types/spec/dialog/base.js +1 -1
- package/dist/es/types/spec/dialog/h5.d.ts +4 -1
- package/dist/es/types/spec/dialog/taro.d.ts +8 -2
- 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/popover/base.d.ts +7 -0
- 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/es/utils/get-rect-by-taro.js +9 -0
- package/dist/es/utils/lru.d.ts +8 -0
- package/dist/es/utils/lru.js +49 -0
- package/dist/nutui.react.umd.js +557 -529
- package/dist/style.css +1 -1
- package/dist/style.scss +38 -38
- package/dist/styles/theme-jmapp.scss +1 -0
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/variables-jmapp.scss +237 -50
- package/dist/styles/variables-jrkf.scss +25 -14
- package/dist/styles/variables.scss +38 -51
- package/package.json +1 -1
- package/dist/cjs/packages/dialog/dialogwrap.d.ts +0 -4
- package/dist/cjs/packages/dialog/dialogwrap.js +0 -79
- package/dist/cjs/packages/dialog/types.d.ts +0 -57
- package/dist/cjs/packages/dialog/types.js +0 -11
- package/dist/es/packages/dialog/dialogwrap.d.ts +0 -4
- package/dist/es/packages/dialog/dialogwrap.js +0 -60
- package/dist/es/packages/dialog/types.d.ts +0 -57
- package/dist/es/packages/dialog/types.js +0 -1
- /package/dist/cjs/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.js → lottie.js} +0 -0
- /package/dist/es/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.js → lottie.js} +0 -0
|
@@ -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,
|
|
@@ -2,22 +2,24 @@ import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
|
2
2
|
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 _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
5
|
-
import React from "react";
|
|
5
|
+
import React, { useMemo } from "react";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { ComponentDefaults } from "../../utils/typings";
|
|
8
8
|
import { usePropsValue } from "../../hooks/use-props-value";
|
|
9
9
|
import TabbarItem from "../tabbaritem";
|
|
10
10
|
import TabbarContext from "./context";
|
|
11
|
+
import SafeArea from "../safearea/index";
|
|
11
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
13
|
defaultValue: 0,
|
|
13
14
|
fixed: false,
|
|
14
15
|
inactiveColor: '',
|
|
15
16
|
activeColor: '',
|
|
17
|
+
direction: 'vertical',
|
|
16
18
|
safeArea: false,
|
|
17
|
-
onSwitch: function(
|
|
19
|
+
onSwitch: function() {}
|
|
18
20
|
});
|
|
19
21
|
export var Tabbar = function(props) {
|
|
20
|
-
var _$_object_spread = _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;
|
|
22
|
+
var _$_object_spread = _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;
|
|
21
23
|
var classPrefix = 'nut-tabbar';
|
|
22
24
|
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
23
25
|
value: value,
|
|
@@ -25,11 +27,26 @@ export var Tabbar = function(props) {
|
|
|
25
27
|
finalValue: 0,
|
|
26
28
|
onChange: onSwitch
|
|
27
29
|
}), 2), selectIndex = _usePropsValue[0], setSelectIndex = _usePropsValue[1];
|
|
30
|
+
var sizeCls = useMemo(function() {
|
|
31
|
+
var size = React.Children.count(children);
|
|
32
|
+
var _obj;
|
|
33
|
+
return size > 3 ? '' : classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-wrap-3"), size === 3), _define_property(_obj, "".concat(classPrefix, "-wrap-2"), size === 2), _define_property(_obj, "".concat(classPrefix, "-wrap-").concat(direction), size === 2 && direction !== 'vertical'), _obj));
|
|
34
|
+
}, [
|
|
35
|
+
children,
|
|
36
|
+
direction
|
|
37
|
+
]);
|
|
38
|
+
var itemDirection = useMemo(function() {
|
|
39
|
+
var size = React.Children.count(children);
|
|
40
|
+
return size === 2 && direction !== 'vertical' && direction;
|
|
41
|
+
}, [
|
|
42
|
+
direction,
|
|
43
|
+
children
|
|
44
|
+
]);
|
|
28
45
|
return /*#__PURE__*/ React.createElement("div", {
|
|
29
46
|
className: classNames(classPrefix, _define_property({}, "".concat(classPrefix, "-fixed"), fixed), className),
|
|
30
47
|
style: style
|
|
31
48
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
32
|
-
className: "".concat(classPrefix, "-wrap")
|
|
49
|
+
className: "".concat(classPrefix, "-wrap ").concat(sizeCls)
|
|
33
50
|
}, /*#__PURE__*/ React.createElement(TabbarContext.Provider, {
|
|
34
51
|
value: {
|
|
35
52
|
selectIndex: selectIndex,
|
|
@@ -38,12 +55,12 @@ export var Tabbar = function(props) {
|
|
|
38
55
|
handleClick: setSelectIndex
|
|
39
56
|
}
|
|
40
57
|
}, React.Children.map(children, function(child, index) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}));
|
|
45
|
-
}))), (fixed || safeArea) && /*#__PURE__*/ React.createElement(
|
|
46
|
-
|
|
58
|
+
return /*#__PURE__*/ React.isValidElement(child) ? /*#__PURE__*/ React.cloneElement(child, _object_spread_props(_object_spread({}, child.props), {
|
|
59
|
+
index: index,
|
|
60
|
+
direction: itemDirection
|
|
61
|
+
})) : null;
|
|
62
|
+
}))), (fixed || safeArea) && /*#__PURE__*/ React.createElement(SafeArea, {
|
|
63
|
+
position: "bottom"
|
|
47
64
|
}));
|
|
48
65
|
};
|
|
49
66
|
Tabbar.displayName = 'NutTabbar';
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
background: var(--nutui-badge-background-color, var(--nutui-color-primary, #ff0f23));
|
|
53
53
|
z-index: 1;
|
|
54
54
|
}
|
|
55
|
+
.nut-badge-disabled {
|
|
56
|
+
background: var(--nutui-badge-background-disabled-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
57
|
+
}
|
|
55
58
|
.nut-badge-number {
|
|
56
59
|
font-family: "JD";
|
|
57
60
|
}
|
|
@@ -77,14 +80,14 @@
|
|
|
77
80
|
height: var(--nutui-badge-dot-width, 6px);
|
|
78
81
|
}
|
|
79
82
|
.nut-badge-dot-small {
|
|
80
|
-
min-width: var(--nutui-badge-dot-width, 4px);
|
|
81
|
-
width: var(--nutui-badge-dot-width, 4px);
|
|
82
|
-
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);
|
|
83
86
|
}
|
|
84
87
|
.nut-badge-dot-large {
|
|
85
|
-
min-width: var(--nutui-badge-dot-width, 8px);
|
|
86
|
-
width: var(--nutui-badge-dot-width, 8px);
|
|
87
|
-
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);
|
|
88
91
|
}
|
|
89
92
|
.nut-badge-outline {
|
|
90
93
|
background: #ffffff;
|
|
@@ -97,25 +100,16 @@
|
|
|
97
100
|
.nut-tabbar-item {
|
|
98
101
|
display: flex;
|
|
99
102
|
flex-direction: column;
|
|
100
|
-
justify-content: center;
|
|
101
103
|
align-items: center;
|
|
102
104
|
flex: 1;
|
|
103
|
-
|
|
104
|
-
text-decoration: none;
|
|
105
|
+
padding: 6px 0 2px;
|
|
105
106
|
color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
|
|
106
107
|
height: 100%;
|
|
107
108
|
}
|
|
108
|
-
.nut-tabbar-item-icon
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
align-items: center;
|
|
113
|
-
position: relative;
|
|
114
|
-
}
|
|
115
|
-
.nut-tabbar-item-icon-box .nut-icon {
|
|
116
|
-
width: 22px;
|
|
117
|
-
height: 22px;
|
|
118
|
-
font-size: 22px;
|
|
109
|
+
.nut-tabbar-item .nut-icon {
|
|
110
|
+
width: 24px;
|
|
111
|
+
height: 24px;
|
|
112
|
+
font-size: 24px;
|
|
119
113
|
/* #ifdef harmony*/
|
|
120
114
|
color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
|
|
121
115
|
/* #endif*/
|
|
@@ -123,23 +117,32 @@
|
|
|
123
117
|
color: inherit;
|
|
124
118
|
/* #endif*/
|
|
125
119
|
}
|
|
126
|
-
.nut-tabbar-item-
|
|
120
|
+
.nut-tabbar-item-text {
|
|
127
121
|
display: block;
|
|
128
122
|
color: var(--nutui-color-text, #505259);
|
|
129
|
-
font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-
|
|
130
|
-
line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-
|
|
131
|
-
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;
|
|
132
135
|
}
|
|
133
|
-
.nut-tabbar-item-
|
|
136
|
+
.nut-tabbar-item-large .nut-tabbar-item-text {
|
|
134
137
|
font-size: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
|
|
135
138
|
margin-top: 0;
|
|
136
|
-
line-height: var(--nutui-tabbar-text-
|
|
139
|
+
line-height: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
|
|
137
140
|
font-weight: var(--nutui-tabbar-text-large-font-weight, var(--nutui-font-weight, 400));
|
|
138
141
|
}
|
|
139
142
|
.nut-tabbar-item-active {
|
|
140
143
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
141
144
|
}
|
|
142
|
-
.nut-tabbar-item-active .nut-tabbar-item-
|
|
145
|
+
.nut-tabbar-item-active .nut-tabbar-item-text,
|
|
143
146
|
.nut-tabbar-item-active .nut-icon {
|
|
144
147
|
/* #ifdef harmony*/
|
|
145
148
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
.nut-tabbar-item {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
justify-content: center;
|
|
5
4
|
align-items: center;
|
|
6
5
|
flex: 1;
|
|
7
|
-
|
|
8
|
-
text-decoration: none;
|
|
6
|
+
padding: 6px 0 2px;
|
|
9
7
|
color: $tabbar-inactive-color;
|
|
10
8
|
height: 100%;
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
.nut-icon {
|
|
11
|
+
width: 24px;
|
|
12
|
+
height: 24px;
|
|
13
|
+
font-size: 24px;
|
|
14
|
+
/* #ifdef harmony*/
|
|
15
|
+
color: $tabbar-inactive-color;
|
|
16
|
+
/* #endif*/
|
|
17
|
+
/* #ifndef harmony*/
|
|
18
|
+
color: inherit;
|
|
19
|
+
/* #endif*/
|
|
20
|
+
}
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/* #ifndef harmony*/
|
|
27
|
-
color: inherit;
|
|
28
|
-
/* #endif*/
|
|
29
|
-
}
|
|
22
|
+
&-text {
|
|
23
|
+
display: block;
|
|
24
|
+
color: $color-text;
|
|
25
|
+
font-size: $tabbar-text-font-size;
|
|
26
|
+
line-height: $tabbar-text-font-size;
|
|
27
|
+
margin-top: $tabbar-text-margin-top;
|
|
28
|
+
}
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
margin-top: $tabbar-text-margin-top;
|
|
30
|
+
.nut-image {
|
|
31
|
+
&-default {
|
|
32
|
+
width: 38px;
|
|
33
|
+
height: 38px;
|
|
34
|
+
border-radius: 38px;
|
|
37
35
|
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-large {
|
|
39
|
+
justify-content: center;
|
|
40
|
+
padding: 0;
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
.nut-tabbar-item-text {
|
|
40
43
|
font-size: $tabbar-text-large-font-size;
|
|
41
44
|
margin-top: 0;
|
|
42
|
-
line-height: $tabbar-text-
|
|
45
|
+
line-height: $tabbar-text-large-font-size;
|
|
43
46
|
font-weight: $tabbar-text-large-font-weight;
|
|
44
47
|
}
|
|
45
48
|
}
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
&-active {
|
|
48
51
|
color: $tabbar-active-color;
|
|
49
52
|
|
|
50
|
-
.nut-tabbar-item-
|
|
53
|
+
.nut-tabbar-item-text,
|
|
51
54
|
.nut-icon {
|
|
52
55
|
/* #ifdef harmony*/
|
|
53
56
|
color: $tabbar-active-color;
|
|
@@ -14,12 +14,13 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
14
14
|
dot: false,
|
|
15
15
|
max: 99,
|
|
16
16
|
top: '0',
|
|
17
|
-
right: '0'
|
|
17
|
+
right: '0',
|
|
18
|
+
direction: 'vertical'
|
|
18
19
|
});
|
|
19
20
|
export var TabbarItem = function(props) {
|
|
20
21
|
var ctx = useContext(TabbarContext);
|
|
21
22
|
var _ref = _object_spread({}, defaultProps, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right = _ref.right, // @ts-ignore
|
|
22
|
-
index = _ref.index, rest = _object_without_properties(_ref, [
|
|
23
|
+
index = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = _object_without_properties(_ref, [
|
|
23
24
|
"className",
|
|
24
25
|
"style",
|
|
25
26
|
"title",
|
|
@@ -29,15 +30,19 @@ export var TabbarItem = function(props) {
|
|
|
29
30
|
"max",
|
|
30
31
|
"top",
|
|
31
32
|
"right",
|
|
32
|
-
"index"
|
|
33
|
+
"index",
|
|
34
|
+
"direction",
|
|
35
|
+
"onActiveClick"
|
|
33
36
|
]);
|
|
34
37
|
var active = index === (ctx === null || ctx === void 0 ? void 0 : ctx.selectIndex);
|
|
35
38
|
var classPrefix = 'nut-tabbar-item';
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
+
var _obj;
|
|
40
|
+
var tabbarItemClass = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-active"), active), _define_property(_obj, "".concat(classPrefix, "-large"), !icon || !title), _obj), className);
|
|
41
|
+
var renderNodeWithActive = function(node) {
|
|
42
|
+
return node && typeof node === 'function' ? node(active) : node;
|
|
43
|
+
};
|
|
39
44
|
var badgeProps = {
|
|
40
|
-
value: value,
|
|
45
|
+
value: renderNodeWithActive(value),
|
|
41
46
|
dot: dot,
|
|
42
47
|
max: max,
|
|
43
48
|
top: top,
|
|
@@ -46,8 +51,26 @@ export var TabbarItem = function(props) {
|
|
|
46
51
|
};
|
|
47
52
|
var renderTitleText = function() {
|
|
48
53
|
return title && /*#__PURE__*/ React.createElement("div", {
|
|
49
|
-
className:
|
|
50
|
-
}, title);
|
|
54
|
+
className: "".concat(classPrefix, "-text")
|
|
55
|
+
}, renderNodeWithActive(title));
|
|
56
|
+
};
|
|
57
|
+
var renderTitle = function() {
|
|
58
|
+
return /*#__PURE__*/ React.createElement(Badge, _object_spread({
|
|
59
|
+
size: "normal"
|
|
60
|
+
}, badgeProps), renderTitleText());
|
|
61
|
+
};
|
|
62
|
+
var renderIcon = function() {
|
|
63
|
+
return renderNodeWithActive(icon);
|
|
64
|
+
};
|
|
65
|
+
var renderIconAndTitle = function() {
|
|
66
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Badge, _object_spread_props(_object_spread({
|
|
67
|
+
size: "normal"
|
|
68
|
+
}, badgeProps), {
|
|
69
|
+
top: 3
|
|
70
|
+
}), renderIcon()), renderTitleText());
|
|
71
|
+
};
|
|
72
|
+
var renderDualItem = function() {
|
|
73
|
+
return dot ? null : /*#__PURE__*/ React.createElement(React.Fragment, null, renderIcon(), renderTitleText(), /*#__PURE__*/ React.createElement(Badge, badgeProps));
|
|
51
74
|
};
|
|
52
75
|
return /*#__PURE__*/ React.createElement("div", _object_spread({
|
|
53
76
|
className: tabbarItemClass,
|
|
@@ -55,9 +78,7 @@ export var TabbarItem = function(props) {
|
|
|
55
78
|
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
56
79
|
}, style),
|
|
57
80
|
onClick: function() {
|
|
58
|
-
return ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
|
|
81
|
+
return active ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
|
|
59
82
|
}
|
|
60
|
-
}, rest),
|
|
61
|
-
className: boxPrefix
|
|
62
|
-
}, icon)), renderTitleText()) : /*#__PURE__*/ React.createElement(Badge, badgeProps, renderTitleText()));
|
|
83
|
+
}, rest), direction === 'horizontal' && !dot ? renderDualItem() : /*#__PURE__*/ React.createElement(React.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
|
|
63
84
|
};
|
|
@@ -12,7 +12,7 @@ export var TabPane = function(props) {
|
|
|
12
12
|
var classes = classNames(classPrefix, {
|
|
13
13
|
active: !disabled && props.active
|
|
14
14
|
}, autoHeightClassName, className);
|
|
15
|
-
return children
|
|
15
|
+
return children ? /*#__PURE__*/ React.createElement("div", {
|
|
16
16
|
className: classes
|
|
17
|
-
}, !disabled && children);
|
|
17
|
+
}, !disabled && children) : null;
|
|
18
18
|
};
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
.nut-popup {
|
|
62
62
|
position: fixed;
|
|
63
|
-
min-height:
|
|
63
|
+
min-height: 26%;
|
|
64
64
|
max-height: 100%;
|
|
65
65
|
background-color: var(--nutui-overlay-content-bg-color, var(--nutui-color-background-overlay, #ffffff));
|
|
66
66
|
-webkit-overflow-scrolling: touch;
|
|
@@ -198,12 +198,12 @@
|
|
|
198
198
|
transform: scale(0.8);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
.nut-popup-slide-
|
|
201
|
+
.nut-popup-slide-none-enter-active {
|
|
202
202
|
animation-fill-mode: both;
|
|
203
203
|
animation-name: popup-scale-fade-in;
|
|
204
204
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
205
205
|
}
|
|
206
|
-
.nut-popup-slide-
|
|
206
|
+
.nut-popup-slide-none-exit-active {
|
|
207
207
|
animation-fill-mode: both;
|
|
208
208
|
animation-name: popup-scale-fade-out;
|
|
209
209
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
animation-name: popup-slide-left-exit;
|
|
331
331
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
332
332
|
}
|
|
333
|
-
.nut-popup-slide-
|
|
333
|
+
.nut-popup-slide-none-exit-done.nut-popup, .nut-popup-slide-center-exit-done.nut-popup, .nut-popup-slide-left-exit-done.nut-popup, .nut-popup-slide-right-exit-done.nut-popup, .nut-popup-slide-top-exit-done.nut-popup, .nut-popup-slide-bottom-exit-done.nut-popup {
|
|
334
334
|
display: none;
|
|
335
335
|
}
|
|
336
336
|
.nut-popup .nut-overflow-hidden {
|