@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/radio.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken, forwardRef, EventEmitter, Directive, ChangeDetectorRef, Output, Input, ContentChildren,
|
|
1
|
+
import { InjectionToken, forwardRef, EventEmitter, Directive, ChangeDetectorRef, Output, Input, ContentChildren, ElementRef, ViewChild, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, NgModule } from '@angular/core';
|
|
2
2
|
import { mixinDisableRipple, mixinTabIndex, MatRippleModule, MatCommonModule } from '@angular/material/core';
|
|
3
3
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
4
4
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
@@ -45,223 +45,226 @@ class MatRadioChange {
|
|
|
45
45
|
this.value = value;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Injection token that can be used to inject instances of `MatRadioGroup`. It serves as
|
|
50
|
+
* alternative token to the actual `MatRadioGroup` class which could cause unnecessary
|
|
51
|
+
* retention of the class and its component metadata.
|
|
52
|
+
*/
|
|
53
|
+
const MAT_RADIO_GROUP = new InjectionToken('MatRadioGroup');
|
|
48
54
|
/**
|
|
49
55
|
* Base class with all of the `MatRadioGroup` functionality.
|
|
50
56
|
* @docs-private
|
|
51
57
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this._isInitialized = false;
|
|
64
|
-
/** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
|
|
65
|
-
this._labelPosition = 'after';
|
|
66
|
-
/** Whether the radio group is disabled. */
|
|
67
|
-
this._disabled = false;
|
|
68
|
-
/** Whether the radio group is required. */
|
|
69
|
-
this._required = false;
|
|
70
|
-
/** The method to be called in order to update ngModel */
|
|
71
|
-
this._controlValueAccessorChangeFn = () => { };
|
|
72
|
-
/**
|
|
73
|
-
* onTouch function registered via registerOnTouch (ControlValueAccessor).
|
|
74
|
-
* @docs-private
|
|
75
|
-
*/
|
|
76
|
-
this.onTouched = () => { };
|
|
77
|
-
/**
|
|
78
|
-
* Event emitted when the group value changes.
|
|
79
|
-
* Change events are only emitted when the value changes due to user interaction with
|
|
80
|
-
* a radio button (the same behavior as `<input type-"radio">`).
|
|
81
|
-
*/
|
|
82
|
-
this.change = new EventEmitter();
|
|
83
|
-
}
|
|
84
|
-
/** Name of the radio button group. All radio buttons inside this group will use this name. */
|
|
85
|
-
get name() { return this._name; }
|
|
86
|
-
set name(value) {
|
|
87
|
-
this._name = value;
|
|
88
|
-
this._updateRadioButtonNames();
|
|
89
|
-
}
|
|
58
|
+
class _MatRadioGroupBase {
|
|
59
|
+
constructor(_changeDetector) {
|
|
60
|
+
this._changeDetector = _changeDetector;
|
|
61
|
+
/** Selected value for the radio group. */
|
|
62
|
+
this._value = null;
|
|
63
|
+
/** The HTML name attribute applied to radio buttons in this group. */
|
|
64
|
+
this._name = `mat-radio-group-${nextUniqueId++}`;
|
|
65
|
+
/** The currently selected radio button. Should match value. */
|
|
66
|
+
this._selected = null;
|
|
67
|
+
/** Whether the `value` has been set to its initial value. */
|
|
68
|
+
this._isInitialized = false;
|
|
90
69
|
/** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
70
|
+
this._labelPosition = 'after';
|
|
71
|
+
/** Whether the radio group is disabled. */
|
|
72
|
+
this._disabled = false;
|
|
73
|
+
/** Whether the radio group is required. */
|
|
74
|
+
this._required = false;
|
|
75
|
+
/** The method to be called in order to update ngModel */
|
|
76
|
+
this._controlValueAccessorChangeFn = () => { };
|
|
98
77
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* radio button, this value persists to be applied in case a new radio button is added with a
|
|
102
|
-
* matching value.
|
|
78
|
+
* onTouch function registered via registerOnTouch (ControlValueAccessor).
|
|
79
|
+
* @docs-private
|
|
103
80
|
*/
|
|
104
|
-
|
|
105
|
-
set value(newValue) {
|
|
106
|
-
if (this._value !== newValue) {
|
|
107
|
-
// Set this before proceeding to ensure no circular loop occurs with selection.
|
|
108
|
-
this._value = newValue;
|
|
109
|
-
this._updateSelectedRadioFromValue();
|
|
110
|
-
this._checkSelectedRadioButton();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
_checkSelectedRadioButton() {
|
|
114
|
-
if (this._selected && !this._selected.checked) {
|
|
115
|
-
this._selected.checked = true;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
81
|
+
this.onTouched = () => { };
|
|
118
82
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
83
|
+
* Event emitted when the group value changes.
|
|
84
|
+
* Change events are only emitted when the value changes due to user interaction with
|
|
85
|
+
* a radio button (the same behavior as `<input type-"radio">`).
|
|
121
86
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
87
|
+
this.change = new EventEmitter();
|
|
88
|
+
}
|
|
89
|
+
/** Name of the radio button group. All radio buttons inside this group will use this name. */
|
|
90
|
+
get name() { return this._name; }
|
|
91
|
+
set name(value) {
|
|
92
|
+
this._name = value;
|
|
93
|
+
this._updateRadioButtonNames();
|
|
94
|
+
}
|
|
95
|
+
/** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
|
|
96
|
+
get labelPosition() {
|
|
97
|
+
return this._labelPosition;
|
|
98
|
+
}
|
|
99
|
+
set labelPosition(v) {
|
|
100
|
+
this._labelPosition = v === 'before' ? 'before' : 'after';
|
|
101
|
+
this._markRadiosForCheck();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Value for the radio-group. Should equal the value of the selected radio button if there is
|
|
105
|
+
* a corresponding radio button with a matching value. If there is not such a corresponding
|
|
106
|
+
* radio button, this value persists to be applied in case a new radio button is added with a
|
|
107
|
+
* matching value.
|
|
108
|
+
*/
|
|
109
|
+
get value() { return this._value; }
|
|
110
|
+
set value(newValue) {
|
|
111
|
+
if (this._value !== newValue) {
|
|
112
|
+
// Set this before proceeding to ensure no circular loop occurs with selection.
|
|
113
|
+
this._value = newValue;
|
|
114
|
+
this._updateSelectedRadioFromValue();
|
|
126
115
|
this._checkSelectedRadioButton();
|
|
127
116
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.
|
|
132
|
-
this._markRadiosForCheck();
|
|
133
|
-
}
|
|
134
|
-
/** Whether the radio group is required */
|
|
135
|
-
get required() { return this._required; }
|
|
136
|
-
set required(value) {
|
|
137
|
-
this._required = coerceBooleanProperty(value);
|
|
138
|
-
this._markRadiosForCheck();
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Initialize properties once content children are available.
|
|
142
|
-
* This allows us to propagate relevant attributes to associated buttons.
|
|
143
|
-
*/
|
|
144
|
-
ngAfterContentInit() {
|
|
145
|
-
// Mark this component as initialized in AfterContentInit because the initial value can
|
|
146
|
-
// possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the
|
|
147
|
-
// NgModel occurs *after* the OnInit of the MatRadioGroup.
|
|
148
|
-
this._isInitialized = true;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Mark this group as being "touched" (for ngModel). Meant to be called by the contained
|
|
152
|
-
* radio buttons upon their blur.
|
|
153
|
-
*/
|
|
154
|
-
_touch() {
|
|
155
|
-
if (this.onTouched) {
|
|
156
|
-
this.onTouched();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
_updateRadioButtonNames() {
|
|
160
|
-
if (this._radios) {
|
|
161
|
-
this._radios.forEach(radio => {
|
|
162
|
-
radio.name = this.name;
|
|
163
|
-
radio._markForCheck();
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/** Updates the `selected` radio button from the internal _value state. */
|
|
168
|
-
_updateSelectedRadioFromValue() {
|
|
169
|
-
// If the value already matches the selected radio, do nothing.
|
|
170
|
-
const isAlreadySelected = this._selected !== null && this._selected.value === this._value;
|
|
171
|
-
if (this._radios && !isAlreadySelected) {
|
|
172
|
-
this._selected = null;
|
|
173
|
-
this._radios.forEach(radio => {
|
|
174
|
-
radio.checked = this.value === radio.value;
|
|
175
|
-
if (radio.checked) {
|
|
176
|
-
this._selected = radio;
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/** Dispatch change event with current selection and group value. */
|
|
182
|
-
_emitChangeEvent() {
|
|
183
|
-
if (this._isInitialized) {
|
|
184
|
-
this.change.emit(new MatRadioChange(this._selected, this._value));
|
|
185
|
-
}
|
|
117
|
+
}
|
|
118
|
+
_checkSelectedRadioButton() {
|
|
119
|
+
if (this._selected && !this._selected.checked) {
|
|
120
|
+
this._selected.checked = true;
|
|
186
121
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The currently selected radio button. If set to a new radio button, the radio group value
|
|
125
|
+
* will be updated to match the new selected button.
|
|
126
|
+
*/
|
|
127
|
+
get selected() { return this._selected; }
|
|
128
|
+
set selected(selected) {
|
|
129
|
+
this._selected = selected;
|
|
130
|
+
this.value = selected ? selected.value : null;
|
|
131
|
+
this._checkSelectedRadioButton();
|
|
132
|
+
}
|
|
133
|
+
/** Whether the radio group is disabled */
|
|
134
|
+
get disabled() { return this._disabled; }
|
|
135
|
+
set disabled(value) {
|
|
136
|
+
this._disabled = coerceBooleanProperty(value);
|
|
137
|
+
this._markRadiosForCheck();
|
|
138
|
+
}
|
|
139
|
+
/** Whether the radio group is required */
|
|
140
|
+
get required() { return this._required; }
|
|
141
|
+
set required(value) {
|
|
142
|
+
this._required = coerceBooleanProperty(value);
|
|
143
|
+
this._markRadiosForCheck();
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Initialize properties once content children are available.
|
|
147
|
+
* This allows us to propagate relevant attributes to associated buttons.
|
|
148
|
+
*/
|
|
149
|
+
ngAfterContentInit() {
|
|
150
|
+
// Mark this component as initialized in AfterContentInit because the initial value can
|
|
151
|
+
// possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the
|
|
152
|
+
// NgModel occurs *after* the OnInit of the MatRadioGroup.
|
|
153
|
+
this._isInitialized = true;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Mark this group as being "touched" (for ngModel). Meant to be called by the contained
|
|
157
|
+
* radio buttons upon their blur.
|
|
158
|
+
*/
|
|
159
|
+
_touch() {
|
|
160
|
+
if (this.onTouched) {
|
|
161
|
+
this.onTouched();
|
|
191
162
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
163
|
+
}
|
|
164
|
+
_updateRadioButtonNames() {
|
|
165
|
+
if (this._radios) {
|
|
166
|
+
this._radios.forEach(radio => {
|
|
167
|
+
radio.name = this.name;
|
|
168
|
+
radio._markForCheck();
|
|
169
|
+
});
|
|
199
170
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
this.
|
|
171
|
+
}
|
|
172
|
+
/** Updates the `selected` radio button from the internal _value state. */
|
|
173
|
+
_updateSelectedRadioFromValue() {
|
|
174
|
+
// If the value already matches the selected radio, do nothing.
|
|
175
|
+
const isAlreadySelected = this._selected !== null && this._selected.value === this._value;
|
|
176
|
+
if (this._radios && !isAlreadySelected) {
|
|
177
|
+
this._selected = null;
|
|
178
|
+
this._radios.forEach(radio => {
|
|
179
|
+
radio.checked = this.value === radio.value;
|
|
180
|
+
if (radio.checked) {
|
|
181
|
+
this._selected = radio;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
207
184
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
registerOnTouched(fn) {
|
|
214
|
-
this.onTouched = fn;
|
|
185
|
+
}
|
|
186
|
+
/** Dispatch change event with current selection and group value. */
|
|
187
|
+
_emitChangeEvent() {
|
|
188
|
+
if (this._isInitialized) {
|
|
189
|
+
this.change.emit(new MatRadioChange(this._selected, this._value));
|
|
215
190
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
setDisabledState(isDisabled) {
|
|
221
|
-
this.disabled = isDisabled;
|
|
222
|
-
this._changeDetector.markForCheck();
|
|
191
|
+
}
|
|
192
|
+
_markRadiosForCheck() {
|
|
193
|
+
if (this._radios) {
|
|
194
|
+
this._radios.forEach(radio => radio._markForCheck());
|
|
223
195
|
}
|
|
224
196
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Sets the model value. Implemented as part of ControlValueAccessor.
|
|
199
|
+
* @param value
|
|
200
|
+
*/
|
|
201
|
+
writeValue(value) {
|
|
202
|
+
this.value = value;
|
|
203
|
+
this._changeDetector.markForCheck();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Registers a callback to be triggered when the model value changes.
|
|
207
|
+
* Implemented as part of ControlValueAccessor.
|
|
208
|
+
* @param fn Callback to be registered.
|
|
209
|
+
*/
|
|
210
|
+
registerOnChange(fn) {
|
|
211
|
+
this._controlValueAccessorChangeFn = fn;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Registers a callback to be triggered when the control is touched.
|
|
215
|
+
* Implemented as part of ControlValueAccessor.
|
|
216
|
+
* @param fn Callback to be registered.
|
|
217
|
+
*/
|
|
218
|
+
registerOnTouched(fn) {
|
|
219
|
+
this.onTouched = fn;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
|
|
223
|
+
* @param isDisabled Whether the control should be disabled.
|
|
224
|
+
*/
|
|
225
|
+
setDisabledState(isDisabled) {
|
|
226
|
+
this.disabled = isDisabled;
|
|
227
|
+
this._changeDetector.markForCheck();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
_MatRadioGroupBase.decorators = [
|
|
231
|
+
{ type: Directive }
|
|
232
|
+
];
|
|
233
|
+
_MatRadioGroupBase.ctorParameters = () => [
|
|
234
|
+
{ type: ChangeDetectorRef }
|
|
235
|
+
];
|
|
236
|
+
_MatRadioGroupBase.propDecorators = {
|
|
237
|
+
change: [{ type: Output }],
|
|
238
|
+
color: [{ type: Input }],
|
|
239
|
+
name: [{ type: Input }],
|
|
240
|
+
labelPosition: [{ type: Input }],
|
|
241
|
+
value: [{ type: Input }],
|
|
242
|
+
selected: [{ type: Input }],
|
|
243
|
+
disabled: [{ type: Input }],
|
|
244
|
+
required: [{ type: Input }]
|
|
245
|
+
};
|
|
243
246
|
/**
|
|
244
247
|
* A group of radio buttons. May contain one or more `<mat-radio-button>` elements.
|
|
245
248
|
*/
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
249
|
+
class MatRadioGroup extends _MatRadioGroupBase {
|
|
250
|
+
}
|
|
251
|
+
MatRadioGroup.decorators = [
|
|
252
|
+
{ type: Directive, args: [{
|
|
253
|
+
selector: 'mat-radio-group',
|
|
254
|
+
exportAs: 'matRadioGroup',
|
|
255
|
+
providers: [
|
|
256
|
+
MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
|
|
257
|
+
{ provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },
|
|
258
|
+
],
|
|
259
|
+
host: {
|
|
260
|
+
'role': 'radiogroup',
|
|
261
|
+
'class': 'mat-radio-group',
|
|
262
|
+
},
|
|
263
|
+
},] }
|
|
264
|
+
];
|
|
265
|
+
MatRadioGroup.propDecorators = {
|
|
266
|
+
_radios: [{ type: ContentChildren, args: [forwardRef(() => MatRadioButton), { descendants: true },] }]
|
|
267
|
+
};
|
|
265
268
|
// Boilerplate for applying mixins to MatRadioButton.
|
|
266
269
|
/** @docs-private */
|
|
267
270
|
class MatRadioButtonBase {
|
|
@@ -276,265 +279,259 @@ const _MatRadioButtonMixinBase = mixinDisableRipple(mixinTabIndex(MatRadioButton
|
|
|
276
279
|
* Base class with all of the `MatRadioButton` functionality.
|
|
277
280
|
* @docs-private
|
|
278
281
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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
|
-
this.checked = false;
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
/** Whether this radio button is checked. */
|
|
314
|
-
get checked() { return this._checked; }
|
|
315
|
-
set checked(value) {
|
|
316
|
-
const newCheckedState = coerceBooleanProperty(value);
|
|
317
|
-
if (this._checked !== newCheckedState) {
|
|
318
|
-
this._checked = newCheckedState;
|
|
319
|
-
if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
|
|
320
|
-
this.radioGroup.selected = this;
|
|
321
|
-
}
|
|
322
|
-
else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {
|
|
323
|
-
// When unchecking the selected radio button, update the selected radio
|
|
324
|
-
// property on the group.
|
|
325
|
-
this.radioGroup.selected = null;
|
|
326
|
-
}
|
|
327
|
-
if (newCheckedState) {
|
|
328
|
-
// Notify all radio buttons with the same name to un-check.
|
|
329
|
-
this._radioDispatcher.notify(this.id, this.name);
|
|
282
|
+
class _MatRadioButtonBase extends _MatRadioButtonMixinBase {
|
|
283
|
+
constructor(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, _animationMode, _providerOverride) {
|
|
284
|
+
super(elementRef);
|
|
285
|
+
this._changeDetector = _changeDetector;
|
|
286
|
+
this._focusMonitor = _focusMonitor;
|
|
287
|
+
this._radioDispatcher = _radioDispatcher;
|
|
288
|
+
this._animationMode = _animationMode;
|
|
289
|
+
this._providerOverride = _providerOverride;
|
|
290
|
+
this._uniqueId = `mat-radio-${++nextUniqueId}`;
|
|
291
|
+
/** The unique ID for the radio button. */
|
|
292
|
+
this.id = this._uniqueId;
|
|
293
|
+
/**
|
|
294
|
+
* Event emitted when the checked state of this radio button changes.
|
|
295
|
+
* Change events are only emitted when the value changes due to user interaction with
|
|
296
|
+
* the radio button (the same behavior as `<input type-"radio">`).
|
|
297
|
+
*/
|
|
298
|
+
this.change = new EventEmitter();
|
|
299
|
+
/** Whether this radio is checked. */
|
|
300
|
+
this._checked = false;
|
|
301
|
+
/** Value assigned to this radio. */
|
|
302
|
+
this._value = null;
|
|
303
|
+
/** Unregister function for _radioDispatcher */
|
|
304
|
+
this._removeUniqueSelectionListener = () => { };
|
|
305
|
+
// Assertions. Ideally these should be stripped out by the compiler.
|
|
306
|
+
// TODO(jelbourn): Assert that there's no name binding AND a parent radio group.
|
|
307
|
+
this.radioGroup = radioGroup;
|
|
308
|
+
this._removeUniqueSelectionListener =
|
|
309
|
+
_radioDispatcher.listen((id, name) => {
|
|
310
|
+
if (id !== this.id && name === this.name) {
|
|
311
|
+
this.checked = false;
|
|
330
312
|
}
|
|
331
|
-
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/** Whether this radio button is checked. */
|
|
316
|
+
get checked() { return this._checked; }
|
|
317
|
+
set checked(value) {
|
|
318
|
+
const newCheckedState = coerceBooleanProperty(value);
|
|
319
|
+
if (this._checked !== newCheckedState) {
|
|
320
|
+
this._checked = newCheckedState;
|
|
321
|
+
if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
|
|
322
|
+
this.radioGroup.selected = this;
|
|
332
323
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (this._value !== value) {
|
|
338
|
-
this._value = value;
|
|
339
|
-
if (this.radioGroup !== null) {
|
|
340
|
-
if (!this.checked) {
|
|
341
|
-
// Update checked when the value changed to match the radio group's value
|
|
342
|
-
this.checked = this.radioGroup.value === value;
|
|
343
|
-
}
|
|
344
|
-
if (this.checked) {
|
|
345
|
-
this.radioGroup.selected = this;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
324
|
+
else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {
|
|
325
|
+
// When unchecking the selected radio button, update the selected radio
|
|
326
|
+
// property on the group.
|
|
327
|
+
this.radioGroup.selected = null;
|
|
348
328
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';
|
|
353
|
-
}
|
|
354
|
-
set labelPosition(value) {
|
|
355
|
-
this._labelPosition = value;
|
|
356
|
-
}
|
|
357
|
-
/** Whether the radio button is disabled. */
|
|
358
|
-
get disabled() {
|
|
359
|
-
return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
|
|
360
|
-
}
|
|
361
|
-
set disabled(value) {
|
|
362
|
-
this._setDisabled(coerceBooleanProperty(value));
|
|
363
|
-
}
|
|
364
|
-
/** Whether the radio button is required. */
|
|
365
|
-
get required() {
|
|
366
|
-
return this._required || (this.radioGroup && this.radioGroup.required);
|
|
367
|
-
}
|
|
368
|
-
set required(value) {
|
|
369
|
-
this._required = coerceBooleanProperty(value);
|
|
370
|
-
}
|
|
371
|
-
/** Theme color of the radio button. */
|
|
372
|
-
get color() {
|
|
373
|
-
return this._color ||
|
|
374
|
-
(this.radioGroup && this.radioGroup.color) ||
|
|
375
|
-
this._providerOverride && this._providerOverride.color || 'accent';
|
|
376
|
-
}
|
|
377
|
-
set color(newValue) { this._color = newValue; }
|
|
378
|
-
/** ID of the native input element inside `<mat-radio-button>` */
|
|
379
|
-
get inputId() { return `${this.id || this._uniqueId}-input`; }
|
|
380
|
-
/** Focuses the radio button. */
|
|
381
|
-
focus(options) {
|
|
382
|
-
this._focusMonitor.focusVia(this._inputElement, 'keyboard', options);
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Marks the radio button as needing checking for change detection.
|
|
386
|
-
* This method is exposed because the parent radio group will directly
|
|
387
|
-
* update bound properties of the radio button.
|
|
388
|
-
*/
|
|
389
|
-
_markForCheck() {
|
|
390
|
-
// When group value changes, the button will not be notified. Use `markForCheck` to explicit
|
|
391
|
-
// update radio button's status
|
|
392
|
-
this._changeDetector.markForCheck();
|
|
393
|
-
}
|
|
394
|
-
ngOnInit() {
|
|
395
|
-
if (this.radioGroup) {
|
|
396
|
-
// If the radio is inside a radio group, determine if it should be checked
|
|
397
|
-
this.checked = this.radioGroup.value === this._value;
|
|
398
|
-
// Copy name from parent radio group
|
|
399
|
-
this.name = this.radioGroup.name;
|
|
329
|
+
if (newCheckedState) {
|
|
330
|
+
// Notify all radio buttons with the same name to un-check.
|
|
331
|
+
this._radioDispatcher.notify(this.id, this.name);
|
|
400
332
|
}
|
|
333
|
+
this._changeDetector.markForCheck();
|
|
401
334
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
335
|
+
}
|
|
336
|
+
/** The value of this radio button. */
|
|
337
|
+
get value() { return this._value; }
|
|
338
|
+
set value(value) {
|
|
339
|
+
if (this._value !== value) {
|
|
340
|
+
this._value = value;
|
|
341
|
+
if (this.radioGroup !== null) {
|
|
342
|
+
if (!this.checked) {
|
|
343
|
+
// Update checked when the value changed to match the radio group's value
|
|
344
|
+
this.checked = this.radioGroup.value === value;
|
|
408
345
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
ngOnDestroy() {
|
|
412
|
-
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
413
|
-
this._removeUniqueSelectionListener();
|
|
414
|
-
}
|
|
415
|
-
/** Dispatch change event with current value. */
|
|
416
|
-
_emitChangeEvent() {
|
|
417
|
-
this.change.emit(new MatRadioChange(this, this._value));
|
|
418
|
-
}
|
|
419
|
-
_isRippleDisabled() {
|
|
420
|
-
return this.disableRipple || this.disabled;
|
|
421
|
-
}
|
|
422
|
-
_onInputClick(event) {
|
|
423
|
-
// We have to stop propagation for click events on the visual hidden input element.
|
|
424
|
-
// By default, when a user clicks on a label element, a generated click event will be
|
|
425
|
-
// dispatched on the associated input element. Since we are using a label element as our
|
|
426
|
-
// root container, the click event on the `radio-button` will be executed twice.
|
|
427
|
-
// The real click event will bubble up, and the generated click event also tries to bubble up.
|
|
428
|
-
// This will lead to multiple click events.
|
|
429
|
-
// Preventing bubbling for the second event will solve that issue.
|
|
430
|
-
event.stopPropagation();
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Triggered when the radio button received a click or the input recognized any change.
|
|
434
|
-
* Clicking on a label element, will trigger a change event on the associated input.
|
|
435
|
-
*/
|
|
436
|
-
_onInputChange(event) {
|
|
437
|
-
// We always have to stop propagation on the change event.
|
|
438
|
-
// Otherwise the change event, from the input element, will bubble up and
|
|
439
|
-
// emit its event object to the `change` output.
|
|
440
|
-
event.stopPropagation();
|
|
441
|
-
const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;
|
|
442
|
-
this.checked = true;
|
|
443
|
-
this._emitChangeEvent();
|
|
444
|
-
if (this.radioGroup) {
|
|
445
|
-
this.radioGroup._controlValueAccessorChangeFn(this.value);
|
|
446
|
-
if (groupValueChanged) {
|
|
447
|
-
this.radioGroup._emitChangeEvent();
|
|
346
|
+
if (this.checked) {
|
|
347
|
+
this.radioGroup.selected = this;
|
|
448
348
|
}
|
|
449
349
|
}
|
|
450
350
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
351
|
+
}
|
|
352
|
+
/** Whether the label should appear after or before the radio button. Defaults to 'after' */
|
|
353
|
+
get labelPosition() {
|
|
354
|
+
return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';
|
|
355
|
+
}
|
|
356
|
+
set labelPosition(value) {
|
|
357
|
+
this._labelPosition = value;
|
|
358
|
+
}
|
|
359
|
+
/** Whether the radio button is disabled. */
|
|
360
|
+
get disabled() {
|
|
361
|
+
return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
|
|
362
|
+
}
|
|
363
|
+
set disabled(value) {
|
|
364
|
+
this._setDisabled(coerceBooleanProperty(value));
|
|
365
|
+
}
|
|
366
|
+
/** Whether the radio button is required. */
|
|
367
|
+
get required() {
|
|
368
|
+
return this._required || (this.radioGroup && this.radioGroup.required);
|
|
369
|
+
}
|
|
370
|
+
set required(value) {
|
|
371
|
+
this._required = coerceBooleanProperty(value);
|
|
372
|
+
}
|
|
373
|
+
/** Theme color of the radio button. */
|
|
374
|
+
get color() {
|
|
375
|
+
return this._color ||
|
|
376
|
+
(this.radioGroup && this.radioGroup.color) ||
|
|
377
|
+
this._providerOverride && this._providerOverride.color || 'accent';
|
|
378
|
+
}
|
|
379
|
+
set color(newValue) { this._color = newValue; }
|
|
380
|
+
/** ID of the native input element inside `<mat-radio-button>` */
|
|
381
|
+
get inputId() { return `${this.id || this._uniqueId}-input`; }
|
|
382
|
+
/** Focuses the radio button. */
|
|
383
|
+
focus(options) {
|
|
384
|
+
this._focusMonitor.focusVia(this._inputElement, 'keyboard', options);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Marks the radio button as needing checking for change detection.
|
|
388
|
+
* This method is exposed because the parent radio group will directly
|
|
389
|
+
* update bound properties of the radio button.
|
|
390
|
+
*/
|
|
391
|
+
_markForCheck() {
|
|
392
|
+
// When group value changes, the button will not be notified. Use `markForCheck` to explicit
|
|
393
|
+
// update radio button's status
|
|
394
|
+
this._changeDetector.markForCheck();
|
|
395
|
+
}
|
|
396
|
+
ngOnInit() {
|
|
397
|
+
if (this.radioGroup) {
|
|
398
|
+
// If the radio is inside a radio group, determine if it should be checked
|
|
399
|
+
this.checked = this.radioGroup.value === this._value;
|
|
400
|
+
// Copy name from parent radio group
|
|
401
|
+
this.name = this.radioGroup.name;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
ngAfterViewInit() {
|
|
405
|
+
this._focusMonitor
|
|
406
|
+
.monitor(this._elementRef, true)
|
|
407
|
+
.subscribe(focusOrigin => {
|
|
408
|
+
if (!focusOrigin && this.radioGroup) {
|
|
409
|
+
this.radioGroup._touch();
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
ngOnDestroy() {
|
|
414
|
+
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
415
|
+
this._removeUniqueSelectionListener();
|
|
416
|
+
}
|
|
417
|
+
/** Dispatch change event with current value. */
|
|
418
|
+
_emitChangeEvent() {
|
|
419
|
+
this.change.emit(new MatRadioChange(this, this._value));
|
|
420
|
+
}
|
|
421
|
+
_isRippleDisabled() {
|
|
422
|
+
return this.disableRipple || this.disabled;
|
|
423
|
+
}
|
|
424
|
+
_onInputClick(event) {
|
|
425
|
+
// We have to stop propagation for click events on the visual hidden input element.
|
|
426
|
+
// By default, when a user clicks on a label element, a generated click event will be
|
|
427
|
+
// dispatched on the associated input element. Since we are using a label element as our
|
|
428
|
+
// root container, the click event on the `radio-button` will be executed twice.
|
|
429
|
+
// The real click event will bubble up, and the generated click event also tries to bubble up.
|
|
430
|
+
// This will lead to multiple click events.
|
|
431
|
+
// Preventing bubbling for the second event will solve that issue.
|
|
432
|
+
event.stopPropagation();
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Triggered when the radio button received a click or the input recognized any change.
|
|
436
|
+
* Clicking on a label element, will trigger a change event on the associated input.
|
|
437
|
+
*/
|
|
438
|
+
_onInputChange(event) {
|
|
439
|
+
// We always have to stop propagation on the change event.
|
|
440
|
+
// Otherwise the change event, from the input element, will bubble up and
|
|
441
|
+
// emit its event object to the `change` output.
|
|
442
|
+
event.stopPropagation();
|
|
443
|
+
const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;
|
|
444
|
+
this.checked = true;
|
|
445
|
+
this._emitChangeEvent();
|
|
446
|
+
if (this.radioGroup) {
|
|
447
|
+
this.radioGroup._controlValueAccessorChangeFn(this.value);
|
|
448
|
+
if (groupValueChanged) {
|
|
449
|
+
this.radioGroup._emitChangeEvent();
|
|
456
450
|
}
|
|
457
451
|
}
|
|
458
452
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
}
|
|
453
|
+
/** Sets the disabled state and marks for check if a change occurred. */
|
|
454
|
+
_setDisabled(value) {
|
|
455
|
+
if (this._disabled !== value) {
|
|
456
|
+
this._disabled = value;
|
|
457
|
+
this._changeDetector.markForCheck();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
_MatRadioButtonBase.decorators = [
|
|
462
|
+
{ type: Directive }
|
|
463
|
+
];
|
|
464
|
+
_MatRadioButtonBase.ctorParameters = () => [
|
|
465
|
+
{ type: _MatRadioGroupBase },
|
|
466
|
+
{ type: ElementRef },
|
|
467
|
+
{ type: ChangeDetectorRef },
|
|
468
|
+
{ type: FocusMonitor },
|
|
469
|
+
{ type: UniqueSelectionDispatcher },
|
|
470
|
+
{ type: String },
|
|
471
|
+
{ type: undefined }
|
|
472
|
+
];
|
|
473
|
+
_MatRadioButtonBase.propDecorators = {
|
|
474
|
+
id: [{ type: Input }],
|
|
475
|
+
name: [{ type: Input }],
|
|
476
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
477
|
+
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
|
478
|
+
ariaDescribedby: [{ type: Input, args: ['aria-describedby',] }],
|
|
479
|
+
checked: [{ type: Input }],
|
|
480
|
+
value: [{ type: Input }],
|
|
481
|
+
labelPosition: [{ type: Input }],
|
|
482
|
+
disabled: [{ type: Input }],
|
|
483
|
+
required: [{ type: Input }],
|
|
484
|
+
color: [{ type: Input }],
|
|
485
|
+
change: [{ type: Output }],
|
|
486
|
+
_inputElement: [{ type: ViewChild, args: ['input',] }]
|
|
487
|
+
};
|
|
488
488
|
/**
|
|
489
489
|
* A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.
|
|
490
490
|
*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
super(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher, animationMode, providerOverride);
|
|
495
|
-
}
|
|
491
|
+
class MatRadioButton extends _MatRadioButtonBase {
|
|
492
|
+
constructor(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher, animationMode, providerOverride) {
|
|
493
|
+
super(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher, animationMode, providerOverride);
|
|
496
494
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
},] }
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
]
|
|
536
|
-
|
|
537
|
-
})();
|
|
495
|
+
}
|
|
496
|
+
MatRadioButton.decorators = [
|
|
497
|
+
{ type: Component, args: [{
|
|
498
|
+
selector: 'mat-radio-button',
|
|
499
|
+
template: "<!-- TODO(jelbourn): render the radio on either side of the content -->\n<!-- TODO(mtlin): Evaluate trade-offs of using native radio vs. cost of additional bindings. -->\n<label [attr.for]=\"inputId\" class=\"mat-radio-label\" #label>\n <!-- The actual 'radio' part of the control. -->\n <div class=\"mat-radio-container\">\n <div class=\"mat-radio-outer-circle\"></div>\n <div class=\"mat-radio-inner-circle\"></div>\n <input #input class=\"mat-radio-input cdk-visually-hidden\" type=\"radio\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [tabIndex]=\"tabIndex\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n (change)=\"_onInputChange($event)\"\n (click)=\"_onInputClick($event)\">\n\n <!-- The ripple comes after the input so that we can target it with a CSS\n sibling selector when the input is focused. -->\n <div mat-ripple class=\"mat-radio-ripple mat-focus-indicator\"\n [matRippleTrigger]=\"label\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleCentered]=\"true\"\n [matRippleRadius]=\"20\"\n [matRippleAnimation]=\"{enterDuration: 150}\">\n\n <div class=\"mat-ripple-element mat-radio-persistent-ripple\"></div>\n </div>\n </div>\n\n <!-- The label content for radio control. -->\n <div class=\"mat-radio-label-content\" [class.mat-radio-label-before]=\"labelPosition == 'before'\">\n <!-- Add an invisible span so JAWS can read the label -->\n <span style=\"display:none\"> </span>\n <ng-content></ng-content>\n </div>\n</label>\n",
|
|
500
|
+
inputs: ['disableRipple', 'tabIndex'],
|
|
501
|
+
encapsulation: ViewEncapsulation.None,
|
|
502
|
+
exportAs: 'matRadioButton',
|
|
503
|
+
host: {
|
|
504
|
+
'class': 'mat-radio-button',
|
|
505
|
+
'[class.mat-radio-checked]': 'checked',
|
|
506
|
+
'[class.mat-radio-disabled]': 'disabled',
|
|
507
|
+
'[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
|
|
508
|
+
'[class.mat-primary]': 'color === "primary"',
|
|
509
|
+
'[class.mat-accent]': 'color === "accent"',
|
|
510
|
+
'[class.mat-warn]': 'color === "warn"',
|
|
511
|
+
// Needs to be -1 so the `focus` event still fires.
|
|
512
|
+
'[attr.tabindex]': '-1',
|
|
513
|
+
'[attr.id]': 'id',
|
|
514
|
+
'[attr.aria-label]': 'null',
|
|
515
|
+
'[attr.aria-labelledby]': 'null',
|
|
516
|
+
'[attr.aria-describedby]': 'null',
|
|
517
|
+
// Note: under normal conditions focus shouldn't land on this element, however it may be
|
|
518
|
+
// programmatically set, for example inside of a focus trap, in this case we want to forward
|
|
519
|
+
// the focus to the native element.
|
|
520
|
+
'(focus)': '_inputElement.nativeElement.focus()',
|
|
521
|
+
},
|
|
522
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
523
|
+
styles: [".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(0.001)}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5)}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"]
|
|
524
|
+
},] }
|
|
525
|
+
];
|
|
526
|
+
MatRadioButton.ctorParameters = () => [
|
|
527
|
+
{ type: MatRadioGroup, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RADIO_GROUP,] }] },
|
|
528
|
+
{ type: ElementRef },
|
|
529
|
+
{ type: ChangeDetectorRef },
|
|
530
|
+
{ type: FocusMonitor },
|
|
531
|
+
{ type: UniqueSelectionDispatcher },
|
|
532
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] },
|
|
533
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RADIO_DEFAULT_OPTIONS,] }] }
|
|
534
|
+
];
|
|
538
535
|
|
|
539
536
|
/**
|
|
540
537
|
* @license
|
|
@@ -543,18 +540,15 @@ let MatRadioButton = /** @class */ (() => {
|
|
|
543
540
|
* Use of this source code is governed by an MIT-style license that can be
|
|
544
541
|
* found in the LICENSE file at https://angular.io/license
|
|
545
542
|
*/
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
];
|
|
556
|
-
return MatRadioModule;
|
|
557
|
-
})();
|
|
543
|
+
class MatRadioModule {
|
|
544
|
+
}
|
|
545
|
+
MatRadioModule.decorators = [
|
|
546
|
+
{ type: NgModule, args: [{
|
|
547
|
+
imports: [MatRippleModule, MatCommonModule],
|
|
548
|
+
exports: [MatRadioGroup, MatRadioButton, MatCommonModule],
|
|
549
|
+
declarations: [MatRadioGroup, MatRadioButton],
|
|
550
|
+
},] }
|
|
551
|
+
];
|
|
558
552
|
|
|
559
553
|
/**
|
|
560
554
|
* @license
|
|
@@ -568,5 +562,5 @@ let MatRadioModule = /** @class */ (() => {
|
|
|
568
562
|
* Generated bundle index. Do not edit.
|
|
569
563
|
*/
|
|
570
564
|
|
|
571
|
-
export { MAT_RADIO_DEFAULT_OPTIONS, MAT_RADIO_DEFAULT_OPTIONS_FACTORY, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule, _MatRadioButtonBase, _MatRadioGroupBase };
|
|
565
|
+
export { MAT_RADIO_DEFAULT_OPTIONS, MAT_RADIO_DEFAULT_OPTIONS_FACTORY, MAT_RADIO_GROUP, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule, _MatRadioButtonBase, _MatRadioGroupBase };
|
|
572
566
|
//# sourceMappingURL=radio.js.map
|