baseui 0.0.0-next-ecc760f → 0.0.0-next-a340870
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/bottom-navigation/bottom-navigation.js +4 -5
- package/bottom-navigation/index.js.flow +2 -2
- package/bottom-navigation/styled-components.js +1 -0
- package/bottom-navigation/types.d.ts +2 -2
- package/es/bottom-navigation/bottom-navigation.js +4 -5
- package/es/bottom-navigation/styled-components.js +1 -0
- package/esm/bottom-navigation/bottom-navigation.js +4 -5
- package/esm/bottom-navigation/styled-components.js +1 -0
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ var MAX_SELECTORS = 5;
|
|
|
45
45
|
|
|
46
46
|
var BottomNavigation = function BottomNavigation(_ref) {
|
|
47
47
|
var _ref$activeKey = _ref.activeKey,
|
|
48
|
-
activeKey = _ref$activeKey === void 0 ?
|
|
48
|
+
activeKey = _ref$activeKey === void 0 ? 0 : _ref$activeKey,
|
|
49
49
|
onChange = _ref.onChange,
|
|
50
50
|
children = _ref.children,
|
|
51
51
|
_ref$overrides = _ref.overrides,
|
|
@@ -118,8 +118,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
118
118
|
icon: _icon.Overflow,
|
|
119
119
|
onChange: function onChange() {
|
|
120
120
|
return setDisplayOverflow(true);
|
|
121
|
-
}
|
|
122
|
-
,
|
|
121
|
+
},
|
|
123
122
|
isActive: displayOverflow || activeKey > 4,
|
|
124
123
|
overrides: {
|
|
125
124
|
Title: overrides.OverflowTitle,
|
|
@@ -145,11 +144,11 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
145
144
|
}), displayOverflow && /*#__PURE__*/React.createElement(OverflowPanel, OverflowPanelProps, /*#__PURE__*/React.createElement(_mobileHeader.MobileHeader, {
|
|
146
145
|
title: "More",
|
|
147
146
|
expanded: true
|
|
148
|
-
}), /*#__PURE__*/React.createElement(OverflowPanelList, OverflowPanelListProps, navItems.slice(MAX_SELECTORS).map(function (navItem, overflowIdx) {
|
|
147
|
+
}), /*#__PURE__*/React.createElement(OverflowPanelList, OverflowPanelListProps, navItems.slice(MAX_SELECTORS - 1).map(function (navItem, overflowIdx) {
|
|
149
148
|
var _navItem$props = navItem.props,
|
|
150
149
|
Icon = _navItem$props.icon,
|
|
151
150
|
title = _navItem$props.title;
|
|
152
|
-
var idx = overflowIdx + MAX_SELECTORS;
|
|
151
|
+
var idx = overflowIdx + MAX_SELECTORS - 1;
|
|
153
152
|
return /*#__PURE__*/React.createElement(_list.ListItem, {
|
|
154
153
|
artwork: function artwork(props) {
|
|
155
154
|
return /*#__PURE__*/React.createElement(Icon, props);
|
|
@@ -33,11 +33,11 @@ export type NavItemPropsT = {
|
|
|
33
33
|
overrides?: NavItemOverridesT,
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export type OnChangeT = (params: { activeKey:
|
|
36
|
+
export type OnChangeT = (params: { activeKey: number }) => void;
|
|
37
37
|
|
|
38
38
|
export type BottomNavigationPropsT = {
|
|
39
39
|
children?: React.Node,
|
|
40
|
-
activeKey?:
|
|
40
|
+
activeKey?: number,
|
|
41
41
|
onChange?: OnChangeT,
|
|
42
42
|
overrides?: BottomNavigationOverridesT,
|
|
43
43
|
};
|
|
@@ -35,11 +35,11 @@ export type PanelProps = {
|
|
|
35
35
|
children: React.ReactNode;
|
|
36
36
|
};
|
|
37
37
|
export type OnChange = (params: {
|
|
38
|
-
activeKey:
|
|
38
|
+
activeKey: number;
|
|
39
39
|
}) => void;
|
|
40
40
|
export interface BottomNavigationProps {
|
|
41
41
|
children?: React.ReactNode;
|
|
42
|
-
activeKey?:
|
|
42
|
+
activeKey?: number;
|
|
43
43
|
onChange?: OnChange;
|
|
44
44
|
overrides?: BottomNavigationOverrides;
|
|
45
45
|
}
|
|
@@ -17,7 +17,7 @@ import { Overflow, ChevronRight } from '../icon';
|
|
|
17
17
|
const MAX_SELECTORS = 5;
|
|
18
18
|
|
|
19
19
|
const BottomNavigation = ({
|
|
20
|
-
activeKey =
|
|
20
|
+
activeKey = 0,
|
|
21
21
|
onChange,
|
|
22
22
|
children,
|
|
23
23
|
overrides = {}
|
|
@@ -64,8 +64,7 @@ const BottomNavigation = ({
|
|
|
64
64
|
const OverflowSelector = () => /*#__PURE__*/React.createElement(Selector, {
|
|
65
65
|
title: "More",
|
|
66
66
|
icon: Overflow,
|
|
67
|
-
onChange: () => setDisplayOverflow(true)
|
|
68
|
-
,
|
|
67
|
+
onChange: () => setDisplayOverflow(true),
|
|
69
68
|
isActive: displayOverflow || activeKey > 4,
|
|
70
69
|
overrides: {
|
|
71
70
|
Title: overrides.OverflowTitle,
|
|
@@ -88,12 +87,12 @@ const BottomNavigation = ({
|
|
|
88
87
|
}), displayOverflow && /*#__PURE__*/React.createElement(OverflowPanel, OverflowPanelProps, /*#__PURE__*/React.createElement(MobileHeader, {
|
|
89
88
|
title: "More",
|
|
90
89
|
expanded: true
|
|
91
|
-
}), /*#__PURE__*/React.createElement(OverflowPanelList, OverflowPanelListProps, navItems.slice(MAX_SELECTORS).map((navItem, overflowIdx) => {
|
|
90
|
+
}), /*#__PURE__*/React.createElement(OverflowPanelList, OverflowPanelListProps, navItems.slice(MAX_SELECTORS - 1).map((navItem, overflowIdx) => {
|
|
92
91
|
const {
|
|
93
92
|
icon: Icon,
|
|
94
93
|
title
|
|
95
94
|
} = navItem.props;
|
|
96
|
-
const idx = overflowIdx + MAX_SELECTORS;
|
|
95
|
+
const idx = overflowIdx + MAX_SELECTORS - 1;
|
|
97
96
|
return /*#__PURE__*/React.createElement(ListItem, {
|
|
98
97
|
artwork: props => /*#__PURE__*/React.createElement(Icon, props),
|
|
99
98
|
endEnhancer: () => /*#__PURE__*/React.createElement(ChevronRight, null),
|
|
@@ -30,7 +30,7 @@ var MAX_SELECTORS = 5;
|
|
|
30
30
|
|
|
31
31
|
var BottomNavigation = function BottomNavigation(_ref) {
|
|
32
32
|
var _ref$activeKey = _ref.activeKey,
|
|
33
|
-
activeKey = _ref$activeKey === void 0 ?
|
|
33
|
+
activeKey = _ref$activeKey === void 0 ? 0 : _ref$activeKey,
|
|
34
34
|
onChange = _ref.onChange,
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
_ref$overrides = _ref.overrides,
|
|
@@ -103,8 +103,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
103
103
|
icon: Overflow,
|
|
104
104
|
onChange: function onChange() {
|
|
105
105
|
return setDisplayOverflow(true);
|
|
106
|
-
}
|
|
107
|
-
,
|
|
106
|
+
},
|
|
108
107
|
isActive: displayOverflow || activeKey > 4,
|
|
109
108
|
overrides: {
|
|
110
109
|
Title: overrides.OverflowTitle,
|
|
@@ -130,11 +129,11 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
130
129
|
}), displayOverflow && /*#__PURE__*/React.createElement(OverflowPanel, OverflowPanelProps, /*#__PURE__*/React.createElement(MobileHeader, {
|
|
131
130
|
title: "More",
|
|
132
131
|
expanded: true
|
|
133
|
-
}), /*#__PURE__*/React.createElement(OverflowPanelList, OverflowPanelListProps, navItems.slice(MAX_SELECTORS).map(function (navItem, overflowIdx) {
|
|
132
|
+
}), /*#__PURE__*/React.createElement(OverflowPanelList, OverflowPanelListProps, navItems.slice(MAX_SELECTORS - 1).map(function (navItem, overflowIdx) {
|
|
134
133
|
var _navItem$props = navItem.props,
|
|
135
134
|
Icon = _navItem$props.icon,
|
|
136
135
|
title = _navItem$props.title;
|
|
137
|
-
var idx = overflowIdx + MAX_SELECTORS;
|
|
136
|
+
var idx = overflowIdx + MAX_SELECTORS - 1;
|
|
138
137
|
return /*#__PURE__*/React.createElement(ListItem, {
|
|
139
138
|
artwork: function artwork(props) {
|
|
140
139
|
return /*#__PURE__*/React.createElement(Icon, props);
|