@angular/material 10.0.0-rc.3 → 10.1.0
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 +17 -17
- package/autocomplete/index.metadata.json +1 -1
- package/autocomplete/testing/autocomplete-harness.d.ts +2 -0
- package/bundles/material-autocomplete-testing.umd.js +11 -0
- package/bundles/material-autocomplete-testing.umd.js.map +1 -1
- package/bundles/material-autocomplete-testing.umd.min.js +2 -2
- package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
- package/bundles/material-autocomplete.umd.js +3 -1
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +5 -5
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-badge-testing.umd.min.js +1 -1
- package/bundles/material-badge-testing.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
- package/bundles/material-button-testing.umd.js +11 -0
- package/bundles/material-button-testing.umd.js.map +1 -1
- package/bundles/material-button-testing.umd.min.js +2 -2
- package/bundles/material-button-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.js +11 -0
- package/bundles/material-button-toggle-testing.umd.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.min.js +3 -3
- package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle.umd.js +12 -3
- package/bundles/material-button-toggle.umd.js.map +1 -1
- package/bundles/material-button-toggle.umd.min.js +2 -2
- package/bundles/material-button-toggle.umd.min.js.map +1 -1
- package/bundles/material-button.umd.js +7 -2
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-button.umd.min.js +4 -4
- package/bundles/material-button.umd.min.js.map +1 -1
- package/bundles/material-card-testing.umd.js +335 -0
- package/bundles/material-card-testing.umd.js.map +1 -0
- package/bundles/material-card-testing.umd.min.js +44 -0
- package/bundles/material-card-testing.umd.min.js.map +1 -0
- package/bundles/material-checkbox-testing.umd.js +11 -0
- package/bundles/material-checkbox-testing.umd.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.min.js +3 -3
- package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-chips.umd.js +36 -12
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-chips.umd.min.js +4 -4
- package/bundles/material-chips.umd.min.js.map +1 -1
- package/bundles/material-core-testing.umd.min.js +1 -1
- package/bundles/material-core-testing.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +11 -3
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +11 -11
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +20 -11
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +5 -5
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-dialog-testing.umd.min.js +1 -1
- package/bundles/material-dialog-testing.umd.min.js.map +1 -1
- package/bundles/material-dialog.umd.js +45 -8
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-dialog.umd.min.js +14 -7
- package/bundles/material-dialog.umd.min.js.map +1 -1
- package/bundles/material-divider-testing.umd.min.js +1 -1
- package/bundles/material-divider-testing.umd.min.js.map +1 -1
- package/bundles/material-expansion-testing.umd.js +11 -0
- package/bundles/material-expansion-testing.umd.js.map +1 -1
- package/bundles/material-expansion-testing.umd.min.js +3 -3
- package/bundles/material-expansion-testing.umd.min.js.map +1 -1
- package/bundles/material-form-field-testing.umd.js +32 -0
- package/bundles/material-form-field-testing.umd.js.map +1 -1
- package/bundles/material-form-field-testing.umd.min.js +4 -4
- package/bundles/material-form-field-testing.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +47 -21
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +5 -5
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.min.js +1 -1
- package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
- package/bundles/material-grid-list.umd.js +2 -2
- package/bundles/material-grid-list.umd.js.map +1 -1
- package/bundles/material-grid-list.umd.min.js +2 -2
- package/bundles/material-grid-list.umd.min.js.map +1 -1
- package/bundles/material-input-testing.umd.js +23 -6
- package/bundles/material-input-testing.umd.js.map +1 -1
- package/bundles/material-input-testing.umd.min.js +3 -3
- package/bundles/material-input-testing.umd.min.js.map +1 -1
- package/bundles/material-input.umd.js +28 -3
- package/bundles/material-input.umd.js.map +1 -1
- package/bundles/material-input.umd.min.js +3 -3
- package/bundles/material-input.umd.min.js.map +1 -1
- package/bundles/material-list-testing.umd.js +33 -0
- package/bundles/material-list-testing.umd.js.map +1 -1
- package/bundles/material-list-testing.umd.min.js +2 -2
- package/bundles/material-list-testing.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +3 -3
- package/bundles/material-list.umd.min.js +1 -1
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu-testing.umd.js +22 -0
- package/bundles/material-menu-testing.umd.js.map +1 -1
- package/bundles/material-menu-testing.umd.min.js +2 -2
- package/bundles/material-menu-testing.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +13 -2
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-menu.umd.min.js +4 -4
- package/bundles/material-menu.umd.min.js.map +1 -1
- package/bundles/material-paginator-testing.umd.min.js +1 -1
- package/bundles/material-paginator-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.js +1 -1
- package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.min.js +2 -2
- package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +2 -2
- package/bundles/material-progress-spinner.umd.min.js +3 -3
- package/bundles/material-progress-spinner.umd.min.js.map +1 -1
- package/bundles/material-radio-testing.umd.js +11 -0
- package/bundles/material-radio-testing.umd.js.map +1 -1
- package/bundles/material-radio-testing.umd.min.js +3 -3
- package/bundles/material-radio-testing.umd.min.js.map +1 -1
- package/bundles/material-radio.umd.js +15 -5
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-radio.umd.min.js +2 -2
- package/bundles/material-radio.umd.min.js.map +1 -1
- package/bundles/material-select-testing.umd.js +11 -0
- package/bundles/material-select-testing.umd.js.map +1 -1
- package/bundles/material-select-testing.umd.min.js +2 -2
- package/bundles/material-select-testing.umd.min.js.map +1 -1
- package/bundles/material-select.umd.js +11 -3
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-select.umd.min.js +4 -4
- package/bundles/material-select.umd.min.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.min.js +1 -1
- package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
- package/bundles/material-sidenav.umd.js +41 -17
- package/bundles/material-sidenav.umd.js.map +1 -1
- package/bundles/material-sidenav.umd.min.js +2 -2
- package/bundles/material-sidenav.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.js +11 -0
- package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.min.js +2 -2
- package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.js +11 -0
- package/bundles/material-slider-testing.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.min.js +2 -2
- package/bundles/material-slider-testing.umd.min.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.min.js +1 -1
- package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +47 -39
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +2 -2
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-sort-testing.umd.js +10 -10
- package/bundles/material-sort-testing.umd.js.map +1 -1
- package/bundles/material-sort-testing.umd.min.js +3 -3
- package/bundles/material-sort-testing.umd.min.js.map +1 -1
- package/bundles/material-sort.umd.js +25 -12
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-sort.umd.min.js +5 -5
- package/bundles/material-sort.umd.min.js.map +1 -1
- package/bundles/material-table-testing.umd.min.js +1 -1
- package/bundles/material-table-testing.umd.min.js.map +1 -1
- package/bundles/material-table.umd.min.js +2 -2
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs-testing.umd.min.js +1 -1
- package/bundles/material-tabs-testing.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +23 -4
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +5 -12
- package/bundles/material-tabs.umd.min.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.js +330 -0
- package/bundles/material-toolbar-testing.umd.js.map +1 -0
- package/bundles/material-toolbar-testing.umd.min.js +44 -0
- package/bundles/material-toolbar-testing.umd.min.js.map +1 -0
- package/bundles/material-tooltip-testing.umd.min.js +1 -1
- package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
- package/bundles/material-tooltip.umd.js +14 -1
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.min.js +3 -3
- package/bundles/material-tooltip.umd.min.js.map +1 -1
- package/bundles/material-tree.umd.js.map +1 -1
- package/button/_button-base.scss +1 -1
- package/button/_button-theme.scss +8 -8
- package/button/index.metadata.json +1 -1
- package/button/testing/button-harness.d.ts +2 -0
- package/button-toggle/button-toggle.d.ts +10 -3
- package/button-toggle/index.metadata.json +1 -1
- package/button-toggle/testing/button-toggle-harness.d.ts +2 -0
- package/card/testing/card-harness-filters.d.ts +17 -0
- package/card/testing/card-harness.d.ts +36 -0
- package/card/testing/index.d.ts +8 -0
- package/card/testing/package.json +9 -0
- package/card/testing/public-api.d.ts +9 -0
- package/checkbox/index.metadata.json +1 -1
- package/checkbox/testing/checkbox-harness.d.ts +2 -0
- package/chips/chip.d.ts +19 -1
- package/chips/index.metadata.json +1 -1
- package/core/focus-indicators/_focus-indicators.scss +6 -6
- package/core/index.metadata.json +1 -1
- package/core/option/optgroup.d.ts +7 -0
- package/core/ripple/ripple-ref.d.ts +21 -2
- package/core/ripple/ripple-renderer.d.ts +1 -19
- package/core/ripple/ripple.d.ts +2 -2
- package/core/style/_list-common.scss +1 -1
- package/datepicker/date-range-input-parts.d.ts +2 -4
- package/datepicker/date-range-input.d.ts +4 -4
- package/datepicker/date-range-picker.d.ts +10 -3
- package/datepicker/datepicker.d.ts +2 -3
- package/datepicker/index.metadata.json +1 -1
- package/datepicker/public-api.d.ts +1 -1
- package/dialog/dialog-container.d.ts +9 -2
- package/dialog/dialog-content-directives.d.ts +1 -0
- package/dialog/dialog-ref.d.ts +7 -0
- package/dialog/index.metadata.json +1 -1
- package/esm2015/autocomplete/autocomplete-module.js +18 -22
- package/esm2015/autocomplete/autocomplete-origin.js +16 -20
- package/esm2015/autocomplete/autocomplete-trigger.js +519 -521
- package/esm2015/autocomplete/autocomplete.js +126 -130
- package/esm2015/autocomplete/testing/autocomplete-harness.js +99 -97
- package/esm2015/badge/badge-module.js +13 -17
- package/esm2015/badge/badge.js +184 -188
- package/esm2015/badge/testing/badge-harness.js +74 -78
- package/esm2015/bottom-sheet/bottom-sheet-container.js +161 -165
- package/esm2015/bottom-sheet/bottom-sheet-module.js +15 -19
- package/esm2015/bottom-sheet/bottom-sheet.js +124 -128
- package/esm2015/bottom-sheet/testing/bottom-sheet-harness.js +29 -33
- package/esm2015/button/button-module.js +20 -24
- package/esm2015/button/button.js +111 -114
- package/esm2015/button/testing/button-harness.js +60 -58
- package/esm2015/button-toggle/button-toggle-module.js +10 -14
- package/esm2015/button-toggle/button-toggle.js +368 -368
- package/esm2015/button-toggle/testing/button-toggle-group-harness.js +42 -46
- package/esm2015/button-toggle/testing/button-toggle-harness.js +113 -111
- package/esm2015/card/card-module.js +30 -34
- package/esm2015/card/card.js +147 -203
- package/esm2015/card/testing/card-harness-filters.js +8 -0
- package/esm2015/card/testing/card-harness.js +52 -0
- package/esm2015/card/testing/index.js +9 -0
- package/esm2015/card/testing/public-api.js +10 -0
- package/esm2015/card/testing/testing.externs.js +0 -0
- package/esm2015/checkbox/checkbox-module.js +21 -29
- package/esm2015/checkbox/checkbox-required-validator.js +9 -13
- package/esm2015/checkbox/checkbox.js +315 -319
- package/esm2015/checkbox/testing/checkbox-harness.js +150 -148
- package/esm2015/chips/chip-input.js +119 -123
- package/esm2015/chips/chip-list.js +572 -576
- package/esm2015/chips/chip.js +333 -328
- package/esm2015/chips/chips-module.js +16 -20
- package/esm2015/core/animation/animation.js +12 -20
- package/esm2015/core/common-behaviors/common-module.js +91 -95
- package/esm2015/core/datetime/index.js +19 -27
- package/esm2015/core/datetime/native-date-adapter.js +202 -206
- package/esm2015/core/error/error-options.js +16 -24
- package/esm2015/core/line/line.js +18 -26
- package/esm2015/core/option/index.js +10 -14
- package/esm2015/core/option/optgroup.js +36 -33
- package/esm2015/core/option/option.js +181 -185
- package/esm2015/core/ripple/index.js +10 -14
- package/esm2015/core/ripple/ripple-ref.js +1 -1
- package/esm2015/core/ripple/ripple-renderer.js +1 -1
- package/esm2015/core/ripple/ripple.js +102 -106
- package/esm2015/core/selection/index.js +9 -13
- package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +32 -36
- package/esm2015/core/testing/optgroup-harness.js +39 -43
- package/esm2015/core/testing/option-harness.js +51 -55
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/calendar-body.js +214 -218
- package/esm2015/datepicker/calendar.js +295 -303
- package/esm2015/datepicker/date-range-input-parts.js +214 -229
- package/esm2015/datepicker/date-range-input.js +244 -242
- package/esm2015/datepicker/date-range-picker.js +19 -23
- package/esm2015/datepicker/date-range-selection-strategy.js +31 -35
- package/esm2015/datepicker/date-selection-model.js +110 -122
- package/esm2015/datepicker/datepicker-base.js +418 -426
- package/esm2015/datepicker/datepicker-input-base.js +227 -224
- package/esm2015/datepicker/datepicker-input.js +111 -115
- package/esm2015/datepicker/datepicker-intl.js +37 -41
- package/esm2015/datepicker/datepicker-module.js +62 -66
- package/esm2015/datepicker/datepicker-toggle.js +81 -89
- package/esm2015/datepicker/datepicker.js +13 -17
- package/esm2015/datepicker/month-view.js +283 -287
- package/esm2015/datepicker/multi-year-view.js +198 -202
- package/esm2015/datepicker/public-api.js +2 -2
- package/esm2015/datepicker/year-view.js +220 -224
- package/esm2015/dialog/dialog-container.js +175 -164
- package/esm2015/dialog/dialog-content-directives.js +105 -114
- package/esm2015/dialog/dialog-module.js +32 -36
- package/esm2015/dialog/dialog-ref.js +17 -3
- package/esm2015/dialog/dialog.js +236 -240
- package/esm2015/dialog/testing/dialog-harness.js +58 -62
- package/esm2015/divider/divider-module.js +10 -14
- package/esm2015/divider/divider.js +33 -37
- package/esm2015/divider/testing/divider-harness.js +16 -20
- package/esm2015/expansion/accordion.js +73 -77
- package/esm2015/expansion/expansion-module.js +26 -30
- package/esm2015/expansion/expansion-panel-content.js +13 -17
- package/esm2015/expansion/expansion-panel-header.js +168 -180
- package/esm2015/expansion/expansion-panel.js +144 -152
- package/esm2015/expansion/testing/accordion-harness.js +24 -28
- package/esm2015/expansion/testing/expansion-harness.js +136 -134
- package/esm2015/form-field/error.js +26 -23
- package/esm2015/form-field/form-field-control.js +6 -10
- package/esm2015/form-field/form-field-module.js +31 -35
- package/esm2015/form-field/form-field.js +407 -409
- package/esm2015/form-field/hint.js +35 -29
- package/esm2015/form-field/label.js +8 -12
- package/esm2015/form-field/placeholder.js +8 -12
- package/esm2015/form-field/prefix.js +16 -13
- package/esm2015/form-field/suffix.js +16 -13
- package/esm2015/form-field/testing/form-field-harness.js +220 -206
- package/esm2015/grid-list/grid-list-module.js +26 -30
- package/esm2015/grid-list/grid-list.js +108 -112
- package/esm2015/grid-list/grid-tile.js +91 -111
- package/esm2015/grid-list/testing/grid-list-harness.js +62 -66
- package/esm2015/grid-list/testing/grid-tile-harness.js +69 -73
- package/esm2015/grid-list/tile-styler.js +1 -1
- package/esm2015/icon/icon-module.js +10 -14
- package/esm2015/icon/icon-registry.js +406 -410
- package/esm2015/icon/icon.js +228 -232
- package/esm2015/icon/testing/fake-icon-registry.js +66 -74
- package/esm2015/input/autosize.js +30 -34
- package/esm2015/input/input-module.js +21 -25
- package/esm2015/input/input.js +305 -284
- package/esm2015/input/testing/input-harness.js +129 -123
- package/esm2015/list/list-module.js +32 -36
- package/esm2015/list/list.js +165 -189
- package/esm2015/list/selection-list.js +503 -511
- package/esm2015/list/testing/action-list-harness.js +55 -57
- package/esm2015/list/testing/list-harness.js +31 -39
- package/esm2015/list/testing/list-item-harness-base.js +13 -17
- package/esm2015/list/testing/nav-list-harness.js +62 -64
- package/esm2015/list/testing/selection-list-harness.js +136 -138
- package/esm2015/menu/menu-content.js +74 -71
- package/esm2015/menu/menu-item.js +119 -123
- package/esm2015/menu/menu-module.js +29 -37
- package/esm2015/menu/menu-panel.js +1 -1
- package/esm2015/menu/menu-trigger.js +402 -405
- package/esm2015/menu/menu.js +329 -339
- package/esm2015/menu/testing/menu-harness.js +193 -189
- package/esm2015/paginator/paginator-intl.js +36 -40
- package/esm2015/paginator/paginator-module.js +16 -20
- package/esm2015/paginator/paginator.js +205 -209
- package/esm2015/paginator/testing/paginator-harness.js +91 -95
- package/esm2015/progress-bar/progress-bar-module.js +10 -14
- package/esm2015/progress-bar/progress-bar.js +114 -118
- package/esm2015/progress-bar/testing/progress-bar-harness.js +27 -31
- package/esm2015/progress-spinner/progress-spinner-module.js +17 -21
- package/esm2015/progress-spinner/progress-spinner.js +181 -189
- package/esm2015/progress-spinner/testing/progress-spinner-harness.js +28 -32
- package/esm2015/radio/radio-module.js +10 -14
- package/esm2015/radio/radio.js +437 -444
- package/esm2015/radio/testing/radio-harness.js +241 -243
- package/esm2015/select/select-module.js +23 -27
- package/esm2015/select/select.js +917 -918
- package/esm2015/select/testing/select-harness.js +138 -136
- package/esm2015/sidenav/drawer.js +632 -620
- package/esm2015/sidenav/sidenav-module.js +31 -35
- package/esm2015/sidenav/sidenav.js +104 -116
- package/esm2015/sidenav/testing/drawer-harness.js +40 -44
- package/esm2015/sidenav/testing/sidenav-harness.js +20 -24
- package/esm2015/slide-toggle/slide-toggle-module.js +27 -35
- package/esm2015/slide-toggle/slide-toggle-required-validator.js +9 -13
- package/esm2015/slide-toggle/slide-toggle.js +184 -188
- package/esm2015/slide-toggle/testing/slide-toggle-harness.js +123 -121
- package/esm2015/slider/slider-module.js +10 -14
- package/esm2015/slider/slider.js +640 -644
- package/esm2015/slider/testing/slider-harness.js +129 -127
- package/esm2015/snack-bar/simple-snack-bar.js +32 -36
- package/esm2015/snack-bar/snack-bar-container.js +144 -148
- package/esm2015/snack-bar/snack-bar-module.js +17 -21
- package/esm2015/snack-bar/snack-bar-ref.js +1 -1
- package/esm2015/snack-bar/snack-bar.js +208 -205
- package/esm2015/snack-bar/testing/snack-bar-harness.js +112 -116
- package/esm2015/sort/sort-header-intl.js +21 -21
- package/esm2015/sort/sort-header.js +200 -194
- package/esm2015/sort/sort-module.js +11 -15
- package/esm2015/sort/sort.js +92 -96
- package/esm2015/sort/testing/sort-harness.js +28 -32
- package/esm2015/sort/testing/sort-header-harness.js +66 -67
- package/esm2015/stepper/step-header.js +78 -82
- package/esm2015/stepper/step-label.js +8 -12
- package/esm2015/stepper/stepper-button.js +23 -31
- package/esm2015/stepper/stepper-icon.js +16 -20
- package/esm2015/stepper/stepper-intl.js +15 -19
- package/esm2015/stepper/stepper-module.js +40 -44
- package/esm2015/stepper/stepper.js +139 -155
- package/esm2015/table/cell.js +94 -122
- package/esm2015/table/row.js +90 -118
- package/esm2015/table/table-module.js +13 -17
- package/esm2015/table/table.js +26 -30
- package/esm2015/table/testing/cell-harness.js +56 -68
- package/esm2015/table/testing/row-harness.js +90 -102
- package/esm2015/table/testing/table-harness.js +65 -69
- package/esm2015/table/text-column.js +17 -21
- package/esm2015/tabs/index.js +4 -2
- package/esm2015/tabs/ink-bar.js +55 -59
- package/esm2015/tabs/paginated-tab-header.js +415 -419
- package/esm2015/tabs/tab-body.js +179 -191
- package/esm2015/tabs/tab-content.js +21 -16
- package/esm2015/tabs/tab-group.js +263 -271
- package/esm2015/tabs/tab-header.js +69 -77
- package/esm2015/tabs/tab-label-wrapper.js +29 -33
- package/esm2015/tabs/tab-label.js +16 -13
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +199 -215
- package/esm2015/tabs/tab.js +80 -83
- package/esm2015/tabs/tabs-module.js +38 -42
- package/esm2015/tabs/testing/tab-group-harness.js +52 -56
- package/esm2015/tabs/testing/tab-harness.js +78 -82
- package/esm2015/toolbar/testing/index.js +9 -0
- package/esm2015/toolbar/testing/public-api.js +10 -0
- package/esm2015/toolbar/testing/testing.externs.js +0 -0
- package/esm2015/toolbar/testing/toolbar-harness-filters.js +8 -0
- package/esm2015/toolbar/testing/toolbar-harness.js +47 -0
- package/esm2015/toolbar/toolbar-module.js +10 -14
- package/esm2015/toolbar/toolbar.js +61 -69
- package/esm2015/tooltip/testing/tooltip-harness.js +43 -47
- package/esm2015/tooltip/tooltip-module.js +17 -21
- package/esm2015/tooltip/tooltip.js +502 -497
- package/esm2015/tree/data-source/flat-data-source.js +1 -1
- package/esm2015/tree/node.js +99 -111
- package/esm2015/tree/outlet.js +19 -23
- package/esm2015/tree/padding.js +13 -17
- package/esm2015/tree/toggle.js +15 -19
- package/esm2015/tree/tree-module.js +10 -14
- package/esm2015/tree/tree.js +23 -27
- package/expansion/testing/expansion-harness.d.ts +2 -0
- package/fesm2015/autocomplete/testing.js +98 -95
- package/fesm2015/autocomplete/testing.js.map +1 -1
- package/fesm2015/autocomplete.js +677 -687
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/badge/testing.js +73 -76
- package/fesm2015/badge/testing.js.map +1 -1
- package/fesm2015/badge.js +195 -201
- package/fesm2015/badge.js.map +1 -1
- package/fesm2015/bottom-sheet/testing.js +28 -31
- package/fesm2015/bottom-sheet/testing.js.map +1 -1
- package/fesm2015/bottom-sheet.js +297 -306
- package/fesm2015/bottom-sheet.js.map +1 -1
- package/fesm2015/button/testing.js +59 -56
- package/fesm2015/button/testing.js.map +1 -1
- package/fesm2015/button-toggle/testing.js +155 -155
- package/fesm2015/button-toggle/testing.js.map +1 -1
- package/fesm2015/button-toggle.js +377 -378
- package/fesm2015/button-toggle.js.map +1 -1
- package/fesm2015/button.js +129 -133
- package/fesm2015/button.js.map +1 -1
- package/fesm2015/card/testing.js +79 -0
- package/fesm2015/card/testing.js.map +1 -0
- package/fesm2015/card.js +175 -220
- package/fesm2015/card.js.map +1 -1
- package/fesm2015/checkbox/testing.js +149 -146
- package/fesm2015/checkbox/testing.js.map +1 -1
- package/fesm2015/checkbox.js +342 -354
- package/fesm2015/checkbox.js.map +1 -1
- package/fesm2015/chips.js +1039 -1039
- package/fesm2015/chips.js.map +1 -1
- package/fesm2015/core/testing.js +88 -94
- package/fesm2015/core/testing.js.map +1 -1
- package/fesm2015/core.js +729 -773
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +2821 -2884
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/dialog/testing.js +57 -60
- package/fesm2015/dialog/testing.js.map +1 -1
- package/fesm2015/dialog.js +564 -549
- package/fesm2015/dialog.js.map +1 -1
- package/fesm2015/divider/testing.js +15 -18
- package/fesm2015/divider/testing.js.map +1 -1
- package/fesm2015/divider.js +41 -47
- package/fesm2015/divider.js.map +1 -1
- package/fesm2015/expansion/testing.js +159 -159
- package/fesm2015/expansion/testing.js.map +1 -1
- package/fesm2015/expansion.js +422 -446
- package/fesm2015/expansion.js.map +1 -1
- package/fesm2015/form-field/testing.js +219 -204
- package/fesm2015/form-field/testing.js.map +1 -1
- package/fesm2015/form-field.js +538 -532
- package/fesm2015/form-field.js.map +1 -1
- package/fesm2015/grid-list/testing.js +129 -135
- package/fesm2015/grid-list/testing.js.map +1 -1
- package/fesm2015/grid-list.js +221 -242
- package/fesm2015/grid-list.js.map +1 -1
- package/fesm2015/icon/testing.js +65 -71
- package/fesm2015/icon/testing.js.map +1 -1
- package/fesm2015/icon.js +660 -669
- package/fesm2015/icon.js.map +1 -1
- package/fesm2015/input/testing.js +128 -121
- package/fesm2015/input/testing.js.map +1 -1
- package/fesm2015/input.js +353 -337
- package/fesm2015/input.js.map +1 -1
- package/fesm2015/list/testing.js +298 -307
- package/fesm2015/list/testing.js.map +1 -1
- package/fesm2015/list.js +698 -725
- package/fesm2015/list.js.map +1 -1
- package/fesm2015/menu/testing.js +192 -186
- package/fesm2015/menu/testing.js.map +1 -1
- package/fesm2015/menu.js +948 -962
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/paginator/testing.js +90 -93
- package/fesm2015/paginator/testing.js.map +1 -1
- package/fesm2015/paginator.js +247 -256
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/progress-bar/testing.js +26 -29
- package/fesm2015/progress-bar/testing.js.map +1 -1
- package/fesm2015/progress-bar.js +122 -128
- package/fesm2015/progress-bar.js.map +1 -1
- package/fesm2015/progress-spinner/testing.js +27 -30
- package/fesm2015/progress-spinner/testing.js.map +1 -1
- package/fesm2015/progress-spinner.js +196 -205
- package/fesm2015/progress-spinner.js.map +1 -1
- package/fesm2015/radio/testing.js +240 -240
- package/fesm2015/radio/testing.js.map +1 -1
- package/fesm2015/radio.js +447 -453
- package/fesm2015/radio.js.map +1 -1
- package/fesm2015/select/testing.js +137 -134
- package/fesm2015/select/testing.js.map +1 -1
- package/fesm2015/select.js +939 -941
- package/fesm2015/select.js.map +1 -1
- package/fesm2015/sidenav/testing.js +58 -64
- package/fesm2015/sidenav/testing.js.map +1 -1
- package/fesm2015/sidenav.js +765 -762
- package/fesm2015/sidenav.js.map +1 -1
- package/fesm2015/slide-toggle/testing.js +122 -119
- package/fesm2015/slide-toggle/testing.js.map +1 -1
- package/fesm2015/slide-toggle.js +217 -229
- package/fesm2015/slide-toggle.js.map +1 -1
- package/fesm2015/slider/testing.js +128 -125
- package/fesm2015/slider/testing.js.map +1 -1
- package/fesm2015/slider.js +648 -654
- package/fesm2015/slider.js.map +1 -1
- package/fesm2015/snack-bar/testing.js +111 -114
- package/fesm2015/snack-bar/testing.js.map +1 -1
- package/fesm2015/snack-bar.js +426 -431
- package/fesm2015/snack-bar.js.map +1 -1
- package/fesm2015/sort/testing.js +92 -95
- package/fesm2015/sort/testing.js.map +1 -1
- package/fesm2015/sort.js +320 -318
- package/fesm2015/sort.js.map +1 -1
- package/fesm2015/stepper.js +312 -345
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table/testing.js +208 -229
- package/fesm2015/table/testing.js.map +1 -1
- package/fesm2015/table.js +235 -286
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/tabs/testing.js +128 -134
- package/fesm2015/tabs/testing.js.map +1 -1
- package/fesm2015/tabs.js +1362 -1399
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/toolbar/testing.js +74 -0
- package/fesm2015/toolbar/testing.js.map +1 -0
- package/fesm2015/toolbar.js +69 -78
- package/fesm2015/toolbar.js.map +1 -1
- package/fesm2015/tooltip/testing.js +42 -45
- package/fesm2015/tooltip/testing.js.map +1 -1
- package/fesm2015/tooltip.js +517 -513
- package/fesm2015/tooltip.js.map +1 -1
- package/fesm2015/tree.js +173 -197
- package/fesm2015/tree.js.map +1 -1
- package/form-field/error.d.ts +7 -0
- package/form-field/hint.d.ts +10 -0
- package/form-field/index.metadata.json +1 -1
- package/form-field/prefix.d.ts +7 -0
- package/form-field/suffix.d.ts +7 -0
- package/form-field/testing/form-field-harness.d.ts +8 -0
- package/grid-list/grid-list.d.ts +2 -1
- package/grid-list/index.metadata.json +1 -1
- package/grid-list/tile-styler.d.ts +10 -5
- package/input/_input-theme.scss +2 -2
- package/input/index.metadata.json +1 -1
- package/input/input.d.ts +6 -2
- package/input/testing/input-harness.d.ts +2 -0
- package/list/index.metadata.json +1 -1
- package/list/testing/action-list-harness.d.ts +2 -0
- package/list/testing/nav-list-harness.d.ts +2 -0
- package/list/testing/selection-list-harness.d.ts +2 -0
- package/menu/index.metadata.json +1 -1
- package/menu/menu-content.d.ts +7 -1
- package/menu/menu-panel.d.ts +1 -0
- package/menu/menu.d.ts +4 -0
- package/menu/testing/menu-harness.d.ts +4 -0
- package/package.json +6 -6
- 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/index.metadata.json +1 -1
- package/radio/index.metadata.json +1 -1
- package/radio/radio.d.ts +6 -0
- package/radio/testing/radio-harness.d.ts +2 -0
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +3 -3
- package/schematics/ng-generate/navigation/schema.json +5 -0
- package/schematics/ng-update/data/index.js +1 -1
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/migrations/hammer-gestures-v9/hammer-gestures-migration.js +639 -639
- package/schematics/ng-update/migrations/misc-ripples-v7/ripple-speed-factor-migration.js +1 -1
- package/select/index.metadata.json +1 -1
- package/select/select.d.ts +6 -0
- package/select/testing/select-harness.d.ts +2 -0
- package/sidenav/drawer.d.ts +15 -3
- package/sidenav/index.metadata.json +1 -1
- package/slide-toggle/index.metadata.json +1 -1
- package/slide-toggle/testing/slide-toggle-harness.d.ts +2 -0
- package/slider/testing/slider-harness.d.ts +2 -0
- package/snack-bar/index.metadata.json +1 -1
- package/snack-bar/simple-snack-bar.d.ts +13 -1
- package/snack-bar/snack-bar-container.d.ts +16 -3
- package/snack-bar/snack-bar-ref.d.ts +3 -3
- package/snack-bar/snack-bar.d.ts +10 -3
- package/sort/index.metadata.json +1 -1
- package/sort/sort-header-intl.d.ts +5 -1
- package/sort/sort-header.d.ts +3 -1
- package/sort/testing/sort-header-harness.d.ts +6 -2
- package/tabs/index.d.ts +3 -1
- package/tabs/index.metadata.json +1 -1
- package/tabs/tab-content.d.ts +7 -1
- package/tabs/tab-label.d.ts +7 -0
- package/toolbar/testing/index.d.ts +8 -0
- package/toolbar/testing/package.json +9 -0
- package/toolbar/testing/public-api.d.ts +9 -0
- package/toolbar/testing/toolbar-harness-filters.d.ts +13 -0
- package/toolbar/testing/toolbar-harness.d.ts +31 -0
- package/tooltip/index.metadata.json +1 -1
- package/tooltip/tooltip.d.ts +1 -0
- package/tree/data-source/flat-data-source.d.ts +4 -4
- package/tree/index.metadata.json +1 -1
package/fesm2015/tabs.js
CHANGED
|
@@ -41,66 +41,63 @@ function _MAT_INK_BAR_POSITIONER_FACTORY() {
|
|
|
41
41
|
* The ink-bar is used to display and animate the line underneath the current active tab label.
|
|
42
42
|
* @docs-private
|
|
43
43
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this._setStyles(element);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/** Shows the ink bar. */
|
|
69
|
-
show() {
|
|
70
|
-
this._elementRef.nativeElement.style.visibility = 'visible';
|
|
44
|
+
class MatInkBar {
|
|
45
|
+
constructor(_elementRef, _ngZone, _inkBarPositioner, _animationMode) {
|
|
46
|
+
this._elementRef = _elementRef;
|
|
47
|
+
this._ngZone = _ngZone;
|
|
48
|
+
this._inkBarPositioner = _inkBarPositioner;
|
|
49
|
+
this._animationMode = _animationMode;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Calculates the styles from the provided element in order to align the ink-bar to that element.
|
|
53
|
+
* Shows the ink bar if previously set as hidden.
|
|
54
|
+
* @param element
|
|
55
|
+
*/
|
|
56
|
+
alignToElement(element) {
|
|
57
|
+
this.show();
|
|
58
|
+
if (typeof requestAnimationFrame !== 'undefined') {
|
|
59
|
+
this._ngZone.runOutsideAngular(() => {
|
|
60
|
+
requestAnimationFrame(() => this._setStyles(element));
|
|
61
|
+
});
|
|
71
62
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this._elementRef.nativeElement.style.visibility = 'hidden';
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Sets the proper styles to the ink bar element.
|
|
78
|
-
* @param element
|
|
79
|
-
*/
|
|
80
|
-
_setStyles(element) {
|
|
81
|
-
const positions = this._inkBarPositioner(element);
|
|
82
|
-
const inkBar = this._elementRef.nativeElement;
|
|
83
|
-
inkBar.style.left = positions.left;
|
|
84
|
-
inkBar.style.width = positions.width;
|
|
63
|
+
else {
|
|
64
|
+
this._setStyles(element);
|
|
85
65
|
}
|
|
86
66
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
67
|
+
/** Shows the ink bar. */
|
|
68
|
+
show() {
|
|
69
|
+
this._elementRef.nativeElement.style.visibility = 'visible';
|
|
70
|
+
}
|
|
71
|
+
/** Hides the ink bar. */
|
|
72
|
+
hide() {
|
|
73
|
+
this._elementRef.nativeElement.style.visibility = 'hidden';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Sets the proper styles to the ink bar element.
|
|
77
|
+
* @param element
|
|
78
|
+
*/
|
|
79
|
+
_setStyles(element) {
|
|
80
|
+
const positions = this._inkBarPositioner(element);
|
|
81
|
+
const inkBar = this._elementRef.nativeElement;
|
|
82
|
+
inkBar.style.left = positions.left;
|
|
83
|
+
inkBar.style.width = positions.width;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
MatInkBar.decorators = [
|
|
87
|
+
{ type: Directive, args: [{
|
|
88
|
+
selector: 'mat-ink-bar',
|
|
89
|
+
host: {
|
|
90
|
+
'class': 'mat-ink-bar',
|
|
91
|
+
'[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,
|
|
92
|
+
},
|
|
93
|
+
},] }
|
|
94
|
+
];
|
|
95
|
+
MatInkBar.ctorParameters = () => [
|
|
96
|
+
{ type: ElementRef },
|
|
97
|
+
{ type: NgZone },
|
|
98
|
+
{ type: undefined, decorators: [{ type: Inject, args: [_MAT_INK_BAR_POSITIONER,] }] },
|
|
99
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
100
|
+
];
|
|
104
101
|
|
|
105
102
|
/**
|
|
106
103
|
* @license
|
|
@@ -109,21 +106,27 @@ let MatInkBar = /** @class */ (() => {
|
|
|
109
106
|
* Use of this source code is governed by an MIT-style license that can be
|
|
110
107
|
* found in the LICENSE file at https://angular.io/license
|
|
111
108
|
*/
|
|
109
|
+
/**
|
|
110
|
+
* Injection token that can be used to reference instances of `MatTabContent`. It serves as
|
|
111
|
+
* alternative token to the actual `MatTabContent` class which could cause unnecessary
|
|
112
|
+
* retention of the class and its directive metadata.
|
|
113
|
+
*/
|
|
114
|
+
const MAT_TAB_CONTENT = new InjectionToken('MatTabContent');
|
|
112
115
|
/** Decorates the `ng-template` tags and reads out the template from it. */
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.template = template;
|
|
117
|
-
}
|
|
116
|
+
class MatTabContent {
|
|
117
|
+
constructor(template) {
|
|
118
|
+
this.template = template;
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
}
|
|
121
|
+
MatTabContent.decorators = [
|
|
122
|
+
{ type: Directive, args: [{
|
|
123
|
+
selector: '[matTabContent]',
|
|
124
|
+
providers: [{ provide: MAT_TAB_CONTENT, useExisting: MatTabContent }],
|
|
125
|
+
},] }
|
|
126
|
+
];
|
|
127
|
+
MatTabContent.ctorParameters = () => [
|
|
128
|
+
{ type: TemplateRef }
|
|
129
|
+
];
|
|
127
130
|
|
|
128
131
|
/**
|
|
129
132
|
* @license
|
|
@@ -132,17 +135,21 @@ let MatTabContent = /** @class */ (() => {
|
|
|
132
135
|
* Use of this source code is governed by an MIT-style license that can be
|
|
133
136
|
* found in the LICENSE file at https://angular.io/license
|
|
134
137
|
*/
|
|
138
|
+
/**
|
|
139
|
+
* Injection token that can be used to reference instances of `MatTabLabel`. It serves as
|
|
140
|
+
* alternative token to the actual `MatTabLabel` class which could cause unnecessary
|
|
141
|
+
* retention of the class and its directive metadata.
|
|
142
|
+
*/
|
|
143
|
+
const MAT_TAB_LABEL = new InjectionToken('MatTabLabel');
|
|
135
144
|
/** Used to flag tab labels for use with the portal directive */
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return MatTabLabel;
|
|
145
|
-
})();
|
|
145
|
+
class MatTabLabel extends CdkPortal {
|
|
146
|
+
}
|
|
147
|
+
MatTabLabel.decorators = [
|
|
148
|
+
{ type: Directive, args: [{
|
|
149
|
+
selector: '[mat-tab-label], [matTabLabel]',
|
|
150
|
+
providers: [{ provide: MAT_TAB_LABEL, useExisting: MatTabLabel }],
|
|
151
|
+
},] }
|
|
152
|
+
];
|
|
146
153
|
|
|
147
154
|
/**
|
|
148
155
|
* @license
|
|
@@ -161,90 +168,88 @@ const _MatTabMixinBase = mixinDisabled(MatTabBase);
|
|
|
161
168
|
* @docs-private
|
|
162
169
|
*/
|
|
163
170
|
const MAT_TAB_GROUP = new InjectionToken('MAT_TAB_GROUP');
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
class MatTab extends _MatTabMixinBase {
|
|
172
|
+
constructor(_viewContainerRef,
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated `_closestTabGroup` parameter to become required.
|
|
175
|
+
* @breaking-change 10.0.0
|
|
176
|
+
*/
|
|
177
|
+
_closestTabGroup) {
|
|
178
|
+
super();
|
|
179
|
+
this._viewContainerRef = _viewContainerRef;
|
|
180
|
+
this._closestTabGroup = _closestTabGroup;
|
|
181
|
+
/** Plain text label for the tab, used when there is no template label. */
|
|
182
|
+
this.textLabel = '';
|
|
183
|
+
/** Portal that will be the hosted content of the tab */
|
|
184
|
+
this._contentPortal = null;
|
|
185
|
+
/** Emits whenever the internal state of the tab changes. */
|
|
186
|
+
this._stateChanges = new Subject();
|
|
167
187
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
188
|
+
* The relatively indexed position where 0 represents the center, negative is left, and positive
|
|
189
|
+
* represents the right.
|
|
170
190
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
* Whether the tab is currently active.
|
|
193
|
-
*/
|
|
194
|
-
this.isActive = false;
|
|
195
|
-
}
|
|
196
|
-
/** Content for the tab label given by `<ng-template mat-tab-label>`. */
|
|
197
|
-
get templateLabel() { return this._templateLabel; }
|
|
198
|
-
set templateLabel(value) {
|
|
199
|
-
// Only update the templateLabel via query if there is actually
|
|
200
|
-
// a MatTabLabel found. This works around an issue where a user may have
|
|
201
|
-
// manually set `templateLabel` during creation mode, which would then get clobbered
|
|
202
|
-
// by `undefined` when this query resolves.
|
|
203
|
-
if (value) {
|
|
204
|
-
this._templateLabel = value;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/** @docs-private */
|
|
208
|
-
get content() {
|
|
209
|
-
return this._contentPortal;
|
|
210
|
-
}
|
|
211
|
-
ngOnChanges(changes) {
|
|
212
|
-
if (changes.hasOwnProperty('textLabel') || changes.hasOwnProperty('disabled')) {
|
|
213
|
-
this._stateChanges.next();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
ngOnDestroy() {
|
|
217
|
-
this._stateChanges.complete();
|
|
191
|
+
this.position = null;
|
|
192
|
+
/**
|
|
193
|
+
* The initial relatively index origin of the tab if it was created and selected after there
|
|
194
|
+
* was already a selected tab. Provides context of what position the tab should originate from.
|
|
195
|
+
*/
|
|
196
|
+
this.origin = null;
|
|
197
|
+
/**
|
|
198
|
+
* Whether the tab is currently active.
|
|
199
|
+
*/
|
|
200
|
+
this.isActive = false;
|
|
201
|
+
}
|
|
202
|
+
// TODO: Remove cast once https://github.com/angular/angular/pull/37506 is available.
|
|
203
|
+
/** Content for the tab label given by `<ng-template mat-tab-label>`. */
|
|
204
|
+
get templateLabel() { return this._templateLabel; }
|
|
205
|
+
set templateLabel(value) {
|
|
206
|
+
// Only update the templateLabel via query if there is actually
|
|
207
|
+
// a MatTabLabel found. This works around an issue where a user may have
|
|
208
|
+
// manually set `templateLabel` during creation mode, which would then get clobbered
|
|
209
|
+
// by `undefined` when this query resolves.
|
|
210
|
+
if (value) {
|
|
211
|
+
this._templateLabel = value;
|
|
218
212
|
}
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
}
|
|
214
|
+
/** @docs-private */
|
|
215
|
+
get content() {
|
|
216
|
+
return this._contentPortal;
|
|
217
|
+
}
|
|
218
|
+
ngOnChanges(changes) {
|
|
219
|
+
if (changes.hasOwnProperty('textLabel') || changes.hasOwnProperty('disabled')) {
|
|
220
|
+
this._stateChanges.next();
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
223
|
+
ngOnDestroy() {
|
|
224
|
+
this._stateChanges.complete();
|
|
225
|
+
}
|
|
226
|
+
ngOnInit() {
|
|
227
|
+
this._contentPortal = new TemplatePortal(this._explicitContent || this._implicitContent, this._viewContainerRef);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
MatTab.decorators = [
|
|
231
|
+
{ type: Component, args: [{
|
|
232
|
+
selector: 'mat-tab',
|
|
233
|
+
template: "<!-- Create a template for the content of the <mat-tab> so that we can grab a reference to this\n TemplateRef and use it in a Portal to render the tab content in the appropriate place in the\n tab-group. -->\n<ng-template><ng-content></ng-content></ng-template>\n",
|
|
234
|
+
inputs: ['disabled'],
|
|
235
|
+
// tslint:disable-next-line:validate-decorators
|
|
236
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
237
|
+
encapsulation: ViewEncapsulation.None,
|
|
238
|
+
exportAs: 'matTab'
|
|
239
|
+
},] }
|
|
240
|
+
];
|
|
241
|
+
MatTab.ctorParameters = () => [
|
|
242
|
+
{ type: ViewContainerRef },
|
|
243
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_TAB_GROUP,] }] }
|
|
244
|
+
];
|
|
245
|
+
MatTab.propDecorators = {
|
|
246
|
+
templateLabel: [{ type: ContentChild, args: [MAT_TAB_LABEL,] }],
|
|
247
|
+
_explicitContent: [{ type: ContentChild, args: [MAT_TAB_CONTENT, { read: TemplateRef, static: true },] }],
|
|
248
|
+
_implicitContent: [{ type: ViewChild, args: [TemplateRef, { static: true },] }],
|
|
249
|
+
textLabel: [{ type: Input, args: ['label',] }],
|
|
250
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
251
|
+
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }]
|
|
252
|
+
};
|
|
248
253
|
|
|
249
254
|
/**
|
|
250
255
|
* @license
|
|
@@ -291,213 +296,204 @@ const matTabsAnimations = {
|
|
|
291
296
|
* The portal host directive for the contents of the tab.
|
|
292
297
|
* @docs-private
|
|
293
298
|
*/
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
_document)
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
ngOnInit()
|
|
311
|
-
|
|
312
|
-
this.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
this.
|
|
320
|
-
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
/** Clean up centering subscription. */
|
|
324
|
-
ngOnDestroy() {
|
|
325
|
-
super.ngOnDestroy();
|
|
326
|
-
this._centeringSub.unsubscribe();
|
|
327
|
-
this._leavingSub.unsubscribe();
|
|
328
|
-
}
|
|
299
|
+
class MatTabBodyPortal extends CdkPortalOutlet {
|
|
300
|
+
constructor(componentFactoryResolver, viewContainerRef, _host,
|
|
301
|
+
/**
|
|
302
|
+
* @deprecated `_document` parameter to be made required.
|
|
303
|
+
* @breaking-change 9.0.0
|
|
304
|
+
*/
|
|
305
|
+
_document) {
|
|
306
|
+
super(componentFactoryResolver, viewContainerRef, _document);
|
|
307
|
+
this._host = _host;
|
|
308
|
+
/** Subscription to events for when the tab body begins centering. */
|
|
309
|
+
this._centeringSub = Subscription.EMPTY;
|
|
310
|
+
/** Subscription to events for when the tab body finishes leaving from center position. */
|
|
311
|
+
this._leavingSub = Subscription.EMPTY;
|
|
312
|
+
}
|
|
313
|
+
/** Set initial visibility or set up subscription for changing visibility. */
|
|
314
|
+
ngOnInit() {
|
|
315
|
+
super.ngOnInit();
|
|
316
|
+
this._centeringSub = this._host._beforeCentering
|
|
317
|
+
.pipe(startWith(this._host._isCenterPosition(this._host._position)))
|
|
318
|
+
.subscribe((isCentering) => {
|
|
319
|
+
if (isCentering && !this.hasAttached()) {
|
|
320
|
+
this.attach(this._host._content);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
this._leavingSub = this._host._afterLeavingCenter.subscribe(() => {
|
|
324
|
+
this.detach();
|
|
325
|
+
});
|
|
329
326
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
327
|
+
/** Clean up centering subscription. */
|
|
328
|
+
ngOnDestroy() {
|
|
329
|
+
super.ngOnDestroy();
|
|
330
|
+
this._centeringSub.unsubscribe();
|
|
331
|
+
this._leavingSub.unsubscribe();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
MatTabBodyPortal.decorators = [
|
|
335
|
+
{ type: Directive, args: [{
|
|
336
|
+
selector: '[matTabBodyHost]'
|
|
337
|
+
},] }
|
|
338
|
+
];
|
|
339
|
+
MatTabBodyPortal.ctorParameters = () => [
|
|
340
|
+
{ type: ComponentFactoryResolver },
|
|
341
|
+
{ type: ViewContainerRef },
|
|
342
|
+
{ type: MatTabBody, decorators: [{ type: Inject, args: [forwardRef(() => MatTabBody),] }] },
|
|
343
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
344
|
+
];
|
|
343
345
|
/**
|
|
344
346
|
* Base class with all of the `MatTabBody` functionality.
|
|
345
347
|
* @docs-private
|
|
346
348
|
*/
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
this.
|
|
370
|
-
|
|
371
|
-
changeDetectorRef.markForCheck();
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
// Ensure that we get unique animation events, because the `.done` callback can get
|
|
375
|
-
// invoked twice in some browsers. See https://github.com/angular/angular/issues/24084.
|
|
376
|
-
this._translateTabComplete.pipe(distinctUntilChanged((x, y) => {
|
|
377
|
-
return x.fromState === y.fromState && x.toState === y.toState;
|
|
378
|
-
})).subscribe(event => {
|
|
379
|
-
// If the transition to the center is complete, emit an event.
|
|
380
|
-
if (this._isCenterPosition(event.toState) && this._isCenterPosition(this._position)) {
|
|
381
|
-
this._onCentered.emit();
|
|
382
|
-
}
|
|
383
|
-
if (this._isCenterPosition(event.fromState) && !this._isCenterPosition(this._position)) {
|
|
384
|
-
this._afterLeavingCenter.emit();
|
|
385
|
-
}
|
|
349
|
+
class _MatTabBodyBase {
|
|
350
|
+
constructor(_elementRef, _dir, changeDetectorRef) {
|
|
351
|
+
this._elementRef = _elementRef;
|
|
352
|
+
this._dir = _dir;
|
|
353
|
+
/** Subscription to the directionality change observable. */
|
|
354
|
+
this._dirChangeSubscription = Subscription.EMPTY;
|
|
355
|
+
/** Emits when an animation on the tab is complete. */
|
|
356
|
+
this._translateTabComplete = new Subject();
|
|
357
|
+
/** Event emitted when the tab begins to animate towards the center as the active tab. */
|
|
358
|
+
this._onCentering = new EventEmitter();
|
|
359
|
+
/** Event emitted before the centering of the tab begins. */
|
|
360
|
+
this._beforeCentering = new EventEmitter();
|
|
361
|
+
/** Event emitted before the centering of the tab begins. */
|
|
362
|
+
this._afterLeavingCenter = new EventEmitter();
|
|
363
|
+
/** Event emitted when the tab completes its animation towards the center. */
|
|
364
|
+
this._onCentered = new EventEmitter(true);
|
|
365
|
+
// Note that the default value will always be overwritten by `MatTabBody`, but we need one
|
|
366
|
+
// anyway to prevent the animations module from throwing an error if the body is used on its own.
|
|
367
|
+
/** Duration for the tab's animation. */
|
|
368
|
+
this.animationDuration = '500ms';
|
|
369
|
+
if (_dir) {
|
|
370
|
+
this._dirChangeSubscription = _dir.change.subscribe((dir) => {
|
|
371
|
+
this._computePositionAnimationState(dir);
|
|
372
|
+
changeDetectorRef.markForCheck();
|
|
386
373
|
});
|
|
387
374
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
*/
|
|
397
|
-
ngOnInit() {
|
|
398
|
-
if (this._position == 'center' && this.origin != null) {
|
|
399
|
-
this._position = this._computePositionFromOrigin(this.origin);
|
|
375
|
+
// Ensure that we get unique animation events, because the `.done` callback can get
|
|
376
|
+
// invoked twice in some browsers. See https://github.com/angular/angular/issues/24084.
|
|
377
|
+
this._translateTabComplete.pipe(distinctUntilChanged((x, y) => {
|
|
378
|
+
return x.fromState === y.fromState && x.toState === y.toState;
|
|
379
|
+
})).subscribe(event => {
|
|
380
|
+
// If the transition to the center is complete, emit an event.
|
|
381
|
+
if (this._isCenterPosition(event.toState) && this._isCenterPosition(this._position)) {
|
|
382
|
+
this._onCentered.emit();
|
|
400
383
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
this._dirChangeSubscription.unsubscribe();
|
|
404
|
-
this._translateTabComplete.complete();
|
|
405
|
-
}
|
|
406
|
-
_onTranslateTabStarted(event) {
|
|
407
|
-
const isCentering = this._isCenterPosition(event.toState);
|
|
408
|
-
this._beforeCentering.emit(isCentering);
|
|
409
|
-
if (isCentering) {
|
|
410
|
-
this._onCentering.emit(this._elementRef.nativeElement.clientHeight);
|
|
384
|
+
if (this._isCenterPosition(event.fromState) && !this._isCenterPosition(this._position)) {
|
|
385
|
+
this._afterLeavingCenter.emit();
|
|
411
386
|
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
/** The shifted index position of the tab body, where zero represents the active center tab. */
|
|
390
|
+
set position(position) {
|
|
391
|
+
this._positionIndex = position;
|
|
392
|
+
this._computePositionAnimationState();
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* After initialized, check if the content is centered and has an origin. If so, set the
|
|
396
|
+
* special position states that transition the tab from the left or right before centering.
|
|
397
|
+
*/
|
|
398
|
+
ngOnInit() {
|
|
399
|
+
if (this._position == 'center' && this.origin != null) {
|
|
400
|
+
this._position = this._computePositionFromOrigin(this.origin);
|
|
412
401
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
402
|
+
}
|
|
403
|
+
ngOnDestroy() {
|
|
404
|
+
this._dirChangeSubscription.unsubscribe();
|
|
405
|
+
this._translateTabComplete.complete();
|
|
406
|
+
}
|
|
407
|
+
_onTranslateTabStarted(event) {
|
|
408
|
+
const isCentering = this._isCenterPosition(event.toState);
|
|
409
|
+
this._beforeCentering.emit(isCentering);
|
|
410
|
+
if (isCentering) {
|
|
411
|
+
this._onCentering.emit(this._elementRef.nativeElement.clientHeight);
|
|
416
412
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
413
|
+
}
|
|
414
|
+
/** The text direction of the containing app. */
|
|
415
|
+
_getLayoutDirection() {
|
|
416
|
+
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
417
|
+
}
|
|
418
|
+
/** Whether the provided position state is considered center, regardless of origin. */
|
|
419
|
+
_isCenterPosition(position) {
|
|
420
|
+
return position == 'center' ||
|
|
421
|
+
position == 'left-origin-center' ||
|
|
422
|
+
position == 'right-origin-center';
|
|
423
|
+
}
|
|
424
|
+
/** Computes the position state that will be used for the tab-body animation trigger. */
|
|
425
|
+
_computePositionAnimationState(dir = this._getLayoutDirection()) {
|
|
426
|
+
if (this._positionIndex < 0) {
|
|
427
|
+
this._position = dir == 'ltr' ? 'left' : 'right';
|
|
422
428
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
if (this._positionIndex < 0) {
|
|
426
|
-
this._position = dir == 'ltr' ? 'left' : 'right';
|
|
427
|
-
}
|
|
428
|
-
else if (this._positionIndex > 0) {
|
|
429
|
-
this._position = dir == 'ltr' ? 'right' : 'left';
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
this._position = 'center';
|
|
433
|
-
}
|
|
429
|
+
else if (this._positionIndex > 0) {
|
|
430
|
+
this._position = dir == 'ltr' ? 'right' : 'left';
|
|
434
431
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
* tab is becoming visible immediately after creation.
|
|
438
|
-
*/
|
|
439
|
-
_computePositionFromOrigin(origin) {
|
|
440
|
-
const dir = this._getLayoutDirection();
|
|
441
|
-
if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {
|
|
442
|
-
return 'left-origin-center';
|
|
443
|
-
}
|
|
444
|
-
return 'right-origin-center';
|
|
432
|
+
else {
|
|
433
|
+
this._position = 'center';
|
|
445
434
|
}
|
|
446
435
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
436
|
+
/**
|
|
437
|
+
* Computes the position state based on the specified origin position. This is used if the
|
|
438
|
+
* tab is becoming visible immediately after creation.
|
|
439
|
+
*/
|
|
440
|
+
_computePositionFromOrigin(origin) {
|
|
441
|
+
const dir = this._getLayoutDirection();
|
|
442
|
+
if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {
|
|
443
|
+
return 'left-origin-center';
|
|
444
|
+
}
|
|
445
|
+
return 'right-origin-center';
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
_MatTabBodyBase.decorators = [
|
|
449
|
+
{ type: Directive }
|
|
450
|
+
];
|
|
451
|
+
_MatTabBodyBase.ctorParameters = () => [
|
|
452
|
+
{ type: ElementRef },
|
|
453
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
454
|
+
{ type: ChangeDetectorRef }
|
|
455
|
+
];
|
|
456
|
+
_MatTabBodyBase.propDecorators = {
|
|
457
|
+
_onCentering: [{ type: Output }],
|
|
458
|
+
_beforeCentering: [{ type: Output }],
|
|
459
|
+
_afterLeavingCenter: [{ type: Output }],
|
|
460
|
+
_onCentered: [{ type: Output }],
|
|
461
|
+
_content: [{ type: Input, args: ['content',] }],
|
|
462
|
+
origin: [{ type: Input }],
|
|
463
|
+
animationDuration: [{ type: Input }],
|
|
464
|
+
position: [{ type: Input }]
|
|
465
|
+
};
|
|
467
466
|
/**
|
|
468
467
|
* Wrapper for the contents of a tab.
|
|
469
468
|
* @docs-private
|
|
470
469
|
*/
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
super(elementRef, dir, changeDetectorRef);
|
|
475
|
-
}
|
|
470
|
+
class MatTabBody extends _MatTabBodyBase {
|
|
471
|
+
constructor(elementRef, dir, changeDetectorRef) {
|
|
472
|
+
super(elementRef, dir, changeDetectorRef);
|
|
476
473
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
})();
|
|
474
|
+
}
|
|
475
|
+
MatTabBody.decorators = [
|
|
476
|
+
{ type: Component, args: [{
|
|
477
|
+
selector: 'mat-tab-body',
|
|
478
|
+
template: "<div class=\"mat-tab-body-content\" #content\n [@translateTab]=\"{\n value: _position,\n params: {animationDuration: animationDuration}\n }\"\n (@translateTab.start)=\"_onTranslateTabStarted($event)\"\n (@translateTab.done)=\"_translateTabComplete.next($event)\">\n <ng-template matTabBodyHost></ng-template>\n</div>\n",
|
|
479
|
+
encapsulation: ViewEncapsulation.None,
|
|
480
|
+
// tslint:disable-next-line:validate-decorators
|
|
481
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
482
|
+
animations: [matTabsAnimations.translateTab],
|
|
483
|
+
host: {
|
|
484
|
+
'class': 'mat-tab-body',
|
|
485
|
+
},
|
|
486
|
+
styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}\n"]
|
|
487
|
+
},] }
|
|
488
|
+
];
|
|
489
|
+
MatTabBody.ctorParameters = () => [
|
|
490
|
+
{ type: ElementRef },
|
|
491
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
492
|
+
{ type: ChangeDetectorRef }
|
|
493
|
+
];
|
|
494
|
+
MatTabBody.propDecorators = {
|
|
495
|
+
_portalHost: [{ type: ViewChild, args: [PortalHostDirective,] }]
|
|
496
|
+
};
|
|
501
497
|
|
|
502
498
|
/**
|
|
503
499
|
* @license
|
|
@@ -533,298 +529,292 @@ const _MatTabGroupMixinBase = mixinColor(mixinDisableRipple(MatTabGroupMixinBase
|
|
|
533
529
|
* Base class with all of the `MatTabGroupBase` functionality.
|
|
534
530
|
* @docs-private
|
|
535
531
|
*/
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
532
|
+
class _MatTabGroupBase extends _MatTabGroupMixinBase {
|
|
533
|
+
constructor(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
|
|
534
|
+
super(elementRef);
|
|
535
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
536
|
+
this._animationMode = _animationMode;
|
|
537
|
+
/** All of the tabs that belong to the group. */
|
|
538
|
+
this._tabs = new QueryList();
|
|
539
|
+
/** The tab index that should be selected after the content has been checked. */
|
|
540
|
+
this._indexToSelect = 0;
|
|
541
|
+
/** Snapshot of the height of the tab body wrapper before another tab is activated. */
|
|
542
|
+
this._tabBodyWrapperHeight = 0;
|
|
543
|
+
/** Subscription to tabs being added/removed. */
|
|
544
|
+
this._tabsSubscription = Subscription.EMPTY;
|
|
545
|
+
/** Subscription to changes in the tab labels. */
|
|
546
|
+
this._tabLabelSubscription = Subscription.EMPTY;
|
|
547
|
+
this._dynamicHeight = false;
|
|
548
|
+
this._selectedIndex = null;
|
|
549
|
+
/** Position of the tab header. */
|
|
550
|
+
this.headerPosition = 'above';
|
|
551
|
+
/** Output to enable support for two-way binding on `[(selectedIndex)]` */
|
|
552
|
+
this.selectedIndexChange = new EventEmitter();
|
|
553
|
+
/** Event emitted when focus has changed within a tab group. */
|
|
554
|
+
this.focusChange = new EventEmitter();
|
|
555
|
+
/** Event emitted when the body animation has completed */
|
|
556
|
+
this.animationDone = new EventEmitter();
|
|
557
|
+
/** Event emitted when the tab selection has changed. */
|
|
558
|
+
this.selectedTabChange = new EventEmitter(true);
|
|
559
|
+
this._groupId = nextId++;
|
|
560
|
+
this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
|
|
561
|
+
defaultConfig.animationDuration : '500ms';
|
|
562
|
+
this.disablePagination = defaultConfig && defaultConfig.disablePagination != null ?
|
|
563
|
+
defaultConfig.disablePagination : false;
|
|
564
|
+
}
|
|
565
|
+
/** Whether the tab group should grow to the size of the active tab. */
|
|
566
|
+
get dynamicHeight() { return this._dynamicHeight; }
|
|
567
|
+
set dynamicHeight(value) { this._dynamicHeight = coerceBooleanProperty(value); }
|
|
568
|
+
/** The index of the active tab. */
|
|
569
|
+
get selectedIndex() { return this._selectedIndex; }
|
|
570
|
+
set selectedIndex(value) {
|
|
571
|
+
this._indexToSelect = coerceNumberProperty(value, null);
|
|
572
|
+
}
|
|
573
|
+
/** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
|
|
574
|
+
get animationDuration() { return this._animationDuration; }
|
|
575
|
+
set animationDuration(value) {
|
|
576
|
+
this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
|
|
577
|
+
}
|
|
578
|
+
/** Background color of the tab group. */
|
|
579
|
+
get backgroundColor() { return this._backgroundColor; }
|
|
580
|
+
set backgroundColor(value) {
|
|
581
|
+
const nativeElement = this._elementRef.nativeElement;
|
|
582
|
+
nativeElement.classList.remove(`mat-background-${this.backgroundColor}`);
|
|
583
|
+
if (value) {
|
|
584
|
+
nativeElement.classList.add(`mat-background-${value}`);
|
|
585
|
+
}
|
|
586
|
+
this._backgroundColor = value;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* After the content is checked, this component knows what tabs have been defined
|
|
590
|
+
* and what the selected index should be. This is where we can know exactly what position
|
|
591
|
+
* each tab should be in according to the new selected index, and additionally we know how
|
|
592
|
+
* a new selected tab should transition in (from the left or right).
|
|
593
|
+
*/
|
|
594
|
+
ngAfterContentChecked() {
|
|
595
|
+
// Don't clamp the `indexToSelect` immediately in the setter because it can happen that
|
|
596
|
+
// the amount of tabs changes before the actual change detection runs.
|
|
597
|
+
const indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
|
|
598
|
+
// If there is a change in selected index, emit a change event. Should not trigger if
|
|
599
|
+
// the selected index has not yet been initialized.
|
|
600
|
+
if (this._selectedIndex != indexToSelect) {
|
|
601
|
+
const isFirstRun = this._selectedIndex == null;
|
|
602
|
+
if (!isFirstRun) {
|
|
603
|
+
this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
|
|
590
604
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
* and what the selected index should be. This is where we can know exactly what position
|
|
596
|
-
* each tab should be in according to the new selected index, and additionally we know how
|
|
597
|
-
* a new selected tab should transition in (from the left or right).
|
|
598
|
-
*/
|
|
599
|
-
ngAfterContentChecked() {
|
|
600
|
-
// Don't clamp the `indexToSelect` immediately in the setter because it can happen that
|
|
601
|
-
// the amount of tabs changes before the actual change detection runs.
|
|
602
|
-
const indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
|
|
603
|
-
// If there is a change in selected index, emit a change event. Should not trigger if
|
|
604
|
-
// the selected index has not yet been initialized.
|
|
605
|
-
if (this._selectedIndex != indexToSelect) {
|
|
606
|
-
const isFirstRun = this._selectedIndex == null;
|
|
605
|
+
// Changing these values after change detection has run
|
|
606
|
+
// since the checked content may contain references to them.
|
|
607
|
+
Promise.resolve().then(() => {
|
|
608
|
+
this._tabs.forEach((tab, index) => tab.isActive = index === indexToSelect);
|
|
607
609
|
if (!isFirstRun) {
|
|
608
|
-
this.
|
|
609
|
-
}
|
|
610
|
-
// Changing these values after change detection has run
|
|
611
|
-
// since the checked content may contain references to them.
|
|
612
|
-
Promise.resolve().then(() => {
|
|
613
|
-
this._tabs.forEach((tab, index) => tab.isActive = index === indexToSelect);
|
|
614
|
-
if (!isFirstRun) {
|
|
615
|
-
this.selectedIndexChange.emit(indexToSelect);
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
// Setup the position for each tab and optionally setup an origin on the next selected tab.
|
|
620
|
-
this._tabs.forEach((tab, index) => {
|
|
621
|
-
tab.position = index - indexToSelect;
|
|
622
|
-
// If there is already a selected tab, then set up an origin for the next selected tab
|
|
623
|
-
// if it doesn't have one already.
|
|
624
|
-
if (this._selectedIndex != null && tab.position == 0 && !tab.origin) {
|
|
625
|
-
tab.origin = indexToSelect - this._selectedIndex;
|
|
610
|
+
this.selectedIndexChange.emit(indexToSelect);
|
|
626
611
|
}
|
|
627
612
|
});
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
613
|
+
}
|
|
614
|
+
// Setup the position for each tab and optionally setup an origin on the next selected tab.
|
|
615
|
+
this._tabs.forEach((tab, index) => {
|
|
616
|
+
tab.position = index - indexToSelect;
|
|
617
|
+
// If there is already a selected tab, then set up an origin for the next selected tab
|
|
618
|
+
// if it doesn't have one already.
|
|
619
|
+
if (this._selectedIndex != null && tab.position == 0 && !tab.origin) {
|
|
620
|
+
tab.origin = indexToSelect - this._selectedIndex;
|
|
631
621
|
}
|
|
622
|
+
});
|
|
623
|
+
if (this._selectedIndex !== indexToSelect) {
|
|
624
|
+
this._selectedIndex = indexToSelect;
|
|
625
|
+
this._changeDetectorRef.markForCheck();
|
|
632
626
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
627
|
+
}
|
|
628
|
+
ngAfterContentInit() {
|
|
629
|
+
this._subscribeToAllTabChanges();
|
|
630
|
+
this._subscribeToTabLabels();
|
|
631
|
+
// Subscribe to changes in the amount of tabs, in order to be
|
|
632
|
+
// able to re-render the content as new tabs are added or removed.
|
|
633
|
+
this._tabsSubscription = this._tabs.changes.subscribe(() => {
|
|
634
|
+
const indexToSelect = this._clampTabIndex(this._indexToSelect);
|
|
635
|
+
// Maintain the previously-selected tab if a new tab is added or removed and there is no
|
|
636
|
+
// explicit change that selects a different tab.
|
|
637
|
+
if (indexToSelect === this._selectedIndex) {
|
|
638
|
+
const tabs = this._tabs.toArray();
|
|
639
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
640
|
+
if (tabs[i].isActive) {
|
|
641
|
+
// Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
|
|
642
|
+
// event, otherwise the consumer may end up in an infinite loop in some edge cases like
|
|
643
|
+
// adding a tab within the `selectedIndexChange` event.
|
|
644
|
+
this._indexToSelect = this._selectedIndex = i;
|
|
645
|
+
break;
|
|
652
646
|
}
|
|
653
647
|
}
|
|
654
|
-
this._changeDetectorRef.markForCheck();
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
/** Listens to changes in all of the tabs. */
|
|
658
|
-
_subscribeToAllTabChanges() {
|
|
659
|
-
// Since we use a query with `descendants: true` to pick up the tabs, we may end up catching
|
|
660
|
-
// some that are inside of nested tab groups. We filter them out manually by checking that
|
|
661
|
-
// the closest group to the tab is the current one.
|
|
662
|
-
this._allTabs.changes
|
|
663
|
-
.pipe(startWith(this._allTabs))
|
|
664
|
-
.subscribe((tabs) => {
|
|
665
|
-
this._tabs.reset(tabs.filter(tab => {
|
|
666
|
-
// @breaking-change 10.0.0 Remove null check for `_closestTabGroup`
|
|
667
|
-
// once it becomes a required parameter in MatTab.
|
|
668
|
-
return !tab._closestTabGroup || tab._closestTabGroup === this;
|
|
669
|
-
}));
|
|
670
|
-
this._tabs.notifyOnChanges();
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
ngOnDestroy() {
|
|
674
|
-
this._tabs.destroy();
|
|
675
|
-
this._tabsSubscription.unsubscribe();
|
|
676
|
-
this._tabLabelSubscription.unsubscribe();
|
|
677
|
-
}
|
|
678
|
-
/** Re-aligns the ink bar to the selected tab element. */
|
|
679
|
-
realignInkBar() {
|
|
680
|
-
if (this._tabHeader) {
|
|
681
|
-
this._tabHeader._alignInkBarToSelectedTab();
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
_focusChanged(index) {
|
|
685
|
-
this.focusChange.emit(this._createChangeEvent(index));
|
|
686
|
-
}
|
|
687
|
-
_createChangeEvent(index) {
|
|
688
|
-
const event = new MatTabChangeEvent;
|
|
689
|
-
event.index = index;
|
|
690
|
-
if (this._tabs && this._tabs.length) {
|
|
691
|
-
event.tab = this._tabs.toArray()[index];
|
|
692
648
|
}
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
649
|
+
this._changeDetectorRef.markForCheck();
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
/** Listens to changes in all of the tabs. */
|
|
653
|
+
_subscribeToAllTabChanges() {
|
|
654
|
+
// Since we use a query with `descendants: true` to pick up the tabs, we may end up catching
|
|
655
|
+
// some that are inside of nested tab groups. We filter them out manually by checking that
|
|
656
|
+
// the closest group to the tab is the current one.
|
|
657
|
+
this._allTabs.changes
|
|
658
|
+
.pipe(startWith(this._allTabs))
|
|
659
|
+
.subscribe((tabs) => {
|
|
660
|
+
this._tabs.reset(tabs.filter(tab => {
|
|
661
|
+
// @breaking-change 10.0.0 Remove null check for `_closestTabGroup`
|
|
662
|
+
// once it becomes a required parameter in MatTab.
|
|
663
|
+
return !tab._closestTabGroup || tab._closestTabGroup === this;
|
|
664
|
+
}));
|
|
665
|
+
this._tabs.notifyOnChanges();
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
ngOnDestroy() {
|
|
669
|
+
this._tabs.destroy();
|
|
670
|
+
this._tabsSubscription.unsubscribe();
|
|
671
|
+
this._tabLabelSubscription.unsubscribe();
|
|
672
|
+
}
|
|
673
|
+
/** Re-aligns the ink bar to the selected tab element. */
|
|
674
|
+
realignInkBar() {
|
|
675
|
+
if (this._tabHeader) {
|
|
676
|
+
this._tabHeader._alignInkBarToSelectedTab();
|
|
718
677
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
678
|
+
}
|
|
679
|
+
_focusChanged(index) {
|
|
680
|
+
this.focusChange.emit(this._createChangeEvent(index));
|
|
681
|
+
}
|
|
682
|
+
_createChangeEvent(index) {
|
|
683
|
+
const event = new MatTabChangeEvent;
|
|
684
|
+
event.index = index;
|
|
685
|
+
if (this._tabs && this._tabs.length) {
|
|
686
|
+
event.tab = this._tabs.toArray()[index];
|
|
722
687
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
// the animation to the new height can have an origin.
|
|
735
|
-
if (this._tabBodyWrapper.nativeElement.offsetHeight) {
|
|
736
|
-
wrapper.style.height = tabHeight + 'px';
|
|
737
|
-
}
|
|
688
|
+
return event;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Subscribes to changes in the tab labels. This is needed, because the @Input for the label is
|
|
692
|
+
* on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
|
|
693
|
+
* binding to be updated, we need to subscribe to changes in it and trigger change detection
|
|
694
|
+
* manually.
|
|
695
|
+
*/
|
|
696
|
+
_subscribeToTabLabels() {
|
|
697
|
+
if (this._tabLabelSubscription) {
|
|
698
|
+
this._tabLabelSubscription.unsubscribe();
|
|
738
699
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
700
|
+
this._tabLabelSubscription = merge(...this._tabs.map(tab => tab._stateChanges))
|
|
701
|
+
.subscribe(() => this._changeDetectorRef.markForCheck());
|
|
702
|
+
}
|
|
703
|
+
/** Clamps the given index to the bounds of 0 and the tabs length. */
|
|
704
|
+
_clampTabIndex(index) {
|
|
705
|
+
// Note the `|| 0`, which ensures that values like NaN can't get through
|
|
706
|
+
// and which would otherwise throw the component into an infinite loop
|
|
707
|
+
// (since Math.max(NaN, 0) === NaN).
|
|
708
|
+
return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
|
|
709
|
+
}
|
|
710
|
+
/** Returns a unique id for each tab label element */
|
|
711
|
+
_getTabLabelId(i) {
|
|
712
|
+
return `mat-tab-label-${this._groupId}-${i}`;
|
|
713
|
+
}
|
|
714
|
+
/** Returns a unique id for each tab content element */
|
|
715
|
+
_getTabContentId(i) {
|
|
716
|
+
return `mat-tab-content-${this._groupId}-${i}`;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Sets the height of the body wrapper to the height of the activating tab if dynamic
|
|
720
|
+
* height property is true.
|
|
721
|
+
*/
|
|
722
|
+
_setTabBodyWrapperHeight(tabHeight) {
|
|
723
|
+
if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
const wrapper = this._tabBodyWrapper.nativeElement;
|
|
727
|
+
wrapper.style.height = this._tabBodyWrapperHeight + 'px';
|
|
728
|
+
// This conditional forces the browser to paint the height so that
|
|
729
|
+
// the animation to the new height can have an origin.
|
|
730
|
+
if (this._tabBodyWrapper.nativeElement.offsetHeight) {
|
|
731
|
+
wrapper.style.height = tabHeight + 'px';
|
|
745
732
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
733
|
+
}
|
|
734
|
+
/** Removes the height of the tab body wrapper. */
|
|
735
|
+
_removeTabBodyWrapperHeight() {
|
|
736
|
+
const wrapper = this._tabBodyWrapper.nativeElement;
|
|
737
|
+
this._tabBodyWrapperHeight = wrapper.clientHeight;
|
|
738
|
+
wrapper.style.height = '';
|
|
739
|
+
this.animationDone.emit();
|
|
740
|
+
}
|
|
741
|
+
/** Handle click events, setting new selected index if appropriate. */
|
|
742
|
+
_handleClick(tab, tabHeader, index) {
|
|
743
|
+
if (!tab.disabled) {
|
|
744
|
+
this.selectedIndex = tabHeader.focusIndex = index;
|
|
751
745
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
return this.selectedIndex === idx ? 0 : -1;
|
|
746
|
+
}
|
|
747
|
+
/** Retrieves the tabindex for the tab. */
|
|
748
|
+
_getTabIndex(tab, idx) {
|
|
749
|
+
if (tab.disabled) {
|
|
750
|
+
return null;
|
|
758
751
|
}
|
|
752
|
+
return this.selectedIndex === idx ? 0 : -1;
|
|
759
753
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
]
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
})();
|
|
754
|
+
}
|
|
755
|
+
_MatTabGroupBase.decorators = [
|
|
756
|
+
{ type: Directive }
|
|
757
|
+
];
|
|
758
|
+
_MatTabGroupBase.ctorParameters = () => [
|
|
759
|
+
{ type: ElementRef },
|
|
760
|
+
{ type: ChangeDetectorRef },
|
|
761
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
|
|
762
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
763
|
+
];
|
|
764
|
+
_MatTabGroupBase.propDecorators = {
|
|
765
|
+
dynamicHeight: [{ type: Input }],
|
|
766
|
+
selectedIndex: [{ type: Input }],
|
|
767
|
+
headerPosition: [{ type: Input }],
|
|
768
|
+
animationDuration: [{ type: Input }],
|
|
769
|
+
disablePagination: [{ type: Input }],
|
|
770
|
+
backgroundColor: [{ type: Input }],
|
|
771
|
+
selectedIndexChange: [{ type: Output }],
|
|
772
|
+
focusChange: [{ type: Output }],
|
|
773
|
+
animationDone: [{ type: Output }],
|
|
774
|
+
selectedTabChange: [{ type: Output }]
|
|
775
|
+
};
|
|
783
776
|
/**
|
|
784
777
|
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
|
|
785
778
|
* animated ink-bar, keyboard navigation, and screen reader.
|
|
786
779
|
* See: https://material.io/design/components/tabs.html
|
|
787
780
|
*/
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
super(elementRef, changeDetectorRef, defaultConfig, animationMode);
|
|
792
|
-
}
|
|
781
|
+
class MatTabGroup extends _MatTabGroupBase {
|
|
782
|
+
constructor(elementRef, changeDetectorRef, defaultConfig, animationMode) {
|
|
783
|
+
super(elementRef, changeDetectorRef, defaultConfig, animationMode);
|
|
793
784
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
]
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
})();
|
|
785
|
+
}
|
|
786
|
+
MatTabGroup.decorators = [
|
|
787
|
+
{ type: Component, args: [{
|
|
788
|
+
selector: 'mat-tab-group',
|
|
789
|
+
exportAs: 'matTabGroup',
|
|
790
|
+
template: "<mat-tab-header #tabHeader\n [selectedIndex]=\"selectedIndex || 0\"\n [disableRipple]=\"disableRipple\"\n [disablePagination]=\"disablePagination\"\n (indexFocused)=\"_focusChanged($event)\"\n (selectFocusedIndex)=\"selectedIndex = $event\">\n <div class=\"mat-tab-label mat-focus-indicator\" role=\"tab\" matTabLabelWrapper mat-ripple cdkMonitorElementFocus\n *ngFor=\"let tab of _tabs; let i = index\"\n [id]=\"_getTabLabelId(i)\"\n [attr.tabIndex]=\"_getTabIndex(tab, i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"_tabs.length\"\n [attr.aria-controls]=\"_getTabContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"tab.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\"\n [class.mat-tab-label-active]=\"selectedIndex == i\"\n [disabled]=\"tab.disabled\"\n [matRippleDisabled]=\"tab.disabled || disableRipple\"\n (click)=\"_handleClick(tab, tabHeader, i)\">\n\n\n <div class=\"mat-tab-label-content\">\n <!-- If there is a label template, use it. -->\n <ng-template [ngIf]=\"tab.templateLabel\">\n <ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template>\n </ng-template>\n\n <!-- If there is not a label template, fall back to the text label. -->\n <ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template>\n </div>\n </div>\n</mat-tab-header>\n\n<div\n class=\"mat-tab-body-wrapper\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabBodyWrapper>\n <mat-tab-body role=\"tabpanel\"\n *ngFor=\"let tab of _tabs; let i = index\"\n [id]=\"_getTabContentId(i)\"\n [attr.aria-labelledby]=\"_getTabLabelId(i)\"\n [class.mat-tab-body-active]=\"selectedIndex == i\"\n [content]=\"tab.content!\"\n [position]=\"tab.position!\"\n [origin]=\"tab.origin\"\n [animationDuration]=\"animationDuration\"\n (_onCentered)=\"_removeTabBodyWrapperHeight()\"\n (_onCentering)=\"_setTabBodyWrapperHeight($event)\">\n </mat-tab-body>\n</div>\n",
|
|
791
|
+
encapsulation: ViewEncapsulation.None,
|
|
792
|
+
// tslint:disable-next-line:validate-decorators
|
|
793
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
794
|
+
inputs: ['color', 'disableRipple'],
|
|
795
|
+
providers: [{
|
|
796
|
+
provide: MAT_TAB_GROUP,
|
|
797
|
+
useExisting: MatTabGroup
|
|
798
|
+
}],
|
|
799
|
+
host: {
|
|
800
|
+
'class': 'mat-tab-group',
|
|
801
|
+
'[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
|
|
802
|
+
'[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
|
|
803
|
+
},
|
|
804
|
+
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:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-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}.cdk-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 500ms cubic-bezier(0.35, 0, 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}\n"]
|
|
805
|
+
},] }
|
|
806
|
+
];
|
|
807
|
+
MatTabGroup.ctorParameters = () => [
|
|
808
|
+
{ type: ElementRef },
|
|
809
|
+
{ type: ChangeDetectorRef },
|
|
810
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
|
|
811
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
812
|
+
];
|
|
813
|
+
MatTabGroup.propDecorators = {
|
|
814
|
+
_allTabs: [{ type: ContentChildren, args: [MatTab, { descendants: true },] }],
|
|
815
|
+
_tabBodyWrapper: [{ type: ViewChild, args: ['tabBodyWrapper',] }],
|
|
816
|
+
_tabHeader: [{ type: ViewChild, args: ['tabHeader',] }]
|
|
817
|
+
};
|
|
828
818
|
|
|
829
819
|
/**
|
|
830
820
|
* @license
|
|
@@ -842,38 +832,35 @@ const _MatTabLabelWrapperMixinBase = mixinDisabled(MatTabLabelWrapperBase);
|
|
|
842
832
|
* Used in the `mat-tab-group` view to display tab labels.
|
|
843
833
|
* @docs-private
|
|
844
834
|
*/
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
this.elementRef = elementRef;
|
|
850
|
-
}
|
|
851
|
-
/** Sets focus on the wrapper element */
|
|
852
|
-
focus() {
|
|
853
|
-
this.elementRef.nativeElement.focus();
|
|
854
|
-
}
|
|
855
|
-
getOffsetLeft() {
|
|
856
|
-
return this.elementRef.nativeElement.offsetLeft;
|
|
857
|
-
}
|
|
858
|
-
getOffsetWidth() {
|
|
859
|
-
return this.elementRef.nativeElement.offsetWidth;
|
|
860
|
-
}
|
|
835
|
+
class MatTabLabelWrapper extends _MatTabLabelWrapperMixinBase {
|
|
836
|
+
constructor(elementRef) {
|
|
837
|
+
super();
|
|
838
|
+
this.elementRef = elementRef;
|
|
861
839
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
840
|
+
/** Sets focus on the wrapper element */
|
|
841
|
+
focus() {
|
|
842
|
+
this.elementRef.nativeElement.focus();
|
|
843
|
+
}
|
|
844
|
+
getOffsetLeft() {
|
|
845
|
+
return this.elementRef.nativeElement.offsetLeft;
|
|
846
|
+
}
|
|
847
|
+
getOffsetWidth() {
|
|
848
|
+
return this.elementRef.nativeElement.offsetWidth;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
MatTabLabelWrapper.decorators = [
|
|
852
|
+
{ type: Directive, args: [{
|
|
853
|
+
selector: '[matTabLabelWrapper]',
|
|
854
|
+
inputs: ['disabled'],
|
|
855
|
+
host: {
|
|
856
|
+
'[class.mat-tab-disabled]': 'disabled',
|
|
857
|
+
'[attr.aria-disabled]': '!!disabled',
|
|
858
|
+
}
|
|
859
|
+
},] }
|
|
860
|
+
];
|
|
861
|
+
MatTabLabelWrapper.ctorParameters = () => [
|
|
862
|
+
{ type: ElementRef }
|
|
863
|
+
];
|
|
877
864
|
|
|
878
865
|
/**
|
|
879
866
|
* @license
|
|
@@ -903,459 +890,456 @@ const HEADER_SCROLL_INTERVAL = 100;
|
|
|
903
890
|
* Base class for a tab header that supported pagination.
|
|
904
891
|
* @docs-private
|
|
905
892
|
*/
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
893
|
+
class MatPaginatedTabHeader {
|
|
894
|
+
constructor(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone,
|
|
895
|
+
/**
|
|
896
|
+
* @deprecated @breaking-change 9.0.0 `_platform` and `_animationMode`
|
|
897
|
+
* parameters to become required.
|
|
898
|
+
*/
|
|
899
|
+
_platform, _animationMode) {
|
|
900
|
+
this._elementRef = _elementRef;
|
|
901
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
902
|
+
this._viewportRuler = _viewportRuler;
|
|
903
|
+
this._dir = _dir;
|
|
904
|
+
this._ngZone = _ngZone;
|
|
905
|
+
this._platform = _platform;
|
|
906
|
+
this._animationMode = _animationMode;
|
|
907
|
+
/** The distance in pixels that the tab labels should be translated to the left. */
|
|
908
|
+
this._scrollDistance = 0;
|
|
909
|
+
/** Whether the header should scroll to the selected index after the view has been checked. */
|
|
910
|
+
this._selectedIndexChanged = false;
|
|
911
|
+
/** Emits when the component is destroyed. */
|
|
912
|
+
this._destroyed = new Subject();
|
|
913
|
+
/** Whether the controls for pagination should be displayed */
|
|
914
|
+
this._showPaginationControls = false;
|
|
915
|
+
/** Whether the tab list can be scrolled more towards the end of the tab label list. */
|
|
916
|
+
this._disableScrollAfter = true;
|
|
917
|
+
/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
|
|
918
|
+
this._disableScrollBefore = true;
|
|
919
|
+
/** Stream that will stop the automated scrolling. */
|
|
920
|
+
this._stopScrolling = new Subject();
|
|
909
921
|
/**
|
|
910
|
-
*
|
|
911
|
-
*
|
|
922
|
+
* Whether pagination should be disabled. This can be used to avoid unnecessary
|
|
923
|
+
* layout recalculations if it's known that pagination won't be required.
|
|
912
924
|
*/
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
this._scrollDistance = 0;
|
|
923
|
-
/** Whether the header should scroll to the selected index after the view has been checked. */
|
|
924
|
-
this._selectedIndexChanged = false;
|
|
925
|
-
/** Emits when the component is destroyed. */
|
|
926
|
-
this._destroyed = new Subject();
|
|
927
|
-
/** Whether the controls for pagination should be displayed */
|
|
928
|
-
this._showPaginationControls = false;
|
|
929
|
-
/** Whether the tab list can be scrolled more towards the end of the tab label list. */
|
|
930
|
-
this._disableScrollAfter = true;
|
|
931
|
-
/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
|
|
932
|
-
this._disableScrollBefore = true;
|
|
933
|
-
/** Stream that will stop the automated scrolling. */
|
|
934
|
-
this._stopScrolling = new Subject();
|
|
935
|
-
/**
|
|
936
|
-
* Whether pagination should be disabled. This can be used to avoid unnecessary
|
|
937
|
-
* layout recalculations if it's known that pagination won't be required.
|
|
938
|
-
*/
|
|
939
|
-
this.disablePagination = false;
|
|
940
|
-
this._selectedIndex = 0;
|
|
941
|
-
/** Event emitted when the option is selected. */
|
|
942
|
-
this.selectFocusedIndex = new EventEmitter();
|
|
943
|
-
/** Event emitted when a label is focused. */
|
|
944
|
-
this.indexFocused = new EventEmitter();
|
|
945
|
-
// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
|
|
946
|
-
_ngZone.runOutsideAngular(() => {
|
|
947
|
-
fromEvent(_elementRef.nativeElement, 'mouseleave')
|
|
948
|
-
.pipe(takeUntil(this._destroyed))
|
|
949
|
-
.subscribe(() => {
|
|
950
|
-
this._stopInterval();
|
|
951
|
-
});
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
/** The index of the active tab. */
|
|
955
|
-
get selectedIndex() { return this._selectedIndex; }
|
|
956
|
-
set selectedIndex(value) {
|
|
957
|
-
value = coerceNumberProperty(value);
|
|
958
|
-
if (this._selectedIndex != value) {
|
|
959
|
-
this._selectedIndexChanged = true;
|
|
960
|
-
this._selectedIndex = value;
|
|
961
|
-
if (this._keyManager) {
|
|
962
|
-
this._keyManager.updateActiveItem(value);
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
ngAfterViewInit() {
|
|
967
|
-
// We need to handle these events manually, because we want to bind passive event listeners.
|
|
968
|
-
fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
925
|
+
this.disablePagination = false;
|
|
926
|
+
this._selectedIndex = 0;
|
|
927
|
+
/** Event emitted when the option is selected. */
|
|
928
|
+
this.selectFocusedIndex = new EventEmitter();
|
|
929
|
+
/** Event emitted when a label is focused. */
|
|
930
|
+
this.indexFocused = new EventEmitter();
|
|
931
|
+
// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
|
|
932
|
+
_ngZone.runOutsideAngular(() => {
|
|
933
|
+
fromEvent(_elementRef.nativeElement, 'mouseleave')
|
|
969
934
|
.pipe(takeUntil(this._destroyed))
|
|
970
935
|
.subscribe(() => {
|
|
971
|
-
this.
|
|
972
|
-
});
|
|
973
|
-
fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
974
|
-
.pipe(takeUntil(this._destroyed))
|
|
975
|
-
.subscribe(() => {
|
|
976
|
-
this._handlePaginatorPress('after');
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
ngAfterContentInit() {
|
|
980
|
-
const dirChange = this._dir ? this._dir.change : of(null);
|
|
981
|
-
const resize = this._viewportRuler.change(150);
|
|
982
|
-
const realign = () => {
|
|
983
|
-
this.updatePagination();
|
|
984
|
-
this._alignInkBarToSelectedTab();
|
|
985
|
-
};
|
|
986
|
-
this._keyManager = new FocusKeyManager(this._items)
|
|
987
|
-
.withHorizontalOrientation(this._getLayoutDirection())
|
|
988
|
-
.withWrap();
|
|
989
|
-
this._keyManager.updateActiveItem(0);
|
|
990
|
-
// Defer the first call in order to allow for slower browsers to lay out the elements.
|
|
991
|
-
// This helps in cases where the user lands directly on a page with paginated tabs.
|
|
992
|
-
typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
|
|
993
|
-
// On dir change or window resize, realign the ink bar and update the orientation of
|
|
994
|
-
// the key manager if the direction has changed.
|
|
995
|
-
merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
996
|
-
// We need to defer this to give the browser some time to recalculate the element dimensions.
|
|
997
|
-
Promise.resolve().then(realign);
|
|
998
|
-
this._keyManager.withHorizontalOrientation(this._getLayoutDirection());
|
|
936
|
+
this._stopInterval();
|
|
999
937
|
});
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
this.updatePagination();
|
|
1012
|
-
this._tabLabelCount = this._items.length;
|
|
1013
|
-
this._changeDetectorRef.markForCheck();
|
|
1014
|
-
}
|
|
1015
|
-
// If the selected index has changed, scroll to the label and check if the scrolling controls
|
|
1016
|
-
// should be disabled.
|
|
1017
|
-
if (this._selectedIndexChanged) {
|
|
1018
|
-
this._scrollToLabel(this._selectedIndex);
|
|
1019
|
-
this._checkScrollingControls();
|
|
1020
|
-
this._alignInkBarToSelectedTab();
|
|
1021
|
-
this._selectedIndexChanged = false;
|
|
1022
|
-
this._changeDetectorRef.markForCheck();
|
|
1023
|
-
}
|
|
1024
|
-
// If the scroll distance has been changed (tab selected, focused, scroll controls activated),
|
|
1025
|
-
// then translate the header to reflect this.
|
|
1026
|
-
if (this._scrollDistanceChanged) {
|
|
1027
|
-
this._updateTabScrollPosition();
|
|
1028
|
-
this._scrollDistanceChanged = false;
|
|
1029
|
-
this._changeDetectorRef.markForCheck();
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
ngOnDestroy() {
|
|
1033
|
-
this._destroyed.next();
|
|
1034
|
-
this._destroyed.complete();
|
|
1035
|
-
this._stopScrolling.complete();
|
|
1036
|
-
}
|
|
1037
|
-
/** Handles keyboard events on the header. */
|
|
1038
|
-
_handleKeydown(event) {
|
|
1039
|
-
// We don't handle any key bindings with a modifier key.
|
|
1040
|
-
if (hasModifierKey(event)) {
|
|
1041
|
-
return;
|
|
1042
|
-
}
|
|
1043
|
-
switch (event.keyCode) {
|
|
1044
|
-
case HOME:
|
|
1045
|
-
this._keyManager.setFirstItemActive();
|
|
1046
|
-
event.preventDefault();
|
|
1047
|
-
break;
|
|
1048
|
-
case END:
|
|
1049
|
-
this._keyManager.setLastItemActive();
|
|
1050
|
-
event.preventDefault();
|
|
1051
|
-
break;
|
|
1052
|
-
case ENTER:
|
|
1053
|
-
case SPACE:
|
|
1054
|
-
if (this.focusIndex !== this.selectedIndex) {
|
|
1055
|
-
this.selectFocusedIndex.emit(this.focusIndex);
|
|
1056
|
-
this._itemSelected(event);
|
|
1057
|
-
}
|
|
1058
|
-
break;
|
|
1059
|
-
default:
|
|
1060
|
-
this._keyManager.onKeydown(event);
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Callback for when the MutationObserver detects that the content has changed.
|
|
1065
|
-
*/
|
|
1066
|
-
_onContentChanges() {
|
|
1067
|
-
const textContent = this._elementRef.nativeElement.textContent;
|
|
1068
|
-
// We need to diff the text content of the header, because the MutationObserver callback
|
|
1069
|
-
// will fire even if the text content didn't change which is inefficient and is prone
|
|
1070
|
-
// to infinite loops if a poorly constructed expression is passed in (see #14249).
|
|
1071
|
-
if (textContent !== this._currentTextContent) {
|
|
1072
|
-
this._currentTextContent = textContent || '';
|
|
1073
|
-
// The content observer runs outside the `NgZone` by default, which
|
|
1074
|
-
// means that we need to bring the callback back in ourselves.
|
|
1075
|
-
this._ngZone.run(() => {
|
|
1076
|
-
this.updatePagination();
|
|
1077
|
-
this._alignInkBarToSelectedTab();
|
|
1078
|
-
this._changeDetectorRef.markForCheck();
|
|
1079
|
-
});
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
/** The index of the active tab. */
|
|
941
|
+
get selectedIndex() { return this._selectedIndex; }
|
|
942
|
+
set selectedIndex(value) {
|
|
943
|
+
value = coerceNumberProperty(value);
|
|
944
|
+
if (this._selectedIndex != value) {
|
|
945
|
+
this._selectedIndexChanged = true;
|
|
946
|
+
this._selectedIndex = value;
|
|
947
|
+
if (this._keyManager) {
|
|
948
|
+
this._keyManager.updateActiveItem(value);
|
|
1080
949
|
}
|
|
1081
950
|
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
951
|
+
}
|
|
952
|
+
ngAfterViewInit() {
|
|
953
|
+
// We need to handle these events manually, because we want to bind passive event listeners.
|
|
954
|
+
fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
955
|
+
.pipe(takeUntil(this._destroyed))
|
|
956
|
+
.subscribe(() => {
|
|
957
|
+
this._handlePaginatorPress('before');
|
|
958
|
+
});
|
|
959
|
+
fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
960
|
+
.pipe(takeUntil(this._destroyed))
|
|
961
|
+
.subscribe(() => {
|
|
962
|
+
this._handlePaginatorPress('after');
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
ngAfterContentInit() {
|
|
966
|
+
const dirChange = this._dir ? this._dir.change : of(null);
|
|
967
|
+
const resize = this._viewportRuler.change(150);
|
|
968
|
+
const realign = () => {
|
|
969
|
+
this.updatePagination();
|
|
970
|
+
this._alignInkBarToSelectedTab();
|
|
971
|
+
};
|
|
972
|
+
this._keyManager = new FocusKeyManager(this._items)
|
|
973
|
+
.withHorizontalOrientation(this._getLayoutDirection())
|
|
974
|
+
.withWrap();
|
|
975
|
+
this._keyManager.updateActiveItem(0);
|
|
976
|
+
// Defer the first call in order to allow for slower browsers to lay out the elements.
|
|
977
|
+
// This helps in cases where the user lands directly on a page with paginated tabs.
|
|
978
|
+
typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
|
|
979
|
+
// On dir change or window resize, realign the ink bar and update the orientation of
|
|
980
|
+
// the key manager if the direction has changed.
|
|
981
|
+
merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
982
|
+
// We need to defer this to give the browser some time to recalculate the element dimensions.
|
|
983
|
+
Promise.resolve().then(realign);
|
|
984
|
+
this._keyManager.withHorizontalOrientation(this._getLayoutDirection());
|
|
985
|
+
});
|
|
986
|
+
// If there is a change in the focus key manager we need to emit the `indexFocused`
|
|
987
|
+
// event in order to provide a public event that notifies about focus changes. Also we realign
|
|
988
|
+
// the tabs container by scrolling the new focused tab into the visible section.
|
|
989
|
+
this._keyManager.change.pipe(takeUntil(this._destroyed)).subscribe(newFocusIndex => {
|
|
990
|
+
this.indexFocused.emit(newFocusIndex);
|
|
991
|
+
this._setTabFocus(newFocusIndex);
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
ngAfterContentChecked() {
|
|
995
|
+
// If the number of tab labels have changed, check if scrolling should be enabled
|
|
996
|
+
if (this._tabLabelCount != this._items.length) {
|
|
997
|
+
this.updatePagination();
|
|
998
|
+
this._tabLabelCount = this._items.length;
|
|
999
|
+
this._changeDetectorRef.markForCheck();
|
|
1000
|
+
}
|
|
1001
|
+
// If the selected index has changed, scroll to the label and check if the scrolling controls
|
|
1002
|
+
// should be disabled.
|
|
1003
|
+
if (this._selectedIndexChanged) {
|
|
1004
|
+
this._scrollToLabel(this._selectedIndex);
|
|
1091
1005
|
this._checkScrollingControls();
|
|
1092
|
-
this.
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
get focusIndex() {
|
|
1096
|
-
return this._keyManager ? this._keyManager.activeItemIndex : 0;
|
|
1097
|
-
}
|
|
1098
|
-
/** When the focus index is set, we must manually send focus to the correct label */
|
|
1099
|
-
set focusIndex(value) {
|
|
1100
|
-
if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
this._keyManager.setActiveItem(value);
|
|
1006
|
+
this._alignInkBarToSelectedTab();
|
|
1007
|
+
this._selectedIndexChanged = false;
|
|
1008
|
+
this._changeDetectorRef.markForCheck();
|
|
1104
1009
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
return true;
|
|
1112
|
-
}
|
|
1113
|
-
const tab = this._items ? this._items.toArray()[index] : null;
|
|
1114
|
-
return !!tab && !tab.disabled;
|
|
1010
|
+
// If the scroll distance has been changed (tab selected, focused, scroll controls activated),
|
|
1011
|
+
// then translate the header to reflect this.
|
|
1012
|
+
if (this._scrollDistanceChanged) {
|
|
1013
|
+
this._updateTabScrollPosition();
|
|
1014
|
+
this._scrollDistanceChanged = false;
|
|
1015
|
+
this._changeDetectorRef.markForCheck();
|
|
1115
1016
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1017
|
+
}
|
|
1018
|
+
ngOnDestroy() {
|
|
1019
|
+
this._destroyed.next();
|
|
1020
|
+
this._destroyed.complete();
|
|
1021
|
+
this._stopScrolling.complete();
|
|
1022
|
+
}
|
|
1023
|
+
/** Handles keyboard events on the header. */
|
|
1024
|
+
_handleKeydown(event) {
|
|
1025
|
+
// We don't handle any key bindings with a modifier key.
|
|
1026
|
+
if (hasModifierKey(event)) {
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
switch (event.keyCode) {
|
|
1030
|
+
case HOME:
|
|
1031
|
+
this._keyManager.setFirstItemActive();
|
|
1032
|
+
event.preventDefault();
|
|
1033
|
+
break;
|
|
1034
|
+
case END:
|
|
1035
|
+
this._keyManager.setLastItemActive();
|
|
1036
|
+
event.preventDefault();
|
|
1037
|
+
break;
|
|
1038
|
+
case ENTER:
|
|
1039
|
+
case SPACE:
|
|
1040
|
+
if (this.focusIndex !== this.selectedIndex) {
|
|
1041
|
+
this.selectFocusedIndex.emit(this.focusIndex);
|
|
1042
|
+
this._itemSelected(event);
|
|
1136
1043
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
_getLayoutDirection() {
|
|
1141
|
-
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
1142
|
-
}
|
|
1143
|
-
/** Performs the CSS transformation on the tab list that will cause the list to scroll. */
|
|
1144
|
-
_updateTabScrollPosition() {
|
|
1145
|
-
if (this.disablePagination) {
|
|
1146
|
-
return;
|
|
1147
|
-
}
|
|
1148
|
-
const scrollDistance = this.scrollDistance;
|
|
1149
|
-
const platform = this._platform;
|
|
1150
|
-
const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
|
|
1151
|
-
// Don't use `translate3d` here because we don't want to create a new layer. A new layer
|
|
1152
|
-
// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
|
|
1153
|
-
// and ripples will exceed the boundaries of the visible tab bar.
|
|
1154
|
-
// See: https://github.com/angular/components/issues/10276
|
|
1155
|
-
// We round the `transform` here, because transforms with sub-pixel precision cause some
|
|
1156
|
-
// browsers to blur the content of the element.
|
|
1157
|
-
this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
|
|
1158
|
-
// Setting the `transform` on IE will change the scroll offset of the parent, causing the
|
|
1159
|
-
// position to be thrown off in some cases. We have to reset it ourselves to ensure that
|
|
1160
|
-
// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
|
|
1161
|
-
// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
|
|
1162
|
-
// @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
|
|
1163
|
-
if (platform && (platform.TRIDENT || platform.EDGE)) {
|
|
1164
|
-
this._tabListContainer.nativeElement.scrollLeft = 0;
|
|
1165
|
-
}
|
|
1044
|
+
break;
|
|
1045
|
+
default:
|
|
1046
|
+
this._keyManager.onKeydown(event);
|
|
1166
1047
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Callback for when the MutationObserver detects that the content has changed.
|
|
1051
|
+
*/
|
|
1052
|
+
_onContentChanges() {
|
|
1053
|
+
const textContent = this._elementRef.nativeElement.textContent;
|
|
1054
|
+
// We need to diff the text content of the header, because the MutationObserver callback
|
|
1055
|
+
// will fire even if the text content didn't change which is inefficient and is prone
|
|
1056
|
+
// to infinite loops if a poorly constructed expression is passed in (see #14249).
|
|
1057
|
+
if (textContent !== this._currentTextContent) {
|
|
1058
|
+
this._currentTextContent = textContent || '';
|
|
1059
|
+
// The content observer runs outside the `NgZone` by default, which
|
|
1060
|
+
// means that we need to bring the callback back in ourselves.
|
|
1061
|
+
this._ngZone.run(() => {
|
|
1062
|
+
this.updatePagination();
|
|
1063
|
+
this._alignInkBarToSelectedTab();
|
|
1064
|
+
this._changeDetectorRef.markForCheck();
|
|
1065
|
+
});
|
|
1185
1066
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Updates the view whether pagination should be enabled or not.
|
|
1070
|
+
*
|
|
1071
|
+
* WARNING: Calling this method can be very costly in terms of performance. It should be called
|
|
1072
|
+
* as infrequently as possible from outside of the Tabs component as it causes a reflow of the
|
|
1073
|
+
* page.
|
|
1074
|
+
*/
|
|
1075
|
+
updatePagination() {
|
|
1076
|
+
this._checkPaginationEnabled();
|
|
1077
|
+
this._checkScrollingControls();
|
|
1078
|
+
this._updateTabScrollPosition();
|
|
1079
|
+
}
|
|
1080
|
+
/** Tracks which element has focus; used for keyboard navigation */
|
|
1081
|
+
get focusIndex() {
|
|
1082
|
+
return this._keyManager ? this._keyManager.activeItemIndex : 0;
|
|
1083
|
+
}
|
|
1084
|
+
/** When the focus index is set, we must manually send focus to the correct label */
|
|
1085
|
+
set focusIndex(value) {
|
|
1086
|
+
if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
|
|
1087
|
+
return;
|
|
1190
1088
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1089
|
+
this._keyManager.setActiveItem(value);
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
|
|
1093
|
+
* providing a valid index and return true.
|
|
1094
|
+
*/
|
|
1095
|
+
_isValidIndex(index) {
|
|
1096
|
+
if (!this._items) {
|
|
1097
|
+
return true;
|
|
1098
|
+
}
|
|
1099
|
+
const tab = this._items ? this._items.toArray()[index] : null;
|
|
1100
|
+
return !!tab && !tab.disabled;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
|
|
1104
|
+
* scrolling is enabled.
|
|
1105
|
+
*/
|
|
1106
|
+
_setTabFocus(tabIndex) {
|
|
1107
|
+
if (this._showPaginationControls) {
|
|
1108
|
+
this._scrollToLabel(tabIndex);
|
|
1109
|
+
}
|
|
1110
|
+
if (this._items && this._items.length) {
|
|
1111
|
+
this._items.toArray()[tabIndex].focus();
|
|
1112
|
+
// Do not let the browser manage scrolling to focus the element, this will be handled
|
|
1113
|
+
// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
|
|
1114
|
+
// should be the full width minus the offset width.
|
|
1115
|
+
const containerEl = this._tabListContainer.nativeElement;
|
|
1116
|
+
const dir = this._getLayoutDirection();
|
|
1117
|
+
if (dir == 'ltr') {
|
|
1118
|
+
containerEl.scrollLeft = 0;
|
|
1212
1119
|
}
|
|
1213
1120
|
else {
|
|
1214
|
-
|
|
1215
|
-
labelBeforePos = labelAfterPos - offsetWidth;
|
|
1216
|
-
}
|
|
1217
|
-
const beforeVisiblePos = this.scrollDistance;
|
|
1218
|
-
const afterVisiblePos = this.scrollDistance + viewLength;
|
|
1219
|
-
if (labelBeforePos < beforeVisiblePos) {
|
|
1220
|
-
// Scroll header to move label to the before direction
|
|
1221
|
-
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
|
|
1222
|
-
}
|
|
1223
|
-
else if (labelAfterPos > afterVisiblePos) {
|
|
1224
|
-
// Scroll header to move label to the after direction
|
|
1225
|
-
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
|
|
1121
|
+
containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
|
|
1226
1122
|
}
|
|
1227
1123
|
}
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1124
|
+
}
|
|
1125
|
+
/** The layout direction of the containing app. */
|
|
1126
|
+
_getLayoutDirection() {
|
|
1127
|
+
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
1128
|
+
}
|
|
1129
|
+
/** Performs the CSS transformation on the tab list that will cause the list to scroll. */
|
|
1130
|
+
_updateTabScrollPosition() {
|
|
1131
|
+
if (this.disablePagination) {
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
const scrollDistance = this.scrollDistance;
|
|
1135
|
+
const platform = this._platform;
|
|
1136
|
+
const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
|
|
1137
|
+
// Don't use `translate3d` here because we don't want to create a new layer. A new layer
|
|
1138
|
+
// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
|
|
1139
|
+
// and ripples will exceed the boundaries of the visible tab bar.
|
|
1140
|
+
// See: https://github.com/angular/components/issues/10276
|
|
1141
|
+
// We round the `transform` here, because transforms with sub-pixel precision cause some
|
|
1142
|
+
// browsers to blur the content of the element.
|
|
1143
|
+
this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
|
|
1144
|
+
// Setting the `transform` on IE will change the scroll offset of the parent, causing the
|
|
1145
|
+
// position to be thrown off in some cases. We have to reset it ourselves to ensure that
|
|
1146
|
+
// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
|
|
1147
|
+
// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
|
|
1148
|
+
// @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
|
|
1149
|
+
if (platform && (platform.TRIDENT || platform.EDGE)) {
|
|
1150
|
+
this._tabListContainer.nativeElement.scrollLeft = 0;
|
|
1250
1151
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1152
|
+
}
|
|
1153
|
+
/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
|
|
1154
|
+
get scrollDistance() { return this._scrollDistance; }
|
|
1155
|
+
set scrollDistance(value) {
|
|
1156
|
+
this._scrollTo(value);
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
|
|
1160
|
+
* the end of the list, respectively). The distance to scroll is computed to be a third of the
|
|
1161
|
+
* length of the tab list view window.
|
|
1162
|
+
*
|
|
1163
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1164
|
+
* should be called sparingly.
|
|
1165
|
+
*/
|
|
1166
|
+
_scrollHeader(direction) {
|
|
1167
|
+
const viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1168
|
+
// Move the scroll distance one-third the length of the tab list's viewport.
|
|
1169
|
+
const scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
|
|
1170
|
+
return this._scrollTo(this._scrollDistance + scrollAmount);
|
|
1171
|
+
}
|
|
1172
|
+
/** Handles click events on the pagination arrows. */
|
|
1173
|
+
_handlePaginatorClick(direction) {
|
|
1174
|
+
this._stopInterval();
|
|
1175
|
+
this._scrollHeader(direction);
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
|
|
1179
|
+
*
|
|
1180
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1181
|
+
* should be called sparingly.
|
|
1182
|
+
*/
|
|
1183
|
+
_scrollToLabel(labelIndex) {
|
|
1184
|
+
if (this.disablePagination) {
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
const selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
|
|
1188
|
+
if (!selectedLabel) {
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
// The view length is the visible width of the tab labels.
|
|
1192
|
+
const viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1193
|
+
const { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;
|
|
1194
|
+
let labelBeforePos, labelAfterPos;
|
|
1195
|
+
if (this._getLayoutDirection() == 'ltr') {
|
|
1196
|
+
labelBeforePos = offsetLeft;
|
|
1197
|
+
labelAfterPos = labelBeforePos + offsetWidth;
|
|
1198
|
+
}
|
|
1199
|
+
else {
|
|
1200
|
+
labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
|
|
1201
|
+
labelBeforePos = labelAfterPos - offsetWidth;
|
|
1202
|
+
}
|
|
1203
|
+
const beforeVisiblePos = this.scrollDistance;
|
|
1204
|
+
const afterVisiblePos = this.scrollDistance + viewLength;
|
|
1205
|
+
if (labelBeforePos < beforeVisiblePos) {
|
|
1206
|
+
// Scroll header to move label to the before direction
|
|
1207
|
+
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
|
|
1208
|
+
}
|
|
1209
|
+
else if (labelAfterPos > afterVisiblePos) {
|
|
1210
|
+
// Scroll header to move label to the after direction
|
|
1211
|
+
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
|
|
1270
1212
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
|
|
1216
|
+
* tab list is wider than the size of the header container, then the pagination controls should
|
|
1217
|
+
* be shown.
|
|
1218
|
+
*
|
|
1219
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1220
|
+
* should be called sparingly.
|
|
1221
|
+
*/
|
|
1222
|
+
_checkPaginationEnabled() {
|
|
1223
|
+
if (this.disablePagination) {
|
|
1224
|
+
this._showPaginationControls = false;
|
|
1282
1225
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
this.
|
|
1287
|
-
const selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
|
|
1288
|
-
if (selectedLabelWrapper) {
|
|
1289
|
-
this._inkBar.alignToElement(selectedLabelWrapper);
|
|
1226
|
+
else {
|
|
1227
|
+
const isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
|
|
1228
|
+
if (!isEnabled) {
|
|
1229
|
+
this.scrollDistance = 0;
|
|
1290
1230
|
}
|
|
1291
|
-
|
|
1292
|
-
this.
|
|
1231
|
+
if (isEnabled !== this._showPaginationControls) {
|
|
1232
|
+
this._changeDetectorRef.markForCheck();
|
|
1293
1233
|
}
|
|
1234
|
+
this._showPaginationControls = isEnabled;
|
|
1294
1235
|
}
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Evaluate whether the before and after controls should be enabled or disabled.
|
|
1239
|
+
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
|
|
1240
|
+
* before button. If the header is at the end of the list (scroll distance is equal to the
|
|
1241
|
+
* maximum distance we can scroll), then disable the after button.
|
|
1242
|
+
*
|
|
1243
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1244
|
+
* should be called sparingly.
|
|
1245
|
+
*/
|
|
1246
|
+
_checkScrollingControls() {
|
|
1247
|
+
if (this.disablePagination) {
|
|
1248
|
+
this._disableScrollAfter = this._disableScrollBefore = true;
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
// Check if the pagination arrows should be activated.
|
|
1252
|
+
this._disableScrollBefore = this.scrollDistance == 0;
|
|
1253
|
+
this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
|
|
1254
|
+
this._changeDetectorRef.markForCheck();
|
|
1298
1255
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
});
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
1259
|
+
* is equal to the difference in width between the tab list container and tab header container.
|
|
1260
|
+
*
|
|
1261
|
+
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
1262
|
+
* should be called sparingly.
|
|
1263
|
+
*/
|
|
1264
|
+
_getMaxScrollDistance() {
|
|
1265
|
+
const lengthOfTabList = this._tabList.nativeElement.scrollWidth;
|
|
1266
|
+
const viewLength = this._tabListContainer.nativeElement.offsetWidth;
|
|
1267
|
+
return (lengthOfTabList - viewLength) || 0;
|
|
1268
|
+
}
|
|
1269
|
+
/** Tells the ink-bar to align itself to the current label wrapper */
|
|
1270
|
+
_alignInkBarToSelectedTab() {
|
|
1271
|
+
const selectedItem = this._items && this._items.length ?
|
|
1272
|
+
this._items.toArray()[this.selectedIndex] : null;
|
|
1273
|
+
const selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
|
|
1274
|
+
if (selectedLabelWrapper) {
|
|
1275
|
+
this._inkBar.alignToElement(selectedLabelWrapper);
|
|
1276
|
+
}
|
|
1277
|
+
else {
|
|
1278
|
+
this._inkBar.hide();
|
|
1323
1279
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1280
|
+
}
|
|
1281
|
+
/** Stops the currently-running paginator interval. */
|
|
1282
|
+
_stopInterval() {
|
|
1283
|
+
this._stopScrolling.next();
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* Handles the user pressing down on one of the paginators.
|
|
1287
|
+
* Starts scrolling the header after a certain amount of time.
|
|
1288
|
+
* @param direction In which direction the paginator should be scrolled.
|
|
1289
|
+
*/
|
|
1290
|
+
_handlePaginatorPress(direction, mouseEvent) {
|
|
1291
|
+
// Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to
|
|
1292
|
+
// null check the `button`, but we do it so we don't break tests that use fake events.
|
|
1293
|
+
if (mouseEvent && mouseEvent.button != null && mouseEvent.button !== 0) {
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
// Avoid overlapping timers.
|
|
1297
|
+
this._stopInterval();
|
|
1298
|
+
// Start a timer after the delay and keep firing based on the interval.
|
|
1299
|
+
timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
|
|
1300
|
+
// Keep the timer going until something tells it to stop or the component is destroyed.
|
|
1301
|
+
.pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
|
|
1302
|
+
.subscribe(() => {
|
|
1303
|
+
const { maxScrollDistance, distance } = this._scrollHeader(direction);
|
|
1304
|
+
// Stop the timer if we've reached the start or the end.
|
|
1305
|
+
if (distance === 0 || distance >= maxScrollDistance) {
|
|
1306
|
+
this._stopInterval();
|
|
1332
1307
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Scrolls the header to a given position.
|
|
1312
|
+
* @param position Position to which to scroll.
|
|
1313
|
+
* @returns Information on the current scroll distance and the maximum.
|
|
1314
|
+
*/
|
|
1315
|
+
_scrollTo(position) {
|
|
1316
|
+
if (this.disablePagination) {
|
|
1317
|
+
return { maxScrollDistance: 0, distance: 0 };
|
|
1318
|
+
}
|
|
1319
|
+
const maxScrollDistance = this._getMaxScrollDistance();
|
|
1320
|
+
this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
|
|
1321
|
+
// Mark that the scroll distance has changed so that after the view is checked, the CSS
|
|
1322
|
+
// transformation can move the header.
|
|
1323
|
+
this._scrollDistanceChanged = true;
|
|
1324
|
+
this._checkScrollingControls();
|
|
1325
|
+
return { maxScrollDistance, distance: this._scrollDistance };
|
|
1341
1326
|
}
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
]
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
})();
|
|
1327
|
+
}
|
|
1328
|
+
MatPaginatedTabHeader.decorators = [
|
|
1329
|
+
{ type: Directive }
|
|
1330
|
+
];
|
|
1331
|
+
MatPaginatedTabHeader.ctorParameters = () => [
|
|
1332
|
+
{ type: ElementRef },
|
|
1333
|
+
{ type: ChangeDetectorRef },
|
|
1334
|
+
{ type: ViewportRuler },
|
|
1335
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1336
|
+
{ type: NgZone },
|
|
1337
|
+
{ type: Platform },
|
|
1338
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1339
|
+
];
|
|
1340
|
+
MatPaginatedTabHeader.propDecorators = {
|
|
1341
|
+
disablePagination: [{ type: Input }]
|
|
1342
|
+
};
|
|
1359
1343
|
|
|
1360
1344
|
/**
|
|
1361
1345
|
* @license
|
|
@@ -1368,38 +1352,35 @@ let MatPaginatedTabHeader = /** @class */ (() => {
|
|
|
1368
1352
|
* Base class with all of the `MatTabHeader` functionality.
|
|
1369
1353
|
* @docs-private
|
|
1370
1354
|
*/
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
animationMode)
|
|
1376
|
-
|
|
1377
|
-
this._disableRipple = false;
|
|
1378
|
-
}
|
|
1379
|
-
/** Whether the ripple effect is disabled or not. */
|
|
1380
|
-
get disableRipple() { return this._disableRipple; }
|
|
1381
|
-
set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
|
|
1382
|
-
_itemSelected(event) {
|
|
1383
|
-
event.preventDefault();
|
|
1384
|
-
}
|
|
1355
|
+
class _MatTabHeaderBase extends MatPaginatedTabHeader {
|
|
1356
|
+
constructor(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
|
|
1357
|
+
// @breaking-change 9.0.0 `_animationMode` parameter to be made required.
|
|
1358
|
+
animationMode) {
|
|
1359
|
+
super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
|
|
1360
|
+
this._disableRipple = false;
|
|
1385
1361
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
}
|
|
1362
|
+
/** Whether the ripple effect is disabled or not. */
|
|
1363
|
+
get disableRipple() { return this._disableRipple; }
|
|
1364
|
+
set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
|
|
1365
|
+
_itemSelected(event) {
|
|
1366
|
+
event.preventDefault();
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
_MatTabHeaderBase.decorators = [
|
|
1370
|
+
{ type: Directive }
|
|
1371
|
+
];
|
|
1372
|
+
_MatTabHeaderBase.ctorParameters = () => [
|
|
1373
|
+
{ type: ElementRef },
|
|
1374
|
+
{ type: ChangeDetectorRef },
|
|
1375
|
+
{ type: ViewportRuler },
|
|
1376
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1377
|
+
{ type: NgZone },
|
|
1378
|
+
{ type: Platform },
|
|
1379
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1380
|
+
];
|
|
1381
|
+
_MatTabHeaderBase.propDecorators = {
|
|
1382
|
+
disableRipple: [{ type: Input }]
|
|
1383
|
+
};
|
|
1403
1384
|
/**
|
|
1404
1385
|
* The header of the tab group which displays a list of all the tabs in the tab group. Includes
|
|
1405
1386
|
* an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
|
|
@@ -1407,50 +1388,47 @@ let _MatTabHeaderBase = /** @class */ (() => {
|
|
|
1407
1388
|
* left and right across the header.
|
|
1408
1389
|
* @docs-private
|
|
1409
1390
|
*/
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
animationMode)
|
|
1415
|
-
super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
|
|
1416
|
-
}
|
|
1391
|
+
class MatTabHeader extends _MatTabHeaderBase {
|
|
1392
|
+
constructor(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
|
|
1393
|
+
// @breaking-change 9.0.0 `_animationMode` parameter to be made required.
|
|
1394
|
+
animationMode) {
|
|
1395
|
+
super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
|
|
1417
1396
|
}
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
},] }
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
]
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
})();
|
|
1397
|
+
}
|
|
1398
|
+
MatTabHeader.decorators = [
|
|
1399
|
+
{ type: Component, args: [{
|
|
1400
|
+
selector: 'mat-tab-header',
|
|
1401
|
+
template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n #tabList\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n role=\"tablist\"\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-labels\">\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n",
|
|
1402
|
+
inputs: ['selectedIndex'],
|
|
1403
|
+
outputs: ['selectFocusedIndex', 'indexFocused'],
|
|
1404
|
+
encapsulation: ViewEncapsulation.None,
|
|
1405
|
+
// tslint:disable-next-line:validate-decorators
|
|
1406
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
1407
|
+
host: {
|
|
1408
|
+
'class': 'mat-tab-header',
|
|
1409
|
+
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
|
|
1410
|
+
'[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
|
|
1411
|
+
},
|
|
1412
|
+
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-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .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 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 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}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-labels{display:flex}[mat-align-tabs=center]>.mat-tab-header .mat-tab-labels{justify-content:center}[mat-align-tabs=end]>.mat-tab-header .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:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-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}.cdk-high-contrast-active .mat-tab-label{opacity:1}@media(max-width: 599px){.mat-tab-label{min-width:72px}}\n"]
|
|
1413
|
+
},] }
|
|
1414
|
+
];
|
|
1415
|
+
MatTabHeader.ctorParameters = () => [
|
|
1416
|
+
{ type: ElementRef },
|
|
1417
|
+
{ type: ChangeDetectorRef },
|
|
1418
|
+
{ type: ViewportRuler },
|
|
1419
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1420
|
+
{ type: NgZone },
|
|
1421
|
+
{ type: Platform },
|
|
1422
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1423
|
+
];
|
|
1424
|
+
MatTabHeader.propDecorators = {
|
|
1425
|
+
_items: [{ type: ContentChildren, args: [MatTabLabelWrapper, { descendants: false },] }],
|
|
1426
|
+
_inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
|
|
1427
|
+
_tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
|
|
1428
|
+
_tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
|
|
1429
|
+
_nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }],
|
|
1430
|
+
_previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }]
|
|
1431
|
+
};
|
|
1454
1432
|
|
|
1455
1433
|
/**
|
|
1456
1434
|
* @license
|
|
@@ -1463,239 +1441,227 @@ let MatTabHeader = /** @class */ (() => {
|
|
|
1463
1441
|
* Base class with all of the `MatTabNav` functionality.
|
|
1464
1442
|
* @docs-private
|
|
1465
1443
|
*/
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
platform, animationMode)
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
this.
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1444
|
+
class _MatTabNavBase extends MatPaginatedTabHeader {
|
|
1445
|
+
constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
|
|
1446
|
+
/**
|
|
1447
|
+
* @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
|
|
1448
|
+
*/
|
|
1449
|
+
platform, animationMode) {
|
|
1450
|
+
super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
|
|
1451
|
+
this._disableRipple = false;
|
|
1452
|
+
/** Theme color of the nav bar. */
|
|
1453
|
+
this.color = 'primary';
|
|
1454
|
+
}
|
|
1455
|
+
/** Background color of the tab nav. */
|
|
1456
|
+
get backgroundColor() { return this._backgroundColor; }
|
|
1457
|
+
set backgroundColor(value) {
|
|
1458
|
+
const classList = this._elementRef.nativeElement.classList;
|
|
1459
|
+
classList.remove(`mat-background-${this.backgroundColor}`);
|
|
1460
|
+
if (value) {
|
|
1461
|
+
classList.add(`mat-background-${value}`);
|
|
1462
|
+
}
|
|
1463
|
+
this._backgroundColor = value;
|
|
1464
|
+
}
|
|
1465
|
+
/** Whether the ripple effect is disabled or not. */
|
|
1466
|
+
get disableRipple() { return this._disableRipple; }
|
|
1467
|
+
set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
|
|
1468
|
+
_itemSelected() {
|
|
1469
|
+
// noop
|
|
1470
|
+
}
|
|
1471
|
+
ngAfterContentInit() {
|
|
1472
|
+
// We need this to run before the `changes` subscription in parent to ensure that the
|
|
1473
|
+
// selectedIndex is up-to-date by the time the super class starts looking for it.
|
|
1474
|
+
this._items.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
|
|
1475
|
+
this.updateActiveLink();
|
|
1476
|
+
});
|
|
1477
|
+
super.ngAfterContentInit();
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Notifies the component that the active link has been changed.
|
|
1481
|
+
* @breaking-change 8.0.0 `element` parameter to be removed.
|
|
1482
|
+
*/
|
|
1483
|
+
updateActiveLink(_element) {
|
|
1484
|
+
if (!this._items) {
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
const items = this._items.toArray();
|
|
1488
|
+
for (let i = 0; i < items.length; i++) {
|
|
1489
|
+
if (items[i].active) {
|
|
1490
|
+
this.selectedIndex = i;
|
|
1491
|
+
this._changeDetectorRef.markForCheck();
|
|
1508
1492
|
return;
|
|
1509
1493
|
}
|
|
1510
|
-
const items = this._items.toArray();
|
|
1511
|
-
for (let i = 0; i < items.length; i++) {
|
|
1512
|
-
if (items[i].active) {
|
|
1513
|
-
this.selectedIndex = i;
|
|
1514
|
-
this._changeDetectorRef.markForCheck();
|
|
1515
|
-
return;
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
// The ink bar should hide itself if no items are active.
|
|
1519
|
-
this.selectedIndex = -1;
|
|
1520
|
-
this._inkBar.hide();
|
|
1521
1494
|
}
|
|
1495
|
+
// The ink bar should hide itself if no items are active.
|
|
1496
|
+
this.selectedIndex = -1;
|
|
1497
|
+
this._inkBar.hide();
|
|
1522
1498
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
]
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
})();
|
|
1499
|
+
}
|
|
1500
|
+
_MatTabNavBase.decorators = [
|
|
1501
|
+
{ type: Directive }
|
|
1502
|
+
];
|
|
1503
|
+
_MatTabNavBase.ctorParameters = () => [
|
|
1504
|
+
{ type: ElementRef },
|
|
1505
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1506
|
+
{ type: NgZone },
|
|
1507
|
+
{ type: ChangeDetectorRef },
|
|
1508
|
+
{ type: ViewportRuler },
|
|
1509
|
+
{ type: Platform, decorators: [{ type: Optional }] },
|
|
1510
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1511
|
+
];
|
|
1512
|
+
_MatTabNavBase.propDecorators = {
|
|
1513
|
+
backgroundColor: [{ type: Input }],
|
|
1514
|
+
disableRipple: [{ type: Input }],
|
|
1515
|
+
color: [{ type: Input }]
|
|
1516
|
+
};
|
|
1542
1517
|
/**
|
|
1543
1518
|
* Navigation component matching the styles of the tab group header.
|
|
1544
1519
|
* Provides anchored navigation with animated ink bar.
|
|
1545
1520
|
*/
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
platform, animationMode)
|
|
1553
|
-
super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode);
|
|
1554
|
-
}
|
|
1521
|
+
class MatTabNav extends _MatTabNavBase {
|
|
1522
|
+
constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
|
|
1523
|
+
/**
|
|
1524
|
+
* @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
|
|
1525
|
+
*/
|
|
1526
|
+
platform, animationMode) {
|
|
1527
|
+
super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode);
|
|
1555
1528
|
}
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
},] }
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
]
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
})();
|
|
1529
|
+
}
|
|
1530
|
+
MatTabNav.decorators = [
|
|
1531
|
+
{ type: Component, args: [{
|
|
1532
|
+
selector: '[mat-tab-nav-bar]',
|
|
1533
|
+
exportAs: 'matTabNavBar, matTabNav',
|
|
1534
|
+
inputs: ['color'],
|
|
1535
|
+
template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-link-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabList\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-links\">\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n",
|
|
1536
|
+
host: {
|
|
1537
|
+
'class': 'mat-tab-nav-bar mat-tab-header',
|
|
1538
|
+
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
|
|
1539
|
+
'[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
|
|
1540
|
+
'[class.mat-primary]': 'color !== "warn" && color !== "accent"',
|
|
1541
|
+
'[class.mat-accent]': 'color === "accent"',
|
|
1542
|
+
'[class.mat-warn]': 'color === "warn"',
|
|
1543
|
+
},
|
|
1544
|
+
encapsulation: ViewEncapsulation.None,
|
|
1545
|
+
// tslint:disable-next-line:validate-decorators
|
|
1546
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
1547
|
+
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-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .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 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-tab-links{display:flex}[mat-align-tabs=center]>.mat-tab-link-container .mat-tab-links{justify-content:center}[mat-align-tabs=end]>.mat-tab-link-container .mat-tab-links{justify-content:flex-end}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 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}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-link-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-link{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;vertical-align:top;text-decoration:none;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent}.mat-tab-link:focus{outline:none}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-link:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-link.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-link.mat-tab-disabled{opacity:.5}.mat-tab-link .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-link{opacity:1}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}.mat-tab-link.mat-tab-disabled{pointer-events:none}@media(max-width: 599px){.mat-tab-link{min-width:72px}}\n"]
|
|
1548
|
+
},] }
|
|
1549
|
+
];
|
|
1550
|
+
MatTabNav.ctorParameters = () => [
|
|
1551
|
+
{ type: ElementRef },
|
|
1552
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1553
|
+
{ type: NgZone },
|
|
1554
|
+
{ type: ChangeDetectorRef },
|
|
1555
|
+
{ type: ViewportRuler },
|
|
1556
|
+
{ type: Platform, decorators: [{ type: Optional }] },
|
|
1557
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1558
|
+
];
|
|
1559
|
+
MatTabNav.propDecorators = {
|
|
1560
|
+
_items: [{ type: ContentChildren, args: [forwardRef(() => MatTabLink), { descendants: true },] }],
|
|
1561
|
+
_inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
|
|
1562
|
+
_tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
|
|
1563
|
+
_tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
|
|
1564
|
+
_nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }],
|
|
1565
|
+
_previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }]
|
|
1566
|
+
};
|
|
1595
1567
|
// Boilerplate for applying mixins to MatTabLink.
|
|
1596
1568
|
class MatTabLinkMixinBase {
|
|
1597
1569
|
}
|
|
1598
1570
|
const _MatTabLinkMixinBase = mixinTabIndex(mixinDisableRipple(mixinDisabled(MatTabLinkMixinBase)));
|
|
1599
1571
|
/** Base class with all of the `MatTabLink` functionality. */
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
this.rippleConfig.animation = { enterDuration: 0, exitDuration: 0 };
|
|
1613
|
-
}
|
|
1572
|
+
class _MatTabLinkBase extends _MatTabLinkMixinBase {
|
|
1573
|
+
constructor(_tabNavBar, elementRef, globalRippleOptions, tabIndex, _focusMonitor, animationMode) {
|
|
1574
|
+
super();
|
|
1575
|
+
this._tabNavBar = _tabNavBar;
|
|
1576
|
+
this.elementRef = elementRef;
|
|
1577
|
+
this._focusMonitor = _focusMonitor;
|
|
1578
|
+
/** Whether the tab link is active or not. */
|
|
1579
|
+
this._isActive = false;
|
|
1580
|
+
this.rippleConfig = globalRippleOptions || {};
|
|
1581
|
+
this.tabIndex = parseInt(tabIndex) || 0;
|
|
1582
|
+
if (animationMode === 'NoopAnimations') {
|
|
1583
|
+
this.rippleConfig.animation = { enterDuration: 0, exitDuration: 0 };
|
|
1614
1584
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
}
|
|
1623
|
-
/**
|
|
1624
|
-
* Whether ripples are disabled on interaction.
|
|
1625
|
-
* @docs-private
|
|
1626
|
-
*/
|
|
1627
|
-
get rippleDisabled() {
|
|
1628
|
-
return this.disabled || this.disableRipple || this._tabNavBar.disableRipple ||
|
|
1629
|
-
!!this.rippleConfig.disabled;
|
|
1630
|
-
}
|
|
1631
|
-
focus() {
|
|
1632
|
-
this.elementRef.nativeElement.focus();
|
|
1633
|
-
}
|
|
1634
|
-
ngAfterViewInit() {
|
|
1635
|
-
this._focusMonitor.monitor(this.elementRef);
|
|
1636
|
-
}
|
|
1637
|
-
ngOnDestroy() {
|
|
1638
|
-
this._focusMonitor.stopMonitoring(this.elementRef);
|
|
1585
|
+
}
|
|
1586
|
+
/** Whether the link is active. */
|
|
1587
|
+
get active() { return this._isActive; }
|
|
1588
|
+
set active(value) {
|
|
1589
|
+
if (value !== this._isActive) {
|
|
1590
|
+
this._isActive = value;
|
|
1591
|
+
this._tabNavBar.updateActiveLink(this.elementRef);
|
|
1639
1592
|
}
|
|
1640
1593
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1594
|
+
/**
|
|
1595
|
+
* Whether ripples are disabled on interaction.
|
|
1596
|
+
* @docs-private
|
|
1597
|
+
*/
|
|
1598
|
+
get rippleDisabled() {
|
|
1599
|
+
return this.disabled || this.disableRipple || this._tabNavBar.disableRipple ||
|
|
1600
|
+
!!this.rippleConfig.disabled;
|
|
1601
|
+
}
|
|
1602
|
+
focus() {
|
|
1603
|
+
this.elementRef.nativeElement.focus();
|
|
1604
|
+
}
|
|
1605
|
+
ngAfterViewInit() {
|
|
1606
|
+
this._focusMonitor.monitor(this.elementRef);
|
|
1607
|
+
}
|
|
1608
|
+
ngOnDestroy() {
|
|
1609
|
+
this._focusMonitor.stopMonitoring(this.elementRef);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
_MatTabLinkBase.decorators = [
|
|
1613
|
+
{ type: Directive }
|
|
1614
|
+
];
|
|
1615
|
+
_MatTabLinkBase.ctorParameters = () => [
|
|
1616
|
+
{ type: _MatTabNavBase },
|
|
1617
|
+
{ type: ElementRef },
|
|
1618
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
|
|
1619
|
+
{ type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
|
1620
|
+
{ type: FocusMonitor },
|
|
1621
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1622
|
+
];
|
|
1623
|
+
_MatTabLinkBase.propDecorators = {
|
|
1624
|
+
active: [{ type: Input }]
|
|
1625
|
+
};
|
|
1657
1626
|
/**
|
|
1658
1627
|
* Link inside of a `mat-tab-nav-bar`.
|
|
1659
1628
|
*/
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
|
|
1666
|
-
}
|
|
1667
|
-
ngOnDestroy() {
|
|
1668
|
-
super.ngOnDestroy();
|
|
1669
|
-
this._tabLinkRipple._removeTriggerEvents();
|
|
1670
|
-
}
|
|
1629
|
+
class MatTabLink extends _MatTabLinkBase {
|
|
1630
|
+
constructor(tabNavBar, elementRef, ngZone, platform, globalRippleOptions, tabIndex, focusMonitor, animationMode) {
|
|
1631
|
+
super(tabNavBar, elementRef, globalRippleOptions, tabIndex, focusMonitor, animationMode);
|
|
1632
|
+
this._tabLinkRipple = new RippleRenderer(this, ngZone, elementRef, platform);
|
|
1633
|
+
this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
|
|
1671
1634
|
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
}
|
|
1635
|
+
ngOnDestroy() {
|
|
1636
|
+
super.ngOnDestroy();
|
|
1637
|
+
this._tabLinkRipple._removeTriggerEvents();
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
MatTabLink.decorators = [
|
|
1641
|
+
{ type: Directive, args: [{
|
|
1642
|
+
selector: '[mat-tab-link], [matTabLink]',
|
|
1643
|
+
exportAs: 'matTabLink',
|
|
1644
|
+
inputs: ['disabled', 'disableRipple', 'tabIndex'],
|
|
1645
|
+
host: {
|
|
1646
|
+
'class': 'mat-tab-link mat-focus-indicator',
|
|
1647
|
+
'[attr.aria-current]': 'active ? "page" : null',
|
|
1648
|
+
'[attr.aria-disabled]': 'disabled',
|
|
1649
|
+
'[attr.tabIndex]': 'tabIndex',
|
|
1650
|
+
'[class.mat-tab-disabled]': 'disabled',
|
|
1651
|
+
'[class.mat-tab-label-active]': 'active',
|
|
1652
|
+
}
|
|
1653
|
+
},] }
|
|
1654
|
+
];
|
|
1655
|
+
MatTabLink.ctorParameters = () => [
|
|
1656
|
+
{ type: MatTabNav },
|
|
1657
|
+
{ type: ElementRef },
|
|
1658
|
+
{ type: NgZone },
|
|
1659
|
+
{ type: Platform },
|
|
1660
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
|
|
1661
|
+
{ type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
|
1662
|
+
{ type: FocusMonitor },
|
|
1663
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
|
1664
|
+
];
|
|
1699
1665
|
|
|
1700
1666
|
/**
|
|
1701
1667
|
* @license
|
|
@@ -1704,46 +1670,43 @@ let MatTabLink = /** @class */ (() => {
|
|
|
1704
1670
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1705
1671
|
* found in the LICENSE file at https://angular.io/license
|
|
1706
1672
|
*/
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
];
|
|
1745
|
-
return MatTabsModule;
|
|
1746
|
-
})();
|
|
1673
|
+
class MatTabsModule {
|
|
1674
|
+
}
|
|
1675
|
+
MatTabsModule.decorators = [
|
|
1676
|
+
{ type: NgModule, args: [{
|
|
1677
|
+
imports: [
|
|
1678
|
+
CommonModule,
|
|
1679
|
+
MatCommonModule,
|
|
1680
|
+
PortalModule,
|
|
1681
|
+
MatRippleModule,
|
|
1682
|
+
ObserversModule,
|
|
1683
|
+
A11yModule,
|
|
1684
|
+
],
|
|
1685
|
+
// Don't export all components because some are only to be used internally.
|
|
1686
|
+
exports: [
|
|
1687
|
+
MatCommonModule,
|
|
1688
|
+
MatTabGroup,
|
|
1689
|
+
MatTabLabel,
|
|
1690
|
+
MatTab,
|
|
1691
|
+
MatTabNav,
|
|
1692
|
+
MatTabLink,
|
|
1693
|
+
MatTabContent,
|
|
1694
|
+
],
|
|
1695
|
+
declarations: [
|
|
1696
|
+
MatTabGroup,
|
|
1697
|
+
MatTabLabel,
|
|
1698
|
+
MatTab,
|
|
1699
|
+
MatInkBar,
|
|
1700
|
+
MatTabLabelWrapper,
|
|
1701
|
+
MatTabNav,
|
|
1702
|
+
MatTabLink,
|
|
1703
|
+
MatTabBody,
|
|
1704
|
+
MatTabBodyPortal,
|
|
1705
|
+
MatTabHeader,
|
|
1706
|
+
MatTabContent,
|
|
1707
|
+
],
|
|
1708
|
+
},] }
|
|
1709
|
+
];
|
|
1747
1710
|
|
|
1748
1711
|
/**
|
|
1749
1712
|
* @license
|
|
@@ -1765,5 +1728,5 @@ let MatTabsModule = /** @class */ (() => {
|
|
|
1765
1728
|
* Generated bundle index. Do not edit.
|
|
1766
1729
|
*/
|
|
1767
1730
|
|
|
1768
|
-
export { MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵangular_material_src_material_tabs_tabs_a,
|
|
1731
|
+
export { MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵangular_material_src_material_tabs_tabs_a, MAT_TAB_LABEL as ɵangular_material_src_material_tabs_tabs_b, MAT_TAB_CONTENT as ɵangular_material_src_material_tabs_tabs_c, MatPaginatedTabHeader as ɵangular_material_src_material_tabs_tabs_d };
|
|
1769
1732
|
//# sourceMappingURL=tabs.js.map
|