|
6 | 6 | * @restrict E
|
7 | 7 | *
|
8 | 8 | * @description
|
9 |
| - * The `<md-tabs>` directive serves as the container for 1..n `<md-tab>` child directives to |
10 |
| - * produces a Tabs components. In turn, the nested `<md-tab>` directive is used to specify a tab |
11 |
| - * label for the **header button** and a [optional] tab view content that will be associated with |
12 |
| - * each tab button. |
| 9 | + * The `<md-tabs>` directive serves as the container for 1..n |
| 10 | + * <a ng-href="api/directive/mdTab">`<md-tab>`</a> child directives. |
| 11 | + * In turn, the nested `<md-tab>` directive is used to specify a tab label for the |
| 12 | + * **header button** and <i>optional</i> tab view content that will be associated with each tab |
| 13 | + * button. |
13 | 14 | *
|
14 | 15 | * Below is the markup for its simplest usage:
|
15 | 16 | *
|
|
21 | 22 | * </md-tabs>
|
22 | 23 | * </hljs>
|
23 | 24 | *
|
24 |
| - * Tabs supports three (3) usage scenarios: |
| 25 | + * Tabs support three (3) usage scenarios: |
25 | 26 | *
|
26 | 27 | * 1. Tabs (buttons only)
|
27 | 28 | * 2. Tabs with internal view content
|
28 | 29 | * 3. Tabs with external view content
|
29 | 30 | *
|
30 |
| - * **Tab-only** support is useful when tab buttons are used for custom navigation regardless of any |
| 31 | + * **Tabs-only** support is useful when tab buttons are used for custom navigation regardless of any |
31 | 32 | * other components, content, or views.
|
32 | 33 | *
|
33 |
| - * <i><b>Note:</b> If you are using the Tabs component for page-level navigation, please take a look |
34 |
| - * at the <a ng-href="./api/directive/mdNavBar">NavBar component</a> instead as it can handle this |
35 |
| - * case a bit more natively.</i> |
| 34 | + * <i><b>Note:</b> If you are using the Tabs component for page-level navigation, please use |
| 35 | + * the <a ng-href="./api/directive/mdNavBar">NavBar component</a> instead. It handles this |
| 36 | + * case a more natively and more performantly.</i> |
36 | 37 | *
|
37 |
| - * **Tabs with internal views** are the traditional usages where each tab has associated view |
| 38 | + * **Tabs with internal views** are the traditional usage where each tab has associated view |
38 | 39 | * content and the view switching is managed internally by the Tabs component.
|
39 | 40 | *
|
40 | 41 | * **Tabs with external view content** is often useful when content associated with each tab is
|
|
47 | 48 | *
|
48 | 49 | * ### Explanation of tab stretching
|
49 | 50 | *
|
50 |
| - * Initially, tabs will have an inherent size. This size will either be defined by how much space is needed to accommodate their text or set by the user through CSS. Calculations will be based on this size. |
| 51 | + * Initially, tabs will have an inherent size. This size will either be defined by how much space |
| 52 | + * is needed to accommodate their text or set by the user through CSS. |
| 53 | + * Calculations will be based on this size. |
51 | 54 | *
|
52 |
| - * On mobile devices, tabs will be expanded to fill the available horizontal space. When this happens, all tabs will become the same size. |
| 55 | + * On mobile devices, tabs will be expanded to fill the available horizontal space. |
| 56 | + * When this happens, all tabs will become the same size. |
53 | 57 | *
|
54 | 58 | * On desktops, by default, stretching will never occur.
|
55 | 59 | *
|
56 |
| - * This default behavior can be overridden through the `md-stretch-tabs` attribute. Here is a table showing when stretching will occur: |
| 60 | + * This default behavior can be overridden through the `md-stretch-tabs` attribute. |
| 61 | + * Here is a table showing when stretching will occur: |
57 | 62 | *
|
58 | 63 | * `md-stretch-tabs` | mobile | desktop
|
59 | 64 | * ------------------|-----------|--------
|
60 | 65 | * `auto` | stretched | ---
|
61 | 66 | * `always` | stretched | stretched
|
62 | 67 | * `never` | --- | ---
|
63 | 68 | *
|
64 |
| - * @param {integer=} md-selected Index of the active/selected tab |
| 69 | + * @param {integer=} md-selected Index of the active/selected tab. |
65 | 70 | * @param {boolean=} md-no-ink If present, disables ink ripple effects.
|
66 | 71 | * @param {boolean=} md-no-ink-bar If present, disables the selection ink bar.
|
67 |
| - * @param {string=} md-align-tabs Attribute to indicate position of tab buttons: `bottom` or `top`; default is `top` |
68 |
| - * @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`, `always`, or `never`; default is `auto` |
69 |
| - * @param {boolean=} md-dynamic-height When enabled, the tab wrapper will resize based on the contents of the selected tab |
70 |
| - * @param {boolean=} md-border-bottom If present, shows a solid `1px` border between the tabs and their content |
71 |
| - * @param {boolean=} md-center-tabs When enabled, tabs will be centered provided there is no need for pagination |
72 |
| - * @param {boolean=} md-no-pagination When enabled, pagination will remain off |
73 |
| - * @param {boolean=} md-swipe-content When enabled, swipe gestures will be enabled for the content area to jump between tabs |
74 |
| - * @param {boolean=} md-enable-disconnect When enabled, scopes will be disconnected for tabs that are not being displayed. This provides a performance boost, but may also cause unexpected issues and is not recommended for most users. |
75 |
| - * @param {boolean=} md-autoselect When present, any tabs added after the initial load will be automatically selected |
76 |
| - * @param {boolean=} md-no-select-click When enabled, click events will not be fired when selecting tabs |
| 72 | + * @param {string=} md-align-tabs Attribute to indicate position of tab buttons: `bottom` or `top`; |
| 73 | + * Default is `top`. |
| 74 | + * @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`, |
| 75 | + * `always`, or `never`; Default is `auto`. |
| 76 | + * @param {boolean=} md-dynamic-height When enabled, the tab wrapper will resize based on the |
| 77 | + * contents of the selected tab. |
| 78 | + * @param {boolean=} md-border-bottom If present, shows a solid `1px` border between the tabs and |
| 79 | + * their content. |
| 80 | + * @param {boolean=} md-center-tabs When enabled, tabs will be centered provided there is no need |
| 81 | + * for pagination. |
| 82 | + * @param {boolean=} md-no-pagination When enabled, pagination will remain off. |
| 83 | + * @param {boolean=} md-swipe-content When enabled, swipe gestures will be enabled for the content |
| 84 | + * area to allow swiping between tabs. |
| 85 | + * @param {boolean=} md-enable-disconnect When enabled, scopes will be disconnected for tabs that |
| 86 | + * are not being displayed. This provides a performance boost, but may also cause unexpected |
| 87 | + * issues. It is not recommended for most users. |
| 88 | + * @param {boolean=} md-autoselect When present, any tabs added after the initial load will be |
| 89 | + * automatically selected. |
| 90 | + * @param {boolean=} md-no-select-click When true, click events will not be fired when the value of |
| 91 | + * `md-active` on an `md-tab` changes. This is useful when using tabs with UI-Router's child |
| 92 | + * states, as triggering a click event in that case can cause an extra tab change to occur. |
77 | 93 | *
|
78 | 94 | * @usage
|
79 | 95 | * <hljs lang="html">
|
@@ -147,7 +163,7 @@ function MdTabs ($$mdSvgRegistry) {
|
147 | 163 | 'ng-repeat="tab in $mdTabsCtrl.tabs" ' +
|
148 | 164 | 'role="tab" ' +
|
149 | 165 | 'id="tab-item-{{::tab.id}}" ' +
|
150 |
| - 'md-tab-id="{{::tab.id}}"' + |
| 166 | + 'md-tab-id="{{::tab.id}}" ' + |
151 | 167 | 'aria-selected="{{tab.isActive()}}" ' +
|
152 | 168 | 'aria-disabled="{{tab.scope.disabled || \'false\'}}" ' +
|
153 | 169 | 'ng-click="$mdTabsCtrl.select(tab.getIndex())" ' +
|
|
0 commit comments