@nativescript-community/ui-material-bottom-navigation 7.1.1 → 7.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-material-bottom-navigation",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "description": "Material Design Bottom Navigation bars allow movement between primary destinations in an app. Tapping on a bottom navigation icon takes you directly to the associated view or refreshes the currently active view.",
5
5
  "main": "bottomnavigation",
6
6
  "sideEffects": false,
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "readmeFilename": "README.md",
53
53
  "dependencies": {
54
- "@nativescript-community/ui-material-core": "^7.1.1",
55
- "@nativescript-community/ui-material-core-tabs": "^7.1.1"
54
+ "@nativescript-community/ui-material-core": "^7.1.2",
55
+ "@nativescript-community/ui-material-core-tabs": "^7.1.2"
56
56
  },
57
- "gitHead": "9be78837739b77c4144933959637cee3be14c055"
57
+ "gitHead": "227429afb7fd24e09466bd1b400f91312df6fa9e"
58
58
  }
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class MaterialBottomNavigationDirective {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<MaterialBottomNavigationDirective, never>;
4
- static ɵdir: i0.ɵɵDirectiveDeclaration<MaterialBottomNavigationDirective, "MDBottomNavigation", never, {}, {}, never, never, false>;
5
- }
6
- export declare class NativeScriptMaterialBottomNavigationModule {
7
- static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptMaterialBottomNavigationModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<NativeScriptMaterialBottomNavigationModule, [typeof MaterialBottomNavigationDirective], never, [typeof MaterialBottomNavigationDirective]>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<NativeScriptMaterialBottomNavigationModule>;
10
- }
@@ -1,30 +0,0 @@
1
- import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
2
- import { TabNavigation } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index.android';
3
- import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
4
- import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
5
- import { TabsPosition } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
6
- import { Color } from '@nativescript/core';
7
- export { TabContentItem, TabStrip, TabStripItem };
8
- interface BottomNavigationBar extends com.nativescript.material.core.BottomNavigationBar {
9
- new (context: android.content.Context, owner: BottomNavigation): BottomNavigationBar;
10
- }
11
- declare let BottomNavigationBar: BottomNavigationBar;
12
- export declare class BottomNavigation extends TabNavigation<com.nativescript.material.core.BottomNavigationBar> {
13
- tabsPosition: TabsPosition;
14
- animationEnabled: boolean;
15
- swipeEnabled: boolean;
16
- protected updateTabsBarItemAt(position: number, itemSpec: com.nativescript.material.core.TabItemSpec): void;
17
- protected setTabsBarSelectedIndicatorColors(colors: number[]): void;
18
- protected getTabBarItemView(index: number): globalAndroid.widget.LinearLayout;
19
- protected getTabBarItemTextView(index: number): globalAndroid.widget.TextView;
20
- protected createNativeTabBar(context: android.content.Context): BottomNavigationBar;
21
- protected setTabBarItems(tabItems: com.nativescript.material.core.TabItemSpec[]): void;
22
- protected selectTabBar(oldIndex: number, newIndex: number): void;
23
- onLoaded(): void;
24
- updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec): void;
25
- setTabBarBackgroundColor(value: android.graphics.drawable.Drawable | Color): void;
26
- _setItemsColors(items: TabStripItem[]): void;
27
- setTabBarSelectedItemColor(value: Color): void;
28
- setTabBarUnSelectedItemColor(value: Color): void;
29
- onTabsBarSelectedPositionChange(position: number, prevPosition: number): void;
30
- }
package/index.android.js DELETED
@@ -1,140 +0,0 @@
1
- import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
2
- import { PRIMARY_COLOR, TabNavigation } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index.android';
3
- import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
4
- import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
5
- import { TabsPosition, animationEnabledProperty, swipeEnabledProperty } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
6
- import { CSSType, Color, Utils } from '@nativescript/core';
7
- export { TabContentItem, TabStrip, TabStripItem };
8
- // eslint-disable-next-line no-redeclare
9
- let BottomNavigationBar;
10
- function initializeNativeClasses() {
11
- if (BottomNavigationBar) {
12
- return;
13
- }
14
- var BottomNavigationBarImplementation = /** @class */ (function (_super) {
15
- __extends(BottomNavigationBarImplementation, _super);
16
- function BottomNavigationBarImplementation(context, owner) {
17
- var _this = _super.call(this, context) || this;
18
- _this.owner = owner;
19
- return global.__native(_this);
20
- }
21
- BottomNavigationBarImplementation.prototype.onSelectedPositionChange = function (position, prevPosition) {
22
- var owner = this.owner;
23
- if (!owner) {
24
- return;
25
- }
26
- owner.onTabsBarSelectedPositionChange(position, prevPosition);
27
- };
28
- BottomNavigationBarImplementation.prototype.onTap = function (position) {
29
- var owner = this.owner;
30
- if (!owner) {
31
- return false;
32
- }
33
- return owner.onTabsBarTap(position);
34
- };
35
- return BottomNavigationBarImplementation;
36
- }(com.nativescript.material.core.BottomNavigationBar));
37
- BottomNavigationBar = BottomNavigationBarImplementation;
38
- }
39
- let BottomNavigation = class BottomNavigation extends TabNavigation {
40
- constructor() {
41
- super(...arguments);
42
- this.tabsPosition = TabsPosition.Bottom;
43
- this.animationEnabled = false;
44
- this.swipeEnabled = false;
45
- }
46
- updateTabsBarItemAt(position, itemSpec) {
47
- this.mTabsBar.updateItemAt(position, itemSpec);
48
- }
49
- setTabsBarSelectedIndicatorColors(colors) {
50
- // nothing to do
51
- }
52
- getTabBarItemView(index) {
53
- return this.mTabsBar.getViewForItemAt(index);
54
- }
55
- getTabBarItemTextView(index) {
56
- return this.mTabsBar.getTextViewForItemAt(index);
57
- }
58
- createNativeTabBar(context) {
59
- initializeNativeClasses();
60
- const tabsBar = new BottomNavigationBar(context, this);
61
- const primaryColor = Utils.android.resources.getPaletteColor(PRIMARY_COLOR, context);
62
- if (primaryColor) {
63
- tabsBar.setBackgroundColor(primaryColor);
64
- }
65
- tabsBar.setSelectedPosition(this.selectedIndex);
66
- return tabsBar;
67
- }
68
- setTabBarItems(tabItems) {
69
- this.mTabsBar.setItems(tabItems);
70
- }
71
- selectTabBar(oldIndex, newIndex) {
72
- this.mTabsBar.setSelectedPosition(newIndex);
73
- }
74
- onLoaded() {
75
- super.onLoaded();
76
- if (!this.tabStrip && this.mTabsBar) {
77
- // manually set the visibility, so that the grid layout remeasures
78
- this.mTabsBar.setVisibility(android.view.View.GONE);
79
- }
80
- // if (this._attachedToWindow) {
81
- // this.changeTab(this.selectedIndex);
82
- // }
83
- }
84
- // _onAttachedToWindow(): void {
85
- // super._onAttachedToWindow();
86
- // // this.changeTab(this.selectedIndex);
87
- // }
88
- updateAndroidItemAt(index, spec) {
89
- // that try catch is fix for an android NPE error on css change which navigated in (not the current fragment)
90
- try {
91
- if (this.mTabsBar) {
92
- this.mTabsBar.updateItemAt(index, spec);
93
- }
94
- }
95
- catch (err) { }
96
- }
97
- setTabBarBackgroundColor(value) {
98
- super.setTabBarBackgroundColor(value);
99
- // this.updateTabStripItems();
100
- }
101
- // private updateTabStripItems(): void {
102
- // this.tabStrip.items.forEach((tabStripItem: TabStripItem) => {
103
- // if (tabStripItem.nativeView) {
104
- // const tabItemSpec = this.createTabItemSpec(tabStripItem);
105
- // this.updateAndroidItemAt(tabStripItem._index, tabItemSpec);
106
- // }
107
- // });
108
- // }
109
- _setItemsColors(items) {
110
- items.forEach((item) => {
111
- if (item.nativeView) {
112
- this._setItemColor(item);
113
- }
114
- });
115
- }
116
- setTabBarSelectedItemColor(value) {
117
- super.setTabBarSelectedItemColor(value);
118
- this._setItemsColors(this.tabStrip.items);
119
- }
120
- setTabBarUnSelectedItemColor(value) {
121
- super.setTabBarUnSelectedItemColor(value);
122
- this._setItemsColors(this.tabStrip.items);
123
- }
124
- onTabsBarSelectedPositionChange(position, prevPosition) {
125
- this.mViewPager.setCurrentItem(position, this.animationEnabled);
126
- const tabStripItems = this.tabStrip && this.tabStrip.items;
127
- if (position >= 0 && tabStripItems && tabStripItems[position]) {
128
- tabStripItems[position]._emit(TabStripItem.selectEvent);
129
- }
130
- if (prevPosition >= 0 && tabStripItems && tabStripItems[prevPosition]) {
131
- tabStripItems[prevPosition]._emit(TabStripItem.unselectEvent);
132
- }
133
- this._setItemsColors(this.tabStrip.items);
134
- }
135
- };
136
- BottomNavigation = __decorate([
137
- CSSType('BottomNavigation')
138
- ], BottomNavigation);
139
- export { BottomNavigation };
140
- //# sourceMappingURL=index.android.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"../src/","sources":["index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gEAAgE,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4EAA4E,CAAC;AAC1H,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,2EAA2E,CAAC;AACzJ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AAMlD,wCAAwC;AACxC,IAAI,mBAAwC,CAAC;AAE7C,SAAS,uBAAuB;IAC5B,IAAI,mBAAmB,EAAE;QACrB,OAAO;KACV;;;;;;;;;;;;;;;;;;;;;;;;IA2BD,mBAAmB,GAAG,iCAAwC,CAAC;AACnE,CAAC;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,aAAiE;IAAhG;;QACH,iBAAY,G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IAEe,+BAA+B,CAAC,QAAgB,EAAE,YAAoB;QAClF,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAE3D,IAAI,QAAQ,IAAI,CAAC,IAAI,aAAa,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;YAC3D,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;SAC3D;QAED,IAAI,YAAY,IAAI,CAAC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE;YACnE,aAAa,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;SACjE;QAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;CACJ,CAAA;AA5GY,gBAAgB;IAD5B,OAAO,CAAC,kBAAkB,CAAC;GACf,gBAAgB,CA4G5B;SA5GY,gBAAgB"}
package/index.d.ts DELETED
@@ -1,88 +0,0 @@
1
- /**
2
- * Material BottomNavigation component
3
- * @module @nativescript-community/ui-material-bottom-navigation
4
- */
5
-
6
- import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
7
- import { TabNavigationBase } from '@nativescript-community/ui-material-core-tabs/tab-navigation-base';
8
- import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
9
- import { CoercibleProperty, EventData, Property } from '@nativescript/core';
10
- import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
11
-
12
- export { TabContentItem, TabStrip, TabStripItem };
13
- /**
14
- * Defines the data for the TabView.selectedIndexChanged event.
15
- */
16
- export interface SelectedIndexChangedEventData extends EventData {
17
- /**
18
- * The old selected index.
19
- */
20
- oldIndex: number;
21
-
22
- /**
23
- * The new selected index.
24
- */
25
- newIndex: number;
26
- }
27
-
28
- /**
29
- * Represents a tab navigation widget with static tabs at the bottom.
30
- */
31
- export class BottomNavigation extends TabNavigationBase {
32
- /**
33
- * Gets or sets the items of the BottomNavigation.
34
- */
35
- items: TabContentItem[];
36
-
37
- /**
38
- * Gets or sets the tab strip of the BottomNavigation.
39
- */
40
- tabStrip: TabStrip;
41
-
42
- /**
43
- * Gets or sets the selectedIndex of the BottomNavigation.
44
- */
45
- selectedIndex: number;
46
-
47
- /**
48
- * Allow custom positioning of Tabs within another view
49
- */
50
- public iosCustomPositioning?: boolean;
51
-
52
- /**
53
- * Gets the native [android widget](http://developer.android.com/reference/android/support/v4/view/ViewPager.html) that represents the user interface for this component. Valid only when running on Android OS.
54
- */
55
- android: any /* android.view.View */; //android.support.v4.view.ViewPager;
56
-
57
- /**
58
- * Gets the native iOS [UITabBarController](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/) that represents the user interface for this component. Valid only when running on iOS.
59
- */
60
- ios: any /* UITabBarController */;
61
-
62
- /**
63
- * String value used when hooking to the selectedIndexChanged event.
64
- */
65
- public static selectedIndexChangedEvent: string;
66
-
67
- /**
68
- * @hidden
69
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
70
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
71
- * @param callback - Callback function which will be executed when event is raised.
72
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
73
- */
74
- on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
75
-
76
- /**
77
- * Raised when the selected index changes.
78
- */
79
- on(event: 'selectedIndexChanged', callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any);
80
-
81
- // parameter to allow the bottom-navigation to be positioned correcly within layouts and thus not be full size
82
- // be careful it will then be influenced by safeArea. Default is false
83
- iosCustomPositioning: boolean;
84
- }
85
-
86
- export const itemsProperty: Property<BottomNavigation, TabContentItem[]>;
87
- export const tabStripProperty: Property<BottomNavigation, TabStrip>;
88
- export const selectedIndexProperty: CoercibleProperty<BottomNavigation, number>;
package/index.ios.d.ts DELETED
@@ -1,68 +0,0 @@
1
- import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
2
- import { TabNavigationBase } from '@nativescript-community/ui-material-core-tabs/tab-navigation-base';
3
- import { TabsPosition } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
4
- import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
5
- import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
6
- import { Color, CoreTypes, Font, Property } from '@nativescript/core';
7
- export { TabContentItem, TabStrip, TabStripItem };
8
- declare class MDTabBarControllerImpl extends UITabBarController {
9
- private _owner;
10
- static initWithOwner(owner: WeakRef<BottomNavigation>): MDTabBarControllerImpl;
11
- viewWillAppear(animated: boolean): void;
12
- viewDidDisappear(animated: boolean): void;
13
- viewWillTransitionToSizeWithTransitionCoordinator(size: CGSize, coordinator: UIViewControllerTransitionCoordinator): void;
14
- traitCollectionDidChange(previousTraitCollection: UITraitCollection): void;
15
- }
16
- export declare const iosCustomPositioningProperty: Property<BottomNavigation, boolean>;
17
- export declare class BottomNavigation extends TabNavigationBase {
18
- tabsPosition: TabsPosition;
19
- viewController: MDTabBarControllerImpl;
20
- items: TabContentItem[];
21
- private mDelegate;
22
- private mMoreNavigationControllerDelegate;
23
- private mIconsCache;
24
- private mSelectedItemColor;
25
- private mUnSelectedItemColor;
26
- iosCustomPositioning: boolean;
27
- constructor();
28
- createNativeView(): UIView;
29
- initNativeView(): void;
30
- disposeNativeView(): void;
31
- onLoaded(): void;
32
- onUnloaded(): void;
33
- get ios(): UITabBarController;
34
- layoutNativeView(left: number, top: number, right: number, bottom: number): void;
35
- _setNativeViewFrame(nativeView: UIView, frame: CGRect): void;
36
- onSelectedIndexChanged(oldIndex: number, newIndex: number): void;
37
- getTabBarBackgroundColor(): UIColor;
38
- setTabBarBackgroundColor(value: UIColor | Color): void;
39
- setTabBarItemTitle(tabStripItem: TabStripItem, value: string): void;
40
- setTabBarItemBackgroundColor(tabStripItem: TabStripItem, value: UIColor | Color): void;
41
- setTabBarItemColor(tabStripItem: TabStripItem, value: UIColor | Color): void;
42
- private setItemColors;
43
- private setIconColor;
44
- setTabBarIconColor(tabStripItem: TabStripItem, value: UIColor | Color): void;
45
- setTabBarIconSource(tabStripItem: TabStripItem, value: UIColor | Color): void;
46
- setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void;
47
- setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void;
48
- getTabBarHighlightColor(): UIColor;
49
- setTabBarHighlightColor(value: UIColor | Color): void;
50
- getTabBarSelectedItemColor(): Color;
51
- setTabBarSelectedItemColor(value: Color): void;
52
- getTabBarUnSelectedItemColor(): Color;
53
- setTabBarUnSelectedItemColor(value: Color): void;
54
- onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
55
- _onViewControllerShown(viewController: UIViewController): void;
56
- private _actionBarHiddenByTabView;
57
- _handleTwoNavigationBars(backToMoreWillBeVisible: boolean): void;
58
- private getViewController;
59
- private setViewControllers;
60
- private setItemImages;
61
- updateAllItemsColors(): void;
62
- private updateItemColors;
63
- private createTabBarItem;
64
- private getIconRenderingMode;
65
- private getIcon;
66
- private getFixedSizeIcon;
67
- private setViewAttributes;
68
- }
package/index.ios.js DELETED
@@ -1,711 +0,0 @@
1
- // Types
2
- import { TabContentItem } from '@nativescript-community/ui-material-core-tabs/tab-content-item';
3
- import { TabNavigationBase, getIconSpecSize, itemsProperty, selectedIndexProperty, tabStripProperty } from '@nativescript-community/ui-material-core-tabs/tab-navigation-base';
4
- import { TabsPosition } from '@nativescript-community/ui-material-core-tabs/tab-navigation/index-common';
5
- import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-strip';
6
- import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item';
7
- // Types
8
- // Requires
9
- import { CSSType, Color, CoreTypes, Device, Font, Frame, IOSHelper, ImageSource, Property, Utils, View, booleanConverter } from '@nativescript/core';
10
- import { getTransformedText } from '@nativescript/core/ui/text-base';
11
- import { iOSNativeHelper } from '@nativescript/core/utils';
12
- export { TabContentItem, TabStrip, TabStripItem };
13
- // TODO:
14
- // import { profile } from "../../profiling";
15
- const maxTabsCount = 5;
16
- const majorVersion = iOSNativeHelper.MajorVersion;
17
- const isPhone = Device.deviceType === 'Phone';
18
- var MDTabBarControllerImpl = /** @class */ (function (_super) {
19
- __extends(MDTabBarControllerImpl, _super);
20
- function MDTabBarControllerImpl() {
21
- return _super !== null && _super.apply(this, arguments) || this;
22
- }
23
- MDTabBarControllerImpl.initWithOwner = function (owner) {
24
- var handler = MDTabBarControllerImpl.alloc().init();
25
- handler._owner = owner;
26
- return handler;
27
- };
28
- // TODO
29
- // @profile
30
- MDTabBarControllerImpl.prototype.viewWillAppear = function (animated) {
31
- _super.prototype.viewWillAppear.call(this, animated);
32
- var owner = this._owner.get();
33
- if (!owner) {
34
- return;
35
- }
36
- // Unify translucent and opaque bars layout
37
- this.extendedLayoutIncludesOpaqueBars = true;
38
- IOSHelper.updateAutoAdjustScrollInsets(this, owner);
39
- if (!owner.parent) {
40
- owner.callLoaded();
41
- }
42
- };
43
- // TODO
44
- // @profile
45
- MDTabBarControllerImpl.prototype.viewDidDisappear = function (animated) {
46
- var _a;
47
- _super.prototype.viewDidDisappear.call(this, animated);
48
- var owner = (_a = this._owner) === null || _a === void 0 ? void 0 : _a.get();
49
- if (owner && !owner.parent && owner.isLoaded && !this.presentedViewController) {
50
- owner.callUnloaded();
51
- }
52
- };
53
- MDTabBarControllerImpl.prototype.viewWillTransitionToSizeWithTransitionCoordinator = function (size, coordinator) {
54
- var _this = this;
55
- _super.prototype.viewWillTransitionToSizeWithTransitionCoordinator.call(this, size, coordinator);
56
- coordinator.animateAlongsideTransitionCompletion(function () {
57
- var owner = _this._owner.get();
58
- if (owner && owner.tabStrip && owner.tabStrip.items) {
59
- var tabStrip_1 = owner.tabStrip;
60
- tabStrip_1.items.forEach(function (tabStripItem) {
61
- updateBackgroundPositions(tabStrip_1, tabStripItem);
62
- var index = tabStripItem.index;
63
- var tabBarItemController = _this.viewControllers[index];
64
- updateTitleAndIconPositions(tabStripItem, tabBarItemController.tabBarItem, tabBarItemController);
65
- });
66
- }
67
- }, null);
68
- };
69
- // Mind implementation for other controllers
70
- MDTabBarControllerImpl.prototype.traitCollectionDidChange = function (previousTraitCollection) {
71
- _super.prototype.traitCollectionDidChange.call(this, previousTraitCollection);
72
- if (majorVersion >= 13) {
73
- var owner = this._owner.get();
74
- if (owner &&
75
- this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection &&
76
- this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) {
77
- owner.notify({
78
- eventName: IOSHelper.traitCollectionColorAppearanceChangedEvent,
79
- object: owner
80
- });
81
- }
82
- }
83
- };
84
- return MDTabBarControllerImpl;
85
- }(UITabBarController));
86
- var BNTabBarControllerDelegateImpl = /** @class */ (function (_super) {
87
- __extends(BNTabBarControllerDelegateImpl, _super);
88
- function BNTabBarControllerDelegateImpl() {
89
- return _super !== null && _super.apply(this, arguments) || this;
90
- }
91
- BNTabBarControllerDelegateImpl.initWithOwner = function (owner) {
92
- var delegate = BNTabBarControllerDelegateImpl.alloc().init();
93
- delegate._owner = owner;
94
- return delegate;
95
- };
96
- BNTabBarControllerDelegateImpl.prototype.tabBarControllerShouldSelectViewController = function (tabBarController, viewController) {
97
- // TODO
98
- // if (Trace.isEnabled()) {
99
- // Trace.write("TabView.delegate.SHOULD_select(" + tabBarController + ", " + viewController + ");", Trace.categories.Debug);
100
- // }
101
- var owner = this._owner.get();
102
- if (owner) {
103
- // "< More" cannot be visible after clicking on the main tab bar buttons.
104
- var backToMoreWillBeVisible = false;
105
- owner._handleTwoNavigationBars(backToMoreWillBeVisible);
106
- if (tabBarController.viewControllers) {
107
- var position = tabBarController.viewControllers.indexOfObject(viewController);
108
- if (position !== NSNotFound) {
109
- var tabStrip = owner.tabStrip;
110
- var tabStripItems = tabStrip && tabStrip.items;
111
- if (tabStripItems && tabStripItems[position]) {
112
- tabStripItems[position]._emit(TabStripItem.tapEvent);
113
- tabStrip.notify({
114
- eventName: TabStrip.itemTapEvent,
115
- object: tabStrip,
116
- index: position
117
- });
118
- }
119
- }
120
- }
121
- }
122
- if (tabBarController.selectedViewController === viewController) {
123
- return false;
124
- }
125
- tabBarController._willSelectViewController = viewController;
126
- return true;
127
- };
128
- BNTabBarControllerDelegateImpl.prototype.tabBarControllerDidSelectViewController = function (tabBarController, viewController) {
129
- // TODO
130
- // if (Trace.isEnabled()) {
131
- // Trace.write("TabView.delegate.DID_select(" + tabBarController + ", " + viewController + ");", Trace.categories.Debug);
132
- // }
133
- var owner = this._owner.get();
134
- if (owner) {
135
- owner._onViewControllerShown(viewController);
136
- }
137
- tabBarController._willSelectViewController = undefined;
138
- };
139
- BNTabBarControllerDelegateImpl.ObjCProtocols = [UITabBarControllerDelegate];
140
- return BNTabBarControllerDelegateImpl;
141
- }(NSObject));
142
- var BNNavigationControllerDelegateImpl = /** @class */ (function (_super) {
143
- __extends(BNNavigationControllerDelegateImpl, _super);
144
- function BNNavigationControllerDelegateImpl() {
145
- return _super !== null && _super.apply(this, arguments) || this;
146
- }
147
- BNNavigationControllerDelegateImpl.initWithOwner = function (owner) {
148
- var delegate = BNNavigationControllerDelegateImpl.alloc().init();
149
- delegate._owner = owner;
150
- return delegate;
151
- };
152
- BNNavigationControllerDelegateImpl.prototype.navigationControllerWillShowViewControllerAnimated = function (navigationController, viewController, animated) {
153
- // TODO
154
- // if (Trace.isEnabled()) {
155
- // Trace.write("TabView.moreNavigationController.WILL_show(" + navigationController + ", " + viewController + ", " + animated + ");", Trace.categories.Debug);
156
- // }
157
- var owner = this._owner.get();
158
- if (owner) {
159
- // If viewController is one of our tab item controllers, then "< More" will be visible shortly.
160
- // Otherwise viewController is the UIMoreListController which shows the list of all tabs beyond the 4th tab.
161
- var backToMoreWillBeVisible = owner.viewController.viewControllers.containsObject(viewController);
162
- owner._handleTwoNavigationBars(backToMoreWillBeVisible);
163
- }
164
- };
165
- BNNavigationControllerDelegateImpl.prototype.navigationControllerDidShowViewControllerAnimated = function (navigationController, viewController, animated) {
166
- // TODO
167
- // if (Trace.isEnabled()) {
168
- // Trace.write("TabView.moreNavigationController.DID_show(" + navigationController + ", " + viewController + ", " + animated + ");", Trace.categories.Debug);
169
- // }
170
- // We don't need Edit button in More screen.
171
- navigationController.navigationBar.topItem.rightBarButtonItem = null;
172
- var owner = this._owner.get();
173
- if (owner) {
174
- owner._onViewControllerShown(viewController);
175
- }
176
- };
177
- BNNavigationControllerDelegateImpl.ObjCProtocols = [UINavigationControllerDelegate];
178
- return BNNavigationControllerDelegateImpl;
179
- }(NSObject));
180
- function updateBackgroundPositions(tabStrip, tabStripItem) {
181
- let bgView = tabStripItem.bgView;
182
- const index = tabStripItem.index;
183
- const width = tabStrip.nativeView.frame.size.width / tabStrip.items.length;
184
- const frame = CGRectMake(width * index, 0, width, tabStrip.nativeView.frame.size.width);
185
- if (!bgView) {
186
- bgView = UIView.alloc().initWithFrame(frame);
187
- tabStrip.nativeView.insertSubviewAtIndex(bgView, 0);
188
- tabStripItem.bgView = bgView;
189
- }
190
- else {
191
- bgView.frame = frame;
192
- }
193
- const backgroundColor = tabStripItem.style.backgroundColor;
194
- if (backgroundColor) {
195
- bgView.backgroundColor = backgroundColor instanceof Color ? backgroundColor.ios : backgroundColor;
196
- }
197
- else {
198
- // always default to at least a solid white background as fallback
199
- // building with Xcode 13 causes bgView with no background to be fully transparent unless a css background-color is set - this allows original default behavior to work as it always did
200
- bgView.backgroundColor = new Color('#fff').ios;
201
- }
202
- }
203
- function updateTitleAndIconPositions(tabStripItem, tabBarItem, controller) {
204
- if (!tabStripItem || !tabBarItem) {
205
- return;
206
- }
207
- // For iOS <11 icon is *always* above the text.
208
- // For iOS 11 icon is above the text *only* on phones in portrait mode.
209
- const orientation = controller.interfaceOrientation;
210
- const isPortrait = orientation !== 4 /* UIInterfaceOrientation.LandscapeLeft */ && orientation !== 3 /* UIInterfaceOrientation.LandscapeRight */;
211
- const isIconAboveTitle = majorVersion < 11 || (isPhone && isPortrait);
212
- if (!tabStripItem.iconSource) {
213
- if (isIconAboveTitle) {
214
- tabBarItem.titlePositionAdjustment = {
215
- horizontal: 0,
216
- vertical: -20
217
- };
218
- }
219
- else {
220
- tabBarItem.titlePositionAdjustment = { horizontal: 0, vertical: 0 };
221
- }
222
- }
223
- if (!tabStripItem.title) {
224
- if (isIconAboveTitle) {
225
- tabBarItem.imageInsets = new UIEdgeInsets({
226
- top: 6,
227
- left: 0,
228
- bottom: -6,
229
- right: 0
230
- });
231
- }
232
- else {
233
- tabBarItem.imageInsets = new UIEdgeInsets({
234
- top: 0,
235
- left: 0,
236
- bottom: 0,
237
- right: 0
238
- });
239
- }
240
- }
241
- }
242
- export const iosCustomPositioningProperty = new Property({
243
- name: 'iosCustomPositioning',
244
- defaultValue: false,
245
- valueConverter: booleanConverter
246
- });
247
- let BottomNavigation = class BottomNavigation extends TabNavigationBase {
248
- constructor() {
249
- super();
250
- this.tabsPosition = TabsPosition.Bottom;
251
- this.mIconsCache = {};
252
- this.viewController = MDTabBarControllerImpl.initWithOwner(new WeakRef(this));
253
- }
254
- createNativeView() {
255
- return this.viewController.view;
256
- }
257
- initNativeView() {
258
- super.initNativeView();
259
- this.mDelegate = BNTabBarControllerDelegateImpl.initWithOwner(new WeakRef(this));
260
- this.mMoreNavigationControllerDelegate = BNNavigationControllerDelegateImpl.initWithOwner(new WeakRef(this));
261
- if (!this.tabStrip) {
262
- this.viewController.tabBar.hidden = true;
263
- }
264
- }
265
- disposeNativeView() {
266
- this.mDelegate = null;
267
- this.mMoreNavigationControllerDelegate = null;
268
- super.disposeNativeView();
269
- }
270
- onLoaded() {
271
- super.onLoaded();
272
- this.setViewControllers(this.items);
273
- const selectedIndex = this.selectedIndex;
274
- const selectedView = this.items && this.items[selectedIndex] && this.items[selectedIndex].content;
275
- if (selectedView instanceof Frame) {
276
- selectedView._pushInFrameStackRecursive();
277
- }
278
- this.viewController.delegate = this.mDelegate;
279
- this.onSelectedIndexChanged(selectedIndex, selectedIndex);
280
- }
281
- onUnloaded() {
282
- this.viewController.delegate = null;
283
- this.viewController.moreNavigationController.delegate = null;
284
- super.onUnloaded();
285
- this.items.forEach((item, i) => {
286
- item.unloadView(item.content);
287
- });
288
- }
289
- // @ts-ignore
290
- get ios() {
291
- return this.viewController;
292
- }
293
- layoutNativeView(left, top, right, bottom) {
294
- if (this.iosCustomPositioning) {
295
- super.layoutNativeView(left, top, right, bottom);
296
- }
297
- }
298
- _setNativeViewFrame(nativeView, frame) {
299
- if (this.iosCustomPositioning) {
300
- super._setNativeViewFrame(nativeView, frame);
301
- }
302
- }
303
- onSelectedIndexChanged(oldIndex, newIndex) {
304
- const items = this.items;
305
- if (!items) {
306
- return;
307
- }
308
- if (this.unloadOnTabChange) {
309
- const oldItem = items[oldIndex];
310
- if (oldItem) {
311
- oldItem.canBeLoaded = false;
312
- oldItem.unloadView(oldItem.content);
313
- }
314
- }
315
- const newItem = items[newIndex];
316
- if (newItem && this.isLoaded) {
317
- const selectedView = items[newIndex].content;
318
- if (selectedView instanceof Frame) {
319
- selectedView._pushInFrameStackRecursive();
320
- }
321
- newItem.canBeLoaded = true;
322
- newItem.loadView(newItem.content);
323
- }
324
- const tabStripItems = this.tabStrip && this.tabStrip.items;
325
- if (tabStripItems) {
326
- if (tabStripItems[newIndex]) {
327
- tabStripItems[newIndex]._emit(TabStripItem.selectEvent);
328
- }
329
- if (oldIndex !== newIndex && tabStripItems[oldIndex]) {
330
- tabStripItems[oldIndex]._emit(TabStripItem.unselectEvent);
331
- }
332
- }
333
- super.onSelectedIndexChanged(oldIndex, newIndex);
334
- }
335
- getTabBarBackgroundColor() {
336
- return this.viewController.tabBar.barTintColor;
337
- }
338
- setTabBarBackgroundColor(value) {
339
- this.viewController.tabBar.barTintColor = value instanceof Color ? value.ios : value;
340
- this.updateAllItemsColors();
341
- }
342
- setTabBarItemTitle(tabStripItem, value) {
343
- tabStripItem.nativeView.title = value;
344
- }
345
- setTabBarItemBackgroundColor(tabStripItem, value) {
346
- if (!this.tabStrip || !tabStripItem) {
347
- return;
348
- }
349
- updateBackgroundPositions(this.tabStrip, tabStripItem);
350
- }
351
- setTabBarItemColor(tabStripItem, value) {
352
- this.setViewAttributes(tabStripItem.nativeView, tabStripItem.label);
353
- }
354
- setItemColors() {
355
- if (this.mSelectedItemColor) {
356
- this.viewController.tabBar.selectedImageTintColor = this.mSelectedItemColor.ios;
357
- }
358
- if (this.mUnSelectedItemColor) {
359
- this.viewController.tabBar.unselectedItemTintColor = this.mUnSelectedItemColor.ios;
360
- }
361
- }
362
- setIconColor(tabStripItem, forceReload = false) {
363
- if (forceReload || (!this.mUnSelectedItemColor && !this.mSelectedItemColor)) {
364
- // if selectedItemColor or unSelectedItemColor is set we don't respect the color from the style
365
- const tabStripColor = this.selectedIndex === tabStripItem.index ? this.mSelectedItemColor : this.mUnSelectedItemColor;
366
- const image = this.getIcon(tabStripItem, tabStripColor);
367
- tabStripItem.nativeView.image = image;
368
- tabStripItem.nativeView.selectedImage = image;
369
- }
370
- }
371
- setTabBarIconColor(tabStripItem, value) {
372
- this.setIconColor(tabStripItem);
373
- }
374
- setTabBarIconSource(tabStripItem, value) {
375
- this.updateItemColors(tabStripItem);
376
- }
377
- setTabBarItemFontInternal(tabStripItem, value) {
378
- this.setViewAttributes(tabStripItem.nativeView, tabStripItem.label);
379
- }
380
- setTabBarItemTextTransform(tabStripItem, value) {
381
- tabStripItem.nativeView.title = getTransformedText(tabStripItem.label.text, value);
382
- }
383
- getTabBarHighlightColor() {
384
- return this.viewController.tabBar.tintColor;
385
- }
386
- setTabBarHighlightColor(value) {
387
- this.viewController.tabBar.tintColor = value instanceof Color ? value.ios : value;
388
- }
389
- getTabBarSelectedItemColor() {
390
- return this.mSelectedItemColor;
391
- }
392
- setTabBarSelectedItemColor(value) {
393
- this.mSelectedItemColor = value;
394
- this.updateAllItemsColors();
395
- }
396
- getTabBarUnSelectedItemColor() {
397
- return this.mUnSelectedItemColor;
398
- }
399
- setTabBarUnSelectedItemColor(value) {
400
- this.mUnSelectedItemColor = value;
401
- this.updateAllItemsColors();
402
- }
403
- onMeasure(widthMeasureSpec, heightMeasureSpec) {
404
- const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
405
- const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
406
- const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
407
- const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
408
- const widthAndState = View.resolveSizeAndState(width, width, widthMode, 0);
409
- const heightAndState = View.resolveSizeAndState(height, height, heightMode, 0);
410
- this.setMeasuredDimension(widthAndState, heightAndState);
411
- }
412
- _onViewControllerShown(viewController) {
413
- // This method could be called with the moreNavigationController or its list controller, so we have to check.
414
- // TODO
415
- // if (Trace.isEnabled()) {
416
- // Trace.write("TabView._onViewControllerShown(" + viewController + ");", Trace.categories.Debug);
417
- // }
418
- if (this.viewController.viewControllers && this.viewController.viewControllers.containsObject(viewController)) {
419
- this.selectedIndex = this.viewController.viewControllers.indexOfObject(viewController);
420
- }
421
- else {
422
- // TODO
423
- // if (Trace.isEnabled()) {
424
- // Trace.write("TabView._onViewControllerShown: viewController is not one of our viewControllers", Trace.categories.Debug);
425
- // }
426
- }
427
- }
428
- _handleTwoNavigationBars(backToMoreWillBeVisible) {
429
- // TODO
430
- // if (Trace.isEnabled()) {
431
- // Trace.write(`TabView._handleTwoNavigationBars(backToMoreWillBeVisible: ${backToMoreWillBeVisible})`, Trace.categories.Debug);
432
- // }
433
- // The "< Back" and "< More" navigation bars should not be visible simultaneously.
434
- const page = this.page || this._selectedView.page || this._selectedView.currentPage;
435
- if (!page || !page.frame) {
436
- return;
437
- }
438
- const actionBarVisible = page.frame._getNavBarVisible(page);
439
- if (backToMoreWillBeVisible && actionBarVisible) {
440
- page.frame.ios._disableNavBarAnimation = true;
441
- page.actionBarHidden = true;
442
- page.frame.ios._disableNavBarAnimation = false;
443
- this._actionBarHiddenByTabView = true;
444
- // TODO
445
- // if (Trace.isEnabled()) {
446
- // Trace.write(`TabView hid action bar`, Trace.categories.Debug);
447
- // }
448
- return;
449
- }
450
- if (!backToMoreWillBeVisible && this._actionBarHiddenByTabView) {
451
- page.frame.ios._disableNavBarAnimation = true;
452
- page.actionBarHidden = false;
453
- page.frame.ios._disableNavBarAnimation = false;
454
- this._actionBarHiddenByTabView = undefined;
455
- // TODO
456
- // if (Trace.isEnabled()) {
457
- // Trace.write(`TabView restored action bar`, Trace.categories.Debug);
458
- // }
459
- return;
460
- }
461
- }
462
- getViewController(item) {
463
- let newController = item.content ? item.content.viewController : null;
464
- if (newController) {
465
- item.setViewController(newController, newController.view);
466
- return newController;
467
- }
468
- if (item.content.ios instanceof UIViewController) {
469
- newController = item.content.ios;
470
- item.setViewController(newController, newController.view);
471
- }
472
- else if (item.content.ios && item.content.ios.controller instanceof UIViewController) {
473
- newController = item.content.ios.controller;
474
- item.setViewController(newController, newController.view);
475
- }
476
- else {
477
- newController = IOSHelper.UILayoutViewController.initWithOwner(new WeakRef(item.content));
478
- newController.view.addSubview(item.content.nativeViewProtected);
479
- item.content.viewController = newController;
480
- item.setViewController(newController, item.content.nativeViewProtected);
481
- }
482
- return newController;
483
- }
484
- setViewControllers(items) {
485
- const length = items ? items.length : 0;
486
- if (length === 0) {
487
- this.viewController.viewControllers = null;
488
- return;
489
- }
490
- // Limit both tabContentItems and tabStripItems to 5 in order to prevent iOS 'more' button
491
- items = items.slice(0, maxTabsCount);
492
- const controllers = NSMutableArray.alloc().initWithCapacity(length);
493
- if (this.tabStrip) {
494
- this.tabStrip.setNativeView(this.viewController.tabBar);
495
- }
496
- items.forEach((item, i) => {
497
- const controller = this.getViewController(item);
498
- if (this.tabStrip && this.tabStrip.items && this.tabStrip.items[i]) {
499
- const tabStripItem = this.tabStrip.items[i];
500
- const tabBarItem = this.createTabBarItem(tabStripItem, i);
501
- updateTitleAndIconPositions(tabStripItem, tabBarItem, controller);
502
- this.setViewAttributes(tabBarItem, tabStripItem.label);
503
- controller.tabBarItem = tabBarItem;
504
- tabStripItem.index = i;
505
- tabStripItem.setNativeView(tabBarItem);
506
- }
507
- controllers.addObject(controller);
508
- });
509
- this.setItemImages();
510
- this.viewController.viewControllers = controllers;
511
- this.viewController.customizableViewControllers = null;
512
- // When we set this.viewController.viewControllers, someone is clearing the moreNavigationController.delegate, so we have to reassign it each time here.
513
- this.viewController.moreNavigationController.delegate = this.mMoreNavigationControllerDelegate;
514
- }
515
- setItemImages() {
516
- if (this.mSelectedItemColor || this.mUnSelectedItemColor) {
517
- if (this.tabStrip && this.tabStrip.items) {
518
- this.tabStrip.items.forEach((item) => {
519
- if (this.mUnSelectedItemColor && item.nativeView) {
520
- item.nativeView.image = this.getIcon(item, this.mUnSelectedItemColor);
521
- item.nativeView.tintColor = this.mUnSelectedItemColor;
522
- }
523
- if (this.mSelectedItemColor && item.nativeView) {
524
- item.nativeView.selectedImage = this.getIcon(item, this.mSelectedItemColor);
525
- item.nativeView.tintColor = this.mSelectedItemColor;
526
- }
527
- });
528
- }
529
- }
530
- }
531
- updateAllItemsColors() {
532
- this.setItemColors();
533
- if (this.tabStrip && this.tabStrip.items) {
534
- this.tabStrip.items.forEach((tabStripItem) => {
535
- this.updateItemColors(tabStripItem);
536
- });
537
- }
538
- }
539
- updateItemColors(tabStripItem) {
540
- updateBackgroundPositions(this.tabStrip, tabStripItem);
541
- this.setIconColor(tabStripItem, true);
542
- }
543
- createTabBarItem(item, index) {
544
- let image;
545
- let title;
546
- if (item.isLoaded) {
547
- image = this.getIcon(item);
548
- title = item.label.text;
549
- const textTransform = item.label.style.textTransform;
550
- if (textTransform) {
551
- title = getTransformedText(title, textTransform);
552
- }
553
- }
554
- return UITabBarItem.alloc().initWithTitleImageTag(title, image, index);
555
- }
556
- getIconRenderingMode() {
557
- switch (this.tabStrip && this.tabStrip.iosIconRenderingMode) {
558
- case 'alwaysOriginal':
559
- return 1 /* UIImageRenderingMode.AlwaysOriginal */;
560
- case 'alwaysTemplate':
561
- return 2 /* UIImageRenderingMode.AlwaysTemplate */;
562
- case 'automatic':
563
- default:
564
- return 0 /* UIImageRenderingMode.Automatic */;
565
- }
566
- }
567
- getIcon(tabStripItem, color) {
568
- // Image and Label children of TabStripItem
569
- // take priority over its `iconSource` and `title` properties
570
- const iconSource = tabStripItem.image && tabStripItem.image.src;
571
- if (!iconSource) {
572
- return null;
573
- }
574
- const target = tabStripItem.image;
575
- const font = target.style.fontInternal || Font.default;
576
- if (!color) {
577
- color = target.style.color;
578
- }
579
- const iconTag = [iconSource, font.fontStyle, font.fontWeight, font.fontSize, font.fontFamily, color].join(';');
580
- let isFontIcon = false;
581
- let image = this.mIconsCache[iconTag];
582
- if (!image) {
583
- let is;
584
- if (Utils.isFontIconURI(iconSource)) {
585
- isFontIcon = true;
586
- const fontIconCode = iconSource.split('//')[1];
587
- is = ImageSource.fromFontIconCodeSync(fontIconCode, font, color);
588
- }
589
- else {
590
- is = ImageSource.fromFileOrResourceSync(iconSource);
591
- }
592
- if (is && is.ios) {
593
- image = is.ios;
594
- if (this.tabStrip && this.tabStrip.isIconSizeFixed) {
595
- image = this.getFixedSizeIcon(image);
596
- }
597
- let renderingMode = 1 /* UIImageRenderingMode.AlwaysOriginal */;
598
- if (!isFontIcon) {
599
- renderingMode = this.getIconRenderingMode();
600
- }
601
- const originalRenderedImage = image.imageWithRenderingMode(renderingMode);
602
- this.mIconsCache[iconTag] = originalRenderedImage;
603
- image = originalRenderedImage;
604
- }
605
- else {
606
- // TODO
607
- // traceMissingIcon(iconSource);
608
- }
609
- }
610
- return image;
611
- }
612
- getFixedSizeIcon(image) {
613
- const inWidth = image.size.width;
614
- const inHeight = image.size.height;
615
- const iconSpecSize = getIconSpecSize({
616
- width: inWidth,
617
- height: inHeight
618
- });
619
- const widthPts = iconSpecSize.width;
620
- const heightPts = iconSpecSize.height;
621
- UIGraphicsBeginImageContextWithOptions({ width: widthPts, height: heightPts }, false, Utils.layout.getDisplayDensity());
622
- image.drawInRect(CGRectMake(0, 0, widthPts, heightPts));
623
- const resultImage = UIGraphicsGetImageFromCurrentImageContext();
624
- UIGraphicsEndImageContext();
625
- return resultImage;
626
- }
627
- // private _updateIOSTabBarColorsAndFonts(): void {
628
- // if (!this.tabStrip || !this.tabStrip.items || !this.tabStrip.items.length) {
629
- // return;
630
- // }
631
- // const tabBar = <UITabBar>this.ios.tabBar;
632
- // const states = getTitleAttributesForStates(this);
633
- // for (let i = 0; i < tabBar.items.count; i++) {
634
- // applyStatesToItem(tabBar.items[i], states);
635
- // }
636
- // }
637
- // TODO: Move this to TabStripItem
638
- // [fontInternalProperty.getDefault](): Font {
639
- // return null;
640
- // }
641
- // [fontInternalProperty.setNative](value: Font) {
642
- // this._updateIOSTabBarColorsAndFonts();
643
- // }
644
- [selectedIndexProperty.setNative](value) {
645
- // TODO
646
- // if (Trace.isEnabled()) {
647
- // Trace.write("TabView._onSelectedIndexPropertyChangedSetNativeValue(" + value + ")", Trace.categories.Debug);
648
- // }
649
- if (value > -1) {
650
- this.viewController._willSelectViewController = this.viewController.viewControllers[value];
651
- this.viewController.selectedIndex = value;
652
- }
653
- }
654
- [itemsProperty.getDefault]() {
655
- return null;
656
- }
657
- [itemsProperty.setNative](value) {
658
- if (value) {
659
- value.forEach((item, i) => {
660
- item.index = i;
661
- });
662
- }
663
- this.setViewControllers(value);
664
- selectedIndexProperty.coerce(this);
665
- }
666
- [tabStripProperty.getDefault]() {
667
- return null;
668
- }
669
- [tabStripProperty.setNative](value) {
670
- this.setViewControllers(this.items);
671
- selectedIndexProperty.coerce(this);
672
- }
673
- setViewAttributes(item, view) {
674
- if (!view) {
675
- return null;
676
- }
677
- const defaultTabItemFontSize = 10;
678
- const tabItemFontSize = view.style.fontSize || defaultTabItemFontSize;
679
- const font = (view.style.fontInternal || Font.default).getUIFont(UIFont.systemFontOfSize(tabItemFontSize));
680
- const tabItemTextColor = view.style.color;
681
- const textColor = tabItemTextColor instanceof Color ? tabItemTextColor.ios : null;
682
- const attributes = { [NSFontAttributeName]: font };
683
- // if selectedItemColor or unSelectedItemColor is set we don't respect the color from the style
684
- if (!this.mSelectedItemColor && !this.mUnSelectedItemColor) {
685
- if (textColor) {
686
- attributes[UITextAttributeTextColor] = textColor;
687
- attributes[NSForegroundColorAttributeName] = textColor;
688
- }
689
- }
690
- else {
691
- this.viewController.tabBar.unselectedItemTintColor = this.mUnSelectedItemColor && this.mUnSelectedItemColor.ios;
692
- this.viewController.tabBar.selectedImageTintColor = this.mSelectedItemColor && this.mSelectedItemColor.ios;
693
- }
694
- item.setTitleTextAttributesForState(attributes, 4 /* UIControlState.Selected */);
695
- item.setTitleTextAttributesForState(attributes, 0 /* UIControlState.Normal */);
696
- // there's a bug when setting the item color on ios 13 if there's no background set to the tabstrip
697
- // https://books.google.bg/books?id=99_BDwAAQBAJ&q=tabBar.unselectedItemTintColor
698
- // to fix the above issue we are applying the selected fix only for the case, when there is no background set
699
- // in that case we have the following known issue:
700
- // // we will set the color to all unselected items, so you won't be able to set different colors for the different not selected items
701
- if (!this.viewController.tabBar.barTintColor && attributes[UITextAttributeTextColor] && majorVersion > 9) {
702
- this.viewController.tabBar.unselectedItemTintColor = attributes[UITextAttributeTextColor];
703
- }
704
- }
705
- };
706
- BottomNavigation = __decorate([
707
- CSSType('BottomNavigation')
708
- ], BottomNavigation);
709
- export { BottomNavigation };
710
- iosCustomPositioningProperty.register(BottomNavigation);
711
- //# sourceMappingURL=index.ios.js.map
package/index.ios.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.ios.js","sourceRoot":"../src/","sources":["index.ios.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,gEAAgE,CAAC;AAChG,OAAO,EA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AAI,CAAC,kBAAkB,CAAC,GAAG,CAAC;SAC9G;QAED,IAAI,CAAC,8BAA8B,CAAC,UAAU,kCAA0B,CAAC;QACzE,IAAI,CAAC,8BAA8B,CAAC,UAAU,gCAAwB,CAAC;QAEvE,mGAAmG;QACnG,iFAAiF;QACjF,6GAA6G;QAC7G,kDAAkD;QAClD,sIAAsI;QACtI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,IAAI,UAAU,CAAC,wBAAwB,CAAC,IAAI,YAAY,GAAG,CAAC,EAAE;YACtG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,uBAAuB,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;SAC7F;IACL,CAAC;CACJ,CAAA;AA7iBY,gBAAgB;IAD5B,OAAO,CAAC,kBAAkB,CAAC;GACf,gBAAgB,CA6iB5B;SA7iBY,gBAAgB;AA8iB7B,4BAA4B,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC"}
package/react/index.d.ts DELETED
@@ -1,26 +0,0 @@
1
- import { NativeScriptProps } from 'react-nativescript';
2
- import { BottomNavigation, SelectedIndexChangedEventData, TabContentItem, TabStrip } from '../';
3
- import { TabNavigationBaseAttributes } from '@nativescript-community/ui-material-core-tabs/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 DELETED
@@ -1,80 +0,0 @@
1
- import { NSVElement, 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',
11
- // @ts-ignore I can assure that this really does extend ViewBase
12
- () => BottomNavigation, {
13
- // TODO: share the same NodeOps for both BottomNavigation and Tabs; they're identical as they both extend TabNavigationBase.
14
- nodeOps: {
15
- insert(child, parent, atIndex) {
16
- const bottomNavigation = parent.nativeView;
17
- if (child.nodeRole === 'tabStrip') {
18
- if (child.nativeView instanceof TabStrip) {
19
- bottomNavigation.tabStrip = child.nativeView;
20
- }
21
- else {
22
- if (enableDebugLogging) {
23
- warn(`Unable to add child "${child.nativeView.constructor.name}" as the tabStrip of <bottomNavigation> as it is not an instance of TabStrip.`);
24
- }
25
- }
26
- }
27
- else if (child.nodeRole === 'items') {
28
- if (child.nativeView instanceof TabContentItem === false) {
29
- if (enableDebugLogging) {
30
- warn(`Unable to add child "${child.nativeView.constructor.name}" to the items of <bottomNavigation> as it is not an instance of TabContentItem.`);
31
- }
32
- return;
33
- }
34
- const items = bottomNavigation.items || []; // Annoyingly, it's the consumer's responsibility to ensure there's an array there!
35
- if (typeof atIndex === 'undefined' || atIndex === items.length) {
36
- bottomNavigation._addChildFromBuilder('items', child.nativeView);
37
- }
38
- else {
39
- const itemsClone = items.slice();
40
- itemsClone.splice(atIndex, 0, child.nativeView);
41
- bottomNavigation.items = itemsClone;
42
- }
43
- }
44
- else if (child.nodeRole === 'item') {
45
- if (enableDebugLogging) {
46
- warn(`Unable to add child "${child.nativeView.constructor.name}" to <bottomNavigation> as it had the nodeRole "item"; please correct it to "items".`);
47
- }
48
- }
49
- else {
50
- if (enableDebugLogging) {
51
- warn(`Unable to add child "${child.nativeView.constructor.name}" to <bottomNavigation> as it does not have a nodeRole specified; ` +
52
- 'please set a nodeRole of "tabStrip", or "items".');
53
- }
54
- }
55
- },
56
- remove(child, parent) {
57
- const tabs = parent.nativeView;
58
- if (child.nodeRole === 'tabStrip') {
59
- tabs.tabStrip = null; // Anything falsy should work.
60
- }
61
- else if (child.nodeRole === 'items') {
62
- tabs.items = (tabs.items || []).filter((i) => i !== child.nativeView);
63
- }
64
- else if (child.nodeRole === 'item') {
65
- if (enableDebugLogging) {
66
- warn(`Unable to remove child "${child.nativeView.constructor.name}" from <bottomNavigation> as it had the nodeRole "item"; please correct it to "items".`);
67
- }
68
- }
69
- else {
70
- if (enableDebugLogging) {
71
- warn(`Unable to remove child "${child.nativeView.constructor.name}" from <bottomNavigation> as it does not have a nodeRole specified; ` +
72
- 'please set a nodeRole of "tabStrip", or "items"');
73
- }
74
- }
75
- }
76
- }
77
- });
78
- installed = true;
79
- }
80
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAiC,cAAc,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAyBhG,IAAI,SAAS,GAAY,KAAK,CAAC;AAM/B,MAAM,UAAU,wBAAwB,CAAC,OAAwC,EAAE;IAC/E,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;IAE5C,IAAI,SAAS,EAAE;QACX,OAAO;KACV;IACD,eAAe,CACX,kBAAkB;IAClB,gEAAgE;IAChE,GAAG,EAAE,CAAC,gBAAgB,EACtB;QACI,4HAA4H;QAC5H,OAAO,EAAE;YACL,MAAM,CAAC,KAAiB,EAAE,MAAoC,EAAE,OAAgB;gBAC5E,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,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AI,kBAAkB,EAAE;wBACpB,IAAI,CACA,wBAAwB,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,oEAAoE;4BACzH,kDAAkD,CACzD,CAAC;qBACL;iBACJ;YACL,CAAC;YACD,MAAM,CAAC,KAAiB,EAAE,MAAoC;gBAC1D,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;gBAE/B,IAAI,KAAK,CAAC,QAAQ,KAAK,UAAU,EAAE;oBAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,8BAA8B;iBACvD;qBAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;oBACnC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,UAAU,CAAC,CAAC;iBACzE;qBAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM,EAAE;oBAClC,IAAI,kBAAkB,EAAE;wBACpB,IAAI,CAAC,2BAA2B,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,wFAAwF,CAAC,CAAC;qBAC9J;iBACJ;qBAAM;oBACH,IAAI,kBAAkB,EAAE;wBACpB,IAAI,CACA,2BAA2B,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,sEAAsE;4BAC9H,iDAAiD,CACxD,CAAC;qBACL;iBACJ;YACL,CAAC;SACJ;KACJ,CACJ,CAAC;IAEF,SAAS,GAAG,IAAI,CAAC;AACrB,CAAC"}
@@ -1,12 +0,0 @@
1
- declare const _default: {
2
- model: {
3
- prop: string;
4
- event: string;
5
- };
6
- render(h: any): any;
7
- methods: {
8
- registerTabStrip(tabStrip: any): void;
9
- registerTabContentItem(tabContentItem: any): void;
10
- };
11
- };
12
- export default _default;
package/vue/component.js DELETED
@@ -1,22 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"../src/","sources":["vue/component.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,KAAK,EAAE;QACH,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,qBAAqB;KAC/B;IAED,MAAM,CAAC,CAAC;QACJ,OAAO,CAAC,CACJ,0BAA0B,EAC1B;YACI,EAAE,EAAE,IAAI,CAAC,UAAU;YACnB,KAAK,EAAE,IAAI,CAAC,MAAM;SACrB,EACD,IAAI,CAAC,MAAM,CAAC,OAAO,CACtB,CAAC;IACN,CAAC;IAED,OAAO,EAAE;QACL,gBAAgB,CAAC,QAAQ;YACrB,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAChD,CAAC;QACD,sBAAsB,CAAC,cAAc;YACjC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC;YAE9C,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC;KACJ;CACJ,CAAC"}
package/vue/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- declare const _default: {
2
- install(Vue: any): void;
3
- };
4
- export default _default;
package/vue/index.js DELETED
@@ -1,20 +0,0 @@
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
package/vue/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAE/E,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,eAAe;IACX,OAAO,CAAC,GAAG;QACP,IAAI,CAAC,SAAS,EAAE;YACZ,SAAS,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE;gBAC9D,KAAK,EAAE;oBACH,IAAI,EAAE,eAAe;oBACrB,KAAK,EAAE,qBAAqB;iBAC/B;gBACD,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO;aAC5C,CAAC,CAAC;YACH,GAAG,CAAC,eAAe,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YAClE,GAAG,CAAC,eAAe,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAC9D,GAAG,CAAC,eAAe,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SACzD;IACL,CAAC;CACJ,CAAC"}