@nativescript-community/ui-material-bottom-navigation 6.2.24 → 7.0.2
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 +41 -1
- package/index.android.d.ts +8 -7
- package/index.android.js +9 -10
- package/index.d.ts +4 -4
- package/index.ios.d.ts +5 -5
- package/index.ios.js +9 -9
- package/package.json +4 -3
- package/react/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,7 +3,47 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [
|
6
|
+
## [7.0.2](https://github.com/nativescript-community/ui-material-components/compare/v7.0.1...v7.0.2) (2022-03-13)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @nativescript-community/ui-material-bottom-navigation
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [7.0.1](https://github.com/nativescript-community/ui-material-components/compare/v7.0.0...v7.0.1) (2022-03-09)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @nativescript-community/ui-material-bottom-navigation
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
# [7.0.0](https://github.com/nativescript-community/ui-material-components/compare/v6.2.23...v7.0.0) (2022-03-08)
|
23
|
+
|
24
|
+
**Note:** Version bump only for package @nativescript-community/ui-material-bottom-navigation
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
## [6.2.23](https://github.com/nativescript-community/ui-material-components/compare/v6.2.22...v6.2.23) (2022-03-07)
|
31
|
+
|
32
|
+
**Note:** Version bump only for package @nativescript-community/ui-material-bottom-navigation
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
## [6.2.22](https://github.com/nativescript-community/ui-material-components/compare/v6.2.21...v6.2.22) (2022-03-07)
|
39
|
+
|
40
|
+
**Note:** Version bump only for package @nativescript-community/ui-material-bottom-navigation
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
## [6.2.21](https://github.com/nativescript-community/ui-material-components/compare/v6.2.20...v6.2.21) (2022-03-06)
|
7
47
|
|
8
48
|
**Note:** Version bump only for package @nativescript-community/ui-material-bottom-navigation
|
9
49
|
|
package/index.android.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { TabContentItem } from '@nativescript-community/ui-material-core
|
2
|
-
import { TabNavigation } from '@nativescript-community/ui-material-core
|
3
|
-
import { TabStrip } from '@nativescript-community/ui-material-core
|
4
|
-
import { TabStripItem } from '@nativescript-community/ui-material-core
|
5
|
-
import { TabsPosition } from '@nativescript-community/ui-material-core
|
1
|
+
import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
|
2
|
+
import { TabNavigation } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index.android';
|
3
|
+
import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
|
4
|
+
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
|
5
|
+
import { TabsPosition } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
|
6
6
|
import { Color } from '@nativescript/core';
|
7
7
|
export { TabContentItem, TabStrip, TabStripItem };
|
8
8
|
interface BottomNavigationBar extends com.nativescript.material.core.BottomNavigationBar {
|
@@ -11,15 +11,16 @@ interface BottomNavigationBar extends com.nativescript.material.core.BottomNavig
|
|
11
11
|
declare let BottomNavigationBar: BottomNavigationBar;
|
12
12
|
export declare class BottomNavigation extends TabNavigation<com.nativescript.material.core.BottomNavigationBar> {
|
13
13
|
tabsPosition: TabsPosition;
|
14
|
+
animationEnabled: boolean;
|
15
|
+
swipeEnabled: boolean;
|
14
16
|
protected updateTabsBarItemAt(position: number, itemSpec: com.nativescript.material.core.TabItemSpec): void;
|
15
17
|
protected setTabsBarSelectedIndicatorColors(colors: number[]): void;
|
16
18
|
protected getTabBarItemView(index: number): globalAndroid.widget.LinearLayout;
|
17
19
|
protected getTabBarItemTextView(index: number): globalAndroid.widget.TextView;
|
18
20
|
protected createNativeTabBar(context: android.content.Context): BottomNavigationBar;
|
19
|
-
protected setTabBarItems(tabItems: com.nativescript.material.core.TabItemSpec[]
|
21
|
+
protected setTabBarItems(tabItems: com.nativescript.material.core.TabItemSpec[]): void;
|
20
22
|
protected selectTabBar(oldIndex: number, newIndex: number): void;
|
21
23
|
onLoaded(): void;
|
22
|
-
_onAttachedToWindow(): void;
|
23
24
|
updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec): void;
|
24
25
|
setTabBarBackgroundColor(value: android.graphics.drawable.Drawable | Color): void;
|
25
26
|
_setItemsColors(items: TabStripItem[]): void;
|
package/index.android.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { TabContentItem } from '@nativescript-community/ui-material-core
|
2
|
-
import { PRIMARY_COLOR, TabNavigation } from '@nativescript-community/ui-material-core
|
3
|
-
import { TabStrip } from '@nativescript-community/ui-material-core
|
4
|
-
import { TabStripItem } from '@nativescript-community/ui-material-core
|
5
|
-
import { TabsPosition } from '@nativescript-community/ui-material-core
|
1
|
+
import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
|
2
|
+
import { PRIMARY_COLOR, TabNavigation } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index.android';
|
3
|
+
import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
|
4
|
+
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
|
5
|
+
import { TabsPosition, animationEnabledProperty, swipeEnabledProperty } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
|
6
6
|
import { CSSType, Color, Utils } from '@nativescript/core';
|
7
7
|
export { TabContentItem, TabStrip, TabStripItem };
|
8
8
|
let BottomNavigationBar;
|
@@ -39,6 +39,8 @@ let BottomNavigation = class BottomNavigation extends TabNavigation {
|
|
39
39
|
constructor() {
|
40
40
|
super(...arguments);
|
41
41
|
this.tabsPosition = TabsPosition.Bottom;
|
42
|
+
this.animationEnabled = false;
|
43
|
+
this.swipeEnabled = false;
|
42
44
|
}
|
43
45
|
updateTabsBarItemAt(position, itemSpec) {
|
44
46
|
this.mTabsBar.updateItemAt(position, itemSpec);
|
@@ -61,7 +63,7 @@ let BottomNavigation = class BottomNavigation extends TabNavigation {
|
|
61
63
|
tabsBar.setSelectedPosition(this.selectedIndex);
|
62
64
|
return tabsBar;
|
63
65
|
}
|
64
|
-
setTabBarItems(tabItems
|
66
|
+
setTabBarItems(tabItems) {
|
65
67
|
this.mTabsBar.setItems(tabItems);
|
66
68
|
}
|
67
69
|
selectTabBar(oldIndex, newIndex) {
|
@@ -73,9 +75,6 @@ let BottomNavigation = class BottomNavigation extends TabNavigation {
|
|
73
75
|
this.mTabsBar.setVisibility(android.view.View.GONE);
|
74
76
|
}
|
75
77
|
}
|
76
|
-
_onAttachedToWindow() {
|
77
|
-
super._onAttachedToWindow();
|
78
|
-
}
|
79
78
|
updateAndroidItemAt(index, spec) {
|
80
79
|
try {
|
81
80
|
if (this.mTabsBar) {
|
@@ -103,7 +102,7 @@ let BottomNavigation = class BottomNavigation extends TabNavigation {
|
|
103
102
|
this._setItemsColors(this.tabStrip.items);
|
104
103
|
}
|
105
104
|
onTabsBarSelectedPositionChange(position, prevPosition) {
|
106
|
-
this.mViewPager.setCurrentItem(position,
|
105
|
+
this.mViewPager.setCurrentItem(position, this.animationEnabled);
|
107
106
|
const tabStripItems = this.tabStrip && this.tabStrip.items;
|
108
107
|
if (position >= 0 && tabStripItems && tabStripItems[position]) {
|
109
108
|
tabStripItems[position]._emit(TabStripItem.selectEvent);
|
package/index.d.ts
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
* @module @nativescript-community/ui-material-bottom-navigation
|
4
4
|
*/
|
5
5
|
|
6
|
-
import { TabContentItem } from '@nativescript-community/ui-material-core
|
7
|
-
import { TabNavigationBase } from '@nativescript-community/ui-material-core
|
8
|
-
import { TabStrip } from '@nativescript-community/ui-material-core
|
6
|
+
import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
|
7
|
+
import { TabNavigationBase } from '@nativescript-community/ui-material-core-tabs/tab-navigation-base';
|
8
|
+
import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
|
9
9
|
import { CoercibleProperty, EventData, Property } from '@nativescript/core';
|
10
|
-
import { TabStripItem } from '@nativescript-community/ui-material-core
|
10
|
+
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
|
11
11
|
|
12
12
|
export { TabContentItem, TabStrip, TabStripItem };
|
13
13
|
/**
|
package/index.ios.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { TabContentItem } from '@nativescript-community/ui-material-core
|
2
|
-
import { TabNavigationBase } from '@nativescript-community/ui-material-core
|
3
|
-
import { TabsPosition } from '@nativescript-community/ui-material-core
|
4
|
-
import { TabStrip } from '@nativescript-community/ui-material-core
|
5
|
-
import { TabStripItem } from '@nativescript-community/ui-material-core
|
1
|
+
import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
|
2
|
+
import { TabNavigationBase } from '@nativescript-community/ui-material-core-tabs/tab-navigation-base';
|
3
|
+
import { TabsPosition } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
|
4
|
+
import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
|
5
|
+
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
|
6
6
|
import { Color, CoreTypes, Font, Property } from '@nativescript/core';
|
7
7
|
export { TabContentItem, TabStrip, TabStripItem };
|
8
8
|
declare class UITabBarControllerImpl extends UITabBarController {
|
package/index.ios.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { TabContentItem } from '@nativescript-community/ui-material-core
|
2
|
-
import { TabNavigationBase, getIconSpecSize, itemsProperty, selectedIndexProperty, tabStripProperty } from '@nativescript-community/ui-material-core
|
3
|
-
import { TabsPosition } from '@nativescript-community/ui-material-core
|
4
|
-
import { TabStrip } from '@nativescript-community/ui-material-core
|
5
|
-
import { TabStripItem } from '@nativescript-community/ui-material-core
|
1
|
+
import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
|
2
|
+
import { TabNavigationBase, getIconSpecSize, itemsProperty, selectedIndexProperty, tabStripProperty } from '@nativescript-community/ui-material-core-tabs/tab-navigation-base';
|
3
|
+
import { TabsPosition } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
|
4
|
+
import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
|
5
|
+
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
|
6
6
|
import { CSSType, Color, CoreTypes, Device, Font, Frame, IOSHelper, ImageSource, Property, Utils, View, booleanConverter } from '@nativescript/core';
|
7
7
|
import { getTransformedText } from '@nativescript/core/ui/text-base';
|
8
8
|
import { iOSNativeHelper } from '@nativescript/core/utils';
|
@@ -54,7 +54,7 @@ var UITabBarControllerImpl = /** @class */ (function (_super) {
|
|
54
54
|
var tabStrip_1 = owner.tabStrip;
|
55
55
|
tabStrip_1.items.forEach(function (tabStripItem) {
|
56
56
|
updateBackgroundPositions(tabStrip_1, tabStripItem);
|
57
|
-
var index = tabStripItem.
|
57
|
+
var index = tabStripItem.index;
|
58
58
|
var tabBarItemController = _this.viewControllers[index];
|
59
59
|
updateTitleAndIconPositions(tabStripItem, tabBarItemController.tabBarItem, tabBarItemController);
|
60
60
|
});
|
@@ -174,7 +174,7 @@ var UINavigationControllerDelegateImpl = /** @class */ (function (_super) {
|
|
174
174
|
}(NSObject));
|
175
175
|
function updateBackgroundPositions(tabStrip, tabStripItem) {
|
176
176
|
let bgView = tabStripItem.bgView;
|
177
|
-
const index = tabStripItem.
|
177
|
+
const index = tabStripItem.index;
|
178
178
|
const width = tabStrip.nativeView.frame.size.width / tabStrip.items.length;
|
179
179
|
const frame = CGRectMake(width * index, 0, width, tabStrip.nativeView.frame.size.width);
|
180
180
|
if (!bgView) {
|
@@ -351,7 +351,7 @@ let BottomNavigation = class BottomNavigation extends TabNavigationBase {
|
|
351
351
|
}
|
352
352
|
setIconColor(tabStripItem, forceReload = false) {
|
353
353
|
if (forceReload || (!this.mUnSelectedItemColor && !this.mSelectedItemColor)) {
|
354
|
-
const tabStripColor = this.selectedIndex === tabStripItem.
|
354
|
+
const tabStripColor = this.selectedIndex === tabStripItem.index ? this.mSelectedItemColor : this.mUnSelectedItemColor;
|
355
355
|
const image = this.getIcon(tabStripItem, tabStripColor);
|
356
356
|
tabStripItem.nativeView.image = image;
|
357
357
|
tabStripItem.nativeView.selectedImage = image;
|
@@ -467,7 +467,7 @@ let BottomNavigation = class BottomNavigation extends TabNavigationBase {
|
|
467
467
|
updateTitleAndIconPositions(tabStripItem, tabBarItem, controller);
|
468
468
|
this.setViewAttributes(tabBarItem, tabStripItem.label);
|
469
469
|
controller.tabBarItem = tabBarItem;
|
470
|
-
tabStripItem.
|
470
|
+
tabStripItem.index = i;
|
471
471
|
tabStripItem.setNativeView(tabBarItem);
|
472
472
|
}
|
473
473
|
controllers.addObject(controller);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-material-bottom-navigation",
|
3
|
-
"version": "
|
3
|
+
"version": "7.0.2",
|
4
4
|
"description": "Material Design Bottom Navigation bars allow movement between primary destinations in an app. Tapping on a bottom navigation icon takes you directly to the associated view or refreshes the currently active view.",
|
5
5
|
"main": "bottomnavigation",
|
6
6
|
"sideEffects": false,
|
@@ -51,7 +51,8 @@
|
|
51
51
|
},
|
52
52
|
"readmeFilename": "README.md",
|
53
53
|
"dependencies": {
|
54
|
-
"@nativescript-community/ui-material-core": "^
|
54
|
+
"@nativescript-community/ui-material-core": "^7.0.2",
|
55
|
+
"@nativescript-community/ui-material-core-tabs": "^7.0.2"
|
55
56
|
},
|
56
|
-
"gitHead": "
|
57
|
+
"gitHead": "5b8059038ec0669db9b9839696250e7a9a831980"
|
57
58
|
}
|
package/react/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { NativeScriptProps } from 'react-nativescript';
|
2
2
|
import { BottomNavigation, SelectedIndexChangedEventData, TabContentItem, TabStrip } from '../';
|
3
|
-
import { TabNavigationBaseAttributes } from '@nativescript-community/ui-material-core
|
3
|
+
import { TabNavigationBaseAttributes } from '@nativescript-community/ui-material-core-tabs/react';
|
4
4
|
export declare type BottomNavigationAttributes = TabNavigationBaseAttributes & {
|
5
5
|
android?: any;
|
6
6
|
ios?: any;
|