@nutui/nutui-react-taro 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/cjs/packages/badge/badge.js +4 -3
- package/dist/cjs/packages/badge/style/badge.scss +7 -8
- package/dist/cjs/packages/badge/style/style.css +13 -15
- package/dist/cjs/packages/badge/style/style.harmony.css +7 -9
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +3 -1
- package/dist/cjs/packages/datepickerview/style/style.css +3 -1
- package/dist/cjs/packages/empty/style/index.js +1 -0
- package/dist/cjs/packages/empty/style/style.css +389 -0
- package/dist/cjs/packages/fixednav/fixednav.js +3 -3
- package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/cjs/packages/fixednav/style/style.css +56 -51
- package/dist/cjs/packages/fixednav/style/style.harmony.css +43 -36
- package/dist/cjs/packages/imagepreview/imagepreview.js +58 -91
- package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/cjs/packages/imagepreview/style/style.css +2 -1
- package/dist/cjs/packages/imagepreview/style/style.harmony.css +2 -1
- package/dist/cjs/packages/indicator/indicator.js +1 -1
- package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
- package/dist/cjs/packages/lottie/index.js +5 -5
- package/dist/cjs/packages/lottie/{mp.js → lottiemp.js} +1 -1
- package/dist/cjs/packages/notify/notify.js +44 -13
- package/dist/cjs/packages/notify/style/notify.scss +39 -36
- package/dist/cjs/packages/notify/style/style.css +36 -31
- package/dist/cjs/packages/notify/style/style.harmony.css +36 -31
- package/dist/cjs/packages/nutui.react.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.js +1 -0
- package/dist/cjs/packages/picker/style/style.css +3 -1
- package/dist/cjs/packages/pickerview/pickerroller.js +81 -11
- package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/cjs/packages/pickerview/style/style.css +3 -1
- package/dist/cjs/packages/pickerview/style/style.harmony.css +3 -0
- package/dist/cjs/packages/resultpage/style/index.js +1 -0
- package/dist/cjs/packages/resultpage/style/style.css +389 -0
- package/dist/cjs/packages/searchbar/searchbar.js +8 -2
- package/dist/cjs/packages/skeleton/skeleton.js +63 -52
- package/dist/cjs/packages/skeleton/style/index.js +0 -1
- package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/cjs/packages/skeleton/style/style.css +32 -175
- package/dist/cjs/packages/skeleton/style/style.harmony.css +32 -42
- package/dist/cjs/packages/switch/style/style.css +5 -0
- package/dist/cjs/packages/switch/style/style.harmony.css +5 -0
- package/dist/cjs/packages/switch/style/switch.scss +5 -0
- package/dist/cjs/packages/switch/switch.js +22 -11
- package/dist/cjs/packages/tabbar/style/style.css +58 -54
- package/dist/cjs/packages/tabbar/style/style.harmony.css +24 -18
- package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/cjs/packages/tabbar/tabbar.js +28 -10
- package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
- package/dist/cjs/packages/tabbaritem/style/style.harmony.css +21 -21
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +38 -14
- package/dist/cjs/types/spec/badge/base.d.ts +1 -0
- package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
- package/dist/cjs/types/spec/notify/base.d.ts +7 -2
- package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
- package/dist/cjs/types/spec/switch/base.d.ts +3 -2
- package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
- package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
- package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
- package/dist/es/packages/badge/badge.js +4 -3
- package/dist/es/packages/badge/style/badge.scss +7 -8
- package/dist/es/packages/badge/style/style.css +13 -15
- package/dist/es/packages/badge/style/style.harmony.css +7 -9
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +3 -1
- package/dist/es/packages/datepickerview/style/style.css +3 -1
- package/dist/es/packages/empty/style/index.js +1 -0
- package/dist/es/packages/empty/style/style.css +389 -0
- package/dist/es/packages/fixednav/fixednav.js +4 -4
- package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/es/packages/fixednav/style/style.css +56 -51
- package/dist/es/packages/fixednav/style/style.harmony.css +43 -36
- package/dist/es/packages/imagepreview/imagepreview.js +58 -91
- package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/es/packages/imagepreview/style/style.css +2 -1
- package/dist/es/packages/imagepreview/style/style.harmony.css +2 -1
- package/dist/es/packages/indicator/indicator.js +1 -1
- package/dist/es/packages/inputnumber/inputnumber.js +2 -2
- package/dist/es/packages/lottie/index.js +3 -3
- package/dist/es/packages/lottie/{mp.js → lottiemp.js} +1 -1
- package/dist/es/packages/notify/notify.js +45 -14
- package/dist/es/packages/notify/style/notify.scss +39 -36
- package/dist/es/packages/notify/style/style.css +36 -31
- package/dist/es/packages/notify/style/style.harmony.css +36 -31
- package/dist/es/packages/picker/style/style.css +3 -1
- package/dist/es/packages/pickerview/pickerroller.js +80 -11
- package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/es/packages/pickerview/style/style.css +3 -1
- package/dist/es/packages/pickerview/style/style.harmony.css +3 -0
- package/dist/es/packages/resultpage/style/index.js +1 -0
- package/dist/es/packages/resultpage/style/style.css +389 -0
- package/dist/es/packages/searchbar/searchbar.js +7 -2
- package/dist/es/packages/skeleton/skeleton.js +62 -52
- package/dist/es/packages/skeleton/style/index.js +0 -1
- package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/es/packages/skeleton/style/style.css +32 -175
- package/dist/es/packages/skeleton/style/style.harmony.css +32 -42
- package/dist/es/packages/switch/style/style.css +5 -0
- package/dist/es/packages/switch/style/style.harmony.css +5 -0
- package/dist/es/packages/switch/style/switch.scss +5 -0
- package/dist/es/packages/switch/switch.js +21 -11
- package/dist/es/packages/tabbar/style/style.css +58 -54
- package/dist/es/packages/tabbar/style/style.harmony.css +24 -18
- package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/es/packages/tabbar/tabbar.js +27 -10
- package/dist/es/packages/tabbaritem/style/style.css +34 -36
- package/dist/es/packages/tabbaritem/style/style.harmony.css +21 -21
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/es/packages/tabbaritem/tabbaritem.js +38 -14
- package/dist/es/types/spec/badge/base.d.ts +4 -0
- package/dist/es/types/spec/indicator/base.d.ts +1 -1
- package/dist/es/types/spec/notify/base.d.ts +22 -5
- package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/es/types/spec/skeleton/base.d.ts +19 -14
- package/dist/es/types/spec/switch/base.d.ts +6 -2
- package/dist/es/types/spec/switch/h5.d.ts +1 -1
- package/dist/es/types/spec/switch/taro.d.ts +1 -4
- package/dist/es/types/spec/tabbar/base.d.ts +7 -4
- package/dist/nutui.react.umd.js +549 -395
- package/dist/style.css +1 -1
- package/dist/style.scss +51 -51
- package/dist/styles/theme-dark.scss +2 -0
- package/dist/styles/theme-default.scss +2 -0
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-jmapp.scss +24 -1
- package/dist/styles/variables-jrkf.scss +24 -1
- package/dist/styles/variables.scss +37 -38
- package/package.json +1 -1
- /package/dist/cjs/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.js → lottieweb.js} +0 -0
- /package/dist/es/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.js → lottieweb.js} +0 -0
|
@@ -8,7 +8,6 @@ import { View } from "@tarojs/components";
|
|
|
8
8
|
import { ComponentDefaults } from "../../utils/typings";
|
|
9
9
|
import Badge from "../badge/index";
|
|
10
10
|
import TabbarContext from "../tabbar/context";
|
|
11
|
-
import addColorForHarmony from "../../utils/add-color-for-harmony";
|
|
12
11
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13
12
|
title: '',
|
|
14
13
|
icon: null,
|
|
@@ -16,12 +15,13 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
16
15
|
dot: false,
|
|
17
16
|
max: 99,
|
|
18
17
|
top: '0',
|
|
19
|
-
right: '0'
|
|
18
|
+
right: '0',
|
|
19
|
+
direction: 'vertical'
|
|
20
20
|
});
|
|
21
21
|
export var TabbarItem = function(props) {
|
|
22
22
|
var ctx = useContext(TabbarContext);
|
|
23
23
|
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
|
|
24
|
-
index = _ref.index, rest = _object_without_properties(_ref, [
|
|
24
|
+
index = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = _object_without_properties(_ref, [
|
|
25
25
|
"className",
|
|
26
26
|
"style",
|
|
27
27
|
"title",
|
|
@@ -31,15 +31,19 @@ export var TabbarItem = function(props) {
|
|
|
31
31
|
"max",
|
|
32
32
|
"top",
|
|
33
33
|
"right",
|
|
34
|
-
"index"
|
|
34
|
+
"index",
|
|
35
|
+
"direction",
|
|
36
|
+
"onActiveClick"
|
|
35
37
|
]);
|
|
36
38
|
var active = index === (ctx === null || ctx === void 0 ? void 0 : ctx.selectIndex);
|
|
37
39
|
var classPrefix = 'nut-tabbar-item';
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
40
|
+
var _obj;
|
|
41
|
+
var tabbarItemClass = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-active"), active), _define_property(_obj, "".concat(classPrefix, "-large"), !icon || !title), _obj), className);
|
|
42
|
+
var renderNodeWithActive = function(node) {
|
|
43
|
+
return node && typeof node === 'function' ? node(active) : node;
|
|
44
|
+
};
|
|
41
45
|
var badgeProps = {
|
|
42
|
-
value: value,
|
|
46
|
+
value: renderNodeWithActive(value),
|
|
43
47
|
dot: dot,
|
|
44
48
|
max: max,
|
|
45
49
|
top: top,
|
|
@@ -48,11 +52,33 @@ export var TabbarItem = function(props) {
|
|
|
48
52
|
};
|
|
49
53
|
var renderTitleText = function() {
|
|
50
54
|
return title && /*#__PURE__*/ React.createElement(View, {
|
|
51
|
-
className:
|
|
55
|
+
className: "".concat(classPrefix, "-text"),
|
|
52
56
|
style: {
|
|
53
57
|
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
54
58
|
}
|
|
55
|
-
}, title);
|
|
59
|
+
}, renderNodeWithActive(title));
|
|
60
|
+
};
|
|
61
|
+
var renderTitle = function() {
|
|
62
|
+
return /*#__PURE__*/ React.createElement(Badge, _object_spread({
|
|
63
|
+
size: "normal"
|
|
64
|
+
}, badgeProps), renderTitleText());
|
|
65
|
+
};
|
|
66
|
+
var renderIcon = function() {
|
|
67
|
+
var distIcon = renderNodeWithActive(icon);
|
|
68
|
+
// 鸿蒙差异处理,需要手动给icon一个color
|
|
69
|
+
return /*#__PURE__*/ React.isValidElement(distIcon) ? /*#__PURE__*/ React.cloneElement(distIcon, _object_spread_props(_object_spread({}, distIcon.props), {
|
|
70
|
+
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
71
|
+
})) : null;
|
|
72
|
+
};
|
|
73
|
+
var renderIconAndTitle = function() {
|
|
74
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Badge, _object_spread_props(_object_spread({
|
|
75
|
+
size: "normal"
|
|
76
|
+
}, badgeProps), {
|
|
77
|
+
top: 3
|
|
78
|
+
}), renderIcon()), renderTitleText());
|
|
79
|
+
};
|
|
80
|
+
var renderDualItem = function() {
|
|
81
|
+
return dot ? null : /*#__PURE__*/ React.createElement(React.Fragment, null, renderIcon(), renderTitleText(), /*#__PURE__*/ React.createElement(Badge, badgeProps));
|
|
56
82
|
};
|
|
57
83
|
return /*#__PURE__*/ React.createElement(View, _object_spread({
|
|
58
84
|
className: tabbarItemClass,
|
|
@@ -60,9 +86,7 @@ export var TabbarItem = function(props) {
|
|
|
60
86
|
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
61
87
|
}, style),
|
|
62
88
|
onClick: function() {
|
|
63
|
-
return ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
|
|
89
|
+
return active ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
|
|
64
90
|
}
|
|
65
|
-
}, rest),
|
|
66
|
-
className: boxPrefix
|
|
67
|
-
}, addColorForHarmony(icon, active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor))), renderTitleText()) : /*#__PURE__*/ React.createElement(Badge, badgeProps, renderTitleText()));
|
|
91
|
+
}, rest), direction === 'horizontal' && !dot ? renderDualItem() : /*#__PURE__*/ React.createElement(React.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
|
|
68
92
|
};
|
|
@@ -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
|
/**
|
|
@@ -1,18 +1,35 @@
|
|
|
1
|
+
import { PositionY } from "../../base/atoms";
|
|
1
2
|
import { BaseProps } from '../../base/props';
|
|
2
3
|
export interface BaseNotify extends BaseProps {
|
|
3
4
|
id: string;
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* 距离顶部/底部距离
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
distance: number
|
|
9
|
+
/**
|
|
10
|
+
* 顶部导航高度
|
|
11
|
+
*/
|
|
12
|
+
navHeight: number
|
|
13
|
+
/**
|
|
14
|
+
* 是否启用关闭模式
|
|
15
|
+
*/
|
|
16
|
+
closeable: boolean
|
|
8
17
|
/**
|
|
9
|
-
*
|
|
18
|
+
* 左边的 icon
|
|
10
19
|
*/
|
|
11
|
-
|
|
20
|
+
leftIcon: React.ReactNode
|
|
21
|
+
/**
|
|
22
|
+
* 右边的 icon,在 closeable 模式下默认为 <Close />
|
|
23
|
+
*/
|
|
24
|
+
rightIcon: React.ReactNode
|
|
12
25
|
/**
|
|
13
26
|
* 自定义位置 (top, bottom)
|
|
14
27
|
*/
|
|
15
|
-
position:
|
|
28
|
+
position: PositionY
|
|
29
|
+
/**
|
|
30
|
+
* 展示时长(ms),值为 0 时,notify 不会消失
|
|
31
|
+
*/
|
|
32
|
+
duration: number
|
|
16
33
|
/**
|
|
17
34
|
* 点击事件回调
|
|
18
35
|
*/
|
|
@@ -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,32 +1,37 @@
|
|
|
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
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* 设置行数
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
rows: number
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* 指定使用的内置高度
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
size: Extract<UISize, 'small' | 'normal' | 'large'>
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* 设置宽度,优先级高于 size 属性
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
width?: SimpleValue
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* 设置高度,优先级高于 size 属性
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
height?: SimpleValue
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* 设置形状
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
shape: UIRound | 'circle'
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
+
* 是否开启骨架屏动画
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
+
animated: boolean
|
|
29
|
+
/**
|
|
30
|
+
* 动画时长
|
|
31
|
+
*/
|
|
32
|
+
duration: number
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
34
|
+
* 是否显示骨架屏(true不显示骨架屏,false显示骨架屏)
|
|
30
35
|
*/
|
|
31
|
-
|
|
36
|
+
visible: boolean
|
|
32
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
/**
|
|
5
5
|
* 开关状态,受控
|
|
6
6
|
*/
|
|
@@ -22,7 +22,11 @@ export interface BaseSwitch<EVENT = any> extends BaseProps {
|
|
|
22
22
|
*/
|
|
23
23
|
inactiveText: ReactNode
|
|
24
24
|
/**
|
|
25
|
+
* 受控 loading 态图标
|
|
26
|
+
*/
|
|
27
|
+
loadingIcon: ReactNode
|
|
28
|
+
/**
|
|
25
29
|
* 切换开关时触发
|
|
26
30
|
*/
|
|
27
|
-
onChange: (val: boolean
|
|
31
|
+
onChange: (val: boolean) => void
|
|
28
32
|
}
|
|
@@ -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,5 +1,5 @@
|
|
|
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
|
/**
|
|
5
5
|
* 默认选中的标签的索引值
|
|
@@ -21,6 +21,7 @@ export interface BaseTabbar extends BaseProps {
|
|
|
21
21
|
* icon激活的颜色
|
|
22
22
|
*/
|
|
23
23
|
activeColor: string
|
|
24
|
+
direction: Direction;
|
|
24
25
|
/**
|
|
25
26
|
* 是否开启iphone系列全面屏底部安全区适配
|
|
26
27
|
*/
|
|
@@ -31,11 +32,13 @@ export interface BaseTabbar extends BaseProps {
|
|
|
31
32
|
onSwitch: (value: number) => void
|
|
32
33
|
}
|
|
33
34
|
export interface BaseTabbarItem extends BaseProps {
|
|
34
|
-
title: ReactNode;
|
|
35
|
-
icon: ReactNode;
|
|
36
|
-
value: ReactNode;
|
|
35
|
+
title: ReactNode | ((active: boolean) => ReactNode);
|
|
36
|
+
icon: ReactNode | ((active: boolean) => ReactNode);
|
|
37
|
+
value: ReactNode | ((active: boolean) => ReactNode);
|
|
37
38
|
dot: boolean;
|
|
38
39
|
max: number;
|
|
39
40
|
top: string;
|
|
40
41
|
right: string;
|
|
42
|
+
direction: Direction;
|
|
43
|
+
onActiveClick: () => void;
|
|
41
44
|
}
|