-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixes for bottom-navigation and tabs
- Loading branch information
1 parent
ea44b7e
commit 89fb903
Showing
20 changed files
with
406 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Directive, NgModule } from '@angular/core'; | ||
import { registerElement } from '@nativescript/angular'; | ||
import { BottomNavigation } from '@nativescript-community/ui-material-bottomnavigation'; | ||
|
||
@Directive({ selector: 'MDBottomNavigation' }) | ||
export class MaterialBottomNavigationDirective {} | ||
|
||
@NgModule({ | ||
declarations: [MaterialBottomNavigationDirective], | ||
exports: [MaterialBottomNavigationDirective] | ||
}) | ||
export class NativeScriptMaterialBottomNavigationModule {} | ||
|
||
registerElement('MDBottomNavigation', () => BottomNavigation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@nativescript-community/ui-material-bottomnavigation-angular", | ||
"main": "index.js", | ||
"ngPackage": { | ||
"dest":"../../../packages/bottomnavigation/angular", | ||
"lib": { | ||
"entryFile": "index.ts", | ||
"umdModuleIds": { | ||
"@nativescript/core": "ns-core", | ||
"@nativescript/angular": "ns-angular", | ||
"@nativescript-community/ui-material-bottomnavigation": "ns-material-bottomnavigation" | ||
} | ||
}, | ||
"whitelistedNonPeerDependencies": [ | ||
"." | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"paths": { | ||
"tns-core-modules": ["./node_modules/@nativescript/core"], | ||
"tns-core-modules/*": ["./node_modules/@nativescript/core/*"], | ||
"@nativescript-community/ui-material-core": ["packages/core/index"], | ||
"@nativescript-community/ui-material-core/*": ["packages/core/*"], | ||
"@nativescript-community/ui-material-bottomnavigation": ["packages/bottomnavigation/index"], | ||
"@nativescript-community/ui-material-bottomnavigation/*": ["packages/bottomnavigation/*"] | ||
} | ||
}, | ||
"include": ["./**/*.ts", "../../../references.d.ts", "../../references.d.ts"], | ||
"angularCompilerOptions": { | ||
"enableIvy": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export default { | ||
model: { | ||
prop: 'selectedIndex', | ||
event: 'selectedIndexChange' | ||
}, | ||
|
||
render(h) { | ||
return h( | ||
'NativeMDBottomNavigation', | ||
{ | ||
on: this.$listeners, | ||
attrs: this.$attrs | ||
}, | ||
this.$slots.default | ||
); | ||
}, | ||
|
||
methods: { | ||
registerTabStrip(tabStrip) { | ||
this.$el.setAttribute('tabStrip', tabStrip); | ||
}, | ||
registerTabContentItem(tabContentItem) { | ||
const items = this.$el.nativeView.items || []; | ||
|
||
this.$el.setAttribute('items', items.concat([tabContentItem])); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { BottomNavigation, TabContentItem, TabStrip, TabStripItem } from '../'; | ||
|
||
let installed = false; | ||
|
||
export default { | ||
install(Vue) { | ||
if (!installed) { | ||
installed = true; | ||
Vue.registerElement('MDBottomNavigation', () => BottomNavigation, { | ||
model: { | ||
prop: 'selectedIndex', | ||
event: 'selectedIndexChange' | ||
}, | ||
component: require('./component').default | ||
}); | ||
Vue.registerElement('MDTabContentItem', () => TabContentItem, {}); | ||
Vue.registerElement('MDTabStripItem', () => TabStripItem, {}); | ||
Vue.registerElement('MDTabStrip', () => TabStrip, {}); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.