@nativescript-community/ui-material-bottom-navigation 7.2.1 → 7.2.3
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/angular/{esm2020 → esm2022}/index.mjs +6 -6
- package/angular/{fesm2020 → fesm2022}/nativescript-community-ui-material-bottom-navigation-angular.mjs +5 -5
- package/angular/{fesm2020 → fesm2022}/nativescript-community-ui-material-bottom-navigation-angular.mjs.map +1 -1
- package/angular/index.d.ts +10 -0
- package/angular/package.json +4 -10
- package/index.android.d.ts +30 -0
- package/index.android.js +140 -0
- package/index.android.js.map +1 -0
- package/index.d.ts +88 -0
- package/index.ios.d.ts +68 -0
- package/index.ios.js +722 -0
- package/index.ios.js.map +1 -0
- package/package.json +4 -4
- package/react/index.d.ts +26 -0
- package/react/index.js +80 -0
- package/react/index.js.map +1 -0
- package/vue/component.d.ts +12 -0
- package/vue/component.js +22 -0
- package/vue/component.js.map +1 -0
- package/vue/index.d.ts +4 -0
- package/vue/index.js +20 -0
- package/vue/index.js.map +1 -0
- package/angular/fesm2015/nativescript-community-ui-material-bottom-navigation-angular.mjs +0 -41
- package/angular/fesm2015/nativescript-community-ui-material-bottom-navigation-angular.mjs.map +0 -1
- /package/angular/{esm2020 → esm2022}/nativescript-community-ui-material-bottom-navigation-angular.mjs +0 -0
@@ -3,18 +3,18 @@ import { registerElement } from '@nativescript/angular';
|
|
3
3
|
import { BottomNavigation, TabContentItem, TabStrip, TabStripItem } from '@nativescript-community/ui-material-bottom-navigation';
|
4
4
|
import * as i0 from "@angular/core";
|
5
5
|
export class MaterialBottomNavigationDirective {
|
6
|
+
static ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
|
7
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
|
6
8
|
}
|
7
|
-
MaterialBottomNavigationDirective.ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
|
8
|
-
MaterialBottomNavigationDirective.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
|
9
9
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MaterialBottomNavigationDirective, [{
|
10
10
|
type: Directive,
|
11
11
|
args: [{ selector: 'MDBottomNavigation' }]
|
12
12
|
}], null, null); })();
|
13
13
|
export class NativeScriptMaterialBottomNavigationModule {
|
14
|
+
static ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
|
15
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
|
16
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
14
17
|
}
|
15
|
-
NativeScriptMaterialBottomNavigationModule.ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
|
16
|
-
NativeScriptMaterialBottomNavigationModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
|
17
|
-
NativeScriptMaterialBottomNavigationModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
18
18
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NativeScriptMaterialBottomNavigationModule, [{
|
19
19
|
type: NgModule,
|
20
20
|
args: [{
|
@@ -27,4 +27,4 @@ registerElement('MDBottomNavigation', () => BottomNavigation);
|
|
27
27
|
registerElement('MDTabStrip', () => TabStrip);
|
28
28
|
registerElement('MDTabStripItem', () => TabStripItem);
|
29
29
|
registerElement('MDTabContentItem', () => TabContentItem);
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
30
|
+
//# sourceMappingURL=data:application/json;base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29udGVudEl0ZW0nLCAoKSA9PiBUYWJDb250ZW50SXRlbSk7XG4iXX0=
|
@@ -4,18 +4,18 @@ import { registerElement } from '@nativescript/angular';
|
|
4
4
|
import { BottomNavigation, TabStrip, TabStripItem, TabContentItem } from '@nativescript-community/ui-material-bottom-navigation';
|
5
5
|
|
6
6
|
class MaterialBottomNavigationDirective {
|
7
|
+
static ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
|
8
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
|
7
9
|
}
|
8
|
-
MaterialBottomNavigationDirective.ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
|
9
|
-
MaterialBottomNavigationDirective.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
|
10
10
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MaterialBottomNavigationDirective, [{
|
11
11
|
type: Directive,
|
12
12
|
args: [{ selector: 'MDBottomNavigation' }]
|
13
13
|
}], null, null); })();
|
14
14
|
class NativeScriptMaterialBottomNavigationModule {
|
15
|
+
static ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
|
16
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
|
17
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
15
18
|
}
|
16
|
-
NativeScriptMaterialBottomNavigationModule.ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
|
17
|
-
NativeScriptMaterialBottomNavigationModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
|
18
|
-
NativeScriptMaterialBottomNavigationModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
19
19
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NativeScriptMaterialBottomNavigationModule, [{
|
20
20
|
type: NgModule,
|
21
21
|
args: [{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nativescript-community-ui-material-bottom-navigation-angular.mjs","sources":["../../../../src/bottom-navigation/angular/index.ts","../../../../src/bottom-navigation/angular/nativescript-community-ui-material-bottom-navigation-angular.ts"],"sourcesContent":["import { Directive, NgModule } from '@angular/core';\nimport { registerElement } from '@nativescript/angular';\nimport { BottomNavigation, TabContentItem, TabStrip, TabStripItem } from '@nativescript-community/ui-material-bottom-navigation';\n\n@Directive({ selector: 'MDBottomNavigation' })\nexport class MaterialBottomNavigationDirective {}\n\n@NgModule({\n declarations: [MaterialBottomNavigationDirective],\n exports: [MaterialBottomNavigationDirective]\n})\nexport class NativeScriptMaterialBottomNavigationModule {}\n\nregisterElement('MDBottomNavigation', () => BottomNavigation);\nregisterElement('MDTabStrip', () => TabStrip);\nregisterElement('MDTabStripItem', () => TabStripItem);\nregisterElement('MDTabContentItem', () => TabContentItem);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAKa,iCAAiC,CAAA
|
1
|
+
{"version":3,"file":"nativescript-community-ui-material-bottom-navigation-angular.mjs","sources":["../../../../src/bottom-navigation/angular/index.ts","../../../../src/bottom-navigation/angular/nativescript-community-ui-material-bottom-navigation-angular.ts"],"sourcesContent":["import { Directive, NgModule } from '@angular/core';\nimport { registerElement } from '@nativescript/angular';\nimport { BottomNavigation, TabContentItem, TabStrip, TabStripItem } from '@nativescript-community/ui-material-bottom-navigation';\n\n@Directive({ selector: 'MDBottomNavigation' })\nexport class MaterialBottomNavigationDirective {}\n\n@NgModule({\n declarations: [MaterialBottomNavigationDirective],\n exports: [MaterialBottomNavigationDirective]\n})\nexport class NativeScriptMaterialBottomNavigationModule {}\n\nregisterElement('MDBottomNavigation', () => BottomNavigation);\nregisterElement('MDTabStrip', () => TabStrip);\nregisterElement('MDTabStripItem', () => TabStripItem);\nregisterElement('MDTabContentItem', () => TabContentItem);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAKa,iCAAiC,CAAA;2FAAjC,iCAAiC,GAAA,CAAA,EAAA,CAAA;6DAAjC,iCAAiC,EAAA,SAAA,EAAA,CAAA,CAAA,oBAAA,CAAA,CAAA,EAAA,CAAA,CAAA;;uFAAjC,iCAAiC,EAAA,CAAA;cAD7C,SAAS;eAAC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAA;;MAOhC,0CAA0C,CAAA;oGAA1C,0CAA0C,GAAA,CAAA,EAAA,CAAA;4DAA1C,0CAA0C,EAAA,CAAA,CAAA;;;uFAA1C,0CAA0C,EAAA,CAAA;cAJtD,QAAQ;AAAC,QAAA,IAAA,EAAA,CAAA;gBACN,YAAY,EAAE,CAAC,iCAAiC,CAAC;gBACjD,OAAO,EAAE,CAAC,iCAAiC,CAAC;AAC/C,aAAA,CAAA;;wFACY,0CAA0C,EAAA,EAAA,YAAA,EAAA,CAN1C,iCAAiC,CAAA,EAAA,OAAA,EAAA,CAAjC,iCAAiC,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;AAQ9C,eAAe,CAAC,oBAAoB,EAAE,MAAM,gBAAgB,CAAC,CAAC;AAC9D,eAAe,CAAC,YAAY,EAAE,MAAM,QAAQ,CAAC,CAAC;AAC9C,eAAe,CAAC,gBAAgB,EAAE,MAAM,YAAY,CAAC,CAAC;AACtD,eAAe,CAAC,kBAAkB,EAAE,MAAM,cAAc,CAAC;;AChBzD;;AAEG;;;;"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class MaterialBottomNavigationDirective {
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialBottomNavigationDirective, never>;
|
4
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MaterialBottomNavigationDirective, "MDBottomNavigation", never, {}, {}, never, never, false, never>;
|
5
|
+
}
|
6
|
+
export declare class NativeScriptMaterialBottomNavigationModule {
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptMaterialBottomNavigationModule, never>;
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NativeScriptMaterialBottomNavigationModule, [typeof MaterialBottomNavigationDirective], never, [typeof MaterialBottomNavigationDirective]>;
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NativeScriptMaterialBottomNavigationModule>;
|
10
|
+
}
|
package/angular/package.json
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-material-bottom-navigation-angular",
|
3
3
|
"main": "index.js",
|
4
|
-
"module": "
|
5
|
-
"es2020": "fesm2020/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
6
|
-
"esm2020": "esm2020/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
7
|
-
"fesm2020": "fesm2020/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
8
|
-
"fesm2015": "fesm2015/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
4
|
+
"module": "fesm2022/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
9
5
|
"typings": "index.d.ts",
|
10
6
|
"exports": {
|
11
7
|
"./package.json": {
|
@@ -13,11 +9,9 @@
|
|
13
9
|
},
|
14
10
|
".": {
|
15
11
|
"types": "./index.d.ts",
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"node": "./fesm2015/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
20
|
-
"default": "./fesm2020/nativescript-community-ui-material-bottom-navigation-angular.mjs"
|
12
|
+
"esm2022": "./esm2022/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
13
|
+
"esm": "./esm2022/nativescript-community-ui-material-bottom-navigation-angular.mjs",
|
14
|
+
"default": "./fesm2022/nativescript-community-ui-material-bottom-navigation-angular.mjs"
|
21
15
|
}
|
22
16
|
},
|
23
17
|
"sideEffects": false,
|
@@ -0,0 +1,30 @@
|
|
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
|
+
import { Color } from '@nativescript/core';
|
7
|
+
export { TabContentItem, TabStrip, TabStripItem };
|
8
|
+
interface BottomNavigationBar extends com.nativescript.material.core.BottomNavigationBar {
|
9
|
+
new (context: android.content.Context, owner: BottomNavigation): BottomNavigationBar;
|
10
|
+
}
|
11
|
+
declare let BottomNavigationBar: BottomNavigationBar;
|
12
|
+
export declare class BottomNavigation extends TabNavigation<com.nativescript.material.core.BottomNavigationBar> {
|
13
|
+
tabsPosition: TabsPosition;
|
14
|
+
animationEnabled: boolean;
|
15
|
+
swipeEnabled: boolean;
|
16
|
+
protected updateTabsBarItemAt(position: number, itemSpec: com.nativescript.material.core.TabItemSpec): void;
|
17
|
+
protected setTabsBarSelectedIndicatorColors(colors: number[]): void;
|
18
|
+
protected getTabBarItemView(index: number): globalAndroid.widget.LinearLayout;
|
19
|
+
protected getTabBarItemTextView(index: number): globalAndroid.widget.TextView;
|
20
|
+
protected createNativeTabBar(context: android.content.Context): BottomNavigationBar;
|
21
|
+
protected setTabBarItems(tabItems: com.nativescript.material.core.TabItemSpec[]): void;
|
22
|
+
protected selectTabBar(oldIndex: number, newIndex: number): void;
|
23
|
+
onLoaded(): void;
|
24
|
+
updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec): void;
|
25
|
+
setTabBarBackgroundColor(value: android.graphics.drawable.Drawable | Color): void;
|
26
|
+
_setItemsColors(items: TabStripItem[]): void;
|
27
|
+
setTabBarSelectedItemColor(value: Color): void;
|
28
|
+
setTabBarUnSelectedItemColor(value: Color): void;
|
29
|
+
onTabsBarSelectedPositionChange(position: number, prevPosition: number): void;
|
30
|
+
}
|
package/index.android.js
ADDED
@@ -0,0 +1,140 @@
|
|
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
|
+
import { CSSType, Color, Utils } from '@nativescript/core';
|
7
|
+
export { TabContentItem, TabStrip, TabStripItem };
|
8
|
+
// eslint-disable-next-line no-redeclare
|
9
|
+
let BottomNavigationBar;
|
10
|
+
function initializeNativeClasses() {
|
11
|
+
if (BottomNavigationBar) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
var BottomNavigationBarImplementation = /** @class */ (function (_super) {
|
15
|
+
__extends(BottomNavigationBarImplementation, _super);
|
16
|
+
function BottomNavigationBarImplementation(context, owner) {
|
17
|
+
var _this = _super.call(this, context) || this;
|
18
|
+
_this.owner = owner;
|
19
|
+
return global.__native(_this);
|
20
|
+
}
|
21
|
+
BottomNavigationBarImplementation.prototype.onSelectedPositionChange = function (position, prevPosition) {
|
22
|
+
var owner = this.owner;
|
23
|
+
if (!owner) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
owner.onTabsBarSelectedPositionChange(position, prevPosition);
|
27
|
+
};
|
28
|
+
BottomNavigationBarImplementation.prototype.onTap = function (position) {
|
29
|
+
var owner = this.owner;
|
30
|
+
if (!owner) {
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
return owner.onTabsBarTap(position);
|
34
|
+
};
|
35
|
+
return BottomNavigationBarImplementation;
|
36
|
+
}(com.nativescript.material.core.BottomNavigationBar));
|
37
|
+
BottomNavigationBar = BottomNavigationBarImplementation;
|
38
|
+
}
|
39
|
+
let BottomNavigation = class BottomNavigation extends TabNavigation {
|
40
|
+
constructor() {
|
41
|
+
super(...arguments);
|
42
|
+
this.tabsPosition = TabsPosition.Bottom;
|
43
|
+
this.animationEnabled = false;
|
44
|
+
this.swipeEnabled = false;
|
45
|
+
}
|
46
|
+
updateTabsBarItemAt(position, itemSpec) {
|
47
|
+
this.mTabsBar.updateItemAt(position, itemSpec);
|
48
|
+
}
|
49
|
+
setTabsBarSelectedIndicatorColors(colors) {
|
50
|
+
// nothing to do
|
51
|
+
}
|
52
|
+
getTabBarItemView(index) {
|
53
|
+
return this.mTabsBar.getViewForItemAt(index);
|
54
|
+
}
|
55
|
+
getTabBarItemTextView(index) {
|
56
|
+
return this.mTabsBar.getTextViewForItemAt(index);
|
57
|
+
}
|
58
|
+
createNativeTabBar(context) {
|
59
|
+
initializeNativeClasses();
|
60
|
+
const tabsBar = new BottomNavigationBar(context, this);
|
61
|
+
const primaryColor = Utils.android.resources.getPaletteColor(PRIMARY_COLOR, context);
|
62
|
+
if (primaryColor) {
|
63
|
+
tabsBar.setBackgroundColor(primaryColor);
|
64
|
+
}
|
65
|
+
tabsBar.setSelectedPosition(this.selectedIndex);
|
66
|
+
return tabsBar;
|
67
|
+
}
|
68
|
+
setTabBarItems(tabItems) {
|
69
|
+
this.mTabsBar.setItems(tabItems);
|
70
|
+
}
|
71
|
+
selectTabBar(oldIndex, newIndex) {
|
72
|
+
this.mTabsBar.setSelectedPosition(newIndex);
|
73
|
+
}
|
74
|
+
onLoaded() {
|
75
|
+
super.onLoaded();
|
76
|
+
if (!this.tabStrip && this.mTabsBar) {
|
77
|
+
// manually set the visibility, so that the grid layout remeasures
|
78
|
+
this.mTabsBar.setVisibility(android.view.View.GONE);
|
79
|
+
}
|
80
|
+
// if (this._attachedToWindow) {
|
81
|
+
// this.changeTab(this.selectedIndex);
|
82
|
+
// }
|
83
|
+
}
|
84
|
+
// _onAttachedToWindow(): void {
|
85
|
+
// super._onAttachedToWindow();
|
86
|
+
// // this.changeTab(this.selectedIndex);
|
87
|
+
// }
|
88
|
+
updateAndroidItemAt(index, spec) {
|
89
|
+
// that try catch is fix for an android NPE error on css change which navigated in (not the current fragment)
|
90
|
+
try {
|
91
|
+
if (this.mTabsBar) {
|
92
|
+
this.mTabsBar.updateItemAt(index, spec);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
catch (err) { }
|
96
|
+
}
|
97
|
+
setTabBarBackgroundColor(value) {
|
98
|
+
super.setTabBarBackgroundColor(value);
|
99
|
+
// this.updateTabStripItems();
|
100
|
+
}
|
101
|
+
// private updateTabStripItems(): void {
|
102
|
+
// this.tabStrip.items.forEach((tabStripItem: TabStripItem) => {
|
103
|
+
// if (tabStripItem.nativeView) {
|
104
|
+
// const tabItemSpec = this.createTabItemSpec(tabStripItem);
|
105
|
+
// this.updateAndroidItemAt(tabStripItem._index, tabItemSpec);
|
106
|
+
// }
|
107
|
+
// });
|
108
|
+
// }
|
109
|
+
_setItemsColors(items) {
|
110
|
+
items.forEach((item) => {
|
111
|
+
if (item.nativeView) {
|
112
|
+
this._setItemColor(item);
|
113
|
+
}
|
114
|
+
});
|
115
|
+
}
|
116
|
+
setTabBarSelectedItemColor(value) {
|
117
|
+
super.setTabBarSelectedItemColor(value);
|
118
|
+
this._setItemsColors(this.tabStrip.items);
|
119
|
+
}
|
120
|
+
setTabBarUnSelectedItemColor(value) {
|
121
|
+
super.setTabBarUnSelectedItemColor(value);
|
122
|
+
this._setItemsColors(this.tabStrip.items);
|
123
|
+
}
|
124
|
+
onTabsBarSelectedPositionChange(position, prevPosition) {
|
125
|
+
this.mViewPager.setCurrentItem(position, this.animationEnabled);
|
126
|
+
const tabStripItems = this.tabStrip && this.tabStrip.items;
|
127
|
+
if (position >= 0 && tabStripItems && tabStripItems[position]) {
|
128
|
+
tabStripItems[position]._emit(TabStripItem.selectEvent);
|
129
|
+
}
|
130
|
+
if (prevPosition >= 0 && tabStripItems && tabStripItems[prevPosition]) {
|
131
|
+
tabStripItems[prevPosition]._emit(TabStripItem.unselectEvent);
|
132
|
+
}
|
133
|
+
this._setItemsColors(this.tabStrip.items);
|
134
|
+
}
|
135
|
+
};
|
136
|
+
BottomNavigation = __decorate([
|
137
|
+
CSSType('BottomNavigation')
|
138
|
+
], BottomNavigation);
|
139
|
+
export { BottomNavigation };
|
140
|
+
//# sourceMappingURL=index.android.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.android.js","sourceRoot":"../src/","sources":["index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gEAAgE,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4EAA4E,CAAC;AAC1H,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,2EAA2E,CAAC;AACzJ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AAMlD,wCAAwC;AACxC,IAAI,mBAAwC,CAAC;AAE7C,SAAS,uBAAuB;IAC5B,IAAI,mBAAmB,EAAE;QACrB,OAAO;KACV;;;;;;;;;;;;;;;;;;;;;;;;IA2BD,mBAAmB,GAAG,iCAAwC,CAAC;AACnE,CAAC;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAi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,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAEe,+BAA+B,CAAC,QAAgB,EAAE,YAAoB;QAClF,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAE3D,IAAI,QAAQ,IAAI,CAAC,IAAI,aAAa,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;YAC3D,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;SAC3D;QAED,IAAI,YAAY,IAAI,CAAC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE;YACnE,aAAa,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;SACjE;QAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;CACJ,CAAA;AA5GY,gBAAgB;IAD5B,OAAO,CAAC,kBAAkB,CAAC;GACf,gBAAgB,CA4G5B;SA5GY,gBAAgB"}
|
package/index.d.ts
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
/**
|
2
|
+
* Material BottomNavigation component
|
3
|
+
* @module @nativescript-community/ui-material-bottom-navigation
|
4
|
+
*/
|
5
|
+
|
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
|
+
import { CoercibleProperty, EventData, Property } from '@nativescript/core';
|
10
|
+
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
|
11
|
+
|
12
|
+
export { TabContentItem, TabStrip, TabStripItem };
|
13
|
+
/**
|
14
|
+
* Defines the data for the TabView.selectedIndexChanged event.
|
15
|
+
*/
|
16
|
+
export interface SelectedIndexChangedEventData extends EventData {
|
17
|
+
/**
|
18
|
+
* The old selected index.
|
19
|
+
*/
|
20
|
+
oldIndex: number;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* The new selected index.
|
24
|
+
*/
|
25
|
+
newIndex: number;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Represents a tab navigation widget with static tabs at the bottom.
|
30
|
+
*/
|
31
|
+
export class BottomNavigation extends TabNavigationBase {
|
32
|
+
/**
|
33
|
+
* Gets or sets the items of the BottomNavigation.
|
34
|
+
*/
|
35
|
+
items: TabContentItem[];
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Gets or sets the tab strip of the BottomNavigation.
|
39
|
+
*/
|
40
|
+
tabStrip: TabStrip;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Gets or sets the selectedIndex of the BottomNavigation.
|
44
|
+
*/
|
45
|
+
selectedIndex: number;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Allow custom positioning of Tabs within another view
|
49
|
+
*/
|
50
|
+
public iosCustomPositioning?: boolean;
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Gets the native [android widget](http://developer.android.com/reference/android/support/v4/view/ViewPager.html) that represents the user interface for this component. Valid only when running on Android OS.
|
54
|
+
*/
|
55
|
+
android: any /* android.view.View */; //android.support.v4.view.ViewPager;
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Gets the native iOS [UITabBarController](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/) that represents the user interface for this component. Valid only when running on iOS.
|
59
|
+
*/
|
60
|
+
ios: any /* UITabBarController */;
|
61
|
+
|
62
|
+
/**
|
63
|
+
* String value used when hooking to the selectedIndexChanged event.
|
64
|
+
*/
|
65
|
+
public static selectedIndexChangedEvent: string;
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @hidden
|
69
|
+
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
|
70
|
+
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
|
71
|
+
* @param callback - Callback function which will be executed when event is raised.
|
72
|
+
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
|
73
|
+
*/
|
74
|
+
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Raised when the selected index changes.
|
78
|
+
*/
|
79
|
+
on(event: 'selectedIndexChanged', callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any);
|
80
|
+
|
81
|
+
// parameter to allow the bottom-navigation to be positioned correcly within layouts and thus not be full size
|
82
|
+
// be careful it will then be influenced by safeArea. Default is false
|
83
|
+
iosCustomPositioning: boolean;
|
84
|
+
}
|
85
|
+
|
86
|
+
export const itemsProperty: Property<BottomNavigation, TabContentItem[]>;
|
87
|
+
export const tabStripProperty: Property<BottomNavigation, TabStrip>;
|
88
|
+
export const selectedIndexProperty: CoercibleProperty<BottomNavigation, number>;
|
package/index.ios.d.ts
ADDED
@@ -0,0 +1,68 @@
|
|
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
|
+
import { Color, CoreTypes, Font, Property } from '@nativescript/core';
|
7
|
+
export { TabContentItem, TabStrip, TabStripItem };
|
8
|
+
declare class MDTabBarControllerImpl extends UITabBarController {
|
9
|
+
private _owner;
|
10
|
+
static initWithOwner(owner: WeakRef<BottomNavigation>): MDTabBarControllerImpl;
|
11
|
+
viewWillAppear(animated: boolean): void;
|
12
|
+
viewDidDisappear(animated: boolean): void;
|
13
|
+
viewWillTransitionToSizeWithTransitionCoordinator(size: CGSize, coordinator: UIViewControllerTransitionCoordinator): void;
|
14
|
+
traitCollectionDidChange(previousTraitCollection: UITraitCollection): void;
|
15
|
+
}
|
16
|
+
export declare const iosCustomPositioningProperty: Property<BottomNavigation, boolean>;
|
17
|
+
export declare class BottomNavigation extends TabNavigationBase {
|
18
|
+
tabsPosition: TabsPosition;
|
19
|
+
viewController: MDTabBarControllerImpl;
|
20
|
+
items: TabContentItem[];
|
21
|
+
private mDelegate;
|
22
|
+
private mMoreNavigationControllerDelegate;
|
23
|
+
private mIconsCache;
|
24
|
+
private mSelectedItemColor;
|
25
|
+
private mUnSelectedItemColor;
|
26
|
+
iosCustomPositioning: boolean;
|
27
|
+
constructor();
|
28
|
+
createNativeView(): UIView;
|
29
|
+
initNativeView(): void;
|
30
|
+
disposeNativeView(): void;
|
31
|
+
onLoaded(): void;
|
32
|
+
onUnloaded(): void;
|
33
|
+
get ios(): UITabBarController;
|
34
|
+
layoutNativeView(left: number, top: number, right: number, bottom: number): void;
|
35
|
+
_setNativeViewFrame(nativeView: UIView, frame: CGRect): void;
|
36
|
+
onSelectedIndexChanged(oldIndex: number, newIndex: number): void;
|
37
|
+
getTabBarBackgroundColor(): UIColor;
|
38
|
+
setTabBarBackgroundColor(value: UIColor | Color): void;
|
39
|
+
setTabBarItemTitle(tabStripItem: TabStripItem, value: string): void;
|
40
|
+
setTabBarItemBackgroundColor(tabStripItem: TabStripItem, value: UIColor | Color): void;
|
41
|
+
setTabBarItemColor(tabStripItem: TabStripItem, value: UIColor | Color): void;
|
42
|
+
private setItemColors;
|
43
|
+
private setIconColor;
|
44
|
+
setTabBarIconColor(tabStripItem: TabStripItem, value: UIColor | Color): void;
|
45
|
+
setTabBarIconSource(tabStripItem: TabStripItem, value: UIColor | Color): void;
|
46
|
+
setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void;
|
47
|
+
setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void;
|
48
|
+
getTabBarHighlightColor(): UIColor;
|
49
|
+
setTabBarHighlightColor(value: UIColor | Color): void;
|
50
|
+
getTabBarSelectedItemColor(): Color;
|
51
|
+
setTabBarSelectedItemColor(value: Color): void;
|
52
|
+
getTabBarUnSelectedItemColor(): Color;
|
53
|
+
setTabBarUnSelectedItemColor(value: Color): void;
|
54
|
+
onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
|
55
|
+
_onViewControllerShown(viewController: UIViewController): void;
|
56
|
+
private _actionBarHiddenByTabView;
|
57
|
+
_handleTwoNavigationBars(backToMoreWillBeVisible: boolean): void;
|
58
|
+
private getViewController;
|
59
|
+
private setViewControllers;
|
60
|
+
private setItemImages;
|
61
|
+
updateAllItemsColors(): void;
|
62
|
+
private updateItemColors;
|
63
|
+
private createTabBarItem;
|
64
|
+
private getIconRenderingMode;
|
65
|
+
private getIcon;
|
66
|
+
private getFixedSizeIcon;
|
67
|
+
private setViewAttributes;
|
68
|
+
}
|