@angular/material 10.0.0-rc.3 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_theming.scss +17 -17
- package/autocomplete/index.metadata.json +1 -1
- package/autocomplete/testing/autocomplete-harness.d.ts +2 -0
- package/bundles/material-autocomplete-testing.umd.js +11 -0
- package/bundles/material-autocomplete-testing.umd.js.map +1 -1
- package/bundles/material-autocomplete-testing.umd.min.js +2 -2
- package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
- package/bundles/material-autocomplete.umd.js +3 -1
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +5 -5
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-badge-testing.umd.min.js +1 -1
- package/bundles/material-badge-testing.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
- package/bundles/material-button-testing.umd.js +11 -0
- package/bundles/material-button-testing.umd.js.map +1 -1
- package/bundles/material-button-testing.umd.min.js +2 -2
- package/bundles/material-button-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.js +11 -0
- package/bundles/material-button-toggle-testing.umd.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.min.js +3 -3
- package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle.umd.js +12 -3
- package/bundles/material-button-toggle.umd.js.map +1 -1
- package/bundles/material-button-toggle.umd.min.js +2 -2
- package/bundles/material-button-toggle.umd.min.js.map +1 -1
- package/bundles/material-button.umd.js +7 -2
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-button.umd.min.js +4 -4
- package/bundles/material-button.umd.min.js.map +1 -1
- package/bundles/material-card-testing.umd.js +335 -0
- package/bundles/material-card-testing.umd.js.map +1 -0
- package/bundles/material-card-testing.umd.min.js +44 -0
- package/bundles/material-card-testing.umd.min.js.map +1 -0
- package/bundles/material-checkbox-testing.umd.js +11 -0
- package/bundles/material-checkbox-testing.umd.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.min.js +3 -3
- package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-chips.umd.js +36 -12
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-chips.umd.min.js +4 -4
- package/bundles/material-chips.umd.min.js.map +1 -1
- package/bundles/material-core-testing.umd.min.js +1 -1
- package/bundles/material-core-testing.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +11 -3
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +11 -11
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +20 -11
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +5 -5
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-dialog-testing.umd.min.js +1 -1
- package/bundles/material-dialog-testing.umd.min.js.map +1 -1
- package/bundles/material-dialog.umd.js +45 -8
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-dialog.umd.min.js +14 -7
- package/bundles/material-dialog.umd.min.js.map +1 -1
- package/bundles/material-divider-testing.umd.min.js +1 -1
- package/bundles/material-divider-testing.umd.min.js.map +1 -1
- package/bundles/material-expansion-testing.umd.js +11 -0
- package/bundles/material-expansion-testing.umd.js.map +1 -1
- package/bundles/material-expansion-testing.umd.min.js +3 -3
- package/bundles/material-expansion-testing.umd.min.js.map +1 -1
- package/bundles/material-form-field-testing.umd.js +32 -0
- package/bundles/material-form-field-testing.umd.js.map +1 -1
- package/bundles/material-form-field-testing.umd.min.js +4 -4
- package/bundles/material-form-field-testing.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +47 -21
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +5 -5
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.min.js +1 -1
- package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
- package/bundles/material-grid-list.umd.js +2 -2
- package/bundles/material-grid-list.umd.js.map +1 -1
- package/bundles/material-grid-list.umd.min.js +2 -2
- package/bundles/material-grid-list.umd.min.js.map +1 -1
- package/bundles/material-input-testing.umd.js +23 -6
- package/bundles/material-input-testing.umd.js.map +1 -1
- package/bundles/material-input-testing.umd.min.js +3 -3
- package/bundles/material-input-testing.umd.min.js.map +1 -1
- package/bundles/material-input.umd.js +28 -3
- package/bundles/material-input.umd.js.map +1 -1
- package/bundles/material-input.umd.min.js +3 -3
- package/bundles/material-input.umd.min.js.map +1 -1
- package/bundles/material-list-testing.umd.js +33 -0
- package/bundles/material-list-testing.umd.js.map +1 -1
- package/bundles/material-list-testing.umd.min.js +2 -2
- package/bundles/material-list-testing.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +3 -3
- package/bundles/material-list.umd.min.js +1 -1
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu-testing.umd.js +22 -0
- package/bundles/material-menu-testing.umd.js.map +1 -1
- package/bundles/material-menu-testing.umd.min.js +2 -2
- package/bundles/material-menu-testing.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +13 -2
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-menu.umd.min.js +4 -4
- package/bundles/material-menu.umd.min.js.map +1 -1
- package/bundles/material-paginator-testing.umd.min.js +1 -1
- package/bundles/material-paginator-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.js +1 -1
- package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.min.js +2 -2
- package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +2 -2
- package/bundles/material-progress-spinner.umd.min.js +3 -3
- package/bundles/material-progress-spinner.umd.min.js.map +1 -1
- package/bundles/material-radio-testing.umd.js +11 -0
- package/bundles/material-radio-testing.umd.js.map +1 -1
- package/bundles/material-radio-testing.umd.min.js +3 -3
- package/bundles/material-radio-testing.umd.min.js.map +1 -1
- package/bundles/material-radio.umd.js +15 -5
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-radio.umd.min.js +2 -2
- package/bundles/material-radio.umd.min.js.map +1 -1
- package/bundles/material-select-testing.umd.js +11 -0
- package/bundles/material-select-testing.umd.js.map +1 -1
- package/bundles/material-select-testing.umd.min.js +2 -2
- package/bundles/material-select-testing.umd.min.js.map +1 -1
- package/bundles/material-select.umd.js +11 -3
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-select.umd.min.js +4 -4
- package/bundles/material-select.umd.min.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.min.js +1 -1
- package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
- package/bundles/material-sidenav.umd.js +41 -17
- package/bundles/material-sidenav.umd.js.map +1 -1
- package/bundles/material-sidenav.umd.min.js +2 -2
- package/bundles/material-sidenav.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.js +11 -0
- package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.min.js +2 -2
- package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.js +11 -0
- package/bundles/material-slider-testing.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.min.js +2 -2
- package/bundles/material-slider-testing.umd.min.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.min.js +1 -1
- package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +47 -39
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +2 -2
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-sort-testing.umd.js +10 -10
- package/bundles/material-sort-testing.umd.js.map +1 -1
- package/bundles/material-sort-testing.umd.min.js +3 -3
- package/bundles/material-sort-testing.umd.min.js.map +1 -1
- package/bundles/material-sort.umd.js +25 -12
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-sort.umd.min.js +5 -5
- package/bundles/material-sort.umd.min.js.map +1 -1
- package/bundles/material-table-testing.umd.min.js +1 -1
- package/bundles/material-table-testing.umd.min.js.map +1 -1
- package/bundles/material-table.umd.min.js +2 -2
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs-testing.umd.min.js +1 -1
- package/bundles/material-tabs-testing.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +23 -4
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +5 -12
- package/bundles/material-tabs.umd.min.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.js +330 -0
- package/bundles/material-toolbar-testing.umd.js.map +1 -0
- package/bundles/material-toolbar-testing.umd.min.js +44 -0
- package/bundles/material-toolbar-testing.umd.min.js.map +1 -0
- package/bundles/material-tooltip-testing.umd.min.js +1 -1
- package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
- package/bundles/material-tooltip.umd.js +14 -1
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.min.js +3 -3
- package/bundles/material-tooltip.umd.min.js.map +1 -1
- package/bundles/material-tree.umd.js.map +1 -1
- package/button/_button-base.scss +1 -1
- package/button/_button-theme.scss +8 -8
- package/button/index.metadata.json +1 -1
- package/button/testing/button-harness.d.ts +2 -0
- package/button-toggle/button-toggle.d.ts +10 -3
- package/button-toggle/index.metadata.json +1 -1
- package/button-toggle/testing/button-toggle-harness.d.ts +2 -0
- package/card/testing/card-harness-filters.d.ts +17 -0
- package/card/testing/card-harness.d.ts +36 -0
- package/card/testing/index.d.ts +8 -0
- package/card/testing/package.json +9 -0
- package/card/testing/public-api.d.ts +9 -0
- package/checkbox/index.metadata.json +1 -1
- package/checkbox/testing/checkbox-harness.d.ts +2 -0
- package/chips/chip.d.ts +19 -1
- package/chips/index.metadata.json +1 -1
- package/core/focus-indicators/_focus-indicators.scss +6 -6
- package/core/index.metadata.json +1 -1
- package/core/option/optgroup.d.ts +7 -0
- package/core/ripple/ripple-ref.d.ts +21 -2
- package/core/ripple/ripple-renderer.d.ts +1 -19
- package/core/ripple/ripple.d.ts +2 -2
- package/core/style/_list-common.scss +1 -1
- package/datepicker/date-range-input-parts.d.ts +2 -4
- package/datepicker/date-range-input.d.ts +4 -4
- package/datepicker/date-range-picker.d.ts +10 -3
- package/datepicker/datepicker.d.ts +2 -3
- package/datepicker/index.metadata.json +1 -1
- package/datepicker/public-api.d.ts +1 -1
- package/dialog/dialog-container.d.ts +9 -2
- package/dialog/dialog-content-directives.d.ts +1 -0
- package/dialog/dialog-ref.d.ts +7 -0
- package/dialog/index.metadata.json +1 -1
- package/esm2015/autocomplete/autocomplete-module.js +18 -22
- package/esm2015/autocomplete/autocomplete-origin.js +16 -20
- package/esm2015/autocomplete/autocomplete-trigger.js +519 -521
- package/esm2015/autocomplete/autocomplete.js +126 -130
- package/esm2015/autocomplete/testing/autocomplete-harness.js +99 -97
- package/esm2015/badge/badge-module.js +13 -17
- package/esm2015/badge/badge.js +184 -188
- package/esm2015/badge/testing/badge-harness.js +74 -78
- package/esm2015/bottom-sheet/bottom-sheet-container.js +161 -165
- package/esm2015/bottom-sheet/bottom-sheet-module.js +15 -19
- package/esm2015/bottom-sheet/bottom-sheet.js +124 -128
- package/esm2015/bottom-sheet/testing/bottom-sheet-harness.js +29 -33
- package/esm2015/button/button-module.js +20 -24
- package/esm2015/button/button.js +111 -114
- package/esm2015/button/testing/button-harness.js +60 -58
- package/esm2015/button-toggle/button-toggle-module.js +10 -14
- package/esm2015/button-toggle/button-toggle.js +368 -368
- package/esm2015/button-toggle/testing/button-toggle-group-harness.js +42 -46
- package/esm2015/button-toggle/testing/button-toggle-harness.js +113 -111
- package/esm2015/card/card-module.js +30 -34
- package/esm2015/card/card.js +147 -203
- package/esm2015/card/testing/card-harness-filters.js +8 -0
- package/esm2015/card/testing/card-harness.js +52 -0
- package/esm2015/card/testing/index.js +9 -0
- package/esm2015/card/testing/public-api.js +10 -0
- package/esm2015/card/testing/testing.externs.js +0 -0
- package/esm2015/checkbox/checkbox-module.js +21 -29
- package/esm2015/checkbox/checkbox-required-validator.js +9 -13
- package/esm2015/checkbox/checkbox.js +315 -319
- package/esm2015/checkbox/testing/checkbox-harness.js +150 -148
- package/esm2015/chips/chip-input.js +119 -123
- package/esm2015/chips/chip-list.js +572 -576
- package/esm2015/chips/chip.js +333 -328
- package/esm2015/chips/chips-module.js +16 -20
- package/esm2015/core/animation/animation.js +12 -20
- package/esm2015/core/common-behaviors/common-module.js +91 -95
- package/esm2015/core/datetime/index.js +19 -27
- package/esm2015/core/datetime/native-date-adapter.js +202 -206
- package/esm2015/core/error/error-options.js +16 -24
- package/esm2015/core/line/line.js +18 -26
- package/esm2015/core/option/index.js +10 -14
- package/esm2015/core/option/optgroup.js +36 -33
- package/esm2015/core/option/option.js +181 -185
- package/esm2015/core/ripple/index.js +10 -14
- package/esm2015/core/ripple/ripple-ref.js +1 -1
- package/esm2015/core/ripple/ripple-renderer.js +1 -1
- package/esm2015/core/ripple/ripple.js +102 -106
- package/esm2015/core/selection/index.js +9 -13
- package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +32 -36
- package/esm2015/core/testing/optgroup-harness.js +39 -43
- package/esm2015/core/testing/option-harness.js +51 -55
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/calendar-body.js +214 -218
- package/esm2015/datepicker/calendar.js +295 -303
- package/esm2015/datepicker/date-range-input-parts.js +214 -229
- package/esm2015/datepicker/date-range-input.js +244 -242
- package/esm2015/datepicker/date-range-picker.js +19 -23
- package/esm2015/datepicker/date-range-selection-strategy.js +31 -35
- package/esm2015/datepicker/date-selection-model.js +110 -122
- package/esm2015/datepicker/datepicker-base.js +418 -426
- package/esm2015/datepicker/datepicker-input-base.js +227 -224
- package/esm2015/datepicker/datepicker-input.js +111 -115
- package/esm2015/datepicker/datepicker-intl.js +37 -41
- package/esm2015/datepicker/datepicker-module.js +62 -66
- package/esm2015/datepicker/datepicker-toggle.js +81 -89
- package/esm2015/datepicker/datepicker.js +13 -17
- package/esm2015/datepicker/month-view.js +283 -287
- package/esm2015/datepicker/multi-year-view.js +198 -202
- package/esm2015/datepicker/public-api.js +2 -2
- package/esm2015/datepicker/year-view.js +220 -224
- package/esm2015/dialog/dialog-container.js +175 -164
- package/esm2015/dialog/dialog-content-directives.js +105 -114
- package/esm2015/dialog/dialog-module.js +32 -36
- package/esm2015/dialog/dialog-ref.js +17 -3
- package/esm2015/dialog/dialog.js +236 -240
- package/esm2015/dialog/testing/dialog-harness.js +58 -62
- package/esm2015/divider/divider-module.js +10 -14
- package/esm2015/divider/divider.js +33 -37
- package/esm2015/divider/testing/divider-harness.js +16 -20
- package/esm2015/expansion/accordion.js +73 -77
- package/esm2015/expansion/expansion-module.js +26 -30
- package/esm2015/expansion/expansion-panel-content.js +13 -17
- package/esm2015/expansion/expansion-panel-header.js +168 -180
- package/esm2015/expansion/expansion-panel.js +144 -152
- package/esm2015/expansion/testing/accordion-harness.js +24 -28
- package/esm2015/expansion/testing/expansion-harness.js +136 -134
- package/esm2015/form-field/error.js +26 -23
- package/esm2015/form-field/form-field-control.js +6 -10
- package/esm2015/form-field/form-field-module.js +31 -35
- package/esm2015/form-field/form-field.js +407 -409
- package/esm2015/form-field/hint.js +35 -29
- package/esm2015/form-field/label.js +8 -12
- package/esm2015/form-field/placeholder.js +8 -12
- package/esm2015/form-field/prefix.js +16 -13
- package/esm2015/form-field/suffix.js +16 -13
- package/esm2015/form-field/testing/form-field-harness.js +220 -206
- package/esm2015/grid-list/grid-list-module.js +26 -30
- package/esm2015/grid-list/grid-list.js +108 -112
- package/esm2015/grid-list/grid-tile.js +91 -111
- package/esm2015/grid-list/testing/grid-list-harness.js +62 -66
- package/esm2015/grid-list/testing/grid-tile-harness.js +69 -73
- package/esm2015/grid-list/tile-styler.js +1 -1
- package/esm2015/icon/icon-module.js +10 -14
- package/esm2015/icon/icon-registry.js +406 -410
- package/esm2015/icon/icon.js +228 -232
- package/esm2015/icon/testing/fake-icon-registry.js +66 -74
- package/esm2015/input/autosize.js +30 -34
- package/esm2015/input/input-module.js +21 -25
- package/esm2015/input/input.js +305 -284
- package/esm2015/input/testing/input-harness.js +129 -123
- package/esm2015/list/list-module.js +32 -36
- package/esm2015/list/list.js +165 -189
- package/esm2015/list/selection-list.js +503 -511
- package/esm2015/list/testing/action-list-harness.js +55 -57
- package/esm2015/list/testing/list-harness.js +31 -39
- package/esm2015/list/testing/list-item-harness-base.js +13 -17
- package/esm2015/list/testing/nav-list-harness.js +62 -64
- package/esm2015/list/testing/selection-list-harness.js +136 -138
- package/esm2015/menu/menu-content.js +74 -71
- package/esm2015/menu/menu-item.js +119 -123
- package/esm2015/menu/menu-module.js +29 -37
- package/esm2015/menu/menu-panel.js +1 -1
- package/esm2015/menu/menu-trigger.js +402 -405
- package/esm2015/menu/menu.js +329 -339
- package/esm2015/menu/testing/menu-harness.js +193 -189
- package/esm2015/paginator/paginator-intl.js +36 -40
- package/esm2015/paginator/paginator-module.js +16 -20
- package/esm2015/paginator/paginator.js +205 -209
- package/esm2015/paginator/testing/paginator-harness.js +91 -95
- package/esm2015/progress-bar/progress-bar-module.js +10 -14
- package/esm2015/progress-bar/progress-bar.js +114 -118
- package/esm2015/progress-bar/testing/progress-bar-harness.js +27 -31
- package/esm2015/progress-spinner/progress-spinner-module.js +17 -21
- package/esm2015/progress-spinner/progress-spinner.js +181 -189
- package/esm2015/progress-spinner/testing/progress-spinner-harness.js +28 -32
- package/esm2015/radio/radio-module.js +10 -14
- package/esm2015/radio/radio.js +437 -444
- package/esm2015/radio/testing/radio-harness.js +241 -243
- package/esm2015/select/select-module.js +23 -27
- package/esm2015/select/select.js +917 -918
- package/esm2015/select/testing/select-harness.js +138 -136
- package/esm2015/sidenav/drawer.js +632 -620
- package/esm2015/sidenav/sidenav-module.js +31 -35
- package/esm2015/sidenav/sidenav.js +104 -116
- package/esm2015/sidenav/testing/drawer-harness.js +40 -44
- package/esm2015/sidenav/testing/sidenav-harness.js +20 -24
- package/esm2015/slide-toggle/slide-toggle-module.js +27 -35
- package/esm2015/slide-toggle/slide-toggle-required-validator.js +9 -13
- package/esm2015/slide-toggle/slide-toggle.js +184 -188
- package/esm2015/slide-toggle/testing/slide-toggle-harness.js +123 -121
- package/esm2015/slider/slider-module.js +10 -14
- package/esm2015/slider/slider.js +640 -644
- package/esm2015/slider/testing/slider-harness.js +129 -127
- package/esm2015/snack-bar/simple-snack-bar.js +32 -36
- package/esm2015/snack-bar/snack-bar-container.js +144 -148
- package/esm2015/snack-bar/snack-bar-module.js +17 -21
- package/esm2015/snack-bar/snack-bar-ref.js +1 -1
- package/esm2015/snack-bar/snack-bar.js +208 -205
- package/esm2015/snack-bar/testing/snack-bar-harness.js +112 -116
- package/esm2015/sort/sort-header-intl.js +21 -21
- package/esm2015/sort/sort-header.js +200 -194
- package/esm2015/sort/sort-module.js +11 -15
- package/esm2015/sort/sort.js +92 -96
- package/esm2015/sort/testing/sort-harness.js +28 -32
- package/esm2015/sort/testing/sort-header-harness.js +66 -67
- package/esm2015/stepper/step-header.js +78 -82
- package/esm2015/stepper/step-label.js +8 -12
- package/esm2015/stepper/stepper-button.js +23 -31
- package/esm2015/stepper/stepper-icon.js +16 -20
- package/esm2015/stepper/stepper-intl.js +15 -19
- package/esm2015/stepper/stepper-module.js +40 -44
- package/esm2015/stepper/stepper.js +139 -155
- package/esm2015/table/cell.js +94 -122
- package/esm2015/table/row.js +90 -118
- package/esm2015/table/table-module.js +13 -17
- package/esm2015/table/table.js +26 -30
- package/esm2015/table/testing/cell-harness.js +56 -68
- package/esm2015/table/testing/row-harness.js +90 -102
- package/esm2015/table/testing/table-harness.js +65 -69
- package/esm2015/table/text-column.js +17 -21
- package/esm2015/tabs/index.js +4 -2
- package/esm2015/tabs/ink-bar.js +55 -59
- package/esm2015/tabs/paginated-tab-header.js +415 -419
- package/esm2015/tabs/tab-body.js +179 -191
- package/esm2015/tabs/tab-content.js +21 -16
- package/esm2015/tabs/tab-group.js +263 -271
- package/esm2015/tabs/tab-header.js +69 -77
- package/esm2015/tabs/tab-label-wrapper.js +29 -33
- package/esm2015/tabs/tab-label.js +16 -13
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +199 -215
- package/esm2015/tabs/tab.js +80 -83
- package/esm2015/tabs/tabs-module.js +38 -42
- package/esm2015/tabs/testing/tab-group-harness.js +52 -56
- package/esm2015/tabs/testing/tab-harness.js +78 -82
- package/esm2015/toolbar/testing/index.js +9 -0
- package/esm2015/toolbar/testing/public-api.js +10 -0
- package/esm2015/toolbar/testing/testing.externs.js +0 -0
- package/esm2015/toolbar/testing/toolbar-harness-filters.js +8 -0
- package/esm2015/toolbar/testing/toolbar-harness.js +47 -0
- package/esm2015/toolbar/toolbar-module.js +10 -14
- package/esm2015/toolbar/toolbar.js +61 -69
- package/esm2015/tooltip/testing/tooltip-harness.js +43 -47
- package/esm2015/tooltip/tooltip-module.js +17 -21
- package/esm2015/tooltip/tooltip.js +502 -497
- package/esm2015/tree/data-source/flat-data-source.js +1 -1
- package/esm2015/tree/node.js +99 -111
- package/esm2015/tree/outlet.js +19 -23
- package/esm2015/tree/padding.js +13 -17
- package/esm2015/tree/toggle.js +15 -19
- package/esm2015/tree/tree-module.js +10 -14
- package/esm2015/tree/tree.js +23 -27
- package/expansion/testing/expansion-harness.d.ts +2 -0
- package/fesm2015/autocomplete/testing.js +98 -95
- package/fesm2015/autocomplete/testing.js.map +1 -1
- package/fesm2015/autocomplete.js +677 -687
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/badge/testing.js +73 -76
- package/fesm2015/badge/testing.js.map +1 -1
- package/fesm2015/badge.js +195 -201
- package/fesm2015/badge.js.map +1 -1
- package/fesm2015/bottom-sheet/testing.js +28 -31
- package/fesm2015/bottom-sheet/testing.js.map +1 -1
- package/fesm2015/bottom-sheet.js +297 -306
- package/fesm2015/bottom-sheet.js.map +1 -1
- package/fesm2015/button/testing.js +59 -56
- package/fesm2015/button/testing.js.map +1 -1
- package/fesm2015/button-toggle/testing.js +155 -155
- package/fesm2015/button-toggle/testing.js.map +1 -1
- package/fesm2015/button-toggle.js +377 -378
- package/fesm2015/button-toggle.js.map +1 -1
- package/fesm2015/button.js +129 -133
- package/fesm2015/button.js.map +1 -1
- package/fesm2015/card/testing.js +79 -0
- package/fesm2015/card/testing.js.map +1 -0
- package/fesm2015/card.js +175 -220
- package/fesm2015/card.js.map +1 -1
- package/fesm2015/checkbox/testing.js +149 -146
- package/fesm2015/checkbox/testing.js.map +1 -1
- package/fesm2015/checkbox.js +342 -354
- package/fesm2015/checkbox.js.map +1 -1
- package/fesm2015/chips.js +1039 -1039
- package/fesm2015/chips.js.map +1 -1
- package/fesm2015/core/testing.js +88 -94
- package/fesm2015/core/testing.js.map +1 -1
- package/fesm2015/core.js +729 -773
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +2821 -2884
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/dialog/testing.js +57 -60
- package/fesm2015/dialog/testing.js.map +1 -1
- package/fesm2015/dialog.js +564 -549
- package/fesm2015/dialog.js.map +1 -1
- package/fesm2015/divider/testing.js +15 -18
- package/fesm2015/divider/testing.js.map +1 -1
- package/fesm2015/divider.js +41 -47
- package/fesm2015/divider.js.map +1 -1
- package/fesm2015/expansion/testing.js +159 -159
- package/fesm2015/expansion/testing.js.map +1 -1
- package/fesm2015/expansion.js +422 -446
- package/fesm2015/expansion.js.map +1 -1
- package/fesm2015/form-field/testing.js +219 -204
- package/fesm2015/form-field/testing.js.map +1 -1
- package/fesm2015/form-field.js +538 -532
- package/fesm2015/form-field.js.map +1 -1
- package/fesm2015/grid-list/testing.js +129 -135
- package/fesm2015/grid-list/testing.js.map +1 -1
- package/fesm2015/grid-list.js +221 -242
- package/fesm2015/grid-list.js.map +1 -1
- package/fesm2015/icon/testing.js +65 -71
- package/fesm2015/icon/testing.js.map +1 -1
- package/fesm2015/icon.js +660 -669
- package/fesm2015/icon.js.map +1 -1
- package/fesm2015/input/testing.js +128 -121
- package/fesm2015/input/testing.js.map +1 -1
- package/fesm2015/input.js +353 -337
- package/fesm2015/input.js.map +1 -1
- package/fesm2015/list/testing.js +298 -307
- package/fesm2015/list/testing.js.map +1 -1
- package/fesm2015/list.js +698 -725
- package/fesm2015/list.js.map +1 -1
- package/fesm2015/menu/testing.js +192 -186
- package/fesm2015/menu/testing.js.map +1 -1
- package/fesm2015/menu.js +948 -962
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/paginator/testing.js +90 -93
- package/fesm2015/paginator/testing.js.map +1 -1
- package/fesm2015/paginator.js +247 -256
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/progress-bar/testing.js +26 -29
- package/fesm2015/progress-bar/testing.js.map +1 -1
- package/fesm2015/progress-bar.js +122 -128
- package/fesm2015/progress-bar.js.map +1 -1
- package/fesm2015/progress-spinner/testing.js +27 -30
- package/fesm2015/progress-spinner/testing.js.map +1 -1
- package/fesm2015/progress-spinner.js +196 -205
- package/fesm2015/progress-spinner.js.map +1 -1
- package/fesm2015/radio/testing.js +240 -240
- package/fesm2015/radio/testing.js.map +1 -1
- package/fesm2015/radio.js +447 -453
- package/fesm2015/radio.js.map +1 -1
- package/fesm2015/select/testing.js +137 -134
- package/fesm2015/select/testing.js.map +1 -1
- package/fesm2015/select.js +939 -941
- package/fesm2015/select.js.map +1 -1
- package/fesm2015/sidenav/testing.js +58 -64
- package/fesm2015/sidenav/testing.js.map +1 -1
- package/fesm2015/sidenav.js +765 -762
- package/fesm2015/sidenav.js.map +1 -1
- package/fesm2015/slide-toggle/testing.js +122 -119
- package/fesm2015/slide-toggle/testing.js.map +1 -1
- package/fesm2015/slide-toggle.js +217 -229
- package/fesm2015/slide-toggle.js.map +1 -1
- package/fesm2015/slider/testing.js +128 -125
- package/fesm2015/slider/testing.js.map +1 -1
- package/fesm2015/slider.js +648 -654
- package/fesm2015/slider.js.map +1 -1
- package/fesm2015/snack-bar/testing.js +111 -114
- package/fesm2015/snack-bar/testing.js.map +1 -1
- package/fesm2015/snack-bar.js +426 -431
- package/fesm2015/snack-bar.js.map +1 -1
- package/fesm2015/sort/testing.js +92 -95
- package/fesm2015/sort/testing.js.map +1 -1
- package/fesm2015/sort.js +320 -318
- package/fesm2015/sort.js.map +1 -1
- package/fesm2015/stepper.js +312 -345
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table/testing.js +208 -229
- package/fesm2015/table/testing.js.map +1 -1
- package/fesm2015/table.js +235 -286
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/tabs/testing.js +128 -134
- package/fesm2015/tabs/testing.js.map +1 -1
- package/fesm2015/tabs.js +1362 -1399
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/toolbar/testing.js +74 -0
- package/fesm2015/toolbar/testing.js.map +1 -0
- package/fesm2015/toolbar.js +69 -78
- package/fesm2015/toolbar.js.map +1 -1
- package/fesm2015/tooltip/testing.js +42 -45
- package/fesm2015/tooltip/testing.js.map +1 -1
- package/fesm2015/tooltip.js +517 -513
- package/fesm2015/tooltip.js.map +1 -1
- package/fesm2015/tree.js +173 -197
- package/fesm2015/tree.js.map +1 -1
- package/form-field/error.d.ts +7 -0
- package/form-field/hint.d.ts +10 -0
- package/form-field/index.metadata.json +1 -1
- package/form-field/prefix.d.ts +7 -0
- package/form-field/suffix.d.ts +7 -0
- package/form-field/testing/form-field-harness.d.ts +8 -0
- package/grid-list/grid-list.d.ts +2 -1
- package/grid-list/index.metadata.json +1 -1
- package/grid-list/tile-styler.d.ts +10 -5
- package/input/_input-theme.scss +2 -2
- package/input/index.metadata.json +1 -1
- package/input/input.d.ts +6 -2
- package/input/testing/input-harness.d.ts +2 -0
- package/list/index.metadata.json +1 -1
- package/list/testing/action-list-harness.d.ts +2 -0
- package/list/testing/nav-list-harness.d.ts +2 -0
- package/list/testing/selection-list-harness.d.ts +2 -0
- package/menu/index.metadata.json +1 -1
- package/menu/menu-content.d.ts +7 -1
- package/menu/menu-panel.d.ts +1 -0
- package/menu/menu.d.ts +4 -0
- package/menu/testing/menu-harness.d.ts +4 -0
- package/package.json +6 -6
- 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-spinner/index.metadata.json +1 -1
- package/radio/index.metadata.json +1 -1
- package/radio/radio.d.ts +6 -0
- package/radio/testing/radio-harness.d.ts +2 -0
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +3 -3
- package/schematics/ng-generate/navigation/schema.json +5 -0
- package/schematics/ng-update/data/index.js +1 -1
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/migrations/hammer-gestures-v9/hammer-gestures-migration.js +639 -639
- package/schematics/ng-update/migrations/misc-ripples-v7/ripple-speed-factor-migration.js +1 -1
- package/select/index.metadata.json +1 -1
- package/select/select.d.ts +6 -0
- package/select/testing/select-harness.d.ts +2 -0
- package/sidenav/drawer.d.ts +15 -3
- package/sidenav/index.metadata.json +1 -1
- package/slide-toggle/index.metadata.json +1 -1
- package/slide-toggle/testing/slide-toggle-harness.d.ts +2 -0
- package/slider/testing/slider-harness.d.ts +2 -0
- package/snack-bar/index.metadata.json +1 -1
- package/snack-bar/simple-snack-bar.d.ts +13 -1
- package/snack-bar/snack-bar-container.d.ts +16 -3
- package/snack-bar/snack-bar-ref.d.ts +3 -3
- package/snack-bar/snack-bar.d.ts +10 -3
- package/sort/index.metadata.json +1 -1
- package/sort/sort-header-intl.d.ts +5 -1
- package/sort/sort-header.d.ts +3 -1
- package/sort/testing/sort-header-harness.d.ts +6 -2
- package/tabs/index.d.ts +3 -1
- package/tabs/index.metadata.json +1 -1
- package/tabs/tab-content.d.ts +7 -1
- package/tabs/tab-label.d.ts +7 -0
- package/toolbar/testing/index.d.ts +8 -0
- package/toolbar/testing/package.json +9 -0
- package/toolbar/testing/public-api.d.ts +9 -0
- package/toolbar/testing/toolbar-harness-filters.d.ts +13 -0
- package/toolbar/testing/toolbar-harness.d.ts +31 -0
- package/tooltip/index.metadata.json +1 -1
- package/tooltip/tooltip.d.ts +1 -0
- package/tree/data-source/flat-data-source.d.ts +4 -4
- package/tree/index.metadata.json +1 -1
package/fesm2015/chips.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SPACE, BACKSPACE, DELETE, HOME, END, TAB, hasModifierKey, ENTER } from '@angular/cdk/keycodes';
|
|
2
|
-
import { Directive, EventEmitter, ElementRef, NgZone, Optional, Inject, ChangeDetectorRef, Attribute, ContentChild,
|
|
2
|
+
import { InjectionToken, Directive, EventEmitter, ElementRef, NgZone, Optional, Inject, ChangeDetectorRef, Attribute, ContentChild, Input, Output, Component, ViewEncapsulation, ChangeDetectionStrategy, Self, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { mixinTabIndex, mixinColor, mixinDisableRipple, RippleRenderer, MAT_RIPPLE_GLOBAL_OPTIONS, mixinErrorState, ErrorStateMatcher } from '@angular/material/core';
|
|
4
|
-
import { DOCUMENT } from '@angular/common';
|
|
5
4
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
6
5
|
import { Platform } from '@angular/cdk/platform';
|
|
6
|
+
import { DOCUMENT } from '@angular/common';
|
|
7
|
+
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
7
8
|
import { Subject, merge } from 'rxjs';
|
|
8
9
|
import { take, takeUntil, startWith } from 'rxjs/operators';
|
|
9
|
-
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
10
10
|
import { FocusKeyManager } from '@angular/cdk/a11y';
|
|
11
11
|
import { Directionality } from '@angular/cdk/bidi';
|
|
12
12
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
@@ -34,6 +34,24 @@ class MatChipSelectionChange {
|
|
|
34
34
|
this.isUserInput = isUserInput;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Injection token that can be used to reference instances of `MatChipRemove`. It serves as
|
|
39
|
+
* alternative token to the actual `MatChipRemove` class which could cause unnecessary
|
|
40
|
+
* retention of the class and its directive metadata.
|
|
41
|
+
*/
|
|
42
|
+
const MAT_CHIP_REMOVE = new InjectionToken('MatChipRemove');
|
|
43
|
+
/**
|
|
44
|
+
* Injection token that can be used to reference instances of `MatChipAvatar`. It serves as
|
|
45
|
+
* alternative token to the actual `MatChipAvatar` class which could cause unnecessary
|
|
46
|
+
* retention of the class and its directive metadata.
|
|
47
|
+
*/
|
|
48
|
+
const MAT_CHIP_AVATAR = new InjectionToken('MatChipAvatar');
|
|
49
|
+
/**
|
|
50
|
+
* Injection token that can be used to reference instances of `MatChipTrailingIcon`. It serves as
|
|
51
|
+
* alternative token to the actual `MatChipTrailingIcon` class which could cause unnecessary
|
|
52
|
+
* retention of the class and its directive metadata.
|
|
53
|
+
*/
|
|
54
|
+
const MAT_CHIP_TRAILING_ICON = new InjectionToken('MatChipTrailingIcon');
|
|
37
55
|
// Boilerplate for applying mixins to MatChip.
|
|
38
56
|
/** @docs-private */
|
|
39
57
|
class MatChipBase {
|
|
@@ -46,311 +64,304 @@ const _MatChipMixinBase = mixinTabIndex(mixinColor(mixinDisableRipple(MatChipBas
|
|
|
46
64
|
* Dummy directive to add CSS class to chip avatar.
|
|
47
65
|
* @docs-private
|
|
48
66
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return MatChipAvatar;
|
|
59
|
-
})();
|
|
67
|
+
class MatChipAvatar {
|
|
68
|
+
}
|
|
69
|
+
MatChipAvatar.decorators = [
|
|
70
|
+
{ type: Directive, args: [{
|
|
71
|
+
selector: 'mat-chip-avatar, [matChipAvatar]',
|
|
72
|
+
host: { 'class': 'mat-chip-avatar' },
|
|
73
|
+
providers: [{ provide: MAT_CHIP_AVATAR, useExisting: MatChipAvatar }]
|
|
74
|
+
},] }
|
|
75
|
+
];
|
|
60
76
|
/**
|
|
61
77
|
* Dummy directive to add CSS class to chip trailing icon.
|
|
62
78
|
* @docs-private
|
|
63
79
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return MatChipTrailingIcon;
|
|
74
|
-
})();
|
|
80
|
+
class MatChipTrailingIcon {
|
|
81
|
+
}
|
|
82
|
+
MatChipTrailingIcon.decorators = [
|
|
83
|
+
{ type: Directive, args: [{
|
|
84
|
+
selector: 'mat-chip-trailing-icon, [matChipTrailingIcon]',
|
|
85
|
+
host: { 'class': 'mat-chip-trailing-icon' },
|
|
86
|
+
providers: [{ provide: MAT_CHIP_TRAILING_ICON, useExisting: MatChipTrailingIcon }],
|
|
87
|
+
},] }
|
|
88
|
+
];
|
|
75
89
|
/**
|
|
76
90
|
* Material design styled Chip component. Used inside the MatChipList component.
|
|
77
91
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
this._dispatchSelectionChange();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/** The value of the chip. Defaults to the content inside `<mat-chip>` tags. */
|
|
143
|
-
get value() {
|
|
144
|
-
return this._value !== undefined
|
|
145
|
-
? this._value
|
|
146
|
-
: this._elementRef.nativeElement.textContent;
|
|
147
|
-
}
|
|
148
|
-
set value(value) { this._value = value; }
|
|
149
|
-
/**
|
|
150
|
-
* Whether or not the chip is selectable. When a chip is not selectable,
|
|
151
|
-
* changes to its selected state are always ignored. By default a chip is
|
|
152
|
-
* selectable, and it becomes non-selectable if its parent chip list is
|
|
153
|
-
* not selectable.
|
|
154
|
-
*/
|
|
155
|
-
get selectable() { return this._selectable && this.chipListSelectable; }
|
|
156
|
-
set selectable(value) {
|
|
157
|
-
this._selectable = coerceBooleanProperty(value);
|
|
158
|
-
}
|
|
159
|
-
/** Whether the chip is disabled. */
|
|
160
|
-
get disabled() { return this._chipListDisabled || this._disabled; }
|
|
161
|
-
set disabled(value) {
|
|
162
|
-
this._disabled = coerceBooleanProperty(value);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Determines whether or not the chip displays the remove styling and emits (removed) events.
|
|
166
|
-
*/
|
|
167
|
-
get removable() { return this._removable; }
|
|
168
|
-
set removable(value) {
|
|
169
|
-
this._removable = coerceBooleanProperty(value);
|
|
170
|
-
}
|
|
171
|
-
/** The ARIA selected applied to the chip. */
|
|
172
|
-
get ariaSelected() {
|
|
173
|
-
// Remove the `aria-selected` when the chip is deselected in single-selection mode, because
|
|
174
|
-
// it adds noise to NVDA users where "not selected" will be read out for each chip.
|
|
175
|
-
return this.selectable && (this._chipListMultiple || this.selected) ?
|
|
176
|
-
this.selected.toString() : null;
|
|
177
|
-
}
|
|
178
|
-
_addHostClassName() {
|
|
179
|
-
const basicChipAttrName = 'mat-basic-chip';
|
|
180
|
-
const element = this._elementRef.nativeElement;
|
|
181
|
-
if (element.hasAttribute(basicChipAttrName) ||
|
|
182
|
-
element.tagName.toLowerCase() === basicChipAttrName) {
|
|
183
|
-
element.classList.add(basicChipAttrName);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
element.classList.add('mat-standard-chip');
|
|
188
|
-
}
|
|
92
|
+
class MatChip extends _MatChipMixinBase {
|
|
93
|
+
constructor(_elementRef, _ngZone, platform, globalRippleOptions,
|
|
94
|
+
// @breaking-change 8.0.0 `animationMode` parameter to become required.
|
|
95
|
+
animationMode,
|
|
96
|
+
// @breaking-change 9.0.0 `_changeDetectorRef` parameter to become required.
|
|
97
|
+
_changeDetectorRef, tabIndex,
|
|
98
|
+
// @breaking-change 11.0.0 `_document` parameter to become required.
|
|
99
|
+
_document) {
|
|
100
|
+
super(_elementRef);
|
|
101
|
+
this._elementRef = _elementRef;
|
|
102
|
+
this._ngZone = _ngZone;
|
|
103
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
104
|
+
/** Whether the chip has focus. */
|
|
105
|
+
this._hasFocus = false;
|
|
106
|
+
/** Whether the chip list is selectable */
|
|
107
|
+
this.chipListSelectable = true;
|
|
108
|
+
/** Whether the chip list is in multi-selection mode. */
|
|
109
|
+
this._chipListMultiple = false;
|
|
110
|
+
/** Whether the chip list as a whole is disabled. */
|
|
111
|
+
this._chipListDisabled = false;
|
|
112
|
+
this._selected = false;
|
|
113
|
+
this._selectable = true;
|
|
114
|
+
this._disabled = false;
|
|
115
|
+
this._removable = true;
|
|
116
|
+
/** Emits when the chip is focused. */
|
|
117
|
+
this._onFocus = new Subject();
|
|
118
|
+
/** Emits when the chip is blured. */
|
|
119
|
+
this._onBlur = new Subject();
|
|
120
|
+
/** Emitted when the chip is selected or deselected. */
|
|
121
|
+
this.selectionChange = new EventEmitter();
|
|
122
|
+
/** Emitted when the chip is destroyed. */
|
|
123
|
+
this.destroyed = new EventEmitter();
|
|
124
|
+
/** Emitted when a chip is to be removed. */
|
|
125
|
+
this.removed = new EventEmitter();
|
|
126
|
+
this._addHostClassName();
|
|
127
|
+
// Dynamically create the ripple target, append it within the chip, and use it as the
|
|
128
|
+
// chip's ripple target. Adding the class '.mat-chip-ripple' ensures that it will have
|
|
129
|
+
// the proper styles.
|
|
130
|
+
this._chipRippleTarget = (_document || document).createElement('div');
|
|
131
|
+
this._chipRippleTarget.classList.add('mat-chip-ripple');
|
|
132
|
+
this._elementRef.nativeElement.appendChild(this._chipRippleTarget);
|
|
133
|
+
this._chipRipple = new RippleRenderer(this, _ngZone, this._chipRippleTarget, platform);
|
|
134
|
+
this._chipRipple.setupTriggerEvents(_elementRef);
|
|
135
|
+
this.rippleConfig = globalRippleOptions || {};
|
|
136
|
+
this._animationsDisabled = animationMode === 'NoopAnimations';
|
|
137
|
+
this.tabIndex = tabIndex != null ? (parseInt(tabIndex) || -1) : -1;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Whether ripples are disabled on interaction
|
|
141
|
+
* @docs-private
|
|
142
|
+
*/
|
|
143
|
+
get rippleDisabled() {
|
|
144
|
+
return this.disabled || this.disableRipple || !!this.rippleConfig.disabled;
|
|
145
|
+
}
|
|
146
|
+
/** Whether the chip is selected. */
|
|
147
|
+
get selected() { return this._selected; }
|
|
148
|
+
set selected(value) {
|
|
149
|
+
const coercedValue = coerceBooleanProperty(value);
|
|
150
|
+
if (coercedValue !== this._selected) {
|
|
151
|
+
this._selected = coercedValue;
|
|
152
|
+
this._dispatchSelectionChange();
|
|
189
153
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
154
|
+
}
|
|
155
|
+
/** The value of the chip. Defaults to the content inside `<mat-chip>` tags. */
|
|
156
|
+
get value() {
|
|
157
|
+
return this._value !== undefined
|
|
158
|
+
? this._value
|
|
159
|
+
: this._elementRef.nativeElement.textContent;
|
|
160
|
+
}
|
|
161
|
+
set value(value) { this._value = value; }
|
|
162
|
+
/**
|
|
163
|
+
* Whether or not the chip is selectable. When a chip is not selectable,
|
|
164
|
+
* changes to its selected state are always ignored. By default a chip is
|
|
165
|
+
* selectable, and it becomes non-selectable if its parent chip list is
|
|
166
|
+
* not selectable.
|
|
167
|
+
*/
|
|
168
|
+
get selectable() { return this._selectable && this.chipListSelectable; }
|
|
169
|
+
set selectable(value) {
|
|
170
|
+
this._selectable = coerceBooleanProperty(value);
|
|
171
|
+
}
|
|
172
|
+
/** Whether the chip is disabled. */
|
|
173
|
+
get disabled() { return this._chipListDisabled || this._disabled; }
|
|
174
|
+
set disabled(value) {
|
|
175
|
+
this._disabled = coerceBooleanProperty(value);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Determines whether or not the chip displays the remove styling and emits (removed) events.
|
|
179
|
+
*/
|
|
180
|
+
get removable() { return this._removable; }
|
|
181
|
+
set removable(value) {
|
|
182
|
+
this._removable = coerceBooleanProperty(value);
|
|
183
|
+
}
|
|
184
|
+
/** The ARIA selected applied to the chip. */
|
|
185
|
+
get ariaSelected() {
|
|
186
|
+
// Remove the `aria-selected` when the chip is deselected in single-selection mode, because
|
|
187
|
+
// it adds noise to NVDA users where "not selected" will be read out for each chip.
|
|
188
|
+
return this.selectable && (this._chipListMultiple || this.selected) ?
|
|
189
|
+
this.selected.toString() : null;
|
|
190
|
+
}
|
|
191
|
+
_addHostClassName() {
|
|
192
|
+
const basicChipAttrName = 'mat-basic-chip';
|
|
193
|
+
const element = this._elementRef.nativeElement;
|
|
194
|
+
if (element.hasAttribute(basicChipAttrName) ||
|
|
195
|
+
element.tagName.toLowerCase() === basicChipAttrName) {
|
|
196
|
+
element.classList.add(basicChipAttrName);
|
|
197
|
+
return;
|
|
193
198
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (!this._selected) {
|
|
197
|
-
this._selected = true;
|
|
198
|
-
this._dispatchSelectionChange();
|
|
199
|
-
this._markForCheck();
|
|
200
|
-
}
|
|
199
|
+
else {
|
|
200
|
+
element.classList.add('mat-standard-chip');
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
}
|
|
203
|
+
ngOnDestroy() {
|
|
204
|
+
this.destroyed.emit({ chip: this });
|
|
205
|
+
this._chipRipple._removeTriggerEvents();
|
|
206
|
+
}
|
|
207
|
+
/** Selects the chip. */
|
|
208
|
+
select() {
|
|
209
|
+
if (!this._selected) {
|
|
210
|
+
this._selected = true;
|
|
211
|
+
this._dispatchSelectionChange();
|
|
212
|
+
this._markForCheck();
|
|
209
213
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
}
|
|
215
|
+
/** Deselects the chip. */
|
|
216
|
+
deselect() {
|
|
217
|
+
if (this._selected) {
|
|
218
|
+
this._selected = false;
|
|
219
|
+
this._dispatchSelectionChange();
|
|
220
|
+
this._markForCheck();
|
|
217
221
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
}
|
|
223
|
+
/** Select this chip and emit selected event */
|
|
224
|
+
selectViaInteraction() {
|
|
225
|
+
if (!this._selected) {
|
|
226
|
+
this._selected = true;
|
|
227
|
+
this._dispatchSelectionChange(true);
|
|
222
228
|
this._markForCheck();
|
|
223
|
-
return this.selected;
|
|
224
229
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
}
|
|
231
|
+
/** Toggles the current selected state of this chip. */
|
|
232
|
+
toggleSelected(isUserInput = false) {
|
|
233
|
+
this._selected = !this.selected;
|
|
234
|
+
this._dispatchSelectionChange(isUserInput);
|
|
235
|
+
this._markForCheck();
|
|
236
|
+
return this.selected;
|
|
237
|
+
}
|
|
238
|
+
/** Allows for programmatic focusing of the chip. */
|
|
239
|
+
focus() {
|
|
240
|
+
if (!this._hasFocus) {
|
|
241
|
+
this._elementRef.nativeElement.focus();
|
|
242
|
+
this._onFocus.next({ chip: this });
|
|
232
243
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
244
|
+
this._hasFocus = true;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or
|
|
248
|
+
* BACKSPACE keys are pressed.
|
|
249
|
+
*
|
|
250
|
+
* Informs any listeners of the removal request. Does not remove the chip from the DOM.
|
|
251
|
+
*/
|
|
252
|
+
remove() {
|
|
253
|
+
if (this.removable) {
|
|
254
|
+
this.removed.emit({ chip: this });
|
|
243
255
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
else {
|
|
250
|
-
event.stopPropagation();
|
|
251
|
-
}
|
|
256
|
+
}
|
|
257
|
+
/** Handles click events on the chip. */
|
|
258
|
+
_handleClick(event) {
|
|
259
|
+
if (this.disabled) {
|
|
260
|
+
event.preventDefault();
|
|
252
261
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (this.disabled) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
switch (event.keyCode) {
|
|
259
|
-
case DELETE:
|
|
260
|
-
case BACKSPACE:
|
|
261
|
-
// If we are removable, remove the focused chip
|
|
262
|
-
this.remove();
|
|
263
|
-
// Always prevent so page navigation does not occur
|
|
264
|
-
event.preventDefault();
|
|
265
|
-
break;
|
|
266
|
-
case SPACE:
|
|
267
|
-
// If we are selectable, toggle the focused chip
|
|
268
|
-
if (this.selectable) {
|
|
269
|
-
this.toggleSelected(true);
|
|
270
|
-
}
|
|
271
|
-
// Always prevent space from scrolling the page since the list has focus
|
|
272
|
-
event.preventDefault();
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
262
|
+
else {
|
|
263
|
+
event.stopPropagation();
|
|
275
264
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
265
|
+
}
|
|
266
|
+
/** Handle custom key presses. */
|
|
267
|
+
_handleKeydown(event) {
|
|
268
|
+
if (this.disabled) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
switch (event.keyCode) {
|
|
272
|
+
case DELETE:
|
|
273
|
+
case BACKSPACE:
|
|
274
|
+
// If we are removable, remove the focused chip
|
|
275
|
+
this.remove();
|
|
276
|
+
// Always prevent so page navigation does not occur
|
|
277
|
+
event.preventDefault();
|
|
278
|
+
break;
|
|
279
|
+
case SPACE:
|
|
280
|
+
// If we are selectable, toggle the focused chip
|
|
281
|
+
if (this.selectable) {
|
|
282
|
+
this.toggleSelected(true);
|
|
283
|
+
}
|
|
284
|
+
// Always prevent space from scrolling the page since the list has focus
|
|
285
|
+
event.preventDefault();
|
|
286
|
+
break;
|
|
290
287
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
288
|
+
}
|
|
289
|
+
_blur() {
|
|
290
|
+
// When animations are enabled, Angular may end up removing the chip from the DOM a little
|
|
291
|
+
// earlier than usual, causing it to be blurred and throwing off the logic in the chip list
|
|
292
|
+
// that moves focus not the next item. To work around the issue, we defer marking the chip
|
|
293
|
+
// as not focused until the next time the zone stabilizes.
|
|
294
|
+
this._ngZone.onStable
|
|
295
|
+
.asObservable()
|
|
296
|
+
.pipe(take(1))
|
|
297
|
+
.subscribe(() => {
|
|
298
|
+
this._ngZone.run(() => {
|
|
299
|
+
this._hasFocus = false;
|
|
300
|
+
this._onBlur.next({ chip: this });
|
|
296
301
|
});
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
_dispatchSelectionChange(isUserInput = false) {
|
|
305
|
+
this.selectionChange.emit({
|
|
306
|
+
source: this,
|
|
307
|
+
isUserInput,
|
|
308
|
+
selected: this._selected
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
_markForCheck() {
|
|
312
|
+
// @breaking-change 9.0.0 Remove this method once the _changeDetectorRef is a required param.
|
|
313
|
+
if (this._changeDetectorRef) {
|
|
314
|
+
this._changeDetectorRef.markForCheck();
|
|
303
315
|
}
|
|
304
316
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
]
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
})();
|
|
317
|
+
}
|
|
318
|
+
MatChip.decorators = [
|
|
319
|
+
{ type: Directive, args: [{
|
|
320
|
+
selector: `mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]`,
|
|
321
|
+
inputs: ['color', 'disableRipple', 'tabIndex'],
|
|
322
|
+
exportAs: 'matChip',
|
|
323
|
+
host: {
|
|
324
|
+
'class': 'mat-chip mat-focus-indicator',
|
|
325
|
+
'[attr.tabindex]': 'disabled ? null : tabIndex',
|
|
326
|
+
'role': 'option',
|
|
327
|
+
'[class.mat-chip-selected]': 'selected',
|
|
328
|
+
'[class.mat-chip-with-avatar]': 'avatar',
|
|
329
|
+
'[class.mat-chip-with-trailing-icon]': 'trailingIcon || removeIcon',
|
|
330
|
+
'[class.mat-chip-disabled]': 'disabled',
|
|
331
|
+
'[class._mat-animation-noopable]': '_animationsDisabled',
|
|
332
|
+
'[attr.disabled]': 'disabled || null',
|
|
333
|
+
'[attr.aria-disabled]': 'disabled.toString()',
|
|
334
|
+
'[attr.aria-selected]': 'ariaSelected',
|
|
335
|
+
'(click)': '_handleClick($event)',
|
|
336
|
+
'(keydown)': '_handleKeydown($event)',
|
|
337
|
+
'(focus)': 'focus()',
|
|
338
|
+
'(blur)': '_blur()',
|
|
339
|
+
},
|
|
340
|
+
},] }
|
|
341
|
+
];
|
|
342
|
+
MatChip.ctorParameters = () => [
|
|
343
|
+
{ type: ElementRef },
|
|
344
|
+
{ type: NgZone },
|
|
345
|
+
{ type: Platform },
|
|
346
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
|
|
347
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] },
|
|
348
|
+
{ type: ChangeDetectorRef },
|
|
349
|
+
{ type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
|
350
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] }
|
|
351
|
+
];
|
|
352
|
+
MatChip.propDecorators = {
|
|
353
|
+
avatar: [{ type: ContentChild, args: [MAT_CHIP_AVATAR,] }],
|
|
354
|
+
trailingIcon: [{ type: ContentChild, args: [MAT_CHIP_TRAILING_ICON,] }],
|
|
355
|
+
removeIcon: [{ type: ContentChild, args: [MAT_CHIP_REMOVE,] }],
|
|
356
|
+
selected: [{ type: Input }],
|
|
357
|
+
value: [{ type: Input }],
|
|
358
|
+
selectable: [{ type: Input }],
|
|
359
|
+
disabled: [{ type: Input }],
|
|
360
|
+
removable: [{ type: Input }],
|
|
361
|
+
selectionChange: [{ type: Output }],
|
|
362
|
+
destroyed: [{ type: Output }],
|
|
363
|
+
removed: [{ type: Output }]
|
|
364
|
+
};
|
|
354
365
|
/**
|
|
355
366
|
* Applies proper (click) support and adds styling for use with the Material Design "cancel" icon
|
|
356
367
|
* available at https://material.io/icons/#ic_cancel.
|
|
@@ -364,46 +375,44 @@ let MatChip = /** @class */ (() => {
|
|
|
364
375
|
* You *may* use a custom icon, but you may need to override the `mat-chip-remove` positioning
|
|
365
376
|
* styles to properly center the icon within the chip.
|
|
366
377
|
*/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
elementRef.nativeElement.setAttribute('type', 'button');
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
/** Calls the parent chip's public `remove()` method if applicable. */
|
|
379
|
-
_handleClick(event) {
|
|
380
|
-
const parentChip = this._parentChip;
|
|
381
|
-
if (parentChip.removable && !parentChip.disabled) {
|
|
382
|
-
parentChip.remove();
|
|
383
|
-
}
|
|
384
|
-
// We need to stop event propagation because otherwise the event will bubble up to the
|
|
385
|
-
// form field and cause the `onContainerClick` method to be invoked. This method would then
|
|
386
|
-
// reset the focused chip that has been focused after chip removal. Usually the parent
|
|
387
|
-
// the parent click listener of the `MatChip` would prevent propagation, but it can happen
|
|
388
|
-
// that the chip is being removed before the event bubbles up.
|
|
389
|
-
event.stopPropagation();
|
|
378
|
+
class MatChipRemove {
|
|
379
|
+
constructor(_parentChip,
|
|
380
|
+
// @breaking-change 11.0.0 `elementRef` parameter to be made required.
|
|
381
|
+
elementRef) {
|
|
382
|
+
this._parentChip = _parentChip;
|
|
383
|
+
// @breaking-change 11.0.0 Remove null check for `elementRef`.
|
|
384
|
+
if (elementRef && elementRef.nativeElement.nodeName === 'BUTTON') {
|
|
385
|
+
elementRef.nativeElement.setAttribute('type', 'button');
|
|
390
386
|
}
|
|
391
387
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
388
|
+
/** Calls the parent chip's public `remove()` method if applicable. */
|
|
389
|
+
_handleClick(event) {
|
|
390
|
+
const parentChip = this._parentChip;
|
|
391
|
+
if (parentChip.removable && !parentChip.disabled) {
|
|
392
|
+
parentChip.remove();
|
|
393
|
+
}
|
|
394
|
+
// We need to stop event propagation because otherwise the event will bubble up to the
|
|
395
|
+
// form field and cause the `onContainerClick` method to be invoked. This method would then
|
|
396
|
+
// reset the focused chip that has been focused after chip removal. Usually the parent
|
|
397
|
+
// the parent click listener of the `MatChip` would prevent propagation, but it can happen
|
|
398
|
+
// that the chip is being removed before the event bubbles up.
|
|
399
|
+
event.stopPropagation();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
MatChipRemove.decorators = [
|
|
403
|
+
{ type: Directive, args: [{
|
|
404
|
+
selector: '[matChipRemove]',
|
|
405
|
+
host: {
|
|
406
|
+
'class': 'mat-chip-remove mat-chip-trailing-icon',
|
|
407
|
+
'(click)': '_handleClick($event)',
|
|
408
|
+
},
|
|
409
|
+
providers: [{ provide: MAT_CHIP_REMOVE, useExisting: MatChipRemove }],
|
|
410
|
+
},] }
|
|
411
|
+
];
|
|
412
|
+
MatChipRemove.ctorParameters = () => [
|
|
413
|
+
{ type: MatChip },
|
|
414
|
+
{ type: ElementRef }
|
|
415
|
+
];
|
|
407
416
|
|
|
408
417
|
/**
|
|
409
418
|
* @license
|
|
@@ -451,642 +460,639 @@ class MatChipListChange {
|
|
|
451
460
|
/**
|
|
452
461
|
* A material design chips component (named ChipList for its similarity to the List component).
|
|
453
462
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
ngControl)
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.ngControl = ngControl;
|
|
464
|
-
/**
|
|
465
|
-
* Implemented as part of MatFormFieldControl.
|
|
466
|
-
* @docs-private
|
|
467
|
-
*/
|
|
468
|
-
this.controlType = 'mat-chip-list';
|
|
469
|
-
/**
|
|
470
|
-
* When a chip is destroyed, we store the index of the destroyed chip until the chips
|
|
471
|
-
* query list notifies about the update. This is necessary because we cannot determine an
|
|
472
|
-
* appropriate chip that should receive focus until the array of chips updated completely.
|
|
473
|
-
*/
|
|
474
|
-
this._lastDestroyedChipIndex = null;
|
|
475
|
-
/** Subject that emits when the component has been destroyed. */
|
|
476
|
-
this._destroyed = new Subject();
|
|
477
|
-
/** Uid of the chip list */
|
|
478
|
-
this._uid = `mat-chip-list-${nextUniqueId++}`;
|
|
479
|
-
/** Tab index for the chip list. */
|
|
480
|
-
this._tabIndex = 0;
|
|
481
|
-
/**
|
|
482
|
-
* User defined tab index.
|
|
483
|
-
* When it is not null, use user defined tab index. Otherwise use _tabIndex
|
|
484
|
-
*/
|
|
485
|
-
this._userTabIndex = null;
|
|
486
|
-
/** Function when touched */
|
|
487
|
-
this._onTouched = () => { };
|
|
488
|
-
/** Function when changed */
|
|
489
|
-
this._onChange = () => { };
|
|
490
|
-
this._multiple = false;
|
|
491
|
-
this._compareWith = (o1, o2) => o1 === o2;
|
|
492
|
-
this._required = false;
|
|
493
|
-
this._disabled = false;
|
|
494
|
-
/** Orientation of the chip list. */
|
|
495
|
-
this.ariaOrientation = 'horizontal';
|
|
496
|
-
this._selectable = true;
|
|
497
|
-
/** Event emitted when the selected chip list value has been changed by the user. */
|
|
498
|
-
this.change = new EventEmitter();
|
|
499
|
-
/**
|
|
500
|
-
* Event that emits whenever the raw value of the chip-list changes. This is here primarily
|
|
501
|
-
* to facilitate the two-way binding for the `value` input.
|
|
502
|
-
* @docs-private
|
|
503
|
-
*/
|
|
504
|
-
this.valueChange = new EventEmitter();
|
|
505
|
-
if (this.ngControl) {
|
|
506
|
-
this.ngControl.valueAccessor = this;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
/** The array of selected chips inside chip list. */
|
|
510
|
-
get selected() {
|
|
511
|
-
return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];
|
|
512
|
-
}
|
|
513
|
-
/** The ARIA role applied to the chip list. */
|
|
514
|
-
get role() { return this.empty ? null : 'listbox'; }
|
|
515
|
-
/** Whether the user should be allowed to select multiple chips. */
|
|
516
|
-
get multiple() { return this._multiple; }
|
|
517
|
-
set multiple(value) {
|
|
518
|
-
this._multiple = coerceBooleanProperty(value);
|
|
519
|
-
this._syncChipsState();
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* A function to compare the option values with the selected values. The first argument
|
|
523
|
-
* is a value from an option. The second is a value from the selection. A boolean
|
|
524
|
-
* should be returned.
|
|
525
|
-
*/
|
|
526
|
-
get compareWith() { return this._compareWith; }
|
|
527
|
-
set compareWith(fn) {
|
|
528
|
-
this._compareWith = fn;
|
|
529
|
-
if (this._selectionModel) {
|
|
530
|
-
// A different comparator means the selection could change.
|
|
531
|
-
this._initializeSelection();
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Implemented as part of MatFormFieldControl.
|
|
536
|
-
* @docs-private
|
|
537
|
-
*/
|
|
538
|
-
get value() { return this._value; }
|
|
539
|
-
set value(value) {
|
|
540
|
-
this.writeValue(value);
|
|
541
|
-
this._value = value;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Implemented as part of MatFormFieldControl.
|
|
545
|
-
* @docs-private
|
|
546
|
-
*/
|
|
547
|
-
get id() {
|
|
548
|
-
return this._chipInput ? this._chipInput.id : this._uid;
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* Implemented as part of MatFormFieldControl.
|
|
552
|
-
* @docs-private
|
|
553
|
-
*/
|
|
554
|
-
get required() { return this._required; }
|
|
555
|
-
set required(value) {
|
|
556
|
-
this._required = coerceBooleanProperty(value);
|
|
557
|
-
this.stateChanges.next();
|
|
558
|
-
}
|
|
463
|
+
class MatChipList extends _MatChipListMixinBase {
|
|
464
|
+
constructor(_elementRef, _changeDetectorRef, _dir, _parentForm, _parentFormGroup, _defaultErrorStateMatcher,
|
|
465
|
+
/** @docs-private */
|
|
466
|
+
ngControl) {
|
|
467
|
+
super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
|
|
468
|
+
this._elementRef = _elementRef;
|
|
469
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
470
|
+
this._dir = _dir;
|
|
471
|
+
this.ngControl = ngControl;
|
|
559
472
|
/**
|
|
560
473
|
* Implemented as part of MatFormFieldControl.
|
|
561
474
|
* @docs-private
|
|
562
475
|
*/
|
|
563
|
-
|
|
564
|
-
return this._chipInput ? this._chipInput.placeholder : this._placeholder;
|
|
565
|
-
}
|
|
566
|
-
set placeholder(value) {
|
|
567
|
-
this._placeholder = value;
|
|
568
|
-
this.stateChanges.next();
|
|
569
|
-
}
|
|
570
|
-
/** Whether any chips or the matChipInput inside of this chip-list has focus. */
|
|
571
|
-
get focused() {
|
|
572
|
-
return (this._chipInput && this._chipInput.focused) || this._hasFocusedChip();
|
|
573
|
-
}
|
|
476
|
+
this.controlType = 'mat-chip-list';
|
|
574
477
|
/**
|
|
575
|
-
*
|
|
576
|
-
*
|
|
478
|
+
* When a chip is destroyed, we store the index of the destroyed chip until the chips
|
|
479
|
+
* query list notifies about the update. This is necessary because we cannot determine an
|
|
480
|
+
* appropriate chip that should receive focus until the array of chips updated completely.
|
|
577
481
|
*/
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
482
|
+
this._lastDestroyedChipIndex = null;
|
|
483
|
+
/** Subject that emits when the component has been destroyed. */
|
|
484
|
+
this._destroyed = new Subject();
|
|
485
|
+
/** Uid of the chip list */
|
|
486
|
+
this._uid = `mat-chip-list-${nextUniqueId++}`;
|
|
487
|
+
/** Tab index for the chip list. */
|
|
488
|
+
this._tabIndex = 0;
|
|
581
489
|
/**
|
|
582
|
-
*
|
|
583
|
-
*
|
|
490
|
+
* User defined tab index.
|
|
491
|
+
* When it is not null, use user defined tab index. Otherwise use _tabIndex
|
|
584
492
|
*/
|
|
585
|
-
|
|
493
|
+
this._userTabIndex = null;
|
|
494
|
+
/** Function when touched */
|
|
495
|
+
this._onTouched = () => { };
|
|
496
|
+
/** Function when changed */
|
|
497
|
+
this._onChange = () => { };
|
|
498
|
+
this._multiple = false;
|
|
499
|
+
this._compareWith = (o1, o2) => o1 === o2;
|
|
500
|
+
this._required = false;
|
|
501
|
+
this._disabled = false;
|
|
502
|
+
/** Orientation of the chip list. */
|
|
503
|
+
this.ariaOrientation = 'horizontal';
|
|
504
|
+
this._selectable = true;
|
|
505
|
+
/** Event emitted when the selected chip list value has been changed by the user. */
|
|
506
|
+
this.change = new EventEmitter();
|
|
586
507
|
/**
|
|
587
|
-
*
|
|
508
|
+
* Event that emits whenever the raw value of the chip-list changes. This is here primarily
|
|
509
|
+
* to facilitate the two-way binding for the `value` input.
|
|
588
510
|
* @docs-private
|
|
589
511
|
*/
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
this.
|
|
593
|
-
this._syncChipsState();
|
|
594
|
-
}
|
|
595
|
-
/**
|
|
596
|
-
* Whether or not this chip list is selectable. When a chip list is not selectable,
|
|
597
|
-
* the selected states for all the chips inside the chip list are always ignored.
|
|
598
|
-
*/
|
|
599
|
-
get selectable() { return this._selectable; }
|
|
600
|
-
set selectable(value) {
|
|
601
|
-
this._selectable = coerceBooleanProperty(value);
|
|
602
|
-
if (this.chips) {
|
|
603
|
-
this.chips.forEach(chip => chip.chipListSelectable = this._selectable);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
set tabIndex(value) {
|
|
607
|
-
this._userTabIndex = value;
|
|
608
|
-
this._tabIndex = value;
|
|
512
|
+
this.valueChange = new EventEmitter();
|
|
513
|
+
if (this.ngControl) {
|
|
514
|
+
this.ngControl.valueAccessor = this;
|
|
609
515
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
516
|
+
}
|
|
517
|
+
/** The array of selected chips inside chip list. */
|
|
518
|
+
get selected() {
|
|
519
|
+
return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];
|
|
520
|
+
}
|
|
521
|
+
/** The ARIA role applied to the chip list. */
|
|
522
|
+
get role() { return this.empty ? null : 'listbox'; }
|
|
523
|
+
/** Whether the user should be allowed to select multiple chips. */
|
|
524
|
+
get multiple() { return this._multiple; }
|
|
525
|
+
set multiple(value) {
|
|
526
|
+
this._multiple = coerceBooleanProperty(value);
|
|
527
|
+
this._syncChipsState();
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* A function to compare the option values with the selected values. The first argument
|
|
531
|
+
* is a value from an option. The second is a value from the selection. A boolean
|
|
532
|
+
* should be returned.
|
|
533
|
+
*/
|
|
534
|
+
get compareWith() { return this._compareWith; }
|
|
535
|
+
set compareWith(fn) {
|
|
536
|
+
this._compareWith = fn;
|
|
537
|
+
if (this._selectionModel) {
|
|
538
|
+
// A different comparator means the selection could change.
|
|
539
|
+
this._initializeSelection();
|
|
621
540
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Implemented as part of MatFormFieldControl.
|
|
544
|
+
* @docs-private
|
|
545
|
+
*/
|
|
546
|
+
get value() { return this._value; }
|
|
547
|
+
set value(value) {
|
|
548
|
+
this.writeValue(value);
|
|
549
|
+
this._value = value;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Implemented as part of MatFormFieldControl.
|
|
553
|
+
* @docs-private
|
|
554
|
+
*/
|
|
555
|
+
get id() {
|
|
556
|
+
return this._chipInput ? this._chipInput.id : this._uid;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Implemented as part of MatFormFieldControl.
|
|
560
|
+
* @docs-private
|
|
561
|
+
*/
|
|
562
|
+
get required() { return this._required; }
|
|
563
|
+
set required(value) {
|
|
564
|
+
this._required = coerceBooleanProperty(value);
|
|
565
|
+
this.stateChanges.next();
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Implemented as part of MatFormFieldControl.
|
|
569
|
+
* @docs-private
|
|
570
|
+
*/
|
|
571
|
+
get placeholder() {
|
|
572
|
+
return this._chipInput ? this._chipInput.placeholder : this._placeholder;
|
|
573
|
+
}
|
|
574
|
+
set placeholder(value) {
|
|
575
|
+
this._placeholder = value;
|
|
576
|
+
this.stateChanges.next();
|
|
577
|
+
}
|
|
578
|
+
/** Whether any chips or the matChipInput inside of this chip-list has focus. */
|
|
579
|
+
get focused() {
|
|
580
|
+
return (this._chipInput && this._chipInput.focused) || this._hasFocusedChip();
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Implemented as part of MatFormFieldControl.
|
|
584
|
+
* @docs-private
|
|
585
|
+
*/
|
|
586
|
+
get empty() {
|
|
587
|
+
return (!this._chipInput || this._chipInput.empty) && (!this.chips || this.chips.length === 0);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Implemented as part of MatFormFieldControl.
|
|
591
|
+
* @docs-private
|
|
592
|
+
*/
|
|
593
|
+
get shouldLabelFloat() { return !this.empty || this.focused; }
|
|
594
|
+
/**
|
|
595
|
+
* Implemented as part of MatFormFieldControl.
|
|
596
|
+
* @docs-private
|
|
597
|
+
*/
|
|
598
|
+
get disabled() { return this.ngControl ? !!this.ngControl.disabled : this._disabled; }
|
|
599
|
+
set disabled(value) {
|
|
600
|
+
this._disabled = coerceBooleanProperty(value);
|
|
601
|
+
this._syncChipsState();
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Whether or not this chip list is selectable. When a chip list is not selectable,
|
|
605
|
+
* the selected states for all the chips inside the chip list are always ignored.
|
|
606
|
+
*/
|
|
607
|
+
get selectable() { return this._selectable; }
|
|
608
|
+
set selectable(value) {
|
|
609
|
+
this._selectable = coerceBooleanProperty(value);
|
|
610
|
+
if (this.chips) {
|
|
611
|
+
this.chips.forEach(chip => chip.chipListSelectable = this._selectable);
|
|
625
612
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
613
|
+
}
|
|
614
|
+
set tabIndex(value) {
|
|
615
|
+
this._userTabIndex = value;
|
|
616
|
+
this._tabIndex = value;
|
|
617
|
+
}
|
|
618
|
+
/** Combined stream of all of the child chips' selection change events. */
|
|
619
|
+
get chipSelectionChanges() {
|
|
620
|
+
return merge(...this.chips.map(chip => chip.selectionChange));
|
|
621
|
+
}
|
|
622
|
+
/** Combined stream of all of the child chips' focus change events. */
|
|
623
|
+
get chipFocusChanges() {
|
|
624
|
+
return merge(...this.chips.map(chip => chip._onFocus));
|
|
625
|
+
}
|
|
626
|
+
/** Combined stream of all of the child chips' blur change events. */
|
|
627
|
+
get chipBlurChanges() {
|
|
628
|
+
return merge(...this.chips.map(chip => chip._onBlur));
|
|
629
|
+
}
|
|
630
|
+
/** Combined stream of all of the child chips' remove change events. */
|
|
631
|
+
get chipRemoveChanges() {
|
|
632
|
+
return merge(...this.chips.map(chip => chip.destroyed));
|
|
633
|
+
}
|
|
634
|
+
ngAfterContentInit() {
|
|
635
|
+
this._keyManager = new FocusKeyManager(this.chips)
|
|
636
|
+
.withWrap()
|
|
637
|
+
.withVerticalOrientation()
|
|
638
|
+
.withHorizontalOrientation(this._dir ? this._dir.value : 'ltr');
|
|
639
|
+
if (this._dir) {
|
|
640
|
+
this._dir.change
|
|
641
|
+
.pipe(takeUntil(this._destroyed))
|
|
642
|
+
.subscribe(dir => this._keyManager.withHorizontalOrientation(dir));
|
|
643
|
+
}
|
|
644
|
+
this._keyManager.tabOut.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
645
|
+
this._allowFocusEscape();
|
|
646
|
+
});
|
|
647
|
+
// When the list changes, re-subscribe
|
|
648
|
+
this.chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
|
|
649
|
+
if (this.disabled) {
|
|
650
|
+
// Since this happens after the content has been
|
|
651
|
+
// checked, we need to defer it to the next tick.
|
|
652
|
+
Promise.resolve().then(() => {
|
|
653
|
+
this._syncChipsState();
|
|
654
|
+
});
|
|
635
655
|
}
|
|
636
|
-
this.
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
//
|
|
640
|
-
this.
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
// checked, we need to defer it to the next tick.
|
|
644
|
-
Promise.resolve().then(() => {
|
|
645
|
-
this._syncChipsState();
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
this._resetChips();
|
|
649
|
-
// Reset chips selected/deselected status
|
|
650
|
-
this._initializeSelection();
|
|
651
|
-
// Check to see if we need to update our tab index
|
|
652
|
-
this._updateTabIndex();
|
|
653
|
-
// Check to see if we have a destroyed chip and need to refocus
|
|
654
|
-
this._updateFocusForDestroyedChips();
|
|
655
|
-
this.stateChanges.next();
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
ngOnInit() {
|
|
659
|
-
this._selectionModel = new SelectionModel(this.multiple, undefined, false);
|
|
656
|
+
this._resetChips();
|
|
657
|
+
// Reset chips selected/deselected status
|
|
658
|
+
this._initializeSelection();
|
|
659
|
+
// Check to see if we need to update our tab index
|
|
660
|
+
this._updateTabIndex();
|
|
661
|
+
// Check to see if we have a destroyed chip and need to refocus
|
|
662
|
+
this._updateFocusForDestroyedChips();
|
|
660
663
|
this.stateChanges.next();
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
ngOnInit() {
|
|
667
|
+
this._selectionModel = new SelectionModel(this.multiple, undefined, false);
|
|
668
|
+
this.stateChanges.next();
|
|
669
|
+
}
|
|
670
|
+
ngDoCheck() {
|
|
671
|
+
if (this.ngControl) {
|
|
672
|
+
// We need to re-evaluate this on every change detection cycle, because there are some
|
|
673
|
+
// error triggers that we can't subscribe to (e.g. parent form submissions). This means
|
|
674
|
+
// that whatever logic is in here has to be super lean or we risk destroying the performance.
|
|
675
|
+
this.updateErrorState();
|
|
676
|
+
if (this.ngControl.disabled !== this._disabled) {
|
|
677
|
+
this.disabled = !!this.ngControl.disabled;
|
|
671
678
|
}
|
|
672
679
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
680
|
+
}
|
|
681
|
+
ngOnDestroy() {
|
|
682
|
+
this._destroyed.next();
|
|
683
|
+
this._destroyed.complete();
|
|
684
|
+
this.stateChanges.complete();
|
|
685
|
+
this._dropSubscriptions();
|
|
686
|
+
}
|
|
687
|
+
/** Associates an HTML input element with this chip list. */
|
|
688
|
+
registerInput(inputElement) {
|
|
689
|
+
this._chipInput = inputElement;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Implemented as part of MatFormFieldControl.
|
|
693
|
+
* @docs-private
|
|
694
|
+
*/
|
|
695
|
+
setDescribedByIds(ids) { this._ariaDescribedby = ids.join(' '); }
|
|
696
|
+
// Implemented as part of ControlValueAccessor.
|
|
697
|
+
writeValue(value) {
|
|
698
|
+
if (this.chips) {
|
|
699
|
+
this._setSelectionByValue(value, false);
|
|
693
700
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
701
|
+
}
|
|
702
|
+
// Implemented as part of ControlValueAccessor.
|
|
703
|
+
registerOnChange(fn) {
|
|
704
|
+
this._onChange = fn;
|
|
705
|
+
}
|
|
706
|
+
// Implemented as part of ControlValueAccessor.
|
|
707
|
+
registerOnTouched(fn) {
|
|
708
|
+
this._onTouched = fn;
|
|
709
|
+
}
|
|
710
|
+
// Implemented as part of ControlValueAccessor.
|
|
711
|
+
setDisabledState(isDisabled) {
|
|
712
|
+
this.disabled = isDisabled;
|
|
713
|
+
this.stateChanges.next();
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Implemented as part of MatFormFieldControl.
|
|
717
|
+
* @docs-private
|
|
718
|
+
*/
|
|
719
|
+
onContainerClick(event) {
|
|
720
|
+
if (!this._originatesFromChip(event)) {
|
|
721
|
+
this.focus();
|
|
697
722
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Focuses the first non-disabled chip in this chip list, or the associated input when there
|
|
726
|
+
* are no eligible chips.
|
|
727
|
+
*/
|
|
728
|
+
focus(options) {
|
|
729
|
+
if (this.disabled) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
// TODO: ARIA says this should focus the first `selected` chip if any are selected.
|
|
733
|
+
// Focus on first element if there's no chipInput inside chip-list
|
|
734
|
+
if (this._chipInput && this._chipInput.focused) {
|
|
735
|
+
// do nothing
|
|
736
|
+
}
|
|
737
|
+
else if (this.chips.length > 0) {
|
|
738
|
+
this._keyManager.setFirstItemActive();
|
|
739
|
+
this.stateChanges.next();
|
|
701
740
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
this.disabled = isDisabled;
|
|
741
|
+
else {
|
|
742
|
+
this._focusInput(options);
|
|
705
743
|
this.stateChanges.next();
|
|
706
744
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (!this._originatesFromChip(event)) {
|
|
713
|
-
this.focus();
|
|
714
|
-
}
|
|
745
|
+
}
|
|
746
|
+
/** Attempt to focus an input if we have one. */
|
|
747
|
+
_focusInput(options) {
|
|
748
|
+
if (this._chipInput) {
|
|
749
|
+
this._chipInput.focus(options);
|
|
715
750
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
else if (this.chips.length > 0) {
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Pass events to the keyboard manager. Available here for tests.
|
|
754
|
+
*/
|
|
755
|
+
_keydown(event) {
|
|
756
|
+
const target = event.target;
|
|
757
|
+
// If they are on an empty input and hit backspace, focus the last chip
|
|
758
|
+
if (event.keyCode === BACKSPACE && this._isInputEmpty(target)) {
|
|
759
|
+
this._keyManager.setLastItemActive();
|
|
760
|
+
event.preventDefault();
|
|
761
|
+
}
|
|
762
|
+
else if (target && target.classList.contains('mat-chip')) {
|
|
763
|
+
if (event.keyCode === HOME) {
|
|
730
764
|
this._keyManager.setFirstItemActive();
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
else {
|
|
734
|
-
this._focusInput(options);
|
|
735
|
-
this.stateChanges.next();
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
/** Attempt to focus an input if we have one. */
|
|
739
|
-
_focusInput(options) {
|
|
740
|
-
if (this._chipInput) {
|
|
741
|
-
this._chipInput.focus(options);
|
|
765
|
+
event.preventDefault();
|
|
742
766
|
}
|
|
743
|
-
|
|
744
|
-
/**
|
|
745
|
-
* Pass events to the keyboard manager. Available here for tests.
|
|
746
|
-
*/
|
|
747
|
-
_keydown(event) {
|
|
748
|
-
const target = event.target;
|
|
749
|
-
// If they are on an empty input and hit backspace, focus the last chip
|
|
750
|
-
if (event.keyCode === BACKSPACE && this._isInputEmpty(target)) {
|
|
767
|
+
else if (event.keyCode === END) {
|
|
751
768
|
this._keyManager.setLastItemActive();
|
|
752
769
|
event.preventDefault();
|
|
753
770
|
}
|
|
754
|
-
else
|
|
755
|
-
|
|
756
|
-
this._keyManager.setFirstItemActive();
|
|
757
|
-
event.preventDefault();
|
|
758
|
-
}
|
|
759
|
-
else if (event.keyCode === END) {
|
|
760
|
-
this._keyManager.setLastItemActive();
|
|
761
|
-
event.preventDefault();
|
|
762
|
-
}
|
|
763
|
-
else {
|
|
764
|
-
this._keyManager.onKeydown(event);
|
|
765
|
-
}
|
|
766
|
-
this.stateChanges.next();
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Check the tab index as you should not be allowed to focus an empty list.
|
|
771
|
-
*/
|
|
772
|
-
_updateTabIndex() {
|
|
773
|
-
// If we have 0 chips, we should not allow keyboard focus
|
|
774
|
-
this._tabIndex = this._userTabIndex || (this.chips.length === 0 ? -1 : 0);
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* If the amount of chips changed, we need to update the
|
|
778
|
-
* key manager state and focus the next closest chip.
|
|
779
|
-
*/
|
|
780
|
-
_updateFocusForDestroyedChips() {
|
|
781
|
-
// Move focus to the closest chip. If no other chips remain, focus the chip-list itself.
|
|
782
|
-
if (this._lastDestroyedChipIndex != null) {
|
|
783
|
-
if (this.chips.length) {
|
|
784
|
-
const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);
|
|
785
|
-
this._keyManager.setActiveItem(newChipIndex);
|
|
786
|
-
}
|
|
787
|
-
else {
|
|
788
|
-
this.focus();
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
this._lastDestroyedChipIndex = null;
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* Utility to ensure all indexes are valid.
|
|
795
|
-
*
|
|
796
|
-
* @param index The index to be checked.
|
|
797
|
-
* @returns True if the index is valid for our list of chips.
|
|
798
|
-
*/
|
|
799
|
-
_isValidIndex(index) {
|
|
800
|
-
return index >= 0 && index < this.chips.length;
|
|
801
|
-
}
|
|
802
|
-
_isInputEmpty(element) {
|
|
803
|
-
if (element && element.nodeName.toLowerCase() === 'input') {
|
|
804
|
-
let input = element;
|
|
805
|
-
return !input.value;
|
|
771
|
+
else {
|
|
772
|
+
this._keyManager.onKeydown(event);
|
|
806
773
|
}
|
|
807
|
-
|
|
774
|
+
this.stateChanges.next();
|
|
808
775
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Check the tab index as you should not be allowed to focus an empty list.
|
|
779
|
+
*/
|
|
780
|
+
_updateTabIndex() {
|
|
781
|
+
// If we have 0 chips, we should not allow keyboard focus
|
|
782
|
+
this._tabIndex = this._userTabIndex || (this.chips.length === 0 ? -1 : 0);
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* If the amount of chips changed, we need to update the
|
|
786
|
+
* key manager state and focus the next closest chip.
|
|
787
|
+
*/
|
|
788
|
+
_updateFocusForDestroyedChips() {
|
|
789
|
+
// Move focus to the closest chip. If no other chips remain, focus the chip-list itself.
|
|
790
|
+
if (this._lastDestroyedChipIndex != null) {
|
|
791
|
+
if (this.chips.length) {
|
|
792
|
+
const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);
|
|
793
|
+
this._keyManager.setActiveItem(newChipIndex);
|
|
815
794
|
}
|
|
816
795
|
else {
|
|
817
|
-
|
|
818
|
-
// Shift focus to the active item. Note that we shouldn't do this in multiple
|
|
819
|
-
// mode, because we don't know what chip the user interacted with last.
|
|
820
|
-
if (correspondingChip) {
|
|
821
|
-
if (isUserInput) {
|
|
822
|
-
this._keyManager.setActiveItem(correspondingChip);
|
|
823
|
-
}
|
|
824
|
-
}
|
|
796
|
+
this.focus();
|
|
825
797
|
}
|
|
826
798
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
799
|
+
this._lastDestroyedChipIndex = null;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Utility to ensure all indexes are valid.
|
|
803
|
+
*
|
|
804
|
+
* @param index The index to be checked.
|
|
805
|
+
* @returns True if the index is valid for our list of chips.
|
|
806
|
+
*/
|
|
807
|
+
_isValidIndex(index) {
|
|
808
|
+
return index >= 0 && index < this.chips.length;
|
|
809
|
+
}
|
|
810
|
+
_isInputEmpty(element) {
|
|
811
|
+
if (element && element.nodeName.toLowerCase() === 'input') {
|
|
812
|
+
let input = element;
|
|
813
|
+
return !input.value;
|
|
840
814
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
815
|
+
return false;
|
|
816
|
+
}
|
|
817
|
+
_setSelectionByValue(value, isUserInput = true) {
|
|
818
|
+
this._clearSelection();
|
|
819
|
+
this.chips.forEach(chip => chip.deselect());
|
|
820
|
+
if (Array.isArray(value)) {
|
|
821
|
+
value.forEach(currentValue => this._selectValue(currentValue, isUserInput));
|
|
822
|
+
this._sortValues();
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
const correspondingChip = this._selectValue(value, isUserInput);
|
|
826
|
+
// Shift focus to the active item. Note that we shouldn't do this in multiple
|
|
827
|
+
// mode, because we don't know what chip the user interacted with last.
|
|
828
|
+
if (correspondingChip) {
|
|
829
|
+
if (isUserInput) {
|
|
830
|
+
this._keyManager.setActiveItem(correspondingChip);
|
|
848
831
|
}
|
|
849
|
-
}
|
|
832
|
+
}
|
|
850
833
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Finds and selects the chip based on its value.
|
|
837
|
+
* @returns Chip that has the corresponding value.
|
|
838
|
+
*/
|
|
839
|
+
_selectValue(value, isUserInput = true) {
|
|
840
|
+
const correspondingChip = this.chips.find(chip => {
|
|
841
|
+
return chip.value != null && this._compareWith(chip.value, value);
|
|
842
|
+
});
|
|
843
|
+
if (correspondingChip) {
|
|
844
|
+
isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();
|
|
845
|
+
this._selectionModel.select(correspondingChip);
|
|
846
|
+
}
|
|
847
|
+
return correspondingChip;
|
|
848
|
+
}
|
|
849
|
+
_initializeSelection() {
|
|
850
|
+
// Defer setting the value in order to avoid the "Expression
|
|
851
|
+
// has changed after it was checked" errors from Angular.
|
|
852
|
+
Promise.resolve().then(() => {
|
|
853
|
+
if (this.ngControl || this._value) {
|
|
854
|
+
this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value, false);
|
|
855
|
+
this.stateChanges.next();
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Deselects every chip in the list.
|
|
861
|
+
* @param skip Chip that should not be deselected.
|
|
862
|
+
*/
|
|
863
|
+
_clearSelection(skip) {
|
|
864
|
+
this._selectionModel.clear();
|
|
865
|
+
this.chips.forEach(chip => {
|
|
866
|
+
if (chip !== skip) {
|
|
867
|
+
chip.deselect();
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
this.stateChanges.next();
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Sorts the model values, ensuring that they keep the same
|
|
874
|
+
* order that they have in the panel.
|
|
875
|
+
*/
|
|
876
|
+
_sortValues() {
|
|
877
|
+
if (this._multiple) {
|
|
856
878
|
this._selectionModel.clear();
|
|
857
879
|
this.chips.forEach(chip => {
|
|
858
|
-
if (chip
|
|
859
|
-
|
|
880
|
+
if (chip.selected) {
|
|
881
|
+
this._selectionModel.select(chip);
|
|
860
882
|
}
|
|
861
883
|
});
|
|
862
884
|
this.stateChanges.next();
|
|
863
885
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
886
|
+
}
|
|
887
|
+
/** Emits change event to set the model value. */
|
|
888
|
+
_propagateChanges(fallbackValue) {
|
|
889
|
+
let valueToEmit = null;
|
|
890
|
+
if (Array.isArray(this.selected)) {
|
|
891
|
+
valueToEmit = this.selected.map(chip => chip.value);
|
|
892
|
+
}
|
|
893
|
+
else {
|
|
894
|
+
valueToEmit = this.selected ? this.selected.value : fallbackValue;
|
|
895
|
+
}
|
|
896
|
+
this._value = valueToEmit;
|
|
897
|
+
this.change.emit(new MatChipListChange(this, valueToEmit));
|
|
898
|
+
this.valueChange.emit(valueToEmit);
|
|
899
|
+
this._onChange(valueToEmit);
|
|
900
|
+
this._changeDetectorRef.markForCheck();
|
|
901
|
+
}
|
|
902
|
+
/** When blurred, mark the field as touched when focus moved outside the chip list. */
|
|
903
|
+
_blur() {
|
|
904
|
+
if (!this._hasFocusedChip()) {
|
|
905
|
+
this._keyManager.setActiveItem(-1);
|
|
906
|
+
}
|
|
907
|
+
if (!this.disabled) {
|
|
908
|
+
if (this._chipInput) {
|
|
909
|
+
// If there's a chip input, we should check whether the focus moved to chip input.
|
|
910
|
+
// If the focus is not moved to chip input, mark the field as touched. If the focus moved
|
|
911
|
+
// to chip input, do nothing.
|
|
912
|
+
// Timeout is needed to wait for the focus() event trigger on chip input.
|
|
913
|
+
setTimeout(() => {
|
|
914
|
+
if (!this.focused) {
|
|
915
|
+
this._markAsTouched();
|
|
874
916
|
}
|
|
875
917
|
});
|
|
876
|
-
this.stateChanges.next();
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
/** Emits change event to set the model value. */
|
|
880
|
-
_propagateChanges(fallbackValue) {
|
|
881
|
-
let valueToEmit = null;
|
|
882
|
-
if (Array.isArray(this.selected)) {
|
|
883
|
-
valueToEmit = this.selected.map(chip => chip.value);
|
|
884
918
|
}
|
|
885
919
|
else {
|
|
886
|
-
|
|
920
|
+
// If there's no chip input, then mark the field as touched.
|
|
921
|
+
this._markAsTouched();
|
|
887
922
|
}
|
|
888
|
-
this._value = valueToEmit;
|
|
889
|
-
this.change.emit(new MatChipListChange(this, valueToEmit));
|
|
890
|
-
this.valueChange.emit(valueToEmit);
|
|
891
|
-
this._onChange(valueToEmit);
|
|
892
|
-
this._changeDetectorRef.markForCheck();
|
|
893
923
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
this._markAsTouched();
|
|
914
|
-
}
|
|
915
|
-
}
|
|
924
|
+
}
|
|
925
|
+
/** Mark the field as touched */
|
|
926
|
+
_markAsTouched() {
|
|
927
|
+
this._onTouched();
|
|
928
|
+
this._changeDetectorRef.markForCheck();
|
|
929
|
+
this.stateChanges.next();
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Removes the `tabindex` from the chip list and resets it back afterwards, allowing the
|
|
933
|
+
* user to tab out of it. This prevents the list from capturing focus and redirecting
|
|
934
|
+
* it back to the first chip, creating a focus trap, if it user tries to tab away.
|
|
935
|
+
*/
|
|
936
|
+
_allowFocusEscape() {
|
|
937
|
+
if (this._tabIndex !== -1) {
|
|
938
|
+
this._tabIndex = -1;
|
|
939
|
+
setTimeout(() => {
|
|
940
|
+
this._tabIndex = this._userTabIndex || 0;
|
|
941
|
+
this._changeDetectorRef.markForCheck();
|
|
942
|
+
});
|
|
916
943
|
}
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
944
|
+
}
|
|
945
|
+
_resetChips() {
|
|
946
|
+
this._dropSubscriptions();
|
|
947
|
+
this._listenToChipsFocus();
|
|
948
|
+
this._listenToChipsSelection();
|
|
949
|
+
this._listenToChipsRemoved();
|
|
950
|
+
}
|
|
951
|
+
_dropSubscriptions() {
|
|
952
|
+
if (this._chipFocusSubscription) {
|
|
953
|
+
this._chipFocusSubscription.unsubscribe();
|
|
954
|
+
this._chipFocusSubscription = null;
|
|
922
955
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
* it back to the first chip, creating a focus trap, if it user tries to tab away.
|
|
927
|
-
*/
|
|
928
|
-
_allowFocusEscape() {
|
|
929
|
-
if (this._tabIndex !== -1) {
|
|
930
|
-
this._tabIndex = -1;
|
|
931
|
-
setTimeout(() => {
|
|
932
|
-
this._tabIndex = this._userTabIndex || 0;
|
|
933
|
-
this._changeDetectorRef.markForCheck();
|
|
934
|
-
});
|
|
935
|
-
}
|
|
956
|
+
if (this._chipBlurSubscription) {
|
|
957
|
+
this._chipBlurSubscription.unsubscribe();
|
|
958
|
+
this._chipBlurSubscription = null;
|
|
936
959
|
}
|
|
937
|
-
|
|
938
|
-
this.
|
|
939
|
-
this.
|
|
940
|
-
this._listenToChipsSelection();
|
|
941
|
-
this._listenToChipsRemoved();
|
|
960
|
+
if (this._chipSelectionSubscription) {
|
|
961
|
+
this._chipSelectionSubscription.unsubscribe();
|
|
962
|
+
this._chipSelectionSubscription = null;
|
|
942
963
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
964
|
+
if (this._chipRemoveSubscription) {
|
|
965
|
+
this._chipRemoveSubscription.unsubscribe();
|
|
966
|
+
this._chipRemoveSubscription = null;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
/** Listens to user-generated selection events on each chip. */
|
|
970
|
+
_listenToChipsSelection() {
|
|
971
|
+
this._chipSelectionSubscription = this.chipSelectionChanges.subscribe(event => {
|
|
972
|
+
event.source.selected
|
|
973
|
+
? this._selectionModel.select(event.source)
|
|
974
|
+
: this._selectionModel.deselect(event.source);
|
|
975
|
+
// For single selection chip list, make sure the deselected value is unselected.
|
|
976
|
+
if (!this.multiple) {
|
|
977
|
+
this.chips.forEach(chip => {
|
|
978
|
+
if (!this._selectionModel.isSelected(chip) && chip.selected) {
|
|
979
|
+
chip.deselect();
|
|
980
|
+
}
|
|
981
|
+
});
|
|
947
982
|
}
|
|
948
|
-
if (
|
|
949
|
-
this.
|
|
950
|
-
this._chipBlurSubscription = null;
|
|
983
|
+
if (event.isUserInput) {
|
|
984
|
+
this._propagateChanges();
|
|
951
985
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
/** Listens to user-generated selection events on each chip. */
|
|
989
|
+
_listenToChipsFocus() {
|
|
990
|
+
this._chipFocusSubscription = this.chipFocusChanges.subscribe(event => {
|
|
991
|
+
let chipIndex = this.chips.toArray().indexOf(event.chip);
|
|
992
|
+
if (this._isValidIndex(chipIndex)) {
|
|
993
|
+
this._keyManager.updateActiveItem(chipIndex);
|
|
955
994
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
995
|
+
this.stateChanges.next();
|
|
996
|
+
});
|
|
997
|
+
this._chipBlurSubscription = this.chipBlurChanges.subscribe(() => {
|
|
998
|
+
this._blur();
|
|
999
|
+
this.stateChanges.next();
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
_listenToChipsRemoved() {
|
|
1003
|
+
this._chipRemoveSubscription = this.chipRemoveChanges.subscribe(event => {
|
|
1004
|
+
const chip = event.chip;
|
|
1005
|
+
const chipIndex = this.chips.toArray().indexOf(event.chip);
|
|
1006
|
+
// In case the chip that will be removed is currently focused, we temporarily store
|
|
1007
|
+
// the index in order to be able to determine an appropriate sibling chip that will
|
|
1008
|
+
// receive focus.
|
|
1009
|
+
if (this._isValidIndex(chipIndex) && chip._hasFocus) {
|
|
1010
|
+
this._lastDestroyedChipIndex = chipIndex;
|
|
959
1011
|
}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
if (!this.multiple) {
|
|
969
|
-
this.chips.forEach(chip => {
|
|
970
|
-
if (!this._selectionModel.isSelected(chip) && chip.selected) {
|
|
971
|
-
chip.deselect();
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
|
-
if (event.isUserInput) {
|
|
976
|
-
this._propagateChanges();
|
|
977
|
-
}
|
|
978
|
-
});
|
|
979
|
-
}
|
|
980
|
-
/** Listens to user-generated selection events on each chip. */
|
|
981
|
-
_listenToChipsFocus() {
|
|
982
|
-
this._chipFocusSubscription = this.chipFocusChanges.subscribe(event => {
|
|
983
|
-
let chipIndex = this.chips.toArray().indexOf(event.chip);
|
|
984
|
-
if (this._isValidIndex(chipIndex)) {
|
|
985
|
-
this._keyManager.updateActiveItem(chipIndex);
|
|
986
|
-
}
|
|
987
|
-
this.stateChanges.next();
|
|
988
|
-
});
|
|
989
|
-
this._chipBlurSubscription = this.chipBlurChanges.subscribe(() => {
|
|
990
|
-
this._blur();
|
|
991
|
-
this.stateChanges.next();
|
|
992
|
-
});
|
|
993
|
-
}
|
|
994
|
-
_listenToChipsRemoved() {
|
|
995
|
-
this._chipRemoveSubscription = this.chipRemoveChanges.subscribe(event => {
|
|
996
|
-
const chip = event.chip;
|
|
997
|
-
const chipIndex = this.chips.toArray().indexOf(event.chip);
|
|
998
|
-
// In case the chip that will be removed is currently focused, we temporarily store
|
|
999
|
-
// the index in order to be able to determine an appropriate sibling chip that will
|
|
1000
|
-
// receive focus.
|
|
1001
|
-
if (this._isValidIndex(chipIndex) && chip._hasFocus) {
|
|
1002
|
-
this._lastDestroyedChipIndex = chipIndex;
|
|
1003
|
-
}
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
/** Checks whether an event comes from inside a chip element. */
|
|
1007
|
-
_originatesFromChip(event) {
|
|
1008
|
-
let currentElement = event.target;
|
|
1009
|
-
while (currentElement && currentElement !== this._elementRef.nativeElement) {
|
|
1010
|
-
if (currentElement.classList.contains('mat-chip')) {
|
|
1011
|
-
return true;
|
|
1012
|
-
}
|
|
1013
|
-
currentElement = currentElement.parentElement;
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
/** Checks whether an event comes from inside a chip element. */
|
|
1015
|
+
_originatesFromChip(event) {
|
|
1016
|
+
let currentElement = event.target;
|
|
1017
|
+
while (currentElement && currentElement !== this._elementRef.nativeElement) {
|
|
1018
|
+
if (currentElement.classList.contains('mat-chip')) {
|
|
1019
|
+
return true;
|
|
1014
1020
|
}
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
/** Checks whether any of the chips is focused. */
|
|
1018
|
-
_hasFocusedChip() {
|
|
1019
|
-
return this.chips.some(chip => chip._hasFocus);
|
|
1021
|
+
currentElement = currentElement.parentElement;
|
|
1020
1022
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1023
|
+
return false;
|
|
1024
|
+
}
|
|
1025
|
+
/** Checks whether any of the chips is focused. */
|
|
1026
|
+
_hasFocusedChip() {
|
|
1027
|
+
return this.chips && this.chips.some(chip => chip._hasFocus);
|
|
1028
|
+
}
|
|
1029
|
+
/** Syncs the list's state with the individual chips. */
|
|
1030
|
+
_syncChipsState() {
|
|
1031
|
+
if (this.chips) {
|
|
1032
|
+
this.chips.forEach(chip => {
|
|
1033
|
+
chip._chipListDisabled = this._disabled;
|
|
1034
|
+
chip._chipListMultiple = this.multiple;
|
|
1035
|
+
});
|
|
1029
1036
|
}
|
|
1030
1037
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
},] }
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
]
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
})();
|
|
1038
|
+
}
|
|
1039
|
+
MatChipList.decorators = [
|
|
1040
|
+
{ type: Component, args: [{
|
|
1041
|
+
selector: 'mat-chip-list',
|
|
1042
|
+
template: `<div class="mat-chip-list-wrapper"><ng-content></ng-content></div>`,
|
|
1043
|
+
exportAs: 'matChipList',
|
|
1044
|
+
host: {
|
|
1045
|
+
'[attr.tabindex]': 'disabled ? null : _tabIndex',
|
|
1046
|
+
'[attr.aria-describedby]': '_ariaDescribedby || null',
|
|
1047
|
+
'[attr.aria-required]': 'role ? required : null',
|
|
1048
|
+
'[attr.aria-disabled]': 'disabled.toString()',
|
|
1049
|
+
'[attr.aria-invalid]': 'errorState',
|
|
1050
|
+
'[attr.aria-multiselectable]': 'multiple',
|
|
1051
|
+
'[attr.role]': 'role',
|
|
1052
|
+
'[class.mat-chip-list-disabled]': 'disabled',
|
|
1053
|
+
'[class.mat-chip-list-invalid]': 'errorState',
|
|
1054
|
+
'[class.mat-chip-list-required]': 'required',
|
|
1055
|
+
'[attr.aria-orientation]': 'ariaOrientation',
|
|
1056
|
+
'class': 'mat-chip-list',
|
|
1057
|
+
'(focus)': 'focus()',
|
|
1058
|
+
'(blur)': '_blur()',
|
|
1059
|
+
'(keydown)': '_keydown($event)',
|
|
1060
|
+
'[id]': '_uid',
|
|
1061
|
+
},
|
|
1062
|
+
providers: [{ provide: MatFormFieldControl, useExisting: MatChipList }],
|
|
1063
|
+
encapsulation: ViewEncapsulation.None,
|
|
1064
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1065
|
+
styles: [".mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:\"\";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n"]
|
|
1066
|
+
},] }
|
|
1067
|
+
];
|
|
1068
|
+
MatChipList.ctorParameters = () => [
|
|
1069
|
+
{ type: ElementRef },
|
|
1070
|
+
{ type: ChangeDetectorRef },
|
|
1071
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1072
|
+
{ type: NgForm, decorators: [{ type: Optional }] },
|
|
1073
|
+
{ type: FormGroupDirective, decorators: [{ type: Optional }] },
|
|
1074
|
+
{ type: ErrorStateMatcher },
|
|
1075
|
+
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }] }
|
|
1076
|
+
];
|
|
1077
|
+
MatChipList.propDecorators = {
|
|
1078
|
+
errorStateMatcher: [{ type: Input }],
|
|
1079
|
+
multiple: [{ type: Input }],
|
|
1080
|
+
compareWith: [{ type: Input }],
|
|
1081
|
+
value: [{ type: Input }],
|
|
1082
|
+
required: [{ type: Input }],
|
|
1083
|
+
placeholder: [{ type: Input }],
|
|
1084
|
+
disabled: [{ type: Input }],
|
|
1085
|
+
ariaOrientation: [{ type: Input, args: ['aria-orientation',] }],
|
|
1086
|
+
selectable: [{ type: Input }],
|
|
1087
|
+
tabIndex: [{ type: Input }],
|
|
1088
|
+
change: [{ type: Output }],
|
|
1089
|
+
valueChange: [{ type: Output }],
|
|
1090
|
+
chips: [{ type: ContentChildren, args: [MatChip, {
|
|
1091
|
+
// We need to use `descendants: true`, because Ivy will no longer match
|
|
1092
|
+
// indirect descendants if it's left as false.
|
|
1093
|
+
descendants: true
|
|
1094
|
+
},] }]
|
|
1095
|
+
};
|
|
1090
1096
|
|
|
1091
1097
|
/**
|
|
1092
1098
|
* @license
|
|
@@ -1101,137 +1107,134 @@ let nextUniqueId$1 = 0;
|
|
|
1101
1107
|
* Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.
|
|
1102
1108
|
* May be placed inside or outside of an `<mat-chip-list>`.
|
|
1103
1109
|
*/
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
this._addOnBlur = false;
|
|
1112
|
-
/**
|
|
1113
|
-
* The list of key codes that will trigger a chipEnd event.
|
|
1114
|
-
*
|
|
1115
|
-
* Defaults to `[ENTER]`.
|
|
1116
|
-
*/
|
|
1117
|
-
this.separatorKeyCodes = this._defaultOptions.separatorKeyCodes;
|
|
1118
|
-
/** Emitted when a chip is to be added. */
|
|
1119
|
-
this.chipEnd = new EventEmitter();
|
|
1120
|
-
/** The input's placeholder text. */
|
|
1121
|
-
this.placeholder = '';
|
|
1122
|
-
/** Unique id for the input. */
|
|
1123
|
-
this.id = `mat-chip-list-input-${nextUniqueId$1++}`;
|
|
1124
|
-
this._disabled = false;
|
|
1125
|
-
this._inputElement = this._elementRef.nativeElement;
|
|
1126
|
-
}
|
|
1127
|
-
/** Register input for chip list */
|
|
1128
|
-
set chipList(value) {
|
|
1129
|
-
if (value) {
|
|
1130
|
-
this._chipList = value;
|
|
1131
|
-
this._chipList.registerInput(this);
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1110
|
+
class MatChipInput {
|
|
1111
|
+
constructor(_elementRef, _defaultOptions) {
|
|
1112
|
+
this._elementRef = _elementRef;
|
|
1113
|
+
this._defaultOptions = _defaultOptions;
|
|
1114
|
+
/** Whether the control is focused. */
|
|
1115
|
+
this.focused = false;
|
|
1116
|
+
this._addOnBlur = false;
|
|
1134
1117
|
/**
|
|
1135
|
-
*
|
|
1118
|
+
* The list of key codes that will trigger a chipEnd event.
|
|
1119
|
+
*
|
|
1120
|
+
* Defaults to `[ENTER]`.
|
|
1136
1121
|
*/
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
/**
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
this._chipList._allowFocusEscape();
|
|
1153
|
-
}
|
|
1154
|
-
this._emitChipEnd(event);
|
|
1122
|
+
this.separatorKeyCodes = this._defaultOptions.separatorKeyCodes;
|
|
1123
|
+
/** Emitted when a chip is to be added. */
|
|
1124
|
+
this.chipEnd = new EventEmitter();
|
|
1125
|
+
/** The input's placeholder text. */
|
|
1126
|
+
this.placeholder = '';
|
|
1127
|
+
/** Unique id for the input. */
|
|
1128
|
+
this.id = `mat-chip-list-input-${nextUniqueId$1++}`;
|
|
1129
|
+
this._disabled = false;
|
|
1130
|
+
this._inputElement = this._elementRef.nativeElement;
|
|
1131
|
+
}
|
|
1132
|
+
/** Register input for chip list */
|
|
1133
|
+
set chipList(value) {
|
|
1134
|
+
if (value) {
|
|
1135
|
+
this._chipList = value;
|
|
1136
|
+
this._chipList.registerInput(this);
|
|
1155
1137
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Whether or not the chipEnd event will be emitted when the input is blurred.
|
|
1141
|
+
*/
|
|
1142
|
+
get addOnBlur() { return this._addOnBlur; }
|
|
1143
|
+
set addOnBlur(value) { this._addOnBlur = coerceBooleanProperty(value); }
|
|
1144
|
+
/** Whether the input is disabled. */
|
|
1145
|
+
get disabled() { return this._disabled || (this._chipList && this._chipList.disabled); }
|
|
1146
|
+
set disabled(value) { this._disabled = coerceBooleanProperty(value); }
|
|
1147
|
+
/** Whether the input is empty. */
|
|
1148
|
+
get empty() { return !this._inputElement.value; }
|
|
1149
|
+
ngOnChanges() {
|
|
1150
|
+
this._chipList.stateChanges.next();
|
|
1151
|
+
}
|
|
1152
|
+
/** Utility method to make host definition/tests more clear. */
|
|
1153
|
+
_keydown(event) {
|
|
1154
|
+
// Allow the user's focus to escape when they're tabbing forward. Note that we don't
|
|
1155
|
+
// want to do this when going backwards, because focus should go back to the first chip.
|
|
1156
|
+
if (event && event.keyCode === TAB && !hasModifierKey(event, 'shiftKey')) {
|
|
1157
|
+
this._chipList._allowFocusEscape();
|
|
1158
|
+
}
|
|
1159
|
+
this._emitChipEnd(event);
|
|
1160
|
+
}
|
|
1161
|
+
/** Checks to see if the blur should emit the (chipEnd) event. */
|
|
1162
|
+
_blur() {
|
|
1163
|
+
if (this.addOnBlur) {
|
|
1164
|
+
this._emitChipEnd();
|
|
1167
1165
|
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1166
|
+
this.focused = false;
|
|
1167
|
+
// Blur the chip list if it is not focused
|
|
1168
|
+
if (!this._chipList.focused) {
|
|
1169
|
+
this._chipList._blur();
|
|
1171
1170
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1171
|
+
this._chipList.stateChanges.next();
|
|
1172
|
+
}
|
|
1173
|
+
_focus() {
|
|
1174
|
+
this.focused = true;
|
|
1175
|
+
this._chipList.stateChanges.next();
|
|
1176
|
+
}
|
|
1177
|
+
/** Checks to see if the (chipEnd) event needs to be emitted. */
|
|
1178
|
+
_emitChipEnd(event) {
|
|
1179
|
+
if (!this._inputElement.value && !!event) {
|
|
1180
|
+
this._chipList._keydown(event);
|
|
1181
|
+
}
|
|
1182
|
+
if (!event || this._isSeparatorKey(event)) {
|
|
1183
|
+
this.chipEnd.emit({ input: this._inputElement, value: this._inputElement.value });
|
|
1184
|
+
if (event) {
|
|
1185
|
+
event.preventDefault();
|
|
1182
1186
|
}
|
|
1183
1187
|
}
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
const separators = this.separatorKeyCodes;
|
|
1198
|
-
const keyCode = event.keyCode;
|
|
1199
|
-
return Array.isArray(separators) ? separators.indexOf(keyCode) > -1 : separators.has(keyCode);
|
|
1188
|
+
}
|
|
1189
|
+
_onInput() {
|
|
1190
|
+
// Let chip list know whenever the value changes.
|
|
1191
|
+
this._chipList.stateChanges.next();
|
|
1192
|
+
}
|
|
1193
|
+
/** Focuses the input. */
|
|
1194
|
+
focus(options) {
|
|
1195
|
+
this._inputElement.focus(options);
|
|
1196
|
+
}
|
|
1197
|
+
/** Checks whether a keycode is one of the configured separators. */
|
|
1198
|
+
_isSeparatorKey(event) {
|
|
1199
|
+
if (hasModifierKey(event)) {
|
|
1200
|
+
return false;
|
|
1200
1201
|
}
|
|
1202
|
+
const separators = this.separatorKeyCodes;
|
|
1203
|
+
const keyCode = event.keyCode;
|
|
1204
|
+
return Array.isArray(separators) ? separators.indexOf(keyCode) > -1 : separators.has(keyCode);
|
|
1201
1205
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
]
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
})();
|
|
1206
|
+
}
|
|
1207
|
+
MatChipInput.decorators = [
|
|
1208
|
+
{ type: Directive, args: [{
|
|
1209
|
+
selector: 'input[matChipInputFor]',
|
|
1210
|
+
exportAs: 'matChipInput, matChipInputFor',
|
|
1211
|
+
host: {
|
|
1212
|
+
'class': 'mat-chip-input mat-input-element',
|
|
1213
|
+
'(keydown)': '_keydown($event)',
|
|
1214
|
+
'(blur)': '_blur()',
|
|
1215
|
+
'(focus)': '_focus()',
|
|
1216
|
+
'(input)': '_onInput()',
|
|
1217
|
+
'[id]': 'id',
|
|
1218
|
+
'[attr.disabled]': 'disabled || null',
|
|
1219
|
+
'[attr.placeholder]': 'placeholder || null',
|
|
1220
|
+
'[attr.aria-invalid]': '_chipList && _chipList.ngControl ? _chipList.ngControl.invalid : null',
|
|
1221
|
+
'[attr.aria-required]': '_chipList && _chipList.required || null',
|
|
1222
|
+
}
|
|
1223
|
+
},] }
|
|
1224
|
+
];
|
|
1225
|
+
MatChipInput.ctorParameters = () => [
|
|
1226
|
+
{ type: ElementRef },
|
|
1227
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_CHIPS_DEFAULT_OPTIONS,] }] }
|
|
1228
|
+
];
|
|
1229
|
+
MatChipInput.propDecorators = {
|
|
1230
|
+
chipList: [{ type: Input, args: ['matChipInputFor',] }],
|
|
1231
|
+
addOnBlur: [{ type: Input, args: ['matChipInputAddOnBlur',] }],
|
|
1232
|
+
separatorKeyCodes: [{ type: Input, args: ['matChipInputSeparatorKeyCodes',] }],
|
|
1233
|
+
chipEnd: [{ type: Output, args: ['matChipInputTokenEnd',] }],
|
|
1234
|
+
placeholder: [{ type: Input }],
|
|
1235
|
+
id: [{ type: Input }],
|
|
1236
|
+
disabled: [{ type: Input }]
|
|
1237
|
+
};
|
|
1235
1238
|
|
|
1236
1239
|
/**
|
|
1237
1240
|
* @license
|
|
@@ -1251,24 +1254,21 @@ const CHIP_DECLARATIONS = [
|
|
|
1251
1254
|
const ɵ0 = {
|
|
1252
1255
|
separatorKeyCodes: [ENTER]
|
|
1253
1256
|
};
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
];
|
|
1270
|
-
return MatChipsModule;
|
|
1271
|
-
})();
|
|
1257
|
+
class MatChipsModule {
|
|
1258
|
+
}
|
|
1259
|
+
MatChipsModule.decorators = [
|
|
1260
|
+
{ type: NgModule, args: [{
|
|
1261
|
+
exports: CHIP_DECLARATIONS,
|
|
1262
|
+
declarations: CHIP_DECLARATIONS,
|
|
1263
|
+
providers: [
|
|
1264
|
+
ErrorStateMatcher,
|
|
1265
|
+
{
|
|
1266
|
+
provide: MAT_CHIPS_DEFAULT_OPTIONS,
|
|
1267
|
+
useValue: ɵ0
|
|
1268
|
+
}
|
|
1269
|
+
]
|
|
1270
|
+
},] }
|
|
1271
|
+
];
|
|
1272
1272
|
|
|
1273
1273
|
/**
|
|
1274
1274
|
* @license
|
|
@@ -1282,5 +1282,5 @@ let MatChipsModule = /** @class */ (() => {
|
|
|
1282
1282
|
* Generated bundle index. Do not edit.
|
|
1283
1283
|
*/
|
|
1284
1284
|
|
|
1285
|
-
export { MAT_CHIPS_DEFAULT_OPTIONS, MatChip, MatChipAvatar, MatChipInput, MatChipList, MatChipListChange, MatChipRemove, MatChipSelectionChange, MatChipTrailingIcon, MatChipsModule, ɵ0 };
|
|
1285
|
+
export { MAT_CHIPS_DEFAULT_OPTIONS, MAT_CHIP_AVATAR, MAT_CHIP_REMOVE, MAT_CHIP_TRAILING_ICON, MatChip, MatChipAvatar, MatChipInput, MatChipList, MatChipListChange, MatChipRemove, MatChipSelectionChange, MatChipTrailingIcon, MatChipsModule, ɵ0 };
|
|
1286
1286
|
//# sourceMappingURL=chips.js.map
|