|
1 | 1 | /**
|
2 |
| - * Contains the TabView class, which represents a standard content component with tabs. |
3 |
| - * @module "ui/tab-view" |
| 2 | + * Contains the Tabs class, which represents a tab navigation component. |
| 3 | + * @module "ui/tabs" |
4 | 4 | */ /** */
|
5 | 5 |
|
6 |
| - import { Property, EventData } from "../core/view"; |
7 |
| - import { TabNavigationBase, SelectedIndexChangedEventData } from "../tab-navigation-base/tab-navigation-base"; |
8 |
| - import { TabContentItem } from "../tab-navigation-base/tab-content-item"; |
9 |
| - import { TabStrip } from "../tab-navigation-base/tab-strip"; |
| 6 | +import { EventData, Property } from "../core/view"; |
| 7 | +import { TabContentItem } from "../tab-navigation-base/tab-content-item"; |
| 8 | +import { |
| 9 | + SelectedIndexChangedEventData, TabNavigationBase |
| 10 | +} from "../tab-navigation-base/tab-navigation-base"; |
| 11 | +import { TabStrip } from "../tab-navigation-base/tab-strip"; |
10 | 12 |
|
11 |
| - export * from "../tab-navigation-base/tab-content-item"; |
12 |
| - export * from "../tab-navigation-base/tab-navigation-base"; |
13 |
| - export * from "../tab-navigation-base/tab-strip"; |
14 |
| - export * from "../tab-navigation-base/tab-strip-item"; |
15 |
| - |
16 |
| - /** |
17 |
| - * Represents a swipeable tabs view. |
18 |
| - */ |
19 |
| - export class Tabs extends TabNavigationBase { |
20 |
| - /** |
21 |
| - * Gets or sets the items of the Tabs. |
22 |
| - */ |
23 |
| - items: Array<TabContentItem>; |
24 |
| - |
25 |
| - /** |
26 |
| - * Gets or sets the tab strip of the Tabs. |
27 |
| - */ |
28 |
| - tabStrip: TabStrip; |
29 |
| - |
30 |
| - /** |
31 |
| - * Gets or sets the selectedIndex of the Tabs. |
32 |
| - */ |
33 |
| - selectedIndex: number; |
| 13 | +export * from "../tab-navigation-base/tab-content-item"; |
| 14 | +export * from "../tab-navigation-base/tab-navigation-base"; |
| 15 | +export * from "../tab-navigation-base/tab-strip"; |
| 16 | +export * from "../tab-navigation-base/tab-strip-item"; |
34 | 17 |
|
35 |
| - /** |
36 |
| - * Gets or sets the swipe enabled state of the Tabs. |
37 |
| - */ |
38 |
| - swipeEnabled: boolean; |
| 18 | +/** |
| 19 | + * Represents a swipeable tabs view. |
| 20 | + */ |
| 21 | +export class Tabs extends TabNavigationBase { |
| 22 | + /** |
| 23 | + * Gets or sets the items of the Tabs. |
| 24 | + */ |
| 25 | + items: Array<TabContentItem>; |
39 | 26 |
|
40 |
| - /** |
41 |
| - * Gets or sets the number of offscreen preloaded tabs of the Tabs. |
42 |
| - */ |
43 |
| - offscreenTabLimit: number; |
| 27 | + /** |
| 28 | + * Gets or sets the tab strip of the Tabs. |
| 29 | + */ |
| 30 | + tabStrip: TabStrip; |
44 | 31 |
|
45 |
| - /** |
46 |
| - * Gets or sets the position state of the Tabs. |
47 |
| - */ |
48 |
| - tabsPosition: "top" | "bottom"; |
49 |
| - |
50 |
| - /** |
51 |
| - * 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. |
52 |
| - */ |
53 |
| - android: any /* android.view.View */; //android.support.v4.view.ViewPager; |
54 |
| - |
55 |
| - /** |
56 |
| - * 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. |
57 |
| - */ |
58 |
| - ios: any /* UITabBarController */; |
59 |
| - |
60 |
| - /** |
61 |
| - * String value used when hooking to the selectedIndexChanged event. |
62 |
| - */ |
63 |
| - public static selectedIndexChangedEvent: string; |
64 |
| - |
65 |
| - /** |
66 |
| - * A basic method signature to hook an event listener (shortcut alias to the addEventListener method). |
67 |
| - * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change"). |
68 |
| - * @param callback - Callback function which will be executed when event is raised. |
69 |
| - * @param thisArg - An optional parameter which will be used as `this` context for callback execution. |
70 |
| - */ |
71 |
| - on(eventNames: string, callback: (data: EventData) => void, thisArg?: any); |
72 |
| - |
73 |
| - /** |
74 |
| - * Raised when the selected index changes. |
75 |
| - */ |
76 |
| - on(event: "selectedIndexChanged", callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any); |
77 |
| - } |
78 |
| - |
79 |
| - export const itemsProperty: Property<Tabs, TabContentItem[]>; |
80 |
| - export const tabStripProperty: Property<Tabs, TabStrip> |
81 |
| - export const selectedIndexProperty: Property<Tabs, number>; |
| 32 | + /** |
| 33 | + * Gets or sets the selectedIndex of the Tabs. |
| 34 | + */ |
| 35 | + selectedIndex: number; |
| 36 | + |
| 37 | + /** |
| 38 | + * Gets or sets the swipe enabled state of the Tabs. |
| 39 | + */ |
| 40 | + swipeEnabled: boolean; |
| 41 | + |
| 42 | + /** |
| 43 | + * Gets or sets the number of offscreen preloaded tabs of the Tabs. |
| 44 | + */ |
| 45 | + offscreenTabLimit: number; |
| 46 | + |
| 47 | + /** |
| 48 | + * Gets or sets the position state of the Tabs. |
| 49 | + */ |
| 50 | + tabsPosition: "top" | "bottom"; |
| 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 | + * A basic method signature to hook an event listener (shortcut alias to the addEventListener method). |
| 69 | + * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change"). |
| 70 | + * @param callback - Callback function which will be executed when event is raised. |
| 71 | + * @param thisArg - An optional parameter which will be used as `this` context for callback execution. |
| 72 | + */ |
| 73 | + on(eventNames: string, callback: (data: EventData) => void, thisArg?: any); |
| 74 | + |
| 75 | + /** |
| 76 | + * Raised when the selected index changes. |
| 77 | + */ |
| 78 | + on(event: "selectedIndexChanged", callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any); |
| 79 | +} |
| 80 | + |
| 81 | +export const itemsProperty: Property<Tabs, TabContentItem[]>; |
| 82 | +export const tabStripProperty: Property<Tabs, TabStrip> |
| 83 | +export const selectedIndexProperty: Property<Tabs, number>; |
0 commit comments