@nativescript-community/ui-material-tabs 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.
Files changed (36) hide show
  1. package/CHANGELOG.md +1037 -0
  2. package/LICENSE +201 -0
  3. package/README.md +320 -0
  4. package/angular/bundles/nativescript-community-ui-material-tabs-angular.umd.js +71 -0
  5. package/angular/bundles/nativescript-community-ui-material-tabs-angular.umd.js.map +1 -0
  6. package/angular/bundles/nativescript-community-ui-material-tabs-angular.umd.min.js +2 -0
  7. package/angular/bundles/nativescript-community-ui-material-tabs-angular.umd.min.js.map +1 -0
  8. package/angular/esm2015/index.js +30 -0
  9. package/angular/esm2015/nativescript-community-ui-material-tabs-angular.js +2 -0
  10. package/angular/fesm2015/nativescript-community-ui-material-tabs-angular.js +33 -0
  11. package/angular/fesm2015/nativescript-community-ui-material-tabs-angular.js.map +1 -0
  12. package/angular/index.d.ts +10 -0
  13. package/angular/nativescript-community-ui-material-tabs-angular.d.ts +2 -0
  14. package/angular/package.json +16 -0
  15. package/package.json +51 -0
  16. package/platforms/ios/Podfile +2 -0
  17. package/pnpm-lock.yaml +90 -0
  18. package/react/index.d.ts +38 -0
  19. package/react/index.js +78 -0
  20. package/react/index.js.map +1 -0
  21. package/tabs-common.d.ts +18 -0
  22. package/tabs-common.js +35 -0
  23. package/tabs-common.js.map +1 -0
  24. package/tabs.android.d.ts +63 -0
  25. package/tabs.android.js +779 -0
  26. package/tabs.android.js.map +1 -0
  27. package/tabs.d.ts +89 -0
  28. package/tabs.ios.d.ts +103 -0
  29. package/tabs.ios.js +967 -0
  30. package/tabs.ios.js.map +1 -0
  31. package/vue/component.d.ts +12 -0
  32. package/vue/component.js +22 -0
  33. package/vue/component.js.map +1 -0
  34. package/vue/index.d.ts +4 -0
  35. package/vue/index.js +20 -0
  36. package/vue/index.js.map +1 -0
