@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
|
@@ -17,6 +17,12 @@ import { mixinDisableRipple, MatCommonModule, MatRippleModule } from '@angular/m
|
|
|
17
17
|
* default options for all button toggles within an app.
|
|
18
18
|
*/
|
|
19
19
|
const MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS = new InjectionToken('MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS');
|
|
20
|
+
/**
|
|
21
|
+
* Injection token that can be used to reference instances of `MatButtonToggleGroup`.
|
|
22
|
+
* It serves as alternative token to the actual `MatButtonToggleGroup` class which
|
|
23
|
+
* could cause unnecessary retention of the class and its component metadata.
|
|
24
|
+
*/
|
|
25
|
+
const MAT_BUTTON_TOGGLE_GROUP = new InjectionToken('MatButtonToggleGroup');
|
|
20
26
|
/**
|
|
21
27
|
* Provider Expression that allows mat-button-toggle-group to register as a ControlValueAccessor.
|
|
22
28
|
* This allows it to support [(ngModel)].
|
|
@@ -40,403 +46,399 @@ class MatButtonToggleChange {
|
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
/** Exclusive selection button toggle group that behaves like a radio-button group. */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this._disabled = false;
|
|
50
|
-
/**
|
|
51
|
-
* The method to be called in order to update ngModel.
|
|
52
|
-
* Now `ngModel` binding is not supported in multiple selection mode.
|
|
53
|
-
*/
|
|
54
|
-
this._controlValueAccessorChangeFn = () => { };
|
|
55
|
-
/** onTouch function registered via registerOnTouch (ControlValueAccessor). */
|
|
56
|
-
this._onTouched = () => { };
|
|
57
|
-
this._name = `mat-button-toggle-group-${_uniqueIdCounter++}`;
|
|
58
|
-
/**
|
|
59
|
-
* Event that emits whenever the value of the group changes.
|
|
60
|
-
* Used to facilitate two-way data binding.
|
|
61
|
-
* @docs-private
|
|
62
|
-
*/
|
|
63
|
-
this.valueChange = new EventEmitter();
|
|
64
|
-
/** Event emitted when the group's value changes. */
|
|
65
|
-
this.change = new EventEmitter();
|
|
66
|
-
this.appearance =
|
|
67
|
-
defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';
|
|
68
|
-
}
|
|
69
|
-
/** `name` attribute for the underlying `input` element. */
|
|
70
|
-
get name() { return this._name; }
|
|
71
|
-
set name(value) {
|
|
72
|
-
this._name = value;
|
|
73
|
-
if (this._buttonToggles) {
|
|
74
|
-
this._buttonToggles.forEach(toggle => {
|
|
75
|
-
toggle.name = this._name;
|
|
76
|
-
toggle._markForCheck();
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/** Whether the toggle group is vertical. */
|
|
81
|
-
get vertical() { return this._vertical; }
|
|
82
|
-
set vertical(value) {
|
|
83
|
-
this._vertical = coerceBooleanProperty(value);
|
|
84
|
-
}
|
|
85
|
-
/** Value of the toggle group. */
|
|
86
|
-
get value() {
|
|
87
|
-
const selected = this._selectionModel ? this._selectionModel.selected : [];
|
|
88
|
-
if (this.multiple) {
|
|
89
|
-
return selected.map(toggle => toggle.value);
|
|
90
|
-
}
|
|
91
|
-
return selected[0] ? selected[0].value : undefined;
|
|
92
|
-
}
|
|
93
|
-
set value(newValue) {
|
|
94
|
-
this._setSelectionByValue(newValue);
|
|
95
|
-
this.valueChange.emit(this.value);
|
|
96
|
-
}
|
|
97
|
-
/** Selected button toggles in the group. */
|
|
98
|
-
get selected() {
|
|
99
|
-
const selected = this._selectionModel ? this._selectionModel.selected : [];
|
|
100
|
-
return this.multiple ? selected : (selected[0] || null);
|
|
101
|
-
}
|
|
102
|
-
/** Whether multiple button toggles can be selected. */
|
|
103
|
-
get multiple() { return this._multiple; }
|
|
104
|
-
set multiple(value) {
|
|
105
|
-
this._multiple = coerceBooleanProperty(value);
|
|
106
|
-
}
|
|
107
|
-
/** Whether multiple button toggle group is disabled. */
|
|
108
|
-
get disabled() { return this._disabled; }
|
|
109
|
-
set disabled(value) {
|
|
110
|
-
this._disabled = coerceBooleanProperty(value);
|
|
111
|
-
if (this._buttonToggles) {
|
|
112
|
-
this._buttonToggles.forEach(toggle => toggle._markForCheck());
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
ngOnInit() {
|
|
116
|
-
this._selectionModel = new SelectionModel(this.multiple, undefined, false);
|
|
117
|
-
}
|
|
118
|
-
ngAfterContentInit() {
|
|
119
|
-
this._selectionModel.select(...this._buttonToggles.filter(toggle => toggle.checked));
|
|
120
|
-
}
|
|
49
|
+
class MatButtonToggleGroup {
|
|
50
|
+
constructor(_changeDetector, defaultOptions) {
|
|
51
|
+
this._changeDetector = _changeDetector;
|
|
52
|
+
this._vertical = false;
|
|
53
|
+
this._multiple = false;
|
|
54
|
+
this._disabled = false;
|
|
121
55
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
56
|
+
* The method to be called in order to update ngModel.
|
|
57
|
+
* Now `ngModel` binding is not supported in multiple selection mode.
|
|
124
58
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
59
|
+
this._controlValueAccessorChangeFn = () => { };
|
|
60
|
+
/** onTouch function registered via registerOnTouch (ControlValueAccessor). */
|
|
61
|
+
this._onTouched = () => { };
|
|
62
|
+
this._name = `mat-button-toggle-group-${_uniqueIdCounter++}`;
|
|
63
|
+
/**
|
|
64
|
+
* Event that emits whenever the value of the group changes.
|
|
65
|
+
* Used to facilitate two-way data binding.
|
|
66
|
+
* @docs-private
|
|
67
|
+
*/
|
|
68
|
+
this.valueChange = new EventEmitter();
|
|
69
|
+
/** Event emitted when the group's value changes. */
|
|
70
|
+
this.change = new EventEmitter();
|
|
71
|
+
this.appearance =
|
|
72
|
+
defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';
|
|
73
|
+
}
|
|
74
|
+
/** `name` attribute for the underlying `input` element. */
|
|
75
|
+
get name() { return this._name; }
|
|
76
|
+
set name(value) {
|
|
77
|
+
this._name = value;
|
|
78
|
+
if (this._buttonToggles) {
|
|
79
|
+
this._buttonToggles.forEach(toggle => {
|
|
80
|
+
toggle.name = this._name;
|
|
81
|
+
toggle._markForCheck();
|
|
82
|
+
});
|
|
136
83
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
84
|
+
}
|
|
85
|
+
/** Whether the toggle group is vertical. */
|
|
86
|
+
get vertical() { return this._vertical; }
|
|
87
|
+
set vertical(value) {
|
|
88
|
+
this._vertical = coerceBooleanProperty(value);
|
|
89
|
+
}
|
|
90
|
+
/** Value of the toggle group. */
|
|
91
|
+
get value() {
|
|
92
|
+
const selected = this._selectionModel ? this._selectionModel.selected : [];
|
|
93
|
+
if (this.multiple) {
|
|
94
|
+
return selected.map(toggle => toggle.value);
|
|
140
95
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
96
|
+
return selected[0] ? selected[0].value : undefined;
|
|
97
|
+
}
|
|
98
|
+
set value(newValue) {
|
|
99
|
+
this._setSelectionByValue(newValue);
|
|
100
|
+
this.valueChange.emit(this.value);
|
|
101
|
+
}
|
|
102
|
+
/** Selected button toggles in the group. */
|
|
103
|
+
get selected() {
|
|
104
|
+
const selected = this._selectionModel ? this._selectionModel.selected : [];
|
|
105
|
+
return this.multiple ? selected : (selected[0] || null);
|
|
106
|
+
}
|
|
107
|
+
/** Whether multiple button toggles can be selected. */
|
|
108
|
+
get multiple() { return this._multiple; }
|
|
109
|
+
set multiple(value) {
|
|
110
|
+
this._multiple = coerceBooleanProperty(value);
|
|
111
|
+
}
|
|
112
|
+
/** Whether multiple button toggle group is disabled. */
|
|
113
|
+
get disabled() { return this._disabled; }
|
|
114
|
+
set disabled(value) {
|
|
115
|
+
this._disabled = coerceBooleanProperty(value);
|
|
116
|
+
if (this._buttonToggles) {
|
|
117
|
+
this._buttonToggles.forEach(toggle => toggle._markForCheck());
|
|
148
118
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
119
|
+
}
|
|
120
|
+
ngOnInit() {
|
|
121
|
+
this._selectionModel = new SelectionModel(this.multiple, undefined, false);
|
|
122
|
+
}
|
|
123
|
+
ngAfterContentInit() {
|
|
124
|
+
this._selectionModel.select(...this._buttonToggles.filter(toggle => toggle.checked));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Sets the model value. Implemented as part of ControlValueAccessor.
|
|
128
|
+
* @param value Value to be set to the model.
|
|
129
|
+
*/
|
|
130
|
+
writeValue(value) {
|
|
131
|
+
this.value = value;
|
|
132
|
+
this._changeDetector.markForCheck();
|
|
133
|
+
}
|
|
134
|
+
// Implemented as part of ControlValueAccessor.
|
|
135
|
+
registerOnChange(fn) {
|
|
136
|
+
this._controlValueAccessorChangeFn = fn;
|
|
137
|
+
}
|
|
138
|
+
// Implemented as part of ControlValueAccessor.
|
|
139
|
+
registerOnTouched(fn) {
|
|
140
|
+
this._onTouched = fn;
|
|
141
|
+
}
|
|
142
|
+
// Implemented as part of ControlValueAccessor.
|
|
143
|
+
setDisabledState(isDisabled) {
|
|
144
|
+
this.disabled = isDisabled;
|
|
145
|
+
}
|
|
146
|
+
/** Dispatch change event with current selection and group value. */
|
|
147
|
+
_emitChangeEvent() {
|
|
148
|
+
const selected = this.selected;
|
|
149
|
+
const source = Array.isArray(selected) ? selected[selected.length - 1] : selected;
|
|
150
|
+
const event = new MatButtonToggleChange(source, this.value);
|
|
151
|
+
this._controlValueAccessorChangeFn(event.value);
|
|
152
|
+
this.change.emit(event);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Syncs a button toggle's selected state with the model value.
|
|
156
|
+
* @param toggle Toggle to be synced.
|
|
157
|
+
* @param select Whether the toggle should be selected.
|
|
158
|
+
* @param isUserInput Whether the change was a result of a user interaction.
|
|
159
|
+
* @param deferEvents Whether to defer emitting the change events.
|
|
160
|
+
*/
|
|
161
|
+
_syncButtonToggle(toggle, select, isUserInput = false, deferEvents = false) {
|
|
162
|
+
// Deselect the currently-selected toggle, if we're in single-selection
|
|
163
|
+
// mode and the button being toggled isn't selected at the moment.
|
|
164
|
+
if (!this.multiple && this.selected && !toggle.checked) {
|
|
165
|
+
this.selected.checked = false;
|
|
166
|
+
}
|
|
167
|
+
if (this._selectionModel) {
|
|
168
|
+
if (select) {
|
|
169
|
+
this._selectionModel.select(toggle);
|
|
178
170
|
}
|
|
179
171
|
else {
|
|
180
|
-
this.
|
|
172
|
+
this._selectionModel.deselect(toggle);
|
|
181
173
|
}
|
|
182
174
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return this._selectionModel && this._selectionModel.isSelected(toggle);
|
|
175
|
+
else {
|
|
176
|
+
deferEvents = true;
|
|
186
177
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (this.multiple && Array.isArray(this._rawValue)) {
|
|
193
|
-
return this._rawValue.some(value => toggle.value != null && value === toggle.value);
|
|
194
|
-
}
|
|
195
|
-
return toggle.value === this._rawValue;
|
|
178
|
+
// We need to defer in some cases in order to avoid "changed after checked errors", however
|
|
179
|
+
// the side-effect is that we may end up updating the model value out of sequence in others
|
|
180
|
+
// The `deferEvents` flag allows us to decide whether to do it on a case-by-case basis.
|
|
181
|
+
if (deferEvents) {
|
|
182
|
+
Promise.resolve().then(() => this._updateModelValue(isUserInput));
|
|
196
183
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
this._rawValue = value;
|
|
200
|
-
if (!this._buttonToggles) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (this.multiple && value) {
|
|
204
|
-
if (!Array.isArray(value)) {
|
|
205
|
-
throw Error('Value must be an array in multiple-selection mode.');
|
|
206
|
-
}
|
|
207
|
-
this._clearSelection();
|
|
208
|
-
value.forEach((currentValue) => this._selectValue(currentValue));
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
this._clearSelection();
|
|
212
|
-
this._selectValue(value);
|
|
213
|
-
}
|
|
184
|
+
else {
|
|
185
|
+
this._updateModelValue(isUserInput);
|
|
214
186
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
187
|
+
}
|
|
188
|
+
/** Checks whether a button toggle is selected. */
|
|
189
|
+
_isSelected(toggle) {
|
|
190
|
+
return this._selectionModel && this._selectionModel.isSelected(toggle);
|
|
191
|
+
}
|
|
192
|
+
/** Determines whether a button toggle should be checked on init. */
|
|
193
|
+
_isPrechecked(toggle) {
|
|
194
|
+
if (typeof this._rawValue === 'undefined') {
|
|
195
|
+
return false;
|
|
219
196
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const correspondingOption = this._buttonToggles.find(toggle => {
|
|
223
|
-
return toggle.value != null && toggle.value === value;
|
|
224
|
-
});
|
|
225
|
-
if (correspondingOption) {
|
|
226
|
-
correspondingOption.checked = true;
|
|
227
|
-
this._selectionModel.select(correspondingOption);
|
|
228
|
-
}
|
|
197
|
+
if (this.multiple && Array.isArray(this._rawValue)) {
|
|
198
|
+
return this._rawValue.some(value => toggle.value != null && value === toggle.value);
|
|
229
199
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
200
|
+
return toggle.value === this._rawValue;
|
|
201
|
+
}
|
|
202
|
+
/** Updates the selection state of the toggles in the group based on a value. */
|
|
203
|
+
_setSelectionByValue(value) {
|
|
204
|
+
this._rawValue = value;
|
|
205
|
+
if (!this._buttonToggles) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (this.multiple && value) {
|
|
209
|
+
if (!Array.isArray(value)) {
|
|
210
|
+
throw Error('Value must be an array in multiple-selection mode.');
|
|
235
211
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
212
|
+
this._clearSelection();
|
|
213
|
+
value.forEach((currentValue) => this._selectValue(currentValue));
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
this._clearSelection();
|
|
217
|
+
this._selectValue(value);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/** Clears the selected toggles. */
|
|
221
|
+
_clearSelection() {
|
|
222
|
+
this._selectionModel.clear();
|
|
223
|
+
this._buttonToggles.forEach(toggle => toggle.checked = false);
|
|
224
|
+
}
|
|
225
|
+
/** Selects a value if there's a toggle that corresponds to it. */
|
|
226
|
+
_selectValue(value) {
|
|
227
|
+
const correspondingOption = this._buttonToggles.find(toggle => {
|
|
228
|
+
return toggle.value != null && toggle.value === value;
|
|
229
|
+
});
|
|
230
|
+
if (correspondingOption) {
|
|
231
|
+
correspondingOption.checked = true;
|
|
232
|
+
this._selectionModel.select(correspondingOption);
|
|
239
233
|
}
|
|
240
234
|
}
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
235
|
+
/** Syncs up the group's value with the model and emits the change event. */
|
|
236
|
+
_updateModelValue(isUserInput) {
|
|
237
|
+
// Only emit the change event for user input.
|
|
238
|
+
if (isUserInput) {
|
|
239
|
+
this._emitChangeEvent();
|
|
240
|
+
}
|
|
241
|
+
// Note: we emit this one no matter whether it was a user interaction, because
|
|
242
|
+
// it is used by Angular to sync up the two-way data binding.
|
|
243
|
+
this.valueChange.emit(this.value);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
MatButtonToggleGroup.decorators = [
|
|
247
|
+
{ type: Directive, args: [{
|
|
248
|
+
selector: 'mat-button-toggle-group',
|
|
249
|
+
providers: [
|
|
250
|
+
MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR,
|
|
251
|
+
{ provide: MAT_BUTTON_TOGGLE_GROUP, useExisting: MatButtonToggleGroup },
|
|
252
|
+
],
|
|
253
|
+
host: {
|
|
254
|
+
'role': 'group',
|
|
255
|
+
'class': 'mat-button-toggle-group',
|
|
256
|
+
'[attr.aria-disabled]': 'disabled',
|
|
257
|
+
'[class.mat-button-toggle-vertical]': 'vertical',
|
|
258
|
+
'[class.mat-button-toggle-group-appearance-standard]': 'appearance === "standard"',
|
|
259
|
+
},
|
|
260
|
+
exportAs: 'matButtonToggleGroup',
|
|
261
|
+
},] }
|
|
262
|
+
];
|
|
263
|
+
MatButtonToggleGroup.ctorParameters = () => [
|
|
264
|
+
{ type: ChangeDetectorRef },
|
|
265
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS,] }] }
|
|
266
|
+
];
|
|
267
|
+
MatButtonToggleGroup.propDecorators = {
|
|
268
|
+
_buttonToggles: [{ type: ContentChildren, args: [forwardRef(() => MatButtonToggle), {
|
|
269
|
+
// Note that this would technically pick up toggles
|
|
270
|
+
// from nested groups, but that's not a case that we support.
|
|
271
|
+
descendants: true
|
|
272
|
+
},] }],
|
|
273
|
+
appearance: [{ type: Input }],
|
|
274
|
+
name: [{ type: Input }],
|
|
275
|
+
vertical: [{ type: Input }],
|
|
276
|
+
value: [{ type: Input }],
|
|
277
|
+
valueChange: [{ type: Output }],
|
|
278
|
+
multiple: [{ type: Input }],
|
|
279
|
+
disabled: [{ type: Input }],
|
|
280
|
+
change: [{ type: Output }]
|
|
281
|
+
};
|
|
276
282
|
// Boilerplate for applying mixins to the MatButtonToggle class.
|
|
277
283
|
/** @docs-private */
|
|
278
284
|
class MatButtonToggleBase {
|
|
279
285
|
}
|
|
280
286
|
const _MatButtonToggleMixinBase = mixinDisableRipple(MatButtonToggleBase);
|
|
281
287
|
/** Single button inside of a toggle group. */
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
this.buttonToggleGroup._syncButtonToggle(this, this._checked);
|
|
323
|
-
}
|
|
324
|
-
this._changeDetectorRef.markForCheck();
|
|
288
|
+
class MatButtonToggle extends _MatButtonToggleMixinBase {
|
|
289
|
+
constructor(toggleGroup, _changeDetectorRef, _elementRef, _focusMonitor, defaultTabIndex, defaultOptions) {
|
|
290
|
+
super();
|
|
291
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
292
|
+
this._elementRef = _elementRef;
|
|
293
|
+
this._focusMonitor = _focusMonitor;
|
|
294
|
+
this._isSingleSelector = false;
|
|
295
|
+
this._checked = false;
|
|
296
|
+
/**
|
|
297
|
+
* Users can specify the `aria-labelledby` attribute which will be forwarded to the input element
|
|
298
|
+
*/
|
|
299
|
+
this.ariaLabelledby = null;
|
|
300
|
+
this._disabled = false;
|
|
301
|
+
/** Event emitted when the group value changes. */
|
|
302
|
+
this.change = new EventEmitter();
|
|
303
|
+
const parsedTabIndex = Number(defaultTabIndex);
|
|
304
|
+
this.tabIndex = (parsedTabIndex || parsedTabIndex === 0) ? parsedTabIndex : null;
|
|
305
|
+
this.buttonToggleGroup = toggleGroup;
|
|
306
|
+
this.appearance =
|
|
307
|
+
defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';
|
|
308
|
+
}
|
|
309
|
+
/** Unique ID for the underlying `button` element. */
|
|
310
|
+
get buttonId() { return `${this.id}-button`; }
|
|
311
|
+
/** The appearance style of the button. */
|
|
312
|
+
get appearance() {
|
|
313
|
+
return this.buttonToggleGroup ? this.buttonToggleGroup.appearance : this._appearance;
|
|
314
|
+
}
|
|
315
|
+
set appearance(value) {
|
|
316
|
+
this._appearance = value;
|
|
317
|
+
}
|
|
318
|
+
/** Whether the button is checked. */
|
|
319
|
+
get checked() {
|
|
320
|
+
return this.buttonToggleGroup ? this.buttonToggleGroup._isSelected(this) : this._checked;
|
|
321
|
+
}
|
|
322
|
+
set checked(value) {
|
|
323
|
+
const newValue = coerceBooleanProperty(value);
|
|
324
|
+
if (newValue !== this._checked) {
|
|
325
|
+
this._checked = newValue;
|
|
326
|
+
if (this.buttonToggleGroup) {
|
|
327
|
+
this.buttonToggleGroup._syncButtonToggle(this, this._checked);
|
|
325
328
|
}
|
|
329
|
+
this._changeDetectorRef.markForCheck();
|
|
326
330
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
else if (group._isSelected(this) !== this._checked) {
|
|
345
|
-
// As as side effect of the circular dependency between the toggle group and the button,
|
|
346
|
-
// we may end up in a state where the button is supposed to be checked on init, but it
|
|
347
|
-
// isn't, because the checked value was assigned too early. This can happen when Ivy
|
|
348
|
-
// assigns the static input value before the `ngOnInit` has run.
|
|
349
|
-
group._syncButtonToggle(this, this._checked);
|
|
350
|
-
}
|
|
331
|
+
}
|
|
332
|
+
/** Whether the button is disabled. */
|
|
333
|
+
get disabled() {
|
|
334
|
+
return this._disabled || (this.buttonToggleGroup && this.buttonToggleGroup.disabled);
|
|
335
|
+
}
|
|
336
|
+
set disabled(value) { this._disabled = coerceBooleanProperty(value); }
|
|
337
|
+
ngOnInit() {
|
|
338
|
+
const group = this.buttonToggleGroup;
|
|
339
|
+
this._isSingleSelector = group && !group.multiple;
|
|
340
|
+
this.id = this.id || `mat-button-toggle-${_uniqueIdCounter++}`;
|
|
341
|
+
if (this._isSingleSelector) {
|
|
342
|
+
this.name = group.name;
|
|
343
|
+
}
|
|
344
|
+
if (group) {
|
|
345
|
+
if (group._isPrechecked(this)) {
|
|
346
|
+
this.checked = true;
|
|
351
347
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
359
|
-
// Remove the toggle from the selection once it's destroyed. Needs to happen
|
|
360
|
-
// on the next tick in order to avoid "changed after checked" errors.
|
|
361
|
-
if (group && group._isSelected(this)) {
|
|
362
|
-
group._syncButtonToggle(this, false, false, true);
|
|
348
|
+
else if (group._isSelected(this) !== this._checked) {
|
|
349
|
+
// As as side effect of the circular dependency between the toggle group and the button,
|
|
350
|
+
// we may end up in a state where the button is supposed to be checked on init, but it
|
|
351
|
+
// isn't, because the checked value was assigned too early. This can happen when Ivy
|
|
352
|
+
// assigns the static input value before the `ngOnInit` has run.
|
|
353
|
+
group._syncButtonToggle(this, this._checked);
|
|
363
354
|
}
|
|
364
355
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
356
|
+
}
|
|
357
|
+
ngAfterViewInit() {
|
|
358
|
+
this._focusMonitor.monitor(this._elementRef, true);
|
|
359
|
+
}
|
|
360
|
+
ngOnDestroy() {
|
|
361
|
+
const group = this.buttonToggleGroup;
|
|
362
|
+
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
363
|
+
// Remove the toggle from the selection once it's destroyed. Needs to happen
|
|
364
|
+
// on the next tick in order to avoid "changed after checked" errors.
|
|
365
|
+
if (group && group._isSelected(this)) {
|
|
366
|
+
group._syncButtonToggle(this, false, false, true);
|
|
368
367
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
368
|
+
}
|
|
369
|
+
/** Focuses the button. */
|
|
370
|
+
focus(options) {
|
|
371
|
+
this._buttonElement.nativeElement.focus(options);
|
|
372
|
+
}
|
|
373
|
+
/** Checks the button toggle due to an interaction with the underlying native button. */
|
|
374
|
+
_onButtonClick() {
|
|
375
|
+
const newChecked = this._isSingleSelector ? true : !this._checked;
|
|
376
|
+
if (newChecked !== this._checked) {
|
|
377
|
+
this._checked = newChecked;
|
|
378
|
+
if (this.buttonToggleGroup) {
|
|
379
|
+
this.buttonToggleGroup._syncButtonToggle(this, this._checked, true);
|
|
380
|
+
this.buttonToggleGroup._onTouched();
|
|
378
381
|
}
|
|
379
|
-
// Emit a change event when it's the single selector
|
|
380
|
-
this.change.emit(new MatButtonToggleChange(this, this.value));
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Marks the button toggle as needing checking for change detection.
|
|
384
|
-
* This method is exposed because the parent button toggle group will directly
|
|
385
|
-
* update bound properties of the radio button.
|
|
386
|
-
*/
|
|
387
|
-
_markForCheck() {
|
|
388
|
-
// When the group value changes, the button will not be notified.
|
|
389
|
-
// Use `markForCheck` to explicit update button toggle's status.
|
|
390
|
-
this._changeDetectorRef.markForCheck();
|
|
391
382
|
}
|
|
383
|
+
// Emit a change event when it's the single selector
|
|
384
|
+
this.change.emit(new MatButtonToggleChange(this, this.value));
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Marks the button toggle as needing checking for change detection.
|
|
388
|
+
* This method is exposed because the parent button toggle group will directly
|
|
389
|
+
* update bound properties of the radio button.
|
|
390
|
+
*/
|
|
391
|
+
_markForCheck() {
|
|
392
|
+
// When the group value changes, the button will not be notified.
|
|
393
|
+
// Use `markForCheck` to explicit update button toggle's status.
|
|
394
|
+
this._changeDetectorRef.markForCheck();
|
|
392
395
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
]
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
})();
|
|
396
|
+
}
|
|
397
|
+
MatButtonToggle.decorators = [
|
|
398
|
+
{ type: Component, args: [{
|
|
399
|
+
selector: 'mat-button-toggle',
|
|
400
|
+
template: "<button #button class=\"mat-button-toggle-button mat-focus-indicator\"\n type=\"button\"\n [id]=\"buttonId\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [attr.aria-pressed]=\"checked\"\n [disabled]=\"disabled || null\"\n [attr.name]=\"name || null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n (click)=\"_onButtonClick()\">\n <div class=\"mat-button-toggle-label-content\">\n <ng-content></ng-content>\n </div>\n</button>\n\n<div class=\"mat-button-toggle-focus-overlay\"></div>\n<div class=\"mat-button-toggle-ripple\" matRipple\n [matRippleTrigger]=\"button\"\n [matRippleDisabled]=\"this.disableRipple || this.disabled\">\n</div>\n",
|
|
401
|
+
encapsulation: ViewEncapsulation.None,
|
|
402
|
+
exportAs: 'matButtonToggle',
|
|
403
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
404
|
+
inputs: ['disableRipple'],
|
|
405
|
+
host: {
|
|
406
|
+
'[class.mat-button-toggle-standalone]': '!buttonToggleGroup',
|
|
407
|
+
'[class.mat-button-toggle-checked]': 'checked',
|
|
408
|
+
'[class.mat-button-toggle-disabled]': 'disabled',
|
|
409
|
+
'[class.mat-button-toggle-appearance-standard]': 'appearance === "standard"',
|
|
410
|
+
'class': 'mat-button-toggle',
|
|
411
|
+
// Always reset the tabindex to -1 so it doesn't conflict with the one on the `button`,
|
|
412
|
+
// but can still receive focus from things like cdkFocusInitial.
|
|
413
|
+
'[attr.tabindex]': '-1',
|
|
414
|
+
'[attr.id]': 'id',
|
|
415
|
+
'[attr.name]': 'null',
|
|
416
|
+
'(focus)': 'focus()',
|
|
417
|
+
},
|
|
418
|
+
styles: [".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;border-radius:2px;-webkit-tap-highlight-color:transparent}.cdk-high-contrast-active .mat-button-toggle-standalone,.cdk-high-contrast-active .mat-button-toggle-group{outline:solid 1px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:4px}.cdk-high-contrast-active .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.cdk-high-contrast-active .mat-button-toggle-group-appearance-standard{outline:0}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:1}.cdk-high-contrast-active .mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:.5}.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{opacity:.04}.mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.12}.cdk-high-contrast-active .mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.5}@media(hover: none){.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;line-height:36px;padding:0 16px;position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{border-radius:inherit;pointer-events:none;opacity:0;top:0;left:0;right:0;bottom:0;position:absolute}.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 36px}.cdk-high-contrast-active .mat-button-toggle-checked .mat-button-toggle-focus-overlay{opacity:.5;height:0}.cdk-high-contrast-active .mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}\n"]
|
|
419
|
+
},] }
|
|
420
|
+
];
|
|
421
|
+
MatButtonToggle.ctorParameters = () => [
|
|
422
|
+
{ type: MatButtonToggleGroup, decorators: [{ type: Optional }, { type: Inject, args: [MAT_BUTTON_TOGGLE_GROUP,] }] },
|
|
423
|
+
{ type: ChangeDetectorRef },
|
|
424
|
+
{ type: ElementRef },
|
|
425
|
+
{ type: FocusMonitor },
|
|
426
|
+
{ type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
|
427
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS,] }] }
|
|
428
|
+
];
|
|
429
|
+
MatButtonToggle.propDecorators = {
|
|
430
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
431
|
+
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
|
432
|
+
_buttonElement: [{ type: ViewChild, args: ['button',] }],
|
|
433
|
+
id: [{ type: Input }],
|
|
434
|
+
name: [{ type: Input }],
|
|
435
|
+
value: [{ type: Input }],
|
|
436
|
+
tabIndex: [{ type: Input }],
|
|
437
|
+
appearance: [{ type: Input }],
|
|
438
|
+
checked: [{ type: Input }],
|
|
439
|
+
disabled: [{ type: Input }],
|
|
440
|
+
change: [{ type: Output }]
|
|
441
|
+
};
|
|
440
442
|
|
|
441
443
|
/**
|
|
442
444
|
* @license
|
|
@@ -445,18 +447,15 @@ let MatButtonToggle = /** @class */ (() => {
|
|
|
445
447
|
* Use of this source code is governed by an MIT-style license that can be
|
|
446
448
|
* found in the LICENSE file at https://angular.io/license
|
|
447
449
|
*/
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
];
|
|
458
|
-
return MatButtonToggleModule;
|
|
459
|
-
})();
|
|
450
|
+
class MatButtonToggleModule {
|
|
451
|
+
}
|
|
452
|
+
MatButtonToggleModule.decorators = [
|
|
453
|
+
{ type: NgModule, args: [{
|
|
454
|
+
imports: [MatCommonModule, MatRippleModule],
|
|
455
|
+
exports: [MatCommonModule, MatButtonToggleGroup, MatButtonToggle],
|
|
456
|
+
declarations: [MatButtonToggleGroup, MatButtonToggle],
|
|
457
|
+
},] }
|
|
458
|
+
];
|
|
460
459
|
|
|
461
460
|
/**
|
|
462
461
|
* @license
|
|
@@ -470,5 +469,5 @@ let MatButtonToggleModule = /** @class */ (() => {
|
|
|
470
469
|
* Generated bundle index. Do not edit.
|
|
471
470
|
*/
|
|
472
471
|
|
|
473
|
-
export { MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS, MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR, MatButtonToggle, MatButtonToggleChange, MatButtonToggleGroup, MatButtonToggleModule };
|
|
472
|
+
export { MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS, MAT_BUTTON_TOGGLE_GROUP, MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR, MatButtonToggle, MatButtonToggleChange, MatButtonToggleGroup, MatButtonToggleModule };
|
|
474
473
|
//# sourceMappingURL=button-toggle.js.map
|