@nutui/nutui-react 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/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 -2
- package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/cjs/packages/fixednav/style/style.css +56 -51
- package/dist/cjs/packages/imagepreview/imagepreview.js +49 -84
- package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/cjs/packages/imagepreview/style/style.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.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 +28 -8
- 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/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 +11 -6
- package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/cjs/packages/pickerview/style/style.css +3 -1
- package/dist/cjs/packages/resultpage/style/index.js +1 -0
- package/dist/cjs/packages/resultpage/style/style.css +389 -0
- 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 +58 -54
- 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/tabbaritem.scss +32 -29
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/cjs/packages/toast/Notification.js +1 -1
- 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/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 +3 -2
- package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/es/packages/fixednav/style/style.css +56 -51
- package/dist/es/packages/imagepreview/imagepreview.js +49 -84
- package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/es/packages/imagepreview/style/style.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.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 +28 -8
- 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/picker/style/style.css +3 -1
- package/dist/es/packages/pickerview/pickerroller.js +10 -6
- package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/es/packages/pickerview/style/style.css +3 -1
- package/dist/es/packages/resultpage/style/index.js +1 -0
- package/dist/es/packages/resultpage/style/style.css +389 -0
- 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 +58 -54
- 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/tabbaritem.scss +32 -29
- package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/es/packages/toast/Notification.js +1 -1
- 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 +394 -373
- package/dist/style.css +1 -1
- package/dist/style.scss +49 -49
- 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/{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
|
@@ -9,26 +9,29 @@ 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 _typings = require("../../utils/typings");
|
|
19
20
|
var _usepropsvalue = require("../../hooks/use-props-value");
|
|
20
21
|
var _tabbaritem = /*#__PURE__*/ _interop_require_default._(require("../tabbaritem"));
|
|
21
22
|
var _context = /*#__PURE__*/ _interop_require_default._(require("./context"));
|
|
23
|
+
var _index = /*#__PURE__*/ _interop_require_default._(require("../safearea/index"));
|
|
22
24
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
23
25
|
defaultValue: 0,
|
|
24
26
|
fixed: false,
|
|
25
27
|
inactiveColor: '',
|
|
26
28
|
activeColor: '',
|
|
29
|
+
direction: 'vertical',
|
|
27
30
|
safeArea: false,
|
|
28
|
-
onSwitch: function onSwitch(
|
|
31
|
+
onSwitch: function onSwitch() {}
|
|
29
32
|
});
|
|
30
33
|
var Tabbar = function Tabbar(props) {
|
|
31
|
-
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;
|
|
34
|
+
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;
|
|
32
35
|
var classPrefix = 'nut-tabbar';
|
|
33
36
|
var _usePropsValue = (0, _sliced_to_array._)((0, _usepropsvalue.usePropsValue)({
|
|
34
37
|
value: value,
|
|
@@ -36,11 +39,26 @@ var Tabbar = function Tabbar(props) {
|
|
|
36
39
|
finalValue: 0,
|
|
37
40
|
onChange: onSwitch
|
|
38
41
|
}), 2), selectIndex = _usePropsValue[0], setSelectIndex = _usePropsValue[1];
|
|
42
|
+
var sizeCls = (0, _react.useMemo)(function() {
|
|
43
|
+
var size = _react.default.Children.count(children);
|
|
44
|
+
var _obj;
|
|
45
|
+
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));
|
|
46
|
+
}, [
|
|
47
|
+
children,
|
|
48
|
+
direction
|
|
49
|
+
]);
|
|
50
|
+
var itemDirection = (0, _react.useMemo)(function() {
|
|
51
|
+
var size = _react.default.Children.count(children);
|
|
52
|
+
return size === 2 && direction !== 'vertical' && direction;
|
|
53
|
+
}, [
|
|
54
|
+
direction,
|
|
55
|
+
children
|
|
56
|
+
]);
|
|
39
57
|
return /*#__PURE__*/ _react.default.createElement("div", {
|
|
40
58
|
className: (0, _classnames.default)(classPrefix, (0, _define_property._)({}, "".concat(classPrefix, "-fixed"), fixed), className),
|
|
41
59
|
style: style
|
|
42
60
|
}, /*#__PURE__*/ _react.default.createElement("div", {
|
|
43
|
-
className: "".concat(classPrefix, "-wrap")
|
|
61
|
+
className: "".concat(classPrefix, "-wrap ").concat(sizeCls)
|
|
44
62
|
}, /*#__PURE__*/ _react.default.createElement(_context.default.Provider, {
|
|
45
63
|
value: {
|
|
46
64
|
selectIndex: selectIndex,
|
|
@@ -49,12 +67,12 @@ var Tabbar = function Tabbar(props) {
|
|
|
49
67
|
handleClick: setSelectIndex
|
|
50
68
|
}
|
|
51
69
|
}, _react.default.Children.map(children, function(child, index) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}));
|
|
56
|
-
}))), (fixed || safeArea) && /*#__PURE__*/ _react.default.createElement(
|
|
57
|
-
|
|
70
|
+
return /*#__PURE__*/ _react.default.isValidElement(child) ? /*#__PURE__*/ _react.default.cloneElement(child, (0, _object_spread_props._)((0, _object_spread._)({}, child.props), {
|
|
71
|
+
index: index,
|
|
72
|
+
direction: itemDirection
|
|
73
|
+
})) : null;
|
|
74
|
+
}))), (fixed || safeArea) && /*#__PURE__*/ _react.default.createElement(_index.default, {
|
|
75
|
+
position: "bottom"
|
|
58
76
|
}));
|
|
59
77
|
};
|
|
60
78
|
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));
|
|
@@ -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;
|
|
@@ -26,11 +26,12 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
26
26
|
dot: false,
|
|
27
27
|
max: 99,
|
|
28
28
|
top: '0',
|
|
29
|
-
right: '0'
|
|
29
|
+
right: '0',
|
|
30
|
+
direction: 'vertical'
|
|
30
31
|
});
|
|
31
32
|
var TabbarItem = function TabbarItem(props) {
|
|
32
33
|
var ctx = (0, _react.useContext)(_context.default);
|
|
33
|
-
var _ref = (0, _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, index = _ref.index, rest = (0, _object_without_properties._)(_ref, [
|
|
34
|
+
var _ref = (0, _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, index = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = (0, _object_without_properties._)(_ref, [
|
|
34
35
|
"className",
|
|
35
36
|
"style",
|
|
36
37
|
"title",
|
|
@@ -40,15 +41,19 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
40
41
|
"max",
|
|
41
42
|
"top",
|
|
42
43
|
"right",
|
|
43
|
-
"index"
|
|
44
|
+
"index",
|
|
45
|
+
"direction",
|
|
46
|
+
"onActiveClick"
|
|
44
47
|
]);
|
|
45
48
|
var active = index === (ctx === null || ctx === void 0 ? void 0 : ctx.selectIndex);
|
|
46
49
|
var classPrefix = 'nut-tabbar-item';
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
+
var _obj;
|
|
51
|
+
var tabbarItemClass = (0, _classnames.default)(classPrefix, (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-active"), active), (0, _define_property._)(_obj, "".concat(classPrefix, "-large"), !icon || !title), _obj), className);
|
|
52
|
+
var renderNodeWithActive = function renderNodeWithActive(node) {
|
|
53
|
+
return node && typeof node === 'function' ? node(active) : node;
|
|
54
|
+
};
|
|
50
55
|
var badgeProps = {
|
|
51
|
-
value: value,
|
|
56
|
+
value: renderNodeWithActive(value),
|
|
52
57
|
dot: dot,
|
|
53
58
|
max: max,
|
|
54
59
|
top: top,
|
|
@@ -57,8 +62,26 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
57
62
|
};
|
|
58
63
|
var renderTitleText = function renderTitleText() {
|
|
59
64
|
return title && /*#__PURE__*/ _react.default.createElement("div", {
|
|
60
|
-
className:
|
|
61
|
-
}, title);
|
|
65
|
+
className: "".concat(classPrefix, "-text")
|
|
66
|
+
}, renderNodeWithActive(title));
|
|
67
|
+
};
|
|
68
|
+
var renderTitle = function renderTitle() {
|
|
69
|
+
return /*#__PURE__*/ _react.default.createElement(_index.default, (0, _object_spread._)({
|
|
70
|
+
size: "normal"
|
|
71
|
+
}, badgeProps), renderTitleText());
|
|
72
|
+
};
|
|
73
|
+
var renderIcon = function renderIcon() {
|
|
74
|
+
return renderNodeWithActive(icon);
|
|
75
|
+
};
|
|
76
|
+
var renderIconAndTitle = function renderIconAndTitle() {
|
|
77
|
+
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_index.default, (0, _object_spread_props._)((0, _object_spread._)({
|
|
78
|
+
size: "normal"
|
|
79
|
+
}, badgeProps), {
|
|
80
|
+
top: 3
|
|
81
|
+
}), renderIcon()), renderTitleText());
|
|
82
|
+
};
|
|
83
|
+
var renderDualItem = function renderDualItem() {
|
|
84
|
+
return dot ? null : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, renderIcon(), renderTitleText(), /*#__PURE__*/ _react.default.createElement(_index.default, badgeProps));
|
|
62
85
|
};
|
|
63
86
|
return /*#__PURE__*/ _react.default.createElement("div", (0, _object_spread._)({
|
|
64
87
|
className: tabbarItemClass,
|
|
@@ -66,9 +89,7 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
66
89
|
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
67
90
|
}, style),
|
|
68
91
|
onClick: function onClick() {
|
|
69
|
-
return ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
|
|
92
|
+
return active ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
|
|
70
93
|
}
|
|
71
|
-
}, rest),
|
|
72
|
-
className: boxPrefix
|
|
73
|
-
}, icon)), renderTitleText()) : /*#__PURE__*/ _react.default.createElement(_index.default, badgeProps, renderTitleText()));
|
|
94
|
+
}, rest), direction === 'horizontal' && !dot ? renderDualItem() : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
|
|
74
95
|
};
|
|
@@ -170,7 +170,7 @@ Notification.newInstance = function(properties, callback) {
|
|
|
170
170
|
});
|
|
171
171
|
};
|
|
172
172
|
var element = document.createElement('div');
|
|
173
|
-
var id = properties.id ? properties.id : "".concat(
|
|
173
|
+
var id = properties.id ? properties.id : "".concat(Date.now());
|
|
174
174
|
element.id = id;
|
|
175
175
|
properties.id = id;
|
|
176
176
|
document.body.appendChild(element);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseProps } from '../../base/props';
|
|
2
2
|
import { UIType } from '../../base/atoms';
|
|
3
|
-
export type IndicatorType = 'anchor' | 'slide';
|
|
3
|
+
export type IndicatorType = 'anchor' | 'slide' | 'dualScreen';
|
|
4
4
|
export type IndicatorColor = Extract<UIType, 'primary' | 'default'>;
|
|
5
5
|
export interface BaseIndicator extends BaseProps {
|
|
6
6
|
total: number;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { PositionY } from "../../base/atoms";
|
|
1
2
|
import { BaseProps } from '../../base/props';
|
|
2
3
|
export interface BaseNotify extends BaseProps {
|
|
3
4
|
id: string;
|
|
5
|
+
distance: number;
|
|
6
|
+
navHeight: number;
|
|
7
|
+
closeable: boolean;
|
|
8
|
+
leftIcon: React.ReactNode;
|
|
9
|
+
rightIcon: React.ReactNode;
|
|
10
|
+
position: PositionY;
|
|
4
11
|
duration: number;
|
|
5
|
-
type: string;
|
|
6
|
-
position: string;
|
|
7
12
|
onClick: () => void;
|
|
8
13
|
onClose: () => void;
|
|
9
14
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ITouchEvent } from '@tarojs/components';
|
|
1
|
+
import { BaseEventOrig, ITouchEvent, InputProps } from '@tarojs/components';
|
|
3
2
|
import { BaseSearchBar } from './base';
|
|
3
|
+
type inputEventDetail = InputProps.inputEventDetail;
|
|
4
|
+
type inputForceEventDetail = InputProps.inputForceEventDetail;
|
|
5
|
+
type inputValueEventDetail = InputProps.inputValueEventDetail;
|
|
4
6
|
export interface TaroSearchBarProps extends Omit<BaseSearchBar, 'onChange' | 'onFocus' | 'onBlur' | 'onClear' | 'onInputClick'> {
|
|
5
|
-
onChange?: (value: string, event?:
|
|
6
|
-
onFocus?: (value: string, event:
|
|
7
|
-
onBlur?: (value: string, event:
|
|
8
|
-
onClear?: (event:
|
|
9
|
-
onInputClick?: (event:
|
|
7
|
+
onChange?: (value: string, event?: BaseEventOrig<inputEventDetail>) => void;
|
|
8
|
+
onFocus?: (value: string, event: BaseEventOrig<inputForceEventDetail>) => void;
|
|
9
|
+
onBlur?: (value: string, event: BaseEventOrig<inputValueEventDetail>) => void;
|
|
10
|
+
onClear?: (event: ITouchEvent) => void;
|
|
11
|
+
onInputClick?: (event: ITouchEvent) => void;
|
|
10
12
|
}
|
|
13
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { BaseProps } from '../../base/props';
|
|
2
|
+
import { SimpleValue, UIRound, UISize } from '../../base/atoms';
|
|
2
3
|
export type avatarShape = 'round' | 'square';
|
|
3
4
|
export interface BaseSkeleton extends BaseProps {
|
|
4
|
-
animated: boolean;
|
|
5
5
|
rows: number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
size: Extract<UISize, 'small' | 'normal' | 'large'>;
|
|
7
|
+
width?: SimpleValue;
|
|
8
|
+
height?: SimpleValue;
|
|
9
|
+
shape: UIRound | 'circle';
|
|
10
|
+
animated: boolean;
|
|
11
|
+
duration: number;
|
|
9
12
|
visible: boolean;
|
|
10
|
-
avatarShape: avatarShape;
|
|
11
13
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BaseProps } from '../../base/props';
|
|
3
|
-
export interface BaseSwitch
|
|
3
|
+
export interface BaseSwitch extends BaseProps {
|
|
4
4
|
checked: boolean;
|
|
5
5
|
defaultChecked: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
activeText: ReactNode;
|
|
8
8
|
inactiveText: ReactNode;
|
|
9
|
-
|
|
9
|
+
loadingIcon: ReactNode;
|
|
10
|
+
onChange: (val: boolean) => void;
|
|
10
11
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { ITouchEvent } from '@tarojs/components';
|
|
2
1
|
import { BaseSwitch } from './base';
|
|
3
|
-
|
|
4
|
-
export interface TaroSwitchProps extends BaseSwitch<UnionEvent> {
|
|
2
|
+
export interface TaroSwitchProps extends BaseSwitch {
|
|
5
3
|
}
|
|
6
|
-
export {};
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseProps } from
|
|
2
|
+
import { BaseProps, Direction } from "../../../types";
|
|
3
3
|
export interface BaseTabbar extends BaseProps {
|
|
4
4
|
defaultValue: number;
|
|
5
5
|
value?: number;
|
|
6
6
|
fixed: boolean;
|
|
7
7
|
inactiveColor: string;
|
|
8
8
|
activeColor: string;
|
|
9
|
+
direction: Direction;
|
|
9
10
|
safeArea: boolean;
|
|
10
11
|
onSwitch: (value: number) => void;
|
|
11
12
|
}
|
|
12
13
|
export interface BaseTabbarItem extends BaseProps {
|
|
13
|
-
title: ReactNode;
|
|
14
|
-
icon: ReactNode;
|
|
15
|
-
value: ReactNode;
|
|
14
|
+
title: ReactNode | ((active: boolean) => ReactNode);
|
|
15
|
+
icon: ReactNode | ((active: boolean) => ReactNode);
|
|
16
|
+
value: ReactNode | ((active: boolean) => ReactNode);
|
|
16
17
|
dot: boolean;
|
|
17
18
|
max: number;
|
|
18
19
|
top: string;
|
|
19
20
|
right: string;
|
|
21
|
+
direction: Direction;
|
|
22
|
+
onActiveClick: () => void;
|
|
20
23
|
}
|
|
@@ -13,7 +13,8 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
13
13
|
top: 0,
|
|
14
14
|
right: 0,
|
|
15
15
|
fill: 'solid',
|
|
16
|
-
size: 'large'
|
|
16
|
+
size: 'large',
|
|
17
|
+
disabled: false
|
|
17
18
|
});
|
|
18
19
|
export var Badge = function(props) {
|
|
19
20
|
var isIcon = function isIcon() {
|
|
@@ -27,7 +28,7 @@ export var Badge = function(props) {
|
|
|
27
28
|
};
|
|
28
29
|
var _this;
|
|
29
30
|
var rtl = useRtl();
|
|
30
|
-
var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size;
|
|
31
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size, disabled = _$_object_spread.disabled;
|
|
31
32
|
var classPrefix = 'nut-badge';
|
|
32
33
|
var classes = classNames(classPrefix, className);
|
|
33
34
|
var getContent = function() {
|
|
@@ -38,7 +39,7 @@ export var Badge = function(props) {
|
|
|
38
39
|
return value;
|
|
39
40
|
};
|
|
40
41
|
var _obj;
|
|
41
|
-
var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix, "-one"), typeof getContent() === 'string' && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix, "-dot"), dot), _define_property(_obj, "".concat(classPrefix, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix, "-").concat(fill), fill === 'outline'), _define_property(_obj, "".concat(classPrefix, "-content"), children), _obj));
|
|
42
|
+
var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix, "-one"), typeof getContent() === 'string' && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix, "-dot"), dot), _define_property(_obj, "".concat(classPrefix, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix, "-").concat(fill), fill === 'outline'), _define_property(_obj, "".concat(classPrefix, "-content"), children), _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _obj));
|
|
42
43
|
var getPositionStyle = function() {
|
|
43
44
|
return _define_property({
|
|
44
45
|
top: "".concat(Number(top) || 0, "px")
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
.nut-badge {
|
|
2
2
|
position: relative;
|
|
3
3
|
display: inline-flex;
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
box-sizing: content-box;
|
|
4
6
|
width: auto;
|
|
5
7
|
|
|
6
8
|
&-icon {
|
|
@@ -37,8 +39,7 @@
|
|
|
37
39
|
|
|
38
40
|
&-sup {
|
|
39
41
|
display: inline-flex;
|
|
40
|
-
|
|
41
|
-
height: $badge-height;
|
|
42
|
+
text-align: center;
|
|
42
43
|
min-width: $badge-min-width;
|
|
43
44
|
padding: $badge-padding;
|
|
44
45
|
box-sizing: border-box;
|
|
@@ -52,14 +53,12 @@
|
|
|
52
53
|
z-index: 1;
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
&-disabled {
|
|
57
|
+
background: $badge-background-disabled-color;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
&-number {
|
|
56
61
|
font-family: 'JD';
|
|
57
|
-
/* #ifdef harmony */
|
|
58
|
-
line-height: 12px;
|
|
59
|
-
/* #endif */
|
|
60
|
-
/* #ifndef harmony */
|
|
61
|
-
line-height: 13px;
|
|
62
|
-
/* #endif */
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
&-one {
|
|
@@ -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;
|