@angular/material 8.1.4 → 8.2.3
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/_theming.scss +13 -11
- package/autocomplete/typings/autocomplete-trigger.d.ts +5 -2
- package/autocomplete/typings/index.metadata.json +1 -1
- package/bundles/material-autocomplete.umd.js +48 -20
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +1 -1
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-button.umd.js +5 -6
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-button.umd.min.js +1 -1
- package/bundles/material-button.umd.min.js.map +1 -1
- package/bundles/material-card.umd.js +1 -1
- package/bundles/material-card.umd.js.map +1 -1
- package/bundles/material-card.umd.min.js +1 -1
- package/bundles/material-card.umd.min.js.map +1 -1
- package/bundles/material-checkbox.umd.js +1 -1
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-checkbox.umd.min.js.map +1 -1
- package/bundles/material-chips.umd.js +24 -4
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-chips.umd.min.js +1 -1
- package/bundles/material-chips.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +20 -18
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +2 -2
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +22 -2
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +2 -2
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-dialog.umd.js +28 -5
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-dialog.umd.min.js +1 -1
- package/bundles/material-dialog.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +15 -2
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +1 -1
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-grid-list.umd.js +1 -1
- package/bundles/material-grid-list.umd.min.js +1 -1
- package/bundles/material-icon.umd.js +103 -42
- package/bundles/material-icon.umd.js.map +1 -1
- package/bundles/material-icon.umd.min.js +1 -1
- package/bundles/material-icon.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +4 -1
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-list.umd.min.js +1 -1
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +35 -19
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-menu.umd.min.js +1 -1
- package/bundles/material-menu.umd.min.js.map +1 -1
- package/bundles/material-paginator.umd.js +1 -1
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-paginator.umd.min.js +1 -1
- package/bundles/material-paginator.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +34 -23
- package/bundles/material-progress-spinner.umd.js.map +1 -1
- package/bundles/material-progress-spinner.umd.min.js +1 -1
- package/bundles/material-progress-spinner.umd.min.js.map +1 -1
- package/bundles/material-radio.umd.js +3 -0
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-radio.umd.min.js +1 -1
- package/bundles/material-radio.umd.min.js.map +1 -1
- package/bundles/material-select.umd.js +14 -2
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-select.umd.min.js +1 -1
- package/bundles/material-select.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js +3 -1
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slide-toggle.umd.min.js +1 -1
- package/bundles/material-slide-toggle.umd.min.js.map +1 -1
- package/bundles/material-slider.umd.js +6 -3
- package/bundles/material-slider.umd.js.map +1 -1
- package/bundles/material-slider.umd.min.js +1 -1
- package/bundles/material-slider.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +7 -8
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +1 -1
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-sort.umd.js +0 -1
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-sort.umd.min.js +1 -1
- package/bundles/material-sort.umd.min.js.map +1 -1
- package/bundles/material-table.umd.js +14 -4
- package/bundles/material-table.umd.js.map +1 -1
- package/bundles/material-table.umd.min.js +1 -1
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +1390 -1208
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +2 -2
- package/bundles/material-tabs.umd.min.js.map +1 -1
- package/bundles/material-tooltip.umd.js +16 -1
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.min.js +1 -1
- package/bundles/material-tooltip.umd.min.js.map +1 -1
- package/bundles/material.umd.js +1767 -1346
- package/bundles/material.umd.js.map +1 -1
- package/bundles/material.umd.min.js +19 -19
- package/bundles/material.umd.min.js.map +1 -1
- package/button/typings/button.d.ts +1 -1
- package/button/typings/index.metadata.json +1 -1
- package/card/typings/index.metadata.json +1 -1
- package/chips/typings/chip.d.ts +4 -2
- package/chips/typings/index.metadata.json +1 -1
- package/core/typings/common-behaviors/common-module.d.ts +2 -2
- package/core/typings/datetime/date-adapter.d.ts +1 -1
- package/core/typings/datetime/native-date-adapter.d.ts +1 -1
- package/core/typings/index.metadata.json +1 -1
- package/core/typings/ripple/ripple-renderer.d.ts +2 -2
- package/core/typings/ripple/ripple.d.ts +1 -1
- package/datepicker/typings/datepicker-intl.d.ts +2 -0
- package/datepicker/typings/index.metadata.json +1 -1
- package/dialog/typings/dialog-config.d.ts +9 -7
- package/dialog/typings/dialog-content-directives.d.ts +2 -0
- package/dialog/typings/dialog-ref.d.ts +10 -0
- package/dialog/typings/index.metadata.json +1 -1
- package/esm2015/autocomplete.js +44 -19
- package/esm2015/autocomplete.js.map +1 -1
- package/esm2015/button.js +3 -5
- package/esm2015/button.js.map +1 -1
- package/esm2015/card.js +1 -1
- package/esm2015/card.js.map +1 -1
- package/esm2015/checkbox.js +1 -1
- package/esm2015/checkbox.js.map +1 -1
- package/esm2015/chips.js +22 -5
- package/esm2015/chips.js.map +1 -1
- package/esm2015/core.js +19 -17
- package/esm2015/core.js.map +1 -1
- package/esm2015/datepicker.js +15 -2
- package/esm2015/datepicker.js.map +1 -1
- package/esm2015/dialog.js +23 -5
- package/esm2015/dialog.js.map +1 -1
- package/esm2015/form-field.js +15 -2
- package/esm2015/form-field.js.map +1 -1
- package/esm2015/grid-list.js +1 -1
- package/esm2015/icon.js +93 -40
- package/esm2015/icon.js.map +1 -1
- package/esm2015/list.js +4 -1
- package/esm2015/list.js.map +1 -1
- package/esm2015/material.js +3 -3
- package/esm2015/menu.js +31 -10
- package/esm2015/menu.js.map +1 -1
- package/esm2015/paginator.js +1 -1
- package/esm2015/paginator.js.map +1 -1
- package/esm2015/progress-spinner.js +31 -23
- package/esm2015/progress-spinner.js.map +1 -1
- package/esm2015/radio.js +3 -0
- package/esm2015/radio.js.map +1 -1
- package/esm2015/select.js +14 -2
- package/esm2015/select.js.map +1 -1
- package/esm2015/slide-toggle.js +3 -1
- package/esm2015/slide-toggle.js.map +1 -1
- package/esm2015/slider.js +6 -2
- package/esm2015/slider.js.map +1 -1
- package/esm2015/snack-bar.js +7 -8
- package/esm2015/snack-bar.js.map +1 -1
- package/esm2015/sort.js +0 -1
- package/esm2015/sort.js.map +1 -1
- package/esm2015/table.js +9 -4
- package/esm2015/table.js.map +1 -1
- package/esm2015/tabs.js +1094 -890
- package/esm2015/tabs.js.map +1 -1
- package/esm2015/tooltip.js +15 -1
- package/esm2015/tooltip.js.map +1 -1
- package/esm5/autocomplete.es5.js +48 -19
- package/esm5/autocomplete.es5.js.map +1 -1
- package/esm5/button.es5.js +5 -6
- package/esm5/button.es5.js.map +1 -1
- package/esm5/card.es5.js +1 -1
- package/esm5/card.es5.js.map +1 -1
- package/esm5/checkbox.es5.js +1 -1
- package/esm5/checkbox.es5.js.map +1 -1
- package/esm5/chips.es5.js +25 -5
- package/esm5/chips.es5.js.map +1 -1
- package/esm5/core.es5.js +21 -19
- package/esm5/core.es5.js.map +1 -1
- package/esm5/datepicker.es5.js +22 -2
- package/esm5/datepicker.es5.js.map +1 -1
- package/esm5/dialog.es5.js +28 -5
- package/esm5/dialog.es5.js.map +1 -1
- package/esm5/form-field.es5.js +15 -2
- package/esm5/form-field.es5.js.map +1 -1
- package/esm5/grid-list.es5.js +1 -1
- package/esm5/icon.es5.js +101 -40
- package/esm5/icon.es5.js.map +1 -1
- package/esm5/list.es5.js +4 -1
- package/esm5/list.es5.js.map +1 -1
- package/esm5/material.es5.js +3 -3
- package/esm5/menu.es5.js +33 -17
- package/esm5/menu.es5.js.map +1 -1
- package/esm5/paginator.es5.js +1 -1
- package/esm5/paginator.es5.js.map +1 -1
- package/esm5/progress-spinner.es5.js +34 -23
- package/esm5/progress-spinner.es5.js.map +1 -1
- package/esm5/radio.es5.js +3 -0
- package/esm5/radio.es5.js.map +1 -1
- package/esm5/select.es5.js +14 -2
- package/esm5/select.es5.js.map +1 -1
- package/esm5/slide-toggle.es5.js +3 -1
- package/esm5/slide-toggle.es5.js.map +1 -1
- package/esm5/slider.es5.js +6 -3
- package/esm5/slider.es5.js.map +1 -1
- package/esm5/snack-bar.es5.js +7 -8
- package/esm5/snack-bar.es5.js.map +1 -1
- package/esm5/sort.es5.js +0 -1
- package/esm5/sort.es5.js.map +1 -1
- package/esm5/table.es5.js +14 -4
- package/esm5/table.es5.js.map +1 -1
- package/esm5/tabs.es5.js +1384 -1207
- package/esm5/tabs.es5.js.map +1 -1
- package/esm5/tooltip.es5.js +16 -1
- package/esm5/tooltip.es5.js.map +1 -1
- package/form-field/typings/form-field.d.ts +2 -0
- package/form-field/typings/index.metadata.json +1 -1
- package/grid-list/typings/index.d.ts +1 -1
- package/grid-list/typings/index.metadata.json +1 -1
- package/icon/typings/icon-registry.d.ts +17 -11
- package/icon/typings/icon.d.ts +3 -2
- package/icon/typings/index.metadata.json +1 -1
- package/list/typings/index.metadata.json +1 -1
- package/menu/typings/index.d.ts +2 -2
- package/menu/typings/index.metadata.json +1 -1
- package/menu/typings/menu-trigger.d.ts +2 -5
- package/package.json +5 -5
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-spinner/typings/index.metadata.json +1 -1
- package/progress-spinner/typings/progress-spinner.d.ts +3 -2
- package/radio/typings/index.metadata.json +1 -1
- package/schematics/ng-add/setup-project.js +8 -8
- package/schematics/ng-add/setup-project.js.map +1 -1
- package/schematics/ng-add/theming/theming.js +6 -6
- package/schematics/ng-add/theming/theming.js.map +1 -1
- package/schematics/ng-update/index.js +2 -2
- package/schematics/ng-update/index.js.map +1 -1
- package/select/typings/index.metadata.json +1 -1
- package/select/typings/select.d.ts +2 -0
- package/slide-toggle/typings/index.metadata.json +1 -1
- package/slider/typings/index.metadata.json +1 -1
- package/slider/typings/slider.d.ts +2 -2
- package/snack-bar/typings/index.metadata.json +1 -1
- package/sort/typings/index.metadata.json +1 -1
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/table-data-source.d.ts +5 -0
- package/tabs/typings/index.d.ts +2 -2
- package/tabs/typings/index.metadata.json +1 -1
- package/tabs/typings/paginated-tab-header.d.ts +8 -5
- package/tabs/typings/public-api.d.ts +4 -4
- package/tabs/typings/tab-body.d.ts +11 -3
- package/tabs/typings/tab-group.d.ts +24 -11
- package/tabs/typings/tab-header.d.ts +12 -5
- package/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts +38 -19
- package/tooltip/typings/index.metadata.json +1 -1
- package/typings/autocomplete/autocomplete-trigger.d.ts +5 -2
- package/typings/autocomplete/index.metadata.json +1 -1
- package/typings/button/button.d.ts +1 -1
- package/typings/button/index.metadata.json +1 -1
- package/typings/card/index.metadata.json +1 -1
- package/typings/chips/chip.d.ts +4 -2
- package/typings/chips/index.metadata.json +1 -1
- package/typings/core/common-behaviors/common-module.d.ts +2 -2
- package/typings/core/datetime/date-adapter.d.ts +1 -1
- package/typings/core/datetime/native-date-adapter.d.ts +1 -1
- package/typings/core/index.metadata.json +1 -1
- package/typings/core/ripple/ripple-renderer.d.ts +2 -2
- package/typings/core/ripple/ripple.d.ts +1 -1
- package/typings/datepicker/datepicker-intl.d.ts +2 -0
- package/typings/datepicker/index.metadata.json +1 -1
- package/typings/dialog/dialog-config.d.ts +9 -7
- package/typings/dialog/dialog-content-directives.d.ts +2 -0
- package/typings/dialog/dialog-ref.d.ts +10 -0
- package/typings/dialog/index.metadata.json +1 -1
- package/typings/esm5/autocomplete/autocomplete-trigger.d.ts +5 -2
- package/typings/esm5/autocomplete/index.metadata.json +1 -1
- package/typings/esm5/button/button.d.ts +1 -1
- package/typings/esm5/button/index.metadata.json +1 -1
- package/typings/esm5/card/index.metadata.json +1 -1
- package/typings/esm5/chips/chip.d.ts +4 -2
- package/typings/esm5/chips/index.metadata.json +1 -1
- package/typings/esm5/core/common-behaviors/common-module.d.ts +2 -2
- package/typings/esm5/core/datetime/date-adapter.d.ts +1 -1
- package/typings/esm5/core/datetime/native-date-adapter.d.ts +1 -1
- package/typings/esm5/core/index.metadata.json +1 -1
- package/typings/esm5/core/ripple/ripple-renderer.d.ts +2 -2
- package/typings/esm5/core/ripple/ripple.d.ts +1 -1
- package/typings/esm5/datepicker/datepicker-intl.d.ts +2 -0
- package/typings/esm5/datepicker/index.metadata.json +1 -1
- package/typings/esm5/dialog/dialog-config.d.ts +9 -7
- package/typings/esm5/dialog/dialog-content-directives.d.ts +2 -0
- package/typings/esm5/dialog/dialog-ref.d.ts +10 -0
- package/typings/esm5/dialog/index.metadata.json +1 -1
- package/typings/esm5/form-field/form-field.d.ts +2 -0
- package/typings/esm5/form-field/index.metadata.json +1 -1
- package/typings/esm5/grid-list/index.d.ts +1 -1
- package/typings/esm5/grid-list/index.metadata.json +1 -1
- package/typings/esm5/icon/icon-registry.d.ts +17 -11
- package/typings/esm5/icon/icon.d.ts +3 -2
- package/typings/esm5/icon/index.metadata.json +1 -1
- package/typings/esm5/list/index.metadata.json +1 -1
- package/typings/esm5/menu/index.d.ts +2 -2
- package/typings/esm5/menu/index.metadata.json +1 -1
- package/typings/esm5/menu/menu-trigger.d.ts +2 -5
- package/typings/esm5/progress-spinner/index.metadata.json +1 -1
- package/typings/esm5/progress-spinner/progress-spinner.d.ts +3 -2
- package/typings/esm5/radio/index.metadata.json +1 -1
- package/typings/esm5/select/index.metadata.json +1 -1
- package/typings/esm5/select/select.d.ts +2 -0
- package/typings/esm5/slide-toggle/index.metadata.json +1 -1
- package/typings/esm5/slider/index.metadata.json +1 -1
- package/typings/esm5/slider/slider.d.ts +2 -2
- package/typings/esm5/snack-bar/index.metadata.json +1 -1
- package/typings/esm5/sort/index.metadata.json +1 -1
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/table/table-data-source.d.ts +5 -0
- package/typings/esm5/tabs/index.d.ts +2 -2
- package/typings/esm5/tabs/index.metadata.json +1 -1
- package/typings/esm5/tabs/paginated-tab-header.d.ts +8 -5
- package/typings/esm5/tabs/public-api.d.ts +4 -4
- package/typings/esm5/tabs/tab-body.d.ts +11 -3
- package/typings/esm5/tabs/tab-group.d.ts +24 -11
- package/typings/esm5/tabs/tab-header.d.ts +12 -5
- package/typings/esm5/tabs/tab-nav-bar/tab-nav-bar.d.ts +38 -19
- package/typings/esm5/tooltip/index.metadata.json +1 -1
- package/typings/form-field/form-field.d.ts +2 -0
- package/typings/form-field/index.metadata.json +1 -1
- package/typings/grid-list/index.d.ts +1 -1
- package/typings/grid-list/index.metadata.json +1 -1
- package/typings/icon/icon-registry.d.ts +17 -11
- package/typings/icon/icon.d.ts +3 -2
- package/typings/icon/index.metadata.json +1 -1
- package/typings/list/index.metadata.json +1 -1
- package/typings/menu/index.d.ts +2 -2
- package/typings/menu/index.metadata.json +1 -1
- package/typings/menu/menu-trigger.d.ts +2 -5
- package/typings/progress-spinner/index.metadata.json +1 -1
- package/typings/progress-spinner/progress-spinner.d.ts +3 -2
- package/typings/radio/index.metadata.json +1 -1
- package/typings/select/index.metadata.json +1 -1
- package/typings/select/select.d.ts +2 -0
- package/typings/slide-toggle/index.metadata.json +1 -1
- package/typings/slider/index.metadata.json +1 -1
- package/typings/slider/slider.d.ts +2 -2
- package/typings/snack-bar/index.metadata.json +1 -1
- package/typings/sort/index.metadata.json +1 -1
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/table-data-source.d.ts +5 -0
- package/typings/tabs/index.d.ts +2 -2
- package/typings/tabs/index.metadata.json +1 -1
- package/typings/tabs/paginated-tab-header.d.ts +8 -5
- package/typings/tabs/public-api.d.ts +4 -4
- package/typings/tabs/tab-body.d.ts +11 -3
- package/typings/tabs/tab-group.d.ts +24 -11
- package/typings/tabs/tab-header.d.ts +12 -5
- package/typings/tabs/tab-nav-bar/tab-nav-bar.d.ts +38 -19
- package/typings/tooltip/index.metadata.json +1 -1
|
@@ -461,11 +461,12 @@ var MatTabBodyPortal = /** @class */ (function (_super) {
|
|
|
461
461
|
return MatTabBodyPortal;
|
|
462
462
|
}(portal.CdkPortalOutlet));
|
|
463
463
|
/**
|
|
464
|
-
*
|
|
464
|
+
* Base class with all of the `MatTabBody` functionality.
|
|
465
465
|
* \@docs-private
|
|
466
|
+
* @abstract
|
|
466
467
|
*/
|
|
467
|
-
var
|
|
468
|
-
function
|
|
468
|
+
var _MatTabBodyBase = /** @class */ (function () {
|
|
469
|
+
function _MatTabBodyBase(_elementRef, _dir, changeDetectorRef) {
|
|
469
470
|
var _this = this;
|
|
470
471
|
this._elementRef = _elementRef;
|
|
471
472
|
this._dir = _dir;
|
|
@@ -532,7 +533,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
532
533
|
}
|
|
533
534
|
}));
|
|
534
535
|
}
|
|
535
|
-
Object.defineProperty(
|
|
536
|
+
Object.defineProperty(_MatTabBodyBase.prototype, "position", {
|
|
536
537
|
/** The shifted index position of the tab body, where zero represents the active center tab. */
|
|
537
538
|
set: /**
|
|
538
539
|
* The shifted index position of the tab body, where zero represents the active center tab.
|
|
@@ -555,7 +556,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
555
556
|
* special position states that transition the tab from the left or right before centering.
|
|
556
557
|
* @return {?}
|
|
557
558
|
*/
|
|
558
|
-
|
|
559
|
+
_MatTabBodyBase.prototype.ngOnInit = /**
|
|
559
560
|
* After initialized, check if the content is centered and has an origin. If so, set the
|
|
560
561
|
* special position states that transition the tab from the left or right before centering.
|
|
561
562
|
* @return {?}
|
|
@@ -568,7 +569,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
568
569
|
/**
|
|
569
570
|
* @return {?}
|
|
570
571
|
*/
|
|
571
|
-
|
|
572
|
+
_MatTabBodyBase.prototype.ngOnDestroy = /**
|
|
572
573
|
* @return {?}
|
|
573
574
|
*/
|
|
574
575
|
function () {
|
|
@@ -579,7 +580,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
579
580
|
* @param {?} event
|
|
580
581
|
* @return {?}
|
|
581
582
|
*/
|
|
582
|
-
|
|
583
|
+
_MatTabBodyBase.prototype._onTranslateTabStarted = /**
|
|
583
584
|
* @param {?} event
|
|
584
585
|
* @return {?}
|
|
585
586
|
*/
|
|
@@ -596,7 +597,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
596
597
|
* The text direction of the containing app.
|
|
597
598
|
* @return {?}
|
|
598
599
|
*/
|
|
599
|
-
|
|
600
|
+
_MatTabBodyBase.prototype._getLayoutDirection = /**
|
|
600
601
|
* The text direction of the containing app.
|
|
601
602
|
* @return {?}
|
|
602
603
|
*/
|
|
@@ -609,7 +610,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
609
610
|
* @param {?} position
|
|
610
611
|
* @return {?}
|
|
611
612
|
*/
|
|
612
|
-
|
|
613
|
+
_MatTabBodyBase.prototype._isCenterPosition = /**
|
|
613
614
|
* Whether the provided position state is considered center, regardless of origin.
|
|
614
615
|
* @param {?} position
|
|
615
616
|
* @return {?}
|
|
@@ -626,7 +627,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
626
627
|
* @param {?=} dir
|
|
627
628
|
* @return {?}
|
|
628
629
|
*/
|
|
629
|
-
|
|
630
|
+
_MatTabBodyBase.prototype._computePositionAnimationState = /**
|
|
630
631
|
* Computes the position state that will be used for the tab-body animation trigger.
|
|
631
632
|
* @private
|
|
632
633
|
* @param {?=} dir
|
|
@@ -654,7 +655,7 @@ var MatTabBody = /** @class */ (function () {
|
|
|
654
655
|
* @private
|
|
655
656
|
* @return {?}
|
|
656
657
|
*/
|
|
657
|
-
|
|
658
|
+
_MatTabBodyBase.prototype._computePositionFromOrigin = /**
|
|
658
659
|
* Computes the position state based on the specified origin position. This is used if the
|
|
659
660
|
* tab is becoming visible immediately after creation.
|
|
660
661
|
* @private
|
|
@@ -668,210 +669,175 @@ var MatTabBody = /** @class */ (function () {
|
|
|
668
669
|
}
|
|
669
670
|
return 'right-origin-center';
|
|
670
671
|
};
|
|
671
|
-
|
|
672
|
-
{ type: core.
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
676
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
677
|
-
animations: [matTabsAnimations.translateTab],
|
|
678
|
-
host: {
|
|
679
|
-
'class': 'mat-tab-body',
|
|
680
|
-
},
|
|
672
|
+
_MatTabBodyBase.decorators = [
|
|
673
|
+
{ type: core.Directive, args: [{
|
|
674
|
+
// TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
|
|
675
|
+
selector: 'do-not-use-abstract-mat-tab-body-base'
|
|
681
676
|
},] },
|
|
682
677
|
];
|
|
683
678
|
/** @nocollapse */
|
|
684
|
-
|
|
679
|
+
_MatTabBodyBase.ctorParameters = function () { return [
|
|
685
680
|
{ type: core.ElementRef },
|
|
686
681
|
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
687
682
|
{ type: core.ChangeDetectorRef }
|
|
688
683
|
]; };
|
|
689
|
-
|
|
684
|
+
_MatTabBodyBase.propDecorators = {
|
|
690
685
|
_onCentering: [{ type: core.Output }],
|
|
691
686
|
_beforeCentering: [{ type: core.Output }],
|
|
692
687
|
_afterLeavingCenter: [{ type: core.Output }],
|
|
693
688
|
_onCentered: [{ type: core.Output }],
|
|
694
|
-
_portalHost: [{ type: core.ViewChild, args: [portal.PortalHostDirective, { static: false },] }],
|
|
695
689
|
_content: [{ type: core.Input, args: ['content',] }],
|
|
696
690
|
origin: [{ type: core.Input }],
|
|
697
691
|
animationDuration: [{ type: core.Input }],
|
|
698
692
|
position: [{ type: core.Input }]
|
|
699
693
|
};
|
|
700
|
-
return
|
|
701
|
-
}());
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* @fileoverview added by tsickle
|
|
705
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
706
|
-
*/
|
|
707
|
-
// Boilerplate for applying mixins to MatTabLabelWrapper.
|
|
708
|
-
/**
|
|
709
|
-
* \@docs-private
|
|
710
|
-
*/
|
|
711
|
-
var
|
|
712
|
-
// Boilerplate for applying mixins to MatTabLabelWrapper.
|
|
713
|
-
/**
|
|
714
|
-
* \@docs-private
|
|
715
|
-
*/
|
|
716
|
-
MatTabLabelWrapperBase = /** @class */ (function () {
|
|
717
|
-
function MatTabLabelWrapperBase() {
|
|
718
|
-
}
|
|
719
|
-
return MatTabLabelWrapperBase;
|
|
694
|
+
return _MatTabBodyBase;
|
|
720
695
|
}());
|
|
721
|
-
/** @type {?} */
|
|
722
|
-
var _MatTabLabelWrapperMixinBase = core$1.mixinDisabled(MatTabLabelWrapperBase);
|
|
723
696
|
/**
|
|
724
|
-
*
|
|
697
|
+
* Wrapper for the contents of a tab.
|
|
725
698
|
* \@docs-private
|
|
726
699
|
*/
|
|
727
|
-
var
|
|
728
|
-
__extends(
|
|
729
|
-
function
|
|
730
|
-
|
|
731
|
-
_this.elementRef = elementRef;
|
|
732
|
-
return _this;
|
|
700
|
+
var MatTabBody = /** @class */ (function (_super) {
|
|
701
|
+
__extends(MatTabBody, _super);
|
|
702
|
+
function MatTabBody(elementRef, dir, changeDetectorRef) {
|
|
703
|
+
return _super.call(this, elementRef, dir, changeDetectorRef) || this;
|
|
733
704
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
* @return {?}
|
|
742
|
-
*/
|
|
743
|
-
function () {
|
|
744
|
-
this.elementRef.nativeElement.focus();
|
|
745
|
-
};
|
|
746
|
-
/**
|
|
747
|
-
* @return {?}
|
|
748
|
-
*/
|
|
749
|
-
MatTabLabelWrapper.prototype.getOffsetLeft = /**
|
|
750
|
-
* @return {?}
|
|
751
|
-
*/
|
|
752
|
-
function () {
|
|
753
|
-
return this.elementRef.nativeElement.offsetLeft;
|
|
754
|
-
};
|
|
755
|
-
/**
|
|
756
|
-
* @return {?}
|
|
757
|
-
*/
|
|
758
|
-
MatTabLabelWrapper.prototype.getOffsetWidth = /**
|
|
759
|
-
* @return {?}
|
|
760
|
-
*/
|
|
761
|
-
function () {
|
|
762
|
-
return this.elementRef.nativeElement.offsetWidth;
|
|
763
|
-
};
|
|
764
|
-
MatTabLabelWrapper.decorators = [
|
|
765
|
-
{ type: core.Directive, args: [{
|
|
766
|
-
selector: '[matTabLabelWrapper]',
|
|
767
|
-
inputs: ['disabled'],
|
|
705
|
+
MatTabBody.decorators = [
|
|
706
|
+
{ type: core.Component, args: [{selector: 'mat-tab-body',
|
|
707
|
+
template: "<div class=\"mat-tab-body-content\" #content [@translateTab]=\"{ value: _position, params: {animationDuration: animationDuration} }\" (@translateTab.start)=\"_onTranslateTabStarted($event)\" (@translateTab.done)=\"_translateTabComplete.next($event)\"><ng-template matTabBodyHost></ng-template></div>",
|
|
708
|
+
styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}"],
|
|
709
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
710
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
711
|
+
animations: [matTabsAnimations.translateTab],
|
|
768
712
|
host: {
|
|
769
|
-
'
|
|
770
|
-
'[attr.aria-disabled]': '!!disabled',
|
|
713
|
+
'class': 'mat-tab-body',
|
|
771
714
|
}
|
|
772
715
|
},] },
|
|
773
716
|
];
|
|
774
717
|
/** @nocollapse */
|
|
775
|
-
|
|
776
|
-
{ type: core.ElementRef }
|
|
718
|
+
MatTabBody.ctorParameters = function () { return [
|
|
719
|
+
{ type: core.ElementRef },
|
|
720
|
+
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
721
|
+
{ type: core.ChangeDetectorRef }
|
|
777
722
|
]; };
|
|
778
|
-
|
|
779
|
-
}
|
|
723
|
+
MatTabBody.propDecorators = {
|
|
724
|
+
_portalHost: [{ type: core.ViewChild, args: [portal.PortalHostDirective, { static: false },] }]
|
|
725
|
+
};
|
|
726
|
+
return MatTabBody;
|
|
727
|
+
}(_MatTabBodyBase));
|
|
780
728
|
|
|
781
729
|
/**
|
|
782
730
|
* @fileoverview added by tsickle
|
|
783
731
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
784
732
|
*/
|
|
785
733
|
/**
|
|
786
|
-
*
|
|
734
|
+
* Used to generate unique ID's for each tab component
|
|
787
735
|
* @type {?}
|
|
788
736
|
*/
|
|
789
|
-
var
|
|
737
|
+
var nextId = 0;
|
|
790
738
|
/**
|
|
791
|
-
*
|
|
792
|
-
* provide a small affordance to the label next to it.
|
|
793
|
-
* @type {?}
|
|
739
|
+
* A simple change event emitted on focus or selection changes.
|
|
794
740
|
*/
|
|
795
|
-
var
|
|
741
|
+
var /**
|
|
742
|
+
* A simple change event emitted on focus or selection changes.
|
|
743
|
+
*/
|
|
744
|
+
MatTabChangeEvent = /** @class */ (function () {
|
|
745
|
+
function MatTabChangeEvent() {
|
|
746
|
+
}
|
|
747
|
+
return MatTabChangeEvent;
|
|
748
|
+
}());
|
|
796
749
|
/**
|
|
797
|
-
*
|
|
798
|
-
* Set a little conservatively in order to handle fake events dispatched on touch devices.
|
|
750
|
+
* Injection token that can be used to provide the default options the tabs module.
|
|
799
751
|
* @type {?}
|
|
800
752
|
*/
|
|
801
|
-
var
|
|
753
|
+
var MAT_TABS_CONFIG = new core.InjectionToken('MAT_TABS_CONFIG');
|
|
754
|
+
// Boilerplate for applying mixins to MatTabGroup.
|
|
802
755
|
/**
|
|
803
|
-
*
|
|
804
|
-
* while the user is holding their pointer.
|
|
805
|
-
* @type {?}
|
|
756
|
+
* \@docs-private
|
|
806
757
|
*/
|
|
807
|
-
var
|
|
758
|
+
var
|
|
759
|
+
// Boilerplate for applying mixins to MatTabGroup.
|
|
808
760
|
/**
|
|
809
|
-
*
|
|
810
|
-
* @abstract
|
|
761
|
+
* \@docs-private
|
|
811
762
|
*/
|
|
812
|
-
|
|
813
|
-
function
|
|
814
|
-
var _this = this;
|
|
763
|
+
MatTabGroupMixinBase = /** @class */ (function () {
|
|
764
|
+
function MatTabGroupMixinBase(_elementRef) {
|
|
815
765
|
this._elementRef = _elementRef;
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
766
|
+
}
|
|
767
|
+
return MatTabGroupMixinBase;
|
|
768
|
+
}());
|
|
769
|
+
/** @type {?} */
|
|
770
|
+
var _MatTabGroupMixinBase = core$1.mixinColor(core$1.mixinDisableRipple(MatTabGroupMixinBase), 'primary');
|
|
771
|
+
/**
|
|
772
|
+
* Base class with all of the `MatTabGroupBase` functionality.
|
|
773
|
+
* \@docs-private
|
|
774
|
+
* @abstract
|
|
775
|
+
*/
|
|
776
|
+
var _MatTabGroupBase = /** @class */ (function (_super) {
|
|
777
|
+
__extends(_MatTabGroupBase, _super);
|
|
778
|
+
function _MatTabGroupBase(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
|
|
779
|
+
var _this = _super.call(this, elementRef) || this;
|
|
780
|
+
_this._changeDetectorRef = _changeDetectorRef;
|
|
781
|
+
_this._animationMode = _animationMode;
|
|
822
782
|
/**
|
|
823
|
-
* The
|
|
783
|
+
* The tab index that should be selected after the content has been checked.
|
|
824
784
|
*/
|
|
825
|
-
|
|
785
|
+
_this._indexToSelect = 0;
|
|
826
786
|
/**
|
|
827
|
-
*
|
|
787
|
+
* Snapshot of the height of the tab body wrapper before another tab is activated.
|
|
828
788
|
*/
|
|
829
|
-
|
|
789
|
+
_this._tabBodyWrapperHeight = 0;
|
|
830
790
|
/**
|
|
831
|
-
*
|
|
791
|
+
* Subscription to tabs being added/removed.
|
|
832
792
|
*/
|
|
833
|
-
|
|
793
|
+
_this._tabsSubscription = rxjs.Subscription.EMPTY;
|
|
834
794
|
/**
|
|
835
|
-
*
|
|
795
|
+
* Subscription to changes in the tab labels.
|
|
836
796
|
*/
|
|
837
|
-
|
|
797
|
+
_this._tabLabelSubscription = rxjs.Subscription.EMPTY;
|
|
798
|
+
_this._dynamicHeight = false;
|
|
799
|
+
_this._selectedIndex = null;
|
|
838
800
|
/**
|
|
839
|
-
*
|
|
801
|
+
* Position of the tab header.
|
|
840
802
|
*/
|
|
841
|
-
|
|
803
|
+
_this.headerPosition = 'above';
|
|
842
804
|
/**
|
|
843
|
-
*
|
|
805
|
+
* Output to enable support for two-way binding on `[(selectedIndex)]`
|
|
844
806
|
*/
|
|
845
|
-
|
|
807
|
+
_this.selectedIndexChange = new core.EventEmitter();
|
|
846
808
|
/**
|
|
847
|
-
*
|
|
809
|
+
* Event emitted when focus has changed within a tab group.
|
|
848
810
|
*/
|
|
849
|
-
|
|
850
|
-
this._selectedIndex = 0;
|
|
811
|
+
_this.focusChange = new core.EventEmitter();
|
|
851
812
|
/**
|
|
852
|
-
* Event emitted when the
|
|
813
|
+
* Event emitted when the body animation has completed
|
|
853
814
|
*/
|
|
854
|
-
|
|
815
|
+
_this.animationDone = new core.EventEmitter();
|
|
855
816
|
/**
|
|
856
|
-
* Event emitted when
|
|
817
|
+
* Event emitted when the tab selection has changed.
|
|
857
818
|
*/
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
819
|
+
_this.selectedTabChange = new core.EventEmitter(true);
|
|
820
|
+
_this._groupId = nextId++;
|
|
821
|
+
_this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
|
|
822
|
+
defaultConfig.animationDuration : '500ms';
|
|
823
|
+
return _this;
|
|
824
|
+
}
|
|
825
|
+
Object.defineProperty(_MatTabGroupBase.prototype, "dynamicHeight", {
|
|
826
|
+
/** Whether the tab group should grow to the size of the active tab. */
|
|
827
|
+
get: /**
|
|
828
|
+
* Whether the tab group should grow to the size of the active tab.
|
|
861
829
|
* @return {?}
|
|
862
830
|
*/
|
|
863
|
-
function () {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}
|
|
874
|
-
Object.defineProperty(MatPaginatedTabHeader.prototype, "selectedIndex", {
|
|
831
|
+
function () { return this._dynamicHeight; },
|
|
832
|
+
set: /**
|
|
833
|
+
* @param {?} value
|
|
834
|
+
* @return {?}
|
|
835
|
+
*/
|
|
836
|
+
function (value) { this._dynamicHeight = coercion.coerceBooleanProperty(value); },
|
|
837
|
+
enumerable: true,
|
|
838
|
+
configurable: true
|
|
839
|
+
});
|
|
840
|
+
Object.defineProperty(_MatTabGroupBase.prototype, "selectedIndex", {
|
|
875
841
|
/** The index of the active tab. */
|
|
876
842
|
get: /**
|
|
877
843
|
* The index of the active tab.
|
|
@@ -883,890 +849,617 @@ var MatPaginatedTabHeader = /** @class */ (function () {
|
|
|
883
849
|
* @return {?}
|
|
884
850
|
*/
|
|
885
851
|
function (value) {
|
|
886
|
-
|
|
887
|
-
if (this._selectedIndex != value) {
|
|
888
|
-
this._selectedIndexChanged = true;
|
|
889
|
-
this._selectedIndex = value;
|
|
890
|
-
if (this._keyManager) {
|
|
891
|
-
this._keyManager.updateActiveItemIndex(value);
|
|
892
|
-
}
|
|
893
|
-
}
|
|
852
|
+
this._indexToSelect = coercion.coerceNumberProperty(value, null);
|
|
894
853
|
},
|
|
895
854
|
enumerable: true,
|
|
896
855
|
configurable: true
|
|
897
856
|
});
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
* @return {?}
|
|
903
|
-
*/
|
|
904
|
-
function () {
|
|
905
|
-
var _this = this;
|
|
906
|
-
// We need to handle these events manually, because we want to bind passive event listeners.
|
|
907
|
-
rxjs.fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
908
|
-
.pipe(operators.takeUntil(this._destroyed))
|
|
909
|
-
.subscribe((/**
|
|
857
|
+
Object.defineProperty(_MatTabGroupBase.prototype, "animationDuration", {
|
|
858
|
+
/** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
|
|
859
|
+
get: /**
|
|
860
|
+
* Duration for the tab animation. Will be normalized to milliseconds if no units are set.
|
|
910
861
|
* @return {?}
|
|
911
862
|
*/
|
|
912
|
-
function () {
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
rxjs.fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
916
|
-
.pipe(operators.takeUntil(this._destroyed))
|
|
917
|
-
.subscribe((/**
|
|
863
|
+
function () { return this._animationDuration; },
|
|
864
|
+
set: /**
|
|
865
|
+
* @param {?} value
|
|
918
866
|
* @return {?}
|
|
919
867
|
*/
|
|
920
|
-
function () {
|
|
921
|
-
|
|
922
|
-
}
|
|
923
|
-
|
|
868
|
+
function (value) {
|
|
869
|
+
this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
|
|
870
|
+
},
|
|
871
|
+
enumerable: true,
|
|
872
|
+
configurable: true
|
|
873
|
+
});
|
|
874
|
+
Object.defineProperty(_MatTabGroupBase.prototype, "backgroundColor", {
|
|
875
|
+
/** Background color of the tab group. */
|
|
876
|
+
get: /**
|
|
877
|
+
* Background color of the tab group.
|
|
878
|
+
* @return {?}
|
|
879
|
+
*/
|
|
880
|
+
function () { return this._backgroundColor; },
|
|
881
|
+
set: /**
|
|
882
|
+
* @param {?} value
|
|
883
|
+
* @return {?}
|
|
884
|
+
*/
|
|
885
|
+
function (value) {
|
|
886
|
+
/** @type {?} */
|
|
887
|
+
var nativeElement = this._elementRef.nativeElement;
|
|
888
|
+
nativeElement.classList.remove("mat-background-" + this.backgroundColor);
|
|
889
|
+
if (value) {
|
|
890
|
+
nativeElement.classList.add("mat-background-" + value);
|
|
891
|
+
}
|
|
892
|
+
this._backgroundColor = value;
|
|
893
|
+
},
|
|
894
|
+
enumerable: true,
|
|
895
|
+
configurable: true
|
|
896
|
+
});
|
|
897
|
+
/**
|
|
898
|
+
* After the content is checked, this component knows what tabs have been defined
|
|
899
|
+
* and what the selected index should be. This is where we can know exactly what position
|
|
900
|
+
* each tab should be in according to the new selected index, and additionally we know how
|
|
901
|
+
* a new selected tab should transition in (from the left or right).
|
|
902
|
+
*/
|
|
924
903
|
/**
|
|
904
|
+
* After the content is checked, this component knows what tabs have been defined
|
|
905
|
+
* and what the selected index should be. This is where we can know exactly what position
|
|
906
|
+
* each tab should be in according to the new selected index, and additionally we know how
|
|
907
|
+
* a new selected tab should transition in (from the left or right).
|
|
925
908
|
* @return {?}
|
|
926
909
|
*/
|
|
927
|
-
|
|
910
|
+
_MatTabGroupBase.prototype.ngAfterContentChecked = /**
|
|
911
|
+
* After the content is checked, this component knows what tabs have been defined
|
|
912
|
+
* and what the selected index should be. This is where we can know exactly what position
|
|
913
|
+
* each tab should be in according to the new selected index, and additionally we know how
|
|
914
|
+
* a new selected tab should transition in (from the left or right).
|
|
928
915
|
* @return {?}
|
|
929
916
|
*/
|
|
930
917
|
function () {
|
|
931
918
|
var _this = this;
|
|
919
|
+
// Don't clamp the `indexToSelect` immediately in the setter because it can happen that
|
|
920
|
+
// the amount of tabs changes before the actual change detection runs.
|
|
932
921
|
/** @type {?} */
|
|
933
|
-
var
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
922
|
+
var indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
|
|
923
|
+
// If there is a change in selected index, emit a change event. Should not trigger if
|
|
924
|
+
// the selected index has not yet been initialized.
|
|
925
|
+
if (this._selectedIndex != indexToSelect) {
|
|
926
|
+
/** @type {?} */
|
|
927
|
+
var isFirstRun_1 = this._selectedIndex == null;
|
|
928
|
+
if (!isFirstRun_1) {
|
|
929
|
+
this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
|
|
930
|
+
}
|
|
931
|
+
// Changing these values after change detection has run
|
|
932
|
+
// since the checked content may contain references to them.
|
|
933
|
+
Promise.resolve().then((/**
|
|
934
|
+
* @return {?}
|
|
935
|
+
*/
|
|
936
|
+
function () {
|
|
937
|
+
_this._tabs.forEach((/**
|
|
938
|
+
* @param {?} tab
|
|
939
|
+
* @param {?} index
|
|
940
|
+
* @return {?}
|
|
941
|
+
*/
|
|
942
|
+
function (tab, index) { return tab.isActive = index === indexToSelect; }));
|
|
943
|
+
if (!isFirstRun_1) {
|
|
944
|
+
_this.selectedIndexChange.emit(indexToSelect);
|
|
945
|
+
}
|
|
946
|
+
}));
|
|
947
|
+
}
|
|
948
|
+
// Setup the position for each tab and optionally setup an origin on the next selected tab.
|
|
949
|
+
this._tabs.forEach((/**
|
|
950
|
+
* @param {?} tab
|
|
951
|
+
* @param {?} index
|
|
954
952
|
* @return {?}
|
|
955
953
|
*/
|
|
956
|
-
function () {
|
|
957
|
-
|
|
958
|
-
|
|
954
|
+
function (tab, index) {
|
|
955
|
+
tab.position = index - indexToSelect;
|
|
956
|
+
// If there is already a selected tab, then set up an origin for the next selected tab
|
|
957
|
+
// if it doesn't have one already.
|
|
958
|
+
if (_this._selectedIndex != null && tab.position == 0 && !tab.origin) {
|
|
959
|
+
tab.origin = indexToSelect - _this._selectedIndex;
|
|
960
|
+
}
|
|
959
961
|
}));
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
962
|
+
if (this._selectedIndex !== indexToSelect) {
|
|
963
|
+
this._selectedIndex = indexToSelect;
|
|
964
|
+
this._changeDetectorRef.markForCheck();
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
/**
|
|
968
|
+
* @return {?}
|
|
969
|
+
*/
|
|
970
|
+
_MatTabGroupBase.prototype.ngAfterContentInit = /**
|
|
971
|
+
* @return {?}
|
|
972
|
+
*/
|
|
973
|
+
function () {
|
|
974
|
+
var _this = this;
|
|
975
|
+
this._subscribeToTabLabels();
|
|
976
|
+
// Subscribe to changes in the amount of tabs, in order to be
|
|
977
|
+
// able to re-render the content as new tabs are added or removed.
|
|
978
|
+
this._tabsSubscription = this._tabs.changes.subscribe((/**
|
|
965
979
|
* @return {?}
|
|
966
980
|
*/
|
|
967
|
-
function (
|
|
968
|
-
|
|
969
|
-
_this.
|
|
981
|
+
function () {
|
|
982
|
+
/** @type {?} */
|
|
983
|
+
var indexToSelect = _this._clampTabIndex(_this._indexToSelect);
|
|
984
|
+
// Maintain the previously-selected tab if a new tab is added or removed and there is no
|
|
985
|
+
// explicit change that selects a different tab.
|
|
986
|
+
if (indexToSelect === _this._selectedIndex) {
|
|
987
|
+
/** @type {?} */
|
|
988
|
+
var tabs = _this._tabs.toArray();
|
|
989
|
+
for (var i = 0; i < tabs.length; i++) {
|
|
990
|
+
if (tabs[i].isActive) {
|
|
991
|
+
// Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
|
|
992
|
+
// event, otherwise the consumer may end up in an infinite loop in some edge cases like
|
|
993
|
+
// adding a tab within the `selectedIndexChange` event.
|
|
994
|
+
_this._indexToSelect = _this._selectedIndex = i;
|
|
995
|
+
break;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
_this._subscribeToTabLabels();
|
|
1000
|
+
_this._changeDetectorRef.markForCheck();
|
|
970
1001
|
}));
|
|
971
1002
|
};
|
|
972
1003
|
/**
|
|
973
1004
|
* @return {?}
|
|
974
1005
|
*/
|
|
975
|
-
|
|
1006
|
+
_MatTabGroupBase.prototype.ngOnDestroy = /**
|
|
976
1007
|
* @return {?}
|
|
977
1008
|
*/
|
|
978
1009
|
function () {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
this.updatePagination();
|
|
982
|
-
this._tabLabelCount = this._items.length;
|
|
983
|
-
this._changeDetectorRef.markForCheck();
|
|
984
|
-
}
|
|
985
|
-
// If the selected index has changed, scroll to the label and check if the scrolling controls
|
|
986
|
-
// should be disabled.
|
|
987
|
-
if (this._selectedIndexChanged) {
|
|
988
|
-
this._scrollToLabel(this._selectedIndex);
|
|
989
|
-
this._checkScrollingControls();
|
|
990
|
-
this._alignInkBarToSelectedTab();
|
|
991
|
-
this._selectedIndexChanged = false;
|
|
992
|
-
this._changeDetectorRef.markForCheck();
|
|
993
|
-
}
|
|
994
|
-
// If the scroll distance has been changed (tab selected, focused, scroll controls activated),
|
|
995
|
-
// then translate the header to reflect this.
|
|
996
|
-
if (this._scrollDistanceChanged) {
|
|
997
|
-
this._updateTabScrollPosition();
|
|
998
|
-
this._scrollDistanceChanged = false;
|
|
999
|
-
this._changeDetectorRef.markForCheck();
|
|
1000
|
-
}
|
|
1010
|
+
this._tabsSubscription.unsubscribe();
|
|
1011
|
+
this._tabLabelSubscription.unsubscribe();
|
|
1001
1012
|
};
|
|
1013
|
+
/** Re-aligns the ink bar to the selected tab element. */
|
|
1002
1014
|
/**
|
|
1015
|
+
* Re-aligns the ink bar to the selected tab element.
|
|
1003
1016
|
* @return {?}
|
|
1004
1017
|
*/
|
|
1005
|
-
|
|
1018
|
+
_MatTabGroupBase.prototype.realignInkBar = /**
|
|
1019
|
+
* Re-aligns the ink bar to the selected tab element.
|
|
1006
1020
|
* @return {?}
|
|
1007
1021
|
*/
|
|
1008
1022
|
function () {
|
|
1009
|
-
this.
|
|
1010
|
-
|
|
1011
|
-
|
|
1023
|
+
if (this._tabHeader) {
|
|
1024
|
+
this._tabHeader._alignInkBarToSelectedTab();
|
|
1025
|
+
}
|
|
1012
1026
|
};
|
|
1013
|
-
/** Handles keyboard events on the header. */
|
|
1014
1027
|
/**
|
|
1015
|
-
*
|
|
1016
|
-
* @param {?} event
|
|
1028
|
+
* @param {?} index
|
|
1017
1029
|
* @return {?}
|
|
1018
1030
|
*/
|
|
1019
|
-
|
|
1020
|
-
*
|
|
1021
|
-
* @param {?} event
|
|
1031
|
+
_MatTabGroupBase.prototype._focusChanged = /**
|
|
1032
|
+
* @param {?} index
|
|
1022
1033
|
* @return {?}
|
|
1023
1034
|
*/
|
|
1024
|
-
function (
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
default:
|
|
1044
|
-
this._keyManager.onKeydown(event);
|
|
1035
|
+
function (index) {
|
|
1036
|
+
this.focusChange.emit(this._createChangeEvent(index));
|
|
1037
|
+
};
|
|
1038
|
+
/**
|
|
1039
|
+
* @private
|
|
1040
|
+
* @param {?} index
|
|
1041
|
+
* @return {?}
|
|
1042
|
+
*/
|
|
1043
|
+
_MatTabGroupBase.prototype._createChangeEvent = /**
|
|
1044
|
+
* @private
|
|
1045
|
+
* @param {?} index
|
|
1046
|
+
* @return {?}
|
|
1047
|
+
*/
|
|
1048
|
+
function (index) {
|
|
1049
|
+
/** @type {?} */
|
|
1050
|
+
var event = new MatTabChangeEvent;
|
|
1051
|
+
event.index = index;
|
|
1052
|
+
if (this._tabs && this._tabs.length) {
|
|
1053
|
+
event.tab = this._tabs.toArray()[index];
|
|
1045
1054
|
}
|
|
1055
|
+
return event;
|
|
1046
1056
|
};
|
|
1047
1057
|
/**
|
|
1048
|
-
*
|
|
1058
|
+
* Subscribes to changes in the tab labels. This is needed, because the @Input for the label is
|
|
1059
|
+
* on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
|
|
1060
|
+
* binding to be updated, we need to subscribe to changes in it and trigger change detection
|
|
1061
|
+
* manually.
|
|
1049
1062
|
*/
|
|
1050
1063
|
/**
|
|
1051
|
-
*
|
|
1064
|
+
* Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
|
|
1065
|
+
* on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
|
|
1066
|
+
* binding to be updated, we need to subscribe to changes in it and trigger change detection
|
|
1067
|
+
* manually.
|
|
1068
|
+
* @private
|
|
1052
1069
|
* @return {?}
|
|
1053
1070
|
*/
|
|
1054
|
-
|
|
1055
|
-
*
|
|
1071
|
+
_MatTabGroupBase.prototype._subscribeToTabLabels = /**
|
|
1072
|
+
* Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
|
|
1073
|
+
* on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
|
|
1074
|
+
* binding to be updated, we need to subscribe to changes in it and trigger change detection
|
|
1075
|
+
* manually.
|
|
1076
|
+
* @private
|
|
1056
1077
|
* @return {?}
|
|
1057
1078
|
*/
|
|
1058
1079
|
function () {
|
|
1059
1080
|
var _this = this;
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
// We need to diff the text content of the header, because the MutationObserver callback
|
|
1063
|
-
// will fire even if the text content didn't change which is inefficient and is prone
|
|
1064
|
-
// to infinite loops if a poorly constructed expression is passed in (see #14249).
|
|
1065
|
-
if (textContent !== this._currentTextContent) {
|
|
1066
|
-
this._currentTextContent = textContent || '';
|
|
1067
|
-
// The content observer runs outside the `NgZone` by default, which
|
|
1068
|
-
// means that we need to bring the callback back in ourselves.
|
|
1069
|
-
this._ngZone.run((/**
|
|
1070
|
-
* @return {?}
|
|
1071
|
-
*/
|
|
1072
|
-
function () {
|
|
1073
|
-
_this.updatePagination();
|
|
1074
|
-
_this._alignInkBarToSelectedTab();
|
|
1075
|
-
_this._changeDetectorRef.markForCheck();
|
|
1076
|
-
}));
|
|
1081
|
+
if (this._tabLabelSubscription) {
|
|
1082
|
+
this._tabLabelSubscription.unsubscribe();
|
|
1077
1083
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
* Updates the view whether pagination should be enabled or not.
|
|
1081
|
-
*
|
|
1082
|
-
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1083
|
-
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1084
|
-
* page.
|
|
1085
|
-
*/
|
|
1086
|
-
/**
|
|
1087
|
-
* Updates the view whether pagination should be enabled or not.
|
|
1088
|
-
*
|
|
1089
|
-
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1090
|
-
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1091
|
-
* page.
|
|
1092
|
-
* @return {?}
|
|
1093
|
-
*/
|
|
1094
|
-
MatPaginatedTabHeader.prototype.updatePagination = /**
|
|
1095
|
-
* Updates the view whether pagination should be enabled or not.
|
|
1096
|
-
*
|
|
1097
|
-
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1098
|
-
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1099
|
-
* page.
|
|
1100
|
-
* @return {?}
|
|
1101
|
-
*/
|
|
1102
|
-
function () {
|
|
1103
|
-
this._checkPaginationEnabled();
|
|
1104
|
-
this._checkScrollingControls();
|
|
1105
|
-
this._updateTabScrollPosition();
|
|
1106
|
-
};
|
|
1107
|
-
Object.defineProperty(MatPaginatedTabHeader.prototype, "focusIndex", {
|
|
1108
|
-
/** Tracks which element has focus; used for keyboard navigation */
|
|
1109
|
-
get: /**
|
|
1110
|
-
* Tracks which element has focus; used for keyboard navigation
|
|
1084
|
+
this._tabLabelSubscription = rxjs.merge.apply(void 0, this._tabs.map((/**
|
|
1085
|
+
* @param {?} tab
|
|
1111
1086
|
* @return {?}
|
|
1112
1087
|
*/
|
|
1113
|
-
function () {
|
|
1114
|
-
return this._keyManager ? (/** @type {?} */ (this._keyManager.activeItemIndex)) : 0;
|
|
1115
|
-
},
|
|
1116
|
-
/** When the focus index is set, we must manually send focus to the correct label */
|
|
1117
|
-
set: /**
|
|
1118
|
-
* When the focus index is set, we must manually send focus to the correct label
|
|
1119
|
-
* @param {?} value
|
|
1088
|
+
function (tab) { return tab._stateChanges; }))).subscribe((/**
|
|
1120
1089
|
* @return {?}
|
|
1121
1090
|
*/
|
|
1122
|
-
function (
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
this._keyManager.setActiveItem(value);
|
|
1127
|
-
},
|
|
1128
|
-
enumerable: true,
|
|
1129
|
-
configurable: true
|
|
1130
|
-
});
|
|
1131
|
-
/**
|
|
1132
|
-
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
|
|
1133
|
-
* providing a valid index and return true.
|
|
1134
|
-
*/
|
|
1091
|
+
function () { return _this._changeDetectorRef.markForCheck(); }));
|
|
1092
|
+
};
|
|
1093
|
+
/** Clamps the given index to the bounds of 0 and the tabs length. */
|
|
1135
1094
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1095
|
+
* Clamps the given index to the bounds of 0 and the tabs length.
|
|
1096
|
+
* @private
|
|
1138
1097
|
* @param {?} index
|
|
1139
1098
|
* @return {?}
|
|
1140
1099
|
*/
|
|
1141
|
-
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1100
|
+
_MatTabGroupBase.prototype._clampTabIndex = /**
|
|
1101
|
+
* Clamps the given index to the bounds of 0 and the tabs length.
|
|
1102
|
+
* @private
|
|
1144
1103
|
* @param {?} index
|
|
1145
1104
|
* @return {?}
|
|
1146
1105
|
*/
|
|
1147
1106
|
function (index) {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
var tab = this._items ? this._items.toArray()[index] : null;
|
|
1153
|
-
return !!tab && !tab.disabled;
|
|
1107
|
+
// Note the `|| 0`, which ensures that values like NaN can't get through
|
|
1108
|
+
// and which would otherwise throw the component into an infinite loop
|
|
1109
|
+
// (since Math.max(NaN, 0) === NaN).
|
|
1110
|
+
return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
|
|
1154
1111
|
};
|
|
1112
|
+
/** Returns a unique id for each tab label element */
|
|
1155
1113
|
/**
|
|
1156
|
-
*
|
|
1157
|
-
*
|
|
1158
|
-
*/
|
|
1159
|
-
/**
|
|
1160
|
-
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
|
|
1161
|
-
* scrolling is enabled.
|
|
1162
|
-
* @param {?} tabIndex
|
|
1114
|
+
* Returns a unique id for each tab label element
|
|
1115
|
+
* @param {?} i
|
|
1163
1116
|
* @return {?}
|
|
1164
1117
|
*/
|
|
1165
|
-
|
|
1166
|
-
*
|
|
1167
|
-
*
|
|
1168
|
-
* @param {?} tabIndex
|
|
1118
|
+
_MatTabGroupBase.prototype._getTabLabelId = /**
|
|
1119
|
+
* Returns a unique id for each tab label element
|
|
1120
|
+
* @param {?} i
|
|
1169
1121
|
* @return {?}
|
|
1170
1122
|
*/
|
|
1171
|
-
function (
|
|
1172
|
-
|
|
1173
|
-
this._scrollToLabel(tabIndex);
|
|
1174
|
-
}
|
|
1175
|
-
if (this._items && this._items.length) {
|
|
1176
|
-
this._items.toArray()[tabIndex].focus();
|
|
1177
|
-
// Do not let the browser manage scrolling to focus the element, this will be handled
|
|
1178
|
-
// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
|
|
1179
|
-
// should be the full width minus the offset width.
|
|
1180
|
-
/** @type {?} */
|
|
1181
|
-
var containerEl = this._tabListContainer.nativeElement;
|
|
1182
|
-
/** @type {?} */
|
|
1183
|
-
var dir = this._getLayoutDirection();
|
|
1184
|
-
if (dir == 'ltr') {
|
|
1185
|
-
containerEl.scrollLeft = 0;
|
|
1186
|
-
}
|
|
1187
|
-
else {
|
|
1188
|
-
containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1123
|
+
function (i) {
|
|
1124
|
+
return "mat-tab-label-" + this._groupId + "-" + i;
|
|
1191
1125
|
};
|
|
1192
|
-
/**
|
|
1126
|
+
/** Returns a unique id for each tab content element */
|
|
1193
1127
|
/**
|
|
1194
|
-
*
|
|
1128
|
+
* Returns a unique id for each tab content element
|
|
1129
|
+
* @param {?} i
|
|
1195
1130
|
* @return {?}
|
|
1196
1131
|
*/
|
|
1197
|
-
|
|
1198
|
-
*
|
|
1132
|
+
_MatTabGroupBase.prototype._getTabContentId = /**
|
|
1133
|
+
* Returns a unique id for each tab content element
|
|
1134
|
+
* @param {?} i
|
|
1199
1135
|
* @return {?}
|
|
1200
1136
|
*/
|
|
1201
|
-
function () {
|
|
1202
|
-
return
|
|
1137
|
+
function (i) {
|
|
1138
|
+
return "mat-tab-content-" + this._groupId + "-" + i;
|
|
1203
1139
|
};
|
|
1204
|
-
/** Performs the CSS transformation on the tab list that will cause the list to scroll. */
|
|
1205
1140
|
/**
|
|
1206
|
-
*
|
|
1141
|
+
* Sets the height of the body wrapper to the height of the activating tab if dynamic
|
|
1142
|
+
* height property is true.
|
|
1143
|
+
*/
|
|
1144
|
+
/**
|
|
1145
|
+
* Sets the height of the body wrapper to the height of the activating tab if dynamic
|
|
1146
|
+
* height property is true.
|
|
1147
|
+
* @param {?} tabHeight
|
|
1207
1148
|
* @return {?}
|
|
1208
1149
|
*/
|
|
1209
|
-
|
|
1210
|
-
*
|
|
1150
|
+
_MatTabGroupBase.prototype._setTabBodyWrapperHeight = /**
|
|
1151
|
+
* Sets the height of the body wrapper to the height of the activating tab if dynamic
|
|
1152
|
+
* height property is true.
|
|
1153
|
+
* @param {?} tabHeight
|
|
1211
1154
|
* @return {?}
|
|
1212
1155
|
*/
|
|
1213
|
-
function () {
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
var platform$$1 = this._platform;
|
|
1156
|
+
function (tabHeight) {
|
|
1157
|
+
if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1218
1160
|
/** @type {?} */
|
|
1219
|
-
var
|
|
1220
|
-
|
|
1221
|
-
//
|
|
1222
|
-
//
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
// browsers to blur the content of the element.
|
|
1226
|
-
this._tabList.nativeElement.style.transform = "translateX(" + Math.round(translateX) + "px)";
|
|
1227
|
-
// Setting the `transform` on IE will change the scroll offset of the parent, causing the
|
|
1228
|
-
// position to be thrown off in some cases. We have to reset it ourselves to ensure that
|
|
1229
|
-
// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
|
|
1230
|
-
// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
|
|
1231
|
-
// @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
|
|
1232
|
-
if (platform$$1 && (platform$$1.TRIDENT || platform$$1.EDGE)) {
|
|
1233
|
-
this._tabListContainer.nativeElement.scrollLeft = 0;
|
|
1161
|
+
var wrapper = this._tabBodyWrapper.nativeElement;
|
|
1162
|
+
wrapper.style.height = this._tabBodyWrapperHeight + 'px';
|
|
1163
|
+
// This conditional forces the browser to paint the height so that
|
|
1164
|
+
// the animation to the new height can have an origin.
|
|
1165
|
+
if (this._tabBodyWrapper.nativeElement.offsetHeight) {
|
|
1166
|
+
wrapper.style.height = tabHeight + 'px';
|
|
1234
1167
|
}
|
|
1235
1168
|
};
|
|
1236
|
-
|
|
1237
|
-
/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
|
|
1238
|
-
get: /**
|
|
1239
|
-
* Sets the distance in pixels that the tab header should be transformed in the X-axis.
|
|
1240
|
-
* @return {?}
|
|
1241
|
-
*/
|
|
1242
|
-
function () { return this._scrollDistance; },
|
|
1243
|
-
set: /**
|
|
1244
|
-
* @param {?} value
|
|
1245
|
-
* @return {?}
|
|
1246
|
-
*/
|
|
1247
|
-
function (value) {
|
|
1248
|
-
this._scrollTo(value);
|
|
1249
|
-
},
|
|
1250
|
-
enumerable: true,
|
|
1251
|
-
configurable: true
|
|
1252
|
-
});
|
|
1253
|
-
/**
|
|
1254
|
-
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
|
|
1255
|
-
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1256
|
-
* length of the tab list view window.
|
|
1257
|
-
*
|
|
1258
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1259
|
-
* should be called sparingly.
|
|
1260
|
-
*/
|
|
1169
|
+
/** Removes the height of the tab body wrapper. */
|
|
1261
1170
|
/**
|
|
1262
|
-
*
|
|
1263
|
-
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1264
|
-
* length of the tab list view window.
|
|
1265
|
-
*
|
|
1266
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1267
|
-
* should be called sparingly.
|
|
1268
|
-
* @param {?} direction
|
|
1171
|
+
* Removes the height of the tab body wrapper.
|
|
1269
1172
|
* @return {?}
|
|
1270
1173
|
*/
|
|
1271
|
-
|
|
1272
|
-
*
|
|
1273
|
-
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1274
|
-
* length of the tab list view window.
|
|
1275
|
-
*
|
|
1276
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1277
|
-
* should be called sparingly.
|
|
1278
|
-
* @param {?} direction
|
|
1174
|
+
_MatTabGroupBase.prototype._removeTabBodyWrapperHeight = /**
|
|
1175
|
+
* Removes the height of the tab body wrapper.
|
|
1279
1176
|
* @return {?}
|
|
1280
1177
|
*/
|
|
1281
|
-
function (
|
|
1282
|
-
/** @type {?} */
|
|
1283
|
-
var viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1284
|
-
// Move the scroll distance one-third the length of the tab list's viewport.
|
|
1178
|
+
function () {
|
|
1285
1179
|
/** @type {?} */
|
|
1286
|
-
var
|
|
1287
|
-
|
|
1180
|
+
var wrapper = this._tabBodyWrapper.nativeElement;
|
|
1181
|
+
this._tabBodyWrapperHeight = wrapper.clientHeight;
|
|
1182
|
+
wrapper.style.height = '';
|
|
1183
|
+
this.animationDone.emit();
|
|
1288
1184
|
};
|
|
1289
|
-
/**
|
|
1185
|
+
/** Handle click events, setting new selected index if appropriate. */
|
|
1290
1186
|
/**
|
|
1291
|
-
*
|
|
1292
|
-
* @param {?}
|
|
1187
|
+
* Handle click events, setting new selected index if appropriate.
|
|
1188
|
+
* @param {?} tab
|
|
1189
|
+
* @param {?} tabHeader
|
|
1190
|
+
* @param {?} index
|
|
1293
1191
|
* @return {?}
|
|
1294
1192
|
*/
|
|
1295
|
-
|
|
1296
|
-
*
|
|
1297
|
-
* @param {?}
|
|
1298
|
-
* @
|
|
1299
|
-
|
|
1300
|
-
function (direction) {
|
|
1301
|
-
this._stopInterval();
|
|
1302
|
-
this._scrollHeader(direction);
|
|
1303
|
-
};
|
|
1304
|
-
/**
|
|
1305
|
-
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1306
|
-
*
|
|
1307
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1308
|
-
* should be called sparingly.
|
|
1309
|
-
*/
|
|
1310
|
-
/**
|
|
1311
|
-
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1312
|
-
*
|
|
1313
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1314
|
-
* should be called sparingly.
|
|
1315
|
-
* @param {?} labelIndex
|
|
1316
|
-
* @return {?}
|
|
1317
|
-
*/
|
|
1318
|
-
MatPaginatedTabHeader.prototype._scrollToLabel = /**
|
|
1319
|
-
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1320
|
-
*
|
|
1321
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1322
|
-
* should be called sparingly.
|
|
1323
|
-
* @param {?} labelIndex
|
|
1193
|
+
_MatTabGroupBase.prototype._handleClick = /**
|
|
1194
|
+
* Handle click events, setting new selected index if appropriate.
|
|
1195
|
+
* @param {?} tab
|
|
1196
|
+
* @param {?} tabHeader
|
|
1197
|
+
* @param {?} index
|
|
1324
1198
|
* @return {?}
|
|
1325
1199
|
*/
|
|
1326
|
-
function (
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
if (!selectedLabel) {
|
|
1330
|
-
return;
|
|
1331
|
-
}
|
|
1332
|
-
// The view length is the visible width of the tab labels.
|
|
1333
|
-
/** @type {?} */
|
|
1334
|
-
var viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1335
|
-
var _a = selectedLabel.elementRef.nativeElement, offsetLeft = _a.offsetLeft, offsetWidth = _a.offsetWidth;
|
|
1336
|
-
/** @type {?} */
|
|
1337
|
-
var labelBeforePos;
|
|
1338
|
-
/** @type {?} */
|
|
1339
|
-
var labelAfterPos;
|
|
1340
|
-
if (this._getLayoutDirection() == 'ltr') {
|
|
1341
|
-
labelBeforePos = offsetLeft;
|
|
1342
|
-
labelAfterPos = labelBeforePos + offsetWidth;
|
|
1343
|
-
}
|
|
1344
|
-
else {
|
|
1345
|
-
labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
|
|
1346
|
-
labelBeforePos = labelAfterPos - offsetWidth;
|
|
1347
|
-
}
|
|
1348
|
-
/** @type {?} */
|
|
1349
|
-
var beforeVisiblePos = this.scrollDistance;
|
|
1350
|
-
/** @type {?} */
|
|
1351
|
-
var afterVisiblePos = this.scrollDistance + viewLength;
|
|
1352
|
-
if (labelBeforePos < beforeVisiblePos) {
|
|
1353
|
-
// Scroll header to move label to the before direction
|
|
1354
|
-
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
|
|
1355
|
-
}
|
|
1356
|
-
else if (labelAfterPos > afterVisiblePos) {
|
|
1357
|
-
// Scroll header to move label to the after direction
|
|
1358
|
-
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
|
|
1200
|
+
function (tab, tabHeader, index) {
|
|
1201
|
+
if (!tab.disabled) {
|
|
1202
|
+
this.selectedIndex = tabHeader.focusIndex = index;
|
|
1359
1203
|
}
|
|
1360
1204
|
};
|
|
1205
|
+
/** Retrieves the tabindex for the tab. */
|
|
1361
1206
|
/**
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1367
|
-
* should be called sparingly.
|
|
1368
|
-
*/
|
|
1369
|
-
/**
|
|
1370
|
-
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
|
|
1371
|
-
* tab list is wider than the size of the header container, then the pagination controls should
|
|
1372
|
-
* be shown.
|
|
1373
|
-
*
|
|
1374
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1375
|
-
* should be called sparingly.
|
|
1207
|
+
* Retrieves the tabindex for the tab.
|
|
1208
|
+
* @param {?} tab
|
|
1209
|
+
* @param {?} idx
|
|
1376
1210
|
* @return {?}
|
|
1377
1211
|
*/
|
|
1378
|
-
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
*
|
|
1383
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1384
|
-
* should be called sparingly.
|
|
1212
|
+
_MatTabGroupBase.prototype._getTabIndex = /**
|
|
1213
|
+
* Retrieves the tabindex for the tab.
|
|
1214
|
+
* @param {?} tab
|
|
1215
|
+
* @param {?} idx
|
|
1385
1216
|
* @return {?}
|
|
1386
1217
|
*/
|
|
1387
|
-
function () {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
if (!isEnabled) {
|
|
1391
|
-
this.scrollDistance = 0;
|
|
1392
|
-
}
|
|
1393
|
-
if (isEnabled !== this._showPaginationControls) {
|
|
1394
|
-
this._changeDetectorRef.markForCheck();
|
|
1218
|
+
function (tab, idx) {
|
|
1219
|
+
if (tab.disabled) {
|
|
1220
|
+
return null;
|
|
1395
1221
|
}
|
|
1396
|
-
this.
|
|
1222
|
+
return this.selectedIndex === idx ? 0 : -1;
|
|
1397
1223
|
};
|
|
1224
|
+
_MatTabGroupBase.decorators = [
|
|
1225
|
+
{ type: core.Directive, args: [{
|
|
1226
|
+
// TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
|
|
1227
|
+
selector: 'do-not-use-abstract-mat-tab-group-base'
|
|
1228
|
+
},] },
|
|
1229
|
+
];
|
|
1230
|
+
/** @nocollapse */
|
|
1231
|
+
_MatTabGroupBase.ctorParameters = function () { return [
|
|
1232
|
+
{ type: core.ElementRef },
|
|
1233
|
+
{ type: core.ChangeDetectorRef },
|
|
1234
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [MAT_TABS_CONFIG,] }, { type: core.Optional }] },
|
|
1235
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
1236
|
+
]; };
|
|
1237
|
+
_MatTabGroupBase.propDecorators = {
|
|
1238
|
+
dynamicHeight: [{ type: core.Input }],
|
|
1239
|
+
selectedIndex: [{ type: core.Input }],
|
|
1240
|
+
headerPosition: [{ type: core.Input }],
|
|
1241
|
+
animationDuration: [{ type: core.Input }],
|
|
1242
|
+
backgroundColor: [{ type: core.Input }],
|
|
1243
|
+
selectedIndexChange: [{ type: core.Output }],
|
|
1244
|
+
focusChange: [{ type: core.Output }],
|
|
1245
|
+
animationDone: [{ type: core.Output }],
|
|
1246
|
+
selectedTabChange: [{ type: core.Output }]
|
|
1247
|
+
};
|
|
1248
|
+
return _MatTabGroupBase;
|
|
1249
|
+
}(_MatTabGroupMixinBase));
|
|
1250
|
+
/**
|
|
1251
|
+
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
|
|
1252
|
+
* animated ink-bar, keyboard navigation, and screen reader.
|
|
1253
|
+
* See: https://material.io/design/components/tabs.html
|
|
1254
|
+
*/
|
|
1255
|
+
var MatTabGroup = /** @class */ (function (_super) {
|
|
1256
|
+
__extends(MatTabGroup, _super);
|
|
1257
|
+
function MatTabGroup(elementRef, changeDetectorRef, defaultConfig, animationMode) {
|
|
1258
|
+
return _super.call(this, elementRef, changeDetectorRef, defaultConfig, animationMode) || this;
|
|
1259
|
+
}
|
|
1260
|
+
MatTabGroup.decorators = [
|
|
1261
|
+
{ type: core.Component, args: [{selector: 'mat-tab-group',
|
|
1262
|
+
exportAs: 'matTabGroup',
|
|
1263
|
+
template: "<mat-tab-header #tabHeader [selectedIndex]=\"selectedIndex\" [disableRipple]=\"disableRipple\" (indexFocused)=\"_focusChanged($event)\" (selectFocusedIndex)=\"selectedIndex = $event\"><div class=\"mat-tab-label\" role=\"tab\" matTabLabelWrapper mat-ripple cdkMonitorElementFocus *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabLabelId(i)\" [attr.tabIndex]=\"_getTabIndex(tab, i)\" [attr.aria-posinset]=\"i + 1\" [attr.aria-setsize]=\"_tabs.length\" [attr.aria-controls]=\"_getTabContentId(i)\" [attr.aria-selected]=\"selectedIndex == i\" [attr.aria-label]=\"tab.ariaLabel || null\" [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\" [class.mat-tab-label-active]=\"selectedIndex == i\" [disabled]=\"tab.disabled\" [matRippleDisabled]=\"tab.disabled || disableRipple\" (click)=\"_handleClick(tab, tabHeader, i)\"><div class=\"mat-tab-label-content\"><ng-template [ngIf]=\"tab.templateLabel\"><ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template></ng-template><ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template></div></div></mat-tab-header><div class=\"mat-tab-body-wrapper\" [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\" #tabBodyWrapper><mat-tab-body role=\"tabpanel\" *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabContentId(i)\" [attr.aria-labelledby]=\"_getTabLabelId(i)\" [class.mat-tab-body-active]=\"selectedIndex == i\" [content]=\"tab.content\" [position]=\"tab.position\" [origin]=\"tab.origin\" [animationDuration]=\"animationDuration\" (_onCentered)=\"_removeTabBodyWrapperHeight()\" (_onCentering)=\"_setTabBodyWrapperHeight($event)\"></mat-tab-body></div>",
|
|
1264
|
+
styles: [".mat-tab-group{display:flex;flex-direction:column}.mat-tab-group.mat-tab-group-inverted-header{flex-direction:column-reverse}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-high-contrast:active){.mat-tab-label.mat-tab-disabled{opacity:.5}}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (-ms-high-contrast:active){.mat-tab-label{opacity:1}}@media (max-width:599px){.mat-tab-label{padding:0 12px}}@media (max-width:959px){.mat-tab-label{padding:0 12px}}.mat-tab-group[mat-stretch-tabs]>.mat-tab-header .mat-tab-label{flex-basis:0;flex-grow:1}.mat-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height .5s cubic-bezier(.35,0,.25,1)}._mat-animation-noopable.mat-tab-body-wrapper{transition:none;animation:none}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;flex-basis:100%}.mat-tab-body.mat-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-tab-group.mat-tab-group-dynamic-height .mat-tab-body.mat-tab-body-active{overflow-y:hidden}"],
|
|
1265
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
1266
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1267
|
+
inputs: ['color', 'disableRipple'],
|
|
1268
|
+
host: {
|
|
1269
|
+
'class': 'mat-tab-group',
|
|
1270
|
+
'[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
|
|
1271
|
+
'[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
|
|
1272
|
+
},
|
|
1273
|
+
},] },
|
|
1274
|
+
];
|
|
1275
|
+
/** @nocollapse */
|
|
1276
|
+
MatTabGroup.ctorParameters = function () { return [
|
|
1277
|
+
{ type: core.ElementRef },
|
|
1278
|
+
{ type: core.ChangeDetectorRef },
|
|
1279
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [MAT_TABS_CONFIG,] }, { type: core.Optional }] },
|
|
1280
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
1281
|
+
]; };
|
|
1282
|
+
MatTabGroup.propDecorators = {
|
|
1283
|
+
_tabs: [{ type: core.ContentChildren, args: [MatTab,] }],
|
|
1284
|
+
_tabBodyWrapper: [{ type: core.ViewChild, args: ['tabBodyWrapper', { static: false },] }],
|
|
1285
|
+
_tabHeader: [{ type: core.ViewChild, args: ['tabHeader', { static: false },] }]
|
|
1286
|
+
};
|
|
1287
|
+
return MatTabGroup;
|
|
1288
|
+
}(_MatTabGroupBase));
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* @fileoverview added by tsickle
|
|
1292
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1293
|
+
*/
|
|
1294
|
+
// Boilerplate for applying mixins to MatTabLabelWrapper.
|
|
1295
|
+
/**
|
|
1296
|
+
* \@docs-private
|
|
1297
|
+
*/
|
|
1298
|
+
var
|
|
1299
|
+
// Boilerplate for applying mixins to MatTabLabelWrapper.
|
|
1300
|
+
/**
|
|
1301
|
+
* \@docs-private
|
|
1302
|
+
*/
|
|
1303
|
+
MatTabLabelWrapperBase = /** @class */ (function () {
|
|
1304
|
+
function MatTabLabelWrapperBase() {
|
|
1305
|
+
}
|
|
1306
|
+
return MatTabLabelWrapperBase;
|
|
1307
|
+
}());
|
|
1308
|
+
/** @type {?} */
|
|
1309
|
+
var _MatTabLabelWrapperMixinBase = core$1.mixinDisabled(MatTabLabelWrapperBase);
|
|
1310
|
+
/**
|
|
1311
|
+
* Used in the `mat-tab-group` view to display tab labels.
|
|
1312
|
+
* \@docs-private
|
|
1313
|
+
*/
|
|
1314
|
+
var MatTabLabelWrapper = /** @class */ (function (_super) {
|
|
1315
|
+
__extends(MatTabLabelWrapper, _super);
|
|
1316
|
+
function MatTabLabelWrapper(elementRef) {
|
|
1317
|
+
var _this = _super.call(this) || this;
|
|
1318
|
+
_this.elementRef = elementRef;
|
|
1319
|
+
return _this;
|
|
1320
|
+
}
|
|
1321
|
+
/** Sets focus on the wrapper element */
|
|
1398
1322
|
/**
|
|
1399
|
-
*
|
|
1400
|
-
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
1401
|
-
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
1402
|
-
* maximum distance we can scroll), then disable the after button.
|
|
1403
|
-
*
|
|
1404
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1405
|
-
* should be called sparingly.
|
|
1406
|
-
*/
|
|
1407
|
-
/**
|
|
1408
|
-
* Evaluate whether the before and after controls should be enabled or disabled.
|
|
1409
|
-
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
1410
|
-
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
1411
|
-
* maximum distance we can scroll), then disable the after button.
|
|
1412
|
-
*
|
|
1413
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1414
|
-
* should be called sparingly.
|
|
1323
|
+
* Sets focus on the wrapper element
|
|
1415
1324
|
* @return {?}
|
|
1416
1325
|
*/
|
|
1417
|
-
|
|
1418
|
-
*
|
|
1419
|
-
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
1420
|
-
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
1421
|
-
* maximum distance we can scroll), then disable the after button.
|
|
1422
|
-
*
|
|
1423
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1424
|
-
* should be called sparingly.
|
|
1326
|
+
MatTabLabelWrapper.prototype.focus = /**
|
|
1327
|
+
* Sets focus on the wrapper element
|
|
1425
1328
|
* @return {?}
|
|
1426
1329
|
*/
|
|
1427
1330
|
function () {
|
|
1428
|
-
|
|
1429
|
-
this._disableScrollBefore = this.scrollDistance == 0;
|
|
1430
|
-
this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
|
|
1431
|
-
this._changeDetectorRef.markForCheck();
|
|
1331
|
+
this.elementRef.nativeElement.focus();
|
|
1432
1332
|
};
|
|
1433
1333
|
/**
|
|
1434
|
-
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
1435
|
-
* is equal to the difference in width between the tab list container and tab header container.
|
|
1436
|
-
*
|
|
1437
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1438
|
-
* should be called sparingly.
|
|
1439
|
-
*/
|
|
1440
|
-
/**
|
|
1441
|
-
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
1442
|
-
* is equal to the difference in width between the tab list container and tab header container.
|
|
1443
|
-
*
|
|
1444
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1445
|
-
* should be called sparingly.
|
|
1446
1334
|
* @return {?}
|
|
1447
1335
|
*/
|
|
1448
|
-
|
|
1449
|
-
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
1450
|
-
* is equal to the difference in width between the tab list container and tab header container.
|
|
1451
|
-
*
|
|
1452
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1453
|
-
* should be called sparingly.
|
|
1336
|
+
MatTabLabelWrapper.prototype.getOffsetLeft = /**
|
|
1454
1337
|
* @return {?}
|
|
1455
1338
|
*/
|
|
1456
1339
|
function () {
|
|
1457
|
-
|
|
1458
|
-
var lengthOfTabList = this._tabList.nativeElement.scrollWidth;
|
|
1459
|
-
/** @type {?} */
|
|
1460
|
-
var viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1461
|
-
return (lengthOfTabList - viewLength) || 0;
|
|
1340
|
+
return this.elementRef.nativeElement.offsetLeft;
|
|
1462
1341
|
};
|
|
1463
|
-
/** Tells the ink-bar to align itself to the current label wrapper */
|
|
1464
1342
|
/**
|
|
1465
|
-
* Tells the ink-bar to align itself to the current label wrapper
|
|
1466
1343
|
* @return {?}
|
|
1467
1344
|
*/
|
|
1468
|
-
|
|
1469
|
-
* Tells the ink-bar to align itself to the current label wrapper
|
|
1345
|
+
MatTabLabelWrapper.prototype.getOffsetWidth = /**
|
|
1470
1346
|
* @return {?}
|
|
1471
1347
|
*/
|
|
1472
1348
|
function () {
|
|
1473
|
-
|
|
1474
|
-
var selectedItem = this._items && this._items.length ?
|
|
1475
|
-
this._items.toArray()[this.selectedIndex] : null;
|
|
1476
|
-
/** @type {?} */
|
|
1477
|
-
var selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
|
|
1478
|
-
if (selectedLabelWrapper) {
|
|
1479
|
-
this._inkBar.alignToElement(selectedLabelWrapper);
|
|
1480
|
-
}
|
|
1481
|
-
else {
|
|
1482
|
-
this._inkBar.hide();
|
|
1483
|
-
}
|
|
1484
|
-
};
|
|
1485
|
-
/** Stops the currently-running paginator interval. */
|
|
1486
|
-
/**
|
|
1487
|
-
* Stops the currently-running paginator interval.
|
|
1488
|
-
* @return {?}
|
|
1489
|
-
*/
|
|
1490
|
-
MatPaginatedTabHeader.prototype._stopInterval = /**
|
|
1491
|
-
* Stops the currently-running paginator interval.
|
|
1492
|
-
* @return {?}
|
|
1493
|
-
*/
|
|
1494
|
-
function () {
|
|
1495
|
-
this._stopScrolling.next();
|
|
1496
|
-
};
|
|
1497
|
-
/**
|
|
1498
|
-
* Handles the user pressing down on one of the paginators.
|
|
1499
|
-
* Starts scrolling the header after a certain amount of time.
|
|
1500
|
-
* @param direction In which direction the paginator should be scrolled.
|
|
1501
|
-
*/
|
|
1502
|
-
/**
|
|
1503
|
-
* Handles the user pressing down on one of the paginators.
|
|
1504
|
-
* Starts scrolling the header after a certain amount of time.
|
|
1505
|
-
* @param {?} direction In which direction the paginator should be scrolled.
|
|
1506
|
-
* @return {?}
|
|
1507
|
-
*/
|
|
1508
|
-
MatPaginatedTabHeader.prototype._handlePaginatorPress = /**
|
|
1509
|
-
* Handles the user pressing down on one of the paginators.
|
|
1510
|
-
* Starts scrolling the header after a certain amount of time.
|
|
1511
|
-
* @param {?} direction In which direction the paginator should be scrolled.
|
|
1512
|
-
* @return {?}
|
|
1513
|
-
*/
|
|
1514
|
-
function (direction) {
|
|
1515
|
-
var _this = this;
|
|
1516
|
-
// Avoid overlapping timers.
|
|
1517
|
-
this._stopInterval();
|
|
1518
|
-
// Start a timer after the delay and keep firing based on the interval.
|
|
1519
|
-
rxjs.timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
|
|
1520
|
-
// Keep the timer going until something tells it to stop or the component is destroyed.
|
|
1521
|
-
.pipe(operators.takeUntil(rxjs.merge(this._stopScrolling, this._destroyed)))
|
|
1522
|
-
.subscribe((/**
|
|
1523
|
-
* @return {?}
|
|
1524
|
-
*/
|
|
1525
|
-
function () {
|
|
1526
|
-
var _a = _this._scrollHeader(direction), maxScrollDistance = _a.maxScrollDistance, distance = _a.distance;
|
|
1527
|
-
// Stop the timer if we've reached the start or the end.
|
|
1528
|
-
if (distance === 0 || distance >= maxScrollDistance) {
|
|
1529
|
-
_this._stopInterval();
|
|
1530
|
-
}
|
|
1531
|
-
}));
|
|
1532
|
-
};
|
|
1533
|
-
/**
|
|
1534
|
-
* Scrolls the header to a given position.
|
|
1535
|
-
* @param position Position to which to scroll.
|
|
1536
|
-
* @returns Information on the current scroll distance and the maximum.
|
|
1537
|
-
*/
|
|
1538
|
-
/**
|
|
1539
|
-
* Scrolls the header to a given position.
|
|
1540
|
-
* @private
|
|
1541
|
-
* @param {?} position Position to which to scroll.
|
|
1542
|
-
* @return {?} Information on the current scroll distance and the maximum.
|
|
1543
|
-
*/
|
|
1544
|
-
MatPaginatedTabHeader.prototype._scrollTo = /**
|
|
1545
|
-
* Scrolls the header to a given position.
|
|
1546
|
-
* @private
|
|
1547
|
-
* @param {?} position Position to which to scroll.
|
|
1548
|
-
* @return {?} Information on the current scroll distance and the maximum.
|
|
1549
|
-
*/
|
|
1550
|
-
function (position) {
|
|
1551
|
-
/** @type {?} */
|
|
1552
|
-
var maxScrollDistance = this._getMaxScrollDistance();
|
|
1553
|
-
this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
|
|
1554
|
-
// Mark that the scroll distance has changed so that after the view is checked, the CSS
|
|
1555
|
-
// transformation can move the header.
|
|
1556
|
-
this._scrollDistanceChanged = true;
|
|
1557
|
-
this._checkScrollingControls();
|
|
1558
|
-
return { maxScrollDistance: maxScrollDistance, distance: this._scrollDistance };
|
|
1559
|
-
};
|
|
1560
|
-
/** @nocollapse */
|
|
1561
|
-
MatPaginatedTabHeader.ctorParameters = function () { return [
|
|
1562
|
-
{ type: core.ElementRef },
|
|
1563
|
-
{ type: core.ChangeDetectorRef },
|
|
1564
|
-
{ type: scrolling.ViewportRuler },
|
|
1565
|
-
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
1566
|
-
{ type: core.NgZone },
|
|
1567
|
-
{ type: platform.Platform },
|
|
1568
|
-
{ type: String }
|
|
1569
|
-
]; };
|
|
1570
|
-
return MatPaginatedTabHeader;
|
|
1571
|
-
}());
|
|
1572
|
-
|
|
1573
|
-
/**
|
|
1574
|
-
* @fileoverview added by tsickle
|
|
1575
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1576
|
-
*/
|
|
1577
|
-
/**
|
|
1578
|
-
* The header of the tab group which displays a list of all the tabs in the tab group. Includes
|
|
1579
|
-
* an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
|
|
1580
|
-
* width of the header container, then arrows will be displayed to allow the user to scroll
|
|
1581
|
-
* left and right across the header.
|
|
1582
|
-
* \@docs-private
|
|
1583
|
-
*/
|
|
1584
|
-
var MatTabHeader = /** @class */ (function (_super) {
|
|
1585
|
-
__extends(MatTabHeader, _super);
|
|
1586
|
-
function MatTabHeader(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform$$1,
|
|
1587
|
-
// @breaking-change 9.0.0 `_animationMode` parameter to be made required.
|
|
1588
|
-
animationMode) {
|
|
1589
|
-
var _this = _super.call(this, elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform$$1, animationMode) || this;
|
|
1590
|
-
_this._disableRipple = false;
|
|
1591
|
-
return _this;
|
|
1592
|
-
}
|
|
1593
|
-
Object.defineProperty(MatTabHeader.prototype, "disableRipple", {
|
|
1594
|
-
/** Whether the ripple effect is disabled or not. */
|
|
1595
|
-
get: /**
|
|
1596
|
-
* Whether the ripple effect is disabled or not.
|
|
1597
|
-
* @return {?}
|
|
1598
|
-
*/
|
|
1599
|
-
function () { return this._disableRipple; },
|
|
1600
|
-
set: /**
|
|
1601
|
-
* @param {?} value
|
|
1602
|
-
* @return {?}
|
|
1603
|
-
*/
|
|
1604
|
-
function (value) { this._disableRipple = coercion.coerceBooleanProperty(value); },
|
|
1605
|
-
enumerable: true,
|
|
1606
|
-
configurable: true
|
|
1607
|
-
});
|
|
1608
|
-
/**
|
|
1609
|
-
* @protected
|
|
1610
|
-
* @param {?} event
|
|
1611
|
-
* @return {?}
|
|
1612
|
-
*/
|
|
1613
|
-
MatTabHeader.prototype._itemSelected = /**
|
|
1614
|
-
* @protected
|
|
1615
|
-
* @param {?} event
|
|
1616
|
-
* @return {?}
|
|
1617
|
-
*/
|
|
1618
|
-
function (event) {
|
|
1619
|
-
event.preventDefault();
|
|
1349
|
+
return this.elementRef.nativeElement.offsetWidth;
|
|
1620
1350
|
};
|
|
1621
|
-
|
|
1622
|
-
{ type: core.
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
inputs: ['selectedIndex'],
|
|
1626
|
-
outputs: ['selectFocusedIndex', 'indexFocused'],
|
|
1627
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
1628
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1351
|
+
MatTabLabelWrapper.decorators = [
|
|
1352
|
+
{ type: core.Directive, args: [{
|
|
1353
|
+
selector: '[matTabLabelWrapper]',
|
|
1354
|
+
inputs: ['disabled'],
|
|
1629
1355
|
host: {
|
|
1630
|
-
'class
|
|
1631
|
-
'[
|
|
1632
|
-
|
|
1633
|
-
},
|
|
1356
|
+
'[class.mat-tab-disabled]': 'disabled',
|
|
1357
|
+
'[attr.aria-disabled]': '!!disabled',
|
|
1358
|
+
}
|
|
1634
1359
|
},] },
|
|
1635
1360
|
];
|
|
1636
1361
|
/** @nocollapse */
|
|
1637
|
-
|
|
1638
|
-
{ type: core.ElementRef }
|
|
1639
|
-
{ type: core.ChangeDetectorRef },
|
|
1640
|
-
{ type: scrolling.ViewportRuler },
|
|
1641
|
-
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
1642
|
-
{ type: core.NgZone },
|
|
1643
|
-
{ type: platform.Platform },
|
|
1644
|
-
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
1362
|
+
MatTabLabelWrapper.ctorParameters = function () { return [
|
|
1363
|
+
{ type: core.ElementRef }
|
|
1645
1364
|
]; };
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
_inkBar: [{ type: core.ViewChild, args: [MatInkBar, { static: true },] }],
|
|
1649
|
-
_tabListContainer: [{ type: core.ViewChild, args: ['tabListContainer', { static: true },] }],
|
|
1650
|
-
_tabList: [{ type: core.ViewChild, args: ['tabList', { static: true },] }],
|
|
1651
|
-
_nextPaginator: [{ type: core.ViewChild, args: ['nextPaginator', { static: false },] }],
|
|
1652
|
-
_previousPaginator: [{ type: core.ViewChild, args: ['previousPaginator', { static: false },] }],
|
|
1653
|
-
disableRipple: [{ type: core.Input }]
|
|
1654
|
-
};
|
|
1655
|
-
return MatTabHeader;
|
|
1656
|
-
}(MatPaginatedTabHeader));
|
|
1365
|
+
return MatTabLabelWrapper;
|
|
1366
|
+
}(_MatTabLabelWrapperMixinBase));
|
|
1657
1367
|
|
|
1658
1368
|
/**
|
|
1659
1369
|
* @fileoverview added by tsickle
|
|
1660
1370
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1661
1371
|
*/
|
|
1662
1372
|
/**
|
|
1663
|
-
*
|
|
1373
|
+
* Config used to bind passive event listeners
|
|
1664
1374
|
* @type {?}
|
|
1665
1375
|
*/
|
|
1666
|
-
var
|
|
1376
|
+
var passiveEventListenerOptions = (/** @type {?} */ (platform.normalizePassiveListenerOptions({ passive: true })));
|
|
1667
1377
|
/**
|
|
1668
|
-
*
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
* A simple change event emitted on focus or selection changes.
|
|
1378
|
+
* The distance in pixels that will be overshot when scrolling a tab label into view. This helps
|
|
1379
|
+
* provide a small affordance to the label next to it.
|
|
1380
|
+
* @type {?}
|
|
1672
1381
|
*/
|
|
1673
|
-
|
|
1674
|
-
function MatTabChangeEvent() {
|
|
1675
|
-
}
|
|
1676
|
-
return MatTabChangeEvent;
|
|
1677
|
-
}());
|
|
1382
|
+
var EXAGGERATED_OVERSCROLL = 60;
|
|
1678
1383
|
/**
|
|
1679
|
-
*
|
|
1384
|
+
* Amount of milliseconds to wait before starting to scroll the header automatically.
|
|
1385
|
+
* Set a little conservatively in order to handle fake events dispatched on touch devices.
|
|
1680
1386
|
* @type {?}
|
|
1681
1387
|
*/
|
|
1682
|
-
var
|
|
1683
|
-
// Boilerplate for applying mixins to MatTabGroup.
|
|
1388
|
+
var HEADER_SCROLL_DELAY = 650;
|
|
1684
1389
|
/**
|
|
1685
|
-
*
|
|
1390
|
+
* Interval in milliseconds at which to scroll the header
|
|
1391
|
+
* while the user is holding their pointer.
|
|
1392
|
+
* @type {?}
|
|
1686
1393
|
*/
|
|
1687
|
-
var
|
|
1688
|
-
// Boilerplate for applying mixins to MatTabGroup.
|
|
1394
|
+
var HEADER_SCROLL_INTERVAL = 100;
|
|
1689
1395
|
/**
|
|
1396
|
+
* Base class for a tab header that supported pagination.
|
|
1690
1397
|
* \@docs-private
|
|
1398
|
+
* @abstract
|
|
1691
1399
|
*/
|
|
1692
|
-
|
|
1693
|
-
function
|
|
1400
|
+
var MatPaginatedTabHeader = /** @class */ (function () {
|
|
1401
|
+
function MatPaginatedTabHeader(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone, _platform, _animationMode) {
|
|
1402
|
+
var _this = this;
|
|
1694
1403
|
this._elementRef = _elementRef;
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
|
|
1702
|
-
* animated ink-bar, keyboard navigation, and screen reader.
|
|
1703
|
-
* See: https://material.io/design/components/tabs.html
|
|
1704
|
-
*/
|
|
1705
|
-
var MatTabGroup = /** @class */ (function (_super) {
|
|
1706
|
-
__extends(MatTabGroup, _super);
|
|
1707
|
-
function MatTabGroup(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
|
|
1708
|
-
var _this = _super.call(this, elementRef) || this;
|
|
1709
|
-
_this._changeDetectorRef = _changeDetectorRef;
|
|
1710
|
-
_this._animationMode = _animationMode;
|
|
1404
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
1405
|
+
this._viewportRuler = _viewportRuler;
|
|
1406
|
+
this._dir = _dir;
|
|
1407
|
+
this._ngZone = _ngZone;
|
|
1408
|
+
this._platform = _platform;
|
|
1409
|
+
this._animationMode = _animationMode;
|
|
1711
1410
|
/**
|
|
1712
|
-
* The
|
|
1411
|
+
* The distance in pixels that the tab labels should be translated to the left.
|
|
1713
1412
|
*/
|
|
1714
|
-
|
|
1413
|
+
this._scrollDistance = 0;
|
|
1715
1414
|
/**
|
|
1716
|
-
*
|
|
1415
|
+
* Whether the header should scroll to the selected index after the view has been checked.
|
|
1717
1416
|
*/
|
|
1718
|
-
|
|
1417
|
+
this._selectedIndexChanged = false;
|
|
1719
1418
|
/**
|
|
1720
|
-
*
|
|
1419
|
+
* Emits when the component is destroyed.
|
|
1721
1420
|
*/
|
|
1722
|
-
|
|
1421
|
+
this._destroyed = new rxjs.Subject();
|
|
1723
1422
|
/**
|
|
1724
|
-
*
|
|
1423
|
+
* Whether the controls for pagination should be displayed
|
|
1725
1424
|
*/
|
|
1726
|
-
|
|
1727
|
-
_this._dynamicHeight = false;
|
|
1728
|
-
_this._selectedIndex = null;
|
|
1425
|
+
this._showPaginationControls = false;
|
|
1729
1426
|
/**
|
|
1730
|
-
*
|
|
1427
|
+
* Whether the tab list can be scrolled more towards the end of the tab label list.
|
|
1731
1428
|
*/
|
|
1732
|
-
|
|
1429
|
+
this._disableScrollAfter = true;
|
|
1733
1430
|
/**
|
|
1734
|
-
*
|
|
1431
|
+
* Whether the tab list can be scrolled more towards the beginning of the tab label list.
|
|
1735
1432
|
*/
|
|
1736
|
-
|
|
1433
|
+
this._disableScrollBefore = true;
|
|
1737
1434
|
/**
|
|
1738
|
-
*
|
|
1435
|
+
* Stream that will stop the automated scrolling.
|
|
1739
1436
|
*/
|
|
1740
|
-
|
|
1437
|
+
this._stopScrolling = new rxjs.Subject();
|
|
1438
|
+
this._selectedIndex = 0;
|
|
1741
1439
|
/**
|
|
1742
|
-
* Event emitted when the
|
|
1440
|
+
* Event emitted when the option is selected.
|
|
1743
1441
|
*/
|
|
1744
|
-
|
|
1442
|
+
this.selectFocusedIndex = new core.EventEmitter();
|
|
1745
1443
|
/**
|
|
1746
|
-
* Event emitted when
|
|
1747
|
-
*/
|
|
1748
|
-
_this.selectedTabChange = new core.EventEmitter(true);
|
|
1749
|
-
_this._groupId = nextId++;
|
|
1750
|
-
_this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
|
|
1751
|
-
defaultConfig.animationDuration : '500ms';
|
|
1752
|
-
return _this;
|
|
1753
|
-
}
|
|
1754
|
-
Object.defineProperty(MatTabGroup.prototype, "dynamicHeight", {
|
|
1755
|
-
/** Whether the tab group should grow to the size of the active tab. */
|
|
1756
|
-
get: /**
|
|
1757
|
-
* Whether the tab group should grow to the size of the active tab.
|
|
1758
|
-
* @return {?}
|
|
1444
|
+
* Event emitted when a label is focused.
|
|
1759
1445
|
*/
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1446
|
+
this.indexFocused = new core.EventEmitter();
|
|
1447
|
+
// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
|
|
1448
|
+
_ngZone.runOutsideAngular((/**
|
|
1763
1449
|
* @return {?}
|
|
1764
1450
|
*/
|
|
1765
|
-
function (
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1451
|
+
function () {
|
|
1452
|
+
rxjs.fromEvent(_elementRef.nativeElement, 'mouseleave')
|
|
1453
|
+
.pipe(operators.takeUntil(_this._destroyed))
|
|
1454
|
+
.subscribe((/**
|
|
1455
|
+
* @return {?}
|
|
1456
|
+
*/
|
|
1457
|
+
function () {
|
|
1458
|
+
_this._stopInterval();
|
|
1459
|
+
}));
|
|
1460
|
+
}));
|
|
1461
|
+
}
|
|
1462
|
+
Object.defineProperty(MatPaginatedTabHeader.prototype, "selectedIndex", {
|
|
1770
1463
|
/** The index of the active tab. */
|
|
1771
1464
|
get: /**
|
|
1772
1465
|
* The index of the active tab.
|
|
@@ -1778,428 +1471,828 @@ var MatTabGroup = /** @class */ (function (_super) {
|
|
|
1778
1471
|
* @return {?}
|
|
1779
1472
|
*/
|
|
1780
1473
|
function (value) {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
* Duration for the tab animation. Will be normalized to milliseconds if no units are set.
|
|
1790
|
-
* @return {?}
|
|
1791
|
-
*/
|
|
1792
|
-
function () { return this._animationDuration; },
|
|
1793
|
-
set: /**
|
|
1794
|
-
* @param {?} value
|
|
1795
|
-
* @return {?}
|
|
1796
|
-
*/
|
|
1797
|
-
function (value) {
|
|
1798
|
-
this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
|
|
1474
|
+
value = coercion.coerceNumberProperty(value);
|
|
1475
|
+
if (this._selectedIndex != value) {
|
|
1476
|
+
this._selectedIndexChanged = true;
|
|
1477
|
+
this._selectedIndex = value;
|
|
1478
|
+
if (this._keyManager) {
|
|
1479
|
+
this._keyManager.updateActiveItemIndex(value);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1799
1482
|
},
|
|
1800
1483
|
enumerable: true,
|
|
1801
1484
|
configurable: true
|
|
1802
1485
|
});
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1486
|
+
/**
|
|
1487
|
+
* @return {?}
|
|
1488
|
+
*/
|
|
1489
|
+
MatPaginatedTabHeader.prototype.ngAfterViewInit = /**
|
|
1490
|
+
* @return {?}
|
|
1491
|
+
*/
|
|
1492
|
+
function () {
|
|
1493
|
+
var _this = this;
|
|
1494
|
+
// We need to handle these events manually, because we want to bind passive event listeners.
|
|
1495
|
+
rxjs.fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
1496
|
+
.pipe(operators.takeUntil(this._destroyed))
|
|
1497
|
+
.subscribe((/**
|
|
1807
1498
|
* @return {?}
|
|
1808
1499
|
*/
|
|
1809
|
-
function () {
|
|
1810
|
-
|
|
1811
|
-
|
|
1500
|
+
function () {
|
|
1501
|
+
_this._handlePaginatorPress('before');
|
|
1502
|
+
}));
|
|
1503
|
+
rxjs.fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
1504
|
+
.pipe(operators.takeUntil(this._destroyed))
|
|
1505
|
+
.subscribe((/**
|
|
1812
1506
|
* @return {?}
|
|
1813
1507
|
*/
|
|
1814
|
-
function (
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
if (value) {
|
|
1819
|
-
nativeElement.classList.add("mat-background-" + value);
|
|
1820
|
-
}
|
|
1821
|
-
this._backgroundColor = value;
|
|
1822
|
-
},
|
|
1823
|
-
enumerable: true,
|
|
1824
|
-
configurable: true
|
|
1825
|
-
});
|
|
1826
|
-
/**
|
|
1827
|
-
* After the content is checked, this component knows what tabs have been defined
|
|
1828
|
-
* and what the selected index should be. This is where we can know exactly what position
|
|
1829
|
-
* each tab should be in according to the new selected index, and additionally we know how
|
|
1830
|
-
* a new selected tab should transition in (from the left or right).
|
|
1831
|
-
*/
|
|
1508
|
+
function () {
|
|
1509
|
+
_this._handlePaginatorPress('after');
|
|
1510
|
+
}));
|
|
1511
|
+
};
|
|
1832
1512
|
/**
|
|
1833
|
-
* After the content is checked, this component knows what tabs have been defined
|
|
1834
|
-
* and what the selected index should be. This is where we can know exactly what position
|
|
1835
|
-
* each tab should be in according to the new selected index, and additionally we know how
|
|
1836
|
-
* a new selected tab should transition in (from the left or right).
|
|
1837
1513
|
* @return {?}
|
|
1838
1514
|
*/
|
|
1839
|
-
|
|
1840
|
-
* After the content is checked, this component knows what tabs have been defined
|
|
1841
|
-
* and what the selected index should be. This is where we can know exactly what position
|
|
1842
|
-
* each tab should be in according to the new selected index, and additionally we know how
|
|
1843
|
-
* a new selected tab should transition in (from the left or right).
|
|
1515
|
+
MatPaginatedTabHeader.prototype.ngAfterContentInit = /**
|
|
1844
1516
|
* @return {?}
|
|
1845
1517
|
*/
|
|
1846
1518
|
function () {
|
|
1847
1519
|
var _this = this;
|
|
1848
|
-
// Don't clamp the `indexToSelect` immediately in the setter because it can happen that
|
|
1849
|
-
// the amount of tabs changes before the actual change detection runs.
|
|
1850
1520
|
/** @type {?} */
|
|
1851
|
-
var
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
var isFirstRun_1 = this._selectedIndex == null;
|
|
1857
|
-
if (!isFirstRun_1) {
|
|
1858
|
-
this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
|
|
1859
|
-
}
|
|
1860
|
-
// Changing these values after change detection has run
|
|
1861
|
-
// since the checked content may contain references to them.
|
|
1862
|
-
Promise.resolve().then((/**
|
|
1863
|
-
* @return {?}
|
|
1864
|
-
*/
|
|
1865
|
-
function () {
|
|
1866
|
-
_this._tabs.forEach((/**
|
|
1867
|
-
* @param {?} tab
|
|
1868
|
-
* @param {?} index
|
|
1869
|
-
* @return {?}
|
|
1870
|
-
*/
|
|
1871
|
-
function (tab, index) { return tab.isActive = index === indexToSelect; }));
|
|
1872
|
-
if (!isFirstRun_1) {
|
|
1873
|
-
_this.selectedIndexChange.emit(indexToSelect);
|
|
1874
|
-
}
|
|
1875
|
-
}));
|
|
1876
|
-
}
|
|
1877
|
-
// Setup the position for each tab and optionally setup an origin on the next selected tab.
|
|
1878
|
-
this._tabs.forEach((/**
|
|
1879
|
-
* @param {?} tab
|
|
1880
|
-
* @param {?} index
|
|
1521
|
+
var dirChange = this._dir ? this._dir.change : rxjs.of(null);
|
|
1522
|
+
/** @type {?} */
|
|
1523
|
+
var resize = this._viewportRuler.change(150);
|
|
1524
|
+
/** @type {?} */
|
|
1525
|
+
var realign = (/**
|
|
1881
1526
|
* @return {?}
|
|
1882
1527
|
*/
|
|
1883
|
-
function (
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1528
|
+
function () {
|
|
1529
|
+
_this.updatePagination();
|
|
1530
|
+
_this._alignInkBarToSelectedTab();
|
|
1531
|
+
});
|
|
1532
|
+
this._keyManager = new a11y.FocusKeyManager(this._items)
|
|
1533
|
+
.withHorizontalOrientation(this._getLayoutDirection())
|
|
1534
|
+
.withWrap();
|
|
1535
|
+
this._keyManager.updateActiveItem(0);
|
|
1536
|
+
// Defer the first call in order to allow for slower browsers to lay out the elements.
|
|
1537
|
+
// This helps in cases where the user lands directly on a page with paginated tabs.
|
|
1538
|
+
typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
|
|
1539
|
+
// On dir change or window resize, realign the ink bar and update the orientation of
|
|
1540
|
+
// the key manager if the direction has changed.
|
|
1541
|
+
rxjs.merge(dirChange, resize, this._items.changes).pipe(operators.takeUntil(this._destroyed)).subscribe((/**
|
|
1542
|
+
* @return {?}
|
|
1543
|
+
*/
|
|
1544
|
+
function () {
|
|
1545
|
+
realign();
|
|
1546
|
+
_this._keyManager.withHorizontalOrientation(_this._getLayoutDirection());
|
|
1890
1547
|
}));
|
|
1891
|
-
|
|
1892
|
-
|
|
1548
|
+
// If there is a change in the focus key manager we need to emit the `indexFocused`
|
|
1549
|
+
// event in order to provide a public event that notifies about focus changes. Also we realign
|
|
1550
|
+
// the tabs container by scrolling the new focused tab into the visible section.
|
|
1551
|
+
this._keyManager.change.pipe(operators.takeUntil(this._destroyed)).subscribe((/**
|
|
1552
|
+
* @param {?} newFocusIndex
|
|
1553
|
+
* @return {?}
|
|
1554
|
+
*/
|
|
1555
|
+
function (newFocusIndex) {
|
|
1556
|
+
_this.indexFocused.emit(newFocusIndex);
|
|
1557
|
+
_this._setTabFocus(newFocusIndex);
|
|
1558
|
+
}));
|
|
1559
|
+
};
|
|
1560
|
+
/**
|
|
1561
|
+
* @return {?}
|
|
1562
|
+
*/
|
|
1563
|
+
MatPaginatedTabHeader.prototype.ngAfterContentChecked = /**
|
|
1564
|
+
* @return {?}
|
|
1565
|
+
*/
|
|
1566
|
+
function () {
|
|
1567
|
+
// If the number of tab labels have changed, check if scrolling should be enabled
|
|
1568
|
+
if (this._tabLabelCount != this._items.length) {
|
|
1569
|
+
this.updatePagination();
|
|
1570
|
+
this._tabLabelCount = this._items.length;
|
|
1571
|
+
this._changeDetectorRef.markForCheck();
|
|
1572
|
+
}
|
|
1573
|
+
// If the selected index has changed, scroll to the label and check if the scrolling controls
|
|
1574
|
+
// should be disabled.
|
|
1575
|
+
if (this._selectedIndexChanged) {
|
|
1576
|
+
this._scrollToLabel(this._selectedIndex);
|
|
1577
|
+
this._checkScrollingControls();
|
|
1578
|
+
this._alignInkBarToSelectedTab();
|
|
1579
|
+
this._selectedIndexChanged = false;
|
|
1580
|
+
this._changeDetectorRef.markForCheck();
|
|
1581
|
+
}
|
|
1582
|
+
// If the scroll distance has been changed (tab selected, focused, scroll controls activated),
|
|
1583
|
+
// then translate the header to reflect this.
|
|
1584
|
+
if (this._scrollDistanceChanged) {
|
|
1585
|
+
this._updateTabScrollPosition();
|
|
1586
|
+
this._scrollDistanceChanged = false;
|
|
1893
1587
|
this._changeDetectorRef.markForCheck();
|
|
1894
1588
|
}
|
|
1895
1589
|
};
|
|
1896
1590
|
/**
|
|
1897
1591
|
* @return {?}
|
|
1898
1592
|
*/
|
|
1899
|
-
|
|
1593
|
+
MatPaginatedTabHeader.prototype.ngOnDestroy = /**
|
|
1900
1594
|
* @return {?}
|
|
1901
1595
|
*/
|
|
1902
1596
|
function () {
|
|
1903
|
-
|
|
1904
|
-
this.
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1597
|
+
this._destroyed.next();
|
|
1598
|
+
this._destroyed.complete();
|
|
1599
|
+
this._stopScrolling.complete();
|
|
1600
|
+
};
|
|
1601
|
+
/** Handles keyboard events on the header. */
|
|
1602
|
+
/**
|
|
1603
|
+
* Handles keyboard events on the header.
|
|
1604
|
+
* @param {?} event
|
|
1605
|
+
* @return {?}
|
|
1606
|
+
*/
|
|
1607
|
+
MatPaginatedTabHeader.prototype._handleKeydown = /**
|
|
1608
|
+
* Handles keyboard events on the header.
|
|
1609
|
+
* @param {?} event
|
|
1610
|
+
* @return {?}
|
|
1611
|
+
*/
|
|
1612
|
+
function (event) {
|
|
1613
|
+
// We don't handle any key bindings with a modifier key.
|
|
1614
|
+
if (keycodes.hasModifierKey(event)) {
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
switch (event.keyCode) {
|
|
1618
|
+
case keycodes.HOME:
|
|
1619
|
+
this._keyManager.setFirstItemActive();
|
|
1620
|
+
event.preventDefault();
|
|
1621
|
+
break;
|
|
1622
|
+
case keycodes.END:
|
|
1623
|
+
this._keyManager.setLastItemActive();
|
|
1624
|
+
event.preventDefault();
|
|
1625
|
+
break;
|
|
1626
|
+
case keycodes.ENTER:
|
|
1627
|
+
case keycodes.SPACE:
|
|
1628
|
+
this.selectFocusedIndex.emit(this.focusIndex);
|
|
1629
|
+
this._itemSelected(event);
|
|
1630
|
+
break;
|
|
1631
|
+
default:
|
|
1632
|
+
this._keyManager.onKeydown(event);
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
/**
|
|
1636
|
+
* Callback for when the MutationObserver detects that the content has changed.
|
|
1637
|
+
*/
|
|
1638
|
+
/**
|
|
1639
|
+
* Callback for when the MutationObserver detects that the content has changed.
|
|
1640
|
+
* @return {?}
|
|
1641
|
+
*/
|
|
1642
|
+
MatPaginatedTabHeader.prototype._onContentChanges = /**
|
|
1643
|
+
* Callback for when the MutationObserver detects that the content has changed.
|
|
1644
|
+
* @return {?}
|
|
1645
|
+
*/
|
|
1646
|
+
function () {
|
|
1647
|
+
var _this = this;
|
|
1648
|
+
/** @type {?} */
|
|
1649
|
+
var textContent = this._elementRef.nativeElement.textContent;
|
|
1650
|
+
// We need to diff the text content of the header, because the MutationObserver callback
|
|
1651
|
+
// will fire even if the text content didn't change which is inefficient and is prone
|
|
1652
|
+
// to infinite loops if a poorly constructed expression is passed in (see #14249).
|
|
1653
|
+
if (textContent !== this._currentTextContent) {
|
|
1654
|
+
this._currentTextContent = textContent || '';
|
|
1655
|
+
// The content observer runs outside the `NgZone` by default, which
|
|
1656
|
+
// means that we need to bring the callback back in ourselves.
|
|
1657
|
+
this._ngZone.run((/**
|
|
1658
|
+
* @return {?}
|
|
1659
|
+
*/
|
|
1660
|
+
function () {
|
|
1661
|
+
_this.updatePagination();
|
|
1662
|
+
_this._alignInkBarToSelectedTab();
|
|
1663
|
+
_this._changeDetectorRef.markForCheck();
|
|
1664
|
+
}));
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1667
|
+
/**
|
|
1668
|
+
* Updates the view whether pagination should be enabled or not.
|
|
1669
|
+
*
|
|
1670
|
+
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1671
|
+
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1672
|
+
* page.
|
|
1673
|
+
*/
|
|
1674
|
+
/**
|
|
1675
|
+
* Updates the view whether pagination should be enabled or not.
|
|
1676
|
+
*
|
|
1677
|
+
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1678
|
+
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1679
|
+
* page.
|
|
1680
|
+
* @return {?}
|
|
1681
|
+
*/
|
|
1682
|
+
MatPaginatedTabHeader.prototype.updatePagination = /**
|
|
1683
|
+
* Updates the view whether pagination should be enabled or not.
|
|
1684
|
+
*
|
|
1685
|
+
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1686
|
+
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1687
|
+
* page.
|
|
1688
|
+
* @return {?}
|
|
1689
|
+
*/
|
|
1690
|
+
function () {
|
|
1691
|
+
this._checkPaginationEnabled();
|
|
1692
|
+
this._checkScrollingControls();
|
|
1693
|
+
this._updateTabScrollPosition();
|
|
1694
|
+
};
|
|
1695
|
+
Object.defineProperty(MatPaginatedTabHeader.prototype, "focusIndex", {
|
|
1696
|
+
/** Tracks which element has focus; used for keyboard navigation */
|
|
1697
|
+
get: /**
|
|
1698
|
+
* Tracks which element has focus; used for keyboard navigation
|
|
1699
|
+
* @return {?}
|
|
1700
|
+
*/
|
|
1701
|
+
function () {
|
|
1702
|
+
return this._keyManager ? (/** @type {?} */ (this._keyManager.activeItemIndex)) : 0;
|
|
1703
|
+
},
|
|
1704
|
+
/** When the focus index is set, we must manually send focus to the correct label */
|
|
1705
|
+
set: /**
|
|
1706
|
+
* When the focus index is set, we must manually send focus to the correct label
|
|
1707
|
+
* @param {?} value
|
|
1708
|
+
* @return {?}
|
|
1709
|
+
*/
|
|
1710
|
+
function (value) {
|
|
1711
|
+
if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
|
|
1712
|
+
return;
|
|
1927
1713
|
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1714
|
+
this._keyManager.setActiveItem(value);
|
|
1715
|
+
},
|
|
1716
|
+
enumerable: true,
|
|
1717
|
+
configurable: true
|
|
1718
|
+
});
|
|
1719
|
+
/**
|
|
1720
|
+
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
|
|
1721
|
+
* providing a valid index and return true.
|
|
1722
|
+
*/
|
|
1723
|
+
/**
|
|
1724
|
+
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
|
|
1725
|
+
* providing a valid index and return true.
|
|
1726
|
+
* @param {?} index
|
|
1727
|
+
* @return {?}
|
|
1728
|
+
*/
|
|
1729
|
+
MatPaginatedTabHeader.prototype._isValidIndex = /**
|
|
1730
|
+
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
|
|
1731
|
+
* providing a valid index and return true.
|
|
1732
|
+
* @param {?} index
|
|
1733
|
+
* @return {?}
|
|
1734
|
+
*/
|
|
1735
|
+
function (index) {
|
|
1736
|
+
if (!this._items) {
|
|
1737
|
+
return true;
|
|
1738
|
+
}
|
|
1739
|
+
/** @type {?} */
|
|
1740
|
+
var tab = this._items ? this._items.toArray()[index] : null;
|
|
1741
|
+
return !!tab && !tab.disabled;
|
|
1742
|
+
};
|
|
1743
|
+
/**
|
|
1744
|
+
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
|
|
1745
|
+
* scrolling is enabled.
|
|
1746
|
+
*/
|
|
1747
|
+
/**
|
|
1748
|
+
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
|
|
1749
|
+
* scrolling is enabled.
|
|
1750
|
+
* @param {?} tabIndex
|
|
1751
|
+
* @return {?}
|
|
1752
|
+
*/
|
|
1753
|
+
MatPaginatedTabHeader.prototype._setTabFocus = /**
|
|
1754
|
+
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
|
|
1755
|
+
* scrolling is enabled.
|
|
1756
|
+
* @param {?} tabIndex
|
|
1757
|
+
* @return {?}
|
|
1758
|
+
*/
|
|
1759
|
+
function (tabIndex) {
|
|
1760
|
+
if (this._showPaginationControls) {
|
|
1761
|
+
this._scrollToLabel(tabIndex);
|
|
1762
|
+
}
|
|
1763
|
+
if (this._items && this._items.length) {
|
|
1764
|
+
this._items.toArray()[tabIndex].focus();
|
|
1765
|
+
// Do not let the browser manage scrolling to focus the element, this will be handled
|
|
1766
|
+
// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
|
|
1767
|
+
// should be the full width minus the offset width.
|
|
1768
|
+
/** @type {?} */
|
|
1769
|
+
var containerEl = this._tabListContainer.nativeElement;
|
|
1770
|
+
/** @type {?} */
|
|
1771
|
+
var dir = this._getLayoutDirection();
|
|
1772
|
+
if (dir == 'ltr') {
|
|
1773
|
+
containerEl.scrollLeft = 0;
|
|
1774
|
+
}
|
|
1775
|
+
else {
|
|
1776
|
+
containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
/** The layout direction of the containing app. */
|
|
1781
|
+
/**
|
|
1782
|
+
* The layout direction of the containing app.
|
|
1783
|
+
* @return {?}
|
|
1784
|
+
*/
|
|
1785
|
+
MatPaginatedTabHeader.prototype._getLayoutDirection = /**
|
|
1786
|
+
* The layout direction of the containing app.
|
|
1787
|
+
* @return {?}
|
|
1788
|
+
*/
|
|
1789
|
+
function () {
|
|
1790
|
+
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
1791
|
+
};
|
|
1792
|
+
/** Performs the CSS transformation on the tab list that will cause the list to scroll. */
|
|
1793
|
+
/**
|
|
1794
|
+
* Performs the CSS transformation on the tab list that will cause the list to scroll.
|
|
1795
|
+
* @return {?}
|
|
1796
|
+
*/
|
|
1797
|
+
MatPaginatedTabHeader.prototype._updateTabScrollPosition = /**
|
|
1798
|
+
* Performs the CSS transformation on the tab list that will cause the list to scroll.
|
|
1799
|
+
* @return {?}
|
|
1800
|
+
*/
|
|
1801
|
+
function () {
|
|
1802
|
+
/** @type {?} */
|
|
1803
|
+
var scrollDistance = this.scrollDistance;
|
|
1804
|
+
/** @type {?} */
|
|
1805
|
+
var platform$$1 = this._platform;
|
|
1806
|
+
/** @type {?} */
|
|
1807
|
+
var translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
|
|
1808
|
+
// Don't use `translate3d` here because we don't want to create a new layer. A new layer
|
|
1809
|
+
// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
|
|
1810
|
+
// and ripples will exceed the boundaries of the visible tab bar.
|
|
1811
|
+
// See: https://github.com/angular/components/issues/10276
|
|
1812
|
+
// We round the `transform` here, because transforms with sub-pixel precision cause some
|
|
1813
|
+
// browsers to blur the content of the element.
|
|
1814
|
+
this._tabList.nativeElement.style.transform = "translateX(" + Math.round(translateX) + "px)";
|
|
1815
|
+
// Setting the `transform` on IE will change the scroll offset of the parent, causing the
|
|
1816
|
+
// position to be thrown off in some cases. We have to reset it ourselves to ensure that
|
|
1817
|
+
// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
|
|
1818
|
+
// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
|
|
1819
|
+
// @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
|
|
1820
|
+
if (platform$$1 && (platform$$1.TRIDENT || platform$$1.EDGE)) {
|
|
1821
|
+
this._tabListContainer.nativeElement.scrollLeft = 0;
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
Object.defineProperty(MatPaginatedTabHeader.prototype, "scrollDistance", {
|
|
1825
|
+
/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
|
|
1826
|
+
get: /**
|
|
1827
|
+
* Sets the distance in pixels that the tab header should be transformed in the X-axis.
|
|
1828
|
+
* @return {?}
|
|
1829
|
+
*/
|
|
1830
|
+
function () { return this._scrollDistance; },
|
|
1831
|
+
set: /**
|
|
1832
|
+
* @param {?} value
|
|
1833
|
+
* @return {?}
|
|
1834
|
+
*/
|
|
1835
|
+
function (value) {
|
|
1836
|
+
this._scrollTo(value);
|
|
1837
|
+
},
|
|
1838
|
+
enumerable: true,
|
|
1839
|
+
configurable: true
|
|
1840
|
+
});
|
|
1841
|
+
/**
|
|
1842
|
+
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
|
|
1843
|
+
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1844
|
+
* length of the tab list view window.
|
|
1845
|
+
*
|
|
1846
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1847
|
+
* should be called sparingly.
|
|
1848
|
+
*/
|
|
1849
|
+
/**
|
|
1850
|
+
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
|
|
1851
|
+
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1852
|
+
* length of the tab list view window.
|
|
1853
|
+
*
|
|
1854
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1855
|
+
* should be called sparingly.
|
|
1856
|
+
* @param {?} direction
|
|
1857
|
+
* @return {?}
|
|
1858
|
+
*/
|
|
1859
|
+
MatPaginatedTabHeader.prototype._scrollHeader = /**
|
|
1860
|
+
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
|
|
1861
|
+
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1862
|
+
* length of the tab list view window.
|
|
1863
|
+
*
|
|
1864
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1865
|
+
* should be called sparingly.
|
|
1866
|
+
* @param {?} direction
|
|
1867
|
+
* @return {?}
|
|
1868
|
+
*/
|
|
1869
|
+
function (direction) {
|
|
1870
|
+
/** @type {?} */
|
|
1871
|
+
var viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1872
|
+
// Move the scroll distance one-third the length of the tab list's viewport.
|
|
1873
|
+
/** @type {?} */
|
|
1874
|
+
var scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
|
|
1875
|
+
return this._scrollTo(this._scrollDistance + scrollAmount);
|
|
1876
|
+
};
|
|
1877
|
+
/** Handles click events on the pagination arrows. */
|
|
1878
|
+
/**
|
|
1879
|
+
* Handles click events on the pagination arrows.
|
|
1880
|
+
* @param {?} direction
|
|
1881
|
+
* @return {?}
|
|
1882
|
+
*/
|
|
1883
|
+
MatPaginatedTabHeader.prototype._handlePaginatorClick = /**
|
|
1884
|
+
* Handles click events on the pagination arrows.
|
|
1885
|
+
* @param {?} direction
|
|
1886
|
+
* @return {?}
|
|
1887
|
+
*/
|
|
1888
|
+
function (direction) {
|
|
1889
|
+
this._stopInterval();
|
|
1890
|
+
this._scrollHeader(direction);
|
|
1891
|
+
};
|
|
1892
|
+
/**
|
|
1893
|
+
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1894
|
+
*
|
|
1895
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1896
|
+
* should be called sparingly.
|
|
1897
|
+
*/
|
|
1898
|
+
/**
|
|
1899
|
+
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1900
|
+
*
|
|
1901
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1902
|
+
* should be called sparingly.
|
|
1903
|
+
* @param {?} labelIndex
|
|
1904
|
+
* @return {?}
|
|
1905
|
+
*/
|
|
1906
|
+
MatPaginatedTabHeader.prototype._scrollToLabel = /**
|
|
1907
|
+
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1908
|
+
*
|
|
1909
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1910
|
+
* should be called sparingly.
|
|
1911
|
+
* @param {?} labelIndex
|
|
1912
|
+
* @return {?}
|
|
1913
|
+
*/
|
|
1914
|
+
function (labelIndex) {
|
|
1915
|
+
/** @type {?} */
|
|
1916
|
+
var selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
|
|
1917
|
+
if (!selectedLabel) {
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
// The view length is the visible width of the tab labels.
|
|
1921
|
+
/** @type {?} */
|
|
1922
|
+
var viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1923
|
+
var _a = selectedLabel.elementRef.nativeElement, offsetLeft = _a.offsetLeft, offsetWidth = _a.offsetWidth;
|
|
1924
|
+
/** @type {?} */
|
|
1925
|
+
var labelBeforePos;
|
|
1926
|
+
/** @type {?} */
|
|
1927
|
+
var labelAfterPos;
|
|
1928
|
+
if (this._getLayoutDirection() == 'ltr') {
|
|
1929
|
+
labelBeforePos = offsetLeft;
|
|
1930
|
+
labelAfterPos = labelBeforePos + offsetWidth;
|
|
1931
|
+
}
|
|
1932
|
+
else {
|
|
1933
|
+
labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
|
|
1934
|
+
labelBeforePos = labelAfterPos - offsetWidth;
|
|
1935
|
+
}
|
|
1936
|
+
/** @type {?} */
|
|
1937
|
+
var beforeVisiblePos = this.scrollDistance;
|
|
1938
|
+
/** @type {?} */
|
|
1939
|
+
var afterVisiblePos = this.scrollDistance + viewLength;
|
|
1940
|
+
if (labelBeforePos < beforeVisiblePos) {
|
|
1941
|
+
// Scroll header to move label to the before direction
|
|
1942
|
+
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
|
|
1943
|
+
}
|
|
1944
|
+
else if (labelAfterPos > afterVisiblePos) {
|
|
1945
|
+
// Scroll header to move label to the after direction
|
|
1946
|
+
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
|
|
1947
|
+
}
|
|
1931
1948
|
};
|
|
1932
1949
|
/**
|
|
1933
|
-
*
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
*
|
|
1950
|
+
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
|
|
1951
|
+
* tab list is wider than the size of the header container, then the pagination controls should
|
|
1952
|
+
* be shown.
|
|
1953
|
+
*
|
|
1954
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1955
|
+
* should be called sparingly.
|
|
1937
1956
|
*/
|
|
1938
|
-
function () {
|
|
1939
|
-
this._tabsSubscription.unsubscribe();
|
|
1940
|
-
this._tabLabelSubscription.unsubscribe();
|
|
1941
|
-
};
|
|
1942
|
-
/** Re-aligns the ink bar to the selected tab element. */
|
|
1943
1957
|
/**
|
|
1944
|
-
*
|
|
1958
|
+
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
|
|
1959
|
+
* tab list is wider than the size of the header container, then the pagination controls should
|
|
1960
|
+
* be shown.
|
|
1961
|
+
*
|
|
1962
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1963
|
+
* should be called sparingly.
|
|
1945
1964
|
* @return {?}
|
|
1946
1965
|
*/
|
|
1947
|
-
|
|
1948
|
-
*
|
|
1966
|
+
MatPaginatedTabHeader.prototype._checkPaginationEnabled = /**
|
|
1967
|
+
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
|
|
1968
|
+
* tab list is wider than the size of the header container, then the pagination controls should
|
|
1969
|
+
* be shown.
|
|
1970
|
+
*
|
|
1971
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1972
|
+
* should be called sparingly.
|
|
1949
1973
|
* @return {?}
|
|
1950
1974
|
*/
|
|
1951
1975
|
function () {
|
|
1952
|
-
|
|
1953
|
-
|
|
1976
|
+
/** @type {?} */
|
|
1977
|
+
var isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
|
|
1978
|
+
if (!isEnabled) {
|
|
1979
|
+
this.scrollDistance = 0;
|
|
1980
|
+
}
|
|
1981
|
+
if (isEnabled !== this._showPaginationControls) {
|
|
1982
|
+
this._changeDetectorRef.markForCheck();
|
|
1954
1983
|
}
|
|
1984
|
+
this._showPaginationControls = isEnabled;
|
|
1955
1985
|
};
|
|
1956
1986
|
/**
|
|
1957
|
-
*
|
|
1958
|
-
*
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
*
|
|
1962
|
-
*
|
|
1987
|
+
* Evaluate whether the before and after controls should be enabled or disabled.
|
|
1988
|
+
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
1989
|
+
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
1990
|
+
* maximum distance we can scroll), then disable the after button.
|
|
1991
|
+
*
|
|
1992
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1993
|
+
* should be called sparingly.
|
|
1963
1994
|
*/
|
|
1964
|
-
function (index) {
|
|
1965
|
-
this.focusChange.emit(this._createChangeEvent(index));
|
|
1966
|
-
};
|
|
1967
1995
|
/**
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1996
|
+
* Evaluate whether the before and after controls should be enabled or disabled.
|
|
1997
|
+
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
1998
|
+
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
1999
|
+
* maximum distance we can scroll), then disable the after button.
|
|
2000
|
+
*
|
|
2001
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
2002
|
+
* should be called sparingly.
|
|
1970
2003
|
* @return {?}
|
|
1971
2004
|
*/
|
|
1972
|
-
|
|
1973
|
-
*
|
|
1974
|
-
*
|
|
2005
|
+
MatPaginatedTabHeader.prototype._checkScrollingControls = /**
|
|
2006
|
+
* Evaluate whether the before and after controls should be enabled or disabled.
|
|
2007
|
+
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
2008
|
+
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
2009
|
+
* maximum distance we can scroll), then disable the after button.
|
|
2010
|
+
*
|
|
2011
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
2012
|
+
* should be called sparingly.
|
|
1975
2013
|
* @return {?}
|
|
1976
2014
|
*/
|
|
1977
|
-
function (
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
event.tab = this._tabs.toArray()[index];
|
|
1983
|
-
}
|
|
1984
|
-
return event;
|
|
2015
|
+
function () {
|
|
2016
|
+
// Check if the pagination arrows should be activated.
|
|
2017
|
+
this._disableScrollBefore = this.scrollDistance == 0;
|
|
2018
|
+
this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
|
|
2019
|
+
this._changeDetectorRef.markForCheck();
|
|
1985
2020
|
};
|
|
1986
2021
|
/**
|
|
1987
|
-
*
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
*
|
|
2022
|
+
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
2023
|
+
* is equal to the difference in width between the tab list container and tab header container.
|
|
2024
|
+
*
|
|
2025
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
2026
|
+
* should be called sparingly.
|
|
1991
2027
|
*/
|
|
1992
2028
|
/**
|
|
1993
|
-
*
|
|
1994
|
-
*
|
|
1995
|
-
*
|
|
1996
|
-
*
|
|
1997
|
-
*
|
|
2029
|
+
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
2030
|
+
* is equal to the difference in width between the tab list container and tab header container.
|
|
2031
|
+
*
|
|
2032
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
2033
|
+
* should be called sparingly.
|
|
1998
2034
|
* @return {?}
|
|
1999
2035
|
*/
|
|
2000
|
-
|
|
2001
|
-
*
|
|
2002
|
-
*
|
|
2003
|
-
*
|
|
2004
|
-
*
|
|
2005
|
-
*
|
|
2036
|
+
MatPaginatedTabHeader.prototype._getMaxScrollDistance = /**
|
|
2037
|
+
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
2038
|
+
* is equal to the difference in width between the tab list container and tab header container.
|
|
2039
|
+
*
|
|
2040
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
2041
|
+
* should be called sparingly.
|
|
2006
2042
|
* @return {?}
|
|
2007
2043
|
*/
|
|
2008
2044
|
function () {
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
* @param {?} tab
|
|
2015
|
-
* @return {?}
|
|
2016
|
-
*/
|
|
2017
|
-
function (tab) { return tab._stateChanges; }))).subscribe((/**
|
|
2018
|
-
* @return {?}
|
|
2019
|
-
*/
|
|
2020
|
-
function () { return _this._changeDetectorRef.markForCheck(); }));
|
|
2021
|
-
};
|
|
2022
|
-
/** Clamps the given index to the bounds of 0 and the tabs length. */
|
|
2023
|
-
/**
|
|
2024
|
-
* Clamps the given index to the bounds of 0 and the tabs length.
|
|
2025
|
-
* @private
|
|
2026
|
-
* @param {?} index
|
|
2027
|
-
* @return {?}
|
|
2028
|
-
*/
|
|
2029
|
-
MatTabGroup.prototype._clampTabIndex = /**
|
|
2030
|
-
* Clamps the given index to the bounds of 0 and the tabs length.
|
|
2031
|
-
* @private
|
|
2032
|
-
* @param {?} index
|
|
2033
|
-
* @return {?}
|
|
2034
|
-
*/
|
|
2035
|
-
function (index) {
|
|
2036
|
-
// Note the `|| 0`, which ensures that values like NaN can't get through
|
|
2037
|
-
// and which would otherwise throw the component into an infinite loop
|
|
2038
|
-
// (since Math.max(NaN, 0) === NaN).
|
|
2039
|
-
return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
|
|
2045
|
+
/** @type {?} */
|
|
2046
|
+
var lengthOfTabList = this._tabList.nativeElement.scrollWidth;
|
|
2047
|
+
/** @type {?} */
|
|
2048
|
+
var viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
2049
|
+
return (lengthOfTabList - viewLength) || 0;
|
|
2040
2050
|
};
|
|
2041
|
-
/**
|
|
2051
|
+
/** Tells the ink-bar to align itself to the current label wrapper */
|
|
2042
2052
|
/**
|
|
2043
|
-
*
|
|
2044
|
-
* @param {?} i
|
|
2053
|
+
* Tells the ink-bar to align itself to the current label wrapper
|
|
2045
2054
|
* @return {?}
|
|
2046
2055
|
*/
|
|
2047
|
-
|
|
2048
|
-
*
|
|
2049
|
-
* @param {?} i
|
|
2056
|
+
MatPaginatedTabHeader.prototype._alignInkBarToSelectedTab = /**
|
|
2057
|
+
* Tells the ink-bar to align itself to the current label wrapper
|
|
2050
2058
|
* @return {?}
|
|
2051
2059
|
*/
|
|
2052
|
-
function (
|
|
2053
|
-
|
|
2060
|
+
function () {
|
|
2061
|
+
/** @type {?} */
|
|
2062
|
+
var selectedItem = this._items && this._items.length ?
|
|
2063
|
+
this._items.toArray()[this.selectedIndex] : null;
|
|
2064
|
+
/** @type {?} */
|
|
2065
|
+
var selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
|
|
2066
|
+
if (selectedLabelWrapper) {
|
|
2067
|
+
this._inkBar.alignToElement(selectedLabelWrapper);
|
|
2068
|
+
}
|
|
2069
|
+
else {
|
|
2070
|
+
this._inkBar.hide();
|
|
2071
|
+
}
|
|
2054
2072
|
};
|
|
2055
|
-
/**
|
|
2073
|
+
/** Stops the currently-running paginator interval. */
|
|
2056
2074
|
/**
|
|
2057
|
-
*
|
|
2058
|
-
* @param {?} i
|
|
2075
|
+
* Stops the currently-running paginator interval.
|
|
2059
2076
|
* @return {?}
|
|
2060
2077
|
*/
|
|
2061
|
-
|
|
2062
|
-
*
|
|
2063
|
-
* @param {?} i
|
|
2078
|
+
MatPaginatedTabHeader.prototype._stopInterval = /**
|
|
2079
|
+
* Stops the currently-running paginator interval.
|
|
2064
2080
|
* @return {?}
|
|
2065
2081
|
*/
|
|
2066
|
-
function (
|
|
2067
|
-
|
|
2082
|
+
function () {
|
|
2083
|
+
this._stopScrolling.next();
|
|
2068
2084
|
};
|
|
2069
2085
|
/**
|
|
2070
|
-
*
|
|
2071
|
-
*
|
|
2086
|
+
* Handles the user pressing down on one of the paginators.
|
|
2087
|
+
* Starts scrolling the header after a certain amount of time.
|
|
2088
|
+
* @param direction In which direction the paginator should be scrolled.
|
|
2072
2089
|
*/
|
|
2073
2090
|
/**
|
|
2074
|
-
*
|
|
2075
|
-
*
|
|
2076
|
-
* @param {?}
|
|
2091
|
+
* Handles the user pressing down on one of the paginators.
|
|
2092
|
+
* Starts scrolling the header after a certain amount of time.
|
|
2093
|
+
* @param {?} direction In which direction the paginator should be scrolled.
|
|
2077
2094
|
* @return {?}
|
|
2078
2095
|
*/
|
|
2079
|
-
|
|
2080
|
-
*
|
|
2081
|
-
*
|
|
2082
|
-
* @param {?}
|
|
2096
|
+
MatPaginatedTabHeader.prototype._handlePaginatorPress = /**
|
|
2097
|
+
* Handles the user pressing down on one of the paginators.
|
|
2098
|
+
* Starts scrolling the header after a certain amount of time.
|
|
2099
|
+
* @param {?} direction In which direction the paginator should be scrolled.
|
|
2083
2100
|
* @return {?}
|
|
2084
2101
|
*/
|
|
2085
|
-
function (
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2102
|
+
function (direction) {
|
|
2103
|
+
var _this = this;
|
|
2104
|
+
// Avoid overlapping timers.
|
|
2105
|
+
this._stopInterval();
|
|
2106
|
+
// Start a timer after the delay and keep firing based on the interval.
|
|
2107
|
+
rxjs.timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
|
|
2108
|
+
// Keep the timer going until something tells it to stop or the component is destroyed.
|
|
2109
|
+
.pipe(operators.takeUntil(rxjs.merge(this._stopScrolling, this._destroyed)))
|
|
2110
|
+
.subscribe((/**
|
|
2111
|
+
* @return {?}
|
|
2112
|
+
*/
|
|
2113
|
+
function () {
|
|
2114
|
+
var _a = _this._scrollHeader(direction), maxScrollDistance = _a.maxScrollDistance, distance = _a.distance;
|
|
2115
|
+
// Stop the timer if we've reached the start or the end.
|
|
2116
|
+
if (distance === 0 || distance >= maxScrollDistance) {
|
|
2117
|
+
_this._stopInterval();
|
|
2118
|
+
}
|
|
2119
|
+
}));
|
|
2097
2120
|
};
|
|
2098
|
-
/** Removes the height of the tab body wrapper. */
|
|
2099
2121
|
/**
|
|
2100
|
-
*
|
|
2101
|
-
* @
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
* Removes the height of the tab body wrapper.
|
|
2105
|
-
* @return {?}
|
|
2106
|
-
*/
|
|
2107
|
-
function () {
|
|
2108
|
-
/** @type {?} */
|
|
2109
|
-
var wrapper = this._tabBodyWrapper.nativeElement;
|
|
2110
|
-
this._tabBodyWrapperHeight = wrapper.clientHeight;
|
|
2111
|
-
wrapper.style.height = '';
|
|
2112
|
-
this.animationDone.emit();
|
|
2113
|
-
};
|
|
2114
|
-
/** Handle click events, setting new selected index if appropriate. */
|
|
2122
|
+
* Scrolls the header to a given position.
|
|
2123
|
+
* @param position Position to which to scroll.
|
|
2124
|
+
* @returns Information on the current scroll distance and the maximum.
|
|
2125
|
+
*/
|
|
2115
2126
|
/**
|
|
2116
|
-
*
|
|
2117
|
-
* @
|
|
2118
|
-
* @param {?}
|
|
2119
|
-
* @
|
|
2120
|
-
* @return {?}
|
|
2127
|
+
* Scrolls the header to a given position.
|
|
2128
|
+
* @private
|
|
2129
|
+
* @param {?} position Position to which to scroll.
|
|
2130
|
+
* @return {?} Information on the current scroll distance and the maximum.
|
|
2121
2131
|
*/
|
|
2122
|
-
|
|
2123
|
-
*
|
|
2124
|
-
* @
|
|
2125
|
-
* @param {?}
|
|
2126
|
-
* @
|
|
2127
|
-
* @return {?}
|
|
2132
|
+
MatPaginatedTabHeader.prototype._scrollTo = /**
|
|
2133
|
+
* Scrolls the header to a given position.
|
|
2134
|
+
* @private
|
|
2135
|
+
* @param {?} position Position to which to scroll.
|
|
2136
|
+
* @return {?} Information on the current scroll distance and the maximum.
|
|
2128
2137
|
*/
|
|
2129
|
-
function (
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2138
|
+
function (position) {
|
|
2139
|
+
/** @type {?} */
|
|
2140
|
+
var maxScrollDistance = this._getMaxScrollDistance();
|
|
2141
|
+
this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
|
|
2142
|
+
// Mark that the scroll distance has changed so that after the view is checked, the CSS
|
|
2143
|
+
// transformation can move the header.
|
|
2144
|
+
this._scrollDistanceChanged = true;
|
|
2145
|
+
this._checkScrollingControls();
|
|
2146
|
+
return { maxScrollDistance: maxScrollDistance, distance: this._scrollDistance };
|
|
2133
2147
|
};
|
|
2134
|
-
|
|
2148
|
+
MatPaginatedTabHeader.decorators = [
|
|
2149
|
+
{ type: core.Directive, args: [{
|
|
2150
|
+
// TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
|
|
2151
|
+
selector: 'do-not-use-abstract-mat-paginated-tab-header'
|
|
2152
|
+
},] },
|
|
2153
|
+
];
|
|
2154
|
+
/** @nocollapse */
|
|
2155
|
+
MatPaginatedTabHeader.ctorParameters = function () { return [
|
|
2156
|
+
{ type: core.ElementRef },
|
|
2157
|
+
{ type: core.ChangeDetectorRef },
|
|
2158
|
+
{ type: scrolling.ViewportRuler },
|
|
2159
|
+
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
2160
|
+
{ type: core.NgZone },
|
|
2161
|
+
{ type: platform.Platform },
|
|
2162
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
2163
|
+
]; };
|
|
2164
|
+
return MatPaginatedTabHeader;
|
|
2165
|
+
}());
|
|
2166
|
+
|
|
2167
|
+
/**
|
|
2168
|
+
* @fileoverview added by tsickle
|
|
2169
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2170
|
+
*/
|
|
2171
|
+
/**
|
|
2172
|
+
* Base class with all of the `MatTabHeader` functionality.
|
|
2173
|
+
* \@docs-private
|
|
2174
|
+
* @abstract
|
|
2175
|
+
*/
|
|
2176
|
+
var _MatTabHeaderBase = /** @class */ (function (_super) {
|
|
2177
|
+
__extends(_MatTabHeaderBase, _super);
|
|
2178
|
+
function _MatTabHeaderBase(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform$$1,
|
|
2179
|
+
// @breaking-change 9.0.0 `_animationMode` parameter to be made required.
|
|
2180
|
+
animationMode) {
|
|
2181
|
+
var _this = _super.call(this, elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform$$1, animationMode) || this;
|
|
2182
|
+
_this._disableRipple = false;
|
|
2183
|
+
return _this;
|
|
2184
|
+
}
|
|
2185
|
+
Object.defineProperty(_MatTabHeaderBase.prototype, "disableRipple", {
|
|
2186
|
+
/** Whether the ripple effect is disabled or not. */
|
|
2187
|
+
get: /**
|
|
2188
|
+
* Whether the ripple effect is disabled or not.
|
|
2189
|
+
* @return {?}
|
|
2190
|
+
*/
|
|
2191
|
+
function () { return this._disableRipple; },
|
|
2192
|
+
set: /**
|
|
2193
|
+
* @param {?} value
|
|
2194
|
+
* @return {?}
|
|
2195
|
+
*/
|
|
2196
|
+
function (value) { this._disableRipple = coercion.coerceBooleanProperty(value); },
|
|
2197
|
+
enumerable: true,
|
|
2198
|
+
configurable: true
|
|
2199
|
+
});
|
|
2135
2200
|
/**
|
|
2136
|
-
*
|
|
2137
|
-
* @param {?}
|
|
2138
|
-
* @param {?} idx
|
|
2201
|
+
* @protected
|
|
2202
|
+
* @param {?} event
|
|
2139
2203
|
* @return {?}
|
|
2140
2204
|
*/
|
|
2141
|
-
|
|
2142
|
-
*
|
|
2143
|
-
* @param {?}
|
|
2144
|
-
* @param {?} idx
|
|
2205
|
+
_MatTabHeaderBase.prototype._itemSelected = /**
|
|
2206
|
+
* @protected
|
|
2207
|
+
* @param {?} event
|
|
2145
2208
|
* @return {?}
|
|
2146
2209
|
*/
|
|
2147
|
-
function (
|
|
2148
|
-
|
|
2149
|
-
return null;
|
|
2150
|
-
}
|
|
2151
|
-
return this.selectedIndex === idx ? 0 : -1;
|
|
2210
|
+
function (event) {
|
|
2211
|
+
event.preventDefault();
|
|
2152
2212
|
};
|
|
2153
|
-
|
|
2154
|
-
{ type: core.
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2213
|
+
_MatTabHeaderBase.decorators = [
|
|
2214
|
+
{ type: core.Directive, args: [{
|
|
2215
|
+
// TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
|
|
2216
|
+
selector: 'do-not-use-abstract-mat-tab-header-base'
|
|
2217
|
+
},] },
|
|
2218
|
+
];
|
|
2219
|
+
/** @nocollapse */
|
|
2220
|
+
_MatTabHeaderBase.ctorParameters = function () { return [
|
|
2221
|
+
{ type: core.ElementRef },
|
|
2222
|
+
{ type: core.ChangeDetectorRef },
|
|
2223
|
+
{ type: scrolling.ViewportRuler },
|
|
2224
|
+
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
2225
|
+
{ type: core.NgZone },
|
|
2226
|
+
{ type: platform.Platform },
|
|
2227
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
2228
|
+
]; };
|
|
2229
|
+
_MatTabHeaderBase.propDecorators = {
|
|
2230
|
+
disableRipple: [{ type: core.Input }]
|
|
2231
|
+
};
|
|
2232
|
+
return _MatTabHeaderBase;
|
|
2233
|
+
}(MatPaginatedTabHeader));
|
|
2234
|
+
/**
|
|
2235
|
+
* The header of the tab group which displays a list of all the tabs in the tab group. Includes
|
|
2236
|
+
* an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
|
|
2237
|
+
* width of the header container, then arrows will be displayed to allow the user to scroll
|
|
2238
|
+
* left and right across the header.
|
|
2239
|
+
* \@docs-private
|
|
2240
|
+
*/
|
|
2241
|
+
var MatTabHeader = /** @class */ (function (_super) {
|
|
2242
|
+
__extends(MatTabHeader, _super);
|
|
2243
|
+
function MatTabHeader(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform$$1,
|
|
2244
|
+
// @breaking-change 9.0.0 `_animationMode` parameter to be made required.
|
|
2245
|
+
animationMode) {
|
|
2246
|
+
return _super.call(this, elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform$$1, animationMode) || this;
|
|
2247
|
+
}
|
|
2248
|
+
MatTabHeader.decorators = [
|
|
2249
|
+
{ type: core.Component, args: [{selector: 'mat-tab-header',
|
|
2250
|
+
template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\" #previousPaginator aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\" (click)=\"_handlePaginatorClick('before')\" (mousedown)=\"_handlePaginatorPress('before')\" (touchend)=\"_stopInterval()\"><div class=\"mat-tab-header-pagination-chevron\"></div></div><div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\"><div #tabList class=\"mat-tab-list\" [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\" role=\"tablist\" (cdkObserveContent)=\"_onContentChanges()\"><div class=\"mat-tab-labels\"><ng-content></ng-content></div><mat-ink-bar></mat-ink-bar></div></div><div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\" #nextPaginator aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\" (mousedown)=\"_handlePaginatorPress('after')\" (click)=\"_handlePaginatorClick('after')\" (touchend)=\"_stopInterval()\"><div class=\"mat-tab-header-pagination-chevron\"></div></div>",
|
|
2251
|
+
styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-pagination-after,.mat-tab-header-rtl .mat-tab-header-pagination-before{padding-right:4px}.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:'';height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform .5s cubic-bezier(.35,0,.25,1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,0,.25,1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}@media (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}.mat-tab-labels{display:flex}[mat-align-tabs=center] .mat-tab-labels{justify-content:center}[mat-align-tabs=end] .mat-tab-labels{justify-content:flex-end}.mat-tab-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}._mat-animation-noopable.mat-tab-list{transition:none;animation:none}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-high-contrast:active){.mat-tab-label.mat-tab-disabled{opacity:.5}}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (-ms-high-contrast:active){.mat-tab-label{opacity:1}}@media (max-width:599px){.mat-tab-label{min-width:72px}}"],
|
|
2252
|
+
inputs: ['selectedIndex'],
|
|
2253
|
+
outputs: ['selectFocusedIndex', 'indexFocused'],
|
|
2158
2254
|
encapsulation: core.ViewEncapsulation.None,
|
|
2159
2255
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2160
|
-
inputs: ['color', 'disableRipple'],
|
|
2161
2256
|
host: {
|
|
2162
|
-
'class': 'mat-tab-
|
|
2163
|
-
'[class.mat-tab-
|
|
2164
|
-
'[class.mat-tab-
|
|
2257
|
+
'class': 'mat-tab-header',
|
|
2258
|
+
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
|
|
2259
|
+
'[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
|
|
2165
2260
|
},
|
|
2166
2261
|
},] },
|
|
2167
2262
|
];
|
|
2168
2263
|
/** @nocollapse */
|
|
2169
|
-
|
|
2264
|
+
MatTabHeader.ctorParameters = function () { return [
|
|
2170
2265
|
{ type: core.ElementRef },
|
|
2171
2266
|
{ type: core.ChangeDetectorRef },
|
|
2172
|
-
{ type:
|
|
2267
|
+
{ type: scrolling.ViewportRuler },
|
|
2268
|
+
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
2269
|
+
{ type: core.NgZone },
|
|
2270
|
+
{ type: platform.Platform },
|
|
2173
2271
|
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
2174
2272
|
]; };
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
animationDuration: [{ type: core.Input }],
|
|
2183
|
-
backgroundColor: [{ type: core.Input }],
|
|
2184
|
-
selectedIndexChange: [{ type: core.Output }],
|
|
2185
|
-
focusChange: [{ type: core.Output }],
|
|
2186
|
-
animationDone: [{ type: core.Output }],
|
|
2187
|
-
selectedTabChange: [{ type: core.Output }]
|
|
2273
|
+
MatTabHeader.propDecorators = {
|
|
2274
|
+
_items: [{ type: core.ContentChildren, args: [MatTabLabelWrapper,] }],
|
|
2275
|
+
_inkBar: [{ type: core.ViewChild, args: [MatInkBar, { static: true },] }],
|
|
2276
|
+
_tabListContainer: [{ type: core.ViewChild, args: ['tabListContainer', { static: true },] }],
|
|
2277
|
+
_tabList: [{ type: core.ViewChild, args: ['tabList', { static: true },] }],
|
|
2278
|
+
_nextPaginator: [{ type: core.ViewChild, args: ['nextPaginator', { static: false },] }],
|
|
2279
|
+
_previousPaginator: [{ type: core.ViewChild, args: ['previousPaginator', { static: false },] }]
|
|
2188
2280
|
};
|
|
2189
|
-
return
|
|
2190
|
-
}(
|
|
2281
|
+
return MatTabHeader;
|
|
2282
|
+
}(_MatTabHeaderBase));
|
|
2191
2283
|
|
|
2192
2284
|
/**
|
|
2193
2285
|
* @fileoverview added by tsickle
|
|
2194
2286
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2195
2287
|
*/
|
|
2196
2288
|
/**
|
|
2197
|
-
*
|
|
2198
|
-
*
|
|
2289
|
+
* Base class with all of the `MatTabNav` functionality.
|
|
2290
|
+
* \@docs-private
|
|
2291
|
+
* @abstract
|
|
2199
2292
|
*/
|
|
2200
|
-
var
|
|
2201
|
-
__extends(
|
|
2202
|
-
function
|
|
2293
|
+
var _MatTabNavBase = /** @class */ (function (_super) {
|
|
2294
|
+
__extends(_MatTabNavBase, _super);
|
|
2295
|
+
function _MatTabNavBase(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
|
|
2203
2296
|
/**
|
|
2204
2297
|
* @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
|
|
2205
2298
|
*/
|
|
@@ -2212,7 +2305,7 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2212
2305
|
_this.color = 'primary';
|
|
2213
2306
|
return _this;
|
|
2214
2307
|
}
|
|
2215
|
-
Object.defineProperty(
|
|
2308
|
+
Object.defineProperty(_MatTabNavBase.prototype, "backgroundColor", {
|
|
2216
2309
|
/** Background color of the tab nav. */
|
|
2217
2310
|
get: /**
|
|
2218
2311
|
* Background color of the tab nav.
|
|
@@ -2235,7 +2328,7 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2235
2328
|
enumerable: true,
|
|
2236
2329
|
configurable: true
|
|
2237
2330
|
});
|
|
2238
|
-
Object.defineProperty(
|
|
2331
|
+
Object.defineProperty(_MatTabNavBase.prototype, "disableRipple", {
|
|
2239
2332
|
/** Whether the ripple effect is disabled or not. */
|
|
2240
2333
|
get: /**
|
|
2241
2334
|
* Whether the ripple effect is disabled or not.
|
|
@@ -2254,7 +2347,7 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2254
2347
|
* @protected
|
|
2255
2348
|
* @return {?}
|
|
2256
2349
|
*/
|
|
2257
|
-
|
|
2350
|
+
_MatTabNavBase.prototype._itemSelected = /**
|
|
2258
2351
|
* @protected
|
|
2259
2352
|
* @return {?}
|
|
2260
2353
|
*/
|
|
@@ -2264,11 +2357,19 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2264
2357
|
/**
|
|
2265
2358
|
* @return {?}
|
|
2266
2359
|
*/
|
|
2267
|
-
|
|
2360
|
+
_MatTabNavBase.prototype.ngAfterContentInit = /**
|
|
2268
2361
|
* @return {?}
|
|
2269
2362
|
*/
|
|
2270
2363
|
function () {
|
|
2271
|
-
this
|
|
2364
|
+
var _this = this;
|
|
2365
|
+
// We need this to run before the `changes` subscription in parent to ensure that the
|
|
2366
|
+
// selectedIndex is up-to-date by the time the super class starts looking for it.
|
|
2367
|
+
this._items.changes.pipe(operators.startWith(null), operators.takeUntil(this._destroyed)).subscribe((/**
|
|
2368
|
+
* @return {?}
|
|
2369
|
+
*/
|
|
2370
|
+
function () {
|
|
2371
|
+
_this.updateActiveLink();
|
|
2372
|
+
}));
|
|
2272
2373
|
_super.prototype.ngAfterContentInit.call(this);
|
|
2273
2374
|
};
|
|
2274
2375
|
/**
|
|
@@ -2281,7 +2382,7 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2281
2382
|
* @param {?=} _element
|
|
2282
2383
|
* @return {?}
|
|
2283
2384
|
*/
|
|
2284
|
-
|
|
2385
|
+
_MatTabNavBase.prototype.updateActiveLink = /**
|
|
2285
2386
|
* Notifies the component that the active link has been changed.
|
|
2286
2387
|
* \@breaking-change 8.0.0 `element` parameter to be removed.
|
|
2287
2388
|
* @param {?=} _element
|
|
@@ -2304,6 +2405,42 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2304
2405
|
this.selectedIndex = -1;
|
|
2305
2406
|
this._inkBar.hide();
|
|
2306
2407
|
};
|
|
2408
|
+
_MatTabNavBase.decorators = [
|
|
2409
|
+
{ type: core.Directive, args: [{
|
|
2410
|
+
// TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
|
|
2411
|
+
selector: 'do-not-use-abstract-mat-tab-nav-base'
|
|
2412
|
+
},] },
|
|
2413
|
+
];
|
|
2414
|
+
/** @nocollapse */
|
|
2415
|
+
_MatTabNavBase.ctorParameters = function () { return [
|
|
2416
|
+
{ type: core.ElementRef },
|
|
2417
|
+
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
2418
|
+
{ type: core.NgZone },
|
|
2419
|
+
{ type: core.ChangeDetectorRef },
|
|
2420
|
+
{ type: scrolling.ViewportRuler },
|
|
2421
|
+
{ type: platform.Platform, decorators: [{ type: core.Optional }] },
|
|
2422
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
2423
|
+
]; };
|
|
2424
|
+
_MatTabNavBase.propDecorators = {
|
|
2425
|
+
backgroundColor: [{ type: core.Input }],
|
|
2426
|
+
disableRipple: [{ type: core.Input }],
|
|
2427
|
+
color: [{ type: core.Input }]
|
|
2428
|
+
};
|
|
2429
|
+
return _MatTabNavBase;
|
|
2430
|
+
}(MatPaginatedTabHeader));
|
|
2431
|
+
/**
|
|
2432
|
+
* Navigation component matching the styles of the tab group header.
|
|
2433
|
+
* Provides anchored navigation with animated ink bar.
|
|
2434
|
+
*/
|
|
2435
|
+
var MatTabNav = /** @class */ (function (_super) {
|
|
2436
|
+
__extends(MatTabNav, _super);
|
|
2437
|
+
function MatTabNav(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
|
|
2438
|
+
/**
|
|
2439
|
+
* @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
|
|
2440
|
+
*/
|
|
2441
|
+
platform$$1, animationMode) {
|
|
2442
|
+
return _super.call(this, elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform$$1, animationMode) || this;
|
|
2443
|
+
}
|
|
2307
2444
|
MatTabNav.decorators = [
|
|
2308
2445
|
{ type: core.Component, args: [{selector: '[mat-tab-nav-bar]',
|
|
2309
2446
|
exportAs: 'matTabNavBar, matTabNav',
|
|
@@ -2341,29 +2478,26 @@ var MatTabNav = /** @class */ (function (_super) {
|
|
|
2341
2478
|
_tabListContainer: [{ type: core.ViewChild, args: ['tabListContainer', { static: true },] }],
|
|
2342
2479
|
_tabList: [{ type: core.ViewChild, args: ['tabList', { static: true },] }],
|
|
2343
2480
|
_nextPaginator: [{ type: core.ViewChild, args: ['nextPaginator', { static: false },] }],
|
|
2344
|
-
_previousPaginator: [{ type: core.ViewChild, args: ['previousPaginator', { static: false },] }]
|
|
2345
|
-
backgroundColor: [{ type: core.Input }],
|
|
2346
|
-
disableRipple: [{ type: core.Input }],
|
|
2347
|
-
color: [{ type: core.Input }]
|
|
2481
|
+
_previousPaginator: [{ type: core.ViewChild, args: ['previousPaginator', { static: false },] }]
|
|
2348
2482
|
};
|
|
2349
2483
|
return MatTabNav;
|
|
2350
|
-
}(
|
|
2484
|
+
}(_MatTabNavBase));
|
|
2351
2485
|
// Boilerplate for applying mixins to MatTabLink.
|
|
2352
2486
|
var
|
|
2353
2487
|
// Boilerplate for applying mixins to MatTabLink.
|
|
2354
|
-
|
|
2355
|
-
function
|
|
2488
|
+
MatTabLinkMixinBase = /** @class */ (function () {
|
|
2489
|
+
function MatTabLinkMixinBase() {
|
|
2356
2490
|
}
|
|
2357
|
-
return
|
|
2491
|
+
return MatTabLinkMixinBase;
|
|
2358
2492
|
}());
|
|
2359
2493
|
/** @type {?} */
|
|
2360
|
-
var _MatTabLinkMixinBase = core$1.mixinTabIndex(core$1.mixinDisableRipple(core$1.mixinDisabled(
|
|
2494
|
+
var _MatTabLinkMixinBase = core$1.mixinTabIndex(core$1.mixinDisableRipple(core$1.mixinDisabled(MatTabLinkMixinBase)));
|
|
2361
2495
|
/**
|
|
2362
|
-
*
|
|
2496
|
+
* Base class with all of the `MatTabLink` functionality.
|
|
2363
2497
|
*/
|
|
2364
|
-
var
|
|
2365
|
-
__extends(
|
|
2366
|
-
function
|
|
2498
|
+
var _MatTabLinkBase = /** @class */ (function (_super) {
|
|
2499
|
+
__extends(_MatTabLinkBase, _super);
|
|
2500
|
+
function _MatTabLinkBase(_tabNavBar, elementRef, globalRippleOptions, tabIndex, _focusMonitor, animationMode) {
|
|
2367
2501
|
var _this = _super.call(this) || this;
|
|
2368
2502
|
_this._tabNavBar = _tabNavBar;
|
|
2369
2503
|
_this.elementRef = elementRef;
|
|
@@ -2372,8 +2506,6 @@ var MatTabLink = /** @class */ (function (_super) {
|
|
|
2372
2506
|
* Whether the tab link is active or not.
|
|
2373
2507
|
*/
|
|
2374
2508
|
_this._isActive = false;
|
|
2375
|
-
_this._tabLinkRipple = new core$1.RippleRenderer(_this, ngZone, elementRef, platform$$1);
|
|
2376
|
-
_this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
|
|
2377
2509
|
_this.rippleConfig = globalRippleOptions || {};
|
|
2378
2510
|
_this.tabIndex = parseInt(tabIndex) || 0;
|
|
2379
2511
|
if (animationMode === 'NoopAnimations') {
|
|
@@ -2382,7 +2514,7 @@ var MatTabLink = /** @class */ (function (_super) {
|
|
|
2382
2514
|
_focusMonitor.monitor(elementRef);
|
|
2383
2515
|
return _this;
|
|
2384
2516
|
}
|
|
2385
|
-
Object.defineProperty(
|
|
2517
|
+
Object.defineProperty(_MatTabLinkBase.prototype, "active", {
|
|
2386
2518
|
/** Whether the link is active. */
|
|
2387
2519
|
get: /**
|
|
2388
2520
|
* Whether the link is active.
|
|
@@ -2402,7 +2534,7 @@ var MatTabLink = /** @class */ (function (_super) {
|
|
|
2402
2534
|
enumerable: true,
|
|
2403
2535
|
configurable: true
|
|
2404
2536
|
});
|
|
2405
|
-
Object.defineProperty(
|
|
2537
|
+
Object.defineProperty(_MatTabLinkBase.prototype, "rippleDisabled", {
|
|
2406
2538
|
/**
|
|
2407
2539
|
* Whether ripples are disabled on interaction.
|
|
2408
2540
|
* @docs-private
|
|
@@ -2422,12 +2554,52 @@ var MatTabLink = /** @class */ (function (_super) {
|
|
|
2422
2554
|
/**
|
|
2423
2555
|
* @return {?}
|
|
2424
2556
|
*/
|
|
2425
|
-
|
|
2557
|
+
_MatTabLinkBase.prototype.focus = /**
|
|
2426
2558
|
* @return {?}
|
|
2427
2559
|
*/
|
|
2428
2560
|
function () {
|
|
2429
2561
|
this.elementRef.nativeElement.focus();
|
|
2430
2562
|
};
|
|
2563
|
+
/**
|
|
2564
|
+
* @return {?}
|
|
2565
|
+
*/
|
|
2566
|
+
_MatTabLinkBase.prototype.ngOnDestroy = /**
|
|
2567
|
+
* @return {?}
|
|
2568
|
+
*/
|
|
2569
|
+
function () {
|
|
2570
|
+
this._focusMonitor.stopMonitoring(this.elementRef);
|
|
2571
|
+
};
|
|
2572
|
+
_MatTabLinkBase.decorators = [
|
|
2573
|
+
{ type: core.Directive, args: [{
|
|
2574
|
+
// TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
|
|
2575
|
+
selector: 'do-not-use-abstract-mat-tab-link-base'
|
|
2576
|
+
},] },
|
|
2577
|
+
];
|
|
2578
|
+
/** @nocollapse */
|
|
2579
|
+
_MatTabLinkBase.ctorParameters = function () { return [
|
|
2580
|
+
{ type: _MatTabNavBase },
|
|
2581
|
+
{ type: core.ElementRef },
|
|
2582
|
+
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [core$1.MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
|
|
2583
|
+
{ type: String, decorators: [{ type: core.Attribute, args: ['tabindex',] }] },
|
|
2584
|
+
{ type: a11y.FocusMonitor },
|
|
2585
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
2586
|
+
]; };
|
|
2587
|
+
_MatTabLinkBase.propDecorators = {
|
|
2588
|
+
active: [{ type: core.Input }]
|
|
2589
|
+
};
|
|
2590
|
+
return _MatTabLinkBase;
|
|
2591
|
+
}(_MatTabLinkMixinBase));
|
|
2592
|
+
/**
|
|
2593
|
+
* Link inside of a `mat-tab-nav-bar`.
|
|
2594
|
+
*/
|
|
2595
|
+
var MatTabLink = /** @class */ (function (_super) {
|
|
2596
|
+
__extends(MatTabLink, _super);
|
|
2597
|
+
function MatTabLink(tabNavBar, elementRef, ngZone, platform$$1, globalRippleOptions, tabIndex, focusMonitor, animationMode) {
|
|
2598
|
+
var _this = _super.call(this, tabNavBar, elementRef, globalRippleOptions, tabIndex, focusMonitor, animationMode) || this;
|
|
2599
|
+
_this._tabLinkRipple = new core$1.RippleRenderer(_this, ngZone, elementRef, platform$$1);
|
|
2600
|
+
_this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
|
|
2601
|
+
return _this;
|
|
2602
|
+
}
|
|
2431
2603
|
/**
|
|
2432
2604
|
* @return {?}
|
|
2433
2605
|
*/
|
|
@@ -2435,8 +2607,8 @@ var MatTabLink = /** @class */ (function (_super) {
|
|
|
2435
2607
|
* @return {?}
|
|
2436
2608
|
*/
|
|
2437
2609
|
function () {
|
|
2610
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
2438
2611
|
this._tabLinkRipple._removeTriggerEvents();
|
|
2439
|
-
this._focusMonitor.stopMonitoring(this.elementRef);
|
|
2440
2612
|
};
|
|
2441
2613
|
MatTabLink.decorators = [
|
|
2442
2614
|
{ type: core.Directive, args: [{
|
|
@@ -2464,11 +2636,8 @@ var MatTabLink = /** @class */ (function (_super) {
|
|
|
2464
2636
|
{ type: a11y.FocusMonitor },
|
|
2465
2637
|
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] }
|
|
2466
2638
|
]; };
|
|
2467
|
-
MatTabLink.propDecorators = {
|
|
2468
|
-
active: [{ type: core.Input }]
|
|
2469
|
-
};
|
|
2470
2639
|
return MatTabLink;
|
|
2471
|
-
}(
|
|
2640
|
+
}(_MatTabLinkBase));
|
|
2472
2641
|
|
|
2473
2642
|
/**
|
|
2474
2643
|
* @fileoverview added by tsickle
|
|
@@ -2509,30 +2678,43 @@ var MatTabsModule = /** @class */ (function () {
|
|
|
2509
2678
|
MatTabBodyPortal,
|
|
2510
2679
|
MatTabHeader,
|
|
2511
2680
|
MatTabContent,
|
|
2681
|
+
(/** @type {?} */ (
|
|
2682
|
+
// TODO(crisbeto): these can be removed once they're turned into selector-less directives.
|
|
2683
|
+
MatPaginatedTabHeader)),
|
|
2684
|
+
(/** @type {?} */ (_MatTabGroupBase)),
|
|
2685
|
+
(/** @type {?} */ (_MatTabNavBase)),
|
|
2686
|
+
(/** @type {?} */ (_MatTabBodyBase)),
|
|
2687
|
+
(/** @type {?} */ (_MatTabHeaderBase)),
|
|
2688
|
+
(/** @type {?} */ (_MatTabLinkBase)),
|
|
2512
2689
|
],
|
|
2513
2690
|
},] },
|
|
2514
2691
|
];
|
|
2515
2692
|
return MatTabsModule;
|
|
2516
2693
|
}());
|
|
2517
2694
|
|
|
2695
|
+
exports.MatTabsModule = MatTabsModule;
|
|
2518
2696
|
exports.MatInkBar = MatInkBar;
|
|
2519
2697
|
exports._MAT_INK_BAR_POSITIONER = _MAT_INK_BAR_POSITIONER;
|
|
2520
2698
|
exports.MatTabBody = MatTabBody;
|
|
2699
|
+
exports._MatTabBodyBase = _MatTabBodyBase;
|
|
2521
2700
|
exports.MatTabBodyPortal = MatTabBodyPortal;
|
|
2522
2701
|
exports.MatTabHeader = MatTabHeader;
|
|
2702
|
+
exports._MatTabHeaderBase = _MatTabHeaderBase;
|
|
2523
2703
|
exports.MatTabLabelWrapper = MatTabLabelWrapper;
|
|
2524
2704
|
exports.MatTab = MatTab;
|
|
2525
2705
|
exports.MatTabLabel = MatTabLabel;
|
|
2526
2706
|
exports.MatTabNav = MatTabNav;
|
|
2527
2707
|
exports.MatTabLink = MatTabLink;
|
|
2708
|
+
exports._MatTabNavBase = _MatTabNavBase;
|
|
2709
|
+
exports._MatTabLinkBase = _MatTabLinkBase;
|
|
2528
2710
|
exports.MatTabContent = MatTabContent;
|
|
2529
|
-
exports.MatTabsModule = MatTabsModule;
|
|
2530
2711
|
exports.MatTabChangeEvent = MatTabChangeEvent;
|
|
2531
2712
|
exports.MAT_TABS_CONFIG = MAT_TABS_CONFIG;
|
|
2713
|
+
exports._MatTabGroupBase = _MatTabGroupBase;
|
|
2532
2714
|
exports.MatTabGroup = MatTabGroup;
|
|
2533
2715
|
exports.matTabsAnimations = matTabsAnimations;
|
|
2534
|
-
exports.ɵ
|
|
2535
|
-
exports.ɵ
|
|
2716
|
+
exports.ɵa24 = _MAT_INK_BAR_POSITIONER_FACTORY;
|
|
2717
|
+
exports.ɵb24 = MatPaginatedTabHeader;
|
|
2536
2718
|
|
|
2537
2719
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2538
2720
|
|