@nativescript-community/ui-material-bottom-navigation 6.0.0
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 +438 -0
- package/LICENSE +201 -0
- package/README.md +320 -0
- package/angular/bundles/nativescript-community-ui-material-bottom-navigation-angular.umd.js +71 -0
- package/angular/bundles/nativescript-community-ui-material-bottom-navigation-angular.umd.min.js +2 -0
- package/angular/esm2015/index.js +30 -0
- package/angular/esm2015/nativescript-community-ui-material-bottom-navigation-angular.js +2 -0
- package/angular/fesm2015/nativescript-community-ui-material-bottom-navigation-angular.js +33 -0
- package/angular/index.d.ts +10 -0
- package/angular/nativescript-community-ui-material-bottom-navigation-angular.d.ts +2 -0
- package/angular/package.json +16 -0
- package/index.android.d.ts +69 -0
- package/index.android.js +819 -0
- package/index.d.ts +88 -0
- package/index.ios.d.ts +66 -0
- package/index.ios.js +636 -0
- package/package.json +56 -0
- package/platforms/ios/Podfile +1 -0
- package/pnpm-lock.yaml +90 -0
- package/react/index.d.ts +26 -0
- package/react/index.js +77 -0
- package/vue/component.d.ts +12 -0
- package/vue/component.js +22 -0
- package/vue/index.d.ts +4 -0
- package/vue/index.js +20 -0
package/pnpm-lock.yaml
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
dependencies:
|
2
|
+
'@nativescript-community/ui-material-core': 5.2.1
|
3
|
+
lockfileVersion: 5.2
|
4
|
+
packages:
|
5
|
+
/@nativescript-community/ui-material-core/5.2.1:
|
6
|
+
dependencies:
|
7
|
+
'@nativescript/hook': 2.0.0
|
8
|
+
dev: false
|
9
|
+
requiresBuild: true
|
10
|
+
resolution:
|
11
|
+
integrity: sha512-Nu0ujgzvpH4sN7Rebk3YsEcnbTR2uWXL+xy95gXflR42qa1YUVgMTXZJJm3sEcCEMKeneMODc8lpIrLOAf6mCg==
|
12
|
+
/@nativescript/hook/2.0.0:
|
13
|
+
dependencies:
|
14
|
+
glob: 7.1.6
|
15
|
+
mkdirp: 1.0.4
|
16
|
+
dev: false
|
17
|
+
resolution:
|
18
|
+
integrity: sha512-v3Hj3Zpd69sQJfFpDNXonV0EjO1a2OL4l48wlo1Ycsqk4r7RY822d/irFTjt0LllRG0OcdEGgfG6wKb0YgPyHw==
|
19
|
+
/balanced-match/1.0.0:
|
20
|
+
dev: false
|
21
|
+
resolution:
|
22
|
+
integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
23
|
+
/brace-expansion/1.1.11:
|
24
|
+
dependencies:
|
25
|
+
balanced-match: 1.0.0
|
26
|
+
concat-map: 0.0.1
|
27
|
+
dev: false
|
28
|
+
resolution:
|
29
|
+
integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
30
|
+
/concat-map/0.0.1:
|
31
|
+
dev: false
|
32
|
+
resolution:
|
33
|
+
integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
34
|
+
/fs.realpath/1.0.0:
|
35
|
+
dev: false
|
36
|
+
resolution:
|
37
|
+
integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
38
|
+
/glob/7.1.6:
|
39
|
+
dependencies:
|
40
|
+
fs.realpath: 1.0.0
|
41
|
+
inflight: 1.0.6
|
42
|
+
inherits: 2.0.4
|
43
|
+
minimatch: 3.0.4
|
44
|
+
once: 1.4.0
|
45
|
+
path-is-absolute: 1.0.1
|
46
|
+
dev: false
|
47
|
+
resolution:
|
48
|
+
integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
49
|
+
/inflight/1.0.6:
|
50
|
+
dependencies:
|
51
|
+
once: 1.4.0
|
52
|
+
wrappy: 1.0.2
|
53
|
+
dev: false
|
54
|
+
resolution:
|
55
|
+
integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
|
56
|
+
/inherits/2.0.4:
|
57
|
+
dev: false
|
58
|
+
resolution:
|
59
|
+
integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
60
|
+
/minimatch/3.0.4:
|
61
|
+
dependencies:
|
62
|
+
brace-expansion: 1.1.11
|
63
|
+
dev: false
|
64
|
+
resolution:
|
65
|
+
integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
66
|
+
/mkdirp/1.0.4:
|
67
|
+
dev: false
|
68
|
+
engines:
|
69
|
+
node: '>=10'
|
70
|
+
hasBin: true
|
71
|
+
resolution:
|
72
|
+
integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
73
|
+
/once/1.4.0:
|
74
|
+
dependencies:
|
75
|
+
wrappy: 1.0.2
|
76
|
+
dev: false
|
77
|
+
resolution:
|
78
|
+
integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
79
|
+
/path-is-absolute/1.0.1:
|
80
|
+
dev: false
|
81
|
+
engines:
|
82
|
+
node: '>=0.10.0'
|
83
|
+
resolution:
|
84
|
+
integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
85
|
+
/wrappy/1.0.2:
|
86
|
+
dev: false
|
87
|
+
resolution:
|
88
|
+
integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
89
|
+
specifiers:
|
90
|
+
'@nativescript-community/ui-material-core': ^5.2.1
|
package/react/index.d.ts
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
import { NativeScriptProps } from 'react-nativescript';
|
2
|
+
import { BottomNavigation, SelectedIndexChangedEventData, TabContentItem, TabStrip } from '../';
|
3
|
+
import { TabNavigationBaseAttributes } from '@nativescript-community/ui-material-core/tab-navigation-base/react';
|
4
|
+
export declare type BottomNavigationAttributes = TabNavigationBaseAttributes & {
|
5
|
+
android?: any;
|
6
|
+
ios?: any;
|
7
|
+
items?: TabContentItem[];
|
8
|
+
onSelectedIndexChanged?: (args: SelectedIndexChangedEventData) => void;
|
9
|
+
selectedIndex?: number;
|
10
|
+
tabStrip?: TabStrip;
|
11
|
+
};
|
12
|
+
declare global {
|
13
|
+
module JSX {
|
14
|
+
interface IntrinsicElements {
|
15
|
+
bottomNavigation: NativeScriptProps<BottomNavigationAttributes, BottomNavigation>;
|
16
|
+
}
|
17
|
+
interface ElementChildrenAttribute {
|
18
|
+
children: {};
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
interface RegisterBottomNavigationOptions {
|
23
|
+
enableDebugLogging?: boolean;
|
24
|
+
}
|
25
|
+
export declare function registerBottomNavigation(opts?: RegisterBottomNavigationOptions): void;
|
26
|
+
export {};
|
package/react/index.js
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
import { registerElement } from 'react-nativescript';
|
2
|
+
import { warn } from 'react-nativescript/dist/shared/Logger';
|
3
|
+
import { BottomNavigation, TabContentItem, TabStrip } from '../';
|
4
|
+
let installed = false;
|
5
|
+
export function registerBottomNavigation(opts = {}) {
|
6
|
+
const { enableDebugLogging = false } = opts;
|
7
|
+
if (installed) {
|
8
|
+
return;
|
9
|
+
}
|
10
|
+
registerElement('bottomNavigation', () => BottomNavigation, {
|
11
|
+
nodeOps: {
|
12
|
+
insert(child, parent, atIndex) {
|
13
|
+
const bottomNavigation = parent.nativeView;
|
14
|
+
if (child.nodeRole === 'tabStrip') {
|
15
|
+
if (child.nativeView instanceof TabStrip) {
|
16
|
+
bottomNavigation.tabStrip = child.nativeView;
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
if (enableDebugLogging) {
|
20
|
+
warn(`Unable to add child "${child.nativeView.constructor.name}" as the tabStrip of <bottomNavigation> as it is not an instance of TabStrip.`);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
else if (child.nodeRole === 'items') {
|
25
|
+
if (child.nativeView instanceof TabContentItem === false) {
|
26
|
+
if (enableDebugLogging) {
|
27
|
+
warn(`Unable to add child "${child.nativeView.constructor.name}" to the items of <bottomNavigation> as it is not an instance of TabContentItem.`);
|
28
|
+
}
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
const items = bottomNavigation.items || [];
|
32
|
+
if (typeof atIndex === 'undefined' || atIndex === items.length) {
|
33
|
+
bottomNavigation._addChildFromBuilder('items', child.nativeView);
|
34
|
+
}
|
35
|
+
else {
|
36
|
+
const itemsClone = items.slice();
|
37
|
+
itemsClone.splice(atIndex, 0, child.nativeView);
|
38
|
+
bottomNavigation.items = itemsClone;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
else if (child.nodeRole === 'item') {
|
42
|
+
if (enableDebugLogging) {
|
43
|
+
warn(`Unable to add child "${child.nativeView.constructor.name}" to <bottomNavigation> as it had the nodeRole "item"; please correct it to "items".`);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
if (enableDebugLogging) {
|
48
|
+
warn(`Unable to add child "${child.nativeView.constructor.name}" to <bottomNavigation> as it does not have a nodeRole specified; ` +
|
49
|
+
'please set a nodeRole of "tabStrip", or "items".');
|
50
|
+
}
|
51
|
+
}
|
52
|
+
},
|
53
|
+
remove(child, parent) {
|
54
|
+
const tabs = parent.nativeView;
|
55
|
+
if (child.nodeRole === 'tabStrip') {
|
56
|
+
tabs.tabStrip = null;
|
57
|
+
}
|
58
|
+
else if (child.nodeRole === 'items') {
|
59
|
+
tabs.items = (tabs.items || []).filter((i) => i !== child.nativeView);
|
60
|
+
}
|
61
|
+
else if (child.nodeRole === 'item') {
|
62
|
+
if (enableDebugLogging) {
|
63
|
+
warn(`Unable to remove child "${child.nativeView.constructor.name}" from <bottomNavigation> as it had the nodeRole "item"; please correct it to "items".`);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
if (enableDebugLogging) {
|
68
|
+
warn(`Unable to remove child "${child.nativeView.constructor.name}" from <bottomNavigation> as it does not have a nodeRole specified; ` +
|
69
|
+
'please set a nodeRole of "tabStrip", or "items"');
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
});
|
75
|
+
installed = true;
|
76
|
+
}
|
77
|
+
//# sourceMappingURL=index.js.map
|
package/vue/component.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
export default {
|
2
|
+
model: {
|
3
|
+
prop: 'selectedIndex',
|
4
|
+
event: 'selectedIndexChange'
|
5
|
+
},
|
6
|
+
render(h) {
|
7
|
+
return h('NativeMDBottomNavigation', {
|
8
|
+
on: this.$listeners,
|
9
|
+
attrs: this.$attrs
|
10
|
+
}, this.$slots.default);
|
11
|
+
},
|
12
|
+
methods: {
|
13
|
+
registerTabStrip(tabStrip) {
|
14
|
+
this.$el.setAttribute('tabStrip', tabStrip);
|
15
|
+
},
|
16
|
+
registerTabContentItem(tabContentItem) {
|
17
|
+
const items = this.$el.nativeView.items || [];
|
18
|
+
this.$el.setAttribute('items', items.concat([tabContentItem]));
|
19
|
+
}
|
20
|
+
}
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=component.js.map
|
package/vue/index.d.ts
ADDED
package/vue/index.js
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import { BottomNavigation, TabContentItem, TabStrip, TabStripItem } from '../';
|
2
|
+
let installed = false;
|
3
|
+
export default {
|
4
|
+
install(Vue) {
|
5
|
+
if (!installed) {
|
6
|
+
installed = true;
|
7
|
+
Vue.registerElement('MDBottomNavigation', () => BottomNavigation, {
|
8
|
+
model: {
|
9
|
+
prop: 'selectedIndex',
|
10
|
+
event: 'selectedIndexChange'
|
11
|
+
},
|
12
|
+
component: require('./component').default
|
13
|
+
});
|
14
|
+
Vue.registerElement('MDTabContentItem', () => TabContentItem, {});
|
15
|
+
Vue.registerElement('MDTabStripItem', () => TabStripItem, {});
|
16
|
+
Vue.registerElement('MDTabStrip', () => TabStrip, {});
|
17
|
+
}
|
18
|
+
}
|
19
|
+
};
|
20
|
+
//# sourceMappingURL=index.js.map
|