@@ -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 { Tabs, TabStrip, TabStripItem, TabContentItem } from '@nativescript-community/ui-material-tabs';
5
+
6
+ class MaterialTabsDirective {
7
+ }
8
+ MaterialTabsDirective.ɵfac = function MaterialTabsDirective_Factory(t) { return new (t || MaterialTabsDirective)(); };
9
+ MaterialTabsDirective.ɵdir = i0.ɵɵdefineDirective({ type: MaterialTabsDirective, selectors: [["MDTabs"]] });
10
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MaterialTabsDirective, [{
11
+ type: Directive,
12
+ args: [{ selector: 'MDTabs' }]
13
+ }], null, null); })();
14
+ class NativeScriptMaterialTabsModule {
15
+ }
16
+ NativeScriptMaterialTabsModule.ɵfac = function NativeScriptMaterialTabsModule_Factory(t) { return new (t || NativeScriptMaterialTabsModule)(); };
17
+ NativeScriptMaterialTabsModule.ɵmod = i0.ɵɵdefineNgModule({ type: NativeScriptMaterialTabsModule });
18
+ NativeScriptMaterialTabsModule.ɵinj = i0.ɵɵdefineInjector({});
19
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NativeScriptMaterialTabsModule, { declarations: [MaterialTabsDirective], exports: [MaterialTabsDirective] }); })();
20
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NativeScriptMaterialTabsModule, [{
21
+ type: NgModule,
22
+ args: [{
23
+ declarations: [MaterialTabsDirective],
24
+ exports: [MaterialTabsDirective]
25
+ }]
26
+ }], null, null); })();
27
+ registerElement('MDTabs', () => Tabs);
28
+ registerElement('MDTabStrip', () => TabStrip);
29
+ registerElement('MDTabStripItem', () => TabStripItem);
30
+ registerElement('MDTabContentItem', () => TabContentItem);
31
+
32
+ export { MaterialTabsDirective, NativeScriptMaterialTabsModule };
33
+ //# sourceMappingURL=nativescript-community-ui-material-tabs-angular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativescript-community-ui-material-tabs-angular.js","sources":["../../../../src/tabs/angular/index.ts"],"sourcesContent":["import { Directive, NgModule } from '@angular/core';\nimport { registerElement } from '@nativescript/angular';\nimport { TabContentItem, TabStrip, TabStripItem, Tabs } from '@nativescript-community/ui-material-tabs';\n\n@Directive({ selector: 'MDTabs' })\nexport class MaterialTabsDirective {}\n\n@NgModule({\n declarations: [MaterialTabsDirective],\n exports: [MaterialTabsDirective]\n})\nexport class NativeScriptMaterialTabsModule {}\n\nregisterElement('MDTabs', () => Tabs);\nregisterElement('MDTabStrip', () => TabStrip);\nregisterElement('MDTabStripItem', () => TabStripItem);\nregisterElement('MDTabContentItem', () => TabContentItem);\n"],"names":[],"mappings":";;;;;MAKa,qBAAqB;;0FAArB,qBAAqB;0DAArB,qBAAqB;uFAArB,qBAAqB;cADjC,SAAS;eAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE;;MAOpB,8BAA8B;;4GAA9B,8BAA8B;kEAA9B,8BAA8B;;wFAA9B,8BAA8B,mBAN9B,qBAAqB,aAArB,qBAAqB;uFAMrB,8BAA8B;cAJ1C,QAAQ;eAAC;gBACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;gBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;aACnC;;AAGD,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC;AACtC,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;;;;"}
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MaterialTabsDirective {
3
+ static ɵfac: i0.ɵɵFactoryDef<MaterialTabsDirective, never>;
4
+ static ɵdir: i0.ɵɵDirectiveDefWithMeta<MaterialTabsDirective, "MDTabs", never, {}, {}, never>;
5
+ }
6
+ export declare class NativeScriptMaterialTabsModule {
7
+ static ɵfac: i0.ɵɵFactoryDef<NativeScriptMaterialTabsModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDefWithMeta<NativeScriptMaterialTabsModule, [typeof MaterialTabsDirective], never, [typeof MaterialTabsDirective]>;
9
+ static ɵinj: i0.ɵɵInjectorDef<NativeScriptMaterialTabsModule>;
10
+ }
@@ -0,0 +1,2 @@
1
+ /// <amd-module name="@nativescript-community/ui-material-tabs-angular" />
2
+ export * from './index';
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@nativescript-community/ui-material-tabs-angular",
3
+ "main": "bundles/nativescript-community-ui-material-tabs-angular.umd.js",
4
+ "module": "fesm2015/nativescript-community-ui-material-tabs-angular.js",
5
+ "es2015": "fesm2015/nativescript-community-ui-material-tabs-angular.js",
6
+ "esm2015": "esm2015/nativescript-community-ui-material-tabs-angular.js",
7
+ "fesm2015": "fesm2015/nativescript-community-ui-material-tabs-angular.js",
8
+ "typings": "nativescript-community-ui-material-tabs-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
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@nativescript-community/ui-material-tabs",
3
+ "version": "6.0.0",
4
+ "description": "Material Design Tabs organize content across different screens, data sets, and other interactions.",
5
+ "main": "./tabs",
6
+ "sideEffects": false,
7
+ "typings": "./tabs.d.ts",
8
+ "scripts": {
9
+ "tsc": "../../node_modules/.bin/cpy ../../src/tabs/tabs.d.ts ./ && ../../node_modules/.bin/tsc --skipLibCheck -d",
10
+ "tsc-win": "..\\..\\node_modules\\.bin\\cpy ..\\..\\src\\tabs\\tabs.d.ts .\\ && ..\\..\\node_modules\\.bin\\tsc --skipLibCheck -d",
11
+ "build": "npm run tsc",
12
+ "build.win": "npm run tsc-win",
13
+ "build.all": "npm run build && npm run build.angular",
14
+ "build.all.win": "npm run build.win && npm run build.angular.win",
15
+ "build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/tabs/angular/package.json -c ../../src/tabs/angular/tsconfig.json",
16
+ "build.angular.win": "..\\..\\node_modules\\.bin\\ng-packagr -p ..\\..\\src\\tabs\\angular\\package.json -c ..\\..\\src\\tabs\\angular\\tsconfig.json",
17
+ "clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map"
18
+ },
19
+ "nativescript": {
20
+ "platforms": {
21
+ "android": "6.2.0",
22
+ "ios": "6.2.0"
23
+ }
24
+ },
25
+ "keywords": [
26
+ "NativeScript",
27
+ "JavaScript",
28
+ "Android",
29
+ "iOS",
30
+ "Vue",
31
+ "Angular",
32
+ "preview|https://raw.githubusercontent.com/nativescript-community/ui-material-components/master/images/demo-tabs.png"
33
+ ],
34
+ "author": {
35
+ "name": "Martin Guillon",
36
+ "email": "martin@akylas.fr"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/nativescript-community/ui-material-components/issues"
40
+ },
41
+ "license": "Apache-2.0",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/nativescript-community/ui-material-components/tree/master/packages/tabs"
45
+ },
46
+ "readmeFilename": "README.md",
47
+ "dependencies": {
48
+ "@nativescript-community/ui-material-core": "^6.0.0"
49
+ },
50
+ "gitHead": "f4a17600487dd826a4a581f2ebde8cf6457710ca"
51
+ }
@@ -0,0 +1,2 @@
1
+ pod 'MaterialComponents/BottomNavigation+Theming'
2
+ pod 'MaterialComponents/Tabs+TabBarViewTheming'
package/pnpm-lock.yaml ADDED
@@ -0,0 +1,90 @@
1
+ dependencies:
2
+ '@nativescript-community/ui-material-core': 5.2.13
3
+ lockfileVersion: 5.2
4
+ packages:
5
+ /@nativescript-community/ui-material-core/5.2.13:
6
+ dependencies:
7
+ '@nativescript/hook': 2.0.0
8
+ dev: false
9
+ requiresBuild: true
10
+ resolution:
11
+ integrity: sha512-wKSy2XeN6M+93/YV4W0WZBdsmQGpVogVwWlD+SHQ3MTiOMLL8GwOdAIrGBZEPVfyei1GLqIF4N3ALTp6mNhgVg==
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.13
@@ -0,0 +1,38 @@
1
+ import { NativeScriptProps } from 'react-nativescript';
2
+ import { PropertyChangeData } from '@nativescript/core';
3
+ import { Tabs } from '../tabs';
4
+ import { TabNavigationBaseAttributes } from '@nativescript-community/ui-material-core/tab-navigation-base/react';
5
+ import { SelectedIndexChangedEventData } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-navigation-base';
6
+ import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip';
7
+ import { TabContentItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-content-item';
8
+ export declare type TabsAttributes = TabNavigationBaseAttributes & {
9
+ android?: any;
10
+ iOSTabBarItemsAlignment?: 'center' | 'leading' | 'justified' | 'centerSelected';
11
+ ios?: any;
12
+ items?: TabContentItem[];
13
+ offscreenTabLimit?: string | number;
14
+ onIOsTabBarItemsAlignmentChange?: (args: PropertyChangeData) => void;
15
+ onOffscreenTabLimitChange?: (args: PropertyChangeData) => void;
16
+ onSelectedIndexChanged?: (args: SelectedIndexChangedEventData) => void;
17
+ onSwipeEnabledChange?: (args: PropertyChangeData) => void;
18
+ onTabsPositionChange?: (args: PropertyChangeData) => void;
19
+ selectedIndex?: number;
20
+ swipeEnabled?: string | false | true;
21
+ tabStrip?: TabStrip;
22
+ tabsPosition?: 'top' | 'bottom';
23
+ };
24
+ declare global {
25
+ module JSX {
26
+ interface IntrinsicElements {
27
+ tabs: NativeScriptProps<TabsAttributes, Tabs>;
28
+ }
29
+ interface ElementChildrenAttribute {
30
+ children: {};
31
+ }
32
+ }
33
+ }
34
+ interface RegisterTabsOptions {
35
+ enableDebugLogging?: boolean;
36
+ }
37
+ export declare function registerTabs(opts?: RegisterTabsOptions): void;
38
+ export {};
package/react/index.js ADDED
@@ -0,0 +1,78 @@
1
+ import { registerElement } from 'react-nativescript';
2
+ import { warn } from 'react-nativescript/dist/shared/Logger';
3
+ import { Tabs } from '../tabs';
4
+ import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip';
5
+ import { TabContentItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-content-item';
6
+ let installed = false;
7
+ export function registerTabs(opts = {}) {
8
+ const { enableDebugLogging = false } = opts;
9
+ if (installed) {
10
+ return;
11
+ }
12
+ registerElement('tabs', () => Tabs, {
13
+ nodeOps: {
14
+ insert(child, parent, atIndex) {
15
+ const tabs = parent.nativeView;
16
+ if (child.nodeRole === 'tabStrip') {
17
+ if (child.nativeView instanceof TabStrip) {
18
+ tabs.tabStrip = child.nativeView;
19
+ }
20
+ else {
21
+ if (enableDebugLogging) {
22
+ warn(`Unable to add child "${child.nativeView.constructor.name}" as the tabStrip of <tabs> as it is not an instance of TabStrip.`);
23
+ }
24
+ }
25
+ }
26
+ else if (child.nodeRole === 'items') {
27
+ if (child.nativeView instanceof TabContentItem === false) {
28
+ if (enableDebugLogging) {
29
+ warn(`Unable to add child "${child.nativeView.constructor.name}" to the items of <tabs> as it is not an instance of TabContentItem.`);
30
+ }
31
+ return;
32
+ }
33
+ const items = tabs.items || [];
34
+ if (typeof atIndex === 'undefined' || atIndex === items.length) {
35
+ tabs._addChildFromBuilder('items', child.nativeView);
36
+ }
37
+ else {
38
+ const itemsClone = items.slice();
39
+ itemsClone.splice(atIndex, 0, child.nativeView);
40
+ tabs.items = itemsClone;
41
+ }
42
+ }
43
+ else if (child.nodeRole === 'item') {
44
+ if (enableDebugLogging) {
45
+ warn(`Unable to add child "${child.nativeView.constructor.name}" to <tabs> as it had the nodeRole "item"; please correct it to "items".`);
46
+ }
47
+ }
48
+ else {
49
+ if (enableDebugLogging) {
50
+ warn(`Unable to add child "${child.nativeView.constructor.name}" to <tabs> as it does not have a nodeRole specified; ` + 'please set a nodeRole of "tabStrip", or "items".');
51
+ }
52
+ }
53
+ },
54
+ remove(child, parent) {
55
+ const tabs = parent.nativeView;
56
+ if (child.nodeRole === 'tabStrip') {
57
+ tabs.tabStrip = null;
58
+ }
59
+ else if (child.nodeRole === 'items') {
60
+ tabs.items = (tabs.items || []).filter((i) => i !== child.nativeView);
61
+ }
62
+ else if (child.nodeRole === 'item') {
63
+ if (enableDebugLogging) {
64
+ warn(`Unable to remove child "${child.nativeView.constructor.name}" from <tabs> as it had the nodeRole "item"; please correct it to "items".`);
65
+ }
66
+ }
67
+ else {
68
+ if (enableDebugLogging) {
69
+ warn(`Unable to remove child "${child.nativeView.constructor.name}" from <tabs> as it does not have a nodeRole specified; ` +
70
+ 'please set a nodeRole of "tabStrip", or "items"');
71
+ }
72
+ }
73
+ }
74
+ }
75
+ });
76
+ installed = true;
77
+ }
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["react/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import { Color, Property } from '@nativescript/core';
2
+ import { TabNavigationBase } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-navigation-base';
3
+ import { Tabs as TabsDefinition } from './tabs';
4
+ export declare const traceCategory = "TabView";
5
+ export declare namespace knownCollections {
6
+ const items = "items";
7
+ }
8
+ export declare class TabsBase extends TabNavigationBase implements TabsDefinition {
9
+ swipeEnabled: boolean;
10
+ offscreenTabLimit: number;
11
+ tabsPosition: 'top' | 'bottom';
12
+ animationEnabled: boolean;
13
+ rippleColor: Color;
14
+ }
15
+ export declare const swipeEnabledProperty: Property<TabsBase, boolean>;
16
+ export declare const offscreenTabLimitProperty: Property<TabsBase, number>;
17
+ export declare const tabsPositionProperty: Property<TabsBase, "top" | "bottom">;
18
+ export declare const animationEnabledProperty: Property<TabsBase, boolean>;
package/tabs-common.js ADDED
@@ -0,0 +1,35 @@
1
+ import { cssProperty } from '@nativescript-community/ui-material-core';
2
+ import { CSSType, Color, Property, booleanConverter } from '@nativescript/core';
3
+ import { TabNavigationBase } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-navigation-base';
4
+ export const traceCategory = 'TabView';
5
+ export var knownCollections;
6
+ (function (knownCollections) {
7
+ knownCollections.items = 'items';
8
+ })(knownCollections || (knownCollections = {}));
9
+ let TabsBase = class TabsBase extends TabNavigationBase {
10
+ };
11
+ __decorate([
12
+ cssProperty,
13
+ __metadata("design:type", Color)
14
+ ], TabsBase.prototype, "rippleColor", void 0);
15
+ TabsBase = __decorate([
16
+ CSSType('MDTabs')
17
+ ], TabsBase);
18
+ export { TabsBase };
19
+ export const swipeEnabledProperty = new Property({
20
+ name: 'swipeEnabled',
21
+ defaultValue: true,
22
+ valueConverter: booleanConverter
23
+ });
24
+ swipeEnabledProperty.register(TabsBase);
25
+ export const offscreenTabLimitProperty = new Property({
26
+ name: 'offscreenTabLimit',
27
+ defaultValue: 1,
28
+ valueConverter: (v) => parseInt(v, 10)
29
+ });
30
+ offscreenTabLimitProperty.register(TabsBase);
31
+ export const tabsPositionProperty = new Property({ name: 'tabsPosition', defaultValue: 'top' });
32
+ tabsPositionProperty.register(TabsBase);
33
+ export const animationEnabledProperty = new Property({ name: 'animationEnabled', defaultValue: true, valueConverter: booleanConverter });
34
+ animationEnabledProperty.register(TabsBase);
35
+ //# sourceMappingURL=tabs-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs-common.js","sourceRoot":"../src/","sources":["tabs-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kFAAkF,CAAC;AAIrH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC,MAAM,KAAW,gBAAgB,CAEhC;AAFD,WAAiB,gBAAgB;IAChB,sBAAK,GAAG,OAAO,CAAC;AACjC,CAAC,EAFgB,gBAAgB,KAAhB,gBAAgB,QAEhC;AAGD,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,iBAAiB;CAO9C,CAAA;AADgB;IAAZ,WAAW;8BAAc,KAAK;6CAAC;AANvB,QAAQ;IADpB,OAAO,CAAC,QAAQ,CAAC;GACL,QAAQ,CAOpB;SAPY,QAAQ;AAUrB,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,QAAQ,CAAoB;IAChE,IAAI,EAAE,cAAc;IACpB,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,gBAAgB;CACnC,CAAC,CAAC;AACH,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAIxC,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,QAAQ,CAAmB;IACpE,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;CACzC,CAAC,CAAC;AACH,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,QAAQ,CAA6B,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5H,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAMxC,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,QAAQ,CAAoB,EAAE,IAAI,EAAE,kBAAkB,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAC5J,wBAAwB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { Color, CoreTypes, Font } from '@nativescript/core';
2
+ import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip';
3
+ import { TabStripItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip-item';
4
+ import { TabContentItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-content-item';
5
+ import { TabsBase } from './tabs-common';
6
+ export { TabContentItem, TabStrip, TabStripItem };
7
+ export * from './tabs-common';
8
+ export declare const tabs: WeakRef<Tabs>[];
9
+ export declare class Tabs extends TabsBase {
10
+ private _tabsBar;
11
+ private _viewPager;
12
+ private _pagerAdapter;
13
+ private _androidViewId;
14
+ _originalBackground: any;
15
+ private _textTransform;
16
+ private _selectedItemColor;
17
+ private _unSelectedItemColor;
18
+ fragments: androidx.fragment.app.Fragment[];
19
+ private _attachedToWindow;
20
+ constructor();
21
+ get _hasFragments(): boolean;
22
+ onItemsChanged(oldItems: TabContentItem[], newItems: TabContentItem[]): void;
23
+ createNativeView(): org.nativescript.widgets.GridLayout;
24
+ onSelectedIndexChanged(oldIndex: number, newIndex: number): void;
25
+ initNativeView(): void;
26
+ _onAttachedToWindow(): void;
27
+ _onDetachedFromWindow(): void;
28
+ _loadUnloadTabItems(newIndex: number): void;
29
+ onLoaded(): void;
30
+ onUnloaded(): void;
31
+ disposeNativeView(): void;
32
+ _onRootViewReset(): void;
33
+ private disposeCurrentFragments;
34
+ private shouldUpdateAdapter;
35
+ private setItems;
36
+ private setTabStripItems;
37
+ private getItemLabelTextTransform;
38
+ private createTabItemSpec;
39
+ private getIcon;
40
+ private getFixedSizeIcon;
41
+ updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec): void;
42
+ getTabBarBackgroundColor(): android.graphics.drawable.Drawable;
43
+ setTabBarBackgroundColor(value: android.graphics.drawable.Drawable | Color): void;
44
+ getTabBarHighlightColor(): number;
45
+ setTabBarHighlightColor(value: number | Color): void;
46
+ getTabBarSelectedItemColor(): Color;
47
+ setTabBarSelectedItemColor(value: Color): void;
48
+ getTabBarUnSelectedItemColor(): Color;
49
+ setTabBarUnSelectedItemColor(value: Color): void;
50
+ private updateItem;
51
+ setTabBarItemTitle(tabStripItem: TabStripItem, value: string): void;
52
+ setTabBarItemBackgroundColor(tabStripItem: TabStripItem, value: android.graphics.drawable.Drawable | Color): void;
53
+ _setItemColor(tabStripItem: TabStripItem): void;
54
+ private setIconColor;
55
+ setTabBarItemColor(tabStripItem: TabStripItem, value: number | Color): void;
56
+ setTabBarIconColor(tabStripItem: TabStripItem, value: number | Color): void;
57
+ setTabBarIconSource(tabStripItem: TabStripItem, value: number | Color): void;
58
+ setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void;
59
+ getTabBarItemTextTransform(tabStripItem: TabStripItem): CoreTypes.TextTransformType;
60
+ setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void;
61
+ getTabBarTextTransform(): CoreTypes.TextTransformType;
62
+ setTabBarTextTransform(value: CoreTypes.TextTransformType): void;
63
+ }