@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/bottom-sheet.js
CHANGED
|
@@ -82,189 +82,186 @@ const matBottomSheetAnimations = {
|
|
|
82
82
|
* Internal component that wraps user-provided bottom sheet content.
|
|
83
83
|
* @docs-private
|
|
84
84
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.attachDomPortal = (portal) => {
|
|
107
|
-
this._validatePortalAttached();
|
|
108
|
-
this._setPanelClass();
|
|
109
|
-
this._savePreviouslyFocusedElement();
|
|
110
|
-
return this._portalOutlet.attachDomPortal(portal);
|
|
111
|
-
};
|
|
112
|
-
this._document = document;
|
|
113
|
-
this._breakpointSubscription = breakpointObserver
|
|
114
|
-
.observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])
|
|
115
|
-
.subscribe(() => {
|
|
116
|
-
this._toggleClass('mat-bottom-sheet-container-medium', breakpointObserver.isMatched(Breakpoints.Medium));
|
|
117
|
-
this._toggleClass('mat-bottom-sheet-container-large', breakpointObserver.isMatched(Breakpoints.Large));
|
|
118
|
-
this._toggleClass('mat-bottom-sheet-container-xlarge', breakpointObserver.isMatched(Breakpoints.XLarge));
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
/** Attach a component portal as content to this bottom sheet container. */
|
|
122
|
-
attachComponentPortal(portal) {
|
|
85
|
+
class MatBottomSheetContainer extends BasePortalOutlet {
|
|
86
|
+
constructor(_elementRef, _changeDetectorRef, _focusTrapFactory, breakpointObserver, document,
|
|
87
|
+
/** The bottom sheet configuration. */
|
|
88
|
+
bottomSheetConfig) {
|
|
89
|
+
super();
|
|
90
|
+
this._elementRef = _elementRef;
|
|
91
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
92
|
+
this._focusTrapFactory = _focusTrapFactory;
|
|
93
|
+
this.bottomSheetConfig = bottomSheetConfig;
|
|
94
|
+
/** The state of the bottom sheet animations. */
|
|
95
|
+
this._animationState = 'void';
|
|
96
|
+
/** Emits whenever the state of the animation changes. */
|
|
97
|
+
this._animationStateChanged = new EventEmitter();
|
|
98
|
+
/** Element that was focused before the bottom sheet was opened. */
|
|
99
|
+
this._elementFocusedBeforeOpened = null;
|
|
100
|
+
/**
|
|
101
|
+
* Attaches a DOM portal to the bottom sheet container.
|
|
102
|
+
* @deprecated To be turned into a method.
|
|
103
|
+
* @breaking-change 10.0.0
|
|
104
|
+
*/
|
|
105
|
+
this.attachDomPortal = (portal) => {
|
|
123
106
|
this._validatePortalAttached();
|
|
124
107
|
this._setPanelClass();
|
|
125
108
|
this._savePreviouslyFocusedElement();
|
|
126
|
-
return this._portalOutlet.
|
|
109
|
+
return this._portalOutlet.attachDomPortal(portal);
|
|
110
|
+
};
|
|
111
|
+
this._document = document;
|
|
112
|
+
this._breakpointSubscription = breakpointObserver
|
|
113
|
+
.observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])
|
|
114
|
+
.subscribe(() => {
|
|
115
|
+
this._toggleClass('mat-bottom-sheet-container-medium', breakpointObserver.isMatched(Breakpoints.Medium));
|
|
116
|
+
this._toggleClass('mat-bottom-sheet-container-large', breakpointObserver.isMatched(Breakpoints.Large));
|
|
117
|
+
this._toggleClass('mat-bottom-sheet-container-xlarge', breakpointObserver.isMatched(Breakpoints.XLarge));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** Attach a component portal as content to this bottom sheet container. */
|
|
121
|
+
attachComponentPortal(portal) {
|
|
122
|
+
this._validatePortalAttached();
|
|
123
|
+
this._setPanelClass();
|
|
124
|
+
this._savePreviouslyFocusedElement();
|
|
125
|
+
return this._portalOutlet.attachComponentPortal(portal);
|
|
126
|
+
}
|
|
127
|
+
/** Attach a template portal as content to this bottom sheet container. */
|
|
128
|
+
attachTemplatePortal(portal) {
|
|
129
|
+
this._validatePortalAttached();
|
|
130
|
+
this._setPanelClass();
|
|
131
|
+
this._savePreviouslyFocusedElement();
|
|
132
|
+
return this._portalOutlet.attachTemplatePortal(portal);
|
|
133
|
+
}
|
|
134
|
+
/** Begin animation of bottom sheet entrance into view. */
|
|
135
|
+
enter() {
|
|
136
|
+
if (!this._destroyed) {
|
|
137
|
+
this._animationState = 'visible';
|
|
138
|
+
this._changeDetectorRef.detectChanges();
|
|
127
139
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.
|
|
133
|
-
|
|
140
|
+
}
|
|
141
|
+
/** Begin animation of the bottom sheet exiting from view. */
|
|
142
|
+
exit() {
|
|
143
|
+
if (!this._destroyed) {
|
|
144
|
+
this._animationState = 'hidden';
|
|
145
|
+
this._changeDetectorRef.markForCheck();
|
|
134
146
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
}
|
|
148
|
+
ngOnDestroy() {
|
|
149
|
+
this._breakpointSubscription.unsubscribe();
|
|
150
|
+
this._destroyed = true;
|
|
151
|
+
}
|
|
152
|
+
_onAnimationDone(event) {
|
|
153
|
+
if (event.toState === 'hidden') {
|
|
154
|
+
this._restoreFocus();
|
|
141
155
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if (!this._destroyed) {
|
|
145
|
-
this._animationState = 'hidden';
|
|
146
|
-
this._changeDetectorRef.markForCheck();
|
|
147
|
-
}
|
|
156
|
+
else if (event.toState === 'visible') {
|
|
157
|
+
this._trapFocus();
|
|
148
158
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
159
|
+
this._animationStateChanged.emit(event);
|
|
160
|
+
}
|
|
161
|
+
_onAnimationStart(event) {
|
|
162
|
+
this._animationStateChanged.emit(event);
|
|
163
|
+
}
|
|
164
|
+
_toggleClass(cssClass, add) {
|
|
165
|
+
const classList = this._elementRef.nativeElement.classList;
|
|
166
|
+
add ? classList.add(cssClass) : classList.remove(cssClass);
|
|
167
|
+
}
|
|
168
|
+
_validatePortalAttached() {
|
|
169
|
+
if (this._portalOutlet.hasAttached()) {
|
|
170
|
+
throw Error('Attempting to attach bottom sheet content after content is already attached');
|
|
152
171
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
this._animationStateChanged.emit(event);
|
|
172
|
+
}
|
|
173
|
+
_setPanelClass() {
|
|
174
|
+
const element = this._elementRef.nativeElement;
|
|
175
|
+
const panelClass = this.bottomSheetConfig.panelClass;
|
|
176
|
+
if (Array.isArray(panelClass)) {
|
|
177
|
+
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
|
|
178
|
+
panelClass.forEach(cssClass => element.classList.add(cssClass));
|
|
161
179
|
}
|
|
162
|
-
|
|
163
|
-
|
|
180
|
+
else if (panelClass) {
|
|
181
|
+
element.classList.add(panelClass);
|
|
164
182
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
183
|
+
}
|
|
184
|
+
/** Moves the focus inside the focus trap. */
|
|
185
|
+
_trapFocus() {
|
|
186
|
+
const element = this._elementRef.nativeElement;
|
|
187
|
+
if (!this._focusTrap) {
|
|
188
|
+
this._focusTrap = this._focusTrapFactory.create(element);
|
|
168
189
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
throw Error('Attempting to attach bottom sheet content after content is already attached');
|
|
172
|
-
}
|
|
190
|
+
if (this.bottomSheetConfig.autoFocus) {
|
|
191
|
+
this._focusTrap.focusInitialElementWhenReady();
|
|
173
192
|
}
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
element.
|
|
193
|
+
else {
|
|
194
|
+
const activeElement = this._document.activeElement;
|
|
195
|
+
// Otherwise ensure that focus is on the container. It's possible that a different
|
|
196
|
+
// component tried to move focus while the open animation was running. See:
|
|
197
|
+
// https://github.com/angular/components/issues/16215. Note that we only want to do this
|
|
198
|
+
// if the focus isn't inside the bottom sheet already, because it's possible that the
|
|
199
|
+
// consumer turned off `autoFocus` in order to move focus themselves.
|
|
200
|
+
if (activeElement !== element && !element.contains(activeElement)) {
|
|
201
|
+
element.focus();
|
|
183
202
|
}
|
|
184
203
|
}
|
|
185
|
-
|
|
186
|
-
|
|
204
|
+
}
|
|
205
|
+
/** Restores focus to the element that was focused before the bottom sheet was opened. */
|
|
206
|
+
_restoreFocus() {
|
|
207
|
+
const toFocus = this._elementFocusedBeforeOpened;
|
|
208
|
+
// We need the extra check, because IE can set the `activeElement` to null in some cases.
|
|
209
|
+
if (this.bottomSheetConfig.restoreFocus && toFocus && typeof toFocus.focus === 'function') {
|
|
210
|
+
const activeElement = this._document.activeElement;
|
|
187
211
|
const element = this._elementRef.nativeElement;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
const activeElement = this._document.activeElement;
|
|
196
|
-
// Otherwise ensure that focus is on the container. It's possible that a different
|
|
197
|
-
// component tried to move focus while the open animation was running. See:
|
|
198
|
-
// https://github.com/angular/components/issues/16215. Note that we only want to do this
|
|
199
|
-
// if the focus isn't inside the bottom sheet already, because it's possible that the
|
|
200
|
-
// consumer turned off `autoFocus` in order to move focus themselves.
|
|
201
|
-
if (activeElement !== element && !element.contains(activeElement)) {
|
|
202
|
-
element.focus();
|
|
203
|
-
}
|
|
212
|
+
// Make sure that focus is still inside the bottom sheet or is on the body (usually because a
|
|
213
|
+
// non-focusable element like the backdrop was clicked) before moving it. It's possible that
|
|
214
|
+
// the consumer moved it themselves before the animation was done, in which case we shouldn't
|
|
215
|
+
// do anything.
|
|
216
|
+
if (!activeElement || activeElement === this._document.body || activeElement === element ||
|
|
217
|
+
element.contains(activeElement)) {
|
|
218
|
+
toFocus.focus();
|
|
204
219
|
}
|
|
205
220
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const toFocus = this._elementFocusedBeforeOpened;
|
|
209
|
-
// We need the extra check, because IE can set the `activeElement` to null in some cases.
|
|
210
|
-
if (this.bottomSheetConfig.restoreFocus && toFocus && typeof toFocus.focus === 'function') {
|
|
211
|
-
const activeElement = this._document.activeElement;
|
|
212
|
-
const element = this._elementRef.nativeElement;
|
|
213
|
-
// Make sure that focus is still inside the bottom sheet or is on the body (usually because a
|
|
214
|
-
// non-focusable element like the backdrop was clicked) before moving it. It's possible that
|
|
215
|
-
// the consumer moved it themselves before the animation was done, in which case we shouldn't
|
|
216
|
-
// do anything.
|
|
217
|
-
if (!activeElement || activeElement === this._document.body || activeElement === element ||
|
|
218
|
-
element.contains(activeElement)) {
|
|
219
|
-
toFocus.focus();
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (this._focusTrap) {
|
|
223
|
-
this._focusTrap.destroy();
|
|
224
|
-
}
|
|
221
|
+
if (this._focusTrap) {
|
|
222
|
+
this._focusTrap.destroy();
|
|
225
223
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
}
|
|
225
|
+
/** Saves a reference to the element that was focused before the bottom sheet was opened. */
|
|
226
|
+
_savePreviouslyFocusedElement() {
|
|
227
|
+
this._elementFocusedBeforeOpened = this._document.activeElement;
|
|
228
|
+
// The `focus` method isn't available during server-side rendering.
|
|
229
|
+
if (this._elementRef.nativeElement.focus) {
|
|
230
|
+
Promise.resolve().then(() => this._elementRef.nativeElement.focus());
|
|
233
231
|
}
|
|
234
232
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
})();
|
|
233
|
+
}
|
|
234
|
+
MatBottomSheetContainer.decorators = [
|
|
235
|
+
{ type: Component, args: [{
|
|
236
|
+
selector: 'mat-bottom-sheet-container',
|
|
237
|
+
template: "<ng-template cdkPortalOutlet></ng-template>\r\n",
|
|
238
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
239
|
+
encapsulation: ViewEncapsulation.None,
|
|
240
|
+
animations: [matBottomSheetAnimations.bottomSheetState],
|
|
241
|
+
host: {
|
|
242
|
+
'class': 'mat-bottom-sheet-container',
|
|
243
|
+
'tabindex': '-1',
|
|
244
|
+
'role': 'dialog',
|
|
245
|
+
'aria-modal': 'true',
|
|
246
|
+
'[attr.aria-label]': 'bottomSheetConfig?.ariaLabel',
|
|
247
|
+
'[@state]': '_animationState',
|
|
248
|
+
'(@state.start)': '_onAnimationStart($event)',
|
|
249
|
+
'(@state.done)': '_onAnimationDone($event)'
|
|
250
|
+
},
|
|
251
|
+
styles: [".mat-bottom-sheet-container{padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto}.cdk-high-contrast-active .mat-bottom-sheet-container{outline:1px solid}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:4px;border-top-right-radius:4px}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}\n"]
|
|
252
|
+
},] }
|
|
253
|
+
];
|
|
254
|
+
MatBottomSheetContainer.ctorParameters = () => [
|
|
255
|
+
{ type: ElementRef },
|
|
256
|
+
{ type: ChangeDetectorRef },
|
|
257
|
+
{ type: FocusTrapFactory },
|
|
258
|
+
{ type: BreakpointObserver },
|
|
259
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
|
|
260
|
+
{ type: MatBottomSheetConfig }
|
|
261
|
+
];
|
|
262
|
+
MatBottomSheetContainer.propDecorators = {
|
|
263
|
+
_portalOutlet: [{ type: ViewChild, args: [CdkPortalOutlet, { static: true },] }]
|
|
264
|
+
};
|
|
268
265
|
|
|
269
266
|
/**
|
|
270
267
|
* @license
|
|
@@ -273,23 +270,20 @@ let MatBottomSheetContainer = /** @class */ (() => {
|
|
|
273
270
|
* Use of this source code is governed by an MIT-style license that can be
|
|
274
271
|
* found in the LICENSE file at https://angular.io/license
|
|
275
272
|
*/
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
];
|
|
291
|
-
return MatBottomSheetModule;
|
|
292
|
-
})();
|
|
273
|
+
class MatBottomSheetModule {
|
|
274
|
+
}
|
|
275
|
+
MatBottomSheetModule.decorators = [
|
|
276
|
+
{ type: NgModule, args: [{
|
|
277
|
+
imports: [
|
|
278
|
+
OverlayModule,
|
|
279
|
+
MatCommonModule,
|
|
280
|
+
PortalModule,
|
|
281
|
+
],
|
|
282
|
+
exports: [MatBottomSheetContainer, MatCommonModule],
|
|
283
|
+
declarations: [MatBottomSheetContainer],
|
|
284
|
+
entryComponents: [MatBottomSheetContainer],
|
|
285
|
+
},] }
|
|
286
|
+
];
|
|
293
287
|
|
|
294
288
|
/**
|
|
295
289
|
* @license
|
|
@@ -393,143 +387,140 @@ const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS = new InjectionToken('mat-bottom-sheet-de
|
|
|
393
387
|
/**
|
|
394
388
|
* Service to trigger Material Design bottom sheets.
|
|
395
389
|
*/
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
390
|
+
class MatBottomSheet {
|
|
391
|
+
constructor(_overlay, _injector, _parentBottomSheet, _location, _defaultOptions) {
|
|
392
|
+
this._overlay = _overlay;
|
|
393
|
+
this._injector = _injector;
|
|
394
|
+
this._parentBottomSheet = _parentBottomSheet;
|
|
395
|
+
this._location = _location;
|
|
396
|
+
this._defaultOptions = _defaultOptions;
|
|
397
|
+
this._bottomSheetRefAtThisLevel = null;
|
|
398
|
+
}
|
|
399
|
+
/** Reference to the currently opened bottom sheet. */
|
|
400
|
+
get _openedBottomSheetRef() {
|
|
401
|
+
const parent = this._parentBottomSheet;
|
|
402
|
+
return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;
|
|
403
|
+
}
|
|
404
|
+
set _openedBottomSheetRef(value) {
|
|
405
|
+
if (this._parentBottomSheet) {
|
|
406
|
+
this._parentBottomSheet._openedBottomSheetRef = value;
|
|
405
407
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
const parent = this._parentBottomSheet;
|
|
409
|
-
return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;
|
|
408
|
+
else {
|
|
409
|
+
this._bottomSheetRefAtThisLevel = value;
|
|
410
410
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
411
|
+
}
|
|
412
|
+
open(componentOrTemplateRef, config) {
|
|
413
|
+
const _config = _applyConfigDefaults(this._defaultOptions || new MatBottomSheetConfig(), config);
|
|
414
|
+
const overlayRef = this._createOverlay(_config);
|
|
415
|
+
const container = this._attachContainer(overlayRef, _config);
|
|
416
|
+
const ref = new MatBottomSheetRef(container, overlayRef, this._location);
|
|
417
|
+
if (componentOrTemplateRef instanceof TemplateRef) {
|
|
418
|
+
container.attachTemplatePortal(new TemplatePortal(componentOrTemplateRef, null, {
|
|
419
|
+
$implicit: _config.data,
|
|
420
|
+
bottomSheetRef: ref
|
|
421
|
+
}));
|
|
418
422
|
}
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
const ref = new MatBottomSheetRef(container, overlayRef, this._location);
|
|
424
|
-
if (componentOrTemplateRef instanceof TemplateRef) {
|
|
425
|
-
container.attachTemplatePortal(new TemplatePortal(componentOrTemplateRef, null, {
|
|
426
|
-
$implicit: _config.data,
|
|
427
|
-
bottomSheetRef: ref
|
|
428
|
-
}));
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
const portal = new ComponentPortal(componentOrTemplateRef, undefined, this._createInjector(_config, ref));
|
|
432
|
-
const contentRef = container.attachComponentPortal(portal);
|
|
433
|
-
ref.instance = contentRef.instance;
|
|
434
|
-
}
|
|
435
|
-
// When the bottom sheet is dismissed, clear the reference to it.
|
|
436
|
-
ref.afterDismissed().subscribe(() => {
|
|
437
|
-
// Clear the bottom sheet ref if it hasn't already been replaced by a newer one.
|
|
438
|
-
if (this._openedBottomSheetRef == ref) {
|
|
439
|
-
this._openedBottomSheetRef = null;
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
if (this._openedBottomSheetRef) {
|
|
443
|
-
// If a bottom sheet is already in view, dismiss it and enter the
|
|
444
|
-
// new bottom sheet after exit animation is complete.
|
|
445
|
-
this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance.enter());
|
|
446
|
-
this._openedBottomSheetRef.dismiss();
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
// If no bottom sheet is in view, enter the new bottom sheet.
|
|
450
|
-
ref.containerInstance.enter();
|
|
451
|
-
}
|
|
452
|
-
this._openedBottomSheetRef = ref;
|
|
453
|
-
return ref;
|
|
423
|
+
else {
|
|
424
|
+
const portal = new ComponentPortal(componentOrTemplateRef, undefined, this._createInjector(_config, ref));
|
|
425
|
+
const contentRef = container.attachComponentPortal(portal);
|
|
426
|
+
ref.instance = contentRef.instance;
|
|
454
427
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
if (this._openedBottomSheetRef) {
|
|
461
|
-
this._openedBottomSheetRef.dismiss(result);
|
|
428
|
+
// When the bottom sheet is dismissed, clear the reference to it.
|
|
429
|
+
ref.afterDismissed().subscribe(() => {
|
|
430
|
+
// Clear the bottom sheet ref if it hasn't already been replaced by a newer one.
|
|
431
|
+
if (this._openedBottomSheetRef == ref) {
|
|
432
|
+
this._openedBottomSheetRef = null;
|
|
462
433
|
}
|
|
434
|
+
});
|
|
435
|
+
if (this._openedBottomSheetRef) {
|
|
436
|
+
// If a bottom sheet is already in view, dismiss it and enter the
|
|
437
|
+
// new bottom sheet after exit animation is complete.
|
|
438
|
+
this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance.enter());
|
|
439
|
+
this._openedBottomSheetRef.dismiss();
|
|
463
440
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
441
|
+
else {
|
|
442
|
+
// If no bottom sheet is in view, enter the new bottom sheet.
|
|
443
|
+
ref.containerInstance.enter();
|
|
468
444
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
return containerRef.instance;
|
|
445
|
+
this._openedBottomSheetRef = ref;
|
|
446
|
+
return ref;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Dismisses the currently-visible bottom sheet.
|
|
450
|
+
* @param result Data to pass to the bottom sheet instance.
|
|
451
|
+
*/
|
|
452
|
+
dismiss(result) {
|
|
453
|
+
if (this._openedBottomSheetRef) {
|
|
454
|
+
this._openedBottomSheetRef.dismiss(result);
|
|
480
455
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
_createOverlay(config) {
|
|
486
|
-
const overlayConfig = new OverlayConfig({
|
|
487
|
-
direction: config.direction,
|
|
488
|
-
hasBackdrop: config.hasBackdrop,
|
|
489
|
-
disposeOnNavigation: config.closeOnNavigation,
|
|
490
|
-
maxWidth: '100%',
|
|
491
|
-
scrollStrategy: config.scrollStrategy || this._overlay.scrollStrategies.block(),
|
|
492
|
-
positionStrategy: this._overlay.position().global().centerHorizontally().bottom('0')
|
|
493
|
-
});
|
|
494
|
-
if (config.backdropClass) {
|
|
495
|
-
overlayConfig.backdropClass = config.backdropClass;
|
|
496
|
-
}
|
|
497
|
-
return this._overlay.create(overlayConfig);
|
|
456
|
+
}
|
|
457
|
+
ngOnDestroy() {
|
|
458
|
+
if (this._bottomSheetRefAtThisLevel) {
|
|
459
|
+
this._bottomSheetRefAtThisLevel.dismiss();
|
|
498
460
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Attaches the bottom sheet container component to the overlay.
|
|
464
|
+
*/
|
|
465
|
+
_attachContainer(overlayRef, config) {
|
|
466
|
+
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
467
|
+
const injector = new PortalInjector(userInjector || this._injector, new WeakMap([
|
|
468
|
+
[MatBottomSheetConfig, config]
|
|
469
|
+
]));
|
|
470
|
+
const containerPortal = new ComponentPortal(MatBottomSheetContainer, config.viewContainerRef, injector);
|
|
471
|
+
const containerRef = overlayRef.attach(containerPortal);
|
|
472
|
+
return containerRef.instance;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Creates a new overlay and places it in the correct location.
|
|
476
|
+
* @param config The user-specified bottom sheet config.
|
|
477
|
+
*/
|
|
478
|
+
_createOverlay(config) {
|
|
479
|
+
const overlayConfig = new OverlayConfig({
|
|
480
|
+
direction: config.direction,
|
|
481
|
+
hasBackdrop: config.hasBackdrop,
|
|
482
|
+
disposeOnNavigation: config.closeOnNavigation,
|
|
483
|
+
maxWidth: '100%',
|
|
484
|
+
scrollStrategy: config.scrollStrategy || this._overlay.scrollStrategies.block(),
|
|
485
|
+
positionStrategy: this._overlay.position().global().centerHorizontally().bottom('0')
|
|
486
|
+
});
|
|
487
|
+
if (config.backdropClass) {
|
|
488
|
+
overlayConfig.backdropClass = config.backdropClass;
|
|
518
489
|
}
|
|
490
|
+
return this._overlay.create(overlayConfig);
|
|
519
491
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
492
|
+
/**
|
|
493
|
+
* Creates an injector to be used inside of a bottom sheet component.
|
|
494
|
+
* @param config Config that was used to create the bottom sheet.
|
|
495
|
+
* @param bottomSheetRef Reference to the bottom sheet.
|
|
496
|
+
*/
|
|
497
|
+
_createInjector(config, bottomSheetRef) {
|
|
498
|
+
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
499
|
+
const injectionTokens = new WeakMap([
|
|
500
|
+
[MatBottomSheetRef, bottomSheetRef],
|
|
501
|
+
[MAT_BOTTOM_SHEET_DATA, config.data]
|
|
502
|
+
]);
|
|
503
|
+
if (config.direction &&
|
|
504
|
+
(!userInjector || !userInjector.get(Directionality, null))) {
|
|
505
|
+
injectionTokens.set(Directionality, {
|
|
506
|
+
value: config.direction,
|
|
507
|
+
change: of()
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return new PortalInjector(userInjector || this._injector, injectionTokens);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
MatBottomSheet.ɵprov = ɵɵdefineInjectable({ factory: function MatBottomSheet_Factory() { return new MatBottomSheet(ɵɵinject(Overlay), ɵɵinject(INJECTOR), ɵɵinject(MatBottomSheet, 12), ɵɵinject(Location, 8), ɵɵinject(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS, 8)); }, token: MatBottomSheet, providedIn: MatBottomSheetModule });
|
|
514
|
+
MatBottomSheet.decorators = [
|
|
515
|
+
{ type: Injectable, args: [{ providedIn: MatBottomSheetModule },] }
|
|
516
|
+
];
|
|
517
|
+
MatBottomSheet.ctorParameters = () => [
|
|
518
|
+
{ type: Overlay },
|
|
519
|
+
{ type: Injector },
|
|
520
|
+
{ type: MatBottomSheet, decorators: [{ type: Optional }, { type: SkipSelf }] },
|
|
521
|
+
{ type: Location, decorators: [{ type: Optional }] },
|
|
522
|
+
{ type: MatBottomSheetConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_BOTTOM_SHEET_DEFAULT_OPTIONS,] }] }
|
|
523
|
+
];
|
|
533
524
|
/**
|
|
534
525
|
* Applies default options to the bottom sheet config.
|
|
535
526
|
* @param defaults Object containing the default values to which to fall back.
|