@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/icon.js
CHANGED
|
@@ -16,7 +16,7 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @fileoverview added by tsickle
|
|
19
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
19
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
22
|
* Returns an exception to be thrown in the case when attempting to
|
|
@@ -70,11 +70,11 @@ class SvgIconConfig {
|
|
|
70
70
|
constructor(data) {
|
|
71
71
|
// Note that we can't use `instanceof SVGElement` here,
|
|
72
72
|
// because it'll break during server-side rendering.
|
|
73
|
-
if (!!(/** @type {?} */ (data)).nodeName) {
|
|
74
|
-
this.svgElement = /** @type {?} */ (data);
|
|
73
|
+
if (!!((/** @type {?} */ (data))).nodeName) {
|
|
74
|
+
this.svgElement = (/** @type {?} */ (data));
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
this.url = /** @type {?} */ (data);
|
|
77
|
+
this.url = (/** @type {?} */ (data));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -125,102 +125,120 @@ class MatIconRegistry {
|
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* Registers an icon by URL in the default namespace.
|
|
128
|
+
* @template THIS
|
|
129
|
+
* @this {THIS}
|
|
128
130
|
* @param {?} iconName Name under which the icon should be registered.
|
|
129
131
|
* @param {?} url
|
|
130
|
-
* @return {
|
|
132
|
+
* @return {THIS}
|
|
131
133
|
*/
|
|
132
134
|
addSvgIcon(iconName, url) {
|
|
133
|
-
return this.addSvgIconInNamespace('', iconName, url);
|
|
135
|
+
return (/** @type {?} */ (this)).addSvgIconInNamespace('', iconName, url);
|
|
134
136
|
}
|
|
135
137
|
/**
|
|
136
138
|
* Registers an icon using an HTML string in the default namespace.
|
|
139
|
+
* @template THIS
|
|
140
|
+
* @this {THIS}
|
|
137
141
|
* @param {?} iconName Name under which the icon should be registered.
|
|
138
142
|
* @param {?} literal SVG source of the icon.
|
|
139
|
-
* @return {
|
|
143
|
+
* @return {THIS}
|
|
140
144
|
*/
|
|
141
145
|
addSvgIconLiteral(iconName, literal) {
|
|
142
|
-
return this.addSvgIconLiteralInNamespace('', iconName, literal);
|
|
146
|
+
return (/** @type {?} */ (this)).addSvgIconLiteralInNamespace('', iconName, literal);
|
|
143
147
|
}
|
|
144
148
|
/**
|
|
145
149
|
* Registers an icon by URL in the specified namespace.
|
|
150
|
+
* @template THIS
|
|
151
|
+
* @this {THIS}
|
|
146
152
|
* @param {?} namespace Namespace in which the icon should be registered.
|
|
147
153
|
* @param {?} iconName Name under which the icon should be registered.
|
|
148
154
|
* @param {?} url
|
|
149
|
-
* @return {
|
|
155
|
+
* @return {THIS}
|
|
150
156
|
*/
|
|
151
157
|
addSvgIconInNamespace(namespace, iconName, url) {
|
|
152
|
-
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url));
|
|
158
|
+
return (/** @type {?} */ (this))._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url));
|
|
153
159
|
}
|
|
154
160
|
/**
|
|
155
161
|
* Registers an icon using an HTML string in the specified namespace.
|
|
162
|
+
* @template THIS
|
|
163
|
+
* @this {THIS}
|
|
156
164
|
* @param {?} namespace Namespace in which the icon should be registered.
|
|
157
165
|
* @param {?} iconName Name under which the icon should be registered.
|
|
158
166
|
* @param {?} literal SVG source of the icon.
|
|
159
|
-
* @return {
|
|
167
|
+
* @return {THIS}
|
|
160
168
|
*/
|
|
161
169
|
addSvgIconLiteralInNamespace(namespace, iconName, literal) {
|
|
162
170
|
/** @type {?} */
|
|
163
|
-
const sanitizedLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);
|
|
171
|
+
const sanitizedLiteral = (/** @type {?} */ (this))._sanitizer.sanitize(SecurityContext.HTML, literal);
|
|
164
172
|
if (!sanitizedLiteral) {
|
|
165
173
|
throw getMatIconFailedToSanitizeLiteralError(literal);
|
|
166
174
|
}
|
|
167
175
|
/** @type {?} */
|
|
168
|
-
const svgElement = this._createSvgElementForSingleIcon(sanitizedLiteral);
|
|
169
|
-
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));
|
|
176
|
+
const svgElement = (/** @type {?} */ (this))._createSvgElementForSingleIcon(sanitizedLiteral);
|
|
177
|
+
return (/** @type {?} */ (this))._addSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));
|
|
170
178
|
}
|
|
171
179
|
/**
|
|
172
180
|
* Registers an icon set by URL in the default namespace.
|
|
181
|
+
* @template THIS
|
|
182
|
+
* @this {THIS}
|
|
173
183
|
* @param {?} url
|
|
174
|
-
* @return {
|
|
184
|
+
* @return {THIS}
|
|
175
185
|
*/
|
|
176
186
|
addSvgIconSet(url) {
|
|
177
|
-
return this.addSvgIconSetInNamespace('', url);
|
|
187
|
+
return (/** @type {?} */ (this)).addSvgIconSetInNamespace('', url);
|
|
178
188
|
}
|
|
179
189
|
/**
|
|
180
190
|
* Registers an icon set using an HTML string in the default namespace.
|
|
191
|
+
* @template THIS
|
|
192
|
+
* @this {THIS}
|
|
181
193
|
* @param {?} literal SVG source of the icon set.
|
|
182
|
-
* @return {
|
|
194
|
+
* @return {THIS}
|
|
183
195
|
*/
|
|
184
196
|
addSvgIconSetLiteral(literal) {
|
|
185
|
-
return this.addSvgIconSetLiteralInNamespace('', literal);
|
|
197
|
+
return (/** @type {?} */ (this)).addSvgIconSetLiteralInNamespace('', literal);
|
|
186
198
|
}
|
|
187
199
|
/**
|
|
188
200
|
* Registers an icon set by URL in the specified namespace.
|
|
201
|
+
* @template THIS
|
|
202
|
+
* @this {THIS}
|
|
189
203
|
* @param {?} namespace Namespace in which to register the icon set.
|
|
190
204
|
* @param {?} url
|
|
191
|
-
* @return {
|
|
205
|
+
* @return {THIS}
|
|
192
206
|
*/
|
|
193
207
|
addSvgIconSetInNamespace(namespace, url) {
|
|
194
|
-
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(url));
|
|
208
|
+
return (/** @type {?} */ (this))._addSvgIconSetConfig(namespace, new SvgIconConfig(url));
|
|
195
209
|
}
|
|
196
210
|
/**
|
|
197
211
|
* Registers an icon set using an HTML string in the specified namespace.
|
|
212
|
+
* @template THIS
|
|
213
|
+
* @this {THIS}
|
|
198
214
|
* @param {?} namespace Namespace in which to register the icon set.
|
|
199
215
|
* @param {?} literal SVG source of the icon set.
|
|
200
|
-
* @return {
|
|
216
|
+
* @return {THIS}
|
|
201
217
|
*/
|
|
202
218
|
addSvgIconSetLiteralInNamespace(namespace, literal) {
|
|
203
219
|
/** @type {?} */
|
|
204
|
-
const sanitizedLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);
|
|
220
|
+
const sanitizedLiteral = (/** @type {?} */ (this))._sanitizer.sanitize(SecurityContext.HTML, literal);
|
|
205
221
|
if (!sanitizedLiteral) {
|
|
206
222
|
throw getMatIconFailedToSanitizeLiteralError(literal);
|
|
207
223
|
}
|
|
208
224
|
/** @type {?} */
|
|
209
|
-
const svgElement = this._svgElementFromString(sanitizedLiteral);
|
|
210
|
-
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(svgElement));
|
|
225
|
+
const svgElement = (/** @type {?} */ (this))._svgElementFromString(sanitizedLiteral);
|
|
226
|
+
return (/** @type {?} */ (this))._addSvgIconSetConfig(namespace, new SvgIconConfig(svgElement));
|
|
211
227
|
}
|
|
212
228
|
/**
|
|
213
229
|
* Defines an alias for a CSS class name to be used for icon fonts. Creating an matIcon
|
|
214
230
|
* component with the alias as the fontSet input will cause the class name to be applied
|
|
215
231
|
* to the `<mat-icon>` element.
|
|
216
232
|
*
|
|
233
|
+
* @template THIS
|
|
234
|
+
* @this {THIS}
|
|
217
235
|
* @param {?} alias Alias for the font.
|
|
218
236
|
* @param {?=} className Class name override to be used instead of the alias.
|
|
219
|
-
* @return {
|
|
237
|
+
* @return {THIS}
|
|
220
238
|
*/
|
|
221
239
|
registerFontClassAlias(alias, className = alias) {
|
|
222
|
-
this._fontCssClassesByAlias.set(alias, className);
|
|
223
|
-
return this;
|
|
240
|
+
(/** @type {?} */ (this))._fontCssClassesByAlias.set(alias, className);
|
|
241
|
+
return (/** @type {?} */ (this));
|
|
224
242
|
}
|
|
225
243
|
/**
|
|
226
244
|
* Returns the CSS class name associated with the alias by a previous call to
|
|
@@ -235,12 +253,14 @@ class MatIconRegistry {
|
|
|
235
253
|
* Sets the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
|
|
236
254
|
* have a fontSet input value, and is not loading an icon by name or URL.
|
|
237
255
|
*
|
|
256
|
+
* @template THIS
|
|
257
|
+
* @this {THIS}
|
|
238
258
|
* @param {?} className
|
|
239
|
-
* @return {
|
|
259
|
+
* @return {THIS}
|
|
240
260
|
*/
|
|
241
261
|
setDefaultFontSetClass(className) {
|
|
242
|
-
this._defaultFontSetClass = className;
|
|
243
|
-
return this;
|
|
262
|
+
(/** @type {?} */ (this))._defaultFontSetClass = className;
|
|
263
|
+
return (/** @type {?} */ (this));
|
|
244
264
|
}
|
|
245
265
|
/**
|
|
246
266
|
* Returns the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
|
|
@@ -270,7 +290,7 @@ class MatIconRegistry {
|
|
|
270
290
|
if (cachedIcon) {
|
|
271
291
|
return of(cloneSvg(cachedIcon));
|
|
272
292
|
}
|
|
273
|
-
return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl)).pipe(tap(svg => this._cachedIconsByUrl.set(/** @type {?} */ (
|
|
293
|
+
return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl)).pipe(tap(svg => this._cachedIconsByUrl.set((/** @type {?} */ (url)), svg)), map(svg => cloneSvg(svg)));
|
|
274
294
|
}
|
|
275
295
|
/**
|
|
276
296
|
* Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
|
|
@@ -282,6 +302,7 @@ class MatIconRegistry {
|
|
|
282
302
|
* @return {?}
|
|
283
303
|
*/
|
|
284
304
|
getNamedSvgIcon(name, namespace = '') {
|
|
305
|
+
// Return (copy of) cached icon if possible.
|
|
285
306
|
/** @type {?} */
|
|
286
307
|
const key = iconKey(namespace, name);
|
|
287
308
|
/** @type {?} */
|
|
@@ -289,6 +310,7 @@ class MatIconRegistry {
|
|
|
289
310
|
if (config) {
|
|
290
311
|
return this._getSvgFromConfig(config);
|
|
291
312
|
}
|
|
313
|
+
// See if we have any icon sets registered for the namespace.
|
|
292
314
|
/** @type {?} */
|
|
293
315
|
const iconSetConfigs = this._iconSetConfigs.get(namespace);
|
|
294
316
|
if (iconSetConfigs) {
|
|
@@ -298,6 +320,7 @@ class MatIconRegistry {
|
|
|
298
320
|
}
|
|
299
321
|
/**
|
|
300
322
|
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
|
|
323
|
+
* @private
|
|
301
324
|
* @param {?} config
|
|
302
325
|
* @return {?}
|
|
303
326
|
*/
|
|
@@ -318,11 +341,14 @@ class MatIconRegistry {
|
|
|
318
341
|
* that have not been cached, and searches again after all fetches are completed.
|
|
319
342
|
* The returned Observable produces the SVG element if possible, and throws
|
|
320
343
|
* an error if no icon with the specified name can be found.
|
|
344
|
+
* @private
|
|
321
345
|
* @param {?} name
|
|
322
346
|
* @param {?} iconSetConfigs
|
|
323
347
|
* @return {?}
|
|
324
348
|
*/
|
|
325
349
|
_getSvgFromIconSetConfigs(name, iconSetConfigs) {
|
|
350
|
+
// For all the icon set SVG elements we've fetched, see if any contain an icon with the
|
|
351
|
+
// requested name.
|
|
326
352
|
/** @type {?} */
|
|
327
353
|
const namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
|
|
328
354
|
if (namedIcon) {
|
|
@@ -331,6 +357,8 @@ class MatIconRegistry {
|
|
|
331
357
|
// it from the icon set.
|
|
332
358
|
return of(namedIcon);
|
|
333
359
|
}
|
|
360
|
+
// Not found in any cached icon sets. If there are icon sets with URLs that we haven't
|
|
361
|
+
// fetched, fetch them now and look for iconName in the results.
|
|
334
362
|
/** @type {?} */
|
|
335
363
|
const iconSetFetchRequests = iconSetConfigs
|
|
336
364
|
.filter(iconSetConfig => !iconSetConfig.svgElement)
|
|
@@ -359,6 +387,7 @@ class MatIconRegistry {
|
|
|
359
387
|
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
|
|
360
388
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
361
389
|
* returns it. Returns null if no matching element is found.
|
|
390
|
+
* @private
|
|
362
391
|
* @param {?} iconName
|
|
363
392
|
* @param {?} iconSetConfigs
|
|
364
393
|
* @return {?}
|
|
@@ -381,6 +410,7 @@ class MatIconRegistry {
|
|
|
381
410
|
/**
|
|
382
411
|
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
|
|
383
412
|
* from it.
|
|
413
|
+
* @private
|
|
384
414
|
* @param {?} config
|
|
385
415
|
* @return {?}
|
|
386
416
|
*/
|
|
@@ -391,6 +421,7 @@ class MatIconRegistry {
|
|
|
391
421
|
/**
|
|
392
422
|
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
|
|
393
423
|
* from it.
|
|
424
|
+
* @private
|
|
394
425
|
* @param {?} config
|
|
395
426
|
* @return {?}
|
|
396
427
|
*/
|
|
@@ -410,6 +441,7 @@ class MatIconRegistry {
|
|
|
410
441
|
}
|
|
411
442
|
/**
|
|
412
443
|
* Creates a DOM element from the given SVG string, and adds default attributes.
|
|
444
|
+
* @private
|
|
413
445
|
* @param {?} responseText
|
|
414
446
|
* @return {?}
|
|
415
447
|
*/
|
|
@@ -423,6 +455,7 @@ class MatIconRegistry {
|
|
|
423
455
|
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
|
|
424
456
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
425
457
|
* returns it. Returns null if no matching element is found.
|
|
458
|
+
* @private
|
|
426
459
|
* @param {?} iconSet
|
|
427
460
|
* @param {?} iconName
|
|
428
461
|
* @return {?}
|
|
@@ -433,13 +466,15 @@ class MatIconRegistry {
|
|
|
433
466
|
if (!iconSource) {
|
|
434
467
|
return null;
|
|
435
468
|
}
|
|
469
|
+
// Clone the element and remove the ID to prevent multiple elements from being added
|
|
470
|
+
// to the page with the same ID.
|
|
436
471
|
/** @type {?} */
|
|
437
|
-
const iconElement = /** @type {?} */ (iconSource.cloneNode(true));
|
|
472
|
+
const iconElement = (/** @type {?} */ (iconSource.cloneNode(true)));
|
|
438
473
|
iconElement.removeAttribute('id');
|
|
439
474
|
// If the icon node is itself an <svg> node, clone and return it directly. If not, set it as
|
|
440
475
|
// the content of a new <svg> node.
|
|
441
476
|
if (iconElement.nodeName.toLowerCase() === 'svg') {
|
|
442
|
-
return this._setSvgAttributes(/** @type {?} */ (iconElement));
|
|
477
|
+
return this._setSvgAttributes((/** @type {?} */ (iconElement)));
|
|
443
478
|
}
|
|
444
479
|
// If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note
|
|
445
480
|
// that the same could be achieved by referring to it via <use href="#id">, however the <use>
|
|
@@ -447,6 +482,11 @@ class MatIconRegistry {
|
|
|
447
482
|
if (iconElement.nodeName.toLowerCase() === 'symbol') {
|
|
448
483
|
return this._setSvgAttributes(this._toSvgElement(iconElement));
|
|
449
484
|
}
|
|
485
|
+
// createElement('SVG') doesn't work as expected; the DOM ends up with
|
|
486
|
+
// the correct nodes, but the SVG content doesn't render. Instead we
|
|
487
|
+
// have to create an empty SVG node using innerHTML and append its content.
|
|
488
|
+
// Elements created using DOMParser.parseFromString have the same problem.
|
|
489
|
+
// http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display
|
|
450
490
|
/** @type {?} */
|
|
451
491
|
const svg = this._svgElementFromString('<svg></svg>');
|
|
452
492
|
// Clone the node so we don't remove it from the parent icon set element.
|
|
@@ -455,6 +495,7 @@ class MatIconRegistry {
|
|
|
455
495
|
}
|
|
456
496
|
/**
|
|
457
497
|
* Creates a DOM element from the given SVG string.
|
|
498
|
+
* @private
|
|
458
499
|
* @param {?} str
|
|
459
500
|
* @return {?}
|
|
460
501
|
*/
|
|
@@ -463,7 +504,7 @@ class MatIconRegistry {
|
|
|
463
504
|
const div = this._document.createElement('DIV');
|
|
464
505
|
div.innerHTML = str;
|
|
465
506
|
/** @type {?} */
|
|
466
|
-
const svg = /** @type {?} */ (div.querySelector('svg'));
|
|
507
|
+
const svg = (/** @type {?} */ (div.querySelector('svg')));
|
|
467
508
|
if (!svg) {
|
|
468
509
|
throw Error('<svg> tag not found');
|
|
469
510
|
}
|
|
@@ -471,6 +512,7 @@ class MatIconRegistry {
|
|
|
471
512
|
}
|
|
472
513
|
/**
|
|
473
514
|
* Converts an element into an SVG node by cloning all of its children.
|
|
515
|
+
* @private
|
|
474
516
|
* @param {?} element
|
|
475
517
|
* @return {?}
|
|
476
518
|
*/
|
|
@@ -486,6 +528,7 @@ class MatIconRegistry {
|
|
|
486
528
|
}
|
|
487
529
|
/**
|
|
488
530
|
* Sets the default attributes for an SVG element to be used as an icon.
|
|
531
|
+
* @private
|
|
489
532
|
* @param {?} svg
|
|
490
533
|
* @return {?}
|
|
491
534
|
*/
|
|
@@ -500,6 +543,7 @@ class MatIconRegistry {
|
|
|
500
543
|
/**
|
|
501
544
|
* Returns an Observable which produces the string contents of the given URL. Results may be
|
|
502
545
|
* cached, so future calls with the same URL may not cause another HTTP request.
|
|
546
|
+
* @private
|
|
503
547
|
* @param {?} safeUrl
|
|
504
548
|
* @return {?}
|
|
505
549
|
*/
|
|
@@ -515,11 +559,16 @@ class MatIconRegistry {
|
|
|
515
559
|
if (!url) {
|
|
516
560
|
throw getMatIconFailedToSanitizeUrlError(safeUrl);
|
|
517
561
|
}
|
|
562
|
+
// Store in-progress fetches to avoid sending a duplicate request for a URL when there is
|
|
563
|
+
// already a request in progress for that URL. It's necessary to call share() on the
|
|
564
|
+
// Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.
|
|
518
565
|
/** @type {?} */
|
|
519
566
|
const inProgressFetch = this._inProgressUrlFetches.get(url);
|
|
520
567
|
if (inProgressFetch) {
|
|
521
568
|
return inProgressFetch;
|
|
522
569
|
}
|
|
570
|
+
// TODO(jelbourn): for some reason, the `finalize` operator "loses" the generic type on the
|
|
571
|
+
// Observable. Figure out why and fix it.
|
|
523
572
|
/** @type {?} */
|
|
524
573
|
const req = this._httpClient.get(url, { responseType: 'text' }).pipe(finalize(() => this._inProgressUrlFetches.delete(url)), share());
|
|
525
574
|
this._inProgressUrlFetches.set(url, req);
|
|
@@ -527,31 +576,37 @@ class MatIconRegistry {
|
|
|
527
576
|
}
|
|
528
577
|
/**
|
|
529
578
|
* Registers an icon config by name in the specified namespace.
|
|
579
|
+
* @private
|
|
580
|
+
* @template THIS
|
|
581
|
+
* @this {THIS}
|
|
530
582
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
531
583
|
* @param {?} iconName Name under which to register the config.
|
|
532
584
|
* @param {?} config Config to be registered.
|
|
533
|
-
* @return {
|
|
585
|
+
* @return {THIS}
|
|
534
586
|
*/
|
|
535
587
|
_addSvgIconConfig(namespace, iconName, config) {
|
|
536
|
-
this._svgIconConfigs.set(iconKey(namespace, iconName), config);
|
|
537
|
-
return this;
|
|
588
|
+
(/** @type {?} */ (this))._svgIconConfigs.set(iconKey(namespace, iconName), config);
|
|
589
|
+
return (/** @type {?} */ (this));
|
|
538
590
|
}
|
|
539
591
|
/**
|
|
540
592
|
* Registers an icon set config in the specified namespace.
|
|
593
|
+
* @private
|
|
594
|
+
* @template THIS
|
|
595
|
+
* @this {THIS}
|
|
541
596
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
542
597
|
* @param {?} config Config to be registered.
|
|
543
|
-
* @return {
|
|
598
|
+
* @return {THIS}
|
|
544
599
|
*/
|
|
545
600
|
_addSvgIconSetConfig(namespace, config) {
|
|
546
601
|
/** @type {?} */
|
|
547
|
-
const configNamespace = this._iconSetConfigs.get(namespace);
|
|
602
|
+
const configNamespace = (/** @type {?} */ (this))._iconSetConfigs.get(namespace);
|
|
548
603
|
if (configNamespace) {
|
|
549
604
|
configNamespace.push(config);
|
|
550
605
|
}
|
|
551
606
|
else {
|
|
552
|
-
this._iconSetConfigs.set(namespace, [config]);
|
|
607
|
+
(/** @type {?} */ (this))._iconSetConfigs.set(namespace, [config]);
|
|
553
608
|
}
|
|
554
|
-
return this;
|
|
609
|
+
return (/** @type {?} */ (this));
|
|
555
610
|
}
|
|
556
611
|
}
|
|
557
612
|
MatIconRegistry.decorators = [
|
|
@@ -575,9 +630,10 @@ MatIconRegistry.ctorParameters = () => [
|
|
|
575
630
|
function ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, httpClient, sanitizer, document) {
|
|
576
631
|
return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document);
|
|
577
632
|
}
|
|
578
|
-
/**
|
|
633
|
+
/**
|
|
579
634
|
* \@docs-private
|
|
580
|
-
|
|
635
|
+
* @type {?}
|
|
636
|
+
*/
|
|
581
637
|
const ICON_REGISTRY_PROVIDER = {
|
|
582
638
|
// If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.
|
|
583
639
|
provide: MatIconRegistry,
|
|
@@ -585,7 +641,7 @@ const ICON_REGISTRY_PROVIDER = {
|
|
|
585
641
|
[new Optional(), new SkipSelf(), MatIconRegistry],
|
|
586
642
|
[new Optional(), HttpClient],
|
|
587
643
|
DomSanitizer,
|
|
588
|
-
[new Optional(), /** @type {?} */ (DOCUMENT)],
|
|
644
|
+
[new Optional(), (/** @type {?} */ (DOCUMENT))],
|
|
589
645
|
],
|
|
590
646
|
useFactory: ICON_REGISTRY_PROVIDER_FACTORY,
|
|
591
647
|
};
|
|
@@ -595,7 +651,7 @@ const ICON_REGISTRY_PROVIDER = {
|
|
|
595
651
|
* @return {?}
|
|
596
652
|
*/
|
|
597
653
|
function cloneSvg(svg) {
|
|
598
|
-
return /** @type {?} */ (svg.cloneNode(true));
|
|
654
|
+
return (/** @type {?} */ (svg.cloneNode(true)));
|
|
599
655
|
}
|
|
600
656
|
/**
|
|
601
657
|
* Returns the cache key to use for an icon namespace and name.
|
|
@@ -609,8 +665,9 @@ function iconKey(namespace, name) {
|
|
|
609
665
|
|
|
610
666
|
/**
|
|
611
667
|
* @fileoverview added by tsickle
|
|
612
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
668
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
613
669
|
*/
|
|
670
|
+
// Boilerplate for applying mixins to MatIcon.
|
|
614
671
|
/**
|
|
615
672
|
* \@docs-private
|
|
616
673
|
*/
|
|
@@ -624,11 +681,12 @@ class MatIconBase {
|
|
|
624
681
|
}
|
|
625
682
|
/** @type {?} */
|
|
626
683
|
const _MatIconMixinBase = mixinColor(MatIconBase);
|
|
627
|
-
/**
|
|
684
|
+
/**
|
|
628
685
|
* Injection token used to provide the current location to `MatIcon`.
|
|
629
686
|
* Used to handle server-side rendering and to stub out during unit tests.
|
|
630
687
|
* \@docs-private
|
|
631
|
-
|
|
688
|
+
* @type {?}
|
|
689
|
+
*/
|
|
632
690
|
const MAT_ICON_LOCATION = new InjectionToken('mat-icon-location', {
|
|
633
691
|
providedIn: 'root',
|
|
634
692
|
factory: MAT_ICON_LOCATION_FACTORY
|
|
@@ -648,9 +706,10 @@ function MAT_ICON_LOCATION_FACTORY() {
|
|
|
648
706
|
getPathname: () => _location ? (_location.pathname + _location.search) : ''
|
|
649
707
|
};
|
|
650
708
|
}
|
|
651
|
-
/**
|
|
709
|
+
/**
|
|
652
710
|
* SVG attributes that accept a FuncIRI (e.g. `url(<something>)`).
|
|
653
|
-
|
|
711
|
+
* @type {?}
|
|
712
|
+
*/
|
|
654
713
|
const funcIriAttributes = [
|
|
655
714
|
'clip-path',
|
|
656
715
|
'color-profile',
|
|
@@ -666,13 +725,15 @@ const funcIriAttributes = [
|
|
|
666
725
|
'stroke'
|
|
667
726
|
];
|
|
668
727
|
const ɵ0 = attr => `[${attr}]`;
|
|
669
|
-
/**
|
|
728
|
+
/**
|
|
670
729
|
* Selector that can be used to find all elements that are using a `FuncIRI`.
|
|
671
|
-
|
|
730
|
+
* @type {?}
|
|
731
|
+
*/
|
|
672
732
|
const funcIriAttributeSelector = funcIriAttributes.map(ɵ0).join(', ');
|
|
673
|
-
/**
|
|
733
|
+
/**
|
|
674
734
|
* Regex that can be used to extract the id out of a FuncIRI.
|
|
675
|
-
|
|
735
|
+
* @type {?}
|
|
736
|
+
*/
|
|
676
737
|
const funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
|
|
677
738
|
/**
|
|
678
739
|
* Component to display an icon. It can be used in the following ways:
|
|
@@ -708,11 +769,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
708
769
|
* @param {?} ariaHidden
|
|
709
770
|
* @param {?=} _location
|
|
710
771
|
*/
|
|
711
|
-
constructor(elementRef, _iconRegistry, ariaHidden,
|
|
712
|
-
* @deprecated `location` parameter to be made required.
|
|
713
|
-
* @breaking-change 8.0.0
|
|
714
|
-
*/
|
|
715
|
-
_location) {
|
|
772
|
+
constructor(elementRef, _iconRegistry, ariaHidden, _location) {
|
|
716
773
|
super(elementRef);
|
|
717
774
|
this._iconRegistry = _iconRegistry;
|
|
718
775
|
this._location = _location;
|
|
@@ -774,6 +831,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
774
831
|
* 'penguin' -> ['', 'penguin']
|
|
775
832
|
* null -> ['', '']
|
|
776
833
|
* 'a:b:c' -> (throws Error)`
|
|
834
|
+
* @private
|
|
777
835
|
* @param {?} iconName
|
|
778
836
|
* @return {?}
|
|
779
837
|
*/
|
|
@@ -785,7 +843,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
785
843
|
const parts = iconName.split(':');
|
|
786
844
|
switch (parts.length) {
|
|
787
845
|
case 1: return ['', parts[0]]; // Use default namespace.
|
|
788
|
-
case 2: return /** @type {?} */ (parts);
|
|
846
|
+
case 2: return (/** @type {?} */ (parts));
|
|
789
847
|
default: throw Error(`Invalid icon name: "${iconName}"`);
|
|
790
848
|
}
|
|
791
849
|
}
|
|
@@ -795,7 +853,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
795
853
|
*/
|
|
796
854
|
ngOnChanges(changes) {
|
|
797
855
|
// Only update the inline SVG icon if the inputs changed, to avoid unnecessary DOM operations.
|
|
798
|
-
if (changes
|
|
856
|
+
if (changes.svgIcon) {
|
|
799
857
|
if (this.svgIcon) {
|
|
800
858
|
const [namespace, iconName] = this._splitIconName(this.svgIcon);
|
|
801
859
|
this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(take(1)).subscribe(svg => this._setSvgElement(svg), (err) => console.log(`Error retrieving icon: ${err.message}`));
|
|
@@ -848,19 +906,24 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
848
906
|
}
|
|
849
907
|
}
|
|
850
908
|
/**
|
|
909
|
+
* @private
|
|
851
910
|
* @return {?}
|
|
852
911
|
*/
|
|
853
912
|
_usingFontIcon() {
|
|
854
913
|
return !this.svgIcon;
|
|
855
914
|
}
|
|
856
915
|
/**
|
|
916
|
+
* @private
|
|
857
917
|
* @param {?} svg
|
|
858
918
|
* @return {?}
|
|
859
919
|
*/
|
|
860
920
|
_setSvgElement(svg) {
|
|
861
921
|
this._clearSvgElement();
|
|
922
|
+
// Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.
|
|
923
|
+
// See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/
|
|
924
|
+
// Do this before inserting the element into the DOM, in order to avoid a style recalculation.
|
|
862
925
|
/** @type {?} */
|
|
863
|
-
const styleTags = /** @type {?} */ (svg.querySelectorAll('style'));
|
|
926
|
+
const styleTags = (/** @type {?} */ (svg.querySelectorAll('style')));
|
|
864
927
|
for (let i = 0; i < styleTags.length; i++) {
|
|
865
928
|
styleTags[i].textContent += ' ';
|
|
866
929
|
}
|
|
@@ -876,6 +939,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
876
939
|
this._elementRef.nativeElement.appendChild(svg);
|
|
877
940
|
}
|
|
878
941
|
/**
|
|
942
|
+
* @private
|
|
879
943
|
* @return {?}
|
|
880
944
|
*/
|
|
881
945
|
_clearSvgElement() {
|
|
@@ -899,6 +963,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
899
963
|
}
|
|
900
964
|
}
|
|
901
965
|
/**
|
|
966
|
+
* @private
|
|
902
967
|
* @return {?}
|
|
903
968
|
*/
|
|
904
969
|
_updateFontIconClasses() {
|
|
@@ -934,6 +999,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
934
999
|
* Cleans up a value to be used as a fontIcon or fontSet.
|
|
935
1000
|
* Since the value ends up being assigned as a CSS class, we
|
|
936
1001
|
* have to trim the value and omit space-separated values.
|
|
1002
|
+
* @private
|
|
937
1003
|
* @param {?} value
|
|
938
1004
|
* @return {?}
|
|
939
1005
|
*/
|
|
@@ -944,6 +1010,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
944
1010
|
* Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
|
|
945
1011
|
* reference. This is required because WebKit browsers require references to be prefixed with
|
|
946
1012
|
* the current path, if the page has a `base` tag.
|
|
1013
|
+
* @private
|
|
947
1014
|
* @param {?} path
|
|
948
1015
|
* @return {?}
|
|
949
1016
|
*/
|
|
@@ -961,6 +1028,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
961
1028
|
/**
|
|
962
1029
|
* Caches the children of an SVG element that have `url()`
|
|
963
1030
|
* references that we need to prefix with the current path.
|
|
1031
|
+
* @private
|
|
964
1032
|
* @param {?} element
|
|
965
1033
|
* @return {?}
|
|
966
1034
|
*/
|
|
@@ -984,8 +1052,8 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
984
1052
|
if (!attributes) {
|
|
985
1053
|
attributes = [];
|
|
986
1054
|
elements.set(elementWithReference, attributes);
|
|
987
|
-
}
|
|
988
|
-
((attributes)).push({ name: attr, value: match[1] });
|
|
1055
|
+
}
|
|
1056
|
+
(/** @type {?} */ (attributes)).push({ name: attr, value: match[1] });
|
|
989
1057
|
}
|
|
990
1058
|
});
|
|
991
1059
|
}
|
|
@@ -1001,6 +1069,7 @@ MatIcon.decorators = [
|
|
|
1001
1069
|
'role': 'img',
|
|
1002
1070
|
'class': 'mat-icon',
|
|
1003
1071
|
'[class.mat-icon-inline]': 'inline',
|
|
1072
|
+
'[class.mat-icon-no-color]': 'color !== "primary" && color !== "accent" && color !== "warn"',
|
|
1004
1073
|
},
|
|
1005
1074
|
encapsulation: ViewEncapsulation.None,
|
|
1006
1075
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1022,7 +1091,7 @@ MatIcon.propDecorators = {
|
|
|
1022
1091
|
|
|
1023
1092
|
/**
|
|
1024
1093
|
* @fileoverview added by tsickle
|
|
1025
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1094
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1026
1095
|
*/
|
|
1027
1096
|
class MatIconModule {
|
|
1028
1097
|
}
|
|
@@ -1036,12 +1105,12 @@ MatIconModule.decorators = [
|
|
|
1036
1105
|
|
|
1037
1106
|
/**
|
|
1038
1107
|
* @fileoverview added by tsickle
|
|
1039
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1108
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1040
1109
|
*/
|
|
1041
1110
|
|
|
1042
1111
|
/**
|
|
1043
1112
|
* @fileoverview added by tsickle
|
|
1044
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1113
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1045
1114
|
*/
|
|
1046
1115
|
|
|
1047
1116
|
export { MatIconModule, MAT_ICON_LOCATION_FACTORY, MatIconBase, _MatIconMixinBase, MAT_ICON_LOCATION, MatIcon, getMatIconNameNotFoundError, getMatIconNoHttpProviderError, getMatIconFailedToSanitizeUrlError, getMatIconFailedToSanitizeLiteralError, ICON_REGISTRY_PROVIDER_FACTORY, MatIconRegistry, ICON_REGISTRY_PROVIDER };
|