/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/material/chips/tokens.ts
73 строки
3 KB
Matthieu Riegler
Set generic on some `InjectionToken`. (#32753)
04 апр 2026, 09:10
Не верифицирован
04 апр 2026, 09:10
8d5a896
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ENTER, ModifierKey} from '@angular/cdk/keycodes'; import {InjectionToken} from '@angular/core'; import type {MatChip} from './chip'; /** Key that can be used as a separator between chips. */ export interface SeparatorKey { keyCode: number; modifiers: readonly ModifierKey[]; } /** Default options, for the chips module, that can be overridden. */ export interface MatChipsDefaultOptions { /** The list of key codes that will trigger a chipEnd event. */ separatorKeyCodes: readonly (number | SeparatorKey)[] | ReadonlySet<number | SeparatorKey>; /** Whether icon indicators should be hidden for single-selection. */ hideSingleSelectionIndicator?: boolean; /** Whether the chip input should be interactive while disabled by default. */ inputDisabledInteractive?: boolean; } /** Injection token to be used to override the default options for the chips module. */ export const MAT_CHIPS_DEFAULT_OPTIONS = new InjectionToken<MatChipsDefaultOptions>( 'mat-chips-default-options', { providedIn: 'root', factory: () => ({ separatorKeyCodes: [ENTER], }), }, ); /** * Injection token that can be used to reference instances of `MatChipAvatar`. It serves as * alternative token to the actual `MatChipAvatar` class which could cause unnecessary * retention of the class and its directive metadata. */ export const MAT_CHIP_AVATAR = new InjectionToken('MatChipAvatar'); /** * Injection token that can be used to reference instances of `MatChipTrailingIcon`. It serves as * alternative token to the actual `MatChipTrailingIcon` class which could cause unnecessary * retention of the class and its directive metadata. */ export const MAT_CHIP_TRAILING_ICON = new InjectionToken('MatChipTrailingIcon'); /** * Injection token that can be used to reference instances of `MatChipEdit`. It serves as * alternative token to the actual `MatChipEdit` class which could cause unnecessary * retention of the class and its directive metadata. */ export const MAT_CHIP_EDIT = new InjectionToken('MatChipEdit'); /** * Injection token that can be used to reference instances of `MatChipRemove`. It serves as * alternative token to the actual `MatChipRemove` class which could cause unnecessary * retention of the class and its directive metadata. */ export const MAT_CHIP_REMOVE = new InjectionToken('MatChipRemove'); /** * Injection token used to avoid a circular dependency between the `MatChip` and `MatChipAction`. */ export const MAT_CHIP = new InjectionToken<MatChip>('MatChip');