@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
|
@@ -42,7 +42,7 @@ function __extends(d, b) {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* @fileoverview added by tsickle
|
|
45
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
45
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
46
46
|
*/
|
|
47
47
|
/**
|
|
48
48
|
* Returns an exception to be thrown in the case when attempting to
|
|
@@ -97,11 +97,11 @@ SvgIconConfig = /** @class */ (function () {
|
|
|
97
97
|
function SvgIconConfig(data) {
|
|
98
98
|
// Note that we can't use `instanceof SVGElement` here,
|
|
99
99
|
// because it'll break during server-side rendering.
|
|
100
|
-
if (!!(/** @type {?} */ (data)).nodeName) {
|
|
101
|
-
this.svgElement = /** @type {?} */ (data);
|
|
100
|
+
if (!!((/** @type {?} */ (data))).nodeName) {
|
|
101
|
+
this.svgElement = (/** @type {?} */ (data));
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
|
-
this.url = /** @type {?} */ (data);
|
|
104
|
+
this.url = (/** @type {?} */ (data));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
return SvgIconConfig;
|
|
@@ -153,18 +153,22 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
153
153
|
*/
|
|
154
154
|
/**
|
|
155
155
|
* Registers an icon by URL in the default namespace.
|
|
156
|
+
* @template THIS
|
|
157
|
+
* @this {THIS}
|
|
156
158
|
* @param {?} iconName Name under which the icon should be registered.
|
|
157
159
|
* @param {?} url
|
|
158
|
-
* @return {
|
|
160
|
+
* @return {THIS}
|
|
159
161
|
*/
|
|
160
162
|
MatIconRegistry.prototype.addSvgIcon = /**
|
|
161
163
|
* Registers an icon by URL in the default namespace.
|
|
164
|
+
* @template THIS
|
|
165
|
+
* @this {THIS}
|
|
162
166
|
* @param {?} iconName Name under which the icon should be registered.
|
|
163
167
|
* @param {?} url
|
|
164
|
-
* @return {
|
|
168
|
+
* @return {THIS}
|
|
165
169
|
*/
|
|
166
170
|
function (iconName, url) {
|
|
167
|
-
return this.addSvgIconInNamespace('', iconName, url);
|
|
171
|
+
return (/** @type {?} */ (this)).addSvgIconInNamespace('', iconName, url);
|
|
168
172
|
};
|
|
169
173
|
/**
|
|
170
174
|
* Registers an icon using an HTML string in the default namespace.
|
|
@@ -173,18 +177,22 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
173
177
|
*/
|
|
174
178
|
/**
|
|
175
179
|
* Registers an icon using an HTML string in the default namespace.
|
|
180
|
+
* @template THIS
|
|
181
|
+
* @this {THIS}
|
|
176
182
|
* @param {?} iconName Name under which the icon should be registered.
|
|
177
183
|
* @param {?} literal SVG source of the icon.
|
|
178
|
-
* @return {
|
|
184
|
+
* @return {THIS}
|
|
179
185
|
*/
|
|
180
186
|
MatIconRegistry.prototype.addSvgIconLiteral = /**
|
|
181
187
|
* Registers an icon using an HTML string in the default namespace.
|
|
188
|
+
* @template THIS
|
|
189
|
+
* @this {THIS}
|
|
182
190
|
* @param {?} iconName Name under which the icon should be registered.
|
|
183
191
|
* @param {?} literal SVG source of the icon.
|
|
184
|
-
* @return {
|
|
192
|
+
* @return {THIS}
|
|
185
193
|
*/
|
|
186
194
|
function (iconName, literal) {
|
|
187
|
-
return this.addSvgIconLiteralInNamespace('', iconName, literal);
|
|
195
|
+
return (/** @type {?} */ (this)).addSvgIconLiteralInNamespace('', iconName, literal);
|
|
188
196
|
};
|
|
189
197
|
/**
|
|
190
198
|
* Registers an icon by URL in the specified namespace.
|
|
@@ -194,20 +202,24 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
194
202
|
*/
|
|
195
203
|
/**
|
|
196
204
|
* Registers an icon by URL in the specified namespace.
|
|
205
|
+
* @template THIS
|
|
206
|
+
* @this {THIS}
|
|
197
207
|
* @param {?} namespace Namespace in which the icon should be registered.
|
|
198
208
|
* @param {?} iconName Name under which the icon should be registered.
|
|
199
209
|
* @param {?} url
|
|
200
|
-
* @return {
|
|
210
|
+
* @return {THIS}
|
|
201
211
|
*/
|
|
202
212
|
MatIconRegistry.prototype.addSvgIconInNamespace = /**
|
|
203
213
|
* Registers an icon by URL in the specified namespace.
|
|
214
|
+
* @template THIS
|
|
215
|
+
* @this {THIS}
|
|
204
216
|
* @param {?} namespace Namespace in which the icon should be registered.
|
|
205
217
|
* @param {?} iconName Name under which the icon should be registered.
|
|
206
218
|
* @param {?} url
|
|
207
|
-
* @return {
|
|
219
|
+
* @return {THIS}
|
|
208
220
|
*/
|
|
209
221
|
function (namespace, iconName, url) {
|
|
210
|
-
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url));
|
|
222
|
+
return (/** @type {?} */ (this))._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url));
|
|
211
223
|
};
|
|
212
224
|
/**
|
|
213
225
|
* Registers an icon using an HTML string in the specified namespace.
|
|
@@ -217,27 +229,31 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
217
229
|
*/
|
|
218
230
|
/**
|
|
219
231
|
* Registers an icon using an HTML string in the specified namespace.
|
|
232
|
+
* @template THIS
|
|
233
|
+
* @this {THIS}
|
|
220
234
|
* @param {?} namespace Namespace in which the icon should be registered.
|
|
221
235
|
* @param {?} iconName Name under which the icon should be registered.
|
|
222
236
|
* @param {?} literal SVG source of the icon.
|
|
223
|
-
* @return {
|
|
237
|
+
* @return {THIS}
|
|
224
238
|
*/
|
|
225
239
|
MatIconRegistry.prototype.addSvgIconLiteralInNamespace = /**
|
|
226
240
|
* Registers an icon using an HTML string in the specified namespace.
|
|
241
|
+
* @template THIS
|
|
242
|
+
* @this {THIS}
|
|
227
243
|
* @param {?} namespace Namespace in which the icon should be registered.
|
|
228
244
|
* @param {?} iconName Name under which the icon should be registered.
|
|
229
245
|
* @param {?} literal SVG source of the icon.
|
|
230
|
-
* @return {
|
|
246
|
+
* @return {THIS}
|
|
231
247
|
*/
|
|
232
248
|
function (namespace, iconName, literal) {
|
|
233
249
|
/** @type {?} */
|
|
234
|
-
var sanitizedLiteral = this._sanitizer.sanitize(core.SecurityContext.HTML, literal);
|
|
250
|
+
var sanitizedLiteral = (/** @type {?} */ (this))._sanitizer.sanitize(core.SecurityContext.HTML, literal);
|
|
235
251
|
if (!sanitizedLiteral) {
|
|
236
252
|
throw getMatIconFailedToSanitizeLiteralError(literal);
|
|
237
253
|
}
|
|
238
254
|
/** @type {?} */
|
|
239
|
-
var svgElement = this._createSvgElementForSingleIcon(sanitizedLiteral);
|
|
240
|
-
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));
|
|
255
|
+
var svgElement = (/** @type {?} */ (this))._createSvgElementForSingleIcon(sanitizedLiteral);
|
|
256
|
+
return (/** @type {?} */ (this))._addSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));
|
|
241
257
|
};
|
|
242
258
|
/**
|
|
243
259
|
* Registers an icon set by URL in the default namespace.
|
|
@@ -245,16 +261,20 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
245
261
|
*/
|
|
246
262
|
/**
|
|
247
263
|
* Registers an icon set by URL in the default namespace.
|
|
264
|
+
* @template THIS
|
|
265
|
+
* @this {THIS}
|
|
248
266
|
* @param {?} url
|
|
249
|
-
* @return {
|
|
267
|
+
* @return {THIS}
|
|
250
268
|
*/
|
|
251
269
|
MatIconRegistry.prototype.addSvgIconSet = /**
|
|
252
270
|
* Registers an icon set by URL in the default namespace.
|
|
271
|
+
* @template THIS
|
|
272
|
+
* @this {THIS}
|
|
253
273
|
* @param {?} url
|
|
254
|
-
* @return {
|
|
274
|
+
* @return {THIS}
|
|
255
275
|
*/
|
|
256
276
|
function (url) {
|
|
257
|
-
return this.addSvgIconSetInNamespace('', url);
|
|
277
|
+
return (/** @type {?} */ (this)).addSvgIconSetInNamespace('', url);
|
|
258
278
|
};
|
|
259
279
|
/**
|
|
260
280
|
* Registers an icon set using an HTML string in the default namespace.
|
|
@@ -262,16 +282,20 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
262
282
|
*/
|
|
263
283
|
/**
|
|
264
284
|
* Registers an icon set using an HTML string in the default namespace.
|
|
285
|
+
* @template THIS
|
|
286
|
+
* @this {THIS}
|
|
265
287
|
* @param {?} literal SVG source of the icon set.
|
|
266
|
-
* @return {
|
|
288
|
+
* @return {THIS}
|
|
267
289
|
*/
|
|
268
290
|
MatIconRegistry.prototype.addSvgIconSetLiteral = /**
|
|
269
291
|
* Registers an icon set using an HTML string in the default namespace.
|
|
292
|
+
* @template THIS
|
|
293
|
+
* @this {THIS}
|
|
270
294
|
* @param {?} literal SVG source of the icon set.
|
|
271
|
-
* @return {
|
|
295
|
+
* @return {THIS}
|
|
272
296
|
*/
|
|
273
297
|
function (literal) {
|
|
274
|
-
return this.addSvgIconSetLiteralInNamespace('', literal);
|
|
298
|
+
return (/** @type {?} */ (this)).addSvgIconSetLiteralInNamespace('', literal);
|
|
275
299
|
};
|
|
276
300
|
/**
|
|
277
301
|
* Registers an icon set by URL in the specified namespace.
|
|
@@ -280,18 +304,22 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
280
304
|
*/
|
|
281
305
|
/**
|
|
282
306
|
* Registers an icon set by URL in the specified namespace.
|
|
307
|
+
* @template THIS
|
|
308
|
+
* @this {THIS}
|
|
283
309
|
* @param {?} namespace Namespace in which to register the icon set.
|
|
284
310
|
* @param {?} url
|
|
285
|
-
* @return {
|
|
311
|
+
* @return {THIS}
|
|
286
312
|
*/
|
|
287
313
|
MatIconRegistry.prototype.addSvgIconSetInNamespace = /**
|
|
288
314
|
* Registers an icon set by URL in the specified namespace.
|
|
315
|
+
* @template THIS
|
|
316
|
+
* @this {THIS}
|
|
289
317
|
* @param {?} namespace Namespace in which to register the icon set.
|
|
290
318
|
* @param {?} url
|
|
291
|
-
* @return {
|
|
319
|
+
* @return {THIS}
|
|
292
320
|
*/
|
|
293
321
|
function (namespace, url) {
|
|
294
|
-
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(url));
|
|
322
|
+
return (/** @type {?} */ (this))._addSvgIconSetConfig(namespace, new SvgIconConfig(url));
|
|
295
323
|
};
|
|
296
324
|
/**
|
|
297
325
|
* Registers an icon set using an HTML string in the specified namespace.
|
|
@@ -300,25 +328,29 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
300
328
|
*/
|
|
301
329
|
/**
|
|
302
330
|
* Registers an icon set using an HTML string in the specified namespace.
|
|
331
|
+
* @template THIS
|
|
332
|
+
* @this {THIS}
|
|
303
333
|
* @param {?} namespace Namespace in which to register the icon set.
|
|
304
334
|
* @param {?} literal SVG source of the icon set.
|
|
305
|
-
* @return {
|
|
335
|
+
* @return {THIS}
|
|
306
336
|
*/
|
|
307
337
|
MatIconRegistry.prototype.addSvgIconSetLiteralInNamespace = /**
|
|
308
338
|
* Registers an icon set using an HTML string in the specified namespace.
|
|
339
|
+
* @template THIS
|
|
340
|
+
* @this {THIS}
|
|
309
341
|
* @param {?} namespace Namespace in which to register the icon set.
|
|
310
342
|
* @param {?} literal SVG source of the icon set.
|
|
311
|
-
* @return {
|
|
343
|
+
* @return {THIS}
|
|
312
344
|
*/
|
|
313
345
|
function (namespace, literal) {
|
|
314
346
|
/** @type {?} */
|
|
315
|
-
var sanitizedLiteral = this._sanitizer.sanitize(core.SecurityContext.HTML, literal);
|
|
347
|
+
var sanitizedLiteral = (/** @type {?} */ (this))._sanitizer.sanitize(core.SecurityContext.HTML, literal);
|
|
316
348
|
if (!sanitizedLiteral) {
|
|
317
349
|
throw getMatIconFailedToSanitizeLiteralError(literal);
|
|
318
350
|
}
|
|
319
351
|
/** @type {?} */
|
|
320
|
-
var svgElement = this._svgElementFromString(sanitizedLiteral);
|
|
321
|
-
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(svgElement));
|
|
352
|
+
var svgElement = (/** @type {?} */ (this))._svgElementFromString(sanitizedLiteral);
|
|
353
|
+
return (/** @type {?} */ (this))._addSvgIconSetConfig(namespace, new SvgIconConfig(svgElement));
|
|
322
354
|
};
|
|
323
355
|
/**
|
|
324
356
|
* Defines an alias for a CSS class name to be used for icon fonts. Creating an matIcon
|
|
@@ -333,23 +365,27 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
333
365
|
* component with the alias as the fontSet input will cause the class name to be applied
|
|
334
366
|
* to the `<mat-icon>` element.
|
|
335
367
|
*
|
|
368
|
+
* @template THIS
|
|
369
|
+
* @this {THIS}
|
|
336
370
|
* @param {?} alias Alias for the font.
|
|
337
371
|
* @param {?=} className Class name override to be used instead of the alias.
|
|
338
|
-
* @return {
|
|
372
|
+
* @return {THIS}
|
|
339
373
|
*/
|
|
340
374
|
MatIconRegistry.prototype.registerFontClassAlias = /**
|
|
341
375
|
* Defines an alias for a CSS class name to be used for icon fonts. Creating an matIcon
|
|
342
376
|
* component with the alias as the fontSet input will cause the class name to be applied
|
|
343
377
|
* to the `<mat-icon>` element.
|
|
344
378
|
*
|
|
379
|
+
* @template THIS
|
|
380
|
+
* @this {THIS}
|
|
345
381
|
* @param {?} alias Alias for the font.
|
|
346
382
|
* @param {?=} className Class name override to be used instead of the alias.
|
|
347
|
-
* @return {
|
|
383
|
+
* @return {THIS}
|
|
348
384
|
*/
|
|
349
385
|
function (alias, className) {
|
|
350
386
|
if (className === void 0) { className = alias; }
|
|
351
|
-
this._fontCssClassesByAlias.set(alias, className);
|
|
352
|
-
return this;
|
|
387
|
+
(/** @type {?} */ (this))._fontCssClassesByAlias.set(alias, className);
|
|
388
|
+
return (/** @type {?} */ (this));
|
|
353
389
|
};
|
|
354
390
|
/**
|
|
355
391
|
* Returns the CSS class name associated with the alias by a previous call to
|
|
@@ -380,19 +416,23 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
380
416
|
* Sets the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
|
|
381
417
|
* have a fontSet input value, and is not loading an icon by name or URL.
|
|
382
418
|
*
|
|
419
|
+
* @template THIS
|
|
420
|
+
* @this {THIS}
|
|
383
421
|
* @param {?} className
|
|
384
|
-
* @return {
|
|
422
|
+
* @return {THIS}
|
|
385
423
|
*/
|
|
386
424
|
MatIconRegistry.prototype.setDefaultFontSetClass = /**
|
|
387
425
|
* Sets the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
|
|
388
426
|
* have a fontSet input value, and is not loading an icon by name or URL.
|
|
389
427
|
*
|
|
428
|
+
* @template THIS
|
|
429
|
+
* @this {THIS}
|
|
390
430
|
* @param {?} className
|
|
391
|
-
* @return {
|
|
431
|
+
* @return {THIS}
|
|
392
432
|
*/
|
|
393
433
|
function (className) {
|
|
394
|
-
this._defaultFontSetClass = className;
|
|
395
|
-
return this;
|
|
434
|
+
(/** @type {?} */ (this))._defaultFontSetClass = className;
|
|
435
|
+
return (/** @type {?} */ (this));
|
|
396
436
|
};
|
|
397
437
|
/**
|
|
398
438
|
* Returns the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
|
|
@@ -449,7 +489,7 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
449
489
|
if (cachedIcon) {
|
|
450
490
|
return rxjs.of(cloneSvg(cachedIcon));
|
|
451
491
|
}
|
|
452
|
-
return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl)).pipe(operators.tap(function (svg) { return _this._cachedIconsByUrl.set(/** @type {?} */ (
|
|
492
|
+
return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl)).pipe(operators.tap(function (svg) { return _this._cachedIconsByUrl.set((/** @type {?} */ (url)), svg); }), operators.map(function (svg) { return cloneSvg(svg); }));
|
|
453
493
|
};
|
|
454
494
|
/**
|
|
455
495
|
* Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
|
|
@@ -479,6 +519,7 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
479
519
|
*/
|
|
480
520
|
function (name, namespace) {
|
|
481
521
|
if (namespace === void 0) { namespace = ''; }
|
|
522
|
+
// Return (copy of) cached icon if possible.
|
|
482
523
|
/** @type {?} */
|
|
483
524
|
var key = iconKey(namespace, name);
|
|
484
525
|
/** @type {?} */
|
|
@@ -486,6 +527,7 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
486
527
|
if (config) {
|
|
487
528
|
return this._getSvgFromConfig(config);
|
|
488
529
|
}
|
|
530
|
+
// See if we have any icon sets registered for the namespace.
|
|
489
531
|
/** @type {?} */
|
|
490
532
|
var iconSetConfigs = this._iconSetConfigs.get(namespace);
|
|
491
533
|
if (iconSetConfigs) {
|
|
@@ -495,11 +537,16 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
495
537
|
};
|
|
496
538
|
/**
|
|
497
539
|
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
|
|
540
|
+
*/
|
|
541
|
+
/**
|
|
542
|
+
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
|
|
543
|
+
* @private
|
|
498
544
|
* @param {?} config
|
|
499
545
|
* @return {?}
|
|
500
546
|
*/
|
|
501
547
|
MatIconRegistry.prototype._getSvgFromConfig = /**
|
|
502
548
|
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
|
|
549
|
+
* @private
|
|
503
550
|
* @param {?} config
|
|
504
551
|
* @return {?}
|
|
505
552
|
*/
|
|
@@ -520,6 +567,15 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
520
567
|
* that have not been cached, and searches again after all fetches are completed.
|
|
521
568
|
* The returned Observable produces the SVG element if possible, and throws
|
|
522
569
|
* an error if no icon with the specified name can be found.
|
|
570
|
+
*/
|
|
571
|
+
/**
|
|
572
|
+
* Attempts to find an icon with the specified name in any of the SVG icon sets.
|
|
573
|
+
* First searches the available cached icons for a nested element with a matching name, and
|
|
574
|
+
* if found copies the element to a new `<svg>` element. If not found, fetches all icon sets
|
|
575
|
+
* that have not been cached, and searches again after all fetches are completed.
|
|
576
|
+
* The returned Observable produces the SVG element if possible, and throws
|
|
577
|
+
* an error if no icon with the specified name can be found.
|
|
578
|
+
* @private
|
|
523
579
|
* @param {?} name
|
|
524
580
|
* @param {?} iconSetConfigs
|
|
525
581
|
* @return {?}
|
|
@@ -531,12 +587,15 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
531
587
|
* that have not been cached, and searches again after all fetches are completed.
|
|
532
588
|
* The returned Observable produces the SVG element if possible, and throws
|
|
533
589
|
* an error if no icon with the specified name can be found.
|
|
590
|
+
* @private
|
|
534
591
|
* @param {?} name
|
|
535
592
|
* @param {?} iconSetConfigs
|
|
536
593
|
* @return {?}
|
|
537
594
|
*/
|
|
538
595
|
function (name, iconSetConfigs) {
|
|
539
596
|
var _this = this;
|
|
597
|
+
// For all the icon set SVG elements we've fetched, see if any contain an icon with the
|
|
598
|
+
// requested name.
|
|
540
599
|
/** @type {?} */
|
|
541
600
|
var namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
|
|
542
601
|
if (namedIcon) {
|
|
@@ -545,6 +604,8 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
545
604
|
// it from the icon set.
|
|
546
605
|
return rxjs.of(namedIcon);
|
|
547
606
|
}
|
|
607
|
+
// Not found in any cached icon sets. If there are icon sets with URLs that we haven't
|
|
608
|
+
// fetched, fetch them now and look for iconName in the results.
|
|
548
609
|
/** @type {?} */
|
|
549
610
|
var iconSetFetchRequests = iconSetConfigs
|
|
550
611
|
.filter(function (iconSetConfig) { return !iconSetConfig.svgElement; })
|
|
@@ -573,6 +634,12 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
573
634
|
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
|
|
574
635
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
575
636
|
* returns it. Returns null if no matching element is found.
|
|
637
|
+
*/
|
|
638
|
+
/**
|
|
639
|
+
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
|
|
640
|
+
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
641
|
+
* returns it. Returns null if no matching element is found.
|
|
642
|
+
* @private
|
|
576
643
|
* @param {?} iconName
|
|
577
644
|
* @param {?} iconSetConfigs
|
|
578
645
|
* @return {?}
|
|
@@ -581,6 +648,7 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
581
648
|
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
|
|
582
649
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
583
650
|
* returns it. Returns null if no matching element is found.
|
|
651
|
+
* @private
|
|
584
652
|
* @param {?} iconName
|
|
585
653
|
* @param {?} iconSetConfigs
|
|
586
654
|
* @return {?}
|
|
@@ -603,12 +671,18 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
603
671
|
/**
|
|
604
672
|
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
|
|
605
673
|
* from it.
|
|
674
|
+
*/
|
|
675
|
+
/**
|
|
676
|
+
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
|
|
677
|
+
* from it.
|
|
678
|
+
* @private
|
|
606
679
|
* @param {?} config
|
|
607
680
|
* @return {?}
|
|
608
681
|
*/
|
|
609
682
|
MatIconRegistry.prototype._loadSvgIconFromConfig = /**
|
|
610
683
|
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
|
|
611
684
|
* from it.
|
|
685
|
+
* @private
|
|
612
686
|
* @param {?} config
|
|
613
687
|
* @return {?}
|
|
614
688
|
*/
|
|
@@ -620,12 +694,18 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
620
694
|
/**
|
|
621
695
|
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
|
|
622
696
|
* from it.
|
|
697
|
+
*/
|
|
698
|
+
/**
|
|
699
|
+
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
|
|
700
|
+
* from it.
|
|
701
|
+
* @private
|
|
623
702
|
* @param {?} config
|
|
624
703
|
* @return {?}
|
|
625
704
|
*/
|
|
626
705
|
MatIconRegistry.prototype._loadSvgIconSetFromConfig = /**
|
|
627
706
|
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
|
|
628
707
|
* from it.
|
|
708
|
+
* @private
|
|
629
709
|
* @param {?} config
|
|
630
710
|
* @return {?}
|
|
631
711
|
*/
|
|
@@ -646,11 +726,16 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
646
726
|
};
|
|
647
727
|
/**
|
|
648
728
|
* Creates a DOM element from the given SVG string, and adds default attributes.
|
|
729
|
+
*/
|
|
730
|
+
/**
|
|
731
|
+
* Creates a DOM element from the given SVG string, and adds default attributes.
|
|
732
|
+
* @private
|
|
649
733
|
* @param {?} responseText
|
|
650
734
|
* @return {?}
|
|
651
735
|
*/
|
|
652
736
|
MatIconRegistry.prototype._createSvgElementForSingleIcon = /**
|
|
653
737
|
* Creates a DOM element from the given SVG string, and adds default attributes.
|
|
738
|
+
* @private
|
|
654
739
|
* @param {?} responseText
|
|
655
740
|
* @return {?}
|
|
656
741
|
*/
|
|
@@ -664,6 +749,12 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
664
749
|
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
|
|
665
750
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
666
751
|
* returns it. Returns null if no matching element is found.
|
|
752
|
+
*/
|
|
753
|
+
/**
|
|
754
|
+
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
|
|
755
|
+
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
756
|
+
* returns it. Returns null if no matching element is found.
|
|
757
|
+
* @private
|
|
667
758
|
* @param {?} iconSet
|
|
668
759
|
* @param {?} iconName
|
|
669
760
|
* @return {?}
|
|
@@ -672,6 +763,7 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
672
763
|
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
|
|
673
764
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
674
765
|
* returns it. Returns null if no matching element is found.
|
|
766
|
+
* @private
|
|
675
767
|
* @param {?} iconSet
|
|
676
768
|
* @param {?} iconName
|
|
677
769
|
* @return {?}
|
|
@@ -682,13 +774,15 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
682
774
|
if (!iconSource) {
|
|
683
775
|
return null;
|
|
684
776
|
}
|
|
777
|
+
// Clone the element and remove the ID to prevent multiple elements from being added
|
|
778
|
+
// to the page with the same ID.
|
|
685
779
|
/** @type {?} */
|
|
686
|
-
var iconElement = /** @type {?} */ (iconSource.cloneNode(true));
|
|
780
|
+
var iconElement = (/** @type {?} */ (iconSource.cloneNode(true)));
|
|
687
781
|
iconElement.removeAttribute('id');
|
|
688
782
|
// If the icon node is itself an <svg> node, clone and return it directly. If not, set it as
|
|
689
783
|
// the content of a new <svg> node.
|
|
690
784
|
if (iconElement.nodeName.toLowerCase() === 'svg') {
|
|
691
|
-
return this._setSvgAttributes(/** @type {?} */ (iconElement));
|
|
785
|
+
return this._setSvgAttributes((/** @type {?} */ (iconElement)));
|
|
692
786
|
}
|
|
693
787
|
// If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note
|
|
694
788
|
// that the same could be achieved by referring to it via <use href="#id">, however the <use>
|
|
@@ -696,6 +790,11 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
696
790
|
if (iconElement.nodeName.toLowerCase() === 'symbol') {
|
|
697
791
|
return this._setSvgAttributes(this._toSvgElement(iconElement));
|
|
698
792
|
}
|
|
793
|
+
// createElement('SVG') doesn't work as expected; the DOM ends up with
|
|
794
|
+
// the correct nodes, but the SVG content doesn't render. Instead we
|
|
795
|
+
// have to create an empty SVG node using innerHTML and append its content.
|
|
796
|
+
// Elements created using DOMParser.parseFromString have the same problem.
|
|
797
|
+
// http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display
|
|
699
798
|
/** @type {?} */
|
|
700
799
|
var svg = this._svgElementFromString('<svg></svg>');
|
|
701
800
|
// Clone the node so we don't remove it from the parent icon set element.
|
|
@@ -704,11 +803,16 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
704
803
|
};
|
|
705
804
|
/**
|
|
706
805
|
* Creates a DOM element from the given SVG string.
|
|
806
|
+
*/
|
|
807
|
+
/**
|
|
808
|
+
* Creates a DOM element from the given SVG string.
|
|
809
|
+
* @private
|
|
707
810
|
* @param {?} str
|
|
708
811
|
* @return {?}
|
|
709
812
|
*/
|
|
710
813
|
MatIconRegistry.prototype._svgElementFromString = /**
|
|
711
814
|
* Creates a DOM element from the given SVG string.
|
|
815
|
+
* @private
|
|
712
816
|
* @param {?} str
|
|
713
817
|
* @return {?}
|
|
714
818
|
*/
|
|
@@ -717,7 +821,7 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
717
821
|
var div = this._document.createElement('DIV');
|
|
718
822
|
div.innerHTML = str;
|
|
719
823
|
/** @type {?} */
|
|
720
|
-
var svg = /** @type {?} */ (div.querySelector('svg'));
|
|
824
|
+
var svg = (/** @type {?} */ (div.querySelector('svg')));
|
|
721
825
|
if (!svg) {
|
|
722
826
|
throw Error('<svg> tag not found');
|
|
723
827
|
}
|
|
@@ -725,11 +829,16 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
725
829
|
};
|
|
726
830
|
/**
|
|
727
831
|
* Converts an element into an SVG node by cloning all of its children.
|
|
832
|
+
*/
|
|
833
|
+
/**
|
|
834
|
+
* Converts an element into an SVG node by cloning all of its children.
|
|
835
|
+
* @private
|
|
728
836
|
* @param {?} element
|
|
729
837
|
* @return {?}
|
|
730
838
|
*/
|
|
731
839
|
MatIconRegistry.prototype._toSvgElement = /**
|
|
732
840
|
* Converts an element into an SVG node by cloning all of its children.
|
|
841
|
+
* @private
|
|
733
842
|
* @param {?} element
|
|
734
843
|
* @return {?}
|
|
735
844
|
*/
|
|
@@ -745,11 +854,16 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
745
854
|
};
|
|
746
855
|
/**
|
|
747
856
|
* Sets the default attributes for an SVG element to be used as an icon.
|
|
857
|
+
*/
|
|
858
|
+
/**
|
|
859
|
+
* Sets the default attributes for an SVG element to be used as an icon.
|
|
860
|
+
* @private
|
|
748
861
|
* @param {?} svg
|
|
749
862
|
* @return {?}
|
|
750
863
|
*/
|
|
751
864
|
MatIconRegistry.prototype._setSvgAttributes = /**
|
|
752
865
|
* Sets the default attributes for an SVG element to be used as an icon.
|
|
866
|
+
* @private
|
|
753
867
|
* @param {?} svg
|
|
754
868
|
* @return {?}
|
|
755
869
|
*/
|
|
@@ -764,12 +878,18 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
764
878
|
/**
|
|
765
879
|
* Returns an Observable which produces the string contents of the given URL. Results may be
|
|
766
880
|
* cached, so future calls with the same URL may not cause another HTTP request.
|
|
881
|
+
*/
|
|
882
|
+
/**
|
|
883
|
+
* Returns an Observable which produces the string contents of the given URL. Results may be
|
|
884
|
+
* cached, so future calls with the same URL may not cause another HTTP request.
|
|
885
|
+
* @private
|
|
767
886
|
* @param {?} safeUrl
|
|
768
887
|
* @return {?}
|
|
769
888
|
*/
|
|
770
889
|
MatIconRegistry.prototype._fetchUrl = /**
|
|
771
890
|
* Returns an Observable which produces the string contents of the given URL. Results may be
|
|
772
891
|
* cached, so future calls with the same URL may not cause another HTTP request.
|
|
892
|
+
* @private
|
|
773
893
|
* @param {?} safeUrl
|
|
774
894
|
* @return {?}
|
|
775
895
|
*/
|
|
@@ -786,11 +906,16 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
786
906
|
if (!url) {
|
|
787
907
|
throw getMatIconFailedToSanitizeUrlError(safeUrl);
|
|
788
908
|
}
|
|
909
|
+
// Store in-progress fetches to avoid sending a duplicate request for a URL when there is
|
|
910
|
+
// already a request in progress for that URL. It's necessary to call share() on the
|
|
911
|
+
// Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.
|
|
789
912
|
/** @type {?} */
|
|
790
913
|
var inProgressFetch = this._inProgressUrlFetches.get(url);
|
|
791
914
|
if (inProgressFetch) {
|
|
792
915
|
return inProgressFetch;
|
|
793
916
|
}
|
|
917
|
+
// TODO(jelbourn): for some reason, the `finalize` operator "loses" the generic type on the
|
|
918
|
+
// Observable. Figure out why and fix it.
|
|
794
919
|
/** @type {?} */
|
|
795
920
|
var req = this._httpClient.get(url, { responseType: 'text' }).pipe(operators.finalize(function () { return _this._inProgressUrlFetches.delete(url); }), operators.share());
|
|
796
921
|
this._inProgressUrlFetches.set(url, req);
|
|
@@ -798,44 +923,67 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
798
923
|
};
|
|
799
924
|
/**
|
|
800
925
|
* Registers an icon config by name in the specified namespace.
|
|
926
|
+
* @param namespace Namespace in which to register the icon config.
|
|
927
|
+
* @param iconName Name under which to register the config.
|
|
928
|
+
* @param config Config to be registered.
|
|
929
|
+
*/
|
|
930
|
+
/**
|
|
931
|
+
* Registers an icon config by name in the specified namespace.
|
|
932
|
+
* @private
|
|
933
|
+
* @template THIS
|
|
934
|
+
* @this {THIS}
|
|
801
935
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
802
936
|
* @param {?} iconName Name under which to register the config.
|
|
803
937
|
* @param {?} config Config to be registered.
|
|
804
|
-
* @return {
|
|
938
|
+
* @return {THIS}
|
|
805
939
|
*/
|
|
806
940
|
MatIconRegistry.prototype._addSvgIconConfig = /**
|
|
807
941
|
* Registers an icon config by name in the specified namespace.
|
|
942
|
+
* @private
|
|
943
|
+
* @template THIS
|
|
944
|
+
* @this {THIS}
|
|
808
945
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
809
946
|
* @param {?} iconName Name under which to register the config.
|
|
810
947
|
* @param {?} config Config to be registered.
|
|
811
|
-
* @return {
|
|
948
|
+
* @return {THIS}
|
|
812
949
|
*/
|
|
813
950
|
function (namespace, iconName, config) {
|
|
814
|
-
this._svgIconConfigs.set(iconKey(namespace, iconName), config);
|
|
815
|
-
return this;
|
|
951
|
+
(/** @type {?} */ (this))._svgIconConfigs.set(iconKey(namespace, iconName), config);
|
|
952
|
+
return (/** @type {?} */ (this));
|
|
816
953
|
};
|
|
817
954
|
/**
|
|
818
955
|
* Registers an icon set config in the specified namespace.
|
|
956
|
+
* @param namespace Namespace in which to register the icon config.
|
|
957
|
+
* @param config Config to be registered.
|
|
958
|
+
*/
|
|
959
|
+
/**
|
|
960
|
+
* Registers an icon set config in the specified namespace.
|
|
961
|
+
* @private
|
|
962
|
+
* @template THIS
|
|
963
|
+
* @this {THIS}
|
|
819
964
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
820
965
|
* @param {?} config Config to be registered.
|
|
821
|
-
* @return {
|
|
966
|
+
* @return {THIS}
|
|
822
967
|
*/
|
|
823
968
|
MatIconRegistry.prototype._addSvgIconSetConfig = /**
|
|
824
969
|
* Registers an icon set config in the specified namespace.
|
|
970
|
+
* @private
|
|
971
|
+
* @template THIS
|
|
972
|
+
* @this {THIS}
|
|
825
973
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
826
974
|
* @param {?} config Config to be registered.
|
|
827
|
-
* @return {
|
|
975
|
+
* @return {THIS}
|
|
828
976
|
*/
|
|
829
977
|
function (namespace, config) {
|
|
830
978
|
/** @type {?} */
|
|
831
|
-
var configNamespace = this._iconSetConfigs.get(namespace);
|
|
979
|
+
var configNamespace = (/** @type {?} */ (this))._iconSetConfigs.get(namespace);
|
|
832
980
|
if (configNamespace) {
|
|
833
981
|
configNamespace.push(config);
|
|
834
982
|
}
|
|
835
983
|
else {
|
|
836
|
-
this._iconSetConfigs.set(namespace, [config]);
|
|
984
|
+
(/** @type {?} */ (this))._iconSetConfigs.set(namespace, [config]);
|
|
837
985
|
}
|
|
838
|
-
return this;
|
|
986
|
+
return (/** @type {?} */ (this));
|
|
839
987
|
};
|
|
840
988
|
MatIconRegistry.decorators = [
|
|
841
989
|
{ type: core.Injectable, args: [{ providedIn: 'root' },] },
|
|
@@ -860,9 +1008,10 @@ var MatIconRegistry = /** @class */ (function () {
|
|
|
860
1008
|
function ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, httpClient, sanitizer, document) {
|
|
861
1009
|
return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document);
|
|
862
1010
|
}
|
|
863
|
-
/**
|
|
1011
|
+
/**
|
|
864
1012
|
* \@docs-private
|
|
865
|
-
|
|
1013
|
+
* @type {?}
|
|
1014
|
+
*/
|
|
866
1015
|
var ICON_REGISTRY_PROVIDER = {
|
|
867
1016
|
// If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.
|
|
868
1017
|
provide: MatIconRegistry,
|
|
@@ -870,7 +1019,7 @@ var ICON_REGISTRY_PROVIDER = {
|
|
|
870
1019
|
[new core.Optional(), new core.SkipSelf(), MatIconRegistry],
|
|
871
1020
|
[new core.Optional(), http.HttpClient],
|
|
872
1021
|
platformBrowser.DomSanitizer,
|
|
873
|
-
[new core.Optional(), /** @type {?} */ (common.DOCUMENT)],
|
|
1022
|
+
[new core.Optional(), (/** @type {?} */ (common.DOCUMENT))],
|
|
874
1023
|
],
|
|
875
1024
|
useFactory: ICON_REGISTRY_PROVIDER_FACTORY,
|
|
876
1025
|
};
|
|
@@ -880,7 +1029,7 @@ var ICON_REGISTRY_PROVIDER = {
|
|
|
880
1029
|
* @return {?}
|
|
881
1030
|
*/
|
|
882
1031
|
function cloneSvg(svg) {
|
|
883
|
-
return /** @type {?} */ (svg.cloneNode(true));
|
|
1032
|
+
return (/** @type {?} */ (svg.cloneNode(true)));
|
|
884
1033
|
}
|
|
885
1034
|
/**
|
|
886
1035
|
* Returns the cache key to use for an icon namespace and name.
|
|
@@ -894,12 +1043,15 @@ function iconKey(namespace, name) {
|
|
|
894
1043
|
|
|
895
1044
|
/**
|
|
896
1045
|
* @fileoverview added by tsickle
|
|
897
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1046
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
898
1047
|
*/
|
|
1048
|
+
// Boilerplate for applying mixins to MatIcon.
|
|
899
1049
|
/**
|
|
900
1050
|
* \@docs-private
|
|
901
1051
|
*/
|
|
902
|
-
var
|
|
1052
|
+
var
|
|
1053
|
+
// Boilerplate for applying mixins to MatIcon.
|
|
1054
|
+
/**
|
|
903
1055
|
* \@docs-private
|
|
904
1056
|
*/
|
|
905
1057
|
MatIconBase = /** @class */ (function () {
|
|
@@ -910,11 +1062,12 @@ MatIconBase = /** @class */ (function () {
|
|
|
910
1062
|
}());
|
|
911
1063
|
/** @type {?} */
|
|
912
1064
|
var _MatIconMixinBase = core$1.mixinColor(MatIconBase);
|
|
913
|
-
/**
|
|
1065
|
+
/**
|
|
914
1066
|
* Injection token used to provide the current location to `MatIcon`.
|
|
915
1067
|
* Used to handle server-side rendering and to stub out during unit tests.
|
|
916
1068
|
* \@docs-private
|
|
917
|
-
|
|
1069
|
+
* @type {?}
|
|
1070
|
+
*/
|
|
918
1071
|
var MAT_ICON_LOCATION = new core.InjectionToken('mat-icon-location', {
|
|
919
1072
|
providedIn: 'root',
|
|
920
1073
|
factory: MAT_ICON_LOCATION_FACTORY
|
|
@@ -934,9 +1087,10 @@ function MAT_ICON_LOCATION_FACTORY() {
|
|
|
934
1087
|
getPathname: function () { return _location ? (_location.pathname + _location.search) : ''; }
|
|
935
1088
|
};
|
|
936
1089
|
}
|
|
937
|
-
/**
|
|
1090
|
+
/**
|
|
938
1091
|
* SVG attributes that accept a FuncIRI (e.g. `url(<something>)`).
|
|
939
|
-
|
|
1092
|
+
* @type {?}
|
|
1093
|
+
*/
|
|
940
1094
|
var funcIriAttributes = [
|
|
941
1095
|
'clip-path',
|
|
942
1096
|
'color-profile',
|
|
@@ -952,13 +1106,15 @@ var funcIriAttributes = [
|
|
|
952
1106
|
'stroke'
|
|
953
1107
|
];
|
|
954
1108
|
var ɵ0 = function (attr) { return "[" + attr + "]"; };
|
|
955
|
-
/**
|
|
1109
|
+
/**
|
|
956
1110
|
* Selector that can be used to find all elements that are using a `FuncIRI`.
|
|
957
|
-
|
|
1111
|
+
* @type {?}
|
|
1112
|
+
*/
|
|
958
1113
|
var funcIriAttributeSelector = funcIriAttributes.map(ɵ0).join(', ');
|
|
959
|
-
/**
|
|
1114
|
+
/**
|
|
960
1115
|
* Regex that can be used to extract the id out of a FuncIRI.
|
|
961
|
-
|
|
1116
|
+
* @type {?}
|
|
1117
|
+
*/
|
|
962
1118
|
var funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
|
|
963
1119
|
/**
|
|
964
1120
|
* Component to display an icon. It can be used in the following ways:
|
|
@@ -989,11 +1145,7 @@ var funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
|
|
|
989
1145
|
*/
|
|
990
1146
|
var MatIcon = /** @class */ (function (_super) {
|
|
991
1147
|
__extends(MatIcon, _super);
|
|
992
|
-
function MatIcon(elementRef, _iconRegistry, ariaHidden,
|
|
993
|
-
* @deprecated `location` parameter to be made required.
|
|
994
|
-
* @breaking-change 8.0.0
|
|
995
|
-
*/
|
|
996
|
-
_location) {
|
|
1148
|
+
function MatIcon(elementRef, _iconRegistry, ariaHidden, _location) {
|
|
997
1149
|
var _this = _super.call(this, elementRef) || this;
|
|
998
1150
|
_this._iconRegistry = _iconRegistry;
|
|
999
1151
|
_this._location = _location;
|
|
@@ -1074,6 +1226,20 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1074
1226
|
* 'penguin' -> ['', 'penguin']
|
|
1075
1227
|
* null -> ['', '']
|
|
1076
1228
|
* 'a:b:c' -> (throws Error)`
|
|
1229
|
+
*/
|
|
1230
|
+
/**
|
|
1231
|
+
* Splits an svgIcon binding value into its icon set and icon name components.
|
|
1232
|
+
* Returns a 2-element array of [(icon set), (icon name)].
|
|
1233
|
+
* The separator for the two fields is ':'. If there is no separator, an empty
|
|
1234
|
+
* string is returned for the icon set and the entire value is returned for
|
|
1235
|
+
* the icon name. If the argument is falsy, returns an array of two empty strings.
|
|
1236
|
+
* Throws an error if the name contains two or more ':' separators.
|
|
1237
|
+
* Examples:
|
|
1238
|
+
* `'social:cake' -> ['social', 'cake']
|
|
1239
|
+
* 'penguin' -> ['', 'penguin']
|
|
1240
|
+
* null -> ['', '']
|
|
1241
|
+
* 'a:b:c' -> (throws Error)`
|
|
1242
|
+
* @private
|
|
1077
1243
|
* @param {?} iconName
|
|
1078
1244
|
* @return {?}
|
|
1079
1245
|
*/
|
|
@@ -1089,6 +1255,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1089
1255
|
* 'penguin' -> ['', 'penguin']
|
|
1090
1256
|
* null -> ['', '']
|
|
1091
1257
|
* 'a:b:c' -> (throws Error)`
|
|
1258
|
+
* @private
|
|
1092
1259
|
* @param {?} iconName
|
|
1093
1260
|
* @return {?}
|
|
1094
1261
|
*/
|
|
@@ -1100,7 +1267,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1100
1267
|
var parts = iconName.split(':');
|
|
1101
1268
|
switch (parts.length) {
|
|
1102
1269
|
case 1: return ['', parts[0]]; // Use default namespace.
|
|
1103
|
-
case 2: return /** @type {?} */ (parts);
|
|
1270
|
+
case 2: return (/** @type {?} */ (parts));
|
|
1104
1271
|
default: throw Error("Invalid icon name: \"" + iconName + "\"");
|
|
1105
1272
|
}
|
|
1106
1273
|
};
|
|
@@ -1115,7 +1282,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1115
1282
|
function (changes) {
|
|
1116
1283
|
var _this = this;
|
|
1117
1284
|
// Only update the inline SVG icon if the inputs changed, to avoid unnecessary DOM operations.
|
|
1118
|
-
if (changes
|
|
1285
|
+
if (changes.svgIcon) {
|
|
1119
1286
|
if (this.svgIcon) {
|
|
1120
1287
|
var _a = this._splitIconName(this.svgIcon), namespace = _a[0], iconName = _a[1];
|
|
1121
1288
|
this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(operators.take(1)).subscribe(function (svg) { return _this._setSvgElement(svg); }, function (err) { return console.log("Error retrieving icon: " + err.message); });
|
|
@@ -1177,26 +1344,33 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1177
1344
|
}
|
|
1178
1345
|
};
|
|
1179
1346
|
/**
|
|
1347
|
+
* @private
|
|
1180
1348
|
* @return {?}
|
|
1181
1349
|
*/
|
|
1182
1350
|
MatIcon.prototype._usingFontIcon = /**
|
|
1351
|
+
* @private
|
|
1183
1352
|
* @return {?}
|
|
1184
1353
|
*/
|
|
1185
1354
|
function () {
|
|
1186
1355
|
return !this.svgIcon;
|
|
1187
1356
|
};
|
|
1188
1357
|
/**
|
|
1358
|
+
* @private
|
|
1189
1359
|
* @param {?} svg
|
|
1190
1360
|
* @return {?}
|
|
1191
1361
|
*/
|
|
1192
1362
|
MatIcon.prototype._setSvgElement = /**
|
|
1363
|
+
* @private
|
|
1193
1364
|
* @param {?} svg
|
|
1194
1365
|
* @return {?}
|
|
1195
1366
|
*/
|
|
1196
1367
|
function (svg) {
|
|
1197
1368
|
this._clearSvgElement();
|
|
1369
|
+
// Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.
|
|
1370
|
+
// See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/
|
|
1371
|
+
// Do this before inserting the element into the DOM, in order to avoid a style recalculation.
|
|
1198
1372
|
/** @type {?} */
|
|
1199
|
-
var styleTags = /** @type {?} */ (svg.querySelectorAll('style'));
|
|
1373
|
+
var styleTags = (/** @type {?} */ (svg.querySelectorAll('style')));
|
|
1200
1374
|
for (var i = 0; i < styleTags.length; i++) {
|
|
1201
1375
|
styleTags[i].textContent += ' ';
|
|
1202
1376
|
}
|
|
@@ -1212,9 +1386,11 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1212
1386
|
this._elementRef.nativeElement.appendChild(svg);
|
|
1213
1387
|
};
|
|
1214
1388
|
/**
|
|
1389
|
+
* @private
|
|
1215
1390
|
* @return {?}
|
|
1216
1391
|
*/
|
|
1217
1392
|
MatIcon.prototype._clearSvgElement = /**
|
|
1393
|
+
* @private
|
|
1218
1394
|
* @return {?}
|
|
1219
1395
|
*/
|
|
1220
1396
|
function () {
|
|
@@ -1238,9 +1414,11 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1238
1414
|
}
|
|
1239
1415
|
};
|
|
1240
1416
|
/**
|
|
1417
|
+
* @private
|
|
1241
1418
|
* @return {?}
|
|
1242
1419
|
*/
|
|
1243
1420
|
MatIcon.prototype._updateFontIconClasses = /**
|
|
1421
|
+
* @private
|
|
1244
1422
|
* @return {?}
|
|
1245
1423
|
*/
|
|
1246
1424
|
function () {
|
|
@@ -1276,6 +1454,12 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1276
1454
|
* Cleans up a value to be used as a fontIcon or fontSet.
|
|
1277
1455
|
* Since the value ends up being assigned as a CSS class, we
|
|
1278
1456
|
* have to trim the value and omit space-separated values.
|
|
1457
|
+
*/
|
|
1458
|
+
/**
|
|
1459
|
+
* Cleans up a value to be used as a fontIcon or fontSet.
|
|
1460
|
+
* Since the value ends up being assigned as a CSS class, we
|
|
1461
|
+
* have to trim the value and omit space-separated values.
|
|
1462
|
+
* @private
|
|
1279
1463
|
* @param {?} value
|
|
1280
1464
|
* @return {?}
|
|
1281
1465
|
*/
|
|
@@ -1283,6 +1467,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1283
1467
|
* Cleans up a value to be used as a fontIcon or fontSet.
|
|
1284
1468
|
* Since the value ends up being assigned as a CSS class, we
|
|
1285
1469
|
* have to trim the value and omit space-separated values.
|
|
1470
|
+
* @private
|
|
1286
1471
|
* @param {?} value
|
|
1287
1472
|
* @return {?}
|
|
1288
1473
|
*/
|
|
@@ -1293,6 +1478,12 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1293
1478
|
* Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
|
|
1294
1479
|
* reference. This is required because WebKit browsers require references to be prefixed with
|
|
1295
1480
|
* the current path, if the page has a `base` tag.
|
|
1481
|
+
*/
|
|
1482
|
+
/**
|
|
1483
|
+
* Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
|
|
1484
|
+
* reference. This is required because WebKit browsers require references to be prefixed with
|
|
1485
|
+
* the current path, if the page has a `base` tag.
|
|
1486
|
+
* @private
|
|
1296
1487
|
* @param {?} path
|
|
1297
1488
|
* @return {?}
|
|
1298
1489
|
*/
|
|
@@ -1300,6 +1491,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1300
1491
|
* Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
|
|
1301
1492
|
* reference. This is required because WebKit browsers require references to be prefixed with
|
|
1302
1493
|
* the current path, if the page has a `base` tag.
|
|
1494
|
+
* @private
|
|
1303
1495
|
* @param {?} path
|
|
1304
1496
|
* @return {?}
|
|
1305
1497
|
*/
|
|
@@ -1317,12 +1509,18 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1317
1509
|
/**
|
|
1318
1510
|
* Caches the children of an SVG element that have `url()`
|
|
1319
1511
|
* references that we need to prefix with the current path.
|
|
1512
|
+
*/
|
|
1513
|
+
/**
|
|
1514
|
+
* Caches the children of an SVG element that have `url()`
|
|
1515
|
+
* references that we need to prefix with the current path.
|
|
1516
|
+
* @private
|
|
1320
1517
|
* @param {?} element
|
|
1321
1518
|
* @return {?}
|
|
1322
1519
|
*/
|
|
1323
1520
|
MatIcon.prototype._cacheChildrenWithExternalReferences = /**
|
|
1324
1521
|
* Caches the children of an SVG element that have `url()`
|
|
1325
1522
|
* references that we need to prefix with the current path.
|
|
1523
|
+
* @private
|
|
1326
1524
|
* @param {?} element
|
|
1327
1525
|
* @return {?}
|
|
1328
1526
|
*/
|
|
@@ -1346,8 +1544,8 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1346
1544
|
if (!attributes) {
|
|
1347
1545
|
attributes = [];
|
|
1348
1546
|
elements.set(elementWithReference, attributes);
|
|
1349
|
-
}
|
|
1350
|
-
((attributes)).push({ name: attr, value: match[1] });
|
|
1547
|
+
}
|
|
1548
|
+
(/** @type {?} */ (attributes)).push({ name: attr, value: match[1] });
|
|
1351
1549
|
}
|
|
1352
1550
|
});
|
|
1353
1551
|
};
|
|
@@ -1365,6 +1563,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1365
1563
|
'role': 'img',
|
|
1366
1564
|
'class': 'mat-icon',
|
|
1367
1565
|
'[class.mat-icon-inline]': 'inline',
|
|
1566
|
+
'[class.mat-icon-no-color]': 'color !== "primary" && color !== "accent" && color !== "warn"',
|
|
1368
1567
|
},
|
|
1369
1568
|
encapsulation: core.ViewEncapsulation.None,
|
|
1370
1569
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
@@ -1388,7 +1587,7 @@ var MatIcon = /** @class */ (function (_super) {
|
|
|
1388
1587
|
|
|
1389
1588
|
/**
|
|
1390
1589
|
* @fileoverview added by tsickle
|
|
1391
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1590
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1392
1591
|
*/
|
|
1393
1592
|
var MatIconModule = /** @class */ (function () {
|
|
1394
1593
|
function MatIconModule() {
|