@angular/material 12.0.6 → 12.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/autocomplete/autocomplete.d.ts +4 -4
- package/autocomplete/index.metadata.json +1 -1
- package/badge/_badge-theme.scss +7 -6
- package/badge/badge.d.ts +5 -5
- package/badge/index.metadata.json +1 -1
- package/bundles/material-autocomplete-testing.umd.js +14 -11
- package/bundles/material-autocomplete-testing.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.js +18 -16
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-badge-testing.umd.js +14 -11
- package/bundles/material-badge-testing.umd.js.map +1 -1
- package/bundles/material-badge.umd.js +19 -17
- package/bundles/material-badge.umd.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.js +14 -11
- package/bundles/material-bottom-sheet-testing.umd.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.js +14 -11
- package/bundles/material-bottom-sheet.umd.js.map +1 -1
- package/bundles/material-button-testing.umd.js +14 -11
- package/bundles/material-button-testing.umd.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.js +14 -11
- package/bundles/material-button-toggle-testing.umd.js.map +1 -1
- package/bundles/material-button-toggle.umd.js +19 -17
- package/bundles/material-button-toggle.umd.js.map +1 -1
- package/bundles/material-button.umd.js +19 -18
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-card-testing.umd.js +14 -11
- package/bundles/material-card-testing.umd.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.js +14 -11
- package/bundles/material-checkbox-testing.umd.js.map +1 -1
- package/bundles/material-checkbox.umd.js +19 -17
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-chips-testing.umd.js +14 -11
- package/bundles/material-chips-testing.umd.js.map +1 -1
- package/bundles/material-chips.umd.js +19 -17
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-core-testing.umd.js +14 -11
- package/bundles/material-core-testing.umd.js.map +1 -1
- package/bundles/material-core.umd.js +20 -18
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-datepicker-testing.umd.js +14 -11
- package/bundles/material-datepicker-testing.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.js +21 -21
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-dialog-testing.umd.js +14 -11
- package/bundles/material-dialog-testing.umd.js.map +1 -1
- package/bundles/material-dialog.umd.js +23 -12
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-divider-testing.umd.js +14 -11
- package/bundles/material-divider-testing.umd.js.map +1 -1
- package/bundles/material-expansion-testing.umd.js +14 -11
- package/bundles/material-expansion-testing.umd.js.map +1 -1
- package/bundles/material-expansion.umd.js +42 -33
- package/bundles/material-expansion.umd.js.map +1 -1
- package/bundles/material-form-field-testing-control.umd.js +14 -11
- package/bundles/material-form-field-testing-control.umd.js.map +1 -1
- package/bundles/material-form-field-testing.umd.js +14 -11
- package/bundles/material-form-field-testing.umd.js.map +1 -1
- package/bundles/material-form-field.umd.js +20 -22
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.js +14 -11
- package/bundles/material-grid-list-testing.umd.js.map +1 -1
- package/bundles/material-grid-list.umd.js +16 -15
- package/bundles/material-grid-list.umd.js.map +1 -1
- package/bundles/material-icon-testing.umd.js +14 -11
- package/bundles/material-icon-testing.umd.js.map +1 -1
- package/bundles/material-icon.umd.js +19 -17
- package/bundles/material-icon.umd.js.map +1 -1
- package/bundles/material-input-testing.umd.js +14 -11
- package/bundles/material-input-testing.umd.js.map +1 -1
- package/bundles/material-input.umd.js +20 -17
- package/bundles/material-input.umd.js.map +1 -1
- package/bundles/material-list-testing.umd.js +14 -11
- package/bundles/material-list-testing.umd.js.map +1 -1
- package/bundles/material-list.umd.js +34 -35
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-menu-testing.umd.js +14 -11
- package/bundles/material-menu-testing.umd.js.map +1 -1
- package/bundles/material-menu.umd.js +29 -26
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-paginator-testing.umd.js +14 -11
- package/bundles/material-paginator-testing.umd.js.map +1 -1
- package/bundles/material-paginator.umd.js +19 -17
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.js +14 -11
- package/bundles/material-progress-bar-testing.umd.js.map +1 -1
- package/bundles/material-progress-bar.umd.js +19 -17
- package/bundles/material-progress-bar.umd.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.js +14 -11
- package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +19 -17
- package/bundles/material-progress-spinner.umd.js.map +1 -1
- package/bundles/material-radio-testing.umd.js +14 -11
- package/bundles/material-radio-testing.umd.js.map +1 -1
- package/bundles/material-radio.umd.js +16 -13
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-select-testing.umd.js +14 -11
- package/bundles/material-select-testing.umd.js.map +1 -1
- package/bundles/material-select.umd.js +18 -16
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.js +14 -11
- package/bundles/material-sidenav-testing.umd.js.map +1 -1
- package/bundles/material-sidenav.umd.js +14 -11
- package/bundles/material-sidenav.umd.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.js +14 -11
- package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js +19 -17
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.js +14 -11
- package/bundles/material-slider-testing.umd.js.map +1 -1
- package/bundles/material-slider.umd.js +108 -57
- package/bundles/material-slider.umd.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.js +14 -11
- package/bundles/material-snack-bar-testing.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +14 -11
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-sort-testing.umd.js +14 -11
- package/bundles/material-sort-testing.umd.js.map +1 -1
- package/bundles/material-sort.umd.js +24 -23
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-stepper-testing.umd.js +14 -11
- package/bundles/material-stepper-testing.umd.js.map +1 -1
- package/bundles/material-stepper.umd.js +17 -15
- package/bundles/material-stepper.umd.js.map +1 -1
- package/bundles/material-table-testing.umd.js +14 -11
- package/bundles/material-table-testing.umd.js.map +1 -1
- package/bundles/material-table.umd.js +14 -11
- package/bundles/material-table.umd.js.map +1 -1
- package/bundles/material-tabs-testing.umd.js +14 -11
- package/bundles/material-tabs-testing.umd.js.map +1 -1
- package/bundles/material-tabs.umd.js +53 -36
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.js +14 -11
- package/bundles/material-toolbar-testing.umd.js.map +1 -1
- package/bundles/material-toolbar.umd.js +19 -17
- package/bundles/material-toolbar.umd.js.map +1 -1
- package/bundles/material-tooltip-testing.umd.js +14 -11
- package/bundles/material-tooltip-testing.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.js +14 -11
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tree-testing.umd.js +14 -11
- package/bundles/material-tree-testing.umd.js.map +1 -1
- package/bundles/material-tree.umd.js +16 -13
- package/bundles/material-tree.umd.js.map +1 -1
- package/button/button.d.ts +7 -8
- package/button/index.metadata.json +1 -1
- package/button-toggle/button-toggle.d.ts +5 -5
- package/button-toggle/index.metadata.json +1 -1
- package/checkbox/checkbox.d.ts +7 -7
- package/checkbox/index.metadata.json +1 -1
- package/chips/chip-list.d.ts +11 -13
- package/chips/chip.d.ts +2 -2
- package/chips/index.metadata.json +1 -1
- package/core/common-behaviors/color.d.ts +5 -1
- package/core/common-behaviors/disable-ripple.d.ts +5 -1
- package/core/common-behaviors/disabled.d.ts +5 -1
- package/core/common-behaviors/error-state.d.ts +5 -1
- package/core/common-behaviors/initialized.d.ts +5 -1
- package/core/common-behaviors/tabindex.d.ts +5 -1
- package/core/focus-indicators/_focus-indicators-theme.scss +9 -35
- package/core/index.metadata.json +1 -1
- package/core/option/optgroup.d.ts +4 -4
- package/core/style/_menu-common.scss +2 -1
- package/core/style/_private.scss +27 -0
- package/core/style/_vendor-prefixes.scss +10 -0
- package/core/typography/_typography-utils.scss +4 -2
- package/datepicker/date-range-input-parts.d.ts +2 -2
- package/datepicker/datepicker-base.d.ts +7 -7
- package/datepicker/index.metadata.json +1 -1
- package/dialog/dialog-content-directives.d.ts +13 -1
- package/dialog/dialog-ref.d.ts +4 -1
- package/dialog/index.metadata.json +1 -1
- package/esm2015/autocomplete/autocomplete.js +3 -4
- package/esm2015/badge/badge.js +4 -5
- package/esm2015/button/button.js +4 -6
- package/esm2015/button-toggle/button-toggle.js +4 -5
- package/esm2015/checkbox/checkbox.js +4 -5
- package/esm2015/chips/chip-list.js +4 -5
- package/esm2015/chips/chip.js +1 -1
- package/esm2015/core/common-behaviors/color.js +1 -1
- package/esm2015/core/common-behaviors/common-module.js +1 -1
- package/esm2015/core/common-behaviors/disable-ripple.js +1 -1
- package/esm2015/core/common-behaviors/disabled.js +1 -1
- package/esm2015/core/common-behaviors/error-state.js +1 -1
- package/esm2015/core/common-behaviors/initialized.js +1 -1
- package/esm2015/core/common-behaviors/tabindex.js +1 -1
- package/esm2015/core/option/optgroup.js +3 -4
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/date-range-input-parts.js +2 -4
- package/esm2015/datepicker/date-range-input.js +1 -1
- package/esm2015/datepicker/datepicker-base.js +4 -5
- package/esm2015/dialog/dialog-content-directives.js +7 -1
- package/esm2015/dialog/dialog-ref.js +4 -2
- package/esm2015/expansion/expansion-panel-header.js +16 -6
- package/esm2015/form-field/form-field.js +5 -10
- package/esm2015/icon/icon.js +4 -5
- package/esm2015/input/input.js +5 -5
- package/esm2015/list/list.js +7 -9
- package/esm2015/list/selection-list.js +7 -9
- package/esm2015/menu/menu-item.js +4 -5
- package/esm2015/menu/menu.js +8 -9
- package/esm2015/paginator/paginator.js +4 -5
- package/esm2015/progress-bar/progress-bar.js +4 -5
- package/esm2015/progress-spinner/progress-spinner.js +4 -5
- package/esm2015/radio/radio.js +3 -3
- package/esm2015/select/select.js +3 -4
- package/esm2015/slide-toggle/slide-toggle.js +4 -5
- package/esm2015/slider/slider.js +93 -45
- package/esm2015/sort/sort-header.js +4 -5
- package/esm2015/sort/sort.js +4 -5
- package/esm2015/stepper/public-api.js +1 -1
- package/esm2015/stepper/step-header.js +4 -5
- package/esm2015/tabs/tab-config.js +1 -1
- package/esm2015/tabs/tab-group.js +18 -6
- package/esm2015/tabs/tab-label-wrapper.js +4 -5
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +3 -4
- package/esm2015/tabs/tab.js +4 -5
- package/esm2015/toolbar/toolbar.js +4 -5
- package/esm2015/tree/node.js +3 -3
- package/expansion/expansion-panel-header.d.ts +11 -2
- package/expansion/index.metadata.json +1 -1
- package/fesm2015/autocomplete.js +2 -3
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/badge.js +3 -4
- package/fesm2015/badge.js.map +1 -1
- package/fesm2015/button-toggle.js +3 -4
- package/fesm2015/button-toggle.js.map +1 -1
- package/fesm2015/button.js +3 -5
- package/fesm2015/button.js.map +1 -1
- package/fesm2015/checkbox.js +3 -4
- package/fesm2015/checkbox.js.map +1 -1
- package/fesm2015/chips.js +3 -4
- package/fesm2015/chips.js.map +1 -1
- package/fesm2015/core.js +4 -5
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +5 -8
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/dialog.js +9 -1
- package/fesm2015/dialog.js.map +1 -1
- package/fesm2015/expansion.js +15 -6
- package/fesm2015/expansion.js.map +1 -1
- package/fesm2015/form-field.js +4 -9
- package/fesm2015/form-field.js.map +1 -1
- package/fesm2015/icon.js +3 -4
- package/fesm2015/icon.js.map +1 -1
- package/fesm2015/input.js +4 -4
- package/fesm2015/input.js.map +1 -1
- package/fesm2015/list.js +12 -16
- package/fesm2015/list.js.map +1 -1
- package/fesm2015/menu.js +10 -12
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/paginator.js +3 -4
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/progress-bar.js +3 -4
- package/fesm2015/progress-bar.js.map +1 -1
- package/fesm2015/progress-spinner.js +3 -4
- package/fesm2015/progress-spinner.js.map +1 -1
- package/fesm2015/radio.js +2 -2
- package/fesm2015/radio.js.map +1 -1
- package/fesm2015/select.js +2 -3
- package/fesm2015/select.js.map +1 -1
- package/fesm2015/slide-toggle.js +3 -4
- package/fesm2015/slide-toggle.js.map +1 -1
- package/fesm2015/slider.js +92 -44
- package/fesm2015/slider.js.map +1 -1
- package/fesm2015/sort.js +6 -8
- package/fesm2015/sort.js.map +1 -1
- package/fesm2015/stepper.js +3 -4
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/tabs.js +25 -16
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/toolbar.js +3 -4
- package/fesm2015/toolbar.js.map +1 -1
- package/fesm2015/tree.js +2 -2
- package/fesm2015/tree.js.map +1 -1
- package/form-field/_form-field-fill-theme.scss +2 -1
- package/form-field/_form-field-legacy-theme.scss +5 -4
- package/form-field/_form-field-outline-theme.scss +3 -2
- package/form-field/_form-field-theme.scss +4 -3
- package/form-field/form-field.d.ts +7 -11
- package/form-field/index.metadata.json +1 -1
- package/icon/icon.d.ts +7 -7
- package/icon/index.metadata.json +1 -1
- package/input/_input-theme.scss +2 -1
- package/input/index.metadata.json +1 -1
- package/input/input.d.ts +13 -13
- package/list/index.metadata.json +1 -1
- package/list/list.d.ts +9 -9
- package/list/selection-list.d.ts +9 -9
- package/menu/index.metadata.json +1 -1
- package/menu/menu-item.d.ts +5 -5
- package/menu/menu.d.ts +4 -0
- package/package.json +3 -3
- package/paginator/index.metadata.json +1 -1
- package/paginator/paginator.d.ts +4 -4
- package/progress-bar/index.metadata.json +1 -1
- package/progress-bar/progress-bar.d.ts +7 -7
- package/progress-spinner/index.metadata.json +1 -1
- package/progress-spinner/progress-spinner.d.ts +7 -7
- package/radio/index.metadata.json +1 -1
- package/radio/radio.d.ts +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-update/migrations/theming-api-v12/config.js +4 -1
- package/schematics/ng-update/migrations/theming-api-v12/config.mjs +4 -1
- package/schematics/ng-update/migrations/theming-api-v12/migration.d.ts +9 -1
- package/schematics/ng-update/migrations/theming-api-v12/migration.js +40 -36
- package/schematics/ng-update/migrations/theming-api-v12/migration.mjs +40 -36
- package/schematics/ng-update/migrations/theming-api-v12/theming-api-migration.js +2 -2
- package/schematics/ng-update/migrations/theming-api-v12/theming-api-migration.mjs +2 -2
- package/select/index.metadata.json +1 -1
- package/select/select.d.ts +10 -10
- package/slide-toggle/index.metadata.json +1 -1
- package/slide-toggle/slide-toggle.d.ts +7 -7
- package/slider/index.metadata.json +1 -1
- package/slider/slider.d.ts +17 -9
- package/sort/index.metadata.json +1 -1
- package/sort/sort-header.d.ts +5 -5
- package/sort/sort.d.ts +5 -5
- package/stepper/_stepper-theme.scss +4 -3
- package/stepper/index.metadata.json +1 -1
- package/stepper/public-api.d.ts +1 -1
- package/stepper/step-header.d.ts +9 -7
- package/tabs/index.metadata.json +1 -1
- package/tabs/tab-config.d.ts +2 -0
- package/tabs/tab-group.d.ts +16 -6
- package/tabs/tab-label-wrapper.d.ts +5 -5
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +4 -4
- package/tabs/tab.d.ts +5 -5
- package/toolbar/index.metadata.json +1 -1
- package/toolbar/toolbar.d.ts +7 -7
- package/tooltip/_tooltip-theme.scss +3 -2
- package/tree/index.metadata.json +1 -1
- package/tree/node.d.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","sources":["../../../../../../src/material/progress-bar/progress-bar.ts","../../../../../../src/material/progress-bar/progress-bar-module.ts","../../../../../../src/material/progress-bar/public-api.ts","../../../../../../src/material/progress-bar/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {CanColor, CanColorCtor, mixinColor} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {fromEvent, Observable, Subscription} from 'rxjs';\nimport {filter} from 'rxjs/operators';\n\n\n// TODO(josephperrott): Benchpress tests.\n// TODO(josephperrott): Add ARIA attributes for progress bar \"for\".\n\n/** Last animation end data. */\nexport interface ProgressAnimationEnd {\n value: number;\n}\n\n// Boilerplate for applying mixins to MatProgressBar.\n/** @docs-private */\nclass MatProgressBarBase {\n constructor(public _elementRef: ElementRef) { }\n}\n\nconst _MatProgressBarMixinBase: CanColorCtor & typeof MatProgressBarBase =\n mixinColor(MatProgressBarBase, 'primary');\n\n/**\n * Injection token used to provide the current location to `MatProgressBar`.\n * Used to handle server-side rendering and to stub out during unit tests.\n * @docs-private\n */\nexport const MAT_PROGRESS_BAR_LOCATION = new InjectionToken<MatProgressBarLocation>(\n 'mat-progress-bar-location',\n {providedIn: 'root', factory: MAT_PROGRESS_BAR_LOCATION_FACTORY}\n);\n\n/**\n * Stubbed out location for `MatProgressBar`.\n * @docs-private\n */\nexport interface MatProgressBarLocation {\n getPathname: () => string;\n}\n\n/** @docs-private */\nexport function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation {\n const _document = inject(DOCUMENT);\n const _location = _document ? _document.location : null;\n\n return {\n // Note that this needs to be a function, rather than a property, because Angular\n // will only resolve it once, but we want the current path on each call.\n getPathname: () => _location ? (_location.pathname + _location.search) : ''\n };\n}\n\nexport type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'query';\n\n/** Counter used to generate unique IDs for progress bars. */\nlet progressbarId = 0;\n\n/**\n * `<mat-progress-bar>` component.\n */\n@Component({\n selector: 'mat-progress-bar',\n exportAs: 'matProgressBar',\n host: {\n 'role': 'progressbar',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[attr.aria-valuenow]': '(mode === \"indeterminate\" || mode === \"query\") ? null : value',\n '[attr.mode]': 'mode',\n 'class': 'mat-progress-bar',\n '[class._mat-animation-noopable]': '_isNoopAnimation',\n },\n inputs: ['color'],\n templateUrl: 'progress-bar.html',\n styleUrls: ['progress-bar.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatProgressBar extends _MatProgressBarMixinBase implements CanColor,\n AfterViewInit, OnDestroy {\n constructor(public _elementRef: ElementRef, private _ngZone: NgZone,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n /**\n * @deprecated `location` parameter to be made required.\n * @breaking-change 8.0.0\n */\n @Optional() @Inject(MAT_PROGRESS_BAR_LOCATION) location?: MatProgressBarLocation) {\n super(_elementRef);\n\n // We need to prefix the SVG reference with the current path, otherwise they won't work\n // in Safari if the page has a `<base>` tag. Note that we need quotes inside the `url()`,\n\n // because named route URLs can contain parentheses (see #12338). Also we don't use since\n // we can't tell the difference between whether\n // the consumer is using the hash location strategy or not, because `Location` normalizes\n // both `/#/foo/bar` and `/foo/bar` to the same thing.\n const path = location ? location.getPathname().split('#')[0] : '';\n this._rectangleFillValue = `url('${path}#${this.progressbarId}')`;\n this._isNoopAnimation = _animationMode === 'NoopAnimations';\n }\n\n /** Flag that indicates whether NoopAnimations mode is set to true. */\n _isNoopAnimation = false;\n\n /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */\n @Input()\n get value(): number { return this._value; }\n set value(v: number) {\n this._value = clamp(coerceNumberProperty(v) || 0);\n }\n private _value: number = 0;\n\n /** Buffer value of the progress bar. Defaults to zero. */\n @Input()\n get bufferValue(): number { return this._bufferValue; }\n set bufferValue(v: number) { this._bufferValue = clamp(v || 0); }\n private _bufferValue: number = 0;\n\n @ViewChild('primaryValueBar') _primaryValueBar: ElementRef;\n\n /**\n * Event emitted when animation of the primary progress bar completes. This event will not\n * be emitted when animations are disabled, nor will it be emitted for modes with continuous\n * animations (indeterminate and query).\n */\n @Output() readonly animationEnd = new EventEmitter<ProgressAnimationEnd>();\n\n /** Reference to animation end subscription to be unsubscribed on destroy. */\n private _animationEndSubscription: Subscription = Subscription.EMPTY;\n\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n @Input() mode: ProgressBarMode = 'determinate';\n\n /** ID of the progress bar. */\n progressbarId = `mat-progress-bar-${progressbarId++}`;\n\n /** Attribute to be used for the `fill` attribute on the internal `rect` element. */\n _rectangleFillValue: string;\n\n /** Gets the current transform value for the progress bar's primary indicator. */\n _primaryTransform() {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.value / 100;\n return {transform: `scale3d(${scale}, 1, 1)`};\n }\n\n /**\n * Gets the current transform value for the progress bar's buffer indicator. Only used if the\n * progress mode is set to buffer, otherwise returns an undefined, causing no transformation.\n */\n _bufferTransform() {\n if (this.mode === 'buffer') {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.bufferValue / 100;\n return {transform: `scale3d(${scale}, 1, 1)`};\n }\n return null;\n }\n\n ngAfterViewInit() {\n // Run outside angular so change detection didn't get triggered on every transition end\n // instead only on the animation that we care about (primary value bar's transitionend)\n this._ngZone.runOutsideAngular((() => {\n const element = this._primaryValueBar.nativeElement;\n\n this._animationEndSubscription =\n (fromEvent(element, 'transitionend') as Observable<TransitionEvent>)\n .pipe(filter(((e: TransitionEvent) => e.target === element)))\n .subscribe(() => {\n if (this.mode === 'determinate' || this.mode === 'buffer') {\n this._ngZone.run(() => this.animationEnd.next({value: this.value}));\n }\n });\n }));\n }\n\n ngOnDestroy() {\n this._animationEndSubscription.unsubscribe();\n }\n\n static ngAcceptInputType_value: NumberInput;\n}\n\n/** Clamps a value to be between two numbers, by default 0 and 100. */\nfunction clamp(v: number, min = 0, max = 100) {\n return Math.max(min, Math.min(max, v));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatProgressBar} from './progress-bar';\n\n\n@NgModule({\n imports: [CommonModule, MatCommonModule],\n exports: [MatProgressBar, MatCommonModule],\n declarations: [MatProgressBar],\n})\nexport class MatProgressBarModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './progress-bar-module';\nexport * from './progress-bar';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;AAwCA;AACA;AACA,MAAM,kBAAkB;IACtB,YAAmB,WAAuB;QAAvB,gBAAW,GAAX,WAAW,CAAY;KAAK;CAChD;AAED,MAAM,wBAAwB,GAC1B,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;AAE9C;;;;;MAKa,yBAAyB,GAAG,IAAI,cAAc,CACzD,2BAA2B,EAC3B,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,EAAC,EAChE;AAUF;SACgB,iCAAiC;IAC/C,MAAM,SAAS,GAA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C;KAC9C;;;YA/HF,SAAS,SAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,QAAQ,EAAE,gBAAgB;gBAC1B,IAAI,EAAE;oBACJ,MAAM,EAAE,aAAa;oBACrB,eAAe,EAAE,GAAG;oBACpB,eAAe,EAAE,KAAK;;;oBAGtB,UAAU,EAAE,IAAI;oBAChB,sBAAsB,EAAE,+DAA+D;oBACvF,aAAa,EAAE,MAAM;oBACrB,OAAO,EAAE,kBAAkB;oBAC3B,iCAAiC,EAAE,kBAAkB;iBACtD;gBACD,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,qmCAAgC;gBAEhC,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACtC;;;YA9FC,UAAU;YAMV,MAAM;yCA4FO,QAAQ,YAAI,MAAM,SAAC,qBAAqB;4CAKxC,QAAQ,YAAI,MAAM,SAAC,yBAAyB;;;oBAmBxD,KAAK;0BAQL,KAAK;+BAKL,SAAS,SAAC,iBAAiB;2BAO3B,MAAM;mBAYN,KAAK;;AAoDR;AACA,SAAS,KAAK,CAAC,CAAS,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG;IAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC;;AC9NA;;;;;;;MAmBa,oBAAoB;;;YALhC,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;gBACxC,OAAO,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC;gBAC1C,YAAY,EAAE,CAAC,cAAc,CAAC;aAC/B;;;AClBD;;;;;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sources":["../../../../../../src/material/progress-bar/progress-bar.ts","../../../../../../src/material/progress-bar/progress-bar-module.ts","../../../../../../src/material/progress-bar/public-api.ts","../../../../../../src/material/progress-bar/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {CanColor, mixinColor} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {fromEvent, Observable, Subscription} from 'rxjs';\nimport {filter} from 'rxjs/operators';\n\n\n// TODO(josephperrott): Benchpress tests.\n// TODO(josephperrott): Add ARIA attributes for progress bar \"for\".\n\n/** Last animation end data. */\nexport interface ProgressAnimationEnd {\n value: number;\n}\n\n// Boilerplate for applying mixins to MatProgressBar.\n/** @docs-private */\nconst _MatProgressBarBase = mixinColor(class {\n constructor(public _elementRef: ElementRef) {}\n}, 'primary');\n\n/**\n * Injection token used to provide the current location to `MatProgressBar`.\n * Used to handle server-side rendering and to stub out during unit tests.\n * @docs-private\n */\nexport const MAT_PROGRESS_BAR_LOCATION = new InjectionToken<MatProgressBarLocation>(\n 'mat-progress-bar-location',\n {providedIn: 'root', factory: MAT_PROGRESS_BAR_LOCATION_FACTORY}\n);\n\n/**\n * Stubbed out location for `MatProgressBar`.\n * @docs-private\n */\nexport interface MatProgressBarLocation {\n getPathname: () => string;\n}\n\n/** @docs-private */\nexport function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation {\n const _document = inject(DOCUMENT);\n const _location = _document ? _document.location : null;\n\n return {\n // Note that this needs to be a function, rather than a property, because Angular\n // will only resolve it once, but we want the current path on each call.\n getPathname: () => _location ? (_location.pathname + _location.search) : ''\n };\n}\n\nexport type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'query';\n\n/** Counter used to generate unique IDs for progress bars. */\nlet progressbarId = 0;\n\n/**\n * `<mat-progress-bar>` component.\n */\n@Component({\n selector: 'mat-progress-bar',\n exportAs: 'matProgressBar',\n host: {\n 'role': 'progressbar',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[attr.aria-valuenow]': '(mode === \"indeterminate\" || mode === \"query\") ? null : value',\n '[attr.mode]': 'mode',\n 'class': 'mat-progress-bar',\n '[class._mat-animation-noopable]': '_isNoopAnimation',\n },\n inputs: ['color'],\n templateUrl: 'progress-bar.html',\n styleUrls: ['progress-bar.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatProgressBar extends _MatProgressBarBase implements CanColor,\n AfterViewInit, OnDestroy {\n constructor(public _elementRef: ElementRef, private _ngZone: NgZone,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n /**\n * @deprecated `location` parameter to be made required.\n * @breaking-change 8.0.0\n */\n @Optional() @Inject(MAT_PROGRESS_BAR_LOCATION) location?: MatProgressBarLocation) {\n super(_elementRef);\n\n // We need to prefix the SVG reference with the current path, otherwise they won't work\n // in Safari if the page has a `<base>` tag. Note that we need quotes inside the `url()`,\n\n // because named route URLs can contain parentheses (see #12338). Also we don't use since\n // we can't tell the difference between whether\n // the consumer is using the hash location strategy or not, because `Location` normalizes\n // both `/#/foo/bar` and `/foo/bar` to the same thing.\n const path = location ? location.getPathname().split('#')[0] : '';\n this._rectangleFillValue = `url('${path}#${this.progressbarId}')`;\n this._isNoopAnimation = _animationMode === 'NoopAnimations';\n }\n\n /** Flag that indicates whether NoopAnimations mode is set to true. */\n _isNoopAnimation = false;\n\n /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */\n @Input()\n get value(): number { return this._value; }\n set value(v: number) {\n this._value = clamp(coerceNumberProperty(v) || 0);\n }\n private _value: number = 0;\n\n /** Buffer value of the progress bar. Defaults to zero. */\n @Input()\n get bufferValue(): number { return this._bufferValue; }\n set bufferValue(v: number) { this._bufferValue = clamp(v || 0); }\n private _bufferValue: number = 0;\n\n @ViewChild('primaryValueBar') _primaryValueBar: ElementRef;\n\n /**\n * Event emitted when animation of the primary progress bar completes. This event will not\n * be emitted when animations are disabled, nor will it be emitted for modes with continuous\n * animations (indeterminate and query).\n */\n @Output() readonly animationEnd = new EventEmitter<ProgressAnimationEnd>();\n\n /** Reference to animation end subscription to be unsubscribed on destroy. */\n private _animationEndSubscription: Subscription = Subscription.EMPTY;\n\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n @Input() mode: ProgressBarMode = 'determinate';\n\n /** ID of the progress bar. */\n progressbarId = `mat-progress-bar-${progressbarId++}`;\n\n /** Attribute to be used for the `fill` attribute on the internal `rect` element. */\n _rectangleFillValue: string;\n\n /** Gets the current transform value for the progress bar's primary indicator. */\n _primaryTransform() {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.value / 100;\n return {transform: `scale3d(${scale}, 1, 1)`};\n }\n\n /**\n * Gets the current transform value for the progress bar's buffer indicator. Only used if the\n * progress mode is set to buffer, otherwise returns an undefined, causing no transformation.\n */\n _bufferTransform() {\n if (this.mode === 'buffer') {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.bufferValue / 100;\n return {transform: `scale3d(${scale}, 1, 1)`};\n }\n return null;\n }\n\n ngAfterViewInit() {\n // Run outside angular so change detection didn't get triggered on every transition end\n // instead only on the animation that we care about (primary value bar's transitionend)\n this._ngZone.runOutsideAngular((() => {\n const element = this._primaryValueBar.nativeElement;\n\n this._animationEndSubscription =\n (fromEvent(element, 'transitionend') as Observable<TransitionEvent>)\n .pipe(filter(((e: TransitionEvent) => e.target === element)))\n .subscribe(() => {\n if (this.mode === 'determinate' || this.mode === 'buffer') {\n this._ngZone.run(() => this.animationEnd.next({value: this.value}));\n }\n });\n }));\n }\n\n ngOnDestroy() {\n this._animationEndSubscription.unsubscribe();\n }\n\n static ngAcceptInputType_value: NumberInput;\n}\n\n/** Clamps a value to be between two numbers, by default 0 and 100. */\nfunction clamp(v: number, min = 0, max = 100) {\n return Math.max(min, Math.min(max, v));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatProgressBar} from './progress-bar';\n\n\n@NgModule({\n imports: [CommonModule, MatCommonModule],\n exports: [MatProgressBar, MatCommonModule],\n declarations: [MatProgressBar],\n})\nexport class MatProgressBarModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './progress-bar-module';\nexport * from './progress-bar';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;AAwCA;AACA;AACA,MAAM,mBAAmB,GAAG,UAAU,CAAC;IACrC,YAAmB,WAAuB;QAAvB,gBAAW,GAAX,WAAW,CAAY;KAAI;CAC/C,EAAE,SAAS,CAAC,CAAC;AAEd;;;;;MAKa,yBAAyB,GAAG,IAAI,cAAc,CACzD,2BAA2B,EAC3B,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,EAAC,EAChE;AAUF;SACgB,iCAAiC;IAC/C,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,QAAQ,GAAG,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,IAAI,EAAE;oBACJ,MAAM,EAAE,aAAa;oBACrB,eAAe,EAAE,GAAG;oBACpB,eAAe,EAAE,KAAK;;;oBAGtB,UAAU,EAAE,IAAI;oBAChB,sBAAsB,EAAE,+DAA+D;oBACvF,aAAa,EAAE,MAAM;oBACrB,OAAO,EAAE,kBAAkB;oBAC3B,iCAAiC,EAAE,kBAAkB;iBACtD;gBACD,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,qmCAAgC;gBAEhC,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACtC;;;YA3FC,UAAU;YAMV,MAAM;yCAyFO,QAAQ,YAAI,MAAM,SAAC,qBAAqB;4CAKxC,QAAQ,YAAI,MAAM,SAAC,yBAAyB;;;oBAmBxD,KAAK;0BAQL,KAAK;+BAKL,SAAS,SAAC,iBAAiB;2BAO3B,MAAM;mBAYN,KAAK;;AAoDR;AACA,SAAS,KAAK,CAAC,CAAS,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG;IAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC;;AC3NA;;;;;;;MAmBa,oBAAoB;;;YALhC,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;gBACxC,OAAO,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC;gBAC1C,YAAY,EAAE,CAAC,cAAc,CAAC;aAC/B;;;AClBD;;;;;;;;ACAA;;;;;;"}
|
|
@@ -24,12 +24,11 @@ const BASE_SIZE = 100;
|
|
|
24
24
|
const BASE_STROKE_WIDTH = 10;
|
|
25
25
|
// Boilerplate for applying mixins to MatProgressSpinner.
|
|
26
26
|
/** @docs-private */
|
|
27
|
-
class
|
|
27
|
+
const _MatProgressSpinnerBase = mixinColor(class {
|
|
28
28
|
constructor(_elementRef) {
|
|
29
29
|
this._elementRef = _elementRef;
|
|
30
30
|
}
|
|
31
|
-
}
|
|
32
|
-
const _MatProgressSpinnerMixinBase = mixinColor(MatProgressSpinnerBase, 'primary');
|
|
31
|
+
}, 'primary');
|
|
33
32
|
/** Injection token to be used to override the default options for `mat-progress-spinner`. */
|
|
34
33
|
const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS = new InjectionToken('mat-progress-spinner-default-options', {
|
|
35
34
|
providedIn: 'root',
|
|
@@ -69,7 +68,7 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `
|
|
|
69
68
|
/**
|
|
70
69
|
* `<mat-progress-spinner>` component.
|
|
71
70
|
*/
|
|
72
|
-
class MatProgressSpinner extends
|
|
71
|
+
class MatProgressSpinner extends _MatProgressSpinnerBase {
|
|
73
72
|
constructor(_elementRef, platform, _document, animationMode, defaults) {
|
|
74
73
|
super(_elementRef);
|
|
75
74
|
this._elementRef = _elementRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-spinner.js","sources":["../../../../../../src/material/progress-spinner/progress-spinner.ts","../../../../../../src/material/progress-spinner/progress-spinner-module.ts","../../../../../../src/material/progress-spinner/public-api.ts","../../../../../../src/material/progress-spinner/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Platform, _getShadowRoot} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n Optional,\n ViewEncapsulation,\n OnInit,\n} from '@angular/core';\nimport {CanColor, CanColorCtor, mixinColor} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\n/** Possible mode for a progress spinner. */\nexport type ProgressSpinnerMode = 'determinate' | 'indeterminate';\n\n/**\n * Base reference size of the spinner.\n * @docs-private\n */\nconst BASE_SIZE = 100;\n\n/**\n * Base reference stroke width of the spinner.\n * @docs-private\n */\nconst BASE_STROKE_WIDTH = 10;\n\n// Boilerplate for applying mixins to MatProgressSpinner.\n/** @docs-private */\nclass MatProgressSpinnerBase {\n constructor(public _elementRef: ElementRef) {}\n}\nconst _MatProgressSpinnerMixinBase: CanColorCtor & typeof MatProgressSpinnerBase =\n mixinColor(MatProgressSpinnerBase, 'primary');\n\n/** Default `mat-progress-spinner` options that can be overridden. */\nexport interface MatProgressSpinnerDefaultOptions {\n /** Diameter of the spinner. */\n diameter?: number;\n /** Width of the spinner's stroke. */\n strokeWidth?: number;\n /**\n * Whether the animations should be force to be enabled, ignoring if the current environment is\n * using NoopAnimationsModule.\n */\n _forceAnimations?: boolean;\n}\n\n/** Injection token to be used to override the default options for `mat-progress-spinner`. */\nexport const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS =\n new InjectionToken<MatProgressSpinnerDefaultOptions>('mat-progress-spinner-default-options', {\n providedIn: 'root',\n factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n });\n\n/** @docs-private */\nexport function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions {\n return {diameter: BASE_SIZE};\n}\n\n// .0001 percentage difference is necessary in order to avoid unwanted animation frames\n// for example because the animation duration is 4 seconds, .1% accounts to 4ms\n// which are enough to see the flicker described in\n// https://github.com/angular/components/issues/8984\nconst INDETERMINATE_ANIMATION_TEMPLATE = `\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n`;\n\n/**\n * `<mat-progress-spinner>` component.\n */\n@Component({\n selector: 'mat-progress-spinner',\n exportAs: 'matProgressSpinner',\n host: {\n 'role': 'progressbar',\n 'class': 'mat-progress-spinner',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n '[attr.aria-valuemin]': 'mode === \"determinate\" ? 0 : null',\n '[attr.aria-valuemax]': 'mode === \"determinate\" ? 100 : null',\n '[attr.aria-valuenow]': 'mode === \"determinate\" ? value : null',\n '[attr.mode]': 'mode',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements OnInit, CanColor {\n private _diameter = BASE_SIZE;\n private _value = 0;\n private _strokeWidth: number;\n private _fallbackAnimation = false;\n\n /**\n * Element to which we should add the generated style tags for the indeterminate animation.\n * For most elements this is the document, but for the ones in the Shadow DOM we need to\n * use the shadow root.\n */\n private _styleRoot: Node;\n\n /**\n * Tracks diameters of existing instances to de-dupe generated styles (default d = 100).\n * We need to keep track of which elements the diameters were attached to, because for\n * elements in the Shadow DOM the style tags are attached to the shadow root, rather\n * than the document head.\n */\n private static _diameters = new WeakMap<Node, Set<number>>();\n\n /** Whether the _mat-animation-noopable class should be applied, disabling animations. */\n _noopAnimations: boolean;\n\n /** A string that is used for setting the spinner animation-name CSS property */\n _spinnerAnimationLabel: string;\n\n /** The diameter of the progress spinner (will set width and height of svg). */\n @Input()\n get diameter(): number { return this._diameter; }\n set diameter(size: number) {\n this._diameter = coerceNumberProperty(size);\n this._spinnerAnimationLabel = this._getSpinnerAnimationLabel();\n\n // If this is set before `ngOnInit`, the style root may not have been resolved yet.\n if (!this._fallbackAnimation && this._styleRoot) {\n this._attachStyleNode();\n }\n }\n\n /** Stroke width of the progress spinner. */\n @Input()\n get strokeWidth(): number {\n return this._strokeWidth || this.diameter / 10;\n }\n set strokeWidth(value: number) {\n this._strokeWidth = coerceNumberProperty(value);\n }\n\n /** Mode of the progress circle */\n @Input() mode: ProgressSpinnerMode = 'determinate';\n\n /** Value of the progress circle. */\n @Input()\n get value(): number {\n return this.mode === 'determinate' ? this._value : 0;\n }\n set value(newValue: number) {\n this._value = Math.max(0, Math.min(100, coerceNumberProperty(newValue)));\n }\n\n constructor(public _elementRef: ElementRef<HTMLElement>,\n platform: Platform,\n @Optional() @Inject(DOCUMENT) private _document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n\n super(_elementRef);\n\n const trackedDiameters = MatProgressSpinner._diameters;\n this._spinnerAnimationLabel = this._getSpinnerAnimationLabel();\n\n // The base size is already inserted via the component's structural styles. We still\n // need to track it so we don't end up adding the same styles again.\n if (!trackedDiameters.has(_document.head)) {\n trackedDiameters.set(_document.head, new Set<number>([BASE_SIZE]));\n }\n\n this._fallbackAnimation = platform.EDGE || platform.TRIDENT;\n this._noopAnimations = animationMode === 'NoopAnimations' &&\n (!!defaults && !defaults._forceAnimations);\n\n if (defaults) {\n if (defaults.diameter) {\n this.diameter = defaults.diameter;\n }\n\n if (defaults.strokeWidth) {\n this.strokeWidth = defaults.strokeWidth;\n }\n }\n }\n\n ngOnInit() {\n const element = this._elementRef.nativeElement;\n\n // Note that we need to look up the root node in ngOnInit, rather than the constructor, because\n // Angular seems to create the element outside the shadow root and then moves it inside, if the\n // node is inside an `ngIf` and a ShadowDom-encapsulated component.\n this._styleRoot = _getShadowRoot(element) || this._document.head;\n this._attachStyleNode();\n\n // On IE and Edge, we can't animate the `stroke-dashoffset`\n // reliably so we fall back to a non-spec animation.\n const animationClass =\n `mat-progress-spinner-indeterminate${this._fallbackAnimation ? '-fallback' : ''}-animation`;\n\n element.classList.add(animationClass);\n }\n\n /** The radius of the spinner, adjusted for stroke width. */\n _getCircleRadius() {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }\n\n /** The view box of the spinner's svg element. */\n _getViewBox() {\n const viewBox = this._getCircleRadius() * 2 + this.strokeWidth;\n return `0 0 ${viewBox} ${viewBox}`;\n }\n\n /** The stroke circumference of the svg circle. */\n _getStrokeCircumference(): number {\n return 2 * Math.PI * this._getCircleRadius();\n }\n\n /** The dash offset of the svg circle. */\n _getStrokeDashOffset() {\n if (this.mode === 'determinate') {\n return this._getStrokeCircumference() * (100 - this._value) / 100;\n }\n\n // In fallback mode set the circle to 80% and rotate it with CSS.\n if (this._fallbackAnimation && this.mode === 'indeterminate') {\n return this._getStrokeCircumference() * 0.2;\n }\n\n return null;\n }\n\n /** Stroke width of the circle in percent. */\n _getCircleStrokeWidth() {\n return this.strokeWidth / this.diameter * 100;\n }\n\n /** Dynamically generates a style tag containing the correct animation for this diameter. */\n private _attachStyleNode(): void {\n const styleRoot = this._styleRoot;\n const currentDiameter = this._diameter;\n const diameters = MatProgressSpinner._diameters;\n let diametersForElement = diameters.get(styleRoot);\n\n if (!diametersForElement || !diametersForElement.has(currentDiameter)) {\n const styleTag: HTMLStyleElement = this._document.createElement('style');\n styleTag.setAttribute('mat-spinner-animation', this._spinnerAnimationLabel);\n styleTag.textContent = this._getAnimationText();\n styleRoot.appendChild(styleTag);\n\n if (!diametersForElement) {\n diametersForElement = new Set<number>();\n diameters.set(styleRoot, diametersForElement);\n }\n\n diametersForElement.add(currentDiameter);\n }\n }\n\n /** Generates animation styles adjusted for the spinner's diameter. */\n private _getAnimationText(): string {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }\n\n /** Returns the circle diameter formatted for use with the animation-name CSS property. */\n private _getSpinnerAnimationLabel(): string {\n // The string of a float point number will include a period ‘.’ character,\n // which is not valid for a CSS animation-name.\n return this.diameter.toString().replace('.', '_');\n }\n\n static ngAcceptInputType_diameter: NumberInput;\n static ngAcceptInputType_strokeWidth: NumberInput;\n static ngAcceptInputType_value: NumberInput;\n}\n\n\n/**\n * `<mat-spinner>` component.\n *\n * This is a component definition to be used as a convenience reference to create an\n * indeterminate `<mat-progress-spinner>` instance.\n */\n@Component({\n selector: 'mat-spinner',\n host: {\n 'role': 'progressbar',\n 'mode': 'indeterminate',\n 'class': 'mat-spinner mat-progress-spinner',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatSpinner extends MatProgressSpinner {\n constructor(elementRef: ElementRef<HTMLElement>, platform: Platform,\n @Optional() @Inject(DOCUMENT) document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n super(elementRef, platform, document, animationMode, defaults);\n this.mode = 'indeterminate';\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatProgressSpinner, MatSpinner} from './progress-spinner';\n\n\n@NgModule({\n imports: [MatCommonModule, CommonModule],\n exports: [\n MatProgressSpinner,\n MatSpinner,\n MatCommonModule\n ],\n declarations: [\n MatProgressSpinner,\n MatSpinner\n ],\n})\nexport class MatProgressSpinnerModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './progress-spinner-module';\nexport {\n MatProgressSpinner,\n MatSpinner,\n MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS,\n ProgressSpinnerMode,\n MatProgressSpinnerDefaultOptions,\n MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n} from './progress-spinner';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AA6BA;;;;AAIA,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB;;;;AAIA,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;AACA;AACA,MAAM,sBAAsB;IAC1B,YAAmB,WAAuB;QAAvB,gBAAW,GAAX,WAAW,CAAY;KA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Q;4CA8UD,QAAQ,YAAI,MAAM,SAAC,QAAQ;yCAC3B,QAAQ,YAAI,MAAM,SAAC,qBAAqB;4CACxC,MAAM,SAAC,oCAAoC;;;ACzV1D;;;;;;;MAyBa,wBAAwB;;;YAZpC,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;gBACxC,OAAO,EAAE;oBACP,kBAAkB;oBAClB,UAAU;oBACV,eAAe;iBAChB;gBACD,YAAY,EAAE;oBACZ,kBAAkB;oBAClB,UAAU;iBACX;aACF;;;ACxBD;;;;;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"progress-spinner.js","sources":["../../../../../../src/material/progress-spinner/progress-spinner.ts","../../../../../../src/material/progress-spinner/progress-spinner-module.ts","../../../../../../src/material/progress-spinner/public-api.ts","../../../../../../src/material/progress-spinner/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Platform, _getShadowRoot} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n Optional,\n ViewEncapsulation,\n OnInit,\n} from '@angular/core';\nimport {CanColor, mixinColor} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\n/** Possible mode for a progress spinner. */\nexport type ProgressSpinnerMode = 'determinate' | 'indeterminate';\n\n/**\n * Base reference size of the spinner.\n * @docs-private\n */\nconst BASE_SIZE = 100;\n\n/**\n * Base reference stroke width of the spinner.\n * @docs-private\n */\nconst BASE_STROKE_WIDTH = 10;\n\n// Boilerplate for applying mixins to MatProgressSpinner.\n/** @docs-private */\nconst _MatProgressSpinnerBase = mixinColor(class {\n constructor(public _elementRef: ElementRef) {}\n}, 'primary');\n\n/** Default `mat-progress-spinner` options that can be overridden. */\nexport interface MatProgressSpinnerDefaultOptions {\n /** Diameter of the spinner. */\n diameter?: number;\n /** Width of the spinner's stroke. */\n strokeWidth?: number;\n /**\n * Whether the animations should be force to be enabled, ignoring if the current environment is\n * using NoopAnimationsModule.\n */\n _forceAnimations?: boolean;\n}\n\n/** Injection token to be used to override the default options for `mat-progress-spinner`. */\nexport const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS =\n new InjectionToken<MatProgressSpinnerDefaultOptions>('mat-progress-spinner-default-options', {\n providedIn: 'root',\n factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n });\n\n/** @docs-private */\nexport function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions {\n return {diameter: BASE_SIZE};\n}\n\n// .0001 percentage difference is necessary in order to avoid unwanted animation frames\n// for example because the animation duration is 4 seconds, .1% accounts to 4ms\n// which are enough to see the flicker described in\n// https://github.com/angular/components/issues/8984\nconst INDETERMINATE_ANIMATION_TEMPLATE = `\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n`;\n\n/**\n * `<mat-progress-spinner>` component.\n */\n@Component({\n selector: 'mat-progress-spinner',\n exportAs: 'matProgressSpinner',\n host: {\n 'role': 'progressbar',\n 'class': 'mat-progress-spinner',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n '[attr.aria-valuemin]': 'mode === \"determinate\" ? 0 : null',\n '[attr.aria-valuemax]': 'mode === \"determinate\" ? 100 : null',\n '[attr.aria-valuenow]': 'mode === \"determinate\" ? value : null',\n '[attr.mode]': 'mode',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatProgressSpinner extends _MatProgressSpinnerBase implements OnInit, CanColor {\n private _diameter = BASE_SIZE;\n private _value = 0;\n private _strokeWidth: number;\n private _fallbackAnimation = false;\n\n /**\n * Element to which we should add the generated style tags for the indeterminate animation.\n * For most elements this is the document, but for the ones in the Shadow DOM we need to\n * use the shadow root.\n */\n private _styleRoot: Node;\n\n /**\n * Tracks diameters of existing instances to de-dupe generated styles (default d = 100).\n * We need to keep track of which elements the diameters were attached to, because for\n * elements in the Shadow DOM the style tags are attached to the shadow root, rather\n * than the document head.\n */\n private static _diameters = new WeakMap<Node, Set<number>>();\n\n /** Whether the _mat-animation-noopable class should be applied, disabling animations. */\n _noopAnimations: boolean;\n\n /** A string that is used for setting the spinner animation-name CSS property */\n _spinnerAnimationLabel: string;\n\n /** The diameter of the progress spinner (will set width and height of svg). */\n @Input()\n get diameter(): number { return this._diameter; }\n set diameter(size: number) {\n this._diameter = coerceNumberProperty(size);\n this._spinnerAnimationLabel = this._getSpinnerAnimationLabel();\n\n // If this is set before `ngOnInit`, the style root may not have been resolved yet.\n if (!this._fallbackAnimation && this._styleRoot) {\n this._attachStyleNode();\n }\n }\n\n /** Stroke width of the progress spinner. */\n @Input()\n get strokeWidth(): number {\n return this._strokeWidth || this.diameter / 10;\n }\n set strokeWidth(value: number) {\n this._strokeWidth = coerceNumberProperty(value);\n }\n\n /** Mode of the progress circle */\n @Input() mode: ProgressSpinnerMode = 'determinate';\n\n /** Value of the progress circle. */\n @Input()\n get value(): number {\n return this.mode === 'determinate' ? this._value : 0;\n }\n set value(newValue: number) {\n this._value = Math.max(0, Math.min(100, coerceNumberProperty(newValue)));\n }\n\n constructor(public _elementRef: ElementRef<HTMLElement>,\n platform: Platform,\n @Optional() @Inject(DOCUMENT) private _document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n\n super(_elementRef);\n\n const trackedDiameters = MatProgressSpinner._diameters;\n this._spinnerAnimationLabel = this._getSpinnerAnimationLabel();\n\n // The base size is already inserted via the component's structural styles. We still\n // need to track it so we don't end up adding the same styles again.\n if (!trackedDiameters.has(_document.head)) {\n trackedDiameters.set(_document.head, new Set<number>([BASE_SIZE]));\n }\n\n this._fallbackAnimation = platform.EDGE || platform.TRIDENT;\n this._noopAnimations = animationMode === 'NoopAnimations' &&\n (!!defaults && !defaults._forceAnimations);\n\n if (defaults) {\n if (defaults.diameter) {\n this.diameter = defaults.diameter;\n }\n\n if (defaults.strokeWidth) {\n this.strokeWidth = defaults.strokeWidth;\n }\n }\n }\n\n ngOnInit() {\n const element = this._elementRef.nativeElement;\n\n // Note that we need to look up the root node in ngOnInit, rather than the constructor, because\n // Angular seems to create the element outside the shadow root and then moves it inside, if the\n // node is inside an `ngIf` and a ShadowDom-encapsulated component.\n this._styleRoot = _getShadowRoot(element) || this._document.head;\n this._attachStyleNode();\n\n // On IE and Edge, we can't animate the `stroke-dashoffset`\n // reliably so we fall back to a non-spec animation.\n const animationClass =\n `mat-progress-spinner-indeterminate${this._fallbackAnimation ? '-fallback' : ''}-animation`;\n\n element.classList.add(animationClass);\n }\n\n /** The radius of the spinner, adjusted for stroke width. */\n _getCircleRadius() {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }\n\n /** The view box of the spinner's svg element. */\n _getViewBox() {\n const viewBox = this._getCircleRadius() * 2 + this.strokeWidth;\n return `0 0 ${viewBox} ${viewBox}`;\n }\n\n /** The stroke circumference of the svg circle. */\n _getStrokeCircumference(): number {\n return 2 * Math.PI * this._getCircleRadius();\n }\n\n /** The dash offset of the svg circle. */\n _getStrokeDashOffset() {\n if (this.mode === 'determinate') {\n return this._getStrokeCircumference() * (100 - this._value) / 100;\n }\n\n // In fallback mode set the circle to 80% and rotate it with CSS.\n if (this._fallbackAnimation && this.mode === 'indeterminate') {\n return this._getStrokeCircumference() * 0.2;\n }\n\n return null;\n }\n\n /** Stroke width of the circle in percent. */\n _getCircleStrokeWidth() {\n return this.strokeWidth / this.diameter * 100;\n }\n\n /** Dynamically generates a style tag containing the correct animation for this diameter. */\n private _attachStyleNode(): void {\n const styleRoot = this._styleRoot;\n const currentDiameter = this._diameter;\n const diameters = MatProgressSpinner._diameters;\n let diametersForElement = diameters.get(styleRoot);\n\n if (!diametersForElement || !diametersForElement.has(currentDiameter)) {\n const styleTag: HTMLStyleElement = this._document.createElement('style');\n styleTag.setAttribute('mat-spinner-animation', this._spinnerAnimationLabel);\n styleTag.textContent = this._getAnimationText();\n styleRoot.appendChild(styleTag);\n\n if (!diametersForElement) {\n diametersForElement = new Set<number>();\n diameters.set(styleRoot, diametersForElement);\n }\n\n diametersForElement.add(currentDiameter);\n }\n }\n\n /** Generates animation styles adjusted for the spinner's diameter. */\n private _getAnimationText(): string {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }\n\n /** Returns the circle diameter formatted for use with the animation-name CSS property. */\n private _getSpinnerAnimationLabel(): string {\n // The string of a float point number will include a period ‘.’ character,\n // which is not valid for a CSS animation-name.\n return this.diameter.toString().replace('.', '_');\n }\n\n static ngAcceptInputType_diameter: NumberInput;\n static ngAcceptInputType_strokeWidth: NumberInput;\n static ngAcceptInputType_value: NumberInput;\n}\n\n\n/**\n * `<mat-spinner>` component.\n *\n * This is a component definition to be used as a convenience reference to create an\n * indeterminate `<mat-progress-spinner>` instance.\n */\n@Component({\n selector: 'mat-spinner',\n host: {\n 'role': 'progressbar',\n 'mode': 'indeterminate',\n 'class': 'mat-spinner mat-progress-spinner',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatSpinner extends MatProgressSpinner {\n constructor(elementRef: ElementRef<HTMLElement>, platform: Platform,\n @Optional() @Inject(DOCUMENT) document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n super(elementRef, platform, document, animationMode, defaults);\n this.mode = 'indeterminate';\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatProgressSpinner, MatSpinner} from './progress-spinner';\n\n\n@NgModule({\n imports: [MatCommonModule, CommonModule],\n exports: [\n MatProgressSpinner,\n MatSpinner,\n MatCommonModule\n ],\n declarations: [\n MatProgressSpinner,\n MatSpinner\n ],\n})\nexport class MatProgressSpinnerModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './progress-spinner-module';\nexport {\n MatProgressSpinner,\n MatSpinner,\n MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS,\n ProgressSpinnerMode,\n MatProgressSpinnerDefaultOptions,\n MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n} from './progress-spinner';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AA6BA;;;;AAIA,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB;;;;AAIA,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;AACA;AACA,MAAM,uBAAuB,GAAG,UAAU,CAAC;IACzC,YAAmB,WAAuB;QAAvB,gBAAW,GAAX,WAAW,CAAY;KAAI;CAC/C,EAAE,SAAS,CAAC,CAAC;AAed;MACa,oCAAoC,GAC7C,IAAI,cAAc,CAAmC,sCAAsC,EAAE;IAC3F,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,4CAA4C;CACtD,EAAE;AAEP;SACgB,4CAA4C;IAC1D,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,CAAC;AAC/B,CAAC;AAED;AACA;AACA;AACA;AACA,MAAM,gCAAgC,GAAG;;;;;;;;;;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ACxBD;;;;;;;;ACAA;;;;;;"}
|
package/fesm2015/radio.js
CHANGED
|
@@ -272,8 +272,6 @@ class MatRadioButtonBase {
|
|
|
272
272
|
this._elementRef = _elementRef;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
// As per Material design specifications the selection control radio should use the accent color
|
|
276
|
-
// palette by default. https://material.io/guidelines/components/selection-controls.html
|
|
277
275
|
const _MatRadioButtonMixinBase = mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));
|
|
278
276
|
/**
|
|
279
277
|
* Base class with all of the `MatRadioButton` functionality.
|
|
@@ -375,6 +373,8 @@ class _MatRadioButtonBase extends _MatRadioButtonMixinBase {
|
|
|
375
373
|
}
|
|
376
374
|
/** Theme color of the radio button. */
|
|
377
375
|
get color() {
|
|
376
|
+
// As per Material design specifications the selection control radio should use the accent color
|
|
377
|
+
// palette by default. https://material.io/guidelines/components/selection-controls.html
|
|
378
378
|
return this._color ||
|
|
379
379
|
(this.radioGroup && this.radioGroup.color) ||
|
|
380
380
|
this._providerOverride && this._providerOverride.color || 'accent';
|
package/fesm2015/radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sources":["../../../../../../src/material/radio/radio.ts","../../../../../../src/material/radio/radio-module.ts","../../../../../../src/material/radio/public-api.ts","../../../../../../src/material/radio/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {\n AfterContentInit,\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanDisableRipple,\n CanDisableRippleCtor,\n HasTabIndex,\n HasTabIndexCtor,\n mixinDisableRipple,\n mixinTabIndex,\n ThemePalette,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\nexport interface MatRadioDefaultOptions {\n color: ThemePalette;\n}\n\nexport const MAT_RADIO_DEFAULT_OPTIONS =\n new InjectionToken<MatRadioDefaultOptions>('mat-radio-default-options', {\n providedIn: 'root',\n factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY\n});\n\nexport function MAT_RADIO_DEFAULT_OPTIONS_FACTORY(): MatRadioDefaultOptions {\n return {\n color: 'accent'\n };\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n/**\n * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This\n * allows it to support [(ngModel)] and ngControl.\n * @docs-private\n */\nexport const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatRadioGroup),\n multi: true\n};\n\n/** Change event object emitted by MatRadio and MatRadioGroup. */\nexport class MatRadioChange {\n constructor(\n /** The MatRadioButton that emits the change event. */\n public source: _MatRadioButtonBase,\n /** The value of the MatRadioButton. */\n public value: any) {}\n}\n\n/**\n * Injection token that can be used to inject instances of `MatRadioGroup`. It serves as\n * alternative token to the actual `MatRadioGroup` class which could cause unnecessary\n * retention of the class and its component metadata.\n */\nexport const MAT_RADIO_GROUP =\n new InjectionToken<_MatRadioGroupBase<_MatRadioButtonBase>>('MatRadioGroup');\n\n/**\n * Base class with all of the `MatRadioGroup` functionality.\n * @docs-private\n */\n@Directive()\nexport abstract class _MatRadioGroupBase<T extends _MatRadioButtonBase> implements AfterContentInit,\n ControlValueAccessor {\n /** Selected value for the radio group. */\n private _value: any = null;\n\n /** The HTML name attribute applied to radio buttons in this group. */\n private _name: string = `mat-radio-group-${nextUniqueId++}`;\n\n /** The currently selected radio button. Should match value. */\n private _selected: T | null = null;\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n private _labelPosition: 'before' | 'after' = 'after';\n\n /** Whether the radio group is disabled. */\n private _disabled: boolean = false;\n\n /** Whether the radio group is required. */\n private _required: boolean = false;\n\n /** The method to be called in order to update ngModel */\n _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @docs-private\n */\n onTouched: () => any = () => {};\n\n /**\n * Event emitted when the group value changes.\n * Change events are only emitted when the value changes due to user interaction with\n * a radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** Child radio buttons. */\n abstract _radios: QueryList<T>;\n\n /** Theme color for all of the radio buttons in the group. */\n @Input() color: ThemePalette;\n\n /** Name of the radio button group. All radio buttons inside this group will use this name. */\n @Input()\n get name(): string { return this._name; }\n set name(value: string) {\n this._name = value;\n this._updateRadioButtonNames();\n }\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition;\n }\n set labelPosition(v) {\n this._labelPosition = v === 'before' ? 'before' : 'after';\n this._markRadiosForCheck();\n }\n\n /**\n * Value for the radio-group. Should equal the value of the selected radio button if there is\n * a corresponding radio button with a matching value. If there is not such a corresponding\n * radio button, this value persists to be applied in case a new radio button is added with a\n * matching value.\n */\n @Input()\n get value(): any { return this._value; }\n set value(newValue: any) {\n if (this._value !== newValue) {\n // Set this before proceeding to ensure no circular loop occurs with selection.\n this._value = newValue;\n\n this._updateSelectedRadioFromValue();\n this._checkSelectedRadioButton();\n }\n }\n\n _checkSelectedRadioButton() {\n if (this._selected && !this._selected.checked) {\n this._selected.checked = true;\n }\n }\n\n /**\n * The currently selected radio button. If set to a new radio button, the radio group value\n * will be updated to match the new selected button.\n */\n @Input()\n get selected() { return this._selected; }\n set selected(selected: T | null) {\n this._selected = selected;\n this.value = selected ? selected.value : null;\n this._checkSelectedRadioButton();\n }\n\n /** Whether the radio group is disabled */\n @Input()\n get disabled(): boolean { return this._disabled; }\n set disabled(value) {\n this._disabled = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n /** Whether the radio group is required */\n @Input()\n get required(): boolean { return this._required; }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n constructor(private _changeDetector: ChangeDetectorRef) { }\n\n /**\n * Initialize properties once content children are available.\n * This allows us to propagate relevant attributes to associated buttons.\n */\n ngAfterContentInit() {\n // Mark this component as initialized in AfterContentInit because the initial value can\n // possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the\n // NgModel occurs *after* the OnInit of the MatRadioGroup.\n this._isInitialized = true;\n }\n\n /**\n * Mark this group as being \"touched\" (for ngModel). Meant to be called by the contained\n * radio buttons upon their blur.\n */\n _touch() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n private _updateRadioButtonNames(): void {\n if (this._radios) {\n this._radios.forEach(radio => {\n radio.name = this.name;\n radio._markForCheck();\n });\n }\n }\n\n /** Updates the `selected` radio button from the internal _value state. */\n private _updateSelectedRadioFromValue(): void {\n // If the value already matches the selected radio, do nothing.\n const isAlreadySelected = this._selected !== null && this._selected.value === this._value;\n\n if (this._radios && !isAlreadySelected) {\n this._selected = null;\n this._radios.forEach(radio => {\n radio.checked = this.value === radio.value;\n if (radio.checked) {\n this._selected = radio;\n }\n });\n }\n }\n\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent(): void {\n if (this._isInitialized) {\n this.change.emit(new MatRadioChange(this._selected!, this._value));\n }\n }\n\n _markRadiosForCheck() {\n if (this._radios) {\n this._radios.forEach(radio => radio._markForCheck());\n }\n }\n\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value: any) {\n this.value = value;\n this._changeDetector.markForCheck();\n }\n\n /**\n * Registers a callback to be triggered when the model value changes.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n /**\n * Registers a callback to be triggered when the control is touched.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnTouched(fn: any) {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.\n * @param isDisabled Whether the control should be disabled.\n */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n this._changeDetector.markForCheck();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\n}\n\n/**\n * A group of radio buttons. May contain one or more `<mat-radio-button>` elements.\n */\n@Directive({\n selector: 'mat-radio-group',\n exportAs: 'matRadioGroup',\n providers: [\n MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,\n {provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup},\n ],\n host: {\n 'role': 'radiogroup',\n 'class': 'mat-radio-group',\n },\n})\nexport class MatRadioGroup extends _MatRadioGroupBase<MatRadioButton> {\n @ContentChildren(forwardRef(() => MatRadioButton), {descendants: true})\n _radios: QueryList<MatRadioButton>;\n}\n\n// Boilerplate for applying mixins to MatRadioButton.\n/** @docs-private */\nabstract class MatRadioButtonBase {\n // Since the disabled property is manually defined for the MatRadioButton and isn't set up in\n // the mixin base class. To be able to use the tabindex mixin, a disabled property must be\n // defined to properly work.\n abstract disabled: boolean;\n constructor(public _elementRef: ElementRef) {}\n}\n// As per Material design specifications the selection control radio should use the accent color\n// palette by default. https://material.io/guidelines/components/selection-controls.html\nconst _MatRadioButtonMixinBase:\n CanDisableRippleCtor & HasTabIndexCtor & typeof MatRadioButtonBase =\n mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));\n\n/**\n * Base class with all of the `MatRadioButton` functionality.\n * @docs-private\n */\n@Directive()\nexport abstract class _MatRadioButtonBase extends _MatRadioButtonMixinBase implements OnInit,\n AfterViewInit, OnDestroy, CanDisableRipple, HasTabIndex {\n\n private _uniqueId: string = `mat-radio-${++nextUniqueId}`;\n\n /** The unique ID for the radio button. */\n @Input() id: string = this._uniqueId;\n\n /** Analog to HTML 'name' attribute used to group radios for unique selection. */\n @Input() name: string;\n\n /** Used to set the 'aria-label' attribute on the underlying input element. */\n @Input('aria-label') ariaLabel: string;\n\n /** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** The 'aria-describedby' attribute is read after the element's label and field type. */\n @Input('aria-describedby') ariaDescribedby: string;\n\n /** Whether this radio button is checked. */\n @Input()\n get checked(): boolean { return this._checked; }\n set checked(value: boolean) {\n const newCheckedState = coerceBooleanProperty(value);\n if (this._checked !== newCheckedState) {\n this._checked = newCheckedState;\n if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {\n this.radioGroup.selected = this;\n } else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {\n\n // When unchecking the selected radio button, update the selected radio\n // property on the group.\n this.radioGroup.selected = null;\n }\n\n if (newCheckedState) {\n // Notify all radio buttons with the same name to un-check.\n this._radioDispatcher.notify(this.id, this.name);\n }\n this._changeDetector.markForCheck();\n }\n }\n\n /** The value of this radio button. */\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n if (this._value !== value) {\n this._value = value;\n if (this.radioGroup !== null) {\n if (!this.checked) {\n // Update checked when the value changed to match the radio group's value\n this.checked = this.radioGroup.value === value;\n }\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n }\n }\n }\n\n /** Whether the label should appear after or before the radio button. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }\n set labelPosition(value) {\n this._labelPosition = value;\n }\n private _labelPosition: 'before' | 'after';\n\n /** Whether the radio button is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);\n }\n set disabled(value: boolean) {\n this._setDisabled(coerceBooleanProperty(value));\n }\n\n /** Whether the radio button is required. */\n @Input()\n get required(): boolean {\n return this._required || (this.radioGroup && this.radioGroup.required);\n }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n }\n\n /** Theme color of the radio button. */\n @Input()\n get color(): ThemePalette {\n return this._color ||\n (this.radioGroup && this.radioGroup.color) ||\n this._providerOverride && this._providerOverride.color || 'accent';\n }\n set color(newValue: ThemePalette) { this._color = newValue; }\n private _color: ThemePalette;\n\n /**\n * Event emitted when the checked state of this radio button changes.\n * Change events are only emitted when the value changes due to user interaction with\n * the radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** The parent radio group. May or may not be present. */\n radioGroup: _MatRadioGroupBase<_MatRadioButtonBase>;\n\n /** ID of the native input element inside `<mat-radio-button>` */\n get inputId(): string { return `${this.id || this._uniqueId}-input`; }\n\n /** Whether this radio is checked. */\n private _checked: boolean = false;\n\n /** Whether this radio is disabled. */\n private _disabled: boolean;\n\n /** Whether this radio is required. */\n private _required: boolean;\n\n /** Value assigned to this radio. */\n private _value: any = null;\n\n /** Unregister function for _radioDispatcher */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n /** The native `<input type=radio>` element */\n @ViewChild('input') _inputElement: ElementRef<HTMLInputElement>;\n\n /** Whether animations are disabled. */\n _noopAnimations: boolean;\n\n constructor(radioGroup: _MatRadioGroupBase<_MatRadioButtonBase>,\n elementRef: ElementRef,\n protected _changeDetector: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _radioDispatcher: UniqueSelectionDispatcher,\n animationMode?: string,\n private _providerOverride?: MatRadioDefaultOptions,\n tabIndex?: string) {\n super(elementRef);\n\n // Assertions. Ideally these should be stripped out by the compiler.\n // TODO(jelbourn): Assert that there's no name binding AND a parent radio group.\n this.radioGroup = radioGroup;\n this._noopAnimations = animationMode === 'NoopAnimations';\n\n if (tabIndex) {\n this.tabIndex = coerceNumberProperty(tabIndex, 0);\n }\n\n this._removeUniqueSelectionListener =\n _radioDispatcher.listen((id: string, name: string) => {\n if (id !== this.id && name === this.name) {\n this.checked = false;\n }\n });\n }\n\n /** Focuses the radio button. */\n focus(options?: FocusOptions, origin?: FocusOrigin): void {\n if (origin) {\n this._focusMonitor.focusVia(this._inputElement, origin, options);\n } else {\n this._inputElement.nativeElement.focus(options);\n }\n }\n\n /**\n * Marks the radio button as needing checking for change detection.\n * This method is exposed because the parent radio group will directly\n * update bound properties of the radio button.\n */\n _markForCheck() {\n // When group value changes, the button will not be notified. Use `markForCheck` to explicit\n // update radio button's status\n this._changeDetector.markForCheck();\n }\n\n ngOnInit() {\n if (this.radioGroup) {\n // If the radio is inside a radio group, determine if it should be checked\n this.checked = this.radioGroup.value === this._value;\n\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n\n // Copy name from parent radio group\n this.name = this.radioGroup.name;\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor\n .monitor(this._elementRef, true)\n .subscribe(focusOrigin => {\n if (!focusOrigin && this.radioGroup) {\n this.radioGroup._touch();\n }\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._removeUniqueSelectionListener();\n }\n\n /** Dispatch change event with current value. */\n private _emitChangeEvent(): void {\n this.change.emit(new MatRadioChange(this, this._value));\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n _onInputClick(event: Event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `radio-button` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n }\n\n /** Triggered when the radio button receives an interaction from the user. */\n _onInputInteraction(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n\n if (!this.checked && !this.disabled) {\n const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;\n this.checked = true;\n this._emitChangeEvent();\n\n if (this.radioGroup) {\n this.radioGroup._controlValueAccessorChangeFn(this.value);\n if (groupValueChanged) {\n this.radioGroup._emitChangeEvent();\n }\n }\n }\n }\n\n /** Sets the disabled state and marks for check if a change occurred. */\n protected _setDisabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._changeDetector.markForCheck();\n }\n }\n\n static ngAcceptInputType_checked: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\n static ngAcceptInputType_disableRipple: BooleanInput;\n static ngAcceptInputType_tabIndex: NumberInput;\n}\n\n\n/**\n * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.\n */\n@Component({\n selector: 'mat-radio-button',\n templateUrl: 'radio.html',\n styleUrls: ['radio.css'],\n inputs: ['disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matRadioButton',\n host: {\n 'class': 'mat-radio-button',\n '[class.mat-radio-checked]': 'checked',\n '[class.mat-radio-disabled]': 'disabled',\n '[class._mat-animation-noopable]': '_noopAnimations',\n '[class.mat-primary]': 'color === \"primary\"',\n '[class.mat-accent]': 'color === \"accent\"',\n '[class.mat-warn]': 'color === \"warn\"',\n // Needs to be removed since it causes some a11y issues (see #21266).\n '[attr.tabindex]': 'null',\n '[attr.id]': 'id',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the native element.\n '(focus)': '_inputElement.nativeElement.focus()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatRadioButton extends _MatRadioButtonBase {\n constructor(@Optional() @Inject(MAT_RADIO_GROUP) radioGroup: MatRadioGroup,\n elementRef: ElementRef,\n changeDetector: ChangeDetectorRef,\n focusMonitor: FocusMonitor,\n radioDispatcher: UniqueSelectionDispatcher,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n @Optional() @Inject(MAT_RADIO_DEFAULT_OPTIONS)\n providerOverride?: MatRadioDefaultOptions,\n @Attribute('tabindex') tabIndex?: string) {\n super(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher,\n animationMode, providerOverride, tabIndex);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatRadioButton, MatRadioGroup} from './radio';\n\n\n@NgModule({\n imports: [MatRippleModule, MatCommonModule],\n exports: [MatRadioGroup, MatRadioButton, MatCommonModule],\n declarations: [MatRadioGroup, MatRadioButton],\n})\nexport class MatRadioModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './radio-module';\nexport * from './radio';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;MAwDa,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,EAAE;IACxE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,iCAAiC;CAC3C,EAAE;SAEa,iCAAiC;IAC/C,OAAO;QACL,KAAK,EAAE,QAA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AC5C,oBAAoB,EAAE,oBAAoB;oBAC1C,kBAAkB,EAAE,kBAAkB;;oBAEtC,iBAAiB,EAAE,MAAM;oBACzB,WAAW,EAAE,IAAI;oBACjB,mBAAmB,EAAE,MAAM;oBAC3B,wBAAwB,EAAE,MAAM;oBAChC,yBAAyB,EAAE,MAAM;;;;oBAIjC,SAAS,EAAE,qCAAqC;iBACjD;gBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YAE8D,aAAa,uBAA7D,QAAQ,YAAI,MAAM,SAAC,eAAe;YA1nB/C,UAAU;YAJV,iBAAiB;YAbX,YAAY;YAOZ,yBAAyB;yCAyoBlB,QAAQ,YAAI,MAAM,SAAC,qBAAqB;4CACtC,QAAQ,YAAI,MAAM,SAAC,yBAAyB;yCAE9C,SAAS,SAAC,UAAU;;;AC3pBnC;;;;;;;MAkBa,cAAc;;;YAL1B,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;gBAC3C,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;gBACzD,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;aAC9C;;;ACjBD;;;;;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../../../../src/material/radio/radio.ts","../../../../../../src/material/radio/radio-module.ts","../../../../../../src/material/radio/public-api.ts","../../../../../../src/material/radio/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {\n AfterContentInit,\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanDisableRipple,\n HasTabIndex,\n mixinDisableRipple,\n mixinTabIndex,\n ThemePalette,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\nexport interface MatRadioDefaultOptions {\n color: ThemePalette;\n}\n\nexport const MAT_RADIO_DEFAULT_OPTIONS =\n new InjectionToken<MatRadioDefaultOptions>('mat-radio-default-options', {\n providedIn: 'root',\n factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY\n});\n\nexport function MAT_RADIO_DEFAULT_OPTIONS_FACTORY(): MatRadioDefaultOptions {\n return {\n color: 'accent'\n };\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n/**\n * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This\n * allows it to support [(ngModel)] and ngControl.\n * @docs-private\n */\nexport const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatRadioGroup),\n multi: true\n};\n\n/** Change event object emitted by MatRadio and MatRadioGroup. */\nexport class MatRadioChange {\n constructor(\n /** The MatRadioButton that emits the change event. */\n public source: _MatRadioButtonBase,\n /** The value of the MatRadioButton. */\n public value: any) {}\n}\n\n/**\n * Injection token that can be used to inject instances of `MatRadioGroup`. It serves as\n * alternative token to the actual `MatRadioGroup` class which could cause unnecessary\n * retention of the class and its component metadata.\n */\nexport const MAT_RADIO_GROUP =\n new InjectionToken<_MatRadioGroupBase<_MatRadioButtonBase>>('MatRadioGroup');\n\n/**\n * Base class with all of the `MatRadioGroup` functionality.\n * @docs-private\n */\n@Directive()\nexport abstract class _MatRadioGroupBase<T extends _MatRadioButtonBase> implements AfterContentInit,\n ControlValueAccessor {\n /** Selected value for the radio group. */\n private _value: any = null;\n\n /** The HTML name attribute applied to radio buttons in this group. */\n private _name: string = `mat-radio-group-${nextUniqueId++}`;\n\n /** The currently selected radio button. Should match value. */\n private _selected: T | null = null;\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n private _labelPosition: 'before' | 'after' = 'after';\n\n /** Whether the radio group is disabled. */\n private _disabled: boolean = false;\n\n /** Whether the radio group is required. */\n private _required: boolean = false;\n\n /** The method to be called in order to update ngModel */\n _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @docs-private\n */\n onTouched: () => any = () => {};\n\n /**\n * Event emitted when the group value changes.\n * Change events are only emitted when the value changes due to user interaction with\n * a radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** Child radio buttons. */\n abstract _radios: QueryList<T>;\n\n /** Theme color for all of the radio buttons in the group. */\n @Input() color: ThemePalette;\n\n /** Name of the radio button group. All radio buttons inside this group will use this name. */\n @Input()\n get name(): string { return this._name; }\n set name(value: string) {\n this._name = value;\n this._updateRadioButtonNames();\n }\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition;\n }\n set labelPosition(v) {\n this._labelPosition = v === 'before' ? 'before' : 'after';\n this._markRadiosForCheck();\n }\n\n /**\n * Value for the radio-group. Should equal the value of the selected radio button if there is\n * a corresponding radio button with a matching value. If there is not such a corresponding\n * radio button, this value persists to be applied in case a new radio button is added with a\n * matching value.\n */\n @Input()\n get value(): any { return this._value; }\n set value(newValue: any) {\n if (this._value !== newValue) {\n // Set this before proceeding to ensure no circular loop occurs with selection.\n this._value = newValue;\n\n this._updateSelectedRadioFromValue();\n this._checkSelectedRadioButton();\n }\n }\n\n _checkSelectedRadioButton() {\n if (this._selected && !this._selected.checked) {\n this._selected.checked = true;\n }\n }\n\n /**\n * The currently selected radio button. If set to a new radio button, the radio group value\n * will be updated to match the new selected button.\n */\n @Input()\n get selected() { return this._selected; }\n set selected(selected: T | null) {\n this._selected = selected;\n this.value = selected ? selected.value : null;\n this._checkSelectedRadioButton();\n }\n\n /** Whether the radio group is disabled */\n @Input()\n get disabled(): boolean { return this._disabled; }\n set disabled(value) {\n this._disabled = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n /** Whether the radio group is required */\n @Input()\n get required(): boolean { return this._required; }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n constructor(private _changeDetector: ChangeDetectorRef) { }\n\n /**\n * Initialize properties once content children are available.\n * This allows us to propagate relevant attributes to associated buttons.\n */\n ngAfterContentInit() {\n // Mark this component as initialized in AfterContentInit because the initial value can\n // possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the\n // NgModel occurs *after* the OnInit of the MatRadioGroup.\n this._isInitialized = true;\n }\n\n /**\n * Mark this group as being \"touched\" (for ngModel). Meant to be called by the contained\n * radio buttons upon their blur.\n */\n _touch() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n private _updateRadioButtonNames(): void {\n if (this._radios) {\n this._radios.forEach(radio => {\n radio.name = this.name;\n radio._markForCheck();\n });\n }\n }\n\n /** Updates the `selected` radio button from the internal _value state. */\n private _updateSelectedRadioFromValue(): void {\n // If the value already matches the selected radio, do nothing.\n const isAlreadySelected = this._selected !== null && this._selected.value === this._value;\n\n if (this._radios && !isAlreadySelected) {\n this._selected = null;\n this._radios.forEach(radio => {\n radio.checked = this.value === radio.value;\n if (radio.checked) {\n this._selected = radio;\n }\n });\n }\n }\n\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent(): void {\n if (this._isInitialized) {\n this.change.emit(new MatRadioChange(this._selected!, this._value));\n }\n }\n\n _markRadiosForCheck() {\n if (this._radios) {\n this._radios.forEach(radio => radio._markForCheck());\n }\n }\n\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value: any) {\n this.value = value;\n this._changeDetector.markForCheck();\n }\n\n /**\n * Registers a callback to be triggered when the model value changes.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n /**\n * Registers a callback to be triggered when the control is touched.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnTouched(fn: any) {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.\n * @param isDisabled Whether the control should be disabled.\n */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n this._changeDetector.markForCheck();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\n}\n\n/**\n * A group of radio buttons. May contain one or more `<mat-radio-button>` elements.\n */\n@Directive({\n selector: 'mat-radio-group',\n exportAs: 'matRadioGroup',\n providers: [\n MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,\n {provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup},\n ],\n host: {\n 'role': 'radiogroup',\n 'class': 'mat-radio-group',\n },\n})\nexport class MatRadioGroup extends _MatRadioGroupBase<MatRadioButton> {\n @ContentChildren(forwardRef(() => MatRadioButton), {descendants: true})\n _radios: QueryList<MatRadioButton>;\n}\n\n// Boilerplate for applying mixins to MatRadioButton.\n/** @docs-private */\nabstract class MatRadioButtonBase {\n // Since the disabled property is manually defined for the MatRadioButton and isn't set up in\n // the mixin base class. To be able to use the tabindex mixin, a disabled property must be\n // defined to properly work.\n abstract disabled: boolean;\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _MatRadioButtonMixinBase = mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));\n\n/**\n * Base class with all of the `MatRadioButton` functionality.\n * @docs-private\n */\n@Directive()\nexport abstract class _MatRadioButtonBase extends _MatRadioButtonMixinBase implements OnInit,\n AfterViewInit, OnDestroy, CanDisableRipple, HasTabIndex {\n\n private _uniqueId: string = `mat-radio-${++nextUniqueId}`;\n\n /** The unique ID for the radio button. */\n @Input() id: string = this._uniqueId;\n\n /** Analog to HTML 'name' attribute used to group radios for unique selection. */\n @Input() name: string;\n\n /** Used to set the 'aria-label' attribute on the underlying input element. */\n @Input('aria-label') ariaLabel: string;\n\n /** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** The 'aria-describedby' attribute is read after the element's label and field type. */\n @Input('aria-describedby') ariaDescribedby: string;\n\n /** Whether this radio button is checked. */\n @Input()\n get checked(): boolean { return this._checked; }\n set checked(value: boolean) {\n const newCheckedState = coerceBooleanProperty(value);\n if (this._checked !== newCheckedState) {\n this._checked = newCheckedState;\n if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {\n this.radioGroup.selected = this;\n } else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {\n\n // When unchecking the selected radio button, update the selected radio\n // property on the group.\n this.radioGroup.selected = null;\n }\n\n if (newCheckedState) {\n // Notify all radio buttons with the same name to un-check.\n this._radioDispatcher.notify(this.id, this.name);\n }\n this._changeDetector.markForCheck();\n }\n }\n\n /** The value of this radio button. */\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n if (this._value !== value) {\n this._value = value;\n if (this.radioGroup !== null) {\n if (!this.checked) {\n // Update checked when the value changed to match the radio group's value\n this.checked = this.radioGroup.value === value;\n }\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n }\n }\n }\n\n /** Whether the label should appear after or before the radio button. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }\n set labelPosition(value) {\n this._labelPosition = value;\n }\n private _labelPosition: 'before' | 'after';\n\n /** Whether the radio button is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);\n }\n set disabled(value: boolean) {\n this._setDisabled(coerceBooleanProperty(value));\n }\n\n /** Whether the radio button is required. */\n @Input()\n get required(): boolean {\n return this._required || (this.radioGroup && this.radioGroup.required);\n }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n }\n\n /** Theme color of the radio button. */\n @Input()\n get color(): ThemePalette {\n // As per Material design specifications the selection control radio should use the accent color\n // palette by default. https://material.io/guidelines/components/selection-controls.html\n return this._color ||\n (this.radioGroup && this.radioGroup.color) ||\n this._providerOverride && this._providerOverride.color || 'accent';\n }\n set color(newValue: ThemePalette) { this._color = newValue; }\n private _color: ThemePalette;\n\n /**\n * Event emitted when the checked state of this radio button changes.\n * Change events are only emitted when the value changes due to user interaction with\n * the radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** The parent radio group. May or may not be present. */\n radioGroup: _MatRadioGroupBase<_MatRadioButtonBase>;\n\n /** ID of the native input element inside `<mat-radio-button>` */\n get inputId(): string { return `${this.id || this._uniqueId}-input`; }\n\n /** Whether this radio is checked. */\n private _checked: boolean = false;\n\n /** Whether this radio is disabled. */\n private _disabled: boolean;\n\n /** Whether this radio is required. */\n private _required: boolean;\n\n /** Value assigned to this radio. */\n private _value: any = null;\n\n /** Unregister function for _radioDispatcher */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n /** The native `<input type=radio>` element */\n @ViewChild('input') _inputElement: ElementRef<HTMLInputElement>;\n\n /** Whether animations are disabled. */\n _noopAnimations: boolean;\n\n constructor(radioGroup: _MatRadioGroupBase<_MatRadioButtonBase>,\n elementRef: ElementRef,\n protected _changeDetector: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _radioDispatcher: UniqueSelectionDispatcher,\n animationMode?: string,\n private _providerOverride?: MatRadioDefaultOptions,\n tabIndex?: string) {\n super(elementRef);\n\n // Assertions. Ideally these should be stripped out by the compiler.\n // TODO(jelbourn): Assert that there's no name binding AND a parent radio group.\n this.radioGroup = radioGroup;\n this._noopAnimations = animationMode === 'NoopAnimations';\n\n if (tabIndex) {\n this.tabIndex = coerceNumberProperty(tabIndex, 0);\n }\n\n this._removeUniqueSelectionListener =\n _radioDispatcher.listen((id: string, name: string) => {\n if (id !== this.id && name === this.name) {\n this.checked = false;\n }\n });\n }\n\n /** Focuses the radio button. */\n focus(options?: FocusOptions, origin?: FocusOrigin): void {\n if (origin) {\n this._focusMonitor.focusVia(this._inputElement, origin, options);\n } else {\n this._inputElement.nativeElement.focus(options);\n }\n }\n\n /**\n * Marks the radio button as needing checking for change detection.\n * This method is exposed because the parent radio group will directly\n * update bound properties of the radio button.\n */\n _markForCheck() {\n // When group value changes, the button will not be notified. Use `markForCheck` to explicit\n // update radio button's status\n this._changeDetector.markForCheck();\n }\n\n ngOnInit() {\n if (this.radioGroup) {\n // If the radio is inside a radio group, determine if it should be checked\n this.checked = this.radioGroup.value === this._value;\n\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n\n // Copy name from parent radio group\n this.name = this.radioGroup.name;\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor\n .monitor(this._elementRef, true)\n .subscribe(focusOrigin => {\n if (!focusOrigin && this.radioGroup) {\n this.radioGroup._touch();\n }\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._removeUniqueSelectionListener();\n }\n\n /** Dispatch change event with current value. */\n private _emitChangeEvent(): void {\n this.change.emit(new MatRadioChange(this, this._value));\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n _onInputClick(event: Event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `radio-button` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n }\n\n /** Triggered when the radio button receives an interaction from the user. */\n _onInputInteraction(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n\n if (!this.checked && !this.disabled) {\n const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;\n this.checked = true;\n this._emitChangeEvent();\n\n if (this.radioGroup) {\n this.radioGroup._controlValueAccessorChangeFn(this.value);\n if (groupValueChanged) {\n this.radioGroup._emitChangeEvent();\n }\n }\n }\n }\n\n /** Sets the disabled state and marks for check if a change occurred. */\n protected _setDisabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._changeDetector.markForCheck();\n }\n }\n\n static ngAcceptInputType_checked: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\n static ngAcceptInputType_disableRipple: BooleanInput;\n static ngAcceptInputType_tabIndex: NumberInput;\n}\n\n\n/**\n * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.\n */\n@Component({\n selector: 'mat-radio-button',\n templateUrl: 'radio.html',\n styleUrls: ['radio.css'],\n inputs: ['disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matRadioButton',\n host: {\n 'class': 'mat-radio-button',\n '[class.mat-radio-checked]': 'checked',\n '[class.mat-radio-disabled]': 'disabled',\n '[class._mat-animation-noopable]': '_noopAnimations',\n '[class.mat-primary]': 'color === \"primary\"',\n '[class.mat-accent]': 'color === \"accent\"',\n '[class.mat-warn]': 'color === \"warn\"',\n // Needs to be removed since it causes some a11y issues (see #21266).\n '[attr.tabindex]': 'null',\n '[attr.id]': 'id',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the native element.\n '(focus)': '_inputElement.nativeElement.focus()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatRadioButton extends _MatRadioButtonBase {\n constructor(@Optional() @Inject(MAT_RADIO_GROUP) radioGroup: MatRadioGroup,\n elementRef: ElementRef,\n changeDetector: ChangeDetectorRef,\n focusMonitor: FocusMonitor,\n radioDispatcher: UniqueSelectionDispatcher,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n @Optional() @Inject(MAT_RADIO_DEFAULT_OPTIONS)\n providerOverride?: MatRadioDefaultOptions,\n @Attribute('tabindex') tabIndex?: string) {\n super(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher,\n animationMode, providerOverride, tabIndex);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatRadioButton, MatRadioGroup} from './radio';\n\n\n@NgModule({\n imports: [MatRippleModule, MatCommonModule],\n exports: [MatRadioGroup, MatRadioButton, MatCommonModule],\n declarations: [MatRadioGroup, MatRadioButton],\n})\nexport class MatRadioModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './radio-module';\nexport * from './radio';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;MAsDa,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,EAAE;IACxE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,iCAAiC;CAC3C,EAAE;SAEa,iCAAiC;IAC/C,OAAO;QACL,KAAK,EAAE,QAAQ;KAChB,CAAC;AACJ,CAA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AC1C,kBAAkB,EAAE,kBAAkB;;oBAEtC,iBAAiB,EAAE,MAAM;oBACzB,WAAW,EAAE,IAAI;oBACjB,mBAAmB,EAAE,MAAM;oBAC3B,wBAAwB,EAAE,MAAM;oBAChC,yBAAyB,EAAE,MAAM;;;;oBAIjC,SAAS,EAAE,qCAAqC;iBACjD;gBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YAE8D,aAAa,uBAA7D,QAAQ,YAAI,MAAM,SAAC,eAAe;YAvnB/C,UAAU;YAJV,iBAAiB;YAbX,YAAY;YAOZ,yBAAyB;yCAsoBlB,QAAQ,YAAI,MAAM,SAAC,qBAAqB;4CACtC,QAAQ,YAAI,MAAM,SAAC,yBAAyB;yCAE9C,SAAS,SAAC,UAAU;;;ACxpBnC;;;;;;;MAkBa,cAAc;;;YAL1B,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;gBAC3C,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;gBACzD,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;aAC9C;;;ACjBD;;;;;;;;ACAA;;;;;;"}
|
package/fesm2015/select.js
CHANGED
|
@@ -164,7 +164,7 @@ class MatSelectChange {
|
|
|
164
164
|
}
|
|
165
165
|
// Boilerplate for applying mixins to MatSelect.
|
|
166
166
|
/** @docs-private */
|
|
167
|
-
class
|
|
167
|
+
const _MatSelectMixinBase = mixinDisableRipple(mixinTabIndex(mixinDisabled(mixinErrorState(class {
|
|
168
168
|
constructor(_elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) {
|
|
169
169
|
this._elementRef = _elementRef;
|
|
170
170
|
this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
|
|
@@ -172,8 +172,7 @@ class MatSelectBase {
|
|
|
172
172
|
this._parentFormGroup = _parentFormGroup;
|
|
173
173
|
this.ngControl = ngControl;
|
|
174
174
|
}
|
|
175
|
-
}
|
|
176
|
-
const _MatSelectMixinBase = mixinDisableRipple(mixinTabIndex(mixinDisabled(mixinErrorState(MatSelectBase))));
|
|
175
|
+
}))));
|
|
177
176
|
/**
|
|
178
177
|
* Injection token that can be used to reference instances of `MatSelectTrigger`. It serves as
|
|
179
178
|
* alternative token to the actual `MatSelectTrigger` class which could cause unnecessary
|