@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/README.md ADDED
@@ -0,0 +1,320 @@
1
+ # NativeScript Material Bottom navigation
2
+
3
+ Material Design's [Bottom navigation](https://material.io/components/bottom-navigation) component for NativeScript.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@nativescript-community/ui-material-bottom-navigation.svg)](https://www.npmjs.com/package/@nativescript-community/ui-material-bottom-navigation)
6
+ [![npm](https://img.shields.io/npm/dt/@nativescript-community/ui-material-bottom-navigation.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/ui-material-bottom-navigation)
7
+
8
+ ## Contents
9
+
10
+ 1. [Installation](#installation)
11
+ 2. [Changelog](#changelog)
12
+ 3. [FAQ](#faq)
13
+ 4. [Usage](#usage)
14
+ - [Plain NativeScript](#plain-nativescript)
15
+ - [Angular](#nativescript--angular)
16
+ - [Vue](#nativescript--vue)
17
+ - [React](#nativescript--react)
18
+ 5. [API](#api)
19
+
20
+ ## Installation
21
+
22
+ ### :warning: Warning :warning:
23
+ From NativeScript 5.x using this component will break the [NativeScript tab component](https://docs.nativescript.org/ui/components/tabs) on iOS (which is bound to be removed). This is needed to allow using the latest native iOS features. If needed you can use either [bottomnavigationbar](https://www.npmjs.com/package/@nativescript-community/ui-material-bottomnavigationbar) (this one is the best choice, closest to material design) or [material-tabs](https://www.npmjs.com/package/@nativescript-community/ui-material-tabs) (clone of the NativeScript one, but with a little less features).
24
+
25
+ ##
26
+
27
+ ```bash
28
+ ns plugin add @nativescript-community/ui-material-bottom-navigation
29
+ ```
30
+
31
+ Be sure to run a new build after adding plugins to avoid any issues.
32
+
33
+ ## [Changelog](./CHANGELOG.md)
34
+
35
+ ## [FAQ](../../README.md#faq)
36
+
37
+ ## Usage
38
+
39
+ ### Plain NativeScript
40
+
41
+ IMPORTANT: _Make sure you include `xmlns:mds="@nativescript-community/ui-material-bottom-navigation"` on the Page element._
42
+
43
+ #### XML
44
+
45
+ ```XML
46
+ <Page xmlns:mdt="@nativescript-community/ui-material-bottom-navigation">
47
+ <mdt:BottomNavigation selectedIndex="1">
48
+ <!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
49
+ <mdt:MDTabStrip>
50
+ <mdt:MDTabStripItem>
51
+ <Label text="Home"></Label>
52
+ <Image src="font://&#xf015;" class="fas"></Image>
53
+ </mdt:MDTabStripItem>
54
+ <mdt:MDTabStripItem class="special">
55
+ <Label text="Account"></Label>
56
+ <Image src="font://&#xf007;" class="fas"></Image>
57
+ </mdt:MDTabStripItem>
58
+ <mdt:MDTabStripItem class="special">
59
+ <Label text="Search"></Label>
60
+ <Image src="font://&#xf00e;" class="fas"></Image>
61
+ </mdt:MDTabStripItem>
62
+ </mdt:MDTabStrip>
63
+
64
+ <!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
65
+ <mdt:MDTabContentItem>
66
+ <GridLayout>
67
+ <Label text="Home Page" class="h2 text-center"></Label>
68
+ </GridLayout>
69
+ </mdt:MDTabContentItem>
70
+ <mdt:MDTabContentItem>
71
+ <GridLayout>
72
+ <Label text="Account Page" class="h2 text-center"></Label>
73
+ </GridLayout>
74
+ </mdt:MDTabContentItem>
75
+ <mdt:MDTabContentItem>
76
+ <GridLayout>
77
+ <Label text="Search Page" class="h2 text-center"></Label>
78
+ </GridLayout>
79
+ </mdt:MDTabContentItem>
80
+ </mdt:BottomNavigation>
81
+ </Page>
82
+ ```
83
+
84
+ #### CSS
85
+
86
+ ```CSS
87
+ MDBottomNavigation.bottom-nav {
88
+ background-color: orangered;
89
+ color: gold;
90
+ font-size: 18;
91
+ }
92
+
93
+ MDTabStripItem.tabstripitem-active {
94
+ background-color: teal;
95
+ }
96
+
97
+ MDTabStripItem.tabstripitem-active:active {
98
+ background-color: yellowgreen;
99
+ }
100
+
101
+ MDTabContentItem.first-tabcontent {
102
+ background-color: seashell;
103
+ color: olive;
104
+ }
105
+ MDTabContentItem.second-tabcontent {
106
+ background-color: slategray;
107
+ color: aquamarine;
108
+ }
109
+ MDTabContentItem.third-tabcontent {
110
+ background-color: blueviolet;
111
+ color: antiquewhite;
112
+ }
113
+ MDBottomNavigation TabStrip {
114
+ highlight-color: red;
115
+ }
116
+ ```
117
+
118
+ ##
119
+
120
+ ### NativeScript + Angular
121
+
122
+ ```typescript
123
+ import { NativeScriptMaterialTabsModule } from "@nativescript-community/ui-material-bottom-navigation/angular";
124
+
125
+ @NgModule({
126
+ imports: [
127
+ NativeScriptMaterialBottomNavigationModule,
128
+ ...
129
+ ],
130
+ ...
131
+ })
132
+ ```
133
+
134
+ ```html
135
+ <MDBottomNavigation selectedIndex="1">
136
+ <!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
137
+ <MDTabStrip>
138
+ <MDTabStripItem>
139
+ <Label text="Home"></Label>
140
+ <Image src="font://&#xf015;" class="fas"></Image>
141
+ </MDTabStripItem>
142
+ <MDTabStripItem class="special">
143
+ <Label text="Account"></Label>
144
+ <Image src="font://&#xf007;" class="fas"></Image>
145
+ </MDTabStripItem>
146
+ <MDTabStripItem class="special">
147
+ <Label text="Search"></Label>
148
+ <Image src="font://&#xf00e;" class="fas"></Image>
149
+ </MDTabStripItem>
150
+ </MDTabStrip>
151
+
152
+ <!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
153
+ <MDTabContentItem>
154
+ <GridLayout>
155
+ <Label text="Home Page" class="h2 text-center"></Label>
156
+ </GridLayout>
157
+ </MDTabContentItem>
158
+ <MDTabContentItem>
159
+ <GridLayout>
160
+ <Label text="Account Page" class="h2 text-center"></Label>
161
+ </GridLayout>
162
+ </MDTabContentItem>
163
+ <MDTabContentItem>
164
+ <GridLayout>
165
+ <Label text="Search Page" class="h2 text-center"></Label>
166
+ </GridLayout>
167
+ </MDTabContentItem>
168
+ </MDBottomNavigation>
169
+ ```
170
+
171
+ ##
172
+
173
+ ### NativeScript + Vue
174
+
175
+ ```javascript
176
+ import BottomNavigation from '@nativescript-community/ui-material-bottom-navigation/vue';
177
+
178
+ Vue.use(BottomNavigation);
179
+ ```
180
+
181
+ ```html
182
+ <MDBottomNavigation selectedIndex="1">
183
+ <!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
184
+ <MDTabStrip>
185
+ <MDTabStripItem>
186
+ <Label text="Home"></Label>
187
+ <Image src="font://&#xf015;" class="fas"></Image>
188
+ </MDTabStripItem>
189
+ <MDTabStripItem class="special">
190
+ <Label text="Account"></Label>
191
+ <Image src="font://&#xf007;" class="fas"></Image>
192
+ </MDTabStripItem>
193
+ <MDTabStripItem class="special">
194
+ <Label text="Search"></Label>
195
+ <Image src="font://&#xf00e;" class="fas"></Image>
196
+ </MDTabStripItem>
197
+ </MDTabStrip>
198
+
199
+ <!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
200
+ <MDTabContentItem>
201
+ <GridLayout>
202
+ <Label text="Home Page" class="h2 text-center"></Label>
203
+ </GridLayout>
204
+ </MDTabContentItem>
205
+ <MDTabContentItem>
206
+ <GridLayout>
207
+ <Label text="Account Page" class="h2 text-center"></Label>
208
+ </GridLayout>
209
+ </MDTabContentItem>
210
+ <MDTabContentItem>
211
+ <GridLayout>
212
+ <Label text="Search Page" class="h2 text-center"></Label>
213
+ </GridLayout>
214
+ </MDTabContentItem>
215
+ </MDBottomNavigation>
216
+ ```
217
+
218
+ ##
219
+
220
+ ### NativeScript + React
221
+
222
+ First, register the component before any of your React NativeScript app renders. A good place to put this code is in your entrypoint file (which may be called `src/app.ts` or similar), before the `ReactNativeScript.start` function is called. Here's how to install it:
223
+
224
+ ```ts
225
+ import { registerTabNavigationBase } from '@nativescript-community/ui-material-core/tab-navigation-base/react';
226
+ import { registerBottomNavigation } from '@nativescript-community/ui-material-bottom-navigation/react';
227
+
228
+ registerTabNavigationBase();
229
+ registerBottomNavigation();
230
+ ```
231
+
232
+ When available (I've not implemented it at the time of writing, but intend to in time), it would be best to use this component via the `bottomNavigationNavigatorFactory()` API exported by [React NativeScript Navigation](https://github.com/shirakaba/react-nativescript-navigation/tree/master/react-nativescript-navigation), as it makes nested navigation easy, but here's how to use it directly:
233
+
234
+ ```tsx
235
+ import * as React from 'react';
236
+
237
+ export function BottomNavigation() {
238
+ const [selectedIndex, setSelectedIndex] = React.useState(0);
239
+
240
+ return (
241
+ <bottomNavigation
242
+ selectedIndex={selectedIndex}
243
+ onSelectedIndexChanged={(args) => {
244
+ setSelectedIndex(args.newIndex);
245
+ }}
246
+ style={{ backgroundColor: 'orange' }}
247
+ >
248
+ {/* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */}
249
+ <tabStrip nodeRole="tabStrip" style={{ backgroundColor: 'red' }}>
250
+ <tabStripItem nodeRole="items">
251
+ <label nodeRole="label">Home</label>
252
+ <image nodeRole="image" src="font://&#xf015;" className="fas" />
253
+ </tabStripItem>
254
+ <tabStripItem nodeRole="items">
255
+ <label nodeRole="label">Account</label>
256
+ <image nodeRole="image" src="font://&#xf007;" className="fas" />
257
+ </tabStripItem>
258
+ <tabStripItem nodeRole="items">
259
+ <label nodeRole="label">Search</label>
260
+ <image nodeRole="image" src="font://&#xf00e;" className="fas" />
261
+ </tabStripItem>
262
+ </tabStrip>
263
+
264
+ {/* The number of tabContentItem components should corespond to the number of TabStripItem components */}
265
+ <tabContentItem nodeRole="items">
266
+ <gridLayout style={{ backgroundColor: 'blue' }}>
267
+ <label style={{ color: 'white' }}>Home Page</label>
268
+ </gridLayout>
269
+ </tabContentItem>
270
+ <tabContentItem nodeRole="items">
271
+ <gridLayout style={{ backgroundColor: 'cyan' }}>
272
+ <label style={{ color: 'black' }}>Account Page</label>
273
+ </gridLayout>
274
+ </tabContentItem>
275
+ <tabContentItem nodeRole="items">
276
+ <gridLayout style={{ backgroundColor: 'magenta' }}>
277
+ <label style={{ color: 'black' }}>Search Page</label>
278
+ </gridLayout>
279
+ </tabContentItem>
280
+ </bottomNavigation>
281
+ );
282
+ }
283
+ ```
284
+
285
+ **Troubleshooting**
286
+
287
+ If you see an error like this when writing e.g. `<bottomNavigation>` into your JSX:
288
+
289
+ > Property 'bottomNavigation' does not exist on type 'JSX.IntrinsicElements'.ts(2339)
290
+
291
+ Make sure that you have:
292
+
293
+ 1. Installed the `react-nativescript` npm module.
294
+ 2. Installed the `@types/react` npm module, strictly with the exact version provided in the [React NativeScript starter template](https://github.com/NativeScript/nativescript-app-templates/tree/master/packages/template-blank-react).
295
+ 3. Run the postinstall script that comes with the React NativeScript template – `npm run postinstall` – to patch `@types/react`.
296
+ 4. Registered the component as described above (i.e. import and run the `registerTabNavigationBase()` and `registerBottomNavigation()` methods).
297
+ 5. If using Visual Studio Code, option-click the import `@nativescript-community/ui-material-bottom-navigation/react` to jump to the file; opening the file will force it to load its provided typings.
298
+
299
+ ## API
300
+
301
+ ### Attributes
302
+
303
+ | Name |Type| Description|
304
+ | ------------- |:-------------:| -----:|
305
+ | items | Array<MDTabContentItem> | Gets or sets the items of the BottomNavigation.|
306
+ |selectedIndex | number | Gets or sets the selectedIndex of the BottomNavigation.|
307
+ |swipeEnabled | boolean | Gets or sets the swipe enabled state of the Tabs.|
308
+ |offscreenTabLimit | number | Gets or sets the number of offscreen preloaded tabs of the Tabs.|
309
+ |tabStrip |TabStrip | Gets or sets the tab strip of the BottomNavigation.|
310
+ |tabsPosition | "top", "bottom" | Gets or sets the position state of the Tabs. Default value: top|
311
+ |iOSTabBarItemsAlignment | "leading", "justified", "center", "centerSelected" |iOS Only: Gets or set the MDCTabBarAlignment of the tab bar icons in iOS. Default value: justified|
312
+
313
+ ### Events
314
+
315
+ | Name | Description |
316
+ | ------------- | -----:|
317
+ | selectedIndexChanged | Emitted when the selectedIndex property is changed. |
318
+ | loaded | Emitted when the view is loaded. |
319
+ | unloaded | Emitted when the view is unloaded. |
320
+ | layoutChanged | Emitted when the layout bounds of a view changes due to layout processing. |
@@ -0,0 +1,71 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@nativescript/angular'), require('@nativescript-community/ui-material-bottom-navigation')) :
3
+ typeof define === 'function' && define.amd ? define('@nativescript-community/ui-material-bottom-navigation-angular', ['exports', '@angular/core', '@nativescript/angular', '@nativescript-community/ui-material-bottom-navigation'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['nativescript-community'] = global['nativescript-community'] || {}, global['nativescript-community']['ui-material-bottom-navigation-angular'] = {}), global.ng.core, global['ns-angular'], global['ns-material-bottom-navigation']));
5
+ }(this, (function (exports, i0, angular, uiMaterialBottomNavigation) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () {
17
+ return e[k];
18
+ }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n['default'] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
+
29
+ var MaterialBottomNavigationDirective = /** @class */ (function () {
30
+ function MaterialBottomNavigationDirective() {
31
+ }
32
+ return MaterialBottomNavigationDirective;
33
+ }());
34
+ MaterialBottomNavigationDirective.ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
35
+ MaterialBottomNavigationDirective.ɵdir = i0__namespace.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
36
+ (function () {
37
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(MaterialBottomNavigationDirective, [{
38
+ type: i0.Directive,
39
+ args: [{ selector: 'MDBottomNavigation' }]
40
+ }], null, null);
41
+ })();
42
+ var NativeScriptMaterialBottomNavigationModule = /** @class */ (function () {
43
+ function NativeScriptMaterialBottomNavigationModule() {
44
+ }
45
+ return NativeScriptMaterialBottomNavigationModule;
46
+ }());
47
+ NativeScriptMaterialBottomNavigationModule.ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
48
+ NativeScriptMaterialBottomNavigationModule.ɵmod = i0__namespace.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
49
+ NativeScriptMaterialBottomNavigationModule.ɵinj = i0__namespace.ɵɵdefineInjector({});
50
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0__namespace.ɵɵsetNgModuleScope(NativeScriptMaterialBottomNavigationModule, { declarations: [MaterialBottomNavigationDirective], exports: [MaterialBottomNavigationDirective] }); })();
51
+ (function () {
52
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(NativeScriptMaterialBottomNavigationModule, [{
53
+ type: i0.NgModule,
54
+ args: [{
55
+ declarations: [MaterialBottomNavigationDirective],
56
+ exports: [MaterialBottomNavigationDirective]
57
+ }]
58
+ }], null, null);
59
+ })();
60
+ angular.registerElement('MDBottomNavigation', function () { return uiMaterialBottomNavigation.BottomNavigation; });
61
+ angular.registerElement('MDTabStrip', function () { return uiMaterialBottomNavigation.TabStrip; });
62
+ angular.registerElement('MDTabStripItem', function () { return uiMaterialBottomNavigation.TabStripItem; });
63
+ angular.registerElement('MDTabContentItem', function () { return uiMaterialBottomNavigation.TabContentItem; });
64
+
65
+ exports.MaterialBottomNavigationDirective = MaterialBottomNavigationDirective;
66
+ exports.NativeScriptMaterialBottomNavigationModule = NativeScriptMaterialBottomNavigationModule;
67
+
68
+ Object.defineProperty(exports, '__esModule', { value: true });
69
+
70
+ })));
71
+ //# sourceMappingURL=nativescript-community-ui-material-bottom-navigation-angular.umd.js.map
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@nativescript/angular"),require("@nativescript-community/ui-material-bottom-navigation")):"function"==typeof define&&define.amd?define("@nativescript-community/ui-material-bottom-navigation-angular",["exports","@angular/core","@nativescript/angular","@nativescript-community/ui-material-bottom-navigation"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["nativescript-community"]=e["nativescript-community"]||{},e["nativescript-community"]["ui-material-bottom-navigation-angular"]={}),e.ng.core,e["ns-angular"],e["ns-material-bottom-navigation"])}(this,(function(e,t,n,i){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=o(t),a=function(){};a.ɵfac=function(e){return new(e||a)},a.ɵdir=r.ɵɵdefineDirective({type:a,selectors:[["MDBottomNavigation"]]}),("undefined"==typeof ngDevMode||ngDevMode)&&r.ɵsetClassMetadata(a,[{type:t.Directive,args:[{selector:"MDBottomNavigation"}]}],null,null);var u=function(){};u.ɵfac=function(e){return new(e||u)},u.ɵmod=r.ɵɵdefineNgModule({type:u}),u.ɵinj=r.ɵɵdefineInjector({}),("undefined"==typeof ngJitMode||ngJitMode)&&r.ɵɵsetNgModuleScope(u,{declarations:[a],exports:[a]}),("undefined"==typeof ngDevMode||ngDevMode)&&r.ɵsetClassMetadata(u,[{type:t.NgModule,args:[{declarations:[a],exports:[a]}]}],null,null),n.registerElement("MDBottomNavigation",(function(){return i.BottomNavigation})),n.registerElement("MDTabStrip",(function(){return i.TabStrip})),n.registerElement("MDTabStripItem",(function(){return i.TabStripItem})),n.registerElement("MDTabContentItem",(function(){return i.TabContentItem})),e.MaterialBottomNavigationDirective=a,e.NativeScriptMaterialBottomNavigationModule=u,Object.defineProperty(e,"__esModule",{value:!0})}));
2
+ //# sourceMappingURL=nativescript-community-ui-material-bottom-navigation-angular.umd.min.js.map
@@ -0,0 +1,30 @@
1
+ import { Directive, NgModule } from '@angular/core';
2
+ import { registerElement } from '@nativescript/angular';
3
+ import { BottomNavigation, TabContentItem, TabStrip, TabStripItem } from '@nativescript-community/ui-material-bottom-navigation';
4
+ import * as i0 from "@angular/core";
5
+ export class MaterialBottomNavigationDirective {
6
+ }
7
+ MaterialBottomNavigationDirective.ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
8
+ MaterialBottomNavigationDirective.ɵdir = i0.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
9
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MaterialBottomNavigationDirective, [{
10
+ type: Directive,
11
+ args: [{ selector: 'MDBottomNavigation' }]
12
+ }], null, null); })();
13
+ export class NativeScriptMaterialBottomNavigationModule {
14
+ }
15
+ NativeScriptMaterialBottomNavigationModule.ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
16
+ NativeScriptMaterialBottomNavigationModule.ɵmod = i0.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
17
+ NativeScriptMaterialBottomNavigationModule.ɵinj = i0.ɵɵdefineInjector({});
18
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NativeScriptMaterialBottomNavigationModule, { declarations: [MaterialBottomNavigationDirective], exports: [MaterialBottomNavigationDirective] }); })();
19
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NativeScriptMaterialBottomNavigationModule, [{
20
+ type: NgModule,
21
+ args: [{
22
+ declarations: [MaterialBottomNavigationDirective],
23
+ exports: [MaterialBottomNavigationDirective]
24
+ }]
25
+ }], null, null); })();
26
+ registerElement('MDBottomNavigation', () => BottomNavigation);
27
+ registerElement('MDTabStrip', () => TabStrip);
28
+ registerElement('MDTabStripItem', () => TabStripItem);
29
+ register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ID0+IFRhYlN0cmlwSXRlbSk7XG5yZWdpc3RlckVsZW1lbnQoJ01EVGFiQ29udGVudEl0ZW0nLCAoKSA9PiBUYWJDb250ZW50SXRlbSk7XG4iXX0=
@@ -0,0 +1,2 @@
1
+ export * from './index';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlc2NyaXB0LWNvbW11bml0eS11aS1tYXRlcmlhbC1ib3R0b20tbmF2aWdhdGlvbi1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JvdHRvbS1uYXZpZ2F0aW9uL2FuZ3VsYXIvbmF0aXZlc2NyaXB0LWNvbW11bml0eS11aS1tYXRlcmlhbC1ib3R0b20tbmF2aWdhdGlvbi1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -0,0 +1,33 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, NgModule } from '@angular/core';
3
+ import { registerElement } from '@nativescript/angular';
4
+ import { BottomNavigation, TabStrip, TabStripItem, TabContentItem } from '@nativescript-community/ui-material-bottom-navigation';
5
+
6
+ class MaterialBottomNavigationDirective {
7
+ }
8
+ MaterialBottomNavigationDirective.ɵfac = function MaterialBottomNavigationDirective_Factory(t) { return new (t || MaterialBottomNavigationDirective)(); };
9
+ MaterialBottomNavigationDirective.ɵdir = i0.ɵɵdefineDirective({ type: MaterialBottomNavigationDirective, selectors: [["MDBottomNavigation"]] });
10
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MaterialBottomNavigationDirective, [{
11
+ type: Directive,
12
+ args: [{ selector: 'MDBottomNavigation' }]
13
+ }], null, null); })();
14
+ class NativeScriptMaterialBottomNavigationModule {
15
+ }
16
+ NativeScriptMaterialBottomNavigationModule.ɵfac = function NativeScriptMaterialBottomNavigationModule_Factory(t) { return new (t || NativeScriptMaterialBottomNavigationModule)(); };
17
+ NativeScriptMaterialBottomNavigationModule.ɵmod = i0.ɵɵdefineNgModule({ type: NativeScriptMaterialBottomNavigationModule });
18
+ NativeScriptMaterialBottomNavigationModule.ɵinj = i0.ɵɵdefineInjector({});
19
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NativeScriptMaterialBottomNavigationModule, { declarations: [MaterialBottomNavigationDirective], exports: [MaterialBottomNavigationDirective] }); })();
20
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NativeScriptMaterialBottomNavigationModule, [{
21
+ type: NgModule,
22
+ args: [{
23
+ declarations: [MaterialBottomNavigationDirective],
24
+ exports: [MaterialBottomNavigationDirective]
25
+ }]
26
+ }], null, null); })();
27
+ registerElement('MDBottomNavigation', () => BottomNavigation);
28
+ registerElement('MDTabStrip', () => TabStrip);
29
+ registerElement('MDTabStripItem', () => TabStripItem);
30
+ registerElement('MDTabContentItem', () => TabContentItem);
31
+
32
+ export { MaterialBottomNavigationDirective, NativeScriptMaterialBottomNavigationModule };
33
+ //# sourceMappingURL=nativescript-community-ui-material-bottom-navigation-angular.js.map
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MaterialBottomNavigationDirective {
3
+ static ɵfac: i0.ɵɵFactoryDef<MaterialBottomNavigationDirective, never>;
4
+ static ɵdir: i0.ɵɵDirectiveDefWithMeta<MaterialBottomNavigationDirective, "MDBottomNavigation", never, {}, {}, never>;
5
+ }
6
+ export declare class NativeScriptMaterialBottomNavigationModule {
7
+ static ɵfac: i0.ɵɵFactoryDef<NativeScriptMaterialBottomNavigationModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDefWithMeta<NativeScriptMaterialBottomNavigationModule, [typeof MaterialBottomNavigationDirective], never, [typeof MaterialBottomNavigationDirective]>;
9
+ static ɵinj: i0.ɵɵInjectorDef<NativeScriptMaterialBottomNavigationModule>;
10
+ }
@@ -0,0 +1,2 @@
1
+ /// <amd-module name="@nativescript-community/ui-material-bottom-navigation-angular" />
2
+ export * from './index';
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@nativescript-community/ui-material-bottom-navigation-angular",
3
+ "main": "bundles/nativescript-community-ui-material-bottom-navigation-angular.umd.js",
4
+ "module": "fesm2015/nativescript-community-ui-material-bottom-navigation-angular.js",
5
+ "es2015": "fesm2015/nativescript-community-ui-material-bottom-navigation-angular.js",
6
+ "esm2015": "esm2015/nativescript-community-ui-material-bottom-navigation-angular.js",
7
+ "fesm2015": "fesm2015/nativescript-community-ui-material-bottom-navigation-angular.js",
8
+ "typings": "nativescript-community-ui-material-bottom-navigation-angular.d.ts",
9
+ "sideEffects": false,
10
+ "dependencies": {
11
+ "tslib": "^2.0.0"
12
+ },
13
+ "scripts": {
14
+ "prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed.\\nPlease delete and rebuild the package, without compiling with Ivy, before attempting to publish.\\n')\" && exit 1"
15
+ }
16
+ }
@@ -0,0 +1,69 @@
1
+ import { TabContentItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-content-item';
2
+ import { TabNavigationBase } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-navigation-base';
3
+ import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip';
4
+ import { TabStripItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip-item';
5
+ import { Color, CoreTypes, Font } from '@nativescript/core';
6
+ export { TabContentItem, TabStrip, TabStripItem };
7
+ export declare const tabs: WeakRef<BottomNavigation>[];
8
+ export declare class BottomNavigation extends TabNavigationBase {
9
+ private _contentView;
10
+ private _contentViewId;
11
+ private _bottomNavigationBar;
12
+ private _currentFragment;
13
+ private _currentTransaction;
14
+ private _attachedToWindow;
15
+ _originalBackground: any;
16
+ private _textTransform;
17
+ private _selectedItemColor;
18
+ private _unSelectedItemColor;
19
+ fragments: androidx.fragment.app.Fragment[];
20
+ constructor();
21
+ get _hasFragments(): boolean;
22
+ onItemsChanged(oldItems: TabContentItem[], newItems: TabContentItem[]): void;
23
+ createNativeView(): org.nativescript.widgets.GridLayout;
24
+ initNativeView(): void;
25
+ _loadUnloadTabItems(newIndex: number): void;
26
+ onLoaded(): void;
27
+ _onAttachedToWindow(): void;
28
+ _onDetachedFromWindow(): void;
29
+ onUnloaded(): void;
30
+ disposeNativeView(): void;
31
+ _onRootViewReset(): void;
32
+ private disposeTabFragments;
33
+ private attachFragment;
34
+ changeTab(index: number): void;
35
+ private instantiateItem;
36
+ private setPrimaryItem;
37
+ private destroyItem;
38
+ private hideFragment;
39
+ private showFragment;
40
+ private removeFragment;
41
+ private setTabStripItems;
42
+ private getItemLabelTextTransform;
43
+ private createTabItemSpec;
44
+ private getOriginalIcon;
45
+ private getDrawableInfo;
46
+ private getIconInfo;
47
+ private getFixedSizeIcon;
48
+ updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec): void;
49
+ getTabBarBackgroundColor(): android.graphics.drawable.Drawable;
50
+ setTabBarBackgroundColor(value: android.graphics.drawable.Drawable | Color): void;
51
+ private updateTabStripItems;
52
+ _setItemsColors(items: TabStripItem[]): void;
53
+ getTabBarSelectedItemColor(): Color;
54
+ setTabBarSelectedItemColor(value: Color): void;
55
+ getTabBarUnSelectedItemColor(): Color;
56
+ setTabBarUnSelectedItemColor(value: Color): void;
57
+ private updateItem;
58
+ setTabBarItemTitle(tabStripItem: TabStripItem, value: string): void;
59
+ setTabBarItemBackgroundColor(tabStripItem: TabStripItem, value: android.graphics.drawable.Drawable | Color): void;
60
+ _setItemColor(tabStripItem: TabStripItem): void;
61
+ private setIconColor;
62
+ setTabBarItemColor(tabStripItem: TabStripItem, value: number | Color): void;
63
+ setTabBarIconColor(tabStripItem: TabStripItem, value: number | Color): void;
64
+ setTabBarIconSource(tabStripItem: TabStripItem, value: number | Color): void;
65
+ setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void;
66
+ setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void;
67
+ getTabBarTextTransform(): CoreTypes.TextTransformType;
68
+ setTabBarTextTransform(value: CoreTypes.TextTransformType): void;
69
+ }