@angular/material 7.1.0 → 7.2.2
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 +50 -19
- package/autocomplete/typings/index.d.ts +0 -1
- package/autocomplete/typings/index.metadata.json +1 -1
- package/autocomplete/typings/public-api.d.ts +1 -0
- package/badge/typings/index.metadata.json +1 -1
- package/bottom-sheet/typings/bottom-sheet-ref.d.ts +2 -0
- package/bottom-sheet/typings/index.metadata.json +1 -1
- package/bundles/material-autocomplete.umd.js +139 -39
- 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 +67 -22
- 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 +45 -14
- 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 +126 -38
- 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 +190 -127
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +1 -2
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +205 -42
- 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 +52 -26
- 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 +123 -34
- 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 +67 -16
- 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 +288 -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 +159 -26
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-list.umd.min.js +2 -2
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +176 -70
- 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 +25 -8
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-paginator.umd.min.js.map +1 -1
- package/bundles/material-progress-bar.umd.js +32 -13
- 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 +30 -14
- package/bundles/material-progress-spinner.umd.js.map +1 -1
- package/bundles/material-progress-spinner.umd.min.js +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 +186 -49
- 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 +31 -15
- 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 +88 -20
- 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 +69 -20
- 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 +29 -20
- 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 +48 -15
- package/bundles/material-table.umd.js.map +1 -1
- package/bundles/material-table.umd.min.js +1 -1
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +162 -61
- 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 +62 -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 +2927 -995
- package/bundles/material.umd.js.map +1 -1
- package/bundles/material.umd.min.js +18 -18
- 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 +2 -2
- 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/core/typings/ripple/ripple.d.ts +1 -1
- package/datepicker/typings/calendar.d.ts +2 -2
- package/datepicker/typings/index.metadata.json +1 -1
- package/dialog/typings/index.metadata.json +1 -1
- package/esm2015/autocomplete.js +73 -36
- 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 +44 -23
- package/esm2015/bottom-sheet.js.map +1 -1
- package/esm2015/button-toggle.js +27 -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 -30
- package/esm2015/chips.js.map +1 -1
- package/esm2015/core.js +147 -128
- package/esm2015/core.js.map +1 -1
- package/esm2015/datepicker.js +103 -37
- 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 +56 -29
- package/esm2015/expansion.js.map +1 -1
- package/esm2015/form-field.js +95 -35
- 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 +144 -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 +118 -24
- package/esm2015/list.js.map +1 -1
- package/esm2015/material.js +13 -12
- package/esm2015/material.js.map +1 -1
- package/esm2015/menu.js +114 -67
- package/esm2015/menu.js.map +1 -1
- package/esm2015/paginator.js +17 -9
- 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 +112 -50
- 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 +51 -23
- package/esm2015/slider.js.map +1 -1
- package/esm2015/snack-bar.js +38 -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 +32 -23
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +51 -18
- package/esm2015/table.js.map +1 -1
- package/esm2015/tabs.js +112 -49
- package/esm2015/tabs.js.map +1 -1
- package/esm2015/toolbar.js +9 -5
- package/esm2015/toolbar.js.map +1 -1
- package/esm2015/tooltip.js +49 -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 +141 -41
- 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 +68 -23
- package/esm5/bottom-sheet.es5.js.map +1 -1
- package/esm5/button-toggle.es5.js +46 -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 +129 -41
- 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 +207 -44
- 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 +54 -29
- package/esm5/expansion.es5.js.map +1 -1
- package/esm5/form-field.es5.js +126 -37
- 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 +290 -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 +161 -27
- 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 +175 -69
- package/esm5/menu.es5.js.map +1 -1
- package/esm5/paginator.es5.js +27 -10
- 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 +189 -52
- 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 +91 -23
- package/esm5/slider.es5.js.map +1 -1
- package/esm5/snack-bar.es5.js +70 -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 +32 -23
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +51 -18
- package/esm5/table.es5.js.map +1 -1
- package/esm5/tabs.es5.js +156 -55
- 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 +64 -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/form-field/typings/prefix.d.ts +1 -1
- package/grid-list/typings/index.d.ts +1 -1
- package/grid-list/typings/index.metadata.json +1 -1
- package/icon/typings/icon-registry.d.ts +3 -2
- package/icon/typings/index.metadata.json +1 -1
- package/list/typings/index.metadata.json +1 -1
- package/list/typings/list.d.ts +16 -5
- package/list/typings/selection-list.d.ts +1 -0
- 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/menu/typings/menu-trigger.d.ts +1 -1
- package/package.json +5 -5
- 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/table/typings/index.metadata.json +1 -1
- package/table/typings/table-data-source.d.ts +2 -0
- package/tabs/typings/index.d.ts +5 -5
- package/tabs/typings/index.metadata.json +1 -1
- package/tabs/typings/tab-group.d.ts +2 -1
- package/tabs/typings/tab-header.d.ts +8 -4
- package/toolbar/typings/index.metadata.json +1 -1
- package/tooltip/typings/index.metadata.json +1 -1
- package/tooltip/typings/tooltip.d.ts +2 -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 +0 -1
- package/typings/autocomplete/index.metadata.json +1 -1
- package/typings/autocomplete/public-api.d.ts +1 -0
- package/typings/badge/index.metadata.json +1 -1
- package/typings/bottom-sheet/bottom-sheet-ref.d.ts +2 -0
- 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 +2 -2
- 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/core/ripple/ripple.d.ts +1 -1
- package/typings/datepicker/calendar.d.ts +2 -2
- package/typings/datepicker/index.metadata.json +1 -1
- package/typings/dialog/index.metadata.json +1 -1
- package/typings/esm5/autocomplete/index.d.ts +0 -1
- package/typings/esm5/autocomplete/index.metadata.json +1 -1
- package/typings/esm5/autocomplete/public-api.d.ts +1 -0
- package/typings/esm5/badge/index.metadata.json +1 -1
- package/typings/esm5/bottom-sheet/bottom-sheet-ref.d.ts +2 -0
- 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 +2 -2
- 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/core/ripple/ripple.d.ts +1 -1
- package/typings/esm5/datepicker/calendar.d.ts +2 -2
- package/typings/esm5/datepicker/index.metadata.json +1 -1
- 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/form-field/prefix.d.ts +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/icon-registry.d.ts +3 -2
- 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/list/list.d.ts +16 -5
- package/typings/esm5/list/selection-list.d.ts +1 -0
- 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/menu/menu-trigger.d.ts +1 -1
- 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/table/index.metadata.json +1 -1
- package/typings/esm5/table/table-data-source.d.ts +2 -0
- package/typings/esm5/tabs/index.d.ts +5 -5
- package/typings/esm5/tabs/index.metadata.json +1 -1
- package/typings/esm5/tabs/tab-group.d.ts +2 -1
- package/typings/esm5/tabs/tab-header.d.ts +8 -4
- package/typings/esm5/toolbar/index.metadata.json +1 -1
- package/typings/esm5/tooltip/index.metadata.json +1 -1
- package/typings/esm5/tooltip/tooltip.d.ts +2 -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/form-field/prefix.d.ts +1 -1
- package/typings/grid-list/index.d.ts +1 -1
- package/typings/grid-list/index.metadata.json +1 -1
- package/typings/icon/icon-registry.d.ts +3 -2
- 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/list/list.d.ts +16 -5
- package/typings/list/selection-list.d.ts +1 -0
- 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/menu/menu-trigger.d.ts +1 -1
- 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/table/index.metadata.json +1 -1
- package/typings/table/table-data-source.d.ts +2 -0
- package/typings/tabs/index.d.ts +5 -5
- package/typings/tabs/index.metadata.json +1 -1
- package/typings/tabs/tab-group.d.ts +2 -1
- package/typings/tabs/tab-header.d.ts +8 -4
- package/typings/toolbar/index.metadata.json +1 -1
- package/typings/tooltip/index.metadata.json +1 -1
- package/typings/tooltip/tooltip.d.ts +2 -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) {
|
|
@@ -296,8 +318,17 @@ class MatIconRegistry {
|
|
|
296
318
|
}
|
|
297
319
|
return throwError(getMatIconNameNotFoundError(key));
|
|
298
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* @return {?}
|
|
323
|
+
*/
|
|
324
|
+
ngOnDestroy() {
|
|
325
|
+
this._svgIconConfigs.clear();
|
|
326
|
+
this._iconSetConfigs.clear();
|
|
327
|
+
this._cachedIconsByUrl.clear();
|
|
328
|
+
}
|
|
299
329
|
/**
|
|
300
330
|
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
|
|
331
|
+
* @private
|
|
301
332
|
* @param {?} config
|
|
302
333
|
* @return {?}
|
|
303
334
|
*/
|
|
@@ -318,11 +349,14 @@ class MatIconRegistry {
|
|
|
318
349
|
* that have not been cached, and searches again after all fetches are completed.
|
|
319
350
|
* The returned Observable produces the SVG element if possible, and throws
|
|
320
351
|
* an error if no icon with the specified name can be found.
|
|
352
|
+
* @private
|
|
321
353
|
* @param {?} name
|
|
322
354
|
* @param {?} iconSetConfigs
|
|
323
355
|
* @return {?}
|
|
324
356
|
*/
|
|
325
357
|
_getSvgFromIconSetConfigs(name, iconSetConfigs) {
|
|
358
|
+
// For all the icon set SVG elements we've fetched, see if any contain an icon with the
|
|
359
|
+
// requested name.
|
|
326
360
|
/** @type {?} */
|
|
327
361
|
const namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
|
|
328
362
|
if (namedIcon) {
|
|
@@ -331,6 +365,8 @@ class MatIconRegistry {
|
|
|
331
365
|
// it from the icon set.
|
|
332
366
|
return of(namedIcon);
|
|
333
367
|
}
|
|
368
|
+
// Not found in any cached icon sets. If there are icon sets with URLs that we haven't
|
|
369
|
+
// fetched, fetch them now and look for iconName in the results.
|
|
334
370
|
/** @type {?} */
|
|
335
371
|
const iconSetFetchRequests = iconSetConfigs
|
|
336
372
|
.filter(iconSetConfig => !iconSetConfig.svgElement)
|
|
@@ -359,6 +395,7 @@ class MatIconRegistry {
|
|
|
359
395
|
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
|
|
360
396
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
361
397
|
* returns it. Returns null if no matching element is found.
|
|
398
|
+
* @private
|
|
362
399
|
* @param {?} iconName
|
|
363
400
|
* @param {?} iconSetConfigs
|
|
364
401
|
* @return {?}
|
|
@@ -381,6 +418,7 @@ class MatIconRegistry {
|
|
|
381
418
|
/**
|
|
382
419
|
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
|
|
383
420
|
* from it.
|
|
421
|
+
* @private
|
|
384
422
|
* @param {?} config
|
|
385
423
|
* @return {?}
|
|
386
424
|
*/
|
|
@@ -391,6 +429,7 @@ class MatIconRegistry {
|
|
|
391
429
|
/**
|
|
392
430
|
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
|
|
393
431
|
* from it.
|
|
432
|
+
* @private
|
|
394
433
|
* @param {?} config
|
|
395
434
|
* @return {?}
|
|
396
435
|
*/
|
|
@@ -410,6 +449,7 @@ class MatIconRegistry {
|
|
|
410
449
|
}
|
|
411
450
|
/**
|
|
412
451
|
* Creates a DOM element from the given SVG string, and adds default attributes.
|
|
452
|
+
* @private
|
|
413
453
|
* @param {?} responseText
|
|
414
454
|
* @return {?}
|
|
415
455
|
*/
|
|
@@ -423,6 +463,7 @@ class MatIconRegistry {
|
|
|
423
463
|
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
|
|
424
464
|
* tag matches the specified name. If found, copies the nested element to a new SVG element and
|
|
425
465
|
* returns it. Returns null if no matching element is found.
|
|
466
|
+
* @private
|
|
426
467
|
* @param {?} iconSet
|
|
427
468
|
* @param {?} iconName
|
|
428
469
|
* @return {?}
|
|
@@ -433,13 +474,15 @@ class MatIconRegistry {
|
|
|
433
474
|
if (!iconSource) {
|
|
434
475
|
return null;
|
|
435
476
|
}
|
|
477
|
+
// Clone the element and remove the ID to prevent multiple elements from being added
|
|
478
|
+
// to the page with the same ID.
|
|
436
479
|
/** @type {?} */
|
|
437
|
-
const iconElement = /** @type {?} */ (iconSource.cloneNode(true));
|
|
480
|
+
const iconElement = (/** @type {?} */ (iconSource.cloneNode(true)));
|
|
438
481
|
iconElement.removeAttribute('id');
|
|
439
482
|
// If the icon node is itself an <svg> node, clone and return it directly. If not, set it as
|
|
440
483
|
// the content of a new <svg> node.
|
|
441
484
|
if (iconElement.nodeName.toLowerCase() === 'svg') {
|
|
442
|
-
return this._setSvgAttributes(/** @type {?} */ (iconElement));
|
|
485
|
+
return this._setSvgAttributes((/** @type {?} */ (iconElement)));
|
|
443
486
|
}
|
|
444
487
|
// If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note
|
|
445
488
|
// that the same could be achieved by referring to it via <use href="#id">, however the <use>
|
|
@@ -447,6 +490,11 @@ class MatIconRegistry {
|
|
|
447
490
|
if (iconElement.nodeName.toLowerCase() === 'symbol') {
|
|
448
491
|
return this._setSvgAttributes(this._toSvgElement(iconElement));
|
|
449
492
|
}
|
|
493
|
+
// createElement('SVG') doesn't work as expected; the DOM ends up with
|
|
494
|
+
// the correct nodes, but the SVG content doesn't render. Instead we
|
|
495
|
+
// have to create an empty SVG node using innerHTML and append its content.
|
|
496
|
+
// Elements created using DOMParser.parseFromString have the same problem.
|
|
497
|
+
// http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display
|
|
450
498
|
/** @type {?} */
|
|
451
499
|
const svg = this._svgElementFromString('<svg></svg>');
|
|
452
500
|
// Clone the node so we don't remove it from the parent icon set element.
|
|
@@ -455,6 +503,7 @@ class MatIconRegistry {
|
|
|
455
503
|
}
|
|
456
504
|
/**
|
|
457
505
|
* Creates a DOM element from the given SVG string.
|
|
506
|
+
* @private
|
|
458
507
|
* @param {?} str
|
|
459
508
|
* @return {?}
|
|
460
509
|
*/
|
|
@@ -463,7 +512,7 @@ class MatIconRegistry {
|
|
|
463
512
|
const div = this._document.createElement('DIV');
|
|
464
513
|
div.innerHTML = str;
|
|
465
514
|
/** @type {?} */
|
|
466
|
-
const svg = /** @type {?} */ (div.querySelector('svg'));
|
|
515
|
+
const svg = (/** @type {?} */ (div.querySelector('svg')));
|
|
467
516
|
if (!svg) {
|
|
468
517
|
throw Error('<svg> tag not found');
|
|
469
518
|
}
|
|
@@ -471,6 +520,7 @@ class MatIconRegistry {
|
|
|
471
520
|
}
|
|
472
521
|
/**
|
|
473
522
|
* Converts an element into an SVG node by cloning all of its children.
|
|
523
|
+
* @private
|
|
474
524
|
* @param {?} element
|
|
475
525
|
* @return {?}
|
|
476
526
|
*/
|
|
@@ -486,6 +536,7 @@ class MatIconRegistry {
|
|
|
486
536
|
}
|
|
487
537
|
/**
|
|
488
538
|
* Sets the default attributes for an SVG element to be used as an icon.
|
|
539
|
+
* @private
|
|
489
540
|
* @param {?} svg
|
|
490
541
|
* @return {?}
|
|
491
542
|
*/
|
|
@@ -500,6 +551,7 @@ class MatIconRegistry {
|
|
|
500
551
|
/**
|
|
501
552
|
* Returns an Observable which produces the string contents of the given URL. Results may be
|
|
502
553
|
* cached, so future calls with the same URL may not cause another HTTP request.
|
|
554
|
+
* @private
|
|
503
555
|
* @param {?} safeUrl
|
|
504
556
|
* @return {?}
|
|
505
557
|
*/
|
|
@@ -515,11 +567,16 @@ class MatIconRegistry {
|
|
|
515
567
|
if (!url) {
|
|
516
568
|
throw getMatIconFailedToSanitizeUrlError(safeUrl);
|
|
517
569
|
}
|
|
570
|
+
// Store in-progress fetches to avoid sending a duplicate request for a URL when there is
|
|
571
|
+
// already a request in progress for that URL. It's necessary to call share() on the
|
|
572
|
+
// Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.
|
|
518
573
|
/** @type {?} */
|
|
519
574
|
const inProgressFetch = this._inProgressUrlFetches.get(url);
|
|
520
575
|
if (inProgressFetch) {
|
|
521
576
|
return inProgressFetch;
|
|
522
577
|
}
|
|
578
|
+
// TODO(jelbourn): for some reason, the `finalize` operator "loses" the generic type on the
|
|
579
|
+
// Observable. Figure out why and fix it.
|
|
523
580
|
/** @type {?} */
|
|
524
581
|
const req = this._httpClient.get(url, { responseType: 'text' }).pipe(finalize(() => this._inProgressUrlFetches.delete(url)), share());
|
|
525
582
|
this._inProgressUrlFetches.set(url, req);
|
|
@@ -527,31 +584,37 @@ class MatIconRegistry {
|
|
|
527
584
|
}
|
|
528
585
|
/**
|
|
529
586
|
* Registers an icon config by name in the specified namespace.
|
|
587
|
+
* @private
|
|
588
|
+
* @template THIS
|
|
589
|
+
* @this {THIS}
|
|
530
590
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
531
591
|
* @param {?} iconName Name under which to register the config.
|
|
532
592
|
* @param {?} config Config to be registered.
|
|
533
|
-
* @return {
|
|
593
|
+
* @return {THIS}
|
|
534
594
|
*/
|
|
535
595
|
_addSvgIconConfig(namespace, iconName, config) {
|
|
536
|
-
this._svgIconConfigs.set(iconKey(namespace, iconName), config);
|
|
537
|
-
return this;
|
|
596
|
+
(/** @type {?} */ (this))._svgIconConfigs.set(iconKey(namespace, iconName), config);
|
|
597
|
+
return (/** @type {?} */ (this));
|
|
538
598
|
}
|
|
539
599
|
/**
|
|
540
600
|
* Registers an icon set config in the specified namespace.
|
|
601
|
+
* @private
|
|
602
|
+
* @template THIS
|
|
603
|
+
* @this {THIS}
|
|
541
604
|
* @param {?} namespace Namespace in which to register the icon config.
|
|
542
605
|
* @param {?} config Config to be registered.
|
|
543
|
-
* @return {
|
|
606
|
+
* @return {THIS}
|
|
544
607
|
*/
|
|
545
608
|
_addSvgIconSetConfig(namespace, config) {
|
|
546
609
|
/** @type {?} */
|
|
547
|
-
const configNamespace = this._iconSetConfigs.get(namespace);
|
|
610
|
+
const configNamespace = (/** @type {?} */ (this))._iconSetConfigs.get(namespace);
|
|
548
611
|
if (configNamespace) {
|
|
549
612
|
configNamespace.push(config);
|
|
550
613
|
}
|
|
551
614
|
else {
|
|
552
|
-
this._iconSetConfigs.set(namespace, [config]);
|
|
615
|
+
(/** @type {?} */ (this))._iconSetConfigs.set(namespace, [config]);
|
|
553
616
|
}
|
|
554
|
-
return this;
|
|
617
|
+
return (/** @type {?} */ (this));
|
|
555
618
|
}
|
|
556
619
|
}
|
|
557
620
|
MatIconRegistry.decorators = [
|
|
@@ -575,9 +638,10 @@ MatIconRegistry.ctorParameters = () => [
|
|
|
575
638
|
function ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, httpClient, sanitizer, document) {
|
|
576
639
|
return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document);
|
|
577
640
|
}
|
|
578
|
-
/**
|
|
641
|
+
/**
|
|
579
642
|
* \@docs-private
|
|
580
|
-
|
|
643
|
+
* @type {?}
|
|
644
|
+
*/
|
|
581
645
|
const ICON_REGISTRY_PROVIDER = {
|
|
582
646
|
// If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.
|
|
583
647
|
provide: MatIconRegistry,
|
|
@@ -585,7 +649,7 @@ const ICON_REGISTRY_PROVIDER = {
|
|
|
585
649
|
[new Optional(), new SkipSelf(), MatIconRegistry],
|
|
586
650
|
[new Optional(), HttpClient],
|
|
587
651
|
DomSanitizer,
|
|
588
|
-
[new Optional(), /** @type {?} */ (DOCUMENT)],
|
|
652
|
+
[new Optional(), (/** @type {?} */ (DOCUMENT))],
|
|
589
653
|
],
|
|
590
654
|
useFactory: ICON_REGISTRY_PROVIDER_FACTORY,
|
|
591
655
|
};
|
|
@@ -595,7 +659,7 @@ const ICON_REGISTRY_PROVIDER = {
|
|
|
595
659
|
* @return {?}
|
|
596
660
|
*/
|
|
597
661
|
function cloneSvg(svg) {
|
|
598
|
-
return /** @type {?} */ (svg.cloneNode(true));
|
|
662
|
+
return (/** @type {?} */ (svg.cloneNode(true)));
|
|
599
663
|
}
|
|
600
664
|
/**
|
|
601
665
|
* Returns the cache key to use for an icon namespace and name.
|
|
@@ -609,8 +673,9 @@ function iconKey(namespace, name) {
|
|
|
609
673
|
|
|
610
674
|
/**
|
|
611
675
|
* @fileoverview added by tsickle
|
|
612
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
676
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
613
677
|
*/
|
|
678
|
+
// Boilerplate for applying mixins to MatIcon.
|
|
614
679
|
/**
|
|
615
680
|
* \@docs-private
|
|
616
681
|
*/
|
|
@@ -624,11 +689,12 @@ class MatIconBase {
|
|
|
624
689
|
}
|
|
625
690
|
/** @type {?} */
|
|
626
691
|
const _MatIconMixinBase = mixinColor(MatIconBase);
|
|
627
|
-
/**
|
|
692
|
+
/**
|
|
628
693
|
* Injection token used to provide the current location to `MatIcon`.
|
|
629
694
|
* Used to handle server-side rendering and to stub out during unit tests.
|
|
630
695
|
* \@docs-private
|
|
631
|
-
|
|
696
|
+
* @type {?}
|
|
697
|
+
*/
|
|
632
698
|
const MAT_ICON_LOCATION = new InjectionToken('mat-icon-location', {
|
|
633
699
|
providedIn: 'root',
|
|
634
700
|
factory: MAT_ICON_LOCATION_FACTORY
|
|
@@ -648,9 +714,10 @@ function MAT_ICON_LOCATION_FACTORY() {
|
|
|
648
714
|
getPathname: () => _location ? (_location.pathname + _location.search) : ''
|
|
649
715
|
};
|
|
650
716
|
}
|
|
651
|
-
/**
|
|
717
|
+
/**
|
|
652
718
|
* SVG attributes that accept a FuncIRI (e.g. `url(<something>)`).
|
|
653
|
-
|
|
719
|
+
* @type {?}
|
|
720
|
+
*/
|
|
654
721
|
const funcIriAttributes = [
|
|
655
722
|
'clip-path',
|
|
656
723
|
'color-profile',
|
|
@@ -666,13 +733,15 @@ const funcIriAttributes = [
|
|
|
666
733
|
'stroke'
|
|
667
734
|
];
|
|
668
735
|
const ɵ0 = attr => `[${attr}]`;
|
|
669
|
-
/**
|
|
736
|
+
/**
|
|
670
737
|
* Selector that can be used to find all elements that are using a `FuncIRI`.
|
|
671
|
-
|
|
738
|
+
* @type {?}
|
|
739
|
+
*/
|
|
672
740
|
const funcIriAttributeSelector = funcIriAttributes.map(ɵ0).join(', ');
|
|
673
|
-
/**
|
|
741
|
+
/**
|
|
674
742
|
* Regex that can be used to extract the id out of a FuncIRI.
|
|
675
|
-
|
|
743
|
+
* @type {?}
|
|
744
|
+
*/
|
|
676
745
|
const funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
|
|
677
746
|
/**
|
|
678
747
|
* Component to display an icon. It can be used in the following ways:
|
|
@@ -708,11 +777,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
708
777
|
* @param {?} ariaHidden
|
|
709
778
|
* @param {?=} _location
|
|
710
779
|
*/
|
|
711
|
-
constructor(elementRef, _iconRegistry, ariaHidden,
|
|
712
|
-
* @deprecated `location` parameter to be made required.
|
|
713
|
-
* @breaking-change 8.0.0
|
|
714
|
-
*/
|
|
715
|
-
_location) {
|
|
780
|
+
constructor(elementRef, _iconRegistry, ariaHidden, _location) {
|
|
716
781
|
super(elementRef);
|
|
717
782
|
this._iconRegistry = _iconRegistry;
|
|
718
783
|
this._location = _location;
|
|
@@ -774,6 +839,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
774
839
|
* 'penguin' -> ['', 'penguin']
|
|
775
840
|
* null -> ['', '']
|
|
776
841
|
* 'a:b:c' -> (throws Error)`
|
|
842
|
+
* @private
|
|
777
843
|
* @param {?} iconName
|
|
778
844
|
* @return {?}
|
|
779
845
|
*/
|
|
@@ -785,7 +851,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
785
851
|
const parts = iconName.split(':');
|
|
786
852
|
switch (parts.length) {
|
|
787
853
|
case 1: return ['', parts[0]]; // Use default namespace.
|
|
788
|
-
case 2: return /** @type {?} */ (parts);
|
|
854
|
+
case 2: return (/** @type {?} */ (parts));
|
|
789
855
|
default: throw Error(`Invalid icon name: "${iconName}"`);
|
|
790
856
|
}
|
|
791
857
|
}
|
|
@@ -795,7 +861,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
795
861
|
*/
|
|
796
862
|
ngOnChanges(changes) {
|
|
797
863
|
// Only update the inline SVG icon if the inputs changed, to avoid unnecessary DOM operations.
|
|
798
|
-
if (changes
|
|
864
|
+
if (changes.svgIcon) {
|
|
799
865
|
if (this.svgIcon) {
|
|
800
866
|
const [namespace, iconName] = this._splitIconName(this.svgIcon);
|
|
801
867
|
this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(take(1)).subscribe(svg => this._setSvgElement(svg), (err) => console.log(`Error retrieving icon: ${err.message}`));
|
|
@@ -848,19 +914,24 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
848
914
|
}
|
|
849
915
|
}
|
|
850
916
|
/**
|
|
917
|
+
* @private
|
|
851
918
|
* @return {?}
|
|
852
919
|
*/
|
|
853
920
|
_usingFontIcon() {
|
|
854
921
|
return !this.svgIcon;
|
|
855
922
|
}
|
|
856
923
|
/**
|
|
924
|
+
* @private
|
|
857
925
|
* @param {?} svg
|
|
858
926
|
* @return {?}
|
|
859
927
|
*/
|
|
860
928
|
_setSvgElement(svg) {
|
|
861
929
|
this._clearSvgElement();
|
|
930
|
+
// Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.
|
|
931
|
+
// See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/
|
|
932
|
+
// Do this before inserting the element into the DOM, in order to avoid a style recalculation.
|
|
862
933
|
/** @type {?} */
|
|
863
|
-
const styleTags = /** @type {?} */ (svg.querySelectorAll('style'));
|
|
934
|
+
const styleTags = (/** @type {?} */ (svg.querySelectorAll('style')));
|
|
864
935
|
for (let i = 0; i < styleTags.length; i++) {
|
|
865
936
|
styleTags[i].textContent += ' ';
|
|
866
937
|
}
|
|
@@ -876,6 +947,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
876
947
|
this._elementRef.nativeElement.appendChild(svg);
|
|
877
948
|
}
|
|
878
949
|
/**
|
|
950
|
+
* @private
|
|
879
951
|
* @return {?}
|
|
880
952
|
*/
|
|
881
953
|
_clearSvgElement() {
|
|
@@ -899,6 +971,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
899
971
|
}
|
|
900
972
|
}
|
|
901
973
|
/**
|
|
974
|
+
* @private
|
|
902
975
|
* @return {?}
|
|
903
976
|
*/
|
|
904
977
|
_updateFontIconClasses() {
|
|
@@ -934,6 +1007,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
934
1007
|
* Cleans up a value to be used as a fontIcon or fontSet.
|
|
935
1008
|
* Since the value ends up being assigned as a CSS class, we
|
|
936
1009
|
* have to trim the value and omit space-separated values.
|
|
1010
|
+
* @private
|
|
937
1011
|
* @param {?} value
|
|
938
1012
|
* @return {?}
|
|
939
1013
|
*/
|
|
@@ -944,6 +1018,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
944
1018
|
* Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
|
|
945
1019
|
* reference. This is required because WebKit browsers require references to be prefixed with
|
|
946
1020
|
* the current path, if the page has a `base` tag.
|
|
1021
|
+
* @private
|
|
947
1022
|
* @param {?} path
|
|
948
1023
|
* @return {?}
|
|
949
1024
|
*/
|
|
@@ -961,6 +1036,7 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
961
1036
|
/**
|
|
962
1037
|
* Caches the children of an SVG element that have `url()`
|
|
963
1038
|
* references that we need to prefix with the current path.
|
|
1039
|
+
* @private
|
|
964
1040
|
* @param {?} element
|
|
965
1041
|
* @return {?}
|
|
966
1042
|
*/
|
|
@@ -984,8 +1060,8 @@ class MatIcon extends _MatIconMixinBase {
|
|
|
984
1060
|
if (!attributes) {
|
|
985
1061
|
attributes = [];
|
|
986
1062
|
elements.set(elementWithReference, attributes);
|
|
987
|
-
}
|
|
988
|
-
((attributes)).push({ name: attr, value: match[1] });
|
|
1063
|
+
}
|
|
1064
|
+
(/** @type {?} */ (attributes)).push({ name: attr, value: match[1] });
|
|
989
1065
|
}
|
|
990
1066
|
});
|
|
991
1067
|
}
|
|
@@ -1001,6 +1077,7 @@ MatIcon.decorators = [
|
|
|
1001
1077
|
'role': 'img',
|
|
1002
1078
|
'class': 'mat-icon',
|
|
1003
1079
|
'[class.mat-icon-inline]': 'inline',
|
|
1080
|
+
'[class.mat-icon-no-color]': 'color !== "primary" && color !== "accent" && color !== "warn"',
|
|
1004
1081
|
},
|
|
1005
1082
|
encapsulation: ViewEncapsulation.None,
|
|
1006
1083
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1022,7 +1099,7 @@ MatIcon.propDecorators = {
|
|
|
1022
1099
|
|
|
1023
1100
|
/**
|
|
1024
1101
|
* @fileoverview added by tsickle
|
|
1025
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1102
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1026
1103
|
*/
|
|
1027
1104
|
class MatIconModule {
|
|
1028
1105
|
}
|
|
@@ -1036,12 +1113,12 @@ MatIconModule.decorators = [
|
|
|
1036
1113
|
|
|
1037
1114
|
/**
|
|
1038
1115
|
* @fileoverview added by tsickle
|
|
1039
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1116
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1040
1117
|
*/
|
|
1041
1118
|
|
|
1042
1119
|
/**
|
|
1043
1120
|
* @fileoverview added by tsickle
|
|
1044
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1121
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1045
1122
|
*/
|
|
1046
1123
|
|
|
1047
1124
|
export { MatIconModule, MAT_ICON_LOCATION_FACTORY, MatIconBase, _MatIconMixinBase, MAT_ICON_LOCATION, MatIcon, getMatIconNameNotFoundError, getMatIconNoHttpProviderError, getMatIconFailedToSanitizeUrlError, getMatIconFailedToSanitizeLiteralError, ICON_REGISTRY_PROVIDER_FACTORY, MatIconRegistry, ICON_REGISTRY_PROVIDER };
|