Files
Vasil Trifonov 458943111e Tabs styling improvements (#8366)
* fix(tabs): delay loadView when animation runs

* chore: update api.md

* chore: remove unnecessary casting

* test: Added disabled test for changing tabs

* tabs(ios): added tabs styling in ios

* tabs: added iosAlignment property

* tabs: textTransform support

* tabs: iosAlignment moved to tabstrip

* test: add frame-in-tabs test

* chore: addressing PR comments

* chore: addressing PR comments

* chore: call method on the instance instead of call

* chore: move IOSAlignment property

* chore: update comments

* fix: texttransform to tabstrip in bottomnavigation

* chore: add new item to native-api-usage

* chore: remove unneeded setNativeView call

* chore: removed unneeded check

Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
2020-03-09 15:24:26 +02:00

46 lines
1.8 KiB
TypeScript

// Types
import { Tabs as TabsDefinition } from ".";
// Requires
import { TabNavigationBase } from "../tab-navigation-base/tab-navigation-base";
import { CSSType, booleanConverter } from "../core/view";
import { Property } from "../core/properties";
export * from "../tab-navigation-base/tab-content-item";
export * from "../tab-navigation-base/tab-navigation-base";
export * from "../tab-navigation-base/tab-strip";
export * from "../tab-navigation-base/tab-strip-item";
export const traceCategory = "TabView";
export module knownCollections {
export const items = "items";
}
@CSSType("Tabs")
export class TabsBase extends TabNavigationBase implements TabsDefinition {
public swipeEnabled: boolean;
public offscreenTabLimit: number;
public tabsPosition: "top" | "bottom";
public iOSTabBarItemsAlignment: IOSTabBarItemsAlignment;
}
// TODO: Add Unit tests
export const swipeEnabledProperty = new Property<TabsBase, boolean>({
name: "swipeEnabled", defaultValue: true, valueConverter: booleanConverter
});
swipeEnabledProperty.register(TabsBase);
// TODO: Add Unit tests
// TODO: Coerce to max number of items?
export const offscreenTabLimitProperty = new Property<TabsBase, number>({
name: "offscreenTabLimit", defaultValue: 1, valueConverter: (v) => parseInt(v)
});
offscreenTabLimitProperty.register(TabsBase);
export const tabsPositionProperty = new Property<TabsBase, "top" | "bottom">({ name: "tabsPosition", defaultValue: "top" });
tabsPositionProperty.register(TabsBase);
export type IOSTabBarItemsAlignment = "leading" | "justified" | "center" | "centerSelected";
export const iOSTabBarItemsAlignmentProperty = new Property<TabsBase, IOSTabBarItemsAlignment>({ name: "iOSTabBarItemsAlignment", defaultValue: "justified" });
iOSTabBarItemsAlignmentProperty.register(TabsBase);