@angular/material 7.0.4 → 7.2.1
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/LICENSE +1 -1
- package/_theming.scss +61 -44
- package/autocomplete/typings/index.d.ts +1 -1
- package/autocomplete/typings/index.metadata.json +1 -1
- package/badge/typings/index.metadata.json +1 -1
- package/bottom-sheet/typings/bottom-sheet-config.d.ts +5 -0
- package/bottom-sheet/typings/bottom-sheet-container.d.ts +1 -1
- package/bottom-sheet/typings/index.metadata.json +1 -1
- package/bundles/material-autocomplete.umd.js +126 -32
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +1 -1
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-badge.umd.js +38 -5
- package/bundles/material-badge.umd.js.map +1 -1
- package/bundles/material-badge.umd.min.js +1 -1
- package/bundles/material-badge.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.js +68 -21
- package/bundles/material-bottom-sheet.umd.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.min.js +1 -1
- package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
- package/bundles/material-button-toggle.umd.js +36 -13
- package/bundles/material-button-toggle.umd.js.map +1 -1
- package/bundles/material-button-toggle.umd.min.js +1 -1
- package/bundles/material-button-toggle.umd.min.js.map +1 -1
- package/bundles/material-button.umd.js +21 -14
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-button.umd.min.js +1 -1
- package/bundles/material-button.umd.min.js.map +1 -1
- package/bundles/material-card.umd.js +3 -3
- package/bundles/material-card.umd.js.map +1 -1
- package/bundles/material-card.umd.min.js +1 -1
- package/bundles/material-card.umd.min.js.map +1 -1
- package/bundles/material-checkbox.umd.js +56 -15
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-checkbox.umd.min.js +1 -1
- package/bundles/material-checkbox.umd.min.js.map +1 -1
- package/bundles/material-chips.umd.js +124 -34
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-chips.umd.min.js +1 -1
- package/bundles/material-chips.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +189 -126
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +1 -1
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +231 -53
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +2 -2
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-dialog.umd.js +138 -40
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-dialog.umd.min.js +1 -1
- package/bundles/material-dialog.umd.min.js.map +1 -1
- package/bundles/material-divider.umd.js +2 -2
- package/bundles/material-divider.umd.js.map +1 -1
- package/bundles/material-divider.umd.min.js.map +1 -1
- package/bundles/material-expansion.umd.js +53 -27
- package/bundles/material-expansion.umd.js.map +1 -1
- package/bundles/material-expansion.umd.min.js +1 -1
- package/bundles/material-expansion.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +121 -32
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +1 -1
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-grid-list.umd.js +66 -15
- package/bundles/material-grid-list.umd.js.map +1 -1
- package/bundles/material-grid-list.umd.min.js +1 -1
- package/bundles/material-grid-list.umd.min.js.map +1 -1
- package/bundles/material-icon.umd.js +277 -78
- package/bundles/material-icon.umd.js.map +1 -1
- package/bundles/material-icon.umd.min.js +1 -1
- package/bundles/material-icon.umd.min.js.map +1 -1
- package/bundles/material-input.umd.js +50 -22
- package/bundles/material-input.umd.js.map +1 -1
- package/bundles/material-input.umd.min.js +1 -1
- package/bundles/material-input.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +69 -21
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-list.umd.min.js +2 -6
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +171 -66
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-menu.umd.min.js +1 -1
- package/bundles/material-menu.umd.min.js.map +1 -1
- package/bundles/material-paginator.umd.js +52 -10
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-paginator.umd.min.js +1 -1
- package/bundles/material-paginator.umd.min.js.map +1 -1
- package/bundles/material-progress-bar.umd.js +31 -12
- package/bundles/material-progress-bar.umd.js.map +1 -1
- package/bundles/material-progress-bar.umd.min.js +1 -1
- package/bundles/material-progress-bar.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +29 -13
- package/bundles/material-progress-spinner.umd.js.map +1 -1
- package/bundles/material-progress-spinner.umd.min.js.map +1 -1
- package/bundles/material-radio.umd.js +38 -40
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-radio.umd.min.js +1 -1
- package/bundles/material-radio.umd.min.js.map +1 -1
- package/bundles/material-select.umd.js +189 -51
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-select.umd.min.js +1 -1
- package/bundles/material-select.umd.min.js.map +1 -1
- package/bundles/material-sidenav.umd.js +104 -25
- package/bundles/material-sidenav.umd.js.map +1 -1
- package/bundles/material-sidenav.umd.min.js +1 -1
- package/bundles/material-sidenav.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js +30 -14
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slide-toggle.umd.min.js +1 -1
- package/bundles/material-slide-toggle.umd.min.js.map +1 -1
- package/bundles/material-slider.umd.js +91 -21
- package/bundles/material-slider.umd.js.map +1 -1
- package/bundles/material-slider.umd.min.js +1 -1
- package/bundles/material-slider.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +71 -19
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +1 -1
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-sort.umd.js +46 -24
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-sort.umd.min.js +1 -1
- package/bundles/material-sort.umd.min.js.map +1 -1
- package/bundles/material-stepper.umd.js +37 -35
- package/bundles/material-stepper.umd.js.map +1 -1
- package/bundles/material-stepper.umd.min.js +1 -1
- package/bundles/material-stepper.umd.min.js.map +1 -1
- package/bundles/material-table.umd.js +29 -9
- package/bundles/material-table.umd.js.map +1 -1
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +170 -68
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +2 -2
- package/bundles/material-tabs.umd.min.js.map +1 -1
- package/bundles/material-toolbar.umd.js +14 -4
- package/bundles/material-toolbar.umd.js.map +1 -1
- package/bundles/material-toolbar.umd.min.js +1 -1
- package/bundles/material-toolbar.umd.min.js.map +1 -1
- package/bundles/material-tooltip.umd.js +53 -26
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.min.js +1 -1
- package/bundles/material-tooltip.umd.min.js.map +1 -1
- package/bundles/material-tree.umd.js +25 -16
- package/bundles/material-tree.umd.js.map +1 -1
- package/bundles/material-tree.umd.min.js +1 -1
- package/bundles/material-tree.umd.min.js.map +1 -1
- package/bundles/material.umd.js +2853 -1010
- package/bundles/material.umd.js.map +1 -1
- package/bundles/material.umd.min.js +19 -21
- package/bundles/material.umd.min.js.map +1 -1
- package/button/typings/button.d.ts +0 -5
- package/button/typings/index.metadata.json +1 -1
- package/button-toggle/typings/index.metadata.json +1 -1
- package/card/typings/index.metadata.json +1 -1
- package/checkbox/typings/index.metadata.json +1 -1
- package/chips/typings/chip-list.d.ts +1 -1
- package/chips/typings/chip.d.ts +2 -2
- package/chips/typings/index.metadata.json +1 -1
- package/core/typings/index.metadata.json +1 -1
- package/core/typings/{testing/month-constants.d.ts → month-constants.d.ts} +2 -0
- package/core/typings/public-api.d.ts +1 -1
- package/datepicker/typings/calendar-body.d.ts +21 -5
- package/datepicker/typings/calendar.d.ts +4 -1
- package/datepicker/typings/datepicker.d.ts +3 -0
- package/datepicker/typings/index.metadata.json +1 -1
- package/datepicker/typings/month-view.d.ts +4 -2
- package/dialog/typings/index.metadata.json +1 -1
- package/esm2015/autocomplete.js +60 -29
- package/esm2015/autocomplete.js.map +1 -1
- package/esm2015/badge.js +29 -6
- package/esm2015/badge.js.map +1 -1
- package/esm2015/bottom-sheet.js +45 -22
- package/esm2015/bottom-sheet.js.map +1 -1
- package/esm2015/button-toggle.js +20 -11
- package/esm2015/button-toggle.js.map +1 -1
- package/esm2015/button.js +20 -15
- package/esm2015/button.js.map +1 -1
- package/esm2015/card.js +5 -5
- package/esm2015/card.js.map +1 -1
- package/esm2015/checkbox.js +30 -12
- package/esm2015/checkbox.js.map +1 -1
- package/esm2015/chips.js +64 -28
- package/esm2015/chips.js.map +1 -1
- package/esm2015/core.js +148 -129
- package/esm2015/core.js.map +1 -1
- package/esm2015/datepicker.js +124 -41
- package/esm2015/datepicker.js.map +1 -1
- package/esm2015/dialog.js +77 -40
- package/esm2015/dialog.js.map +1 -1
- package/esm2015/divider.js +4 -4
- package/esm2015/divider.js.map +1 -1
- package/esm2015/expansion.js +58 -31
- package/esm2015/expansion.js.map +1 -1
- package/esm2015/form-field.js +94 -34
- package/esm2015/form-field.js.map +1 -1
- package/esm2015/grid-list.js +45 -17
- package/esm2015/grid-list.js.map +1 -1
- package/esm2015/icon.js +136 -67
- package/esm2015/icon.js.map +1 -1
- package/esm2015/input.js +44 -23
- package/esm2015/input.js.map +1 -1
- package/esm2015/list.js +47 -22
- package/esm2015/list.js.map +1 -1
- package/esm2015/material.js +13 -12
- package/esm2015/material.js.map +1 -1
- package/esm2015/menu.js +109 -63
- package/esm2015/menu.js.map +1 -1
- package/esm2015/paginator.js +35 -12
- package/esm2015/paginator.js.map +1 -1
- package/esm2015/progress-bar.js +26 -13
- package/esm2015/progress-bar.js.map +1 -1
- package/esm2015/progress-spinner.js +24 -14
- package/esm2015/progress-spinner.js.map +1 -1
- package/esm2015/radio.js +22 -21
- package/esm2015/radio.js.map +1 -1
- package/esm2015/select.js +116 -53
- package/esm2015/select.js.map +1 -1
- package/esm2015/sidenav.js +75 -28
- package/esm2015/sidenav.js.map +1 -1
- package/esm2015/slide-toggle.js +23 -15
- package/esm2015/slide-toggle.js.map +1 -1
- package/esm2015/slider.js +54 -24
- package/esm2015/slider.js.map +1 -1
- package/esm2015/snack-bar.js +41 -21
- package/esm2015/snack-bar.js.map +1 -1
- package/esm2015/sort.js +47 -24
- package/esm2015/sort.js.map +1 -1
- package/esm2015/stepper.js +35 -32
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +31 -11
- package/esm2015/table.js.map +1 -1
- package/esm2015/tabs.js +113 -53
- package/esm2015/tabs.js.map +1 -1
- package/esm2015/toolbar.js +9 -5
- package/esm2015/toolbar.js.map +1 -1
- package/esm2015/tooltip.js +43 -28
- package/esm2015/tooltip.js.map +1 -1
- package/esm2015/tree.js +22 -17
- package/esm2015/tree.js.map +1 -1
- package/esm5/autocomplete.es5.js +128 -34
- package/esm5/autocomplete.es5.js.map +1 -1
- package/esm5/badge.es5.js +40 -7
- package/esm5/badge.es5.js.map +1 -1
- package/esm5/bottom-sheet.es5.js +70 -23
- package/esm5/bottom-sheet.es5.js.map +1 -1
- package/esm5/button-toggle.es5.js +38 -15
- package/esm5/button-toggle.es5.js.map +1 -1
- package/esm5/button.es5.js +23 -16
- package/esm5/button.es5.js.map +1 -1
- package/esm5/card.es5.js +5 -5
- package/esm5/card.es5.js.map +1 -1
- package/esm5/checkbox.es5.js +58 -17
- package/esm5/checkbox.es5.js.map +1 -1
- package/esm5/chips.es5.js +127 -37
- package/esm5/chips.es5.js.map +1 -1
- package/esm5/core.es5.js +192 -129
- package/esm5/core.es5.js.map +1 -1
- package/esm5/datepicker.es5.js +233 -55
- package/esm5/datepicker.es5.js.map +1 -1
- package/esm5/dialog.es5.js +140 -42
- package/esm5/dialog.es5.js.map +1 -1
- package/esm5/divider.es5.js +4 -4
- package/esm5/divider.es5.js.map +1 -1
- package/esm5/expansion.es5.js +56 -31
- package/esm5/expansion.es5.js.map +1 -1
- package/esm5/form-field.es5.js +125 -36
- package/esm5/form-field.es5.js.map +1 -1
- package/esm5/grid-list.es5.js +68 -17
- package/esm5/grid-list.es5.js.map +1 -1
- package/esm5/icon.es5.js +279 -80
- package/esm5/icon.es5.js.map +1 -1
- package/esm5/input.es5.js +52 -24
- package/esm5/input.es5.js.map +1 -1
- package/esm5/list.es5.js +72 -24
- package/esm5/list.es5.js.map +1 -1
- package/esm5/material.es5.js +13 -12
- package/esm5/material.es5.js.map +1 -1
- package/esm5/menu.es5.js +170 -65
- package/esm5/menu.es5.js.map +1 -1
- package/esm5/paginator.es5.js +55 -13
- package/esm5/paginator.es5.js.map +1 -1
- package/esm5/progress-bar.es5.js +33 -14
- package/esm5/progress-bar.es5.js.map +1 -1
- package/esm5/progress-spinner.es5.js +31 -15
- package/esm5/progress-spinner.es5.js.map +1 -1
- package/esm5/radio.es5.js +42 -42
- package/esm5/radio.es5.js.map +1 -1
- package/esm5/select.es5.js +193 -55
- package/esm5/select.es5.js.map +1 -1
- package/esm5/sidenav.es5.js +107 -28
- package/esm5/sidenav.es5.js.map +1 -1
- package/esm5/slide-toggle.es5.js +32 -16
- package/esm5/slide-toggle.es5.js.map +1 -1
- package/esm5/slider.es5.js +94 -24
- package/esm5/slider.es5.js.map +1 -1
- package/esm5/snack-bar.es5.js +73 -21
- package/esm5/snack-bar.es5.js.map +1 -1
- package/esm5/sort.es5.js +53 -26
- package/esm5/sort.es5.js.map +1 -1
- package/esm5/stepper.es5.js +40 -38
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +31 -11
- package/esm5/table.es5.js.map +1 -1
- package/esm5/tabs.es5.js +162 -61
- package/esm5/tabs.es5.js.map +1 -1
- package/esm5/toolbar.es5.js +16 -6
- package/esm5/toolbar.es5.js.map +1 -1
- package/esm5/tooltip.es5.js +55 -28
- package/esm5/tooltip.es5.js.map +1 -1
- package/esm5/tree.es5.js +27 -18
- package/esm5/tree.es5.js.map +1 -1
- package/expansion/typings/expansion-panel-header.d.ts +2 -2
- package/expansion/typings/expansion-panel.d.ts +19 -2
- package/expansion/typings/index.metadata.json +1 -1
- package/form-field/typings/form-field.d.ts +15 -4
- package/form-field/typings/index.metadata.json +1 -1
- package/grid-list/typings/index.d.ts +1 -1
- package/grid-list/typings/index.metadata.json +1 -1
- package/icon/typings/index.metadata.json +1 -1
- package/list/typings/index.metadata.json +1 -1
- package/material.d.ts +1 -1
- package/material.metadata.json +3 -3
- package/menu/typings/index.d.ts +4 -4
- package/menu/typings/index.metadata.json +1 -1
- package/menu/typings/menu-directive.d.ts +1 -0
- package/menu/typings/menu-item.d.ts +2 -0
- package/package.json +5 -5
- package/paginator/typings/index.metadata.json +1 -1
- package/paginator/typings/paginator.d.ts +7 -3
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-bar/typings/index.metadata.json +1 -1
- package/radio/typings/index.metadata.json +1 -1
- package/radio/typings/radio.d.ts +2 -6
- package/schematics/ng-add/theming/{custom-theme.d.ts → create-custom-theme.d.ts} +0 -0
- package/schematics/ng-add/theming/{custom-theme.js → create-custom-theme.js} +1 -1
- package/schematics/ng-add/theming/create-custom-theme.js.map +1 -0
- package/schematics/ng-add/theming/theming.js +35 -19
- package/schematics/ng-add/theming/theming.js.map +1 -1
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/schematics/ng-generate/nav/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/select/typings/index.metadata.json +1 -1
- package/select/typings/select.d.ts +12 -2
- package/sidenav/typings/drawer.d.ts +9 -2
- package/sidenav/typings/index.metadata.json +1 -1
- package/slide-toggle/typings/index.metadata.json +1 -1
- package/slider/typings/index.metadata.json +1 -1
- package/snack-bar/typings/index.metadata.json +1 -1
- package/sort/typings/index.metadata.json +1 -1
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/step-header.d.ts +3 -5
- package/tabs/typings/index.d.ts +5 -5
- package/tabs/typings/index.metadata.json +1 -1
- package/tabs/typings/tab-body.d.ts +2 -0
- package/tabs/typings/tab-group.d.ts +11 -2
- package/tabs/typings/tab-header.d.ts +9 -3
- package/toolbar/typings/index.metadata.json +1 -1
- package/tooltip/typings/index.metadata.json +1 -1
- package/tree/typings/data-source/flat-data-source.d.ts +2 -2
- package/tree/typings/index.metadata.json +1 -1
- package/typings/autocomplete/index.d.ts +1 -1
- package/typings/autocomplete/index.metadata.json +1 -1
- package/typings/badge/index.metadata.json +1 -1
- package/typings/bottom-sheet/bottom-sheet-config.d.ts +5 -0
- package/typings/bottom-sheet/bottom-sheet-container.d.ts +1 -1
- package/typings/bottom-sheet/index.metadata.json +1 -1
- package/typings/button/button.d.ts +0 -5
- package/typings/button/index.metadata.json +1 -1
- package/typings/button-toggle/index.metadata.json +1 -1
- package/typings/card/index.metadata.json +1 -1
- package/typings/checkbox/index.metadata.json +1 -1
- package/typings/chips/chip-list.d.ts +1 -1
- package/typings/chips/chip.d.ts +2 -2
- package/typings/chips/index.metadata.json +1 -1
- package/typings/core/index.metadata.json +1 -1
- package/typings/core/{testing/month-constants.d.ts → month-constants.d.ts} +2 -0
- package/typings/core/public-api.d.ts +1 -1
- package/typings/datepicker/calendar-body.d.ts +21 -5
- package/typings/datepicker/calendar.d.ts +4 -1
- package/typings/datepicker/datepicker.d.ts +3 -0
- package/typings/datepicker/index.metadata.json +1 -1
- package/typings/datepicker/month-view.d.ts +4 -2
- package/typings/dialog/index.metadata.json +1 -1
- package/typings/esm5/autocomplete/index.d.ts +1 -1
- package/typings/esm5/autocomplete/index.metadata.json +1 -1
- package/typings/esm5/badge/index.metadata.json +1 -1
- package/typings/esm5/bottom-sheet/bottom-sheet-config.d.ts +5 -0
- package/typings/esm5/bottom-sheet/bottom-sheet-container.d.ts +1 -1
- package/typings/esm5/bottom-sheet/index.metadata.json +1 -1
- package/typings/esm5/button/button.d.ts +0 -5
- package/typings/esm5/button/index.metadata.json +1 -1
- package/typings/esm5/button-toggle/index.metadata.json +1 -1
- package/typings/esm5/card/index.metadata.json +1 -1
- package/typings/esm5/checkbox/index.metadata.json +1 -1
- package/typings/esm5/chips/chip-list.d.ts +1 -1
- package/typings/esm5/chips/chip.d.ts +2 -2
- package/typings/esm5/chips/index.metadata.json +1 -1
- package/typings/esm5/core/index.metadata.json +1 -1
- package/typings/esm5/core/{testing/month-constants.d.ts → month-constants.d.ts} +2 -0
- package/typings/esm5/core/public-api.d.ts +1 -1
- package/typings/esm5/datepicker/calendar-body.d.ts +21 -5
- package/typings/esm5/datepicker/calendar.d.ts +4 -1
- package/typings/esm5/datepicker/datepicker.d.ts +3 -0
- package/typings/esm5/datepicker/index.metadata.json +1 -1
- package/typings/esm5/datepicker/month-view.d.ts +4 -2
- package/typings/esm5/dialog/index.metadata.json +1 -1
- package/typings/esm5/expansion/expansion-panel-header.d.ts +2 -2
- package/typings/esm5/expansion/expansion-panel.d.ts +19 -2
- package/typings/esm5/expansion/index.metadata.json +1 -1
- package/typings/esm5/form-field/form-field.d.ts +15 -4
- package/typings/esm5/form-field/index.metadata.json +1 -1
- package/typings/esm5/grid-list/index.d.ts +1 -1
- package/typings/esm5/grid-list/index.metadata.json +1 -1
- package/typings/esm5/icon/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/list/index.metadata.json +1 -1
- package/typings/esm5/menu/index.d.ts +4 -4
- package/typings/esm5/menu/index.metadata.json +1 -1
- package/typings/esm5/menu/menu-directive.d.ts +1 -0
- package/typings/esm5/menu/menu-item.d.ts +2 -0
- package/typings/esm5/paginator/index.metadata.json +1 -1
- package/typings/esm5/paginator/paginator.d.ts +7 -3
- package/typings/esm5/progress-bar/index.metadata.json +1 -1
- package/typings/esm5/radio/index.metadata.json +1 -1
- package/typings/esm5/radio/radio.d.ts +2 -6
- package/typings/esm5/select/index.metadata.json +1 -1
- package/typings/esm5/select/select.d.ts +12 -2
- package/typings/esm5/sidenav/drawer.d.ts +9 -2
- package/typings/esm5/sidenav/index.metadata.json +1 -1
- package/typings/esm5/slide-toggle/index.metadata.json +1 -1
- package/typings/esm5/slider/index.metadata.json +1 -1
- package/typings/esm5/snack-bar/index.metadata.json +1 -1
- package/typings/esm5/sort/index.metadata.json +1 -1
- package/typings/esm5/stepper/index.metadata.json +1 -1
- package/typings/esm5/stepper/step-header.d.ts +3 -5
- package/typings/esm5/tabs/index.d.ts +5 -5
- package/typings/esm5/tabs/index.metadata.json +1 -1
- package/typings/esm5/tabs/tab-body.d.ts +2 -0
- package/typings/esm5/tabs/tab-group.d.ts +11 -2
- package/typings/esm5/tabs/tab-header.d.ts +9 -3
- package/typings/esm5/toolbar/index.metadata.json +1 -1
- package/typings/esm5/tooltip/index.metadata.json +1 -1
- package/typings/esm5/tree/data-source/flat-data-source.d.ts +2 -2
- package/typings/esm5/tree/index.metadata.json +1 -1
- package/typings/expansion/expansion-panel-header.d.ts +2 -2
- package/typings/expansion/expansion-panel.d.ts +19 -2
- package/typings/expansion/index.metadata.json +1 -1
- package/typings/form-field/form-field.d.ts +15 -4
- package/typings/form-field/index.metadata.json +1 -1
- package/typings/grid-list/index.d.ts +1 -1
- package/typings/grid-list/index.metadata.json +1 -1
- package/typings/icon/index.metadata.json +1 -1
- package/typings/index.metadata.json +1 -1
- package/typings/list/index.metadata.json +1 -1
- package/typings/menu/index.d.ts +4 -4
- package/typings/menu/index.metadata.json +1 -1
- package/typings/menu/menu-directive.d.ts +1 -0
- package/typings/menu/menu-item.d.ts +2 -0
- package/typings/paginator/index.metadata.json +1 -1
- package/typings/paginator/paginator.d.ts +7 -3
- package/typings/progress-bar/index.metadata.json +1 -1
- package/typings/radio/index.metadata.json +1 -1
- package/typings/radio/radio.d.ts +2 -6
- package/typings/schematics/ng-add/theming/{custom-theme.d.ts → create-custom-theme.d.ts} +0 -0
- package/typings/select/index.metadata.json +1 -1
- package/typings/select/select.d.ts +12 -2
- package/typings/sidenav/drawer.d.ts +9 -2
- package/typings/sidenav/index.metadata.json +1 -1
- package/typings/slide-toggle/index.metadata.json +1 -1
- package/typings/slider/index.metadata.json +1 -1
- package/typings/snack-bar/index.metadata.json +1 -1
- package/typings/sort/index.metadata.json +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/step-header.d.ts +3 -5
- package/typings/tabs/index.d.ts +5 -5
- package/typings/tabs/index.metadata.json +1 -1
- package/typings/tabs/tab-body.d.ts +2 -0
- package/typings/tabs/tab-group.d.ts +11 -2
- package/typings/tabs/tab-header.d.ts +9 -3
- package/typings/toolbar/index.metadata.json +1 -1
- package/typings/tooltip/index.metadata.json +1 -1
- package/typings/tree/data-source/flat-data-source.d.ts +2 -2
- package/typings/tree/index.metadata.json +1 -1
- package/schematics/ng-add/theming/custom-theme.js.map +0 -1
package/esm2015/select.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
9
|
-
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
|
|
9
|
+
import { ActiveDescendantKeyManager, LiveAnnouncer } from '@angular/cdk/a11y';
|
|
10
10
|
import { Directionality } from '@angular/cdk/bidi';
|
|
11
11
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
12
12
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
13
|
-
import { A, DOWN_ARROW, END, ENTER, HOME, LEFT_ARROW, RIGHT_ARROW, SPACE, UP_ARROW } from '@angular/cdk/keycodes';
|
|
13
|
+
import { A, DOWN_ARROW, END, ENTER, HOME, LEFT_ARROW, RIGHT_ARROW, SPACE, UP_ARROW, hasModifierKey } from '@angular/cdk/keycodes';
|
|
14
14
|
import { CdkConnectedOverlay, Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
15
15
|
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
16
16
|
import { Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, Directive, ElementRef, EventEmitter, Inject, InjectionToken, Input, isDevMode, NgZone, Optional, Output, Self, ViewChild, ViewEncapsulation, NgModule } from '@angular/core';
|
|
@@ -23,25 +23,26 @@ import { CommonModule } from '@angular/common';
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @fileoverview added by tsickle
|
|
26
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
26
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
27
27
|
*/
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
29
|
* The following are all the animations for the mat-select component, with each
|
|
30
30
|
* const containing the metadata for one animation.
|
|
31
31
|
*
|
|
32
32
|
* The values below match the implementation of the AngularJS Material mat-select animation.
|
|
33
33
|
* \@docs-private
|
|
34
|
-
|
|
34
|
+
* @type {?}
|
|
35
|
+
*/
|
|
35
36
|
const matSelectAnimations = {
|
|
36
37
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
* This animation transforms the select's overlay panel on and off the page.
|
|
39
|
+
*
|
|
40
|
+
* When the panel is attached to the DOM, it expands its width by the amount of padding, scales it
|
|
41
|
+
* up to 100% on the Y axis, fades in its border, and translates slightly up and to the
|
|
42
|
+
* side to ensure the option text correctly overlaps the trigger text.
|
|
43
|
+
*
|
|
44
|
+
* When the panel is removed from the DOM, it simply fades out linearly.
|
|
45
|
+
*/
|
|
45
46
|
transformPanel: trigger('transformPanel', [
|
|
46
47
|
state('void', style({
|
|
47
48
|
transform: 'scaleY(0.8)',
|
|
@@ -64,12 +65,12 @@ const matSelectAnimations = {
|
|
|
64
65
|
transition('* => void', animate('100ms 25ms linear', style({ opacity: 0 })))
|
|
65
66
|
]),
|
|
66
67
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
* This animation fades in the background color and text content of the
|
|
69
|
+
* select's options. It is time delayed to occur 100ms after the overlay
|
|
70
|
+
* panel has transformed in.
|
|
71
|
+
* @deprecated Not used anymore. To be removed.
|
|
72
|
+
* \@breaking-change 8.0.0
|
|
73
|
+
*/
|
|
73
74
|
fadeInContent: trigger('fadeInContent', [
|
|
74
75
|
state('showing', style({ opacity: 1 })),
|
|
75
76
|
transition('void => showing', [
|
|
@@ -78,22 +79,24 @@ const matSelectAnimations = {
|
|
|
78
79
|
])
|
|
79
80
|
])
|
|
80
81
|
};
|
|
81
|
-
/**
|
|
82
|
+
/**
|
|
82
83
|
* @deprecated
|
|
83
84
|
* \@breaking-change 8.0.0
|
|
84
85
|
* \@docs-private
|
|
85
|
-
|
|
86
|
+
* @type {?}
|
|
87
|
+
*/
|
|
86
88
|
const transformPanel = matSelectAnimations.transformPanel;
|
|
87
|
-
/**
|
|
89
|
+
/**
|
|
88
90
|
* @deprecated
|
|
89
91
|
* \@breaking-change 8.0.0
|
|
90
92
|
* \@docs-private
|
|
91
|
-
|
|
93
|
+
* @type {?}
|
|
94
|
+
*/
|
|
92
95
|
const fadeInContent = matSelectAnimations.fadeInContent;
|
|
93
96
|
|
|
94
97
|
/**
|
|
95
98
|
* @fileoverview added by tsickle
|
|
96
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
99
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
97
100
|
*/
|
|
98
101
|
|
|
99
102
|
/**
|
|
@@ -127,27 +130,32 @@ function getMatSelectNonFunctionValueError() {
|
|
|
127
130
|
|
|
128
131
|
/**
|
|
129
132
|
* @fileoverview added by tsickle
|
|
130
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
133
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
131
134
|
*/
|
|
132
135
|
/** @type {?} */
|
|
133
136
|
let nextUniqueId = 0;
|
|
134
|
-
/**
|
|
137
|
+
/**
|
|
135
138
|
* The max height of the select's overlay panel
|
|
136
|
-
|
|
139
|
+
* @type {?}
|
|
140
|
+
*/
|
|
137
141
|
const SELECT_PANEL_MAX_HEIGHT = 256;
|
|
138
|
-
/**
|
|
142
|
+
/**
|
|
139
143
|
* The panel's padding on the x-axis
|
|
140
|
-
|
|
144
|
+
* @type {?}
|
|
145
|
+
*/
|
|
141
146
|
const SELECT_PANEL_PADDING_X = 16;
|
|
142
|
-
/**
|
|
147
|
+
/**
|
|
143
148
|
* The panel's x axis padding if it is indented (e.g. there is an option group).
|
|
144
|
-
|
|
149
|
+
* @type {?}
|
|
150
|
+
*/
|
|
145
151
|
const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
|
|
146
|
-
/**
|
|
152
|
+
/**
|
|
147
153
|
* The height of the select items in `em` units.
|
|
148
|
-
|
|
154
|
+
* @type {?}
|
|
155
|
+
*/
|
|
149
156
|
const SELECT_ITEM_HEIGHT_EM = 3;
|
|
150
|
-
|
|
157
|
+
// TODO(josephperrott): Revert to a constant after 2018 spec updates are fully merged.
|
|
158
|
+
/**
|
|
151
159
|
* Distance between the panel edge and the option text in
|
|
152
160
|
* multi-selection mode.
|
|
153
161
|
*
|
|
@@ -155,16 +163,19 @@ const SELECT_ITEM_HEIGHT_EM = 3;
|
|
|
155
163
|
* (SELECT_PANEL_PADDING_X * 1.5) + 20 = 44
|
|
156
164
|
* The padding is multiplied by 1.5 because the checkbox's margin is half the padding.
|
|
157
165
|
* The checkbox width is 16px.
|
|
158
|
-
|
|
166
|
+
* @type {?}
|
|
167
|
+
*/
|
|
159
168
|
let SELECT_MULTIPLE_PANEL_PADDING_X = 0;
|
|
160
|
-
/**
|
|
169
|
+
/**
|
|
161
170
|
* The select panel will only "fit" inside the viewport if it is positioned at
|
|
162
171
|
* this value or more away from the viewport boundary.
|
|
163
|
-
|
|
172
|
+
* @type {?}
|
|
173
|
+
*/
|
|
164
174
|
const SELECT_PANEL_VIEWPORT_PADDING = 8;
|
|
165
|
-
/**
|
|
175
|
+
/**
|
|
166
176
|
* Injection token that determines the scroll handling while a select is open.
|
|
167
|
-
|
|
177
|
+
* @type {?}
|
|
178
|
+
*/
|
|
168
179
|
const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken('mat-select-scroll-strategy');
|
|
169
180
|
/**
|
|
170
181
|
* \@docs-private
|
|
@@ -174,9 +185,10 @@ const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken('mat-select-scroll-strateg
|
|
|
174
185
|
function MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
|
|
175
186
|
return () => overlay.scrollStrategies.reposition();
|
|
176
187
|
}
|
|
177
|
-
/**
|
|
188
|
+
/**
|
|
178
189
|
* \@docs-private
|
|
179
|
-
|
|
190
|
+
* @type {?}
|
|
191
|
+
*/
|
|
180
192
|
const MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
|
|
181
193
|
provide: MAT_SELECT_SCROLL_STRATEGY,
|
|
182
194
|
deps: [Overlay],
|
|
@@ -195,6 +207,7 @@ class MatSelectChange {
|
|
|
195
207
|
this.value = value;
|
|
196
208
|
}
|
|
197
209
|
}
|
|
210
|
+
// Boilerplate for applying mixins to MatSelect.
|
|
198
211
|
/**
|
|
199
212
|
* \@docs-private
|
|
200
213
|
*/
|
|
@@ -240,8 +253,9 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
240
253
|
* @param {?} ngControl
|
|
241
254
|
* @param {?} tabIndex
|
|
242
255
|
* @param {?} scrollStrategyFactory
|
|
256
|
+
* @param {?=} _liveAnnouncer
|
|
243
257
|
*/
|
|
244
|
-
constructor(_viewportRuler, _changeDetectorRef, _ngZone, _defaultErrorStateMatcher, elementRef, _dir, _parentForm, _parentFormGroup, _parentFormField, ngControl, tabIndex, scrollStrategyFactory) {
|
|
258
|
+
constructor(_viewportRuler, _changeDetectorRef, _ngZone, _defaultErrorStateMatcher, elementRef, _dir, _parentForm, _parentFormGroup, _parentFormField, ngControl, tabIndex, scrollStrategyFactory, _liveAnnouncer) {
|
|
245
259
|
super(elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
|
|
246
260
|
this._viewportRuler = _viewportRuler;
|
|
247
261
|
this._changeDetectorRef = _changeDetectorRef;
|
|
@@ -249,6 +263,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
249
263
|
this._dir = _dir;
|
|
250
264
|
this._parentFormField = _parentFormField;
|
|
251
265
|
this.ngControl = ngControl;
|
|
266
|
+
this._liveAnnouncer = _liveAnnouncer;
|
|
252
267
|
/**
|
|
253
268
|
* Whether or not the overlay panel is open.
|
|
254
269
|
*/
|
|
@@ -554,7 +569,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
554
569
|
ngOnChanges(changes) {
|
|
555
570
|
// Updating the disabled state is handled by `mixinDisabled`, but we need to additionally let
|
|
556
571
|
// the parent form field know to run change detection when the disabled state changes.
|
|
557
|
-
if (changes
|
|
572
|
+
if (changes.disabled) {
|
|
558
573
|
this.stateChanges.next();
|
|
559
574
|
}
|
|
560
575
|
}
|
|
@@ -708,6 +723,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
708
723
|
}
|
|
709
724
|
/**
|
|
710
725
|
* Handles keyboard events while the select is closed.
|
|
726
|
+
* @private
|
|
711
727
|
* @param {?} event
|
|
712
728
|
* @return {?}
|
|
713
729
|
*/
|
|
@@ -722,11 +738,13 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
722
738
|
/** @type {?} */
|
|
723
739
|
const manager = this._keyManager;
|
|
724
740
|
// Open the select on ALT + arrow key to match the native <select>
|
|
725
|
-
if (isOpenKey || ((this.multiple || event.altKey) && isArrowKey)) {
|
|
741
|
+
if ((isOpenKey && !hasModifierKey(event)) || ((this.multiple || event.altKey) && isArrowKey)) {
|
|
726
742
|
event.preventDefault(); // prevents the page from scrolling down when pressing space
|
|
727
743
|
this.open();
|
|
728
744
|
}
|
|
729
745
|
else if (!this.multiple) {
|
|
746
|
+
/** @type {?} */
|
|
747
|
+
const selectedOption = this.selected;
|
|
730
748
|
if (keyCode === HOME || keyCode === END) {
|
|
731
749
|
keyCode === HOME ? manager.setFirstItemActive() : manager.setLastItemActive();
|
|
732
750
|
event.preventDefault();
|
|
@@ -734,10 +752,16 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
734
752
|
else {
|
|
735
753
|
manager.onKeydown(event);
|
|
736
754
|
}
|
|
755
|
+
// Since the value has changed, we need to announce it ourselves.
|
|
756
|
+
// @breaking-change 8.0.0 remove null check for _liveAnnouncer.
|
|
757
|
+
if (this._liveAnnouncer && selectedOption !== this.selected) {
|
|
758
|
+
this._liveAnnouncer.announce(((/** @type {?} */ (this.selected))).viewValue);
|
|
759
|
+
}
|
|
737
760
|
}
|
|
738
761
|
}
|
|
739
762
|
/**
|
|
740
763
|
* Handles keyboard events when the selected is open.
|
|
764
|
+
* @private
|
|
741
765
|
* @param {?} event
|
|
742
766
|
* @return {?}
|
|
743
767
|
*/
|
|
@@ -757,7 +781,8 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
757
781
|
event.preventDefault();
|
|
758
782
|
this.close();
|
|
759
783
|
}
|
|
760
|
-
else if ((keyCode === ENTER || keyCode === SPACE) && manager.activeItem
|
|
784
|
+
else if ((keyCode === ENTER || keyCode === SPACE) && manager.activeItem &&
|
|
785
|
+
!hasModifierKey(event)) {
|
|
761
786
|
event.preventDefault();
|
|
762
787
|
manager.activeItem._selectViaInteraction();
|
|
763
788
|
}
|
|
@@ -822,8 +847,10 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
822
847
|
_getPanelTheme() {
|
|
823
848
|
return this._parentFormField ? `mat-${this._parentFormField.color}` : '';
|
|
824
849
|
}
|
|
850
|
+
// TODO(josephperrott): Remove after 2018 spec updates are fully merged.
|
|
825
851
|
/**
|
|
826
852
|
* Sets the pseudo checkbox padding size based on the width of the pseudo checkbox.
|
|
853
|
+
* @private
|
|
827
854
|
* @return {?}
|
|
828
855
|
*/
|
|
829
856
|
_setPseudoCheckboxPaddingSize() {
|
|
@@ -843,6 +870,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
843
870
|
return !this._selectionModel || this._selectionModel.isEmpty();
|
|
844
871
|
}
|
|
845
872
|
/**
|
|
873
|
+
* @private
|
|
846
874
|
* @return {?}
|
|
847
875
|
*/
|
|
848
876
|
_initializeSelection() {
|
|
@@ -850,11 +878,13 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
850
878
|
// has changed after it was checked" errors from Angular.
|
|
851
879
|
Promise.resolve().then(() => {
|
|
852
880
|
this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value);
|
|
881
|
+
this.stateChanges.next();
|
|
853
882
|
});
|
|
854
883
|
}
|
|
855
884
|
/**
|
|
856
885
|
* Sets the selected option based on a value. If no option can be
|
|
857
886
|
* found with the designated value, the select trigger is cleared.
|
|
887
|
+
* @private
|
|
858
888
|
* @param {?} value
|
|
859
889
|
* @return {?}
|
|
860
890
|
*/
|
|
@@ -881,6 +911,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
881
911
|
}
|
|
882
912
|
/**
|
|
883
913
|
* Finds and selects and option based on its value.
|
|
914
|
+
* @private
|
|
884
915
|
* @param {?} value
|
|
885
916
|
* @return {?} Option that has the corresponding value.
|
|
886
917
|
*/
|
|
@@ -906,6 +937,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
906
937
|
}
|
|
907
938
|
/**
|
|
908
939
|
* Sets up a key manager to listen to keyboard events on the overlay panel.
|
|
940
|
+
* @private
|
|
909
941
|
* @return {?}
|
|
910
942
|
*/
|
|
911
943
|
_initKeyManager() {
|
|
@@ -931,6 +963,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
931
963
|
}
|
|
932
964
|
/**
|
|
933
965
|
* Drops current option subscriptions and IDs and resets from scratch.
|
|
966
|
+
* @private
|
|
934
967
|
* @return {?}
|
|
935
968
|
*/
|
|
936
969
|
_resetOptions() {
|
|
@@ -955,6 +988,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
955
988
|
}
|
|
956
989
|
/**
|
|
957
990
|
* Invoked when an option is clicked.
|
|
991
|
+
* @private
|
|
958
992
|
* @param {?} option
|
|
959
993
|
* @param {?} isUserInput
|
|
960
994
|
* @return {?}
|
|
@@ -990,6 +1024,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
990
1024
|
}
|
|
991
1025
|
/**
|
|
992
1026
|
* Sorts the selected values in the selected based on their order in the panel.
|
|
1027
|
+
* @private
|
|
993
1028
|
* @return {?}
|
|
994
1029
|
*/
|
|
995
1030
|
_sortValues() {
|
|
@@ -1005,6 +1040,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1005
1040
|
}
|
|
1006
1041
|
/**
|
|
1007
1042
|
* Emits change event to set the model value.
|
|
1043
|
+
* @private
|
|
1008
1044
|
* @param {?=} fallbackValue
|
|
1009
1045
|
* @return {?}
|
|
1010
1046
|
*/
|
|
@@ -1012,10 +1048,10 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1012
1048
|
/** @type {?} */
|
|
1013
1049
|
let valueToEmit = null;
|
|
1014
1050
|
if (this.multiple) {
|
|
1015
|
-
valueToEmit = (/** @type {?} */ (this.selected)).map(option => option.value);
|
|
1051
|
+
valueToEmit = ((/** @type {?} */ (this.selected))).map(option => option.value);
|
|
1016
1052
|
}
|
|
1017
1053
|
else {
|
|
1018
|
-
valueToEmit = this.selected ? (/** @type {?} */ (this.selected)).value : fallbackValue;
|
|
1054
|
+
valueToEmit = this.selected ? ((/** @type {?} */ (this.selected))).value : fallbackValue;
|
|
1019
1055
|
}
|
|
1020
1056
|
this._value = valueToEmit;
|
|
1021
1057
|
this.valueChange.emit(valueToEmit);
|
|
@@ -1025,6 +1061,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1025
1061
|
}
|
|
1026
1062
|
/**
|
|
1027
1063
|
* Records option IDs to pass to the aria-owns property.
|
|
1064
|
+
* @private
|
|
1028
1065
|
* @return {?}
|
|
1029
1066
|
*/
|
|
1030
1067
|
_setOptionIds() {
|
|
@@ -1033,6 +1070,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1033
1070
|
/**
|
|
1034
1071
|
* Highlights the selected item. If no option is selected, it will highlight
|
|
1035
1072
|
* the first item instead.
|
|
1073
|
+
* @private
|
|
1036
1074
|
* @return {?}
|
|
1037
1075
|
*/
|
|
1038
1076
|
_highlightCorrectOption() {
|
|
@@ -1047,6 +1085,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1047
1085
|
}
|
|
1048
1086
|
/**
|
|
1049
1087
|
* Scrolls the active option into view.
|
|
1088
|
+
* @private
|
|
1050
1089
|
* @return {?}
|
|
1051
1090
|
*/
|
|
1052
1091
|
_scrollActiveOptionIntoView() {
|
|
@@ -1065,6 +1104,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1065
1104
|
}
|
|
1066
1105
|
/**
|
|
1067
1106
|
* Gets the index of the provided option in the option list.
|
|
1107
|
+
* @private
|
|
1068
1108
|
* @param {?} option
|
|
1069
1109
|
* @return {?}
|
|
1070
1110
|
*/
|
|
@@ -1075,6 +1115,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1075
1115
|
}
|
|
1076
1116
|
/**
|
|
1077
1117
|
* Calculates the scroll position and x- and y-offsets of the overlay panel.
|
|
1118
|
+
* @private
|
|
1078
1119
|
* @return {?}
|
|
1079
1120
|
*/
|
|
1080
1121
|
_calculateOverlayPosition() {
|
|
@@ -1086,11 +1127,15 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1086
1127
|
const panelHeight = Math.min(items * itemHeight, SELECT_PANEL_MAX_HEIGHT);
|
|
1087
1128
|
/** @type {?} */
|
|
1088
1129
|
const scrollContainerHeight = items * itemHeight;
|
|
1130
|
+
// The farthest the panel can be scrolled before it hits the bottom
|
|
1089
1131
|
/** @type {?} */
|
|
1090
1132
|
const maxScroll = scrollContainerHeight - panelHeight;
|
|
1133
|
+
// If no value is selected we open the popup to the first item.
|
|
1091
1134
|
/** @type {?} */
|
|
1092
|
-
let selectedOptionOffset = this.empty ? 0 : /** @type {?} */ (
|
|
1135
|
+
let selectedOptionOffset = this.empty ? 0 : (/** @type {?} */ (this._getOptionIndex(this._selectionModel.selected[0])));
|
|
1093
1136
|
selectedOptionOffset += _countGroupLabelsBeforeOption(selectedOptionOffset, this.options, this.optionGroups);
|
|
1137
|
+
// We must maintain a scroll buffer so the selected option will be scrolled to the
|
|
1138
|
+
// center of the overlay panel rather than the top.
|
|
1094
1139
|
/** @type {?} */
|
|
1095
1140
|
const scrollBuffer = panelHeight / 2;
|
|
1096
1141
|
this._scrollTop = this._calculateOverlayScroll(selectedOptionOffset, scrollBuffer, maxScroll);
|
|
@@ -1115,6 +1160,10 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1115
1160
|
const optionOffsetFromScrollTop = itemHeight * selectedIndex;
|
|
1116
1161
|
/** @type {?} */
|
|
1117
1162
|
const halfOptionHeight = itemHeight / 2;
|
|
1163
|
+
// Starts at the optionOffsetFromScrollTop, which scrolls the option to the top of the
|
|
1164
|
+
// scroll container, then subtracts the scroll buffer to scroll the option down to
|
|
1165
|
+
// the center of the overlay panel. Half the option height must be re-added to the
|
|
1166
|
+
// scrollTop so the option is centered based on its middle, not its top edge.
|
|
1118
1167
|
/** @type {?} */
|
|
1119
1168
|
const optimalScrollPosition = optionOffsetFromScrollTop - scrollBuffer + halfOptionHeight;
|
|
1120
1169
|
return Math.min(Math.max(0, optimalScrollPosition), maxScroll);
|
|
@@ -1160,6 +1209,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1160
1209
|
* the panel opens. Will change based on LTR or RTL text direction. Note that the offset
|
|
1161
1210
|
* can't be calculated until the panel has been attached, because we need to know the
|
|
1162
1211
|
* content width in order to constrain the panel within the viewport.
|
|
1212
|
+
* @private
|
|
1163
1213
|
* @return {?}
|
|
1164
1214
|
*/
|
|
1165
1215
|
_calculateOverlayOffsetX() {
|
|
@@ -1187,6 +1237,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1187
1237
|
if (!isRtl) {
|
|
1188
1238
|
offsetX *= -1;
|
|
1189
1239
|
}
|
|
1240
|
+
// Determine how much the select overflows on each side.
|
|
1190
1241
|
/** @type {?} */
|
|
1191
1242
|
const leftOverflow = 0 - (overlayRect.left + offsetX - (isRtl ? paddingWidth : 0));
|
|
1192
1243
|
/** @type {?} */
|
|
@@ -1209,6 +1260,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1209
1260
|
* Calculates the y-offset of the select's overlay panel in relation to the
|
|
1210
1261
|
* top start corner of the trigger. It has to be adjusted in order for the
|
|
1211
1262
|
* selected option to be aligned over the trigger when the panel opens.
|
|
1263
|
+
* @private
|
|
1212
1264
|
* @param {?} selectedIndex
|
|
1213
1265
|
* @param {?} scrollBuffer
|
|
1214
1266
|
* @param {?} maxScroll
|
|
@@ -1235,6 +1287,8 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1235
1287
|
const firstDisplayedIndex = this._getItemCount() - maxOptionsDisplayed;
|
|
1236
1288
|
/** @type {?} */
|
|
1237
1289
|
const selectedDisplayIndex = selectedIndex - firstDisplayedIndex;
|
|
1290
|
+
// The first item is partially out of the viewport. Therefore we need to calculate what
|
|
1291
|
+
// portion of it is shown in the viewport and account for it in our offset.
|
|
1238
1292
|
/** @type {?} */
|
|
1239
1293
|
let partialItemHeight = itemHeight - (this._getItemCount() * itemHeight - SELECT_PANEL_MAX_HEIGHT) % itemHeight;
|
|
1240
1294
|
// Because the panel height is longer than the height of the options alone,
|
|
@@ -1259,6 +1313,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1259
1313
|
* If it will not fit, tries to adjust the scroll position and the associated
|
|
1260
1314
|
* y-offset so the panel can open fully on-screen. If it still won't fit,
|
|
1261
1315
|
* sets the offset back to 0 to allow the fallback position to take over.
|
|
1316
|
+
* @private
|
|
1262
1317
|
* @param {?} maxScroll
|
|
1263
1318
|
* @return {?}
|
|
1264
1319
|
*/
|
|
@@ -1289,11 +1344,13 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1289
1344
|
}
|
|
1290
1345
|
/**
|
|
1291
1346
|
* Adjusts the overlay panel up to fit in the viewport.
|
|
1347
|
+
* @private
|
|
1292
1348
|
* @param {?} panelHeightBottom
|
|
1293
1349
|
* @param {?} bottomSpaceAvailable
|
|
1294
1350
|
* @return {?}
|
|
1295
1351
|
*/
|
|
1296
1352
|
_adjustPanelUp(panelHeightBottom, bottomSpaceAvailable) {
|
|
1353
|
+
// Browsers ignore fractional scroll offsets, so we need to round.
|
|
1297
1354
|
/** @type {?} */
|
|
1298
1355
|
const distanceBelowViewport = Math.round(panelHeightBottom - bottomSpaceAvailable);
|
|
1299
1356
|
// Scrolls the panel up by the distance it was extending past the boundary, then
|
|
@@ -1312,12 +1369,14 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1312
1369
|
}
|
|
1313
1370
|
/**
|
|
1314
1371
|
* Adjusts the overlay panel down to fit in the viewport.
|
|
1372
|
+
* @private
|
|
1315
1373
|
* @param {?} panelHeightTop
|
|
1316
1374
|
* @param {?} topSpaceAvailable
|
|
1317
1375
|
* @param {?} maxScroll
|
|
1318
1376
|
* @return {?}
|
|
1319
1377
|
*/
|
|
1320
1378
|
_adjustPanelDown(panelHeightTop, topSpaceAvailable, maxScroll) {
|
|
1379
|
+
// Browsers ignore fractional scroll offsets, so we need to round.
|
|
1321
1380
|
/** @type {?} */
|
|
1322
1381
|
const distanceAboveViewport = Math.round(panelHeightTop - topSpaceAvailable);
|
|
1323
1382
|
// Scrolls the panel down by the distance it was extending past the boundary, then
|
|
@@ -1337,6 +1396,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1337
1396
|
}
|
|
1338
1397
|
/**
|
|
1339
1398
|
* Sets the transform origin point based on the selected option.
|
|
1399
|
+
* @private
|
|
1340
1400
|
* @return {?}
|
|
1341
1401
|
*/
|
|
1342
1402
|
_getOriginBasedOnOption() {
|
|
@@ -1350,6 +1410,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1350
1410
|
}
|
|
1351
1411
|
/**
|
|
1352
1412
|
* Calculates the amount of items in the select. This includes options and group labels.
|
|
1413
|
+
* @private
|
|
1353
1414
|
* @return {?}
|
|
1354
1415
|
*/
|
|
1355
1416
|
_getItemCount() {
|
|
@@ -1357,6 +1418,7 @@ class MatSelect extends _MatSelectMixinBase {
|
|
|
1357
1418
|
}
|
|
1358
1419
|
/**
|
|
1359
1420
|
* Calculates the height of the select's options.
|
|
1421
|
+
* @private
|
|
1360
1422
|
* @return {?}
|
|
1361
1423
|
*/
|
|
1362
1424
|
_getItemHeight() {
|
|
@@ -1393,7 +1455,7 @@ MatSelect.decorators = [
|
|
|
1393
1455
|
{ type: Component, args: [{selector: 'mat-select',
|
|
1394
1456
|
exportAs: 'matSelect',
|
|
1395
1457
|
template: "<div cdk-overlay-origin class=\"mat-select-trigger\" aria-hidden=\"true\" (click)=\"toggle()\" #origin=\"cdkOverlayOrigin\" #trigger><div class=\"mat-select-value\" [ngSwitch]=\"empty\"><span class=\"mat-select-placeholder\" *ngSwitchCase=\"true\">{{placeholder || '\u00A0'}}</span> <span class=\"mat-select-value-text\" *ngSwitchCase=\"false\" [ngSwitch]=\"!!customTrigger\"><span *ngSwitchDefault>{{triggerValue || '\u00A0'}}</span><ng-content select=\"mat-select-trigger\" *ngSwitchCase=\"true\"></ng-content></span></div><div class=\"mat-select-arrow-wrapper\"><div class=\"mat-select-arrow\"></div></div></div><ng-template cdk-connected-overlay cdkConnectedOverlayLockPosition cdkConnectedOverlayHasBackdrop cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\" [cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\" [cdkConnectedOverlayOrigin]=\"origin\" [cdkConnectedOverlayOpen]=\"panelOpen\" [cdkConnectedOverlayPositions]=\"_positions\" [cdkConnectedOverlayMinWidth]=\"_triggerRect?.width\" [cdkConnectedOverlayOffsetY]=\"_offsetY\" (backdropClick)=\"close()\" (attach)=\"_onAttached()\" (detach)=\"close()\"><div #panel class=\"mat-select-panel {{ _getPanelTheme() }}\" [ngClass]=\"panelClass\" [@transformPanel]=\"multiple ? 'showing-multiple' : 'showing'\" (@transformPanel.done)=\"_panelDoneAnimatingStream.next($event.toState)\" [style.transformOrigin]=\"_transformOrigin\" [style.font-size.px]=\"_triggerFontSize\" (keydown)=\"_handleKeydown($event)\"><ng-content></ng-content></div></ng-template>",
|
|
1396
|
-
styles: [".mat-select{display:inline-block;width:100%;outline:0}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform .4s cubic-bezier(.25,.8,.25,1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px}@media
|
|
1458
|
+
styles: [".mat-select{display:inline-block;width:100%;outline:0}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform .4s cubic-bezier(.25,.8,.25,1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px}@media (-ms-high-contrast:active){.mat-select-panel{outline:solid 1px}}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}"],
|
|
1397
1459
|
inputs: ['disabled', 'disableRipple', 'tabIndex'],
|
|
1398
1460
|
encapsulation: ViewEncapsulation.None,
|
|
1399
1461
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1441,7 +1503,8 @@ MatSelect.ctorParameters = () => [
|
|
|
1441
1503
|
{ type: MatFormField, decorators: [{ type: Optional }] },
|
|
1442
1504
|
{ type: NgControl, decorators: [{ type: Self }, { type: Optional }] },
|
|
1443
1505
|
{ type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
|
1444
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_SELECT_SCROLL_STRATEGY,] }] }
|
|
1506
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_SELECT_SCROLL_STRATEGY,] }] },
|
|
1507
|
+
{ type: LiveAnnouncer }
|
|
1445
1508
|
];
|
|
1446
1509
|
MatSelect.propDecorators = {
|
|
1447
1510
|
trigger: [{ type: ViewChild, args: ['trigger',] }],
|
|
@@ -1471,7 +1534,7 @@ MatSelect.propDecorators = {
|
|
|
1471
1534
|
|
|
1472
1535
|
/**
|
|
1473
1536
|
* @fileoverview added by tsickle
|
|
1474
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1537
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1475
1538
|
*/
|
|
1476
1539
|
class MatSelectModule {
|
|
1477
1540
|
}
|
|
@@ -1491,12 +1554,12 @@ MatSelectModule.decorators = [
|
|
|
1491
1554
|
|
|
1492
1555
|
/**
|
|
1493
1556
|
* @fileoverview added by tsickle
|
|
1494
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1557
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1495
1558
|
*/
|
|
1496
1559
|
|
|
1497
1560
|
/**
|
|
1498
1561
|
* @fileoverview added by tsickle
|
|
1499
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1562
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1500
1563
|
*/
|
|
1501
1564
|
|
|
1502
1565
|
export { MatSelectModule, MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_INDENT_PADDING_X, SELECT_ITEM_HEIGHT_EM, SELECT_MULTIPLE_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, MAT_SELECT_SCROLL_STRATEGY, MAT_SELECT_SCROLL_STRATEGY_PROVIDER, MatSelectChange, MatSelectBase, _MatSelectMixinBase, MatSelectTrigger, MatSelect, matSelectAnimations, transformPanel, fadeInContent };
|