nativescript-bottom-navigation
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,11 +0,25 @@ | ||
export declare class BottomNavigationDirective { | ||
import { AfterViewInit, ElementRef } from "@angular/core"; | ||
import { BottomNavigation, BottomNavigationTab } from '../'; | ||
export declare class BottomNavigationDirective implements AfterViewInit { | ||
bottomNavigation: BottomNavigation; | ||
private _viewInitialized; | ||
constructor(element: ElementRef); | ||
private _activeColor; | ||
activeColor: string; | ||
private _inactiveColor; | ||
inactiveColor: string; | ||
private _backgroundColor; | ||
backgroundColor: string; | ||
tabs: any[]; | ||
private _tabs; | ||
tabs: BottomNavigationTab[]; | ||
private _selectedTabIndex; | ||
selectedTabIndex: number; | ||
ngAfterViewInit(): void; | ||
} | ||
export declare class BottomNavigationTabDirective { | ||
private _title; | ||
title: string; | ||
private _icon; | ||
icon: string; | ||
} | ||
export declare const DIRECTIVES: (typeof BottomNavigationDirective | typeof BottomNavigationTabDirective)[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var lang_facade_1 = require("nativescript-angular/lang-facade"); | ||
var BottomNavigationDirective = (function () { | ||
function BottomNavigationDirective() { | ||
function BottomNavigationDirective(element) { | ||
this.bottomNavigation = element.nativeElement; | ||
} | ||
Object.defineProperty(BottomNavigationDirective.prototype, "activeColor", { | ||
get: function () { | ||
return this._activeColor; | ||
}, | ||
set: function (value) { | ||
this._activeColor = value; | ||
if (this._viewInitialized) { | ||
this.bottomNavigation.activeColor = this._activeColor; | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BottomNavigationDirective.prototype, "inactiveColor", { | ||
get: function () { | ||
return this._inactiveColor; | ||
}, | ||
set: function (value) { | ||
this._inactiveColor = value; | ||
if (this._viewInitialized) { | ||
this.bottomNavigation.inactiveColor = this._inactiveColor; | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BottomNavigationDirective.prototype, "backgroundColor", { | ||
get: function () { | ||
return this._backgroundColor; | ||
}, | ||
set: function (value) { | ||
this._backgroundColor = value; | ||
if (this._viewInitialized) { | ||
this.bottomNavigation.backgroundColor = this._backgroundColor; | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BottomNavigationDirective.prototype, "tabs", { | ||
get: function () { | ||
return this._tabs; | ||
}, | ||
set: function (value) { | ||
this._tabs = value; | ||
if (this._viewInitialized) { | ||
this.bottomNavigation.tabs = this._tabs; | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BottomNavigationDirective.prototype, "selectedTabIndex", { | ||
get: function () { | ||
return this._selectedTabIndex; | ||
}, | ||
set: function (value) { | ||
this._selectedTabIndex = value; | ||
if (this._viewInitialized) { | ||
this.bottomNavigation.selectedTabIndex = this._selectedTabIndex; | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
BottomNavigationDirective.prototype.ngAfterViewInit = function () { | ||
this._viewInitialized = true; | ||
if (!lang_facade_1.isBlank(this._activeColor)) { | ||
this.bottomNavigation.activeColor = this._activeColor; | ||
} | ||
if (!lang_facade_1.isBlank(this._inactiveColor)) { | ||
this.bottomNavigation.inactiveColor = this._inactiveColor; | ||
} | ||
if (!lang_facade_1.isBlank(this._backgroundColor)) { | ||
this.bottomNavigation.backgroundColor = this._backgroundColor; | ||
} | ||
if (!lang_facade_1.isBlank(this._tabs)) { | ||
this.bottomNavigation.tabs = this._tabs; | ||
} | ||
if (!lang_facade_1.isBlank(this._selectedTabIndex)) { | ||
this.bottomNavigation.selectedTabIndex = this._selectedTabIndex; | ||
} | ||
}; | ||
return BottomNavigationDirective; | ||
@@ -11,20 +96,30 @@ }()); | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], BottomNavigationDirective.prototype, "activeColor", void 0); | ||
__metadata("design:type", String), | ||
__metadata("design:paramtypes", [String]) | ||
], BottomNavigationDirective.prototype, "activeColor", null); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], BottomNavigationDirective.prototype, "inactiveColor", void 0); | ||
__metadata("design:type", String), | ||
__metadata("design:paramtypes", [String]) | ||
], BottomNavigationDirective.prototype, "inactiveColor", null); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], BottomNavigationDirective.prototype, "backgroundColor", void 0); | ||
__metadata("design:type", String), | ||
__metadata("design:paramtypes", [String]) | ||
], BottomNavigationDirective.prototype, "backgroundColor", null); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", Array) | ||
], BottomNavigationDirective.prototype, "tabs", void 0); | ||
__metadata("design:type", Array), | ||
__metadata("design:paramtypes", [Array]) | ||
], BottomNavigationDirective.prototype, "tabs", null); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", Number), | ||
__metadata("design:paramtypes", [Number]) | ||
], BottomNavigationDirective.prototype, "selectedTabIndex", null); | ||
BottomNavigationDirective = __decorate([ | ||
core_1.Directive({ | ||
selector: "BottomNavigation" | ||
}) | ||
}), | ||
__metadata("design:paramtypes", [core_1.ElementRef]) | ||
], BottomNavigationDirective); | ||
@@ -35,2 +130,22 @@ exports.BottomNavigationDirective = BottomNavigationDirective; | ||
} | ||
Object.defineProperty(BottomNavigationTabDirective.prototype, "title", { | ||
get: function () { | ||
return this._title; | ||
}, | ||
set: function (value) { | ||
this._title = value; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BottomNavigationTabDirective.prototype, "icon", { | ||
get: function () { | ||
return this._icon; | ||
}, | ||
set: function (value) { | ||
this._icon = value; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return BottomNavigationTabDirective; | ||
@@ -40,8 +155,10 @@ }()); | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], BottomNavigationTabDirective.prototype, "title", void 0); | ||
__metadata("design:type", String), | ||
__metadata("design:paramtypes", [String]) | ||
], BottomNavigationTabDirective.prototype, "title", null); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], BottomNavigationTabDirective.prototype, "icon", void 0); | ||
__metadata("design:type", String), | ||
__metadata("design:paramtypes", [String]) | ||
], BottomNavigationTabDirective.prototype, "icon", null); | ||
BottomNavigationTabDirective = __decorate([ | ||
@@ -48,0 +165,0 @@ core_1.Directive({ |
@@ -5,3 +5,2 @@ import { BottomNavigationBase, BottomNavigationTabBase } from './bottom-navigation.common'; | ||
initNativeView(): void; | ||
onUnloaded(): void; | ||
readonly android: any; | ||
@@ -8,0 +7,0 @@ createTabs(tabs: BottomNavigationTab[]): void; |
@@ -42,6 +42,2 @@ "use strict"; | ||
}; | ||
BottomNavigation.prototype.onUnloaded = function () { | ||
this.nativeView = null; | ||
_super.prototype.onUnloaded.call(this); | ||
}; | ||
Object.defineProperty(BottomNavigation.prototype, "android", { | ||
@@ -48,0 +44,0 @@ get: function () { |
@@ -34,3 +34,4 @@ "use strict"; | ||
exports.tabsProperty = new properties_1.Property({ | ||
name: 'tabs' | ||
name: 'tabs', | ||
equalityComparer: function (a, b) { return !a && !b && a.length === b.length; } | ||
}); | ||
@@ -37,0 +38,0 @@ exports.tabsProperty.register(BottomNavigationBase); |
@@ -14,3 +14,2 @@ import { BottomNavigationBase, BottomNavigationTabBase } from './bottom-navigation.common'; | ||
onLoaded(): void; | ||
onUnloaded(): void; | ||
readonly ios: any; | ||
@@ -17,0 +16,0 @@ createTabs(tabs: BottomNavigationTab[]): void; |
@@ -31,4 +31,4 @@ "use strict"; | ||
BottomNavigation.prototype.createNativeView = function () { | ||
this._delegate = BottomNavigationDelegate.initWithOwner(new WeakRef(this)); | ||
this.nativeView = new MiniTabBar({ items: null }); | ||
this._delegate = BottomNavigationDelegate.initWithOwner(new WeakRef(this)); | ||
this.nativeView.frame = CGRectMake(0, platform_1.screen.mainScreen.heightDIPs - 56, platform_1.screen.mainScreen.widthDIPs, 56); | ||
@@ -50,6 +50,2 @@ return this.nativeView; | ||
}; | ||
BottomNavigation.prototype.onUnloaded = function () { | ||
this.nativeView.delegate = null; | ||
_super.prototype.onUnloaded.call(this); | ||
}; | ||
Object.defineProperty(BottomNavigation.prototype, "ios", { | ||
@@ -107,3 +103,3 @@ get: function () { | ||
BottomNavigation.prototype.selectTabNative = function (index) { | ||
this.nativeView.selectItem(index, true); | ||
this.nativeView.selectItemAnimated(index, true); | ||
}; | ||
@@ -110,0 +106,0 @@ return BottomNavigation; |
{ | ||
"name": "nativescript-bottom-navigation", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Nativescript plugin to add a bottom navigation component for Android & iOS", | ||
@@ -5,0 +5,0 @@ "main": "bottom-navigation", |
@@ -41,3 +41,3 @@ # Nativescript Bottom Navigation | ||
loaded="bottomNavigationLoaded" | ||
row="1"></bottomBar:BottomNavigation> | ||
row="1"></bottomNav:BottomNavigation> | ||
</GridLayout> | ||
@@ -99,3 +99,3 @@ </Page> | ||
<bottomNav:BottomNavigationTab title="Third" icon="ic_menu"></bottomNav:BottomNavigationTab> | ||
</bottomBar:BottomNavigation> | ||
</bottomNav:BottomNavigation> | ||
</GridLayout> | ||
@@ -154,3 +154,3 @@ </Page> | ||
backgroundColor="black" | ||
(tabSelected)="onBottomNavigationTabSelected" | ||
(tabSelected)="onBottomNavigationTabSelected($event)" | ||
row="1"></BottomNavigation> | ||
@@ -170,3 +170,3 @@ </GridLayout> | ||
backgroundColor="black" | ||
(tabSelected)="onBottomNavigationTabSelected" | ||
(tabSelected)="onBottomNavigationTabSelected($event)" | ||
row="1"> | ||
@@ -173,0 +173,0 @@ <BottomNavigationTab title="First" icon="ic_home"></BottomNavigationTab> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54057
648